main.js.bak 2.5 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. !function() {
  5. "use strict";
  6. function t(t, i) {
  7. return typeof t === i
  8. }
  9. function i(t, i) {
  10. return t instanceof i
  11. }
  12. function n(t) {
  13. return t && t.nodeType
  14. }
  15. function e(t) {
  16. return n(t) ? t : i(t, g) ? t[0] : void 0
  17. }
  18. function o(t, i, n) {
  19. return g.each(t, function(t, e) {
  20. n = i.call(e, n, t, e)
  21. }),
  22. n
  23. }
  24. function r(t, i, n) {
  25. var e, o, r;
  26. if (t === i)
  27. return !0;
  28. if (!t || !i || t.constructor !== i.constructor)
  29. return !1;
  30. for (e = 0,
  31. o = n.length; o > e; e += 1) {
  32. if (r = n[e],
  33. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  34. return !1;
  35. if (t[r] !== i[r])
  36. return !1
  37. }
  38. return !0
  39. }
  40. function s(t, i, n, e) {
  41. this.left = E(t),
  42. this.top = E(i),
  43. this.width = E(n),
  44. this.height = E(e),
  45. this.right = this.left + this.width,
  46. this.bottom = this.top + this.height
  47. }
  48. function h(t, i, n, e) {
  49. this.visible = t || 0,
  50. this.viewport = i || 0,
  51. this.possible = n || 0,
  52. this.rects = e && T({}, e) || null
  53. }
  54. function l(t, i) {
  55. this.els = t,
  56. this.viewport = i
  57. }
  58. function c(t, i, n) {
  59. var e;
  60. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  61. e ? e[n] : 0
  62. }
  63. function u(t, i) {
  64. return t.val - i.val
  65. }
  66. function a(t, i) {
  67. return i.val - t.val
  68. }
  69. function f(t) {
  70. var i = s.ofContent(t, !0)
  71. , n = s.ofViewport(t, !0)
  72. , e = i.width - n.width
  73. , o = i.height - n.height;
  74. this.content = i,
  75. this.viewport = n,
  76. this.width = 0 >= e ? null : n.left / e,
  77. this.height = 0 >= o ? null : n.top / o,
  78. this.left = n.left,
  79. this.top = n.top,
  80. this.right = i.right - n.right,
  81. this.bottom = i.bottom - n.bottom
  82. }
  83. function p(t) {
  84. this.el = t || window
  85. }
  86. function d(t, i) {
  87. this.context = t,
  88. this.viewport = i,
  89. this.init()
  90. }
  91. function v(t, i, n, e) {
  92. this.context = new l(t,i),
  93. this.property = n,
  94. this.descending = e,
  95. this.init()
  96. }
  97. function w(t) {
  98. t && t !== window && t !== document ? (this.context = t,
  99. this.$autoTarget = g(t)) : this.context = window,
  100. this.init()
  101. }
  102. var g = jQuery
  103. , m = g(window)
  104. , b = g(document)
  105. , T = g.extend
  106. , y = g.isFunction
  107. , k = Math.max
  108. , V = Math.min
  109. , E = Math.round
  110. , x = function() {
  111. var t = {}
  112. , i = 1;
  113. return function(n) {
  114. return n ? (t[n] || (t[n] = i,
  115. i += 1),
  116. t[n]) : 0
  117. }
  118. }();
  119. T(s.prototype, {
  120. equals: function(t) {
  121. return r(this, t, ["left", "top", "width", "height"])
  122. },
  123. area: function() {
  124. return this.width * this.height
  125. },
  126. relativeTo: function(t) {
  127. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  128. },
  129. intersection: function(t) {
  130. if (!i(t, s))
  131. return null;
  132. var n = k(this.left, t.left)
  133. , e = V(this.right, t.right)
  134. , o = k(this.top, t.top)
  135. , r = V(this.bottom, t.bottom)
  136. , h = e - n
  137. , l = r - o;
  138. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  139. },
  140. envelope: function(t) {
  141. if (!i(t, s))
  142. return this;
  143. var n = V(this.left, t.left)
  144. , e = k(this.right, t.right)
  145. , o = V(this.top, t.top)
  146. , r = k(this.bottom, t.bottom)
  147. , h = e - n
  148. , l = r - o;
  149. return new s(n,o,h,l)
  150. }
  151. }),
  152. T(s, {
  153. ofContent: function(t, i) {
  154. return t && t !== document && t !== window ? i ? new s(0,0,t.scrollWidth,t.scrollHeight) : new s(t.offsetLeft - t.scrollLeft,t.offsetTop - t.scrollTop,t.scrollWidth,t.scrollHeight) : new s(0,0,b.width(),b.height())
  155. },
  156. ofViewport: function(t, i) {
  157. return t && t !== document && t !== window ? i ? new s(t.scrollLeft,t.scrollTop,t.clientWidth,t.clientHeight) : new s(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight) : new s(m.scrollLeft(),m.scrollTop(),m.width(),m.height())
  158. },
  159. ofElement: function(t) {
  160. var i = g(t);
  161. if (!i.is(":visible"))
  162. return null;
  163. var n = i.offset();
  164. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  165. }
  166. }),
  167. T(h.prototype, {
  168. equals: function(t) {
  169. return this.fracsEqual(t) && this.rectsEqual(t)
  170. },
  171. fracsEqual: function(t) {
  172. return r(this, t, ["visible", "viewport", "possible"])
  173. },
  174. rectsEqual: function(t) {
  175. return r(this.rects, t.rects, ["document", "element", "viewport"])
  176. }
  177. }),
  178. T(h, {
  179. of: function(t, i) {
  180. var e, o, r;
  181. return t = n(t) && s.ofElement(t) || t,
  182. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  183. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  184. r = V(t.width, i.width) * V(t.height, i.height),
  185. new h(o / t.area(),o / i.area(),o / r,{
  186. document: e,
  187. element: e.relativeTo(t),
  188. viewport: e.relativeTo(i)
  189. })) : new h
  190. }
  191. });
  192. var q = ["width", "height", "left", "right", "top", "bottom"]
  193. , S = ["possible", "visible", "viewport"];
  194. T(l.prototype, {
  195. sorted: function(t, i) {
  196. var n = this.viewport;
  197. return g.map(this.els, function(i) {
  198. return {
  199. el: i,
  200. val: c(i, n, t)
  201. }
  202. }).sort(i ? a : u)
  203. },
  204. best: function(t, i) {
  205. return this.els.length ? this.sorted(t, i)[0] : null
  206. }
  207. }),
  208. T(f.prototype, {
  209. equals: function(t) {
  210. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  211. }
  212. }),
  213. T(p.prototype, {
  214. equals: function(t) {
  215. return r(this, t, ["el"])
  216. },
  217. scrollState: function() {
  218. return new f(this.el)
  219. },
  220. scrollTo: function(t, i, n) {
  221. var e = g(this.el === window ? "html,body" : this.el);
  222. t = t || 0,
  223. i = i || 0,
  224. n = isNaN(n) ? 1e3 : n,
  225. e.stop(!0).animate({
  226. scrollLeft: t,
  227. scrollTop: i
  228. }, n)
  229. },
  230. scroll: function(t, i, n) {
  231. var e = this.el === window ? m : g(this.el);
  232. t = t || 0,
  233. i = i || 0,
  234. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  235. },
  236. scrollToRect: function(t, i, n, e) {
  237. i = i || 0,
  238. n = n || 0,
  239. this.scrollTo(t.left - i, t.top - n, e)
  240. },
  241. scrollToElement: function(t, i, n, e) {
  242. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  243. this.scrollToRect(o, i, n, e)
  244. }
  245. });
  246. var C = {
  247. init: function() {
  248. this.callbacks = g.Callbacks("memory unique"),
  249. this.currVal = null,
  250. this.prevVal = null,
  251. this.checkProxy = g.proxy(this.check, this),
  252. this.autoCheck()
  253. },
  254. bind: function(t) {
  255. this.callbacks.add(t)
  256. },
  257. unbind: function(t) {
  258. t ? this.callbacks.remove(t) : this.callbacks.empty()
  259. },
  260. trigger: function() {
  261. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  262. },
  263. check: function(t) {
  264. var i = this.updatedValue(t);
  265. return void 0 !== i && (this.prevVal = this.currVal,
  266. this.currVal = i,
  267. this.trigger(),
  268. !0)
  269. },
  270. $autoTarget: m,
  271. autoEvents: "load resize scroll",
  272. autoCheck: function(t) {
  273. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  274. }
  275. };
  276. T(d.prototype, C, {
  277. updatedValue: function() {
  278. var t = h.of(this.context, this.viewport);
  279. return this.currVal && this.currVal.equals(t) ? void 0 : t
  280. }
  281. }),
  282. T(v.prototype, C, {
  283. updatedValue: function() {
  284. var t = this.context.best(this.property, this.descending);
  285. return t && (t = t.val > 0 ? t.el : null,
  286. this.currVal !== t) ? t : void 0
  287. }
  288. }),
  289. T(w.prototype, C, {
  290. updatedValue: function() {
  291. var t = new f(this.context);
  292. return this.currVal && this.currVal.equals(t) ? void 0 : t
  293. }
  294. });
  295. var L = function(t, i) {
  296. var n = [].slice
  297. , e = jQuery
  298. , o = e.extend
  299. , r = e.isFunction
  300. , s = o({}, i)
  301. , h = function(i, n, o, s) {
  302. return o = r(o) ? o.apply(i, n) : o,
  303. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  304. }
  305. , l = function() {
  306. return h(this, n.call(arguments), s.defaultStatic, l)
  307. }
  308. , c = function(t) {
  309. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  310. }
  311. , u = function(t) {
  312. t && (o(l, t.statics),
  313. o(c, t.methods)),
  314. l.modplug = u
  315. };
  316. u.prev = {
  317. statics: e[t],
  318. methods: e.fn[t]
  319. },
  320. u(i),
  321. e[t] = l,
  322. e.fn[t] = c
  323. }
  324. , M = "fracs";
  325. L(M, {
  326. statics: {
  327. version: "0.15.0",
  328. Rect: s,
  329. Fractions: h,
  330. Group: l,
  331. ScrollState: f,
  332. Viewport: p,
  333. FracsCallbacks: d,
  334. GroupCallbacks: v,
  335. ScrollStateCallbacks: w,
  336. fracs: function(t, i) {
  337. return h.of(t, i)
  338. }
  339. },
  340. methods: {
  341. content: function(t) {
  342. return this.length ? s.ofContent(this[0], t) : null
  343. },
  344. envelope: function() {
  345. return o(this, function(t) {
  346. var i = s.ofElement(this);
  347. return t ? t.envelope(i) : i
  348. })
  349. },
  350. fracs: function(i, n, o) {
  351. t(i, "string") || (o = n,
  352. n = i,
  353. i = null),
  354. y(n) || (o = n,
  355. n = null),
  356. o = e(o);
  357. var r = M + ".fracs." + x(o);
  358. return "unbind" === i ? this.each(function() {
  359. var t = g(this).data(r);
  360. t && t.unbind(n)
  361. }) : "check" === i ? this.each(function() {
  362. var t = g(this).data(r);
  363. t && t.check()
  364. }) : y(n) ? this.each(function() {
  365. var t = g(this)
  366. , i = t.data(r);
  367. i || (i = new d(this,o),
  368. t.data(r, i)),
  369. i.bind(n)
  370. }) : this.length ? h.of(this[0], o) : null
  371. },
  372. intersection: function() {
  373. return o(this, function(t) {
  374. var i = s.ofElement(this);
  375. return t ? t.intersection(i) : i
  376. })
  377. },
  378. max: function(t, i, n) {
  379. return y(i) || (n = i,
  380. i = null),
  381. n = e(n),
  382. i ? (new v(this,n,t,!0).bind(i),
  383. this) : this.pushStack(new l(this,n).best(t, !0).el)
  384. },
  385. min: function(t, i, n) {
  386. return y(i) || (n = i,
  387. i = null),
  388. n = e(n),
  389. i ? (new v(this,n,t).bind(i),
  390. this) : this.pushStack(new l(this,n).best(t).el)
  391. },
  392. rect: function() {
  393. return this.length ? s.ofElement(this[0]) : null
  394. },
  395. scrollState: function(i, n) {
  396. var e = M + ".scrollState";
  397. return t(i, "string") || (n = i,
  398. i = null),
  399. "unbind" === i ? this.each(function() {
  400. var t = g(this).data(e);
  401. t && t.unbind(n)
  402. }) : "check" === i ? this.each(function() {
  403. var t = g(this).data(e);
  404. t && t.check()
  405. }) : y(n) ? this.each(function() {
  406. var t = g(this)
  407. , i = t.data(e);
  408. i || (i = new w(this),
  409. t.data(e, i)),
  410. i.bind(n)
  411. }) : this.length ? new f(this[0]) : null
  412. },
  413. scroll: function(t, i, n) {
  414. return this.each(function() {
  415. new p(this).scroll(t, i, n)
  416. })
  417. },
  418. scrollTo: function(t, i, n, o) {
  419. return g.isNumeric(t) && (o = n,
  420. n = i,
  421. i = t,
  422. t = null),
  423. t = e(t),
  424. this.each(function() {
  425. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  426. })
  427. },
  428. scrollToThis: function(t, i, n, o) {
  429. return o = new p(e(o)),
  430. o.scrollToElement(this[0], t, i, n),
  431. this
  432. },
  433. softLink: function(t, i, n, o) {
  434. return o = new p(e(o)),
  435. this.filter("a[href^=#]").each(function() {
  436. var e = g(this);
  437. e.on("click", function() {
  438. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  439. })
  440. })
  441. },
  442. sort: function(i, n, o) {
  443. return t(n, "boolean") || (o = n,
  444. n = null),
  445. o = e(o),
  446. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  447. return t.el
  448. }))
  449. },
  450. viewport: function(t) {
  451. return this.length ? s.ofViewport(this[0], t) : null
  452. }
  453. },
  454. defaultStatic: "fracs",
  455. defaultMethod: "fracs"
  456. })
  457. }();
  458. if ("undefined" == typeof jQuery)
  459. throw new Error("Bootstrap's JavaScript requires jQuery");
  460. +function(t) {
  461. "use strict";
  462. function e(e) {
  463. return this.each(function() {
  464. var o = t(this)
  465. , s = o.data("bs.tooltip")
  466. , n = "object" == typeof e && e;
  467. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  468. "string" == typeof e && s[e]())
  469. })
  470. }
  471. var i = function(t, e) {
  472. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  473. this.init("tooltip", t, e)
  474. };
  475. i.VERSION = "3.2.0",
  476. i.DEFAULTS = {
  477. animation: !0,
  478. placement: "top",
  479. selector: !1,
  480. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  481. trigger: "hover focus",
  482. title: "",
  483. delay: 0,
  484. html: !1,
  485. container: !1,
  486. viewport: {
  487. selector: "body",
  488. padding: 0
  489. }
  490. },
  491. i.prototype.init = function(e, i, o) {
  492. this.enabled = !0,
  493. this.type = e,
  494. this.$element = t(i),
  495. this.options = this.getOptions(o),
  496. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  497. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  498. var r = s[n];
  499. if ("click" == r)
  500. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  501. else if ("manual" != r) {
  502. var a = "hover" == r ? "mouseenter" : "focusin"
  503. , l = "hover" == r ? "mouseleave" : "focusout";
  504. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  505. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  506. }
  507. }
  508. this.options.selector ? this._options = t.extend({}, this.options, {
  509. trigger: "manual",
  510. selector: ""
  511. }) : this.fixTitle()
  512. }
  513. ,
  514. i.prototype.getDefaults = function() {
  515. return i.DEFAULTS
  516. }
  517. ,
  518. i.prototype.getOptions = function(e) {
  519. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  520. e.delay && "number" == typeof e.delay && (e.delay = {
  521. show: e.delay,
  522. hide: e.delay
  523. }),
  524. e
  525. }
  526. ,
  527. i.prototype.getDelegateOptions = function() {
  528. var e = {}
  529. , i = this.getDefaults();
  530. return this._options && t.each(this._options, function(t, o) {
  531. i[t] != o && (e[t] = o)
  532. }),
  533. e
  534. }
  535. ,
  536. i.prototype.enter = function(e) {
  537. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  538. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  539. t(e.currentTarget).data("bs." + this.type, i)),
  540. clearTimeout(i.timeout),
  541. i.hoverState = "in",
  542. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  543. "in" == i.hoverState && i.show()
  544. }, i.options.delay.show)) : i.show()
  545. }
  546. ,
  547. i.prototype.leave = function(e) {
  548. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  549. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  550. t(e.currentTarget).data("bs." + this.type, i)),
  551. clearTimeout(i.timeout),
  552. i.hoverState = "out",
  553. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  554. "out" == i.hoverState && i.hide()
  555. }, i.options.delay.hide)) : i.hide()
  556. }
  557. ,
  558. i.prototype.show = function() {
  559. var e = t.Event("show.bs." + this.type);
  560. if (this.hasContent() && this.enabled) {
  561. this.$element.trigger(e);
  562. var i = t.contains(document.documentElement, this.$element[0]);
  563. if (e.isDefaultPrevented() || !i)
  564. return;
  565. var o = this
  566. , s = this.tip()
  567. , n = this.getUID(this.type);
  568. this.setContent(),
  569. s.attr("id", n),
  570. this.$element.attr("aria-describedby", n),
  571. this.options.animation && s.addClass("fade");
  572. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  573. , a = /\s?auto?\s?/i
  574. , l = a.test(r);
  575. l && (r = r.replace(a, "") || "top"),
  576. s.detach().css({
  577. top: 0,
  578. left: 0,
  579. display: "block"
  580. }).addClass(r).data("bs." + this.type, this),
  581. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  582. var p = this.getPosition()
  583. , h = s[0].offsetWidth
  584. , f = s[0].offsetHeight;
  585. if (l) {
  586. var u = r
  587. , c = this.$element.parent()
  588. , d = this.getPosition(c);
  589. r = "bottom" == r && p.top + p.height + f - d.scroll > d.height ? "top" : "top" == r && p.top - d.scroll - f < 0 ? "bottom" : "right" == r && p.right + h > d.width ? "left" : "left" == r && p.left - h < d.left ? "right" : r,
  590. s.removeClass(u).addClass(r)
  591. }
  592. var g = this.getCalculatedOffset(r, p, h, f);
  593. this.applyPlacement(g, r);
  594. var y = function() {
  595. o.$element.trigger("shown.bs." + o.type),
  596. o.hoverState = null
  597. };
  598. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  599. }
  600. }
  601. ,
  602. i.prototype.applyPlacement = function(e, i) {
  603. var o = this.tip()
  604. , s = o[0].offsetWidth
  605. , n = o[0].offsetHeight
  606. , r = parseInt(o.css("margin-top"), 10)
  607. , a = parseInt(o.css("margin-left"), 10);
  608. isNaN(r) && (r = 0),
  609. isNaN(a) && (a = 0),
  610. e.top = e.top + r,
  611. e.left = e.left + a,
  612. t.offset.setOffset(o[0], t.extend({
  613. using: function(t) {
  614. o.css({
  615. top: Math.round(t.top),
  616. left: Math.round(t.left)
  617. })
  618. }
  619. }, e), 0),
  620. o.addClass("in");
  621. var l = o[0].offsetWidth
  622. , p = o[0].offsetHeight;
  623. "top" == i && p != n && (e.top = e.top + n - p);
  624. var h = this.getViewportAdjustedDelta(i, e, l, p);
  625. h.left ? e.left += h.left : e.top += h.top;
  626. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  627. , u = h.left ? "left" : "top"
  628. , c = h.left ? "offsetWidth" : "offsetHeight";
  629. o.offset(e),
  630. this.replaceArrow(f, o[0][c], u)
  631. }
  632. ,
  633. i.prototype.replaceArrow = function(t, e, i) {
  634. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  635. }
  636. ,
  637. i.prototype.setContent = function() {
  638. var t = this.tip()
  639. , e = this.getTitle();
  640. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  641. t.removeClass("fade in top bottom left right")
  642. }
  643. ,
  644. i.prototype.hide = function() {
  645. function e() {
  646. "in" != i.hoverState && o.detach(),
  647. i.$element.trigger("hidden.bs." + i.type)
  648. }
  649. var i = this
  650. , o = this.tip()
  651. , s = t.Event("hide.bs." + this.type);
  652. if (this.$element.removeAttr("aria-describedby"),
  653. this.$element.trigger(s),
  654. !s.isDefaultPrevented())
  655. return o.removeClass("in"),
  656. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  657. this.hoverState = null,
  658. this
  659. }
  660. ,
  661. i.prototype.fixTitle = function() {
  662. var t = this.$element;
  663. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  664. }
  665. ,
  666. i.prototype.hasContent = function() {
  667. return this.getTitle()
  668. }
  669. ,
  670. i.prototype.getPosition = function(e) {
  671. e = e || this.$element;
  672. var i = e[0]
  673. , o = "BODY" == i.tagName;
  674. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  675. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  676. width: o ? t(window).width() : e.outerWidth(),
  677. height: o ? t(window).height() : e.outerHeight()
  678. }, o ? {
  679. top: 0,
  680. left: 0
  681. } : e.offset())
  682. }
  683. ,
  684. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  685. return "bottom" == t ? {
  686. top: e.top + e.height,
  687. left: e.left + e.width / 2 - i / 2
  688. } : "top" == t ? {
  689. top: e.top - o,
  690. left: e.left + e.width / 2 - i / 2
  691. } : "left" == t ? {
  692. top: e.top + e.height / 2 - o / 2,
  693. left: e.left - i
  694. } : {
  695. top: e.top + e.height / 2 - o / 2,
  696. left: e.left + e.width
  697. }
  698. }
  699. ,
  700. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  701. var s = {
  702. top: 0,
  703. left: 0
  704. };
  705. if (!this.$viewport)
  706. return s;
  707. var n = this.options.viewport && this.options.viewport.padding || 0
  708. , r = this.getPosition(this.$viewport);
  709. if (/right|left/.test(t)) {
  710. var a = e.top - n - r.scroll
  711. , l = e.top + n - r.scroll + o;
  712. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  713. } else {
  714. var p = e.left - n
  715. , h = e.left + n + i;
  716. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  717. }
  718. return s
  719. }
  720. ,
  721. i.prototype.getTitle = function() {
  722. var t, e = this.$element, i = this.options;
  723. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  724. }
  725. ,
  726. i.prototype.getUID = function(t) {
  727. do
  728. t += ~~(1e6 * Math.random());
  729. while (document.getElementById(t));return t
  730. }
  731. ,
  732. i.prototype.tip = function() {
  733. return this.$tip = this.$tip || t(this.options.template)
  734. }
  735. ,
  736. i.prototype.arrow = function() {
  737. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  738. }
  739. ,
  740. i.prototype.validate = function() {
  741. this.$element[0].parentNode || (this.hide(),
  742. this.$element = null,
  743. this.options = null)
  744. }
  745. ,
  746. i.prototype.enable = function() {
  747. this.enabled = !0
  748. }
  749. ,
  750. i.prototype.disable = function() {
  751. this.enabled = !1
  752. }
  753. ,
  754. i.prototype.toggleEnabled = function() {
  755. this.enabled = !this.enabled
  756. }
  757. ,
  758. i.prototype.toggle = function(e) {
  759. var i = this;
  760. e && (i = t(e.currentTarget).data("bs." + this.type),
  761. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  762. t(e.currentTarget).data("bs." + this.type, i))),
  763. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  764. }
  765. ,
  766. i.prototype.destroy = function() {
  767. clearTimeout(this.timeout),
  768. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  769. }
  770. ;
  771. var o = t.fn.tooltip;
  772. t.fn.tooltip = e,
  773. t.fn.tooltip.Constructor = i,
  774. t.fn.tooltip.noConflict = function() {
  775. return t.fn.tooltip = o,
  776. this
  777. }
  778. }(jQuery);
  779. !function(e, t, n) {
  780. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  781. }("Keen", this, function() {
  782. "use strict";
  783. function Keen() {
  784. return _init.apply(this, arguments)
  785. }
  786. function _init(e) {
  787. if (_isUndefined(e))
  788. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  789. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  790. throw new Error("Please provide a projectId");
  791. this.configure(e)
  792. }
  793. function _extend(e) {
  794. for (var t = 1; t < arguments.length; t++)
  795. for (var n in arguments[t])
  796. e[n] = arguments[t][n];
  797. return e
  798. }
  799. function _isUndefined(e) {
  800. return void 0 === e
  801. }
  802. function _type(e) {
  803. var t = e && e.constructor ? e.constructor.toString() : void 0;
  804. return t ? t.match(/function (.*)\(/)[1] : "Null"
  805. }
  806. function _each(e, t, n) {
  807. var r;
  808. if (!e)
  809. return 0;
  810. if (n = n ? n : e,
  811. "array" === _type(e)) {
  812. for (r = 0; r < e.length; r++)
  813. if (t.call(n, e[r], r, e) === !1)
  814. return 0
  815. } else
  816. for (r in e)
  817. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  818. return 0;
  819. return 1
  820. }
  821. function _parse_params(e) {
  822. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  823. return decodeURIComponent(e.replace(r, " "))
  824. }, a = e.split("?")[1]; t = i.exec(a); )
  825. n[o(t[1])] = o(t[2]);
  826. return n
  827. }
  828. function _set_protocol(e) {
  829. switch (e) {
  830. case "http":
  831. return "http";
  832. case "auto":
  833. return location.protocol.replace(/:/g, "");
  834. case "https":
  835. case void 0:
  836. default:
  837. return "https"
  838. }
  839. }
  840. function _set_request_type(e) {
  841. var t = e || "jsonp"
  842. , n = !1;
  843. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  844. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  845. }
  846. function _build_url(e) {
  847. return this.client.endpoint + "/projects/" + this.client.projectId + e
  848. }
  849. function _uploadEvent(e, t, n, r, i) {
  850. var o = _build_url.apply(this, ["/events/" + e])
  851. , a = {};
  852. n = n !== !1,
  853. this.client.globalProperties && (a = this.client.globalProperties(e));
  854. for (var c in t)
  855. t.hasOwnProperty(c) && (a[c] = t[c]);
  856. switch (this.client.requestType) {
  857. case "xhr":
  858. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  859. break;
  860. case "jsonp":
  861. var s = JSON.stringify(a)
  862. , l = Keen.Base64.encode(s);
  863. o = o + "?api_key=" + this.client.writeKey,
  864. o = o + "&data=" + l,
  865. o = o + "&modified=" + (new Date).getTime(),
  866. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  867. break;
  868. case "beacon":
  869. var s = JSON.stringify(a)
  870. , l = Keen.Base64.encode(s);
  871. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  872. o = o + "&data=" + encodeURIComponent(l),
  873. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  874. o += "&c=clv1",
  875. _request.beacon.apply(this, [o, null, r, i])
  876. }
  877. }
  878. Keen.prototype.configure = function(e) {
  879. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  880. e.protocol = _set_protocol(e.protocol),
  881. e.requestType = _set_request_type(e.requestType),
  882. this.client = {
  883. projectId: e.projectId,
  884. writeKey: e.writeKey,
  885. readKey: e.readKey,
  886. globalProperties: null,
  887. endpoint: e.protocol + "://" + e.host,
  888. requestType: e.requestType
  889. },
  890. Keen.trigger("client", this, e),
  891. this.trigger("ready"),
  892. this
  893. }
  894. ;
  895. var _request = {
  896. xhr: function(e, t, n, r, i, o, a, c) {
  897. if (!i)
  898. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  899. var s = new XMLHttpRequest;
  900. if (s.onreadystatechange = function() {
  901. if (4 == s.readyState)
  902. if (s.status >= 200 && s.status < 300) {
  903. var e;
  904. try {
  905. e = JSON.parse(s.responseText)
  906. } catch (e) {
  907. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  908. c && c(s, e)
  909. }
  910. a && e && a(e)
  911. } else
  912. Keen.log("HTTP request failed."),
  913. c && c(s, null)
  914. }
  915. ,
  916. s.open(e, t, o),
  917. i && s.setRequestHeader("Authorization", i),
  918. r && s.setRequestHeader("Content-Type", "application/json"),
  919. n)
  920. for (var l in n)
  921. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  922. var u = r ? JSON.stringify(r) : null;
  923. s.send(u)
  924. },
  925. jsonp: function(e, t, n, r) {
  926. if (!t)
  927. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  928. if (t && e.indexOf("api_key") < 0) {
  929. var i = e.indexOf("?") > 0 ? "&" : "?";
  930. e = e + i + "api_key=" + t
  931. }
  932. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  933. o += "a";
  934. var a = !1;
  935. window[o] = function(e) {
  936. a = !0,
  937. n && e && n(e),
  938. window[o] = void 0
  939. }
  940. ,
  941. e = e + "&jsonp=" + o;
  942. var c = document.createElement("script");
  943. c.id = "keen-jsonp",
  944. c.src = e,
  945. document.getElementsByTagName("head")[0].appendChild(c),
  946. c.onreadystatechange = function() {
  947. a === !1 && "loaded" === this.readyState && (a = !0,
  948. r && r())
  949. }
  950. ,
  951. c.onerror = function() {
  952. a === !1 && (a = !0,
  953. r && r())
  954. }
  955. },
  956. beacon: function(e, t, n, r) {
  957. if (t && e.indexOf("api_key") < 0) {
  958. var i = e.indexOf("?") > 0 ? "&" : "?";
  959. e = e + i + "api_key=" + t
  960. }
  961. var o = !1
  962. , a = document.createElement("img");
  963. a.onload = function() {
  964. if (o = !0,
  965. "naturalHeight"in this) {
  966. if (this.naturalHeight + this.naturalWidth === 0)
  967. return void this.onerror()
  968. } else if (this.width + this.height === 0)
  969. return void this.onerror();
  970. n && n({
  971. created: !0
  972. })
  973. }
  974. ,
  975. a.onerror = function() {
  976. o = !0,
  977. r && r()
  978. }
  979. ,
  980. a.src = e
  981. }
  982. }
  983. , Events = Keen.Events = {
  984. on: function(e, t) {
  985. this.listeners || (this.listeners = {});
  986. var n = this.listeners[e] || (this.listeners[e] = []);
  987. return n.push({
  988. callback: t
  989. }),
  990. this
  991. },
  992. off: function(e, t) {
  993. if (!e && !t)
  994. return this.listeners = void 0,
  995. delete this.listeners,
  996. this;
  997. for (var n = this.listeners[e] || [], r = n.length; r--; )
  998. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  999. t && 0 != n.length || (this.listeners[e] = void 0,
  1000. delete this.listeners[e]);
  1001. return this
  1002. },
  1003. trigger: function(e) {
  1004. if (!this.listeners)
  1005. return this;
  1006. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1007. n[r].callback.apply(this, t);
  1008. return this
  1009. }
  1010. };
  1011. _extend(Keen.prototype, Events),
  1012. _extend(Keen, Events),
  1013. Keen.loaded = !0,
  1014. Keen.utils = {
  1015. each: _each,
  1016. extend: _extend,
  1017. parseParams: _parse_params
  1018. },
  1019. Keen.ready = function(e) {
  1020. Keen.loaded ? e() : Keen.on("ready", e)
  1021. }
  1022. ,
  1023. Keen.log = function(e) {
  1024. "object" == typeof console && console.log("[Keen IO]", e)
  1025. }
  1026. ;
  1027. var Plugins = Keen.Plugins = {};
  1028. Keen.prototype.addEvent = function() {
  1029. _uploadEvent.apply(this, arguments)
  1030. }
  1031. ,
  1032. Keen.prototype.addEventSync = function(e, t, n, r) {
  1033. _uploadEvent.apply(this, [e, t, !1, n, r])
  1034. }
  1035. ,
  1036. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1037. var o = e
  1038. , a = o.metaKey
  1039. , c = o.target
  1040. , s = !1
  1041. , l = function() {};
  1042. return void 0 === r && (r = 500),
  1043. "A" === c.nodeName ? l = function() {
  1044. a || s || (s = !0,
  1045. window.location = c.href)
  1046. }
  1047. : "FORM" === c.nodeName && (l = function() {
  1048. s || (s = !0,
  1049. c.submit())
  1050. }
  1051. ),
  1052. i && (l = function() {
  1053. s || (s = !0,
  1054. i())
  1055. }
  1056. ),
  1057. _uploadEvent.call(this, t, n, l, l),
  1058. setTimeout(function() {
  1059. l()
  1060. }, r),
  1061. !!a && void 0
  1062. }
  1063. ,
  1064. Keen.prototype.setGlobalProperties = function(e) {
  1065. if (!this.client)
  1066. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1067. if (!e || "function" != typeof e)
  1068. throw new Error("Invalid value for global properties: " + e);
  1069. this.client.globalProperties = e
  1070. }
  1071. ,
  1072. Keen.Base64 = {
  1073. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1074. encode: function(e) {
  1075. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1076. for (e = this.utf8.encode(e); l < e.length; )
  1077. t = e.charCodeAt(l++),
  1078. n = e.charCodeAt(l++),
  1079. r = e.charCodeAt(l++),
  1080. i = t >> 2,
  1081. o = (3 & t) << 4 | n >> 4,
  1082. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1083. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1084. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1085. return s
  1086. },
  1087. decode: function(e) {
  1088. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1089. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1090. t = u.indexOf(e.charAt(l++)),
  1091. n = u.indexOf(e.charAt(l++)),
  1092. r = u.indexOf(e.charAt(l++)),
  1093. i = u.indexOf(e.charAt(l++)),
  1094. o = t << 2 | n >> 4,
  1095. a = (15 & n) << 4 | r >> 2,
  1096. c = (3 & r) << 6 | i,
  1097. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1098. return this.utf8.decode(s)
  1099. },
  1100. utf8: {
  1101. encode: function(e) {
  1102. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1103. t = e.charCodeAt(r++),
  1104. n += 128 > t ? i(t) : t > 127 && 2048 > t ? i(t >> 6 | 192) + i(63 & t | 128) : i(t >> 12 | 224) + i(t >> 6 & 63 | 128) + i(63 & t | 128);
  1105. return n
  1106. },
  1107. decode: function(e) {
  1108. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1109. n = e.charCodeAt(i),
  1110. r += 128 > n ? [o(n), i++][0] : n > 191 && 224 > n ? [o((31 & n) << 6 | 63 & (t = e.charCodeAt(i + 1))), i += 2][0] : [o((15 & n) << 12 | (63 & (t = e.charCodeAt(i + 1))) << 6 | 63 & (c3 = e.charCodeAt(i + 2))), i += 3][0];
  1111. return r
  1112. }
  1113. }
  1114. },
  1115. "object" != typeof JSON && (JSON = {}),
  1116. function() {
  1117. function f(e) {
  1118. return 10 > e ? "0" + e : e
  1119. }
  1120. function quote(e) {
  1121. return escapable.lastIndex = 0,
  1122. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1123. var t = meta[e];
  1124. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1125. }) + '"' : '"' + e + '"'
  1126. }
  1127. function str(e, t) {
  1128. var n, r, i, o, a, c = gap, s = t[e];
  1129. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1130. "function" == typeof rep && (s = rep.call(t, e, s)),
  1131. typeof s) {
  1132. case "string":
  1133. return quote(s);
  1134. case "number":
  1135. return isFinite(s) ? String(s) : "null";
  1136. case "boolean":
  1137. case "null":
  1138. return String(s);
  1139. case "object":
  1140. if (!s)
  1141. return "null";
  1142. if (gap += indent,
  1143. a = [],
  1144. "[object Array]" === Object.prototype.toString.apply(s)) {
  1145. for (o = s.length,
  1146. n = 0; o > n; n += 1)
  1147. a[n] = str(n, s) || "null";
  1148. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1149. gap = c,
  1150. i
  1151. }
  1152. if (rep && "object" == typeof rep)
  1153. for (o = rep.length,
  1154. n = 0; o > n; n += 1)
  1155. "string" == typeof rep[n] && (r = rep[n],
  1156. i = str(r, s),
  1157. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1158. else
  1159. for (r in s)
  1160. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1161. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1162. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1163. gap = c,
  1164. i
  1165. }
  1166. }
  1167. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1168. 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
  1169. }
  1170. ,
  1171. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1172. return this.valueOf()
  1173. }
  1174. );
  1175. 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 = {
  1176. "\b": "\\b",
  1177. "\t": "\\t",
  1178. "\n": "\\n",
  1179. "\f": "\\f",
  1180. "\r": "\\r",
  1181. '"': '\\"',
  1182. "\\": "\\\\"
  1183. }, rep;
  1184. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1185. var r;
  1186. if (gap = "",
  1187. indent = "",
  1188. "number" == typeof n)
  1189. for (r = 0; n > r; r += 1)
  1190. indent += " ";
  1191. else
  1192. "string" == typeof n && (indent = n);
  1193. if (rep = t,
  1194. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1195. throw new Error("JSON.stringify");
  1196. return str("", {
  1197. "": e
  1198. })
  1199. }
  1200. ),
  1201. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1202. function walk(e, t) {
  1203. var n, r, i = e[t];
  1204. if (i && "object" == typeof i)
  1205. for (n in i)
  1206. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1207. void 0 !== r ? i[n] = r : delete i[n]);
  1208. return reviver.call(e, t, i)
  1209. }
  1210. var j;
  1211. if (text = String(text),
  1212. cx.lastIndex = 0,
  1213. cx.test(text) && (text = text.replace(cx, function(e) {
  1214. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1215. })),
  1216. /^[\],:{}\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, "")))
  1217. return j = eval("(" + text + ")"),
  1218. "function" == typeof reviver ? walk({
  1219. "": j
  1220. }, "") : j;
  1221. throw new SyntaxError("JSON.parse")
  1222. }
  1223. )
  1224. }(),
  1225. !function(e, t, n) {
  1226. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1227. }("domready", Keen.utils, function(e) {
  1228. function t(e) {
  1229. for (d = 1; e = r.shift(); )
  1230. e()
  1231. }
  1232. var n, r = [], i = !1, o = document, a = o.documentElement, c = a.doScroll, s = "DOMContentLoaded", l = "addEventListener", u = "onreadystatechange", f = "readyState", p = c ? /^loaded|^c/ : /^loaded|c/, d = p.test(o[f]);
  1233. return o[l] && o[l](s, n = function() {
  1234. o.removeEventListener(s, n, i),
  1235. t()
  1236. }
  1237. , i),
  1238. c && o.attachEvent(u, n = function() {
  1239. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1240. t())
  1241. }
  1242. ),
  1243. e = c ? function(t) {
  1244. self != top ? d ? t() : r.push(t) : function() {
  1245. try {
  1246. a.doScroll("left")
  1247. } catch (n) {
  1248. return setTimeout(function() {
  1249. e(t)
  1250. }, 50)
  1251. }
  1252. t()
  1253. }()
  1254. }
  1255. : function(e) {
  1256. d ? e() : r.push(e)
  1257. }
  1258. });
  1259. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1260. if (loaded && cached) {
  1261. clients = cached.clients || {},
  1262. ready = cached.ready || [];
  1263. for (var instance in clients)
  1264. if (clients.hasOwnProperty(instance)) {
  1265. var client = clients[instance];
  1266. for (var method in Keen.prototype)
  1267. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1268. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1269. ,
  1270. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1271. ,
  1272. client._config && (client.configure.call(client, client._config),
  1273. delete client._config),
  1274. client._setGlobalProperties) {
  1275. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1276. client.setGlobalProperties.apply(client, globals[i]);
  1277. delete client._setGlobalProperties
  1278. }
  1279. if (client._addEvent) {
  1280. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1281. client.addEvent.apply(client, queue[i]);
  1282. delete client._addEvent
  1283. }
  1284. var callback = client._on || [];
  1285. if (client._on) {
  1286. for (var i = 0; i < callback.length; i++)
  1287. client.on.apply(client, callback[i]);
  1288. client.trigger("ready"),
  1289. delete client._on
  1290. }
  1291. }
  1292. for (var i = 0; i < ready.length; i++) {
  1293. var callback = ready[i];
  1294. Keen.on("ready", function() {
  1295. callback()
  1296. })
  1297. }
  1298. }
  1299. return Keen.loaded && setTimeout(function() {
  1300. Keen.utils.domready(function() {
  1301. Keen.trigger("ready")
  1302. })
  1303. }, 0),
  1304. Keen
  1305. });
  1306. !function() {
  1307. var t = window.analytics = window.analytics || [];
  1308. if (!t.initialize) {
  1309. if (t.invoked)
  1310. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1311. t.invoked = !0,
  1312. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1313. t.factory = function(e) {
  1314. return function() {
  1315. var n = Array.prototype.slice.call(arguments);
  1316. return n.unshift(e),
  1317. t.push(n),
  1318. t
  1319. }
  1320. }
  1321. ;
  1322. for (var e = 0; e < t.methods.length; e++) {
  1323. var n = t.methods[e];
  1324. t[n] = t.factory(n)
  1325. }
  1326. t.load = function(t) {
  1327. var e = document.createElement("script");
  1328. e.type = "text/javascript",
  1329. e.async = !0,
  1330. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1331. var n = document.getElementsByTagName("script")[0];
  1332. n.parentNode.insertBefore(e, n)
  1333. }
  1334. ,
  1335. t.SNIPPET_VERSION = "4.0.0"
  1336. }
  1337. }();
  1338. !function(i, e) {
  1339. "use strict";
  1340. var s = ""
  1341. , r = "?"
  1342. , o = "function"
  1343. , a = "undefined"
  1344. , n = "object"
  1345. , t = "major"
  1346. , d = "model"
  1347. , w = "name"
  1348. , l = "type"
  1349. , p = "vendor"
  1350. , m = "version"
  1351. , c = "architecture"
  1352. , u = "console"
  1353. , g = "mobile"
  1354. , f = "tablet"
  1355. , h = "smarttv"
  1356. , b = {
  1357. has: function(i, e) {
  1358. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1359. },
  1360. lowerize: function(i) {
  1361. return i.toLowerCase()
  1362. }
  1363. }
  1364. , y = {
  1365. rgx: function() {
  1366. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1367. var c = m[p]
  1368. , u = m[p + 1];
  1369. if (typeof i === a) {
  1370. i = {};
  1371. for (t in u)
  1372. d = u[t],
  1373. typeof d === n ? i[d[0]] = e : i[d] = e
  1374. }
  1375. for (s = r = 0; s < c.length; s++)
  1376. if (w = c[s].exec(this.getUA())) {
  1377. for (t = 0; t < u.length; t++)
  1378. l = w[++r],
  1379. d = u[t],
  1380. typeof d === n && d.length > 0 ? 2 == d.length ? typeof d[1] == o ? i[d[0]] = d[1].call(this, l) : i[d[0]] = d[1] : 3 == d.length ? typeof d[1] !== o || d[1].exec && d[1].test ? i[d[0]] = l ? l.replace(d[1], d[2]) : e : i[d[0]] = l ? d[1].call(this, l, d[2]) : e : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e) : i[d] = l ? l : e;
  1381. break
  1382. }
  1383. if (w)
  1384. break
  1385. }
  1386. return i
  1387. },
  1388. str: function(i, s) {
  1389. for (var o in s)
  1390. if (typeof s[o] === n && s[o].length > 0) {
  1391. for (var a = 0; a < s[o].length; a++)
  1392. if (b.has(s[o][a], i))
  1393. return o === r ? e : o
  1394. } else if (b.has(s[o], i))
  1395. return o === r ? e : o;
  1396. return i
  1397. }
  1398. }
  1399. , v = {
  1400. browser: {
  1401. oldsafari: {
  1402. major: {
  1403. 1: ["/8", "/1", "/3"],
  1404. 2: "/4",
  1405. "?": "/"
  1406. },
  1407. version: {
  1408. "1.0": "/8",
  1409. 1.2: "/1",
  1410. 1.3: "/3",
  1411. "2.0": "/412",
  1412. "2.0.2": "/416",
  1413. "2.0.3": "/417",
  1414. "2.0.4": "/419",
  1415. "?": "/"
  1416. }
  1417. }
  1418. },
  1419. device: {
  1420. sprint: {
  1421. model: {
  1422. "Evo Shift 4G": "7373KT"
  1423. },
  1424. vendor: {
  1425. HTC: "APA",
  1426. Sprint: "Sprint"
  1427. }
  1428. }
  1429. },
  1430. os: {
  1431. windows: {
  1432. version: {
  1433. ME: "4.90",
  1434. "NT 3.11": "NT3.51",
  1435. "NT 4.0": "NT4.0",
  1436. 2e3: "NT 5.0",
  1437. XP: ["NT 5.1", "NT 5.2"],
  1438. Vista: "NT 6.0",
  1439. 7: "NT 6.1",
  1440. 8: "NT 6.2",
  1441. 8.1: "NT 6.3",
  1442. RT: "ARM"
  1443. }
  1444. }
  1445. }
  1446. }
  1447. , k = {
  1448. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [w, m, t], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[w, "Opera"], m, t], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [w, m, t], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[w, "IE"], m, t], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[w, "Yandex"], m, t], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[w, /_/g, " "], m, t], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [w, m, t], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[w, "Dolphin"], m, t], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[w, "Chrome"], m, t], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [m, t, [w, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [m, t, w], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [w, m, t], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[w, "Netscape"], m, t], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [w, m, t], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [w, m, t], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [w, m], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(flrp)\/((\d+)[\w\.-]+)/i], [[w, "Flip Player"], m, t], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [w], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [w, m, t], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [w, m, t], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[w, /_/g, " "], m, t], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [w, m], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [w, m, t], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [w], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [w, m, t], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [w, m, t], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [w, m, t], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [w], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(smp)((\d+)[\d\.]+)/i], [w, m, t], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [w, m, t], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[w, /-/g, " "], m, t], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [m, t, [w, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [w, m, t], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[w, "rad.io"], m, t]],
  1449. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[c, "amd64"]], [/(ia32(?=;))/i], [[c, b.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[c, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[c, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[c, /ower/, "", b.lowerize]], [/(sun4\w)[;\)]/i], [[c, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [c, b.lowerize]],
  1450. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [d, p, [l, f]], [/applecoremedia\/[\w\.]+ \((ipad)/], [d, [p, "Apple"], [l, f]], [/(apple\s{0,1}tv)/i], [[d, "Apple TV"], [p, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [p, d, [l, f]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [d, p, [l, g]], [/\((ip[honed|\s\w*]+);/i], [d, [p, "Apple"], [l, g]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [p, d, [l, g]], [/\((bb10);\s(\w+)/i], [[p, "BlackBerry"], d, [l, g]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[p, "Asus"], d, [l, f]], [/(sony)\s(tablet\s[ps])/i], [p, d, [l, f]], [/(nintendo)\s([wids3u]+)/i], [p, d, [l, u]], [/((playstation)\s[3portablevi]+)/i], [[p, "Sony"], d, [l, u]], [/(sprint\s(\w+))/i], [[p, y.str, v.device.sprint.vendor], [d, y.str, v.device.sprint.model], [l, g]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [p, [d, /_/g, " "], [l, g]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[p, "Motorola"], d, [l, g]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[p, "Motorola"], d, [l, f]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[p, "Samsung"], d, [l, f]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[p, "Samsung"], d, [l, g]], [/(sie)-(\w+)*/i], [[p, "Siemens"], d, [l, g]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[p, "Nokia"], d, [l, g]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[p, "Acer"], d, [l, f]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[p, "LG"], d, [l, f]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[p, "LG"], d, [l, g]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[p, "Lenovo"], d, [l, f]], [/(lg) netcast\.tv/i], [p, [l, h]], [/(mobile|tablet);.+rv\:.+gecko\//i], [l, p, d]],
  1451. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [w, m], [/rv\:([\w\.]+).*(gecko)/i], [m, w]],
  1452. os: [[/microsoft\s(windows)\s(vista|xp)/i], [w, m], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [w, [m, y.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[w, "Windows"], [m, y.str, v.os.windows.version]], [/\((bb)(10);/i], [[w, "BlackBerry"], m], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [w, m], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[w, "Symbian"], m], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[w, "Firefox OS"], m], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [w, m], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[w, "Chromium OS"], m], [/(sunos)\s?([\w\.]+\d)*/i], [[w, "Solaris"], m], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [w, m], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[w, "iOS"], [m, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [w, [m, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [w, m]]
  1453. }
  1454. , x = function(e) {
  1455. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1456. return this instanceof x ? (this.getBrowser = function() {
  1457. return y.rgx.apply(this, k.browser)
  1458. }
  1459. ,
  1460. this.getCPU = function() {
  1461. return y.rgx.apply(this, k.cpu)
  1462. }
  1463. ,
  1464. this.getDevice = function() {
  1465. return y.rgx.apply(this, k.device)
  1466. }
  1467. ,
  1468. this.getEngine = function() {
  1469. return y.rgx.apply(this, k.engine)
  1470. }
  1471. ,
  1472. this.getOS = function() {
  1473. return y.rgx.apply(this, k.os)
  1474. }
  1475. ,
  1476. this.getResult = function() {
  1477. return {
  1478. ua: this.getUA(),
  1479. browser: this.getBrowser(),
  1480. engine: this.getEngine(),
  1481. os: this.getOS(),
  1482. device: this.getDevice(),
  1483. cpu: this.getCPU()
  1484. }
  1485. }
  1486. ,
  1487. this.getUA = function() {
  1488. return r
  1489. }
  1490. ,
  1491. this.setUA = function(i) {
  1492. return r = i,
  1493. this
  1494. }
  1495. ,
  1496. void this.setUA(r)) : new x(e).getResult()
  1497. };
  1498. if (typeof exports !== a)
  1499. typeof module !== a && module.exports && (exports = module.exports = x),
  1500. exports.UAParser = x;
  1501. else if (i.UAParser = x,
  1502. typeof define === o && define.amd && define(function() {
  1503. return x
  1504. }),
  1505. typeof i.jQuery !== a) {
  1506. var A = i.jQuery
  1507. , _ = new x;
  1508. A.ua = _.getResult(),
  1509. A.ua.get = function() {
  1510. return _.getUA()
  1511. }
  1512. ,
  1513. A.ua.set = function(i) {
  1514. _.setUA(i);
  1515. var e = _.getResult();
  1516. for (var s in e)
  1517. A.ua[s] = e[s]
  1518. }
  1519. }
  1520. }(this);
  1521. window.Modernizr = function(n, e, t) {
  1522. function o(n) {
  1523. d.cssText = n
  1524. }
  1525. function r(n, e) {
  1526. return typeof n === e
  1527. }
  1528. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1529. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1530. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1531. return e in n && r(n.constructor.prototype[e], "undefined")
  1532. }
  1533. : function(n, e) {
  1534. return v.call(n, e)
  1535. }
  1536. ,
  1537. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1538. var e = this;
  1539. if ("function" != typeof e)
  1540. throw new TypeError;
  1541. var t = b.call(arguments, 1)
  1542. , o = function() {
  1543. if (this instanceof o) {
  1544. var r = function() {};
  1545. r.prototype = e.prototype;
  1546. var i = new r
  1547. , c = e.apply(i, t.concat(b.call(arguments)));
  1548. return Object(c) === c ? c : i
  1549. }
  1550. return e.apply(n, t.concat(b.call(arguments)))
  1551. };
  1552. return o
  1553. }
  1554. ),
  1555. y.webgl = function() {
  1556. return !!n.WebGLRenderingContext
  1557. }
  1558. ;
  1559. for (var h in y)
  1560. u(y, h) && (c = h.toLowerCase(),
  1561. f[c] = y[h](),
  1562. w.push((f[c] ? "" : "no-") + c));
  1563. return f.addTest = function(n, e) {
  1564. if ("object" == typeof n)
  1565. for (var o in n)
  1566. u(n, o) && f.addTest(o, n[o]);
  1567. else {
  1568. if (n = n.toLowerCase(),
  1569. f[n] !== t)
  1570. return f;
  1571. e = "function" == typeof e ? e() : e,
  1572. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1573. f[n] = e
  1574. }
  1575. return f
  1576. }
  1577. ,
  1578. o(""),
  1579. p = i = null,
  1580. f._version = a,
  1581. f
  1582. }(this, this.document);
  1583. !function(e, t, a) {
  1584. "use strict";
  1585. function n(t, h, m) {
  1586. function H(a) {
  1587. var n = 0
  1588. , i = Ee.length;
  1589. if (Ce.old = e.extend({}, Ce),
  1590. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1591. ke = Be[ge.horizontal ? "width" : "height"](),
  1592. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1593. Ee.length = 0,
  1594. Ce.start = 0,
  1595. Ce.end = q(ze - Ie, 0),
  1596. Re) {
  1597. n = Ne.length,
  1598. qe = Pe.children(ge.itemSelector),
  1599. Ne.length = 0;
  1600. var r, s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"), o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"), l = "border-box" === e(qe).css("boxSizing"), u = "none" !== qe.css("float"), f = 0, v = qe.length - 1;
  1601. ze = 0,
  1602. qe.each(function(t, a) {
  1603. var n = e(a)
  1604. , i = a.getBoundingClientRect()
  1605. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1606. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1607. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1608. , h = l + d + p
  1609. , m = !d || !p
  1610. , g = {};
  1611. g.el = a,
  1612. g.size = m ? l : h,
  1613. g.half = g.size / 2,
  1614. g.start = ze + (m ? d : 0),
  1615. g.center = g.start - E(Ie / 2 - g.size / 2),
  1616. g.end = g.start - Ie + g.size,
  1617. t || (ze += s),
  1618. ze += h,
  1619. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1620. t === v && (g.end += o,
  1621. ze += o,
  1622. f = m ? p : 0),
  1623. Ne.push(g),
  1624. r = g
  1625. }),
  1626. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1627. ze -= f,
  1628. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1629. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1630. }
  1631. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1632. Q(),
  1633. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1634. Te = d(Te, ge.minHandleSize, ke),
  1635. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1636. xe.end = ke - Te,
  1637. it || j()),
  1638. !we && Ie > 0) {
  1639. var p = Ce.start
  1640. , h = "";
  1641. if (Re)
  1642. e.each(Ne, function(e, t) {
  1643. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1644. Ee.push(p),
  1645. p += Ie,
  1646. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1647. });
  1648. else
  1649. for (; p - Ie < Ce.end; )
  1650. Ee.push(p),
  1651. p += Ie;
  1652. if (De[0] && i !== Ee.length) {
  1653. for (var m = 0; m < Ee.length; m++)
  1654. h += ge.pageBuilder.call(ye, m);
  1655. Ae = De.html(h).children(),
  1656. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1657. }
  1658. }
  1659. if (Oe.slideeSize = ze,
  1660. Oe.frameSize = Ie,
  1661. Oe.sbSize = ke,
  1662. Oe.handleSize = Te,
  1663. Re) {
  1664. a && null != ge.startAt && (W(ge.startAt),
  1665. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1666. var g = Ne[Oe.activeItem];
  1667. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1668. } else
  1669. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1670. pe("load")
  1671. }
  1672. function X(e, t, a) {
  1673. if (Re && at.released && !a) {
  1674. var n = $(e)
  1675. , i = e > Ce.start && e < Ce.end;
  1676. Le ? (i && (e = Ne[n.centerItem].center),
  1677. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1678. }
  1679. at.init && at.slidee && ge.elasticBounds ? e > Ce.end ? e = Ce.end + (e - Ce.end) / 6 : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6) : e = d(e, Ce.start, Ce.end),
  1680. et.start = +new Date,
  1681. et.time = 0,
  1682. et.from = Ce.cur,
  1683. et.to = e,
  1684. et.delta = e - Ce.cur,
  1685. et.tweesing = at.tweese || at.init && !at.slidee,
  1686. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1687. at.tweese = 0,
  1688. e !== Ce.dest && (Ce.dest = e,
  1689. pe("change"),
  1690. it || Y()),
  1691. K(),
  1692. Q(),
  1693. Z(),
  1694. F()
  1695. }
  1696. function Y() {
  1697. if (ye.initialized) {
  1698. if (!it)
  1699. return it = w(Y),
  1700. void (at.released && pe("moveStart"));
  1701. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1702. x(et.tweeseDelta) < .1 ? Ce.cur = et.to : Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)) : (et.time = N(+new Date - et.start, ge.speed),
  1703. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1704. et.to === Ce.cur ? (Ce.cur = et.to,
  1705. at.tweese = it = 0) : it = w(Y),
  1706. pe("move"),
  1707. we || (f ? Pe[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + -Ce.cur + "px)" : Pe[0].style[ge.horizontal ? "left" : "top"] = -E(Ce.cur) + "px"),
  1708. !it && at.released && pe("moveEnd"),
  1709. j()
  1710. }
  1711. }
  1712. function j() {
  1713. Se.length && (xe.cur = Ce.start === Ce.end ? 0 : ((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start) * xe.end,
  1714. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1715. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1716. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1717. }
  1718. function F() {
  1719. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1720. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1721. pe("activePage", _e.page))
  1722. }
  1723. function M() {
  1724. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1725. ot = at.init ? w(M) : 0,
  1726. tt.now = +new Date,
  1727. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1728. X(at.init ? tt.pos : E(tt.pos)),
  1729. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1730. tt.lastTime = tt.now
  1731. }
  1732. function L(e, t, n) {
  1733. if ("boolean" === i(t) && (n = t,
  1734. t = a),
  1735. t === a)
  1736. X(Ce[e], n);
  1737. else {
  1738. if (Le && "center" !== e)
  1739. return;
  1740. var r = ye.getPos(t);
  1741. r && X(r[e], n, !Le)
  1742. }
  1743. }
  1744. function R(e) {
  1745. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1746. }
  1747. function U(e) {
  1748. return R(l(e) && 0 > e ? e + Ne.length : e)
  1749. }
  1750. function W(e, t) {
  1751. var a = R(e);
  1752. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1753. qe.eq(a).addClass(ge.activeClass),
  1754. _e.active = Oe.activeItem = a,
  1755. Z(),
  1756. pe("active", a)),
  1757. a)
  1758. }
  1759. function $(e) {
  1760. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1761. var t = {}
  1762. , a = Me ? 0 : Ie / 2;
  1763. if (!we)
  1764. for (var n = 0, i = Ee.length; i > n; n++) {
  1765. if (e >= Ce.end || n === Ee.length - 1) {
  1766. t.activePage = Ee.length - 1;
  1767. break
  1768. }
  1769. if (e <= Ee[n] + a) {
  1770. t.activePage = n;
  1771. break
  1772. }
  1773. }
  1774. if (Re) {
  1775. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1776. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1777. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1778. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1779. s = c;
  1780. break
  1781. }
  1782. t.firstItem = l(r) ? r : 0,
  1783. t.centerItem = l(o) ? o : t.firstItem,
  1784. t.lastItem = l(s) ? s : t.centerItem
  1785. }
  1786. return t
  1787. }
  1788. function Q(t) {
  1789. e.extend(Oe, $(t))
  1790. }
  1791. function Z() {
  1792. var e = Ce.dest <= Ce.start
  1793. , t = Ce.dest >= Ce.end
  1794. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1795. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1796. Je.is("button,input") && Je.prop("disabled", e),
  1797. Ke.is("button,input") && Ke.prop("disabled", t),
  1798. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1799. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1800. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1801. Qe.is("button,input") && Qe.prop("disabled", e),
  1802. $e.is("button,input") && $e.prop("disabled", t)),
  1803. Re && null != Oe.activeItem) {
  1804. var n = 0 === Oe.activeItem
  1805. , i = Oe.activeItem >= Ne.length - 1
  1806. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1807. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1808. Ze.is("button,input") && Ze.prop("disabled", n),
  1809. Ge.is("button,input") && Ge.prop("disabled", i),
  1810. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1811. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1812. }
  1813. }
  1814. function G(e, t, a) {
  1815. if (e = U(e),
  1816. t = U(t),
  1817. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1818. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1819. var n = t > e ? e : a ? t : t - 1
  1820. , i = e > t ? e : a ? t + 1 : t
  1821. , r = e > t;
  1822. null != Oe.activeItem && (e === Oe.activeItem ? _e.active = Oe.activeItem = a ? r ? t + 1 : t : r ? t : t - 1 : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  1823. H()
  1824. }
  1825. }
  1826. function J(e, t) {
  1827. for (var a = 0, n = Ve[e].length; n > a; a++)
  1828. if (Ve[e][a] === t)
  1829. return a;
  1830. return -1
  1831. }
  1832. function K() {
  1833. at.released && !ye.isPaused && ye.resume()
  1834. }
  1835. function V(e) {
  1836. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1837. }
  1838. function _() {
  1839. at.history[0] = at.history[1],
  1840. at.history[1] = at.history[2],
  1841. at.history[2] = at.history[3],
  1842. at.history[3] = at.delta
  1843. }
  1844. function ee(e) {
  1845. at.released = 0,
  1846. at.source = e,
  1847. at.slidee = "slidee" === e
  1848. }
  1849. function te(t) {
  1850. var a = "touchstart" === t.type
  1851. , n = t.data.source
  1852. , i = "slidee" === n;
  1853. at.init || !a && ie(t.target) || ("handle" !== n || ge.dragHandle && xe.start !== xe.end) && (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) && (a || r(t),
  1854. ee(n),
  1855. at.init = 0,
  1856. at.$source = e(t.target),
  1857. at.touch = a,
  1858. at.pointer = a ? t.originalEvent.touches[0] : t,
  1859. at.initX = at.pointer.pageX,
  1860. at.initY = at.pointer.pageY,
  1861. at.initPos = i ? Ce.cur : xe.cur,
  1862. at.start = +new Date,
  1863. at.time = 0,
  1864. at.path = 0,
  1865. at.delta = 0,
  1866. at.locked = 0,
  1867. at.history = [0, 0, 0, 0],
  1868. at.pathToLock = i ? a ? 30 : 10 : 0,
  1869. b.on(a ? z : I, ae),
  1870. ye.pause(1),
  1871. (i ? Pe : Se).addClass(ge.draggedClass),
  1872. pe("moveStart"),
  1873. i && (rt = setInterval(_, 10)))
  1874. }
  1875. function ae(e) {
  1876. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1877. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1878. at.pathX = at.pointer.pageX - at.initX,
  1879. at.pathY = at.pointer.pageY - at.initY,
  1880. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1881. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1882. at.released || !(at.path < 1)) {
  1883. if (!at.init) {
  1884. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1885. return ne();
  1886. at.init = 1
  1887. }
  1888. r(e),
  1889. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1890. at.$source.on(B, s)),
  1891. at.released && (ne(),
  1892. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1893. at.delta += at.swing,
  1894. at.tweese = x(at.swing) > 10)),
  1895. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1896. }
  1897. }
  1898. function ne() {
  1899. clearInterval(rt),
  1900. at.released = !0,
  1901. b.off(at.touch ? z : I, ae),
  1902. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1903. setTimeout(function() {
  1904. at.$source.off(B, s)
  1905. }),
  1906. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1907. ye.resume(1),
  1908. at.init = 0
  1909. }
  1910. function ie(t) {
  1911. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1912. }
  1913. function re() {
  1914. ye.stop(),
  1915. b.off("mouseup", re)
  1916. }
  1917. function se(e) {
  1918. switch (r(e),
  1919. this) {
  1920. case $e[0]:
  1921. case Qe[0]:
  1922. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1923. b.on("mouseup", re);
  1924. break;
  1925. case Ze[0]:
  1926. ye.prev();
  1927. break;
  1928. case Ge[0]:
  1929. ye.next();
  1930. break;
  1931. case Je[0]:
  1932. ye.prevPage();
  1933. break;
  1934. case Ke[0]:
  1935. ye.nextPage()
  1936. }
  1937. }
  1938. function oe(e) {
  1939. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1940. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1941. Re ? (p = +new Date,
  1942. nt.last < p - nt.resetTime && (nt.delta = 0),
  1943. nt.last = p,
  1944. nt.delta += nt.curDelta,
  1945. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1946. nt.delta %= 1),
  1947. nt.finalDelta) : nt.curDelta
  1948. }
  1949. function le(e) {
  1950. e.originalEvent[g] = ye;
  1951. var t = +new Date;
  1952. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1953. return void (O = t);
  1954. if (ge.scrollBy && Ce.start !== Ce.end) {
  1955. var a = oe(e.originalEvent);
  1956. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1957. ye.slideBy(ge.scrollBy * a)
  1958. }
  1959. }
  1960. function ce(e) {
  1961. ge.clickBar && e.target === Be[0] && (r(e),
  1962. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1963. }
  1964. function de(e) {
  1965. if (ge.keyboardNavBy)
  1966. switch (e.which) {
  1967. case ge.horizontal ? 37 : 38:
  1968. r(e),
  1969. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1970. break;
  1971. case ge.horizontal ? 39 : 40:
  1972. r(e),
  1973. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1974. }
  1975. }
  1976. function ue(e) {
  1977. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1978. }
  1979. function fe() {
  1980. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1981. }
  1982. function ve(e) {
  1983. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1984. }
  1985. function pe(e, t) {
  1986. if (Ve[e]) {
  1987. for (me = Ve[e].length,
  1988. T.length = 0,
  1989. he = 0; me > he; he++)
  1990. T.push(Ve[e][he]);
  1991. for (he = 0; me > he; he++)
  1992. T[he].call(ye, e, t)
  1993. }
  1994. }
  1995. var he, me, ge = e.extend({}, n.defaults, h), ye = this, we = l(t), be = e(t), Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0), Ie = 0, ze = 0, Ce = {
  1996. start: 0,
  1997. center: 0,
  1998. end: 0,
  1999. cur: 0,
  2000. dest: 0
  2001. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2002. start: 0,
  2003. end: 0,
  2004. cur: 0
  2005. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2006. firstItem: 0,
  2007. lastItem: 0,
  2008. centerItem: 0,
  2009. activeItem: null,
  2010. activePage: 0
  2011. }, He = new u(be[0]), Xe = new u(Pe[0]), Ye = new u(Be[0]), je = new u(Se[0]), Fe = "basic" === ge.itemNav, Me = "forceCentered" === ge.itemNav, Le = "centered" === ge.itemNav || Me, Re = !we && (Fe || Le || Me), Ue = ge.scrollSource ? e(ge.scrollSource) : be, We = ge.dragSource ? e(ge.dragSource) : be, $e = e(ge.forward), Qe = e(ge.backward), Ze = e(ge.prev), Ge = e(ge.next), Je = e(ge.prevPage), Ke = e(ge.nextPage), Ve = {}, _e = {}, et = {}, tt = {}, at = {
  2012. released: 1
  2013. }, nt = {
  2014. last: 0,
  2015. delta: 0,
  2016. resetTime: 200
  2017. }, it = 0, rt = 0, st = 0, ot = 0;
  2018. we || (t = be[0]),
  2019. ye.initialized = 0,
  2020. ye.frame = t,
  2021. ye.slidee = Pe[0],
  2022. ye.pos = Ce,
  2023. ye.rel = Oe,
  2024. ye.items = Ne,
  2025. ye.pages = Ee,
  2026. ye.isPaused = 0,
  2027. ye.options = ge,
  2028. ye.dragging = at,
  2029. ye.reload = function() {
  2030. H()
  2031. }
  2032. ,
  2033. ye.getPos = function(e) {
  2034. if (Re) {
  2035. var t = R(e);
  2036. return -1 !== t && Ne[t]
  2037. }
  2038. var a = Pe.find(e).eq(0);
  2039. if (a[0]) {
  2040. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2041. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2042. return {
  2043. start: n,
  2044. center: n - Ie / 2 + i / 2,
  2045. end: n - Ie + i,
  2046. size: i
  2047. }
  2048. }
  2049. return !1
  2050. }
  2051. ,
  2052. ye.moveBy = function(e) {
  2053. tt.speed = e,
  2054. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2055. tt.startPos = Ce.cur,
  2056. ee("button"),
  2057. at.init = 1,
  2058. pe("moveStart"),
  2059. y(ot),
  2060. M())
  2061. }
  2062. ,
  2063. ye.stop = function() {
  2064. "button" === at.source && (at.init = 0,
  2065. at.released = 1)
  2066. }
  2067. ,
  2068. ye.prev = function() {
  2069. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2070. }
  2071. ,
  2072. ye.next = function() {
  2073. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2074. }
  2075. ,
  2076. ye.prevPage = function() {
  2077. ye.activatePage(Oe.activePage - 1)
  2078. }
  2079. ,
  2080. ye.nextPage = function() {
  2081. ye.activatePage(Oe.activePage + 1)
  2082. }
  2083. ,
  2084. ye.slideBy = function(e, t) {
  2085. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2086. }
  2087. ,
  2088. ye.slideTo = function(e, t) {
  2089. X(e, t)
  2090. }
  2091. ,
  2092. ye.toStart = function(e, t) {
  2093. L("start", e, t)
  2094. }
  2095. ,
  2096. ye.toEnd = function(e, t) {
  2097. L("end", e, t)
  2098. }
  2099. ,
  2100. ye.toCenter = function(e, t) {
  2101. L("center", e, t)
  2102. }
  2103. ,
  2104. ye.getIndex = R,
  2105. ye.activate = function(e, t) {
  2106. var a = W(e);
  2107. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2108. }
  2109. ,
  2110. ye.activatePage = function(e, t) {
  2111. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2112. }
  2113. ,
  2114. ye.resume = function(e) {
  2115. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2116. st ? st = clearTimeout(st) : pe("resume"),
  2117. st = setTimeout(function() {
  2118. switch (pe("cycle"),
  2119. ge.cycleBy) {
  2120. case "items":
  2121. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2122. break;
  2123. case "pages":
  2124. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2125. }
  2126. }, ge.cycleInterval))
  2127. }
  2128. ,
  2129. ye.pause = function(e) {
  2130. e < ye.isPaused || (ye.isPaused = e || 100,
  2131. st && (st = clearTimeout(st),
  2132. pe("pause")))
  2133. }
  2134. ,
  2135. ye.toggle = function() {
  2136. ye[st ? "pause" : "resume"]()
  2137. }
  2138. ,
  2139. ye.set = function(t, a) {
  2140. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2141. }
  2142. ,
  2143. ye.add = function(t, a) {
  2144. var n = e(t);
  2145. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2146. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2147. H()
  2148. }
  2149. ,
  2150. ye.remove = function(t) {
  2151. if (Re) {
  2152. var a = U(t);
  2153. if (a > -1) {
  2154. qe.eq(a).remove();
  2155. var n = a === Oe.activeItem;
  2156. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2157. H(),
  2158. n && (_e.active = null,
  2159. ye.activate(Oe.activeItem))
  2160. }
  2161. } else
  2162. e(t).remove(),
  2163. H()
  2164. }
  2165. ,
  2166. ye.moveAfter = function(e, t) {
  2167. G(e, t, 1)
  2168. }
  2169. ,
  2170. ye.moveBefore = function(e, t) {
  2171. G(e, t)
  2172. }
  2173. ,
  2174. ye.on = function(e, t) {
  2175. if ("object" === i(e))
  2176. for (var a in e)
  2177. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2178. else if ("function" === i(t))
  2179. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2180. Ve[n[r]] = Ve[n[r]] || [],
  2181. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2182. else if ("array" === i(t))
  2183. for (var o = 0, l = t.length; l > o; o++)
  2184. ye.on(e, t[o])
  2185. }
  2186. ,
  2187. ye.one = function(e, t) {
  2188. function a() {
  2189. t.apply(ye, arguments),
  2190. ye.off(e, a)
  2191. }
  2192. ye.on(e, a)
  2193. }
  2194. ,
  2195. ye.off = function(e, t) {
  2196. if (t instanceof Array)
  2197. for (var a = 0, n = t.length; n > a; a++)
  2198. ye.off(e, t[a]);
  2199. else
  2200. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2201. if (Ve[i[r]] = Ve[i[r]] || [],
  2202. null == t)
  2203. Ve[i[r]].length = 0;
  2204. else {
  2205. var o = J(i[r], t);
  2206. -1 !== o && Ve[i[r]].splice(o, 1)
  2207. }
  2208. }
  2209. ,
  2210. ye.destroy = function() {
  2211. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2212. b.off("keydown", de),
  2213. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2214. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2215. De.empty(),
  2216. we || (be.off("." + g),
  2217. He.restore(),
  2218. Xe.restore(),
  2219. Ye.restore(),
  2220. je.restore(),
  2221. e.removeData(t, g)),
  2222. Ne.length = Ee.length = 0,
  2223. _e = {},
  2224. ye.initialized = 0,
  2225. ye
  2226. }
  2227. ,
  2228. ye.init = function() {
  2229. if (!ye.initialized) {
  2230. ye.on(m);
  2231. var e = ["overflow", "position"]
  2232. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2233. He.save.apply(He, e),
  2234. Ye.save.apply(Ye, e),
  2235. Xe.save.apply(Xe, t),
  2236. je.save.apply(je, t);
  2237. var a = Se;
  2238. return we || (a = a.add(Pe),
  2239. be.css("overflow", "hidden"),
  2240. f || "static" !== be.css("position") || be.css("position", "relative")),
  2241. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2242. a.css({
  2243. position: "absolute"
  2244. })),
  2245. ge.forward && $e.on(S, se),
  2246. ge.backward && Qe.on(S, se),
  2247. ge.prev && Ze.on(B, se),
  2248. ge.next && Ge.on(B, se),
  2249. ge.prevPage && Je.on(B, se),
  2250. ge.nextPage && Ke.on(B, se),
  2251. Ue.on(C, le),
  2252. Be[0] && Be.on(B, ce),
  2253. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2254. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2255. We.on(P, {
  2256. source: "slidee"
  2257. }, te),
  2258. Se && Se.on(P, {
  2259. source: "handle"
  2260. }, te),
  2261. b.on("keydown", de),
  2262. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2263. be.on("scroll." + g, o)),
  2264. ye.initialized = 1,
  2265. H(!0),
  2266. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2267. ye
  2268. }
  2269. }
  2270. }
  2271. function i(e) {
  2272. 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
  2273. }
  2274. function r(e, t) {
  2275. e.preventDefault(),
  2276. t && e.stopPropagation()
  2277. }
  2278. function s(t) {
  2279. r(t, 1),
  2280. e(this).off(t.type, s)
  2281. }
  2282. function o() {
  2283. this.scrollLeft = 0,
  2284. this.scrollTop = 0
  2285. }
  2286. function l(e) {
  2287. return !isNaN(parseFloat(e)) && isFinite(e)
  2288. }
  2289. function c(e, t) {
  2290. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2291. }
  2292. function d(e, t, a) {
  2293. return t > e ? t : e > a ? a : e
  2294. }
  2295. function u(e) {
  2296. var t = {};
  2297. return t.style = {},
  2298. t.save = function() {
  2299. if (e && e.nodeType) {
  2300. for (var a = 0; a < arguments.length; a++)
  2301. t.style[arguments[a]] = e.style[arguments[a]];
  2302. return t
  2303. }
  2304. }
  2305. ,
  2306. t.restore = function() {
  2307. if (e && e.nodeType) {
  2308. for (var a in t.style)
  2309. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2310. return t
  2311. }
  2312. }
  2313. ,
  2314. t
  2315. }
  2316. var f, v, p, h = "sly", m = "Sly", g = h, y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame, w = t.requestAnimationFrame, b = e(document), P = "touchstart." + g + " mousedown." + g, I = "mousemove." + g + " mouseup." + g, z = "touchmove." + g + " touchend." + g, C = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + g, B = "click." + g, S = "mousedown." + g, k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], T = [], x = Math.abs, D = Math.sqrt, A = Math.pow, E = Math.round, q = Math.max, N = Math.min, O = 0;
  2317. b.on(C, function(e) {
  2318. var t = e.originalEvent[g]
  2319. , a = +new Date;
  2320. (!t || t.options.scrollHijack < a - O) && (O = a)
  2321. }),
  2322. function(e) {
  2323. function t(e) {
  2324. var t = (new Date).getTime()
  2325. , n = Math.max(0, 16 - (t - a))
  2326. , i = setTimeout(e, n);
  2327. return a = t,
  2328. i
  2329. }
  2330. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2331. var a = (new Date).getTime()
  2332. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2333. y = function(t) {
  2334. n.call(e, t)
  2335. }
  2336. }(window),
  2337. function() {
  2338. function e(e) {
  2339. for (var n = 0, i = t.length; i > n; n++) {
  2340. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2341. if (null != a.style[r])
  2342. return r
  2343. }
  2344. }
  2345. var t = ["", "webkit", "moz", "ms", "o"]
  2346. , a = document.createElement("div");
  2347. f = e("transform"),
  2348. v = e("perspective") ? "translateZ(0) " : ""
  2349. }(),
  2350. t[m] = n,
  2351. e.fn[h] = function(t, a) {
  2352. var r, s;
  2353. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2354. s = Array.prototype.slice.call(arguments, 1)),
  2355. t = {}),
  2356. this.each(function(i, o) {
  2357. var l = e.data(o, g);
  2358. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2359. })
  2360. }
  2361. ,
  2362. n.defaults = {
  2363. slidee: null,
  2364. horizontal: !1,
  2365. itemNav: null,
  2366. itemSelector: null,
  2367. smart: !1,
  2368. activateOn: null,
  2369. activateMiddle: !1,
  2370. scrollSource: null,
  2371. scrollBy: 0,
  2372. scrollHijack: 300,
  2373. scrollTrap: !1,
  2374. dragSource: null,
  2375. mouseDragging: !1,
  2376. touchDragging: !1,
  2377. releaseSwing: !1,
  2378. swingSpeed: .2,
  2379. elasticBounds: !1,
  2380. interactive: null,
  2381. scrollBar: null,
  2382. dragHandle: !1,
  2383. dynamicHandle: !1,
  2384. minHandleSize: 50,
  2385. clickBar: !1,
  2386. syncSpeed: .5,
  2387. pagesBar: null,
  2388. activatePageOn: null,
  2389. pageBuilder: function(e) {
  2390. return "<li>" + (e + 1) + "</li>"
  2391. },
  2392. forward: null,
  2393. backward: null,
  2394. prev: null,
  2395. next: null,
  2396. prevPage: null,
  2397. nextPage: null,
  2398. cycleBy: null,
  2399. cycleInterval: 5e3,
  2400. pauseOnHover: !1,
  2401. startPaused: !1,
  2402. moveBy: 300,
  2403. speed: 0,
  2404. easing: "swing",
  2405. startAt: null,
  2406. keyboardNavBy: null,
  2407. draggedClass: "dragged",
  2408. activeClass: "active",
  2409. disabledClass: "disabled"
  2410. }
  2411. }(jQuery, window);
  2412. !function e(t, i, n) {
  2413. function r(a, s) {
  2414. if (!i[a]) {
  2415. if (!t[a]) {
  2416. var l = "function" == typeof require && require;
  2417. if (!s && l)
  2418. return l(a, !0);
  2419. if (o)
  2420. return o(a, !0);
  2421. var c = new Error("Cannot find module '" + a + "'");
  2422. throw c.code = "MODULE_NOT_FOUND",
  2423. c
  2424. }
  2425. var h = i[a] = {
  2426. exports: {}
  2427. };
  2428. t[a][0].call(h.exports, function(e) {
  2429. var i = t[a][1][e];
  2430. return r(i ? i : e)
  2431. }, h, h.exports, e, t, i, n)
  2432. }
  2433. return i[a].exports
  2434. }
  2435. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2436. r(n[a]);
  2437. return r
  2438. }({
  2439. 1: [function(e, t, i) {
  2440. (function(i) {
  2441. "use strict";
  2442. function n(e) {
  2443. this.player = null,
  2444. this.director = null,
  2445. this.modelManager = null,
  2446. this.container = null,
  2447. this.tagManager = null,
  2448. this.fadeInSpeed = e,
  2449. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2450. }
  2451. var r = e("three")
  2452. , o = e("./util/logger")
  2453. , a = (e("./util/common"),
  2454. e("./enum/PlayerEvents"))
  2455. , s = e("./enum/DirectorEvents")
  2456. , l = e("./settings")
  2457. , c = e("./enum/Viewmode")
  2458. , h = (e("./enum/WarpStyle"),
  2459. e("./enum/BlackoutStyle"),
  2460. e("./enum/ModelManagerEvents"))
  2461. , u = e("./enum/tagEvents")
  2462. , d = e("./util/transitions")
  2463. , p = e("./util/lerp")
  2464. , f = new o(i);
  2465. n.prototype.init = function(e, t, i, n, r) {
  2466. this.player = t,
  2467. this.director = e,
  2468. this.modelManager = i,
  2469. this.tagManager = n,
  2470. this.container = r,
  2471. this.updateModel(),
  2472. this.bindEvents()
  2473. }
  2474. ,
  2475. n.prototype.bindEvents = function() {
  2476. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2477. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2478. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2479. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2480. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2481. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2482. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2483. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2484. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2485. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2486. }
  2487. ,
  2488. n.prototype.updateModel = function() {
  2489. this.model = this.modelManager.getActiveModel()
  2490. }
  2491. ,
  2492. n.prototype.handleWarpStarted = function() {
  2493. this.hidePlayerReticule()
  2494. }
  2495. ,
  2496. n.prototype.ontagActivated = function() {
  2497. this.hidePlayerReticule()
  2498. }
  2499. ,
  2500. n.prototype.onNavigationTotag = function() {
  2501. this.hidePlayerReticule()
  2502. }
  2503. ,
  2504. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2505. var n = this.modelManager.getActiveModel()
  2506. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2507. n.fadePanoMarkers(r),
  2508. n.setMode(t)
  2509. }
  2510. ,
  2511. n.prototype.handlePlayerModeChanged = function(e, t) {
  2512. var i = this.modelManager.getActiveModel()
  2513. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2514. i.setSide(n),
  2515. i.setMode(t)
  2516. }
  2517. ,
  2518. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2519. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2520. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2521. }
  2522. ,
  2523. n.prototype.handleActionInterruption = function() {}
  2524. ,
  2525. n.prototype.handleStartInside = function(e) {
  2526. var t = l[this.player.mode]
  2527. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2528. this.fadeIn(this.fadeInSpeed),
  2529. this.model.alpha = 0,
  2530. this.model.skybox.material.uniforms.opacity.value = 1,
  2531. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2532. var n = this.player.reticule;
  2533. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2534. }
  2535. ,
  2536. n.prototype.handleStartOutside = function(e) {
  2537. this.fadeIn(e)
  2538. }
  2539. ,
  2540. n.prototype.fadeIn = function(e) {
  2541. null !== e && void 0 !== e || (e = 2e3,
  2542. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2543. $(this.container).fadeIn(e)
  2544. }
  2545. ,
  2546. n.prototype.hidePlayerReticule = function() {
  2547. this.player.reticule.hide()
  2548. }
  2549. ,
  2550. t.exports = n
  2551. }
  2552. ).call(this, "/js/DisplayController.js")
  2553. }
  2554. , {
  2555. "./enum/BlackoutStyle": 18,
  2556. "./enum/DirectorEvents": 23,
  2557. "./enum/tagEvents": 32,
  2558. "./enum/ModelManagerEvents": 33,
  2559. "./enum/PlayerEvents": 40,
  2560. "./enum/Viewmode": 51,
  2561. "./enum/WarpStyle": 52,
  2562. "./settings": 166,
  2563. "./util/common": 185,
  2564. "./util/lerp": 188,
  2565. "./util/logger": 189,
  2566. "./util/transitions": 195,
  2567. three: 217
  2568. }],
  2569. 2: [function(e, t, i) {
  2570. "use strict";
  2571. function n() {
  2572. this.baseStartTime = performance.timing.navigationStart,
  2573. this.loadingStartTime = null,
  2574. this.waitingStartTime = null,
  2575. this.appReadyTime = null
  2576. }
  2577. n.prototype.setBaseStartTime = function(e) {
  2578. this.baseStartTime = e || Date.now()
  2579. }
  2580. ,
  2581. n.prototype.setWaitingStartTime = function(e) {
  2582. this.waitingStartTime = e || Date.now()
  2583. }
  2584. ,
  2585. n.prototype.setLoadingStartTime = function(e) {
  2586. this.loadingStartTime = e || Date.now()
  2587. }
  2588. ,
  2589. n.prototype.setAppReadyTime = function(e) {
  2590. this.appReadyTime = e || Date.now()
  2591. }
  2592. ,
  2593. n.prototype.calcFullLoadingTime = function() {
  2594. var e = this.appReadyTime - this.baseStartTime;
  2595. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2596. e
  2597. }
  2598. ,
  2599. t.exports = n
  2600. }
  2601. , {}],
  2602. 3: [function(e, t, i) {
  2603. (function(i) {
  2604. "use strict";
  2605. function n() {
  2606. return 100 * Math.random()
  2607. }
  2608. var r = e("./util/logger")
  2609. , o = e("./util/browser")
  2610. , a = new r(i)
  2611. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2612. initialized: !1,
  2613. init: function(e, t) {
  2614. if (t = t || {},
  2615. !this.initialized) {
  2616. this.initialized = !0,
  2617. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2618. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2619. for (var i in e) {
  2620. var r = i.match("^sc_tilegen_([0-9]+)$");
  2621. r && (s.tilegen = n() < parseInt(r[1]));
  2622. var l = i.match("^sc_imgopt_([0-9]+)$");
  2623. l && (s.imgopt = n() < parseInt(l[1]))
  2624. }
  2625. for (var c in t)
  2626. s[c] = t[c],
  2627. a.debug("A/B override:", c, s[c])
  2628. }
  2629. },
  2630. changeIfTileGenerating: function(e) {
  2631. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2632. e += "imgopt=1"),
  2633. e
  2634. },
  2635. changeIfImageOptimzing: function(e) {
  2636. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2637. e += "imgopt=1"),
  2638. e
  2639. },
  2640. tilegen: !1,
  2641. imgopt: !1
  2642. };
  2643. t.exports = s
  2644. }
  2645. ).call(this, "/js/ab.js")
  2646. }
  2647. , {
  2648. "./util/browser": 182,
  2649. "./util/logger": 189
  2650. }],
  2651. 4: [function(e, t, i) {
  2652. (function(i) {
  2653. "use strict";
  2654. function n() {
  2655. return {
  2656. addons: [{
  2657. name: "keen:ua_parser",
  2658. input: {
  2659. ua_string: "user_agent"
  2660. },
  2661. output: "parsed_user_agent"
  2662. }]
  2663. }
  2664. }
  2665. function r(e, t, i, n) {
  2666. function r(t) {
  2667. l[t.sid] = !0;
  2668. var i = t.billboard.media && t.billboard.media.type
  2669. , n = {
  2670. tag_id: t.sid,
  2671. tags_visited: Object.keys(l).length,
  2672. tag_count: Object.keys(e.tags).length,
  2673. tag_view_count: ++E,
  2674. has_media: !!i
  2675. };
  2676. i && (n.media_type = i),
  2677. u("tag_opened", n)
  2678. }
  2679. var l = {}
  2680. , h = Date.now() - N
  2681. , f = null;
  2682. n && (f = Date.now() - window.navigationStart);
  2683. var g;
  2684. try {
  2685. g = e.data.player_options.highlight_reel && e.heroLocations.length > 1
  2686. } catch (e) {
  2687. g = !1
  2688. }
  2689. var v, A = e.supportsVR;
  2690. A || (v = "VR disabled at the model/account level",
  2691. m.valueFromHash("vr") === _.NONE ? v = "VR disabled, using &vr=0" : m.detectAndroid() ? b.isDeviceSupported(w.Android) || (v = "VR disabled, unsupported Android version") : m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = "VR disabled, unsupported iOS version"))),
  2692. u("model_loaded", {
  2693. duration: h,
  2694. duration_from_navigation_start: f,
  2695. has_hlr: g,
  2696. has_vr: A,
  2697. vr_reason: v
  2698. });
  2699. var I = 0;
  2700. e.panos.forEach(function(e) {
  2701. e.on("enter", function() {
  2702. c("pano_viewed", {
  2703. pano_id: e.id,
  2704. pano_view_count: ++I,
  2705. alignment_type: e.alignmentType,
  2706. interaction_source: O,
  2707. navigation_source: p
  2708. })
  2709. })
  2710. });
  2711. var E = 0;
  2712. for (var T in e.tags)
  2713. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2714. t.on("tour_auto", function(e) {
  2715. p = "tour_" + e
  2716. }),
  2717. t.on("tour_manual", function(e) {
  2718. O = "gui-" + e,
  2719. p = "tour_manual"
  2720. }),
  2721. i.on(C.InteractionKey, function() {
  2722. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2723. }),
  2724. i.on(C.InteractionDirect, function() {
  2725. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2726. }),
  2727. o(t),
  2728. a(),
  2729. s()
  2730. }
  2731. function o(e) {
  2732. I.on(T.OPENED, function() {
  2733. c("showcase_share_intent", {
  2734. pano_id: e.currentPano && e.currentPano.id
  2735. })
  2736. }),
  2737. I.on(T.LINK_CLICKED, function(t) {
  2738. c("showcase_share_action", {
  2739. channel: t.channel,
  2740. pano_id: e.currentPano && e.currentPano.id
  2741. })
  2742. }),
  2743. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2744. c("showcase_share_origin_link_clicked")
  2745. })
  2746. }
  2747. function a() {}
  2748. function s() {
  2749. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2750. gui_action: "click_vr_button"
  2751. })),
  2752. b.on(S.LAUNCH, function(e) {
  2753. c("showcase_gui", {
  2754. gui_action: "launch_vr",
  2755. vr_platform: e.vr_platform,
  2756. vr_app: e.vr_app
  2757. })
  2758. }),
  2759. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2760. gui_action: "vr_modal_prev"
  2761. })),
  2762. b.on(S.NEXT, function(e) {
  2763. c("showcase_gui", {
  2764. gui_action: e.nextAction
  2765. })
  2766. }),
  2767. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2768. gui_action: "vr_modal_close"
  2769. })),
  2770. b.on(S.falseICECHOSEN, function(e) {
  2771. c("showcase_gui", {
  2772. gui_action: e.name + " "
  2773. })
  2774. }),
  2775. b.on(S.STORE, function(e) {
  2776. c("showcase_gui", {
  2777. gui_action: "launch_store",
  2778. store: e
  2779. })
  2780. })
  2781. }
  2782. function l(e, t) {
  2783. if (f)
  2784. try {
  2785. f.addEvent(e, v.extendObject({
  2786. host: window.location.host,
  2787. keen: n(),
  2788. user_agent: "${keen.user_agent}",
  2789. referrer: {
  2790. url: v.normalizeUrl(document.referrer),
  2791. domain: v.domainFromUrl(document.referrer),
  2792. url_original: document.referrer
  2793. },
  2794. embedded: m.inIframe(),
  2795. is_mobile: m.isMobile(),
  2796. version: "2.25.6-0-gd87e5b1"
  2797. }, t))
  2798. } catch (e) {
  2799. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2800. }
  2801. }
  2802. function c(e, t) {
  2803. if (t = t || {},
  2804. L)
  2805. try {
  2806. window.analytics.track(e, v.extendObject(t, B), {
  2807. context: {
  2808. app: {
  2809. name: "showcase",
  2810. version: "2.25.6-0-gd87e5b1"
  2811. },
  2812. screen: {
  2813. width: window.screen.width,
  2814. height: window.screen.height,
  2815. density: window.devicePixelRatio
  2816. }
  2817. }
  2818. })
  2819. } catch (t) {
  2820. console.warn("Failed to send data to segment for " + e)
  2821. }
  2822. }
  2823. function h(e, t) {
  2824. if (t = t || {},
  2825. navigator.sendBeacon && L)
  2826. try {
  2827. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2828. event: e,
  2829. anonymousId: window.analytics.user().anonymousId(),
  2830. properties: v.extendObject(t, B),
  2831. writeKey: L,
  2832. sentAt: Date.now(),
  2833. type: "track",
  2834. context: {
  2835. userAgent: m.userAgent(),
  2836. library: {
  2837. name: "showcase-beacon",
  2838. version: "2.25.6-0-gd87e5b1"
  2839. },
  2840. app: {
  2841. name: "showcase",
  2842. version: "2.25.6-0-gd87e5b1"
  2843. }
  2844. }
  2845. }))
  2846. } catch (e) {
  2847. console.warn("Failed to send async segment request")
  2848. }
  2849. }
  2850. function u(e, t) {
  2851. t = t || {},
  2852. c(e, t)
  2853. }
  2854. function d(e, t) {
  2855. O = e === C.InteractionGui ? "gui-" + t : e,
  2856. p = "self_guided"
  2857. }
  2858. var p, f, g = (e("three"),
  2859. e("./util/ajax"),
  2860. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2861. e("./enum/Viewmode")), C = e("./enum/ControlEvents"), I = e("./gui/sharing/modal"), E = e("./gui/title/titleBar"), b = e("./gui/vr/vrModal"), w = e("./enum/VRPlatforms"), _ = e("./enum/VROption"), T = e("./gui/sharing/ShareEvents"), x = e("./gui/title/TitleEvents"), S = e("./gui/vr/vrEvent"), M = e("./tag/Billboard/BillboardEvent"), R = e("./util/logger"), P = new R(i), O = (e("./enum/PlayerEvents"),
  2862. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2863. t.exports = {
  2864. report: function(e, t, i, n) {
  2865. l("Session starts", {
  2866. model: e,
  2867. status: t,
  2868. loadtime: Date.now() - (N || Date.now()),
  2869. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2870. autoplay: i,
  2871. quickstart: n,
  2872. ab_tilegen: g.tilegen,
  2873. ab_imgopt: g.imgopt
  2874. })
  2875. },
  2876. impression: function(e) {
  2877. e = e || {};
  2878. var t = void 0 === e.isVisible || e.isVisible
  2879. , i = (void 0 !== e.immediate && e.immediate,
  2880. window.location.search.substr(1).split("&"));
  2881. u("impression", {
  2882. visible: t,
  2883. url_params: i
  2884. })
  2885. },
  2886. initKeen: function(e) {
  2887. return e.token && e.appId ? void (f = new Keen({
  2888. projectId: e.appId,
  2889. writeKey: e.token,
  2890. readKey: "",
  2891. requestType: "xhr"
  2892. })) : void P.warn("no keen token/appId")
  2893. },
  2894. initSegment: function(e) {
  2895. return e.token ? (L = e.token,
  2896. window.analytics.load(e.token),
  2897. B = {
  2898. model_id: e.model,
  2899. start_source: e.startSource,
  2900. autoplay: e.autoplay,
  2901. quickstart: e.quickstart,
  2902. language_tag: A.languageTag,
  2903. is_mobile: m.isMobile(),
  2904. iframe: m.inIframe(),
  2905. aspect_ratio: m.aspectRatio(),
  2906. session_id: F,
  2907. window: {
  2908. width: $("#player").width(),
  2909. height: $("#player").height()
  2910. },
  2911. platform: {
  2912. browser: {
  2913. name: $.ua.browser.name,
  2914. major: $.ua.browser.major,
  2915. version: $.ua.browser.version
  2916. },
  2917. os: {
  2918. name: $.ua.os.name,
  2919. version: $.ua.os.version
  2920. },
  2921. device: {
  2922. vendor: $.ua.device.vendor,
  2923. model: $.ua.device.model,
  2924. type: $.ua.device.type
  2925. }
  2926. }
  2927. },
  2928. D = Math.random() < A.analytics.sessionTrackingRate,
  2929. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2930. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2931. },
  2932. sessionStart: function(e) {
  2933. P.debug("analytics user_session_start"),
  2934. c("session_started"),
  2935. N = Date.now(),
  2936. window.addEventListener("unload", function() {
  2937. h("session_ended", {
  2938. duration: Date.now() - N
  2939. })
  2940. })
  2941. },
  2942. modelLoaded: function(e, t, i, n) {
  2943. r(e, t, i, n)
  2944. },
  2945. loadComplete: function(e) {
  2946. var t = {
  2947. time_to_app_start: e
  2948. };
  2949. c("load_times", t)
  2950. },
  2951. track: function(e, t) {
  2952. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2953. c(e, t))
  2954. },
  2955. trackAlways: function(e, t) {
  2956. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2957. c(e, t)
  2958. },
  2959. getSessionId: function() {
  2960. return F
  2961. },
  2962. updateInteraction: d
  2963. }
  2964. }
  2965. ).call(this, "/js/analytics.js")
  2966. }
  2967. , {
  2968. "./ab": 3,
  2969. "./enum/ControlEvents": 21,
  2970. "./enum/PlayerEvents": 40,
  2971. "./enum/VROption": 47,
  2972. "./enum/VRPlatforms": 49,
  2973. "./enum/Viewmode": 51,
  2974. "./gui/sharing/ShareEvents": 76,
  2975. "./gui/sharing/modal": 77,
  2976. "./gui/title/TitleEvents": 80,
  2977. "./gui/title/titleBar": 82,
  2978. "./gui/vr/vrEvent": 85,
  2979. "./gui/vr/vrModal": 87,
  2980. "./localization/localize": 108,
  2981. "./tag/Billboard/BillboardEvent": 120,
  2982. "./settings": 166,
  2983. "./util/ajax": 181,
  2984. "./util/browser": 182,
  2985. "./util/common": 185,
  2986. "./util/logger": 189,
  2987. three: 217
  2988. }],
  2989. 5: [function(e, t, i) {
  2990. "use strict";
  2991. function n() {
  2992. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2993. this.controls = null
  2994. }
  2995. var r = e("three")
  2996. , o = e("../constants")
  2997. , a = e("../util/cameraLight");
  2998. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  2999. n.prototype.updateAspect = function(e) {
  3000. this.aspect = e,
  3001. this.updateProjectionMatrix()
  3002. }
  3003. ,
  3004. t.exports = n
  3005. }
  3006. , {
  3007. "../constants": 8,
  3008. "../util/cameraLight": 184,
  3009. three: 217
  3010. }],
  3011. 6: [function(e, t, i) {
  3012. "use strict";
  3013. function n() {
  3014. var e = $("#player").width() / $("#player").height();
  3015. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3016. this.controls = null,
  3017. this.updateAspect(e)
  3018. }
  3019. var r = e("three")
  3020. , o = e("../constants");
  3021. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3022. n.prototype.updateAspect = function(e) {
  3023. this.aspect = e,
  3024. this.top = o.orthoBase / e,
  3025. this.bottom = -o.orthoBase / e,
  3026. this.updateProjectionMatrix()
  3027. }
  3028. ,
  3029. t.exports = n
  3030. }
  3031. , {
  3032. "../constants": 8,
  3033. three: 217
  3034. }],
  3035. 7: [function(e, t, i) {
  3036. "use strict";
  3037. function n() {
  3038. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3039. this.controls = null
  3040. }
  3041. var r = e("three")
  3042. , o = e("../settings")
  3043. , a = e("../util/cameraLight");
  3044. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3045. n.prototype.updateAspect = function(e) {
  3046. this.aspect = e,
  3047. this.updateProjectionMatrix()
  3048. }
  3049. ,
  3050. t.exports = n
  3051. }
  3052. , {
  3053. "../settings": 166,
  3054. "../util/cameraLight": 184,
  3055. three: 217
  3056. }],
  3057. 8: [function(e, t, i) {
  3058. "use strict";
  3059. t.exports = {
  3060. signedUrlDefaultExpireTime: 24e4,
  3061. signedUrlCheckInterval: 1e4,
  3062. signedUrlRefreshBuffer: 15e3,
  3063. dollhouseFOV: 70,
  3064. dollhouseNear: 1,
  3065. dollhouseFar: 5e3,
  3066. insideFOV: 70,
  3067. insideFOVMax: 120,
  3068. insideNear: .1,
  3069. insideFar: 5e3,
  3070. insideLookSpeed: .12,
  3071. insideLookLimitUp: 40,
  3072. insideLookLimitDown: -40,
  3073. orthoNear: 1,
  3074. orthoFar: 5e3,
  3075. orthoBase: 10,
  3076. narrowLandscapeHeight: 290,
  3077. reallyNarrowLandscapeHeight: 250,
  3078. visionTilingStartDate: new Date("8/26/2016"),
  3079. visionTilingStartVersion: "1.1.407.13667",
  3080. windowHeightHighQualityThreshold: 900,
  3081. tourStepDelayDefault: 3500,
  3082. tourStepDelaySlideShow: 5e3,
  3083. workshopApsect: 9 / 16,
  3084. highQualityMaxZoom: 2,
  3085. ultraHighQualityMaxZoom: 3
  3086. }
  3087. }
  3088. , {}],
  3089. 9: [function(e, t, i) {
  3090. "use strict";
  3091. function n() {
  3092. this.activeControl = null,
  3093. this.controls = {},
  3094. this.cameras = {}
  3095. }
  3096. var r = e("./PanoramaControls")
  3097. , o = e("./DollhouseControls")
  3098. , a = e("./FloorplanControls")
  3099. , s = e("../cameras/PanoramaCamera")
  3100. , l = e("../cameras/DollhouseCamera")
  3101. , c = e("../cameras/FloorplanCamera")
  3102. , h = e("events").EventEmitter
  3103. , u = e("../enum/ControlEvents")
  3104. , d = e("../enum/ModelManagerEvents")
  3105. , p = e("../enum/Viewmode")
  3106. , f = e("../settings");
  3107. n.prototype = Object.create(h.prototype),
  3108. n.prototype.init = function(e, t) {
  3109. this.setUpControls(),
  3110. this.bindEvents(e, t)
  3111. }
  3112. ,
  3113. n.prototype.activateControls = function(e) {
  3114. this.activeControl && (this.activeControl.reset(),
  3115. this.activeControl.enabled = !1),
  3116. this.controls[e] && (this.controls[e].enabled = !0),
  3117. this.activeControl = this.controls[e]
  3118. }
  3119. ,
  3120. n.prototype.setUpControls = function() {
  3121. var e = {}
  3122. , t = {}
  3123. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3124. , n = [s, l, c]
  3125. , h = [r, o, a];
  3126. i.forEach(function(i, r) {
  3127. e[i] = new n[r],
  3128. t[i] = new h[r](e[i]),
  3129. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3130. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3131. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3132. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3133. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3134. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3135. }
  3136. .bind(this)),
  3137. this.controls = t,
  3138. this.cameras = e
  3139. }
  3140. ,
  3141. n.prototype.bindEvents = function(e, t) {
  3142. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3143. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3144. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3145. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3146. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this)),
  3147. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3148. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3149. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3150. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3151. e.addEventListener("contextmenu", function(e) {
  3152. e.preventDefault()
  3153. }),
  3154. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3155. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3156. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3157. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3158. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3159. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3160. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3161. t.on(d.ActiveModelChanged, function(e) {
  3162. this.setModelForControls(e.model)
  3163. }
  3164. .bind(this))
  3165. }
  3166. ,
  3167. n.prototype.setModelForControls = function(e) {
  3168. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3169. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3170. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3171. this.controls[e].setBounds(t)
  3172. }
  3173. .bind(this))
  3174. }
  3175. ,
  3176. n.prototype.onMouseDown = function(e) {
  3177. e.preventDefault(),
  3178. this.activeControl && this.activeControl.onMouseDown(e)
  3179. }
  3180. ,
  3181. n.prototype.onMouseMove = function(e) {
  3182. e.preventDefault(),
  3183. this.activeControl && this.activeControl.onMouseMove(e)
  3184. }
  3185. ,
  3186. n.prototype.onMouseUp = function(e) {
  3187. e.preventDefault(),
  3188. this.activeControl && this.activeControl.onMouseUp(e)
  3189. }
  3190. ,
  3191. n.prototype.onMouseOver = function(e) {
  3192. e.preventDefault(),
  3193. this.activeControl && this.activeControl.onMouseOver(e)
  3194. }
  3195. ,
  3196. n.prototype.onMouseWheel = function(e) {
  3197. e.preventDefault(),
  3198. this.activeControl && this.activeControl.onMouseWheel(e)
  3199. }
  3200. ,
  3201. n.prototype.onTouchStart = function(e) {
  3202. e.preventDefault(),
  3203. this.activeControl && this.activeControl.onTouchStart(e)
  3204. }
  3205. ,
  3206. n.prototype.onTouchMove = function(e) {
  3207. e.preventDefault(),
  3208. this.activeControl && this.activeControl.onTouchMove(e)
  3209. }
  3210. ,
  3211. n.prototype.onTouchEnd = function(e) {
  3212. e.preventDefault(),
  3213. this.activeControl && this.activeControl.onTouchEnd(e)
  3214. }
  3215. ,
  3216. n.prototype.onPointerDown = function(e) {
  3217. if (e.preventDefault(),
  3218. this.activeControl)
  3219. switch (e.pointerType) {
  3220. case "mouse":
  3221. this.activeControl.onMouseDown(e);
  3222. break;
  3223. default:
  3224. this.activeControl.onPointerDown(e)
  3225. }
  3226. }
  3227. ,
  3228. n.prototype.onPointerMove = function(e) {
  3229. if (e.preventDefault(),
  3230. this.activeControl)
  3231. switch (e.pointerType) {
  3232. case "mouse":
  3233. this.activeControl.onMouseMove(e);
  3234. break;
  3235. default:
  3236. this.activeControl.onPointerMove(e)
  3237. }
  3238. }
  3239. ,
  3240. n.prototype.onPointerUp = function(e) {
  3241. if (e.preventDefault(),
  3242. this.activeControl)
  3243. switch (e.pointerType) {
  3244. case "mouse":
  3245. this.activeControl.onMouseUp(e);
  3246. break;
  3247. default:
  3248. this.activeControl.onPointerUp(e)
  3249. }
  3250. }
  3251. ,
  3252. n.prototype.onPointerCancel = function(e) {
  3253. e.preventDefault(),
  3254. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3255. }
  3256. ,
  3257. n.prototype.onKeyDown = function(e) {
  3258. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3259. this.activeControl && this.activeControl.onKeyDown(e))
  3260. }
  3261. ,
  3262. n.prototype.onKeyUp = function(e) {
  3263. e.preventDefault(),
  3264. this.activeControl && this.activeControl.onKeyUp(e)
  3265. }
  3266. ,
  3267. t.exports = n
  3268. }
  3269. , {
  3270. "../cameras/DollhouseCamera": 5,
  3271. "../cameras/FloorplanCamera": 6,
  3272. "../cameras/PanoramaCamera": 7,
  3273. "../enum/ControlEvents": 21,
  3274. "../enum/ModelManagerEvents": 33,
  3275. "../enum/Viewmode": 51,
  3276. "../settings": 166,
  3277. "./DollhouseControls": 10,
  3278. "./FloorplanControls": 11,
  3279. "./PanoramaControls": 13,
  3280. events: 202
  3281. }],
  3282. 10: [function(e, t, i) {
  3283. "use strict";
  3284. function n(e) {
  3285. a.call(this, e),
  3286. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3287. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3288. this.minDistance = o.dollhouseDefault.minDistance,
  3289. this.maxDistance = o.dollhouseDefault.maxDistance,
  3290. this.adjustedMinDistance = this.minDistance,
  3291. this.adjustedMaxDistance = this.maxDistance
  3292. }
  3293. var r = e("three")
  3294. , o = e("../settings")
  3295. , a = e("./OutsideControls");
  3296. n.prototype = Object.create(a.prototype),
  3297. n.prototype.pan = function(e, t) {
  3298. this.camera.updateMatrix();
  3299. var i = this.camera.position.clone().sub(this.target).length();
  3300. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3301. this.panLeft(2 * e * i / $("#player").height()),
  3302. this.panUp(-2 * t * i / $("#player").height())
  3303. }
  3304. ,
  3305. n.prototype.updateZoom = function() {
  3306. var e = this.offset.length();
  3307. return e * this.scale
  3308. }
  3309. ,
  3310. n.prototype.setZoomBounds = function(e) {
  3311. var t = e.min.distanceTo(e.max);
  3312. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3313. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3314. this.minDistance = this.adjustedMinDistance,
  3315. this.maxDistance = this.adjustedMaxDistance
  3316. }
  3317. ,
  3318. n.prototype.resetRanges = function(e, t) {
  3319. e ? (this.minDistance = Math.min(e, this.minDistance),
  3320. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3321. this.maxDistance = this.adjustedMaxDistance),
  3322. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3323. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3324. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3325. }
  3326. ,
  3327. n.prototype.toJSON = function() {
  3328. return a.prototype.toJSON.call(this)
  3329. }
  3330. ,
  3331. t.exports = n
  3332. }
  3333. , {
  3334. "../settings": 166,
  3335. "./OutsideControls": 12,
  3336. three: 217
  3337. }],
  3338. 11: [function(e, t, i) {
  3339. "use strict";
  3340. function n(e) {
  3341. a.call(this, e),
  3342. this.minDistance = 15,
  3343. this.maxDistance = 50,
  3344. this.noRotateUpDown = !0,
  3345. this.minPolarAngle = 0,
  3346. this.maxPolarAngle = 0,
  3347. this.mouseActions[l.LEFT] = s.PAN,
  3348. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3349. this.mouseActions[l.RIGHT] = s.ROTATE,
  3350. this.touchActions[1] = s.PAN,
  3351. this.touchActions[2] = s.ROTATE_DOLLY,
  3352. this.absoluteScale = 1,
  3353. this.currentScale = 1
  3354. }
  3355. var r = e("three")
  3356. , o = e("../settings")
  3357. , a = e("./OutsideControls")
  3358. , s = e("../enum/ControlActions")
  3359. , l = e("../enum/MouseButton")
  3360. , c = e("../util/math")
  3361. , h = e("../util/browser");
  3362. n.prototype = Object.create(a.prototype),
  3363. n.prototype.zoomToContain = function(e) {
  3364. var t = Math.max(e.x, e.z)
  3365. , i = Math.min(e.x, e.z)
  3366. , n = Math.max(t, i * this.camera.aspect)
  3367. , r = Math.max(i, t * this.camera.aspect);
  3368. this.absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2,
  3369. this.currentScale = this.absoluteScale
  3370. }
  3371. ,
  3372. n.prototype.rotateToView = function(e, t) {
  3373. var i = 0
  3374. , n = h.aspectRatio() < 1
  3375. , r = e.x < e.z;
  3376. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3377. this.rotateLeft(i),
  3378. this.update(0)
  3379. }
  3380. ,
  3381. n.prototype.pan = function(e, t) {
  3382. this.camera.updateMatrix(),
  3383. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3384. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3385. }
  3386. ,
  3387. n.prototype.updateZoom = function() {
  3388. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3389. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3390. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3391. this.camera.left = -o.orthoBase * this.currentScale,
  3392. this.camera.right = o.orthoBase * this.currentScale,
  3393. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3394. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3395. this.camera.updateProjectionMatrix(),
  3396. this.offset.length()
  3397. }
  3398. ,
  3399. n.prototype.toJSON = function() {
  3400. var e = new r.Quaternion
  3401. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3402. , i = new r.Quaternion;
  3403. return function() {
  3404. var n = a.prototype.toJSON.call(this);
  3405. return e.copy(n.camera_quaternion),
  3406. i.copy(t),
  3407. i.multiply(e),
  3408. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3409. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3410. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3411. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3412. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3413. n
  3414. }
  3415. }(),
  3416. t.exports = n
  3417. }
  3418. , {
  3419. "../enum/ControlActions": 20,
  3420. "../enum/MouseButton": 34,
  3421. "../settings": 166,
  3422. "../util/browser": 182,
  3423. "../util/math": 190,
  3424. "./OutsideControls": 12,
  3425. three: 217
  3426. }],
  3427. 12: [function(e, t, i) {
  3428. "use strict";
  3429. function n(e) {
  3430. this.camera = e,
  3431. this.camera.controls = this,
  3432. this.enabled = !1,
  3433. this.target = new r.Vector3,
  3434. this.targetBounds = new r.Box3,
  3435. this.zoomSpeed = 1,
  3436. this.minDistance = 0,
  3437. this.maxDistance = 1 / 0,
  3438. this.noRotateUpDown = !1,
  3439. this.rotateSpeed = 1,
  3440. this.keyboardZoomSpeed = 0,
  3441. this.keyPanSpeed = 7,
  3442. this.autoRotate = !1,
  3443. this.autoRotateSpeed = 2,
  3444. this.autoPan = !1,
  3445. this.autoPanPosition = new r.Vector3,
  3446. this.minPolarAngle = r.Math.degToRad(25),
  3447. this.maxPolarAngle = r.Math.degToRad(65),
  3448. this.rotationAcceleration = new r.Vector2,
  3449. this.rotationSpeed = new r.Vector2,
  3450. this.panAcceleration = new r.Vector2,
  3451. this.panSpeed = new r.Vector2,
  3452. this.rotateStart = new r.Vector2,
  3453. this.rotateEnd = new r.Vector2,
  3454. this.rotateDelta = new r.Vector2,
  3455. this.panStart = new r.Vector2,
  3456. this.panEnd = new r.Vector2,
  3457. this.panDelta = new r.Vector2,
  3458. this.panOffset = new r.Vector3,
  3459. this.offset = new r.Vector3,
  3460. this.dollyStart = new r.Vector2,
  3461. this.dollyEnd = new r.Vector2,
  3462. this.dollyDelta = new r.Vector2,
  3463. this.phiDelta = 0,
  3464. this.thetaDelta = 0,
  3465. this.scale = 1,
  3466. this.panVector = new r.Vector3,
  3467. this.lastPosition = new r.Vector3,
  3468. this.state = c.NONE,
  3469. this.mouseActions = {},
  3470. this.mouseActions[h.LEFT] = c.ROTATE,
  3471. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3472. this.mouseActions[h.RIGHT] = c.PAN,
  3473. this.touchActions = {},
  3474. this.touchActions[1] = c.ROTATE,
  3475. this.touchActions[2] = c.PAN_DOLLY,
  3476. this.lastMoveTime = 0,
  3477. this.pointersLimit = 2,
  3478. this.pointers = []
  3479. }
  3480. var r = e("three")
  3481. , o = e("../settings")
  3482. , a = e("../util/common")
  3483. , s = e("../util/math")
  3484. , l = e("../enum/Vectors")
  3485. , c = e("../enum/ControlActions")
  3486. , h = e("../enum/MouseButton")
  3487. , u = e("../enum/Keys")
  3488. , d = e("../enum/ControlEvents")
  3489. , p = e("events").EventEmitter
  3490. , f = 1e-6;
  3491. n.prototype = Object.create(p.prototype),
  3492. n.prototype.setBounds = function(e) {
  3493. this.targetBounds = e
  3494. }
  3495. ,
  3496. n.prototype.isEngaged = function() {
  3497. return this.state !== c.NONE
  3498. }
  3499. ,
  3500. n.prototype.rotateLeft = function(e) {
  3501. void 0 === e && (e = this.getAutoRotationAngle()),
  3502. this.thetaDelta -= e
  3503. }
  3504. ,
  3505. n.prototype.rotateUp = function(e) {
  3506. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3507. this.phiDelta -= e)
  3508. }
  3509. ,
  3510. n.prototype.panLeft = function(e) {
  3511. var t = this.camera.matrix.elements;
  3512. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3513. this.panOffset.multiplyScalar(-e),
  3514. this.panVector.add(this.panOffset)
  3515. }
  3516. ,
  3517. n.prototype.panUp = function(e) {
  3518. var t = this.camera.matrix.elements;
  3519. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3520. this.panOffset.multiplyScalar(-e),
  3521. this.panVector.add(this.panOffset)
  3522. }
  3523. ,
  3524. n.prototype.startRotating = function(e, t) {
  3525. e && this.navRotationAcc("x", e),
  3526. t && this.navRotationAcc("y", t)
  3527. }
  3528. ,
  3529. n.prototype.stopRotating = function(e) {
  3530. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3531. this.navRotationAcc("x", 0),
  3532. this.navRotationAcc("y", 0)
  3533. }
  3534. ,
  3535. n.prototype.setAutoPanPosition = function(e, t) {
  3536. var i = new r.Vector3
  3537. , n = new r.Vector3;
  3538. return function(e, t) {
  3539. i.copy(this.camera.position),
  3540. void 0 === e && null === e || i.setX(e),
  3541. void 0 === t && null === t || i.setZ(t);
  3542. var r = this.camera.position.distanceTo(this.target)
  3543. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3544. this.targetClamped = !1,
  3545. n.copy(i).addScaledVector(o, r),
  3546. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3547. i.copy(n).addScaledVector(o, -r),
  3548. this.targetClamped = !0),
  3549. this.autoPanPosition.x = i.x,
  3550. this.autoPanPosition.z = i.z,
  3551. this.autoPan && this.stopAutoPanning()
  3552. }
  3553. }(),
  3554. n.prototype.stopAutoPanning = function() {
  3555. var e = this.autoPan;
  3556. this.autoPan = !1,
  3557. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3558. }
  3559. ,
  3560. n.prototype.dollyIn = function(e) {
  3561. void 0 === e && (e = this.getZoomScale()),
  3562. this.scale /= e
  3563. }
  3564. ,
  3565. n.prototype.dollyOut = function(e) {
  3566. void 0 === e && (e = this.getZoomScale()),
  3567. this.scale *= e
  3568. }
  3569. ,
  3570. n.prototype.updatePan = function(e) {
  3571. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3572. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3573. this.autoPan) {
  3574. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3575. t.setY(0).clampLength(0, 50 * e),
  3576. this.target.add(t),
  3577. this.camera.position.add(t),
  3578. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3579. this.stopAutoPanning())
  3580. }
  3581. }
  3582. ,
  3583. n.prototype.update = function(e) {
  3584. e || (e = 1 / 60),
  3585. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3586. this.rotateLeft(-this.rotationSpeed.x),
  3587. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3588. this.updatePan(e);
  3589. var t = this.camera.position;
  3590. this.offset.copy(t).sub(this.target);
  3591. var i = Math.atan2(this.offset.x, this.offset.z)
  3592. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3593. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3594. i += this.thetaDelta,
  3595. n += this.phiDelta,
  3596. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3597. n = Math.max(f, Math.min(Math.PI - f, n));
  3598. var r = this.updateZoom();
  3599. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3600. this.target.add(this.panVector),
  3601. this.targetBounds.clampPoint(this.target, this.target),
  3602. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3603. this.offset.y = r * Math.cos(n),
  3604. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3605. t.copy(this.target).add(this.offset),
  3606. this.camera.lookAt(this.target),
  3607. this.thetaDelta = 0,
  3608. this.phiDelta = 0,
  3609. this.scale = 1,
  3610. this.panVector.set(0, 0, 0),
  3611. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3612. }
  3613. ,
  3614. n.prototype.getAutoRotationAngle = function() {
  3615. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3616. }
  3617. ,
  3618. n.prototype.getZoomScale = function() {
  3619. return Math.pow(.95, this.zoomSpeed)
  3620. }
  3621. ,
  3622. n.prototype.onMouseDown = function(e) {
  3623. if (this.enabled) {
  3624. switch (e.preventDefault(),
  3625. this.stopAutoPanning(),
  3626. this.mouseDown = !0,
  3627. this.state = this.mouseActions[e.button],
  3628. this.state) {
  3629. case c.ROTATE:
  3630. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3631. this.rotationSpeed.set(0, 0);
  3632. break;
  3633. case c.DOLLY:
  3634. this.dollyStart.set(e.clientX, e.clientY);
  3635. break;
  3636. case c.PAN:
  3637. this.panStart.set(e.clientX, e.clientY)
  3638. }
  3639. this.emit(d.InputStart, "mouse")
  3640. }
  3641. }
  3642. ,
  3643. n.prototype.onMouseMove = function(e) {
  3644. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3645. switch (e.preventDefault(),
  3646. this.state) {
  3647. case c.ROTATE:
  3648. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3649. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3650. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3651. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3652. this.rotateStart.copy(this.rotateEnd);
  3653. break;
  3654. case c.DOLLY:
  3655. this.dollyEnd.set(e.clientX, e.clientY),
  3656. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3657. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3658. t.call(this),
  3659. this.dollyStart.copy(this.dollyEnd);
  3660. break;
  3661. case c.PAN:
  3662. this.panEnd.set(e.clientX, e.clientY),
  3663. this.panDelta.subVectors(this.panEnd, this.panStart),
  3664. this.pan(this.panDelta.x, this.panDelta.y),
  3665. this.panStart.copy(this.panEnd)
  3666. }
  3667. this.emit(d.Move, "mouse"),
  3668. this.lastMoveTime = e.timeStamp,
  3669. this.update()
  3670. }
  3671. }
  3672. ,
  3673. n.prototype.onMouseUp = function(e) {
  3674. this.enabled && (this.mouseDown = !1,
  3675. this.state = c.NONE,
  3676. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3677. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3678. this.update(),
  3679. this.rotationAcceleration.set(0, 0),
  3680. this.rotateDelta.set(0, 0)))
  3681. }
  3682. ,
  3683. n.prototype.onMouseOver = function(e) {
  3684. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3685. }
  3686. ,
  3687. n.prototype.onMouseWheel = function(e) {
  3688. if (this.enabled && o.useWheel) {
  3689. this.emit(d.Move, "wheel");
  3690. var t = e.wheelDelta || -e.detail
  3691. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3692. i.call(this),
  3693. this.update()
  3694. }
  3695. }
  3696. ,
  3697. n.prototype.onKeyDown = function(e) {
  3698. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3699. this.handleKeyDown(e.which)))
  3700. }
  3701. ,
  3702. n.prototype.navRotationAcc = function(e, t) {
  3703. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3704. }
  3705. ,
  3706. n.prototype.navPanAcc = function(e, t) {
  3707. this.stopAutoPanning(),
  3708. this.panAcceleration[e] = t
  3709. }
  3710. ,
  3711. n.prototype.handleKeyDown = function(e) {
  3712. var t = !0;
  3713. switch (e) {
  3714. case u.UPARROW:
  3715. case u.I:
  3716. this.navRotationAcc("y", 1);
  3717. break;
  3718. case u.DOWNARROW:
  3719. case u.K:
  3720. this.navRotationAcc("y", -1);
  3721. break;
  3722. case u.LEFTARROW:
  3723. case u.J:
  3724. this.navRotationAcc("x", -1);
  3725. break;
  3726. case u.RIGHTARROW:
  3727. case u.L:
  3728. this.navRotationAcc("x", 1);
  3729. break;
  3730. case u.W:
  3731. this.navPanAcc("y", 1);
  3732. break;
  3733. case u.S:
  3734. this.navPanAcc("y", -1);
  3735. break;
  3736. case u.A:
  3737. this.navPanAcc("x", -1);
  3738. break;
  3739. case u.D:
  3740. this.navPanAcc("x", 1);
  3741. break;
  3742. default:
  3743. t = !1
  3744. }
  3745. t && this.emit(d.Move, "key")
  3746. }
  3747. ,
  3748. n.prototype.onKeyUp = function(e) {
  3749. this.enabled && (e.preventDefault(),
  3750. e.stopPropagation(),
  3751. this.handleKeyUp(e.which))
  3752. }
  3753. ,
  3754. n.prototype.handleKeyUp = function(e) {
  3755. switch (e) {
  3756. case u.I:
  3757. case u.K:
  3758. case u.UPARROW:
  3759. case u.DOWNARROW:
  3760. this.keyboardZoomSpeed = 0,
  3761. this.rotationAcceleration.y = 0;
  3762. break;
  3763. case u.J:
  3764. case u.L:
  3765. case u.LEFTARROW:
  3766. case u.RIGHTARROW:
  3767. this.rotationAcceleration.x = 0;
  3768. break;
  3769. case u.S:
  3770. case u.W:
  3771. this.panAcceleration.y = 0;
  3772. break;
  3773. case u.A:
  3774. case u.D:
  3775. this.panAcceleration.x = 0
  3776. }
  3777. }
  3778. ,
  3779. n.prototype.onTouchStart = function(e) {
  3780. if (this.enabled || this.state === c.NONE) {
  3781. e.preventDefault(),
  3782. e.stopPropagation(),
  3783. this.stopAutoPanning();
  3784. var t = function() {
  3785. if (2 === e.touches.length) {
  3786. var t = e.touches[0].pageX - e.touches[1].pageX
  3787. , i = e.touches[0].pageY - e.touches[1].pageY;
  3788. this.dollyStart.set(t, i)
  3789. }
  3790. }
  3791. .bind(this)
  3792. , i = function() {
  3793. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3794. }
  3795. .bind(this)
  3796. , n = function() {
  3797. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3798. }
  3799. .bind(this);
  3800. switch (this.state = this.touchActions[e.touches.length],
  3801. this.state) {
  3802. case c.PAN_DOLLY:
  3803. t();
  3804. case c.PAN:
  3805. i();
  3806. break;
  3807. case c.ROTATE_DOLLY:
  3808. t();
  3809. case c.ROTATE:
  3810. n()
  3811. }
  3812. this.rotationSpeed.set(0, 0),
  3813. this.emit(d.InputStart, "touch")
  3814. }
  3815. }
  3816. ,
  3817. n.prototype.onTouchMove = function(e) {
  3818. if (this.enabled && this.state !== c.NONE) {
  3819. e.preventDefault(),
  3820. e.stopPropagation();
  3821. var t = function() {
  3822. var t = e.touches[0].pageX - e.touches[1].pageX
  3823. , i = e.touches[0].pageY - e.touches[1].pageY;
  3824. this.dollyEnd.set(t, i);
  3825. var n = this.dollyStart.length() - this.dollyEnd.length();
  3826. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3827. this.dollyStart.copy(this.dollyEnd)
  3828. }
  3829. .bind(this)
  3830. , i = function() {
  3831. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3832. this.panDelta.subVectors(this.panEnd, this.panStart),
  3833. this.pan(this.panDelta.x, this.panDelta.y),
  3834. this.panStart.copy(this.panEnd),
  3835. this.rotateDelta.set(0, 0)
  3836. }
  3837. .bind(this)
  3838. , n = function() {
  3839. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3840. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3841. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3842. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3843. this.rotateStart.copy(this.rotateEnd)
  3844. }
  3845. .bind(this)
  3846. , r = function() {
  3847. if (2 === e.touches.length) {
  3848. var i = window.devicePixelRatio || 1
  3849. , r = e.touches[1].pageX - e.touches[0].pageX
  3850. , s = e.touches[1].pageY - e.touches[0].pageY
  3851. , l = Math.sqrt(r * r + s * s)
  3852. , h = Math.abs(this.dollyStart.length() - l);
  3853. if (h > o.input.touchMoveThreshold * i)
  3854. this.state = c.DOLLY,
  3855. t();
  3856. else {
  3857. var u = a.average(e.touches, "pageX")
  3858. , d = a.average(e.touches, "pageY")
  3859. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3860. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3861. this.rotateStart.set(u, d),
  3862. n())
  3863. }
  3864. }
  3865. }
  3866. .bind(this);
  3867. switch (this.state) {
  3868. case c.PAN_DOLLY:
  3869. t();
  3870. case c.PAN:
  3871. i();
  3872. break;
  3873. case c.ROTATE_DOLLY:
  3874. r();
  3875. break;
  3876. case c.DOLLY:
  3877. t();
  3878. break;
  3879. case c.ROTATE:
  3880. n();
  3881. break;
  3882. default:
  3883. this.state = c.NONE
  3884. }
  3885. this.lastMoveTime = e.timeStamp,
  3886. this.emit(d.Move, "touch")
  3887. }
  3888. }
  3889. ,
  3890. n.prototype.onTouchEnd = function(e) {
  3891. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3892. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3893. this.state = c.NONE,
  3894. this.update(),
  3895. this.rotationAcceleration.set(0, 0),
  3896. this.rotateDelta.set(0, 0))
  3897. }
  3898. ,
  3899. n.prototype.onPointerDown = function(e) {
  3900. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3901. id: e.pointerId,
  3902. pageX: e.pageX,
  3903. pageY: e.pageY
  3904. }),
  3905. e.touches = this.pointers,
  3906. this.onTouchStart(e)),
  3907. this.emit(d.InputStart, "pointer"))
  3908. }
  3909. ,
  3910. n.prototype.onPointerMove = function(e) {
  3911. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3912. e.pointerId === t.id && (t.pageX = e.pageX,
  3913. t.pageY = e.pageY)
  3914. }),
  3915. e.touches = this.pointers,
  3916. this.onTouchMove(e))
  3917. }
  3918. ,
  3919. n.prototype.onPointerUp = function(e) {
  3920. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3921. e.pointerId === t.id && this.pointers.splice(i, 1)
  3922. }
  3923. .bind(this)),
  3924. e.touches = this.pointers,
  3925. this.onTouchEnd(e))
  3926. }
  3927. ,
  3928. n.prototype.reset = function() {
  3929. this.state = c.NONE,
  3930. this.stopAutoPanning(),
  3931. this.rotationSpeed.set(0, 0),
  3932. this.rotationAcceleration.set(0, 0),
  3933. this.panSpeed.set(0, 0),
  3934. this.panAcceleration.set(0, 0)
  3935. }
  3936. ,
  3937. n.prototype.toJSON = function() {
  3938. var e = {
  3939. camera_position: {
  3940. x: s.toPrecision(this.camera.position.x, 4),
  3941. y: s.toPrecision(this.camera.position.y, 4),
  3942. z: s.toPrecision(this.camera.position.z, 4)
  3943. },
  3944. camera_quaternion: {
  3945. x: s.toPrecision(this.camera.quaternion.x, 4),
  3946. y: s.toPrecision(this.camera.quaternion.y, 4),
  3947. z: s.toPrecision(this.camera.quaternion.z, 4),
  3948. w: s.toPrecision(this.camera.quaternion.w, 4)
  3949. }
  3950. };
  3951. return e
  3952. }
  3953. ,
  3954. t.exports = n
  3955. }
  3956. , {
  3957. "../enum/ControlActions": 20,
  3958. "../enum/ControlEvents": 21,
  3959. "../enum/Keys": 30,
  3960. "../enum/MouseButton": 34,
  3961. "../enum/Vectors": 50,
  3962. "../settings": 166,
  3963. "../util/common": 185,
  3964. "../util/math": 190,
  3965. events: 202,
  3966. three: 217
  3967. }],
  3968. 13: [function(e, t, i) {
  3969. (function(i) {
  3970. "use strict";
  3971. function n(e) {
  3972. this.camera = e,
  3973. this.camera.controls = this,
  3974. this.target = new r.Vector3(0,0,0),
  3975. this.lookVector = new r.Vector3,
  3976. this.lookSpeed = .05,
  3977. this.rotationAcc = new r.Vector2,
  3978. this.rotationSpeed = new r.Vector2,
  3979. this.lat = 0,
  3980. this.lon = 0,
  3981. this.phi = 0,
  3982. this.theta = 0,
  3983. this.enabled = !1,
  3984. this.locked = !1,
  3985. this.pointer = new r.Vector2(0,0),
  3986. this.rotationHistory = [],
  3987. this.rotationDifference = new r.Vector2,
  3988. this.pointerDragOn = !1,
  3989. this.pointerDragStart = new r.Vector2(0,0),
  3990. this.pinchDistance = 0,
  3991. this.moveStart = new r.Vector2,
  3992. this.moveTolerance = .01,
  3993. this.pointersLimit = 2,
  3994. this.pointers = []
  3995. }
  3996. var r = e("three")
  3997. , o = e("../util/logger")
  3998. , a = e("../settings")
  3999. , s = e("../util/common")
  4000. , l = e("../util/math")
  4001. , c = (e("../enum/Vectors"),
  4002. e("../enum/MouseButton"))
  4003. , h = e("../enum/Keys")
  4004. , u = e("../enum/ControlEvents")
  4005. , d = e("events").EventEmitter;
  4006. new o(i);
  4007. n.prototype = Object.create(d.prototype),
  4008. n.prototype.usable = function() {
  4009. return this.enabled && !this.locked
  4010. }
  4011. ,
  4012. n.prototype.lookAt = function(e) {
  4013. var t = this.camera.position.clone().sub(e)
  4014. , i = Math.atan(t.z / t.x);
  4015. i += t.x < 0 ? Math.PI : 0,
  4016. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4017. this.lon = r.Math.radToDeg(i) + 180;
  4018. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4019. , o = Math.atan(t.y / n);
  4020. this.lat = -r.Math.radToDeg(o)
  4021. }
  4022. ,
  4023. n.prototype.startRotationFrom = function(e, t) {
  4024. l.convertScreenPositionToNDC(e, t, this.pointer),
  4025. this.pointerDragOn = !0,
  4026. this.pointerDragStart.copy(this.pointer),
  4027. this.moveStart.copy(this.pointer),
  4028. this.rotationHistory = [],
  4029. this.rotationSpeed.set(0, 0)
  4030. }
  4031. ,
  4032. n.prototype.onMouseOver = function(e) {
  4033. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4034. }
  4035. ,
  4036. n.prototype.onTouchStart = function(e) {
  4037. if (this.usable()) {
  4038. switch (e.preventDefault(),
  4039. e.stopPropagation(),
  4040. e.touches.length) {
  4041. case 1:
  4042. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4043. break;
  4044. case 2:
  4045. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4046. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4047. this.pinchDistance = Math.sqrt(t * t + i * i)
  4048. }
  4049. this.emit(u.InputStart, "touch")
  4050. }
  4051. }
  4052. ,
  4053. n.prototype.onPointerDown = function(e) {
  4054. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4055. id: e.pointerId,
  4056. clientX: e.clientX,
  4057. clientY: e.clientY
  4058. }),
  4059. e.touches = this.pointers,
  4060. this.onTouchStart(e),
  4061. this.emit(u.InputStart, "pointer"))
  4062. }
  4063. ,
  4064. n.prototype.onMouseDown = function(e) {
  4065. if (this.usable()) {
  4066. switch (e.preventDefault(),
  4067. e.stopPropagation(),
  4068. e.button) {
  4069. case c.LEFT:
  4070. this.startRotationFrom(e.clientX, e.clientY)
  4071. }
  4072. this.emit(u.InputStart, "mouse")
  4073. }
  4074. }
  4075. ,
  4076. n.prototype.updateRotation = function() {
  4077. if (this.usable() && this.pointerDragOn) {
  4078. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4079. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4080. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4081. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4082. , o = Math.atan2(e.y, i)
  4083. , a = Math.atan2(t.y, n);
  4084. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4085. e.y = 0,
  4086. t.y = 0;
  4087. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4088. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4089. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4090. this.pointerDragStart.copy(this.pointer)
  4091. }
  4092. }
  4093. ,
  4094. n.prototype.onMouseMove = function(e) {
  4095. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4096. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(u.Move, "mouse"))
  4097. }
  4098. ,
  4099. n.prototype.onTouchMove = function(e) {
  4100. if (this.usable())
  4101. switch (this.emit(u.Move, "touch"),
  4102. e.touches.length) {
  4103. case 1:
  4104. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4105. break;
  4106. case 2:
  4107. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4108. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4109. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4110. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4111. this.emit(u.Pinch, n),
  4112. this.pinchDistance -= n)
  4113. }
  4114. }
  4115. ,
  4116. n.prototype.onPointerMove = function(e) {
  4117. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4118. e.pointerId === t.id && (t.clientX = e.clientX,
  4119. t.clientY = e.clientY)
  4120. }),
  4121. e.touches = this.pointers,
  4122. this.onTouchMove(e))
  4123. }
  4124. ,
  4125. n.prototype.endRotation = function() {
  4126. this.pointerDragOn = !1;
  4127. var e = s.averageVectors(this.rotationHistory);
  4128. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4129. }
  4130. ,
  4131. n.prototype.onTouchEnd = function(e) {
  4132. this.usable() && (e.preventDefault(),
  4133. e.stopPropagation(),
  4134. this.endRotation())
  4135. }
  4136. ,
  4137. n.prototype.onMouseUp = function(e) {
  4138. this.usable() && (e.preventDefault(),
  4139. e.stopPropagation(),
  4140. this.endRotation())
  4141. }
  4142. ,
  4143. n.prototype.onPointerUp = function(e) {
  4144. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4145. e.pointerId === t.id && this.pointers.splice(i, 1)
  4146. }
  4147. .bind(this)),
  4148. e.touches = this.pointers,
  4149. this.onTouchEnd(e))
  4150. }
  4151. ,
  4152. n.prototype.update = function(e) {
  4153. this.lon,
  4154. this.lat;
  4155. for (this.updateRotation(),
  4156. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4157. this.rotationHistory.shift();
  4158. this.lon += this.rotationDifference.x,
  4159. this.lat += this.rotationDifference.y,
  4160. this.rotationDifference.set(0, 0),
  4161. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4162. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4163. this.lon += this.rotationSpeed.x * e,
  4164. this.lat += this.rotationSpeed.y * e,
  4165. this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4166. this.phi = r.Math.degToRad(90 - this.lat),
  4167. this.theta = r.Math.degToRad(this.lon),
  4168. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4169. this.lookVector.y = Math.cos(this.phi),
  4170. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4171. this.target.copy(this.lookVector).add(this.camera.position),
  4172. this.camera.lookAt(this.target)
  4173. }
  4174. ,
  4175. n.prototype.onMouseWheel = function(e) {
  4176. if (this.usable()) {
  4177. var t = e.wheelDelta || -e.detail;
  4178. this.emit(u.InteractionDirect),
  4179. this.emit(u.Scroll, t)
  4180. }
  4181. }
  4182. ,
  4183. n.prototype.onKeyDown = function(e) {
  4184. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4185. this.handleKeyDown(e.which)))
  4186. }
  4187. ,
  4188. n.prototype.handleKeyDown = function(e) {
  4189. var t = function(e, t) {
  4190. this.rotationAcc[e] = t
  4191. }
  4192. .bind(this);
  4193. this.emit(u.InteractionKey);
  4194. var i = !0;
  4195. switch (e) {
  4196. case h.LEFTARROW:
  4197. case h.J:
  4198. t("x", -1);
  4199. break;
  4200. case h.RIGHTARROW:
  4201. case h.L:
  4202. t("x", 1);
  4203. break;
  4204. case h.I:
  4205. t("y", 1);
  4206. break;
  4207. case h.K:
  4208. t("y", -1);
  4209. break;
  4210. default:
  4211. i = !1
  4212. }
  4213. i && this.emit(u.Move, "key")
  4214. }
  4215. ,
  4216. n.prototype.onKeyUp = function(e) {
  4217. this.usable() && (e.preventDefault(),
  4218. e.stopPropagation(),
  4219. this.handleKeyUp(e.which))
  4220. }
  4221. ,
  4222. n.prototype.handleKeyUp = function(e) {
  4223. switch (e) {
  4224. case h.LEFTARROW:
  4225. case h.J:
  4226. case h.RIGHTARROW:
  4227. case h.L:
  4228. this.rotationAcc.x = 0;
  4229. break;
  4230. case h.I:
  4231. case h.K:
  4232. this.rotationAcc.y = 0
  4233. }
  4234. }
  4235. ,
  4236. n.prototype.startRotating = function(e, t) {
  4237. e && (this.rotationAcc.x = e),
  4238. t && (this.rotationAcc.y = t)
  4239. }
  4240. ,
  4241. n.prototype.stopRotating = function(e) {
  4242. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4243. this.rotationAcc.set(0, 0)
  4244. }
  4245. ,
  4246. n.prototype.reset = function() {
  4247. this.pointerDragOn = !1,
  4248. this.rotationAcc.set(0, 0),
  4249. this.rotationSpeed.set(0, 0),
  4250. this.pointers = []
  4251. }
  4252. ,
  4253. n.prototype.toJSON = function() {
  4254. var e = {
  4255. camera_position: {
  4256. x: l.toPrecision(this.camera.position.x, 4),
  4257. y: l.toPrecision(this.camera.position.y, 4),
  4258. z: l.toPrecision(this.camera.position.z, 4)
  4259. },
  4260. camera_quaternion: {
  4261. x: l.toPrecision(this.camera.quaternion.x, 4),
  4262. y: l.toPrecision(this.camera.quaternion.y, 4),
  4263. z: l.toPrecision(this.camera.quaternion.z, 4),
  4264. w: l.toPrecision(this.camera.quaternion.w, 4)
  4265. }
  4266. };
  4267. return e
  4268. }
  4269. ,
  4270. n.prototype.setStateFromJSON = function(e) {
  4271. this.camera.position.copy(e.camera_position),
  4272. this.camera.quaternion.copy(e.camera_quaternion)
  4273. }
  4274. ,
  4275. t.exports = n
  4276. }
  4277. ).call(this, "/js/controls/PanoramaControls.js")
  4278. }
  4279. , {
  4280. "../enum/ControlEvents": 21,
  4281. "../enum/Keys": 30,
  4282. "../enum/MouseButton": 34,
  4283. "../enum/Vectors": 50,
  4284. "../settings": 166,
  4285. "../util/common": 185,
  4286. "../util/logger": 189,
  4287. "../util/math": 190,
  4288. events: 202,
  4289. three: 217
  4290. }],
  4291. 14: [function(e, t, i) {
  4292. (function(i) {
  4293. "use strict";
  4294. var n = e("three")
  4295. , r = e("../enum/Viewmode")
  4296. , o = e("../util/logger")
  4297. , a = new o(i);
  4298. t.exports = {
  4299. serialize: function(e) {
  4300. return encodeURI(JSON.stringify(e))
  4301. },
  4302. deserialize: function(e) {
  4303. function t(e) {
  4304. function t(e, t) {
  4305. return e && "number" == typeof t && !isNaN(t)
  4306. }
  4307. return e.reduce(t, !0)
  4308. }
  4309. try {
  4310. var i = JSON.parse(decodeURI(e))
  4311. , o = {
  4312. mode: r.fromInt(i.camera_mode),
  4313. panoId: i.scan_id,
  4314. position: (new n.Vector3).copy(i.camera_position),
  4315. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4316. zoom: i.ortho_zoom,
  4317. floorVisibility: i.floor_visibility
  4318. }
  4319. , s = o.position;
  4320. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4321. var l = o.quaternion;
  4322. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4323. o
  4324. } catch (i) {
  4325. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4326. try {
  4327. var c = e.split(",")
  4328. , h = {
  4329. x: parseFloat(c[2]),
  4330. y: parseFloat(c[3]),
  4331. z: parseFloat(c[4])
  4332. }
  4333. , u = {
  4334. x: parseFloat(c[5]),
  4335. y: parseFloat(c[6]),
  4336. z: parseFloat(c[7]),
  4337. w: parseFloat(c[8])
  4338. };
  4339. return t([h.x, h.y, h.z]) || (h.x = 0,
  4340. h.y = 0,
  4341. h.z = 0),
  4342. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4343. u.y = 0,
  4344. u.z = 0,
  4345. u.w = 1),
  4346. {
  4347. mode: r.fromInt(c[0]),
  4348. panoId: c[1],
  4349. position: (new n.Vector3).copy(h),
  4350. quaternion: (new n.Quaternion).copy(u)
  4351. }
  4352. } catch (t) {
  4353. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4354. }
  4355. }
  4356. return null
  4357. }
  4358. }
  4359. }
  4360. ).call(this, "/js/controls/serializer.js")
  4361. }
  4362. , {
  4363. "../enum/Viewmode": 51,
  4364. "../util/logger": 189,
  4365. three: 217
  4366. }],
  4367. 15: [function(e, t, i) {
  4368. (function(i) {
  4369. "use strict";
  4370. function n() {
  4371. this.endlessLoop = a.warp.loop,
  4372. this.clock = new r.Clock(!0),
  4373. this.model = null,
  4374. this.player = null,
  4375. this.currentItem = null,
  4376. this.destinationItem = null,
  4377. this.tourIsPlaying = !1,
  4378. this.transitionStage = y.None,
  4379. this.nextFunc = null,
  4380. this.onTheBus = !1,
  4381. this.tourInProgress = !1,
  4382. this.reachSource = null,
  4383. this.interrupted = !1,
  4384. this.nItems = 0,
  4385. this.walkingSectionPaused = !1
  4386. }
  4387. var r = e("three")
  4388. , o = e("./util/logger")
  4389. , a = e("./settings")
  4390. , s = e("./util/transitions")
  4391. , l = e("events").EventEmitter
  4392. , c = e("./enum/Viewmode")
  4393. , h = e("./analytics")
  4394. , u = e("./enum/WarpStyle")
  4395. , s = e("./util/transitions")
  4396. , d = (e("./model/ModelManager"),
  4397. e("./enum/ModelManagerEvents"))
  4398. , p = e("./enum/DirectorEvents")
  4399. , f = e("./enum/PlayerEvents")
  4400. , g = (e("./enum/ControlEvents"),
  4401. e("./enum/BlackoutStyle"))
  4402. , m = e("./enum/PathDiscardMode")
  4403. , v = e("./enum/PathDisplayMode")
  4404. , A = (e("./player"),
  4405. new o(i))
  4406. , y = Object.freeze({
  4407. None: 0,
  4408. Moving: 1,
  4409. Aiming: 2,
  4410. Interlude: 3
  4411. })
  4412. , C = Object.freeze({
  4413. Forward: 1,
  4414. NoChange: 0,
  4415. Backwards: -1
  4416. })
  4417. , I = s.getUniqueId();
  4418. n.prototype = Object.create(l.prototype),
  4419. n.prototype.init = function(e, t) {
  4420. this.player = e,
  4421. this.modelManager = t,
  4422. this.updateModel(),
  4423. this.resetAll(),
  4424. this.bindEvents()
  4425. }
  4426. ,
  4427. n.prototype.resetAll = function() {
  4428. if (this.currentItem = null,
  4429. this.destinationItem = null,
  4430. this.tourIsPlaying = !1,
  4431. this.bgmReplay(),//xzw
  4432. this.transitionStage = y.None,
  4433. this.nextFunc = null,
  4434. this.onTheBus = !1,
  4435. this.reachSource = null,
  4436. this.interrupted = !1,
  4437. this.model) {
  4438. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4439. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4440. } else
  4441. this.defaultWarpStyle = u.BLACK,
  4442. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4443. this.resetSpecialTransition()
  4444. }
  4445. ,
  4446. n.prototype.updateModel = function() {
  4447. this.model = this.modelManager.getActiveModel(),
  4448. this.nItems = this.model.heroLocations.length
  4449. }
  4450. ,
  4451. n.prototype.bindEvents = function() {
  4452. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4453. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4454. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4455. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4456. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4457. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4458. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4459. this.player.once(f.Move, function() {
  4460. s.cancelById(I)
  4461. })
  4462. }
  4463. ,
  4464. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4465. return e === u.WALK && (this.interrupt(g.NONE),
  4466. this.pauseWalkingSection(),
  4467. this.player.fastForwardActivePanoFlight(),
  4468. !0)
  4469. }
  4470. ,
  4471. n.prototype.handlePlayerMove = function(e) {
  4472. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4473. this.emit("update.controls")
  4474. }
  4475. ,
  4476. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4477. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4478. this.emit("update.controls"))
  4479. }
  4480. ,
  4481. n.prototype.handlePlayerModeChanged = function(e, t) {
  4482. this.intermediateState() || e === t || (this.onTheBus = !1,
  4483. this.emit("update.controls"))
  4484. }
  4485. ,
  4486. n.prototype.handlePlayerInputStart = function(e) {
  4487. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4488. }
  4489. ,
  4490. n.prototype.handlePlayerFlyingStarted = function() {
  4491. this.clearWalkingSectionPaused()
  4492. }
  4493. ,
  4494. n.prototype.describe = function() {
  4495. return {
  4496. nItems: this.nItems,
  4497. currentItem: this.currentItem,
  4498. destinationItem: this.destinationItem,
  4499. tourIsPlaying: this.tourIsPlaying,
  4500. onTheBus: this.onTheBus,
  4501. endlessLoop: this.endlessLoop,
  4502. viewMode: this.player.mode,
  4503. inTransition: this._inTransition(),
  4504. transitionStage: this.transitionStage,
  4505. tourInProgress: this.tourInProgress
  4506. }
  4507. }
  4508. ,
  4509. n.prototype._inTransition = function() {
  4510. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4511. }
  4512. ,
  4513. n.prototype.bounceable = function() {
  4514. var e = this.clock.getDelta();
  4515. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4516. }
  4517. ,
  4518. n.prototype.currentMoveDirection = function() {
  4519. return null === this.currentItem || void 0 === this.currentItem ? C.Forward : this.destinationItem === this.currentItem ? C.NoChange : this.destinationItem > this.currentItem ? C.Forward : C.Backwards
  4520. }
  4521. ,
  4522. n.prototype.clearPath = function() {
  4523. this._inTransition() || this.player.path.discardPathObject()
  4524. }
  4525. ,
  4526. n.prototype.allFloors = function() {
  4527. this.model.toggleAllFloors()
  4528. }
  4529. ,
  4530. n.prototype.actionComplete = function(e) {
  4531. if (this.interrupted = !1,
  4532. this.transitionStage = y.None,
  4533. this.resetSpecialTransition(),
  4534. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4535. this.tourIsPlaying || (this.player.disablePreRendering(),
  4536. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4537. this.emit("update.controls"),
  4538. this.nextFunc) {
  4539. var t = this.nextFunc;
  4540. this.nextFunc = null,
  4541. t()
  4542. }
  4543. }
  4544. ,
  4545. n.prototype.awaitCompletion = function(e, t) {
  4546. this.nextFunc = t,
  4547. e()
  4548. }
  4549. ,
  4550. n.prototype.updateSuccessFunction = function(e) {
  4551. this.nextFunc = e
  4552. }
  4553. ,
  4554. n.prototype.interrupt = function(e, t) {
  4555. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4556. this.tourIsPlaying = !1,
  4557. this.bgmReplay(),//xzw
  4558. this.interrupted = !0,
  4559. this.nextFunc = null,
  4560. this.emit(p.ActionInterrupted),
  4561. null !== e && void 0 !== e || (e = g.BEGINNING),
  4562. this.player.interruptAndFastForward(e, t),
  4563. !0)
  4564. }
  4565. ,
  4566. n.prototype.wouldInterrupt = function() {
  4567. return this.transitionStage !== y.None
  4568. }
  4569. ,
  4570. n.prototype.intermediateState = function() {
  4571. return this.transitionStage !== y.None
  4572. }
  4573. ,
  4574. n.prototype.isInterrupted = function() {
  4575. return this.interrupted
  4576. }
  4577. ,
  4578. n.prototype.pauseWalkingSection = function() {
  4579. this.walkingSectionPaused = !0
  4580. }
  4581. ,
  4582. n.prototype.clearWalkingSectionPaused = function() {
  4583. this.walkingSectionPaused = !1
  4584. }
  4585. ,
  4586. n.prototype.autoTour = function() {
  4587. var e = Date.now();
  4588. this.model.auxDataPromise.then(function() {
  4589. e = Date.now() - e;
  4590. var t = a.warp.auto
  4591. , i = this.model.data && this.model.data.player_options && this.model.data.player_options.highlight_reel;
  4592. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4593. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4594. done: function() {
  4595. this.playTour()
  4596. }
  4597. .bind(this),
  4598. name: "_atr",
  4599. id: I
  4600. })
  4601. }
  4602. .bind(this))
  4603. }
  4604. ,
  4605. n.prototype.atDestinationPano = function() {
  4606. if (!this.player.currentPano || null === this.destinationItem)
  4607. return !1;
  4608. var e = this.player.currentPano.id;
  4609. if (void 0 === e)
  4610. return !1;
  4611. var t = this.model.heroLocations;
  4612. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4613. }
  4614. ,
  4615. n.prototype.redirectToItem = function(e, t) {
  4616. if (null === e || void 0 === e)
  4617. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4618. if (!this.wouldInterrupt())
  4619. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4620. if (this.player.mode === c.TRANSITIONING)
  4621. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4622. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4623. var i = function() {
  4624. s.setTimeout(function() {
  4625. this.setDestinationItem(e),
  4626. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4627. }
  4628. .bind(this), 0)
  4629. }
  4630. .bind(this);
  4631. this.interrupt(g.END, 0),
  4632. this.updateSuccessFunction(i)
  4633. }
  4634. ,
  4635. n.prototype.useSpecialTransition = function(e) {
  4636. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4637. this.nextWarpStyle = u.BLACK
  4638. }
  4639. ,
  4640. n.prototype.resetSpecialTransition = function() {
  4641. this.nextWarpStyle = this.defaultWarpStyle
  4642. }
  4643. ,
  4644. n.prototype.arrivedAtDestination = function(e) {
  4645. if (this.player.flying || this.player.isWarping())
  4646. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4647. else {
  4648. this.transitionStage = y.Aiming;
  4649. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4650. this.player.model.fadePanoMarkers(0),
  4651. this.awaitCompletion(function() {
  4652. this.resetSpecialTransition(),
  4653. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4654. }
  4655. .bind(this), t)
  4656. }
  4657. }
  4658. ,
  4659. n.prototype.goToDestination = function(e, t, i, n) {
  4660. //xzw add:
  4661. if(g_data2.tourAudio){
  4662. var tM = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4663. if(tM && tM.music){
  4664. var s = g_Prefix+"/audio/"+g_index+"/"+tM.music;
  4665. if(g_tourAudio.src==s && !g_tourAudio.paused) return;
  4666. g_tourAudio.src = s;
  4667. g_playAudio = g_tourAudio;
  4668. g_play && g_tourAudio.play();
  4669. g_bgAudio && g_bgAudio.pause();
  4670. }
  4671. }
  4672. if (this.onTheBus = !0,
  4673. this.emit("update.controls"),
  4674. this.player.updateLastView(),
  4675. !n && this.atDestinationPano())
  4676. return void this.arrivedAtDestination(!0);
  4677. if (this.player.flying || this.player.isWarping())
  4678. A.warn("Cannot go to new destination while player is flying or warping.");
  4679. else {
  4680. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4681. , o = null
  4682. , a = null;
  4683. if (r.isPano()) {
  4684. var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4685. a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, t, i, this.actionComplete.bind(this)),
  4686. o = this.arrivedAtDestination.bind(this, !0)
  4687. } else
  4688. a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4689. o = this.arrivedAtDestination.bind(this, !1);
  4690. this.transitionStage = y.Moving,
  4691. this.model.fadePanoMarkers(0),
  4692. this.awaitCompletion(function() {
  4693. a()
  4694. }
  4695. .bind(this), o),
  4696. this.emit("update.controls")
  4697. }
  4698. }
  4699. ,
  4700. n.prototype.tourInterlude = function() {
  4701. if (h.trackAlways("reach_highlight", {
  4702. reach_source: this.reachSource
  4703. }),
  4704. this.model.fadePanoMarkers(0),
  4705. this.emit("update.controls"),
  4706. this.tourIsPlaying)
  4707. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4708. this.stopTour(),
  4709. this.emit(p.TourEnd),
  4710. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4711. this.transitionStage = y.Interlude,
  4712. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4713. }
  4714. .bind(this), this.goNext.bind(this))
  4715. }
  4716. ,
  4717. n.prototype.playTour = function() {
  4718. if (!this.bounceable())
  4719. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4720. this.tourInProgress = !0,
  4721. this.reachSource = "play",
  4722. this.tourIsPlaying = !0,
  4723. this.wasZoomEnabled = this.player.zoomEnabled,
  4724. this.player.zoomEnabled = !1,
  4725. this.resetSpecialTransition(),
  4726. this.emit("update.controls"),
  4727. this.emit(p.TourStart),
  4728. this.player.enablePreRendering(),
  4729. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4730. this.goToDestination()) : this.goNext()))
  4731. }
  4732. ,
  4733. n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4734. if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
  4735. g_playAudio = g_bgAudio;
  4736. g_bgAudio.play()
  4737. }
  4738. }
  4739. ,
  4740. n.prototype.stopTour = function() {
  4741. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4742. this.tourIsPlaying = !1,
  4743. this.bgmReplay(),//xzw
  4744. this.interrupt(),
  4745. this.clearWalkingSectionPaused(),
  4746. this.resetSpecialTransition(),
  4747. this.emit("update.controls"))
  4748. }
  4749. ,
  4750. n.prototype.endTourProgress = function() {
  4751. this.tourInProgress = !1,
  4752. this.emit("update.controls"),
  4753. this.emit(p.TourEnd)
  4754. }
  4755. ,
  4756. n.prototype.goToHighlight = function(e) {
  4757. if (this.wouldInterrupt())
  4758. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4759. else {
  4760. if (A.debug("<tour.goto " + e + ">"),
  4761. this.isInterrupted())
  4762. return;
  4763. this.clearWalkingSectionPaused(),
  4764. this.setDestinationItem(e),
  4765. this.useSpecialTransition("Hilight"),
  4766. this.goToDestination(),
  4767. h.trackAlways("reach_highlight", {
  4768. reach_source: "thumb"
  4769. })
  4770. }
  4771. }
  4772. ,
  4773. n.prototype.prevHighlight = function() {
  4774. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4775. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4776. this.reachSource = "prev",
  4777. this.goPrev()))
  4778. }
  4779. ,
  4780. n.prototype.nextHighlight = function() {
  4781. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4782. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4783. this.reachSource = "next",
  4784. this.goNext()))
  4785. }
  4786. ,
  4787. n.prototype.changeMode = function(e) {
  4788. var t = $.Deferred()
  4789. , i = t.resolve.bind(t)
  4790. , n = t.reject.bind(t);
  4791. this.emit(p.StartModeChange);
  4792. var r = function() {
  4793. return this.clearWalkingSectionPaused(),
  4794. !!this.wouldInterrupt() && (this.interrupt(),
  4795. !0)
  4796. }
  4797. .bind(this);
  4798. if (!r()) {
  4799. switch (e) {
  4800. case c.PANORAMA:
  4801. this.player.mode === c.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4802. break;
  4803. case c.DOLLHOUSE:
  4804. case c.FLOORPLAN:
  4805. this.player.flyToNewMode({
  4806. mode: e
  4807. }).done(i).fail(n);
  4808. break;
  4809. case c.OUTDOOR:
  4810. this.player.model.has360Views && (this.player.mode !== c.PANORAMA || this.player.mode === c.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4811. }
  4812. return t.promise()
  4813. }
  4814. }
  4815. ,
  4816. n.prototype.atEndOfTour = function() {
  4817. var e = this.currentItem >= this.nItems - 1;
  4818. return e
  4819. }
  4820. ,
  4821. n.prototype.firstDestination = function() {
  4822. return this.nItems > 0 ? 0 : null
  4823. }
  4824. ,
  4825. n.prototype.finalDestination = function() {
  4826. return this.nItems > 0 ? this.nItems - 1 : null
  4827. }
  4828. ,
  4829. n.prototype.goPrev = function() {
  4830. this.tourAdvance(-1)
  4831. }
  4832. ,
  4833. n.prototype.goNext = function() {
  4834. this.tourAdvance(1)
  4835. }
  4836. ,
  4837. n.prototype.setDestinationItem = function(e) {
  4838. this.destinationItem = e,
  4839. this.emit("update.controls")
  4840. }
  4841. ,
  4842. n.prototype.setCurrentItem = function(e) {
  4843. this.currentItem = e,
  4844. this.emit("update.controls")
  4845. }
  4846. ,
  4847. n.prototype.nextItem = function(e) {
  4848. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4849. }
  4850. ,
  4851. n.prototype.prevItem = function(e) {
  4852. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4853. }
  4854. ,
  4855. n.prototype.tourAdvance = function(e) {
  4856. A.debug("tourAdvance(" + e + ")"),
  4857. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4858. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4859. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4860. this.useSpecialTransition("looping back to start")),
  4861. this.goToDestination()
  4862. }
  4863. ,
  4864. t.exports = n
  4865. }
  4866. ).call(this, "/js/director.js")
  4867. }
  4868. , {
  4869. "./analytics": 4,
  4870. "./enum/BlackoutStyle": 18,
  4871. "./enum/ControlEvents": 21,
  4872. "./enum/DirectorEvents": 23,
  4873. "./enum/ModelManagerEvents": 33,
  4874. "./enum/PathDiscardMode": 38,
  4875. "./enum/PathDisplayMode": 39,
  4876. "./enum/PlayerEvents": 40,
  4877. "./enum/Viewmode": 51,
  4878. "./enum/WarpStyle": 52,
  4879. "./model/ModelManager": 140,
  4880. "./player": 155,
  4881. "./settings": 166,
  4882. "./util/logger": 189,
  4883. "./util/transitions": 195,
  4884. events: 202,
  4885. three: 217
  4886. }],
  4887. 16: [function(e, t, i) {
  4888. "use strict";
  4889. var n = e("three")
  4890. , r = e("./enum/Viewmode")
  4891. , o = (e("./settings"),
  4892. e("./util/transitions"))
  4893. , a = e("./enum/PlayerEvents")
  4894. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4895. , l = new n.ShaderPass(n.VerticalBlurShader);
  4896. l.renderToScreen = !0;
  4897. var c = $("#player").width() / $("#player").height();
  4898. isNaN(c) && (c = 1);
  4899. var h = {
  4900. currentBlur: 0,
  4901. aspect: c,
  4902. blurStrength: 1,
  4903. hblurPass: s,
  4904. vblurPass: l,
  4905. bindEvents: function(e) {
  4906. e.on(a.ModeChanged, function(e, t) {
  4907. e === r.PANORAMA && (o.cancel(h.blur),
  4908. o.cancel(h.addBlur),
  4909. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4910. })
  4911. },
  4912. blur: function(e) {
  4913. h.currentBlur = e;
  4914. var t = e * h.blurStrength;
  4915. l.uniforms.v.value = t / 512 * h.aspect,
  4916. s.uniforms.h.value = t / 512
  4917. },
  4918. addBlur: function(e) {
  4919. e = Math.max(e, h.currentBlur),
  4920. h.blur(e)
  4921. },
  4922. removeBlur: function(e) {
  4923. e = Math.min(1 - e, h.currentBlur),
  4924. h.blur(e)
  4925. }
  4926. };
  4927. h.blur(0),
  4928. t.exports = h
  4929. }
  4930. , {
  4931. "./enum/PlayerEvents": 40,
  4932. "./enum/Viewmode": 51,
  4933. "./settings": 166,
  4934. "./util/transitions": 195,
  4935. three: 217
  4936. }],
  4937. 17: [function(e, t, i) {
  4938. "use strict";
  4939. t.exports = {
  4940. UNKNOWN: 0,
  4941. ALIGNED: 1,
  4942. UNALIGNED: 2,
  4943. PLACED: 3
  4944. }
  4945. }
  4946. , {}],
  4947. 18: [function(e, t, i) {
  4948. "use strict";
  4949. t.exports = {
  4950. NONE: 0,
  4951. MIDDLE: 1,
  4952. END: 2,
  4953. BEGINNING: 3,
  4954. FADEIN: 4
  4955. }
  4956. }
  4957. , {}],
  4958. 19: [function(e, t, i) {
  4959. "use strict";
  4960. var n = e("three");
  4961. t.exports = {
  4962. newBlue: new n.Color(4967932),
  4963. altBlue: new n.Color(47355),
  4964. tagDefault: new n.Color(223357),
  4965. classicBlue: new n.Color(53759),
  4966. mpYellow: new n.Color(16502016),
  4967. mpOrange: new n.Color(16428055),
  4968. mpBlue: new n.Color(12096),
  4969. mpLtGrey: new n.Color(13751252),
  4970. mpDkGrey: new n.Color(10000019),
  4971. mpRed: new n.Color(12525854),
  4972. mpOrangeDesat: new n.Color(16764529),
  4973. mpBlueDesat: new n.Color(4034734),
  4974. mpRedDesat: new n.Color(14705505),
  4975. white: new n.Color(16777215),
  4976. black: new n.Color(0),
  4977. _desat: function(e, t) {
  4978. var i = t || .3
  4979. , r = (new n.Color).copy(e).getHSL();
  4980. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  4981. },
  4982. _darken: function(e, t) {
  4983. var i = t || .2
  4984. , r = e.getHSL();
  4985. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  4986. }
  4987. }
  4988. }
  4989. , {
  4990. three: 217
  4991. }],
  4992. 20: [function(e, t, i) {
  4993. "use strict";
  4994. t.exports = {
  4995. NONE: -1,
  4996. ROTATE: 0,
  4997. DOLLY: 1,
  4998. PAN: 2,
  4999. ROTATE_DOLLY: 3,
  5000. PAN_DOLLY: 4
  5001. }
  5002. }
  5003. , {}],
  5004. 21: [function(e, t, i) {
  5005. "use strict";
  5006. t.exports = {
  5007. Move: "move",
  5008. InteractionDirect: "interaction.direct",
  5009. InteractionKey: "interaction.key",
  5010. InteractionGui: "interaction.gui",
  5011. FlyInDirection: "fly.direction",
  5012. InputStart: "input.start",
  5013. Pinch: "input.pinch",
  5014. Scroll: "input.scroll",
  5015. AutoPanInterrupt: "autopan.interrupt",
  5016. AutoPanComplete: "autopan.complete",
  5017. AutoPanClamped: "autopan.clamped",
  5018. LongTap: "longtap"
  5019. }
  5020. }
  5021. , {}],
  5022. 22: [function(e, t, i) {
  5023. "use strict";
  5024. t.exports = Object.freeze({
  5025. FORWARD: "FORWARD",
  5026. LEFT: "LEFT",
  5027. RIGHT: "RIGHT",
  5028. BACK: "BACK",
  5029. UP: "UP",
  5030. DOWN: "DOWN"
  5031. })
  5032. }
  5033. , {}],
  5034. 23: [function(e, t, i) {
  5035. "use strict";
  5036. t.exports = {
  5037. ActionInterrupted: "action.interrupted",
  5038. TourStart: "tour.start",
  5039. TourEnd: "tour.end",
  5040. StartModeChange: "mode.startChange"
  5041. }
  5042. }
  5043. , {}],
  5044. 24: [function(e, t, i) {
  5045. "use strict";
  5046. t.exports = Object.freeze({
  5047. None: 0,
  5048. Queued: 1,
  5049. ForceQueued: 2,
  5050. Downloading: 3,
  5051. Downloaded: 4,
  5052. DownloadFailed: 5
  5053. })
  5054. }
  5055. , {}],
  5056. 25: [function(e, t, i) {
  5057. "use strict";
  5058. t.exports = {
  5059. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5060. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5061. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5062. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5063. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5064. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5065. }
  5066. }
  5067. , {}],
  5068. 26: [function(e, t, i) {
  5069. "use strict";
  5070. t.exports = {
  5071. Texture2D: 0,
  5072. TextureCube: 1
  5073. }
  5074. }
  5075. , {}],
  5076. 27: [function(e, t, i) {
  5077. "use strict";
  5078. t.exports = {
  5079. SMALL: "small",
  5080. LARGE: "large"
  5081. }
  5082. }
  5083. , {}],
  5084. 28: [function(e, t, i) {
  5085. "use strict";
  5086. var n = e("./Viewmode")
  5087. , r = {
  5088. LANDING: {},
  5089. NAVIGATION: "navigation",
  5090. MORE_HELP: "moreHelp",
  5091. TOUR_INTERACTION: {}
  5092. };
  5093. r.LANDING[n.PANORAMA] = "panorama.landing",
  5094. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5095. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5096. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5097. r.TOUR_INTERACTION.standard = "standard.tour",
  5098. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5099. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5100. t.exports = r
  5101. }
  5102. , {
  5103. "./Viewmode": 51
  5104. }],
  5105. 29: [function(e, t, i) {
  5106. "use strict";
  5107. var n = {
  5108. UP: 1,
  5109. DOWN: -1,
  5110. LEFT: "L",
  5111. RIGHT: "R",
  5112. FORWARD: "F",
  5113. BACK: "B",
  5114. reverse: {},
  5115. opposite: function(e) {
  5116. return this.reverse[e.toString()]
  5117. }
  5118. };
  5119. !function() {
  5120. n.reverse[n.UP] = n.DOWN,
  5121. n.reverse[n.DOWN] = n.UP,
  5122. n.reverse[n.LEFT] = n.RIGHT,
  5123. n.reverse[n.RIGHT] = n.LEFT,
  5124. n.reverse[n.FORWARD] = n.BACK,
  5125. n.reverse[n.BACK] = n.FORWARD
  5126. }(),
  5127. t.exports = n
  5128. }
  5129. , {}],
  5130. 30: [function(e, t, i) {
  5131. "use strict";
  5132. var n = e("../util/browser")
  5133. , r = {
  5134. ZERO: 48,
  5135. ONE: 49,
  5136. TWO: 50,
  5137. THREE: 51,
  5138. FOUR: 52,
  5139. FIVE: 53,
  5140. SIX: 54,
  5141. SEVEN: 55,
  5142. EIGHT: 56,
  5143. NINE: 57,
  5144. LEFTARROW: 37,
  5145. UPARROW: 38,
  5146. RIGHTARROW: 39,
  5147. DOWNARROW: 40,
  5148. A: 65,
  5149. B: 66,
  5150. C: 67,
  5151. D: 68,
  5152. E: 69,
  5153. F: 70,
  5154. G: 71,
  5155. H: 72,
  5156. I: 73,
  5157. J: 74,
  5158. K: 75,
  5159. L: 76,
  5160. M: 77,
  5161. N: 78,
  5162. O: 79,
  5163. P: 80,
  5164. Q: 81,
  5165. R: 82,
  5166. S: 83,
  5167. T: 84,
  5168. U: 85,
  5169. V: 86,
  5170. W: 87,
  5171. X: 88,
  5172. Y: 89,
  5173. Z: 90,
  5174. SPACE: 32,
  5175. RETURN: 13,
  5176. SEMICOLON: 186,
  5177. PLUSEQUALS: 187,
  5178. DASHUNDERSCORE: 189,
  5179. OPENBRACKET: 219
  5180. };
  5181. n.detectFirefox() && (r.SEMICOLON = 59,
  5182. r.PLUSEQUALS = 61,
  5183. r.DASHUNDERSCORE = 173),
  5184. t.exports = r
  5185. }
  5186. , {
  5187. "../util/browser": 182
  5188. }],
  5189. 31: [function(e, t, i) {
  5190. "use strict";
  5191. t.exports = {
  5192. EN_US: "en-US",
  5193. ES_MX: "es-MX",
  5194. FR_FR: "fr-FR",
  5195. DE_DE: "de-DE",
  5196. RU_RU: "ru-RU",
  5197. CN_CN: "cn-CN",
  5198. JP_JP: "jp-JP"
  5199. }
  5200. }
  5201. , {}],
  5202. 32: [function(e, t, i) {
  5203. "use strict";
  5204. t.exports = {
  5205. TagActivated: "tag.activated",
  5206. TagDismissed: "tag.dismissed",
  5207. TagNavigation: "tag.navigation"
  5208. }
  5209. }
  5210. , {}],
  5211. 33: [function(e, t, i) {
  5212. "use strict";
  5213. t.exports = {
  5214. ModelAdded: "model-added",
  5215. ActiveModelChanged: "active-model-changed"
  5216. }
  5217. }
  5218. , {}],
  5219. 34: [function(e, t, i) {
  5220. "use strict";
  5221. t.exports = {
  5222. LEFT: 0,
  5223. MIDDLE: 1,
  5224. RIGHT: 2
  5225. }
  5226. }
  5227. , {}],
  5228. 35: [function(e, t, i) {
  5229. "use strict";
  5230. t.exports = {
  5231. PanoRenderComplete: "panorama.render.complete",
  5232. TileRenderFailure: "panorama.tile.render.failed",
  5233. TileRenderSuccess: "panorama.tile.render.success",
  5234. TileUploadAttempted: "panorama.tile.upload.attempted",
  5235. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5236. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5237. }
  5238. }
  5239. , {}],
  5240. 36: [function(e, t, i) {
  5241. "use strict";
  5242. t.exports = {
  5243. BASE: 1,
  5244. STANDARD: 2,
  5245. HIGH: 3,
  5246. ULTRAHIGH: 4
  5247. }
  5248. }
  5249. , {}],
  5250. 37: [function(e, t, i) {
  5251. "use strict";
  5252. t.exports = {
  5253. LoadComplete: "panorama.load.complete",
  5254. LoadFailed: "panorama.load.failed",
  5255. TileLoaded: "panorama.tile.loaded"
  5256. }
  5257. }
  5258. , {}],
  5259. 38: [function(e, t, i) {
  5260. "use strict";
  5261. t.exports = Object.freeze({
  5262. Standard: 0,
  5263. Slow: 1,
  5264. Retain: 2
  5265. })
  5266. }
  5267. , {}],
  5268. 39: [function(e, t, i) {
  5269. "use strict";
  5270. t.exports = Object.freeze({
  5271. Show: 0,
  5272. Hide: 1,
  5273. Retain: 2
  5274. })
  5275. }
  5276. , {}],
  5277. 40: [function(e, t, i) {
  5278. "use strict";
  5279. t.exports = {
  5280. Move: "move",
  5281. MoveComplete: "move.complete",
  5282. ModeChanged: "mode.changed",
  5283. ModeChanging: "mode.changing",
  5284. PanoChosen: "pano.chosen",
  5285. ClosestPanoChanging: "closest.pano.changing",
  5286. WarpStarted: "warp.started",
  5287. WarpInterrupted: "warp.interrupted",
  5288. WarpEnded: "warp.ended",
  5289. FlyinFinished: "flyin.finished",
  5290. FlyingStarted: "flying.started",
  5291. FlyingInterrupted: "flying.interrupted",
  5292. FlyingEnded: "flying.ended",
  5293. Ready: "ready",
  5294. StartInside: "start.inside",
  5295. StartOutside: "start.outside",
  5296. ViewChanged: "view.changed",
  5297. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5298. InputStart: "input.start"
  5299. }
  5300. }
  5301. , {}],
  5302. 41: [function(e, t, i) {
  5303. "use strict";
  5304. t.exports = Object.freeze({
  5305. DEFAULT: 0,
  5306. PANOMARKERS: 1,
  5307. RETICULE: 2,
  5308. TAG: 3
  5309. })
  5310. }
  5311. , {}],
  5312. 42: [function(e, t, i) {
  5313. "use strict";
  5314. t.exports = {
  5315. visibleFloor: 1,
  5316. ghostFloor: 3,
  5317. boundingSkybox: 1,
  5318. panoMarker: 2,
  5319. reticule: 3,
  5320. tagStem: 4,
  5321. tagDisc: 5,
  5322. ribbon: 100
  5323. }
  5324. }
  5325. , {}],
  5326. 43: [function(e, t, i) {
  5327. "use strict";
  5328. t.exports = {
  5329. ContextCreated: "scene-renderer-context-created",
  5330. AfterRender: "after-render",
  5331. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5332. }
  5333. }
  5334. , {}],
  5335. 44: [function(e, t, i) {
  5336. "use strict";
  5337. t.exports = {
  5338. IDLE: "idle",
  5339. BROWSE: "browse",
  5340. EXAMINE: "examine"
  5341. }
  5342. }
  5343. , {}],
  5344. 45: [function(e, t, i) {
  5345. "use strict";
  5346. t.exports = {
  5347. TileDownloadSuccess: "tiledownloader.download.success",
  5348. TileDownloadFailure: "tiledownloader.download.failure",
  5349. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5350. }
  5351. }
  5352. , {}],
  5353. 46: [function(e, t, i) {
  5354. "use strict";
  5355. t.exports = {
  5356. CardboardAndroid: "googlevr",
  5357. GearVR: "gearvr",
  5358. CardboardIOS: "googlevrios",
  5359. Cardboard: "googlevr"
  5360. }
  5361. }
  5362. , {}],
  5363. 47: [function(e, t, i) {
  5364. "use strict";
  5365. t.exports = {
  5366. NONE: 0,
  5367. CONTEXTUAL: 1,
  5368. ANDROID: 2
  5369. }
  5370. }
  5371. , {}],
  5372. 48: [function(e, t, i) {
  5373. "use strict";
  5374. var n = {
  5375. Title: 0,
  5376. Cardboard: 1
  5377. }
  5378. , r = {
  5379. Title: 0,
  5380. Cardboard: 1,
  5381. Gear: 2
  5382. };
  5383. !function() {
  5384. [n, r].forEach(function(e) {
  5385. e.pageCount = Object.keys(e).length
  5386. })
  5387. }(),
  5388. t.exports.ios = n,
  5389. t.exports.standard = r
  5390. }
  5391. , {}],
  5392. 49: [function(e, t, i) {
  5393. "use strict";
  5394. t.exports = {
  5395. Android: "android",
  5396. IOS: "ios",
  5397. Desktop: "desktop",
  5398. UnsupportedAndroid: "android-unsupported"
  5399. }
  5400. }
  5401. , {}],
  5402. 50: [function(e, t, i) {
  5403. "use strict";
  5404. var n = e("three");
  5405. t.exports = {
  5406. UP: new n.Vector3(0,1,0),
  5407. DOWN: new n.Vector3(0,-1,0),
  5408. LEFT: new n.Vector3(-1,0,0),
  5409. RIGHT: new n.Vector3(1,0,0),
  5410. FORWARD: new n.Vector3(0,0,-1),
  5411. BACK: new n.Vector3(0,0,1)
  5412. }
  5413. }
  5414. , {
  5415. three: 217
  5416. }],
  5417. 51: [function(e, t, i) {
  5418. "use strict";
  5419. var n = e("../exception/ViewmodeConvertException")
  5420. , r = e("./coreViewmodes")
  5421. , o = e("../util/common")
  5422. , a = {
  5423. MESH: "mesh",
  5424. OUTDOOR: "outdoor",
  5425. TRANSITIONING: "transitioning",
  5426. toInt: function(e) {
  5427. switch (e) {
  5428. case this.PANORAMA:
  5429. return 1;
  5430. case this.DOLLHOUSE:
  5431. return 2;
  5432. case this.FLOORPLAN:
  5433. return 3;
  5434. case this.OUTDOOR:
  5435. return 4;
  5436. case this.TRANSITIONING:
  5437. return -1
  5438. }
  5439. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5440. },
  5441. fromInt: function(e) {
  5442. switch (e) {
  5443. case "1":
  5444. case 1:
  5445. return this.PANORAMA;
  5446. case "2":
  5447. case 2:
  5448. return this.DOLLHOUSE;
  5449. case "3":
  5450. case 3:
  5451. return this.FLOORPLAN;
  5452. case "4":
  5453. case 4:
  5454. return this.OUTDOOR
  5455. }
  5456. throw new n("No known conversion for int to viewmode for int: " + e)
  5457. },
  5458. convertWorkshopModeInt: function(e) {
  5459. switch (e) {
  5460. case "0":
  5461. case 0:
  5462. case undefined: //xzw add
  5463. return this.PANORAMA;
  5464. case "1":
  5465. case 1:
  5466. return this.FLOORPLAN;
  5467. case "2":
  5468. case 2:
  5469. return this.DOLLHOUSE;
  5470. case "3":
  5471. case 3:
  5472. return this.MESH
  5473. }
  5474. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5475. }
  5476. };
  5477. o.extendObject(a, r),
  5478. t.exports = a
  5479. }
  5480. , {
  5481. "../exception/ViewmodeConvertException": 58,
  5482. "../util/common": 185,
  5483. "./coreViewmodes": 54
  5484. }],
  5485. 52: [function(e, t, i) {
  5486. "use strict";
  5487. t.exports = {
  5488. BLACK: "black",
  5489. STD: "std",
  5490. WALK: "walk"
  5491. }
  5492. }
  5493. , {}],
  5494. 53: [function(e, t, i) {
  5495. "use strict";
  5496. t.exports = {
  5497. ZoomIn: "zoom.in",
  5498. ZoomOut: "zoom.out",
  5499. ZoomMax: "zoom.max",
  5500. ZoomMin: "zoom.min"
  5501. }
  5502. }
  5503. , {}],
  5504. 54: [function(e, t, i) {
  5505. "use strict";
  5506. t.exports = {
  5507. PANORAMA: "panorama",
  5508. DOLLHOUSE: "dollhouse",
  5509. FLOORPLAN: "floorplan"
  5510. }
  5511. }
  5512. , {}],
  5513. 55: [function(e, t, i) {
  5514. "use strict";
  5515. function n(e) {
  5516. this.message = e
  5517. }
  5518. t.exports = n
  5519. }
  5520. , {}],
  5521. 56: [function(e, t, i) {
  5522. "use strict";
  5523. function n(e) {
  5524. r.call(this, e)
  5525. }
  5526. var r = e("./BasicException");
  5527. n.prototype = Object.create(r.prototype),
  5528. t.exports = n
  5529. }
  5530. , {
  5531. "./BasicException": 55
  5532. }],
  5533. 57: [function(e, t, i) {
  5534. "use strict";
  5535. function n(e) {
  5536. r.call(this, e)
  5537. }
  5538. var r = e("./BasicException");
  5539. n.prototype = Object.create(r.prototype),
  5540. t.exports = n
  5541. }
  5542. , {
  5543. "./BasicException": 55
  5544. }],
  5545. 58: [function(e, t, i) {
  5546. "use strict";
  5547. function n(e) {
  5548. r.call(this, e)
  5549. }
  5550. var r = e("./BasicException");
  5551. n.prototype = Object.create(r.prototype),
  5552. t.exports = n
  5553. }
  5554. , {
  5555. "./BasicException": 55
  5556. }],
  5557. 59: [function(e, t, i) {
  5558. (function(i) {
  5559. "use strict";
  5560. function n(e) {
  5561. var t = {};
  5562. if (e) {
  5563. var i = e.flags;
  5564. if (i)
  5565. for (var n in i)
  5566. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5567. return t
  5568. }
  5569. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5570. null
  5571. }
  5572. var r = e("./util/ajax")
  5573. , o = e("./util/showcase")
  5574. , a = e("./util/logger")
  5575. , s = "/api/v1/user/"
  5576. , l = new a(i)
  5577. , c = {};
  5578. t.exports = {
  5579. loadFeatureFlags: function(e) {
  5580. var t = $.Deferred();
  5581. return r.get(e.urlBase + s, {
  5582. responseType: "json",
  5583. prefetchFrom: "user",
  5584. auth: o.getAuthorizationHeader()
  5585. }).done(function(e) {
  5586. c = n(e),
  5587. c ? t.resolve(c) : t.reject("loading-failed")
  5588. }).fail(function() {
  5589. l.debug("Retrieval of feature flags failed."),
  5590. t.reject("loading-failed")
  5591. }),
  5592. t.promise()
  5593. },
  5594. getFlags: function() {
  5595. return c
  5596. },
  5597. updateDependentSettings: function(e, t) {
  5598. e = e || c,
  5599. e.labels && (t.labels.enabled = !0),
  5600. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5601. e.showcase_sdk && (t.sdkInit = !0),
  5602. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5603. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5604. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5605. e.hide_sc_sharing && (t.share.enabled = !1)
  5606. }
  5607. }
  5608. }
  5609. ).call(this, "/js/featureflags.js")
  5610. }
  5611. , {
  5612. "./util/ajax": 181,
  5613. "./util/logger": 189,
  5614. "./util/showcase": 193
  5615. }],
  5616. 60: [function(e, t, i) {
  5617. "use strict";
  5618. var n = (e("../util/common"),
  5619. {
  5620. status: 0,
  5621. set: function(e) {
  5622. var t = e
  5623. , i = $("#bar");
  5624. if (isNaN(t))
  5625. return !1;
  5626. var n = i.attr("r")
  5627. , r = Math.PI * (2 * n);
  5628. t = Math.max(Math.min(t, 100), 0);
  5629. var o = (100 - t) / 100 * r;
  5630. o = Math.max(Math.min(o, 295.3), 0),
  5631. i.css({
  5632. strokeDashoffset: o
  5633. }),
  5634. $("#cont").attr("data-pct", t),
  5635. this.status = e
  5636. },
  5637. done: function(e) {
  5638. return e || this.status ? (this.status = null,
  5639. this.set(100)) : this
  5640. }
  5641. });
  5642. t.exports.circleLoader = n
  5643. }
  5644. , {
  5645. "../util/common": 185
  5646. }],
  5647. 61: [function(e, t, i) {
  5648. "use strict";
  5649. t.exports = Object.freeze({
  5650. CLOSE: "modal.closer.close"
  5651. })
  5652. }
  5653. , {}],
  5654. 62: [function(e, t, i) {
  5655. "use strict";
  5656. function n(e, t) {
  5657. t && (t.stopPropagation(),
  5658. t.preventDefault()),
  5659. e && this.emit(l.CLOSE, e),
  5660. g.reset()
  5661. }
  5662. function r(e, t) {
  5663. function i() {
  5664. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5665. t !== f && (f = t,
  5666. t ? (e.classList.add("closeByFooter"),
  5667. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5668. h.classList.remove("closeByFooter")))
  5669. }
  5670. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5671. }
  5672. var o = e("../../settings")
  5673. , a = (e("../../tag/Media/MediaEvent"),
  5674. e("../../util/browser"))
  5675. , s = e("../../util/common")
  5676. , l = e("./ModalCloserEvent")
  5677. , c = e("events").EventEmitter
  5678. , h = document.getElementsByClassName("footer")[0]
  5679. , u = h.querySelectorAll(".close")[0]
  5680. , d = null
  5681. , p = null
  5682. , f = null
  5683. , g = (a.isMobile(),
  5684. {
  5685. open: function(e) {
  5686. e && (r(e),
  5687. d && u.removeEventListener("click", d, !0),
  5688. d = n.bind(this, e.id),
  5689. u.addEventListener("click", d, !0),
  5690. p && window.removeEventListener("resize", p, !0),
  5691. p = r.bind(this, e),
  5692. window.addEventListener("resize", p, !0))
  5693. },
  5694. reset: function() {
  5695. h.classList.remove("closeByFooter"),
  5696. u.removeEventListener("click", d, !0),
  5697. window.removeEventListener("resize", p, !0),
  5698. d = p = f = null
  5699. }
  5700. });
  5701. s.extendObject(g, c.prototype),
  5702. t.exports = g
  5703. }
  5704. , {
  5705. "../../tag/Media/MediaEvent": 131,
  5706. "../../settings": 166,
  5707. "../../util/browser": 182,
  5708. "../../util/common": 185,
  5709. "./ModalCloserEvent": 61,
  5710. events: 202
  5711. }],
  5712. 63: [function(e, t, i) {
  5713. "use strict";
  5714. function n(e, t, i) {
  5715. var n = new r.GUI({
  5716. width: 400
  5717. })
  5718. , u = n.addFolder("Flydown from Dollhouse");
  5719. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5720. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5721. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5722. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5723. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5724. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5725. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5726. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5727. var d = n.addFolder("Transition between panos");
  5728. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5729. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5730. h.transition.flyTime = 0,
  5731. d.__controllers.forEach(function(e) {
  5732. e.updateDisplay()
  5733. })
  5734. }),
  5735. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5736. h.transition.flySpeed = 0,
  5737. d.__controllers.forEach(function(e) {
  5738. e.updateDisplay()
  5739. })
  5740. }),
  5741. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5742. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5743. d.add(h.transition, "movementEasing", Object.keys(a));
  5744. var p = n.addFolder("Path Display");
  5745. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5746. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5747. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5748. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5749. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5750. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5751. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5752. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5753. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5754. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5755. h.path.color = l[h.path.color],
  5756. h.path.colorUp = l._desat(h.path.color),
  5757. h.path.colorDown = l.darken(h.path.color)
  5758. }),
  5759. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5760. h.reticuleColor = l[h.reticuleColor]
  5761. });
  5762. var f = n.addFolder("Warping")
  5763. , g = f.addFolder("Warp/Teleport");
  5764. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5765. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5766. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5767. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5768. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5769. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5770. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5771. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5772. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5773. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5774. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5775. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5776. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5777. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5778. h.path.typ = c[h.path.typ]
  5779. }),
  5780. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5781. t.endlessLoop = h.warp.loop
  5782. }),
  5783. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5784. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5785. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5786. var m = f.addFolder("Long Warp Only");
  5787. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5788. h.warp.flySpeed = 0,
  5789. m.__controllers.forEach(function(e) {
  5790. e.updateDisplay()
  5791. })
  5792. }),
  5793. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5794. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5795. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5796. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5797. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5798. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5799. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5800. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5801. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5802. var v = n.addFolder("Warp Esoterica");
  5803. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5804. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5805. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5806. h.warp.minWarpTime = 0,
  5807. v.__controllers.forEach(function(e) {
  5808. e.updateDisplay()
  5809. })
  5810. }),
  5811. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5812. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5813. v.add(h.warp, "movementEasing", Object.keys(a));
  5814. var A = n.addFolder("Misc");
  5815. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5816. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5817. }),
  5818. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5819. i.cameras[s.PANORAMA].fov = h.insideFOV
  5820. }),
  5821. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5822. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5823. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5824. var y = n.addFolder("Navigation");
  5825. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5826. h.navigation.panoScores || e.panos.forEach(function(e) {
  5827. e.floor.remove(e.text3d),
  5828. e.text3d = null
  5829. })
  5830. }),
  5831. y.add(h.navigation, "mouseDirection"),
  5832. y.add(h.navigation, "filterStrictness", 0, 1),
  5833. y.add(h.navigation, "angleFactor", -60, 0),
  5834. y.add(h.navigation, "directionFactor", 1, 20),
  5835. y.add(h.navigation, "distanceFactor", -5, 5),
  5836. y.add(h.navigation, "optionalityFactor", .1, 10);
  5837. var C = n.addFolder("tags")
  5838. , I = C.addFolder("Tag Creation");
  5839. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  5840. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5841. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5842. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5843. var E = C.addFolder("Visibility");
  5844. E.add(h.tags.visibility, "anyDistance"),
  5845. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5846. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5847. E.add(h.tags.visibility, "hideViaFloor"),
  5848. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5849. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5850. var b = C.addFolder("Disc Parameters");
  5851. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5852. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5853. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5854. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  5855. }),
  5856. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5857. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  5858. }),
  5859. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  5860. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  5861. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5862. var w = C.addFolder("Navigate");
  5863. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  5864. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  5865. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  5866. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5867. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5868. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5869. var _ = n.addFolder("Debug");
  5870. _.add(h, "wireframe").onFinishChange(function() {
  5871. e.chunks.forEach(function(t) {
  5872. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  5873. t.wireframeTwin.material.depthWrite = !1,
  5874. t.wireframeTwin.material.depthTest = !1,
  5875. t.wireframeTwin.material.opacity = .5,
  5876. t.wireframeTwin.material.transparent = !0),
  5877. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  5878. })
  5879. }),
  5880. _.add(h, "skyboxWireframe").onFinishChange(function() {
  5881. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  5882. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  5883. e.skybox.wireframe = null)
  5884. }),
  5885. _.add(h, "showSweeps").onFinishChange(function() {
  5886. e.setSweepVisibility(h.showSweeps)
  5887. }),
  5888. _.add(h, "showMesh").onFinishChange(function() {
  5889. e.chunks.forEach(function(e) {
  5890. e.visible = h.showMesh
  5891. })
  5892. }),
  5893. _.add(h, "showFloors").onFinishChange(function() {
  5894. e.floors.forEach(function(e) {
  5895. e.collider.children.forEach(function(e) {
  5896. e.material.visible = h.showFloors
  5897. })
  5898. })
  5899. }),
  5900. _.add(h, "showSkyboxes").onFinishChange(function() {
  5901. e.panos.forEach(function(e) {
  5902. e.skyboxMesh.visible = h.showSkyboxes
  5903. })
  5904. }),
  5905. _.add(h, "showNeighbors").onChange(function() {}),
  5906. _.add(e, "alpha", 0, 1)
  5907. }
  5908. var r = e("../lib/dat.gui")
  5909. , o = e("three")
  5910. , a = e("../util/easing")
  5911. , s = e("../enum/Viewmode")
  5912. , l = e("../enum/Colors")
  5913. , c = e("../enum/WarpStyle")
  5914. , h = e("../settings");
  5915. e("../tag/tag");
  5916. r.GUI.prototype.removeFolder = function(e) {
  5917. var t = this.__folders[e];
  5918. t && (t.close(),
  5919. this.__ul.removeChild(t.domElement.parentNode),
  5920. delete this.__folders[e],
  5921. this.onResize())
  5922. }
  5923. ,
  5924. t.exports.toggle = n
  5925. }
  5926. , {
  5927. "../enum/Colors": 19,
  5928. "../enum/Viewmode": 51,
  5929. "../enum/WarpStyle": 52,
  5930. "../lib/dat.gui": 93,
  5931. "../tag/tag": 123,
  5932. "../settings": 166,
  5933. "../util/easing": 186,
  5934. three: 217
  5935. }],
  5936. 64: [function(e, t, i) {
  5937. (function(i) {
  5938. "use strict";
  5939. function n(e, t, i, n) {
  5940. $(".gui-error .error-problem-text").text(e),
  5941. $(".gui-error .error-solution-text").text(t),
  5942. $(".gui-error .error-explanation").text(i),
  5943. $(".gui-error .error-actions").html(n),
  5944. $(window).resize(),
  5945. $(".gui-error").fadeIn(),
  5946. $("#bottom-logo").fadeIn()
  5947. }
  5948. function r(e) {
  5949. 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("");
  5950. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  5951. s.isMobile() || $("[rel=tiletip]").tooltip({
  5952. placement: "bottom",
  5953. delay: {
  5954. show: 50,
  5955. hide: 0
  5956. },
  5957. trigger: "hover",
  5958. viewport: {
  5959. selector: "body",
  5960. padding: 10
  5961. }
  5962. })
  5963. }
  5964. function o() {
  5965. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  5966. , t = [h.ERROR_GENERIC_ACTIONS_1, e, '<a class="link" target="_blank" href=', p, ">" + h.ERROR_GENERIC_ACTIONS_4 + "</a>."].join("");
  5967. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  5968. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5969. e.preventDefault(),
  5970. e.stopPropagation(),
  5971. r(" ")
  5972. })
  5973. }
  5974. function a(e) {
  5975. if ($("head title").text(c.pageTitle),
  5976. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5977. $("#gui-loading").fadeOut(250),
  5978. $("#quick-blackout").hide(),
  5979. l.track("showcase_error", {
  5980. error_key: e
  5981. }),
  5982. h.locale || h.init(),
  5983. "webgl-unsupported" === e)
  5984. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5985. else if ("webgl-ios" === e)
  5986. n(h.ERROR_WEBGL_IOS_PROBLEM, h.ERROR_WEBGL_IOS_SOLUTION, "", h.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  5987. else if ("webgl-safari" === e)
  5988. n(h.ERROR_WEBGL_SAFARI_PROBLEM, "", "", h.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + h.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  5989. else if ("webgl-generic" === e)
  5990. o();
  5991. else if ("missing-urls" === e)
  5992. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  5993. else if ("loading-failed" === e)
  5994. n(h.ERROR_LOADING_FAILED_PROBLEM, "", "", h.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href=' + p + ">" + h.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  5995. else {
  5996. if ("loading-failed-maintenance" !== e)
  5997. return void d.error("Unhandled error: " + e);
  5998. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  5999. }
  6000. }
  6001. var s = e("./../util/browser")
  6002. , l = e("./../analytics")
  6003. , c = e("./../settings")
  6004. , h = e("../localization/localize")
  6005. , u = e("./../util/logger")
  6006. , d = new u(i)
  6007. , p = '"https://support.port.com/hc/articles/208220058"';
  6008. t.exports.error = a
  6009. }
  6010. ).call(this, "/js/gui/error.js")
  6011. }
  6012. , {
  6013. "../localization/localize": 108,
  6014. "./../analytics": 4,
  6015. "./../settings": 166,
  6016. "./../util/browser": 182,
  6017. "./../util/logger": 189
  6018. }],
  6019. 65: [function(e, t, i) {
  6020. (function(i) {
  6021. "use strict";
  6022. function n() {
  6023. Ue = [],
  6024. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6025. Ue.push(".hideTarget", ".pinTop.right")
  6026. }
  6027. function r() {
  6028. for (var e in je)
  6029. if (je.hasOwnProperty(e)) {
  6030. var t = je[e];
  6031. if (!t.visible)
  6032. for (var i = 0; i < t.elements.length; i++)
  6033. $(t.elements[i]).hide()
  6034. }
  6035. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6036. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6037. n()
  6038. }
  6039. function o(e, t) {
  6040. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6041. $("#gui-zoomin").toggle(i),
  6042. $("#gui-zoomout").toggle(i)
  6043. }
  6044. function a() {
  6045. c(),
  6046. $(".pinBottom").toggleClass("open"),
  6047. $("#drawer").toggleClass("open"),
  6048. $(".footer").toggleClass("open"),
  6049. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6050. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6051. ie.resetDrawer()),
  6052. setTimeout(function() {
  6053. $("#pullTab").toggleClass("opened")
  6054. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6055. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6056. }
  6057. function s(e) {
  6058. var t;
  6059. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6060. t = e.position().top + e.outerHeight(),
  6061. e.attr("style", "display: none"));
  6062. var i = $("#player").outerHeight()
  6063. , n = i - 130;
  6064. return n < t + 25
  6065. }
  6066. function l(e) {
  6067. "touchstart" === e.type && e.preventDefault(),
  6068. e.stopPropagation()
  6069. }
  6070. function c() {
  6071. W && (W.reload(),
  6072. W.init())
  6073. }
  6074. function h(e) {
  6075. ne.show(e),
  6076. r()
  6077. }
  6078. function u(e) {
  6079. ne.progress(e)
  6080. }
  6081. function d(e, t, i) {
  6082. var n = t.player;
  6083. $("#gui-thumb").fadeOut(2500),
  6084. ne.hide(function() {
  6085. Ge = !1
  6086. }),
  6087. me.init(e, i),
  6088. de.finishSetup(Object.keys(e.tags).length),
  6089. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6090. var s = function() {
  6091. i.dismissExaminedTag(),
  6092. i.disableHovering()
  6093. };
  6094. Ae.on(ye.OPENED, s),
  6095. Ce.on(Me.OPENED, s),
  6096. he.on(ue.OPENED, s),
  6097. fe.on(ge.OPENED, s);
  6098. var l = i.enableHovering.bind(i);
  6099. if (Ae.on(ye.CLOSED, l),
  6100. Ce.on(Me.CLOSED, l),
  6101. he.on(ue.CLOSED, l),
  6102. fe.on(ge.CLOSED, l),
  6103. Q.labels.enabled && Object.keys(e.labels).length,
  6104. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6105. C(e.currentFloor, n.mode)),
  6106. r(),
  6107. o(t, t.player),
  6108. $("#gui").fadeIn(1500),
  6109. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6110. a(),
  6111. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6112. }, 2e3),
  6113. !K.isMobile())
  6114. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6115. $(c[h]).addClass("hasHover");
  6116. O(e),
  6117. de.setupToggling();
  6118. //xzw:
  6119. editHotPanel();
  6120. }
  6121. function editHotPanel(){//如果是编辑状态
  6122. if(window.location.href.substring(window.location.href.indexOf("&")+1).indexOf('add')==-1) return;
  6123. $('#addHot').css("display","block");
  6124. $('#addHot>div').children()[0].addEventListener("click",function(){//add hot
  6125. g_HotStatus = "add";
  6126. $("#player").css("cursor","cell");
  6127. })
  6128. $('#addHot>div').children()[1].addEventListener("click",function(){//output
  6129. var str = ""
  6130. for(var i=0; i<g_newHot.length; i++){
  6131. str+=( '"'+g_newHot[i].sid + '":{ "position":['+g_newHot[i].position+'], "rotation":['+g_newHot[i].rotation+']},\r');
  6132. }
  6133. if(str=="")logData("没有添加新热点")
  6134. else logData(str)
  6135. })
  6136. $('#addHot>div').children()[2].addEventListener("click",function(){//snapShot
  6137. var ev=document.createEvent("MouseEvent");//"MouseEvent"
  6138. ev.initMouseEvent("snapshotBegin",true,true,document.defaultView,0,0,0,0,0,false,false,false,false,0,null);
  6139. window.dispatchEvent(ev);
  6140. })
  6141. $('#addHot textarea').on("mousewheel",function(e){
  6142. e.stopPropagation();
  6143. })
  6144. window.logData = function(v){
  6145. $('#addHot textarea')[0].value += (v+"\r");
  6146. $('#addHot textarea')[0].scrollTop = $('#addHot textarea')[0].scrollHeight;
  6147. }
  6148. }
  6149. function p(e) {
  6150. e || (e = 0),
  6151. We = !1,
  6152. window.setTimeout(function() {
  6153. We || (ze = !0,
  6154. $("#gui-spinner").stop(!0, !0).show())
  6155. }
  6156. .bind(this), e)
  6157. }
  6158. function f() {
  6159. $("#gui-spinner").stop(!0, !0),
  6160. $("#gui-spinner").fadeOut(1e3),
  6161. We = !0,
  6162. ze = !1
  6163. }
  6164. function g(e, t) {
  6165. var i = e.mode
  6166. , n = t || e.currentPano;
  6167. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6168. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6169. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6170. Q.show360Views.enabled && !n.isAligned() ? ($("#gui-modes-inside").removeClass("hidden"),
  6171. $(".gui-floor").addClass("hidden"),
  6172. $("#gui-modes-outside").addClass("desktop-only")) : ($("#gui-modes-inside").addClass("hidden"),
  6173. $(".gui-floor").removeClass("hidden"),
  6174. $("#gui-modes-outside").removeClass("desktop-only")),
  6175. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6176. Be = i,
  6177. $("#gui-modes-outside").addClass("hidden"),
  6178. $("#gui-modes-inside").removeClass("hidden"),
  6179. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6180. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6181. }
  6182. function m(e, t) {
  6183. var i = t.player;
  6184. $("#gui-modes-inside").find("a").on("click", function(e) {
  6185. l(e),
  6186. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6187. J.track("showcase_gui", {
  6188. gui_action: "click_inside_mode_button"
  6189. }),
  6190. t.changeMode(_e.PANORAMA)
  6191. }),
  6192. $("#gui-modes-outside").find("a").on("click", function(e) {
  6193. l(e),
  6194. J.track("showcase_gui", {
  6195. gui_action: "click_outside_mode_button"
  6196. }),
  6197. t.changeMode(Be)
  6198. }),
  6199. $("#gui-modes-floorplan").on("click", function(e) {
  6200. l(e),
  6201. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6202. gui_action: "click_floorplan_mode_button"
  6203. }),
  6204. t.changeMode(_e.FLOORPLAN))
  6205. }),
  6206. $("#gui-modes-dollhouse").on("click", function(e) {
  6207. l(e),
  6208. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6209. gui_action: "click_dollhouse_mode_button"
  6210. }),
  6211. t.changeMode(_e.DOLLHOUSE))
  6212. })
  6213. }
  6214. function v(e, t) {
  6215. function i() {
  6216. document.getElementById("vr").classList.remove("hidden"),
  6217. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6218. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6219. $(".improper-embed").toggleClass("hidden", !1),
  6220. r())
  6221. }, function(e) {
  6222. r()
  6223. }) : r()
  6224. }
  6225. function n(i) {
  6226. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6227. Ie.init(e.data, t, i, q),
  6228. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6229. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6230. }
  6231. function r() {
  6232. De.info("WebVR support not found, VR button activates native app VR modal"),
  6233. Ae.init(e.data, q),
  6234. Ae.on(ye.OPENED, function() {
  6235. var e = document.getElementById("vr-modal");
  6236. return function() {
  6237. Ze("vr"),
  6238. le.open(e)
  6239. }
  6240. }()),
  6241. Ae.on(ye.CLOSED, le.reset)
  6242. }
  6243. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0))
  6244. switch (Q.vr.option) {
  6245. case Pe.CONTEXTUAL:
  6246. i();
  6247. break;
  6248. case Pe.ANDROID:
  6249. K.detectAndroid() && i();
  6250. break;
  6251. case Pe.NONE:
  6252. }
  6253. }
  6254. function A(e, t) {
  6255. $("#play").find("a").on("mousedown touchstart", function(e) {
  6256. l(e);
  6257. Ze("tour");
  6258. ve.play();
  6259. J.trackAlways("showcase_gui", {
  6260. gui_action: "play_highlights"
  6261. })
  6262. }),
  6263. $("#pause").find("a").on("mousedown touchstart", function(e) {
  6264. l(e),
  6265. ve.pause(),
  6266. J.trackAlways("showcase_gui", {
  6267. gui_action: "pause_highlights"
  6268. })
  6269. }),
  6270. $("#gui-zoomin").find("a").on("click", function(e) {
  6271. l(e),
  6272. t.player.zoomInIncrementally()
  6273. }),
  6274. $("#gui-zoomout").find("a").on("click", function(e) {
  6275. l(e),
  6276. t.player.zoomOutIncrementally()
  6277. })
  6278. }
  6279. function y(e, t) {
  6280. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6281. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6282. $(".gui-floor").find(".container").prepend(r)
  6283. }
  6284. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6285. i.on("click", function(e) {
  6286. l(e),
  6287. Ze("floor"),
  6288. i.toggleClass("open")
  6289. }),
  6290. $(".floorChoice").on("click", function(e) {
  6291. l(e);
  6292. var n = $(this).data("index");
  6293. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6294. t.player.gotoFloor(n),
  6295. J.track("showcase_gui", {
  6296. gui_action: "click_floor_select_button",
  6297. interaction_source: "gui"
  6298. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6299. Ze("move"),
  6300. t.allFloors(),
  6301. J.track("showcase_gui", {
  6302. gui_action: "click_toggle_all_floors_button",
  6303. interaction_source: "gui"
  6304. })),
  6305. i.removeClass("open")
  6306. })
  6307. }
  6308. function C(e, t) {
  6309. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? $(".allFloorBtn").show() : $(".allFloorBtn").hide(),
  6310. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6311. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6312. $(".floorChoice").removeClass("active"),
  6313. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6314. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6315. $(".floorChoice").removeClass("active"),
  6316. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6317. }
  6318. function I(e) {
  6319. return e.describe().inTransition
  6320. }
  6321. function E(e) {
  6322. $("<img/>").attr("src", e).on("load", function() {
  6323. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  6324. $(this).remove()
  6325. })
  6326. }
  6327. function b(e, t, i) {
  6328. Fe = e.heroLocations.length;
  6329. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6330. , r = 100 / Fe + "%"
  6331. , o = $("#thumb-container")
  6332. , a = $("#progressBar");
  6333. $("#status").find(".totalSteps").text(Fe);
  6334. for (var s = 0; s < Fe; s++) {
  6335. var c = e.heroLocations[s]
  6336. , h = $(n);
  6337. if (h.attr("data-index", s),
  6338. je.highlight.visible && h.find("img").attr("src", c.thumbUrl),
  6339. c.name) {
  6340. var u = $('<div class="overlay"></div>').text(c.name);
  6341. h.prepend(u)
  6342. }
  6343. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6344. var d = e.panos.get(c.panoId)
  6345. , p = d && !d.isAligned()
  6346. , f = p ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6347. h.prepend(f)
  6348. }
  6349. o.append(h),
  6350. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6351. }
  6352. j = 144 * Fe,
  6353. Y = 111 * Fe,
  6354. $(".thumbImg").on("mouseover", function() {
  6355. I(t) || i.showPathToHeroLocation($(this).data("index"))
  6356. }),
  6357. $(".thumbImg").on("mouseout", function() {
  6358. t.clearPath()
  6359. }),
  6360. $(".thumbImg").on("click", function(e) {
  6361. l(e);
  6362. var i = $(this);
  6363. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6364. J.trackAlways("showcase_gui", {
  6365. gui_action: "click_highlight"
  6366. }),
  6367. t.goToHighlight(i.data("index"))
  6368. }),
  6369. $(".previous").find("a").on("click", function(e) {
  6370. l(e),
  6371. J.trackAlways("showcase_gui", {
  6372. gui_action: "prev_highlight"
  6373. }),
  6374. t.prevHighlight()
  6375. }),
  6376. $(".next").find("a").on("click", function(e) {
  6377. l(e),
  6378. J.trackAlways("showcase_gui", {
  6379. gui_action: "next_highlight"
  6380. }),
  6381. t.nextHighlight()
  6382. }),
  6383. $("#drawer").on("mouseleave", function(e) {
  6384. l(e);
  6385. var t;
  6386. try {
  6387. t = new MouseEvent("mouseup",{
  6388. clientX: e.clientX,
  6389. clientY: e.clientY,
  6390. screenX: e.screenX,
  6391. screenY: e.screenY
  6392. })
  6393. } catch (i) {
  6394. t = document.createEvent("MouseEvents"),
  6395. t.initMouseEvent("mouseup", e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  6396. }
  6397. document.dispatchEvent(t)
  6398. }),
  6399. W = new Sly($("#scrollFrame"),{
  6400. horizontal: !0,
  6401. itemNav: "centered",
  6402. smart: !0,
  6403. scrollTrap: !0,
  6404. scrollBy: 1,
  6405. mouseDragging: !0,
  6406. touchDragging: !0,
  6407. speed: 300,
  6408. dragHandle: !0,
  6409. dynamicHandle: !0,
  6410. clickBar: !0,
  6411. scrollBar: $("#scroller"),
  6412. activateOn: null
  6413. }).init(),
  6414. W.on("active", function(e, t) {
  6415. Ve = t,
  6416. Ze("tour"),
  6417. $(".step").removeClass("active"),
  6418. $("#status").find(".curIdx").text(t + 1);
  6419. for (var i = 0; i <= t; i++)
  6420. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6421. }),
  6422. w()
  6423. }
  6424. function w() {
  6425. var e = $("#player").width() - 20
  6426. , t = $("#scroller")
  6427. , i = $("#drawer")
  6428. , n = $(".pinBottom");
  6429. if ($("#player").width() < 488 || $("#player").height() < 488)
  6430. t.addClass("hidden"),
  6431. i.addClass("noScroll"),
  6432. n.addClass("noScroll");
  6433. else {
  6434. var r = j > e
  6435. , o = !i.hasClass("noScroll")
  6436. , a = r !== o;
  6437. a && (t.toggleClass("hidden"),
  6438. i.toggleClass("noScroll"),
  6439. n.toggleClass("noScroll"))
  6440. }
  6441. }
  6442. function _(e) {
  6443. je.tourControls.visible = e.tour_buttons && K.valueFromHash("gt", 1),
  6444. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6445. je.highlight.visible = e.highlight_reel && 1 !== Q.specialEdition && Q.showHighlights
  6446. }
  6447. function T(e) {
  6448. function t(t, i) {
  6449. return !!e.player_options[t] && e[i || t]
  6450. }
  6451. $(".model-title").text(e.name);
  6452. var i = Q.pageTitle;
  6453. 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6454. document.title = i,
  6455. K.isMobile() ? $("#gui-fullscreen").toggleClass("hidden") : ($("[rel=tooltip]").tooltip({
  6456. delay: {
  6457. show: 50,
  6458. hide: 0
  6459. },
  6460. trigger: "hover",
  6461. html: !1,
  6462. viewport: {
  6463. selector: "body",
  6464. padding: 10
  6465. }
  6466. }),
  6467. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6468. t("presented_by") && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", 0) ? document.getElementById("loaderCoBrandName").innerText = t("presented_by") : document.getElementById("loaderCoBrand").classList.add("hidden"),
  6469. de.populate({
  6470. name: t("model_name", "name"),
  6471. coBrand: t("presented_by"),
  6472. description: t("model_summary", "summary"),
  6473. contactName: t("contact_name"),
  6474. address: t("address"),
  6475. phone: t("contact_phone"),
  6476. formattedPhone: e.formatted_contact_phone,
  6477. email: t("contact_email"),
  6478. url: t("external_url"),
  6479. socialSharing: e.enable_social_sharing && e.is_public
  6480. })
  6481. }
  6482. function x(e, t, i, n, r, o) {
  6483. function a() {
  6484. o.setLoadingStartTime(),
  6485. H(),
  6486. r ? (re.showMessage(t, i, je.coBrand.visible),
  6487. l()) : h(l)
  6488. }
  6489. var s = $.Deferred()
  6490. , l = s.resolve.bind(s);
  6491. return Ge = !0,
  6492. O(e),
  6493. e.data.player_options && _(e.data.player_options),
  6494. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6495. Re.localizeGUI(),
  6496. T(e.data),
  6497. r || $(".quick").addClass("hidden"),
  6498. e.data.image && !r && E(e.data.image),
  6499. n ? (J.impression(),
  6500. a()) : (o.setWaitingStartTime(),
  6501. oe.show(r, a)),
  6502. s
  6503. }
  6504. function S(e, t, i, n, r, a, s) {
  6505. q = s,
  6506. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6507. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6508. ae.init(),
  6509. re.init(e, a),
  6510. Oe.init(e, t, n),
  6511. $(".icon").on("mouseover", function() {
  6512. t.player && t.player.reticule.hide()
  6513. }),
  6514. m(e, t),
  6515. A(e, t),
  6516. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(e.data.name),
  6517. Ce.on(Me.OPENED, function() {
  6518. var e = document.getElementById("share-modal");
  6519. return function() {
  6520. Ze("share"),
  6521. le.open(e)
  6522. }
  6523. }()),
  6524. Ce.on(Me.CLOSED, le.reset)),
  6525. e.heroLocations.length > 1 ? b(e, t, i) : (je.highlight.visible = !1,
  6526. je.tourControls.visible = !1),
  6527. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6528. z(),
  6529. g(i),
  6530. v(e, r),
  6531. e.on("floor.changed", C),
  6532. e.on("waiting", R.bind(this, e)),
  6533. e.on("waiting-done", P.bind(this, e)),
  6534. i.on(xe.ModeChanged, function(e, n) {
  6535. g(i),
  6536. o(t, i),
  6537. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6538. he.updateMode(n)
  6539. }),
  6540. n.on(Se.Move, Ze.bind(this, "move")),
  6541. i.on(xe.Ready, function() {
  6542. ie.init(n, i, i.tagManager, t),
  6543. i.on(xe.ModeChanged, function(e, t) {
  6544. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6545. })
  6546. }),
  6547. i.on(xe.PanoChosen, function(e, t) {
  6548. g(i, t),
  6549. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6550. }),
  6551. le.on(ce.CLOSE, function(e) {
  6552. switch (e) {
  6553. case "vr-modal":
  6554. Ae.dismiss();
  6555. break;
  6556. case "share-modal":
  6557. Ce.hide();
  6558. break;
  6559. case "terms-modal":
  6560. fe.hide()
  6561. }
  6562. });
  6563. var l = $("#play").eq(0)
  6564. , c = $("#pause").eq(0)
  6565. , h = $(".pinBottom").toArray()
  6566. , u = $("#drawer").eq(0)
  6567. , d = $("#playHead").eq(0)
  6568. , p = $("#progressBar").eq(0)
  6569. , f = $("#thumb-container").eq(0)
  6570. , y = f.children()
  6571. , I = p.children();
  6572. t.on("update.controls", function() {
  6573. var n = t.describe();
  6574. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6575. c.show()),
  6576. n.tourInProgress && (h.forEach(function(e) {
  6577. e.classList.add("playing")
  6578. }),
  6579. u.addClass("playing"),
  6580. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6581. c.hide()),
  6582. n.tourInProgress || (ve.stopTour(),
  6583. h.forEach(function(e) {
  6584. e.classList.remove("playing")
  6585. }),
  6586. u.removeClass("playing"),
  6587. d.removeClass("playing")));
  6588. var r, a, s;
  6589. if (null !== n.currentItem) {
  6590. var p, f;
  6591. $("#status").find(".curIdx").text(n.currentItem + 1),
  6592. n.onTheBus ? (p = "active",
  6593. f = "recent") : (f = "active",
  6594. p = "recent");
  6595. var g = null === n.destinationItem || n.currentItem === n.destinationItem;
  6596. for (r = 0; r < e.heroLocations.length; r += 1)
  6597. s = y.eq(r),
  6598. a = I.eq(r),
  6599. s.removeClass(f),
  6600. a.removeClass(f),
  6601. n.onTheBus && r === n.destinationItem ? (s.addClass(p),
  6602. a.addClass(p),
  6603. W.activate(r)) : n.onTheBus && g && r === n.currentItem ? (s.addClass(p),
  6604. a.addClass(p)) : (s.removeClass(p),
  6605. a.removeClass(p))
  6606. } else
  6607. for (r = 0; r < e.heroLocations.length; r += 1)
  6608. s = y.eq(r),
  6609. a = I.eq(r),
  6610. s.removeClass("active recent"),
  6611. a.removeClass("active recent");
  6612. o(t, i)
  6613. }),
  6614. document.addEventListener("keydown", function(n) {
  6615. switch (J.updateInteraction(Se.InteractionKey),
  6616. n.which) {
  6617. case we.ZERO:
  6618. Q.debug && e.toggleAlpha();
  6619. break;
  6620. case we.NINE:
  6621. Q.debug && se.toggle();
  6622. break;
  6623. case we.ONE:
  6624. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6625. break;
  6626. case we.TWO:
  6627. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6628. break;
  6629. case we.THREE:
  6630. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6631. break;
  6632. case we.FOUR:
  6633. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6634. break;
  6635. case we.SPACE:
  6636. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6637. break;
  6638. case we.RETURN:
  6639. Q.debug && e.toggleExplodeUp();
  6640. break;
  6641. case we.P:
  6642. k();
  6643. break;
  6644. case we.U:
  6645. B();
  6646. break;
  6647. case we.X:
  6648. Q.debug && e.toggleExplode();
  6649. break;
  6650. case we.PLUSEQUALS:
  6651. t.player.activatePersistentZooming(!0),
  6652. ie.hideUi();
  6653. break;
  6654. case we.DASHUNDERSCORE:
  6655. t.player.activatePersistentZooming(!1),
  6656. ie.hideUi();
  6657. break;
  6658. case we.SEVEN:
  6659. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6660. break;
  6661. case we.EIGHT:
  6662. t.player.decreaseZoomSpeed();
  6663. break;
  6664. case we.NINE:
  6665. t.player.increaseZoomSpeed()
  6666. }
  6667. return i && i.reticule.hide(),
  6668. !0
  6669. }
  6670. .bind(this)),
  6671. document.addEventListener("keyup", function(e) {
  6672. switch (e.which) {
  6673. case we.PLUSEQUALS:
  6674. t.player.deactivatePersistentZooming();
  6675. break;
  6676. case we.DASHUNDERSCORE:
  6677. t.player.deactivatePersistentZooming()
  6678. }
  6679. }
  6680. .bind(this)),
  6681. F(e),
  6682. L(e, t.player),
  6683. M(i),
  6684. te.setAutoPlay(e.heroCount()),
  6685. he.init(i, a.mode),
  6686. he.on(ue.OPENED, Ze.bind(this, "help")),
  6687. fe.init(),
  6688. fe.on(ge.OPENED, function() {
  6689. var e = document.getElementById("terms-modal");
  6690. return function() {
  6691. Ze("terms"),
  6692. le.open(e)
  6693. }
  6694. }()),
  6695. fe.on(ge.CLOSED, le.reset),
  6696. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6697. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6698. Q.profiling.enabled && se.show(),
  6699. ve.init(t)
  6700. }
  6701. function M(e) {
  6702. var t = function(e, t) {
  6703. $(e).find("a").each(function(e, i) {
  6704. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6705. i.style.pointerEvents = t ? "auto" : "none"
  6706. })
  6707. }
  6708. , i = function() {
  6709. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6710. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6711. };
  6712. e.on(Ne.ZoomMax, function() {
  6713. t("#gui-zoomin", !1),
  6714. t("#gui-zoomout", !0)
  6715. }),
  6716. e.on(Ne.ZoomMin, function() {
  6717. t("#gui-zoomin", !0),
  6718. t("#gui-zoomout", !1)
  6719. }),
  6720. e.on(Ne.ZoomIn, function() {
  6721. t("#gui-zoomout", !0)
  6722. }),
  6723. e.on(Ne.ZoomOut, function() {
  6724. t("#gui-zoomin", !0)
  6725. }),
  6726. i()
  6727. }
  6728. function R(e) {
  6729. O(e)
  6730. }
  6731. function P(e) {
  6732. O(e)
  6733. }
  6734. function O(e) {
  6735. var t = e.waitQueue.length;
  6736. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6737. }
  6738. function L(e, t) {
  6739. He = {
  6740. gui: null,
  6741. visible: !1,
  6742. model: e,
  6743. player: t
  6744. }
  6745. }
  6746. function D(e, t) {
  6747. function i() {
  6748. var i = t.toJSON();
  6749. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6750. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6751. }
  6752. var n = {}
  6753. , r = new Le.GUI({
  6754. autoPlace: !0,
  6755. width: "60%"
  6756. });
  6757. i(),
  6758. t.on(xe.ViewChanged, i),
  6759. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6760. r.domElement.id = "datLinks";
  6761. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6762. return o.forEach(function(e) {
  6763. if (!K.detectSafari()) {
  6764. var t = document.createElement("button");
  6765. t.classList.add("btn-deep-link"),
  6766. t.innerText = Re.MENU_COPY,
  6767. e.nextSibling.appendChild(t);
  6768. var i = function() {
  6769. alert(Re.LINK_ALERT_COPY),
  6770. t.hide()
  6771. };
  6772. t.addEventListener("click", function(e) {
  6773. try {
  6774. var t = e.target.parentNode.childNodes[0];
  6775. t.select();
  6776. var n = document.execCommand("copy");
  6777. t.blur(),
  6778. n || i()
  6779. } catch (e) {
  6780. i()
  6781. }
  6782. })
  6783. }
  6784. }),
  6785. $(r.__closeButton).hide(),
  6786. r
  6787. }
  6788. function N(e) {
  6789. He.gui || (He.gui = D(He.model, He.player)),
  6790. He.visible = e,
  6791. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6792. }
  6793. function B() {
  6794. N(!He.visible)
  6795. }
  6796. function F(e) {
  6797. ke = {
  6798. gui: null,
  6799. visible: !1,
  6800. model: e
  6801. }
  6802. }
  6803. function V(e) {
  6804. var t = new Le.GUI;
  6805. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6806. e.setSweepVisibility(Q.showSweeps)
  6807. }),
  6808. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6809. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6810. Q.transition.flySpeed = 0,
  6811. t.__controllers.forEach(function(e) {
  6812. e.updateDisplay()
  6813. })
  6814. }),
  6815. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6816. $(t.__closeButton).hide(),
  6817. t
  6818. }
  6819. function U(e) {
  6820. ke.gui || (ke.gui = V(ke.model)),
  6821. ke.visible = e,
  6822. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  6823. }
  6824. function k() {
  6825. U(!ke.visible)
  6826. }
  6827. function H() {
  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) || e.preventDefault()
  6830. }
  6831. $("body").css("touch-action", "none"),
  6832. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  6833. e.preventDefault()
  6834. });
  6835. var t = document.getElementById("terms-text")
  6836. , i = document.getElementById("more-help-wrapper")
  6837. , n = (document.getElementById("navigation-help-wrapper"),
  6838. document.getElementById("help-dialog"),
  6839. document.getElementById("tag-billboards"));
  6840. Q.useWheel && (document.body.addEventListener("mousewheel", e),
  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. function G(e, t) {
  6847. for (var i = []; e; )
  6848. i.push(e),
  6849. e = e.parentNode;
  6850. for (; t && i.indexOf(t) === -1; )
  6851. t = t.parentNode;
  6852. return t
  6853. }
  6854. function z() {
  6855. var e, t = function(t) {
  6856. e = 0 === t.button || 1 === t.which ? t.target : null
  6857. }, i = function(t) {
  6858. e !== t.target && (e = G(e, t.target));
  6859. var i = document.getElementById("gui-parent");
  6860. if (G(i, e) !== i && (e = null),
  6861. e) {
  6862. var n;
  6863. try {
  6864. n = new MouseEvent("click",t)
  6865. } catch (e) {
  6866. n = document.createEvent("MouseEvents"),
  6867. n.initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6868. }
  6869. n.syntheticClick = !0,
  6870. e.dispatchEvent(n),
  6871. e = null
  6872. }
  6873. };
  6874. document.body.addEventListener("mousedown", t, !0),
  6875. document.body.addEventListener("mouseup", i, !0),
  6876. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6877. e.syntheticClick || (e.stopPropagation(),
  6878. "A" === e.target.nodeName && e.preventDefault())
  6879. }, !0)
  6880. }
  6881. var W, j, Y, X, Z, q, K = (e("three"),
  6882. e("../util/ajax"),
  6883. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  6884. e("../util/camera"),
  6885. e("../util/logger")), te = (e("../objects/Snapshot"),
  6886. e("./helpManager")), ie = e("./immersiveMode"), ne = e("./loadingScreen"), re = e("./landingScreen"), oe = e("./playButton"), ae = e("./populateModal"), se = e("./memoryUsage"), le = e("./closer/modalCloser"), ce = e("./closer/ModalCloserEvent"), he = e("./help/help"), ue = e("./help/HelpEvent"), de = e("./title/titleBar"), pe = e("./title/TitleEvents"), fe = e("./terms/terms"), ge = e("./terms/TermsEvent"), me = e("./title/tagToggle"), ve = e("./tourInteraction"), Ae = e("./vr/vrModal"), ye = e("./vr/vrEvent"), Ce = e("./sharing/modal"), Ie = e("./webvr/webVRgui"), Ee = e("./webvr/WebVrEvent"), be = e("../controls/serializer"), we = e("../enum/Keys"), _e = e("../enum/Viewmode"), Te = (e("../enum/BlackoutStyle"),
  6887. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  6888. e("../enum/PathDisplayMode"),
  6889. e("../enum/DirectorEvents"),
  6890. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  6891. e("../enum/WarpStyle"),
  6892. e("../enum/AlignmentType"),
  6893. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  6894. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  6895. coBrand: {
  6896. visible: !0,
  6897. elements: [".co-brand", "#loaderCoBrand"]
  6898. },
  6899. help: {
  6900. visible: !0,
  6901. elements: [".nav-help", "#nav-help"]
  6902. },
  6903. tourControls: {
  6904. visible: !0,
  6905. elements: [".next", ".previous", "#play"]
  6906. },
  6907. highlight: {
  6908. visible: !0,
  6909. elements: ["#drawer", "#pullTab"]
  6910. },
  6911. share: {
  6912. visible: !0,
  6913. elements: [".socialButton", "#share"]
  6914. },
  6915. fullScreen: {
  6916. visible: !0,
  6917. elements: ["#gui-fullscreen"]
  6918. },
  6919. floors: {
  6920. visible: !0,
  6921. elements: [".gui-floor"]
  6922. }
  6923. }, Ye = function() {
  6924. var e = document.getElementById("drawer");
  6925. return function() {
  6926. $("#player").height() < 400 && e.classList.contains("open") && a()
  6927. }
  6928. }(), Xe = function() {
  6929. var e = document.getElementById("meta-info");
  6930. return function() {
  6931. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  6932. }
  6933. }(), Ze = function(e) {
  6934. function t() {
  6935. u.classList.contains("expand") && de.toggleMeta(!0)
  6936. }
  6937. function i() {
  6938. fe.hide()
  6939. }
  6940. function n() {
  6941. he.close()
  6942. }
  6943. function r() {
  6944. Ae.dismiss()
  6945. }
  6946. function o() {
  6947. p.hasClass("open") && a(!0)
  6948. }
  6949. function l() {
  6950. Ce.hide()
  6951. }
  6952. function c() {
  6953. f.hasClass("open") && f.removeClass("open")
  6954. }
  6955. function h() {
  6956. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  6957. }
  6958. var u = document.getElementById("meta-info")
  6959. , d = document.getElementById("interaction-modal")
  6960. , p = $("#drawer").eq(0)
  6961. , f = $(".gui-floor").eq(0)
  6962. , g = $(".vr-popup").eq(0);
  6963. return function(e) {
  6964. switch (e) {
  6965. case "info":
  6966. i(),
  6967. n(),
  6968. Ye(),
  6969. l(),
  6970. c(),
  6971. r(),
  6972. h();
  6973. break;
  6974. case "terms":
  6975. t(),
  6976. n(),
  6977. o(),
  6978. l(),
  6979. c(),
  6980. r(),
  6981. h();
  6982. break;
  6983. case "help":
  6984. t(),
  6985. i(),
  6986. l(),
  6987. c(),
  6988. r(),
  6989. h();
  6990. break;
  6991. case "vr":
  6992. t(),
  6993. i(),
  6994. l(),
  6995. c(),
  6996. n(),
  6997. h(),
  6998. s(g) && o();
  6999. break;
  7000. case "highlights":
  7001. Xe(),
  7002. i(),
  7003. l(),
  7004. c();
  7005. break;
  7006. case "share":
  7007. t(),
  7008. i(),
  7009. n(),
  7010. c(),
  7011. r(),
  7012. h();
  7013. break;
  7014. case "floor":
  7015. i(),
  7016. l(),
  7017. r();
  7018. break;
  7019. case "view":
  7020. c(),
  7021. l(),
  7022. i(),
  7023. r();
  7024. break;
  7025. case "tour":
  7026. i(),
  7027. l(),
  7028. c(),
  7029. r();
  7030. break;
  7031. case "move":
  7032. i(),
  7033. l(),
  7034. c(),
  7035. r();
  7036. break;
  7037. case "resize":
  7038. t(),
  7039. Ye(),
  7040. c();
  7041. break;
  7042. case "tag":
  7043. i(),
  7044. n(),
  7045. l(),
  7046. c(),
  7047. r()
  7048. }
  7049. }
  7050. }();
  7051. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7052. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7053. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7054. setTimeout(function() {
  7055. $(".icon:visible").hide().show(0)
  7056. }, 100)
  7057. }),
  7058. $("#gui-fullscreen").find("a").on("click", function(e) {
  7059. l(e),
  7060. K.requestFullscreen($("body")[0]),
  7061. J.track("showcase_gui", {
  7062. gui_action: "click_enter_fullscreen",
  7063. interaction_source: "gui"
  7064. }),
  7065. W.reload()
  7066. }),
  7067. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7068. l(e),
  7069. K.exitFullscreen(),
  7070. J.track("showcase_gui", {
  7071. gui_action: "click_exit_fullscreen",
  7072. interaction_source: "gui"
  7073. })
  7074. }),
  7075. $("#volume").find("a").on("click", function(e) {//xzw 声音
  7076. l(e);
  7077. if($("#volume img")[0].src.indexOf("btn_on.png")>-1)
  7078. {
  7079. g_play = 0;
  7080. //g_bgAudio.pause();
  7081. //g_tourAudio.pause(); //g_tourAudio.volume = 0;//ios 无法改变音量
  7082. g_playAudio && g_playAudio.pause();
  7083. $("#volume img").attr("src", "./images/Volume btn_off.png");
  7084. $("#volume").attr("title", "关闭声音");
  7085. }
  7086. else if($("#volume img")[0].src.indexOf("btn_off.png")>-1)
  7087. {
  7088. g_play = 1;
  7089. g_playAudio && g_playAudio.play()
  7090. /* if(g_tourAudio && g_tourAudio.src) g_tourAudio.play();
  7091. else if(g_bgAudio)g_bgAudio.play() */
  7092. $("#volume img").attr("src", "./images/Volume btn_on.png");
  7093. $("#volume").attr("title", "打开声音");
  7094. }
  7095. }),
  7096. $(window).on("resize", function(e) {
  7097. var t = e.target.innerHeight
  7098. , i = e.target.innerWidth;
  7099. t === X && i === Z || (je.highlight.visible && w(),
  7100. Ze("resize"),
  7101. $(".pinTop.right").removeClass("hideUnderMeta"),
  7102. c(),
  7103. X = t,
  7104. Z = i)
  7105. }).resize(),
  7106. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7107. $("#pullTab").on("click", function(e) {
  7108. l(e),
  7109. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7110. gui_action: "hide_highlight_reel"
  7111. }),
  7112. $(this).addClass("open")) : (J.trackAlways("showcase_gui", {
  7113. gui_action: "show_highlight_reel"
  7114. }),
  7115. $(this).removeClass("open")),
  7116. a()
  7117. }),
  7118. $("#more-menu-button").on("click", function(e) {
  7119. l(e);
  7120. var t = $("#more-menu");
  7121. t.toggleClass("open")
  7122. }),
  7123. t.exports.init = S,
  7124. t.exports.startLoading = x,
  7125. t.exports.endLoading = d,
  7126. t.exports.onProgress = u
  7127. }
  7128. ).call(this, "/js/gui/gui.js")
  7129. }
  7130. , {
  7131. "../analytics": 4,
  7132. "../controls/serializer": 14,
  7133. "../enum/AlignmentType": 17,
  7134. "../enum/BlackoutStyle": 18,
  7135. "../enum/ControlEvents": 21,
  7136. "../enum/DirectorEvents": 23,
  7137. "../enum/Keys": 30,
  7138. "../enum/PathDiscardMode": 38,
  7139. "../enum/PathDisplayMode": 39,
  7140. "../enum/PlayerEvents": 40,
  7141. "../enum/VROption": 47,
  7142. "../enum/Vectors": 50,
  7143. "../enum/Viewmode": 51,
  7144. "../enum/WarpStyle": 52,
  7145. "../enum/ZoomEvents": 53,
  7146. "../lib/dat.gui": 93,
  7147. "../localization/localize": 108,
  7148. "../tag/Media/MediaEvent": 131,
  7149. "../objects/Snapshot": 153,
  7150. "../settings": 166,
  7151. "../util/ajax": 181,
  7152. "../util/browser": 182,
  7153. "../util/camera": 183,
  7154. "../util/logger": 189,
  7155. "../util/showcase": 193,
  7156. "../util/transitions": 195,
  7157. "./closer/ModalCloserEvent": 61,
  7158. "./closer/modalCloser": 62,
  7159. "./help/HelpEvent": 66,
  7160. "./help/help": 67,
  7161. "./helpManager": 68,
  7162. "./immersiveMode": 69,
  7163. "./konami": 70,
  7164. "./landingScreen": 71,
  7165. "./loadingScreen": 72,
  7166. "./memoryUsage": 73,
  7167. "./playButton": 74,
  7168. "./populateModal": 75,
  7169. "./sharing/ShareEvents": 76,
  7170. "./sharing/modal": 77,
  7171. "./terms/TermsEvent": 78,
  7172. "./terms/terms": 79,
  7173. "./title/TitleEvents": 80,
  7174. "./title/tagToggle": 81,
  7175. "./title/titleBar": 82,
  7176. "./tourInteraction": 84,
  7177. "./vr/vrEvent": 85,
  7178. "./vr/vrModal": 87,
  7179. "./webvr/WebVrEvent": 88,
  7180. "./webvr/webVRgui": 89,
  7181. three: 217
  7182. }],
  7183. 66: [function(e, t, i) {
  7184. "use strict";
  7185. t.exports = Object.freeze({
  7186. OPENED: "help.opened",
  7187. CLOSED: "help.closed"
  7188. })
  7189. }
  7190. , {}],
  7191. 67: [function(e, t, i) {
  7192. "use strict";
  7193. function n() {
  7194. g.on("click", function(e) {
  7195. if (S && S !== l.TRANSITIONING) {
  7196. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7197. t && !M ? R.close() : r()
  7198. }
  7199. }),
  7200. w.on("click", function(e) {
  7201. R.close()
  7202. }),
  7203. E.on("click", function(e) {
  7204. S && S !== l.TRANSITIONING && (s(),
  7205. o())
  7206. }),
  7207. b.on("click", function(e) {
  7208. s(),
  7209. a()
  7210. })
  7211. }
  7212. function r() {
  7213. S && S !== l.TRANSITIONING && (M = !0,
  7214. setTimeout(function() {
  7215. M = !1
  7216. }, d.help.modalStayDuration),
  7217. R.emit(h.OPENED),
  7218. m.addClass("open " + S),
  7219. g.addClass("open"),
  7220. s(),
  7221. o(),
  7222. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7223. y.classList.add("fadeIn"))
  7224. }
  7225. function o() {
  7226. E.addClass("underline-tab"),
  7227. u.fill(_, c.NAVIGATION, S),
  7228. m.addClass(S)
  7229. }
  7230. function a() {
  7231. b.addClass("underline-tab"),
  7232. u.fill(T, c.MORE_HELP),
  7233. m.addClass("more-help")
  7234. }
  7235. function s(e, t) {
  7236. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7237. I.forEach(function(e) {
  7238. e.classList.remove("underline-tab")
  7239. })
  7240. }
  7241. var l = e("../../enum/Viewmode")
  7242. , c = e("../../enum/HelpModalType")
  7243. , h = e("./HelpEvent")
  7244. , u = (e("../helpManager"),
  7245. e("./../populateModal"))
  7246. , d = e("../../settings")
  7247. , p = e("../../util/common")
  7248. , f = e("events").EventEmitter
  7249. , g = $(".footer-help").eq(0)
  7250. , m = $("#help-dialog").eq(0)
  7251. , v = document.querySelector("#quick-logo")
  7252. , A = document.querySelector("#loaderCoBrand")
  7253. , y = document.querySelector("#help-dialog")
  7254. , C = document.querySelector(".footer")
  7255. , I = $(".help-tabs").children().toArray()
  7256. , E = $(".navigation-tab").eq(0)
  7257. , b = $(".more-help-tab").eq(0)
  7258. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7259. m.find(".close").eq(0))
  7260. , _ = m.find(".interactions").toArray()
  7261. , T = m.find(".ui-instructions").toArray()
  7262. , x = l.PANORAMA
  7263. , S = l.PANORAMA
  7264. , M = !1
  7265. , R = {
  7266. init: function(e, t) {
  7267. S = t,
  7268. x = t,
  7269. [y, A, v, C].forEach(function(e) {
  7270. e.classList.add(u.deviceType)
  7271. }),
  7272. n()
  7273. },
  7274. close: function() {
  7275. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7276. g.removeClass("open"),
  7277. m.removeClass("open"),
  7278. y.classList.contains("fadeIn"))) {
  7279. y.classList.remove("fadeIn");
  7280. var e = S === l.TRANSITIONING ? x : S;
  7281. u.clear(_, c.NAVIGATION, e)
  7282. }
  7283. },
  7284. updateMode: function(e) {
  7285. x = S,
  7286. S = e
  7287. }
  7288. };
  7289. p.extendObject(R, f.prototype),
  7290. t.exports = R
  7291. }
  7292. , {
  7293. "../../enum/HelpModalType": 28,
  7294. "../../enum/Viewmode": 51,
  7295. "../../settings": 166,
  7296. "../../util/common": 185,
  7297. "../helpManager": 68,
  7298. "./../populateModal": 75,
  7299. "./HelpEvent": 66,
  7300. events: 202
  7301. }],
  7302. 68: [function(e, t, i) {
  7303. (function(i) {
  7304. "use strict";
  7305. var n = e("../util/browser")
  7306. , r = e("./../util/logger")
  7307. , o = e("./../settings")
  7308. , a = new r(i)
  7309. , s = function() {
  7310. var e;
  7311. try {
  7312. return e = window.localStorage.getItem("visitCount") || "0",
  7313. e = (parseFloat(e) + 1).toString(),
  7314. window.localStorage.setItem("visitCount", e),
  7315. a.debug("visitCount = " + e),
  7316. e
  7317. } catch (t) {
  7318. e = "1",
  7319. a.debug("couldn't set local storage")
  7320. }
  7321. }()
  7322. , l = !1;
  7323. t.exports = {
  7324. isHelpDisabled: function() {
  7325. return "0" === n.valueFromHash("help", null) || l
  7326. },
  7327. isLargeHelpEnabled: function() {
  7328. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7329. },
  7330. isSmallHelpEnabled: function() {
  7331. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7332. },
  7333. isHelpEnabled: function() {
  7334. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7335. },
  7336. setAutoPlay: function(e) {
  7337. l = o.warp.auto >= 0 && e > 1
  7338. }
  7339. }
  7340. }
  7341. ).call(this, "/js/gui/helpManager.js")
  7342. }
  7343. , {
  7344. "../util/browser": 182,
  7345. "./../settings": 166,
  7346. "./../util/logger": 189
  7347. }],
  7348. 69: [function(e, t, i) {
  7349. "use strict";
  7350. function n(e, t, i, n) {
  7351. F = n,
  7352. r(e, t, i, F),
  7353. o(),
  7354. N = t.mode
  7355. }
  7356. function r(e, t, i, n) {
  7357. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7358. e.controls[t].on(v.Move, a),
  7359. e.controls[t].on(v.LongTap, c)
  7360. }),
  7361. M.on("mousewheel DOMMouseScroll", a),
  7362. i.on(m.TagActivated, a),
  7363. i.on(m.TagNavigation, a),
  7364. t.on(A.FlyingEnded, s),
  7365. t.on(A.ModeChanging, function(e, t) {
  7366. B = t !== C.PANORAMA && e !== C.PANORAMA
  7367. }),
  7368. t.on(A.ModeChanged, function(e, i) {
  7369. N = t.mode,
  7370. i !== C.TRANSITIONING ? l() : a("modeChange")
  7371. }),
  7372. n.on(y.TourStart, function() {
  7373. L = !0,
  7374. a()
  7375. }),
  7376. n.on(y.TourEnd, function() {
  7377. L = !1,
  7378. l()
  7379. }),
  7380. n.on(y.ActionInterrupted, function() {
  7381. L = !1
  7382. }),
  7383. R.addEventListener("touchend", function() {
  7384. $("#pullTab").hasClass("opened") && !L && l()
  7385. }, !0)
  7386. }
  7387. function o() {
  7388. p.isMobile() ? (b.forEach(function(e) {
  7389. e.classList.add("mobile")
  7390. }),
  7391. w.click(l)) : (b.forEach(function(e) {
  7392. e.addEventListener("mouseleave", function() {
  7393. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7394. }, !0)
  7395. }),
  7396. M.mouseleave(function() {
  7397. b[0].classList.contains("detectHover") && l()
  7398. }))
  7399. }
  7400. function a(e) {
  7401. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7402. P = !0,
  7403. g.close(),
  7404. h(e),
  7405. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) || S.addClass("fadeOut"),
  7406. _.hasClass("playing") || (b.forEach(function(e) {
  7407. e.classList.add("detectHover")
  7408. }),
  7409. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7410. }
  7411. function s() {
  7412. _.hasClass("playing") || (clearTimeout(O),
  7413. O = setTimeout(l, f.immersive.timeToShowAgain))
  7414. }
  7415. function l() {
  7416. clearTimeout(O),
  7417. P = !1,
  7418. I.forEach(function(e) {
  7419. e.classList.remove("fadeOut"),
  7420. e.classList.remove("drawerOpen")
  7421. }),
  7422. L || E.forEach(function(e) {
  7423. e.classList.remove("duringTour")
  7424. }),
  7425. b.forEach(function(e) {
  7426. e.classList.remove("detectHover")
  7427. })
  7428. }
  7429. function c() {
  7430. P ? l() : a(),
  7431. D = !0,
  7432. setTimeout(function() {
  7433. D = !1
  7434. }, f.immersive.uiStayDuration)
  7435. }
  7436. function h(e) {
  7437. !d(e) && L ? E.forEach(function(e) {
  7438. e.classList.remove("drawerOpen"),
  7439. e.classList.add("duringTour")
  7440. }) : _.hasClass("open") ? E.forEach(function(e) {
  7441. e.classList.remove("duringTour"),
  7442. e.classList.add("drawerOpen")
  7443. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7444. e.classList.add("fadeOut")
  7445. })
  7446. }
  7447. function u() {
  7448. T.hasClass("duringTour") || (L = !1,
  7449. a("gui"),
  7450. l())
  7451. }
  7452. function d(e) {
  7453. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7454. }
  7455. var p = e("../util/browser")
  7456. , f = e("../settings")
  7457. , g = e("./help/help")
  7458. , m = e("../enum/tagEvents")
  7459. , v = e("../enum/ControlEvents")
  7460. , A = e("../enum/PlayerEvents")
  7461. , y = e("../enum/DirectorEvents")
  7462. , A = e("../enum/PlayerEvents")
  7463. , C = e("../enum/Viewmode")
  7464. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7465. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7466. , b = $("#hover-bottom, #hover-top").toArray()
  7467. , w = ($("#pullTab").eq(0),
  7468. $("#playHead").eq(0),
  7469. $(".pinBottom-container").eq(0))
  7470. , _ = $("#drawer").eq(0)
  7471. , T = $("#drawer-container").eq(0)
  7472. , x = $("#meta-info").eq(0)
  7473. , S = $(".pinTop.left").eq(0)
  7474. , M = $("#player").eq(0)
  7475. , R = document.getElementById("pullTab")
  7476. , P = !1
  7477. , O = null
  7478. , L = !1
  7479. , D = !1
  7480. , N = null
  7481. , B = !1
  7482. , F = null;
  7483. t.exports.init = n,
  7484. t.exports.hideUi = a,
  7485. t.exports.resetDrawer = u
  7486. }
  7487. , {
  7488. "../enum/ControlEvents": 21,
  7489. "../enum/DirectorEvents": 23,
  7490. "../enum/tagEvents": 32,
  7491. "../enum/PlayerEvents": 40,
  7492. "../enum/Viewmode": 51,
  7493. "../settings": 166,
  7494. "../util/browser": 182,
  7495. "./help/help": 67
  7496. }],
  7497. 70: [function(e, t, i) {
  7498. (function(i) {
  7499. "use strict";
  7500. function n(e, t, i) {
  7501. l.debug("konami has the modelInstance");
  7502. var n = [];
  7503. $(window).on("keydown", function(e) {
  7504. n.push(e.which),
  7505. n.length > o.secretPanelWord.length && n.shift(),
  7506. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7507. o.debug = !0)
  7508. }),
  7509. $(window).on("keydown", function n(r) {
  7510. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7511. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7512. })
  7513. }
  7514. var r = e("./../util/logger")
  7515. , o = e("./../settings")
  7516. , a = e("./debug")
  7517. , s = e("./../util/common")
  7518. , l = (e("./gui"),
  7519. new r(i));
  7520. o.console && $("body").append('<div id="debug-console"></div>'),
  7521. t.exports.init = n
  7522. }
  7523. ).call(this, "/js/gui/konami.js")
  7524. }
  7525. , {
  7526. "./../settings": 166,
  7527. "./../util/common": 185,
  7528. "./../util/logger": 189,
  7529. "./debug": 63,
  7530. "./gui": 65
  7531. }],
  7532. 71: [function(e, t, i) {
  7533. "use strict";
  7534. function n(e, t) {
  7535. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7536. }
  7537. function r(e) {
  7538. var t = $.Deferred();
  7539. e || t.resolve();
  7540. var i = c.startupFlyinDelay;
  7541. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7542. setTimeout(t.resolve.bind(t), i),
  7543. t
  7544. }
  7545. function o(e, t, i) {
  7546. var n = 0;
  7547. c.quickstart.enabled && (a(i),
  7548. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7549. var r = function() {
  7550. e.once(g.Move, l),
  7551. t.once(f.TourStart, l)
  7552. };
  7553. s(n, r)
  7554. }
  7555. function a(e) {
  7556. return e && (y.addClass("quick-brand"),
  7557. v.before(y),
  7558. A = $(".quick-brand").toArray()),
  7559. m.addClass("fadeOut"),
  7560. setTimeout(function() {
  7561. A.forEach(function(e) {
  7562. e.classList.add("fadeIn")
  7563. })
  7564. }, c.quickstart.showTextDelay),
  7565. setTimeout(function() {
  7566. A.forEach(function(e) {
  7567. e.classList.add("fadeOut")
  7568. })
  7569. }, c.quickstart.fadeOutDelay),
  7570. !0
  7571. }
  7572. function s(e, t) {
  7573. setTimeout(function() {
  7574. if (h.isHelpEnabled()) {
  7575. if (t(),
  7576. u.init(),
  7577. C.addClass("fadeIn landing " + u.deviceType),
  7578. h.isSmallHelpEnabled())
  7579. return void C.addClass("small");
  7580. u.fill(I, d.LANDING[E]),
  7581. C.addClass(E)
  7582. }
  7583. }, e)
  7584. }
  7585. function l() {
  7586. u.clear(I, d.LANDING[E]),
  7587. C.removeClass("fadeIn")
  7588. }
  7589. var c = e("../settings")
  7590. , h = (e("./help/help"),
  7591. e("./helpManager"))
  7592. , u = e("./populateModal")
  7593. , d = e("../enum/HelpModalType")
  7594. , p = e("../enum/Viewmode")
  7595. , f = e("../enum/DirectorEvents")
  7596. , g = e("../enum/PlayerEvents")
  7597. , m = $("#quick-blackout").eq(0)
  7598. , v = $("#quick-logo").eq(0)
  7599. , A = $(".quick-brand").toArray()
  7600. , y = $("#loaderCoBrand").eq(0)
  7601. , C = $("#interaction-modal").eq(0)
  7602. , I = C.find(".interaction").toArray()
  7603. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7604. "");
  7605. t.exports.delayLanding = r,
  7606. t.exports.showMessage = o,
  7607. t.exports.init = n,
  7608. t.exports.dismissModal = l
  7609. }
  7610. , {
  7611. "../enum/DirectorEvents": 23,
  7612. "../enum/HelpModalType": 28,
  7613. "../enum/PlayerEvents": 40,
  7614. "../enum/Viewmode": 51,
  7615. "../settings": 166,
  7616. "./help/help": 67,
  7617. "./helpManager": 68,
  7618. "./populateModal": 75
  7619. }],
  7620. 72: [function(e, t, i) {
  7621. "use strict";
  7622. var n = e("./circleLoader").circleLoader;
  7623. t.exports = {
  7624. element: $("#gui-loading"),
  7625. hide: function(e) {
  7626. n.done(),
  7627. this.element.fadeOut(2500, e)
  7628. },
  7629. show: function(e) {
  7630. this.element.fadeIn(500, function() {
  7631. this.element.css("display", "table"),
  7632. e && e()
  7633. }
  7634. .bind(this))
  7635. },
  7636. progress: function(e) {
  7637. n.set(e)
  7638. }
  7639. }
  7640. }
  7641. , {
  7642. "./circleLoader": 60
  7643. }],
  7644. 73: [function(e, t, i) {
  7645. "use strict";
  7646. var n = e("../settings")
  7647. , r = $("#memory-info")
  7648. , o = r.find("#memory-gpu")
  7649. , a = !1;
  7650. t.exports = {
  7651. show: function() {
  7652. n.profiling.enabled && (r.show(),
  7653. a = !0)
  7654. },
  7655. hide: function() {
  7656. r.hide(),
  7657. a = !1
  7658. },
  7659. toggle: function() {
  7660. a ? this.hide() : this.show()
  7661. },
  7662. update: function(e) {
  7663. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7664. }
  7665. }
  7666. }
  7667. , {
  7668. "../settings": 166
  7669. }],
  7670. 74: [function(e, t, i) {
  7671. "use strict";
  7672. var n = e("../util/browser")
  7673. , r = e("../analytics");
  7674. e("../settings");
  7675. t.exports = {
  7676. show: function(e, t) {
  7677. $("#gui-message").fadeIn(250, function() {
  7678. $(this).css("display", "table");
  7679. var e = $("#gui-message").fracs().visible >= .5;
  7680. r.impression({
  7681. visible: e,
  7682. immediate: !0
  7683. })
  7684. }),
  7685. e && $("#quick-blackout").addClass("fadeOut"),
  7686. $("#button-play").on("click", function(i) {
  7687. return n.inIframe() && n.isMobile() ? n.valueFromHash("nt", !1) ? window.open(self.location.href, "_blank") : void (top.location.href = self.location.href) : e ? (i.stopPropagation(),
  7688. $("#quick-blackout").removeClass("fadeOut"),
  7689. $("#gui-message").hide(),
  7690. void t()) : void $("#gui-message").fadeOut(500, function() {
  7691. t()
  7692. })
  7693. })
  7694. }
  7695. }
  7696. }
  7697. , {
  7698. "../analytics": 4,
  7699. "../settings": 166,
  7700. "../util/browser": 182
  7701. }],
  7702. 75: [function(e, t, i) {
  7703. "use strict";
  7704. function n(e, t, i, n) {
  7705. function r(e) {
  7706. return e.classList.contains(a)
  7707. }
  7708. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7709. for (var a in o) {
  7710. var s = e.find(r);
  7711. for (var l in o[a]) {
  7712. var c = o[a][l];
  7713. if ("top-info" === l || "bottom-info" === l) {
  7714. var h = n ? c : "";
  7715. s.querySelector("." + l).textContent = h
  7716. } else {
  7717. var u = n ? c : ""
  7718. , d = s.querySelector("." + l);
  7719. d.src = u,
  7720. n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7721. }
  7722. }
  7723. }
  7724. var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7725. p.forEach(function(e) {
  7726. n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7727. })
  7728. }
  7729. var r = e("../util/browser")
  7730. , o = e("../localization/localize")
  7731. , a = e("../enum/HelpModalType")
  7732. , s = (e("../enum/HelpModalSize"),
  7733. e("../enum/Viewmode"));
  7734. t.exports = {
  7735. init: function() {
  7736. if (!this.hasInitialized) {
  7737. this.hasInitialized = !0,
  7738. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7739. this.assets = {},
  7740. this.assets[a.LANDING[s.PANORAMA]] = {
  7741. desktop: {
  7742. left: {
  7743. "top-info": o.ROTATE,
  7744. "big-image": "images/nav_help_mouse_drag_left.png",
  7745. keyboard: "images/nav_help_keyboard_left_right.png"
  7746. },
  7747. middle: {
  7748. "top-info": o.MOVE,
  7749. "big-image": "images/nav_help_mouse_click.png",
  7750. keyboard: "images/nav_help_keyboard_up_down.png"
  7751. },
  7752. right: {
  7753. "top-info": o.ZOOM,
  7754. "big-image": "images/nav_help_mouse_zoom.png",
  7755. keyboard: "images/nav_help_zoom_keys.png"
  7756. }
  7757. },
  7758. mobile: {
  7759. left: {
  7760. "top-info": o.ROTATE,
  7761. "big-image": "images/nav_help_gesture_drag.png"
  7762. },
  7763. middle: {
  7764. "top-info": o.MOVE,
  7765. "big-image": "images/nav_help_gesture_tap.png"
  7766. },
  7767. right: {
  7768. "top-info": o.ZOOM,
  7769. "big-image": "images/nav_help_gesture_pinch.png"
  7770. }
  7771. }
  7772. },
  7773. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7774. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7775. desktop: {
  7776. left: {
  7777. "top-info": o.ROTATE,
  7778. "big-image": "images/nav_help_mouse_drag_left.png",
  7779. keyboard: "images/nav_help_keyboard_left_right.png"
  7780. },
  7781. middle: {
  7782. "top-info": o.MOVE,
  7783. "big-image": "images/nav_help_mouse_position_right.png"
  7784. }
  7785. },
  7786. mobile: {
  7787. left: {
  7788. "top-info": o.ROTATE,
  7789. "big-image": "images/nav_help_gesture_drag.png"
  7790. },
  7791. middle: {
  7792. "top-info": o.MOVE,
  7793. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7794. }
  7795. }
  7796. },
  7797. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7798. desktop: {
  7799. left: {
  7800. "top-info": o.MOVE,
  7801. "big-image": "images/nav_help_mouse_position_left.png"
  7802. },
  7803. middle: {
  7804. "top-info": o.ROTATE,
  7805. "big-image": "images/nav_help_mouse_drag_right.png",
  7806. keyboard: "images/nav_help_keyboard_left_right.png"
  7807. }
  7808. },
  7809. mobile: {
  7810. left: {
  7811. "top-info": o.MOVE,
  7812. "big-image": "images/nav_help_gesture_position.png"
  7813. },
  7814. middle: {
  7815. "top-info": o.ROTATE,
  7816. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7817. }
  7818. }
  7819. };
  7820. var e = {
  7821. "top-info": o.INSIDE,
  7822. "big-image": "images/nav_help_click_inside.png",
  7823. keyboard: "images/nav_help_inside_key.png"
  7824. };
  7825. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7826. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7827. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7828. var t = {
  7829. "top-info": o.INSIDE,
  7830. "big-image": "images/nav_help_tap_inside.png"
  7831. };
  7832. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7833. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7834. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7835. this.assets[a.NAVIGATION] = {},
  7836. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7837. desktop: {
  7838. left: {
  7839. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7840. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7841. "big-image": "images/nav_help_mouse_drag_left.png",
  7842. keyboard: "images/nav_help_keyboard_left_right.png"
  7843. },
  7844. middle: {
  7845. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7846. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7847. "big-image": "images/nav_help_mouse_click.png",
  7848. keyboard: "images/nav_help_keyboard_up_down.png"
  7849. },
  7850. right: {
  7851. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7852. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7853. "big-image": "images/nav_help_mouse_zoom.png",
  7854. keyboard: "images/nav_help_zoom_keys.png"
  7855. }
  7856. },
  7857. mobile: {
  7858. left: {
  7859. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7860. "big-image": "images/nav_help_gesture_drag.png"
  7861. },
  7862. middle: {
  7863. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7864. "big-image": "images/nav_help_gesture_tap.png"
  7865. },
  7866. right: {
  7867. "top-info": o.HELP_MOBILE_3,
  7868. "big-image": "images/nav_help_gesture_pinch.png"
  7869. }
  7870. }
  7871. },
  7872. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7873. desktop: {
  7874. left: {
  7875. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7876. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7877. "big-image": "images/nav_help_mouse_drag_left.png",
  7878. keyboard: "images/nav_help_keyboard_all.png"
  7879. },
  7880. middle: {
  7881. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7882. "big-image": "images/nav_help_mouse_position_right.png"
  7883. },
  7884. right: {
  7885. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7886. "big-image": "images/nav_help_mouse_zoom.png"
  7887. }
  7888. },
  7889. mobile: {
  7890. left: {
  7891. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7892. "big-image": "images/nav_help_gesture_drag.png"
  7893. },
  7894. middle: {
  7895. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7896. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7897. },
  7898. right: {
  7899. "top-info": o.HELP_MOBILE_3,
  7900. "big-image": "images/nav_help_gesture_pinch.png"
  7901. }
  7902. }
  7903. },
  7904. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7905. desktop: {
  7906. left: {
  7907. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7908. "big-image": "images/nav_help_mouse_position_left.png"
  7909. },
  7910. middle: {
  7911. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7912. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7913. "big-image": "images/nav_help_mouse_drag_right.png",
  7914. keyboard: "images/nav_help_keyboard_left_right.png"
  7915. },
  7916. right: {
  7917. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7918. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7919. "big-image": "images/nav_help_mouse_zoom.png",
  7920. keyboard: "images/nav_help_keyboard_up_down.png"
  7921. }
  7922. },
  7923. mobile: {
  7924. left: {
  7925. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7926. "big-image": "images/nav_help_gesture_position.png"
  7927. },
  7928. middle: {
  7929. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7930. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7931. },
  7932. right: {
  7933. "top-info": o.HELP_MOBILE_3,
  7934. "big-image": "images/nav_help_gesture_pinch.png"
  7935. }
  7936. }
  7937. },
  7938. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7939. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7940. "top-info": o.HELP_DESKTOP_360_2A,
  7941. "bottom-info": o.HELP_DESKTOP_360_2B,
  7942. "big-image": "images/nav_help_click_inside.png",
  7943. keyboard: "images/nav_help_inside_key.png"
  7944. },
  7945. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7946. "top-info": o.HELP_MOBILE_360_2,
  7947. "big-image": "images/nav_help_tap_inside.png"
  7948. },
  7949. this.assets[a.MORE_HELP] = {
  7950. desktop: {
  7951. "more-help-hlr": {
  7952. "top-info": o.HELP_MORE_HLR_A,
  7953. "big-image": "images/nav_help_expand.svg",
  7954. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7955. },
  7956. "more-help-dollhouse": {
  7957. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7958. "big-image": "images/nav_help_dollhouse.svg",
  7959. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7960. },
  7961. "more-help-floors": {
  7962. "top-info": o.HELP_MORE_FLOORS_A,
  7963. "big-image": "images/nav_help_floor picker.svg",
  7964. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7965. },
  7966. "more-help-tag": {
  7967. "top-info": o.HELP_MORE_TAG_A,
  7968. "big-image": "images/nav_help_tag.svg",
  7969. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7970. },
  7971. "more-help-zoom": {
  7972. "top-info": o.HELP_MORE_ZOOM_A,
  7973. "big-image": "images/nav_help_zoom.svg",
  7974. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7975. },
  7976. "more-help-tour": {
  7977. "top-info": o.HELP_MORE_TOUR_A,
  7978. "big-image": "images/nav_help_play.png",
  7979. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7980. },
  7981. "more-help-inside": {
  7982. "top-info": o.HELP_MORE_INSIDE_A,
  7983. "big-image": "images/nav_help_inside.svg",
  7984. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7985. },
  7986. "more-help-vr": {
  7987. "top-info": o.HELP_MORE_VR_A,
  7988. "big-image": "images/nav_help_vr.svg",
  7989. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7990. },
  7991. "more-help-360": {
  7992. "top-info": o.HELP_MORE_360_A,
  7993. "big-image": "images/nav_help_360.svg",
  7994. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7995. },
  7996. "more-help-fullscreen": {
  7997. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7998. "big-image": "images/nav_help_fullscreen.svg",
  7999. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8000. }
  8001. },
  8002. mobile: {
  8003. "more-help-hlr": {
  8004. "top-info": o.HELP_MORE_HLR_A,
  8005. "big-image": "images/nav_help_expand.svg",
  8006. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8007. },
  8008. "more-help-dollhouse": {
  8009. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8010. "big-image": "images/nav_help_dollhouse.svg",
  8011. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8012. },
  8013. "more-help-floors": {
  8014. "top-info": o.HELP_MORE_FLOORS_A,
  8015. "big-image": "images/nav_help_floor picker.svg",
  8016. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8017. },
  8018. "more-help-tag": {
  8019. "top-info": o.HELP_MORE_TAG_A,
  8020. "big-image": "images/nav_help_tag.svg",
  8021. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8022. },
  8023. "more-help-tour": {
  8024. "top-info": o.HELP_MORE_TOUR_A,
  8025. "big-image": "images/nav_help_play.png",
  8026. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8027. },
  8028. "more-help-inside": {
  8029. "top-info": o.HELP_MORE_INSIDE_A,
  8030. "big-image": "images/nav_help_inside.svg",
  8031. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8032. },
  8033. "more-help-vr": {
  8034. "top-info": o.HELP_MORE_VR_A,
  8035. "big-image": "images/webvr.svg",
  8036. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8037. },
  8038. "more-help-360": {
  8039. "top-info": o.HELP_MORE_360_A,
  8040. "big-image": "images/nav_help_360.svg",
  8041. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8042. }
  8043. }
  8044. },
  8045. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8046. desktop: {
  8047. left: {
  8048. "top-info": o.ROTATE,
  8049. "big-image": "images/nav_help_mouse_drag_left.png",
  8050. keyboard: "images/nav_help_keyboard_left_right.png"
  8051. },
  8052. middle: {
  8053. "top-info": o.MOVE,
  8054. "big-image": "images/nav_help_mouse_click.png",
  8055. keyboard: "images/nav_help_keyboard_up_down.png"
  8056. },
  8057. right: {
  8058. "top-info": o.PLAY,
  8059. "big-image": "images/Desktop-help-play-button.svg",
  8060. keyboard: "images/Desktop-help-spacebar-2.svg"
  8061. }
  8062. },
  8063. mobile: {
  8064. left: {
  8065. "top-info": o.ROTATE,
  8066. "big-image": "images/nav_help_gesture_drag.png"
  8067. },
  8068. middle: {
  8069. "top-info": o.MOVE,
  8070. "big-image": "images/nav_help_gesture_tap.png"
  8071. },
  8072. right: {
  8073. "top-info": o.PLAY,
  8074. "big-image": "images/mobile-help-play-button.svg"
  8075. }
  8076. }
  8077. },
  8078. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8079. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8080. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8081. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8082. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8083. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8084. }
  8085. },
  8086. fill: function(e, t, i) {
  8087. n.call(this, e, t, i, !0)
  8088. },
  8089. clear: function(e, t, i) {
  8090. n.call(this, e, t, i, !1)
  8091. }
  8092. }
  8093. }
  8094. , {
  8095. "../enum/HelpModalSize": 27,
  8096. "../enum/HelpModalType": 28,
  8097. "../enum/Viewmode": 51,
  8098. "../localization/localize": 108,
  8099. "../util/browser": 182
  8100. }],
  8101. 76: [function(e, t, i) {
  8102. "use strict";
  8103. t.exports = Object.freeze({
  8104. OPENED: "share.open",
  8105. CLOSED: "share.closed",
  8106. LINK_CLICKED: "share.linked"
  8107. })
  8108. }
  8109. , {}],
  8110. 77: [function(e, t, i) {
  8111. "use strict";
  8112. function n(e) {
  8113. function t(t, i) {
  8114. var n = window.screenY + ($("#player").height() - i) / 2
  8115. , r = window.screenX + ($("#player").width() - t) / 2
  8116. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8117. I.emit(l.LINK_CLICKED, {
  8118. channel: e
  8119. }),
  8120. window.open(C[e], "shareWindow", o)
  8121. }
  8122. switch (e) {
  8123. case y.FACEBOOK:
  8124. t(580, 420);
  8125. break;
  8126. case y.TWITTER:
  8127. t(550, 440);
  8128. break;
  8129. case y.MAIL:
  8130. I.emit(l.LINK_CLICKED, {
  8131. channel: "email"
  8132. }),
  8133. window.open(C[e], "_blank");
  8134. break;
  8135. case y.LINKEDIN:
  8136. }
  8137. }
  8138. function r(e) {
  8139. I.emit(l.LINK_CLICKED, {
  8140. channel: "copylink"
  8141. });
  8142. var t = document.createRange();
  8143. t.selectNodeContents(v);
  8144. var i = window.getSelection();
  8145. i.removeAllRanges(),
  8146. i.addRange(t),
  8147. document.execCommand("copy"),
  8148. A.classList.remove("hidden"),
  8149. v.classList.add("highlighted")
  8150. }
  8151. function o(e) {
  8152. e && (e.stopPropagation(),
  8153. e.target === v) || (window.getSelection().removeAllRanges(),
  8154. v.classList.remove("highlighted"),
  8155. A.classList.add("hidden"))
  8156. }
  8157. var a = e("../../util/browser")
  8158. , s = e("../../localization/localize")
  8159. , l = e("./ShareEvents")
  8160. , c = e("../../util/common")
  8161. , h = e("events").EventEmitter
  8162. , u = document.getElementById("sharing")
  8163. , d = document.getElementById("share-modal")
  8164. , p = document.getElementById("share-close")
  8165. , f = document.getElementById("facebook-share")
  8166. , g = document.getElementById("twitter-share")
  8167. , m = document.getElementById("mail-share")
  8168. , v = document.getElementById("share-url-text")
  8169. , A = document.getElementById("copy-success")
  8170. , y = Object.freeze({
  8171. FACEBOOK: "facebook",
  8172. TWITTER: "twitter",
  8173. MAIL: "mail",
  8174. LINKEDIN: "linkedin"
  8175. })
  8176. , C = {};
  8177. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8178. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8179. C[y.MAIL] = "mailto:?subject=";
  8180. var I = {
  8181. init: function(e) {
  8182. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8183. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8184. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8185. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8186. u.addEventListener("click", this.toggle.bind(this)),
  8187. p.addEventListener("click", this.hide.bind(this)),
  8188. v.addEventListener("click", r),
  8189. d.addEventListener("click", o),
  8190. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8191. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8192. m.addEventListener("click", n.bind(this, y.MAIL)),
  8193. v.textContent = window.location.href + "&utm_source=4",
  8194. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8195. u.classList.remove("hidden")
  8196. },
  8197. show: function() {
  8198. this.emit(l.OPENED),
  8199. d.classList.add("fadeIn")
  8200. },
  8201. hide: function() {
  8202. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8203. document.selection && document.selection.empty(),
  8204. window.getSelection().removeAllRanges(),
  8205. o(),
  8206. d.classList.remove("fadeIn"))
  8207. },
  8208. toggle: function() {
  8209. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8210. }
  8211. };
  8212. c.extendObject(I, h.prototype),
  8213. t.exports = I
  8214. }
  8215. , {
  8216. "../../localization/localize": 108,
  8217. "../../util/browser": 182,
  8218. "../../util/common": 185,
  8219. "./ShareEvents": 76,
  8220. events: 202
  8221. }],
  8222. 78: [function(e, t, i) {
  8223. "use strict";
  8224. t.exports = Object.freeze({
  8225. OPENED: "terms.opened",
  8226. CLOSED: "terms.closed"
  8227. })
  8228. }
  8229. , {}],
  8230. 79: [function(e, t, i) {
  8231. "use strict";
  8232. var n = e("./TermsEvent")
  8233. , r = e("../../localization/localize")
  8234. , o = e("../../analytics")
  8235. , a = e("../../util/ajax")
  8236. , s = e("../../util/common")
  8237. , l = e("events").EventEmitter
  8238. , c = document.getElementById("terms-modal")
  8239. , h = {
  8240. init: function() {
  8241. $(".footer-terms").on("click", function(e) {
  8242. e.preventDefault(),
  8243. this.show()
  8244. }
  8245. .bind(this)),
  8246. $("#terms-modal .close").on("click", this.hide.bind(this))
  8247. },
  8248. show: function() {
  8249. this.emit(n.OPENED),
  8250. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8251. var t = $("#terms-text").html(e);
  8252. o.track("showcase_gui", {
  8253. gui_action: "click_terms_button",
  8254. interaction_source: "gui"
  8255. }),
  8256. t.find("a").attr("target", "_blank")
  8257. }).fail(function() {
  8258. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8259. }),
  8260. c.classList.add("fadeIn")
  8261. },
  8262. hide: function(e) {
  8263. e && e.preventDefault(),
  8264. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8265. c.classList.remove("fadeIn")
  8266. }
  8267. };
  8268. s.extendObject(h, l.prototype),
  8269. t.exports = h
  8270. }
  8271. , {
  8272. "../../analytics": 4,
  8273. "../../localization/localize": 108,
  8274. "../../util/ajax": 181,
  8275. "../../util/common": 185,
  8276. "./TermsEvent": 78,
  8277. events: 202
  8278. }],
  8279. 80: [function(e, t, i) {
  8280. "use strict";
  8281. t.exports = Object.freeze({
  8282. OPEN_INFO: "title.open.info",
  8283. CLOSE_INFO: "title.close.info",
  8284. SHOW_INFO: "title.show.info",
  8285. HIDE_INFO: "title.hide.info",
  8286. LINK_CLICKED: "title.link.click",
  8287. CONTACT_LINK_CLICKED: "title.contact.click",
  8288. ORIGIN_LINK_CLICKED: "title.origin.click"
  8289. })
  8290. }
  8291. , {}],
  8292. 81: [function(e, t, i) {
  8293. "use strict";
  8294. function n(e, t) {
  8295. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8296. }
  8297. function r(e, t) {
  8298. function i(i) {
  8299. e.shouldShowtags = "show" === this.value,
  8300. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8301. }
  8302. document.getElementById("tag-toggles").classList.remove("hidden"),
  8303. document.getElementById("radio-tag-show").checked = !0;
  8304. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8305. n[r].addEventListener("change", i)
  8306. }
  8307. var o = e("../../settings");
  8308. t.exports.init = n
  8309. }
  8310. , {
  8311. "../../settings": 166
  8312. }],
  8313. 82: [function(e, t, i) {
  8314. (function(i) {
  8315. "use strict";
  8316. function n(e, t) {
  8317. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8318. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8319. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8320. document.getElementById("gui-name").classList.add("noCoBrand"),
  8321. document.getElementById("cobrandTitle").classList.add("hidden")),
  8322. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8323. !1)
  8324. }
  8325. function r(e) {
  8326. return e ? (L = !0,
  8327. void (_.innerText = e)) : void _.classList.add("hidden")
  8328. }
  8329. function o(e, t, i, n) {
  8330. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8331. return void T.classList.add("hidden");
  8332. L = !0;
  8333. var r = []
  8334. , o = c(r, "<br>");
  8335. if (e && o('<span id="contactName">' + e + "</span>"),
  8336. t) {
  8337. var a = n || t
  8338. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8339. o(s)
  8340. }
  8341. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8342. r[0] = "",
  8343. x.innerHTML = r.join("")
  8344. }
  8345. function a(e) {
  8346. if ("string" == typeof e)
  8347. try {
  8348. e = JSON.parse(e)
  8349. } catch (e) {
  8350. return y.warn("Unable to parse address data"),
  8351. void S.parentElement.classList.add("hidden")
  8352. }
  8353. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8354. return void S.parentElement.classList.add("hidden");
  8355. L = !0;
  8356. var t = []
  8357. , i = c(t, " ");
  8358. e.address_1 && i(e.address_1),
  8359. e.address_2 && i(e.address_2),
  8360. e.city && i(e.city, ", "),
  8361. e.state && i(e.state, ", "),
  8362. e.zip && i(e.zip, e.state ? " " : ", "),
  8363. t[0] = "",
  8364. S.innerText = t.join("")
  8365. }
  8366. function s(e) {
  8367. var t = document.createElement("a");
  8368. return t.id = "url",
  8369. t.target = "_blank",
  8370. t.href = e,
  8371. t.innerText = e,
  8372. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8373. t
  8374. }
  8375. function l(e) {
  8376. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8377. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8378. P.appendChild(s(e)),
  8379. O.forEach(function(e) {
  8380. e.classList.add("share-link")
  8381. }),
  8382. !0)
  8383. }
  8384. function c(e, t) {
  8385. var i = e
  8386. , n = t;
  8387. return function(e, t) {
  8388. i.push(t || n, e)
  8389. }
  8390. }
  8391. function h() {
  8392. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8393. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8394. var e = [].slice.call(_.querySelectorAll("a"));
  8395. e.forEach(function(e) {
  8396. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8397. });
  8398. var t = [].slice.call(T.querySelectorAll("a"));
  8399. t.forEach(function(e) {
  8400. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8401. contact_type: e.getAttribute("id")
  8402. }))
  8403. })
  8404. }
  8405. var u = e("../../util/browser")
  8406. , d = e("../../util/common")
  8407. , p = e("../../util/logger")
  8408. , f = e("../../localization/localize")
  8409. , g = e("./titleBarSettings")
  8410. , m = e("../../settings")
  8411. , v = e("./TitleEvents")
  8412. , A = e("events").EventEmitter
  8413. , y = new p(i)
  8414. , C = document.querySelector(".pinTop.left")
  8415. , I = document.getElementsByClassName("title-container")[0]
  8416. , E = document.getElementById("title-toggle").querySelector("i")
  8417. , b = document.getElementById("meta-info-wrapper")
  8418. , w = document.getElementById("meta-info")
  8419. , _ = document.getElementById("meta-description")
  8420. , T = document.getElementsByClassName("contact-info")[0]
  8421. , x = document.getElementById("contact-data")
  8422. , S = document.getElementById("addressTxt")
  8423. , M = document.getElementById("tag-toggles")
  8424. , R = document.getElementById("share-origin")
  8425. , P = document.getElementById("share-link-wrapper")
  8426. , O = [w, b, I]
  8427. , L = !1
  8428. , D = !1
  8429. , N = {
  8430. populate: function(e) {
  8431. if (n(e.name, e.coBrand)) {
  8432. if (r(e.description),
  8433. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8434. a(e.address),
  8435. L) {
  8436. var t = document.createElement("br");
  8437. M.insertBefore(t, M.firstElementChild)
  8438. }
  8439. e.socialSharing && m.share.enabled && (D = l(e.url))
  8440. }
  8441. },
  8442. finishSetup: function(e) {
  8443. L = L || !!e,
  8444. h(),
  8445. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8446. },
  8447. toggleMeta: function(e, t) {
  8448. t && t.preventDefault();
  8449. var i = w.classList.contains("expand");
  8450. e && !i || (i ? (O.forEach(function(e) {
  8451. e.classList.remove("expand")
  8452. }),
  8453. this.emit(v.CLOSE_INFO)) : (O.forEach(function(e) {
  8454. e.classList.add("expand")
  8455. }),
  8456. this.emit(v.OPEN_INFO)))
  8457. },
  8458. setupToggling: function() {
  8459. b.style.height = w.offsetHeight + "px",
  8460. w.addEventListener("transitionend", function() {
  8461. b.style.height = w.offsetHeight + "px"
  8462. })
  8463. },
  8464. toggleTitle: function(e) {
  8465. e && e.preventDefault(),
  8466. C.classList.contains("closed") ? (C.classList.add("open"),
  8467. E.classList.remove("icon-dpad-right"),
  8468. E.classList.add("icon-dpad-left"),
  8469. this.emit(v.SHOW_INFO),
  8470. setTimeout(function() {
  8471. C.classList.remove("closed"),
  8472. C.classList.remove("open")
  8473. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8474. E.classList.remove("icon-dpad-left"),
  8475. E.classList.add("icon-dpad-right"),
  8476. this.emit(v.HIDE_INFO))
  8477. }
  8478. };
  8479. d.extendObject(N, A.prototype),
  8480. t.exports = N
  8481. }
  8482. ).call(this, "/js/gui/title/titleBar.js")
  8483. }
  8484. , {
  8485. "../../localization/localize": 108,
  8486. "../../settings": 166,
  8487. "../../util/browser": 182,
  8488. "../../util/common": 185,
  8489. "../../util/logger": 189,
  8490. "./TitleEvents": 80,
  8491. "./titleBarSettings": 83,
  8492. events: 202
  8493. }],
  8494. 83: [function(e, t, i) {
  8495. "use strict";
  8496. t.exports = Object.freeze({
  8497. minTooltipCharacters: 19,
  8498. removeAnimationClasses: 500
  8499. })
  8500. }
  8501. , {}],
  8502. 84: [function(e, t, i) {
  8503. "use strict";
  8504. function n(e) {
  8505. C = e,
  8506. P.forEach(function(e) {
  8507. b.addEventListener(e, u.bind(this, !1), !0),
  8508. w.addEventListener(e, u.bind(this, !0), !0),
  8509. E.addEventListener(e, o, !0),
  8510. S.forEach(function(t) {
  8511. t.addEventListener(e, a, !0)
  8512. }),
  8513. $("#drawer img").on(e, a)
  8514. }),
  8515. document.addEventListener("keydown", u.bind(this, !1), !0),
  8516. C.on(v.TourStart, function() {
  8517. E.classList.add("playing")
  8518. })
  8519. }
  8520. function r() {
  8521. C.playTour(),
  8522. I && clearTimeout(I),
  8523. d(),
  8524. _.removeClass("fadeIn")
  8525. }
  8526. function o() {
  8527. E.classList.contains("playing") && (C.stopTour(),
  8528. _.addClass("fadeIn"),
  8529. setTimeout(function() {
  8530. _.removeClass("fadeIn")
  8531. }, p.tourInteraction.showPauseButton),
  8532. O || (clearTimeout(I),
  8533. I = setTimeout(h, p.tourInteraction.showModal)),
  8534. setTimeout(function() {
  8535. E.classList.remove("playing")
  8536. }, p.tourInteraction.allowNextClick))
  8537. }
  8538. function a() {
  8539. C.tourInProgress && (C.stopTour(),
  8540. C.endTourProgress(),
  8541. E.classList.remove("playing"))
  8542. }
  8543. function s() {
  8544. T.is(":visible") ? r() : o()
  8545. }
  8546. function l() {
  8547. x.hasClass("playing") && (clearTimeout(I),
  8548. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8549. }
  8550. function c() {
  8551. E.classList.remove("playing"),
  8552. h()
  8553. }
  8554. function h() {
  8555. if (!p.tourInteraction.disabled) {
  8556. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8557. M.addClass("fadeIn tour " + m.deviceType);
  8558. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8559. if (!p.tourInteraction.smallModal) {
  8560. var t;
  8561. t = C.player.mode === g.PANORAMA && !C.player.currentPano.isAligned() || C.player.mode === g.DOLLHOUSE ? g.OUTDOOR : C.player.mode === g.FLOORPLAN ? g.FLOORPLAN : g.PANORAMA,
  8562. m.fill(R, A.TOUR_INTERACTION[t]),
  8563. M.addClass(t)
  8564. }
  8565. M.addClass(e)
  8566. }
  8567. }
  8568. function u(e, t) {
  8569. if (t) {
  8570. var i = "keydown" === t.type
  8571. , n = t.which === f.SPACE || C.tourIsPlaying;
  8572. i && n || e || (O = !0),
  8573. C.atEndOfTour() && d(),
  8574. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8575. d(),
  8576. t.which !== f.SPACE && a()),
  8577. i && n && s()
  8578. }
  8579. }
  8580. function d() {
  8581. M.removeClass("fadeIn")
  8582. }
  8583. var p = (e("../util/browser"),
  8584. e("../settings"))
  8585. , f = e("../enum/Keys")
  8586. , g = e("../enum/Viewmode")
  8587. , m = (e("./helpManager"),
  8588. e("./populateModal"))
  8589. , v = e("../enum/DirectorEvents")
  8590. , A = e("../enum/HelpModalType")
  8591. , y = e("../enum/HelpModalSize")
  8592. , C = null
  8593. , I = null
  8594. , E = document.getElementById("pause-overlay")
  8595. , b = document.getElementById("player")
  8596. , w = document.getElementById("gui")
  8597. , _ = $("#pause-icon").eq(0)
  8598. , T = $("#play").eq(0)
  8599. , x = $("#playHead").eq(0)
  8600. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8601. , M = $("#interaction-modal").eq(0)
  8602. , R = $("#interaction-modal .interaction").toArray()
  8603. , P = ["touchstart", "mousedown", "pointerdown"]
  8604. , O = !1;
  8605. t.exports.init = n,
  8606. t.exports.play = r,
  8607. t.exports.pause = o,
  8608. t.exports.pauseWithoutCTA = a,
  8609. t.exports.togglePlay = s,
  8610. t.exports.stopTour = l,
  8611. t.exports.dismissModal = d
  8612. }
  8613. , {
  8614. "../enum/DirectorEvents": 23,
  8615. "../enum/HelpModalSize": 27,
  8616. "../enum/HelpModalType": 28,
  8617. "../enum/Keys": 30,
  8618. "../enum/Viewmode": 51,
  8619. "../settings": 166,
  8620. "../util/browser": 182,
  8621. "./helpManager": 68,
  8622. "./populateModal": 75
  8623. }],
  8624. 85: [function(e, t, i) {
  8625. "use strict";
  8626. t.exports = Object.freeze({
  8627. OPENED: "vr.modal.opened",
  8628. LAUNCH: "vr.modal.launch",
  8629. CLOSED: "vr.modal.closed",
  8630. NEXT: "vr.modal.next",
  8631. PREV: "vr.modal.prev",
  8632. STORE: "vr.modal.store",
  8633. falseICECHOSEN: "vr.modal.device"
  8634. })
  8635. }
  8636. , {}],
  8637. 86: [function(e, t, i) {
  8638. "use strict";
  8639. function n(e, t, i) {
  8640. function n(e, t, n, r) {
  8641. function o() {
  8642. return p + "&m=" + t + "&display=" + e
  8643. }
  8644. function s() {
  8645. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8646. , t = "&utm_source=" + u
  8647. , n = "&utm_showcase_session_id=" + i;
  8648. return e + t + n
  8649. }
  8650. function l() {
  8651. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8652. }
  8653. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8654. }
  8655. function r(e, t, i, r) {
  8656. var o = "https://api.branch.io/v1/url"
  8657. , a = n(e, t, i, r)
  8658. , s = {
  8659. responseType: "json",
  8660. data: {
  8661. branch_key: h.appConfig.branch_key,
  8662. data: {
  8663. m: t,
  8664. full_url: a,
  8665. $desktop_url: m,
  8666. $og_app_id: "331853976762864119",
  8667. $og_title: i,
  8668. $og_description: r,
  8669. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8670. $canonical_url: window.location.href
  8671. }
  8672. }
  8673. };
  8674. c.post(o, s).done(function(t) {
  8675. f[e] = t.url
  8676. }).fail(function(t) {
  8677. f[e] = t
  8678. }
  8679. .bind(this, a))
  8680. }
  8681. function o(e, t, i) {
  8682. for (var r in s) {
  8683. var o = s[r]
  8684. , a = n(o, e, t, i);
  8685. f[o] = a
  8686. }
  8687. }
  8688. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8689. , d = g + "/vr/dlist/?ret=" + u
  8690. , p = g + "/vr/show/?ret=" + u
  8691. , m = "https://support.port.com/hc/en-us/articles/224728887-What-do-I-need-for-Virtual-Reality";
  8692. switch (e) {
  8693. case l.IOS:
  8694. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8695. break;
  8696. default:
  8697. o(t.sid, t.name, t.summary)
  8698. }
  8699. }
  8700. function r(e) {
  8701. var t = f[e];
  8702. window.open(t, "_blank")
  8703. }
  8704. function o(e) {
  8705. var t = u[e];
  8706. window.open(t, "_blank")
  8707. }
  8708. var a = e("../../util/browser")
  8709. , s = e("../../enum/VRApps")
  8710. , l = e("../../enum/VRPlatforms")
  8711. , c = e("../../util/ajax")
  8712. , h = e("../../settings")
  8713. , u = {};
  8714. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8715. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8716. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8717. for (var d in s) {
  8718. var p = s[d];
  8719. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8720. }
  8721. var f = {}
  8722. , g = function() {
  8723. var e = window.location.host;
  8724. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8725. "https://" + e
  8726. }();
  8727. t.exports.init = n,
  8728. t.exports.launch = r,
  8729. t.exports.launchStore = o
  8730. }
  8731. , {
  8732. "../../enum/VRApps": 46,
  8733. "../../enum/VRPlatforms": 49,
  8734. "../../settings": 166,
  8735. "../../util/ajax": 181,
  8736. "../../util/browser": 182
  8737. }],
  8738. 87: [function(e, t, i) {
  8739. "use strict";
  8740. function n(e) {
  8741. var t;
  8742. switch (e) {
  8743. case m.IOS:
  8744. return t = p.iosVersion(),
  8745. t.major > 9 || 9 === t.major && t.minor >= 1;
  8746. case m.Android:
  8747. return t = p.androidVersion(),
  8748. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8749. }
  8750. return !1
  8751. }
  8752. function r(e, t) {
  8753. function i(e) {
  8754. K.emit(A.STORE, {
  8755. type: e
  8756. }),
  8757. f.launchStore(e)
  8758. }
  8759. function r(e) {
  8760. switch (e !== _.pageCount && (a(e),
  8761. N.text(e + 1 + " / " + _.pageCount)),
  8762. e) {
  8763. case _.Title:
  8764. O.css("display", "none"),
  8765. L.text(u[e]),
  8766. o(s);
  8767. break;
  8768. case _.Cardboard:
  8769. O.css("display", "block"),
  8770. L.text(u[e]),
  8771. M.filter(".cardboard").off(),
  8772. M.filter(".gearvr").off(),
  8773. c(e, s),
  8774. h(H, X, Z);
  8775. break;
  8776. case _.Gear:
  8777. L.text(u[e]),
  8778. c(e, s),
  8779. T.addClass("lastPage"),
  8780. h(G, X, Z);
  8781. break;
  8782. case _.pageCount:
  8783. T.removeClass("fadeIn"),
  8784. K.emit(A.CLOSED)
  8785. }
  8786. B.filter("[src='']").hide()
  8787. }
  8788. var s = function() {
  8789. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  8790. w = ".show-supported",
  8791. m.Android) : (T.addClass("unsupported"),
  8792. w = ".show-unsupported",
  8793. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  8794. w = ".show-ios",
  8795. _ = v.ios,
  8796. m.IOS) : (T.addClass("desktop"),
  8797. w = ".show-desktop",
  8798. m.Desktop)
  8799. }();
  8800. f.init(s, e, t),
  8801. s !== m.Desktop && T.addClass("mobile");
  8802. var l = function(e) {
  8803. K.emit(A.LAUNCH, {
  8804. vr_platform: s,
  8805. vr_app: e
  8806. }),
  8807. f.launch(e)
  8808. };
  8809. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  8810. q.gear = l.bind(this, g.GearVR),
  8811. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  8812. d(),
  8813. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8814. $(w).show();
  8815. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  8816. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8817. s === m.IOS && (u.splice(1, 1),
  8818. y.splice(1, 1)),
  8819. $("#vr").on("click", function(e) {
  8820. e.preventDefault(),
  8821. T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  8822. r(b),
  8823. T.addClass("fadeIn"),
  8824. K.emit(A.OPENED))
  8825. });
  8826. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  8827. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  8828. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  8829. $("span.modelLink").text(I),
  8830. O.on("click", function(e) {
  8831. K.emit(A.PREV),
  8832. b--,
  8833. r(b)
  8834. }),
  8835. L.on("click", function(e) {
  8836. L.text();
  8837. K.emit(A.NEXT, {
  8838. nextAction: y[b]
  8839. }),
  8840. b++,
  8841. r(b)
  8842. }),
  8843. T.find(".close").on("click", K.dismiss)
  8844. }
  8845. function o(e) {
  8846. switch (e) {
  8847. case m.Android:
  8848. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8849. M.filter(".gearvr").off().on("click", q.gear),
  8850. s(H, G, "logo-button", "same-line");
  8851. break;
  8852. case m.UnsupportedAndroid:
  8853. s("", z, "", "");
  8854. break;
  8855. case m.IOS:
  8856. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  8857. s(H, "", "logo-button", "");
  8858. break;
  8859. case m.Desktop:
  8860. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  8861. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  8862. s(H, G, "logo-button", "same-line"),
  8863. Q.cardboard()
  8864. }
  8865. }
  8866. function a(e) {
  8867. $(".p1, .p2, .p3").hide(),
  8868. x.insertAfter(S),
  8869. T.removeClass("front-page"),
  8870. T.removeClass("details-page"),
  8871. T.removeClass("lastPage"),
  8872. M.removeClass("logo-button"),
  8873. M.removeClass("same-line"),
  8874. S.removeClass("headsetOptions"),
  8875. R.attr("src", ""),
  8876. R.filter(".second").removeClass("gear"),
  8877. R.css("display", "inline-block"),
  8878. R.off(),
  8879. P.filter(".second").css("display", ""),
  8880. D.css("display", "none"),
  8881. $(".p" + (e + 1) + w).show(),
  8882. R.filter(".third").insertBefore(P.filter(".third"))
  8883. }
  8884. function s(e, t, i, n) {
  8885. T.addClass("front-page"),
  8886. R.filter(".first").attr("src", e),
  8887. R.filter(".second").attr("src", t),
  8888. M.filter(".first").addClass(i),
  8889. M.filter(".second").addClass(i),
  8890. M.addClass(n),
  8891. ".show-desktop" === w && S.insertAfter(x)
  8892. }
  8893. function l(e, t, i) {
  8894. S.addClass("headsetOptions"),
  8895. M.off(),
  8896. R.filter(".second").attr("src", t),
  8897. D.css("display", "block"),
  8898. P.filter(".second").css("display", "none"),
  8899. D.on("click", function() {
  8900. a(_.Title),
  8901. o(m.Desktop)
  8902. }),
  8903. e && (K.emit(A.falseICECHOSEN, {
  8904. name: g.GearVR
  8905. }),
  8906. R.filter(".first").attr("src", e),
  8907. R.filter(".second").addClass("gear"),
  8908. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8909. Q.gearvr()),
  8910. i && (K.emit(A.falseICECHOSEN, {
  8911. name: g.Cardboard
  8912. }),
  8913. R.filter(".third").attr("src", i),
  8914. R.filter(".third").show(),
  8915. R.filter(".third").insertAfter(R.filter(".second")),
  8916. R.filter(".third").addClass("link"),
  8917. R.filter(".second").addClass("link"),
  8918. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8919. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  8920. Q.cardboard())
  8921. }
  8922. function c(e, t) {
  8923. switch (t) {
  8924. case m.IOS:
  8925. X = Y,
  8926. Z = j;
  8927. break;
  8928. case m.Desktop:
  8929. e === _.Cardboard ? (X = F,
  8930. Z = U,
  8931. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8932. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  8933. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8934. Z = "");
  8935. break;
  8936. default:
  8937. e === _.Cardboard ? (X = z,
  8938. Z = j) : (X = k,
  8939. Z = W)
  8940. }
  8941. }
  8942. function h(e, t, i) {
  8943. T.find(".inner").addClass("details-page"),
  8944. T.addClass("details-page"),
  8945. R.filter(".first").attr("src", e),
  8946. R.filter(".second").attr("src", t),
  8947. R.filter(".third").attr("src", i)
  8948. }
  8949. function u() {
  8950. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  8951. K.emit(A.CLOSED))
  8952. }
  8953. function d() {
  8954. var e = p.aspectRatio() > 1 && p.isMobile();
  8955. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  8956. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  8957. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  8958. }
  8959. var p = e("../../util/browser")
  8960. , f = e("./vrLink")
  8961. , g = e("../../enum/VRApps")
  8962. , m = e("../../enum/VRPlatforms")
  8963. , v = e("../../enum/VRPages")
  8964. , A = e("./vrEvent")
  8965. , y = (e("../../settings"),
  8966. e("../../constants"))
  8967. , C = e("../../localization/localize")
  8968. , I = e("../../util/common")
  8969. , E = e("events").EventEmitter
  8970. , b = 0
  8971. , w = null
  8972. , _ = v.standard
  8973. , T = $(".vr-popup")
  8974. , x = T.find(".vr-popup-body")
  8975. , S = T.find(".vr-images")
  8976. , M = T.find(".img-container")
  8977. , R = T.find(".vr-sm-image")
  8978. , P = M.find(".vr-img-caption")
  8979. , O = $(".vr-buttons").find(".prev-button")
  8980. , L = $(".vr-buttons").find(".next-button")
  8981. , D = S.find(".front-close")
  8982. , N = $(".vr-page")
  8983. , B = T.find("img")
  8984. , F = "images/apple-store.png"
  8985. , V = "images/badge-oculus.png"
  8986. , U = "images/badge-cardboard.png"
  8987. , k = "images/logo-samsung.png"
  8988. , H = "images/headset-cardboard.png"
  8989. , G = "images/headset-gearvr.png"
  8990. , z = "images/ico-android-robot.png"
  8991. , W = "images/ico-gearvr.png"
  8992. , j = "images/ico-vr.png"
  8993. , Y = "images/apple-logo-white.svg"
  8994. , X = null
  8995. , Z = null
  8996. , q = {}
  8997. , K = {
  8998. init: r,
  8999. dismiss: u,
  9000. isDeviceSupported: n
  9001. };
  9002. I.extendObject(K, E.prototype),
  9003. $(window).resize(d);
  9004. var Q = function() {
  9005. var e = P.filter(".first").find(".cardboard")
  9006. , t = P.filter(".first").find(".gearvr");
  9007. return {
  9008. cardboard: function() {
  9009. t.addClass("hidden"),
  9010. e.removeClass("hidden")
  9011. },
  9012. gearvr: function() {
  9013. e.addClass("hidden"),
  9014. t.removeClass("hidden")
  9015. }
  9016. }
  9017. }();
  9018. t.exports = K
  9019. }
  9020. , {
  9021. "../../constants": 8,
  9022. "../../enum/VRApps": 46,
  9023. "../../enum/VRPages": 48,
  9024. "../../enum/VRPlatforms": 49,
  9025. "../../localization/localize": 108,
  9026. "../../settings": 166,
  9027. "../../util/browser": 182,
  9028. "../../util/common": 185,
  9029. "./vrEvent": 85,
  9030. "./vrLink": 86,
  9031. events: 202
  9032. }],
  9033. 88: [function(e, t, i) {
  9034. "use strict";
  9035. t.exports = Object.freeze({
  9036. OPENED: "webvr.modal.opened",
  9037. SHOW_TERMS: "webvr.footer.show.terms"
  9038. })
  9039. }
  9040. , {}],
  9041. 89: [function(e, t, i) {
  9042. (function(i) {
  9043. "use strict";
  9044. function n(e, t, i, n) {
  9045. function r(e) {
  9046. e.preventDefault(),
  9047. a(e.currentTarget.id)
  9048. }
  9049. function a(e) {
  9050. ne[e](),
  9051. Object.keys(ne).map(function(t, i) {
  9052. $("#" + t).toggleClass("tabs-underlined", t === e)
  9053. })
  9054. }
  9055. y = i,
  9056. v = t,
  9057. w.init(E.Android, e, n),
  9058. m();
  9059. var l = new RegExp("daydream","i")
  9060. , c = l.test(y.displayName);
  9061. c ? (a("tabdaydream"),
  9062. B.filter(".device-headset-side").attr("src", H),
  9063. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9064. B.filter(".device-headset-side").attr("src", Y),
  9065. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9066. $("#vr").on("click", function(e) {
  9067. e.preventDefault(),
  9068. g("click_webvr_button"),
  9069. L.is(":hidden") && (ie.emit(_.OPENED),
  9070. o())
  9071. }),
  9072. $(".webvr-popup .close").on("click", function(e) {
  9073. e.preventDefault(),
  9074. D.hasClass("hidden") ? (g("webvr_help_close"),
  9075. p()) : s()
  9076. }),
  9077. $("#tabcardboard").on("click", r),
  9078. $("#tabdaydream").on("click", r),
  9079. $("#tabnative").on("click", r),
  9080. $(".webvr-popup .open-with-app").on("click", function(e) {
  9081. e.preventDefault(),
  9082. g("webvr_learn_more"),
  9083. a("tabnative"),
  9084. p()
  9085. }),
  9086. $(".webvr-popup .help").on("click", function(e) {
  9087. e.preventDefault(),
  9088. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9089. p()
  9090. }),
  9091. $(".webvr-popup .terms").on("click", function(e) {
  9092. e.preventDefault(),
  9093. g("webvr_click_terms"),
  9094. s(),
  9095. ie.emit(_.SHOW_TERMS)
  9096. }),
  9097. F.on("click", function(e) {
  9098. e.preventDefault(),
  9099. g(ee),
  9100. window.open(J, "_blank")
  9101. }),
  9102. V.on("click", function(e) {
  9103. e.preventDefault(),
  9104. g("webvr_phone_link"),
  9105. window.open(te, "_blank")
  9106. }),
  9107. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9108. e.preventDefault(),
  9109. g("webvr_cardboard_link"),
  9110. w.launch(b.CardboardAndroid)
  9111. }),
  9112. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9113. e.preventDefault(),
  9114. g("webvr_oculus_link"),
  9115. w.launch(b.GearVR)
  9116. })
  9117. }
  9118. function r() {
  9119. function e() {
  9120. y.isPresenting || (f(),
  9121. window.removeEventListener("vrdisplaypresentchange", e))
  9122. }
  9123. R.info("Headset mounted"),
  9124. v.suspend();
  9125. var t = document.createElement("canvas");
  9126. for (t.getContext("webgl"),
  9127. t.className = "webvr-canvas",
  9128. document.bgColor = "#000",
  9129. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9130. document.body.removeChild(document.body.firstChild);
  9131. document.body.appendChild(t),
  9132. g("webvr_enter_app"),
  9133. y.requestPresent([{
  9134. source: t,
  9135. predistorted: !0
  9136. }]).catch(function(t) {
  9137. R.error("Failed to present: " + t),
  9138. g("webvr_exit_calibrate"),
  9139. e()
  9140. }),
  9141. A.then(function() {
  9142. window.dispatchEvent(new Event("vrapp-start"))
  9143. }),
  9144. window.addEventListener("vrdisplaypresentchange", e)
  9145. }
  9146. function o() {
  9147. O.fadeOut(I.guiAnimationSpeed),
  9148. L.fadeIn(I.guiAnimationSpeed),
  9149. a()
  9150. }
  9151. function a() {
  9152. if (!A) {
  9153. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9154. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9155. A = new Promise(function(e, i) {
  9156. var n = document.createElement("script");
  9157. n.type = "text/javascript",
  9158. n.src = t,
  9159. n.onload = e,
  9160. document.head.appendChild(n)
  9161. }
  9162. )
  9163. }
  9164. D.find(".enter-button").on("click", r)
  9165. }
  9166. function s() {
  9167. g("webvr_modal_close"),
  9168. D.find(".enter-button").off("click", r),
  9169. L.fadeOut(I.guiAnimationSpeed, function() {
  9170. D.toggleClass("hidden", !1),
  9171. N.toggleClass("hidden", !0),
  9172. C.exitFullscreen()
  9173. }),
  9174. O.fadeIn(I.guiAnimationSpeed)
  9175. }
  9176. function l() {
  9177. k.toggleClass("hidden", !1),
  9178. U.toggleClass("hidden", !0)
  9179. }
  9180. function c() {
  9181. k.toggleClass("hidden", !0),
  9182. U.toggleClass("hidden", !1)
  9183. }
  9184. function h() {
  9185. B.filter(".device-headset").attr("src", G),
  9186. B.filter(".device-phone").attr("src", z),
  9187. J = Z,
  9188. ee = K,
  9189. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9190. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9191. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9192. c()
  9193. }
  9194. function u() {
  9195. B.filter(".badge-cardboard").attr("src", j),
  9196. B.filter(".badge-oculus").attr("src", X),
  9197. l()
  9198. }
  9199. function d() {
  9200. B.filter(".device-headset").attr("src", Y),
  9201. B.filter(".device-phone").attr("src", W),
  9202. J = q,
  9203. ee = Q,
  9204. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9205. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9206. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9207. c()
  9208. }
  9209. function p() {
  9210. D.toggleClass("hidden"),
  9211. N.toggleClass("hidden")
  9212. }
  9213. function f() {
  9214. R.info("exiting webVR"),
  9215. g("webvr_exit_app"),
  9216. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9217. }
  9218. function g(e) {
  9219. var t = C.isLandscape() ? "landscape" : "portrait";
  9220. T.trackAlways("showcase_gui", {
  9221. gui_action: e,
  9222. orientation: t
  9223. })
  9224. }
  9225. function m() {
  9226. var e = C.isLandscape();
  9227. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9228. }
  9229. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9230. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9231. e("../../localization/localize")), S = e("../../util/common"), M = e("../../util/logger"), R = new M(i), P = e("events").EventEmitter, O = $("#gui"), L = $(".webvr-popup"), D = $(".webvr-popup .page.p1"), N = $(".webvr-popup .page.p2"), B = L.find(".image"), F = $(".webvr-popup .detail.headset"), V = $(".webvr-popup .detail.phone"), U = $(".webvr-popup .tab-content.webvr"), k = $(".webvr-popup .tab-content.native"), H = "images/device-daydream-side.png", G = "images/device-daydream.png", z = "images/device-pixel.png", W = "images/ico-android-robot.png", j = "images/badge-cardboard.png", Y = "images/headset-cardboard.png", X = "images/badge-oculus.png", Z = "https://madeby.google.com/vr/", q = "https://vr.google.com/cardboard/get-cardboard/", K = "webvr_daydream_link", Q = "webvr_cardboard_link", J = Z, ee = K, te = "https://vr.google.com/daydream/phones/", ie = {
  9232. init: n
  9233. }, ne = {
  9234. tabcardboard: d,
  9235. tabdaydream: h,
  9236. tabnative: u
  9237. };
  9238. S.extendObject(ie, P.prototype),
  9239. $(window).resize(m),
  9240. t.exports = ie
  9241. }
  9242. ).call(this, "/js/gui/webvr/webVRgui.js")
  9243. }
  9244. , {
  9245. "../../analytics": 4,
  9246. "../../constants": 8,
  9247. "../../enum/VRApps": 46,
  9248. "../../enum/VRPlatforms": 49,
  9249. "../../localization/localize": 108,
  9250. "../../settings": 166,
  9251. "../../util/browser": 182,
  9252. "../../util/common": 185,
  9253. "../../util/logger": 189,
  9254. "./../gui": 65,
  9255. "./../vr/vrLink": 86,
  9256. "./WebVrEvent": 88,
  9257. events: 202
  9258. }],
  9259. 90: [function(e, t, i) {
  9260. "use strict";
  9261. function n(e, t, i, n, o) {
  9262. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9263. this.roomId = o || "",
  9264. this.labelId = e,
  9265. this.position = (new r.Vector3).copy(t),
  9266. this.text = i
  9267. }
  9268. var r = e("three")
  9269. , o = e("../util/browser");
  9270. n.prototype.build = function() {
  9271. var e = window.document.createElement("div");
  9272. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9273. var t = window.document.createElement("div");
  9274. t.setAttribute("class", "gui-floorplan-label-text");
  9275. var i = window.document.createTextNode(this.text);
  9276. t.appendChild(i),
  9277. e.appendChild(t),
  9278. window.document.body.appendChild(e),
  9279. this.labelGui = e,
  9280. this.textBlock = t,
  9281. $(this.labelGui).hide();
  9282. var n = window.getComputedStyle(this.labelGui);
  9283. this.initialTransform = n.transform || n.webkitTransform
  9284. }
  9285. ,
  9286. t.exports = n
  9287. }
  9288. , {
  9289. "../util/browser": 182,
  9290. three: 217
  9291. }],
  9292. 91: [function(e, t, i) {
  9293. "use strict";
  9294. function n() {
  9295. this.player = null,
  9296. this.modelManager = null,
  9297. this.container = null
  9298. }
  9299. var r = e("three")
  9300. , o = (e("../util/common"),
  9301. e("../enum/PlayerEvents"))
  9302. , a = (e("../enum/DirectorEvents"),
  9303. e("../enum/ModelManagerEvents"))
  9304. , s = e("../settings")
  9305. , l = e("../enum/Viewmode")
  9306. , c = (e("../enum/WarpStyle"),
  9307. e("../util/transitions"),
  9308. e("../util/lerp"),
  9309. e("../util/browser"));
  9310. n.prototype.init = function(e, t, i) {
  9311. this.player = e,
  9312. this.modelManager = t,
  9313. this.container = i,
  9314. this.updateModel(),
  9315. this.bindEvents()
  9316. }
  9317. ,
  9318. n.prototype.bindEvents = function() {
  9319. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9320. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9321. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9322. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9323. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9324. }
  9325. ,
  9326. n.prototype.updateModel = function() {
  9327. this.model = this.modelManager.getActiveModel()
  9328. }
  9329. ,
  9330. n.prototype.handlePlayerViewChanged = function() {
  9331. this.updateLabelVisibility(),
  9332. this.updateLabelDisplay()
  9333. }
  9334. ,
  9335. n.prototype.getLabelsForFloor = function(e, t) {
  9336. return t = t || [],
  9337. t.length = 0,
  9338. this.model.labels.forEach(function(i) {
  9339. this.labelVisibleForFloor(i, e) && t.push(i)
  9340. }
  9341. .bind(this)),
  9342. t
  9343. }
  9344. ,
  9345. n.prototype.getLabelsForCurrentFloor = function(e) {
  9346. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9347. }
  9348. ,
  9349. n.prototype.labelVisibleForFloor = function(e, t) {
  9350. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9351. if (!this.model.showingLabels || !e.labelGui || !i)
  9352. return !1;
  9353. var n = e.floorId === this.model.floors.size() - 1;
  9354. return this.model.allFloorsVisible ? n : e.floorId === t
  9355. }
  9356. ,
  9357. n.prototype.updateLabelVisibility = function(e) {
  9358. this.model.labels.forEach(function(e) {
  9359. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration) : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  9360. }
  9361. .bind(this))
  9362. }
  9363. ,
  9364. n.prototype.showAllLabels = function(e, t) {
  9365. this.model.labels.forEach(function(i) {
  9366. this.showLabel(i, e, t)
  9367. }
  9368. .bind(this))
  9369. }
  9370. ,
  9371. n.prototype.hideAllLabels = function(e, t) {
  9372. this.model.labels.forEach(function(i) {
  9373. this.hideLabel(i, e, t)
  9374. }
  9375. .bind(this))
  9376. }
  9377. ,
  9378. n.prototype.showLabel = function(e, t, i) {
  9379. this.model.showingLabels && (e.visible || (e.visible = !0,
  9380. e.labelGui.style.display = "block",
  9381. e.labelGui.style.opacity = 0,
  9382. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9383. }
  9384. ,
  9385. n.prototype.hideLabel = function(e, t, i) {
  9386. e.visible && (e.visible = !1,
  9387. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9388. }
  9389. ,
  9390. n.prototype.supportedMode = function() {
  9391. return this.player.mode === l.FLOORPLAN
  9392. }
  9393. ,
  9394. n.prototype.updateLabelDisplay = function() {
  9395. var e = (new r.Vector3,
  9396. new r.Vector3,
  9397. []);
  9398. return function() {
  9399. var t = this.player.getLabelScaleFactor()
  9400. , i = .6
  9401. , n = 1.2
  9402. , r = (1 - t) * n + i
  9403. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9404. this.getLabelsForCurrentFloor(e);
  9405. for (var a = 0; a < e.length; a++) {
  9406. var l = e[a];
  9407. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9408. t >= o && l.text.length >= s.labels.minLengthForTruncate ? l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix : l.textBlock.innerText = l.text)
  9409. }
  9410. }
  9411. }(),
  9412. n.prototype.updateProjectedGuiElement = function() {
  9413. var e = new r.Vector3;
  9414. new r.Vector3;
  9415. return function(t, i, n, r, o) {
  9416. i.style.fontSize = 100 * o + "%";
  9417. var a = $("#player").width()
  9418. , s = $("#player").height()
  9419. , l = .5 * a
  9420. , c = .5 * s;
  9421. e.copy(n),
  9422. e.project(this.player.camera);
  9423. var h = e.x * l + l
  9424. , u = -(e.y * c) + c;
  9425. h -= t.offsetWidth / 2,
  9426. u -= t.offsetHeight / 2,
  9427. t.style.left = h + "px",
  9428. t.style.top = u + "px"
  9429. }
  9430. }(),
  9431. n.prototype.handleStartInside = function(e) {
  9432. this.updateLabelVisibility()
  9433. }
  9434. ,
  9435. n.prototype.handleStartOutside = function() {
  9436. this.updateLabelVisibility()
  9437. }
  9438. ,
  9439. t.exports = n
  9440. }
  9441. , {
  9442. "../enum/DirectorEvents": 23,
  9443. "../enum/ModelManagerEvents": 33,
  9444. "../enum/PlayerEvents": 40,
  9445. "../enum/Viewmode": 51,
  9446. "../enum/WarpStyle": 52,
  9447. "../settings": 166,
  9448. "../util/browser": 182,
  9449. "../util/common": 185,
  9450. "../util/lerp": 188,
  9451. "../util/transitions": 195,
  9452. three: 217
  9453. }],
  9454. 92: [function(e, t, i) {
  9455. "use strict";
  9456. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9457. if (null == this)
  9458. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9459. if ("function" != typeof e)
  9460. throw new TypeError("predicate must be a function");
  9461. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9462. if (t = i[o],
  9463. e.call(r, t, o, i))
  9464. return o;
  9465. return -1
  9466. }
  9467. ),
  9468. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9469. value: function(e) {
  9470. if (null == this)
  9471. throw new TypeError('"this" is null or not defined');
  9472. var t = Object(this)
  9473. , i = t.length >>> 0;
  9474. if ("function" != typeof e)
  9475. throw new TypeError("predicate must be a function");
  9476. for (var n = arguments[1], r = 0; r < i; ) {
  9477. var o = t[r];
  9478. if (e.call(n, o, r, t))
  9479. return o;
  9480. r++
  9481. }
  9482. }
  9483. })
  9484. }
  9485. , {}],
  9486. 93: [function(e, t, i) {
  9487. "use strict";
  9488. var n = n || {};
  9489. t.exports = n,
  9490. n.gui = n.gui || {},
  9491. n.utils = n.utils || {},
  9492. n.controllers = n.controllers || {},
  9493. n.dom = n.dom || {},
  9494. n.color = n.color || {},
  9495. n.utils.css = function() {
  9496. return {
  9497. load: function(e, t) {
  9498. t = t || document;
  9499. var i = t.createElement("link");
  9500. i.type = "text/css",
  9501. i.rel = "stylesheet",
  9502. i.href = e,
  9503. t.getElementsByTagName("head")[0].appendChild(i)
  9504. },
  9505. inject: function(e, t) {
  9506. t = t || document;
  9507. var i = document.createElement("style");
  9508. i.type = "text/css",
  9509. i.innerHTML = e,
  9510. t.getElementsByTagName("head")[0].appendChild(i)
  9511. }
  9512. }
  9513. }(),
  9514. n.utils.common = function() {
  9515. var e = Array.prototype.forEach
  9516. , t = Array.prototype.slice;
  9517. return {
  9518. BREAK: {},
  9519. extend: function(e) {
  9520. return this.each(t.call(arguments, 1), function(t) {
  9521. for (var i in t)
  9522. this.isUndefined(t[i]) || (e[i] = t[i])
  9523. }, this),
  9524. e
  9525. },
  9526. defaults: function(e) {
  9527. return this.each(t.call(arguments, 1), function(t) {
  9528. for (var i in t)
  9529. this.isUndefined(e[i]) && (e[i] = t[i])
  9530. }, this),
  9531. e
  9532. },
  9533. compose: function() {
  9534. var e = t.call(arguments);
  9535. return function() {
  9536. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9537. i = [e[n].apply(this, i)];
  9538. return i[0]
  9539. }
  9540. },
  9541. each: function(t, i, n) {
  9542. if (t)
  9543. if (e && t.forEach && t.forEach === e)
  9544. t.forEach(i, n);
  9545. else if (t.length === t.length + 0) {
  9546. for (var r = 0, o = t.length; r < o; r++)
  9547. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9548. return
  9549. } else
  9550. for (var r in t)
  9551. if (i.call(n, t[r], r) === this.BREAK)
  9552. return
  9553. },
  9554. defer: function(e) {
  9555. setTimeout(e, 0)
  9556. },
  9557. toArray: function(e) {
  9558. return e.toArray ? e.toArray() : t.call(e)
  9559. },
  9560. isUndefined: function(e) {
  9561. return void 0 === e
  9562. },
  9563. isNull: function(e) {
  9564. return null === e
  9565. },
  9566. isNaN: function(e) {
  9567. return e !== e
  9568. },
  9569. isArray: Array.isArray || function(e) {
  9570. return e.constructor === Array
  9571. }
  9572. ,
  9573. isObject: function(e) {
  9574. return e === Object(e)
  9575. },
  9576. isNumber: function(e) {
  9577. return e === e + 0
  9578. },
  9579. isString: function(e) {
  9580. return e === e + ""
  9581. },
  9582. isBoolean: function(e) {
  9583. return e === !1 || e === !0
  9584. },
  9585. isFunction: function(e) {
  9586. return "[object Function]" === Object.prototype.toString.call(e)
  9587. }
  9588. }
  9589. }(),
  9590. n.controllers.Controller = function(e) {
  9591. var t = function(e, t) {
  9592. this.initialValue = e[t],
  9593. this.domElement = document.createElement("div"),
  9594. this.object = e,
  9595. this.property = t,
  9596. this.__onChange = void 0,
  9597. this.__onFinishChange = void 0
  9598. };
  9599. return e.extend(t.prototype, {
  9600. onChange: function(e) {
  9601. return this.__onChange = e,
  9602. this
  9603. },
  9604. onFinishChange: function(e) {
  9605. return this.__onFinishChange = e,
  9606. this
  9607. },
  9608. setValue: function(e) {
  9609. return this.object[this.property] = e,
  9610. this.__onChange && this.__onChange.call(this, e),
  9611. this.updateDisplay(),
  9612. this
  9613. },
  9614. getValue: function() {
  9615. return this.object[this.property]
  9616. },
  9617. updateDisplay: function() {
  9618. return this
  9619. },
  9620. isModified: function() {
  9621. return this.initialValue !== this.getValue()
  9622. }
  9623. }),
  9624. t
  9625. }(n.utils.common),
  9626. n.dom.dom = function(e) {
  9627. function t(t) {
  9628. if ("0" === t || e.isUndefined(t))
  9629. return 0;
  9630. var i = t.match(r);
  9631. return e.isNull(i) ? 0 : parseFloat(i[1])
  9632. }
  9633. var i = {
  9634. HTMLEvents: ["change"],
  9635. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9636. KeyboardEvents: ["keydown"]
  9637. }
  9638. , n = {};
  9639. e.each(i, function(t, i) {
  9640. e.each(t, function(e) {
  9641. n[e] = i
  9642. })
  9643. });
  9644. var r = /(\d+(\.\d+)?)px/
  9645. , o = {
  9646. makeSelectable: function(e, t) {
  9647. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9648. return !1
  9649. }
  9650. : function() {}
  9651. ,
  9652. e.style.MozUserSelect = t ? "auto" : "none",
  9653. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9654. e.unselectable = t ? "on" : "off")
  9655. },
  9656. makeFullscreen: function(t, i, n) {
  9657. e.isUndefined(i) && (i = !0),
  9658. e.isUndefined(n) && (n = !0),
  9659. t.style.position = "absolute",
  9660. i && (t.style.left = 0,
  9661. t.style.right = 0),
  9662. n && (t.style.top = 0,
  9663. t.style.bottom = 0)
  9664. },
  9665. fakeEvent: function(t, i, r, o) {
  9666. r = r || {};
  9667. var a = n[i];
  9668. if (!a)
  9669. throw new Error("Event type " + i + " not supported.");
  9670. var s = document.createEvent(a);
  9671. switch (a) {
  9672. case "MouseEvents":
  9673. var l = r.x || r.clientX || 0
  9674. , c = r.y || r.clientY || 0;
  9675. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9676. break;
  9677. case "KeyboardEvents":
  9678. var h = s.initKeyboardEvent || s.initKeyEvent;
  9679. e.defaults(r, {
  9680. cancelable: !0,
  9681. ctrlKey: !1,
  9682. altKey: !1,
  9683. shiftKey: !1,
  9684. metaKey: !1,
  9685. keyCode: void 0,
  9686. charCode: void 0
  9687. }),
  9688. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9689. break;
  9690. default:
  9691. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9692. }
  9693. e.defaults(s, o),
  9694. t.dispatchEvent(s)
  9695. },
  9696. bind: function(e, t, i, n) {
  9697. return n = n || !1,
  9698. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9699. o
  9700. },
  9701. unbind: function(e, t, i, n) {
  9702. return n = n || !1,
  9703. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9704. o
  9705. },
  9706. addClass: function(e, t) {
  9707. if (void 0 === e.className)
  9708. e.className = t;
  9709. else if (e.className !== t) {
  9710. var i = e.className.split(/ +/);
  9711. i.indexOf(t) == -1 && (i.push(t),
  9712. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9713. }
  9714. return o
  9715. },
  9716. removeClass: function(e, t) {
  9717. if (t)
  9718. if (void 0 === e.className)
  9719. ;
  9720. else if (e.className === t)
  9721. e.removeAttribute("class");
  9722. else {
  9723. var i = e.className.split(/ +/)
  9724. , n = i.indexOf(t);
  9725. n != -1 && (i.splice(n, 1),
  9726. e.className = i.join(" "))
  9727. }
  9728. else
  9729. e.className = void 0;
  9730. return o
  9731. },
  9732. hasClass: function(e, t) {
  9733. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9734. },
  9735. getWidth: function(e) {
  9736. var i = getComputedStyle(e);
  9737. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9738. },
  9739. getHeight: function(e) {
  9740. var i = getComputedStyle(e);
  9741. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9742. },
  9743. getOffset: function(e) {
  9744. var t = {
  9745. left: 0,
  9746. top: 0
  9747. };
  9748. if (e.offsetParent)
  9749. do
  9750. t.left += e.offsetLeft,
  9751. t.top += e.offsetTop;
  9752. while (e = e.offsetParent);return t
  9753. },
  9754. isActive: function(e) {
  9755. return e === document.activeElement && (e.type || e.href)
  9756. }
  9757. };
  9758. return o
  9759. }(n.utils.common),
  9760. n.controllers.OptionController = function(e, t, i) {
  9761. var n = function(e, r, o) {
  9762. n.superclass.call(this, e, r);
  9763. var a = this;
  9764. if (this.__select = document.createElement("select"),
  9765. i.isArray(o)) {
  9766. var s = {};
  9767. i.each(o, function(e) {
  9768. s[e] = e
  9769. }),
  9770. o = s
  9771. }
  9772. i.each(o, function(e, t) {
  9773. var i = document.createElement("option");
  9774. i.innerHTML = t,
  9775. i.setAttribute("value", e),
  9776. a.__select.appendChild(i)
  9777. }),
  9778. this.updateDisplay(),
  9779. t.bind(this.__select, "change", function() {
  9780. var e = this.options[this.selectedIndex].value;
  9781. a.setValue(e)
  9782. }),
  9783. this.domElement.appendChild(this.__select)
  9784. };
  9785. return n.superclass = e,
  9786. i.extend(n.prototype, e.prototype, {
  9787. setValue: function(e) {
  9788. var t = n.superclass.prototype.setValue.call(this, e);
  9789. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9790. t
  9791. },
  9792. updateDisplay: function() {
  9793. return this.__select.value = this.getValue(),
  9794. n.superclass.prototype.updateDisplay.call(this)
  9795. }
  9796. }),
  9797. n
  9798. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9799. n.controllers.NumberController = function(e, t) {
  9800. function i(e) {
  9801. return e = e.toString(),
  9802. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  9803. }
  9804. var n = function(e, r, o) {
  9805. n.superclass.call(this, e, r),
  9806. o = o || {},
  9807. this.__min = o.min,
  9808. this.__max = o.max,
  9809. this.__step = o.step,
  9810. t.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  9811. this.__precision = i(this.__impliedStep)
  9812. };
  9813. return n.superclass = e,
  9814. t.extend(n.prototype, e.prototype, {
  9815. setValue: function(e) {
  9816. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9817. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9818. n.superclass.prototype.setValue.call(this, e)
  9819. },
  9820. min: function(e) {
  9821. return this.__min = e,
  9822. this
  9823. },
  9824. max: function(e) {
  9825. return this.__max = e,
  9826. this
  9827. },
  9828. step: function(e) {
  9829. return this.__step = e,
  9830. this.__impliedStep = e,
  9831. this.__precision = i(e),
  9832. this
  9833. }
  9834. }),
  9835. n
  9836. }(n.controllers.Controller, n.utils.common),
  9837. n.controllers.NumberControllerBox = function(e, t, i) {
  9838. function n(e, t) {
  9839. var i = Math.pow(10, t);
  9840. return Math.round(e * i) / i
  9841. }
  9842. var r = function(e, n, o) {
  9843. function a() {
  9844. var e = parseFloat(d.__input.value);
  9845. i.isNaN(e) || d.setValue(e)
  9846. }
  9847. function s() {
  9848. a(),
  9849. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  9850. }
  9851. function l(e) {
  9852. t.bind(window, "mousemove", c),
  9853. t.bind(window, "mouseup", h),
  9854. u = e.clientY
  9855. }
  9856. function c(e) {
  9857. var t = u - e.clientY;
  9858. d.setValue(d.getValue() + t * d.__impliedStep),
  9859. u = e.clientY
  9860. }
  9861. function h() {
  9862. t.unbind(window, "mousemove", c),
  9863. t.unbind(window, "mouseup", h)
  9864. }
  9865. this.__truncationSuspended = !1,
  9866. r.superclass.call(this, e, n, o);
  9867. var u, d = this;
  9868. this.__input = document.createElement("input"),
  9869. this.__input.setAttribute("type", "text"),
  9870. t.bind(this.__input, "change", a),
  9871. t.bind(this.__input, "blur", s),
  9872. t.bind(this.__input, "mousedown", l),
  9873. t.bind(this.__input, "keydown", function(e) {
  9874. 13 === e.keyCode && (d.__truncationSuspended = !0,
  9875. this.blur(),
  9876. d.__truncationSuspended = !1)
  9877. }),
  9878. this.updateDisplay(),
  9879. this.domElement.appendChild(this.__input)
  9880. };
  9881. return r.superclass = e,
  9882. i.extend(r.prototype, e.prototype, {
  9883. updateDisplay: function() {
  9884. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  9885. r.superclass.prototype.updateDisplay.call(this)
  9886. }
  9887. }),
  9888. r
  9889. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  9890. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  9891. function o(e, t, i, n, r) {
  9892. return n + (r - n) * ((e - t) / (i - t))
  9893. }
  9894. var a = function(e, i, n, r, s) {
  9895. function l(e) {
  9896. t.bind(window, "mousemove", c),
  9897. t.bind(window, "mouseup", h),
  9898. c(e)
  9899. }
  9900. function c(e) {
  9901. e.preventDefault();
  9902. var i = t.getOffset(u.__background)
  9903. , n = t.getWidth(u.__background);
  9904. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  9905. !1
  9906. }
  9907. function h() {
  9908. t.unbind(window, "mousemove", c),
  9909. t.unbind(window, "mouseup", h),
  9910. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  9911. }
  9912. a.superclass.call(this, e, i, {
  9913. min: n,
  9914. max: r,
  9915. step: s
  9916. });
  9917. var u = this;
  9918. this.__background = document.createElement("div"),
  9919. this.__foreground = document.createElement("div"),
  9920. t.bind(this.__background, "mousedown", l),
  9921. t.addClass(this.__background, "slider"),
  9922. t.addClass(this.__foreground, "slider-fg"),
  9923. this.updateDisplay(),
  9924. this.__background.appendChild(this.__foreground),
  9925. this.domElement.appendChild(this.__background)
  9926. };
  9927. return a.superclass = e,
  9928. a.useDefaultStyles = function() {
  9929. i.inject(r)
  9930. }
  9931. ,
  9932. n.extend(a.prototype, e.prototype, {
  9933. updateDisplay: function() {
  9934. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9935. return this.__foreground.style.width = 100 * e + "%",
  9936. a.superclass.prototype.updateDisplay.call(this)
  9937. }
  9938. }),
  9939. a
  9940. }(n.controllers.NumberController, n.dom.dom, n.utils.css, n.utils.common, "/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"),
  9941. n.controllers.FunctionController = function(e, t, i) {
  9942. var n = function(e, i, r) {
  9943. n.superclass.call(this, e, i);
  9944. var o = this;
  9945. this.__button = document.createElement("div"),
  9946. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  9947. t.bind(this.__button, "click", function(e) {
  9948. return e.preventDefault(),
  9949. o.fire(),
  9950. !1
  9951. }),
  9952. t.addClass(this.__button, "button"),
  9953. this.domElement.appendChild(this.__button)
  9954. };
  9955. return n.superclass = e,
  9956. i.extend(n.prototype, e.prototype, {
  9957. fire: function() {
  9958. this.__onChange && this.__onChange.call(this),
  9959. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9960. this.getValue().call(this.object)
  9961. }
  9962. }),
  9963. n
  9964. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9965. n.controllers.BooleanController = function(e, t, i) {
  9966. var n = function(e, i) {
  9967. function r() {
  9968. o.setValue(!o.__prev)
  9969. }
  9970. n.superclass.call(this, e, i);
  9971. var o = this;
  9972. this.__prev = this.getValue(),
  9973. this.__checkbox = document.createElement("input"),
  9974. this.__checkbox.setAttribute("type", "checkbox"),
  9975. t.bind(this.__checkbox, "change", r, !1),
  9976. this.domElement.appendChild(this.__checkbox),
  9977. this.updateDisplay()
  9978. };
  9979. return n.superclass = e,
  9980. i.extend(n.prototype, e.prototype, {
  9981. setValue: function(e) {
  9982. var t = n.superclass.prototype.setValue.call(this, e);
  9983. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9984. this.__prev = this.getValue(),
  9985. t
  9986. },
  9987. updateDisplay: function() {
  9988. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  9989. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9990. n.superclass.prototype.updateDisplay.call(this)
  9991. }
  9992. }),
  9993. n
  9994. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9995. n.color.toString = function(e) {
  9996. return function(t) {
  9997. if (1 == t.a || e.isUndefined(t.a)) {
  9998. for (var i = t.hex.toString(16); i.length < 6; )
  9999. i = "0" + i;
  10000. return "#" + i
  10001. }
  10002. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10003. }
  10004. }(n.utils.common),
  10005. n.color.interpret = function(e, t) {
  10006. var i, n, r = function() {
  10007. n = !1;
  10008. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10009. return t.each(o, function(r) {
  10010. if (r.litmus(e))
  10011. return t.each(r.conversions, function(r, o) {
  10012. if (i = r.read(e),
  10013. n === !1 && i !== !1)
  10014. return n = i,
  10015. i.conversionName = o,
  10016. i.conversion = r,
  10017. t.BREAK
  10018. }),
  10019. t.BREAK
  10020. }),
  10021. n
  10022. }, o = [{
  10023. litmus: t.isString,
  10024. conversions: {
  10025. THREE_CHAR_HEX: {
  10026. read: function(e) {
  10027. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10028. return null !== t && {
  10029. space: "HEX",
  10030. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10031. }
  10032. },
  10033. write: e
  10034. },
  10035. SIX_CHAR_HEX: {
  10036. read: function(e) {
  10037. var t = e.match(/^#([A-F0-9]{6})$/i);
  10038. return null !== t && {
  10039. space: "HEX",
  10040. hex: parseInt("0x" + t[1].toString())
  10041. }
  10042. },
  10043. write: e
  10044. },
  10045. CSS_RGB: {
  10046. read: function(e) {
  10047. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10048. return null !== t && {
  10049. space: "RGB",
  10050. r: parseFloat(t[1]),
  10051. g: parseFloat(t[2]),
  10052. b: parseFloat(t[3])
  10053. }
  10054. },
  10055. write: e
  10056. },
  10057. CSS_RGBA: {
  10058. read: function(e) {
  10059. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10060. return null !== t && {
  10061. space: "RGB",
  10062. r: parseFloat(t[1]),
  10063. g: parseFloat(t[2]),
  10064. b: parseFloat(t[3]),
  10065. a: parseFloat(t[4])
  10066. }
  10067. },
  10068. write: e
  10069. }
  10070. }
  10071. }, {
  10072. litmus: t.isNumber,
  10073. conversions: {
  10074. HEX: {
  10075. read: function(e) {
  10076. return {
  10077. space: "HEX",
  10078. hex: e,
  10079. conversionName: "HEX"
  10080. }
  10081. },
  10082. write: function(e) {
  10083. return e.hex
  10084. }
  10085. }
  10086. }
  10087. }, {
  10088. litmus: t.isArray,
  10089. conversions: {
  10090. RGB_ARRAY: {
  10091. read: function(e) {
  10092. return 3 == e.length && {
  10093. space: "RGB",
  10094. r: e[0],
  10095. g: e[1],
  10096. b: e[2]
  10097. }
  10098. },
  10099. write: function(e) {
  10100. return [e.r, e.g, e.b]
  10101. }
  10102. },
  10103. RGBA_ARRAY: {
  10104. read: function(e) {
  10105. return 4 == e.length && {
  10106. space: "RGB",
  10107. r: e[0],
  10108. g: e[1],
  10109. b: e[2],
  10110. a: e[3]
  10111. }
  10112. },
  10113. write: function(e) {
  10114. return [e.r, e.g, e.b, e.a]
  10115. }
  10116. }
  10117. }
  10118. }, {
  10119. litmus: t.isObject,
  10120. conversions: {
  10121. RGBA_OBJ: {
  10122. read: function(e) {
  10123. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10124. space: "RGB",
  10125. r: e.r,
  10126. g: e.g,
  10127. b: e.b,
  10128. a: e.a
  10129. }
  10130. },
  10131. write: function(e) {
  10132. return {
  10133. r: e.r,
  10134. g: e.g,
  10135. b: e.b,
  10136. a: e.a
  10137. }
  10138. }
  10139. },
  10140. RGB_OBJ: {
  10141. read: function(e) {
  10142. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10143. space: "RGB",
  10144. r: e.r,
  10145. g: e.g,
  10146. b: e.b
  10147. }
  10148. },
  10149. write: function(e) {
  10150. return {
  10151. r: e.r,
  10152. g: e.g,
  10153. b: e.b
  10154. }
  10155. }
  10156. },
  10157. HSVA_OBJ: {
  10158. read: function(e) {
  10159. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10160. space: "HSV",
  10161. h: e.h,
  10162. s: e.s,
  10163. v: e.v,
  10164. a: e.a
  10165. }
  10166. },
  10167. write: function(e) {
  10168. return {
  10169. h: e.h,
  10170. s: e.s,
  10171. v: e.v,
  10172. a: e.a
  10173. }
  10174. }
  10175. },
  10176. HSV_OBJ: {
  10177. read: function(e) {
  10178. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10179. space: "HSV",
  10180. h: e.h,
  10181. s: e.s,
  10182. v: e.v
  10183. }
  10184. },
  10185. write: function(e) {
  10186. return {
  10187. h: e.h,
  10188. s: e.s,
  10189. v: e.v
  10190. }
  10191. }
  10192. }
  10193. }
  10194. }];
  10195. return r
  10196. }(n.color.toString, n.utils.common),
  10197. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10198. function g(e, t, i, o) {
  10199. if (void 0 === t[i])
  10200. throw new Error("Object " + t + ' has no property "' + i + '"');
  10201. var a;
  10202. if (o.color)
  10203. a = new h(t,i);
  10204. else {
  10205. var s = [t, i].concat(o.factoryArgs);
  10206. a = n.apply(e, s)
  10207. }
  10208. o.before instanceof r && (o.before = o.before.__li),
  10209. A(e, a),
  10210. p.addClass(a.domElement, "c");
  10211. var l = document.createElement("span");
  10212. p.addClass(l, "property-name"),
  10213. l.innerHTML = a.property;
  10214. var c = document.createElement("div");
  10215. c.appendChild(l),
  10216. c.appendChild(a.domElement);
  10217. var u = m(e, c, o.before);
  10218. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10219. p.addClass(u, typeof a.getValue()),
  10220. v(e, u, a),
  10221. e.__controllers.push(a),
  10222. a
  10223. }
  10224. function m(e, t, i) {
  10225. var n = document.createElement("li");
  10226. return t && n.appendChild(t),
  10227. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10228. e.onResize(),
  10229. n
  10230. }
  10231. function v(e, t, i) {
  10232. if (i.__li = t,
  10233. i.__gui = e,
  10234. f.extend(i, {
  10235. options: function(t) {
  10236. return arguments.length > 1 ? (i.remove(),
  10237. g(e, i.object, i.property, {
  10238. before: i.__li.nextElementSibling,
  10239. factoryArgs: [f.toArray(arguments)]
  10240. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10241. g(e, i.object, i.property, {
  10242. before: i.__li.nextElementSibling,
  10243. factoryArgs: [t]
  10244. })) : void 0
  10245. },
  10246. name: function(e) {
  10247. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10248. i
  10249. },
  10250. listen: function() {
  10251. return i.__gui.listen(i),
  10252. i
  10253. },
  10254. remove: function() {
  10255. return i.__gui.remove(i),
  10256. i
  10257. }
  10258. }),
  10259. i instanceof l) {
  10260. var n = new s(i.object,i.property,{
  10261. min: i.__min,
  10262. max: i.__max,
  10263. step: i.__step
  10264. });
  10265. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10266. var t = i[e]
  10267. , r = n[e];
  10268. i[e] = n[e] = function() {
  10269. var e = Array.prototype.slice.call(arguments);
  10270. return t.apply(i, e),
  10271. r.apply(n, e)
  10272. }
  10273. }),
  10274. p.addClass(t, "has-slider"),
  10275. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10276. } else if (i instanceof s) {
  10277. var r = function(t) {
  10278. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10279. g(e, i.object, i.property, {
  10280. before: i.__li.nextElementSibling,
  10281. factoryArgs: [i.__min, i.__max, i.__step]
  10282. })) : t
  10283. };
  10284. i.min = f.compose(r, i.min),
  10285. i.max = f.compose(r, i.max)
  10286. } else
  10287. i instanceof o ? (p.bind(t, "click", function() {
  10288. p.fakeEvent(i.__checkbox, "click")
  10289. }),
  10290. p.bind(i.__checkbox, "click", function(e) {
  10291. e.stopPropagation()
  10292. })) : i instanceof a ? (p.bind(t, "click", function() {
  10293. p.fakeEvent(i.__button, "click")
  10294. }),
  10295. p.bind(t, "mouseover", function() {
  10296. p.addClass(i.__button, "hover")
  10297. }),
  10298. p.bind(t, "mouseout", function() {
  10299. p.removeClass(i.__button, "hover")
  10300. })) : i instanceof h && (p.addClass(t, "color"),
  10301. i.updateDisplay = f.compose(function(e) {
  10302. return t.style.borderLeftColor = i.__color.toString(),
  10303. e
  10304. }, i.updateDisplay),
  10305. i.updateDisplay());
  10306. i.setValue = f.compose(function(t) {
  10307. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10308. t
  10309. }, i.setValue)
  10310. }
  10311. function A(e, t) {
  10312. var i = e.getRoot()
  10313. , n = i.__rememberedObjects.indexOf(t.object);
  10314. if (n != -1) {
  10315. var r = i.__rememberedObjectIndecesToControllers[n];
  10316. if (void 0 === r && (r = {},
  10317. i.__rememberedObjectIndecesToControllers[n] = r),
  10318. r[t.property] = t,
  10319. i.load && i.load.remembered) {
  10320. var o, a = i.load.remembered;
  10321. if (a[e.preset])
  10322. o = a[e.preset];
  10323. else {
  10324. if (!a[L])
  10325. return;
  10326. o = a[L]
  10327. }
  10328. if (o[n] && void 0 !== o[n][t.property]) {
  10329. var s = o[n][t.property];
  10330. t.initialValue = s,
  10331. t.setValue(s)
  10332. }
  10333. }
  10334. }
  10335. }
  10336. function y(e, t) {
  10337. return document.location.href + "." + t
  10338. }
  10339. function C(e) {
  10340. var t = e.__save_row = document.createElement("li");
  10341. p.addClass(e.domElement, "has-save"),
  10342. e.__ul.insertBefore(t, e.__ul.firstChild),
  10343. p.addClass(t, "save-row");
  10344. var i = document.createElement("span");
  10345. i.innerHTML = "&nbsp;",
  10346. p.addClass(i, "button gears");
  10347. var n = document.createElement("span");
  10348. n.innerHTML = "Save",
  10349. p.addClass(n, "button"),
  10350. p.addClass(n, "save");
  10351. var r = document.createElement("span");
  10352. r.innerHTML = "New",
  10353. p.addClass(r, "button"),
  10354. p.addClass(r, "save-as");
  10355. var o = document.createElement("span");
  10356. o.innerHTML = "Revert",
  10357. p.addClass(o, "button"),
  10358. p.addClass(o, "revert");
  10359. var a = e.__preset_select = document.createElement("select");
  10360. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10361. w(e, i, i == e.preset)
  10362. }) : w(e, L, !1),
  10363. p.bind(a, "change", function() {
  10364. for (var t = 0; t < e.__preset_select.length; t++)
  10365. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10366. e.preset = this.value
  10367. }),
  10368. t.appendChild(a),
  10369. t.appendChild(i),
  10370. t.appendChild(n),
  10371. t.appendChild(r),
  10372. t.appendChild(o),
  10373. D) {
  10374. var s = document.getElementById("dg-save-locally")
  10375. , l = document.getElementById("dg-local-explain");
  10376. s.style.display = "block";
  10377. var c = document.getElementById("dg-local-storage");
  10378. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10379. var h = function() {
  10380. l.style.display = e.useLocalStorage ? "block" : "none"
  10381. };
  10382. h(),
  10383. p.bind(c, "change", function() {
  10384. e.useLocalStorage = !e.useLocalStorage,
  10385. h()
  10386. })
  10387. }
  10388. var u = document.getElementById("dg-new-constructor");
  10389. p.bind(u, "keydown", function(e) {
  10390. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10391. }),
  10392. p.bind(i, "click", function() {
  10393. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10394. S.show(),
  10395. u.focus(),
  10396. u.select()
  10397. }),
  10398. p.bind(n, "click", function() {
  10399. e.save()
  10400. }),
  10401. p.bind(r, "click", function() {
  10402. var t = prompt("Enter a new preset name.");
  10403. t && e.saveAs(t)
  10404. }),
  10405. p.bind(o, "click", function() {
  10406. e.revert()
  10407. })
  10408. }
  10409. function I(e) {
  10410. function t(t) {
  10411. return t.preventDefault(),
  10412. r = t.clientX,
  10413. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10414. p.bind(window, "mousemove", i),
  10415. p.bind(window, "mouseup", n),
  10416. !1
  10417. }
  10418. function i(t) {
  10419. return t.preventDefault(),
  10420. e.width += r - t.clientX,
  10421. e.onResize(),
  10422. r = t.clientX,
  10423. !1
  10424. }
  10425. function n() {
  10426. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10427. p.unbind(window, "mousemove", i),
  10428. p.unbind(window, "mouseup", n)
  10429. }
  10430. e.__resize_handle = document.createElement("div"),
  10431. f.extend(e.__resize_handle.style, {
  10432. width: "6px",
  10433. marginLeft: "-3px",
  10434. height: "200px",
  10435. cursor: "ew-resize",
  10436. position: "absolute"
  10437. });
  10438. var r;
  10439. p.bind(e.__resize_handle, "mousedown", t),
  10440. p.bind(e.__closeButton, "mousedown", t),
  10441. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10442. }
  10443. function E(e, t) {
  10444. e.domElement.style.width = t + "px",
  10445. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10446. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10447. }
  10448. function b(e, t) {
  10449. var i = {};
  10450. return f.each(e.__rememberedObjects, function(n, r) {
  10451. var o = {}
  10452. , a = e.__rememberedObjectIndecesToControllers[r];
  10453. f.each(a, function(e, i) {
  10454. o[i] = t ? e.initialValue : e.getValue()
  10455. }),
  10456. i[r] = o
  10457. }),
  10458. i
  10459. }
  10460. function w(e, t, i) {
  10461. var n = document.createElement("option");
  10462. n.innerHTML = t,
  10463. n.value = t,
  10464. e.__preset_select.appendChild(n),
  10465. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10466. }
  10467. function _(e) {
  10468. for (var t = 0; t < e.__preset_select.length; t++)
  10469. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10470. }
  10471. function T(e, t) {
  10472. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10473. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10474. }
  10475. function x(e) {
  10476. 0 != e.length && u(function() {
  10477. x(e)
  10478. }),
  10479. f.each(e, function(e) {
  10480. e.updateDisplay()
  10481. })
  10482. }
  10483. e.inject(i);
  10484. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10485. try {
  10486. return "localStorage"in window && null !== window.localStorage
  10487. } catch (e) {
  10488. return !1
  10489. }
  10490. }(), N = !0, B = !1, F = [], V = function(e) {
  10491. function t() {
  10492. var e = i.getRoot();
  10493. e.width += 1,
  10494. f.defer(function() {
  10495. e.width -= 1
  10496. })
  10497. }
  10498. var i = this;
  10499. this.domElement = document.createElement("div"),
  10500. this.__ul = document.createElement("ul"),
  10501. this.domElement.appendChild(this.__ul),
  10502. p.addClass(this.domElement, R),
  10503. this.__folders = {},
  10504. this.__controllers = [],
  10505. this.__rememberedObjects = [],
  10506. this.__rememberedObjectIndecesToControllers = [],
  10507. this.__listening = [],
  10508. e = e || {},
  10509. e = f.defaults(e, {
  10510. autoPlace: !0,
  10511. width: V.DEFAULT_WIDTH
  10512. }),
  10513. e = f.defaults(e, {
  10514. resizable: e.autoPlace,
  10515. hideable: e.autoPlace
  10516. }),
  10517. f.isUndefined(e.load) ? e.load = {
  10518. preset: L
  10519. } : e.preset && (e.load.preset = e.preset),
  10520. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10521. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10522. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10523. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10524. if (Object.defineProperties(this, {
  10525. parent: {
  10526. get: function() {
  10527. return e.parent
  10528. }
  10529. },
  10530. scrollable: {
  10531. get: function() {
  10532. return e.scrollable
  10533. }
  10534. },
  10535. autoPlace: {
  10536. get: function() {
  10537. return e.autoPlace
  10538. }
  10539. },
  10540. preset: {
  10541. get: function() {
  10542. return i.parent ? i.getRoot().preset : e.load.preset
  10543. },
  10544. set: function(t) {
  10545. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10546. _(this),
  10547. i.revert()
  10548. }
  10549. },
  10550. width: {
  10551. get: function() {
  10552. return e.width
  10553. },
  10554. set: function(t) {
  10555. e.width = t,
  10556. E(i, t)
  10557. }
  10558. },
  10559. name: {
  10560. get: function() {
  10561. return e.name
  10562. },
  10563. set: function(t) {
  10564. e.name = t,
  10565. a && (a.innerHTML = e.name)
  10566. }
  10567. },
  10568. closed: {
  10569. get: function() {
  10570. return e.closed
  10571. },
  10572. set: function(t) {
  10573. e.closed = t,
  10574. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10575. this.onResize(),
  10576. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10577. }
  10578. },
  10579. load: {
  10580. get: function() {
  10581. return e.load
  10582. }
  10583. },
  10584. useLocalStorage: {
  10585. get: function() {
  10586. return r
  10587. },
  10588. set: function(e) {
  10589. D && (r = e,
  10590. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10591. localStorage.setItem(y(i, "isLocal"), e))
  10592. }
  10593. }
  10594. }),
  10595. f.isUndefined(e.parent)) {
  10596. if (e.closed = !1,
  10597. p.addClass(this.domElement, V.CLASS_MAIN),
  10598. p.makeSelectable(this.domElement, !1),
  10599. D && r) {
  10600. i.useLocalStorage = !0;
  10601. var o = localStorage.getItem(y(this, "gui"));
  10602. o && (e.load = JSON.parse(o))
  10603. }
  10604. this.__closeButton = document.createElement("div"),
  10605. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10606. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10607. this.domElement.appendChild(this.__closeButton),
  10608. p.bind(this.__closeButton, "click", function() {
  10609. i.closed = !i.closed
  10610. })
  10611. } else {
  10612. void 0 === e.closed && (e.closed = !0);
  10613. var a = document.createTextNode(e.name);
  10614. p.addClass(a, "controller-name");
  10615. var s = m(i, a)
  10616. , l = function(e) {
  10617. return e.preventDefault(),
  10618. i.closed = !i.closed,
  10619. !1
  10620. };
  10621. p.addClass(this.__ul, V.CLASS_CLOSED),
  10622. p.addClass(s, "title"),
  10623. p.bind(s, "click", l),
  10624. e.closed || (this.closed = !1)
  10625. }
  10626. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10627. p.addClass(M, R),
  10628. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10629. document.body.appendChild(M),
  10630. N = !1),
  10631. M.appendChild(this.domElement),
  10632. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10633. this.parent || E(i, e.width)),
  10634. p.bind(window, "resize", function() {
  10635. i.onResize()
  10636. }),
  10637. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10638. i.onResize()
  10639. }),
  10640. p.bind(this.__ul, "transitionend", function() {
  10641. i.onResize()
  10642. }),
  10643. p.bind(this.__ul, "oTransitionEnd", function() {
  10644. i.onResize()
  10645. }),
  10646. this.onResize(),
  10647. e.resizable && I(this),
  10648. n = function() {
  10649. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10650. }
  10651. ,
  10652. this.saveToLocalStorageIfPossible = n;
  10653. i.getRoot();
  10654. e.parent || t()
  10655. };
  10656. return V.toggleHide = function() {
  10657. B = !B,
  10658. f.each(F, function(e) {
  10659. e.domElement.style.zIndex = B ? -999 : 999,
  10660. e.domElement.style.opacity = B ? 0 : 1
  10661. })
  10662. }
  10663. ,
  10664. V.CLASS_AUTO_PLACE = "a",
  10665. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10666. V.CLASS_MAIN = "main",
  10667. V.CLASS_CONTROLLER_ROW = "cr",
  10668. V.CLASS_TOO_TALL = "taller-than-window",
  10669. V.CLASS_CLOSED = "closed",
  10670. V.CLASS_CLOSE_BUTTON = "close-button",
  10671. V.CLASS_DRAG = "drag",
  10672. V.DEFAULT_WIDTH = 245,
  10673. V.TEXT_CLOSED = "Close Controls",
  10674. V.TEXT_OPEN = "Open Controls",
  10675. p.bind(window, "keydown", function(e) {
  10676. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10677. }, !1),
  10678. f.extend(V.prototype, {
  10679. add: function(e, t) {
  10680. return g(this, e, t, {
  10681. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10682. })
  10683. },
  10684. addColor: function(e, t) {
  10685. return g(this, e, t, {
  10686. color: !0
  10687. })
  10688. },
  10689. remove: function(e) {
  10690. this.__ul.removeChild(e.__li),
  10691. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10692. var t = this;
  10693. f.defer(function() {
  10694. t.onResize()
  10695. })
  10696. },
  10697. destroy: function() {
  10698. this.autoPlace && M.removeChild(this.domElement)
  10699. },
  10700. addFolder: function(e) {
  10701. if (void 0 !== this.__folders[e])
  10702. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10703. var t = {
  10704. name: e,
  10705. parent: this
  10706. };
  10707. t.autoPlace = this.autoPlace,
  10708. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10709. t.load = this.load.folders[e]);
  10710. var i = new V(t);
  10711. this.__folders[e] = i;
  10712. var n = m(this, i.domElement);
  10713. return p.addClass(n, "folder"),
  10714. i
  10715. },
  10716. open: function() {
  10717. this.closed = !1
  10718. },
  10719. close: function() {
  10720. this.closed = !0
  10721. },
  10722. onResize: function() {
  10723. var e = this.getRoot();
  10724. if (e.scrollable) {
  10725. var t = p.getOffset(e.__ul).top
  10726. , i = 0;
  10727. f.each(e.__ul.childNodes, function(t) {
  10728. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10729. }),
  10730. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10731. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10732. e.__ul.style.height = "auto")
  10733. }
  10734. e.__resize_handle && f.defer(function() {
  10735. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10736. }),
  10737. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10738. },
  10739. remember: function() {
  10740. if (f.isUndefined(S) && (S = new d,
  10741. S.domElement.innerHTML = t),
  10742. this.parent)
  10743. throw new Error("You can only call remember on a top level GUI.");
  10744. var e = this;
  10745. f.each(Array.prototype.slice.call(arguments), function(t) {
  10746. 0 == e.__rememberedObjects.length && C(e),
  10747. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10748. }),
  10749. this.autoPlace && E(this, this.width)
  10750. },
  10751. getRoot: function() {
  10752. for (var e = this; e.parent; )
  10753. e = e.parent;
  10754. return e
  10755. },
  10756. getSaveObject: function() {
  10757. var e = this.load;
  10758. return e.closed = this.closed,
  10759. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  10760. e.remembered || (e.remembered = {}),
  10761. e.remembered[this.preset] = b(this)),
  10762. e.folders = {},
  10763. f.each(this.__folders, function(t, i) {
  10764. e.folders[i] = t.getSaveObject()
  10765. }),
  10766. e
  10767. },
  10768. save: function() {
  10769. this.load.remembered || (this.load.remembered = {}),
  10770. this.load.remembered[this.preset] = b(this),
  10771. T(this, !1),
  10772. this.saveToLocalStorageIfPossible()
  10773. },
  10774. saveAs: function(e) {
  10775. this.load.remembered || (this.load.remembered = {},
  10776. this.load.remembered[L] = b(this, !0)),
  10777. this.load.remembered[e] = b(this),
  10778. this.preset = e,
  10779. w(this, e, !0),
  10780. this.saveToLocalStorageIfPossible()
  10781. },
  10782. revert: function(e) {
  10783. f.each(this.__controllers, function(t) {
  10784. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  10785. }, this),
  10786. f.each(this.__folders, function(e) {
  10787. e.revert(e)
  10788. }),
  10789. e || T(this.getRoot(), !1)
  10790. },
  10791. listen: function(e) {
  10792. var t = 0 == this.__listening.length;
  10793. this.__listening.push(e),
  10794. t && x(this.__listening)
  10795. }
  10796. }),
  10797. V
  10798. }(n.utils.css, '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>', ".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n", n.controllers.factory = function(e, t, i, n, r, o, a) {
  10799. return function(s, l) {
  10800. var c = s[l];
  10801. return a.isArray(arguments[2]) || a.isObject(arguments[2]) ? new e(s,l,arguments[2]) : a.isNumber(c) ? a.isNumber(arguments[2]) && a.isNumber(arguments[3]) ? new i(s,l,arguments[2],arguments[3]) : new t(s,l,{
  10802. min: arguments[2],
  10803. max: arguments[3]
  10804. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  10805. }
  10806. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  10807. var n = function(e, i) {
  10808. function r() {
  10809. a.setValue(a.__input.value)
  10810. }
  10811. function o() {
  10812. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  10813. }
  10814. n.superclass.call(this, e, i);
  10815. var a = this;
  10816. this.__input = document.createElement("input"),
  10817. this.__input.setAttribute("type", "text"),
  10818. t.bind(this.__input, "keyup", r),
  10819. t.bind(this.__input, "change", r),
  10820. t.bind(this.__input, "blur", o),
  10821. t.bind(this.__input, "keydown", function(e) {
  10822. 13 === e.keyCode && this.blur()
  10823. }),
  10824. this.updateDisplay(),
  10825. this.domElement.appendChild(this.__input)
  10826. };
  10827. return n.superclass = e,
  10828. i.extend(n.prototype, e.prototype, {
  10829. updateDisplay: function() {
  10830. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  10831. n.superclass.prototype.updateDisplay.call(this)
  10832. }
  10833. }),
  10834. n
  10835. }(n.controllers.Controller, n.dom.dom, n.utils.common), n.controllers.FunctionController, n.controllers.BooleanController, n.utils.common), n.controllers.Controller, n.controllers.BooleanController, n.controllers.FunctionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.OptionController, n.controllers.ColorController = function(e, t, i, n, r) {
  10836. function o(e, t, i, n) {
  10837. e.style.background = "",
  10838. r.each(l, function(r) {
  10839. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  10840. })
  10841. }
  10842. function a(e) {
  10843. e.style.background = "",
  10844. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10845. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10846. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10847. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10848. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10849. }
  10850. var s = function(e, l) {
  10851. function c(e) {
  10852. p(e),
  10853. t.bind(window, "mousemove", p),
  10854. t.bind(window, "mouseup", h)
  10855. }
  10856. function h() {
  10857. t.unbind(window, "mousemove", p),
  10858. t.unbind(window, "mouseup", h)
  10859. }
  10860. function u() {
  10861. var e = n(this.value);
  10862. e !== !1 ? (g.__color.__state = e,
  10863. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  10864. }
  10865. function d() {
  10866. t.unbind(window, "mousemove", f),
  10867. t.unbind(window, "mouseup", d)
  10868. }
  10869. function p(e) {
  10870. e.preventDefault();
  10871. var i = t.getWidth(g.__saturation_field)
  10872. , n = t.getOffset(g.__saturation_field)
  10873. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  10874. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10875. return o > 1 ? o = 1 : o < 0 && (o = 0),
  10876. r > 1 ? r = 1 : r < 0 && (r = 0),
  10877. g.__color.v = o,
  10878. g.__color.s = r,
  10879. g.setValue(g.__color.toOriginal()),
  10880. !1
  10881. }
  10882. function f(e) {
  10883. e.preventDefault();
  10884. var i = t.getHeight(g.__hue_field)
  10885. , n = t.getOffset(g.__hue_field)
  10886. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10887. return r > 1 ? r = 1 : r < 0 && (r = 0),
  10888. g.__color.h = 360 * r,
  10889. g.setValue(g.__color.toOriginal()),
  10890. !1
  10891. }
  10892. s.superclass.call(this, e, l),
  10893. this.__color = new i(this.getValue()),
  10894. this.__temp = new i(0);
  10895. var g = this;
  10896. this.domElement = document.createElement("div"),
  10897. t.makeSelectable(this.domElement, !1),
  10898. this.__selector = document.createElement("div"),
  10899. this.__selector.className = "selector",
  10900. this.__saturation_field = document.createElement("div"),
  10901. this.__saturation_field.className = "saturation-field",
  10902. this.__field_knob = document.createElement("div"),
  10903. this.__field_knob.className = "field-knob",
  10904. this.__field_knob_border = "2px solid ",
  10905. this.__hue_knob = document.createElement("div"),
  10906. this.__hue_knob.className = "hue-knob",
  10907. this.__hue_field = document.createElement("div"),
  10908. this.__hue_field.className = "hue-field",
  10909. this.__input = document.createElement("input"),
  10910. this.__input.type = "text",
  10911. this.__input_textShadow = "0 1px 1px ",
  10912. t.bind(this.__input, "keydown", function(e) {
  10913. 13 === e.keyCode && u.call(this)
  10914. }),
  10915. t.bind(this.__input, "blur", u),
  10916. t.bind(this.__selector, "mousedown", function(e) {
  10917. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10918. t.removeClass(g.__selector, "drag")
  10919. })
  10920. });
  10921. var m = document.createElement("div");
  10922. r.extend(this.__selector.style, {
  10923. width: "122px",
  10924. height: "102px",
  10925. padding: "3px",
  10926. backgroundColor: "#222",
  10927. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10928. }),
  10929. r.extend(this.__field_knob.style, {
  10930. position: "absolute",
  10931. width: "12px",
  10932. height: "12px",
  10933. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10934. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10935. borderRadius: "12px",
  10936. zIndex: 1
  10937. }),
  10938. r.extend(this.__hue_knob.style, {
  10939. position: "absolute",
  10940. width: "15px",
  10941. height: "2px",
  10942. borderRight: "4px solid #fff",
  10943. zIndex: 1
  10944. }),
  10945. r.extend(this.__saturation_field.style, {
  10946. width: "100px",
  10947. height: "100px",
  10948. border: "1px solid #555",
  10949. marginRight: "3px",
  10950. display: "inline-block",
  10951. cursor: "pointer"
  10952. }),
  10953. r.extend(m.style, {
  10954. width: "100%",
  10955. height: "100%",
  10956. background: "none"
  10957. }),
  10958. o(m, "top", "rgba(0,0,0,0)", "#000"),
  10959. r.extend(this.__hue_field.style, {
  10960. width: "15px",
  10961. height: "100px",
  10962. display: "inline-block",
  10963. border: "1px solid #555",
  10964. cursor: "ns-resize"
  10965. }),
  10966. a(this.__hue_field),
  10967. r.extend(this.__input.style, {
  10968. outline: "none",
  10969. textAlign: "center",
  10970. color: "#fff",
  10971. border: 0,
  10972. fontWeight: "bold",
  10973. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10974. }),
  10975. t.bind(this.__saturation_field, "mousedown", c),
  10976. t.bind(this.__field_knob, "mousedown", c),
  10977. t.bind(this.__hue_field, "mousedown", function(e) {
  10978. f(e),
  10979. t.bind(window, "mousemove", f),
  10980. t.bind(window, "mouseup", d)
  10981. }),
  10982. this.__saturation_field.appendChild(m),
  10983. this.__selector.appendChild(this.__field_knob),
  10984. this.__selector.appendChild(this.__saturation_field),
  10985. this.__selector.appendChild(this.__hue_field),
  10986. this.__hue_field.appendChild(this.__hue_knob),
  10987. this.domElement.appendChild(this.__input),
  10988. this.domElement.appendChild(this.__selector),
  10989. this.updateDisplay()
  10990. };
  10991. s.superclass = e,
  10992. r.extend(s.prototype, e.prototype, {
  10993. updateDisplay: function() {
  10994. var e = n(this.getValue());
  10995. if (e !== !1) {
  10996. var t = !1;
  10997. r.each(i.COMPONENTS, function(i) {
  10998. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  10999. return t = !0,
  11000. {}
  11001. }, this),
  11002. t && r.extend(this.__color.__state, e)
  11003. }
  11004. r.extend(this.__temp.__state, this.__color.__state),
  11005. this.__temp.a = 1;
  11006. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11007. , s = 255 - a;
  11008. r.extend(this.__field_knob.style, {
  11009. marginLeft: 100 * this.__color.s - 7 + "px",
  11010. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11011. backgroundColor: this.__temp.toString(),
  11012. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11013. }),
  11014. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11015. this.__temp.s = 1,
  11016. this.__temp.v = 1,
  11017. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11018. r.extend(this.__input.style, {
  11019. backgroundColor: this.__input.value = this.__color.toString(),
  11020. color: "rgb(" + a + "," + a + "," + a + ")",
  11021. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11022. })
  11023. }
  11024. });
  11025. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11026. return s
  11027. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11028. function r(e, t, i) {
  11029. Object.defineProperty(e, t, {
  11030. get: function() {
  11031. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11032. this.__state[t])
  11033. },
  11034. set: function(e) {
  11035. "RGB" !== this.__state.space && (a(this, t, i),
  11036. this.__state.space = "RGB"),
  11037. this.__state[t] = e
  11038. }
  11039. })
  11040. }
  11041. function o(e, t) {
  11042. Object.defineProperty(e, t, {
  11043. get: function() {
  11044. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11045. this.__state[t])
  11046. },
  11047. set: function(e) {
  11048. "HSV" !== this.__state.space && (s(this),
  11049. this.__state.space = "HSV"),
  11050. this.__state[t] = e
  11051. }
  11052. })
  11053. }
  11054. function a(e, i, r) {
  11055. if ("HEX" === e.__state.space)
  11056. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11057. else {
  11058. if ("HSV" !== e.__state.space)
  11059. throw "Corrupted color state";
  11060. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11061. }
  11062. }
  11063. function s(e) {
  11064. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11065. n.extend(e.__state, {
  11066. s: i.s,
  11067. v: i.v
  11068. }),
  11069. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11070. }
  11071. var l = function() {
  11072. if (this.__state = e.apply(this, arguments),
  11073. this.__state === !1)
  11074. throw "Failed to interpret color arguments";
  11075. this.__state.a = this.__state.a || 1
  11076. };
  11077. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11078. n.extend(l.prototype, {
  11079. toString: function() {
  11080. return i(this)
  11081. },
  11082. toOriginal: function() {
  11083. return this.__state.conversion.write(this)
  11084. }
  11085. }),
  11086. r(l.prototype, "r", 2),
  11087. r(l.prototype, "g", 1),
  11088. r(l.prototype, "b", 0),
  11089. o(l.prototype, "h"),
  11090. o(l.prototype, "s"),
  11091. o(l.prototype, "v"),
  11092. Object.defineProperty(l.prototype, "a", {
  11093. get: function() {
  11094. return this.__state.a
  11095. },
  11096. set: function(e) {
  11097. this.__state.a = e
  11098. }
  11099. }),
  11100. Object.defineProperty(l.prototype, "hex", {
  11101. get: function() {
  11102. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11103. this.__state.hex
  11104. },
  11105. set: function(e) {
  11106. this.__state.space = "HEX",
  11107. this.__state.hex = e
  11108. }
  11109. }),
  11110. l
  11111. }(n.color.interpret, n.color.math = function() {
  11112. var e;
  11113. return {
  11114. hsv_to_rgb: function(e, t, i) {
  11115. var n = Math.floor(e / 60) % 6
  11116. , r = e / 60 - Math.floor(e / 60)
  11117. , o = i * (1 - t)
  11118. , a = i * (1 - r * t)
  11119. , s = i * (1 - (1 - r) * t)
  11120. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11121. return {
  11122. r: 255 * l[0],
  11123. g: 255 * l[1],
  11124. b: 255 * l[2]
  11125. }
  11126. },
  11127. rgb_to_hsv: function(e, t, i) {
  11128. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11129. return 0 == a ? {
  11130. h: NaN,
  11131. s: 0,
  11132. v: 0
  11133. } : (r = s / a,
  11134. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11135. n /= 6,
  11136. n < 0 && (n += 1),
  11137. {
  11138. h: 360 * n,
  11139. s: r,
  11140. v: a / 255
  11141. })
  11142. },
  11143. rgb_to_hex: function(e, t, i) {
  11144. var n = this.hex_with_component(0, 2, e);
  11145. return n = this.hex_with_component(n, 1, t),
  11146. n = this.hex_with_component(n, 0, i)
  11147. },
  11148. component_from_hex: function(e, t) {
  11149. return e >> 8 * t & 255
  11150. },
  11151. hex_with_component: function(t, i, n) {
  11152. return n << (e = 8 * i) | t & ~(255 << e)
  11153. }
  11154. }
  11155. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11156. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11157. window.setTimeout(e, 1e3 / 60)
  11158. }
  11159. }(), n.dom.CenteredDiv = function(e, t) {
  11160. var i = function() {
  11161. this.backgroundElement = document.createElement("div"),
  11162. t.extend(this.backgroundElement.style, {
  11163. backgroundColor: "rgba(0,0,0,0.8)",
  11164. top: 0,
  11165. left: 0,
  11166. display: "none",
  11167. zIndex: "1000",
  11168. opacity: 0,
  11169. WebkitTransition: "opacity 0.2s linear"
  11170. }),
  11171. e.makeFullscreen(this.backgroundElement),
  11172. this.backgroundElement.style.position = "fixed",
  11173. this.domElement = document.createElement("div"),
  11174. t.extend(this.domElement.style, {
  11175. position: "fixed",
  11176. display: "none",
  11177. zIndex: "1001",
  11178. opacity: 0,
  11179. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11180. }),
  11181. document.body.appendChild(this.backgroundElement),
  11182. document.body.appendChild(this.domElement);
  11183. var i = this;
  11184. e.bind(this.backgroundElement, "click", function() {
  11185. i.hide()
  11186. })
  11187. };
  11188. return i.prototype.show = function() {
  11189. var e = this;
  11190. this.backgroundElement.style.display = "block",
  11191. this.domElement.style.display = "block",
  11192. this.domElement.style.opacity = 0,
  11193. this.domElement.style.webkitTransform = "scale(1.1)",
  11194. this.layout(),
  11195. t.defer(function() {
  11196. e.backgroundElement.style.opacity = 1,
  11197. e.domElement.style.opacity = 1,
  11198. e.domElement.style.webkitTransform = "scale(1)"
  11199. })
  11200. }
  11201. ,
  11202. i.prototype.hide = function() {
  11203. var t = this
  11204. , i = function() {
  11205. t.domElement.style.display = "none",
  11206. t.backgroundElement.style.display = "none",
  11207. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11208. e.unbind(t.domElement, "transitionend", i),
  11209. e.unbind(t.domElement, "oTransitionEnd", i)
  11210. };
  11211. e.bind(this.domElement, "webkitTransitionEnd", i),
  11212. e.bind(this.domElement, "transitionend", i),
  11213. e.bind(this.domElement, "oTransitionEnd", i),
  11214. this.backgroundElement.style.opacity = 0,
  11215. this.domElement.style.opacity = 0,
  11216. this.domElement.style.webkitTransform = "scale(1.1)"
  11217. }
  11218. ,
  11219. i.prototype.layout = function() {
  11220. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11221. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11222. }
  11223. ,
  11224. i
  11225. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11226. }
  11227. , {}],
  11228. 94: [function(e, t, i) {
  11229. (function(e) {
  11230. "use strict";
  11231. function i(t) {
  11232. function i(e) {
  11233. 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++) {
  11234. var n = _((t[i] * e + 50) / 100);
  11235. n < 1 ? n = 1 : n > 255 && (n = 255),
  11236. T[G[i]] = n
  11237. }
  11238. 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++) {
  11239. var a = _((r[o] * e + 50) / 100);
  11240. a < 1 ? a = 1 : a > 255 && (a = 255),
  11241. x[G[o]] = a
  11242. }
  11243. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11244. for (var h = 0; h < 8; h++)
  11245. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11246. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11247. l++
  11248. }
  11249. function n(e, t) {
  11250. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11251. for (var a = 1; a <= e[o]; a++)
  11252. r[t[n]] = [],
  11253. r[t[n]][0] = i,
  11254. r[t[n]][1] = o,
  11255. n++,
  11256. i++;
  11257. i *= 2
  11258. }
  11259. return r
  11260. }
  11261. function r() {
  11262. C = n(z, W),
  11263. I = n(X, Z),
  11264. E = n(j, Y),
  11265. b = n(q, K)
  11266. }
  11267. function o() {
  11268. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11269. for (var n = e; n < t; n++)
  11270. P[32767 + n] = i,
  11271. R[32767 + n] = [],
  11272. R[32767 + n][1] = i,
  11273. R[32767 + n][0] = n;
  11274. for (var r = -(t - 1); r <= -e; r++)
  11275. P[32767 + r] = i,
  11276. R[32767 + r] = [],
  11277. R[32767 + r][1] = i,
  11278. R[32767 + r][0] = t - 1 + r;
  11279. e <<= 1,
  11280. t <<= 1
  11281. }
  11282. }
  11283. function a() {
  11284. for (var e = 0; e < 256; e++)
  11285. H[e] = 19595 * e,
  11286. H[e + 256 >> 0] = 38470 * e,
  11287. H[e + 512 >> 0] = 7471 * e + 32768,
  11288. H[e + 768 >> 0] = -11059 * e,
  11289. H[e + 1024 >> 0] = -21709 * e,
  11290. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11291. H[e + 1536 >> 0] = -27439 * e,
  11292. H[e + 1792 >> 0] = -5329 * e
  11293. }
  11294. function s(e) {
  11295. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11296. t & 1 << i && (N |= 1 << B),
  11297. i--,
  11298. B--,
  11299. B < 0 && (255 == N ? (l(255),
  11300. l(0)) : l(N),
  11301. B = 7,
  11302. N = 0)
  11303. }
  11304. function l(e) {
  11305. D.push(e)
  11306. }
  11307. function c(e) {
  11308. l(e >> 8 & 255),
  11309. l(255 & e)
  11310. }
  11311. function h(e, t) {
  11312. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11313. for (h = 0; h < d; ++h) {
  11314. i = e[u],
  11315. n = e[u + 1],
  11316. r = e[u + 2],
  11317. o = e[u + 3],
  11318. a = e[u + 4],
  11319. s = e[u + 5],
  11320. l = e[u + 6],
  11321. c = e[u + 7];
  11322. var f = i + c
  11323. , g = i - c
  11324. , m = n + l
  11325. , v = n - l
  11326. , A = r + s
  11327. , y = r - s
  11328. , C = o + a
  11329. , I = o - a
  11330. , E = f + C
  11331. , b = f - C
  11332. , w = m + A
  11333. , _ = m - A;
  11334. e[u] = E + w,
  11335. e[u + 4] = E - w;
  11336. var T = .707106781 * (_ + b);
  11337. e[u + 2] = b + T,
  11338. e[u + 6] = b - T,
  11339. E = I + y,
  11340. w = y + v,
  11341. _ = v + g;
  11342. var x = .382683433 * (E - _)
  11343. , S = .5411961 * E + x
  11344. , M = 1.306562965 * _ + x
  11345. , R = .707106781 * w
  11346. , P = g + R
  11347. , L = g - R;
  11348. e[u + 5] = L + S,
  11349. e[u + 3] = L - S,
  11350. e[u + 1] = P + M,
  11351. e[u + 7] = P - M,
  11352. u += 8
  11353. }
  11354. for (u = 0,
  11355. h = 0; h < d; ++h) {
  11356. i = e[u],
  11357. n = e[u + 8],
  11358. r = e[u + 16],
  11359. o = e[u + 24],
  11360. a = e[u + 32],
  11361. s = e[u + 40],
  11362. l = e[u + 48],
  11363. c = e[u + 56];
  11364. var D = i + c
  11365. , N = i - c
  11366. , B = n + l
  11367. , F = n - l
  11368. , V = r + s
  11369. , U = r - s
  11370. , k = o + a
  11371. , H = o - a
  11372. , G = D + k
  11373. , z = D - k
  11374. , W = B + V
  11375. , j = B - V;
  11376. e[u] = G + W,
  11377. e[u + 32] = G - W;
  11378. var Y = .707106781 * (j + z);
  11379. e[u + 16] = z + Y,
  11380. e[u + 48] = z - Y,
  11381. G = H + U,
  11382. W = U + F,
  11383. j = F + N;
  11384. var X = .382683433 * (G - j)
  11385. , Z = .5411961 * G + X
  11386. , q = 1.306562965 * j + X
  11387. , K = .707106781 * W
  11388. , Q = N + K
  11389. , J = N - K;
  11390. e[u + 40] = J + Z,
  11391. e[u + 24] = J - Z,
  11392. e[u + 8] = Q + q,
  11393. e[u + 56] = Q - q,
  11394. u++
  11395. }
  11396. var $;
  11397. for (h = 0; h < p; ++h)
  11398. $ = e[h] * t[h],
  11399. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11400. return O
  11401. }
  11402. function u() {
  11403. c(65504),
  11404. c(16),
  11405. l(74),
  11406. l(70),
  11407. l(73),
  11408. l(70),
  11409. l(0),
  11410. l(1),
  11411. l(1),
  11412. l(0),
  11413. c(1),
  11414. c(1),
  11415. l(0),
  11416. l(0)
  11417. }
  11418. function d(e, t) {
  11419. c(65472),
  11420. c(17),
  11421. l(8),
  11422. c(t),
  11423. c(e),
  11424. l(3),
  11425. l(1),
  11426. l(17),
  11427. l(0),
  11428. l(2),
  11429. l(17),
  11430. l(1),
  11431. l(3),
  11432. l(17),
  11433. l(1)
  11434. }
  11435. function p() {
  11436. c(65499),
  11437. c(132),
  11438. l(0);
  11439. for (var e = 0; e < 64; e++)
  11440. l(T[e]);
  11441. l(1);
  11442. for (var t = 0; t < 64; t++)
  11443. l(x[t])
  11444. }
  11445. function f() {
  11446. c(65476),
  11447. c(418),
  11448. l(0);
  11449. for (var e = 0; e < 16; e++)
  11450. l(z[e + 1]);
  11451. for (var t = 0; t <= 11; t++)
  11452. l(W[t]);
  11453. l(16);
  11454. for (var i = 0; i < 16; i++)
  11455. l(j[i + 1]);
  11456. for (var n = 0; n <= 161; n++)
  11457. l(Y[n]);
  11458. l(1);
  11459. for (var r = 0; r < 16; r++)
  11460. l(X[r + 1]);
  11461. for (var o = 0; o <= 11; o++)
  11462. l(Z[o]);
  11463. l(17);
  11464. for (var a = 0; a < 16; a++)
  11465. l(q[a + 1]);
  11466. for (var s = 0; s <= 161; s++)
  11467. l(K[s])
  11468. }
  11469. function g() {
  11470. c(65498),
  11471. c(12),
  11472. l(3),
  11473. l(1),
  11474. l(0),
  11475. l(2),
  11476. l(17),
  11477. l(3),
  11478. l(17),
  11479. l(0),
  11480. l(63),
  11481. l(0)
  11482. }
  11483. function m(e, t, i, n, r) {
  11484. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11485. L[G[f]] = p[f];
  11486. var g = L[0] - i;
  11487. i = L[0],
  11488. 0 == g ? s(n[0]) : (o = 32767 + g,
  11489. s(n[P[o]]),
  11490. s(R[o]));
  11491. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11492. ;
  11493. if (0 == m)
  11494. return s(a),
  11495. i;
  11496. for (var v, A = 1; A <= m; ) {
  11497. for (var y = A; 0 == L[A] && A <= m; ++A)
  11498. ;
  11499. var C = A - y;
  11500. if (C >= c) {
  11501. v = C >> 4;
  11502. for (var I = 1; I <= v; ++I)
  11503. s(l);
  11504. C &= 15
  11505. }
  11506. o = 32767 + L[A],
  11507. s(r[(C << 4) + P[o]]),
  11508. s(R[o]),
  11509. A++
  11510. }
  11511. return m != u && s(a),
  11512. i
  11513. }
  11514. function v() {
  11515. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11516. k[t] = e(t)
  11517. }
  11518. function A(e) {
  11519. if (e <= 0 && (e = 1),
  11520. e > 100 && (e = 100),
  11521. w != e) {
  11522. var t = 0;
  11523. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11524. i(t),
  11525. w = e
  11526. }
  11527. }
  11528. function y() {
  11529. var e = (new Date).getTime();
  11530. t || (t = 50),
  11531. v(),
  11532. r(),
  11533. o(),
  11534. a(),
  11535. A(t);
  11536. (new Date).getTime() - e
  11537. }
  11538. var C, I, E, b, w, _ = (Math.round,
  11539. Math.floor), T = new Array(64), x = new Array(64), S = new Array(64), M = new Array(64), R = new Array(65535), P = new Array(65535), O = new Array(64), L = new Array(64), D = [], N = 0, B = 7, F = new Array(64), V = new Array(64), U = new Array(64), k = new Array(256), H = new Array(2048), G = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  11540. this.encode = function(t, i) {
  11541. var n = ((new Date).getTime(),
  11542. i.quality);
  11543. n && A(n),
  11544. D = new Array,
  11545. N = 0,
  11546. B = 7,
  11547. c(65496),
  11548. u(),
  11549. p(),
  11550. d(t.width, t.height),
  11551. f(),
  11552. g();
  11553. var r = 0
  11554. , o = 0
  11555. , a = 0;
  11556. N = 0,
  11557. B = 7,
  11558. this.encode.displayName = "_encode_";
  11559. for (var l, h, v, y, w, _, T, x, R, P = t.data, O = t.width, L = t.height, k = i.flipY, G = 4 * O, z = k ? L : 0, W = k ? -8 : 8; k && z > 0 || !k && z < L; ) {
  11560. for (l = 0; l < G; ) {
  11561. for (w = G * z + l,
  11562. _ = w,
  11563. T = -1,
  11564. x = 0,
  11565. R = 0; R < 64; R++)
  11566. x = (k ? 63 - R : R) >> 3,
  11567. T = 4 * (7 & R),
  11568. _ = w + x * G + T,
  11569. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11570. l + T >= G && (_ -= l + T - G + 4),
  11571. h = P[_++],
  11572. v = P[_++],
  11573. y = P[_++],
  11574. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11575. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11576. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11577. r = m(F, S, r, C, E),
  11578. o = m(V, M, o, I, b),
  11579. a = m(U, M, a, I, b),
  11580. l += 32
  11581. }
  11582. z += W
  11583. }
  11584. if (B >= 0) {
  11585. var j = [];
  11586. j[1] = B + 1,
  11587. j[0] = (1 << B + 1) - 1,
  11588. s(j)
  11589. }
  11590. return c(65497),
  11591. new e(D)
  11592. }
  11593. ,
  11594. y()
  11595. }
  11596. function n(e, t) {
  11597. t = t || {},
  11598. t.quality = t.quality || 50;
  11599. var n = t.quality
  11600. , r = new i(n)
  11601. , o = r.encode(e, t);
  11602. return {
  11603. data: o,
  11604. width: e.width,
  11605. height: e.height
  11606. }
  11607. }
  11608. t.exports.encode = n
  11609. }
  11610. ).call(this, e("buffer").Buffer)
  11611. }
  11612. , {
  11613. buffer: 198
  11614. }],
  11615. 95: [function(e, t, i) {
  11616. "use strict";
  11617. !function() {
  11618. if ("performance"in window == !1 && (window.performance = {}),
  11619. Date.now = Date.now || function() {
  11620. return (new Date).getTime()
  11621. }
  11622. ,
  11623. "now"in window.performance == !1) {
  11624. var e = Date.now();
  11625. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11626. window.performance.now = function() {
  11627. return Date.now() - e
  11628. }
  11629. }
  11630. }()
  11631. }
  11632. , {}],
  11633. 96: [function(e, t, i) {
  11634. "use strict";
  11635. var n = e("three");
  11636. n.EffectComposer = function(e, t) {
  11637. if (this.renderer = e,
  11638. void 0 === t) {
  11639. var i = {
  11640. minFilter: n.LinearFilter,
  11641. magFilter: n.LinearFilter,
  11642. format: n.RGBAFormat,
  11643. stencilBuffer: !1
  11644. }
  11645. , r = e.getSize();
  11646. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11647. }
  11648. this.renderTarget1 = t,
  11649. this.renderTarget2 = t.clone(),
  11650. this.writeBuffer = this.renderTarget1,
  11651. this.readBuffer = this.renderTarget2,
  11652. this.passes = [],
  11653. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11654. this.copyPass = new n.ShaderPass(n.CopyShader)
  11655. }
  11656. ,
  11657. n.EffectComposer.prototype = {
  11658. swapBuffers: function() {
  11659. var e = this.readBuffer;
  11660. this.readBuffer = this.writeBuffer,
  11661. this.writeBuffer = e
  11662. },
  11663. addPass: function(e) {
  11664. this.passes.push(e)
  11665. },
  11666. insertPass: function(e, t) {
  11667. this.passes.splice(t, 0, e)
  11668. },
  11669. render: function(e) {
  11670. this.writeBuffer = this.renderTarget1,
  11671. this.readBuffer = this.renderTarget2;
  11672. var t, i, r = !1, o = this.passes.length;
  11673. for (i = 0; i < o; i++)
  11674. if (t = this.passes[i],
  11675. t.enabled) {
  11676. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11677. t.needsSwap) {
  11678. if (r) {
  11679. var a = this.renderer.context;
  11680. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11681. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11682. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11683. }
  11684. this.swapBuffers()
  11685. }
  11686. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11687. }
  11688. },
  11689. reset: function(e) {
  11690. if (void 0 === e) {
  11691. var t = this.renderer.getSize();
  11692. e = this.renderTarget1.clone(),
  11693. e.setSize(t.width, t.height)
  11694. }
  11695. this.renderTarget1.dispose(),
  11696. this.renderTarget2.dispose(),
  11697. this.renderTarget1 = e,
  11698. this.renderTarget2 = e.clone(),
  11699. this.writeBuffer = this.renderTarget1,
  11700. this.readBuffer = this.renderTarget2
  11701. },
  11702. setSize: function(e, t) {
  11703. this.renderTarget1.setSize(e, t),
  11704. this.renderTarget2.setSize(e, t)
  11705. }
  11706. }
  11707. }
  11708. , {
  11709. three: 217
  11710. }],
  11711. 97: [function(e, t, i) {
  11712. "use strict";
  11713. var n = e("three");
  11714. n.MaskPass = function(e, t) {
  11715. this.scene = e,
  11716. this.camera = t,
  11717. this.enabled = !0,
  11718. this.clear = !0,
  11719. this.needsSwap = !1,
  11720. this.inverse = !1
  11721. }
  11722. ,
  11723. n.MaskPass.prototype = {
  11724. render: function(e, t, i, n) {
  11725. var r = e.context;
  11726. r.colorMask(!1, !1, !1, !1),
  11727. r.depthMask(!1);
  11728. var o, a;
  11729. this.inverse ? (o = 0,
  11730. a = 1) : (o = 1,
  11731. a = 0),
  11732. r.enable(r.STENCIL_TEST),
  11733. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11734. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11735. r.clearStencil(a),
  11736. e.render(this.scene, this.camera, i, this.clear),
  11737. e.render(this.scene, this.camera, t, this.clear),
  11738. r.colorMask(!0, !0, !0, !0),
  11739. r.depthMask(!0),
  11740. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11741. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11742. }
  11743. },
  11744. n.ClearMaskPass = function() {
  11745. this.enabled = !0
  11746. }
  11747. ,
  11748. n.ClearMaskPass.prototype = {
  11749. render: function(e, t, i, n) {
  11750. var r = e.context;
  11751. r.disable(r.STENCIL_TEST)
  11752. }
  11753. }
  11754. }
  11755. , {
  11756. three: 217
  11757. }],
  11758. 98: [function(e, t, i) {
  11759. "use strict";
  11760. var n = e("three");
  11761. n.RenderPass = function(e, t, i, r, o) {
  11762. this.scene = e,
  11763. this.camera = t,
  11764. this.overrideMaterial = i,
  11765. this.clearColor = r,
  11766. this.clearAlpha = void 0 !== o ? o : 1,
  11767. this.oldClearColor = new n.Color,
  11768. this.oldClearAlpha = 1,
  11769. this.enabled = !0,
  11770. this.clear = !0,
  11771. this.needsSwap = !1
  11772. }
  11773. ,
  11774. n.RenderPass.prototype = {
  11775. render: function(e, t, i, n) {
  11776. this.scene.overrideMaterial = this.overrideMaterial,
  11777. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11778. this.oldClearAlpha = e.getClearAlpha(),
  11779. e.setClearColor(this.clearColor, this.clearAlpha)),
  11780. e.render(this.scene, this.camera, i, this.clear),
  11781. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11782. this.scene.overrideMaterial = null
  11783. }
  11784. }
  11785. }
  11786. , {
  11787. three: 217
  11788. }],
  11789. 99: [function(e, t, i) {
  11790. "use strict";
  11791. var n = e("three");
  11792. n.ShaderPass = function(e, t) {
  11793. this.textureID = void 0 !== t ? t : "tDiffuse",
  11794. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11795. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11796. this.material = new n.ShaderMaterial({
  11797. defines: e.defines || {},
  11798. uniforms: this.uniforms,
  11799. vertexShader: e.vertexShader,
  11800. fragmentShader: e.fragmentShader
  11801. })),
  11802. this.renderToScreen = !1,
  11803. this.enabled = !0,
  11804. this.needsSwap = !0,
  11805. this.clear = !1,
  11806. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11807. this.scene = new n.Scene,
  11808. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11809. this.scene.add(this.quad)
  11810. }
  11811. ,
  11812. n.ShaderPass.prototype = {
  11813. render: function(e, t, i, n) {
  11814. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11815. this.quad.material = this.material,
  11816. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11817. }
  11818. }
  11819. }
  11820. , {
  11821. three: 217
  11822. }],
  11823. 100: [function(e, t, i) {
  11824. "use strict";
  11825. var n = e("three");
  11826. n.CopyShader = {
  11827. uniforms: {
  11828. tDiffuse: {
  11829. type: "t",
  11830. value: null
  11831. },
  11832. opacity: {
  11833. type: "f",
  11834. value: 1
  11835. }
  11836. },
  11837. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11838. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11839. }
  11840. }
  11841. , {
  11842. three: 217
  11843. }],
  11844. 101: [function(e, t, i) {
  11845. "use strict";
  11846. var n = e("three");
  11847. n.HorizontalBlurShader = {
  11848. uniforms: {
  11849. tDiffuse: {
  11850. type: "t",
  11851. value: null
  11852. },
  11853. h: {
  11854. type: "f",
  11855. value: 1 / 512
  11856. }
  11857. },
  11858. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11859. 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")
  11860. }
  11861. }
  11862. , {
  11863. three: 217
  11864. }],
  11865. 102: [function(e, t, i) {
  11866. "use strict";
  11867. var n = e("three");
  11868. n.VerticalBlurShader = {
  11869. uniforms: {
  11870. tDiffuse: {
  11871. type: "t",
  11872. value: null
  11873. },
  11874. v: {
  11875. type: "f",
  11876. value: 1 / 512
  11877. }
  11878. },
  11879. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11880. 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")
  11881. }
  11882. }
  11883. , {
  11884. three: 217
  11885. }],
  11886. 103: [function(e, t, i) {
  11887. "use strict";
  11888. var n = e("three");
  11889. !function() {
  11890. if ("performance"in window == 0 && (window.performance = {}),
  11891. "now"in window.performance == 0) {
  11892. var e = Date.now();
  11893. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11894. window.performance.now = function() {
  11895. return Date.now() - e
  11896. }
  11897. }
  11898. }(),
  11899. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11900. var t, i = this.extensions, r = this.context;
  11901. if (e === n.RepeatWrapping)
  11902. return r.REPEAT;
  11903. if (e === n.ClampToEdgeWrapping)
  11904. return r.CLAMP_TO_EDGE;
  11905. if (e === n.MirroredRepeatWrapping)
  11906. return r.MIRRORED_REPEAT;
  11907. if (e === n.NearestFilter)
  11908. return r.NEAREST;
  11909. if (e === n.NearestMipMapNearestFilter)
  11910. return r.NEAREST_MIPMAP_NEAREST;
  11911. if (e === n.NearestMipMapLinearFilter)
  11912. return r.NEAREST_MIPMAP_LINEAR;
  11913. if (e === n.LinearFilter)
  11914. return r.LINEAR;
  11915. if (e === n.LinearMipMapNearestFilter)
  11916. return r.LINEAR_MIPMAP_NEAREST;
  11917. if (e === n.LinearMipMapLinearFilter)
  11918. return r.LINEAR_MIPMAP_LINEAR;
  11919. if (e === n.UnsignedByteType)
  11920. return r.UNSIGNED_BYTE;
  11921. if (e === n.UnsignedShort4444Type)
  11922. return r.UNSIGNED_SHORT_4_4_4_4;
  11923. if (e === n.UnsignedShort5551Type)
  11924. return r.UNSIGNED_SHORT_5_5_5_1;
  11925. if (e === n.UnsignedShort565Type)
  11926. return r.UNSIGNED_SHORT_5_6_5;
  11927. if (e === n.ByteType)
  11928. return r.BYTE;
  11929. if (e === n.ShortType)
  11930. return r.SHORT;
  11931. if (e === n.UnsignedShortType)
  11932. return r.UNSIGNED_SHORT;
  11933. if (e === n.IntType)
  11934. return r.INT;
  11935. if (e === n.UnsignedIntType)
  11936. return r.UNSIGNED_INT;
  11937. if (e === n.FloatType)
  11938. return r.FLOAT;
  11939. if (t = i.get("OES_texture_half_float"),
  11940. null !== t && e === n.HalfFloatType)
  11941. return t.HALF_FLOAT_OES;
  11942. if (e === n.AlphaFormat)
  11943. return r.ALPHA;
  11944. if (e === n.RGBFormat)
  11945. return r.RGB;
  11946. if (e === n.RGBAFormat)
  11947. return r.RGBA;
  11948. if (e === n.LuminanceFormat)
  11949. return r.LUMINANCE;
  11950. if (e === n.LuminanceAlphaFormat)
  11951. return r.LUMINANCE_ALPHA;
  11952. if (e === n.AddEquation)
  11953. return r.FUNC_ADD;
  11954. if (e === n.SubtractEquation)
  11955. return r.FUNC_SUBTRACT;
  11956. if (e === n.ReverseSubtractEquation)
  11957. return r.FUNC_REVERSE_SUBTRACT;
  11958. if (e === n.ZeroFactor)
  11959. return r.ZERO;
  11960. if (e === n.OneFactor)
  11961. return r.ONE;
  11962. if (e === n.SrcColorFactor)
  11963. return r.SRC_COLOR;
  11964. if (e === n.OneMinusSrcColorFactor)
  11965. return r.ONE_MINUS_SRC_COLOR;
  11966. if (e === n.SrcAlphaFactor)
  11967. return r.SRC_ALPHA;
  11968. if (e === n.OneMinusSrcAlphaFactor)
  11969. return r.ONE_MINUS_SRC_ALPHA;
  11970. if (e === n.DstAlphaFactor)
  11971. return r.DST_ALPHA;
  11972. if (e === n.OneMinusDstAlphaFactor)
  11973. return r.ONE_MINUS_DST_ALPHA;
  11974. if (e === n.DstColorFactor)
  11975. return r.DST_COLOR;
  11976. if (e === n.OneMinusDstColorFactor)
  11977. return r.ONE_MINUS_DST_COLOR;
  11978. if (e === n.SrcAlphaSaturateFactor)
  11979. return r.SRC_ALPHA_SATURATE;
  11980. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  11981. null !== t) {
  11982. if (e === n.RGB_S3TC_DXT1_Format)
  11983. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11984. if (e === n.RGBA_S3TC_DXT1_Format)
  11985. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11986. if (e === n.RGBA_S3TC_DXT3_Format)
  11987. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11988. if (e === n.RGBA_S3TC_DXT5_Format)
  11989. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11990. }
  11991. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  11992. null !== t) {
  11993. if (e === n.RGB_PVRTC_4BPPV1_Format)
  11994. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11995. if (e === n.RGB_PVRTC_2BPPV1_Format)
  11996. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11997. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  11998. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11999. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12000. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12001. }
  12002. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12003. null !== t && e === n.RGB_ETC1_Format)
  12004. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12005. if (t = i.get("EXT_blend_minmax"),
  12006. null !== t) {
  12007. if (e === n.MinEquation)
  12008. return t.MIN_EXT;
  12009. if (e === n.MaxEquation)
  12010. return t.MAX_EXT
  12011. }
  12012. return 0
  12013. }
  12014. ,
  12015. n.WebGLState = function(e, t, i) {
  12016. var r = this
  12017. , o = new n.Vector4
  12018. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12019. , s = new Uint8Array(a)
  12020. , l = new Uint8Array(a)
  12021. , c = new Uint8Array(a)
  12022. , h = {}
  12023. , u = null
  12024. , d = null
  12025. , p = null
  12026. , f = null
  12027. , g = null
  12028. , m = null
  12029. , v = null
  12030. , A = null
  12031. , y = !1
  12032. , C = null
  12033. , I = null
  12034. , E = null
  12035. , b = null
  12036. , w = null
  12037. , _ = null
  12038. , T = null
  12039. , x = null
  12040. , S = null
  12041. , M = null
  12042. , R = null
  12043. , P = null
  12044. , O = null
  12045. , L = null
  12046. , D = null
  12047. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12048. , B = void 0
  12049. , F = {}
  12050. , V = new n.Vector4
  12051. , U = null
  12052. , k = null
  12053. , H = new n.Vector4
  12054. , G = new n.Vector4;
  12055. this.init = function() {
  12056. this.clearColor(0, 0, 0, 1),
  12057. this.clearDepth(1),
  12058. this.clearStencil(0),
  12059. this.enable(e.DEPTH_TEST),
  12060. e.depthFunc(e.LEQUAL),
  12061. e.frontFace(e.CCW),
  12062. e.cullFace(e.BACK),
  12063. this.enable(e.CULL_FACE),
  12064. this.enable(e.BLEND),
  12065. e.blendEquation(e.FUNC_ADD),
  12066. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12067. }
  12068. ,
  12069. this.initAttributes = function() {
  12070. for (var e = 0, t = s.length; e < t; e++)
  12071. s[e] = 0
  12072. }
  12073. ,
  12074. this.enableAttribute = function(i) {
  12075. if (s[i] = 1,
  12076. 0 === l[i] && (e.enableVertexAttribArray(i),
  12077. l[i] = 1),
  12078. 0 !== c[i]) {
  12079. var n = t.get("ANGLE_instanced_arrays");
  12080. n.vertexAttribDivisorANGLE(i, 0),
  12081. c[i] = 0
  12082. }
  12083. }
  12084. ,
  12085. this.enableAttributeAndDivisor = function(t, i, n) {
  12086. s[t] = 1,
  12087. 0 === l[t] && (e.enableVertexAttribArray(t),
  12088. l[t] = 1),
  12089. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12090. c[t] = i)
  12091. }
  12092. ,
  12093. this.disableUnusedAttributes = function() {
  12094. for (var t = 0, i = l.length; t < i; t++)
  12095. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12096. l[t] = 0)
  12097. }
  12098. ,
  12099. this.enable = function(t) {
  12100. h[t] !== !0 && (e.enable(t),
  12101. h[t] = !0)
  12102. }
  12103. ,
  12104. this.disable = function(t) {
  12105. h[t] !== !1 && (e.disable(t),
  12106. h[t] = !1)
  12107. }
  12108. ,
  12109. this.getCompressedTextureFormats = function() {
  12110. if (null === u && (u = [],
  12111. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12112. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12113. u.push(i[n]);
  12114. return u
  12115. }
  12116. ,
  12117. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12118. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12119. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12120. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12121. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12122. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12123. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12124. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12125. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12126. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12127. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12128. d = t,
  12129. y = h),
  12130. t === n.CustomBlending ? (s = s || r,
  12131. l = l || o,
  12132. c = c || a,
  12133. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12134. p = r,
  12135. m = s),
  12136. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12137. f = o,
  12138. g = a,
  12139. v = l,
  12140. A = c)) : (p = null,
  12141. f = null,
  12142. g = null,
  12143. m = null,
  12144. v = null,
  12145. A = null)
  12146. }
  12147. ,
  12148. this.setDepthFunc = function(t) {
  12149. if (C !== t) {
  12150. if (t)
  12151. switch (t) {
  12152. case n.NeverDepth:
  12153. e.depthFunc(e.NEVER);
  12154. break;
  12155. case n.AlwaysDepth:
  12156. e.depthFunc(e.ALWAYS);
  12157. break;
  12158. case n.LessDepth:
  12159. e.depthFunc(e.LESS);
  12160. break;
  12161. case n.LessEqualDepth:
  12162. e.depthFunc(e.LEQUAL);
  12163. break;
  12164. case n.EqualDepth:
  12165. e.depthFunc(e.EQUAL);
  12166. break;
  12167. case n.GreaterEqualDepth:
  12168. e.depthFunc(e.GEQUAL);
  12169. break;
  12170. case n.GreaterDepth:
  12171. e.depthFunc(e.GREATER);
  12172. break;
  12173. case n.NotEqualDepth:
  12174. e.depthFunc(e.NOTEQUAL);
  12175. break;
  12176. default:
  12177. e.depthFunc(e.LEQUAL)
  12178. }
  12179. else
  12180. e.depthFunc(e.LEQUAL);
  12181. C = t
  12182. }
  12183. }
  12184. ,
  12185. this.setDepthTest = function(t) {
  12186. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12187. }
  12188. ,
  12189. this.setDepthWrite = function(t) {
  12190. I !== t && (e.depthMask(t),
  12191. I = t)
  12192. }
  12193. ,
  12194. this.setColorWrite = function(t) {
  12195. E !== t && (e.colorMask(t, t, t, t),
  12196. E = t)
  12197. }
  12198. ,
  12199. this.setStencilFunc = function(t, i, n) {
  12200. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12201. w = t,
  12202. _ = i,
  12203. T = n)
  12204. }
  12205. ,
  12206. this.setStencilOp = function(t, i, n) {
  12207. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12208. x = t,
  12209. S = i,
  12210. M = n)
  12211. }
  12212. ,
  12213. this.setStencilTest = function(t) {
  12214. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12215. }
  12216. ,
  12217. this.setStencilWrite = function(t) {
  12218. b !== t && (e.stencilMask(t),
  12219. b = t)
  12220. }
  12221. ,
  12222. this.setFlipSided = function(t) {
  12223. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12224. R = t)
  12225. }
  12226. ,
  12227. this.setLineWidth = function(t) {
  12228. t !== P && (e.lineWidth(t),
  12229. P = t)
  12230. }
  12231. ,
  12232. this.setPolygonOffset = function(t, i, n) {
  12233. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12234. !t || O === i && L === n || (e.polygonOffset(i, n),
  12235. O = i,
  12236. L = n)
  12237. }
  12238. ,
  12239. this.getScissorTest = function() {
  12240. return D
  12241. }
  12242. ,
  12243. this.setScissorTest = function(t) {
  12244. D = t,
  12245. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12246. }
  12247. ,
  12248. this.activeTexture = function(t) {
  12249. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12250. B !== t && (e.activeTexture(t),
  12251. B = t)
  12252. }
  12253. ,
  12254. this.bindTexture = function(t, i) {
  12255. void 0 === B && r.activeTexture();
  12256. var n = F[B];
  12257. void 0 === n && (n = {
  12258. type: void 0,
  12259. texture: void 0
  12260. },
  12261. F[B] = n),
  12262. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12263. n.type = t,
  12264. n.texture = i)
  12265. }
  12266. ,
  12267. this.compressedTexImage2D = function() {
  12268. try {
  12269. e.compressedTexImage2D.apply(e, arguments)
  12270. } catch (e) {
  12271. console.error(e)
  12272. }
  12273. }
  12274. ,
  12275. this.texImage2D = function() {
  12276. try {
  12277. e.texImage2D.apply(e, arguments)
  12278. } catch (e) {
  12279. console.error(e)
  12280. }
  12281. }
  12282. ,
  12283. this.clearColor = function(t, i, n, r) {
  12284. o.set(t, i, n, r),
  12285. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12286. V.copy(o))
  12287. }
  12288. ,
  12289. this.clearDepth = function(t) {
  12290. U !== t && (e.clearDepth(t),
  12291. U = t)
  12292. }
  12293. ,
  12294. this.clearStencil = function(t) {
  12295. k !== t && (e.clearStencil(t),
  12296. k = t)
  12297. }
  12298. ,
  12299. this.scissor = function(t) {
  12300. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12301. H.copy(t))
  12302. }
  12303. ,
  12304. this.viewport = function(t) {
  12305. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12306. G.copy(t))
  12307. }
  12308. ,
  12309. this.reset = function() {
  12310. for (var t = 0; t < l.length; t++)
  12311. 1 === l[t] && (e.disableVertexAttribArray(t),
  12312. l[t] = 0);
  12313. h = {},
  12314. u = null,
  12315. B = void 0,
  12316. F = {},
  12317. d = null,
  12318. E = null,
  12319. I = null,
  12320. b = null,
  12321. R = null
  12322. }
  12323. }
  12324. }
  12325. , {
  12326. three: 217
  12327. }],
  12328. 104: [function(e, t, i) {
  12329. (function(i, n) {
  12330. "use strict";
  12331. function r(e) {
  12332. this.urls = e;
  12333. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12334. this.builder = a.loadProto(t),
  12335. this.decoder = this.builder.build("binary_mesh")
  12336. }
  12337. var o = e("three")
  12338. , a = e("protobufjs")
  12339. , s = e("../util/logger")
  12340. , l = (e("../util/common"),
  12341. e("../util/ajax"))
  12342. , c = e("../objects/Chunk")
  12343. , h = new s(n);
  12344. r.prototype = {
  12345. constructor: r,
  12346. load: function(e, t, i, n) {
  12347. return h.time("download"),
  12348. l.get(e, {
  12349. responseType: "arraybuffer"
  12350. }).done(function(r) {
  12351. h.timeEnd("download"),
  12352. this.parse(r, e, t, i, n)
  12353. }
  12354. .bind(this)).fail(n)
  12355. },
  12356. parse: function(e, t, i, n, r) {
  12357. var o = this.readProtobuf(e);
  12358. if (!o)
  12359. return r();
  12360. try {
  12361. h.time("convert to webgl"),
  12362. this.convertProtobufToSceneObject(o, t, i, n, r),
  12363. h.timeEnd("convert to webgl")
  12364. } catch (e) {
  12365. return h.error("failed parsing .dam"),
  12366. h.error(e.message),
  12367. r()
  12368. }
  12369. },
  12370. readProtobuf: function(e) {
  12371. var t;
  12372. try {
  12373. h.time("parse proto"),
  12374. t = this.decoder.decode(e),
  12375. h.timeEnd("parse proto")
  12376. } catch (e) {
  12377. return h.error("failed parsing proto for .dam"),
  12378. h.error(e.message),
  12379. null
  12380. }
  12381. return t
  12382. },
  12383. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12384. function a(e) {
  12385. var i = new o.BufferGeometry;
  12386. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12387. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12388. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12389. i.applyMatrix(s),
  12390. i.computeBoundingBox(),
  12391. new c({
  12392. geometry: i,
  12393. textureName: e.material_name,
  12394. name: e.chunk_name,
  12395. meshUrl: t
  12396. })
  12397. }
  12398. if (0 === e.chunk.length)
  12399. return h.warn("No chunks in damfile..."),
  12400. i([]);
  12401. var s = new o.Matrix4;
  12402. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12403. var l = e.chunk.map(a);
  12404. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12405. r())
  12406. }
  12407. },
  12408. t.exports = r
  12409. }
  12410. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12411. }
  12412. , {
  12413. "../objects/Chunk": 144,
  12414. "../util/ajax": 181,
  12415. "../util/common": 185,
  12416. "../util/logger": 189,
  12417. buffer: 198,
  12418. protobufjs: 214,
  12419. three: 217
  12420. }],
  12421. 105: [function(e, t, i) {
  12422. (function(i) {
  12423. "use strict";
  12424. var n = (e("three"),
  12425. e("../settings"),
  12426. e("../util/browser"),
  12427. e("./DamLoader"))
  12428. , r = e("../util/logger")
  12429. , o = (e("../ab"),
  12430. new r(i));
  12431. t.exports = {
  12432. getLoaders: function() {
  12433. return [["_50k", ".dam", n], ["", ".dam", n]]
  12434. },
  12435. load: function(e, t, i, n, r, a) {
  12436. var s = this.getLoaders();
  12437. a = a || 0;
  12438. var l = s[a];
  12439. if (!l)
  12440. return void (r && r("No suitable model file found..."));
  12441. var c = l[0]
  12442. , h = l[1]
  12443. , u = new l[2](t)
  12444. , d = t.get(e + c + h);
  12445. d ? (o.debug("Trying " + c + h),
  12446. u.load(d, i, n, function() {
  12447. this.load(e, t, i, n, r, ++a)
  12448. }
  12449. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12450. this.load(e, t, i, n, r, ++a))
  12451. }
  12452. }
  12453. }
  12454. ).call(this, "/js/loaders/ModelLoader.js")
  12455. }
  12456. , {
  12457. "../ab": 3,
  12458. "../settings": 166,
  12459. "../util/browser": 182,
  12460. "../util/logger": 189,
  12461. "./DamLoader": 104,
  12462. three: 217
  12463. }],
  12464. 106: [function(e, t, i) {
  12465. (function(i) {
  12466. "use strict";
  12467. var n = e("../util/common")
  12468. , r = e("../util/texture")
  12469. , o = e("../util/browser")
  12470. , a = e("../util/logger")
  12471. , s = e("../settings")
  12472. , l = new a(i);
  12473. t.exports = {
  12474. load: function(e, t) {
  12475. function i(e, i) {
  12476. e || (t.push(i),
  12477. p++,
  12478. d.notify(p, a),
  12479. p === a && d.resolve())
  12480. }
  12481. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12482. return $.when();
  12483. var a = n.countUnique(e.chunks.map(function(e) {
  12484. return e.textureName
  12485. }))
  12486. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12487. , h = "_50k" === c ? "high" : "low";
  12488. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12489. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12490. h = "low"));
  12491. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12492. , d = $.Deferred()
  12493. , p = 0;
  12494. return e.chunks.forEach(function(t) {
  12495. if (!t.material.map && t.textureName) {
  12496. var n = e.urls.get(u + t.textureName);
  12497. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12498. }
  12499. }),
  12500. d.promise()
  12501. }
  12502. }
  12503. }
  12504. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12505. }
  12506. , {
  12507. "../settings": 166,
  12508. "../util/browser": 182,
  12509. "../util/common": 185,
  12510. "../util/logger": 189,
  12511. "../util/texture": 194
  12512. }],
  12513. 107: [function(e, t, i) {
  12514. (function(i, n) {
  12515. "use strict";
  12516. function r(e) {
  12517. this.model = e,
  12518. this.modelDataPath = this.model.urls.get("vision.modeldata"),
  12519. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12520. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12521. , n = o.loadProto(t);
  12522. this.decoder = n.build("VisionModeldata")
  12523. }
  12524. var o = e("protobufjs")
  12525. , a = e("../util/ajax")
  12526. , s = (e("../util/common"),
  12527. e("../util/math"))
  12528. , l = e("../util/logger")
  12529. , c = new l(n);
  12530. r.prototype.load = function() {
  12531. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12532. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12533. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12534. $.when([]))
  12535. }
  12536. ,
  12537. r.prototype.loadVisionModelData = function() {
  12538. return a.get(this.modelDataPath, {
  12539. responseType: "arraybuffer"
  12540. }).then(function(e) {
  12541. var t;
  12542. try {
  12543. t = this.decoder.decode(e)
  12544. } catch (e) {
  12545. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12546. this.loadSweepLocationsCSV()
  12547. }
  12548. var i = t.sweepLocations.map(function(e) {
  12549. return {
  12550. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12551. position: {
  12552. x: e.pose.translation.x,
  12553. y: e.pose.translation.y,
  12554. z: e.pose.translation.z
  12555. },
  12556. quaternion: {
  12557. x: e.pose.rotation.x,
  12558. y: e.pose.rotation.y,
  12559. z: e.pose.rotation.z,
  12560. w: e.pose.rotation.w
  12561. },
  12562. puck: {
  12563. x: e.puck.x,
  12564. y: e.puck.y,
  12565. z: e.puck.z
  12566. },
  12567. floor: e.group,
  12568. neighbours: e.visibles,
  12569. alignmentType: e.alignment_type
  12570. }
  12571. }).map(function(e) {
  12572. return e.position = s.convertVisionVector(e.position),
  12573. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12574. e.puck = s.convertVisionVector(e.puck),
  12575. e
  12576. });
  12577. return i.forEach(function(e) {
  12578. e.neighbours = e.neighbours.map(function(e) {
  12579. return i[e].uuid
  12580. })
  12581. }),
  12582. i
  12583. }
  12584. .bind(this), function() {
  12585. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12586. this.loadSweepLocationsCSV()
  12587. }
  12588. .bind(this))
  12589. }
  12590. ,
  12591. r.prototype.loadSweepLocationsCSV = function() {
  12592. return a.get(this.sweepLocationsPath).then(function(e) {
  12593. var t = e.split("\n").map(function(e) {
  12594. return e.split(", ")
  12595. }).filter(function(e) {
  12596. return e.length > 1
  12597. }).map(function(e) {
  12598. return {
  12599. uuid: e[0],
  12600. position: {
  12601. x: parseFloat(e[1]),
  12602. y: parseFloat(e[2]),
  12603. z: parseFloat(e[3])
  12604. },
  12605. quaternion: {
  12606. x: parseFloat(e[4]),
  12607. y: parseFloat(e[5]),
  12608. z: parseFloat(e[6]),
  12609. w: parseFloat(e[7])
  12610. }
  12611. }
  12612. }).map(function(e) {
  12613. return e.position = s.convertVisionVector(e.position),
  12614. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12615. e
  12616. });
  12617. return t
  12618. }).fail(function() {
  12619. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12620. })
  12621. }
  12622. ,
  12623. t.exports = r
  12624. }
  12625. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12626. }
  12627. , {
  12628. "../util/ajax": 181,
  12629. "../util/common": 185,
  12630. "../util/logger": 189,
  12631. "../util/math": 190,
  12632. buffer: 198,
  12633. protobufjs: 214
  12634. }],
  12635. 108: [function(e, t, i) {
  12636. (function(i) {
  12637. "use strict";
  12638. function n() {
  12639. this.locale = null
  12640. }
  12641. var r = e("../settings")
  12642. , o = e("../util/common")
  12643. , a = e("../util/logger")
  12644. , s = e("../enum/Locale")
  12645. , l = new a(i);
  12646. n.prototype.init = function() {
  12647. var t;
  12648. switch (r.languageTag) {
  12649. case null:
  12650. case "en":
  12651. case s.EN_US:
  12652. this.locale = s.EN_US,
  12653. t = e("./strings-en-US");
  12654. break;
  12655. case "es":
  12656. case s.ES_MX:
  12657. this.locale = s.ES_MX,
  12658. t = e("./strings-es-MX");
  12659. break;
  12660. case "fr":
  12661. case s.FR_FR:
  12662. this.locale = s.FR_FR,
  12663. t = e("./strings-fr-FR");
  12664. break;
  12665. case "de":
  12666. case s.DE_DE:
  12667. this.locale = s.DE_DE,
  12668. t = e("./strings-de-DE");
  12669. break;
  12670. case "ru":
  12671. case s.RU_RU:
  12672. this.locale = s.RU_RU,
  12673. t = e("./strings-ru-RU");
  12674. break;
  12675. case "cn":
  12676. case s.CN_CN:
  12677. this.locale = s.CN_CN,
  12678. t = e("./strings-cn-CN");
  12679. break;
  12680. case "jp":
  12681. case s.JP_JP:
  12682. this.locale = s.JP_JP,
  12683. t = e("./strings-jp-JP");
  12684. break;
  12685. default:
  12686. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12687. this.locale = s.EN_US,
  12688. t = e("./strings-en-US")
  12689. }
  12690. l.info("Using locale '" + this.locale + "'"),
  12691. o.extendObject(this, t)
  12692. }
  12693. ,
  12694. n.prototype.localizeGUI = function() {
  12695. var e = document.querySelector("#gui-parent");
  12696. this.localizeTree(e),
  12697. this.localizeLoadingText()
  12698. }
  12699. ,
  12700. n.prototype.localizeLoadingText = function() {
  12701. var e = document.querySelector("#loader-cont")
  12702. , t = e.getAttribute("title");
  12703. e.removeAttribute("title"),
  12704. e.setAttribute("data-status", t),
  12705. e.classList.add(this.locale),
  12706. document.querySelector("#help-dialog").classList.add(this.locale),
  12707. document.querySelector("#interaction-modal").classList.add(this.locale),
  12708. document.querySelector("#gui").classList.add(this.locale)
  12709. }
  12710. ,
  12711. n.prototype.localizeTree = function(e) {
  12712. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12713. if (e.nodeType === Node.TEXT_NODE)
  12714. t = e.data.match(n),
  12715. t && (i = t[1],
  12716. e.data = this.localizeText(i) || i);
  12717. else if (e.nodeType === Node.ELEMENT_NODE) {
  12718. var r = e.getAttribute("title");
  12719. r && (t = r.match(n),
  12720. t && (i = t[1],
  12721. e.setAttribute("title", this.localizeText(i) || i)))
  12722. }
  12723. for (e = e.firstChild; e; )
  12724. this.localizeTree(e),
  12725. e = e.nextSibling
  12726. }
  12727. ,
  12728. n.prototype.localizeText = function(t) {
  12729. var i = this[t];
  12730. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12731. i = e("./strings-en-US")[t]),
  12732. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12733. i
  12734. }
  12735. ,
  12736. t.exports = new n
  12737. }
  12738. ).call(this, "/js/localization/localize.js")
  12739. }
  12740. , {
  12741. "../enum/Locale": 31,
  12742. "../settings": 166,
  12743. "../util/common": 185,
  12744. "../util/logger": 189,
  12745. "./strings-cn-CN": 109,
  12746. "./strings-de-DE": 110,
  12747. "./strings-en-US": 111,
  12748. "./strings-es-MX": 112,
  12749. "./strings-fr-FR": 113,
  12750. "./strings-jp-JP": 114,
  12751. "./strings-ru-RU": 115
  12752. }],
  12753. 109: [function(e, t, i) {
  12754. "use strict";
  12755. t.exports = {
  12756. PAGE_TITLE: "port 3D Showcase",
  12757. LOADING: "正在加载",
  12758. PRESENTED_BY_CAPS: "呈现者:",
  12759. POWERED_BY: "技术支持:",
  12760. POWERED_BY_CAPS: "技术支持:",
  12761. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12762. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12763. PRESENTED_BY: "呈现者:",
  12764. MORE: "更多 ",
  12765. LESS: "更少 ",
  12766. TAG_CONTENT: "tag™ 内容",
  12767. SHOW: "显示",
  12768. HIDE: "隐藏",
  12769. DOLLHOUSE: "场景屋",
  12770. FLOOR_PLAN: "楼层平面图",
  12771. OPEN_HIGHLIGHTS: "打开精彩片段",
  12772. CLOSE_HIGHLIGHTS: "关闭",
  12773. PREVIOUS: "上一个",
  12774. PLAY: "播放",
  12775. PAUSE: "暂停",
  12776. NEXT: "下一个",
  12777. EXPLORE_3D_SPACE: "探索 3D 空间",
  12778. VIEW_DOLLHOUSE: "观看场景屋",
  12779. SOCIAL_SHARING: "分享这个空间",
  12780. VIEW_IN_VR: "以 VR 观看",
  12781. VIEW_FULLSCREEN: "全屏观看",
  12782. EXIT_FULLSCREEN: " 退出全屏",
  12783. ZOOM_IN: "放大",
  12784. ZOOM_OUT: "缩小",
  12785. FLOOR_NAME: "楼层",
  12786. FLOOR_ALL: "全部",
  12787. TERMS: "条款",
  12788. PORT_TERMS: "port 条款",
  12789. TERMS_OF_USE: "使用条款",
  12790. CLOSE_TERMS: "关闭",
  12791. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12792. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12793. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12794. WEBVR_ENTER_WEBVR: "进入 VR",
  12795. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12796. WEBVR_LEARN_MORE: "了解更多",
  12797. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12798. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12799. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12800. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12801. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12802. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12803. VR_LEARN_MORE_CAPS: "了解更多",
  12804. VR_PREVIOUS_CAPS: "上一个’,",
  12805. VR_NEXT_CAPS: "下一个",
  12806. VR_GOT_IT_CAPS: "明白了",
  12807. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12808. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12809. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12810. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12811. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12812. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12813. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12814. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12815. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12816. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12817. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12818. VR_APP: "port VR 应用程序",
  12819. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12820. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12821. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12822. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12823. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12824. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12825. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12826. VR_ANDROID_DVICES: "Android 设备",
  12827. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12828. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12829. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12830. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12831. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12832. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12833. VR_DOWNLOAD_HERE: "在此下载",
  12834. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12835. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12836. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12837. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12838. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12839. SHARE_TO: "分享到",
  12840. SHARE_LINK: "直接链接",
  12841. SHARE_EXPLORE: "探索",
  12842. SHARE_AT: "在",
  12843. SHARE_WITH: "使用",
  12844. SHARE_3D: "以 3D",
  12845. SHARE_COPIED: "已复制!",
  12846. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12847. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12848. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12849. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12850. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12851. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12852. ERROR_GENERIC_ACTIONS_3: " 或",
  12853. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12854. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12855. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12856. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12857. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12858. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12859. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12860. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12861. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12862. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12863. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12864. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12865. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12866. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12867. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12868. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12869. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12870. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12871. LINK_TO_LOCATION: "地点链接",
  12872. MENU_COPY: "复制",
  12873. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12874. ROTATE: "旋转",
  12875. MOVE: "移动",
  12876. INSIDE: "内部",
  12877. ZOOM: "缩放",
  12878. HELP: "小帮手",
  12879. HELP_NAVIGATION_TAB: "导航",
  12880. HELP_MORE_HELP_TAB: "更多帮助",
  12881. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12882. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12883. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12884. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12885. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12886. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12887. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12888. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12889. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12890. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12891. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12892. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12893. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12894. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12895. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12896. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12897. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12898. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12899. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12900. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12901. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12902. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12903. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12904. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12905. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12906. HELP_MORE_HLR_A: "精彩片段集锦",
  12907. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12908. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12909. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12910. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12911. HELP_MORE_FLOORS_A: "楼层选择器",
  12912. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12913. HELP_MORE_TAG_A: "tag™ 贴文",
  12914. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12915. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12916. HELP_MORE_ZOOM_A: "缩放控件",
  12917. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12918. HELP_MORE_TOUR_A: "导览控件",
  12919. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12920. HELP_MORE_INSIDE_A: "内部视图",
  12921. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12922. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12923. HELP_MORE_VR_A: "VR 模式",
  12924. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12925. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12926. HELP_MORE_360_A: "360° 视图",
  12927. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12928. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12929. HELP_MORE_FULLSCREEN_A: "全屏",
  12930. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12931. CLOSE: "关闭"
  12932. }
  12933. }
  12934. , {}],
  12935. 110: [function(e, t, i) {
  12936. "use strict";
  12937. t.exports = {
  12938. PAGE_TITLE: "port 3D Showcase",
  12939. LOADING: "Lädt",
  12940. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12941. POWERED_BY: "Angetrieben von",
  12942. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12943. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12944. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12945. PRESENTED_BY: "Präsentiert von ",
  12946. MORE: "Mehr ",
  12947. LESS: "Weniger ",
  12948. TAG_CONTENT: "tag™ Inhalt",
  12949. SHOW: "Anzeigen",
  12950. HIDE: "Verbergen",
  12951. DOLLHOUSE: "Puppenhaus",
  12952. FLOOR_PLAN: "Grundriss",
  12953. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12954. CLOSE_HIGHLIGHTS: "Schließen",
  12955. PREVIOUS: "Vorheriges",
  12956. PLAY: "Abspielen",
  12957. PAUSE: "Pausieren",
  12958. NEXT: "Nächstes",
  12959. EXPLORE_3D_SPACE: "Innenraum betreten",
  12960. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12961. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12962. VIEW_IN_VR: "In VR ansehen",
  12963. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12964. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12965. ZOOM_IN: "Vergrößern",
  12966. ZOOM_OUT: "Verkleinern",
  12967. FLOOR_NAME: "Etage ",
  12968. FLOOR_ALL: "Alle",
  12969. TERMS: "Bedingungen",
  12970. PORT_TERMS: "port Bedingungen",
  12971. TERMS_OF_USE: "Nutzungsbedingungen",
  12972. TERMS_TEXT_FILE: "terms-de-DE.html",
  12973. CLOSE_TERMS: "Schließen",
  12974. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12975. HELP: "Hilfe",
  12976. HELP_NAVIGATION_TAB: "Navigation",
  12977. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12978. CLOSE: "Schließen",
  12979. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12980. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12981. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12982. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12983. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12984. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12985. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12986. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12987. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12988. 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.",
  12989. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12990. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12991. 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.",
  12992. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12993. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12994. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12995. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12996. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12997. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12998. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12999. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13000. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13001. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13002. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13003. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13004. HELP_MORE_HLR_A: "Liste das Highlight",
  13005. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13006. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13007. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13008. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13009. HELP_MORE_FLOORS_A: "Etage auswählen",
  13010. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13011. HELP_MORE_TAG_A: "tag™ Posts",
  13012. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13013. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13014. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13015. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13016. HELP_MORE_TOUR_A: "Tour Steuerung",
  13017. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13018. HELP_MORE_INSIDE_A: "Innenansicht",
  13019. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13020. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13021. HELP_MORE_VR_A: "VR Modus",
  13022. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13023. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13024. HELP_MORE_360_A: "360° Views Ansicht ",
  13025. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13026. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13027. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13028. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13029. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13030. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13031. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13032. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13033. WEBVR_LEARN_MORE: "Mehr Infos",
  13034. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13035. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13036. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13037. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13038. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13039. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13040. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13041. VR_APP: "port VR App",
  13042. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13043. 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",
  13044. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13045. VR_APP_FOR_ANDROID: "port VR app für Android",
  13046. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13047. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13048. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13049. VR_PREVIOUS_CAPS: "ZURÜCK",
  13050. VR_NEXT_CAPS: "WEITER",
  13051. VR_GOT_IT_CAPS: "VERSTANDEN",
  13052. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13053. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13054. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13055. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13056. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13057. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13058. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13059. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13060. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13061. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13062. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13063. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13064. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13065. VR_ANDROID_DVICES: "Android Geräte",
  13066. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13067. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13068. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13069. VR_DOWNLOAD_HERE: "Hier runterladen",
  13070. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13071. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13072. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13073. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13074. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13075. SHARE_TO: "Teilen auf",
  13076. SHARE_LINK: "Direkter Link",
  13077. SHARE_EXPLORE: "Umsehen",
  13078. SHARE_AT: "auf",
  13079. SHARE_WITH: "mit",
  13080. SHARE_3D: "in 3D",
  13081. SHARE_COPIED: "Kopiert!",
  13082. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13083. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13084. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13085. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13086. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13087. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13088. ERROR_GENERIC_ACTIONS_3: " oder ",
  13089. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13090. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13091. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13092. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13093. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13094. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13095. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13096. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13097. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13098. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13099. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13100. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13101. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13102. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13103. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13104. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13105. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13106. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13107. LINK_TO_LOCATION: "Link zu",
  13108. MENU_COPY: "Kopieren",
  13109. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13110. ROTATE: "Drehen",
  13111. INSIDE: "Drinnen",
  13112. MOVE: "Bewegen",
  13113. ZOOM: "Vergrößern"
  13114. }
  13115. }
  13116. , {}],
  13117. 111: [function(e, t, i) {
  13118. "use strict";
  13119. t.exports = {
  13120. PAGE_TITLE: "port 3D Showcase",
  13121. LOADING: "Loading",
  13122. PRESENTED_BY_CAPS: "PRESENTED BY",
  13123. POWERED_BY: "powered by ",
  13124. POWERED_BY_CAPS: "POWERED BY",
  13125. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13126. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13127. PRESENTED_BY: "Presented by ",
  13128. MORE: "More ",
  13129. LESS: "Less ",
  13130. TAG_CONTENT: "tag™ Content",
  13131. SHOW: "Show",
  13132. HIDE: "Hide",
  13133. DOLLHOUSE: "Dollhouse",
  13134. FLOOR_PLAN: "Floor plan",
  13135. OPEN_HIGHLIGHTS: "Open Highlights",
  13136. CLOSE_HIGHLIGHTS: "Close",
  13137. PREVIOUS: "Previous",
  13138. PLAY: "Play",
  13139. PAUSE: "Pause",
  13140. NEXT: "Next",
  13141. EXPLORE_3D_SPACE: "Explore 3D Space",
  13142. VIEW_DOLLHOUSE: "View dollhouse",
  13143. SOCIAL_SHARING: "Share this Space",
  13144. VIEW_IN_VR: "View in VR",
  13145. VIEW_FULLSCREEN: "View Fullscreen",
  13146. EXIT_FULLSCREEN: "Exit Fullscreen",
  13147. ZOOM_IN: "Zoom in",
  13148. ZOOM_OUT: "Zoom out",
  13149. FLOOR_NAME: "Floor ",
  13150. FLOOR_ALL: "All",
  13151. TERMS: "Terms",
  13152. PORT_TERMS: "port terms",
  13153. TERMS_OF_USE: "Terms of Use",
  13154. TERMS_TEXT_FILE: "terms-en-US.html",
  13155. CLOSE_TERMS: "Close",
  13156. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13157. HELP: "Help",
  13158. HELP_NAVIGATION_TAB: "Navigation",
  13159. HELP_MORE_HELP_TAB: "More Help",
  13160. CLOSE: "Close",
  13161. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13162. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13163. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13164. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13165. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13166. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13167. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13168. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13169. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13170. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13171. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13172. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13173. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13174. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13175. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13176. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13177. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13178. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13179. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13180. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13181. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13182. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13183. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13184. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13185. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13186. HELP_MORE_HLR_A: "Highlight Reel",
  13187. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13188. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13189. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13190. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13191. HELP_MORE_FLOORS_A: "Floor Selector",
  13192. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13193. HELP_MORE_TAG_A: "tag™ Posts",
  13194. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13195. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13196. HELP_MORE_ZOOM_A: "Zoom Controls",
  13197. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13198. HELP_MORE_TOUR_A: "Tour Controls",
  13199. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13200. HELP_MORE_INSIDE_A: "Inside View",
  13201. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13202. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13203. HELP_MORE_VR_A: "VR Mode",
  13204. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13205. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13206. HELP_MORE_360_A: "360° Views",
  13207. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13208. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13209. HELP_MORE_FULLSCREEN_A: "Full screen",
  13210. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13211. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13212. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13213. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13214. WEBVR_ENTER_WEBVR: "ENTER VR",
  13215. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13216. WEBVR_LEARN_MORE: "Learn more",
  13217. WEBVR_VIEW_SPACE: "View Space in VR",
  13218. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13219. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13220. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13221. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13222. VR_PREVIOUS_CAPS: "PREVIOUS",
  13223. VR_NEXT_CAPS: "NEXT",
  13224. VR_GOT_IT_CAPS: "GOT IT",
  13225. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13226. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13227. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13228. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13229. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13230. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13231. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13232. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13233. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13234. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13235. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13236. VR_APP: "port VR App",
  13237. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13238. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13239. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13240. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13241. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13242. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13243. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13244. VR_ANDROID_DVICES: "Android Devices",
  13245. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13246. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13247. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13248. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13249. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13250. VR_APP_OPEN: "Open with the port VR app instead",
  13251. VR_DOWNLOAD_HERE: "Download here",
  13252. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13253. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13254. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13255. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13256. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13257. SHARE_TO: "Share to",
  13258. SHARE_LINK: "Direct Link",
  13259. SHARE_EXPLORE: "Explore ",
  13260. SHARE_AT: "at",
  13261. SHARE_WITH: "with",
  13262. SHARE_3D: " in 3D",
  13263. SHARE_COPIED: "Copied!",
  13264. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13265. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13266. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13267. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13268. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13269. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13270. ERROR_GENERIC_ACTIONS_3: " or ",
  13271. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13272. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13273. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13274. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13275. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13276. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13277. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13278. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13279. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13280. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13281. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13282. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13283. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13284. ERROR_LOADING_FAILED_PROBLEM: "Oops, model not available.",
  13285. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13286. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13287. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13288. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13289. LINK_TO_LOCATION: "Link to location",
  13290. MENU_COPY: "Copy",
  13291. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13292. ROTATE: "Rotate",
  13293. INSIDE: "Inside",
  13294. MOVE: "Move",
  13295. ZOOM: "Zoom"
  13296. }
  13297. }
  13298. , {}],
  13299. 112: [function(e, t, i) {
  13300. "use strict";
  13301. t.exports = {
  13302. PAGE_TITLE: "port 3D Showcase",
  13303. LOADING: "Cargando",
  13304. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13305. POWERED_BY: "potenciando por ",
  13306. POWERED_BY_CAPS: "POTENCIADO POR ",
  13307. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13308. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13309. PRESENTED_BY: "Presentado por ",
  13310. MORE: "Más ",
  13311. LESS: "Menos ",
  13312. TAG_CONTENT: "Contenido de tag™",
  13313. SHOW: "Mostrar",
  13314. HIDE: "Ocultar",
  13315. DOLLHOUSE: "Dollhouse",
  13316. FLOOR_PLAN: "Planos",
  13317. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13318. CLOSE_HIGHLIGHTS: "Cerrar",
  13319. PREVIOUS: "Anterior",
  13320. PLAY: "Play",
  13321. PAUSE: "Pausa",
  13322. NEXT: "Siguiente",
  13323. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13324. VIEW_DOLLHOUSE: "Ver dollhouse",
  13325. SOCIAL_SHARING: "Compartir este espacio",
  13326. VIEW_IN_VR: "Ver en realidad virtual",
  13327. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13328. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13329. ZOOM_IN: "Acercar",
  13330. ZOOM_OUT: "Alejar",
  13331. FLOOR_NAME: "Piso ",
  13332. FLOOR_ALL: "Todas",
  13333. TERMS: "Condiciones",
  13334. PORT_TERMS: "port términos de uso",
  13335. TERMS_OF_USE: "Términos de uso",
  13336. TERMS_TEXT_FILE: "terms-es-MX.html",
  13337. CLOSE_TERMS: "Cerrar",
  13338. 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.",
  13339. HELP: "Ayuda",
  13340. HELP_NAVIGATION_TAB: "Navegación",
  13341. HELP_MORE_HELP_TAB: "Más Ayuda",
  13342. CLOSE: "Cerrar",
  13343. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13344. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13345. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13346. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13347. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13348. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13349. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13350. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13351. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13352. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13353. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13354. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13355. 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.",
  13356. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13357. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13358. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13359. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13360. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13361. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13362. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13363. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13364. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13365. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13366. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13367. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13368. HELP_MORE_HLR_A: "Galería destacada",
  13369. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13370. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13371. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13372. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13373. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13374. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13375. HELP_MORE_TAG_A: "tag™ Posts",
  13376. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13377. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13378. HELP_MORE_ZOOM_A: "Controles de zoom",
  13379. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13380. HELP_MORE_TOUR_A: "Controles de recorrido",
  13381. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13382. HELP_MORE_INSIDE_A: "Vista interior",
  13383. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13384. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13385. HELP_MORE_VR_A: "Modo de realidad virtual",
  13386. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13387. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13388. HELP_MORE_360_A: "360° Views",
  13389. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13390. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13391. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13392. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13393. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13394. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13395. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13396. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13397. WEBVR_LEARN_MORE: "Más información",
  13398. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13399. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13400. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13401. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13402. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13403. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13404. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13405. VR_APP: "port VR App",
  13406. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13407. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13408. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13409. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13410. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13411. VR_PREVIOUS_CAPS: "ANTERIOR",
  13412. VR_NEXT_CAPS: "SIGUIENTE",
  13413. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13414. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13415. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13416. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13417. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13418. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13419. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13420. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13421. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13422. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13423. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13424. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13425. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13426. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13427. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13428. VR_ANDROID_DVICES: "Dispositivos Android",
  13429. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13430. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13431. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13432. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13433. VR_DOWNLOAD_HERE: "Descargar aquí",
  13434. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13435. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13436. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13437. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13438. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13439. SHARE_TO: "Compartir en",
  13440. SHARE_LINK: "Enlace directo",
  13441. SHARE_EXPLORE: "Explorar ",
  13442. SHARE_AT: "en",
  13443. SHARE_WITH: "con",
  13444. SHARE_3D: " en 3D",
  13445. SHARE_COPIED: "¡Copiado!",
  13446. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13447. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13448. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13449. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13450. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13451. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13452. ERROR_GENERIC_ACTIONS_3: " o ",
  13453. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13454. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13455. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13456. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13457. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13458. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13459. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13460. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13461. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13462. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13463. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13464. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13465. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13466. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13467. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13468. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13469. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13470. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13471. LINK_TO_LOCATION: "Enlace a la ubicación",
  13472. MENU_COPY: "Copiar",
  13473. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13474. ROTATE: "Girar",
  13475. INSIDE: "Interior",
  13476. MOVE: "Moverse",
  13477. ZOOM: "Acercar o alejar"
  13478. }
  13479. }
  13480. , {}],
  13481. 113: [function(e, t, i) {
  13482. "use strict";
  13483. t.exports = {
  13484. PAGE_TITLE: "port 3D Showcase",
  13485. LOADING: "Chargement",
  13486. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13487. POWERED_BY: "alimenté par ",
  13488. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13489. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13490. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13491. PRESENTED_BY: "Présenté par ",
  13492. MORE: "Plus ",
  13493. LESS: "Moins ",
  13494. TAG_CONTENT: "Contenu tag™",
  13495. SHOW: "Montrer",
  13496. HIDE: "Cacher",
  13497. DOLLHOUSE: "Dollhouse",
  13498. FLOOR_PLAN: "Plan de sol",
  13499. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13500. CLOSE_HIGHLIGHTS: "Fermer",
  13501. PREVIOUS: "Précédent",
  13502. PLAY: "Lecture",
  13503. PAUSE: "Pause",
  13504. NEXT: "Suivant",
  13505. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13506. VIEW_DOLLHOUSE: "Voir dollhouse",
  13507. SOCIAL_SHARING: "Partager cet espace",
  13508. VIEW_IN_VR: "Voir en VR",
  13509. VIEW_FULLSCREEN: "Plein écran",
  13510. EXIT_FULLSCREEN: "Fermer plein écran",
  13511. ZOOM_IN: "Zoom avant",
  13512. ZOOM_OUT: "Zoom arrière",
  13513. FLOOR_NAME: "Étage ",
  13514. FLOOR_ALL: "Tous",
  13515. TERMS: "Mentions légales",
  13516. PORT_TERMS: "port mentions légales",
  13517. TERMS_OF_USE: "Conditions d'utilisation",
  13518. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13519. CLOSE_TERMS: "Fermer",
  13520. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13521. HELP: "Aide",
  13522. HELP_NAVIGATION_TAB: "Navigation",
  13523. HELP_MORE_HELP_TAB: "Aide",
  13524. CLOSE: "Fermer",
  13525. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13526. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13527. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13528. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13529. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13530. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13531. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13532. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13533. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13534. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13535. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13536. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13537. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13538. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13539. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13540. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13541. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13542. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13543. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13544. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13545. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13546. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13547. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13548. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13549. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13550. HELP_MORE_HLR_A: "Carrousel",
  13551. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13552. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13553. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13554. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13555. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13556. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13557. HELP_MORE_TAG_A: "tag™ Posts",
  13558. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13559. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13560. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13561. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13562. HELP_MORE_TOUR_A: "Commandes de la visite",
  13563. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13564. HELP_MORE_INSIDE_A: "Vue intérieure",
  13565. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13566. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13567. HELP_MORE_VR_A: "Mode RV",
  13568. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13569. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13570. HELP_MORE_360_A: "Vues 360°",
  13571. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13572. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13573. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13574. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13575. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13576. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13577. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13578. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13579. WEBVR_LEARN_MORE: "En savoir plus",
  13580. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13581. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13582. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13583. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13584. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13585. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13586. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13587. VR_NEXT_CAPS: "SUIVANT",
  13588. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13589. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13590. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13591. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13592. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13593. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13594. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13595. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13596. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13597. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13598. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13599. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13600. VR_APP: "port VR App",
  13601. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13602. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13603. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13604. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13605. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13606. 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",
  13607. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13608. VR_ANDROID_DVICES: "Appareils Android",
  13609. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13610. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13611. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13612. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13613. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13614. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13615. VR_DOWNLOAD_HERE: "Télécharger ici",
  13616. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13617. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13618. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13619. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13620. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13621. SHARE_TO: "Partager sur",
  13622. SHARE_LINK: "Lien direct",
  13623. SHARE_EXPLORE: "Explorer ",
  13624. SHARE_AT: "à",
  13625. SHARE_WITH: "avec",
  13626. SHARE_3D: " en 3D",
  13627. SHARE_COPIED: "Copié!",
  13628. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13629. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13630. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13631. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13632. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13633. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13634. ERROR_GENERIC_ACTIONS_3: " ou ",
  13635. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13636. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13637. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13638. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13639. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13640. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13641. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13642. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13643. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13644. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13645. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13646. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13647. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13648. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13649. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13650. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13651. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13652. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13653. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13654. MENU_COPY: "Copie",
  13655. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13656. ROTATE: "Faire pivoter",
  13657. INSIDE: "Intérieure",
  13658. MOVE: "Se déplacer",
  13659. ZOOM: "Zoom"
  13660. }
  13661. }
  13662. , {}],
  13663. 114: [function(e, t, i) {
  13664. "use strict";
  13665. t.exports = {
  13666. PAGE_TITLE: "port 3D Showcase",
  13667. LOADING: "読み込み中",
  13668. PRESENTED_BY_CAPS: "PRESENTED BY",
  13669. POWERED_BY: "powered by",
  13670. POWERED_BY_CAPS: "POWERED BY",
  13671. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13672. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13673. PRESENTED_BY: "Presented by ",
  13674. MORE: "全て表示 ",
  13675. LESS: "閉じる ",
  13676. TAG_CONTENT: "tag™コンテンツ ",
  13677. SHOW: "表示",
  13678. HIDE: "非表示",
  13679. DOLLHOUSE: "ドールハウス",
  13680. FLOOR_PLAN: "フロアプラン",
  13681. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13682. CLOSE_HIGHLIGHTS: "閉じる",
  13683. PREVIOUS: "前へ",
  13684. PLAY: "再生",
  13685. PAUSE: "一時停止",
  13686. NEXT: "次へ",
  13687. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13688. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13689. SOCIAL_SHARING: "このSpaceを共有する",
  13690. VIEW_IN_VR: "VRで表示",
  13691. VIEW_FULLSCREEN: "フルスクリーン表示",
  13692. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13693. ZOOM_IN: "ズームイン",
  13694. ZOOM_OUT: "ズームアウト",
  13695. FLOOR_NAME: "フロア ",
  13696. FLOOR_ALL: "すべて",
  13697. TERMS: "規約",
  13698. PORT_TERMS: "port規約",
  13699. TERMS_OF_USE: "利用規約",
  13700. CLOSE_TERMS: "閉じる",
  13701. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13702. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13703. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13704. WEBVR_ENTER_WEBVR: "VRに入る",
  13705. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13706. WEBVR_LEARN_MORE: "もっと詳しく",
  13707. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13708. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13709. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13710. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13711. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13712. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13713. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13714. VR_PREVIOUS_CAPS: "前へ",
  13715. VR_NEXT_CAPS: "次へ",
  13716. VR_GOT_IT_CAPS: "了解",
  13717. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13718. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13719. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13720. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13721. VR_WHAT_YOU_NEED: "必要なもの",
  13722. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13723. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13724. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13725. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13726. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13727. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13728. VR_APP: "port VRアプリ",
  13729. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13730. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13731. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13732. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13733. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13734. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13735. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13736. VR_ANDROID_DVICES: "Androidデバイス",
  13737. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13738. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13739. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13740. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13741. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13742. VR_APP_OPEN: "port VRアプリで開く",
  13743. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13744. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13745. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13746. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13747. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13748. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13749. SHARE_TO: "共有先",
  13750. SHARE_LINK: "ダイレクトリンク",
  13751. SHARE_EXPLORE: "探索",
  13752. SHARE_AT: "場所",
  13753. SHARE_WITH: "使用アプリ",
  13754. SHARE_3D: "3Dで",
  13755. SHARE_COPIED: "コピーされました!",
  13756. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13757. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13758. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13759. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13760. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13761. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13762. ERROR_GENERIC_ACTIONS_3: "または",
  13763. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13764. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13765. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13766. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13767. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13768. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13769. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13770. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13771. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13772. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13773. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13774. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13775. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13776. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13777. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13778. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13779. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13780. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13781. LINK_TO_LOCATION: "ロケーションへのリンク",
  13782. MENU_COPY: "コピー",
  13783. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13784. ROTATE: "回転",
  13785. MOVE: "移動",
  13786. INSIDE: "内側",
  13787. ZOOM: "ズーム",
  13788. HELP: "ヘルプ",
  13789. HELP_NAVIGATION_TAB: "ナビゲーション",
  13790. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13791. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13792. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13793. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13794. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13795. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13796. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13797. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13798. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13799. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13800. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13801. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13802. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13803. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13804. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13805. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13806. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13807. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13808. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13809. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13810. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13811. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13812. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13813. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13814. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13815. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13816. HELP_MORE_HLR_A: "ハイライト",
  13817. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13818. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13819. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13820. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13821. HELP_MORE_FLOORS_A: "フロアセレクター",
  13822. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13823. HELP_MORE_TAG_A: "tag™ Posts",
  13824. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13825. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13826. HELP_MORE_ZOOM_A: "ズームコントロール",
  13827. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13828. HELP_MORE_TOUR_A: "ツアーコントロール",
  13829. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13830. HELP_MORE_INSIDE_A: "内側ビュー",
  13831. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13832. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13833. HELP_MORE_VR_A: "VRモード",
  13834. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13835. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13836. HELP_MORE_360_A: "360° Views",
  13837. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13838. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13839. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13840. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13841. CLOSE: "閉じる"
  13842. }
  13843. }
  13844. , {}],
  13845. 115: [function(e, t, i) {
  13846. "use strict";
  13847. t.exports = {
  13848. PAGE_TITLE: "port 3D Showcase",
  13849. LOADING: "Загрузка",
  13850. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13851. POWERED_BY: "разработано на платформе ",
  13852. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13853. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13854. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13855. PRESENTED_BY: "Представлено ",
  13856. MORE: "Больше ",
  13857. LESS: "Меньше ",
  13858. TAG_CONTENT: "tag™ Контент",
  13859. SHOW: "Показать",
  13860. HIDE: "Скрыть",
  13861. DOLLHOUSE: "Dollhouse",
  13862. FLOOR_PLAN: "Планировка",
  13863. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13864. CLOSE_HIGHLIGHTS: "Закрыть",
  13865. PREVIOUS: "Предыдущий",
  13866. PLAY: "Воспроизвести",
  13867. PAUSE: "Пауза",
  13868. NEXT: "Следующий",
  13869. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13870. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13871. SOCIAL_SHARING: "Поделиться этой моделью",
  13872. VIEW_IN_VR: "Посмотреть в VR",
  13873. VIEW_FULLSCREEN: "Полный экран",
  13874. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13875. ZOOM_IN: "Увеличить",
  13876. ZOOM_OUT: "Уменьшить",
  13877. FLOOR_NAME: "Этаж ",
  13878. FLOOR_ALL: "Все",
  13879. TERMS: "Условия",
  13880. PORT_TERMS: "Правила пользования",
  13881. TERMS_OF_USE: "Условия использования",
  13882. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13883. CLOSE_TERMS: "Закрыть",
  13884. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13885. HELP: "Помощь",
  13886. HELP_NAVIGATION_TAB: "Навигация",
  13887. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13888. CLOSE: "Закрыть",
  13889. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13890. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13891. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13892. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13893. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13894. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13895. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13896. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13897. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13898. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13899. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13900. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13901. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13902. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13903. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13904. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13905. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13906. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13907. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13908. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13909. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13910. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13911. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13912. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13913. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13914. HELP_MORE_HLR_A: "Фотоколлаж",
  13915. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13916. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13917. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13918. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13919. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13920. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13921. HELP_MORE_TAG_A: "tag™ Posts",
  13922. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13923. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13924. HELP_MORE_ZOOM_A: "Масштаб",
  13925. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13926. HELP_MORE_TOUR_A: "Управление Туром",
  13927. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13928. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13929. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13930. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13931. HELP_MORE_VR_A: "Режим VR",
  13932. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13933. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13934. HELP_MORE_360_A: "360° Views",
  13935. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13936. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13937. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13938. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13939. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13940. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13941. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13942. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13943. WEBVR_LEARN_MORE: "Узнать больше",
  13944. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13945. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13946. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13947. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13948. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13949. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13950. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13951. VR_APP: "port VR App",
  13952. VR_APP_OPEN: "Или открыть через приложение port VR",
  13953. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13954. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13955. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13956. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13957. VR_VIEW_SPACE: "Запустить модель в VR",
  13958. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13959. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13960. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13961. VR_GOT_IT_CAPS: "ЯСНО",
  13962. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13963. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13964. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13965. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13966. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13967. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13968. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13969. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13970. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13971. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13972. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13973. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13974. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13975. VR_ANDROID_DVICES: "Android устройства",
  13976. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13977. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13978. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13979. VR_DOWNLOAD_HERE: "Скачать здесь",
  13980. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13981. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13982. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13983. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13984. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13985. SHARE_TO: "Поделиться",
  13986. SHARE_LINK: "Прямая ссылка",
  13987. SHARE_EXPLORE: "просмотреть",
  13988. SHARE_AT: "на",
  13989. SHARE_WITH: "с",
  13990. SHARE_3D: "в 3D",
  13991. SHARE_COPIED: "Скопировано!",
  13992. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13993. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13994. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13995. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13996. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13997. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13998. ERROR_GENERIC_ACTIONS_3: " или ",
  13999. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14000. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14001. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14002. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14003. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14004. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14005. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14006. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14007. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14008. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14009. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14010. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14011. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14012. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14013. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14014. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14015. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14016. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14017. LINK_TO_LOCATION: "Ссылка на местоположение",
  14018. MENU_COPY: "Копировать",
  14019. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14020. ROTATE: "Вращать",
  14021. MOVE: "Передвигаться",
  14022. INSIDE: "Вид изнутри",
  14023. ZOOM: "Масштаб"
  14024. }
  14025. }
  14026. , {}],
  14027. 116: [function(e, t, i) {//main.js
  14028. (function(t) {
  14029. "use strict";
  14030. function i() {
  14031. var e = Y.getModelIDFromQueryString();
  14032. if (!e)
  14033. return b(null, "loading-failed");
  14034. var t = Y.parseSidUrl(e)
  14035. , i = l()
  14036. , a = c()
  14037. , s = o()
  14038. , u = V.quickstart.enabled
  14039. , g = null
  14040. , m = null
  14041. , v = null
  14042. , w = null
  14043. , T = null
  14044. , x = null
  14045. , S = null
  14046. , M = null
  14047. , R = null
  14048. , P = null
  14049. , O = null
  14050. , L = null
  14051. , N = new ue;
  14052. r(s);
  14053. /* h({ //MP开头写法
  14054. urlBase: t.urlBase
  14055. }).then...... */
  14056. $.ajax("data/"+window.number+"/someData.json",{dataType: "json"}).done( function(e){ //改
  14057. e.files.templates[0] = e.files.templates[0].replace("{{number}}",window.number);
  14058. window.MP_PREFETCHED_MODELDATA = e;
  14059. h({
  14060. urlBase: t.urlBase
  14061. })//xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14062. }).then(function(i) {
  14063. return re.init(),
  14064. d(t, e) //getModel and load
  14065. }).then(function(e) {
  14066. return P = e,
  14067. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14068. startSource: i,
  14069. autoplay: V.autoplay,
  14070. quickstart: u
  14071. }),
  14072. P.urls.init()
  14073. }).then(function() {
  14074. return P.loadPanos()
  14075. }).then(function() {
  14076. m = X.getStartCameraOptions(P, P.panos),
  14077. S = A(P),
  14078. O = y(u, m.mode),
  14079. v = O.controls,
  14080. w = O.player,
  14081. T = O.director,
  14082. x = O.tagManager,
  14083. M = O.tileDownloader,
  14084. R = O.qualityManager,
  14085. L = O.panoRenderer,
  14086. C(P, S, O, s),
  14087. w.director = T,//xzw add
  14088. P.supportsTiles && M.start(),
  14089. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14090. u = !1);
  14091. var e = null;
  14092. if (u) {
  14093. de.warn("Quickstart engaged. Hold on to your knickers.");
  14094. var t = v.controls[D.PANORAMA];
  14095. g = new ie(R,S.scene,S.camera,t,s),
  14096. _(S, s, P),
  14097. e = g.load(m).then(function() {
  14098. S.addComponent(g),
  14099. S.once(le.AfterRender, function() {
  14100. de.warn("First render after quickstart load finished.")
  14101. })
  14102. })
  14103. }
  14104. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14105. }).then(function() {
  14106. return f(P, U.onProgress, i, !u, a)
  14107. }).then(function() {
  14108. if (m.quickstart = u,
  14109. I(P, S, O, s),
  14110. S.started || _(S, s, P),
  14111. H.modelLoaded(P, w, v, V.autoplay),
  14112. E(w, P, m, V.autoplay).done(function() {
  14113. T.autoTour()
  14114. }),
  14115. !P.supportsTiles) {
  14116. var e = new Z(P,w);
  14117. e.start()
  14118. }
  14119. u && (S.removeComponent(g),
  14120. g.destroy(),
  14121. m.pano.enter()),
  14122. U.init(P, T, w, v, S, m, H.getSessionId()),
  14123. U.endLoading(P, T, x),
  14124. S.once(le.AfterRender, function() {
  14125. N.setAppReadyTime();
  14126. var e = N.calcFullLoadingTime();
  14127. de.warn("Total load time: " + e / 1e3),
  14128. H.loadComplete(e),
  14129. de.warn("First render after model load finished.")
  14130. }),
  14131. S.on(le.MemoryUsageUpdated, n)
  14132. }).fail(b.bind(this, e))
  14133. }
  14134. function n(e) {
  14135. ce.update(e)
  14136. }
  14137. function r(e) {
  14138. de.info("Version", "2.25.6-0-gd87e5b1"),
  14139. q.defaultMaxListeners = 1e3,
  14140. a(e),
  14141. s()
  14142. }
  14143. function o() {
  14144. return document.getElementById("player")
  14145. }
  14146. function a(e) {
  14147. e.addEventListener("dragenter", T, !1),
  14148. e.addEventListener("dragover", T, !1)
  14149. }
  14150. function s() {
  14151. F.valueFromHash("title", !0) || $(document).ready(function() {
  14152. var e = $(".model-title");
  14153. e.hide()
  14154. })
  14155. }
  14156. function l() {
  14157. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14158. }
  14159. function c() {
  14160. return {
  14161. panoElementsToLoad: 6,
  14162. modelElementsToLoad: 0,
  14163. totalElementsLoaded: 0,
  14164. totalElementsToLoad: 0,
  14165. totalPercentageLoaded: 0,
  14166. progressCallback: null
  14167. }
  14168. }
  14169. function h(e) {
  14170. return K.loadFeatureFlags(e).done(function(e) {
  14171. K.updateDependentSettings(e, V)
  14172. })
  14173. }
  14174. function u(e) {
  14175. return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14176. responseType: "json",
  14177. prefetchFrom: "config"
  14178. }).then(function(e) {
  14179. return e ? void j.extendObject(V.appConfig, e) : {}
  14180. }, function(e) {
  14181. return de.warn("Failed loading runtime config, using defaults."),
  14182. $.when({})
  14183. })
  14184. }
  14185. function d(e, t) {
  14186. var i = B.getModel({
  14187. url: t,
  14188. floors: F.valueFromHash("f", !0),
  14189. autoload: !1
  14190. })
  14191. , n = u({
  14192. urlBase: e.urlBase
  14193. });
  14194. return $.when(i, n).then(null, function(e) {
  14195. return this
  14196. })
  14197. }
  14198. function p(e, t, i, n, r) {
  14199. de.info("Model data loaded"),
  14200. de.debug("UUID: " + e.data.job.uuid),
  14201. J.init(K.getFlags()),
  14202. i && H.initKeen({
  14203. token: i,
  14204. appId: n
  14205. }),
  14206. H.initSegment({
  14207. model: e.sid,
  14208. version: "2.25.6-0-gd87e5b1",
  14209. startSource: r.startSource,
  14210. token: t,
  14211. autoplay: r.autoplay,
  14212. quickstart: r.quickstart
  14213. })
  14214. }
  14215. function f(e, t, i, n, r) {
  14216. return r.progressCallback = t,
  14217. H.sessionStart(),
  14218. e.load(n).progress(g.bind(this, r))
  14219. }
  14220. function g(e, t) {
  14221. e.modelElementsToLoad = t[1],
  14222. v(e),
  14223. m(e)
  14224. }
  14225. function m(e) {
  14226. e.totalElementsLoaded++,
  14227. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14228. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14229. }
  14230. function v(e) {
  14231. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14232. }
  14233. function A(e) {
  14234. var t = new x.PerspectiveCamera;
  14235. t.layers.enable(he.PANOMARKERS),
  14236. t.layers.enable(he.RETICULE),
  14237. t.layers.enable(he.TAG);
  14238. var i = new x.Scene
  14239. , n = new x.AmbientLight(16777215);
  14240. i.add(n),
  14241. i.skybox = new W,
  14242. i.add(i.skybox),
  14243. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14244. side: x.DoubleSide
  14245. })),
  14246. i.plane.position.y = 0,
  14247. i.plane.rotateX(-Math.PI / 2),
  14248. i.plane.material.visible = !1,
  14249. i.add(i.plane),
  14250. i.updateMatrixWorld(),
  14251. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14252. if (e.metadata && e.metadata.camera_position) {
  14253. var t = e.metadata.camera_position
  14254. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14255. n.position = t.clone(),
  14256. i.add(n);
  14257. var r = e.metadata.camera_quaternion
  14258. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14259. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14260. }
  14261. }),
  14262. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14263. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14264. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14265. var r = new te(i,t,z);
  14266. return r
  14267. }
  14268. function y(e, t) {
  14269. var i = e ? 1 : 1e3
  14270. , n = J.tilegen || J.imgopt ? 6 : 2;
  14271. n = F.valueFromHash("tileconc", n);
  14272. var r = new ne
  14273. , o = new ae({
  14274. concurrentDownloads: n
  14275. })
  14276. , a = new se
  14277. , s = new P
  14278. , l = new M
  14279. , c = new S(t)
  14280. , h = new R
  14281. , u = new O(i)
  14282. , d = new L
  14283. , p = new oe;
  14284. return {
  14285. qualityManager: r,
  14286. panoRenderer: a,
  14287. tileDownloader: o,
  14288. player: c,
  14289. director: l,
  14290. modelManager: s,
  14291. tagManager: p,
  14292. displayController: u,
  14293. labelDisplayController: d,
  14294. controls: h
  14295. }
  14296. }
  14297. function C(e, t, i, n) {
  14298. var r = i.controls
  14299. , o = i.qualityManager
  14300. , a = i.panoRenderer
  14301. , s = i.tileDownloader
  14302. , l = i.modelManager;
  14303. r.init(n, l),
  14304. ee.init(i.director, r, i.player, l, t),
  14305. o.init(l),
  14306. s.init(o),
  14307. a.init(t, s, o),
  14308. l.init(s, a, o),
  14309. l.addModel(e),
  14310. t.addComponent(G)
  14311. }
  14312. function I(e, t, i, n) {
  14313. var r = i.qualityManager
  14314. , o = i.panoRenderer
  14315. , a = i.tileDownloader
  14316. , s = i.modelManager
  14317. , l = i.player
  14318. , c = i.director
  14319. , h = i.tagManager
  14320. , u = i.displayController
  14321. , d = i.labelDisplayController
  14322. , p = i.controls;
  14323. t.scene.add(e),
  14324. t.qualityManager = r;
  14325. var f = {
  14326. camera: t.camera,
  14327. director: c,
  14328. modelManager: s,
  14329. tileDownloader: a,
  14330. panoRenderer: o,
  14331. qualityManager: r,
  14332. tagManager: h,
  14333. container: n,
  14334. controls: p
  14335. };
  14336. l.init(f),
  14337. l.setScene(t.scene),
  14338. h.init(s, l),
  14339. c.init(l, s),
  14340. u.init(c, l, s, h, n),
  14341. d.init(l, s, n),
  14342. z.bindEvents(l),
  14343. t.addComponent(h),
  14344. t.addComponent(l),
  14345. t.addComponent(o)
  14346. l.sceneRenderer = t; //xzw add 方便resize
  14347. }
  14348. function E(e, t, i, n) {
  14349. return de.info("Starting player in " + i.mode),
  14350. H.report(t.sid, "started-playing", n, i.quickstart),
  14351. e.start(i)
  14352. }
  14353. function b(e, t) {
  14354. de.error(t),
  14355. k.error(t),
  14356. H.report(e, "error-" + t)
  14357. }
  14358. function w(e) {
  14359. var t = F.details();
  14360. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14361. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14362. H.report(e, "error-webgl-generic"))
  14363. }
  14364. function _(e, t, i) {
  14365. try {
  14366. e.start(t)
  14367. } catch (e) {
  14368. throw de.warn(e.message),
  14369. w(i.sid),
  14370. e
  14371. }
  14372. }
  14373. function T(e) {
  14374. e.stopPropagation(),
  14375. e.preventDefault()
  14376. }
  14377. e("./lib/three75-shim"),
  14378. e("./lib/array-polyfill"),
  14379. e("./lib/performance-polyfill"),
  14380. e("./lib/shaders/CopyShader.js"),
  14381. e("./lib/shaders/HorizontalBlurShader.js"),
  14382. e("./lib/shaders/VerticalBlurShader.js"),
  14383. e("./lib/postprocessing/EffectComposer.js"),
  14384. e("./lib/postprocessing/RenderPass.js"),
  14385. e("./lib/postprocessing/MaskPass.js"),
  14386. e("./lib/postprocessing/ShaderPass.js"),
  14387. window.Promise || (window.Promise = e("promise-polyfill"));
  14388. var x = e("three")
  14389. , S = (e("./util/sentry"),
  14390. e("./player"))
  14391. , M = e("./director")
  14392. , R = e("./controls/CameraControls")
  14393. , P = e("./model/ModelManager")
  14394. , O = e("./DisplayController")
  14395. , L = e("./label/LabelDisplayController")
  14396. , D = e("./enum/Viewmode")
  14397. , N = e("./util/logger")
  14398. , B = e("./showcase")
  14399. , F = e("./util/browser")
  14400. , V = e("./settings")
  14401. , U = e("./gui/gui")
  14402. , k = e("./gui/error")
  14403. , H = e("./analytics")
  14404. , G = e("./util/transitions")
  14405. , z = e("./effects")
  14406. , W = e("./objects/Skybox")
  14407. , j = e("./util/common")
  14408. , Y = (e("./util/PanoramaCollection"),
  14409. e("./util/math"),
  14410. e("./util/showcase"))
  14411. , X = e("./util/camera")
  14412. , Z = (e("./objects/Panorama"),
  14413. e("./cameras/PanoramaCamera"),
  14414. e("./preloaders"))
  14415. , q = e("events").EventEmitter
  14416. , K = e("./featureflags")
  14417. , Q = (e("./util/lerp"),
  14418. e("./util/ajax"))
  14419. , J = e("./ab")
  14420. , ee = e("./sdk/automation.js")
  14421. , te = e("./scene/SceneRenderer")
  14422. , ie = e("./scene/QuickstartManager")
  14423. , ne = e("./tile/QualityManager.js")
  14424. , re = e("./localization/localize")
  14425. , oe = e("./tag/tagManager")
  14426. , ae = e("./tile/TileDownloader")
  14427. , se = e("./tile/PanoRenderer")
  14428. , le = (e("./enum/PanoSizeClass"),
  14429. e("./enum/PanoramaEvents"),
  14430. e("./enum/SceneRendererEvents"))
  14431. , ce = e("./gui/memoryUsage")
  14432. , he = e("./enum/RenderLayers")
  14433. , ue = e("./TimingData")
  14434. , de = new N(t);
  14435. N.level = V.logLevel,
  14436. N.consoleEnabled = V.console,
  14437. i()
  14438. }
  14439. ).call(this, "/js/main.js")
  14440. }
  14441. , {
  14442. "./DisplayController": 1,
  14443. "./TimingData": 2,
  14444. "./ab": 3,
  14445. "./analytics": 4,
  14446. "./cameras/PanoramaCamera": 7,
  14447. "./controls/CameraControls": 9,
  14448. "./director": 15,
  14449. "./effects": 16,
  14450. "./enum/PanoSizeClass": 36,
  14451. "./enum/PanoramaEvents": 37,
  14452. "./enum/RenderLayers": 41,
  14453. "./enum/SceneRendererEvents": 43,
  14454. "./enum/Viewmode": 51,
  14455. "./featureflags": 59,
  14456. "./gui/error": 64,
  14457. "./gui/gui": 65,
  14458. "./gui/memoryUsage": 73,
  14459. "./label/LabelDisplayController": 91,
  14460. "./lib/array-polyfill": 92,
  14461. "./lib/performance-polyfill": 95,
  14462. "./lib/postprocessing/EffectComposer.js": 96,
  14463. "./lib/postprocessing/MaskPass.js": 97,
  14464. "./lib/postprocessing/RenderPass.js": 98,
  14465. "./lib/postprocessing/ShaderPass.js": 99,
  14466. "./lib/shaders/CopyShader.js": 100,
  14467. "./lib/shaders/HorizontalBlurShader.js": 101,
  14468. "./lib/shaders/VerticalBlurShader.js": 102,
  14469. "./lib/three75-shim": 103,
  14470. "./localization/localize": 108,
  14471. "./tag/tagManager": 124,
  14472. "./model/ModelManager": 140,
  14473. "./objects/Panorama": 148,
  14474. "./objects/Skybox": 152,
  14475. "./player": 155,
  14476. "./preloaders": 156,
  14477. "./scene/QuickstartManager": 157,
  14478. "./scene/SceneRenderer": 158,
  14479. "./sdk/automation.js": 164,
  14480. "./settings": 166,
  14481. "./showcase": 168,
  14482. "./tile/PanoRenderer": 169,
  14483. "./tile/QualityManager.js": 170,
  14484. "./tile/TileDownloader": 171,
  14485. "./util/PanoramaCollection": 178,
  14486. "./util/ajax": 181,
  14487. "./util/browser": 182,
  14488. "./util/camera": 183,
  14489. "./util/common": 185,
  14490. "./util/lerp": 188,
  14491. "./util/logger": 189,
  14492. "./util/math": 190,
  14493. "./util/sentry": 192,
  14494. "./util/showcase": 193,
  14495. "./util/transitions": 195,
  14496. events: 202,
  14497. "promise-polyfill": 213,
  14498. three: 217
  14499. }],
  14500. 117: [function(e, t, i) {
  14501. "use strict";
  14502. function n(e) {
  14503. e = e || {},
  14504. r.RawShaderMaterial.call(this, a.extendObject({
  14505. fragmentShader: o.cube.fragmentShader,
  14506. vertexShader: o.cube.vertexShader,
  14507. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14508. name: "CubemapMaterial"
  14509. }, e))
  14510. }
  14511. var r = e("three")
  14512. , o = e("../shaders")
  14513. , a = e("../util/common");
  14514. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14515. n.prototype.constructor = n,
  14516. t.exports = n
  14517. }
  14518. , {
  14519. "../shaders": 167,
  14520. "../util/common": 185,
  14521. three: 217
  14522. }],
  14523. 118: [function(e, t, i) {
  14524. "use strict";
  14525. function n(e) {
  14526. e = e || {},
  14527. r.RawShaderMaterial.call(this, a.extendObject({
  14528. fragmentShader: o.model.fragmentShader,
  14529. vertexShader: o.model.vertexShader,
  14530. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14531. name: "ModelTextureMaterial"
  14532. }, e))
  14533. }
  14534. var r = e("three")
  14535. , o = e("../shaders")
  14536. , a = e("../util/common");
  14537. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14538. n.prototype.constructor = n,
  14539. n.prototype.setProjectedPanos = function(e, t, i) {
  14540. i && (this.uniforms.progress.value = 0),
  14541. e.ensureSkyboxReadyForRender(),
  14542. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14543. this.uniforms.pano0Position.value.copy(e.position),
  14544. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14545. t.ensureSkyboxReadyForRender(),
  14546. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14547. this.uniforms.pano1Position.value.copy(t.position),
  14548. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14549. }
  14550. ,
  14551. t.exports = n
  14552. }
  14553. , {
  14554. "../shaders": 167,
  14555. "../util/common": 185,
  14556. three: 217
  14557. }],
  14558. 119: [function(e, t, i) {
  14559. (function(i) {
  14560. "use strict";
  14561. function n(e, t, i, n) {
  14562. this.div = null,
  14563. this.body = null,
  14564. this.label = e,
  14565. this.description = t,
  14566. this.parsedDescription = [],
  14567. this.media = i || {
  14568. type: null
  14569. },
  14570. this.loadingSpinner = null,
  14571. this.parser = new r({
  14572. supportLinks: !u.valueFromHash("mls"),
  14573. keepLinkLabels: !0
  14574. }),
  14575. this.state = I.CLOSED,
  14576. this.orientation = "",
  14577. this.initialTransform = "",
  14578. this.hovering = !1,
  14579. this.openTransition = null,
  14580. this.closeTransition = null,
  14581. this.openPromise = null,
  14582. this.closePromise = null,
  14583. this.animationTransition = null,
  14584. this.animationScale = 0
  14585. }
  14586. var r = e("../Parser/DescriptionParser")
  14587. , o = e("../Media/Link")
  14588. , a = e("../Media/Image")
  14589. , s = e("../Media/EmbedlyPlayer")
  14590. , l = e("../Media/EmbedlyEmbed")
  14591. , c = e("../../util/transitions")
  14592. , h = e("../../util/lerp")
  14593. , u = e("../../util/browser")
  14594. , d = e("./BillboardEvent")
  14595. , p = e("../Media/MediaEvent")
  14596. , f = e("../Parser/DescriptionChunkType")
  14597. , g = e("events").EventEmitter
  14598. , m = e("./billboardSettings")
  14599. , v = e("./overlaySettings")
  14600. , A = e("../../util/logger")
  14601. , y = new A(i)
  14602. , C = document.getElementById("tag-billboards");
  14603. C.addEventListener("touchend", function(e) {
  14604. C.style.pointerEvents = "none"
  14605. }),
  14606. C.addEventListener("touchcancel", function(e) {
  14607. C.style.pointerEvents = "none"
  14608. });
  14609. var I = {
  14610. CLOSED: "closed",
  14611. OPENING: "opening",
  14612. OPEN: "open",
  14613. CLOSING: "closing",
  14614. ACTIVE: "active"
  14615. };
  14616. n.prototype = Object.create(g.prototype),
  14617. n.prototype.build = function(e) {
  14618. this.parsedDescription = this.parser.parse(this.description);
  14619. var t = document.createElement("div");
  14620. t.className = "tag-container has-hotzone",
  14621. this.div = t,
  14622. this.body = document.createElement("div"),
  14623. this.body.className = "tag-body";
  14624. var i = document.createElement("div");
  14625. i.classList.add("tag-content");
  14626. var n = document.createElement("div");
  14627. n.classList.add("tag-text-content");
  14628. var r = document.createElement("div");
  14629. r.className = "tag-label",
  14630. r.textContent = this.label,
  14631. n.appendChild(r);
  14632. var o = document.createElement("div");
  14633. o.className = "tag-desc",
  14634. n.appendChild(o),
  14635. i.appendChild(n),
  14636. this.body.appendChild(i),
  14637. this.appendDescriptionElements(this.parsedDescription, o),
  14638. this.appendMedia(),
  14639. t.appendChild(this.body),
  14640. C.appendChild(t),
  14641. this.bindEvents(t, this.body)
  14642. }
  14643. ,
  14644. n.prototype.bindEvents = function(e, t) {
  14645. var i = function(e) {
  14646. return function(t) {
  14647. if (!this.div.classList.contains("overlay")) {
  14648. var i, n = document.getElementById("player");
  14649. try {
  14650. i = new MouseEvent(e,t)
  14651. } catch (n) {
  14652. i = document.createEvent("MouseEvents"),
  14653. i.initMouseEvent(e, t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  14654. }
  14655. n.dispatchEvent(i)
  14656. }
  14657. }
  14658. };
  14659. t.addEventListener("mousedown", function(e) {
  14660. e.stopPropagation()
  14661. }),
  14662. t.addEventListener("mouseup", function(e) {
  14663. e.stopPropagation()
  14664. }),
  14665. e.addEventListener("touchstart", function(e) {
  14666. C.style.pointerEvents = "auto"
  14667. }),
  14668. e.addEventListener("mousedown", i("mousedown").bind(this)),
  14669. e.addEventListener("mouseup", i("mouseup").bind(this)),
  14670. t.addEventListener("mouseover", function(t) {
  14671. this.state === I.OPEN && e.classList.remove("has-hotzone")
  14672. }
  14673. .bind(this)),
  14674. e.addEventListener("mouseenter", function(e) {
  14675. this.state !== I.CLOSING && (this.hovering = !0,
  14676. this.emit(d.ENTER))
  14677. }
  14678. .bind(this)),
  14679. e.addEventListener("mouseleave", function(e) {
  14680. this.hovering = !1,
  14681. this.emit(d.LEAVE)
  14682. }
  14683. .bind(this)),
  14684. e.addEventListener("gesturestart", function(e) {
  14685. e.preventDefault()
  14686. });
  14687. var n = e.querySelector(".tag-text-content")
  14688. , r = 0;
  14689. n.addEventListener("touchstart", function(e) {
  14690. r = e.changedTouches[0].clientY
  14691. }),
  14692. n.addEventListener("touchmove", function(t) {
  14693. function i(e) {
  14694. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14695. }
  14696. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  14697. }),
  14698. e.addEventListener("touchmove", function(e) {
  14699. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14700. })
  14701. }
  14702. ,
  14703. n.prototype.appendDescriptionElements = function(e, t) {
  14704. e.length > 0 && this.div.classList.add("has-text"),
  14705. e.forEach(function(e, i) {
  14706. switch (e.type) {
  14707. case f.TEXT:
  14708. t.appendChild(this.createTextElement(e.text));
  14709. break;
  14710. case f.LINK:
  14711. t.appendChild(this.createLinkElement(e.link))
  14712. }
  14713. }
  14714. .bind(this))
  14715. }
  14716. ,
  14717. n.prototype.appendLoadingSpinner = function() {
  14718. this.loadingSpinner = document.createElement("div"),
  14719. this.loadingSpinner.classList.add("loading-spinner");
  14720. var e = document.createElement("div");
  14721. e.classList.add("gui-spinner-icon"),
  14722. this.loadingSpinner.appendChild(e),
  14723. this.body.appendChild(this.loadingSpinner)
  14724. }
  14725. ,
  14726. n.prototype.onMediaLoadFinished = function() {
  14727. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14728. this.applyOrientation(this.orientation),
  14729. this.loadingSpinner = null)
  14730. }
  14731. ,
  14732. n.prototype.appendMedia = function() {
  14733. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  14734. this.appendLoadingSpinner();
  14735. var e = document.createElement("div");
  14736. e.classList.add("tag-media-content");
  14737. var t = document.createElement("i");
  14738. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14739. t.classList.add(e)
  14740. }),
  14741. this.body.appendChild(t),
  14742. this.body.appendChild(e),
  14743. this.media.type) {
  14744. case f.IMAGE:
  14745. e.appendChild(this.createImageElement(this.media, this.body));
  14746. break;
  14747. case f.VIDEO:
  14748. e.appendChild(this.createVideoElement(this.media, this.body));
  14749. break;
  14750. case f.RICH:
  14751. e.appendChild(this.createEmbedElement(this.media, this.body))
  14752. }
  14753. }
  14754. }
  14755. ,
  14756. n.prototype.createTextElement = function(e) {
  14757. var t = document.createElement("span");
  14758. return t.textContent = e,
  14759. t
  14760. }
  14761. ;
  14762. n.prototype.createLinkElement = function(e) {
  14763. var t = new o(e);
  14764. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  14765. t.createDomElement()
  14766. }
  14767. ,
  14768. n.prototype.createImageElement = function(e, t) {
  14769. function i() {
  14770. function e() {
  14771. m || (r.classList.remove("view-image"),
  14772. c.classList.add("overlay"),
  14773. i(),
  14774. window.addEventListener("resize", b),
  14775. c.addEventListener("click", a),
  14776. g.addEventListener("click", l),
  14777. f.addEventListener("click", s),
  14778. m = !0,
  14779. o.emit(p.IMAGE_OPENED))
  14780. }
  14781. function i() {
  14782. t.classList.add("show-info"),
  14783. h.classList.remove("collapsible"),
  14784. h.style.height = "";
  14785. var e = parseFloat(getComputedStyle(I).lineHeight)
  14786. , i = y + e
  14787. , r = c.clientWidth - 2 * v.boundaryWidth - C
  14788. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  14789. , s = a
  14790. , l = s * n.aspect;
  14791. l > r && (l = r,
  14792. s = l / n.aspect),
  14793. s > a && (s = a,
  14794. l = s * n.aspect),
  14795. l += C,
  14796. s += C + i,
  14797. t.style.width = l + "px",
  14798. t.style.height = s + "px",
  14799. u.style.paddingTop = e + C + "px",
  14800. o.description.length > 0 && (h.classList.add("collapsible"),
  14801. h.style.height = h.clientHeight + 12 + "px",
  14802. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  14803. }
  14804. function a(e) {
  14805. e.target === c && s()
  14806. }
  14807. function s() {
  14808. m && (m = !1,
  14809. r.classList.add("view-image"),
  14810. c.classList.remove("overlay"),
  14811. h.style.height = "",
  14812. u.style.paddingTop = "",
  14813. t.style.width = "",
  14814. t.style.height = "",
  14815. window.removeEventListener("resize", b),
  14816. c.removeEventListener("click", a),
  14817. g.removeEventListener("click", l),
  14818. f.removeEventListener("click", s),
  14819. o.emit(p.IMAGE_CLOSED),
  14820. o.close(!0))
  14821. }
  14822. function l(e) {
  14823. t.classList.toggle("show-info")
  14824. }
  14825. var c = o.div
  14826. , h = c.getElementsByClassName("tag-content")[0]
  14827. , u = c.getElementsByClassName("tag-media-content")[0]
  14828. , f = t.getElementsByClassName("close")[0]
  14829. , g = h.getElementsByClassName("tag-label")[0];
  14830. c.classList.add("has-image"),
  14831. r.classList.add("view-image"),
  14832. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  14833. o.applyOrientation(o.orientation);
  14834. var m = !1
  14835. , A = getComputedStyle(h)
  14836. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  14837. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  14838. , I = h.querySelector(".tag-label")
  14839. , E = h.querySelector(".tag-desc")
  14840. , b = function() {
  14841. var e, t, n = 0;
  14842. return function() {
  14843. clearInterval(e),
  14844. clearTimeout(t),
  14845. e = setInterval(function() {
  14846. var e = c.clientHeight;
  14847. n !== e && (i(),
  14848. n = e)
  14849. }, 100),
  14850. t = setTimeout(clearInterval.bind(this, e), 1e3)
  14851. }
  14852. }();
  14853. n.on(p.IMAGE_OPENING, e),
  14854. o.on(d.ACTIVATE, e),
  14855. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  14856. o.on(d.CLOSING, s)
  14857. }
  14858. var n = new a
  14859. , r = n.createDomElement();
  14860. this.once(d.OPENED, function() {
  14861. n.load(e.src).then(i).catch(function(t) {
  14862. y.warn("Failed to load image:", e.src),
  14863. y.warn("with error:", t)
  14864. }).then(this.onMediaLoadFinished.bind(this))
  14865. });
  14866. var o = this;
  14867. return r
  14868. }
  14869. ,
  14870. n.prototype.createVideoElement = function(e, t) {
  14871. var i = new s({
  14872. autoPlay: !0,
  14873. autoResume: !0,
  14874. startMuted: !1,
  14875. loop: !1
  14876. })
  14877. , n = i.createDomElement();
  14878. return this.once(d.OPENED, function() {
  14879. i.load(e.src).then(function() {
  14880. this.div.classList.add("has-video"),
  14881. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  14882. i.play()),
  14883. this.on(d.OPENING, i.show.bind(i)),
  14884. this.on(d.OPENED, i.play.bind(i)),
  14885. this.on(d.CLOSING, i.pause.bind(i)),
  14886. this.on(d.CLOSED, i.hide.bind(i))
  14887. }
  14888. .bind(this)).catch(function(t) {
  14889. y.warn("Failed to embed video:", e.src),
  14890. y.warn("with error:", t)
  14891. }).then(this.onMediaLoadFinished.bind(this))
  14892. }
  14893. .bind(this)),
  14894. n
  14895. }
  14896. ,
  14897. n.prototype.createEmbedElement = function(e, t) {
  14898. var i = new l
  14899. , n = i.createDomElement();
  14900. return this.once(d.OPENED, function() {
  14901. i.load(e.src).then(function() {
  14902. this.div.classList.add("has-embed"),
  14903. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  14904. this.applyOrientation(this.orientation),
  14905. this.on(d.OPENING, i.show.bind(i)),
  14906. this.on(d.CLOSED, i.hide.bind(i))
  14907. }
  14908. .bind(this)).catch(function(t) {
  14909. y.warn("Failed to embed:", e.src),
  14910. y.warn("with error:", t)
  14911. }).then(this.onMediaLoadFinished.bind(this))
  14912. }
  14913. .bind(this)),
  14914. n
  14915. }
  14916. ,
  14917. n.prototype.open = function(e) {
  14918. return this.openPromise = $.Deferred(),
  14919. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14920. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  14921. this.state !== I.OPEN && (this.emit(d.OPENING),
  14922. e && this.emit(d.ACTIVATING),
  14923. this.state = I.OPENING,
  14924. this.animateOpen(function() {
  14925. e && this.setActiveState(),
  14926. this.openPromise.resolve()
  14927. }
  14928. .bind(this)))
  14929. }
  14930. .bind(this), m.animation.openDelay),
  14931. c.cancel(this.closeTransition),
  14932. this.closePromise && this.closePromise.reject(),
  14933. this.closeTransition = void 0,
  14934. this.openPromise.promise())
  14935. }
  14936. ,
  14937. n.prototype.close = function(e) {
  14938. return this.closePromise = $.Deferred(),
  14939. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  14940. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  14941. this.state = I.CLOSING,
  14942. this.animateClose())
  14943. }
  14944. .bind(this), m.animation.closeDelay)),
  14945. c.cancel(this.openTransition),
  14946. this.openPromise && this.openPromise.reject(),
  14947. this.openTransition = void 0,
  14948. this.closePromise.resolve(),
  14949. this.closePromise.promise())
  14950. }
  14951. ,
  14952. n.prototype.setActiveState = function() {
  14953. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  14954. this.emit(d.ACTIVATE),
  14955. this.div.classList.remove("has-hotzone"))
  14956. }
  14957. ,
  14958. n.prototype.animateOpen = function(e) {
  14959. if (this.state === I.OPENING) {
  14960. if (c.cancel(this.animationTransition),
  14961. u.detectSamsungNative())
  14962. return this.boardOrientation = null,
  14963. this.div.style.visibility = "visible",
  14964. this.emit(d.OPENED),
  14965. this.state = I.OPEN,
  14966. void (e && e());
  14967. this.div.style.webkitTransform = "scale(0)",
  14968. this.div.style.transform = "scale(0)",
  14969. this.div.style.visibility = "visible",
  14970. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  14971. this.emit(d.OPENED),
  14972. this.state = I.OPEN,
  14973. e && e()
  14974. }
  14975. .bind(this))
  14976. }
  14977. }
  14978. ,
  14979. n.prototype.animateClose = function(e) {
  14980. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  14981. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  14982. this.emit(d.CLOSED),
  14983. this.state = I.CLOSED,
  14984. this.div.style.visibility = "hidden",
  14985. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14986. e && e()
  14987. }
  14988. .bind(this)))
  14989. }
  14990. ,
  14991. n.prototype.needsUpdate = function() {
  14992. return this.state !== I.CLOSED
  14993. }
  14994. ,
  14995. n.prototype.update = function(e, t) {
  14996. if (this.needsUpdate()) {
  14997. var i = (this.updateOrientation(e),
  14998. this.calcScale(t))
  14999. , n = {
  15000. x: (e.x + 1) * $("#player").width() / 2,
  15001. y: (e.y + 1) * $("#player").height() / 2
  15002. };
  15003. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15004. this.div.style.webkitTransform = this.div.screenTransform,
  15005. this.div.style.transform = this.div.screenTransform
  15006. }
  15007. }
  15008. ,
  15009. n.prototype.getDimensions = function() {
  15010. return this.div.getBoundingClientRect()
  15011. }
  15012. ,
  15013. n.prototype.calcScale = function(e) {
  15014. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15015. }
  15016. ,
  15017. n.prototype.updateOrientation = function(e) {
  15018. if (this.state !== I.ACTIVE) {
  15019. var t = 1 / 3
  15020. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15021. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15022. , r = "";
  15023. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15024. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15025. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15026. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15027. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15028. }
  15029. }
  15030. ,
  15031. n.prototype.applyOrientation = function(e) {
  15032. this.div.style.transform = this.div.style.webkitTransform = "",
  15033. this.div.classList.remove("tag-container-" + this.orientation),
  15034. this.div.classList.add("tag-container-" + e);
  15035. var t = window.getComputedStyle(this.div);
  15036. this.initialTransform = t.transform || t.webkitTransform,
  15037. "none" === this.initialTransform && (this.initialTransform = "");
  15038. var i = t.transform.slice(7, -1).split(",")
  15039. , n = -i[4]
  15040. , r = -i[5];
  15041. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15042. this.div.style.transformOrigin = n + "px " + r + "px",
  15043. this.orientation = e
  15044. }
  15045. ,
  15046. t.exports = n
  15047. }
  15048. ).call(this, "/js/tag/Billboard/Billboard.js")
  15049. }
  15050. , {
  15051. "../../util/browser": 182,
  15052. "../../util/lerp": 188,
  15053. "../../util/logger": 189,
  15054. "../../util/transitions": 195,
  15055. "../Media/EmbedlyEmbed": 125,
  15056. "../Media/EmbedlyPlayer": 126,
  15057. "../Media/Image": 128,
  15058. "../Media/Link": 129,
  15059. "../Media/MediaEvent": 131,
  15060. "../Parser/DescriptionChunkType": 133,
  15061. "../Parser/DescriptionParser": 134,
  15062. "./BillboardEvent": 120,
  15063. "./billboardSettings": 121,
  15064. "./overlaySettings": 122,
  15065. events: 202
  15066. }],
  15067. 120: [function(e, t, i) {
  15068. "use strict";
  15069. t.exports = Object.freeze({
  15070. ENTER: "billboard.enter",
  15071. LEAVE: "billboard.leave",
  15072. OPENING: "billboard.opening",
  15073. OPENED: "billboard.open",
  15074. CLOSING: "billboard.closing",
  15075. CLOSED: "billboard.closed",
  15076. ACTIVATING: "billboard.activating",
  15077. ACTIVATE: "billboard.activate"
  15078. })
  15079. }
  15080. , {}],
  15081. 121: [function(e, t, i) {
  15082. "use strict";
  15083. t.exports = Object.freeze({
  15084. animation: Object.freeze({
  15085. hoverOnClosing: !1,
  15086. openDelay: 100,
  15087. closeDelay: 50,
  15088. openDuration: 200,
  15089. closeDuration: 100
  15090. }),
  15091. boardToDiscRatio: 1.2
  15092. })
  15093. }
  15094. , {}],
  15095. 122: [function(e, t, i) {
  15096. "use strict";
  15097. t.exports = Object.freeze({
  15098. boundaryWidth: 30,
  15099. boundaryHeight: 0
  15100. })
  15101. }
  15102. , {}],
  15103. "hot": [function(e, t, i) {//热点
  15104. "use strict";
  15105. function hot(sid,d,model){
  15106. this.sid = sid;
  15107. this.position = d.position;
  15108. this.rotation = d.rotation;
  15109. this.link = d.link;
  15110. this.model = model;
  15111. this.size = d.size;
  15112. this.build();
  15113. }
  15114. var r = e("three")
  15115. , f = e("../shaders")
  15116. , a = e("../settings")
  15117. , s = e("../enum/Viewmode")
  15118. , p = e("../objects/Panorama")
  15119. , te = e("../util/texture")
  15120. var raycaster = new r.Raycaster;
  15121. var geometry = new r.PlaneBufferGeometry( 0.13, 0.13,1,1);
  15122. var shaderMaterial = new r.ShaderMaterial( {
  15123. uniforms: f.hot.uniforms,
  15124. vertexShader: f.hot.vertexShader,
  15125. fragmentShader: f.hot.fragmentShader
  15126. });
  15127. shaderMaterial.transparent = true;
  15128. f.hot.uniforms.texture1.value = te.load("images/point2.png");
  15129. f.hot.uniforms.texture2.value = te.load("images/point2_light.png");
  15130. hot.prototype.build = function(){
  15131. var sprite = new r.Mesh( geometry, shaderMaterial );
  15132. sprite.dynamic = true;
  15133. sprite.position.copy(new r.Vector3().fromArray(this.position));
  15134. sprite.rotation.copy(new r.Euler().fromArray(this.rotation));
  15135. this.size && sprite.scale.set(this.size,this.size,this.size);
  15136. sprite.name = this.sid;
  15137. sprite.type = "hotSprite";
  15138. sprite.belongHot = this;
  15139. if(this.link) sprite.hotLink = this.link;
  15140. this.mesh = sprite;
  15141. this.model.add(sprite);
  15142. }
  15143. hot.prototype.closestPanoTowardTag = function(e, t) {
  15144. var i = []
  15145. , o = []
  15146. , l = this.mesh.position;
  15147. if (e === s.PANORAMA) {
  15148. var c = .5
  15149. , h = t.position.clone().sub(l).normalize();
  15150. i.push(p.filters.isPanoAligned()),
  15151. i.push(p.filters.inPanoDirection(l, h, c)),
  15152. i.push(p.filters.isNeighbourPanoTo(t)),
  15153. o.push(p.scoreFunctions.direction(l, h))
  15154. }
  15155. var u = new r.Vector3
  15156. , d = function(e) {
  15157. u.copy(l).sub(e.position);
  15158. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15159. , i = a.tags.navigate.tiltTolerance;
  15160. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15161. }
  15162. , f = function(e) {
  15163. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15164. };
  15165. i.push(f, d),
  15166. o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
  15167. var g = t.model.panos.sortByScore(i, o);
  15168. if (g && a.tags.navigate.lineOfSight) {
  15169. for (var m = 0; m < g.length; m++) {
  15170. var v = g[m].pano
  15171. , A = v.position.distanceTo(l);
  15172. raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15173. var y = raycaster.intersectObjects(t.model.colliders);
  15174. if (0 === y.length || y[0].distance > A)
  15175. return v
  15176. }
  15177. return null
  15178. }
  15179. return g && g.length > 0 && g[0].pano
  15180. },
  15181. hot.prototype.examine = function(e) {
  15182. var hotPop = document.getElementById('popup');
  15183. if(this.link){
  15184. g_currentHot = this;
  15185. hotPop.style.display = "block";
  15186. hotPop.classList.add("wait");
  15187. var myElement = document.createElement("iframe");
  15188. myElement.src = this.link;
  15189. myElement.id = "id1";
  15190. myElement.allowTransparency = "true";
  15191. myElement.style.width = "100%";
  15192. myElement.style.height = "100%";
  15193. myElement.scrolling = "no";
  15194. var element=document.getElementById("id1"); //??
  15195. if (typeof(element)== "undefined" || element == null){
  15196. document.getElementById("popup").appendChild(myElement);
  15197. }
  15198. setTimeout(function(){$('#player').on("click",e.closePopup);},20)
  15199. }
  15200. var t = e.mode
  15201. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15202. , n = this.mesh.position;
  15203. e.flyingToTag = true;
  15204. var o = function() {
  15205. e.flyingToTag = false;
  15206. if(this.link){
  15207. hotPop.classList.remove("wait");
  15208. }
  15209. }.bind(this);
  15210. if (t === s.PANORAMA){
  15211. var l = {
  15212. pano: i,
  15213. lookAtPoint: n,
  15214. duration: null,
  15215. maxDistanceOverride: null,
  15216. skipWarpingCheck: !1
  15217. };
  15218. e.flyToPano(l, o)
  15219. }else {
  15220. var c = {
  15221. pano: i
  15222. };
  15223. if (n) {
  15224. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15225. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15226. }
  15227. c.callback = o,
  15228. c.duration = 1500,
  15229. c.mode = s.PANORAMA,
  15230. e.flyToNewMode(c)
  15231. }
  15232. },
  15233. t.exports = hot;
  15234. }
  15235. , {
  15236. three: 217,
  15237. "../shaders":167,
  15238. "../enum/Viewmode":51,
  15239. "../objects/Panorama":148,
  15240. "../util/texture":194,
  15241. "../settings":166
  15242. }],
  15243. 123: [function(e, t, i) {//tag
  15244. (function(i) {
  15245. "use strict";
  15246. function n(e, t, i) {
  15247. var n = i.version || "0";
  15248. "0" !== n && I.info("tag defined using version " + n),
  15249. this.model = e,
  15250. this.sid = t,
  15251. this.color = (new r.Color).set(i.color || l.tagDefault),
  15252. this.hoverColor = l._darken(this.color, .2),
  15253. this.floor = null,
  15254. this.floorIndex = i.floor,
  15255. this.mode = s.PANORAMA,
  15256. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15257. this.obj3d = null,
  15258. this.disc = null,
  15259. this.materials = {
  15260. disc: null,
  15261. pole: null
  15262. },
  15263. this.position = (new r.Vector3).copy(i.position),
  15264. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15265. this.discWorldPosition = null,
  15266. this.discScale = .05,
  15267. this.poleEnabled = i.stem.enabled,
  15268. this.billboard = new o(i.label,i.description,i.media,this),
  15269. this.visibleTransition = null,
  15270. this.hoveringDisc = !1
  15271. }
  15272. var r = e("three")
  15273. , o = e("./Billboard/Billboard")
  15274. , a = e("../settings")
  15275. , s = e("../enum/Viewmode")
  15276. , l = e("../enum/Colors")
  15277. , c = e("../enum/RenderLayers")
  15278. , h = e("../enum/RenderOrder")
  15279. , u = (e("../util/common"),
  15280. e("../util/math"))
  15281. , d = e("../util/texture")
  15282. , p = e("../objects/Panorama")
  15283. , f = e("../shaders")
  15284. , g = e("../util/transitions")
  15285. , m = e("../util/lerp")
  15286. , v = e("../util/easing")
  15287. , A = e("./Billboard/BillboardEvent")
  15288. , y = e("events").EventEmitter
  15289. , C = e("../util/logger")
  15290. , I = new C(i)
  15291. , E = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg==")
  15292. , b = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC")
  15293. , w = new r.PlaneBufferGeometry(1,1);
  15294. n.prototype = Object.create(y.prototype),
  15295. n.raycaster = new r.Raycaster,
  15296. n.prototype.bindEvents = function() {
  15297. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15298. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15299. }
  15300. ,
  15301. n.prototype.build = function() {
  15302. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15303. this.floor && (this.billboard.build(this.model.sid),
  15304. this.obj3d = this.buildObject3D(),
  15305. this.floor.add(this.obj3d)),
  15306. this
  15307. }
  15308. ,
  15309. n.prototype.buildObject3D = function() {
  15310. var e = new r.Object3D;
  15311. e.position.copy(this.position);
  15312. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15313. t.bg.value = b,
  15314. t.mask.value = E,
  15315. t.color.value.copy(this.color),
  15316. this.materials.disc = new r.RawShaderMaterial({
  15317. transparent: !0,
  15318. vertexShader: f.tagDisc.vertexShader,
  15319. fragmentShader: f.tagDisc.fragmentShader,
  15320. uniforms: t
  15321. }),
  15322. this.disc = new r.Mesh(w,this.materials.disc),
  15323. this.disc.layers.set(c.TAG),
  15324. this.disc.position.copy(this.discPosition),
  15325. this.disc.renderOrder = h.tagDisc,
  15326. this.disc.tag = this;
  15327. var i = this.buildPole();
  15328. return i.layers.set(c.TAG),
  15329. i.renderOrder = h.tagStem,
  15330. e.add(i),
  15331. e.layers.set(c.TAG),
  15332. e.add(this.disc)
  15333. }
  15334. ,
  15335. n.prototype.buildPole = function() {
  15336. var e = new r.BufferGeometry
  15337. , t = new Float32Array(6);
  15338. return t[0] = t[1] = t[2] = 0,
  15339. t[3] = this.discPosition.x,
  15340. t[4] = this.discPosition.y,
  15341. t[5] = this.discPosition.z,
  15342. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15343. this.materials.pole = new r.LineBasicMaterial({
  15344. linewidth: a.tags.pole.width,
  15345. color: a.tags.pole.color,
  15346. opacity: 0,
  15347. visible: this.poleEnabled,
  15348. transparent: !0,
  15349. depthWrite: !1
  15350. }),
  15351. new r.Line(e,this.materials.pole)
  15352. }
  15353. ,
  15354. n.prototype.setFreeState = function(e) {
  15355. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15356. this.materials.disc.uniforms.color.value = this.color
  15357. }
  15358. .bind(this))
  15359. }
  15360. ,
  15361. n.prototype.setHoverState = function(e) {
  15362. this.billboard.open(e),
  15363. this.materials.disc.uniforms.color.value = this.hoverColor
  15364. }
  15365. ,
  15366. n.prototype.hide = function(e, t) {
  15367. var i = $.Deferred();
  15368. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15369. return i.resolve().promise();
  15370. e = e || 0,
  15371. t = t || 0,
  15372. g.cancel(this.visibleTransition);
  15373. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15374. , r = t + e
  15375. , o = t / r;
  15376. return this.visibleTransition = g.start(function(e) {
  15377. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15378. , i = m.property(e.materials.pole, "opacity", 0);
  15379. return function(n) {
  15380. t(n),
  15381. e.materials.pole && i(n)
  15382. }
  15383. }(this), r * n, function() {
  15384. i.resolve()
  15385. }, o, v[a.warp.blendEasing]),
  15386. i.promise()
  15387. }
  15388. ,
  15389. n.prototype.show = function(e, t) {
  15390. var i = $.Deferred();
  15391. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15392. return i.resolve().promise();
  15393. e = e || 0,
  15394. t = t || 0,
  15395. g.cancel(this.visibleTransition);
  15396. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15397. , r = t + e
  15398. , o = t / r;
  15399. return this.visibleTransition = g.start(function(e) {
  15400. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15401. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15402. return function(n) {
  15403. t(n),
  15404. e.materials.pole && i(n)
  15405. }
  15406. }(this), r * n, function() {
  15407. i.resolve()
  15408. }, o, v[a.warp.blendEasing]),
  15409. i.promise()
  15410. }
  15411. ,
  15412. n.prototype.closestPanoTowardTag = function(e, t) {
  15413. var i = []
  15414. , o = []
  15415. , l = this.disc.getWorldPosition();
  15416. if (e === s.PANORAMA) {
  15417. var c = .5
  15418. , h = t.position.clone().sub(l).normalize();
  15419. i.push(p.filters.isPanoAligned()),
  15420. i.push(p.filters.inPanoDirection(l, h, c)),
  15421. i.push(p.filters.isNeighbourPanoTo(t)),
  15422. o.push(p.scoreFunctions.direction(l, h))
  15423. }
  15424. var u = new r.Vector3
  15425. , d = function(e) {
  15426. u.copy(l).sub(e.position);
  15427. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15428. , i = a.tags.navigate.tiltTolerance;
  15429. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15430. }
  15431. , f = function(e) {
  15432. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15433. };
  15434. i.push(f, d),
  15435. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15436. var g = this.model.panos.sortByScore(i, o);
  15437. if (a.tags.navigate.lineOfSight) {
  15438. for (var m = 0; m < g.length; m++) {
  15439. var v = g[m].pano
  15440. , A = v.position.distanceTo(l);
  15441. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15442. return null;
  15443. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15444. var y = n.raycaster.intersectObjects(this.model.colliders);
  15445. if (0 === y.length || y[0].distance > A)
  15446. return v
  15447. }
  15448. return null
  15449. }
  15450. return g.length > 0 && g[0].pano
  15451. }
  15452. ,
  15453. n.prototype.examine = function(e) {
  15454. var t = e.mode
  15455. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15456. , n = this.disc.getWorldPosition();
  15457. this.billboard.setActiveState();
  15458. var o = function() {
  15459. var t = this.billboard.getDimensions()
  15460. , n = new r.Vector3;
  15461. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15462. n.unproject(e.camera),
  15463. e.flyToPano({
  15464. pano: i,
  15465. lookAtPoint: n
  15466. })
  15467. }
  15468. .bind(this);
  15469. if (t === s.PANORAMA)
  15470. if (i !== e.currentPano) {
  15471. var l = {
  15472. pano: i,
  15473. lookAtPoint: n,
  15474. duration: null,
  15475. maxDistanceOverride: null,
  15476. skipWarpingCheck: !1
  15477. };
  15478. e.flyToPano(l, o)
  15479. } else
  15480. setTimeout(function() {
  15481. this.billboard.open().then(function() {
  15482. o()
  15483. })
  15484. }
  15485. .bind(this), 0);
  15486. else {
  15487. var c = {
  15488. pano: i
  15489. };
  15490. if (n) {
  15491. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15492. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15493. }
  15494. c.callback = o,
  15495. c.duration = 1500,
  15496. c.mode = s.PANORAMA,
  15497. e.flyToNewMode(c)
  15498. }
  15499. }
  15500. ,
  15501. n.prototype.update = function(e, t) {
  15502. var i = new r.Vector3;
  15503. return function(e, t) {
  15504. this.discWorldPosition = this.disc.getWorldPosition(),
  15505. this.updateDisc(e, t),
  15506. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15507. i.z < 1 && (i.y *= -1,
  15508. this.billboard.update(i, this.getDiscRadius(i, t))))
  15509. }
  15510. }(),
  15511. n.prototype.updateDisc = function(e, t) {
  15512. var i = new r.Vector3
  15513. , o = new r.Vector3
  15514. , l = new r.Vector3
  15515. , c = new r.Vector3
  15516. , h = new r.Vector3;
  15517. return function(e, t) {
  15518. var u = a.tags.visibility
  15519. , d = a.tags.disc.scale
  15520. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15521. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) && (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15522. this.obj3d.visible) {
  15523. this.disc.quaternion.copy(t.quaternion);
  15524. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15525. i.copy(this.discWorldPosition).project(t),
  15526. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15527. l.set(f / 2, 0, 0).add(o),
  15528. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15529. h.copy(c).unproject(t);
  15530. var g = h.distanceTo(this.discWorldPosition)
  15531. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15532. this.discScale = g * m,
  15533. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15534. }
  15535. }
  15536. }(),
  15537. n.prototype.getDiscRadius = function(e, t) {
  15538. var i = new r.Vector3;
  15539. return function(e, t) {
  15540. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15541. Math.abs(e.x - i.x) * $("#player").width()
  15542. }
  15543. }(),
  15544. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  15545. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15546. }
  15547. ,
  15548. n.prototype.offScreen = function(e, t) {
  15549. var i = e.getWorldPosition().project(t);
  15550. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15551. }
  15552. ,
  15553. n.viewportScale = function() {
  15554. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  15555. n.viewportHeight = $("#player").height(),
  15556. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  15557. n.currentViewportScale
  15558. }
  15559. ,
  15560. t.exports = n
  15561. }
  15562. ).call(this, "/js/tag/tag.js")
  15563. }
  15564. , {
  15565. "../enum/Colors": 19,
  15566. "../enum/RenderLayers": 41,
  15567. "../enum/RenderOrder": 42,
  15568. "../enum/Viewmode": 51,
  15569. "../objects/Panorama": 148,
  15570. "../settings": 166,
  15571. "../shaders": 167,
  15572. "../util/common": 185,
  15573. "../util/easing": 186,
  15574. "../util/lerp": 188,
  15575. "../util/logger": 189,
  15576. "../util/math": 190,
  15577. "../util/texture": 194,
  15578. "../util/transitions": 195,
  15579. "./Billboard/Billboard": 119,
  15580. "./Billboard/BillboardEvent": 120,
  15581. events: 202,
  15582. three: 217
  15583. }],
  15584. 124: [function(e, t, i) {
  15585. (function(i) {
  15586. "use strict";
  15587. function n() {
  15588. this.tagState = y.IDLE,
  15589. this.intersectTag = null,
  15590. this.hoveredTag = null,
  15591. this.activeTag = null,
  15592. this.tagDiscs = [],
  15593. this.raycaster = new r.Raycaster,
  15594. this.modelManager = null,
  15595. this.player = null,
  15596. this.totaltags = 0,
  15597. this.navigatingViaTag = !1,
  15598. this.enabled = !1
  15599. }
  15600. var r = e("three")
  15601. , o = e("../util/logger")
  15602. , a = e("../util/common")
  15603. , s = e("../controls/serializer")
  15604. , l = e("../objects/Snapshot")
  15605. , c = e("../settings")
  15606. , h = e("./Billboard/BillboardEvent")
  15607. , u = e("./Media/MediaEvent")
  15608. , d = e("./Media/LinkType")
  15609. , p = e("../enum/Viewmode")
  15610. , f = e("../enum/WarpStyle")
  15611. , g = e("../enum/BlackoutStyle")
  15612. , m = e("../enum/ModelManagerEvents")
  15613. , v = e("../enum/tagEvents")
  15614. , A = e("../enum/PlayerEvents")
  15615. , y = (e("../util/lerp"),
  15616. e("../enum/TagStates"))
  15617. , C = e("events").EventEmitter
  15618. , I = new o(i);
  15619. a.extend(n, C),
  15620. n.prototype.init = function(e, t) {
  15621. this.modelManager = e,
  15622. this.player = t,
  15623. this.updateModel(),
  15624. this.bindEvents()
  15625. }
  15626. ,
  15627. n.prototype.update = function(e) {
  15628. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15629. }
  15630. ,
  15631. n.prototype.updateTags = function(e, t, i, n) {
  15632. for (var r in this.model.tags)
  15633. this.model.tags[r].update(e, t, i, n)
  15634. }
  15635. ,
  15636. n.prototype.updateModel = function() {
  15637. this.model = this.modelManager.getActiveModel(),
  15638. this.gettagsFromModel(),
  15639. this.totaltags = Object.keys(this.model.tags).length
  15640. }
  15641. ,
  15642. n.prototype.gettagsFromModel = function() {
  15643. this.tagDiscs = [];
  15644. for (var e in this.model.tags) {
  15645. var t = this.model.tags[e].disc;
  15646. t && this.tagDiscs.push(t)
  15647. }
  15648. }
  15649. ,
  15650. n.prototype.bindEvents = function() {
  15651. function e() {
  15652. Object.keys(this.model.tags).forEach(function(e) {
  15653. var t = this.model.tags[e];
  15654. t.bindEvents(),
  15655. t.billboard.on(u.LINK_CLICK, function(e) {
  15656. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  15657. }
  15658. .bind(this)),
  15659. t.billboard.on(u.IMAGE_OPENED, function() {
  15660. this.tagState = y.EXAMINE,
  15661. this.emit(u.IMAGE_OPENED)
  15662. }
  15663. .bind(this)),
  15664. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  15665. }
  15666. .bind(this))
  15667. }
  15668. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  15669. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  15670. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15671. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  15672. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  15673. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15674. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  15675. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15676. e.call(this)
  15677. }
  15678. ,
  15679. n.prototype.navigateViaLink = function(e) {
  15680. var t = s.deserialize(e);
  15681. if (t)
  15682. if (t.mode === p.PANORAMA) {
  15683. try {
  15684. this.player.model.panos.get(t.panoId)
  15685. } catch (e) {
  15686. return void I.warn("Unable to find panorama location", t.panoId)
  15687. }
  15688. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  15689. } else {
  15690. var i = {
  15691. cameraMode: t.mode,
  15692. position: t.position,
  15693. quaternion: t.quaternion,
  15694. scanId: t.panoId,
  15695. orthoZoom: t.zoom,
  15696. floorVisibility: t.floorVisibility,
  15697. thumbUrl: null,
  15698. name: null
  15699. };
  15700. this.player.flyToNewMode({
  15701. mode: t.mode,
  15702. duration: c.warp.outsideTime,
  15703. warpDest: new l(i),
  15704. force: !0
  15705. })
  15706. }
  15707. }
  15708. ,
  15709. n.prototype.handleWarpStart = function(e, t, i, n) {
  15710. this.dismissExaminedTag(),
  15711. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  15712. e && (i = g.END),
  15713. this.hideShowTagsForBlackoutStyle(i, n))
  15714. }
  15715. ,
  15716. n.prototype.handleWarpInterruption = function(e, t, i) {
  15717. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  15718. this.hideShowTagsForBlackoutStyle(t, i)
  15719. }
  15720. ,
  15721. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15722. var i = 0
  15723. , n = 0
  15724. , r = t / 2;
  15725. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  15726. e) {
  15727. case g.END:
  15728. this.hideAlltags(r);
  15729. break;
  15730. case g.BEGINNING:
  15731. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15732. break;
  15733. case g.NONE:
  15734. break;
  15735. case g.MIDDLE:
  15736. i = r,
  15737. n = r,
  15738. this.hideAlltags(n),
  15739. setTimeout(function() {
  15740. this.showAlltags(i)
  15741. }
  15742. .bind(this), n);
  15743. break;
  15744. case g.FADEIN:
  15745. setTimeout(function() {
  15746. this.showAlltags(r)
  15747. }
  15748. .bind(this), r)
  15749. }
  15750. }
  15751. ,
  15752. n.prototype.onPlayerModeChanging = function(e, t) {
  15753. t !== p.PANORAMA && this.dismissExaminedTag(),
  15754. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  15755. var i = t !== p.OUTDOOR;
  15756. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15757. }
  15758. ,
  15759. n.prototype.onPanoChange = function(e, t) {
  15760. var i = this.navigatingViaTag;
  15761. if (this.navigatingViaTag = !1,
  15762. !i) {
  15763. this.dismissExaminedTag();
  15764. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  15765. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  15766. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15767. }
  15768. }
  15769. ,
  15770. n.prototype.onPlayerReady = function(e, t, i) {
  15771. this.startAlltags(e, t ? i : null)
  15772. }
  15773. ,
  15774. n.prototype.onPlayerFlyingEnded = function(e, t) {
  15775. this.updateClosestTags(e)
  15776. }
  15777. ,
  15778. n.prototype.dismissExaminedTag = function() {
  15779. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  15780. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15781. this.hoveredTag = null)
  15782. }
  15783. ,
  15784. n.prototype.startAlltags = function(e, t) {
  15785. this.model.shouldShowtags = c.tags.enabled,
  15786. this.enabled = !0,
  15787. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  15788. t && setTimeout(function() {
  15789. this.activateTag(this.model.getTagBySid(t))
  15790. }
  15791. .bind(this), c.tags.startup.fadeInDuration / 2))
  15792. }
  15793. ,
  15794. n.prototype.showAlltags = function(e, t, i) {
  15795. function n() {
  15796. o++,
  15797. o === this.totaltags && (this.model.tagsShown = !0,
  15798. r.resolve())
  15799. }
  15800. var r = $.Deferred();
  15801. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15802. return r.resolve().promise();
  15803. var o = 0;
  15804. for (var a in this.model.tags) {
  15805. var s = this.model.tags[a];
  15806. s.show(e, t).done(n.bind(this))
  15807. }
  15808. return r.promise()
  15809. }
  15810. ,
  15811. n.prototype.hideAlltags = function(e, t) {
  15812. function i() {
  15813. r++,
  15814. r === this.totaltags && (this.model.tagsShown = !1,
  15815. n.resolve())
  15816. }
  15817. var n = $.Deferred()
  15818. , r = 0;
  15819. for (var o in this.model.tags) {
  15820. var a = this.model.tags[o];
  15821. a.hide(e, t).done(i.bind(this)),
  15822. a === this.activeTag && this.dismissActiveTag()
  15823. }
  15824. return n.promise()
  15825. }
  15826. ,
  15827. n.prototype.enableHovering = function() {
  15828. this.enabled = !0
  15829. }
  15830. ,
  15831. n.prototype.disableHovering = function() {
  15832. this.enabled = !1
  15833. }
  15834. ,
  15835. n.prototype.activateTag = function(e, t) {
  15836. t = t || y.EXAMINE,
  15837. this.activeTag = e,
  15838. this.activeTag.hoveringDisc = !0,
  15839. this.activeTag.setHoverState(t === y.EXAMINE),
  15840. this.tagState = t,
  15841. this.emit(v.TagActivated, e)
  15842. }
  15843. ,
  15844. n.prototype.dismissActiveTag = function() {
  15845. this.activeTag.hoveringDisc = !1,
  15846. this.activeTag.setFreeState(!0);
  15847. var e = this.activeTag;
  15848. this.activeTag = null,
  15849. this.tagState = y.IDLE,
  15850. this.emit(v.TagDismissed, e)
  15851. }
  15852. ,
  15853. n.prototype.clickedOnTag = function(e) {
  15854. var t = function() {
  15855. this.navigatingViaTag = !0,
  15856. this.activeTag.examine(this.player),
  15857. this.emit(v.TagNavigation, this.activeTag)
  15858. }
  15859. .bind(this);
  15860. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  15861. this.activeTag = this.intersectTag,
  15862. t(),
  15863. !0) : (this.dismissActiveTag(),
  15864. !1)
  15865. }
  15866. ,
  15867. n.prototype.intersecttag = function() {
  15868. var e = new r.Vector3
  15869. , t = new r.Vector3
  15870. , i = new r.Vector3;
  15871. return function(n, r, o) {
  15872. if (!this.enabled)
  15873. return null;
  15874. var a = null
  15875. , s = this.tagDiscs.filter(function(e) {
  15876. return e.parent.visible
  15877. });
  15878. if (s.length > 0) {
  15879. var l = this.model.floors.reduce(function(e, t) {
  15880. return t.hidden ? e : e.concat(t.collider.children)
  15881. }, s);
  15882. e.set(n.x, n.y, -1).unproject(o),
  15883. t.set(n.x, n.y, 1).unproject(o),
  15884. i.copy(t).sub(e).normalize(),
  15885. this.raycaster.set(e, i);
  15886. var c = this.raycaster.intersectObjects(l);
  15887. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  15888. }
  15889. return this.intersectTag = a,
  15890. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  15891. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  15892. this.hoveredTag = a
  15893. }
  15894. .bind(this)),
  15895. a.billboard.on(h.LEAVE, function() {
  15896. this.hoveredTag = null
  15897. }
  15898. .bind(this))),
  15899. this.activateTag(a, y.BROWSE))),
  15900. a
  15901. }
  15902. }(),
  15903. n.prototype.rankedtagInDirection = function() {
  15904. var e = []
  15905. , t = []
  15906. , i = new r.Vector3
  15907. , n = new r.Vector3
  15908. , o = new r.Vector3;
  15909. return function(r, a, s, l) {
  15910. var c = 0;
  15911. t.length = 0;
  15912. for (var h = 0; h < this.closesttags.length; h++) {
  15913. var u = this.closesttags[h];
  15914. n.copy(u.position),
  15915. n.add(u.discPosition),
  15916. i.copy(a),
  15917. i.sub(n).negate(),
  15918. i.normalize();
  15919. var d = i.dot(l);
  15920. if (d >= 0) {
  15921. o.copy(n),
  15922. o.project(s);
  15923. var p = this.intersecttag(o, !1, s);
  15924. if (p) {
  15925. if (c >= e.length)
  15926. for (var f = 0; f < 64; f++)
  15927. e.push({
  15928. tag: u,
  15929. dot: d
  15930. });
  15931. var g = e[c];
  15932. g.tag = u,
  15933. g.dot = d,
  15934. g.position = math.projectPositionToCanvas(n, s),
  15935. t.push(g),
  15936. c++
  15937. }
  15938. }
  15939. }
  15940. return t.sort(function(e, t) {
  15941. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15942. }),
  15943. r < t.length ? t[r].tag : null
  15944. }
  15945. }(),
  15946. n.prototype.updateClosestTags = function() {
  15947. var e = new r.Vector3
  15948. , t = 30;
  15949. return function(i) {
  15950. this.closesttags || (this.closesttags = []),
  15951. this.closesttags.length = 0;
  15952. var n = this.model.tags;
  15953. if (n)
  15954. for (var r in n)
  15955. if (n.hasOwnProperty(r)) {
  15956. var o = n[r]
  15957. , a = o.position;
  15958. e.copy(i),
  15959. e.sub(a).negate();
  15960. var s = e.lengthSq();
  15961. s < t && this.closesttags.push(o)
  15962. }
  15963. }
  15964. }(),
  15965. t.exports = n
  15966. }
  15967. ).call(this, "/js/tag/tagManager.js")
  15968. }
  15969. , {
  15970. "../controls/serializer": 14,
  15971. "../enum/BlackoutStyle": 18,
  15972. "../enum/tagEvents": 32,
  15973. "../enum/ModelManagerEvents": 33,
  15974. "../enum/PlayerEvents": 40,
  15975. "../enum/TagStates": 44,
  15976. "../enum/Viewmode": 51,
  15977. "../enum/WarpStyle": 52,
  15978. "../objects/Snapshot": 153,
  15979. "../settings": 166,
  15980. "../util/common": 185,
  15981. "../util/lerp": 188,
  15982. "../util/logger": 189,
  15983. "./Billboard/BillboardEvent": 120,
  15984. "./Media/LinkType": 130,
  15985. "./Media/MediaEvent": 131,
  15986. events: 202,
  15987. three: 217
  15988. }],
  15989. 125: [function(e, t, i) {
  15990. (function(i) {
  15991. "use strict";
  15992. function n() {
  15993. this.embedWrapper = null,
  15994. this.embedElement = null
  15995. }
  15996. var r = e("../../util/ajax")
  15997. , o = e("./mediaSettings")
  15998. , a = e("../../settings")
  15999. , s = e("../../util/logger")
  16000. , l = new s(i);
  16001. n.prototype.createDomElement = function() {
  16002. return this.embedWrapper = document.createElement("div"),
  16003. this.embedWrapper.classList.add("tag-embed"),
  16004. this.embedWrapper.classList.add("hidden"),
  16005. this.embedWrapper
  16006. }
  16007. ,
  16008. n.prototype.load = function(e) {
  16009. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16010. return new Promise(function(e, i) {
  16011. r.get(t).then(function(t) {
  16012. if (t = JSON.parse(t),
  16013. t.html && t.html.indexOf("<script") === -1) {
  16014. this.embedWrapper.innerHTML = t.html;
  16015. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16016. if (this.embedWrapper.style.width = n + "px",
  16017. t.height) {
  16018. var r = t.height / t.width;
  16019. this.embedWrapper.style.height = n * r + "px"
  16020. }
  16021. this.embedElement = this.embedWrapper.firstChild;
  16022. var a = [];
  16023. try {
  16024. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16025. } catch (e) {
  16026. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16027. }
  16028. a.forEach(function(e) {
  16029. e.setAttribute("target", "_blank")
  16030. }),
  16031. this.embedElement.classList.add("hidden"),
  16032. this.embedWrapper.classList.remove("hidden"),
  16033. e()
  16034. } else
  16035. i("Not a valid embed")
  16036. }
  16037. .bind(this), function(e) {
  16038. i(e.response)
  16039. })
  16040. }
  16041. .bind(this))
  16042. }
  16043. ,
  16044. n.prototype.show = function() {
  16045. this.embedElement && this.embedElement.classList.remove("hidden")
  16046. }
  16047. ,
  16048. n.prototype.hide = function() {
  16049. this.embedElement && this.embedElement.classList.add("hidden")
  16050. }
  16051. ,
  16052. t.exports = n
  16053. }
  16054. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16055. }
  16056. , {
  16057. "../../settings": 166,
  16058. "../../util/ajax": 181,
  16059. "../../util/logger": 189,
  16060. "./mediaSettings": 132
  16061. }],
  16062. 126: [function(e, t, i) {
  16063. (function(i) {
  16064. "use strict";
  16065. function n(e) {
  16066. o.call(this),
  16067. this.options = e,
  16068. this.playerControls = null,
  16069. this.state = s.NOT_READY
  16070. }
  16071. var r = e("../../util/browser")
  16072. , o = e("./EmbedlyEmbed")
  16073. , a = e("../../util/logger")
  16074. , s = (new a(i),
  16075. Object.freeze({
  16076. NOT_READY: "player.not.ready",
  16077. CUED: "player.cued",
  16078. PLAYING: "player.playing",
  16079. PAUSED: "player.paused"
  16080. }));
  16081. n.prototype = Object.create(o.prototype),
  16082. n.prototype.createDomElement = function() {
  16083. return this.embedWrapper = document.createElement("div"),
  16084. this.embedWrapper.classList.add("tag-video"),
  16085. this.embedWrapper.classList.add("hidden"),
  16086. this.embedWrapper
  16087. }
  16088. ,
  16089. n.prototype.load = function(e) {
  16090. var t = function() {
  16091. function e(e) {
  16092. this.playerState = s.CUED,
  16093. this.options.startMuted && this.playerControls.mute()
  16094. }
  16095. function t(e) {
  16096. this.playerState = e
  16097. }
  16098. function i(e) {
  16099. this.playerControls.setCurrentTime(0),
  16100. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16101. }
  16102. this.playerControls = new playerjs.Player(this.embedElement),
  16103. this.playerControls.on("ready", e.bind(this)),
  16104. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16105. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16106. this.playerControls.on("ended", i.bind(this))
  16107. }
  16108. .bind(this);
  16109. return o.prototype.load.call(this, e).then(t.bind(this))
  16110. }
  16111. ,
  16112. n.prototype.play = function() {
  16113. var e = r.isMobile();
  16114. return function() {
  16115. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16116. }
  16117. }(),
  16118. n.prototype.pause = function() {
  16119. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16120. }
  16121. ,
  16122. t.exports = n
  16123. }
  16124. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16125. }
  16126. , {
  16127. "../../util/browser": 182,
  16128. "../../util/logger": 189,
  16129. "./EmbedlyEmbed": 125
  16130. }],
  16131. 127: [function(e, t, i) {
  16132. (function(i) {
  16133. "use strict";
  16134. function n(e) {
  16135. function t() {
  16136. return a.debug("requesting file from embedly:", e.href),
  16137. r.get(e.href, {
  16138. responseType: e.responseType
  16139. }).then(function(t) {
  16140. return a.debug("requesting file finished:", e.href),
  16141. t
  16142. })
  16143. }
  16144. function i() {}
  16145. return s = new Promise(function(e, n) {
  16146. s.catch(i).then(function() {
  16147. t().then(e, n)
  16148. })
  16149. }
  16150. )
  16151. }
  16152. var r = e("../../util/ajax")
  16153. , o = (e("./mediaSettings"),
  16154. e("../../util/logger"))
  16155. , a = new o(i)
  16156. , s = Promise.resolve();
  16157. t.exports.enqueue = n
  16158. }
  16159. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16160. }
  16161. , {
  16162. "../../util/ajax": 181,
  16163. "../../util/logger": 189,
  16164. "./mediaSettings": 132
  16165. }],
  16166. 128: [function(e, t, i) {
  16167. (function(i) {
  16168. "use strict";
  16169. function n() {
  16170. this.imageWrapper = null,
  16171. this.width = 0,
  16172. this.height = 0,
  16173. this.aspect = 1
  16174. }
  16175. var r = e("./MediaEvent")
  16176. , o = e("./EmbedlyQueue")
  16177. , a = e("events").EventEmitter
  16178. , s = e("../../util/logger")
  16179. , l = e("../../settings");
  16180. new s(i);
  16181. n.prototype = Object.create(a.prototype),
  16182. n.prototype.createDomElement = function() {
  16183. return this.imageWrapper = document.createElement("div"),
  16184. this.imageWrapper.classList.add("tag-image"),
  16185. this.imageWrapper.classList.add("hidden"),
  16186. this.imageWrapper.addEventListener("click", function(e) {
  16187. e.stopPropagation(),
  16188. this.emit(r.IMAGE_OPENING),
  16189. this.imageWrapper.style.pointerEvents = "none"
  16190. }
  16191. .bind(this)),
  16192. this.imageWrapper
  16193. }
  16194. ,
  16195. n.prototype.onClosed = function() {
  16196. this.imageWrapper.style.pointerEvents = "auto"
  16197. }
  16198. ,
  16199. n.prototype.load = function(e) {
  16200. var t = Math.max(window.screen.height, window.screen.width)
  16201. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16202. return new Promise(function(e, t) {
  16203. function n(t) {
  16204. var i = t.target;
  16205. this.width = i.naturalWidth,
  16206. this.height = i.naturalHeight,
  16207. this.aspect = this.width / this.height;
  16208. var n = t.target.src;
  16209. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16210. this.imageWrapper.style.width = this.width + "px",
  16211. this.imageWrapper.style.height = this.height + "px",
  16212. this.imageWrapper.classList.remove("hidden"),
  16213. e()
  16214. }
  16215. o.enqueue({
  16216. href: i,
  16217. responseType: "arraybuffer"
  16218. }).then(function(e) {
  16219. var t = new Uint8Array(e)
  16220. , i = new Blob([t])
  16221. , r = new window.Image;
  16222. r.addEventListener("load", n.bind(this));
  16223. var o = URL.createObjectURL(i);
  16224. r.src = o
  16225. }
  16226. .bind(this), t)
  16227. }
  16228. .bind(this))
  16229. }
  16230. ,
  16231. t.exports = n
  16232. }
  16233. ).call(this, "/js/tag/Media/Image.js")
  16234. }
  16235. , {
  16236. "../../settings": 166,
  16237. "../../util/logger": 189,
  16238. "./EmbedlyQueue": 127,
  16239. "./MediaEvent": 131,
  16240. events: 202
  16241. }],
  16242. 129: [function(e, t, i) {
  16243. "use strict";
  16244. function n(e) {
  16245. this.label = e.label,
  16246. this.href = e.url,
  16247. this.type = this.updateLinkForType(),
  16248. this.domElement = null,
  16249. this.id = c++
  16250. }
  16251. var r = e("./LinkType")
  16252. , o = e("./MediaEvent")
  16253. , a = e("../../util/browser")
  16254. , s = e("../../analytics")
  16255. , l = e("events").EventEmitter
  16256. , c = 0;
  16257. n.prototype = Object.create(l.prototype),
  16258. n.prototype.updateLinkForType = function() {
  16259. function e(e) {
  16260. var t = new RegExp("[#&?]start=([^#&?]*)")
  16261. , i = t.exec(e);
  16262. return i[1]
  16263. }
  16264. function t(e) {
  16265. return e + "&play=1"
  16266. }
  16267. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16268. return this.href.indexOf("port.com/show") !== -1 || this.href.indexOf(window.location.host + "/show") !== -1 ? this.href.indexOf(i) !== -1 && this.href.indexOf("start=") !== -1 ? (this.href = e(this.href),
  16269. r.NAVIGATION) : (this.href = t(this.href),
  16270. r.MODEL) : r.EXT_LINK
  16271. }
  16272. ;
  16273. var h = {};
  16274. n.prototype.createDomElement = function() {
  16275. function e(e) {
  16276. switch (e.stopPropagation(),
  16277. h[this.id] = !0,
  16278. s.trackAlways("click_tag_link", {
  16279. link_type: this.type,
  16280. link_count: c,
  16281. links_clicked: Object.keys(h).length
  16282. }),
  16283. this.type) {
  16284. case r.MODEL:
  16285. window.location.replace(this.href);
  16286. break;
  16287. case r.EXT_LINK:
  16288. window.open(this.href, "_blank")
  16289. }
  16290. this.emit(o.LINK_CLICK, {
  16291. type: this.type,
  16292. url: this.href
  16293. })
  16294. }
  16295. if (this.domElement = document.createElement("a"),
  16296. this.domElement.classList.add("tag-link"),
  16297. this.domElement.textContent = this.label,
  16298. this.type === r.EXT_LINK) {
  16299. this.domElement.textContent += " ";
  16300. var t = document.createElement("i");
  16301. t.classList.add("icon-ext-link"),
  16302. t.title = "Link to external web site",
  16303. this.domElement.appendChild(t)
  16304. }
  16305. return this.domElement.addEventListener("click", e.bind(this)),
  16306. this.domElement
  16307. }
  16308. ,
  16309. t.exports = n
  16310. }
  16311. , {
  16312. "../../analytics": 4,
  16313. "../../util/browser": 182,
  16314. "./LinkType": 130,
  16315. "./MediaEvent": 131,
  16316. events: 202
  16317. }],
  16318. 130: [function(e, t, i) {
  16319. "use strict";
  16320. t.exports = {
  16321. NAVIGATION: "navigation",
  16322. MODEL: "model",
  16323. EXT_LINK: "ext-link"
  16324. }
  16325. }
  16326. , {}],
  16327. 131: [function(e, t, i) {
  16328. "use strict";
  16329. t.exports = Object.freeze({
  16330. LINK_CLICK: "mtmedia.link",
  16331. IMAGE_LOADED: "mtmedia.image.loaded",
  16332. IMAGE_OPENING: "mtmedia.image.opening",
  16333. IMAGE_OPENED: "mtmedia.image.opened",
  16334. IMAGE_CLOSING: "mtmedia.image.closing",
  16335. IMAGE_CLOSED: "mtmedia.image.closed",
  16336. VIDEO_START: "mtmedia.video.start",
  16337. VIDEO_PAUSE: "mtmedia.video.pause",
  16338. VIDEO_ENDED: "mtmedia.video.end"
  16339. })
  16340. }
  16341. , {}],
  16342. 132: [function(e, t, i) {
  16343. "use strict";
  16344. t.exports = Object.freeze({
  16345. maxEmbedWidth: 350,
  16346. defaultAspectRatio: .75
  16347. })
  16348. }
  16349. , {}],
  16350. 133: [function(e, t, i) {
  16351. "use strict";
  16352. t.exports = Object.freeze({
  16353. TEXT: "text",
  16354. LINK: "link",
  16355. IMAGE: "photo",
  16356. VIDEO: "video",
  16357. RICH: "rich"
  16358. })
  16359. }
  16360. , {}],
  16361. 134: [function(e, t, i) {
  16362. "use strict";
  16363. function n(e) {
  16364. this.capabilities = {
  16365. links: {
  16366. enable: e.supportLinks,
  16367. keepLabels: e.keepLinkLabels
  16368. }
  16369. }
  16370. }
  16371. var r = e("./DescriptionChunkType");
  16372. n.prototype.parse = function(e, t) {
  16373. var i = []
  16374. , n = e.split("[").map(function(e, t) {
  16375. return 0 === t ? e : "[" + e
  16376. });
  16377. return n.forEach(function(e) {
  16378. var n = this.findMarkdown(e);
  16379. if (n) {
  16380. if (n.url.indexOf("javascript:") !== -1)
  16381. return;
  16382. this.addLinkChunk(i, n, t),
  16383. this.addTextChunk(i, e.slice(n.markdown.length))
  16384. } else
  16385. this.addTextChunk(i, e)
  16386. }
  16387. .bind(this)),
  16388. i
  16389. }
  16390. ,
  16391. n.prototype.findMarkdown = function(e) {
  16392. var t = /\[([^\]]*)\]\((.*)\)/
  16393. , i = e.match(t);
  16394. if (i) {
  16395. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16396. 0 !== r); )
  16397. o++;
  16398. var a = n.length - o;
  16399. return {
  16400. markdown: i[0].substring(0, i[0].length - a),
  16401. label: i[1],
  16402. url: i[2].substring(0, o)
  16403. }
  16404. }
  16405. }
  16406. ,
  16407. n.prototype.addTextChunk = function(e, t) {
  16408. 0 !== t.length && e.push({
  16409. type: r.TEXT,
  16410. text: t
  16411. })
  16412. }
  16413. ,
  16414. n.prototype.addLinkChunk = function(e, t) {
  16415. if (!this.capabilities.links.enable)
  16416. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16417. var i = {
  16418. label: t.label,
  16419. url: t.url
  16420. };
  16421. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16422. e.push({
  16423. type: r.LINK,
  16424. link: i
  16425. })
  16426. }
  16427. ,
  16428. t.exports = n
  16429. }
  16430. , {
  16431. "./DescriptionChunkType": 133
  16432. }],
  16433. 135: [function(e, t, i) {
  16434. (function(i) {
  16435. "use strict";
  16436. var n = e("../util/logger")
  16437. , r = new n(i)
  16438. , o = {
  16439. parseIdsFromChunkName: function(e, t) {
  16440. t.floorId = o.parseFloor(e),
  16441. t.roomId = o.parseRoom(e)
  16442. },
  16443. parseFloor: function(e) {
  16444. var t = e.match(/_group([0-9]+)/);
  16445. if (!t)
  16446. return 0;
  16447. try {
  16448. return parseInt(t[1], 10)
  16449. } catch (e) {
  16450. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16451. 0
  16452. }
  16453. },
  16454. parseRoom: function(e) {
  16455. var t = e.match(/_sub([0-9]+)/);
  16456. if (!t)
  16457. return -1;
  16458. try {
  16459. return parseInt(t[1], 10)
  16460. } catch (e) {
  16461. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16462. 0
  16463. }
  16464. }
  16465. };
  16466. t.exports = o
  16467. }
  16468. ).call(this, "/js/model/Chunks.js")
  16469. }
  16470. , {
  16471. "../util/logger": 189
  16472. }],
  16473. 136: [function(e, t, i) {
  16474. (function(i) {
  16475. "use strict";
  16476. function n(e) {
  16477. s.call(this),
  16478. this.model = e,
  16479. this.exploded = !1
  16480. }
  16481. var r = e("../objects/Floor")
  16482. , o = (e("../settings"),
  16483. e("../util/logger"))
  16484. , a = e("../util/transitions")
  16485. , s = e("../util/IndexedCollection")
  16486. , l = e("../util/common")
  16487. , c = e("../util/easing");
  16488. new o(i);
  16489. l.inherit(n, s),
  16490. n.prototype.add = function(e) {
  16491. s.prototype.add.call(this, e),
  16492. this.model.add(e)
  16493. }
  16494. ,
  16495. n.prototype.getIndex = function(e) {
  16496. return e.floorIndex
  16497. }
  16498. ,
  16499. n.prototype.build = function() {
  16500. this.list.forEach(function(e) {
  16501. e.build()
  16502. })
  16503. }
  16504. ,
  16505. n.prototype.size = function() {
  16506. return this.length
  16507. }
  16508. ,
  16509. n.prototype.sort = function() {
  16510. s.prototype.sort.call(this, function(e, t) {
  16511. return e.floorIndex - t.floorIndex
  16512. })
  16513. }
  16514. ,
  16515. n.prototype.nextFloor = function(e, t) {
  16516. return this.index[e.floorIndex + t] || null
  16517. }
  16518. ,
  16519. n.prototype.getFloorAtPoint = function(e) {
  16520. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16521. var r = this.list[n]
  16522. , o = r.distanceToPoint(e);
  16523. (!t || i > o) && (i = o,
  16524. t = r)
  16525. }
  16526. return t
  16527. }
  16528. ,
  16529. n.prototype.getOrMakeFloor = function(e) {
  16530. var t = this.index[e];
  16531. return t || (t = new r(this.model,e),
  16532. this.add(t)),
  16533. t
  16534. }
  16535. ,
  16536. n.prototype.hide = function() {
  16537. this.list.forEach(function(e) {
  16538. e.hide()
  16539. })
  16540. }
  16541. ,
  16542. n.prototype.show = function() {
  16543. this.list.forEach(function(e) {
  16544. e.show()
  16545. })
  16546. }
  16547. ,
  16548. n.prototype.names = function() {
  16549. return this.list.reduce(function(e, t) {
  16550. return e.concat(t.name)
  16551. }, [])
  16552. }
  16553. ,
  16554. n.prototype.toggleExplodeHorizontal = function() {
  16555. function e(e, t) {
  16556. r.copy(e.position),
  16557. e.position.x = i[e.floorIndex] * t,
  16558. e.position.y = 1 * e.floorIndex * t,
  16559. r.sub(e.position).multiplyScalar(-1),
  16560. e.panos.forEach(function(e) {
  16561. e.translate(r)
  16562. })
  16563. }
  16564. var t, i = [], n = 0;
  16565. this.list.forEach(function(e, r, o) {
  16566. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16567. n += t,
  16568. i[r] = n
  16569. }),
  16570. i = i.map(function(e) {
  16571. return e - n / 2
  16572. });
  16573. var r = this.list[0].position.clone();
  16574. this.exploded ? this.list.forEach(function(t) {
  16575. a.start(function(i) {
  16576. e(t, 1 - i)
  16577. }, 1500, null, 0, c.easeOutExpo)
  16578. }) : this.list.forEach(function(t) {
  16579. a.start(function(i) {
  16580. e(t, i)
  16581. }, 1500, null, 0, c.easeOutExpo)
  16582. }),
  16583. this.exploded = !this.exploded
  16584. }
  16585. ,
  16586. n.prototype.toggleExplodeVertical = function() {
  16587. function e(e, i) {
  16588. var n = n.copy(e.position);
  16589. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  16590. n.sub(e.position).multiplyScalar(-1),
  16591. e.panos.forEach(function(e) {
  16592. e.translate(n)
  16593. })
  16594. }
  16595. var t = this.model.size;
  16596. this.list[0].position.clone();
  16597. this.exploded ? this.list.forEach(function(t) {
  16598. a.start(function(i) {
  16599. e(t, 1 - i)
  16600. }, 1500, null, 0, c.easeOutExpo)
  16601. }) : this.list.forEach(function(t) {
  16602. a.start(function(i) {
  16603. e(t, i)
  16604. }, 1500, null, 0, c.easeOutExpo)
  16605. }),
  16606. this.exploded = !this.exploded
  16607. }
  16608. ,
  16609. t.exports = n
  16610. }
  16611. ).call(this, "/js/model/FloorCollection.js")
  16612. }
  16613. , {
  16614. "../objects/Floor": 146,
  16615. "../settings": 166,
  16616. "../util/IndexedCollection": 175,
  16617. "../util/common": 185,
  16618. "../util/easing": 186,
  16619. "../util/logger": 189,
  16620. "../util/transitions": 195
  16621. }],
  16622. 137: [function(e, t, i) {
  16623. (function(i) {
  16624. "use strict";
  16625. function n() {
  16626. c.call(this)
  16627. }
  16628. var r = e("../settings")
  16629. , o = e("../util/logger")
  16630. , a = e("../enum/Viewmode")
  16631. , s = e("../objects/Snapshot")
  16632. , l = (e("../util/math"),
  16633. e("../util/common"))
  16634. , c = e("../util/IndexedCollection")
  16635. , h = new o(i);
  16636. l.inherit(n, c),
  16637. n.prototype.getImage = function(e) {
  16638. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16639. }
  16640. ,
  16641. n.prototype.filterByModesAndReel = function(e, t) {
  16642. for (var i = [], n = 0; n < t.length; n += 1) {
  16643. var r = t[n]
  16644. , o = this.index[r.sid];
  16645. o && i.push(o)
  16646. }
  16647. var s = e[a.DOLLHOUSE]
  16648. , l = e[a.FLOORPLAN];
  16649. i = i.filter(function(e) {
  16650. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16651. return !0;
  16652. var t;
  16653. try {
  16654. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  16655. } catch (e) {
  16656. return h.debug(e.message),
  16657. !1
  16658. }
  16659. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  16660. }),
  16661. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16662. this.list = i,
  16663. this.reIndex()
  16664. }
  16665. ,
  16666. n.prototype.getHeroLocations = function(e) {
  16667. if (0 === this.list.length)
  16668. return [];
  16669. for (var t = [], i = 0; i < this.list.length; ++i) {
  16670. var o = this.list[i]
  16671. , l = o.thumbnail_signed_src
  16672. , c = o.name;
  16673. if (o.metadata && void 0 !== o.metadata.camera_quaternion) {
  16674. if (!r.show360Views.enabled && o.metadata.scan_id) {
  16675. var h = e.get(o.metadata.scan_id);
  16676. if (h && !h.isAligned())
  16677. continue
  16678. }
  16679. var u = a.convertWorkshopModeInt(o.metadata.camera_mode);
  16680. if (u === a.MESH)
  16681. continue;
  16682. var d = {
  16683. cameraMode: u,
  16684. position: o.metadata.camera_position,
  16685. quaternion: o.metadata.camera_quaternion,
  16686. panoId: o.metadata.scan_id,
  16687. orthoZoom: o.metadata.ortho_zoom,
  16688. floorVisibility: void 0 !== o.metadata.floor_visibility ? o.metadata.floor_visibility.slice(0) : [],
  16689. thumbUrl: l,
  16690. name: n.filterImageName(c),
  16691. sid: o.sid //xzw add g_tourAudio要用
  16692. }
  16693. , p = new s(d);
  16694. t.push(p)
  16695. }
  16696. }
  16697. return t
  16698. }
  16699. ,
  16700. n.prototype.getIndex = function(e) {
  16701. return e.sid
  16702. }
  16703. ,
  16704. n.filterImageName = function(e) {
  16705. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16706. }
  16707. ,
  16708. t.exports = n
  16709. }
  16710. ).call(this, "/js/model/ImageCollection.js")
  16711. }
  16712. , {
  16713. "../enum/Viewmode": 51,
  16714. "../objects/Snapshot": 153,
  16715. "../settings": 166,
  16716. "../util/IndexedCollection": 175,
  16717. "../util/common": 185,
  16718. "../util/logger": 189,
  16719. "../util/math": 190
  16720. }],
  16721. 138: [function(e, t, i) {
  16722. (function(i) {
  16723. "use strict";
  16724. function n() {
  16725. u.call(this)
  16726. }
  16727. var r = e("../label/Label")
  16728. , o = e("../settings")
  16729. , a = e("../util/logger")
  16730. , s = e("../util/math")
  16731. , l = e("../util/ajax")
  16732. , c = e("./RoomCollection")
  16733. , h = e("../util/common")
  16734. , u = e("../util/IndexedCollection");
  16735. new a(i);
  16736. h.inherit(n, u),
  16737. n.prototype.getIndex = function(e) {
  16738. return e.labelId
  16739. }
  16740. ,
  16741. n.prototype.associateWithRooms = function(e) {
  16742. this.forEach(function(t) {
  16743. e.forEach(function(e) {
  16744. e.roomId === t.roomId && (t.room = e)
  16745. })
  16746. })
  16747. }
  16748. ,
  16749. n.prototype.createFromLabelData = function(e) {
  16750. e.forEach(function(e) {
  16751. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16752. t = c.generateRoomId(e.floorId, t);
  16753. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16754. i.position = s.convertWorkshopVector(i.position),
  16755. this.add(i),
  16756. i.build()
  16757. }
  16758. .bind(this))
  16759. }
  16760. ,
  16761. n.prototype.load = function(e, t) {
  16762. return l.get(e, {
  16763. responseType: "json",
  16764. auth: t ? o.authorizationHeader : null
  16765. }).done(function(e) {
  16766. var t = [];
  16767. for (var i in e) {
  16768. var n = e[i];
  16769. t.push(n)
  16770. }
  16771. this.createFromLabelData(t)
  16772. }
  16773. .bind(this))
  16774. }
  16775. ,
  16776. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16777. var t = -1;
  16778. if (e) {
  16779. var i = e.split("_");
  16780. t = parseInt(i[0])
  16781. }
  16782. return t
  16783. }
  16784. ,
  16785. t.exports = n
  16786. }
  16787. ).call(this, "/js/model/LabelCollection.js")
  16788. }
  16789. , {
  16790. "../label/Label": 90,
  16791. "../settings": 166,
  16792. "../util/IndexedCollection": 175,
  16793. "../util/ajax": 181,
  16794. "../util/common": 185,
  16795. "../util/logger": 189,
  16796. "../util/math": 190,
  16797. "./RoomCollection": 141
  16798. }],
  16799. 139: [function(e, t, i) {
  16800. (function(i) {
  16801. "use strict";
  16802. function n(e, t) {
  16803. o.Object3D.call(this),
  16804. this.sid = t.sid,
  16805. this.data = t,
  16806. this.options = e,
  16807. this.urls = new s(e.urlFiles),
  16808. this.isPublic = void 0 !== t.is_public && t.is_public,
  16809. this.images = new _(this),
  16810. this.images.extend(t.images),
  16811. this.heroImage = this.images.getImage(t.icon),
  16812. this.heroLocations = [],
  16813. this.outdoorPanoLocations = [],
  16814. this.floors = new d(this),
  16815. this.floorsEnabled = void 0 === e.floors || e.floors,
  16816. this.changingFloor = !1,
  16817. this.chunks = [],
  16818. this.panos = new A,
  16819. this.colliders = [],
  16820. this.loadPanosPromise = null,
  16821. this.loadMeshTexturesPromise = null,
  16822. this.auxDataPromise = null,
  16823. this.meshTexturesLoaded = !1,
  16824. this.meshTextures = [],
  16825. this.tags = {},
  16826. this.tagsShown = !1,
  16827. this.shouldShowtags = !1,
  16828. this.has360Views = !1,
  16829. this.showingLabels = f.labels.enabled && t.player_options.labels,
  16830. this.supportedModes = {},
  16831. this.supportedModes[c.PANORAMA] = !0,
  16832. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  16833. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  16834. this.supportedModes[c.TRANSITIONING] = !0,
  16835. this.supportsTiles = this.configureTiling(),
  16836. this.supportsVR = t.is_vr,
  16837. this.mode = c.DOLLHOUSE,
  16838. this.size = null,
  16839. this.center = null,
  16840. this.boundingBox = new o.Box3,
  16841. this.currentFloor = null,
  16842. this.allFloorsVisible = !0,
  16843. this.projectedPano0 = null,
  16844. this.projectedPano1 = null,
  16845. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  16846. this.addFloor(new u(this,t,e.trim()))
  16847. }
  16848. .bind(this)),
  16849. this.waitQueue = [],
  16850. this.on("load", function(e) {
  16851. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16852. return !e.isLoadedCallback()
  16853. }),
  16854. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16855. }
  16856. .bind(this)),
  16857. this.setupCustomProperties()
  16858. this.hots = {};
  16859. }
  16860. function r() {
  16861. try {
  16862. var e = document.createElement("canvas")
  16863. , t = e.getContext("webgl");
  16864. t || (t = e.getContext("experimental-webgl"));
  16865. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  16866. return i
  16867. } catch (e) {
  16868. return 0
  16869. }
  16870. }
  16871. var o = e("three")
  16872. , a = e("../util/ajax")
  16873. , s = e("../util/ModelUrls")
  16874. , l = e("../objects/BoundingTextureSkybox")
  16875. , c = e("../enum/Viewmode")
  16876. , h = e("../enum/RenderOrder")
  16877. , u = (e("../enum/AlignmentType"),
  16878. e("../objects/Floor"))
  16879. , d = e("./FloorCollection")
  16880. , p = e("../objects/Chunk")
  16881. , f = (e("../objects/Room"),
  16882. e("../objects/Snapshot"),
  16883. e("../label/Label"),
  16884. e("../util/math"),
  16885. e("../settings"))
  16886. ,ss = e("../shaders")
  16887. , g = e("../util/logger")
  16888. , m = e("../tag/tag")
  16889. , v = (e("../tag/tagManager"),
  16890. e("../objects/Panorama"))
  16891. , A = e("../util/PanoramaCollection")
  16892. , y = e("../loaders/ModelLoader")
  16893. , C = e("../loaders/ModelTextureLoader")
  16894. , I = e("../loaders/SweepDataLoader")
  16895. , E = e("../util/transitions")
  16896. , b = (e("../util/easing"),
  16897. e("../util/lerp"),
  16898. e("../util/common"))
  16899. , w = (e("../util/texture"),
  16900. e("./../util/browser"))
  16901. , _ = e("./ImageCollection")
  16902. , T = e("./RoomCollection")
  16903. , x = e("./LabelCollection")
  16904. , S = e("./Chunks")
  16905. , M = e("./../util/showcase")
  16906. , R = e("../exception/BasicException")
  16907. , P = (e("../constants")
  16908. ,e("events").EventEmitter)
  16909. ,Hot = e("hot")
  16910. , O = new g(i);
  16911. n.prototype = Object.create(o.Object3D.prototype),
  16912. b.extend(n, P),
  16913. n.prototype.setupCustomProperties = function() {
  16914. var e = f.modelAlpha;
  16915. Object.defineProperty(this, "alpha", {
  16916. get: function() {
  16917. return e
  16918. },
  16919. set: function(t) {
  16920. e = t,
  16921. this.chunks.forEach(function(t) {
  16922. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  16923. })
  16924. }
  16925. })
  16926. }
  16927. ,
  16928. n.prototype.configureTiling = function() {
  16929. var e = r();
  16930. if (e < 2048)
  16931. return !1;
  16932. O.warn("Max cube texture size: " + e);
  16933. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  16934. var i = f.tiling.tilingFlagNames[t];
  16935. if ("1" === w.valueFromHash(i, null))
  16936. return !0;
  16937. if ("0" === w.valueFromHash(i, null))
  16938. return !1
  16939. }
  16940. return !!M.modelDataPromisesTiles(this.data)
  16941. }
  16942. ,
  16943. n.prototype.toggleAlpha = function() {
  16944. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16945. }
  16946. ,
  16947. n.prototype.load = function(e) {
  16948. var t = function() {
  16949. return $.when(this.loadPanos(), this.loadMesh())
  16950. }
  16951. , i = this.urls.init().then(t.bind(this));
  16952. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  16953. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  16954. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  16955. }
  16956. ,
  16957. n.prototype.loadMesh = function() {
  16958. function e(e) {
  16959. O.error(e),
  16960. n.reject("loading-failed")
  16961. }
  16962. function t(e, t) {
  16963. n.notify(e, t)
  16964. }
  16965. function i(e, t) {
  16966. if (0 === e.length) {
  16967. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16968. r.supportedModes[c.DOLLHOUSE] = !1,
  16969. r.supportedModes[c.FLOORPLAN] = !1;
  16970. var i = new p({
  16971. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16972. });
  16973. i.material.visible = !1,
  16974. i.rotateX(-Math.PI / 2),
  16975. i.geometry.computeBoundingBox(),
  16976. e = [i]
  16977. }
  16978. e.forEach(function(e) {
  16979. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  16980. r.addChunk(t, e)
  16981. }),
  16982. r.floors.sort(),
  16983. n.resolve(r)
  16984. }
  16985. var n = $.Deferred()
  16986. , r = this;
  16987. return y.load(r.data.job.uuid, r.urls, i, t, e),
  16988. n.promise()
  16989. }
  16990. ,
  16991. n.prototype.loadMeshTextures = function() {
  16992. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  16993. this.meshTexturesLoaded = !0
  16994. }
  16995. .bind(this)),
  16996. this.loadTexturesPromise)
  16997. }
  16998. ,
  16999. /* n.prototype.loadtags = function() {//xzw改
  17000. var e = $.Deferred();
  17001. if (!f.tags.enabled)
  17002. return e.resolve();
  17003. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17004. t = "data/" + this.sid + "/tags.json"
  17005. return a.get(t, {
  17006. responseType: "json",
  17007. auth: this.isPublic ? null : f.authorizationHeader
  17008. }).done(function(t) {
  17009. var i = 0
  17010. , n = 0;
  17011. for (var r in t) {
  17012. var o = t[r];
  17013. o.enabled && (n++,
  17014. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17015. i++))
  17016. }
  17017. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17018. e.resolve()
  17019. }
  17020. .bind(this)).fail(function() {
  17021. O.warn("Getting tags failed, not displaying tags."),
  17022. e.resolve()
  17023. }),
  17024. e
  17025. } */
  17026. n.prototype.shineHots = function(){ //xzw
  17027. E.trigger({
  17028. func: function(e) {
  17029. if(e<=0.5) ss.hot.uniforms.opac.value = 2*e;
  17030. else ss.hot.uniforms.opac.value = -2*e + 2;
  17031. }.bind(this),
  17032. cycling: true,
  17033. duration: 3000,
  17034. //easing: "easeInOutQuad",
  17035. name: "hotShine"
  17036. })
  17037. },
  17038. n.prototype.audioAutoPlay = function(audio){
  17039. //https://www.cnblogs.com/interdrp/p/4211883.html 部分资料
  17040. audio.load(); // iOS 9 还需要额外的 load 一下, 否则直接 play 无效
  17041. var play = function(){
  17042. audio.play();
  17043. console.log('begin play bgm')
  17044. document.removeEventListener("touchstart",play);
  17045. $('#player')[0].removeEventListener("touchstart", play);
  17046. };
  17047. audio.play();
  17048. document.addEventListener("WeixinJSBridgeReady", function () {
  17049. play();
  17050. }, false);
  17051. document.addEventListener("touchstart", play);//ios需要加个事件才能播放 不能自动播放;如果还有浏览器不行,换成别的交互事件
  17052. $('#player')[0].addEventListener("touchstart", play);
  17053. audio.addEventListener('ended', function () {
  17054. audio.play();
  17055. });
  17056. }
  17057. n.prototype.loadhots = function() {//xzw
  17058. var e = $.Deferred();
  17059. var t = "data/" + this.sid + "/data2.js"
  17060. return a.get(t, {
  17061. responseType: "json",
  17062. auth: this.isPublic ? null : f.authorizationHeader
  17063. }).done(function(t) {
  17064. g_data2 = t;
  17065. this.hotsCount = 0;
  17066. for(var i in t.hots){
  17067. this.hotsCount ++;
  17068. this.hots[i] = new Hot(i, t.hots[i], this);
  17069. }
  17070. g_index = w.valueFromHash("m");
  17071. if(t.tourAudio){
  17072. g_tourAudio = new Audio;
  17073. g_tourAudio.loop = false;
  17074. g_tourAudio.addEventListener('ended', function () {
  17075. var ev = document.createEvent("MouseEvent");
  17076. ev.initEvent("tourAudioEnded",true,true);
  17077. window.dispatchEvent(ev);
  17078. });
  17079. }
  17080. if(t.hasBGM){
  17081. g_bgAudio = new Audio;
  17082. g_bgAudio.src = g_Prefix+"/audio/"+g_index+"/background.mp3";
  17083. g_bgAudio.loop = true;
  17084. g_bgAudio.autoplay = true;
  17085. g_playAudio = g_bgAudio;
  17086. this.audioAutoPlay(g_bgAudio)
  17087. }
  17088. /* g_audio=t.audio;
  17089. g_Text=t.texts;
  17090. g_TextShow=t.showText;
  17091. g_weixinTitle=t.weixintitle;
  17092. if("undefined" != typeof(t.roof))
  17093. {
  17094. g_roof=t.roof;
  17095. }
  17096. if("undefined" != typeof(t.dollhouseminDistance))
  17097. {
  17098. I.dollhouseDefault.minDistance=t.dollhouseminDistance;
  17099. } */
  17100. e.resolve()
  17101. }.bind(this)).fail(function() {
  17102. console.log('没有热点')
  17103. e.resolve()
  17104. }),
  17105. e
  17106. }
  17107. ,
  17108. n.prototype.loadPanos = function() {
  17109. if (this.loadPanosPromise)
  17110. return this.loadPanosPromise;
  17111. var e = new I(this);
  17112. return this.loadPanosPromise = e.load().then(function(e) {
  17113. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17114. return this.data.sweeps[e.uuid].enabled
  17115. }
  17116. .bind(this))),
  17117. this.panos.extend(e.map(function(e) {
  17118. return new v(this,e.uuid,e,this.supportsTiles)
  17119. }
  17120. .bind(this))),
  17121. this.panos.forEach(function(e) {
  17122. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17123. var i = this.panos.get(t);
  17124. i && this.panos.setNeighbour(e, i, !0)
  17125. }
  17126. .bind(this)),
  17127. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17128. }
  17129. .bind(this)),
  17130. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17131. this.supportedModes[c.PANORAMA] = !1),
  17132. $.when(this)
  17133. }
  17134. .bind(this)),
  17135. this.loadPanosPromise
  17136. }
  17137. ,
  17138. n.prototype.loadHighlightReel = function() {//xzw
  17139. var e = $.Deferred()
  17140. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17141. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17142. return a.get(t, {
  17143. responseType: "json",
  17144. auth: this.isPublic ? null : f.authorizationHeader
  17145. }).done(function(t) {
  17146. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17147. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17148. e.resolve()
  17149. }
  17150. .bind(this)).fail(function() {
  17151. O.warn("Getting highlight reel failed, no highlights available"),
  17152. e.resolve()
  17153. }),
  17154. e
  17155. }
  17156. ,
  17157. n.prototype.waitForLoad = function(e, t) {
  17158. t() || (this.waitQueue.push({
  17159. object: e,
  17160. isLoadedCallback: t
  17161. }),
  17162. 1 === this.waitQueue.length && this.emit("waiting"))
  17163. }
  17164. ,
  17165. n.prototype.hide = function() {
  17166. this.floors.hide()
  17167. }
  17168. ,
  17169. n.prototype.show = function() {
  17170. this.floors.show()
  17171. }
  17172. ,
  17173. n.prototype.floorNames = function() {
  17174. return this.floors.names()
  17175. }
  17176. ,
  17177. n.prototype.warpDestFloors = function(e, t) {
  17178. if (!e || this.floors.length !== e.length)
  17179. return void this.toggleAllFloors(!0);
  17180. var i = e.findIndex(function(e) {
  17181. return e
  17182. }
  17183. .bind(this));
  17184. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17185. }
  17186. ,
  17187. n.prototype.setFloor = function(e, t, i) {
  17188. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17189. this.allFloorsVisible = !1,
  17190. this._setFloor(e, t, i)
  17191. }
  17192. ,
  17193. n.prototype.toggleAllFloors = function(e) {
  17194. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17195. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17196. this._setFloor(this.currentFloor)
  17197. }
  17198. ,
  17199. n.prototype._setFloor = function(e, t, i) {
  17200. t = t || this.mode,
  17201. this.emit("floor.changed", e, t, this.currentFloor),
  17202. this.currentFloor = e;
  17203. var n;
  17204. if (t === c.PANORAMA) {
  17205. if (this.show(),
  17206. this.shouldShowtags && this.tagsShown)
  17207. for (n in this.tags)
  17208. this.tags[n].show(f.showFloorDuration)
  17209. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17210. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17211. }
  17212. .bind(this)),
  17213. this.shouldShowtags && this.tagsShown))
  17214. for (n in this.tags) {
  17215. var r = this.tags[n];
  17216. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17217. }
  17218. var o = this
  17219. , a = e;
  17220. E.start(function() {}, f.showFloorDelay, function() {
  17221. o.floors.forEach(function(e) {
  17222. e.chunks.forEach(function(t) {
  17223. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17224. })
  17225. })
  17226. }
  17227. .bind(this))
  17228. }
  17229. ,
  17230. n.prototype.toggleExplode = function() {
  17231. this.floors.toggleExplodeHorizontal()
  17232. }
  17233. ,
  17234. n.prototype.toggleExplodeUp = function() {
  17235. this.floors.toggleExplodeVertical()
  17236. }
  17237. ,
  17238. n.prototype.nextFloor = function(e) {
  17239. return this.floors.nextFloor(this.currentFloor, e)
  17240. }
  17241. ,
  17242. n.prototype.addFloor = function(e) {
  17243. this.floors.add(e)
  17244. }
  17245. ,
  17246. n.prototype.getFloorAtPoint = function(e) {
  17247. return this.floors.getFloorAtPoint(e)
  17248. }
  17249. ,
  17250. n.prototype.getTagBySid = function(e) {
  17251. return this.tags[e]
  17252. }
  17253. ,
  17254. n.prototype.addChunk = function(e, t) {
  17255. this.floors.getOrMakeFloor(e).addChunk(t),
  17256. this.chunks.push(t)
  17257. }
  17258. ,
  17259. n.prototype.setMode = function(e) {
  17260. if (!this.supportedModes[e])
  17261. throw new R("Mode not supported for this model: " + e);
  17262. this.mode = e,
  17263. this.chunks.forEach(function(t) {
  17264. t.setMode(e)
  17265. })
  17266. }
  17267. ,
  17268. n.prototype.build = function() {
  17269. this.heroLocations = this.images.getHeroLocations(this.panos);
  17270. var e = function() {
  17271. 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()
  17272. }
  17273. .bind(this)();
  17274. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17275. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17276. }
  17277. .bind(this)) || e,
  17278. null === this.heroImage && O.warn("No hero image defined."),
  17279. this.currentFloor = this.floors.last(),
  17280. this.floors.build(),
  17281. this.colliders = this.floors.reduce(function(e, t) {
  17282. return e.concat(t.collider.children)
  17283. }, []),
  17284. this.panos.forEach(function(e) {
  17285. e.build1(),
  17286. e.on("enter", function() {
  17287. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17288. }
  17289. .bind(this))
  17290. }
  17291. .bind(this)),
  17292. this.panos.forEach(function(e) {
  17293. e.build2()
  17294. }),
  17295. this.floors.forEach(function(e) {
  17296. this.boundingBox.union(e.boundingBox)
  17297. }
  17298. .bind(this)),
  17299. this.size = this.boundingBox.size(),
  17300. this.center = this.boundingBox.center(),
  17301. this.floors.forEach(function(e) {
  17302. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17303. }
  17304. .bind(this)),
  17305. this.panos.populate_path_graph(),
  17306. this.skybox = new l(this.boundingBox),
  17307. this.skybox.matrixWorldNeedsUpdate = !0,
  17308. this.add(this.skybox);
  17309. for (var t in this.tags)
  17310. this.tags[t].build();
  17311. return O.debug("Done building model"),
  17312. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17313. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17314. this.buildRooms(),
  17315. this.labels.associateWithRooms(this.rooms),
  17316. $.when(this)
  17317. }
  17318. ,
  17319. n.prototype.loadLabels = function() {//xzw
  17320. this.labels = new x(this);
  17321. var e = $.Deferred();
  17322. if (!this.showingLabels)
  17323. return e.resolve();
  17324. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17325. var t = "data/" + this.sid + "/labels.json";
  17326. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17327. O.warn("Getting labels failed, not displaying labels."),
  17328. e.resolve()
  17329. }),
  17330. e
  17331. }
  17332. ,
  17333. n.prototype.buildRooms = function() {
  17334. this.rooms = new T(this),
  17335. this.rooms.createFromChunks(this.chunks),
  17336. this.rooms.calcRoomBoundaries()
  17337. }
  17338. ,
  17339. n.prototype.updateProjectedPanos = function() {
  17340. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17341. }
  17342. ,
  17343. n.prototype.setProjectedPanos = function(e, t, i) {
  17344. void 0 !== i && null !== i || (i = !0),
  17345. i = !!i,
  17346. this.projectedPano0 = e,
  17347. this.projectedPano1 = t,
  17348. this.skybox.material.setProjectedPanos(e, t, i),
  17349. this.chunks.forEach(function(n) {
  17350. n.materialInside.setProjectedPanos(e, t, i)
  17351. })
  17352. }
  17353. ,
  17354. n.prototype.setSide = function(e) {
  17355. this.floors.forEach(function(t) {
  17356. t.collider.material.side = e
  17357. })
  17358. }
  17359. ,
  17360. n.prototype.heroCount = function() {
  17361. return this.heroLocations ? this.heroLocations.length : 0
  17362. }
  17363. ,
  17364. n.prototype.getHeroDescriptorByIndex = function(e) {
  17365. if (e < 0)
  17366. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17367. null;
  17368. var t = this.heroCount();
  17369. if (t < 1)
  17370. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17371. null;
  17372. var i = this.heroLocations[e];
  17373. return void 0 === i ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17374. null) : i
  17375. }
  17376. ,
  17377. n.prototype.findPanoramicHero = function() {
  17378. for (var e in this.heroLocations)
  17379. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  17380. return this.heroLocations[e];
  17381. return null
  17382. }
  17383. ,
  17384. n.prototype.listImagePanos = function() {
  17385. var e = []
  17386. , t = this;
  17387. return this.images.forEach(function(i) {
  17388. if (i.metadata && i.metadata.scan_id) {
  17389. var n = t.panos.get(i.metadata.scan_id);
  17390. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  17391. }
  17392. }),
  17393. e
  17394. }
  17395. ,
  17396. n.prototype.fadePanoMarkers = function(e, t) {
  17397. this.panos.fadeMarkerOpacity(e, t)
  17398. }
  17399. ,
  17400. n.prototype.setSweepVisibility = function(e) {
  17401. this.panos.forEach(function(t) {
  17402. t.marker && (t.marker.visible = e)
  17403. })
  17404. }
  17405. ,
  17406. n.prototype.outsideAllowed = function() {
  17407. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  17408. }
  17409. ,
  17410. t.exports = n
  17411. }
  17412. ).call(this, "/js/model/Model.js")
  17413. }
  17414. , {
  17415. "../constants": 8,
  17416. "../enum/AlignmentType": 17,
  17417. "../enum/RenderOrder": 42,
  17418. "../enum/Viewmode": 51,
  17419. "../exception/BasicException": 55,
  17420. "../label/Label": 90,
  17421. "../loaders/ModelLoader": 105,
  17422. "../loaders/ModelTextureLoader": 106,
  17423. "../loaders/SweepDataLoader": 107,
  17424. "../tag/tag": 123,
  17425. "../tag/tagManager": 124,
  17426. "../objects/BoundingTextureSkybox": 143,
  17427. "../objects/Chunk": 144,
  17428. "../objects/Floor": 146,
  17429. "../objects/Panorama": 148,
  17430. "../objects/Room": 150,
  17431. "../objects/Snapshot": 153,
  17432. "../settings": 166,
  17433. "../shaders": 167,
  17434. "../util/ModelUrls": 177,
  17435. "../util/PanoramaCollection": 178,
  17436. "../util/ajax": 181,
  17437. "../util/common": 185,
  17438. "../util/easing": 186,
  17439. "../util/lerp": 188,
  17440. "../util/logger": 189,
  17441. "../util/math": 190,
  17442. "../util/texture": 194,
  17443. "../util/transitions": 195,
  17444. "./../util/browser": 182,
  17445. "./../util/showcase": 193,
  17446. "./Chunks": 135,
  17447. "./FloorCollection": 136,
  17448. "./ImageCollection": 137,
  17449. "./LabelCollection": 138,
  17450. "./RoomCollection": 141,
  17451. events: 202,
  17452. three: 217,
  17453. "hot": "hot"
  17454. }],
  17455. 140: [function(e, t, i) {
  17456. "use strict";
  17457. function n() {
  17458. this.modelMap = {},
  17459. this.activeModel = null,
  17460. this.modelCount = 0,
  17461. this.tileDownloader = null,
  17462. this.panoRenderer = null
  17463. }
  17464. var r = (e("three"),
  17465. e("../util/common"))
  17466. , o = e("../exception/BasicException")
  17467. , a = e("../enum/ModelManagerEvents")
  17468. , s = e("../enum/PanoRendererEvents")
  17469. , l = e("events").EventEmitter;
  17470. n.prototype.init = function(e, t, i) {
  17471. this.tileDownloader = e,
  17472. this.panoRenderer = t,
  17473. this.qualityManager = i,
  17474. this.bindEvents()
  17475. }
  17476. ,
  17477. n.prototype.bindEvents = function() {
  17478. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17479. }
  17480. ,
  17481. n.prototype.onTileRendered = function(e, t, i, n) {}
  17482. ,
  17483. n.prototype.addModel = function(e) {
  17484. this.modelMap[e.sid] = e,
  17485. 0 === this.modelCount && this.activateModel(e.sid),
  17486. this.modelCount++,
  17487. this.emit(a.ModelAdded)
  17488. }
  17489. ,
  17490. n.prototype.getModel = function(e) {
  17491. return this.modelMap[e]
  17492. }
  17493. ,
  17494. n.prototype.activateModel = function(e) {
  17495. var t = this.modelMap[e];
  17496. if (!t)
  17497. throw new o("Tried to activate invalid model!");
  17498. var i = this.activeModel;
  17499. this.activeModel = t,
  17500. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17501. this.tileDownloader.setUrls(t.urls),
  17502. t.panos.forEach(function(e) {
  17503. e.attachToPanoRenderer(this.panoRenderer),
  17504. e.tileDownloader = this.tileDownloader,
  17505. e.qualityManager = this.qualityManager
  17506. }
  17507. .bind(this)),
  17508. this.emit(a.ActiveModelChanged, {
  17509. oldModel: i,
  17510. model: t
  17511. })
  17512. }
  17513. ,
  17514. n.prototype.getActiveModel = function() {
  17515. return this.activeModel
  17516. }
  17517. ,
  17518. r.extend(n, l),
  17519. t.exports = n
  17520. }
  17521. , {
  17522. "../enum/ModelManagerEvents": 33,
  17523. "../enum/PanoRendererEvents": 35,
  17524. "../exception/BasicException": 55,
  17525. "../util/common": 185,
  17526. events: 202,
  17527. three: 217
  17528. }],
  17529. 141: [function(e, t, i) {
  17530. (function(i) {
  17531. "use strict";
  17532. function n() {
  17533. s.call(this)
  17534. }
  17535. var r = e("../objects/Room")
  17536. , o = (e("../settings"),
  17537. e("../util/logger"))
  17538. , a = (e("../util/transitions"),
  17539. e("../util/easing"),
  17540. e("../util/common"))
  17541. , s = e("../util/IndexedCollection")
  17542. , l = e("./Chunks");
  17543. new o(i);
  17544. a.inherit(n, s),
  17545. n.prototype.getIndex = function(e) {
  17546. return e.roomId
  17547. }
  17548. ,
  17549. n.prototype.calcRoomBoundaries = function() {
  17550. this.forEach(function(e) {
  17551. e.calcBoundaries()
  17552. })
  17553. }
  17554. ,
  17555. n.prototype.createFromChunks = function(e) {
  17556. var t = {
  17557. floorId: -1,
  17558. roomId: -1
  17559. }
  17560. , i = {};
  17561. e.forEach(function(e) {
  17562. l.parseIdsFromChunkName(e.name, t);
  17563. var o = i[t.roomId];
  17564. if (!o) {
  17565. var a = n.generateRoomId(t.floorId, t.roomId);
  17566. o = new r(t.floorId,a),
  17567. this.add(o),
  17568. i[t.roomId] = o
  17569. }
  17570. o.addChunk(e)
  17571. }
  17572. .bind(this)),
  17573. this.calcRoomBoundaries()
  17574. }
  17575. ,
  17576. n.generateRoomId = function(e, t) {
  17577. return e + "_" + t
  17578. }
  17579. ,
  17580. t.exports = n
  17581. }
  17582. ).call(this, "/js/model/RoomCollection.js")
  17583. }
  17584. , {
  17585. "../objects/Room": 150,
  17586. "../settings": 166,
  17587. "../util/IndexedCollection": 175,
  17588. "../util/common": 185,
  17589. "../util/easing": 186,
  17590. "../util/logger": 189,
  17591. "../util/transitions": 195,
  17592. "./Chunks": 135
  17593. }],
  17594. 142: [function(e, t, i) {
  17595. "use strict";
  17596. function n(e, t, i) {
  17597. e = e.clone();
  17598. var n = e.size()
  17599. , o = new r.BoxGeometry(n.x,n.y,n.z);
  17600. o.boundingBox = e,
  17601. r.Mesh.call(this, o, t),
  17602. this.position.copy(e.center()),
  17603. this.frustumCulled = !1,
  17604. i && this.add(new r.WireframeHelper(this))
  17605. }
  17606. var r = e("three");
  17607. n.prototype = Object.create(r.Mesh.prototype),
  17608. n.prototype.constructor = n,
  17609. t.exports = n
  17610. }
  17611. , {
  17612. three: 217
  17613. }],
  17614. 143: [function(e, t, i) {
  17615. (function(i) {
  17616. "use strict";
  17617. function n(e) {
  17618. h.time("Computing a nice bounding cubemap");
  17619. var t = new a({
  17620. side: r.BackSide,
  17621. transparent: !0
  17622. });
  17623. t.uniforms.modelAlpha.value = 0,
  17624. t.uniforms.opacity.value = 1 - s.modelAlpha,
  17625. this.renderOrder = l.boundingSkybox,
  17626. o.call(this, e, t),
  17627. h.timeEnd("Computing a nice bounding cubemap")
  17628. }
  17629. var r = e("three")
  17630. , o = (e("../enum/Viewmode"),
  17631. e("../shaders"),
  17632. e("./BoundingMesh"))
  17633. , a = e("../materials/ModelTextureMaterial")
  17634. , s = e("../settings")
  17635. , l = e("../enum/RenderOrder")
  17636. , c = e("../util/logger")
  17637. , h = new c(i);
  17638. n.prototype = Object.create(o.prototype),
  17639. n.prototype.constructor = n,
  17640. t.exports = n
  17641. }
  17642. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17643. }
  17644. , {
  17645. "../enum/RenderOrder": 42,
  17646. "../enum/Viewmode": 51,
  17647. "../materials/ModelTextureMaterial": 118,
  17648. "../settings": 166,
  17649. "../shaders": 167,
  17650. "../util/logger": 189,
  17651. "./BoundingMesh": 142,
  17652. three: 217
  17653. }],
  17654. 144: [function(e, t, i) {
  17655. "use strict";
  17656. function n(e) {
  17657. this.materialInside = new s({
  17658. side: r.DoubleSide
  17659. });
  17660. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17661. this.materialOutside = new r.RawShaderMaterial({
  17662. fragmentShader: o.modelOutside.fragmentShader,
  17663. vertexShader: o.modelOutside.vertexShader,
  17664. uniforms: t,
  17665. side: r.FrontSide,
  17666. name: "chunkOut"
  17667. }),
  17668. r.Mesh.call(this, e.geometry, this.materialInside),
  17669. this.name = e.name || "",
  17670. this.textureName = e.textureName,
  17671. this.meshUrl = e.meshUrl
  17672. }
  17673. var r = e("three")
  17674. , o = e("../shaders")
  17675. , a = e("../enum/Viewmode")
  17676. , s = e("../materials/ModelTextureMaterial");
  17677. n.prototype = Object.create(r.Mesh.prototype),
  17678. n.prototype.setTextureMap = function(e) {
  17679. this.materialInside.uniforms.map.value = e,
  17680. this.materialOutside.uniforms.map.value = e
  17681. }
  17682. ,
  17683. n.prototype.setMode = function(e) {
  17684. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17685. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17686. t.transparent = this.material.transparent,
  17687. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  17688. this.material = t
  17689. }
  17690. ,
  17691. t.exports = n
  17692. }
  17693. , {
  17694. "../enum/Viewmode": 51,
  17695. "../materials/ModelTextureMaterial": 118,
  17696. "../shaders": 167,
  17697. three: 217
  17698. }],
  17699. 145: [function(e, t, i) {
  17700. "use strict";
  17701. function n(e) {
  17702. this.chunksize = e || 10,
  17703. this.chunks = {},
  17704. this.boundingBoxes = {},
  17705. this.children = [],
  17706. this.offset = new r.Vector3(0,.5,0),
  17707. this.material = new r.MeshBasicMaterial({
  17708. color: 16777215 * Math.random(),
  17709. side: r.DoubleSide
  17710. })
  17711. }
  17712. var r = e("three");
  17713. e("../enum/Viewmode");
  17714. n.prototype.add = function(e) {
  17715. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  17716. m ? (t = m.position.array,
  17717. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17718. n = e.faces);
  17719. var v = new r.Vector3;
  17720. if (i)
  17721. for (o = 0,
  17722. a = i.length; o < a; o += 3) {
  17723. var A = 3 * i[o]
  17724. , y = 3 * i[o + 1]
  17725. , C = 3 * i[o + 2];
  17726. s = (t[A] + t[y] + t[C]) / 3,
  17727. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  17728. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  17729. h = Math.floor(s / this.chunksize),
  17730. u = Math.floor(l / this.chunksize),
  17731. d = Math.floor(c / this.chunksize),
  17732. p = h + "." + u + "." + d,
  17733. p in this.chunks ? (g = this.chunks[p],
  17734. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  17735. f = this.boundingBoxes[p] = new r.Box3),
  17736. g.push(t[A], t[A + 1], t[A + 2], t[y], t[y + 1], t[y + 2], t[C], t[C + 1], t[C + 2]),
  17737. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  17738. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  17739. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  17740. }
  17741. else
  17742. for (o = 0,
  17743. a = t.length; o < a; o += 9)
  17744. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  17745. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  17746. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  17747. h = Math.floor(s / this.chunksize),
  17748. u = Math.floor(l / this.chunksize),
  17749. d = Math.floor(c / this.chunksize),
  17750. p = h + "." + u + "." + d,
  17751. p in this.chunks ? (g = this.chunks[p],
  17752. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  17753. f = this.boundingBoxes[p] = new r.Box3),
  17754. g.push(t[o], t[o + 1], t[o + 2], t[o + 3], t[o + 4], t[o + 5], t[o + 6], t[o + 7], t[o + 8]),
  17755. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  17756. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  17757. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  17758. }
  17759. ,
  17760. n.prototype.build = function() {
  17761. var e = new r.Object3D;
  17762. e.material = this.material;
  17763. for (var t in this.chunks) {
  17764. var i = this.chunks[t]
  17765. , n = new r.BufferGeometry;
  17766. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  17767. n.boundingBox = this.boundingBoxes[t];
  17768. var o = new r.Mesh(n,this.material);
  17769. o.material.visible = !1,
  17770. e.add(o),
  17771. this.chunks[t] = []
  17772. }
  17773. return e
  17774. }
  17775. ,
  17776. t.exports = n
  17777. }
  17778. , {
  17779. "../enum/Viewmode": 51,
  17780. three: 217
  17781. }],
  17782. 146: [function(e, t, i) {
  17783. "use strict";
  17784. function n(e, t, i) {
  17785. r.Object3D.call(this),
  17786. this.model = e,
  17787. this.floorIndex = t,
  17788. this.name = i || d.FLOOR_NAME + (t + 1),
  17789. this.panos = [],
  17790. this.chunks = [],
  17791. this.colliderBuilder = new l(3),
  17792. this.collider = null,
  17793. this.center = null,
  17794. this.boundingBox = new r.Box3,
  17795. this.size = null,
  17796. this.hidden = !1,
  17797. this.conservativeBoundingBox = new r.Box3,
  17798. this.debugColor = 16777215 * Math.random(),
  17799. this.transition = null
  17800. }
  17801. var r = e("three")
  17802. , o = e("../settings")
  17803. , a = e("../util/common")
  17804. , s = e("../util/lerp")
  17805. , l = e("./ChunkedCollider")
  17806. , c = e("../util/transitions")
  17807. , h = e("../util/easing")
  17808. , u = (e("../objects/Panorama"),
  17809. e("../enum/RenderOrder"))
  17810. , d = e("../localization/localize");
  17811. n.prototype = Object.create(r.Object3D.prototype),
  17812. n.prototype.enter = function(e) {
  17813. this.model.setFloor(this, e)
  17814. }
  17815. ,
  17816. n.prototype.hide = function(e) {
  17817. if (!this.hidden || this.transition) {
  17818. this.chunks.forEach(function(e) {
  17819. e.material.transparent = !0
  17820. }),
  17821. c.cancel(this.transition);
  17822. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  17823. , i = e ? 0 : o.hideFloorDelay / t;
  17824. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  17825. this.hidden = !0
  17826. }
  17827. .bind(this), i, h.easeInOutQuad)
  17828. }
  17829. }
  17830. ,
  17831. n.prototype.show = function(e) {
  17832. if (this.hidden || this.transition) {
  17833. this.hidden = !1,
  17834. c.cancel(this.transition);
  17835. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  17836. , i = e ? 0 : o.showFloorDelay / t;
  17837. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  17838. this.hidden || this.chunks.forEach(function(e) {
  17839. e.material.transparent = !1
  17840. })
  17841. }
  17842. .bind(this), i, h.easeInOutQuad)
  17843. }
  17844. }
  17845. ,
  17846. n.prototype.toggle = function(e, t) {
  17847. e = void 0 === e ? this.hidden : e,
  17848. e ? this.show(t) : this.hide(t)
  17849. }
  17850. ,
  17851. n.prototype.containsPoint = function(e) {
  17852. return this.collider.children.some(function(t) {
  17853. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  17854. t.geometry.boundingBox.containsPoint(e)
  17855. })
  17856. }
  17857. ,
  17858. n.prototype.distanceToPoint = function(e) {
  17859. var t = null
  17860. , i = 1 / 0;
  17861. return this.collider.children.forEach(function(n) {
  17862. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  17863. var r = n.geometry.boundingBox.distanceToPoint(e);
  17864. (!t || i > r) && (i = r,
  17865. t = n)
  17866. }),
  17867. i
  17868. }
  17869. ,
  17870. n.prototype.addChunk = function(e) {
  17871. e.renderOrder = u.ghostFloor,
  17872. this.add(e),
  17873. this.chunks.push(e),
  17874. this.boundingBox.union(e.geometry.boundingBox),
  17875. this.size = this.boundingBox.size(),
  17876. this.colliderBuilder.add(e.geometry)
  17877. }
  17878. ,
  17879. n.prototype.addPano = function(e) {
  17880. this.panos.push(e),
  17881. this.add(e.skyboxMesh),
  17882. e.marker && this.add(e.marker);
  17883. var t = new r.Vector3(1,1,1)
  17884. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  17885. this.boundingBox.union(i)
  17886. }
  17887. ,
  17888. n.prototype.build = function() {
  17889. this.collider = this.colliderBuilder.build(!0),
  17890. this.add(this.collider),
  17891. this.center = this.boundingBox.center(),
  17892. this.conservativeBoundingBox.copy(this.boundingBox),
  17893. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  17894. return e.geometry.boundingBox.min.y
  17895. }), 5),
  17896. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  17897. return e.geometry.boundingBox.max.y
  17898. }), 5),
  17899. this.colliderBuilder = null
  17900. }
  17901. ,
  17902. n.prototype.toShortString = function() {
  17903. return a.nth(this.floorIndex + 1)
  17904. }
  17905. ,
  17906. n.prototype.toString = function() {
  17907. return this.name
  17908. }
  17909. ,
  17910. t.exports = n
  17911. }
  17912. , {
  17913. "../enum/RenderOrder": 42,
  17914. "../localization/localize": 108,
  17915. "../objects/Panorama": 148,
  17916. "../settings": 166,
  17917. "../util/common": 185,
  17918. "../util/easing": 186,
  17919. "../util/lerp": 188,
  17920. "../util/transitions": 195,
  17921. "./ChunkedCollider": 145,
  17922. three: 217
  17923. }],
  17924. 147: [function(e, t, i) {
  17925. "use strict";
  17926. function n(e) {
  17927. this.player = e,
  17928. this.obj3d = null,
  17929. this.UP = new r.Vector3(0,1,0)
  17930. }
  17931. var r = e("three")
  17932. , o = e("../settings");
  17933. n.prototype.prefs = {
  17934. linewidth: 3,
  17935. height: .07,
  17936. opacity: .45,
  17937. endScale: .05
  17938. },
  17939. n.prototype.discard = function() {
  17940. if (this.obj3d) {
  17941. var e = this.obj3d.parent;
  17942. e && e.remove(this.obj3d)
  17943. }
  17944. this.obj3d = null
  17945. }
  17946. ,
  17947. n.prototype.draw = function() {
  17948. if (this.discard(),
  17949. o.showNeighbors) {
  17950. var e = this.player.currentPano.floor;
  17951. this.obj3d = new r.Object3D;
  17952. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17953. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17954. i.y += this.prefs.height;
  17955. var n = .1525
  17956. , a = .127
  17957. , s = .0127
  17958. , l = .1
  17959. , c = .19
  17960. , h = .2032
  17961. , u = .2286
  17962. , d = .255
  17963. , p = new r.Matrix4;
  17964. for (var f in t)
  17965. if (t[f]) {
  17966. var g = this.player.model.panos.get(f)
  17967. , m = (g.position.clone().sub(this.player.model.position),
  17968. g.position.clone().sub(g.floorPosition))
  17969. , v = g.floorPosition.clone().sub(this.player.model.position);
  17970. v.y += this.prefs.height;
  17971. var A = new r.Geometry;
  17972. A.vertices.push(new r.Vector3(0,-s,0), new r.Vector3(-s,0,0), new r.Vector3(0,s,0), new r.Vector3(s,0,0), new r.Vector3(0,-s,0)),
  17973. A.vertices.push(new r.Vector3(0,-d,0), new r.Vector3(d,-d,0), new r.Vector3(d,n,0), new r.Vector3(-n,n,0), new r.Vector3(-n,a,0), new r.Vector3(-c,l,0), new r.Vector3(-c,-h,0), new r.Vector3(-n,-u,0), new r.Vector3(-n,-d,0), new r.Vector3(0,-d,0)),
  17974. p.identity().setPosition(m),
  17975. A.applyMatrix(p),
  17976. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  17977. A.vertices.push(new r.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new r.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  17978. p.lookAt(v, i, this.UP).setPosition(v),
  17979. A.applyMatrix(p),
  17980. A.vertices.push(v, i);
  17981. var y = new r.Line(A,new r.LineBasicMaterial({
  17982. color: g.debugColor.getHex(),
  17983. transparent: !0,
  17984. opacity: this.prefs.opacity,
  17985. depthWrite: !1,
  17986. name: "sLine" + f,
  17987. linewidth: this.prefs.linewidth
  17988. }));
  17989. this.obj3d.add(y)
  17990. }
  17991. e.add(this.obj3d)
  17992. }
  17993. }
  17994. ,
  17995. n.prototype.update = function() {
  17996. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17997. }
  17998. ,
  17999. t.exports = n
  18000. }
  18001. , {
  18002. "../settings": 166,
  18003. three: 217
  18004. }],
  18005. 148: [function(e, t, i) {
  18006. (function(i) {
  18007. "use strict";
  18008. function n(e, t, i, n) {
  18009. this.model = e,
  18010. this.id = t,
  18011. this.alignmentType = i.alignmentType || l.ALIGNED,
  18012. this.neighbourUUIDs = i.neighbours || null,
  18013. this.neighbourPanos = null,
  18014. this.floor = null,
  18015. this.floorIndex = i.floor,
  18016. this.failedLoadingAt = 0,
  18017. this.maxLoadRetries = 4,
  18018. this.origin = i.position.clone(),
  18019. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18020. this.quaternion = i.quaternion.clone(),
  18021. this.skyboxMesh = new r.Mesh(E),
  18022. this.skyboxMesh.position.copy(this.position),
  18023. this.skyboxMesh.quaternion.copy(this.quaternion),
  18024. this.skyboxMesh.name = "skybox",
  18025. this.skyboxMesh.visible = !1,
  18026. this.skyboxMesh.updateMatrix(),
  18027. this.skyboxMesh.updateMatrixWorld(),
  18028. this.marker = null,
  18029. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18030. map: w,
  18031. side: r.DoubleSide,
  18032. opacity: 0,
  18033. transparent: !0,
  18034. depthWrite: !1
  18035. })),
  18036. this.marker.renderOrder = s.panoMarker,
  18037. this.marker.name = "marker",
  18038. this.marker.pano = this,
  18039. this.marker.layers.set(v.PANOMARKERS),
  18040. this.marker.updateMatrixWorld(),
  18041. a.colorMarkerOnLoad && this.on("load", function() {
  18042. this.marker.material.color.set(65280)
  18043. })),
  18044. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18045. this.floorPosition = i.puck ? i.puck.clone() : null,
  18046. this.tiled = n,
  18047. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18048. this.solidSkybox.flipY = !1,
  18049. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18050. this.solidSkybox.magFilter = r.LinearFilter,
  18051. this.solidSkybox.generateMipmaps = !1)),
  18052. this.zoomed = !1,
  18053. this.panoRenderer = null,
  18054. this.qualityManager = null,
  18055. this.tileDownloader = null,
  18056. this.tiledPanoRenderTarget = null,
  18057. this.minimumTiledPanoLoaded = !1,
  18058. this.highestPartialTileRenderOpCompleted = 0,
  18059. this.highestFullTileRenderOpCompleted = 0,
  18060. this.shouldRedrawOnBaseLoaded = !1,
  18061. this.lockUntilRenderingComplete = !1,
  18062. a.colorMarkerOnLoad && this.on("load", function() {
  18063. this.marker.material.color.set(65280)
  18064. })
  18065. }
  18066. var r = e("three")
  18067. , o = e("../util/logger")
  18068. , a = e("../settings")
  18069. , s = (e("../enum/Viewmode"),
  18070. e("../enum/RenderOrder"))
  18071. , l = e("../enum/AlignmentType")
  18072. , c = (e("../util/common"),
  18073. e("../util/transitions"))
  18074. , h = e("../util/lerp")
  18075. , u = e("../util/ajax")
  18076. , d = e("../util/texture")
  18077. , p = e("../util/panorama")
  18078. , f = (e("../enum/TileDownloaderEvents"),
  18079. e("../enum/PanoramaEvents"))
  18080. , g = e("../enum/PanoRendererEvents")
  18081. , m = e("../enum/PanoSizeClass")
  18082. , v = e("../enum/RenderLayers")
  18083. , A = (e("../scene/SceneRenderer"),
  18084. e("../enum/GLCubeFaces"),
  18085. e("../exception/BasicException"))
  18086. , y = e("../tile/TileUtils")
  18087. , C = e("events").EventEmitter
  18088. , I = new o(i)
  18089. , E = new r.SphereBufferGeometry(.1)
  18090. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  18091. , w = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAIIRJREFUeAHtnQvsXVWVxnnKG8qjFCiPtjA8Qh3COyTgpIOgECQDwmAI+ByMCiNqJDpRY4ya0cGoICiB+MQhIA8JElAeaRxISAuFMJRAkUIpFCjlUYZnodD5fWXfet/3nHvPY6991krW/9z/uefss/a31vruPnvvs89667k4Ao6AI+AIOAKOgCPgCDgCjkCDEFi/QXVNsqpr1qzZkIpti+4QtluylW4RtPX5ffyvYzfqUv5db3WXvsP/b6Gvoa+Gbeuz/n8JfV7b9ddfX8e6GEXACcCI40j07TB1OrorOg3dHlXST0E3QOuQd7noSlRk8AK6HH0KXQYxvMjWJXIEnAAidBDJvhNm7YnujirhlfiboZbkDYxdhooQlqKLIYVn2bpEhIATQM3OINnVJJ+BKuFbqmZ7iqLbh8VtugRS0O2HS00IOAHUADxJP5XL7o/ORvdBdX/eRFE/wyJ0IfogZLCiiSDUWWcngArQJ+GFsxL9AFSJr3t4l14E1IfwIHo/ughCWNN7iO8pEgEngCLRbCsrJP0/sOsQ9CB0q7av/eNoBF7hkHvRe9C/ORmMBmycI5wAxkFtyDkk/h58fQSqpN9myKH+VXYEXuZQkcFdEMET2U/zI0ch4AQwCqEM35P06qE/HD0S3S3DKX7I+Ag8yal3ovMgA400uEyAgBPABOCR+HtxupL+YLSpHXkTIDjRqepAXIDeCRE8OlFJDT7ZCSCn88O9vRL+GHRGztP98HIQWEKxt6ILvK8gH8BOABnxIvE34VD92h+NahaeS3wIaDbi7ahaBaviMy8+i5wARvgk3N/r134OuvmIw/3rOBB4HTPmord6P8FwhzgBDMAn/OJ/kK+V/Nam4Q6oVeN2q5NQtwa3eYugv++dALpwIfHVmadf+2PRVKfkdtU6+X81BfkWdC5EoM5Dl4CAE0AAgsQXFhq/PwndOuz2TVoIaD7B9ajmE/gsQ4BwAgAEkl/DeaehevrOJX0E9HTiVZBA44cPG00AJL6esf8oqum6Ls1DQNOMr4UIGrt2QSMJgMTXAhrq3DsB9Qk8gNBgUZ/AjahGDLTASaOkcQRA8quZfybqzf1GhfrIyuq24HJIQNvGSGMIgMTfGK9+BNUvv1oALo5ANwJqAWjY8E8QwdvdX6b4fyMIgOSfifM+g2ohDhdHYBQCWpjkl5DA46MOtP598gRA8mvqrjr6NrTuLLe/UgTe4WrqINTU4mQlWQIg8TVt95OoVuFxcQTGRUCrE/0GItD04uQkSQIg+WfhqbNQDfO5OAKTIqBhwktTvCVIjgBIfnXyaTafN/knDXs/vx0B3RL8ERJQJ2EykgwBkPhb4JVPoe9PxjtekRgReACjfg0R6E1J5iUJAvAmv/k4tFYB3RJcBgk8Zs3wbnvNEwDJr0d2T0a9yd/tXf+/TAR0S3AdJHBbmRcpu2zTBEDynwpAIgAXR6AuBLTWwNV1XXzS65okABJfv/afQLUSr4sjUDcC8zDgtxCBWgWmxBwBkPx6eOdzqN6w4+IIxIKA3mh0CSRgasERUwRA8qun/9/RmbF43e1wBNoQ0NThn0ECZkYIzBAAya9JPeeienW2iyMQKwJ6BfoFkICJNQZMEADJvwugfhHdNlavu12OQBsCL/H5Qkjg6bZ9UX6MngBI/j1B7mxUzX8XR8AKAroNuBgSWByzwVETAMmvjj51+PmqPTFHkds2CAF1CKpjUB2EUUq0C2OEX35P/ijDxo3KiMDaEasQyxlPqfawKAkAwHTPr2a///JXGw9+teIRUAyfTUzvXHzRk5cYHQEAlHr71eHn9/yT+9dLiAMBxfK5IbbjsChYERUBANBaoLDNe/ujChM3pgAEFNMigah+2KLpBAQYNZW+gs4sAGwvohcBLXL5Zpvq7bn6X7Ipqrcfa9tSLaLqUjwCmiz0YzoGo5gxGAUBkPya2382un/xeDeixDXUUhNPlqPPtm1X8FlLWa0i4LTibWbBJ2odihS0tNpUVBOwprVtdasWRfxghzXRqICGCGt/diAKBxJsnwYQf7AnWxgr2Zehi1CNMSvhnyOYKl3GGp+phbAjKmLQXI190OloFDGFHbHLPHz2q7qNrN1ZBNKpgOCP9A6PBP2yP4wq6RcROHrbbXSCL/U2ZRGBdF9ULQaXwQjU/ihxrQRAwCjxRQAunQioabgQXYAq4Vd2fm3jP/w7BUtFBgejs1Hd6rl0InA1/q1tUZHaCIDgmAUOX0U9KP4eEEv4qGfL58f6K/93U/N9Cq2DwzhLt3oz8p2d9NEi+x/h71qWF6uFAAgGDYV8E1VHUtNFnXfzUb2zXvfzyQv+V7/BEagIwWPgvQ7c7+H/16p2fl0EcA4VbfrqvY+Awc3oQzheHXuNE4hA8bcfehy6d+MA6KzwA8TBRZ27yv+vcgLA6cdSLb2qq6mie/ubcLZ68F0CAsSFRhKOR9VX0FTRq8huqbLylRIATm7qfb9+4e9Db8bBS6t0sLVrESO7Y7NaBAeilcZnBFhV3h9QGcA4VhNKvoU26Z5PiX83ql/8Z9i6ZESAeNmZQ9UiOBStLE4zmlfmYeoT+i7xoglcpUtlwOLQL1CbJr2o80nqewWOrKV3t/TIqegCxI1ajaeju1V0yRgucz9x8/MqDKmEAHBik8b738BxN6BzcWIjO/eKDlziR3E6Bz0R3azo8iMtr5L5AaUTAM6bCcDnoU0Y759PPa8h8V+ONKhMm0UsbUMFTkE1fJi6qD/gfGLp8TIrWioB4DDNF/82OrXMSkRQtsbv1dzXVF2XkhEgrjS7ULcFmk+Qsuhhru8QV6U951E2AZxMBT6Usoeo2x3olThpdeL1jKp64cflNIw6KirDijfmL8TWdcUX+16JpREADtJwzn+gG5RlfM3lvsn1f49z1MvvUhMCxJlGCc5AN63JhLIv+y4X+E/irJTh41KSE6eo3DPRUsovG/EM5auH//ue/BmQKvmQ4IPvcxn5JEVZm0shpwqvX1kJegyWqgWQovwPlfoBgfdcipWzWKfgix9gu3yToiiXlFOFS+EEAFNpos8JhVtaf4GrMOEygu2/Ub/fr98fHRbIJ/KNfITKV6nJCSG3Cq1X4QSAdZrnr/X9UpJXqcxPCLB7UqpUinUJPvoJdZPPUhLlVOHP0BRKADDUXhh5SEqoUxdNzSx9PDYxzGqtDiSgsfPzUfkuJTkk5FhhdSqMADBMIwoalklJnqYyPySgGvGcfkqOCz77IXWSD1OS00KuFVKnwggAa45AU+r4e5T66Jff5HJchUSH8UKC79QSkC9TEeWYcq0QKYQAYCTdn5xUiEVxFPK/mPFTAqiSJ7LiqHKaVgQf/pTayaepyEkh5yauTyEEgBX/jG49sTVxFKBA+QWBU9r0yziq2Rwrgi9/QY1TIQHl2pwiPDgxAcBEm2BIKWOURVQwZxlqKl5KwLyb8zw/PHIEgk8vxcxUbgeODbk3EfITEwBX16O+W05kRRwnq7NIb2vxX/44/FG4FcG3F1NwCh2Dyjnl3kQyEQHAQHo2O4Vffw0XXUCA+D3/ROEU/8nBxxdgaQpDhMeEHBwb+IkIgKsq+a0v0KAJI0p+7+0fO4xsnRh8LRKwPllo4h/gsQkg3H8U0hFRY/hoyuhFBISP89fohDouHXx+Ede2Pm14ziR9AWMTAMAdiW5eh/MKvObvCIRSV1wp0FYvqmAEgu9/V3CxVRenHFQujiVjEQCMo1l/R491xXhO+isB4HP74/FHLZaEGPhrLRcv7qJHh5zMXeJYBMBV9LLH7XNfLZ4T9Oz4H+Ixxy2pGQHFguX1BJSLysncMi4BWO7510o+GutfnRstPyFJBEIsaI6AYsOqjJWTuQmApoae+JthFSXs1jJezxm2300vAYEQE78voeiqipwRcjPX9XITAKVbXoTxDhzta/jlCpHmHBxi4w7DNc6dm7kIAIbRuONBRgHSUN+VRm13s6tDQDFidVj4oJCjmdHKRQCUejiqJ/8sitbt9/t+i56r0OYQI1dUeMkiL6XcVI5mlrwEMPZ4Y2aLyjlwPo5dVE7RXmpqCIRYmW+0XrlyNDMB0LTYA0B2MwjKG9h8jUG73eR6EVDMKHasyW4hVzPZnZkAKK2wVUgyWVbcQTfA6P6uvuLwbERJIWZuMFrZzLmaiQBgFM38s9j5p8kdc4060c2uHwHFjsUJQuoMVM6OlEwEQCl7o3ozqyVZg7Hq+NPWxRHIjUCIHXUIWosh5apydqRkJYCxphmOvHq5B9yNAx8r9xJeeuoIhBiyOHckU86OJACjzX8x9k2pB6fXrzIEFEvWWgGZbgNGEgAV17vYt6oM6mIudB/M/UwxRXkpTUcgxNJ9xnBQzip3h0oWAjhgaAlxfnlznGa5VYYRsBhTI3M3CwHsb8xpC2HspcZsdnMjRyDE1MLIzew2b2TuDiUA7v+nUuK07lIj/9/v/SN3kGHzrMXWtJDDAyEfSgCcNZJBBpZczxeLYOrF9Vzar5o6AiG2HjFWz6E5PIoAZhur7J+N2evm2kPAWl/A0BweSAA0HTbCNyN7ESPyn9Z5fygie9yUNBFQjFl6p8A+IZf7emMgAXD0DFSPF1oRPfFnbazWCrZuZ0AgxJilJwWVwzMGOXAYAew56KRI998VqV1uVnoIWIu1gbmcCgEsgZmtruKSXnokXqMQa0sMVTN5AphnyBluahoIWIq5fARAp8FO+GhLI356Bzst3ZMZgdXNHIGAYk6xZ0G2DDndY+ugW4CBjNFTQv07NPPP+kse60fRLciFQIg5SzMD++b0IALYPRca9R68oN7L+9UbjICl2Oub04MIYFdDTvXFPg05KzFTLcVe35weRADTjTjqWZpiK43Y6mYmhkCIPSujT31zuocA6CzYDj/pBSAWxBIDW8DTbcyPgJUY3CzkdkcNewiAb/syRcdZ8fxjBfx4EHNLikbAUgz25HY/Auh7r1A0agWUp2m/lsAvoMpeRIQIKAatTEHvye1+BGDl+f9lPvwXYTo0zKQQg8uMVLsnt/sRwPZGKvOwETvdzPQRsBKLPbndjwB2MOIvX/LbiKMaYKaVWOzJ7Q4CoJdwQ5w1xYjDrAy/GIHTzZwAASuxOCXk+LqqdhAAe7dFu/etOziiD+p0eS4ie9yUZiOgWLTQEajcVo6vk+5k72kirDsyrg8v0vnydlwmuTVNRSDEopVVgjpyvJsAOtghYocuj9g2N62ZCFiJyY4c7yYAK48AW7nnamYqNLPWVmKyI8etEoAVtm1mKjSz1lZicigBbGHEd1bY1gicbmYBCFiJyY4ct9oCWFGAw7wIR6BIBKzEZBItgNeL9JyX5QgUgICVmEyiBfBmAQ7zIhyBIhFYVWRhJZY1lAA2LvHCRRX9FuOuFiZdFFVfL8cAAsTku5j5lgFTO172090HoNeBxS7+6x+7h5prn4XY7MjxbgLQswCxi5WmVuw4un3FI2AhNjtyvJsAOtiheHwKKdECyxZSUS/EHAIWYrMjxy0SgAWWNRe5bnAhCFiITfMEYIFlC4kmL8QcAhZicygBmEPcDXYEHIHxEei+BVg9flGVnblpZVfyCzkC+RCwEJsdOW6RADbJ5xM/2hGoDAELsWmeACywbGUR5xeKCgELsekEEFXIuDEpIWCeACy879wCyCkFtdclOwIWYrMjx7v7ACzMZd6YlU277c7uIj/SESgBgRCTJp6laa9+dyK91v5lxJ8tdLZEDJ+bVgICVmKyI8etEsDmJTjQi3QEJkHASky+2l7JbgLo+LL9wMg+T43MHjfHEbASk0m0AHbyeHMEIkPASkwOJQArLYCet5xGFgxuTvMQsBKTHTlu9RbACts2Lw2aW2MrMTmUAF4y4j8rbGsETjezAASsxGRHjne3AJ4vAIgqitiOcVcLY65VYOHXqBmBEIvb1WxG1st35Hg3AYgdtLhh7LI+Bu4Yu5FuX2MQUCwqJmMX5fbgFgArm2qa4MrYaxHss3LPZQRON3MCBKzE4sqQ4+uq2t0C0BcdTYR1R8b3YVZ8JrlFDUVgTyP17sntfgTwgpHK7GvETjczfQT2MVLFntzuRwBW3nI6nc6XLY0A72YmikCIwelGqvdst539COCp7oMi/V+dLlaYN1II3awCEFAMWugAVFWXdde3HwH0HNR9UkT/OwFE5IyGmmIpBntyu4cA6CV8EUe+YcSZ3g9gxFEJm2klBt8Iud3hih4CCN/2MEXHWfH8M417sCnxmOOWNAmBEHtWZgD2zelBBGClH0DxZqkJ1qT8aEJdLcVe35weRABLDXnvYEO2uqlpIWAp9vrm9CACWGzIT7N9ONCQtxIxNcTcbEPV6ZvTfQmAzgKNF3Y8NhhxRfW648Mits9NSxMBxVzHq7YjruarIad7TOxLAOGovozRU0IcOw6Pwwy3okEIWIq5gbmcCgHMoElm5YGMBuVImlUNsTbDUO2SJwD54ghDDnFTbSNgLdbGIoAl+MjCi0JaoXQYzGxlSmbLZt8aQyDEmKU+J+XwkkEwD7wFoNNALxFcNOjECPdrRZb9IrTLTUoLAcWYldV/hPyikMt9vTCQAMLRC/ueFe/O4+I1zS1LBAFrMTY0h0cRwIPGnLY3TTQrizMYg9bNDbG1tzEkhubwUAKg6bCCyi43VuHjjdnr5tpBwFpsLQ85PBDhoQQQzhrKIANLru8LzQzcvb7L+5VTRCDElKWZf3LDyNzNQgD3G3Sotfs0gxA3zmSLMTUyd7MQgEYCXjHm7gNh7J2N2ezmRopAiKUDIzVvkFnK2ZGjeCMJgHuINRR076CrRLpf8wGs3a9FCqWbFWLJ2hyTe0PuDnXgSAIIZ98ztJQ4vzwU5p4Vp2lulRUEQgwdasXeNjsz5WxWAvgbBb/cVriFj2Ls03GgNea2gG0jbAyxczqVtRZDylXl7EjJRABGbwNU+d3QOSNR8AMcgf4IKHYUQ9YkU/NflcpEAKH2d1lDIdh7Iky+jVHb3eyaEAgxc2JNl5/0splzNTMB0Ap4AquenNSyGs7fjGueUsN1/ZK2EVDMKHasyZMhVzPZnZkAQml3Zio1voP0pKClBRzjQ7BBFoVYsfTEX7t3cuVoXgKYx5UsPSLcDow6BDdq3+GfHYFuBEKMqOPPoig3laOZJRcB0LTQC0MWZC49rgO1YtDH4jLJrYkQAcWI1dWlFoQczQxrLgIIpeZqYmS2pJoDj4LhLY7pVoNOw68SYuMowzDkzs3cBADDPApASwyDdAaO3tGw/W56CQiEmDijhKKrKnJJyM1c18tNAKH0W3NdJa6DN8Wcz+Jw7w+Iyy+1WRNi4bMYoNiwKmPl5LgEoH6AF6wihd2a3HGaYfvd9GIRUCxYnPDTQkG5OFbf3FgEQFNDDwjd3rq60e0HYP5DjNruZheEQIiBDxRUXF3F3B5yMvf1xyKAcBV1OLye+4pxnfBxAmBmXCa5NVUhEHz/8aquV9J1lIO5O/9atoxNADDOKgqZ2yrI6HYT7D6HQLA67GMU9vrNDj4/B0sUA5ZlbsjFseowNgGEq6njQXMDLMuWGH8uATHFciXc9uwIBF+fyxnyvWVR7o3V+deq9EQEAPNMbEDLkJq3WuddJLB5zXb45UtGIPhYyW9pbf9BqNwacnDQ9yP3T0QAofTb2L468krxH7ALJp5NgGwcv6lu4TgIBN+ezbnytXVRzin3JpKJCSDcf9wykRXxnLwXpmiOwMS4xFMlt0QIBJ9qrF8+TkFumeTevwVAUYGuzsD/axVqfPuP2P95bwkY92Kb+cGXn2eXfJuCaMWfQjrgCyEAmEhPIf0xBWRDHRQoXyJwvE/AuFODD79ENVJJfnnk+pBzE3unEAIIVtzFdunEFsVTgJqK5xFAPjoQj09yWRJ8dx4npdLsV/2VY8q1QqQwAoCRNDvwqkKsiqcQdRZ9jUDyeQLx+CSTJcFnX+PgFDr82ut8Vci19n1jfy6MAGQBhulJwUzLEY9tcfUnarhILQGfMVg99mNdMfhKv/wpDPW1Y3BPyLH2fRN9LpQAgiXXslWfQEqiCSNfJrD82YHIvRp89GXMtD7Jpxtp5ZRyq1ApnABgqBex8MZCrYyjME0ZPYsA86XF4vBHhxX4ZSP5Rj5CrU/v7ahb+OfGkFv9vht7X+EEECzR9MSlY1sV94n/hHlfJ9h8UZFI/BR88XXMkW9SFOXSRFN+B4FSCgHAVO9ywctRbVMUPTv+DQLPlxer2bvBB9/ADMvP8w9DcW0uhZwadtxY360/1lkZT8I5J3PohzIebvWwOzD8Shy02moFLNpNbG2E3R9Dj7Jofw6b/0JsXZfj+FyHlk0Amlf/bXRqLqvsHfwsJl+Bo0a+jtle1eKzmOTfB6t0v5/68OwK6vgd4urtsrxQKgHIaJyl4TMNyWyo/xOX+dTvGhxm7UWqJtxCLOkVb6egh5kweDIj3+H084mlxycrZvjZpROALo/jPsjm1OGmJPOtHpG+AdVCDWuSqVWNFSF+FKdz0BPRzWo0pcpL/4H4ub3sC1ZCAKoETvwCmwPKrlBE5es9iroteCwim8yZQtzMwmg191Pt5Ovnk/uJm5/3+6LofVUSgB6s+Raa2uysYT5RC+Bu9CYc+sywA/27TgRI/J3ZczyqkZbK4rTTilr+0zya7xIvWuuvdKkU2MDmX6VWTegPaHeeiOA+9GYcm+r8iPb6jv2ZGNmdk49DD0Qrjc+xjS7uRN33/4gYqazVWDnAOPgYKqmOnKbKQiquFsHipgLQr97ExZ7s1y/+7H7fN2SfOpBLmfAzCL/KCUCG4Oxz2Lx/kFEN2a8hwz+jD+H0RnYWEgeKv/3QD6Ma2muyPEAcXFQ1AHURwBZU9Jtok/oDBvlW93zz0bsIAM0nSF5IfI3fH4FqOM9jYL31FAPfw/+vsa1UaiEA1ZAgUO9uE/sDhjl4CV/OQ+cTDK8OO9Dad/hbT+cp4Q9HZ6Au7yFQ+X1/O/C1EYCMICiOZvOv7Qb557UIKCjUV6D3vS2CDFau3WvsD/7Vakpq2h+M6t6+aZ2/VHmkVDLeP8iKWglARhEkmiCkiUIugxHQrYH6DNZqrK2D8CuvhG9p6lN1B3ss2ze34cursx1azlG1E4CqReB8mo2ahi6jEVCH4TL0YVTDRSKH5wik0uaLU36P4DM957EjqiTX7dy+6HQ0ipjCjthlHj77Vd1GRuEsgklNw7PR/esGxOj1RQrqSFqOihBa2xV8fh1dRbC9yzaz4JMNOHgTVBO4pqJK9GltW3XeRRE/2GFNHsTgi/GJbvVqlWgcSMC9DyS+gs6sFZF0L64lpd5EV3VtVeNNUSV7+1b+cCkegccp8sckv/xRu0RDAEICElBP8Xmofm1cHIHUEFDr7L9I/tdiqZiaedEIwGjo6wL0pWiMckMcgWIQUExfEFPyq1pREYAMAiDdy16IRsOSssvFEZgAAcXyhSG2Jyim+FOjIwBVEaCeZnMxGsV9kmxycQTGREAxrA4/xXR0EiUBCCUA08Myl6BOAgLExSICit1LQixHaX9UnYD9EKJjUE+JaYhwi37f+z5HIFIE1OzXL79+yKKV6AlAyEECu7D5Irqt/ndxBCJHQB1+uuePstnfjp0JApDBkIAmnpyL+hChAHGJFQEN9am3X53Z0YsZAhCSYZ6A1hKYGT2ybmATEdAkn5+R/GZGsEwRgCIKEtAMtc+hPm1YgLjEgsCDGKIOP1Od1uYIQN6GBPTswCdQf4BIgLjUjYDWcPgtyV/73P68QJgkgFYlIYJT+eyPErcA8W0dCNT+SO8klTZNAKo4JCACOBn1xSYEiEtVCOjX/jp+9W+r6oJlXMc8AQgUSEBzBf4N1UiBiyNQNgLq4b+M5K9s+e6yKpQEAQgcSEAThT6FNn21YcHhUh4CD1D0r0l+Mz39w6BIhgBalYQIjuXzv6B+S9ACxbdFIKAm//Uk/i1FFBZLGckRgICFBGaxOQv1WwIB4jIpAsk0+buBSJIAVElIQEtZfRI9AHVxBMZF4H5O/A2//FpaLTlJlgBanoIIfJSgBYZv8yCQRC//qAonTwACABKYyeYz6FT97+IIjEBgBd//kl99Te1NWhpBAPIgJKBlrD+CHoNGuw4CtrnUh4BWTtbLOf9E8le6zHpdVW4MAbQAhgh25/OZqLYujkALgaV8uJzE17Yx0jgCkGchAbUA1BI4AdXDRS7NRUAP79yI3kryqwXQKGkkAbQ8DBFomPCj6CGtfb5tFAL3UNtrSXwTz+6X4ZlGE0ALUIhgLz6fhvptQQuUtLdq5l9F4j+adjVH184JIGAECQgLvbP+JHTrsNs3aSHwMtW5Hr2L5F+TVtXGq40TQBduEIH6BOagmlKsNxW52EdAL5zRFN65JL6pBTvKht4JYADCEIHeladJROos3GzAYb47bgTewDwN6+mZfb0T0aULASeALkC6/4UIlPwiAbUKNL3YJX4ENG13LqqefZGAywAEnAAGANO9O7QIjmT/0ej23d/7/1Eg8AJW3I7e6b/42fzhBJANp3VHQQTC7GBUrYIZqEv9CCzBBDX1F5D43rmXwx9OADnA6j4UMtDw4VHoQahPKOoGqNz/1Zl3L3oHSd/44bxxoXYCGBe5tvNCP4FWKNYtwm5tX/nH4hF4kiLvROf5/f3k4DoBTI5hRwmQwR7s0HwCtQq26fjS/xkXAY3f69de4/dPjFuIn9eLgBNALyaF7Al9BXtTmPoLRAZbFVJwcwp5haoq6Regj/i9fTmOdwIoB9eOUgMZ7MNOrU6kNxpN6zjA/2khsJwPesOOVuFZ5EnfgqW8rRNAedgOLBlC0MIkIoLZqIihqR2I6shbhC5EHyThtRCHS4UIOAFUCHa/S0EGG7F/Brpnm6Y6BVlTche36RKSfjX/u9SEgBNATcAPuyykoFegixD0dOKu6HTU2nRkzcBbhj6F6um7xSS7Xp3tEhECTgAROWOYKZCC1i4QEYgQ1Ieg2Yg7oFNQLXBSh2gBjZXo86hm4ekeXgm/jGR/ka1L5Ag4AUTuoFHmQQwbcsy2qMhAW90+SLdo2+qz+hl0u6HjtW0pH9dTM7yl74TPuj/X22+karq3tvr8Eqqkf4lE1/EujoAj4Ag4Ao6AI+AIOAKOgCPgCDgC8SPw/zAG7eO6u+9JAAAAAElFTkSuQmCC");
  18092. n.prototype = Object.create(C.prototype),
  18093. n.prototype.enter = function() {
  18094. var e = null;
  18095. return function() {
  18096. this.setZoomed(!1),
  18097. this.emit("enter", {
  18098. oldPano: e,
  18099. newPano: this
  18100. }),
  18101. e = this
  18102. }
  18103. }(),
  18104. n.prototype.exit = function() {
  18105. this.tiled ? (this.clearWaitDeferreds(),
  18106. this.minimumTiledPanoLoaded = !1,
  18107. this.tiledPanoRenderTarget = null,
  18108. this.setZoomed(!1),
  18109. this.panoRenderer.deactivateTiledPano(this),
  18110. this.highestPartialTileRenderOpCompleted = 0,
  18111. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18112. this.solidSkybox.loaded = !1,
  18113. this.solidSkybox.version = 0),
  18114. this.emit("exit")
  18115. }
  18116. ,
  18117. n.prototype.hoverOn = function(e) {
  18118. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18119. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18120. }
  18121. ,
  18122. n.prototype.hoverOff = function(e) {
  18123. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18124. }
  18125. ,
  18126. n.prototype.build1 = function() {
  18127. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18128. this.floor.addPano(this),
  18129. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18130. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18131. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18132. }
  18133. ,
  18134. n.prototype.build2 = function() {
  18135. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18136. this.height = this.position.distanceTo(this.floorPosition),
  18137. this.placeMarker()
  18138. }
  18139. ,
  18140. n.prototype.interpolateFloorPosition = function() {
  18141. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18142. return !!e.floorPosition
  18143. }).sort(function(e, t) {
  18144. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18145. }
  18146. .bind(this))
  18147. , t = this.position.clone();
  18148. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18149. t
  18150. }
  18151. ,
  18152. n.prototype.raycastFloorPosition = function() {
  18153. I.warn("Performance warning: Raycasting to find floor position");
  18154. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  18155. , t = e.intersectObjects(this.model.colliders);
  18156. return t.length ? t[0].point : null
  18157. }
  18158. ,
  18159. n.prototype.raycastToFindFloor = function() {
  18160. var e = [new r.Vector3(0,-1,0), new r.Vector3(1,-1,0), new r.Vector3(0,-1,1), new r.Vector3(-1,-1,0), new r.Vector3(0,-1,-1), new r.Vector3(1,0,0), new r.Vector3(0,0,1), new r.Vector3(-1,0,0), new r.Vector3(0,0,-1)];
  18161. return function() {
  18162. I.warn("Performance warning: Raycasting to find floor index");
  18163. for (var t = 0; t < e.length; t++) {
  18164. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  18165. , n = i.intersectObjects(this.model.colliders);
  18166. if (n.length)
  18167. return n[0].object.parent.parent
  18168. }
  18169. return null
  18170. }
  18171. }(),
  18172. n.prototype.placeMarker = function() {
  18173. this.marker && (this.marker.position.copy(this.floorPosition),
  18174. this.marker.position.y += .05,
  18175. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  18176. }
  18177. ,
  18178. n.prototype.translate = function(e) {
  18179. this.position.add(e),
  18180. this.floorPosition.add(e)
  18181. }
  18182. ,
  18183. n.prototype.findClosestMidtpointPanoTo = function(e) {
  18184. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  18185. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  18186. }
  18187. ,
  18188. n.prototype.attachToPanoRenderer = function(e) {
  18189. this.panoRenderer = e,
  18190. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18191. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18192. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18193. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18194. }
  18195. ;
  18196. var _ = {};
  18197. n.prototype.getWaitDeferred = function(e) {
  18198. var t = _[this.id];
  18199. t || (t = {},
  18200. _[this.id] = t);
  18201. var i = t[e];
  18202. return i || (i = {
  18203. deferred: $.Deferred(),
  18204. active: !1
  18205. },
  18206. t[e] = i),
  18207. i
  18208. }
  18209. ,
  18210. n.prototype.resetWaitDeferred = function(e) {
  18211. var t = this.getWaitDeferred(e);
  18212. t.active = !1,
  18213. t.deferred = $.Deferred()
  18214. }
  18215. ,
  18216. n.prototype.clearWaitDeferreds = function() {
  18217. var e = _[this.id];
  18218. e || (e = {},
  18219. _[this.id] = e);
  18220. for (var t in e)
  18221. if (e.hasOwnProperty(t)) {
  18222. var i = e[t];
  18223. i.active = !1,
  18224. i.deferred = $.Deferred()
  18225. }
  18226. }
  18227. ,
  18228. n.prototype.loadTiledPano = function() {
  18229. var e = (new r.Vector3,
  18230. [])
  18231. , t = [];
  18232. return function(i, n, r, o, a, s) {
  18233. null !== o && void 0 !== o || (o = !0),
  18234. null !== a && void 0 !== a || (a = !0);
  18235. var l = this.getWaitDeferred(i)
  18236. , c = l.deferred
  18237. , h = null
  18238. , u = null;
  18239. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  18240. u = r.vFov)),
  18241. !this.isLoaded(i)) {
  18242. if (!l.active) {
  18243. if (l.active = !0,
  18244. r) {
  18245. var d = y.matchingTilesInDirection(this, i, n, h, u);
  18246. e[this.id + ":" + i] = {
  18247. tileCount: 0,
  18248. targetTileCount: d
  18249. },
  18250. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  18251. }
  18252. t[this.id] || (t[this.id] = !0,
  18253. this.on(f.LoadComplete, function(e, t) {
  18254. var i = this.getWaitDeferred(e).deferred;
  18255. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18256. this.resetWaitDeferred(e))
  18257. }
  18258. .bind(this)),
  18259. this.on(f.LoadFailed, function(e) {
  18260. var t = this.getWaitDeferred(e).deferred;
  18261. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18262. this.resetWaitDeferred(e))
  18263. }
  18264. .bind(this)),
  18265. this.on(f.TileLoaded, function(t, i, n) {
  18266. var r = this.getWaitDeferred(t).deferred;
  18267. if (r && "pending" === r.state()) {
  18268. r.notify(t, i, n);
  18269. var o = e[this.id + ":" + t];
  18270. o && (o.tileCount++,
  18271. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  18272. r.resolve(t, n),
  18273. this.resetWaitDeferred(t)))
  18274. }
  18275. }
  18276. .bind(this)))
  18277. }
  18278. this.tileDownloader.clearForceQueue(),
  18279. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  18280. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  18281. this.panoRenderer.renderPanoTiles(this.id, n, a)
  18282. }
  18283. return c.promise()
  18284. }
  18285. }(),
  18286. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18287. if (e === this.id) {
  18288. var n = this.qualityManager.getPanoSize(m.BASE);
  18289. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18290. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18291. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18292. }
  18293. }
  18294. ,
  18295. n.prototype.onTileRendered = function(e, t, i, n) {
  18296. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18297. }
  18298. ,
  18299. n.prototype.onPanoRendered = function(e, t, i, n) {
  18300. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18301. this.updateSkyboxForZoomLevel(),
  18302. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18303. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18304. this.emit("load", t),
  18305. this.model.emit("load", this),
  18306. this.emit(f.LoadComplete, t, i))
  18307. }
  18308. ,
  18309. n.prototype.setZoomed = function(e) {
  18310. this.zoomed = e,
  18311. this.updateSkyboxForZoomLevel()
  18312. }
  18313. ,
  18314. n.prototype.ensureSkyboxReadyForRender = function() {
  18315. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18316. this.solidSkybox.loaded = !0)
  18317. }
  18318. ,
  18319. n.prototype.updateSkyboxForZoomLevel = function() {
  18320. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18321. }
  18322. ,
  18323. n.prototype.getSkyboxTexture = function() {
  18324. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18325. }
  18326. ,
  18327. n.prototype.onTileRenderFail = function(e, t, i) {
  18328. e === this.id && this.emit(f.LoadFailed, t)
  18329. }
  18330. ,
  18331. n.prototype.isLoaded = function(e) {
  18332. if (this.tiled) {
  18333. if (e && "string" == typeof e)
  18334. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18335. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18336. }
  18337. if (e && "number" == typeof e)
  18338. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18339. return !!this.solidSkybox.high || e in this.solidSkybox
  18340. }
  18341. ,
  18342. n.prototype.loadCube = function(e) {
  18343. if (this.isLoaded(e))
  18344. return I.info("Skipping load of pano, already loaded"),
  18345. $.when();
  18346. this.emit("loading", e),
  18347. this.model.emit("loading", this);
  18348. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  18349. , i = t.filter(function(e) {
  18350. return !e
  18351. });
  18352. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18353. e = "high",
  18354. t = p.getCubemapUrls(this.model.urls, this.id, e));
  18355. var n = 0
  18356. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  18357. return u.getImage(t[i])
  18358. }
  18359. .bind(this));
  18360. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  18361. return this.solidSkybox[e] = [t, i, n, r, o, a],
  18362. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  18363. this.solidSkybox.low = null),
  18364. this.solidSkybox.needsUpdate = !0,
  18365. this.emit("load", e),
  18366. this.model.emit("load", this),
  18367. this
  18368. }
  18369. .bind(this), function() {
  18370. I.error("Downloading cubemap for pano", this.id, "failed"),
  18371. this.failedLoadingAt = Date.now()
  18372. }
  18373. .bind(this), function() {
  18374. return $.when(++n, 6)
  18375. })
  18376. }
  18377. ,
  18378. n.raycastsSkipped = 0,
  18379. n.raycastsDone = 0,
  18380. n.prototype.findNeighourPanos = function() {
  18381. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18382. this.model.panos.forEach(function(e) {
  18383. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18384. var t = this.position.distanceTo(e.position);
  18385. if (t > a.panoramaNeighbourMaxDistance)
  18386. return this.model.panos.setNeighbour(this, e, !1),
  18387. void n.raycastsSkipped++;
  18388. var i = e.position.clone().sub(this.position).normalize()
  18389. , o = new r.Raycaster(this.position,i.clone(),0,t)
  18390. , s = o.intersectObjects(this.model.colliders);
  18391. n.raycastsDone++,
  18392. this.model.panos.setNeighbour(this, e, 0 === s.length),
  18393. a.showNeighbourRaycasts && (s.length ? this.floor.model.add(new r.ArrowHelper(i,this.position,s[0].distance,16711680)) : this.floor.model.add(new r.ArrowHelper(i,this.position,t,16777215,0,0)))
  18394. }
  18395. }
  18396. .bind(this)),
  18397. this.model.panos.neighbourMap[this.id]
  18398. }
  18399. ,
  18400. n.prototype.worldPosition = function() {
  18401. return this.position
  18402. }
  18403. ,
  18404. n.prototype.addTextSprite = function(e, t) {
  18405. this.removeTextSprite();
  18406. var i = document.createElement("canvas")
  18407. , n = i.getContext("2d");
  18408. i.width = 256,
  18409. i.height = 256;
  18410. var o = "Arial"
  18411. , a = 60;
  18412. n.font = "bold " + a + "px " + o,
  18413. n.fillStyle = "white";
  18414. var s = n.measureText(e).width;
  18415. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  18416. var l = new r.Texture(i);
  18417. l.needsUpdate = !0;
  18418. var c = new r.SpriteMaterial({
  18419. map: l,
  18420. color: t || 16428055
  18421. });
  18422. this.text3d = new r.Sprite(c),
  18423. this.text3d.position.copy(this.skyboxMesh.position),
  18424. this.floor.add(this.text3d)
  18425. }
  18426. ,
  18427. n.prototype.removeTextSprite = function() {
  18428. this.text3d && (this.floor.remove(this.text3d),
  18429. this.text3d = null)
  18430. }
  18431. ,
  18432. n.prototype.isAligned = function() {
  18433. return this.alignmentType === l.ALIGNED
  18434. }
  18435. ,
  18436. n.filters = {
  18437. inDirection: function(e, t, i) {
  18438. return function(n) {
  18439. var r = n.position.clone().sub(e).normalize();
  18440. return r.dot(t) > i
  18441. }
  18442. },
  18443. inFloorDirection: function(e, t, i) {
  18444. return function(n) {
  18445. var r = n.floorPosition.clone().sub(e).normalize();
  18446. return r.dot(t) > i
  18447. }
  18448. },
  18449. inPanoDirection: function(e, t, i) {
  18450. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  18451. function(n) {
  18452. var r = n.floorPosition.clone().sub(e).normalize()
  18453. , o = n.position.clone().sub(e).normalize();
  18454. return r.dot(t) > i || o.dot(t) > i
  18455. }
  18456. },
  18457. atFloor: function(e) {
  18458. return function(t) {
  18459. return !e || t.floor === e
  18460. }
  18461. },
  18462. not: function(e) {
  18463. return function(t) {
  18464. return t !== e
  18465. }
  18466. },
  18467. notIn: function(e) {
  18468. return function(t) {
  18469. return e.indexOf(t) === -1
  18470. }
  18471. },
  18472. isLoaded: function() {
  18473. return function(e) {
  18474. return e.isLoaded()
  18475. }
  18476. },
  18477. isNotLoaded: function() {
  18478. return function(e) {
  18479. return !e.isLoaded()
  18480. }
  18481. },
  18482. isCloseEnoughTo: function(e, t) {
  18483. return function(i) {
  18484. return e.distanceTo(i.floorPosition) < t
  18485. }
  18486. },
  18487. hasMinimumHeightDifferenceTo: function(e, t) {
  18488. return function(i) {
  18489. return Math.abs(i.position.y - e.y) > t
  18490. }
  18491. },
  18492. isNotBehindNormal: function(e, t) {
  18493. var i = new r.Vector3;
  18494. return t = t.clone(),
  18495. function(n) {
  18496. var r = i.copy(n.position).sub(e).normalize();
  18497. return r.dot(t) > 0
  18498. }
  18499. },
  18500. isNeighbourPanoTo: function(e) {
  18501. return function(t) {
  18502. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  18503. }
  18504. },
  18505. isNeighbourOfNeighbourTo: function(e) {
  18506. return function(t) {
  18507. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  18508. var n = e.model.panos.get(i);
  18509. return !!n && n.neighbourPanos[t.id]
  18510. })
  18511. }
  18512. },
  18513. isNotRecentlyFailed: function(e) {
  18514. return function(t) {
  18515. return Date.now() - t.failedLoadingAt > e
  18516. }
  18517. },
  18518. isOnVisibleFloor: function() {
  18519. return function(e) {
  18520. return !e.floor.hidden
  18521. }
  18522. },
  18523. isPanoAligned: function() {
  18524. return function(e) {
  18525. return e.isAligned()
  18526. }
  18527. }
  18528. },
  18529. n.sortFunctions = {
  18530. distanceToPoint: function(e) {
  18531. return function(t, i) {
  18532. return t.position.distanceTo(e) - i.position.distanceTo(e)
  18533. }
  18534. },
  18535. floorDistanceToPoint: function(e) {
  18536. return function(t, i) {
  18537. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  18538. }
  18539. },
  18540. choose: function(e) {
  18541. return function(t, i) {
  18542. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  18543. }
  18544. }
  18545. },
  18546. n.scoreFunctions = {
  18547. distance: function(e, t) {
  18548. return t = t || a.navigation.distanceFactor,
  18549. function(i) {
  18550. return e ? e.position.distanceTo(i.position) * t : 0
  18551. }
  18552. },
  18553. distanceSquared: function(e, t) {
  18554. return t = t || a.navigation.distanceFactor,
  18555. function(i) {
  18556. return e ? e.position.distanceToSquared(i.position) * t : 0
  18557. }
  18558. },
  18559. direction: function(e, t) {
  18560. return function(i) {
  18561. var n = i.position.clone().sub(e).normalize();
  18562. return n.dot(t) * a.navigation.directionFactor
  18563. }
  18564. },
  18565. angle: function(e, t) {
  18566. return function(i) {
  18567. var n = i.position.clone().sub(e).normalize();
  18568. return n.angleTo(t) * a.navigation.angleFactor
  18569. }
  18570. },
  18571. inFieldOfView: function(e, t) {
  18572. return function(i) {
  18573. var n = i.position.clone().sub(e).normalize();
  18574. return n.dot(t) > .75 ? 10 : -1
  18575. }
  18576. },
  18577. optionality: function(e) {
  18578. return function(t) {
  18579. var i = t.neighbourUUIDs.filter(function(t) {
  18580. return !(t in e.neighbourUUIDs) && t !== e.id
  18581. });
  18582. return i.length * a.navigation.optionalityFactor
  18583. }
  18584. },
  18585. penalizeHeightDifferenceUnder: function(e, t) {
  18586. return function(i) {
  18587. return e.y - i.position.y < t ? -20 : 0
  18588. }
  18589. }
  18590. },
  18591. t.exports = n
  18592. }
  18593. ).call(this, "/js/objects/Panorama.js")
  18594. }
  18595. , {
  18596. "../enum/AlignmentType": 17,
  18597. "../enum/GLCubeFaces": 25,
  18598. "../enum/PanoRendererEvents": 35,
  18599. "../enum/PanoSizeClass": 36,
  18600. "../enum/PanoramaEvents": 37,
  18601. "../enum/RenderLayers": 41,
  18602. "../enum/RenderOrder": 42,
  18603. "../enum/TileDownloaderEvents": 45,
  18604. "../enum/Viewmode": 51,
  18605. "../exception/BasicException": 55,
  18606. "../scene/SceneRenderer": 158,
  18607. "../settings": 166,
  18608. "../tile/TileUtils": 174,
  18609. "../util/ajax": 181,
  18610. "../util/common": 185,
  18611. "../util/lerp": 188,
  18612. "../util/logger": 189,
  18613. "../util/panorama": 191,
  18614. "../util/texture": 194,
  18615. "../util/transitions": 195,
  18616. events: 202,
  18617. three: 217
  18618. }],
  18619. 149: [function(e, t, i) {
  18620. "use strict";
  18621. function n(e) {
  18622. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18623. t.map.value = d,
  18624. t.opacity.value = 0,
  18625. t.color.value.set(o.reticuleColor),
  18626. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18627. side: r.DoubleSide,
  18628. depthWrite: !1,
  18629. depthTest: !1,
  18630. transparent: !0,
  18631. vertexShader: c.waypoint.vertexShader,
  18632. fragmentShader: c.waypoint.fragmentShader,
  18633. uniforms: t,
  18634. name: "waypoint",
  18635. opacity: 0
  18636. })),
  18637. this.layers.set(h.RETICULE),
  18638. this.renderOrder = u.reticule,
  18639. this.player = e,
  18640. this.direction = new r.Vector3,
  18641. this.hidden = !0,
  18642. this.mouseLastMoveTime = Date.now()
  18643. }
  18644. var r = e("three")
  18645. , o = e("../settings")
  18646. , a = e("../util/transitions")
  18647. , s = e("../util/texture")
  18648. , l = e("../util/lerp")
  18649. , c = e("../shaders")
  18650. , h = e("../enum/RenderLayers")
  18651. , u = e("../enum/RenderOrder")
  18652. , d = s.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAQABJREFUeAHtfQl8HMWVd1V3z4wky7KNjDFgwI4xR7htGccHhwMxkswRQmKSkCWBhGw2ybebQE6yuzj7fSEkBMLuJtlkIUDIQhYnhGDQYQdiDttgPDZgIBzGsQwGbGNZsmxZmumjvv9rSUYzmuo5NNPdI1X/MJqu89Wr939d9epVFWPqURxQHFAcUBxQHFAcUBxQHFAcUBwYRRzgo6itI7Kps+LxyGRx8lG20KcxTUzhjE9Ep+IfrxVc1KLRE7lghwjGK/E7yjiLIT7KBIu5731cSSI8IRhLIjyBoCRnokdwtge/d3PB2wUT+Md24+9u5vDtOre37uAvvbWhrs7sK0L9vxw5oBRAmfTa+fGeo6M8cioAeKom+HEA9zQAcyqAOwVN0AJphmA26n0btLSBlq0OF69D8WxKCnPTo3WVbwZCk6o0Lw4oBZAXu3xJzBfFE8dHBJ8vuDYTX2KAnp/CORvnS+1FqkQIthe0vwjaN3HhbDS5WLOyLvYaisdAQj1h4YBSAAH3REPz5piYNHW2zhgAz+bjSzoPX3Uauo+8R7B2jBbWYkqyBkOHNXxX2/qWxhk05VBPQBxQCiAAxjfEe6czoTVwzusxZF4IwFcFQEbwVQp2AFOaVUKIVsadlpa6ii3BEzW6KFAKwI/+XrZMXzzt0oUO5xdrXNQzxmf4UW351SE2O4K3akIsb9r64Cq2ZAnZGNRTQg4oBVAq5i5dqtUv/t7ZGueX4wt/GRh9aKmqGonlwlDwHqwFDzhC3N/a9IMn2dKlzkhsZ9BtUgqgyD1Q/2xytq5rV8II9nEY7iYXufjMxQksz3GxFfaDNgyp3wF42jVatuNit2Nr7Rhi79Z0Z7/tOElm2olk0komYvsTT29/OkkFzp0yNxpLVMeiUSPKInpM17Qo8lVjijIR+WpR7kQHy4oQFvzjR6DcqQibBsU2MTNBxQ0FL3eAl3+wbeee1jOj64tb+uguTSmAIvT/uas6xlfVjLkC4LgGw/vTilDkkCIA6gQT4hXG+YtciE2C81ctx25L7t/bNnbsofR1nGgZMB7a1gTQMIY7rJoZDH95tRBONQyMFQCRDgOcgbT4xw0Ai36jSGbBOI9/zEI6C+E20vVyru0XmtiP2G6hsf1I0810o8OwWDvS7t637z0tWj1uqqHpUAjiBNB0Kmg8BQWeCMEiP4MSPOIFKLnbD3R13/v4wgmdJahgVBWpFMAwurs+bi7QAHow8RP4GpKjTVEeANBiXDyPIfAaJpx1tmCbdmvR1w/R2KG6ZR7JdDFFF/zw/q/yRHypK4pScZ6FYGTRC8W0W2PabptbO6A2tttG5O09DntvopM8TufsVMa1OeDNfCb46VA0rsLJs5rMyQXrQd2/d6AMWusiqzMnUqHZOKAUQDYOpcfDoNcw9ZKPc137Br74denRhbwD8L34uj6JvE+hQ9bsYMa6ccmeCTEjcizXaajNp+DLejjiigegQgjNMQ+ACQXG3wXN24UttiYs84290cqOycyag7j5KOYsjDvOhkIoiuLCiCAubOcnLW0P/UEZDnPspP5kSgHkyK9zV+2qrqwZ/wXOtK+BacfkmM0jmdgM4LcIWL13cf0J+O4ewR37OF3n04XjTMdXvWgjCg8ifIvCaKGHa9oW2xZbhKa/Dp/idyYJ+xyOVREoggYohGGvjEC5bBPMua2nq/OOxxdOwpRFPdk4oBRAFg658/ux1dcBkF9F0vFZkntGAwTr8FW8X3BneY/e015hV5+MJa+T3DnzCAO8JyMQSQoB/3sFS6Mv9+r7X6q0K2Fs1C4GLy4Hr+dky58lvhPl/+zAvv23KDuBN6eUApDwZ/7q98bWVIzH154D/MNxwxUb8GW6n/Vay1ikIsF0uw4Gs5kQ9CMlVY/OYCGwp4BvZLYeZ2ZvjFUYSyCcl2NkMKtQhmCEtRfTg1u6ejtvW7Pg0H2FljOS8ykFkNa7i1bsGBOprcXXnn8TxquCXHIheDvwjbvLTtp3CmF2adHKOpjf6xTo05gte4UysAWPO8meOOeRGj2qX43+uAqKuLBlVbggoz9uNtvbf7bygsndsmpHY7hSAAO9DsedhsXXf07j2o0A/mEDwXn8hUFatMIyf7txhL7SfMeaiS16Z2E4OzWPMlTSNA5gKN+GNc6nIkcYG6137EXwb7gGihTelAXsgBRspyOc61uabrxbORb1MVopAPCBlvOwGeffIVgz0+Qvl1eab/7ScsxfYKnLMCKRBfjaYJgfzNJcLgSXYxo4H2GlhMct01yNJVLL0CJfhnL9EtqSv11GiI3wMf4ntXwIjpajMBSLZnePPYvcjKHlknzLxLy+DWv0twkrcpfg1klaRDsPc/uj8i1Hpc+fA7AVvOWYzmNcGC9zw7wKvga0MjM135IwVVsG18hvjuazC0alAjh31SpjzNgF10H/3QAVmNdyG772z2Hn2k3bjWjTUZa1AIrgwzAU5v8VyldaVfohHICBrxMC/Je3DGP1FCu5GDssv4NRwRlDEnoFwKEII7bvd+9bjRWDheQNOaqeUacALognZ+qM35G/oIiXsGa/NMm7Ho2xmkVwkV2ghvnhwApND+DyvDrBulZGRc358C1YiuncyflQR4rdZuILK+qiG/PJV+5pR40CmLv2rcoJkcnfB/CvxVcfU/7cHgjGaxjqf7/djjYdEoURSrBzkDOaW26VymcOJB3OntiT1FfW6hgRcO0G9PfxOdOAPRDo71s7zB03PD3vKIwMRv4zKhRAYzw5B0bjezHXn55rl2J+uIdz57vdFZH7KnqTH9GFvhCKo0QbXHKlSqXLiQM42NTm9qreiuifx/SanxZC+yH6/pCc8iIR+n4LY84VzXXRdbnmKdd0I14BNMbNazHXvwkCEMmlkzCnx9SS3ZkYo387esA6DQy6GHP8vOwEudSj0pSeA/ia08nGy3uqjU1V++yboMCvRn/mJPNQAjjtWHynuS5ya+kpDa6GnJgRHHmF13zB2r2HGLGqu9DfF+deinjBttg/6Jq9U+iRTyurfu6cC3NKWjXgtnmf7eiH6Qb7L8hEHlu2xXIrceCqFfPG0RHpI+4ZkQqgfp05F5tq/he6/uhcegzavgtDvn9tt/bdVRsddwlGAPNz/VLkUr5KEzwH3JEdZ2vak3sfqjXGXoUp4b9hVFiTE2WCvelw5/KWWdFnckpfRolGmgLgi+PmdTiKmuZ8OW2dBfh/Z7PEdZxFp2ucfQzD/TFl1H+K1Dw5gPldtyPYHwVLbtFZ7BbIyadyKQJyYuGY8+821UVuQXrok5HxjBgFcN66rtqYXvkbWH0X59Q1QrwKi/FXbNvYbGjWFcg3Lad8KtGI4ADsA1stx7hX160ZWNn5OZYNT8ilYcjXlLB7PvvYnBo6FansH7irl/+z+FlzXkyvei4X8PcZ+cQtnb2dZwqHTzI0+3oF/vKXgXxbQH1OfU8yQLIA0/8trmxkKYhkjGSNZC5L0rKILvsRQL+V/0e5DPkxjNsDu8BnuWP9VXD9GnRmzktDZdGbisiCOICv+h4u7NuFZnwQg/vfQJayygVNCTAT+Ha5rxKU8wiAN24wbwWIaR6Xdb6Pud9ay0mejs5O4mDLbyjwF4SVEZnJlQXIBMmGKyOQlWwNJZkj2SMZRNqy/ZCWJeHujbjs9LvA9iuydVTfsE7cLGqMH7BO80pN007JlkfFj14OOI7zIhsfuYd3Wd8Drr8JgGTHiGD37mDPX1WONyVnb1zIZKH/wI4HYLS5ICtpOAgCJ+peybn1msZ02keOI7PVoziQhQNCdDgMUwJhHI+Tje+BCsh+MIwQK3DgyGXlduBIWSmAc+NdE8ewyiYA+cwsXYjpmVjtWOantEiEztyjtf2c/f+zlq0SjHwOcFx9LsRDjmm+rBmR30GGcM5DlkeIZ3vtnsZyWiEoGxsA7d2vYpU4DMIb/DTkx3NTgu27UDOMSzGC+5gCfxbBVdFDOeB+MPjHSIZIlkimsq4SQDaxFL2GZHVogeEMKYsRwKL1iZMjmt4KFh7pxUZYZuG/bX8OBr91GotgyC/UkN+LYSouNw4IjimBeTucxLCpTL8bBsBs+0reNh27fuXs2Eu5VRBcqtArgIb15nxN4w+DRZ5ghnbuhpb+GHfELqZrOL8/aycFx3VVc9lxAPJlMtu5Q2h8Eqz/f4R8ZfMY7XAccVHL7MiaMDc21AqgYb3VAPdcGPyynNqDyzFx8WUj03gMV3XBq6+AAyPD3EuKtlBwACNMBye/3ssckcAFqs2Qy4mehOG0IbgdX9Yy22jxTBdgZGgVgPvl5/zP2cAPzbzNcSysCBjTdY1dEiAvVdWjhAO2wx7C7WdbNM1YAQAd49lsVwmIj4R1JBBKIyDN+d1hf9Yvv3jJ7NHhkmmcocDvKYYqsogc6JM14wxX9oTwnudDhkmWL3g2cVIRSShaUaFTAGRB7Tf4ec75aZnPShrnRMbYjeiQhUXjiCpIcSAHDpDMkeyRDJIsZskywdD1FWFcHQiVAqAdfVFmrAQzPa39WOlbnphgXGjEzCu5w2ZnYb6KVhwoCQdI9kgGSRZJJrNUciTJNsl4lnS+RodGAZCHX4Ve2QwLq+chjjDE3LNDGFfGOq2v4FCHE33l1gioDDYT8pPoxVJpJ5ZJd9A/+t0XBo8J9eTJAe1EkkWSSZJNr8wk2yTjJOte6fyMC4URsM+3/7SH4eSTxb1XLCdG457565D2MD8ZFfa6yEKN47GxR11zQY1bh3eawnkvxqIHEhHW65gdiciuCb0tjTzh1ZaGZhEzJ3VUaJEJsZjJcJtpsirCtUNxi+9huPkId/M5k3Eceq1aaUnjIvi9gxm3TOYWlECWY+jgNryDvXBRGPYOhEEB4BQf67ew9l+RxtLUV8yzaKjV9+Xn3pbX1Jwj7g1f7B4AfTPAuIVpYodtmztr/la16/dLOG68Kv3ziWVC7/rAgUm6HjmMOaQUNJy27MyAo8woPzxVbEuMN34e67AewQfK23UYG4ia6oy/Q28FOuoKXAG4W3oZ/7qn2MLSSsYWI+ZcCX6NxmF/EpeSvIFV6NeciPVq6+kV2yBggQrOkP4CgfXP9x6jmcYJTNOOB3nHIs0ovD+Bv2IltHuMqPUE+sjzchIo8p82z4pcO4SXPgYEqgDoMA/aU+3VXkj5NlpuMSrtxTBY1HmlHUlxEI53MZSMm6b12vg3Y3/z6+teLB7SKKHz6MQHIhEDNh1clsr44cUqO+zl4DbjuNWjN0Uq7bUAmOdoFbaX64I8VCQwBUCOPgD/43SwgrRDycNPWBhKuev8C6XpRkqEEPsw117PuflM88zKbSOlWdSOxo09xwgR+RCOWj8T/V49ktqWqS1wFloFZ6HndG5gA5vcYxC2GwtK4NygHIUCUQB9B3jSGX5Mepsuvvzdju0sxPVOh45kJx+008TXcZPNrGdatzz0MluyxJd5fCah9SVs2TK9fvolJ+nM+BBGOadCALNtrPGFrFJU4noMwhCr6doqtFNq+YcSeCthHzgjiG3EQSgAjqH/w/gKLJYxHQwxIRwXAhwHdM7JUDLiHrLYY5/DyvYeY93T8ziMeqPvmbtWVNZWWnPgL7+IVhZGIgdw2eBvAbIqKPlH8MGTKjuMApowFbgIPIDY+/f4rgBg9MMxS/zHsiai9cC+/RlYl/8KY9Lfj7jlJiwXMYe1NrU9uG7Ef+1lnZwejlHB4qmXzsEWrnoYzkbU8i4tz8J4+yus1nyQcf1/ADgp5iD434JR8OZ09pTyXUpMKSqlG3s0nT/pNe+HJvwhLmn9NefG10GcVGOWgr5SlukIsZ3boqV5TmQDZMBXLV/KdhW3bMEb15mzhM6xC5RPKW7ZwZWGzjaFsH6KS6k/j5Hvd2WUkD3AscXZrXMiT8vSFDvcNwXg3tUXHfMc9J/8tBRa68fpKzE27rsj5TAPKLQ2hxtNrbP4pmJ33kgur36DOFUT1mIAZuqIaCcOFUmwvT+MsbHePgK4hsxKdp/h112EvikADP2XY+hPc5zMDyz+jpU8Q4vGLoWzquf6aeYCQhYKi76tsQdaZ/qnzUPGgaKQU78R9zw67DJMDcYWpcAgC+H8JSeZeFAzovQhlJ4lgKnAw5gK5HGpbeGN8kUBZFvvp3m/cNhiLBHhvg5+aeHNCT4nrqPGnI89pTP9Tw/X8QPBU1T+FFwUF1U2sz8KG8FZmDyFZv9KIZwVtngQS704nZ49AvBJ8Qco+OIfICWgkMZlytMYT86Bq+hTnhZQJn4shP3fOGDhOpgAy/j0XrFNcOPe5pl8WyZeqLDhcaBxoziGCwsu42XsCo7ThnGADS6z0b+IEfG3ZByhlTC4V5/VXBddJ0tTjPCSKoC5a9+qnBA9/EWAH77imR8Md9bi0o4Gba91PYZ53mcAZC4iBKHiAC4a/VPLTONJZeArdXcI3rDROhsXen4UvK4qdW0lKZ/uHRhn3IjLR1qgBKR3DEIJbOlIvnvK0/OOKtkycUmHUxMik7/vBX587dst2/wk64KPf7mCn/PXE8JY2jIz8oQCf0ngklYoF8Rr4jlk5vW0yPJ4JVmHzJPsA+R7ZEQTdghDsvhihJdsBHBBPDnTYNqzmOVkHNLTvB8NuBhznSSWfC4rRmP8LMOd69ustblOXw5BpLaox28OwGTUGLcvhoTVl6NtAEvDD2CVgzZMwUAusQdgTdxizpkr6qIbS8HekowAzl21ytAZv0MGfmoIgH8L3dKL89IwlCu3R3ThNtn/aJ5tPKTAH2DfQfFSH1BfQKK6AqSkoKpJ9t2bqoEFaQH4gBKWCFPSNMOIKIkCGDN2wXXQbGdI6RLi1a7ezn8Tun5NuRn9BOevJcS+/9c0K/aKtH0qwlcOUF9Qn1Df+FrxcCuDwZswQFjAF/FVWXGEJcKULH444UWfAtDBhzEWeRVff+nhEDhb/Tzh8EnldJgnTVlgvW1urYvRyUVqyD8cqStVXjqTIJ64CKtJjdIhdanqHka5tHOQa2IX7rR4TFoMjhdPMPOER+sq35SmKSCi6COAKIMvswf4YfS4z7aNzdgIc04B9AaTBfMwzXHubJ1doeb7wfRAbrVCMVMfUV9hZFk2uyoJC4QJYON30oYCUy62pAkKiyjqCKA+bi7A7r2nZKSggV02S5ygs+hnMayZJksXqnDBEo6m/7JlJjYnqadsONCwUXxQc+wv4WMUKweiYRPbarPkb3QWexXW/xoZzdhdeFZrXSTbMeSy7EPCizcCWLpUg7n/34fUkBLg/Atn0enlAn50yn5bN29V4E/pxLJ4oT6jvqM+LAeCCROEDTj//KsXvS7GgDWvNPnEFW0E0LA+eTX8G38tqxwd8Xy71XVObaRmKZwfpIcjyPL7HQ569yQs47bHPsR3+l23qq94HDjvGXFYzLC+BoAdUrxSS1MSnOK6282upbVGzROg93RZLY7jfL5ldvROWXw+4UVRAHTOeaR24hYMtzLu5XYNaJaYr0X4sTCfeZ+Wmg/1pUorxNvd+v7/ePyMCZ2lqkKV6x8Hzn2uY/wYu/ofYbw90r9aC6sJ/iWrHVO8oRl8DcCZGZ+C7TTbd09fecHk7sJqeT9XUYYSkdrar8rA71Yl2J26Zu+EYWb++1WH9BfArzHjJwr8Ie2fAsiivqQ+xVLb2wVk9zcLMNKPFfkXHh9aF3NFoCyzhsmj4Pmr3xs7vmLCViiAjEc6katjYox+XKzH+Qfs9jsqj6J9T0rD/gP6/h8p8PvOel8qpJFAlV397bBPB+DP8FaiUvuvWLf9OgyCmacucKPv7O2YtmbBofuGw7xhjwDGV4z/ugz8RBjnznejB6zTygD8+2nOr8A/HHEKd17qW+rjsBsGCSsuZoAdKUfxwa2pGP81aXyOEcNSAOeu6hgvGL9WVhcY/Vp3ReQ+DDN8OdxARkfWcFrq063/VAa/rJwq+wTUx9TXmI4mwtwY2MouJuwQhmR0wph+HWFQFp9L+LAUQNXYarj8snGyihzhLK3oTX4EhEq9AmV5fQuHwwit87eeUdnmW52qokA5QH1NfR5mZyFMUyoJO4QhGbMIe4RBWXwu4QUrgHNX7aoGkV+VVoLrvDrsaDOcnRdK0wQcQasTXDh3q3X+gDsigOqpz6nvSQYCqD6nKgk7hCEYL1+SZSAMEhZl8dnCC1YAlTXjv4DC5cMPh99wSNReBPtAaD2x0PNNj8yOPpuNSSp+ZHKA+p5kILStA3ZcDAFLHjSO78eiRxJ5VGEKAOe4c6ZJDRCYtzyX0Loew6kt58irDjYGltbXWmbqjwRLhao9aA6QDJAsBE2HrH7CEGGJMCVL42IRmJTFe4UXpAAapl7ycRj2jpEWzJ2borzmAsSH9HZY0ZV09v5a7eqT9uDoicAGIlcWwnueQDTGajCSdm6SdQphkTApi/cKL0gBcF37hqxQDKnathvRJpzrH0qnH/ckH+bc+WjdIXtlbVDho4sDfbLg3NknG+Fru9DEAsIUYUtGnRcmZXkoPG8FQDv+YNWvkxYqnNumJCwc38wrpGmCjMAxXuowjyA7IJx1uzIB2QgjdYSloyzckg1syegjTBI2ZfGy8LwVAM7v+6KsMIR3CityF85oC6flH4dIumf4eTRARY1eDvSf7xjKg0bx9f+wiy1gTNZDWbCZMVteCoCcDuCgIJ1rwFDxS8Gtk6CN5KsDGcnwI1AcwMZ+nFOoTvPxg9tlWQdkw5URJkJ3oQthirBFGJPxlrCZr2NQXgqgsnrMZ7CsJ3PqcSzH/IUW0c6TERhkuGOzPz1ax9W8P8hOKIO6SUbojocwkkrYIoyBNicjfcBmVc2YKzLGSQLzUgA4xZTW/jM/QrTCrcYIo88/joprazmTLu1Qj+JAdg7QBS8kM9lT+pvCxRYwBscgqa0CI4Vr8qEqZwVQ/2xyNrb2nCYr3GH8diMSydsIISuvWOGuZVfT7gPtmEapR3EgFw5AViAzYVwVIIwR1uSt4Kf1YVWeYnBMzgpA49pnB2cc/BtbfncYR+grucOgJEL24KJOdVdfyPqkDMhxZQayEzZSCWOENcKcjDZd166UxaWH56YA6AwyjiuapY+4y3nXmhU6t19c0U239ErJVhGKAx4ccGUHMuSRxP8ouAe7WGPiLlnlUA4fZzmeGwgnouzP4ri5ENbzv8hSWglrhh7VP4GNCVNlaYIIt7m4u3Vm5Okg6lZ1jgwO1G805+qCfy5MrcFKQJudtH9vxIzNUrqE+HBTXWSVNL4/IqcRAPb8L5EXJDYIYXaFDfzEJAV+ea+pmNw4QDJEspRban9SEdYIc9jIuEFWozdm38+VXQHQJgOP4T8sa/dr0Uq5Z+D7dfn6y+FGeHd5+coJVdlwORBGWSLMEfakbSPM5rBBKKsCWDzt0oWYJxwqrajXwtZAESoFgFtXt7fO4pukNKsIxYE8OODKUsgOFHUxB+zJmkGYJezK4gfCsyoAh3PpcV4YGq1jkYoE7ANHDhQYhr/cFi1hoEPRMHI4IGzRHKrWEOaAPReDEsK8sDuQJasC0LioH0g85K8Q9zPdDtXXH04SO5vnRKRzoyFtUAGKAzlwwJUpyFYOSf1LQtgjDEoeT+z25/FUAA3x3ulwoJkhKR+Of85yeCfNlMUHEu7Qji7l9BMI70d0pZApV7bC00jCHmFQThGf0YdheQpPBcCE1iDPKjb36D3tYRr+44C/9qa2B9fJaVYxigOFc4Bki2Ss8BKKnBPTABeDTHgsB3phOMt5AFhukA7/4WzQUmFXn1zkJg2rOFyzvJItWVI210IPq7Eqs/8cgGy5MuZ/zdIaCYOERVkCLwxTHukIoKF5cwwbC6RWRGyWaNWEOElWsd/hWBIx23sM9fX3m/GjrD6SMZK1sDSbMEhYlNFDGCYsy+KlCkBMmjob6/9VmTJC4/Tu4voTGP6fmCk+iDA0dNPT83hPEHWrOkcPB0jGSNZC02JgkLBImMxIEzDsYjljpMcIAEeMzpfkQbB4ciJnR2B4USlP42+Mzaxn/K1R1TZaORAmWSMMEhYJk7L+8MKyfATAvRQAe4o79nGyCn0Px4aN1i0Pvex7varCUckBV9ZCtEmoH4vSnYvY1iz9mMsUAA5H4vNkvQsvozW6zrFEGI4HDg/rlfEvHH0xKqiAMdCVuZA0lrBImJSR049lJBn6ZFQAi+KJ4zH/rx2aHAMNwawdDIYQxwmNAuDcVMP/TJ2lwkrGgTDJHGHRxSSwmbHBwLKL6QyRGRVARHDpkAE+Ns8fbrAJYZn/CybebZ5ZuS1D21SQ4kDJOEAyR7JXsgryKJiwSJgkbMqyyTCdUQEIrsm9+wRbYyetY2UV+R/O4/7XqWpUHCAOhEf2XEwCm7J+kWE6owLgTJwqKwiXE6zjuviANN7nCJvpr/pcpapOccDlgGlaoblT0MUksCnrGhmmMyoAHCZwiqwgYbMXGNePlMX7HJ6s2cK2+lynqk5xwOXA+Ddjf8OPZCjYAUzagkn9E2SYHqIAzo/3HM05G5epUfCASrw59o03YAk8PFO832HwgHrj90u4cv31m/GqPpcDJHskg6FgBzC5fcwbmwmjmeghTBO20+OGKIAoj3gM/8UrRyQ+CL8DZqQXFMi744RmCBZI+1WlwXMgJDJImCRs4uP8iowpmbA9RAHAsilXAHCB1GxziqwCv8OdiKXm/34zXdWXwoEwyaBumZiay92UM2F7iALQBJd6+MGQ8CLXRCjm/2hMT+vpFWr5L0Uc1YvfHCAZJFn0u96M9eliCmE0YxwCM2F7iALAfudpsgIE56/iiORQzP/RnM3YjIQpj3oUBwLkgCuDkMUQPIRNwqiMlEzYHqIAcMyPVAFYjt2GIcZEWQW+htvOFl/rU5UpDkg5EA5ZxJVhtX0YzUwoXIKnpsekKIBZ8XgE1kL5EH9Px1Z8cjO6CKcXXPL3iNhR8jpUBYoDuXBAC4cswhA4kQGjUpI5m0IYHxyfogAmi5OPQmRK2MHEgu2O1R6GEQavOBgW4A/bNncGWL2qWnHgIAfCIouETcIoA1YPEpf6Q+vH+MHQFLDbQpcO/zF/IM0SiuE/NiQ5NX+r2nWwFeqH4kCAHCBZJJkMkITBVU/sx+rgsIO/0zGeogA0XdAIIOOD+UObZYRk+M/EbuUAlLGbVGAAHHAdgkJyWChhlLAqY0M6xlMUALyapPN7jCveYbY1QVawn+G4DEEN//1kuKorBw5o4bBJAaMuViUUp2M8RQG4RgRZRsZwHDIfI4n2N1gPCbP9bbWqLcwc4OEwBBJGYaiXHl2ejvE0BSAfAeAokN3cYdVh6AOchKpGAGHoCEXDQQ6ERSb7MCpkRkCc85OK8RQFAJBLjXzwd2jHDoBQjABsx1AGwIOip36EgQOhkUlg1MWqlCmpGE9RADg8UGoDcGytnTs8FCMAi/eGw/VSymQVMdo4EBaZJIwSVmX8T8d4igKAY61UAcDwtlsIJxQKQEtYmc9Al7VahSsOlJgDYZFJwihhVdZcYPyQwXEpCgCHBkidfDTd2Q/tIY0fXGipf+t6tVIApWayKj8vDoRFJgmjhFUZ8cB45eC4FAWACOkVQsxyEpoIxzkAb46V3IIyuGXqt+KAjxwIi0y6GAVWPZqegvFUBcBZVJbRtu0kTIi4ZCTYBxrOefkkHo5jmIJlhao9RBwgmSTZDJwkYNTFqoyQNIynKACsEUoVQDJpEeiCPwnIEQr8ss5V4cFyIByyafRjNSMv0jGeogCwiSBleDC4hERsP4YVPHgFwNXwf3C/qN8h4kAoZJMbfViV8CUN46kKwGME8PT2p5PY8BC4AsB2ZWUAlPStCg6WA2GQTcIoYdWDEymj/HQF4JFPRSkOKA6MNA6kKwCp5pg7ZW4UGi7z3WM+cgUaLhRLkT42WVVVJhwIg2wSRgmrHixLwXiqAuCZzxSnwmKJatgHROAKAHYKpQA8eldFBciBUMimsPqwKuFDGsZTFAB2EaVoh8FFRKMGaZXgFQDnUkPlYHrVb8UB3zkQDtm0+rGasfnpGE9RAPi6yh0IInoM65yBKwAsY/CGZqGUQMbuVYFBcYBkkmQzqPoH6nUxCqwOvA/5m4bxVAXgMQLQNS2KOU4oruEyJ3WoacCQnlUBQXIgLDJJGCWsevAiZZSfogBwqYB0lx12GFVjI0EoluC0yAS5hvNouYpSHCgVB8Iik4RRwqqsnekYT1EAGD7skWbkfCLnmnSTgSxfKcJjpjIEloKvqszCORAWmSSM4nRg6bke6RhPUQDQHtJ9xNhhVCs0EQoFkGDJqsK7SuVUHCg+B8Iik4RRwqpHC1O2CqcoANgwUiIHF4KTRifCBNg9OCyo3xGuHRpU3apexYFMHAiNTAKjLlYzEYkwxKV85FMUAE4TTYkcXAZdOyQ0FooRgMP5YYNpU78VB4LmQFhkkjBKWJXxIx3jaQpAeqMIrW+gUBGKEQCzncmyBqpwxYFAOCB4SGRSdPdhNTMX4AeQMspPUwAeRwkxfgTTjY7MxfocqoWF2T63W1UXYg6E5KMEjOLk3yNkjMIIQK4AmMO3SzNyMdWw5EZCWb5ShGMeU/uJZSLww0lK0TZVZvlxgGSRZDIMlBNGcTXYVCktaRhPGQHo3N4qy4gGTkNcivaQpS11ODY8aF0fODCp1PWo8hUHcuEAySLJZC5pfUizux+rGatKx3gK0Tv4S28hV+ZjjTibuG/fe7j/QITCGUjXI8oQmLGLVaDfHAiLLBI2CaMw2GX2A4CXYD/GD7IoRQFsqKszsR9AOg2IVo+bmm5EOFiS3z8cZQfwm+WqPgkHQiKLhE3CqIRKCn7bxfigBCkKgMIxf2gbFJ/y09D0qZrHUmFK4pK/aNNLXoWqQHEgJw6EQxY1pu0mjMpIzoTtIQoA8wcPO4A4webiXVkF/oY7MxiuOvW3TlWb4kAaB1wZhCyG4LG5tYMLcYKMlEzYHqIAHC5elxUgOD+V2fKVAlm+UoRjqaOy/vneY0pRtipTcSBXDpAMkizmmr6k6YBNF6OSSrAE+Fp61BAFgMZsSk908F2IU2wj8vbB94B/aKYh1XYBk6aqHyUcCJMMutgERqWs5/zF9LghCiApTLkC4PzEd2J/3Q1jQ+AHg7gN0bTj0xuk3hUHfOVASGSQMLnHYe8xYFTW/kzYHqIAHq2rfBOHCuzNVAgm3LEp3cfOQCWhsAPgGuRjlUNQpp5SYX5wwHUAggz6UVfWOoDJiU7yOMJoprSEacJ2etwQBUAJcGjAkKHCQEads1NhfJMuFQ6k8+lvtGs6Iwcl9SgO+M6BzqMTH0ClXqfv+EcTMOliU1KjDNMZFQBuEPWYBmhzhC2kKwWS+ksWrDNb2QFKxl1VsBcHIhEjNFNQF5NcmyOjV4bpjAqAC2ejrCAMD+brUeMNabzvEaLO9ypVhYoDLgfCI3sJy3yDsCnrGBmmMyoAk4s1soLgKXT6uxbrgNuh9PxAad4SRGDV4vDGjT1qObAEvFVFyjlAMkeyJ0/hXwxhcW+0soOwKatVhumMCmBlXew1uARnPBwEmx6MycyawzVti6wyv8OFiHzI7zpVfaObA2GSOcKii0lgM2OvAMsupjNEZlQASAf/JrE2Q3o3CEsO821bhEYBYIfSbLZsmdoeLOswFV5cDkDWXJkrbqkFl0ZYJEzKCujHMpIMfWQKAGeHMfk0gLGzhKZLPQaHVlPiEM7H1k+/5KQS16KKVxxwOeDKGmQuLOzox+JZMnq8sCxVALgBxEMB8LPhDfROWOwA1HCdGWoaIJMAFV5UDoRJ1giDhEUs3p8ta6QXlqUKgO9qWw87wIFMhcIOUDFJ2OdgovBKpvggwuDnfOrctSIcPtlBMEDV6QsHSMZI1nypLJdKgEHCImEyY3Jg2MVyxkgmP8WkpXFGAg1dJckHZ0BRj5NQX5bF+x0OD6hIbaUlXQf1mx5V38jkAMkYyVpYWkcYJCzK6CEME5Zl8dIRAGXA8KJVlhEap6FX3/+SLD6IcEewRcoYGATnR0mdMP65Mhai5hIGCYsykrwwTHk8FQDjTousYMw5ZlTalbXQEm/L0/gbg/3OtYunXqpGAf6yfdTURrJFMhaaBgN7LgaBRSlNnhjOogBa6iqw1Cc2ywrnQrsY+4/lXoOyjKUM1xiGQ+qgkFKyeHSWDZlyZSs8rSfsEQblFInNfRiWp/AeASCfI7h0GgBDwOW4jDguLz6AGNwa1LjOnBVAzarKEcwBV6bCdiMVYY8wKHk8sdufJ6sCgMPDckn5qJvPYWZvLEzTAKIVp7RL50SytqhwxQEvDoROpmjqDey5GJQQ7oXdgSxZFUDT1gdXwYXovYEMQ/5WGEtswUM1CtA4n1K/IURLNUOYpgLKiQMkSyRTYaLZxRywJ6OJMEvYlcUPhGdVAGzJEhv+AA8MZEj/iyWRy51kT6gUANGoCWtxOq3qXXGgEA6EUZYIc4Q9aXsIs4TdLE92BYACHCHul5fDZ3EeqcFyQ5s8jf8xGBpNrd9ozvW/ZlXjSOIAyRDJUpjaRFgjzGElTmrr8sbs+63JSQG0Nv3gSRwptOP9bKm/9Kh+NdYiV6eGBv+mO+yyi+KiKnhKFAXlyAGSHZKhsNGOq7ueIszJ6CKsEmZl8YPDc1IAbOlSOByxPwzOmPqbX6UdbmzArqPe1PCA37Bhw2b2RwOmQlVfphxwZSdEm36IjYSxyBEGlt75VTK2ulgFZmXxg8NzUwDIYdvOPYMzDv6NCidb79iLQFTobAFYuz2rcaM4ZjC96rfiQDYOuDID2cmWzv94HiesEeZkdXthNT1Pzgqg9czoeuifF9ILGHjHlWHXWKYZumkAtkJqXFhXKOeggZ5Sf7NzAC42kBmSnexp/U1BGCOsyWsVL/RhVZ5icExeDcTGgtsHZ075zXk9DhGwwDq6YThkDz+mYaMl3S4ZMmIVOQFzoE9WeOhGjS62gDE44Hht/pFjNANf81IAB7q678WSYE+GcihIM7TIlx3TeUwSH2iwJthHz4+LcYESoSoPPQdIRkhWwkgoYYswBtoy4xbYdDGaB/GZC5IU8PjCCZ1wMPi9JJo8A7/EhfEyRgqdsjTBhfOqmOZ8AV6LWD5Vj+JABg5ANlwZYTx0K0eEKcIWYSwD5W4QYZMwKovPFJ6XAqACHK9pAGPjuWFeBYT9JVNlgYcJcVxj3PbYPBE4hYqAADngygZkJEASpFUTpghbSDBeligLNjNmy1sBtNZFVkMbya39XPvaW4axOnRLggPN11n94g2JEwde1V/FAeKAKxOQjTByg7BEmGLAlow+wiRhUxYvC89bAVBBwnZ+IisQmmrqFCu5mDs8b2JkZRYzvM+yq119fnyPsgcUk7FlXFafLGhXh9HqT2wlLLmYArZkbPbCpCwPhRekAFraHvoD5hvbpAUL7TsJ1rUS8UlpmkAjeE1UG/d5ZQ8ItBPCUTnm/a4sMA7X2lA+SRdLwJSMOsIiYVIW7xVekAKgTQaCObfJCoah4oyYU3Oew9kTsjRBh3Mhjq+PJy4Kmg5Vf7AcIBkgWQiWCnnthKGoqDmfMCVL5WIxh40/mfIXpgBQUk9X5x34I7c4auL7e5L6SiwbSg8kzESQn2GaZjReuD55pp91qrrCwwHqe5KB8FCURgmwQxiCV9LStJjBr539WBwclvPvghXA4wsn7ceupJ9Ja+L85Fo9udjm9ippmoAjYK/AEW/a5xo2ig8GTIqq3mcOUJ9T35MM+Fx1ztURdghDWF8/WZaJMEhYlMVnCy9YAVDBB/btvwU7j/ZKK+HaDb0V0T+DSJnzkDSrbxGc6Zpjf6n+uZ6pvtWpKgqUA9TX1OeAfmivkyPMEHZg+b9BxizCHmFQFp9L+LAUQJ9jkJASgHnL8WN6zU/D9UZ6rFguRJY8DWcxzTb+z3nPiMNKXpeqIFAOUB9TXwP8sUAJyVI5YYawQxiSJcXS3y35Ov6klzUsBUCFdfV23oZ5fnt6wQPvQmg/TFYZL4Rzj8AAlRgHcl4dM6yvnftch9TR4v3U6lc5coD6lvqY+jrM9BNWXMwAO1I6gTkXe9IEuUUMWwGsWXDoPngG3CyrDtsWD4l12z/itnkflivwX3gfCMYhY+zqf1SHiIS3jwqljPqU+pb6uNAy/MhHGCGsuJgBduR1ipv7sCdPkUvMsBUAVWK2t/8M0N4prZCzq21HPwzDrjXSNGGJ4PxIh1nfUCOBsHTI8OmgvqQ+xTDvyOGXVuISgJF+rFwtq4lO/HExJ0uQR3hRFMDKCyZ3O8K5XlYvWVp1g/1Xe3LvQ5i3dMvShSYcglJlV39b2QRC0yMFE0J9SH1ZDuAnbBBGCCteqxNCON8jzBXMlEEZi6IAqLyWphvvhmcdjiqSPfy0WmPsVbhb7Y+yFGEKp6Ei5ovfUqsDYeqV/GihvqM+DPuwf6BVhA3CCL6Xpw2EDfkLjLlYGxJRWEBR10Dr4+YCnfOnZKRg6NJls8QJOot+Fp0yTZYuVOFwxnA0/ZctM/lfQ0WXIsaTA7TO37/UF2pr/0AjsOy31WbJ3+gs9irsZlK3ZFuIswrZ9DNQT/rfoo0AqGB3p6Bgy9IrGXinhqGBt1iOcS+UQU6HFg7kDewvLRE69leVx2BgPZB3xa6HH/os7Et9Aw0jLBAmCBte4Ee6ZcUEP9VfVAXgNihhfgsGQanjDxr4KV23ZmC488QAA0L/Fw4jjqZdXb++92K1gSjEvYWNPdRH1FcAf2idfNI5SFggTBA20uMOvgNTSWZ+8+B7kX4UdQowQNPiuElGl5sG3of8FeLVzt7OM8dVjL++XOZnA23AGu1rSWfvrx+tO0TuATmQWP31jQO0pZd29YV5Y08mZmDov2dvb+eN4yvGPwvMnJApjRsmxHea6iI/ksYXGFH8EQAI6d63Gi7C4jkpTWgoGnwDF/bt0NRZry+SlhNABAlYjI/9Z3WoSADMl1RJfUF9Um7gJ9knDBAWvMBPWCJMSZo/rOCSjACIogviyZkG06DVMg/F+p2CLkbjkrh4MXS3r2TjKlw1Haiu1uY6fTk6L9QOTtnaUrbxGPK7x3jhJJ+wHubhxVtc3/UARsBRpFkOIGbGomC2xZwzV9RFPVbYvGrxjstcqXeenGMb15s/5hqXzltg1NhjOcnTdW5comnaKTkXHKaEnL+OZYI7Hq3jakrgY7/Q6b39h7yG8gy/bKxwHOdFW1gPGVr0ecz9pR5/whE3N8+OfCtbeYXGl2QKMEBMh7njBoB8y8B7+l9quKFH/peNj9wD41pHenxZvOMQyRi3ljY8a55DXpxlQXNZEyk48Zp4DpkpS/C7sg6ZJ9n3BD+wQxgqZXeVXGAb48k5WGx4Cg2NyBoCD6gfC2H/Nw5nuA4rCGVjvU1vD0akbUzT7mueybelx6n34XPAva7LcbBDTkwdfmkBlYB5v+NYWO7Tv8gZl37Z8eE0beEsWDE7+mwpKS25AiDiG+PmtZjrSI0YZA9wHHahrgkYBPnHStngUpft2gYc3N7K9D89XMcPlLq+0VA+beRxL+rEXX3lONdP7SPxR9vhuqaxRwA+Kf4AiGubZ0d/mpq3+G9SAopdVeMGE4YOfpG0XGxvdKzk6ZphXIpDEKQnoEjzhy1CiH22xh5onRl5OmyklRM99RvNue4V3SG7pbcgHgrnJceyHtSM6POAfq28DLG8aVbkEnl88WJ8UwAXrN17iBEd8xwafrSUfCFWJ9i+C2Ns3HdxWNcEaboyisAqR5vDjabWWXxTGZEdOKn1G8SpmrAWY+Q4NXBiikGA4B0JtveHMTb2EawaLZAWKdibVrL7jBXzxu2RpilihG8KgGiuX2fO1XT+JOwBhqwNAMxNWPm4g3Pj6yBOajeQ5Q9rOJZ8tnNbtDTPiWzAyE8tG2bsKCzrrTNnCZ03YGl4SsYkZRiIzja5o98quHUNFJr8eG/BLMcWZ7fO8W/U6KsCoL6DlyDty5YeIEL2ANw88hnmYPONpv09lEVJVyp8lychdsKDoLWp7cF1dLy67/WHscJly/TFUy+dg57GDdN8RB3LBmOewxznV0zDwbNc/x8ATo45Ib4Jb7+f+NlFcmJKRwWcN8yHoQkXy6ogCyi0wIVQBgewu/DvZOnKORzXPbVrnK1s7zHWPT2PS/dOlHMbs9E+d62orK205sAXfhGOZ/aYE2crKbzx2L33W4CsCvavRzxXwoRoaq6LkI3M19FhEAqAnbeuqzamVz0Hhhwl6zpwoduxnYUwCB6qa8wXg4iMllKGo50mhGOTzaxnWrc89PKIHxXga18//ZKTdGZ8CEr+VAjgiJnmpcuJ7bCHsL71nqZrq9DOMenxA+/44L2VsA+c8dicmvaBML/+BqIAqHGLnzXnCY0/4WUPgC7cDW8pGEyMM6AEFvrFlMDqwcqBw/l6zs1nmmdWbguMjhJU3Lix5xghIh/ShJiNYf7YElQRqiIB/lWMWc/ByxWXerKJMuIAfos74pymMyNrZWlKGR6YAqBGNa5Pfp1r2q1eDcQXcpvZo8+LjLEbucNme6UdSXH4Or6L6WLcZvqrNVvY1t8v4WVlL/jEMqF3TWfTdGZjh5uowyjn8JHUP15tERpbb3brzZFKey0AdoxnWp/W+2U0BKoAiCj4B9wK4fi6jEA3XIiXrKRxjhFzroQwjcarvZPwMnwDxqTXnIj1auvpFdvwFYVuDNFDe/Gf7z1GM40TYLw9HuQdC+qiIaLQJ1KcV6wE3Hyj1hPoI09/Fij5nzbPilzrE2EZqwlcAYAqvjhu/RbDpCsyUjgQSD4CE4wLY53WV5DFU6sOZBmpfyE4MBpqmxlztsC6vMO2zZ01f6va5dcowf26f+DAJF2PHIbVmsmgZTpomQFFXjlSeZ5bu8S2xHjj57EOy3utnwoT7N6mOoMM3IEq8jAoADYrHo9MZqc9DI15gTejxfIdwrhyMrOuQ9oRtVzk3e7sse5yExO74UexE5ed7cBce6ftGLss3tujJaxeXa/ufXMs6335JO55ZftJL4vo0ftYhW3vr3BiRoXGtKoIDLGwTRwGL/bJWL0B3/nEEbc8m53F3inA7x3MuGUyt+4Bfy72TCzEih3shYs21NWZnul8iAyFAqB2LlqxY0yktvYvAPaZXu2GoN8DCf9HMHrUjwS8+CSL69urIJIYcfUCxL2UDjytwHeoAryPQSBCIxOyNoQvXGzDh+nnh3H7P8E872VrIZ7Fmf4fLtax3sPlRag6+9x418QqVrkaX5njvRsmlmOodWWs07lqlNoEvNmjYn3kAH8lMV67C1PTrF9+jM5eS9g984NY7pMxJFQKgIg8P95zdIy7SyLet7jAJgDD4CVazL4MroJ1sgaqcMWBUnEAx1rHnYT+AAx+D2H0JPfv7yPg7YQw5z1aV/lmqegppNzQKQBqxKL1iZMjmv4kfnpvCMLqQLLXuECP2WePCj+BQnpY5SkJB2id307oT0YrrBUAv6e1HwR0mI599srZsZdKQswwCg2lAqD2NKw352NDCO5HZ56WZZhQt+GABRgPjekj2WNwGH2sshaZA66HH7O24ACbFQCQ94oUjvPGRrCPtMyOhPJezNAqAOqzhvUWdoWxB7IpAddj0HEamcZjGuNXKAt1kSVeFedygFZaHCbuZY5I4ESPZsil1MOvLwOBn13WMttoCSsLMX0O70OMI+0JCr3PC0RH9PtbV+EKj19hVBD48kp4uaooK4QDrkxhVx++mFUka1nBD5nt+/KHF/zEh1ArACKQhk40f8LPt+ld9qBjxsAR5RFmiw8KYf0U53N6Kw1ZQSpccSCdA5AlV6awpZdkjGQtPUna+9sks2Ed9g+mNfQKgIgl4wlZUGkZZTDx6b8x9I/07bnWP7/b6rwRxpnQGV3SaVbvIecAZIhO8sH1Fp93ZcvjcFtqibvUB1kNo8EvE6dDbQNIJ5j8BMawyiYA29NZyM2HZULHMj/FtcjJ3IBnVhmfNpzOB/XuAwdweq+wxHLhmC9pRuR3OSzzEfqf7bV7GsO0zp+NU2UxAhhoxON1NbvJiwqMXjEQJv2LdVkcvvgc7vLjdAwz8qgpgZRZKiKFA5AVkhmSHZKhHMG/gmSznMBPbS4rBUAEkwsl+VHji34vvXs+MA5yjTXRGezOOONGh/EXPdOryFHPAZIRkhX33H7ITg7GPnz52b0kk2Fx782nE8tqCpDWMI6txLfAKOO9lbg/E3bQrbVs85O6FjlR0/hH1ZQgjZuj/dW9sEP8yXbMV9wbexiflwtL+rf0Xoe0WCgov6fsRgCDWCxoLzWMLtdhfdYaFJ7xJxTFvIgWxTFkuIzRtn6CM/l8OXY5IzEqMFQccGUBMkGy4cpIDuAnmSPZ69/PX5bgp04o5xHAQSEir0F03u+wCiA9Y3AgMXoK/SZu6ert/LexsQmL4Wh0jnIcGuDO6PrrOvYI9sS+REdTTcX4f4UMXQdAZMUE8r2FY7w+GdQxXsXspayNLWZlpSyr76DRyt+gExfnVI8QrzqcfcW2jc2GZsF7kE/LKZ9KNCI4gI/AVssx7tV1a4Ym2M9h6MPRZdkf5GvCjr7PlpuxT9ayEaMA+htIdoFvwAkIRhz55SODmQFtfp/NEt/gLDodo4GPYaqQzcljcHb1u8w4gDl7N9xz/yhYcovOYhj2s0/n0gQa8uM+l+sx5Kdz+8t2yJ/e1pGmANz20Q1Eus7/F4M5+TVkgziBzu3CkVb/0m7tu7s2Ou4SdO98MGZE8mZQs0fVT5r6oUfXtCf3PlRrjP0cFsD+L8BfkxMTcF2XbYtP+nljT050FSHRiBVyuotQj1XdjS86XbaQ04Ph3fOOzb6sa/ZOoUc+zYXIalPIqWCVKFAOYD3/LW6b99mOfpims19gund6rgRhxPCwnTjwOb/u6suVrmKlG7EKYIBBdDU5PuY3QdtHBsK8/rpfCsHuTIzRvx09YJ0GBl0MJeK5JdmrPBUXHAeg0HtwBNryZJXxQqzb/hFGAFejP3OSeYwKsaFMfAe39dwaXAtKX3NOzCg9GaWtoTGenIMh371QAji9NrcHArAHPoTf7a6I3FfRm/yILvSFEJ1YbrlVqkA5IFjC5vaq3oron8f0mp8WQvsh+v6QXGlC32/BlPCK5rroulzzlGu6cvYDyJnn1JEdyXdPEY64GTNBO5eMfQKj/aqqx4rjesfYbkv/Z6wa/Bl5PU/VzaVslaZkHEhSH1FfUZ+5fce0X+UMfsgGyQjJymgAP/XCqBgBDBa3C+LJmTrjuH6cnzE4POtvHD+GM/BvSGhdj8VYzSKhiQW40LIiaz6VoOQcgCNPL3f46gTrWhlzas7DXQnfx7JetmO6UujCdOE5m4kvrKiLbkyJGOEvo2IEMLgPqYMP7Ft9JtyBvoPRQM/gOM/fJFA6eyDKxq4S3ObbdeN6YYsHYSTq9MynIkvGAeI99YHbF+gT6hvqo7zATzIAWSCZGG3gp44ZdSOAwdLYuKbnGBaL/BhDxCWDw3P5DWNhG25+vU1YkbsEt07SItp5atUgF84NPw1Z9R3TeYwL42VumFfhBumvQZCn5lsy5vrLksz8ZthO6s23HcNJP6oVwADj6uPmAp2xf8eXY+ZAWB5/OzF8/KXlmL+AA5JhRCIL3EtMlcEwDxbmkBSGPbp00zJN3LYrLEOLfBnTuC8h5/gccqcmEWIjDEH/1FoXWZ0aMfrelAIY6POlS7WGxdd/TuMaThJiuP4q7wfnRYpWbCe93ThCX+m8a83CF2YBhHRq3iWpDAc5AOXahhHaau1wY4P1jr1IY+IaKOp6JMh7+or+2CGE872WphvvZkuX4lh/9SgFkCYD/VeUfRWzo29CEdSmRef0SoKGNeS77KR9pxBmlxatrNO5qIPgel92klPpoyCREG/bgsedZE+c80iNHtWvRn9cBUWAi0gLeARrR3/cjAM7flaOe2QjXhcAAAVhSURBVPYLaHHOWZQCkLBq/ur3xo6vGP91+I9eC8EbJ0mWQ7DYAHvB/azXWsYiFQmm23WwFcxUyiCNdQA95vYbma3HmdkbYxXGEgjn5QD+rLSUOb9CEe/lTNza2dv50zULDt2Xc8ZRlFApgCydfe6qjvFVY6uvw1Aeo4IC5puDysdwdh2mCfcL7izv0XvaK+zqk3GL70lQBiei/FHlbQhekPX9Fdw6/HKvvv+lSruylgvtYvDicvACjlvDesgu87MD+/bf8vjCCWqVxoOVSgF4MGdw1LmrdlVX1oz/AmeuxfmYwXGF/Rab8YVqEYK37uL6ExM5O4I79nHYxDRdOM70kaYQCPBc07ZgU80Woemv7xbsnUnCPodzUY8RVgO+9DMK4+P7uTDS2oa7O27r6eq84/GFk/a/H6N+yTigFICMM7LwZcv0hqmXfJzrGrYQ8zpZsnzCoQhwTbd4EnmeQoeswT3z6w432AQ7aR3LdfEBHEd9JL6WhyPOyKfcoNICiNg6y98FzduxTr9VjxpvvGuxjsnMmoO4+aDrLAD+bAC/KI5U8AeIC9v5SUvbQ39gS5bk5OkZFG/CVq9SAMPoEVo+xP2FX+SCfRwGw6IN4aEQaO/583BUWgNfg3XCZi+8OfaNN45IfHCiZptTuCaO1AU/HCsOtejAiRgtFAVI+bICX/VeAHo3LPPtNhfvCoe/7eiR7e/E/rr76H3HQnmx07BGPwe8mY8l0tMB+OIpMDjwYKPPH3D7zn+r5bx8e+799EoBvM+Lgn+RnaCyesxncNjoF/BlO63ggjwyAmgJmjOj/E0wbL0Ig9mrlmO3sT0dW2O1hyGaTbQMrFrYFm5U5mPgi1ANuOEvr8bSVzXAUoGTbwyAES4PBERuQNG4gAQwcaaioHMVLdorAX96C0qtF4di74fL836EdmMNHkNq0c10o8OwyKrOdifad2KLzYRphqZPhWHzBBhMT0GaU12bBivVxinxguOIO3r2d/+Pmt+jF4b5KAUwTAamZ69/Njlb17UrAa6PA1iFLVulF5rtXbDd8Iffir0JbRgOvwNtQMteuzG/bndsrR1f6t2a7gDITsK27WQyaSUTsf2Jp7c/7W5smjtlbjSWqI5Fo0ZU1/UoM7QY8lVjZIE7F51a2CmwHMphpmAYcfAjUBcAz6dBmUzMRlox4sHLHeDlH2zbuaf1zOj6YpSpyujjgFIApZIEOBYtvvB75+CruARAuQyMPrRUVY3EcqHE3sNo5AGMdpY1PfKDJ5TjTml6WSmA0vA1tVQYDhdPu3Qhlrwu1mD1xtd02Bbv1ApGypvY7GBVBEujy5u2PrhKGfRK369KAZSex0NqaIj3TmdCa8AQux5D6oUYIVQNSTQaAgQ7gCnLKkxRWhl3WlrqKraMhmaHqY1KAQTcGw3Nm2Ni0tTZsMzNh6FuPubW86AQCnJBDrgp2auHSy7sB2thYFyDtbo1fFfb+pbGGYnsGVWKUnFAKYBScbbwcvmieOL4iOBQCNpMzIFPJes6jGDDcEcunJhCc8JwR264L4L2TVw4G00u1qysi9H17rRioZ6QcEApgJB0RDYyzo/3HB3lESgDcaom+HH4kk7DaGEqRgtTkDfvnXHZ6ssxHjsg2XbQ0gZatjpcvI4pzaakMDeN5j32OfIuFMmUAghFNxROxKx4PDJZnHyULfRpmi6OoiU7dCqW7GjpTkzEtAI+9uwQfInJUSkGhRFFfBTApQNOo/01JxGewKc5iXBaGkzg602ONnuQF0uKHJ67oh3x/UuL/C2d21t38Jfe2lBXh9Nz1aM4oDigOKA4oDigOKA4oDigOKA4oDigOFAGHPj/BmkrpMF8AC4AAAAASUVORK5CYII=");
  18653. n.prototype = Object.create(r.Mesh.prototype),
  18654. n.prototype.move = function(e, t, i) {
  18655. this.hidden = i,
  18656. this.mouseLastMoveTime = Date.now()
  18657. }
  18658. ,
  18659. n.prototype.hide = function() {
  18660. this.hidden || (this.hidden = !0,
  18661. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18662. }
  18663. ,
  18664. n.prototype.show = function() {
  18665. this.hidden = !1,
  18666. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18667. }
  18668. ,
  18669. n.prototype.update = function() {
  18670. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18671. }
  18672. ,
  18673. n.prototype.updatePosition = function(e, t) {
  18674. if (!this.hidden) {
  18675. if (!t)
  18676. return this.hide();
  18677. var i = t.point
  18678. , n = e.distanceTo(i)
  18679. , r = 1 + .01 * n;
  18680. n < 1 && (r -= 1 - n),
  18681. this.show(),
  18682. this.scale.set(r, r, r),
  18683. this.direction = this.direction.multiplyScalar(.8),
  18684. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18685. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18686. this.lookAt(this.position.clone().add(this.direction))
  18687. }
  18688. }
  18689. ,
  18690. n.prototype.writeAstag = function() {
  18691. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18692. , t = new Date;
  18693. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  18694. var i = {
  18695. enabled: !0,
  18696. version: "0",
  18697. created: t.toISOString(),
  18698. created_by: "APITest",
  18699. position: this.position.clone(),
  18700. stem: {
  18701. enabled: o.tags.pole.enabled,
  18702. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18703. },
  18704. label: "tag " + this.tagCount,
  18705. description: "Description " + e,
  18706. floor: function(e) {
  18707. if (e.currentFloor) {
  18708. var t = e.floors.indexOf(e.currentFloor);
  18709. return t > -1 ? t : void 0
  18710. }
  18711. }(this.player.model),
  18712. type: "info",
  18713. metadata: {
  18714. preferred_camera: {
  18715. mode: this.player.mode
  18716. }
  18717. }
  18718. };
  18719. console.log("--------------------------"),
  18720. console.log(JSON.stringify(i));
  18721. var n = this.player.model.addtag(e, i).build();
  18722. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18723. n.visible || n.show(o.tags.startup.fadeInDuration))
  18724. }
  18725. ,
  18726. t.exports = n
  18727. }
  18728. , {
  18729. "../enum/RenderLayers": 41,
  18730. "../enum/RenderOrder": 42,
  18731. "../settings": 166,
  18732. "../shaders": 167,
  18733. "../util/lerp": 188,
  18734. "../util/texture": 194,
  18735. "../util/transitions": 195,
  18736. three: 217
  18737. }],
  18738. 150: [function(e, t, i) {
  18739. "use strict";
  18740. function n(e, t) {
  18741. this.chunks = [],
  18742. this.floorId = e,
  18743. this.roomId = t,
  18744. this.position = new r.Vector3
  18745. }
  18746. var r = e("three");
  18747. n.prototype.addChunk = function(e) {
  18748. this.chunks.push(e)
  18749. }
  18750. ,
  18751. n.prototype.calcBoundaries = function() {
  18752. for (var e = new r.Vector3, t = new r.Vector3(0,0,0), i = new r.Vector3(0,0,0), n = new r.Vector3(0,0,0), o = 0, a = 0; a < this.chunks.length; a++) {
  18753. var s = this.chunks[a]
  18754. , l = s.geometry.attributes.position;
  18755. if (l)
  18756. for (var c = 0; c < l.array.length; c += 3)
  18757. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  18758. t.add(e),
  18759. 0 === c ? (i.copy(e),
  18760. n.copy(e)) : (i.max(e),
  18761. n.min(e)),
  18762. o++
  18763. }
  18764. o > 0 ? (t.multiplyScalar(1 / o),
  18765. this.average = t) : this.average = null,
  18766. this.boundsMax = i,
  18767. this.boundsMin = n,
  18768. this.center = new r.Vector3,
  18769. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18770. }
  18771. ,
  18772. t.exports = n
  18773. }
  18774. , {
  18775. three: 217
  18776. }],
  18777. 151: [function(e, t, i) {
  18778. (function(i) {
  18779. "use strict";
  18780. function n(e, t, i) {
  18781. this.obj3d = null,
  18782. this.nodes = [],
  18783. this.colorHull = [],
  18784. this.shortPaths = {},
  18785. this.floorHull = null,
  18786. this.cameraHull = null,
  18787. this.floorPathDistance = 0,
  18788. this.floorCurvePoints = null,
  18789. this.floorCurveColors = null,
  18790. this.camCurvePoints = null,
  18791. this.warpDestHeroLoc = null,
  18792. this.warpDestPano = null,
  18793. this.warpPathPoints = null,
  18794. this.warpPathLengths = [0],
  18795. this.warpLength = 0,
  18796. this.closeWarpDistance = 4,
  18797. this.UP = A.UP.clone(),
  18798. this.longestStep = 0,
  18799. this.upcomingTransType = null,
  18800. this.burnsDir = 1,
  18801. this.prevNextDist = 0,
  18802. this.nextI = 0,
  18803. this.activeTransType = null,
  18804. this.lastTransType = null,
  18805. this.bunnyObj = null,
  18806. this.director = e,
  18807. this.player = t,
  18808. this.playerControls = i,
  18809. this.modelManager = t.modelManager,
  18810. this.updateModel(),
  18811. this.updateDefaultsFromModelData(),
  18812. this.bindEvents(),
  18813. this.warping = !1,
  18814. this.waitingToWarp = !1,
  18815. this.warpInterrupted = !1,
  18816. this.warpInterruptionBlackoutStyle = null,
  18817. this.warpInterruptionTravelTime = null
  18818. }
  18819. var r = e("three")
  18820. , o = e("../util/logger")
  18821. , a = e("../enum/Viewmode")
  18822. , s = e("../enum/RenderOrder")
  18823. , l = e("../enum/WarpStyle")
  18824. , c = e("../settings")
  18825. , h = e("../util/math")
  18826. , u = e("../util/lerp")
  18827. , d = e("../util/easing")
  18828. , p = e("../util/transitions")
  18829. , f = e("../objects/Snapshot")
  18830. , g = e("../effects")
  18831. , m = e("../shaders")
  18832. , v = (e("../gui/gui"),
  18833. e("../util/texture"))
  18834. , A = e("../enum/Vectors")
  18835. , y = (e("../model/ModelManager"),
  18836. new o(i))
  18837. , C = e("../enum/PlayerEvents")
  18838. , I = e("../enum/BlackoutStyle")
  18839. , E = e("../enum/ModelManagerEvents")
  18840. , b = e("../constants")
  18841. , w = {
  18842. path: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"),
  18843. pathEnd: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM3pJREFUeAHtfQmUHMWZZkTW0Ye6uRECg5FYCz3WHGK6G0kNFmqBpD4WG3Mb3sh4bOPd98aewWAMyxsj7NGADdhee97bHWwPtvy4ZJDxQF8IqYUspBbdPSCOZSX5WcJgEBIgoFt9VFZl7PdnVbWqW1XdWVfmn1WRT62sjIyM+OL7j4yIjEMKffiagUVb36qqDc88PaACc4SwTpaGPB4FOkEoOqvjJf0W4lglZCXOYSFFBcLCQokK+xr/4YggfEzRWYkxupZCjeJ8EGHvCyE/EFJ9gOv3lUVn492YjO0ZjOx/c1vjaSMI14dPGYAu6IM7A0t6eoJVVY1nqoA4VxrG2VLJM2DcMHg5W0oxy0v8Sol9wLIXWPYoqf6sLOs1GROvjIxs3bWpqSnqJTad9/QMaAcwPUeuxljSs6eysvbUeghmgRTyXBjXuULKs3BNb2zfHKg5jAml3oBjeEUJhT+xfXTw7f5NTXOoZqEPJgxoB+CxIFo2D54oqqsuhKFfaEiBs6wDpLDHsIqVfQTlHLCUeAHlfEEMj7zQubj2QLEy0+lOz4B2ANNzVNAYdf39oVnivItQdW5B9b0Fb/ezC5qB3xJT6jVw0QkuOveJHVsG6utNvxXBz3i1A3BBesu2HDolVBG6DMYOo5eXIMsaF7L1YxZDSqkNaDp0mmPm0+svmvGOHwvhJ8zaARRJWpf0Dp1UEQpfhQ67a5WUF4FozXUWXKPPAH2Kagv+e3zMjDyxYWHNe1k8rqM6ZEArpUOinERbsfXj4wKhqqvxpr8Wb/qL8Yzh5DkdZ1oGLNQMnkfN4PGYOfK77sajP5z2CR3BEQPaATiiaepIzX3mEkPKryPWFWjL0vd2fRSJAfQX0FeEdfAIv+hqCG0qUjZlk6x2ADmKevkLgzMD4cobDUN8DbX7uTkmox/LiwG127LEL2OR0V8/e2Ht/rySKtOHtQPIUvArtkfOCwSNWzBi7jq87UNZPq6jF4EB1ApM9LA8FotaD3QvCO8oQhYlm6R2AA5F2zxgrggIcSve9pc6fERH84QB9VxMiPu76kLdnmTvs0y1A5hKYGvXBlrmXH4DOvRuxd85U0XV93gxgE7DV/F3f+eepx4W11wDn6CPdAxoB5COlVWrjNa2O64V0lgFwz8zXRQd5g8G4AR2CWWt6mi/53GxapXlD9TuodQOYCLXsrUvip58dTc+5X124i195WsGlHpdKXlXR0NwHcqBYQb6IAa0A0joQWufuQxs/Ahv/PlaNUqXAdQIXob539bREFpfuqV0XrKydwDLekfnhkKBBzDz7jLntOmYfmcAMxSfNs3YLesXVu72e1nywV+2DqCl94OjRPCof8IAnm+BwFKdfZePbpTDsxEMKPqZiH7yg86Fx39SDgWeXMaydACtL0a+IgLGvSj8zMmE6OvyYwAdAvtFzLq944LwQ+VW+rJyACu2jn4mEA48iHZ+U7kJWpd3egbQP9ATi8Ru6m6s/NP0sUsjRlk4AHtJrZqLvo3q/ip09FWVhuh0KYrCgBIjaBasGhna8uNyWNKs5B1AS1/kfLzxf4W/84uiMDrRkmQAtYGX8PfVzobwSyVZwEShSnq6astA5B+lNLZr4y9lFS5O2UhnSHdIh4qTA49US7IG0PbHj45VVTMeghC/wINmjcLPDKAm8Ac5cugr7Z875qCfy5EOe8k5gNb+yAIM4X0cBTs9XYF1mGYgFwbwpeBNDCm+tqM+vD2X57k+U1JNgNZ+89tYhOeP2vi5qpt/ccV1yvhjXMf8W47JyEuiBmAvxVVR/Ws9mm+yePV1MRigUYSxseEbS2FpMt87gObt5qJAQD6Gz3ufLoawdZqagbQMKPGXWExd17UgtC3tfZ8E+rkJIFsHzO8YAblZG79PtK2UYOKFQ7pHOohi+fZF6kvgtH1W9VGnPowq/xWlpFO6LP5kAE2CdcOfvH2DH7c9850DuLT/w6PDsvY/YPyL/akuGnUpMgAnsDmiBj//XP1xH/upfL5yACv6D50ckOEuGD82zdSHZoAXA3ACr8RUpLm7fsa7vJBlRuMbBxCftx98FoBnZy6OvqMZ8JYBjBfYa5rR5X5ZZ8AXDqB1e6ReBI0OgD3RW/Hq3DUD0zMAJ3BARK3WjgXh/uljexuD/VeAtj7zUhk0erTxe6soOnfnDJCuks6S7jp/ypuYrB1Ac9/YdcKQ7aBG76brjX7oXHNnoIZ019bh3NMo+pNsHUBbf+SbhhF4BAzo5bqKrgY6gyIxECYdJl0uUvp5J8uyDwCDK+5CT/+qvEtXZgmg7XkIO+juwizInVjUYpch1PvKEkNKGoPKUIOBmMDZGrRMa9A0zMF9b741SBTNOv202pAVqjVCRq20jNpYQOAsa6WyaqUhaiwhT8BiKmdiVtw8LJd+JpRmRplRm3dx8YVgVUdd6O68EypwAuwcgO0tpfGzApez1JJ7B4b+Kgx+pxRqZ8ySO6Vl7uxcWP22GwVt6R0+VRmheQFDzVNCzoMSkWOgnZNOcSN/3+ahrG+114d/zgk/KwdA7SWqMgEUK1xeC8zuVVaiB9NRN5oxayPXT0z2p9qAsRTTsfEnmiBE/dUmRXkgR2VZseu7GioeSwn29CcbQ7N7TOMdfrrNL8RHqG4/D33ZiL+ejvqK16Al0B9fHbK1f+xs+PIm/C1Fs+RioD/GVyUoDtiIsFRbe0PoueIkn12qLBwAfeenzyaAXr69/QrtcymesCy1pqt99eaS28cO+y02t9252DDkSqnEVagh1GanqiUVe0hFrSYO4wQ8dwCJEX4vAEj5VReViCmp1gvLWnPQ3P/UtsbTRkpKzTMUZtHWt6qODc28XBgGnIGkLdmw83p5HajOHcCIwQu9bs556gDiY/srtgLE7DIT/w6lxBphjT3ScUHNvvIq+8TStr44NEsYFddLKVaiqXDexLulfQUnsDemxhq9nDvgmQNIzOrbXEYTeyz03K8TUt3bXhceKG3Vzq10bQOROqHk7fiiQNO82Y5Rya106Z+iCUSYRbjYq1mEnjiAxHz+7nKY0os3fRRV3EdlJHZP+6KKN9KrgQ5NZaBt29hZKhy4A92eX0LNIJh6rxR/wwlsxnoCK7xYT8ALByDb+s0n4eW/WIrCTClTBL9/bUbNe59dULUnJVz/dMjA8u0jc0LB0O2IfiP+SvrrEJzAOgwUugrlRMvAvcN1B9DSZ96GnuAfuldEl3NSYhhV/QdHTPP+jY3Vf3U595LMbunW4U9VhUK34qVxE2pT1SVZSBQKTuA2OIH73Cyfqw6AFvCkddRKtlqnxO9GIpGbteEXR4VtRxAO/wRO4Ori5OBtqtRctGJqsZsLjbrmAGjp7mB4xksQXgmu3qt2W0r8fWd96FlvVag8cm/pN5cbUvwrvhrMLbkSY7XhaOTQ+W4tOe5WT6sMYN3+kjP++E6y37Pe23uONn73TJG4Js4x4el7qDeX1tgJvCBtW3GJTldqAPDYt2A22f0ulcmVbDBUtz0ai35Td/C5QnfGTKijMBgI/hxDjdsyRvLhDTi3W+HoHig29KI7AOyuulAqg9r9oWIXxpX0lXgPbbVvdDQE/+BKfjoTRwy09kW/AB37N9QyT3L0APNI0DFTSWtxZ124t5hQi+oA7F16q2teQianF7MQbqWNt34PRu9dX+6j99ziO9t8EqMKH0FtoCnbZznGx/fAN+Xw0PnF3JW4qH0A9hbdpWH8lrLU3R3PrL5UGz9HU4ljItmQjEhWCLH4InWGjF6cZEPOYucWC3kU52jti9wsDePHxUndvVRRFduHCTs3dNaFMDVXH35hoGXAXIqJRg+jWTDLL5gz4bSEdTOaAj/NdD+f8KI4gBX9kb8JCKPX/+1+tWHUHLthw8Ka9/IhWT/rDQOX9A6dVBmqeBifCy/xBkFhcrX7A5S1oLMh/FJhUjycSsGbAEt6eoIBIX/pZ+NH2wuDstRd7U+vXq6N/7Cy+O0XyY5kSLK0Zeq3AiTwki2hX+NXZFuFLkLBawB+H+pL3tZSsZWclm0qtNDLMT17uTkZWOPnFxMWi/luZ0PoR4WUX0EdwIqto58JhoOv4FNMVSFBupjWEDqQruhoCK13MU+dlUsMtPaZy6Qh1yE7f648hUFP0Uj03O7Gyj8VirKCNgEC4cCDfjV+VBEP2Ms0aeMvlG6xS4ccO8mYZM0OnBNAeLHaNuYkrsM4BXMALX2Rv/Pr91coxF4RjV7EYY02h3LT0XJkwJYxZG3LPMc0vHyMbKz1xchXCoWhIE2Alt4PjpKho3cjsZmFAuZWOhjc82pMRFZ4uSyTW2XV+RxmwF6OToS7YVC0n4GvDjiv/cr8eG7nwuM/yRd4YWoAwaP+yZfGL9TW4cGhxdr481Uj/z1PMifZ43PPVr+ht20NNlcI3HnXAGhV33AoSOvW+2rFFnrzkwJsajr2o0IQqdPwJwNLeg4eU11bg7kqvqsJRCJm9Ox8VxXOuwYQCgVoxpK/jJ9WY0W1Xxu/P422kKhJB0gXfNgnEE7YXl505FUDSHxW8dUiGBD0gXiHX+WuvJjTD5cUA63bR88UweAWGISv9qfAZ+vl+Xy2zqcGgEV9RUEHJbigUUNYdKm1Y4E2fhe49lUWtk5ANwB6yFfA4zaY84s8ZweA+ddXoN003y9k2eOpaZDPgnC/XzBrnO4yQLpBA8FIV9zNOffcyAbJFnNNITcHgH3epLSnXOaar6vPodoPucZW5lNVchWwzswzBkhHSFdIZzwDkWXGti3CJrN8zI6eU9WhtW/sSxLbeOeSoRfP0NpxWF7pB17krfP0JwPYu+J7WIb8br+gV9h2vKOh4tFs8WbvNdauxWQ/Y1W2GXkXX23ofGb1au/y1zn7kYH2Z1b/MyoBG3yDnWySbDPLI+saAIb8rjQM4zdZ5uNJdLTl9o1FR+eX45Te+PftGfPAwTxDyHnosD0TQjgB51qE1aLtWINKbi3CaKONYYQPYmzEEGbLDSJ8EGHv47wLGxruRNjO4cFDO8vtsymtJ1ARrHwZ5ffFoiKWZX0ZawasgewcH1k7AFSNXkXV6GzHOXgX0YLyLiuTlXxkc+/YOUZQNsGwlyohF0KwBR+WjUbxfilULxzFRiuqeroWVrwK8fqmrZyLKtLKQnCgNDs0+9pyLhnm8QwNbuuoD52bTRJZOYDmAXMF6v9d2WTgVVz0+t2NDp1VXuVf7Hzt+RdG7ZVYdq0FeTXhDX5CsfOcnD4s/4BUYpOyrE5lDT5ZiLHpk/PgcI3xLqswjfguDlimwxATqrmrLtQ9Xbzk/ay8GhoYtyYf5HyGJ+zpaF/9fc4Yc8KGNl5zX7S1bSD6qBE8ep8MGP8Ow7/aC+Mn/Hh7nEj5Ew7CQ7gIXy5t0Zz4cOkh0iXSKZeyyyubbG3UcQ1gxfbIecGg8XJe6Nx4mNbtt0bnl9Lqvcu2HDolVBH+R1TvV8Lg+K97b++doNaYY5Gfrr9oxjtuiL3YedCS49KofNkP/Eej1vzuBeEdTjhxXAMIBI1bnCTodRx0cH2jVIy/edvI7Nb+6P8OVVX8GVXQ7/hB+Wz5w0kRXsJN+KkcXutFvvmTTpFu5ZuOG89nY6uOagCJ3tC3uK+nhmraM+gEucwNkouZhz0uPRC8E3lcD84LvhBkMbGnSxuGE0X4IyIWXe33Ydit/eYzqImx3oYMfJv4+nWak69fjmoA4UDFl7kbP/qiR7BX37fSKaBfwur636mGgt0jAsHXwPfKUjB+4p7KQeWhclH5qJx+kclknLQfJOna5HBO1+A6RDbrBJMjB2AY4mtOEvMyDhZ2+Bc/b9TZ0h+9fJaY+QbeLreTAL3kslh5U7mofFROKm+x8ilmuqRj+Lx8TzHzKETaTm12WgfQ3GcugQ+fWwhQxUtD7Vb7995XvPSLl/LyF4dPw9iKdux3/3u08T9dvJwYpYxyUnmp3FR+RsicQdm/F7Ng1W5nkb2KJefGbXfq/Kd1AJj18/Wpk/D+rqXE33e2zh3zHkl2CFoHov8taITRsyxpGmr5HSg3lZ948FPhSddI57hjdmK7U3YCrtj68XGBihnvIFIF28Iq8bv2+uA1bPGlAVbX3x+aJc67R0n5bXA7pQzSPF5yQRhQhO0X1Y/3iR13DNTX+2Yqblt/dC2kdzVXgaAzcDQWOfSp7sajP8yEccoaQCBcdQ1z4x8eiURuzlQ4juGX9o98+iRx3ma89W/Rxh+XkM0D+CBeiB+OckuHydY9hXkUTA/0uVSSDU8Fb0oHgJfTlA9PlbAr95R6cGNj9V9dyasAmWA99/kVIvQiOsIWFiC5kkuCeCF+iCc/FM7WPeggb6xT23BGB2CPfJLyYsaFi4yY5v2M8U2Ahg6vJmEYz/tmMM8E9C5e0EhH8OSkA8tFVBmzSuhgJGMEj2/AqV5MtpwJRkYHIALhK/FQ5vuZUnQpHO3Gh/zy9seSTVeivd+JKtlRLtHj62yIJ8OQXcQb94KQDpIuMsZpJGw5LcSMBi6VvDbtEwwCaWRZNGr+kAGUaSG09UW+Kg2xlnVfyrSlcD8C8UW8EX/u555djqSLidGO2T3oUuypbDmtA6DJJ3hjXeQSvuyzkeJRPwz6sd9ghkFtxLQ8Z1/wsnvCQHPgQe41AVsXoZNcpUO2TDadDl9axQxVhC5j3ENtyUiM/UiseJtfPAzS03KcThg6LC0DcALiYZvPtLd5BCZ00uKBZiIKsmWy6Ymh8av0yiklLTLB81BqXfuiijd4goujol5srMrzlK72F0ZKxCPxyfnrgK2T0M3ClLgIqWSw6SMcAA1SQc/hJUWAUJAko8zHYbe+MHI6Vunp0h1+BRH3eCLEJ/HKepyAVPeOA2b2g2yabHsyrCMcAEaoUdu/ZnJEHtdqR3d9+D95YDkShU1wRfAx/anvSG4KEoJPhGERfDydIhck/TwTaa8LD2BQo6OFOPLMKpfHaxK2PeHZIxwAejPZVv+Bbc0E9MwuaHgvDWZhBquk4BC/xDPXQnHW0XS2fYQDQFWLpwNQIiassUe4Cp4mtNDYfq74SgkX8cx2AhHpKOkqwyOdbU9wAC2bB7HII88lvzFbZD3Xpb7sKa1K/IbxlxOG6pg7JJtn8M1xKrG9dBh0NffSFfFJ2LZt4ylZTHAAorrqwpR7vH5aFtvqf8gI/R941+N4EVbaaIhv4p1lKRnr6mQbn+gAhOLpALBTzUFz/1Mchd08EP1i2c7n91ogWE/A5t9rHJPyt3U1vrvSpDscLifa+AQHgFVaWDoAJcUT2xpPY7cOG61tF1DipxzEWq4YiH9uawySrpLOcpTJZBsfdwBLevZUYsBQHUfQlqVYVv9niROxg2yZLOPFUTEIE/i35cAMH1edJRuP23qcsHEHUFl7aj2Cwsx4JDgfdbWv3swNFy3djdFputefgWBIDvZS6gywJCEkdPaj5DWjczhh6zakcQeAntUFjECOQ8Fa/8+LVav4jbHGuv3oiDpiZNU4cP3DNQZsOcT3UXAtz2kzgs7aujttRPcjpNp6igOQ57oPxUmOaqOTWG7GSex0c72beeq8pmXgen47EPHTXWJRisO2Pu4AMISRpQOIYivqaUXvcgQjFPou3jq+37HHZdqKmh3Jg+RS1EyyTJyj7saLcNjWbQewpKcniE9ZZ2VZvqJHx0orB55tqHi96BllkYE9r1qKr2TxiI7qFgOQS6Z5725BSM2HdJd0ODWMxW/Yum3zAGM7gKqqxjPRLuC39LcSPcAIDvkc9i69HLniQ5FnSEiHST6eATgyY2xYZevwkXc8DCGeyOYJgu0AVECwrP4LZfGq/q9dG8BklJUeyk5nPQ0Dtnwgp2miuXebmw4nSp60edsBYJ712e4x4jwnM8bLATTPuWKFnurrXH6exMSUYVtOnmR+ZKbcdDiJMGnztgMwhPwvyRuMzu+sX1i5mxEeETDE33LCo7GkZ4CTnBI6/E56pN6FYqHQMyj3eBNAqdneQcmQs1KvZrjjSXBL7wdHoT33BU8y15lmxwDkZMsru6eKF5uZLscLqubQ2XYA+DI4G79ZHej528kJkDRqr0T1v4oTJo0lAwOQky2vDLfdDuamy/Hyy9l0NhZtfasK31Az7hxCkbw4pFDMHIDBc6EUL4TjgzzRxmUjL266TOIjmyfbN2rDM0/nKM+YJTk5ADSZxBKOPGlM6RlIyAtfvLw/mOnyOCFk+0ZABey2wHgokx/SMtk4gObesXOgSScyoUbDcMAAyYvk5iBq0aNw0uXUwpLtow/AOjk1kMNvtJkOdS6sfpsDFsJgBGUTFywah3MGuMiNdJl02jlyt2JaJxvSkMe7lZ3TfKRi1v6XcqlT7DoeHwYwKIiP3JTaxYeZOBKyfdQAxAncgGF+N5vqP3EDPHqpb25K4gAPL7nJ/+cAsttRTjCE4lcDEIy85ZKeg8egPTnTbcno/PJngORG8ss/pfxTwKQAVoPa7BLB9lEDUOxqAFKqD/KnvDApVNfOmFeYlHQqXjDARX54077vRfmnzlOdgDUCBbs+AHzCGZwauHt3sZuKdgDu0V3wnLjIj5NOJ0km2zcAjN969pbBxgFgnoR2AEmN8eGZjfwY6XSKGI+lPgB26wBgFyA2DgDDf+150ymk6Z9+YoCJ/FjpdEJ+6CStpK8A/BxAjE8TAPyw6yPxk/0xwMpCfoqXTifFUoEaEr+lwI2ANZRE6PlZilrPMWgAuTPARH6sdDrJJmyfOgHZ7QVgmRabJgA6kbQDSCqMD89c5MdJp5NiJNtHHwC/JoBpmGwcAOZNaQeQ1BhfnnnIj5dOJwQJ26c+AHY1gH1vvsXGAWDapHYAvjT8OGgu8uOk0yniRA1AH1MzoPQiIFMTxPyult+UAiIHEJkyhgc3Z51+Gqe37rAHFOgsC8cAC/kx0+kkuxH6CjCWvOJyDlkhNg4A0zj5fJHgIiA/4WAyqpSTTo+LD7ZvQMHZ1QCMkMHGAWCuBJv+iHHB6R+OGcAGnSwcOC+djtNHtk9fAdjVAKTFxwGgE0k7AMfmxi8iF/lx0ulxKcH2WfYBxAKMet6VdgDjCuPHH0zkx0qnD8sxgoFAavTwNY9f0uLx7TbBBsNpnDzk5BMULOTHTKdt0ZHtUw3gIDdBSmXx6QNQgt1STtzkxRoPE/mx0unDAjtInYAfHL7m8UsaooYHEiyZymx/Ai68+AUHF/lx0umk7GD776MGIFlUkZKg6GwJyWIGF2FBJxKr9QkJkz6cM8BFfpx0+jB78gOMA+Cz/FYSmCElmzn4w4OHtANICsaHZy7y46TT42KE7VMfALsaAL7dslmFZ1PTsR+hqrR/nDT9wzcMkNxIfhwAc9LpFD7eN5TFrwaAejebGgCRhd7S3hTS9E+fMMBKbsx0mkRIto8agPEuN3linvKMlt7hU7nggvfeyAWLxuGcAS5yI10mnXaO3K2YxrtGTMb2uJVdNvkoI8SmGWBFVU822HVcHgxwkRsnXU6VDNm+MRjZ/2ZqIJffAYNPP0DXwopX0Z48wIUbjWN6BkheJLfpYxY/BiddTi0t2b6xrfG0ESybtC/1BoffWLGUTQ0AfGBRV7GJAy8agzMGEvKCH/D+YKbLNiFk82T79BUAh9prnxj9hzYTJweADhOrkxE9Gso0DHCSFzddjlMXt/mEA5B7puHT/dtSnuN+pplzVNbgk5g5OZI5hr7DhgHIyZYXF0DMdDlOS9zmbQeA+u2fuXCVguOUZb2jc1OuPf3ZufD4T/A98A+egtCZO2MAcrLl5Sx2UWMldPiUomaSQ+JJm487AMt6LYc0iv5IKGAsLXomWWQQs8Rvs4iuo3rEACc5cdPhpEjQRLJt3nYAMiZeSd5gdZa8HEDXnnXdaAa8x4ojDWYiA5CPLaeJod5dMdPhJBFJm7cdwMjI1l3oLmW3MhCq3E0AjD4UJsc118QwuGQNEzQaRhoGbPlATmlueREkEzrsRd4Z8yRbJ5unCLYD2NTUFBVKvZHxCY9uwPJPXN439lmPsk+brTkW+SlLZ5kWbXkFklxIPlxK3do/djbpMBc84zhg67bNI8B2APEbkmUzICjl0nHgDH6sv2jGO2gGPMQAioYwmQHIxZbP5HDPriXVYBkeh2193AEooVg6ALQAWDkAkqZlmj/EQIooQ8mWLSSSB8mFFwH8dJf4SbX1FAcgtvMiL45GSnmxWLVqHCcHjF2LqvYCxyMcsGgM4ww8kpDLeICnP6Cztu56CiJ95mgqjdv6uGGNDr7dj+js9ggApmOa2+5cnL4oHobGoqvx1jE9RKCzTjBgywHy4ERIQmeP4YQpgSWSsHX7ctwBbGqag9WB1QBDwMIw5EpuuDoWVKIXVT3ADVd54lEPxOXBp/QcdTbOjhqI23r8atwB0KWlxAvxYF7/Y2LHVYu2vlXFC5XAgIADP0CD6i/ccJUVHvBvy4FRoUlXSWcZQRqHMtnGJzgAdLixdAD4llp7bGjm5eOlYPJjoP6UYUuIf2ACpyxhEP8kB06Ft3WV7bbyE218ogMYHuHpAEi6hsGuGUCwOuuDT2EMRQf91ofLDIB3m3+Xs502O6a6auOeZOMTHEDn4toDUGaW8wKkkstaXxyaNS35HkQwLfO/oyPqQw+yLtssiW/inRsBpKOkq9xw2Xhg27aNp4Cb4AAoHMTynPcuRUAYFdenYGfz89kLqt9CM+XL+LyCf/ooNgM2z+Db5r3YmWWbPuko6SrDI51tH+EAsJECTwcAQoGNZTOAZN1RF3xGKvVjhnIvOUjEM/HNsWCcdTSdbR/hAPaJHVtA7BBHcuECzmsbiNTxxCawrtqOOzAZRS8hXkQBEb/EcxGzyDnpuG7K83JOoLgPDiVse0IuRziAgfp6EyRvmBCL04WSt3OCk4qFuIuI6LVoCLyXGq5/F4gB8Er8Es8FSrGwyTDWTbLpdLwd4QBsRpRi2wxAO+CKtm1jZxVWcoVL7bn6qr9gsYVmtLc+KVyqOiXik3glfjmyYeskdJMjNhtTBptO6wDMMfNpxh1ahgoHWFYBk8LvuCD8MnaluRwc8ltjIQnSR2fikfgkXrnCTuhkWnvyGjPZMtl0OhxpAdOUSnS0UF8Az0OJLy3fPjKHJ7g4qvb6UA+2Ob4BVxiroo88GLCIR5vPPBIp5qO2LkIni5lHPmmTLWeaJp3WAVBmWDTw8XwyLeaz6M0MhoIhtn0BybJ3NASfFJZ1E661E0iSkt0Zxm/dZPOY3XOuxiZdJJ10NdMsMpvKljM6gDEz8gTy4Ky4Ny7dOvypLHjwJGp7Q/hXyhLX6OZAdvQTX8Qb8Zfdk+7GTujgje7mmlVuVsKW0z6U0QFsWFjzHnoOn0/7FI/AcFUodCsPKFOjoDcYqmEtumNwap6Sd4kn4ov7m5/wJnQwnMTO7Uw2TLacCVdGB2A/oPg2A2x8Ut7kh1oAYY33CVgX60+EtuQy/0efUC3rYs5t/iR4W/egg8lrludpbHhKBxAzR34Hb4x1ApgeUlRXhcM/YYruCFjUiz0mzAvglfVgoSPYoWHoqpf44dzbnwrb1j3oYGoYp99ku2TDU2Ga0gF0Nx5NE1zWTZWA5/ekuLql31zuOQ6HAOg79ntix2Jo+wP0ecbhYyUdzeYBfBAvXL/zTxaArXPQvcnhzK7XJWw4I6wpHQA9ZSn1i4xPM7lhSPGvLR27K5jAmRYGjchCFZf6Lz4PL13WswgT5f888ZFupNq0ZHoQgXSNdM6DrLPK0ontTusAuhpCm/Ci2p1Vzq5HlnPFzNm3uZ5tnhnShJaoFZmP2kB5rieAclP5uU7sySheW9egc6wPtTtuu1ODnNYB0OOWJX45dTLe3zWEvIP74KB0LNGUVrz92rCVzRVoEPwlXZySC0M5qbxUbpZTeqcgnHSMdG2KKCxuObVZRw4gFhn9NapqJouSZQIhRVUwEPx5ptvcw7vqgr/fJ/afhdoA7TnAm+scybTLhfJROam8OSbj6WO2jkHXPAUxTebEM9nsNNHs29i5yNnROhBdg8h/6yy2d7EweORyfD/29TberdtHzxSB4J1g8XrOI8ycShkKSZuoPCKwdDe31XudloHitfRHL0fbn73jQqfqb9GscrR2hmMHsGJ75Lxg0GA7GWNckPiOrKzR+R0X1OwbD/Ppj+ZtI7ONUOi7WGHmKxCUbzo5k3RDEcfQrHmIduxhtWlHEmAWZ3upL6PyZcjipCwe8yRqNGrN714Q3uEkc0dNAEoonqB6zkminsYhARkVj3DbTSgXTshoOuqD/8McGTtDWeo+3wwisp2wuo9wE36/G7+tS6RTPjB+dNg/59T4SScd1wAocvOAuSIgZBf95n7AYO7uaAit4o4zK3xr1waa51yxImCgKabEFyA9Pm1RJUaA5w8xS/y2a8+6bsFni+6sKE4XubXPXCUNeVe6e9zCYkI1d9WFup3iysoBUKKt/eYr2PPsHKcZeBgPHaFqWWddaKOHGIqWdUvvB0dJo/ZKaRgtSoolEKTr21Cjin8AG2BswkIdncoafLJz4fEltwhKy4C5FL3+6yFIx7Xlogl9moQxkvLVjvrQudNEm3A7awfQ0hdZaRjGbyakwvQCnU/7xqKj86eaDMEUerawZHPv2DlGUDbBOS9VQi6EYGdmm8h08WHw+7EwRy8UbaMVVT1dCytexTMILs3jkt6hkyqClS+jI3aWH0oIR7yyoyH822ywZu0ABKqhrWd88f9C0c7MJiPv4qoN7U+vXo52HOepzQWnZ0nPwWOqa2fMgxOchzfYPFTPSV4n4FyLsFq0/mqh2LUw3yqEjSBsELY8iLBBhOG3eB/nXahF7UTYzuHBQzs3NR37UcGBck0Qu/u2XXbns+DpEq4QU3HBKe/q+PPv/2u2Ta/sHQBybe0b+5I0Ao+kAmD9W6m7MOjk+6wxanCsGGjrN7+H9SfvZgVqCjDKil3f0VDx6BRR0t7KqV3T0X7P4xiw8nraFBkGKilXNfeNXccQmobEkAHSFdIZhtDSQ4It2jaZ/u6UoTnVACjF1r4oOqAErRrkiwNVXBNOqw1fBqhDRx+agbQMoMd/Gd787Wj2hNJGYBiIwW9X5bp4Ss4OADxIfBH4T/QFzGfISSZIQypqNXUsCPdniqDDy5eB1u2Rehk0esBAjV9YQNv/ZfT8/w3w5tQZm1MTIEGOQpZ+m4FXI4JGhz3U1i8S1jhdYcDWCegGMvON8dvExG0wJ+On5/NxAIKq0/ACT9tAfPIfqjwnimCwe0X/oZN9AlnDLDIDti5AJ2zdKHJehUyebC/fJm1eDoAKY5qxW3CKFLJgxU4Lgp4dEOFu+lRW7Lx0+rwZIB0gXSCd4I30CHSRhO0dcSObgLwdwPqFlbux8sjPssmUQ1z0XZxTfVRNu3YCHKThDQZ7rAR0gHTBGwS550o2R7aXewrxJ/N2AHYy0U9+gEbI/nzBuP28FLKxurZms24OuM289/mRzEn2pAPeo8kOgW1rsLnsnkofuyAOwB4DHrNuT58F71Dy/gFZsVV3DPKWUyHRkaxJ5n5889s8wNYKNe8CTZ/CHfgsuBGkNhUuRfdSglc9IKJWq/5E6B7nXuREn/roSxAU3/XJU4UoLz779eCz39JCpEVpFKQGkAQTi8RuwqfBkeS1n86kEPQN2B4I4ifgGqtjBki2JGO/Gj/Zlm1jjks8fcSCOoDuxso/oXNi1fTZso1RQ6PA9LBhtvLJGZgtU8gWCfjrO39Kicm2yMZSgvL+WVAHQGhGhrb8GNWUl/JG5lECNATUwEQnezIIZoR5BENnWygGaFYfJvaQTP00vHdy8cmmyLYmh+d7jdpQ4Q+sGXC+lMZ2PxMeZ0VtGDXHbiiD9QQKrwQMUqT5/JWhiof9MqU3E2U0j0Upa0FnQ7jgL9aivOEIqJKW34YJp+FfXkILQtCqMGlu6iDGDJDMSHZ+N36imGypGMZPaRfFAVDCnXXhn6La4uvluakcqMXMoiWhaF24UlholMpU0geq/CQrkhnJzu9lJRsiWypWOYrSBEiCbfvjR8eq6pqXkMnpyTA/nyGMHmGNXV8KS477WQ6ZsNPS3bQitF8/RU8uFz5NvymHh85v/9wxByffK9R1UR0AgWztjyxAReOP/u8PSFBOS14r8Q2/bz5SKAXikg7Wp/gCdOzfsLwZ+3X7nXBmr18hrM911Ie3O4mfa5yiOwAChgFC34ZXfiBXkByfQ22gPRqLfvPZBVV7OOIrF0y0Vx9t1wX9aiulMkO/bsGAn4L3+k/myBUHQJm2Dpj/gXHXl00G4OtrDMzAlMx/Ufv33tfZOnfM12XxGXjaolvOnP0d6NT/xFufz/4IBeDRnuZbF/p8AZKaNomidQJOzjk2NnwjRjL9ZXK4r6+heHjz/MA4afarLf3mcl+XxUfgiWvinLgvNeMnG7FtxSV5uFYDoPI0bzcXGQG5GW21oEvlczcbJX43EoncvLGx+q/uZlweuS3dOvypqnD4JzD6q0uxxGj3R62YWty1ILTNrfK56gCoUGgKULXtR24V0PV8lBjG4qMPjpjm/doRFIZ92/BDoVvxTfYmGH91YVLllwqq/rd11IXucxOZ6w4AhZNwAk/ACVzhZkE9yCuCzzgPRaPmD3VHYW7sUwdfKBiiaeY34i+cWyr+eArGvw7GfxXQQm3cO7xwAGJJz57K6qNOxTJMcrF7RfUmJ6rW4a31qIzE7mlfVPGGNyj8lWvbtrGzVDhwB0zhSyXbXEwRCYx/8/Anb6/Y1DRnNCXYlZ+eOAAq2aX9Hx4dlrW0IktWmxm6wkpxMsEuW2qdkOre9rrwQHGy8HeqbQOROox7vR1VfaodutZB7SVrMP5XImpw8XP1x33sBQ7PHAAVlpZlsldmEWK2F4X3Lk+1AzWDNRhV+Ei5jypMjN67Hm/6lWgdnuedTNzPGXX9vTE11thdP+Nd93OP5+ipAyAIy3pH54ZCwRcAxJcrtOQlOCViSqr1wrLWHDT3P7Wt8TRfLqaSLQeLtr5VdWxo5uXCMFZKJbETjwhkm4bf48P4D5hm9MJCLOyZDxeeOwAC78cdWfIhPe2z2JFXSfGEZak1Xe2rN5fcbsaYpNPcdudiw5AwenEVjL42LQ/lEchmhyoWDoBk3tZnXioMe8WWku7tdajfH2Eo6PPoEN4YVWrjsw0Vr+M5V3uHHeKcKppc3jf22aCUS1G1X4pBOxcjst6HgfbQsFRbe0PouanIc+seGwdABaZlm+yVW6AxbhHgh3yougjz7xHK2mjGrI1eVxszcWY35wLGUiHpTzRBiOXXrMtEDsIhR2VhG++uhorHpojm6i12htbWH/kmFMh3G424KjUh3sEXhVehUDulUDtjltwpLXNn58Lqt93A0dI7fKoyQvMChpqnhJwHJZqHnvtzkPcpbuTv2zyU9a32+vDPOeFn5wCIHAwUugufB1dxIsoPWOAQDkmldsIo8ad2G0K9j36FQWEZ6F9QgyomBo2ANWSZ1qBpmIP73nxrkMo16/TTakNWqNYIGbVWzKiRAVGLzrlaYVg4i1pLyBMgj7lwNvOUtA1+hh/4YIVRqbva60PfZ4UJYFg6ACKJagJKGv8LANli5CZMjYcfA1Ttl8r6B25v/iRTrI2L+gQCRuA3AKs7BpMS02c/MRCJWbEvc2rzTyaPtQMgsImvA7/HT9+u5z6ZdH1dFgwMobf/i1x6+zMxzt4BEHC/b+eUiXwdXpoMoNrvm23mfOEASE0SIwafBeDZpak2ulSlwACMfy9G+C3n+ql2Mse+mXBBhNK4aZo8MbkQ+lozwIEB0k3SUb8YP3HmGwdAYGnSBM2cAtGb6VofmgEuDJBOkm56ObEnFy585QCogDRtkuZOg/B1uRRYP6MZKDQDpIukk15N6c2nPL7pA0hTSNnSh+XFpFxdDotGpCm/DvKYAVrsBXM27uxssJfxQvPff4efHYDNNi00GgjIxzBc6NP+o18j9i0DtHpvTF3n5gKexeDKd02AySSQAKKRQ+ejGvb05Hv6WjNQDAZI10jn/G78xI3vawApApZYL/7bGLN+D5oEoZRw/VMzUBAGUOU3Yfx3dMZ37PFllX8yEaXkAOyy2XsRSuNxFOz0yYXV15qBXBmAtb+JybzXFnuvvlzx5fqc75sAkwtOAqIdVdE54/utySeXTV97wwDpEulUqRk/sVlyNYBUFWnti9yMtQV+qJsEqazo304ZoCo/3vrf7WjAbkQlepS0AyCZtfRFzsenwl/h7/wSlaEuVhEYwFv/Jfx9tbMh/FIRkmeTZMk1ASYzSwIcHtxyARbb/C7WZCqLVXcnc6Cvs2AAOkK6QjpT6sZPrJR8DSBV9Cu2jn4mEA48iNpAU2q4/q0ZIAbwxu+JRWI3dTdW/qlcGCkrB5AUKpoFfycN4x4UfmYyTJ/LlwH08O8XMev2jgvCD5UbCyXfBEgnUFTt/l2ZH8+1lLof9yPp4uiwsmAgQjpAulCOxk8SLssaQKpqx9cZCDyAAUSXpYbr36XNAI3mM83YLX6aulsMiZS9A0iS2tpn0hZVP0L/wPxkmD6XHgNo57+MzuDbOhpC60uvdNmXSDuAiZzJ1r7oFVKqu7HO/Wcn3tJXvmZAqdeVknd1NARpGjma/fogBsqyD2AK0SsoyJPtz6w+V2EHF7wtdk0RV9/yAQMkQ5IlyZRkC8ja+FPkpmsAKWQc8XPt2kDLnMtvMKT8DmoEZx9xXwfwZUCp19DBd1/nnqceFtdcE+ML1Ftk2gE45L95wFyBPaxvRb/ppQ4f0dE8YUA9B2u/v6su1O1J9j7LVDuALAW2YnvkvEDQuAUVyev0HIMsyStSdHvMvhSPxaLWA90LwjuKlE1JJqsdQI5ivaR36KRwoOLLhiG+hlrB3ByT0Y/lxYDabVnil5HY2G82LKx5L6+kyvRh7QAKIPjmPnMJ+gm+js+IV4LQigIkqZPIwAB68MZQ+3oS7ftfdDWENmWIpoMdMqAdgEOinERbsfXj4wLhqmtQI7gG4wkuxjP6K4sT4qaPA3tXz6MDf20sMrK2u/HoD6d/RMdwwoB2AE5YyiFO64tDs0QgfCW22b4WW2pfBKI111nwiDc9dtVVW/Df4yIWebLjgpp9WTyuozpkQCulQ6LyibZsy6FTQhWhy/ApsQU1g0uQlt7oND2hQ3jTb8C0vE5zzHx6/UUz3kkfTYcWigHtAArFpMN0Prv29fDsM868ED3XcAaipezHF+B7PbjoBBed+8SOLQP19aZDKnW0AjCgHUABSMwniZbNgyeK6qoLUeO90JACZ1mH9ML5pMn4Wcy8VAOWEi+gnC+I4ZEXOhfXHmCMt+ShaQfATMRLevZUVtaeWg/BLMAMxXNhMOeilnAWrn31dSHeW6/egKG/gpl3+BPbRwff7t/UNGeUGeVlDUc7AB+If0lPT7CqqvFMFRDnYiGTs9GxeAYcwxwY12xUnWd5WQRU39E5p/YCyx502P1ZWdZrMiZeGRnZumtTU1PUS2w67+kZ0A5geo5Yx1i09a2q2vDM0wMqAIdgnSwNeTwAn4A+dJzVCRAwXR+rhKzEuQLfIsIIC+NbOtUokk2NCMLH8JaOIJwWSBmTQtGb+iDCPoBxvy+kwlm8ryw6G+/GZGzPYGT/m9saT9PrLIIYvx7/H1IyCcsl4M1WAAAAAElFTkSuQmCC"),
  18844. pathStart: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")
  18845. };
  18846. n.prototype.setScene = function(e) {
  18847. this.createCpm(e),
  18848. this.createBunnyObj(e)
  18849. }
  18850. ,
  18851. n.prototype.updateModel = function() {
  18852. this.model = this.modelManager.getActiveModel()
  18853. }
  18854. ,
  18855. n.prototype.bindEvents = function() {
  18856. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  18857. }
  18858. ,
  18859. n.prototype.updateDefaultsFromModelData = function() {
  18860. this.model.data
  18861. }
  18862. ,
  18863. n.prototype.pointPathDistance = function(e) {
  18864. for (var t = 0, i = 1; i < e.length; i += 1)
  18865. t += e[i - 1].distanceTo(e[i]);
  18866. return t
  18867. }
  18868. ,
  18869. n.prototype.pointPathLengths = function(e) {
  18870. for (var t = [0], i = 1; i < e.length; i += 1)
  18871. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18872. return t
  18873. }
  18874. ,
  18875. n.prototype.interpAlongPath = function(e, t, i) {
  18876. var n, o = new r.Vector3, a = t[t.length - 1];
  18877. if (i < 1) {
  18878. n = i * a;
  18879. for (var s = 1; s < t.length; s += 1)
  18880. if (t[s] > n) {
  18881. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  18882. return o.copy(e[s]),
  18883. o.sub(e[s - 1]),
  18884. o.multiplyScalar(l),
  18885. o.add(e[s - 1]),
  18886. o
  18887. }
  18888. } else
  18889. o.copy(e[e.length - 1]);
  18890. return o
  18891. }
  18892. ,
  18893. n.prototype.pathHeight = function() {
  18894. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  18895. }
  18896. ,
  18897. n.prototype.createBunnyObj = function(e) {
  18898. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  18899. this.bunnyObj.visible = c.warp.showBunny),
  18900. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18901. e.add(this.bunnyObj)
  18902. }
  18903. ,
  18904. n.prototype.createCpm = function(e) {
  18905. if (!this.currentPanoMarker) {
  18906. var t = this.makeWaypointObj(w.pathEnd, "Current");
  18907. t.material.uniforms.opacity.value = 0,
  18908. this.currentPanoMarker = {
  18909. mesh: t,
  18910. placed: !1
  18911. }
  18912. }
  18913. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18914. this.placeCpm(),
  18915. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18916. }
  18917. ,
  18918. n.prototype.placeCpm = function() {
  18919. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18920. var e = this.player.currentPano.floor;
  18921. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18922. e.add(this.currentPanoMarker.mesh)),
  18923. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18924. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18925. this.currentPanoMarker.placed = !0
  18926. } else
  18927. this.popOutCpm()
  18928. }
  18929. ,
  18930. n.prototype.fadeInCpm = function(e) {
  18931. this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  18932. }
  18933. ,
  18934. n.prototype.fadeOutCpm = function(e) {
  18935. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18936. }
  18937. ,
  18938. n.prototype.popInCpm = function() {
  18939. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18940. }
  18941. ,
  18942. n.prototype.popOutCpm = function() {
  18943. this.fadeOutCpm(2)
  18944. }
  18945. ,
  18946. n.prototype.brushPrefs = {
  18947. linewidth: 7,
  18948. strokeWidth: 15,
  18949. cvSegments: 48,
  18950. paveStep: .1,
  18951. paveWidth: .2,
  18952. lookBlendDist: 3,
  18953. maxTurn: r.Math.degToRad(2)
  18954. },
  18955. n.prototype.panoPathDistance = function(e) {
  18956. var t = this.model.panos;
  18957. if (!e || e.length < 2)
  18958. return 0;
  18959. for (var i = [], n = 0; n < e.length; n += 1)
  18960. i.push(t.get(e[n]).floorPosition);
  18961. return this.pointPathDistance(i)
  18962. }
  18963. ,
  18964. n.prototype.loadTileTexture = function(e) {
  18965. var t = v.load(e, function(t) {
  18966. t.wrapS = r.RepeatWrapping,
  18967. t.wrapT = r.RepeatWrapping,
  18968. t.needsUpdate = !0,
  18969. y.debug('path texture "' + e + '" is ready')
  18970. }, function() {
  18971. y.error('path texture "' + e + '" failed')
  18972. });
  18973. return t.mapping = r.UVMapping,
  18974. t
  18975. }
  18976. ,
  18977. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18978. var a = {
  18979. cameraMode: n,
  18980. position: e,
  18981. quaternion: t,
  18982. panoId: i,
  18983. orthoZoom: o,
  18984. floorVisibility: r,
  18985. thumbUrl: null,
  18986. name: null
  18987. };
  18988. return new f(a)
  18989. }
  18990. ,
  18991. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18992. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18993. }
  18994. ,
  18995. n.prototype.setWarpDestination = function(e) {
  18996. this.warpDestHeroLoc = e
  18997. }
  18998. ,
  18999. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  19000. var t = this.getHeroDescriptorByHeroIndex(e);
  19001. return null !== t && (this.setWarpDestination(t),
  19002. !0)
  19003. }
  19004. ,
  19005. n.prototype.setWarpDestinationByPano = function(e, t) {
  19006. var i = this.model.panos.get(e.id);
  19007. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19008. }
  19009. ,
  19010. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  19011. var i = this.model.panos.get(e);
  19012. if (i) {
  19013. t = t || new r.Quaternion;
  19014. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19015. return this.setWarpDestination(n),
  19016. !0
  19017. }
  19018. return !1
  19019. }
  19020. ,
  19021. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19022. var t = this.model.heroCount();
  19023. if (null !== this.warpDestHeroLoc && t < 2)
  19024. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19025. this.model.getHeroDescriptorByIndex(0);
  19026. var i = this.model.getHeroDescriptorByIndex(e);
  19027. if (i) {
  19028. var n = i.isPano() ? i.panoId : i.cameraMode;
  19029. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19030. }
  19031. return i
  19032. }
  19033. ,
  19034. n.prototype.getHeroDescriptorByPano = function(e) {
  19035. var t = this.model.panos.get(e.id);
  19036. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19037. }
  19038. ,
  19039. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19040. var t = this.getHeroIndexFromPanoId(e);
  19041. return this.getHeroDescriptorByHeroIndex(t)
  19042. }
  19043. ,
  19044. n.prototype.getHeroIndexFromPanoId = function(e) {
  19045. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19046. var i = this.model.heroLocations[t]
  19047. , n = this.getHeroId(i);
  19048. if (n && n === e)
  19049. return t
  19050. }
  19051. return -1
  19052. }
  19053. ,
  19054. n.prototype.getHeroPano = function(e) {
  19055. if (null === e)
  19056. return y.warn("getHeroPano(): no destination"),
  19057. null;
  19058. var t = this.getHeroId(e)
  19059. , i = this.model.panos.get(t);
  19060. return void 0 === i && (i = null,
  19061. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19062. i
  19063. }
  19064. ,
  19065. n.prototype.getHeroId = function(e) {
  19066. return e.panoId
  19067. }
  19068. ,
  19069. n.prototype.setWarpDestPano = function() {
  19070. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19071. this.warpDestPano
  19072. }
  19073. ,
  19074. n.prototype.brushToWarpPano = function(e, t) {
  19075. if (this.discardPathObject(),
  19076. !this.setWarpDestPano())
  19077. return !1;
  19078. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19079. !this.warpDestPano)
  19080. return y.info("No brush"),
  19081. !1;
  19082. if (!this.player.currentPano)
  19083. return y.debug("No current pano, visibility undefined"),
  19084. !1;
  19085. if (!this.warpDestPano)
  19086. return y.info("No wPano, visibility undefined"),
  19087. !1;
  19088. if (!this.warpDestPano.isAligned())
  19089. return y.debug("Cannot brush to unaligned pano"),
  19090. !1;
  19091. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  19092. , n = !0;
  19093. if (this.player.currentPano.id === this.warpDestPano.id)
  19094. y.debug("Already at destination pano");
  19095. else {
  19096. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19097. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19098. this.obj3d = new r.Object3D,
  19099. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19100. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  19101. e = t) : (this.setPathHulls(this.nodes),
  19102. this.setFloorCurves(),
  19103. i && ("chevron" === c.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === c.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  19104. this.player.currentPano.floor.add(this.obj3d);
  19105. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  19106. , s = e === l.STD;
  19107. if (!n && (i || s)) {
  19108. if (o) {
  19109. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19110. this.obj3d.add(h)
  19111. }
  19112. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19113. this.obj3d.add(u)
  19114. }
  19115. this.appearSlow()
  19116. }
  19117. return this.upcomingTransType = e,
  19118. !n
  19119. }
  19120. ,
  19121. n.prototype.findShortestPath = function(e, t) {
  19122. if (!e || !t)
  19123. return null;
  19124. var i = c.warp.walkExtraPanosDistance
  19125. , n = e.id + ":" + t.id + ":" + i;
  19126. if (this.shortPaths.hasOwnProperty(n))
  19127. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19128. var r = t.id + ":" + e.id + ":" + i;
  19129. if (this.shortPaths.hasOwnProperty(r))
  19130. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19131. var o = this.model.panos.aStarSearch(e, t);
  19132. return this.model.panos.includeNodesNearPath(o, i),
  19133. this.shortPaths[n] = o ? o.slice() : null,
  19134. o
  19135. }
  19136. ,
  19137. n.prototype.makePathHulls = function(e) {
  19138. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  19139. t = u.get(e[0]),
  19140. r = t.floor.floorIndex;
  19141. for (var d = 0; d < e.length; d += 1)
  19142. t = u.get(e[d]),
  19143. i = t.floorPosition.clone().sub(this.model.position),
  19144. i.y += this.pathHeight(),
  19145. s.push(i),
  19146. l.push(t.position.clone()),
  19147. n = t.floor.floorIndex,
  19148. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  19149. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  19150. o > a && (a = o));
  19151. return a > this.longestStep && (this.longestStep = a,
  19152. y.debug("path contains " + a + " meter segment")),
  19153. {
  19154. floor: s,
  19155. camera: l,
  19156. color: h
  19157. }
  19158. }
  19159. ,
  19160. n.prototype.makeFloorCurves = function(e, t, i) {
  19161. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19162. , o = this.pointPathDistance(e) - 2 * n
  19163. , s = e.slice(0)
  19164. , l = s[1].clone().sub(s[0]);
  19165. l.y = 0,
  19166. l.normalize().multiplyScalar(n),
  19167. s[0] = (new r.Vector3).copy(s[0]).add(l),
  19168. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  19169. l.y = 0,
  19170. l.normalize().multiplyScalar(n),
  19171. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  19172. var h = new r.CatmullRomCurve3(s)
  19173. , u = Math.floor(o / i);
  19174. u = 4 * Math.floor(u / 4),
  19175. u = Math.max(4, u);
  19176. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  19177. f = 0,
  19178. d = g[A].distanceTo(e[0]);
  19179. for (var y = 1; y < e.length; y += 1)
  19180. v.copy(g[A]).sub(e[y]),
  19181. v.y *= 4,
  19182. p = v.length(),
  19183. p < d && (f = y);
  19184. m.push(t[f])
  19185. }
  19186. return {
  19187. distance: o,
  19188. points: g,
  19189. colors: m
  19190. }
  19191. }
  19192. ,
  19193. n.prototype.makeCameraCurvePoints = function(e, t) {
  19194. var i = this.pointPathDistance(e)
  19195. , n = new r.CatmullRomCurve3(e);
  19196. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19197. }
  19198. ,
  19199. n.prototype.makeCameraCurveTangents = function(e, t) {
  19200. var i = this.pointPathDistance(e)
  19201. , n = new r.CatmullRomCurve3(e)
  19202. , o = Math.max(2, Math.floor(i / t));
  19203. o || (o = 5);
  19204. for (var a = [], s = 0; s <= o; s++)
  19205. a.push(n.getTangentAt(s / o));
  19206. return a
  19207. }
  19208. ,
  19209. n.prototype.setPathHulls = function(e) {
  19210. var t = this.makePathHulls(e);
  19211. this.floorHull = t.floor,
  19212. this.cameraHull = t.camera,
  19213. this.colorHull = t.color
  19214. }
  19215. ,
  19216. n.prototype.setFloorCurves = function() {
  19217. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19218. this.floorPathDistance = e.distance,
  19219. this.floorCurvePoints = e.points,
  19220. this.floorCurveColors = e.colors
  19221. }
  19222. ,
  19223. n.prototype.setCameraCurvePoints = function() {
  19224. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  19225. }
  19226. ,
  19227. n.prototype.chooseWarpPath = function(e) {
  19228. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  19229. if (this.player.currentPano === this.warpDestPano || !e)
  19230. return this.warpPathPoints = null,
  19231. this.warpLength = 0,
  19232. !1;
  19233. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19234. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  19235. t = this.warpDestPano.position.clone().sub(o.position),
  19236. i = t.clone().negate(),
  19237. t.multiplyScalar(.15).add(o.position),
  19238. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19239. t.y = o.position.y,
  19240. i.y = this.warpDestPano.position.y,
  19241. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  19242. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19243. this.setCameraCurvePoints(),
  19244. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19245. this.warpLength = 0,
  19246. this.warpPathLengths = [0];
  19247. for (var s = new r.Vector3, l = new r.Vector3, h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)), u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)), d = 1; d < this.warpPathPoints.length; d += 1) {
  19248. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  19249. var p = s.length();
  19250. s.y *= c.warp.climbEffort;
  19251. var f = s.length() / p;
  19252. if (d > 1) {
  19253. s.setY(0).normalize(),
  19254. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  19255. var g = Math.min(1, s.dot(l))
  19256. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  19257. f = Math.max(m, f)
  19258. }
  19259. this.warpLength += p * f,
  19260. this.warpPathLengths[d] = this.warpLength
  19261. }
  19262. return !0
  19263. }
  19264. ,
  19265. n.prototype.drawPathRibbon = function(e, t) {
  19266. this.bunnyObj.visible = c.warp.showBunny;
  19267. for (var i = .6 * c.path.ribbonWidth * .5, n = new r.Vector3, o = new r.Vector3(0,this.pathHeight(),0), l = new r.Geometry, h = new r.Vector3, u = 0; u < e.length; u += 1) {
  19268. h.copy(e[u]),
  19269. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  19270. h.normalize(),
  19271. n.crossVectors(h, A.UP),
  19272. n.multiplyScalar(i);
  19273. var d = (new r.Vector3).copy(e[u]).add(o);
  19274. d.sub(n),
  19275. l.vertices.push(d),
  19276. d = (new r.Vector3).copy(e[u]).add(o),
  19277. d.add(n),
  19278. l.vertices.push(d)
  19279. }
  19280. var p, f = 0;
  19281. for (u = 0; u < e.length - 1; u += 1) {
  19282. var g = 2 * u
  19283. , v = f;
  19284. f += e[u + 1].distanceTo(e[u]);
  19285. var y = f
  19286. , C = t[u]
  19287. , I = t[u + 1];
  19288. p = new r.Face3(g,g + 1,g + 2),
  19289. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  19290. l.faces.push(p),
  19291. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  19292. p = new r.Face3(g + 2,g + 1,g + 3),
  19293. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  19294. l.faces.push(p),
  19295. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  19296. }
  19297. l.computeFaceNormals(),
  19298. l.computeVertexNormals();
  19299. var E, b;
  19300. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  19301. b.map.value = w.path,
  19302. b.opacity.value = 0,
  19303. b.color.value.set(c.path.color),
  19304. E = new r.RawShaderMaterial({
  19305. side: r.DoubleSide,
  19306. depthWrite: !1,
  19307. transparent: !0,
  19308. vertexShader: m.ribbon.vertexShader,
  19309. fragmentShader: m.ribbon.fragmentShader,
  19310. uniforms: b,
  19311. name: "ribbonT",
  19312. opacity: 0
  19313. })) : E = new r.MeshBasicMaterial({
  19314. color: 16777215,
  19315. side: r.DoubleSide,
  19316. name: "ribbonOut",
  19317. vertexColors: r.VertexColors
  19318. });
  19319. var _ = new r.Mesh(l,E);
  19320. return _.name = "ribbon",
  19321. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  19322. _
  19323. }
  19324. ,
  19325. n.prototype.drawPathPavement = function(e) {
  19326. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  19327. s.copy(e[l]),
  19328. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  19329. s.normalize(),
  19330. n.crossVectors(s, A.UP),
  19331. n.multiplyScalar(this.brushPrefs.paveWidth),
  19332. t = (new r.Vector3).copy(e[l]),
  19333. t.sub(n),
  19334. o.vertices.push(t),
  19335. o.vertices.push((new r.Vector3).copy(e[l])),
  19336. t = (new r.Vector3).copy(e[l]),
  19337. t.add(n),
  19338. o.vertices.push(t);
  19339. var h, u, d;
  19340. for (l = 0; l < e.length - 1; l += 1)
  19341. h = 3 * l + 1,
  19342. u = l * i,
  19343. d = u + i,
  19344. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  19345. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  19346. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  19347. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  19348. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  19349. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  19350. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  19351. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  19352. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  19353. color: c.path.color,
  19354. side: r.DoubleSide,
  19355. transparent: !0,
  19356. depthWrite: !1,
  19357. opacity: 0,
  19358. name: "paveT",
  19359. map: w.path
  19360. }) : new r.MeshBasicMaterial({
  19361. color: c.path.color,
  19362. side: r.DoubleSide,
  19363. transparent: !0,
  19364. depthWrite: !1,
  19365. opacity: 1,
  19366. name: "paveO",
  19367. map: w.path
  19368. });
  19369. return new r.Mesh(o,p)
  19370. }
  19371. ,
  19372. n.prototype.hintPrefs = {
  19373. rad: .18,
  19374. width: .0125,
  19375. depth: .0625,
  19376. setBack: -.04,
  19377. markRad: .25,
  19378. markInnerRad: .16
  19379. },
  19380. n.prototype.makeWaypointObj = function(e, t) {
  19381. var i = new r.Geometry
  19382. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19383. , o = this.pathHeight();
  19384. i.vertices.push(new r.Vector3(-n,o,n), new r.Vector3(-n,o,-n), new r.Vector3(n,o,-n), new r.Vector3(n,o,n)),
  19385. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  19386. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  19387. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  19388. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  19389. s.map.value = e,
  19390. s.opacity.value = 0,
  19391. s.color.value.set(c.path.color);
  19392. var l = {
  19393. side: r.DoubleSide,
  19394. depthWrite: !1,
  19395. transparent: !0,
  19396. vertexShader: m.waypoint.vertexShader,
  19397. fragmentShader: m.waypoint.fragmentShader,
  19398. uniforms: s,
  19399. name: "waypoint",
  19400. opacity: 0
  19401. };
  19402. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  19403. l.name = "wayPtOut");
  19404. var h = new r.RawShaderMaterial(l)
  19405. , u = new r.Mesh(i,h);
  19406. return u.name = t,
  19407. u
  19408. }
  19409. ,
  19410. n.prototype.makeStartMarker = function(e, t) {
  19411. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  19412. i.y = 0,
  19413. i.normalize();
  19414. var n = Math.acos(i.x)
  19415. , o = this.makeWaypointObj(w.pathStart, "Start");
  19416. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  19417. o.position.copy(e),
  19418. o
  19419. }
  19420. ,
  19421. n.prototype.makeEndMarker = function(e) {
  19422. var t = this.makeWaypointObj(w.pathEnd, "End")
  19423. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19424. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19425. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  19426. t.position.copy(e),
  19427. t
  19428. }
  19429. ,
  19430. n.prototype.pathClean = function(e) {
  19431. if (e) {
  19432. for (var t in e.children)
  19433. this.pathClean(e.children[t]);
  19434. e.geometry && e.geometry.dispose(),
  19435. e.material && e.material.dispose()
  19436. }
  19437. }
  19438. ,
  19439. n.prototype.discardPathObject = function() {
  19440. if (this.obj3d) {
  19441. var e = this.obj3d.parent;
  19442. e && e.remove(this.obj3d),
  19443. this.pathClean(this.obj3d)
  19444. }
  19445. this.obj3d = null,
  19446. this.popInCpm()
  19447. }
  19448. ,
  19449. n.prototype.discardSlow = function() {
  19450. if (this.obj3d) {
  19451. if (this.player.mode !== a.PANORAMA)
  19452. return void this.discardPathObject();
  19453. for (var e, t = this, i = 0, n = function() {
  19454. this.discardPathObject()
  19455. }
  19456. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  19457. e = t.obj3d.children[r],
  19458. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]),
  19459. i += 1,
  19460. n = null);
  19461. 0 === i && this.discardPathObject(),
  19462. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  19463. }
  19464. }
  19465. ,
  19466. n.prototype.appearSlow = function() {
  19467. var e, t = this;
  19468. this.fadeOutCpm(c.path.fadeInTime);
  19469. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  19470. e = t.obj3d.children[n],
  19471. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]))
  19472. }
  19473. ,
  19474. n.prototype.update = function() {
  19475. this.obj3d && this.obj3d.updateMatrixWorld()
  19476. }
  19477. ,
  19478. n.prototype.calcBurnsAmount = function(e) {
  19479. var t = r.Math.degToRad(c.warp.burnsAngle);
  19480. if (this.player.mode === a.PANORAMA) {
  19481. var i = this.burnsDir * t;
  19482. if (this.upcomingTransType === l.BLACK)
  19483. return i;
  19484. var n = e;
  19485. if (null === n)
  19486. return y.warn("Transition request for non-highlight"),
  19487. i;
  19488. var o = this.getHeroDescriptorByHeroIndex(n);
  19489. if (null === o)
  19490. return i;
  19491. if (!o.isPano())
  19492. return i;
  19493. var s = this.getHeroPano(o)
  19494. , h = this.playerControls.cameras[a.PANORAMA]
  19495. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  19496. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  19497. , p = function(e) {
  19498. var i = Math.acos(Math.min(1, e.dot(u)))
  19499. , n = (new r.Vector3).crossVectors(u, e);
  19500. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  19501. };
  19502. if (s === this.player.currentPano)
  19503. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  19504. var f = this.findShortestPath(this.player.currentPano, s);
  19505. if (void 0 === f || null === f || f.length < 1)
  19506. return y.debug("Empty path ahead..."),
  19507. i;
  19508. var g = this.makePathHulls(f)
  19509. , m = new r.CatmullRomCurve3(g.camera)
  19510. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  19511. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  19512. }
  19513. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  19514. }
  19515. ,
  19516. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  19517. var i = (time==void 0)? c.warp.tourStepDelay : time; //
  19518. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  19519. var n = new r.Euler
  19520. , o = new r.Vector3;
  19521. y.debug("Starting wait: " + (void 0 !== t));
  19522. var s = this.calcBurnsAmount(e)
  19523. , h = function() {
  19524. this.endWarpState(),
  19525. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19526. t && t()
  19527. }
  19528. .bind(this)
  19529. , u = function(e, t) {
  19530. if (this.warpInterrupted)
  19531. return h(),
  19532. !0;
  19533. var r = t || 1e3 / 60;
  19534. if (c.warp.doBurns)
  19535. if (this.player.mode === a.PANORAMA) {
  19536. var l = this.playerControls.cameras[a.PANORAMA];
  19537. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  19538. var u = r * s / i;
  19539. n.y += u,
  19540. o.set(0, 0, -1),
  19541. o.applyEuler(n),
  19542. o.add(l.position),
  19543. l.controls.lookAt(o),
  19544. l.controls.lookVector.copy(o),
  19545. l.lookAt(o)
  19546. } else
  19547. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  19548. }
  19549. .bind(this);
  19550. this.startWarpState(),
  19551. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  19552. }
  19553. ,
  19554. n.prototype.warpToNonPano = function(e) {
  19555. if (this.discardPathObject(),
  19556. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  19557. var t = function() {
  19558. e && e()
  19559. }
  19560. .bind(this);
  19561. this.player.flyToNewMode({
  19562. mode: this.warpDestHeroLoc.cameraMode,
  19563. duration: c.warp.outsideTime,
  19564. warpDest: this.warpDestHeroLoc,
  19565. callback: t,
  19566. force: !0
  19567. })
  19568. } else
  19569. y.warn("no warp destination!!!"),
  19570. e && e()
  19571. }
  19572. ,
  19573. n.prototype._resetWarpShaderParams = function(e) {
  19574. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19575. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19576. }
  19577. ,
  19578. n.prototype._clearWarpShading = function() {
  19579. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19580. this._resetWarpShaderParams(e[t]),
  19581. e[t].visible = !0;
  19582. this._resetWarpShaderParams(this.model.skybox)
  19583. }
  19584. ,
  19585. n.prototype._warpStopFlying = function() {
  19586. this.activeTransType = null,
  19587. this.placeCpm()
  19588. }
  19589. ,
  19590. n.prototype._wrapupTravelOnlyBits = function() {
  19591. this._warpStopFlying(),
  19592. this.warpPathPoints && (this.player.currentPano.exit(),
  19593. this.warpDestPano.enter(),
  19594. this.player.currentPano = this.warpDestPano),
  19595. this.player.spider.draw(),
  19596. this.placeCpm()
  19597. }
  19598. ,
  19599. n.prototype._wrapupTravel = function(e) {
  19600. this._wrapupTravelOnlyBits(),
  19601. this.warpCameraAim(e)
  19602. }
  19603. ,
  19604. n.prototype._wrapupWarpShading = function(e) {
  19605. this._clearWarpShading(),
  19606. this._wrapupTravel(e)
  19607. }
  19608. ,
  19609. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  19610. t !== I.END && this._clearWarpShading(),
  19611. this._wrapupTravelOnlyBits(),
  19612. this.upcomingTransType = null,
  19613. e && e()
  19614. }
  19615. ,
  19616. n.prototype._warpCameraAim = function(e, t) {
  19617. var i = this.warpDestHeroLoc.quaternion
  19618. , n = this.playerControls.cameras[a.PANORAMA]
  19619. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  19620. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  19621. , l = s.dot(o)
  19622. , u = r.Math.radToDeg(Math.acos(l))
  19623. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  19624. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19625. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  19626. m.y = h.constrainedTurn(m.y),
  19627. this.burnsDir = Math.sign(m.y);
  19628. var v = new r.Euler(0,0,0,c.warp.eOrder)
  19629. , A = new r.Vector3
  19630. , C = function(e, t) {
  19631. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  19632. v.y = g.y + e * m.y,
  19633. v.z = g.z + e * m.z,
  19634. A.set(0, 0, -1),
  19635. A.applyEuler(v),
  19636. A.add(n.position),
  19637. n.controls.lookAt(A),
  19638. n.controls.lookVector.copy(A),
  19639. void n.lookAt(A))
  19640. }
  19641. .bind(this);
  19642. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) : (y.debug("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19643. void (t && t()))
  19644. }
  19645. ,
  19646. n.prototype._warpBendAim = function(e, t, i, n) {
  19647. var o = n || 0
  19648. , s = this.playerControls.cameras[a.PANORAMA]
  19649. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19650. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  19651. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  19652. f.y = h.constrainedTurn(f.y);
  19653. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  19654. f.x = g * Math.sign(f.x),
  19655. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  19656. this.burnsDir = Math.sign(f.y),
  19657. g *= Math.sign(f.y),
  19658. f.y = g;
  19659. var m = new r.Euler(0,0,0,c.warp.eOrder)
  19660. , v = new r.Vector3
  19661. , A = function(e, t) {
  19662. if (e < .5)
  19663. m.x = u.x + e * f.x,
  19664. m.y = u.y + e * f.y,
  19665. m.z = u.z + e * f.z;
  19666. else {
  19667. var i = (1 - e) * c.warp.softBendEnd;
  19668. m.x = l.x - i * f.x,
  19669. m.y = l.y - i * f.y,
  19670. m.z = l.z - i * f.z
  19671. }
  19672. v.set(0, 0, -1),
  19673. v.applyEuler(m),
  19674. v.add(s.position),
  19675. s.controls.lookAt(v),
  19676. s.controls.lookVector.copy(v),
  19677. s.lookAt(v)
  19678. }
  19679. .bind(this);
  19680. return p.start(A, t, i, o, d[c.warp.movementEasing])
  19681. }
  19682. ,
  19683. n.prototype._warpStepCameraAim = function(e, t, i) {
  19684. var n = this.playerControls.cameras[a.PANORAMA]
  19685. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19686. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19687. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  19688. l.y = h.constrainedTurn(l.y),
  19689. this.burnsDir = Math.sign(l.y);
  19690. var u = new r.Euler(0,0,0,c.warp.eOrder)
  19691. , f = new r.Vector3
  19692. , g = function(e, t) {
  19693. e < .5 ? u.copy(s) : u.copy(o),
  19694. f.set(0, 0, -1),
  19695. f.applyEuler(u),
  19696. f.add(n.position),
  19697. n.controls.lookAt(f),
  19698. n.controls.lookVector.copy(f),
  19699. n.lookAt(f)
  19700. }
  19701. .bind(this);
  19702. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  19703. }
  19704. ,
  19705. n.prototype.setBurnsDir = function() {
  19706. var e = this.playerControls.cameras[a.PANORAMA]
  19707. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19708. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  19709. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  19710. n.y = h.constrainedTurn(n.y),
  19711. this.burnsDir = Math.sign(n.y)
  19712. }
  19713. ,
  19714. n.prototype.stepWarpPath = function(e, t) {
  19715. var i = this.playerControls.cameras[a.PANORAMA];
  19716. if (!this.warpPathPoints)
  19717. return i.position.copy(this.warpDestPano.position),
  19718. !0;
  19719. var n = this.warpPathPoints[0]
  19720. , o = this.warpDestPano.position;
  19721. if (null !== this.nodes && this.cameraHull.length > 1) {
  19722. var s = new r.Vector3;
  19723. e < .5 ? s.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(c.warp.softPushDist * e).add(n) : s.copy(this.cameraHull[this.cameraHull.length - 2]).sub(o).normalize().multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e)).add(o),
  19724. i.position.copy(s)
  19725. } else
  19726. e < .5 ? i.position.copy(n) : i.position.copy(o)
  19727. }
  19728. ,
  19729. n.prototype.interruptAndFastForward = function(e, t) {
  19730. this.warping && (this.warpInterrupted = !0,
  19731. this.warpInterruptionBlackoutStyle = e,
  19732. this.warpInterruptionTravelTime = t,
  19733. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  19734. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  19735. }
  19736. ,
  19737. n.prototype.warpCameraAim = function(e) {
  19738. var t = c.warp.minWarpTime;
  19739. if (this.upcomingTransType === l.BLACK)
  19740. t = c.warp.teleportTime;
  19741. else {
  19742. var i = this.playerControls.cameras[a.PANORAMA]
  19743. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19744. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  19745. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  19746. s.y = h.constrainedTurn(s.y);
  19747. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  19748. t = Math.max(t, u)
  19749. }
  19750. var d = function() {
  19751. this._warpStopFlying(),
  19752. this.discardSlow(),
  19753. e && e()
  19754. }
  19755. .bind(this);
  19756. this._warpCameraAim(t, d)
  19757. }
  19758. ,
  19759. n.prototype.warpCommonParameters = function(e, t, i, n) {
  19760. this.model.skybox.material.uniforms.blackout.value = n;
  19761. var r = u.uniform(this.model.skybox, "progress", 1)
  19762. , o = u.allUniforms(this.model.chunks, "progress", 1)
  19763. , a = !1
  19764. , s = function() {
  19765. if (this.warpInterrupted)
  19766. return a = !0,
  19767. !0
  19768. }
  19769. .bind(this)
  19770. , l = function(e, t) {
  19771. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  19772. !0) : void r(e, t)
  19773. }
  19774. .bind(this)
  19775. , h = function(e, t) {
  19776. return i && a ? (o(0),
  19777. !0) : void o(e, t)
  19778. }
  19779. .bind(this);
  19780. p.start(s, e, null, t, null, "safeHaltWatch"),
  19781. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  19782. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  19783. }
  19784. ,
  19785. n.prototype.warpTravel_STD = function(e) {
  19786. var t, i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength), n = this.playerControls.cameras[a.PANORAMA], o = (Math.min(.25, 3 / this.warpLength),
  19787. Math.min(.35, 7 / this.warpLength)), s = new r.Euler(0,0,0,c.warp.eOrder), f = new r.Vector3, m = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder), v = (new r.Euler).copy(m), C = n.position.clone(), E = new r.Matrix4, b = new r.Euler, w = c.warp.minWarpTime;
  19788. w += this.warpLength * c.warp.timePerMeter,
  19789. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  19790. var _ = !1
  19791. , T = this.warpDestHeroLoc.quaternion
  19792. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  19793. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19794. , M = S.dot(x)
  19795. , R = r.Math.radToDeg(Math.acos(M))
  19796. , P = function(e) {
  19797. var t = o
  19798. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  19799. return i
  19800. }
  19801. , O = function() {
  19802. return E.lookAt(C, t, A.UP),
  19803. s.setFromRotationMatrix(E, c.warp.eOrder),
  19804. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  19805. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  19806. h.constrainedTurn(b.y)
  19807. }
  19808. .bind(this)
  19809. , L = function(e, t) {
  19810. if (this.warpInterrupted)
  19811. return _ = !0,
  19812. !0
  19813. }
  19814. .bind(this)
  19815. , D = function(e, t) {
  19816. return _ || !this.warpPathPoints ? (g.blur(0),
  19817. !0) : void g.blur(e)
  19818. }
  19819. .bind(this)
  19820. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  19821. , B = function(e, t) {
  19822. return _ || !this.warpPathPoints ? (N(0),
  19823. !0) : void N(e, t)
  19824. }
  19825. .bind(this)
  19826. , F = function(e, t) {
  19827. if (!this.warpPathPoints)
  19828. return n.position.copy(this.warpDestPano.position),
  19829. !0;
  19830. if (_)
  19831. return !0;
  19832. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19833. n.position.copy(i),
  19834. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19835. }
  19836. .bind(this)
  19837. , V = function(e, n) {
  19838. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  19839. !0)
  19840. }
  19841. .bind(this)
  19842. , U = function(e, o) {
  19843. if (_)
  19844. return y.debug(">>>> Walkthrough interupted at t=" + e),
  19845. !0;
  19846. if (!this.warpPathPoints)
  19847. return !0;
  19848. var a = this.warpLength * e
  19849. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  19850. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19851. c.warp.matchCam && (l *= 1 - u),
  19852. E.lookAt(C, t, A.UP),
  19853. s.setFromRotationMatrix(E, c.warp.eOrder),
  19854. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  19855. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  19856. b.y = h.constrainedTurn(b.y),
  19857. s.x = m.x + l * b.x,
  19858. s.y = m.y + l * b.y,
  19859. s.z = m.z + l * b.z,
  19860. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  19861. b.y = h.constrainedTurn(b.y);
  19862. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  19863. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  19864. v.x = v.x + b.x * c.warp.turnFriction,
  19865. v.y = v.y + b.y * c.warp.turnFriction,
  19866. v.z = v.z + b.z * c.warp.turnFriction,
  19867. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  19868. var p = t.clone().sub(C).normalize();
  19869. if (R < c.warp.maxAimRotation && u > 0) {
  19870. var g = 1 - u;
  19871. p.x = p.x * g + u * S.x,
  19872. p.y = p.y * g + u * S.y,
  19873. p.z = p.z * g + u * S.z,
  19874. p.normalize()
  19875. }
  19876. this.bunnyObj.position.copy(n.position).add(p),
  19877. f.set(0, 0, -1).applyEuler(v).normalize(),
  19878. f.multiplyScalar(8),
  19879. f.add(n.position),
  19880. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  19881. n.controls.lookVector.copy(f),
  19882. n.lookAt(f))
  19883. }
  19884. .bind(this)
  19885. , k = function() {
  19886. _ ? (this.discardSlow(),
  19887. this.upcomingTransType = l.BLACK,
  19888. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  19889. }
  19890. .bind(this);
  19891. V(0);
  19892. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  19893. w += H;
  19894. var G = H / w;
  19895. this.warpCommonParameters(w, G, !0, I.NONE),
  19896. p.start(L, w, null, 0, null, "_haltWatcher"),
  19897. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  19898. p.start(D, w, null, G, P, "blurring")),
  19899. p.start(B, w, null, G, P, "modelAlpha"),
  19900. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  19901. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  19902. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  19903. }
  19904. ,
  19905. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19906. var r = e || 0;
  19907. void 0 !== t && null !== t || (t = c.warp.teleportTime),
  19908. this.warpCommonParameters(t, r, !1, i),
  19909. this.model.chunks.forEach(function(e) {
  19910. e.material.uniforms.blackout.value = i
  19911. }),
  19912. this._warpBendAim(null, t, null, r);
  19913. var o = function() {
  19914. this.wrapupWarpShadingOnly(n, i)
  19915. }
  19916. .bind(this);
  19917. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  19918. }
  19919. ,
  19920. n.prototype.flightStepWalk = function(e, t, i) {
  19921. var n = .001
  19922. , o = 1
  19923. , a = 1.2
  19924. , s = new r.Vector3
  19925. , h = new r.Vector3
  19926. , u = function(e, t) {
  19927. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  19928. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  19929. h.copy(A.FORWARD),
  19930. this.player.getDirection(h),
  19931. s.copy(t).sub(e.position).normalize();
  19932. var l = s.dot(h)
  19933. , u = Math.acos(l)
  19934. , d = u / r;
  19935. return d > n && (r *= d / n,
  19936. u < o && (r *= a)),
  19937. r
  19938. };
  19939. return function(e, t, i) {
  19940. if (this.warpInterrupted)
  19941. i && i();
  19942. else if (this.activeTransType !== l.WALK)
  19943. this._clearWarpShading(),
  19944. this._warpStopFlying(),
  19945. this.player.spider.draw(),
  19946. this.placeCpm(),
  19947. i && i();
  19948. else if (this.player.currentPano !== e) {
  19949. var n = {
  19950. pano: e,
  19951. lookAtPoint: t,
  19952. duration: null,
  19953. maxDistanceOverride: c.warp.walkMaxDist,
  19954. skipWarpingCheck: !1,
  19955. constantMoveSpeed: !0
  19956. };
  19957. n.duration = u.call(this, e, t),
  19958. this.player.nonInterruptingFlyToPano(n, i)
  19959. } else
  19960. i && i()
  19961. }
  19962. }(),
  19963. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  19964. return this.flightStepWalk.bind(this, e, t, i)
  19965. }
  19966. ,
  19967. n.prototype.warpTravel_WALK = function() {
  19968. var e = [];
  19969. return function(t) {
  19970. var i = this.player.model.panos;
  19971. e.length = 0;
  19972. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  19973. var s = this.nodes[a]
  19974. , l = i.get(s);
  19975. a === this.nodes.length - 1;
  19976. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  19977. n && o || (e.push(s),
  19978. n = l)
  19979. }
  19980. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  19981. var h = e.length
  19982. , u = i.get(e[h - 1])
  19983. , d = new Array(h + 1);
  19984. d[d.length - 1] = function() {
  19985. t && t()
  19986. }
  19987. .bind(this);
  19988. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  19989. var g = e[p];
  19990. u = i.get(g);
  19991. var m = new r.Vector3;
  19992. this.getLookAtForWalkingTourNode(e, p, m),
  19993. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  19994. p--
  19995. }
  19996. d[0]()
  19997. }
  19998. }(),
  19999. n.prototype.getLookAtForWalkingTourNode = function() {
  20000. var e = new r.Vector3
  20001. , t = new r.Vector3
  20002. , i = new r.Vector3
  20003. , n = new r.Vector3
  20004. , o = new r.Vector3
  20005. , a = .65
  20006. , s = .75
  20007. , l = .2
  20008. , c = .4
  20009. , h = .2
  20010. , u = 3;
  20011. return function(r, d, p) {
  20012. var f = r.length;
  20013. if (d >= f)
  20014. return !1;
  20015. var g = 1
  20016. , m = 1;
  20017. t.set(0, 0, 0),
  20018. o.set(0, 0, 0);
  20019. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20020. if (v = this.player.model.panos.get(r[A]),
  20021. this.getOrientationForWalkingTourNode(r, A, i),
  20022. A === d && e.copy(i),
  20023. n.copy(i),
  20024. A > d) {
  20025. var y = n.dot(e) < a;
  20026. g *= y ? l : s,
  20027. m *= y ? h : c
  20028. }
  20029. i.multiplyScalar(g),
  20030. t.add(i),
  20031. o.lerp(v.position, m)
  20032. }
  20033. return t.normalize(),
  20034. p.copy(o),
  20035. p.add(t),
  20036. !0
  20037. }
  20038. }(),
  20039. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20040. var n = e.length;
  20041. if (t >= n)
  20042. return !1;
  20043. if (t === n - 1)
  20044. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20045. else {
  20046. var r = this.player.model.panos.get(e[t])
  20047. , o = this.player.model.panos.get(e[t + 1]);
  20048. i.copy(o.position).sub(r.position)
  20049. }
  20050. return i.normalize(),
  20051. !0
  20052. }
  20053. ,
  20054. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20055. if (this.activeTransType = this.upcomingTransType,
  20056. this.lastTransType = this.activeTransType,
  20057. this.upcomingTransType = null,
  20058. !e) {
  20059. var r = function() {
  20060. this._wrapupTravel(n)
  20061. }
  20062. .bind(this)
  20063. , o = {
  20064. pano: this.warpDestPano,
  20065. lookAtPoint: null,
  20066. duration: null,
  20067. maxDistanceOverride: null,
  20068. skipWarpingCheck: !1
  20069. };
  20070. return void this.player.flyToPano(o, r)
  20071. }
  20072. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  20073. this._clearWarpShading(),
  20074. this._warpStopFlying(),
  20075. this.player.spider.draw(),
  20076. this.placeCpm(),
  20077. n && n()
  20078. }
  20079. .bind(this)) : this.warpTravel_STD(n)
  20080. }
  20081. ,
  20082. n.prototype.startWarpState = function() {
  20083. this.warping = !0,
  20084. this.warpInterrupted = !1,
  20085. this.warpInterruptionBlackoutStyle = null,
  20086. this.warpInterruptionTravelTime = null
  20087. }
  20088. ,
  20089. n.prototype.endWarpState = function() {
  20090. this.warping = !1
  20091. }
  20092. ,
  20093. n.prototype.warpToPano = function(e, t, i, n) {
  20094. if (this.warping)
  20095. return void y.warn("Cannot warp when already warping");
  20096. if (this.upcomingTransType = e,
  20097. this.activeTransType = null,
  20098. !this.setWarpDestPano())
  20099. return this.upcomingTransType = null,
  20100. void this.warpToNonPano(n);
  20101. if (this.player.mode !== a.PANORAMA)
  20102. return this.upcomingTransType = null,
  20103. this.discardSlow(),
  20104. void this.player.flyToNewMode({
  20105. mode: a.PANORAMA,
  20106. pano: this.warpDestPano,
  20107. duration: c.warp.outsideTime,
  20108. warpDest: this.warpDestHeroLoc,
  20109. callback: n,
  20110. force: !0
  20111. });
  20112. if (!this.warpDestPano)
  20113. return y.warn("no warp destination, callback dropped"),
  20114. void (this.upcomingTransType = null);
  20115. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist)
  20116. , o = this.chooseWarpPath(r);
  20117. if (o && this.upcomingTransType !== l.WALK) {
  20118. var s = function() {
  20119. this.waitingToWarp = !1,
  20120. this.warpToPano(e, t, i, n)
  20121. }
  20122. .bind(this);
  20123. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  20124. return void (this.waitingToWarp = !0)
  20125. }
  20126. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  20127. this.player.currentPano = this.warpDestPano,
  20128. this.placeCpm(),
  20129. this.fadeOutCpm(c.path.fadeOutTime),
  20130. this.player.spider.draw()),
  20131. y.debug("Warping to pano ", this.warpDestPano.position),
  20132. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20133. this.startWarpState();
  20134. var h = function() {
  20135. this.endWarpState(),
  20136. n && n()
  20137. }
  20138. .bind(this);
  20139. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h),
  20140. this.player.smoothZoomToDefault(c.zoom.restoreTime)
  20141. }
  20142. ,
  20143. t.exports = n
  20144. }
  20145. ).call(this, "/js/objects/ShowPath.js")
  20146. }
  20147. , {
  20148. "../constants": 8,
  20149. "../effects": 16,
  20150. "../enum/BlackoutStyle": 18,
  20151. "../enum/ModelManagerEvents": 33,
  20152. "../enum/PlayerEvents": 40,
  20153. "../enum/RenderOrder": 42,
  20154. "../enum/Vectors": 50,
  20155. "../enum/Viewmode": 51,
  20156. "../enum/WarpStyle": 52,
  20157. "../gui/gui": 65,
  20158. "../model/ModelManager": 140,
  20159. "../objects/Snapshot": 153,
  20160. "../settings": 166,
  20161. "../shaders": 167,
  20162. "../util/easing": 186,
  20163. "../util/lerp": 188,
  20164. "../util/logger": 189,
  20165. "../util/math": 190,
  20166. "../util/texture": 194,
  20167. "../util/transitions": 195,
  20168. three: 217
  20169. }],
  20170. 152: [function(e, t, i) {
  20171. "use strict";
  20172. function n() {
  20173. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20174. , t = new r.RawShaderMaterial({
  20175. fragmentShader: o.skysphere.fragmentShader,
  20176. vertexShader: o.skysphere.vertexShader,
  20177. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20178. side: r.BackSide,
  20179. name: "skysphere"
  20180. });
  20181. t.uniforms.radius.value = e.parameters.radius,
  20182. r.Mesh.call(this, e, t)
  20183. }
  20184. var r = e("three")
  20185. , o = e("../shaders")
  20186. , a = e("../settings");
  20187. n.prototype = Object.create(r.Mesh.prototype),
  20188. n.prototype.constructor = n,
  20189. t.exports = n
  20190. }
  20191. , {
  20192. "../settings": 166,
  20193. "../shaders": 167,
  20194. three: 217
  20195. }],
  20196. 153: [function(e, t, i) {
  20197. (function(i) {
  20198. "use strict";
  20199. function n(e) {
  20200. o.call(this, e),
  20201. this.sid = e.sid,//xzw add
  20202. this.panoId = e.panoId,
  20203. this.orthoZoom = e.orthoZoom,
  20204. this.floorVisibility = e.floorVisibility,
  20205. this.thumbUrl = e.thumbUrl,
  20206. this.name = e.name
  20207. }
  20208. var r = (e("three"),
  20209. e("../util/logger"))
  20210. , o = (e("../settings"),
  20211. e("../enum/Viewmode"),
  20212. e("../util/common"),
  20213. e("../util/transitions"),
  20214. e("../util/lerp"),
  20215. e("../util/ajax"),
  20216. e("../util/texture"),
  20217. e("./View"));
  20218. e("events").EventEmitter,
  20219. new r(i);
  20220. n.prototype = Object.create(o.prototype),
  20221. n.prototype.isPano = function() {
  20222. return this.panoId && "" !== this.panoId
  20223. }
  20224. ,
  20225. t.exports = n
  20226. }
  20227. ).call(this, "/js/objects/Snapshot.js")
  20228. }
  20229. , {
  20230. "../enum/Viewmode": 51,
  20231. "../settings": 166,
  20232. "../util/ajax": 181,
  20233. "../util/common": 185,
  20234. "../util/lerp": 188,
  20235. "../util/logger": 189,
  20236. "../util/texture": 194,
  20237. "../util/transitions": 195,
  20238. "./View": 154,
  20239. events: 202,
  20240. three: 217
  20241. }],
  20242. 154: [function(e, t, i) {
  20243. (function(i) {
  20244. "use strict";
  20245. function n(e) {
  20246. e = e || {},
  20247. this.position = new r.Vector3,
  20248. this.quaternion = new r.Quaternion,
  20249. this.update(e)
  20250. }
  20251. var r = e("three")
  20252. , o = e("../util/logger")
  20253. , a = (e("../settings"),
  20254. e("../enum/Viewmode"),
  20255. e("../util/common"),
  20256. e("../util/transitions"),
  20257. e("../util/lerp"),
  20258. e("../util/ajax"),
  20259. e("../util/texture"),
  20260. e("events").EventEmitter);
  20261. new o(i);
  20262. n.prototype = Object.create(a.prototype),
  20263. n.prototype.isValid = function() {
  20264. return !!this.cameraMode
  20265. }
  20266. ,
  20267. n.prototype.update = function(e) {
  20268. return this.cameraMode = e.cameraMode || this.cameraMode,
  20269. this.pano = e.pano || this.pano,
  20270. e.position && this.position.copy(e.position),
  20271. e.quaternion && this.quaternion.copy(e.quaternion),
  20272. this
  20273. }
  20274. ,
  20275. t.exports = n
  20276. }
  20277. ).call(this, "/js/objects/View.js")
  20278. }
  20279. , {
  20280. "../enum/Viewmode": 51,
  20281. "../settings": 166,
  20282. "../util/ajax": 181,
  20283. "../util/common": 185,
  20284. "../util/lerp": 188,
  20285. "../util/logger": 189,
  20286. "../util/texture": 194,
  20287. "../util/transitions": 195,
  20288. events: 202,
  20289. three: 217
  20290. }],
  20291. 155: [function(e, t, i) {//player.js
  20292. (function(i) {
  20293. "use strict";
  20294. function n(e) {
  20295. this.currentPano = null,
  20296. this.nextPano = null,
  20297. this.camera = null,
  20298. this.paused = !1,
  20299. this.flying = !1,
  20300. this.sceneIntersectionPlane = null,
  20301. this.target = new r.Vector3,
  20302. this.mouse = new r.Vector3(1.1,1.1,.5),
  20303. this.mouseAtMouseDown = new r.Vector2,
  20304. this.mouseCouldBeClickToMove = !1,
  20305. this.mouseLastMoveTime = Date.now(),
  20306. this.mouseDown = !1,
  20307. this.mouseDownTimer = null,
  20308. this.couldBeLongTap = !1,
  20309. this.containsMouse = !0,
  20310. this.isTouchEvent = !1,
  20311. this.isPanoHover = !1,
  20312. this.reticule = new a(this),
  20313. this.panoMarkers = [],
  20314. this.spider = new h(this),
  20315. this.quaternion = new r.Quaternion,
  20316. this.position = new r.Vector3(15,10,15),
  20317. this.previousState = null,
  20318. this.lastInsideView = new c,
  20319. this.last360View = new c,
  20320. this.raycaster = new r.Raycaster,
  20321. this.intersect = null,
  20322. this.lastChangeTime = Date.now(),
  20323. this.history = new I,
  20324. this.cameraControls = null,
  20325. this.path = null,
  20326. this.model = null,
  20327. this.domElement = null,
  20328. this.cachedPanoCandidates = null,
  20329. this.basePanoSize = 0,
  20330. this.standardPanoSize = 0,
  20331. this.highPanoSize = 0,
  20332. this.ultraHighPanoSize = 0,
  20333. this.zoomLevel = 1,
  20334. this.zooming = 0,
  20335. this.zoomSpeed = .5,
  20336. this.scrollZoomSpeed = .06,
  20337. this.zoomSpeedAdjust = .05,
  20338. this.defaultZoomIncrement = .2,
  20339. this.baseFov = f.insideFOV,
  20340. this.zoomFov = this.baseFov,
  20341. this.zoomEnabled = !0,
  20342. this.preRenderingEnabled = !1,
  20343. this.setupCustomProperties(e),
  20344. this.zoomStats = new L
  20345. }
  20346. var r = e("three")
  20347. , o = e("./util/logger")
  20348. , a = e("./objects/Reticule")
  20349. , s = e("./objects/Panorama")
  20350. , l = e("./objects/ShowPath")
  20351. , c = e("./objects/View")
  20352. , h = (e("./objects/Snapshot"),
  20353. e("./objects/NSpider"))
  20354. , u = e("./enum/Viewmode")
  20355. , d = (e("./enum/TagStates"),
  20356. e("./enum/Vectors"))
  20357. , p = e("./enum/Keys")
  20358. , f = (e("./enum/AlignmentType"),
  20359. e("./settings"))
  20360. , g = e("./util/common")
  20361. , m = (e("./util/browser"),
  20362. e("./util/math"))
  20363. , v = e("./util/lerp")
  20364. , A = e("./util/easing")
  20365. , y = e("./util/transitions")
  20366. , C = e("events").EventEmitter
  20367. , I = (e("./shaders"),
  20368. e("./util/history"))
  20369. , E = (e("./util/camera"),
  20370. e("./model/ModelManager"),
  20371. e("./enum/PathDiscardMode"))
  20372. , b = e("./enum/PathDisplayMode")
  20373. , w = e("./enum/PlayerEvents")
  20374. , _ = e("./enum/ControlEvents")
  20375. , T = e("./enum/ModelManagerEvents")
  20376. , x = e("./enum/WarpStyle")
  20377. , S = e("./enum/BlackoutStyle")
  20378. , M = e("./exception/BasicException")
  20379. , R = e("./enum/PanoSizeClass")
  20380. , P = (e("./tile/TileDownloader"),
  20381. e("./tile/TilePrioritizer"))
  20382. , O = (e("./enum/PanoramaEvents"),
  20383. e("./enum/ZoomEvents"))
  20384. , L = e("./util/ZoomStats")
  20385. , D = e("./constants")
  20386. , N = e("./util/common")
  20387. , B = e("./util/cameraLight")
  20388. , Hot = e('hot')
  20389. , F = new o(i)
  20390. , V = Object.freeze({
  20391. FlyToPano: y.getUniqueId(),
  20392. FlyToNewMode: y.getUniqueId(),
  20393. FlyToSameMode: y.getUniqueId(),
  20394. FlyToViewFloor: y.getUniqueId(),
  20395. LookTransition: y.getUniqueId(),
  20396. ZoomTransition: y.getUniqueId()
  20397. });
  20398. n.prototype = Object.create(C.prototype),
  20399. n.prototype.init = function(e) {
  20400. this.modelManager = e.modelManager,
  20401. this.tileDownloader = e.tileDownloader,
  20402. this.panoRenderer = e.panoRenderer,
  20403. this.qualityManager = e.qualityManager,
  20404. this.domElement = e.container,
  20405. this.camera = e.camera,
  20406. this.tagManager = e.tagManager,
  20407. this.cameraControls = e.controls,
  20408. this.path = new l(e.director,this,e.controls),
  20409. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  20410. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  20411. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  20412. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  20413. this.tileDownloader.processPriorityQueue = !1,
  20414. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20415. this.bindEvents(e.container),
  20416. this.updateModel()
  20417. }
  20418. //xzw add: 截图
  20419. function dataURLtoBlob(dataurl) {
  20420. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  20421. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  20422. while(n--){
  20423. u8arr[n] = bstr.charCodeAt(n);
  20424. }
  20425. return new Blob([u8arr], {type:mime});
  20426. }
  20427. n.prototype.screenShot = function(o){
  20428. if(this.flying || this.flyingToTag) return;
  20429. var R = this.sceneRenderer;
  20430. R.updateScreenSize(o);
  20431. for(var i in this.model.panos.index){
  20432. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  20433. this.model.panos.index[i].marker.visible = false;
  20434. }
  20435. for(var i in this.model.hots){
  20436. this.model.hots[i].mesh.visible = false;
  20437. }
  20438. this.reticule.visible = false;
  20439. this.reticule.forceUnvisible = true;
  20440. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  20441. R.renderer.clear(true,true,true);
  20442. R.renderer.render(R.scene, R.camera);
  20443. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  20444. o.f && o.f(imgData)
  20445. R.updateScreenSize({resize:true});
  20446. this.reticule.visible = true;
  20447. for(var i in this.model.hots){
  20448. this.model.hots[i].visible = true;
  20449. }
  20450. for(var i in this.model.panos.index){
  20451. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  20452. }
  20453. R.renderer.render(R.scene, R.camera);
  20454. }.bind(this),30) //这个数字不能太小
  20455. }
  20456. var scaleImg = e("scaleImg");
  20457. var ResizeImg = function(img, option){
  20458. var img2; //不能直接改img 否则可能触发第二次img.onload
  20459. var compress = function(ratio,type){
  20460. var image = img2 || img;
  20461. var c = document.createElement('canvas');
  20462. c.width = image.width; c.height = image.height;
  20463. var ctx = c.getContext('2d');
  20464. ctx.drawImage(image,0,0,image.width,image.height);
  20465. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  20466. }
  20467. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  20468. var image = img2 || img;
  20469. var blob = dataURLtoBlob(image.src);
  20470. if(option.maxWeight && blob.size > option.maxWeight){
  20471. compress(option.maxWeight/blob.size, "jpeg")
  20472. blob = dataURLtoBlob(image.src);
  20473. }
  20474. if(!img2){
  20475. img2 = new Image();
  20476. }
  20477. img2.base64Src = image.src;
  20478. img2.src = window.URL.createObjectURL(blob);
  20479. }
  20480. var oldSize = Math.max(img.width, img.height);
  20481. if(option.toType != "png"){//不是非要png的话
  20482. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  20483. if(oldSize > option.maxSize){
  20484. compress(option.maxSize/oldSize, "jpeg");
  20485. }
  20486. reCom();
  20487. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  20488. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  20489. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  20490. reCom();
  20491. }
  20492. }
  20493. }else{
  20494. //?貌似png会越压缩越大?
  20495. }
  20496. return img2 || img;
  20497. }
  20498. var _fixType=function(type) {
  20499. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  20500. var r = type.match(/png|jpeg|bmp|gif/)[0];
  20501. return 'image/' + r;
  20502. };
  20503. var saveFile=function(data, filename){
  20504. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  20505. save_link.href = data;
  20506. save_link.download = filename;
  20507. var event = document.createEvent('MouseEvents');
  20508. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  20509. save_link.dispatchEvent(event);
  20510. };
  20511. n.prototype.getWrapShot = function(){ //获取导览点截图和信息
  20512. var str = ',{\r\t'+this.getSnapAngleInfo();
  20513. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  20514. var img = new Image();
  20515. img.src = imgData;
  20516. img.onload = function(){
  20517. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  20518. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  20519. var filename = "snap" + (new Date()).getTime();
  20520. saveFile(img2.src,filename + ".jpg");
  20521. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  20522. str +=('\r\t"sid":"'+filename+'",');
  20523. str +=('\r\t"name":"'+filename+'"\r}');
  20524. logData(str)
  20525. }
  20526. }});
  20527. }
  20528. ,
  20529. n.prototype.getSnapAngleInfo = function(){
  20530. var info = {};
  20531. var str = '"metadata":{';
  20532. var q = this.camera.quaternion.clone();
  20533. switch (this.mode) {
  20534. case "panorama":
  20535. info.scan_id = this.currentPano.id;
  20536. str += ('"scan_id":"'+this.currentPano.id+'",');
  20537. break;
  20538. case "floorplan":
  20539. info.camera_mode = 1;
  20540. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  20541. q.multiply(this.camera.quaternion);
  20542. str += ('"camera_mode":1,');
  20543. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20544. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20545. break;
  20546. case "dollhouse":
  20547. info.camera_mode = 2;
  20548. str += ('"camera_mode":2,');
  20549. break;
  20550. }
  20551. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  20552. info.camera_quaternion = m.toPrecision(q.toArray(),4);
  20553. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20554. return str;
  20555. }
  20556. //------end
  20557. n.prototype.closePopup = function() {//xzw 关闭热点页面
  20558. if(!g_currentHot) return;
  20559. g_currentHot = null;
  20560. var hotPop = document.getElementById('popup');
  20561. hotPop.style.display = "none";
  20562. hotPop.removeChild(document.getElementById("id1"));
  20563. $("#popup iframe:last").remove();
  20564. //document.getElementById("bgaudio").play();
  20565. $('#player').off("click",this.closePopup)
  20566. }
  20567. n.prototype.setupCustomProperties = function(e) {
  20568. var t = e || u.PANORAMA;
  20569. Object.defineProperty(this, "mode", {
  20570. get: function() {
  20571. return t
  20572. },
  20573. set: function(e) {
  20574. var i = t;
  20575. t = e,
  20576. this.onModeUpdated(i, t)
  20577. }
  20578. })
  20579. }
  20580. ,
  20581. n.prototype.isInMode = function() {
  20582. for (var e = 0; e < arguments.length; e++)
  20583. if (this.mode === arguments[e])
  20584. return !0;
  20585. return !1
  20586. }
  20587. ,
  20588. n.prototype.isOutsideMode = function(e) {
  20589. return e = e || this.mode,
  20590. e === u.DOLLHOUSE || e === u.FLOORPLAN
  20591. }
  20592. ,
  20593. n.prototype.is360View = function(e, t) {
  20594. return e === u.PANORAMA && t && !t.isAligned()
  20595. }
  20596. ,
  20597. n.prototype.setScene = function(e) {
  20598. this.sceneIntersectionPlane = e.plane,
  20599. this.path.setScene(e),
  20600. this.moveReticuleToScene(e)
  20601. }
  20602. ,
  20603. n.prototype.moveReticuleToScene = function(e) {
  20604. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20605. e.add(this.reticule)
  20606. }
  20607. ,
  20608. n.prototype.updateModel = function() {
  20609. function e(e, t, n) {
  20610. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  20611. }
  20612. function t(e, t) {
  20613. if (this.mode === u.DOLLHOUSE) {
  20614. var n = e ? this.model.center.y : n = t.center.y;
  20615. i.call(this, n)
  20616. }
  20617. }
  20618. function i(e) {
  20619. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  20620. , i = this.cameraControls.controls[u.DOLLHOUSE]
  20621. , n = t.position.y + (e - i.target.y)
  20622. , r = f.showFloorDuration + f.showFloorDelay;
  20623. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  20624. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  20625. }
  20626. this.model = this.modelManager.getActiveModel(),
  20627. this.model.on("floor.changed", e.bind(this)),
  20628. this.model.on("allfloors.toggled", t.bind(this)),
  20629. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  20630. }
  20631. ,
  20632. n.prototype.updateModelDependentData = function() {
  20633. this.cameraControls.setModelForControls(this.model),
  20634. this.getPanoMarkersFromModel(this.model)
  20635. }
  20636. ,
  20637. n.prototype.onModelChanged = function() {
  20638. this.updateModel(),
  20639. this.updateModelDependentData()
  20640. }
  20641. ,
  20642. n.prototype.getPanoMarkersFromModel = function(e) {
  20643. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20644. return t.marker ? e.concat(t.marker) : e
  20645. }, [])
  20646. }
  20647. ,
  20648. n.prototype.handleControlMove = function(e) {
  20649. this.emit(w.Move, e)
  20650. }
  20651. ,
  20652. n.prototype.handleControlInputStart = function(e) {
  20653. this.emit(w.InputStart, e)
  20654. }
  20655. ,
  20656. n.prototype.onModeUpdated = function(e, t) {
  20657. this.cameraControls.activateControls(t),
  20658. this.emit(w.ModeChanged, e, t)
  20659. }
  20660. ,
  20661. n.prototype.isWarping = function() {
  20662. return this.path.warping
  20663. }
  20664. ,
  20665. n.prototype.isWaitingToWarp = function() {
  20666. return this.path.waitingToWarp
  20667. }
  20668. ,
  20669. n.prototype.getLabelScaleFactor = function() {
  20670. if (this.isOutsideMode()) {
  20671. var e = 10
  20672. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  20673. return t
  20674. }
  20675. return .5
  20676. }
  20677. ,
  20678. n.prototype.changeMusic = function() {//xzw add
  20679. if(!this.director.tourIsPlaying && g_play && g_bgAudio){
  20680. g_playAudio = g_bgAudio;
  20681. g_bgAudio.play();
  20682. }else{
  20683. if(!g_play){
  20684. g_playAudio = g_bgAudio;
  20685. }else{//防止再次播放时重播一遍
  20686. g_playAudio = null;
  20687. }
  20688. }
  20689. }
  20690. ,
  20691. n.prototype.bindEvents = function(e) {
  20692. e !== document && e.setAttribute("tabindex", -1),
  20693. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20694. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20695. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20696. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20697. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20698. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  20699. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20700. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20701. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20702. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20703. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20704. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20705. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20706. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20707. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20708. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  20709. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  20710. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  20711. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  20712. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this))//xzw add
  20713. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this))//xzw add
  20714. $('#closepop').on("click",this.closePopup.bind(this)); //xzw add
  20715. }
  20716. ,
  20717. n.prototype.onMouseDown = function(e) {
  20718. e.currentTarget !== document && e.currentTarget.focus(),
  20719. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20720. this.updateIntersect())
  20721. }
  20722. ,
  20723. n.prototype.onMouseMove = function(e) {
  20724. this.isTouchEvent = !1,
  20725. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20726. }
  20727. ,
  20728. n.prototype.onMouseOver = function(e) {
  20729. this.containsMouse = !0,
  20730. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20731. }
  20732. ,
  20733. n.prototype.onMouseOut = function(e) {
  20734. this.containsMouse = !1
  20735. }
  20736. ,
  20737. n.prototype.onMouseUp = function(e) {
  20738. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  20739. }
  20740. ,
  20741. n.prototype.onTouchStart = function(e) {
  20742. if (e.currentTarget !== document && e.currentTarget.focus(),
  20743. !this.mouseDown) {
  20744. this.couldBeLongTap = !0;
  20745. var t = g.average(e.changedTouches, "clientX")
  20746. , i = g.average(e.changedTouches, "clientY");
  20747. this.handleInputStart.call(this, t, i, !0),
  20748. this.mouseDownTimer = setTimeout(function() {
  20749. this.updateIntersect(),
  20750. this.handleInputEnd.call(this, t, i, !0)
  20751. }
  20752. .bind(this), f.input.longTapThreshold)
  20753. }
  20754. }
  20755. ,
  20756. n.prototype.onTouchMove = function(e) {
  20757. var t = g.average(e.changedTouches, "clientX")
  20758. , i = g.average(e.changedTouches, "clientY");
  20759. this.handleInputMove.call(this, t, i, !0)
  20760. }
  20761. ,
  20762. n.prototype.onTouchEnd = function(e) {
  20763. if (clearTimeout(this.mouseDownTimer),
  20764. this.mouseDown) {
  20765. this.couldBeLongTap = !1,
  20766. this.updateIntersect();
  20767. var t = g.average(e.changedTouches, "clientX")
  20768. , i = g.average(e.changedTouches, "clientY");
  20769. this.handleInputEnd.call(this, t, i, !0)
  20770. }
  20771. }
  20772. ,
  20773. n.prototype.onPointerDown = function(e) {
  20774. return e.currentTarget !== document && e.currentTarget.focus(),
  20775. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20776. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20777. void (this.mouseDownTimer = setTimeout(function() {
  20778. this.updateIntersect(),
  20779. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20780. }
  20781. .bind(this), f.input.longTapThreshold)))
  20782. }
  20783. ,
  20784. n.prototype.onPointerMove = function(e) {
  20785. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20786. }
  20787. ,
  20788. n.prototype.onPointerUp = function(e) {
  20789. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20790. this.couldBeLongTap = !1,
  20791. this.updateIntersect(),
  20792. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20793. }
  20794. ,
  20795. n.prototype.onPointerOut = function(e) {
  20796. this.mouseDown = !1
  20797. }
  20798. ,
  20799. n.prototype.onPointerCancel = function(e) {
  20800. this.mouseDown = !1
  20801. }
  20802. ,
  20803. n.prototype.onKeyDown = function(e) {
  20804. var t = function() {
  20805. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  20806. }
  20807. .bind(this)
  20808. , i = e.which;
  20809. switch (i) {
  20810. case p.F:
  20811. t(),
  20812. this.changeFloor(-1);
  20813. break;
  20814. case p.R:
  20815. t(),
  20816. this.changeFloor(1)
  20817. }
  20818. if (this.mode === u.PANORAMA)
  20819. switch (i) {
  20820. case p.UPARROW:
  20821. case p.W:
  20822. this.flyLocalDirection(d.FORWARD.clone());
  20823. break;
  20824. case p.DOWNARROW:
  20825. case p.S:
  20826. this.flyLocalDirection(d.BACK.clone());
  20827. break;
  20828. case p.A:
  20829. this.flyLocalDirection(d.LEFT.clone());
  20830. break;
  20831. case p.D:
  20832. this.flyLocalDirection(d.RIGHT.clone())
  20833. }
  20834. }
  20835. ,
  20836. n.prototype.handleScrollPinchZoom = function() {
  20837. return function(e) {
  20838. var t = e
  20839. , i = this.zoomLevel;
  20840. this.zoomBy(t),
  20841. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20842. }
  20843. }(),
  20844. n.prototype.handleControlPinch = function(e) {
  20845. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  20846. }
  20847. ,
  20848. n.prototype.handleControlScroll = function(e) {
  20849. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20850. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  20851. }
  20852. ,
  20853. n.prototype.handleInputStart = function(e, t, i) {
  20854. this.isTouchEvent = i,
  20855. m.convertScreenPositionToNDC(e, t, this.mouse),
  20856. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20857. this.mouseCouldBeClickToMove = !0,
  20858. this.mouseDown = !0
  20859. }
  20860. ,
  20861. n.prototype.handleInputMove = function(e, t, i) {
  20862. this.isTouchEvent = i,
  20863. m.convertScreenPositionToNDC(e, t, this.mouse),
  20864. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20865. this.couldBeLongTap = !1,
  20866. clearTimeout(this.mouseDownTimer)),
  20867. this.mouseLastMoveTime = Date.now(),
  20868. this.reticule.move(e, t, i)
  20869. }
  20870. ,
  20871. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  20872. if (this.isTouchEvent = i,
  20873. this.mouseDown = !1,
  20874. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  20875. !i && this.couldBeLongTap)
  20876. return !0;
  20877. if (this.handleLongTap())
  20878. return !0;
  20879. if (this.mouseCouldBeClickToMove) {
  20880. if (this.flying)
  20881. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20882. !0;
  20883. if(this.checkHotClick())//add
  20884. return !0;
  20885. if(g_HotStatus == "add"){//添加热点 add
  20886. var position = this.reticule.position.toArray();
  20887. var rotation = this.reticule.rotation.toArray().slice(0,3);
  20888. var sid = "hot"+(this.model.hotsCount+g_newHot.length);
  20889. while(this.model.hots[sid]){sid+="_1"}//防重名
  20890. var hot = new Hot(sid, {position:position, rotation:rotation, size:2}, this.model);
  20891. g_newHot.push(hot);
  20892. this.model.hots[sid] = hot;
  20893. //$('#addHot textarea')[0].value+=('添加热点:\r"'+sid + '":{ "position":['+position+'], "rotation":['+rotation+']},\r');
  20894. logData('添加热点:\r"'+sid + '":{ "position":['+position+'], "rotation":['+rotation+']},\r')
  20895. g_HotStatus = false;
  20896. $("#player").css("cursor","");
  20897. return !0;
  20898. }
  20899. //if (this.checktagClick())
  20900. // return !0;
  20901. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  20902. this.history.invalidate(),
  20903. this.intersect)
  20904. return this.flyToPanoClosestToMouse();
  20905. if (this.mode === u.PANORAMA) {
  20906. var n = this.closestPanoInDirection(this.getMouseDirection());
  20907. return n ? this.flyToPano({
  20908. pano: n
  20909. }) : this.bump(this.getMouseDirection())
  20910. }
  20911. }
  20912. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20913. }
  20914. ,
  20915. n.prototype.handleLongTap = function() {
  20916. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  20917. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  20918. !0
  20919. }
  20920. ,
  20921. n.prototype.checktagClick = function() {
  20922. if (this.tagManager.intersectTag) {
  20923. var e = this.isTouchEvent
  20924. , t = this.tagManager.clickedOnTag(e, this);
  20925. return e || t || y.cancelById(V.LookTransition),
  20926. !0
  20927. }
  20928. if (this.tagManager.activeTag)
  20929. return this.tagManager.dismissActiveTag(),
  20930. !1
  20931. }
  20932. ,
  20933. n.prototype.rankedtagInDirection = function(e, t) {
  20934. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20935. }
  20936. ,
  20937. n.prototype.start = function(e) {
  20938. var t = e.mode
  20939. , i = e.pano
  20940. , n = e.position
  20941. , r = e.quaternion
  20942. , o = e.tag
  20943. , a = e.quickstart
  20944. , s = $.Deferred();
  20945. this.updateModelDependentData(),
  20946. this.updateFromControls(),
  20947. this.findDefaultViews();
  20948. var l = this.is360View(t, i);
  20949. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20950. s.done(function(e) {
  20951. this.emit(w.Ready, l, e, o)
  20952. }
  20953. .bind(this)),
  20954. s.promise()
  20955. }
  20956. ,
  20957. n.prototype.startOutside = function(e, t) {
  20958. var i = e.mode
  20959. , n = e.pano
  20960. , r = e.position
  20961. , o = e.quaternion
  20962. , a = e.zoom
  20963. , s = e.floorVisibility
  20964. , l = e.tag;
  20965. this.emit(w.StartOutside, f[i].transitionTime),
  20966. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20967. y.cancelById(V.FlyToViewFloor),
  20968. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20969. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20970. }
  20971. ,
  20972. n.prototype.startInside = function(e, t, i, n, r) {
  20973. r = r || $.Deferred(),
  20974. this.currentPano = e;
  20975. var o = e && !e.isAligned();
  20976. if (t = o ? e.position : t || e.position,
  20977. i = i || e.quaternion,
  20978. e) {
  20979. var a = this.startInside.bind(this, e, t, i, n, r);
  20980. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20981. return
  20982. }
  20983. return this.mode = u.PANORAMA,
  20984. e.floor.enter(this.mode),
  20985. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  20986. this.switchCameraMode(this.mode, i),
  20987. this.emit(w.StartInside, o),
  20988. r.resolve(!0),
  20989. r
  20990. }
  20991. ,
  20992. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  20993. setTimeout(function(){
  20994. this.model.hotsCount && this.model.shineHots();
  20995. }.bind(this),1200)//xzw 热点开始闪烁
  20996. if (r = r || $.Deferred(),
  20997. this.dollhouseMode(),
  20998. !e)
  20999. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21000. r.resolve(!1),
  21001. r;
  21002. t = t || e.position;
  21003. var o = i || this.cameraControls.activeControl.camera.quaternion
  21004. , a = e.position;
  21005. return this.fitDollhouse(a, t, o),
  21006. setTimeout(function(t) {
  21007. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  21008. var n = {
  21009. mode: u.PANORAMA,
  21010. pano: e,
  21011. quaternion: i,
  21012. callback: function() {
  21013. this.emit(w.FlyinFinished),
  21014. r.resolve(!0)
  21015. }
  21016. .bind(this)
  21017. };
  21018. this.flyToNewMode(n)
  21019. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  21020. r
  21021. }
  21022. ,
  21023. n.prototype.checkAndWaitForPanoLoad = function() {
  21024. var e = {}
  21025. , t = {}
  21026. , i = 5e3
  21027. , n = function() {
  21028. for (var n in e)
  21029. if (e.hasOwnProperty(n) && e[n]) {
  21030. var r = performance.now() - t[n];
  21031. if (r < i)
  21032. return !0
  21033. }
  21034. return !1
  21035. };
  21036. return function(r, o, a, s, l, c, h, u, d, p) {
  21037. if (n())
  21038. return !0;
  21039. var f = function(t, i, n) {
  21040. N.delayOneFrame(function() {
  21041. e[t] = !1,
  21042. l && l(i, n)
  21043. }
  21044. .bind(this))
  21045. }
  21046. .bind(this, r.id)
  21047. , g = function(t, i) {
  21048. N.delayOneFrame(function() {
  21049. e[t] = !1,
  21050. c && c(i)
  21051. }
  21052. .bind(this))
  21053. }
  21054. .bind(this, r.id);
  21055. try {
  21056. return null !== u && void 0 !== u || (u = !0),
  21057. this.model.supportsTiles ? e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p) : e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u),
  21058. e[r.id] && (t[r.id] = performance.now()),
  21059. e[r.id]
  21060. } catch (n) {
  21061. throw e[r.id] = !1,
  21062. t[r.id] = performance.now() - i,
  21063. n
  21064. }
  21065. }
  21066. }(),
  21067. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21068. if (!e)
  21069. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21070. return r && this.model.waitForLoad(e, function() {
  21071. return e.isLoaded(i)
  21072. }),
  21073. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21074. !0)
  21075. }
  21076. ,
  21077. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  21078. var e = new r.Vector3;
  21079. return function(t, i, n, r, o, a, s, l) {
  21080. if (!t)
  21081. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21082. return e.copy(d.FORWARD),
  21083. this.getDirection(e),
  21084. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  21085. return t.isLoaded(i)
  21086. }),
  21087. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  21088. n && n(e, t)
  21089. }
  21090. .bind(this)).fail(function(e) {
  21091. r && r(e)
  21092. }
  21093. .bind(this)).progress(function(e, t, i) {
  21094. o && o(e, t, i)
  21095. }
  21096. .bind(this)),
  21097. !0)
  21098. }
  21099. }(),
  21100. n.prototype.switchCameraMode = function(e, t) {
  21101. var i = this.cameraControls.controls[e]
  21102. , n = i.camera;
  21103. switch (e) {
  21104. case u.PANORAMA:
  21105. n.position.copy(this.currentPano.position);
  21106. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21107. i.lookAt(o.add(n.position));
  21108. break;
  21109. case u.DOLLHOUSE:
  21110. var a = this.position.clone();
  21111. this.mode === u.PANORAMA ? a.add(new r.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : a.add(d.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  21112. n.position.copy(a),
  21113. i.target.copy(this.target.clone().setY(this.model.center.y));
  21114. break;
  21115. case u.FLOORPLAN:
  21116. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  21117. i.target.copy(this.model.center).setY(0),
  21118. i.zoomToContain(this.model.size),
  21119. i.rotateToView(this.model.size, this.getDirection())
  21120. }
  21121. i.update(0)
  21122. }
  21123. ,
  21124. n.prototype.update = function() {
  21125. var e = (new r.Vector3,
  21126. {})
  21127. , t = [];
  21128. return function(i) {
  21129. this.updatePersistentZooming(i),
  21130. this.updateFromControls(i),
  21131. this.getCurrentNodePanos(t),
  21132. this.hasChanged(e) && (this.lastChangeTime = Date.now(),
  21133. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  21134. this.emit(w.ViewChanged)),
  21135. this.model.supportsTiles && (this.updateTileDownloader(t),
  21136. this.updatePanoRenderer(t)),
  21137. this.updatePreRendering(t),
  21138. this.reticule.update(),
  21139. this.path.update(),
  21140. this.spider.update(),
  21141. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21142. this.updateControlLocks(),
  21143. this.model.supportsTiles && this.updateZoomPano()
  21144. }
  21145. }(),
  21146. n.prototype.updatePersistentZooming = function(e) {
  21147. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  21148. }
  21149. ,
  21150. n.prototype.updateControlLocks = function() {
  21151. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21152. }
  21153. ,
  21154. n.prototype.updatePanoRenderer = function() {
  21155. var e = new r.Vector3;
  21156. return function(t) {
  21157. var i = this.nextPano || this.currentPano;
  21158. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  21159. this.getDirection(e),
  21160. this.panoRenderer.updateDirection(e))
  21161. }
  21162. }(),
  21163. n.prototype.cleanupInactivePanos = function() {
  21164. var e = []
  21165. , t = [];
  21166. return function() {
  21167. e.length = 0,
  21168. e.push(this.currentPano),
  21169. this.nextPano && e.push(this.nextPano),
  21170. t.length = 0;
  21171. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  21172. t.push(this.panoRenderer.activePanos[i]);
  21173. for (var n = 0; n < t.length; n++) {
  21174. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  21175. r.id === e[a].id && (o = !1);
  21176. o && r.exit()
  21177. }
  21178. }
  21179. }(),
  21180. n.prototype.updatePreRendering = function() {
  21181. var e = {};
  21182. return function(t) {
  21183. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21184. var i = this.nextPano || this.currentPano;
  21185. if (i && t && t.length > 1) {
  21186. var n = t.findIndex(function(e) {
  21187. if (e.id === i.id)
  21188. return !0
  21189. });
  21190. if (n >= 0 && n + 1 < t.length) {
  21191. var r = t[n + 1];
  21192. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  21193. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21194. window.setTimeout(function(t) {
  21195. e[t.id] = !1
  21196. }
  21197. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  21198. }
  21199. .bind(this, r), f.tiling.panoPreRenderDelay),
  21200. e[r.id] = !0)
  21201. }
  21202. }
  21203. }
  21204. }
  21205. }(),
  21206. n.prototype.enablePreRendering = function() {
  21207. this.preRenderingEnabled = !0
  21208. }
  21209. ,
  21210. n.prototype.disablePreRendering = function() {
  21211. this.preRenderingEnabled = !1,
  21212. this.cleanupInactivePanos()
  21213. }
  21214. ,
  21215. n.prototype.updateTileDownloader = function() {
  21216. var e = new r.Vector3;
  21217. return function(t) {
  21218. var i = this.nextPano || this.currentPano;
  21219. i && (e.copy(d.FORWARD),
  21220. this.getDirection(e),
  21221. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  21222. this.tileDownloader.processPriorityQueue = !0)
  21223. }
  21224. }(),
  21225. n.prototype.updateFromControls = function(e) {
  21226. null !== e && void 0 !== e || (e = 0),
  21227. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21228. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21229. this.position.copy(this.cameraControls.activeControl.camera.position),
  21230. this.target.copy(this.cameraControls.activeControl.target),
  21231. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21232. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21233. this.camera.position.copy(this.position),
  21234. this.camera.quaternion.copy(this.quaternion),
  21235. this.camera.updateMatrix(),
  21236. this.camera.updateMatrixWorld()
  21237. }
  21238. ,
  21239. n.prototype.hasChanged = function(e) {
  21240. if (!this.previousState)
  21241. return this.previousState = {
  21242. allFloorsVisible: this.model.allFloorsVisible,
  21243. position: this.position.clone(),
  21244. quaternion: this.quaternion.clone(),
  21245. mouse: this.mouse.clone(),
  21246. labelScaleFactor: this.getLabelScaleFactor(),
  21247. currentFloor: this.model.currentFloor,
  21248. projectionMatrix: this.camera.projectionMatrix.clone(),
  21249. worldMatrix: this.camera.matrixWorld.clone(),
  21250. mode: this.mode,
  21251. modelPosition: this.model.position.clone(),
  21252. modelCenter: this.model.center.clone(),
  21253. zoomLevel: this.zoomLevel
  21254. },
  21255. !0;
  21256. 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;
  21257. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21258. e.moved = !this.position.equals(this.previousState.position),
  21259. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21260. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21261. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21262. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21263. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21264. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21265. e.modeChanged = this.mode !== this.previousState.mode,
  21266. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21267. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21268. e.nextPanoActive = null !== this.nextPano,
  21269. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21270. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21271. this.previousState.position.copy(this.position),
  21272. this.previousState.quaternion.copy(this.quaternion),
  21273. this.previousState.mouse.copy(this.mouse),
  21274. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21275. this.previousState.currentFloor = this.model.currentFloor,
  21276. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21277. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21278. this.previousState.mode = this.mode,
  21279. this.previousState.modelPosition.copy(this.model.position),
  21280. this.previousState.modelCenter.copy(this.model.center),
  21281. this.previousState.zoomLevel = this.zoomLevel,
  21282. !t
  21283. }
  21284. ,
  21285. n.prototype.updateIntersect = function() {
  21286. var e = this.flying || this.isWarping()
  21287. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21288. , i = y.getById(V.LookTransition)
  21289. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  21290. //this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),//--MP
  21291. this.intersect = this.getMouseIntersect(); //xzw change
  21292. this.intersect && this.updateClosestPano(this.intersect),
  21293. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21294. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21295. }
  21296. ,
  21297. n.prototype.checkHotClick = function() {
  21298. if(this.intersectHot){
  21299. this.intersectHot.examine(this);
  21300. /* g_touraudio.pause();
  21301. g_bgaudio = false;
  21302. document.getElementById("bgaudio").pause();
  21303. var sWidth = document.body.scrollWidth;
  21304. var sHeight = document.body.scrollHeight;
  21305. var pop1 = document.getElementById('popup');
  21306. pop1.style.display = "block";
  21307. var myElement = document.createElement("iframe");
  21308. myElement.src = g_HotMeshes[i].hotLink;
  21309. myElement.id = "id1";
  21310. myElement.allowTransparency = "true";
  21311. myElement.style.width = "100%";
  21312. myElement.style.height = "100%";
  21313. myElement.scrolling = "no";
  21314. var element=document.getElementById("id1");
  21315. if (typeof(element)== "undefined" || element == null){
  21316. document.getElementById("popup").appendChild(myElement);
  21317. }
  21318. var oClose = document.getElementById("closepop");
  21319. oClose.onclick = function() {
  21320. pop1.style.display = "none";
  21321. document.getElementById("popup").removeChild(document.getElementById("id1"));
  21322. $("#popup iframe:last").remove();
  21323. document.getElementById("bgaudio").play();
  21324. } */
  21325. return true;
  21326. }
  21327. },
  21328. n.prototype.getMouseDirection = function(e) {
  21329. e = e || this.mouse;
  21330. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  21331. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  21332. return i.sub(t).normalize()
  21333. }
  21334. ,
  21335. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  21336. e = e || this.mouse.clone(),
  21337. t = t || this.model.floors.reduce(function(e, t) {
  21338. return t.hidden ? e : e.concat(t.collider.children)
  21339. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  21340. for(var i in this.model.hots){
  21341. t.push(this.model.hots[i].mesh);
  21342. }
  21343. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  21344. this.raycaster.set(i, this.getMouseDirection(e));
  21345. var n = this.raycaster.intersectObjects(t);
  21346. if (0 === n.length){
  21347. this.intersectHot = null; //add
  21348. if(g_HotStatus!="add") $("#player").css("cursor","");
  21349. return null;
  21350. }
  21351. var o = n[0];
  21352. if(o.object.type == "hotSprite"){ //add
  21353. this.intersectHot = o.object.belongHot;
  21354. $("#player").css("cursor","pointer");
  21355. return;
  21356. }
  21357. this.intersectHot = null;
  21358. if(g_HotStatus!="add") $("#player").css("cursor","");
  21359. if (o.face) {
  21360. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  21361. var a = this.position.clone().sub(o.point);
  21362. a.dot(o.normal) < 0 && o.normal.negate(),
  21363. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21364. o.horizontal = o.normal.y > .8
  21365. }
  21366. return o
  21367. }
  21368. ,
  21369. n.prototype.updateClosestPano = function(e) {
  21370. var t = [s.filters.isPanoAligned()];
  21371. if (this.mode === u.PANORAMA) {
  21372. if (!this.currentPano)
  21373. return;
  21374. t.push(s.filters.not(this.currentPano)),
  21375. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21376. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  21377. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  21378. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  21379. } else
  21380. t.push(s.filters.isOnVisibleFloor()),
  21381. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  21382. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  21383. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21384. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  21385. this.closestPano = i) : this.isPanoHover = !1
  21386. }
  21387. ,
  21388. n.prototype.dollhouseMode = function(e, t) {
  21389. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  21390. this.mode = u.DOLLHOUSE,
  21391. this.cameraControls.controls[u.DOLLHOUSE].reset();
  21392. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  21393. , n = new r.Vector3(15,10,15);
  21394. if (e && t) {
  21395. var o = d.FORWARD.clone().applyQuaternion(t)
  21396. , a = this.model.center.clone().sub(e)
  21397. , s = a.dot(o);
  21398. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  21399. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21400. }
  21401. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  21402. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  21403. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  21404. this.updateFromControls(),
  21405. this.model.alpha = 1,
  21406. this.model.skybox.material.uniforms.opacity.value = 0
  21407. }
  21408. ,
  21409. n.prototype.insideMode = function(e, t) {
  21410. var i = $.Deferred()
  21411. , n = t || null;
  21412. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  21413. var r = [s.filters.isPanoAligned()];
  21414. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  21415. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21416. this.flyToNewMode({
  21417. mode: u.PANORAMA,
  21418. pano: e,
  21419. callback: n
  21420. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21421. } else {
  21422. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21423. i.reject(o)
  21424. }
  21425. return i.promise()
  21426. }
  21427. ,
  21428. n.prototype.fitDollhouse = function(e, t, i) {
  21429. var n = d.FORWARD.clone().applyQuaternion(i);
  21430. this.cameraControls.activeControl.target.copy(n).add(e);
  21431. var o = d.RIGHT.clone().applyQuaternion(i)
  21432. , a = d.UP.clone()
  21433. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  21434. , l = this.model.boundingBox.max.clone()
  21435. , c = this.model.boundingBox.min.clone()
  21436. , h = [new r.Vector3(l.x,0,l.z).sub(e), new r.Vector3(l.x,0,c.z).sub(e), new r.Vector3(c.x,0,l.z).sub(e), new r.Vector3(c.x,0,c.z).sub(e)]
  21437. , u = 0
  21438. , p = 0
  21439. , g = 0;
  21440. h.forEach(function(e, t, i) {
  21441. var n = Math.abs(e.dot(o))
  21442. , r = e.dot(s);
  21443. n > u && (u = n,
  21444. p = r),
  21445. r > g && (g = r)
  21446. });
  21447. var m = Math.max(Math.abs(new r.Vector3(0,l.y,0).sub(e).dot(a)), Math.abs(new r.Vector3(0,c.y,0).sub(e).dot(a)))
  21448. , v = s.clone().multiplyScalar(p).add(t)
  21449. , A = s.clone().multiplyScalar(g).add(t);
  21450. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180)),
  21451. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180)),
  21452. p = Math.max(p, 10),
  21453. g = Math.max(g, 10);
  21454. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  21455. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  21456. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1,
  21457. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p)) : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  21458. }
  21459. ,
  21460. n.prototype.floorplanMode = function(e, t, i) {
  21461. this.mode = u.FLOORPLAN;
  21462. var n = this.cameraControls.controls[u.FLOORPLAN];
  21463. n.reset();
  21464. var r = e ? e : this.model.center;
  21465. if (n.target.copy(r).setY(0),
  21466. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  21467. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21468. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21469. t) {
  21470. var o = d.LEFT.clone().applyQuaternion(t);
  21471. n.rotateLeft(-Math.atan2(o.x, o.z))
  21472. } else
  21473. n.rotateToView(this.model.size, this.getDirection());
  21474. n.update(0)
  21475. }
  21476. ,
  21477. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  21478. return e.skipWarpingCheck = !0,
  21479. this.flyToPano(e, t)
  21480. }
  21481. ,
  21482. n.prototype.flyToPano = function(e, t) {
  21483. var i = e.pano
  21484. , n = e.lookAtPoint
  21485. , o = e.duration
  21486. , a = e.aimDuration
  21487. , s = e.maxDistanceOverride
  21488. , l = e.skipWarpingCheck
  21489. , c = e.constantMoveSpeed
  21490. , h = null
  21491. , p = null;
  21492. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  21493. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  21494. t && t(),
  21495. !1;
  21496. if (this.updateLastView(),
  21497. this.mode !== u.PANORAMA) {
  21498. var m;
  21499. return n && (m = (new r.Quaternion).setFromUnitVectors(d.FORWARD, n.sub(i.position).normalize())),
  21500. void this.flyToNewMode({
  21501. mode: u.PANORAMA,
  21502. pano: i,
  21503. duration: o,
  21504. quaternion: m,
  21505. callback: t
  21506. })
  21507. }
  21508. if (!i || (h = g.deepExtend(e),
  21509. p = function() {
  21510. N.delayOneFrame(function() {
  21511. this.flyToPano(h, t)
  21512. }
  21513. .bind(this))
  21514. }
  21515. .bind(this),
  21516. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  21517. var C = function(e) {
  21518. t && t(e)
  21519. }
  21520. .bind(this);
  21521. this.currentPano || (this.currentPano = i,
  21522. this.path.placeCpm(),
  21523. this.path.fadeOutCpm(f.path.fadeOutTime),
  21524. this.spider.draw());
  21525. var I = o;
  21526. if ("number" != typeof o) {
  21527. var E = s || f.transition.flytimeMaxDistanceThreshold;
  21528. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  21529. }
  21530. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  21531. 1 !== this.zoomLevel)
  21532. switch (f.zoom.transitionStyle) {
  21533. case 1:
  21534. this.smoothZoomToDefault(I / 2);
  21535. break;
  21536. case 2:
  21537. return h = g.deepExtend(e),
  21538. p = this.flyToPano.bind(this, h, t),
  21539. void this.smoothZoomToDefault(f.zoom.restoreTime * (this.zoomLevel - 1), p)
  21540. }
  21541. if (n) {
  21542. y.cancelById(V.LookTransition),
  21543. I *= f.transition.aimSlowFactor;
  21544. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  21545. , _ = (new r.Matrix4).lookAt(i.position, n, d.UP)
  21546. , T = (new r.Quaternion).setFromRotationMatrix(_)
  21547. , S = b.clone()
  21548. , M = new r.Vector3;
  21549. if (i === this.currentPano) {
  21550. var R = d.FORWARD.clone().applyQuaternion(b)
  21551. , P = d.FORWARD.clone().applyQuaternion(T)
  21552. , O = R.angleTo(P);
  21553. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  21554. void y.start(function(e) {
  21555. S.copy(b),
  21556. v.quaternion(S, T)(e),
  21557. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  21558. this.cameraControls.activeControl.lookAt(M)
  21559. }
  21560. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  21561. }
  21562. }
  21563. if (i === this.currentPano || this.flying)
  21564. return void C();
  21565. this.flying = !0;
  21566. var L = this.position.clone()
  21567. , D = this.currentPano;
  21568. F.debug("Flying to pano ", i.position),
  21569. this.emit(w.PanoChosen, this.currentPano, i),
  21570. this.emit(w.FlyingStarted, i.position, L, i, D),
  21571. n && y.start(function(e) {
  21572. S.copy(b),
  21573. v.quaternion(S, T)(e),
  21574. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  21575. this.cameraControls.activeControl.lookAt(M)
  21576. }
  21577. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  21578. var B = c ? null : A[f.transition.movementEasing];
  21579. this.nextPano = i,
  21580. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  21581. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  21582. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  21583. this.flying = !1,
  21584. this.currentPano !== i && this.currentPano.exit(),
  21585. i.enter(),
  21586. this.currentPano = i,
  21587. this.nextPano = null,
  21588. this.path.placeCpm(),
  21589. this.path.fadeOutCpm(f.path.fadeOutTime),
  21590. this.spider.draw(),
  21591. this.emit(w.FlyingEnded, i.position, L, i, D),
  21592. C(e)
  21593. }
  21594. .bind(this), 0, B, "camFly", V.FlyToPano)
  21595. }
  21596. }
  21597. ,
  21598. n.prototype.fastForwardActivePanoFlight = function(e) {
  21599. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  21600. y.adjustSpeed(V.FlyToPano, e),
  21601. y.adjustSpeed(V.LookTransition, e)
  21602. }
  21603. ,
  21604. n.prototype.flyToPanoClosestToMouse = function() {
  21605. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  21606. this.intersect && this.updateClosestPano(this.intersect)),
  21607. this.closestPano)
  21608. return this.flyToPano({
  21609. pano: this.closestPano
  21610. });
  21611. var e = this.getMouseDirection();
  21612. this.flyDirection(e) || this.flyToPano({
  21613. pano: this.currentPano
  21614. })
  21615. }
  21616. ,
  21617. n.prototype.flyLocalDirection = function(e) {
  21618. var t = this.getDirection(e)
  21619. , i = 1 === e.z ? .4 : .75
  21620. , n = 1 === Math.abs(e.x);
  21621. return this.flyDirection(t, i, n)
  21622. }
  21623. ,
  21624. n.prototype.flyDirection = function(e, t, i) {
  21625. this.closePopup();//xzw add
  21626. var n = $.Deferred();
  21627. this.history.invalidate();
  21628. var r = this.closestPanoInDirection(e, t, i);
  21629. return r ? this.flyToPano({
  21630. pano: r
  21631. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21632. n.resolve(!1)),
  21633. n.promise()
  21634. }
  21635. ,
  21636. n.prototype.closestPanoInDirection = function(e, t, i) {
  21637. return this.rankedPanoInDirection(0, e, t, i)
  21638. }
  21639. ,
  21640. n.prototype.rankedPanoInDirection = function() {
  21641. var e = {
  21642. pano: null,
  21643. candidates: []
  21644. };
  21645. return function(t, i, n, r) {
  21646. t || (t = 0),
  21647. n = void 0 !== n ? n : .75;
  21648. var o = r ? "angle" : "direction";
  21649. return this.model.panos.findRankedByScore(t, [s.filters.isPanoAligned(), s.filters.inPanoDirection(this.position, i, n), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.not(this.currentPano)], [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)], e),
  21650. this.cachedPanoCandidates = e.candidates,
  21651. e.pano
  21652. }
  21653. }(),
  21654. n.prototype.bump = function(e) {
  21655. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  21656. var t, i, n, r = f.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e), s = Math.abs(a) > .5;
  21657. if (s)
  21658. t = function() {
  21659. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  21660. }
  21661. .bind(this),
  21662. i = function() {
  21663. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  21664. }
  21665. .bind(this);
  21666. else {
  21667. var l = this.camera.position.clone()
  21668. , c = e.clone();
  21669. this.raycaster.set(l, c);
  21670. var h = this.model.floors.reduce(function(e, t) {
  21671. return e.concat(t.collider.children)
  21672. }, [])
  21673. , d = this.raycaster.intersectObjects(h)
  21674. , p = d.length > 0 ? d[0].distance / 25 : .04
  21675. , g = l.clone().add(c.multiplyScalar(p));
  21676. t = function() {
  21677. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  21678. }
  21679. .bind(this),
  21680. i = function() {
  21681. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  21682. }
  21683. .bind(this)
  21684. }
  21685. n = function() {
  21686. this.flying = !1
  21687. }
  21688. .bind(this),
  21689. this.flying = !0,
  21690. t()
  21691. }
  21692. }
  21693. ,
  21694. n.prototype.changeFloor = function(e) {
  21695. if (!this.is360View(this.mode, this.currentPano))
  21696. if (this.mode === u.PANORAMA) {
  21697. var t = this.history.reversePano(e);
  21698. t && t.isAligned() ? this.flyToPano({
  21699. pano: t
  21700. }) : this.changeFloorByScore(e)
  21701. } else
  21702. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21703. }
  21704. ,
  21705. n.prototype.changeFloorByScore = function() {
  21706. var e = {
  21707. pano: null,
  21708. candidates: []
  21709. };
  21710. return function(t) {
  21711. var i = this.model.nextFloor(t);
  21712. return i ? (this.model.panos.lowestByScore([s.filters.atFloor(i), s.filters.isPanoAligned()], [s.scoreFunctions.distance(this.currentPano), s.scoreFunctions.direction(this.position, new r.Vector3(0,t,0)), s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], e),
  21713. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  21714. this.history.push(t, this.currentPano),
  21715. this.flyToPano({
  21716. pano: e.pano
  21717. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  21718. }
  21719. }(),
  21720. n.prototype.gotoFloor = function(e) {
  21721. var t = e - this.model.currentFloor.floorIndex;
  21722. this.changeFloor(t)
  21723. }
  21724. ,
  21725. n.prototype.getDirection = function(e) {
  21726. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  21727. e.applyQuaternion(this.camera.quaternion)
  21728. }
  21729. ,
  21730. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  21731. if (o = o || $.Deferred(),
  21732. this.mode === u.TRANSITIONING)
  21733. return F.warn("should not be transitioning here"),
  21734. n && n(!1),
  21735. o.reject().promise();
  21736. var a = i || !1
  21737. , s = i ? i.position : this.position
  21738. , l = this.position.clone()
  21739. , c = this.currentPano;
  21740. if (F.debug("New pose in mode " + this.mode),
  21741. !e || (retryCallback = function() {
  21742. N.delayOneFrame(function() {
  21743. this.flyToSameMode(e, t, i, n, o)
  21744. }
  21745. .bind(this))
  21746. }
  21747. .bind(this),
  21748. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21749. var h = function() {
  21750. this.emit(w.FlyingEnded, s, l, e, c),
  21751. n && n(!0)
  21752. }
  21753. .bind(this)
  21754. , d = f[this.mode]
  21755. , p = void 0 !== t ? t : d.transitionTime
  21756. , g = new r.Vector3
  21757. , C = new r.Vector3;
  21758. if (this.emit(w.FlyingStarted, s, l, e, c),
  21759. this.mode === u.PANORAMA)
  21760. F.warn("we should not be here for panorama views");
  21761. else if (this.mode === u.DOLLHOUSE)
  21762. if (a) {
  21763. var I = new r.Vector3(0,1,0);
  21764. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  21765. this.model.warpDestFloors(i.floorVisibility),
  21766. C.copy(i.position);
  21767. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21768. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  21769. , _ = b.intersectObjects(this.model.colliders)
  21770. , T = 3;
  21771. _.length ? (g.copy(_[0].point),
  21772. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  21773. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21774. var x = (new r.Matrix4).lookAt(C, g, I)
  21775. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  21776. , M = g.distanceTo(C)
  21777. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  21778. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  21779. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  21780. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  21781. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  21782. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  21783. this.path.burnsDir = Math.sign(L.y);
  21784. var D = new r.Euler(0,0,0,f.warp.eOrder)
  21785. , B = new r.Vector3;
  21786. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  21787. y.start(function(e, t) {
  21788. D.x = P.x + e * L.x,
  21789. D.y = P.y + e * L.y,
  21790. D.z = P.z + e * L.z;
  21791. var i = O + e * (M - O);
  21792. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  21793. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  21794. }
  21795. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  21796. y.start(function(e, t) {
  21797. this.cameraControls.controls[u.DOLLHOUSE].update(),
  21798. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  21799. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  21800. }
  21801. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  21802. } else
  21803. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21804. else if (this.path.placeCpm(),
  21805. this.path.fadeInCpm(f.path.fadeInTime),
  21806. i) {
  21807. this.model.warpDestFloors(i.floorVisibility);
  21808. var U = this.cameraControls.cameras[u.FLOORPLAN]
  21809. , k = this.cameraControls.controls[u.FLOORPLAN]
  21810. , H = k.target.clone()
  21811. , G = i.position.clone().sub(H)
  21812. , z = U.position.clone().sub(k.target)
  21813. , W = z.length()
  21814. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21815. , Y = Math.atan2(k.offset.x, k.offset.z)
  21816. , X = Math.atan2(j.x, j.z)
  21817. , Z = k.absoluteScale
  21818. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  21819. y.start(function(e, t) {
  21820. k.target.copy(G).multiplyScalar(e).add(H);
  21821. var i = Y + (X - Y) * e;
  21822. k.offset.x = W * Math.sin(i),
  21823. k.offset.z = W * Math.cos(i),
  21824. U.position.copy(k.target).add(k.offset),
  21825. k.absoluteScale = Z + e * (q - Z),
  21826. k.update(),
  21827. this.quaternion.copy(U.quaternion),
  21828. this.position.copy(U.position),
  21829. this.target.copy(k.target),
  21830. this.camera.projectionMatrix.copy(U.projectionMatrix)
  21831. }
  21832. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  21833. } else
  21834. F.info("flyToSameMode() funny floorplan view? skipping");
  21835. return y.setTimeout(function(e) {
  21836. this.mode = e,
  21837. h(),
  21838. o.resolve(!0)
  21839. }
  21840. .bind(this, this.mode), p, V.FlyToSameMode),
  21841. this.mode = u.TRANSITIONING,
  21842. o.promise()
  21843. }
  21844. }
  21845. ,
  21846. n.prototype.flyToNewMode = function(e, t) {
  21847. e = e || {};
  21848. var i = e.mode
  21849. , n = e.pano
  21850. , o = e.duration
  21851. , a = e.warpDest
  21852. , s = e.callback
  21853. , l = e.force
  21854. , c = e.quaternion;
  21855. if (t = t || $.Deferred(),
  21856. this.isWarping())
  21857. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21858. s && s(!1),
  21859. t.reject("Cannot change mode during tour transition").promise();
  21860. if (this.mode === u.TRANSITIONING)
  21861. return s && s(!1),
  21862. t.reject("Cannot change mode during mode transition").promise();
  21863. if (i === this.mode)
  21864. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21865. t.promise()) : (s && s(!1),
  21866. t.reject("Already in " + i + " mode").promise());
  21867. var h = a || !1;
  21868. F.debug("Switching mode to " + i);
  21869. var d = function() {
  21870. N.delayOneFrame(function() {
  21871. this.flyToNewMode(e, t)
  21872. }
  21873. .bind(this))
  21874. }
  21875. .bind(this);
  21876. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  21877. return t.promise();
  21878. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21879. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21880. this.model.waitForLoad(this.model, function() {
  21881. return this.model.meshTexturesLoaded;
  21882. }
  21883. .bind(this)),
  21884. this.model.loadMeshTextures().done(d),
  21885. t.promise();
  21886. this.history.invalidate(),
  21887. this.updateLastView();
  21888. var p = this.mode
  21889. , C = this.cameraControls.cameras[i];
  21890. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  21891. var I = void 0 !== o ? o : e.transitionTime;
  21892. this.emit(w.ModeChanging, p, i, n),
  21893. n && (this.currentPano = n),
  21894. this.switchCameraMode(i, c),
  21895. y.cancelById(V.LookTransition);
  21896. var _ = (new r.Vector3).copy(this.position);
  21897. if (i === u.PANORAMA)
  21898. this.emit(w.PanoChosen, n, n),
  21899. setTimeout(function() {
  21900. n.floor.enter(i)
  21901. }
  21902. .bind(this), I / 2),
  21903. this.path.fadeOutCpm(f.path.fadeOutTime);
  21904. else if (i === u.DOLLHOUSE) {
  21905. if (h && (this.model.stayPut = !0),
  21906. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  21907. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  21908. this.path.placeCpm(),
  21909. this.path.fadeInCpm(f.path.fadeInTime),
  21910. h) {
  21911. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  21912. _.set(15, 10, 15);
  21913. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  21914. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  21915. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  21916. P.length ? (T.copy(P[0].point),
  21917. _.copy(a.position),
  21918. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(.75 * _.distanceTo(T), !0)) : (F.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion),
  21919. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  21920. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  21921. _.add(this.model.position),
  21922. C.position.copy(_),
  21923. this.cameraControls.controls[u.DOLLHOUSE].update()
  21924. }
  21925. } else if (this.path.placeCpm(),
  21926. this.path.fadeInCpm(f.path.fadeInTime),
  21927. a) {
  21928. this.model.warpDestFloors(a.floorVisibility);
  21929. var O = this.cameraControls.cameras[u.FLOORPLAN]
  21930. , L = this.cameraControls.controls[u.FLOORPLAN]
  21931. , D = O.position.clone().sub(L.target)
  21932. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  21933. , U = Math.atan2(B.x, B.z);
  21934. L.target.copy(a.position);
  21935. var k = D.length();
  21936. L.offset.x = k * Math.sin(U),
  21937. L.offset.y = 0,
  21938. L.offset.z = k * Math.cos(U),
  21939. O.position.copy(L.target).add(L.offset);
  21940. L.target.clone().sub(C.position);
  21941. C.quaternion.copy(a.quaternion),
  21942. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  21943. L.absoluteScale = L.currentScale,
  21944. L.update()
  21945. } else
  21946. this.model.currentFloor.enter(i);
  21947. var H = this.currentPano
  21948. , G = this.position.clone();
  21949. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  21950. this.flying = !0,
  21951. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  21952. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21953. C.controls.update()),
  21954. e.blackoutStyle = S.FADEIN,
  21955. I = f.show360Views.transitionTime,
  21956. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  21957. this.mode = i,
  21958. this.path && this.path.popOutCpm(),
  21959. e.blackoutStyle = S.END,
  21960. I = f.show360Views.transitionTime,
  21961. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  21962. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  21963. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  21964. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  21965. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  21966. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  21967. y.setTimeout(function() {
  21968. this.flying = !1,
  21969. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  21970. this.currentPano.enter(),
  21971. this.path.placeCpm(),
  21972. this.path.fadeOutCpm(f.path.fadeOutTime),
  21973. this.spider.draw()),
  21974. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  21975. this.mode = i,
  21976. this.emit(w.FlyingEnded, _, G, this.currentPano, H),
  21977. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  21978. t.resolve())
  21979. }
  21980. .bind(this), I, V.FlyToNewMode),
  21981. this.mode = u.TRANSITIONING,
  21982. t.promise()
  21983. }
  21984. ,
  21985. n.prototype.fade360View = function(e, t, i) {
  21986. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21987. $(this.domElement).fadeOut(.5 * e, function() {
  21988. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21989. this.model.alpha = i.modelAlpha,
  21990. this.position.copy(t.position),
  21991. this.quaternion.copy(t.quaternion),
  21992. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21993. $(this.domElement).fadeIn(.5 * e)
  21994. }
  21995. .bind(this))
  21996. }
  21997. ,
  21998. n.prototype.findDefaultViews = function() {
  21999. this.findDefaultView(this.lastInsideView, !0),
  22000. this.findDefaultView(this.last360View, !1)
  22001. }
  22002. ,
  22003. n.prototype.findDefaultView = function(e, t) {
  22004. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22005. if (e.cameraMode !== u.PANORAMA)
  22006. return !1;
  22007. var i = r.get(e.panoId);
  22008. return i && i.isAligned() === t
  22009. });
  22010. o >= 0 ? (i = r.get(n[o].panoId),
  22011. e.update({
  22012. cameraMode: u.PANORAMA,
  22013. pano: i,
  22014. position: n[o].position,
  22015. quaternion: n[o].quaternion
  22016. })) : (o = r.list.findIndex(function(e) {
  22017. return e.isAligned() === t
  22018. }),
  22019. o >= 0 ? (i = r.list[o],
  22020. e.update({
  22021. cameraMode: u.PANORAMA,
  22022. pano: i,
  22023. position: i.position
  22024. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  22025. }
  22026. ,
  22027. n.prototype.updateLastView = function() {
  22028. if (this.mode === u.PANORAMA) {
  22029. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  22030. e.update({
  22031. pano: this.currentPano,
  22032. position: this.position,
  22033. quaternion: this.quaternion
  22034. })
  22035. }
  22036. }
  22037. ,
  22038. n.prototype.goToLastView = function(e, t) {
  22039. var i = $.Deferred()
  22040. , n = i.resolve.bind(i)
  22041. , r = i.reject.bind(i)
  22042. , o = e ? this.lastInsideView : this.last360View;
  22043. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22044. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22045. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22046. mode: o.cameraMode,
  22047. pano: o.pano,
  22048. quaternion: o.quaternion,
  22049. callback: t
  22050. }).done(n).fail(r),
  22051. i.promise()
  22052. }
  22053. ,
  22054. n.prototype.fadeToView = function(e, t, i, n) {
  22055. var r = $.Deferred()
  22056. , o = r.resolve.bind(r)
  22057. , a = r.reject.bind(r);
  22058. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  22059. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  22060. a("Cannot go to illegal view"),
  22061. r.promise();
  22062. var s = (f[t.cameraMode],
  22063. function() {
  22064. $(this.domElement).fadeIn(.5 * i),
  22065. n && n(),
  22066. o()
  22067. }
  22068. .bind(this))
  22069. , l = e ? S.FADEIN : S.END;
  22070. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22071. $(this.domElement).fadeOut(.5 * i, function() {
  22072. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  22073. t.cameraMode === u.PANORAMA ? this.flyToPano({
  22074. pano: t.pano,
  22075. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22076. duration: 0
  22077. }, s) : this.flyToNewMode({
  22078. mode: t.cameraMode,
  22079. quaternion: t.quaternion,
  22080. duration: 0,
  22081. callback: s
  22082. })
  22083. }
  22084. .bind(this)),
  22085. r.promise()
  22086. }
  22087. ,
  22088. n.prototype.startWarp = function(e, t, i, n, r, o) {
  22089. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22090. this.flying)
  22091. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  22092. o && o(),
  22093. !1;
  22094. null !== e && void 0 !== e || (e = b.Show),
  22095. this.history.invalidate(),
  22096. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  22097. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22098. return this.emit(w.WarpStarted, a, i, n, r),
  22099. n = n || S.MIDDLE,
  22100. this.path.warpToPano(i, n, r, function() {
  22101. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  22102. this.emit(w.WarpEnded, i),
  22103. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22104. o && o()
  22105. }
  22106. .bind(this)),
  22107. e === b.Hide && this.path.discardPathObject(),
  22108. !0
  22109. }
  22110. ,
  22111. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22112. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22113. s && s(),
  22114. !1)
  22115. }
  22116. ,
  22117. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22118. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22119. a && a(),
  22120. !1)
  22121. }
  22122. ,
  22123. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22124. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22125. }
  22126. ,
  22127. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22128. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22129. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22130. t && t(),
  22131. !1)
  22132. }
  22133. ,
  22134. n.prototype.aimTourCamera = function(e, t, i, n) {
  22135. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22136. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22137. }
  22138. ,
  22139. n.prototype.showPathToHeroLocation = function(e) {
  22140. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  22141. }
  22142. ,
  22143. n.prototype.tourInterlude = function(e, t) {
  22144. this.history.invalidate();
  22145. this.path.discardSlow();
  22146. //xzw:
  22147. var a = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid];
  22148. var rotTime = a && a.time;
  22149. this.path.waitNextStep(e, function() {
  22150. t && t()
  22151. }.bind(this), rotTime)
  22152. }
  22153. ,
  22154. n.prototype.stopInterlude = function() {
  22155. this.interruptAndFastForward(null, 0)
  22156. }
  22157. ,
  22158. n.prototype.interruptAndFastForward = function(e, t) {
  22159. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  22160. this.flying && this.emit(w.FlyingInterrupted),
  22161. this.path.interruptAndFastForward(e, t)
  22162. }
  22163. ,
  22164. n.prototype.setSize = function(e, t) {
  22165. var i = e / t;
  22166. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  22167. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  22168. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  22169. for (var r in this.cameraControls.cameras) {
  22170. var o = this.cameraControls.cameras[r];
  22171. o.fov = this.baseFov * (1 / this.zoomLevel),
  22172. o.updateAspect(i)
  22173. }
  22174. }
  22175. ,
  22176. n.prototype.toJSON = function() {
  22177. var e = {};
  22178. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  22179. e.camera_mode = u.toInt(this.mode),
  22180. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22181. return e.hidden ? 0 : 1
  22182. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  22183. e) : e
  22184. }
  22185. ,
  22186. n.prototype.getCurrentNodePanos = function(e) {
  22187. this.model.panos.map;
  22188. if (e.length = 0,
  22189. this.path.nodes)
  22190. for (var t = 0; t < this.path.nodes.length; t++) {
  22191. var i = this.path.nodes[t];
  22192. e.push(this.model.panos.get(i))
  22193. }
  22194. }
  22195. ,
  22196. n.prototype.zoomIncrementally = function(e) {
  22197. var t = this.zoomLevel;
  22198. this.zoomTo(this.zoomLevel + e),
  22199. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22200. }
  22201. ,
  22202. n.prototype.zoomInIncrementally = function(e) {
  22203. e = e || this.defaultZoomIncrement,
  22204. this.zoomIncrementally(e)
  22205. }
  22206. ,
  22207. n.prototype.zoomOutIncrementally = function(e) {
  22208. e = e || -this.defaultZoomIncrement,
  22209. this.zoomIncrementally(e)
  22210. }
  22211. ,
  22212. n.prototype.zoomBy = function(e) {
  22213. this.zoomTo(this.zoomLevel * e)
  22214. }
  22215. ,
  22216. n.prototype.zoomIn = function() {
  22217. this.zoomBy(1 + this.zoomSpeed)
  22218. }
  22219. ,
  22220. n.prototype.zoomOut = function() {
  22221. this.zoomBy(1 - this.zoomSpeed)
  22222. }
  22223. ,
  22224. n.prototype.zoomTo = function(e, t) {
  22225. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  22226. if (e < f.zoom.min && (e = f.zoom.min),
  22227. e > f.zoom.max && (e = f.zoom.max),
  22228. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  22229. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  22230. e === f.zoom.min && this.emit(O.ZoomMin)),
  22231. this.cameraControls.activeControl) {
  22232. var i = this.cameraControls.activeControl.camera;
  22233. this.zoomLevel = e,
  22234. i.fov = this.baseFov * (1 / this.zoomLevel),
  22235. i.updateProjectionMatrix(),
  22236. this.zoomFov = i.fov
  22237. }
  22238. }
  22239. }
  22240. ,
  22241. n.prototype.increaseZoomSpeed = function() {
  22242. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22243. }
  22244. ,
  22245. n.prototype.decreaseZoomSpeed = function() {
  22246. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22247. }
  22248. ,
  22249. n.prototype.clampZoomSpeed = function(e) {
  22250. return e < 0 ? 0 : e
  22251. }
  22252. ,
  22253. n.prototype.activatePersistentZooming = function(e) {
  22254. this.zooming = e ? 1 : -1
  22255. }
  22256. ,
  22257. n.prototype.deactivatePersistentZooming = function() {
  22258. this.zooming = 0
  22259. }
  22260. ,
  22261. n.prototype.zoomDefault = function() {
  22262. this.zoomTo(1, !0)
  22263. }
  22264. ,
  22265. n.prototype.smoothZoomToDefault = function(e, t) {
  22266. var i, n = this.zoomLevel, r = function(e) {
  22267. e > 1 && (e = 1),
  22268. i = n * (1 - e) + e,
  22269. this.zoomTo(i, !0)
  22270. }
  22271. .bind(this), o = function() {
  22272. this.zoomDefault(),
  22273. t && window.setTimeout(t, 50)
  22274. }
  22275. .bind(this);
  22276. y.start(r, e, o, null, 0, A[f.transition.blendEasing])
  22277. }
  22278. ,
  22279. n.prototype.updateZoomPano = function() {
  22280. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  22281. var e = this.currentPano;
  22282. if (e) {
  22283. var t = this.zoomLevel > f.zoom.activationThreshold
  22284. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  22285. , n = !i && !this.isWarping()
  22286. , r = t && n;
  22287. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  22288. this.panoRenderer.setZoomingActive(r, e, !0);
  22289. var o = function(e, t) {
  22290. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22291. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22292. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22293. e.setZoomed(t)
  22294. }
  22295. .bind(this);
  22296. r && !e.zoomed ? (o(e, !0),
  22297. this.panoRenderer.enableUltraHighQualityMode(function() {
  22298. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  22299. r && o(e, !0)
  22300. }
  22301. .bind(this))) : !t && e.zoomed && o(e, !1)
  22302. }
  22303. }
  22304. }
  22305. ,
  22306. t.exports = n
  22307. }
  22308. ).call(this, "/js/player.js")
  22309. }
  22310. , {
  22311. "./constants": 8,
  22312. "./enum/AlignmentType": 17,
  22313. "./enum/BlackoutStyle": 18,
  22314. "./enum/ControlEvents": 21,
  22315. "./enum/Keys": 30,
  22316. "./enum/ModelManagerEvents": 33,
  22317. "./enum/PanoSizeClass": 36,
  22318. "./enum/PanoramaEvents": 37,
  22319. "./enum/PathDiscardMode": 38,
  22320. "./enum/PathDisplayMode": 39,
  22321. "./enum/PlayerEvents": 40,
  22322. "./enum/TagStates": 44,
  22323. "./enum/Vectors": 50,
  22324. "./enum/Viewmode": 51,
  22325. "./enum/WarpStyle": 52,
  22326. "./enum/ZoomEvents": 53,
  22327. "./exception/BasicException": 55,
  22328. "./model/ModelManager": 140,
  22329. "./objects/NSpider": 147,
  22330. "./objects/Panorama": 148,
  22331. "./objects/Reticule": 149,
  22332. "./objects/ShowPath": 151,
  22333. "./objects/Snapshot": 153,
  22334. "./objects/View": 154,
  22335. "./settings": 166,
  22336. "./shaders": 167,
  22337. "./tile/TileDownloader": 171,
  22338. "./tile/TilePrioritizer": 172,
  22339. "./util/ZoomStats": 179,
  22340. "./util/browser": 182,
  22341. "./util/camera": 183,
  22342. "./util/cameraLight": 184,
  22343. "./util/common": 185,
  22344. "./util/easing": 186,
  22345. "./util/history": 187,
  22346. "./util/lerp": 188,
  22347. "./util/logger": 189,
  22348. "./util/math": 190,
  22349. "./util/transitions": 195,
  22350. "hot":"hot",
  22351. "scaleImg":"scaleImg",
  22352. events: 202,
  22353. three: 217
  22354. }],
  22355. "scaleImg":[function(t, e){// xzw
  22356. var OUTPUT = e;
  22357. (function(){function t(t,a,i,r){function h(){B="object"==typeof i?i:a.src||r?u:document.createElement("canvas"),B.width=s,B.height=f,G=B.getContext("2d")}
  22358. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  22359. i[e]=t[e]*it|0,i[e+1]=t[e+1]*it|0,i[e+2]=t[e+2]*it|0,i[e+3]=t[e+3]*it|0;return delete t,a}
  22360. return G.getImageData(0,0,s,f)}
  22361. function o(t,e,a,i,r){return.5*(i-e+(2*e-5*a+4*i-r+(3*(a-i)+r-e)*t)*t)*t+a}
  22362. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  22363. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  22364. u.width=a.naturalWidth,u.height=a.naturalHeight;else if(null!=a.runtimeStyle){var l=a.runtimeStyle,c=l.width,g=l.height;l.width="auto",l.height="auto",u.width=a.width,u.height=a.height,l.width=c,l.height=g}else{var c=a.width,g=a.height;a.removeAttribute&&(a.removeAttribute("width"),a.removeAttribute("height")),u.width=a.width,u.height=a.height,a.width=c,a.height=g}
  22365. else
  22366. u=a;d=u.getContext("2d"),a.src&&d.drawImage(a,0,0);var s,f,m=u.width,w=u.height,p=d.getImageData(0,0,m,w).data;if(!m||!w)
  22367. return!1;(a.src||r)&&u.clearRect(0,0,m,w),"object"==typeof t?t.width?(s=t.width+.5|0,f=t.height+.5|0):(s=m*t.scaleX+.5|0,f=w*t.scaleY+.5|0):(s=t*m+.5|0,f=t*w+.5|0);var v,b,y,x,D,I,A,j,R,k,C,E,F,L,S,U,W,H,alpha,X,Y,q,z,B,G,J,K,M,N,O,P,Q,T,V,Z,$=s<<2,_=m<<2,tt=0,et=0,at=$*f,it=255.99/255,rt=s/m,ht=f/w,nt=rt*ht;if(rt>1||ht>1)
  22368. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  22369. for(b=x/ht,R=0|b,q=b-R,N=R*_,M=1>R?N:N-_,w-2>R?(O=N+_,P=(R+2)*_):O=P=R>w-2?N:N+_,y=0;s>y;y++,et+=4)
  22370. v=y/rt,j=0|v,z=v-j,T=j<<2,Q=1>j?T:T-4,m-2>j?(V=T+4,Z=T+8):V=Z=j>m-2?T:T+4,H=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,X=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,Y=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,alpha=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,K[et]=H>=0?256>H?H:255:0,K[et+1]=X>=0?256>X?X:255:0,K[et+2]=Y>=0?256>Y?Y:255:0,K[et+3]=alpha>=0?256>alpha?alpha:255:0;else{if(e.Float32Array)
  22371. W=new Float32Array(at);else
  22372. for(W=[],et=0;at>et;++et)
  22373. W[et]=0;for(b=0;w>b;b++)
  22374. for(x=b*ht,A=0|x,D=A*$,U=!!((A-(x+ht|0))*(w-1-b))<<1,U&&(F=A+1-x,L=x+ht-A-1),v=0;m>v;v++,tt+=4)
  22375. switch(y=v*rt,I=0|y,et=D+(I<<2),S=!!((I-(y+rt|0))*(m-1-v)),S&&(C=I+1-y,E=y+rt-I-1),H=p[tt],X=p[tt+1],Y=p[tt+2],alpha=p[tt+3],S+U){case 0:W[et]+=H*nt,W[et+1]+=X*nt,W[et+2]+=Y*nt,W[et+3]+=alpha*nt;break;case 1:k=C*ht,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*ht,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;break;case 2:k=rt*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=rt*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k;break;default:k=C*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*F,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k,k=C*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*L,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;}
  22376. delete p,h(),J=n(W)}
  22377. if(G.putImageData(J,0,0),"string"==typeof i){if("png"===i||"jpeg"===i){var ot;return ot=r&&a.src?a:new Image,ot.width=s,ot.height=f,ot.src=B.toDataURL("image/"+i,0.85),ot}
  22378. if("png-src"===i||"jpeg-src"===i)
  22379. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  22380. return B}
  22381. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  22382. OUTPUT.exports = c;
  22383. }, {}
  22384. ],
  22385. 156: [function(e, t, i) {
  22386. (function(i) {
  22387. "use strict";
  22388. function n(e, t) {
  22389. this.model = e,
  22390. this.panos = e.panos,
  22391. this.player = t,
  22392. this.imagePanos = this.listImagePanos(),
  22393. this.retryMinimumTime = 1e4
  22394. }
  22395. var r = (e("three"),
  22396. e("./enum/Viewmode"))
  22397. , o = (e("./settings"),
  22398. e("./objects/Panorama"))
  22399. , a = e("./util/logger")
  22400. , s = new a(i);
  22401. n.prototype.start = function() {
  22402. this.loadNextPano(function(e) {
  22403. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  22404. setTimeout(function() {
  22405. this.start()
  22406. }
  22407. .bind(this), 1e3))
  22408. }
  22409. .bind(this))
  22410. }
  22411. ,
  22412. n.prototype.validLoadTarget = function(e) {
  22413. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22414. }
  22415. ,
  22416. n.prototype.listImagePanos = function() {
  22417. var e = []
  22418. , t = this;
  22419. return this.model.images.forEach(function(i) {
  22420. if (i.metadata && i.metadata.scan_id) {
  22421. var n = t.model.panos.get(i.metadata.scan_id);
  22422. n && !n.isLoaded("high") && e.push(n)
  22423. }
  22424. }),
  22425. e
  22426. }
  22427. ,
  22428. n.prototype.nextNotLoadedImage = function() {
  22429. for (; this.imagePanos.length > 0; ) {
  22430. var e = this.imagePanos[0];
  22431. if (!e.isLoaded("high"))
  22432. return e;
  22433. this.imagePanos.shift()
  22434. }
  22435. return null
  22436. }
  22437. ,
  22438. n.prototype.loadNextPano = function(e) {
  22439. var t, i, n = this.model.waitQueue.filter(function(e) {
  22440. return e.object instanceof o
  22441. });
  22442. n.length > 0 ? (t = n[0].object,
  22443. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22444. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22445. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22446. t = this.imagePanos[0],
  22447. s.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode === r.PANORAMA && (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())]),
  22448. t && s.debug("Normal pano selection: neighbor " + t.id)),
  22449. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22450. s.debug("Preloading " + i + "-res pano " + t.id),
  22451. t.loadCube(i).done(e).fail(function() {
  22452. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22453. e()
  22454. })) : e && e(null)
  22455. }
  22456. ,
  22457. t.exports = n
  22458. }
  22459. ).call(this, "/js/preloaders.js")
  22460. }
  22461. , {
  22462. "./enum/Viewmode": 51,
  22463. "./objects/Panorama": 148,
  22464. "./settings": 166,
  22465. "./util/logger": 189,
  22466. three: 217
  22467. }],
  22468. 157: [function(e, t, i) {
  22469. (function(i) {
  22470. "use strict";
  22471. function n(e, t, i, n, r) {
  22472. this.qualityManager = e,
  22473. this.scene = t,
  22474. this.camera = i,
  22475. this.container = r,
  22476. this.controls = n,
  22477. this.controls.enabled = !0,
  22478. this.controls.locked = !0,
  22479. this.quickstartCamera = n.camera,
  22480. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  22481. this.skybox = null
  22482. }
  22483. var r = e("three")
  22484. , o = e("../util/logger")
  22485. , a = e("../constants")
  22486. , s = (e("../util/transitions"),
  22487. e("../util/lerp"),
  22488. e("../util/easing"),
  22489. e("../enum/Vectors"))
  22490. , l = e("../enum/PanoSizeClass")
  22491. , c = (e("../materials/ModelTextureMaterial"),
  22492. e("../materials/CubemapMaterial"))
  22493. , h = (e("../cameras/PanoramaCamera"),
  22494. e("../controls/PanoramaControls"),
  22495. e("../tile/TileUtils"),
  22496. e("../util/camera"),
  22497. e("../util/cameraLight"))
  22498. , u = (e("../util/browser"),
  22499. e("../settings"),
  22500. e("../gui/helpManager"),
  22501. new o(i));
  22502. n.prototype.load = function(e) {
  22503. e.pano.shouldRedrawOnBaseLoaded = !0;
  22504. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22505. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22506. var a = this.qualityManager.getPanoSize(l.BASE)
  22507. , c = this.qualityManager.getPanoSize(l.STANDARD);
  22508. if (e.pano.tiled) {
  22509. u.warn("Loading startPano, TILED", e.pano.id);
  22510. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22511. , p = this.quickstartCamera.fov;
  22512. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  22513. t = e.pano.loadTiledPano(c, r, {
  22514. hFov: d,
  22515. vFov: p
  22516. }, !1, !1, !0),
  22517. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22518. } else
  22519. u.warn("Loading startPano", e.pano.id),
  22520. t = e.pano.loadCube("high");
  22521. return $.when(t).then(function() {
  22522. n.init(e.pano, e.quaternion),
  22523. e.pano.tiled ? i.done(function() {
  22524. e.pano.lockUntilRenderingComplete = !1,
  22525. this.controls.locked = !1
  22526. }
  22527. .bind(this)) : this.controls.locked = !1
  22528. }
  22529. .bind(this))
  22530. }
  22531. ,
  22532. n.prototype.init = function(e, t) {
  22533. u.info("Quickstart done loading, adding scene objects"),
  22534. e.lockUntilRenderingComplete = !0,
  22535. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  22536. side: r.BackSide
  22537. })),
  22538. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22539. this.skybox.quaternion.copy(e.quaternion),
  22540. this.scene.add(this.skybox),
  22541. $(this.container).show()
  22542. }
  22543. ,
  22544. n.prototype.update = function(e) {
  22545. this.controls.update(e),
  22546. this.camera.copy(this.quickstartCamera)
  22547. }
  22548. ,
  22549. n.prototype.setSize = function(e, t) {
  22550. this.quickstartCamera.updateAspect(e / t)
  22551. }
  22552. ,
  22553. n.prototype.destroy = function() {
  22554. this.scene.remove(this.skybox)
  22555. }
  22556. ,
  22557. t.exports = n
  22558. }
  22559. ).call(this, "/js/scene/QuickstartManager.js")
  22560. }
  22561. , {
  22562. "../cameras/PanoramaCamera": 7,
  22563. "../constants": 8,
  22564. "../controls/PanoramaControls": 13,
  22565. "../enum/PanoSizeClass": 36,
  22566. "../enum/Vectors": 50,
  22567. "../gui/helpManager": 68,
  22568. "../materials/CubemapMaterial": 117,
  22569. "../materials/ModelTextureMaterial": 118,
  22570. "../settings": 166,
  22571. "../tile/TileUtils": 174,
  22572. "../util/browser": 182,
  22573. "../util/camera": 183,
  22574. "../util/cameraLight": 184,
  22575. "../util/easing": 186,
  22576. "../util/lerp": 188,
  22577. "../util/logger": 189,
  22578. "../util/transitions": 195,
  22579. three: 217
  22580. }],
  22581. 158: [function(e, t, i) {
  22582. "use strict";
  22583. function n(e, t, i) {
  22584. this.scene = e,
  22585. this.camera = t,
  22586. this.renderer = null,
  22587. this.effects = i,
  22588. this.animateCallback = null,
  22589. this.composer = null,
  22590. this.qualityManager = null,
  22591. e.renderWidth = 0,
  22592. e.renderHeight = 0,
  22593. this.updateClock = new r.Clock,
  22594. this.components = [],
  22595. this.updateListeners = [],
  22596. this.resizeListeners = [],
  22597. this.forceUpdateSize = !1,
  22598. this.started = !1,
  22599. this.textures = {},
  22600. this.suspendedObjects = []
  22601. }
  22602. var r = e("three")
  22603. , o = e("../shaders")
  22604. , a = e("../enum/SceneRendererEvents")
  22605. , s = e("../enum/GLTextureType")
  22606. , l = e("../enum/GLCubeFaces")
  22607. , c = e("../exception/BasicException")
  22608. , h = e("../exception/RendererCreationException")
  22609. , u = e("../settings")
  22610. , d = e("events").EventEmitter;
  22611. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22612. n.prototype = Object.create(d.prototype),
  22613. n.prototype.addComponent = function(e) {
  22614. this.components.push(e),
  22615. e.update && this.updateListeners.push(e),
  22616. e.setSize && (this.resizeListeners.push(e),
  22617. this.forceUpdateSize = !0)
  22618. }
  22619. ,
  22620. n.prototype.removeComponent = function(e) {
  22621. var t = function(t) {
  22622. return t !== e
  22623. };
  22624. this.components = this.components.filter(t),
  22625. this.updateListeners = this.updateListeners.filter(t),
  22626. this.resizeListeners = this.resizeListeners.filter(t)
  22627. }
  22628. ,
  22629. n.prototype.start = function(e) {
  22630. if (this.started)
  22631. throw new c("Can't start SceneRenderer, already started");
  22632. this.createContext(e),
  22633. this.initComposer(),
  22634. this.started = !0,
  22635. (p = p.bind(this))()
  22636. }
  22637. ,
  22638. n.prototype.createContext = function(e) {
  22639. try {
  22640. this.renderer = new r.WebGLRenderer,
  22641. this.renderer.autoClear = !0,
  22642. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22643. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  22644. this.emit(a.ContextCreated)
  22645. } catch (e) {
  22646. throw new h("Unable to create a WebGL rendering context")
  22647. }
  22648. u.profiling.enabled && this.overrideTextures(),
  22649. e.appendChild(this.renderer.domElement)
  22650. }
  22651. ,
  22652. n.prototype.overrideTextures = function() {
  22653. var e = this.renderer.context
  22654. , t = 0
  22655. , i = e.createTexture;
  22656. e.createTexture = function() {
  22657. var n = i.call(e);
  22658. return n.id = t++,
  22659. this.textures[n.id] = n,
  22660. n
  22661. }
  22662. .bind(this);
  22663. var n = e.texImage2D;
  22664. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  22665. var d, p = this.getTextureTypeFromTarget(e, t);
  22666. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  22667. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  22668. h = a,
  22669. u = l,
  22670. o = u.naturalWidth,
  22671. a = u.naturalHeight,
  22672. n.call(e, t, i, r, c, h, u));
  22673. var f = this.textures[d.id];
  22674. f.width = p === s.TextureCube ? 6 * o : o,
  22675. f.height = a
  22676. }
  22677. .bind(this);
  22678. var r = e.deleteTexture;
  22679. e.deleteTexture = function(t) {
  22680. delete this.textures[t.id],
  22681. r.call(e, t)
  22682. }
  22683. .bind(this)
  22684. }
  22685. ,
  22686. n.prototype.updateTextureMemory = function() {
  22687. var e = null;
  22688. return function() {
  22689. var t = 0;
  22690. for (var i in this.textures) {
  22691. var n = this.textures[i];
  22692. n.width && n.height && (t += n.width * n.height * 4)
  22693. }
  22694. t !== e && this.emit(a.MemoryUsageUpdated, t),
  22695. e = t
  22696. }
  22697. }(),
  22698. n.prototype.getTextureTypeFromTarget = function(e, t) {
  22699. switch (t) {
  22700. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22701. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22702. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22703. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22704. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22705. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22706. return s.TextureCube;
  22707. case e.TEXTURE_2D:
  22708. return s.Texture2D;
  22709. default:
  22710. return null
  22711. }
  22712. }
  22713. ,
  22714. n.prototype.initComposer = function() {
  22715. this.composer = new r.EffectComposer(this.renderer),
  22716. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  22717. this.composer.addPass(this.effects.hblurPass),
  22718. this.composer.addPass(this.effects.vblurPass)
  22719. }
  22720. ,
  22721. n.prototype.setSize = function(e, t, devicePixelRatio) {
  22722. this.renderWidth = e,
  22723. this.renderHeight = t,
  22724. this.effects.aspect = e / t,
  22725. /* this.renderer.setSize(e, t), -----MP */
  22726. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  22727. this.composer.setSize(e, t);
  22728. for (var i = 0; i < this.resizeListeners.length; i++)
  22729. this.resizeListeners[i].setSize(e, t)
  22730. }
  22731. ,
  22732. n.prototype.render = function() {
  22733. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22734. }
  22735. ,
  22736. /* n.prototype.updateScreenSize = function() {----MP
  22737. ($("#player").width() !== this.renderWidth || $("#player").height() !== this.renderHeight || this.forceUpdateSize) && (this.setSize($("#player").width(), $("#player").height()),
  22738. this.forceUpdateSize = !1)
  22739. } */
  22740. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  22741. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  22742. return function(o){
  22743. var render = false;
  22744. var ratio;
  22745. var w, h; //记录应当render的大小
  22746. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  22747. w = o.width, h = o.height, render = true, ratio=1;
  22748. }else{
  22749. w = $('#player').width();
  22750. h = $('#player').height();
  22751. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  22752. (w !== W || h !== H || this.forceUpdateSize) &&
  22753. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  22754. }
  22755. if(render){
  22756. this.setSize(w, h, ratio);
  22757. this.forceUpdateSize = !1
  22758. }
  22759. }
  22760. }()
  22761. ,
  22762. n.prototype.updateComponents = function() {
  22763. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  22764. this.updateListeners[t].update(e)
  22765. }
  22766. ,
  22767. n.prototype.suspend = function() {
  22768. this.started = !1,
  22769. this.suspendedObjects = this.scene.children.map(function(e) {
  22770. return this.scene.remove(e),
  22771. e
  22772. }
  22773. .bind(this)),
  22774. this.render()
  22775. }
  22776. ,
  22777. n.prototype.resume = function() {
  22778. this.suspendedObjects.forEach(function(e) {
  22779. this.scene.add(e)
  22780. }
  22781. .bind(this)),
  22782. this.suspendedObjects = [],
  22783. this.started = !0,
  22784. p()
  22785. }
  22786. ;
  22787. var p = function() {
  22788. this.started && (window.requestAnimationFrame(p),
  22789. this.updateScreenSize(),
  22790. this.updateComponents(),
  22791. this.updateTextureMemory(),
  22792. this.render(),
  22793. this.emit(a.AfterRender))
  22794. };
  22795. n.prototype.getImageData = function() {
  22796. var e = document.createElement("canvas")
  22797. , t = e.getContext("2d");
  22798. return function(i, n, r) {
  22799. return e.width === n && e.height === r || (e.width = n,
  22800. e.height = r),
  22801. t.drawImage(i, 0, 0, n, r),
  22802. t.getImageData(0, 0, n, r)
  22803. }
  22804. }(),
  22805. n.prototype.initSizedTexture2D = function(e, t, i) {
  22806. var n = this.renderer
  22807. , o = n.context
  22808. , a = n.state
  22809. , s = new r.Texture(null);
  22810. s.flipY = !1,
  22811. i !== !0 && (i = !1),
  22812. s.generateMipmaps = i;
  22813. var l = n.paramThreeToGL(s.format)
  22814. , c = n.paramThreeToGL(s.type)
  22815. , h = n.properties.get(s)
  22816. , u = o.createTexture();
  22817. a.bindTexture(o.TEXTURE_2D, u),
  22818. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  22819. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  22820. s.wrapS = t,
  22821. s.wrapT = t;
  22822. var d = n.paramThreeToGL(t);
  22823. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  22824. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  22825. i ? (s.magFilter = r.LinearFilter,
  22826. s.minFilter = r.LinearMipMapLinearFilter,
  22827. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  22828. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  22829. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  22830. s.minFilter = r.LinearFilter,
  22831. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  22832. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  22833. a.bindTexture(o.TEXTURE_2D, null),
  22834. h.__webglTexture = u,
  22835. s
  22836. }
  22837. ,
  22838. n.prototype.initSizedCubeMap = function(e, t) {
  22839. var i = this.renderer
  22840. , n = i.context
  22841. , o = i.state
  22842. , a = new r.CubeTexture([null, null, null, null, null, null]);
  22843. a.flipY = !1,
  22844. a.generateMipmaps = t;
  22845. var s = i.paramThreeToGL(a.format)
  22846. , l = i.paramThreeToGL(a.type)
  22847. , c = i.properties.get(a)
  22848. , h = n.createTexture();
  22849. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  22850. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  22851. for (var u = 0; u < 6; u++)
  22852. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  22853. return t ? (a.magFilter = r.LinearFilter,
  22854. a.minFilter = r.LinearMipMapLinearFilter,
  22855. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22856. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  22857. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  22858. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  22859. a.minFilter = r.LinearFilter,
  22860. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22861. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  22862. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  22863. c.__image__webglTextureCube = h,
  22864. a
  22865. }
  22866. ,
  22867. n.prototype.deallocateCubeTexture = function(e) {
  22868. var t = this.renderer
  22869. , i = t.context
  22870. , n = t.properties.get(e);
  22871. i.deleteTexture(n.__image__webglTextureCube)
  22872. }
  22873. ,
  22874. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  22875. var a = this.renderer
  22876. , s = a.context
  22877. , l = a.state
  22878. , c = a.properties.get(t);
  22879. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  22880. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22881. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  22882. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  22883. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  22884. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  22885. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  22886. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  22887. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  22888. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  22889. l.bindTexture(s.TEXTURE_2D, null)
  22890. }
  22891. ,
  22892. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  22893. var s = this.renderer
  22894. , l = s.context
  22895. , c = s.state
  22896. , h = s.properties.get(t);
  22897. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  22898. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22899. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  22900. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  22901. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  22902. }
  22903. ,
  22904. n.prototype.rebuildMipMaps2D = function(e) {
  22905. var t = this.renderer
  22906. , i = t.context
  22907. , n = t.state;
  22908. t.properties.get(e);
  22909. i.generateMipmap(i.TEXTURE_2D),
  22910. n.bindTexture(i.TEXTURE_2D, null)
  22911. }
  22912. ,
  22913. n.prototype.rebuildMipMaps3D = function(e) {
  22914. var t = this.renderer
  22915. , i = t.context
  22916. , n = t.state
  22917. , r = t.properties.get(e);
  22918. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  22919. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  22920. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  22921. }
  22922. ,
  22923. n.prototype.renderToCubeMap = function() {
  22924. var e = !1
  22925. , t = null
  22926. , i = null
  22927. , n = null
  22928. , a = null
  22929. , s = null
  22930. , l = 1;
  22931. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  22932. var _ = this.renderer;
  22933. _.context;
  22934. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  22935. i.position.z = 150,
  22936. t = new r.Scene,
  22937. t.add(i),
  22938. n = new r.ShaderMaterial({
  22939. uniforms: {
  22940. tDiffuse: {
  22941. type: "t",
  22942. value: null
  22943. },
  22944. alpha: {
  22945. type: "f",
  22946. value: 1
  22947. }
  22948. },
  22949. vertexShader: o.basicTextured.vertexShader,
  22950. fragmentShader: o.basicTextured.fragmentShader,
  22951. depthWrite: !1,
  22952. depthTest: !1,
  22953. side: r.DoubleSide
  22954. }),
  22955. a = new r.PlaneBufferGeometry(l,l),
  22956. s = new r.Mesh(a,n),
  22957. s.position.z = 0,
  22958. t.add(s),
  22959. e = !0);
  22960. var T = a.getAttribute("uv");
  22961. T.setDynamic(!0),
  22962. T.needsUpdate = !0;
  22963. var x = T.array
  22964. , S = p / u
  22965. , M = f / d
  22966. , R = g / u
  22967. , P = m / d;
  22968. x[0] = S,
  22969. x[1] = M + P,
  22970. x[2] = S + R,
  22971. x[3] = M + P,
  22972. x[4] = S,
  22973. x[5] = M,
  22974. x[6] = S + R,
  22975. x[7] = M;
  22976. var O = a.getAttribute("position");
  22977. O.setDynamic(!0),
  22978. O.needsUpdate = !0;
  22979. var L = O.array
  22980. , D = v / h.width - l / 2
  22981. , N = A / h.height - l / 2
  22982. , B = y / h.width
  22983. , F = C / h.height;
  22984. L[0] = D,
  22985. L[1] = N + F,
  22986. L[3] = D + B,
  22987. L[4] = N + F,
  22988. L[6] = D,
  22989. L[7] = N,
  22990. L[9] = D + B,
  22991. L[10] = N;
  22992. this.renderer.properties.get(c);
  22993. n.uniforms.tDiffuse.value = c,
  22994. n.blending = E || r.NoBlending,
  22995. n.transparent = !!b,
  22996. void 0 !== w && null !== w || (w = 1),
  22997. n.uniforms.alpha.value = w,
  22998. n.needUpdate = !0,
  22999. h.activeCubeFace = I,
  23000. h.viewport.set(0, 0, h.width, h.height);
  23001. var V = this.renderer.autoClear;
  23002. this.renderer.autoClear = !1,
  23003. this.renderer.render(t, i, h, !1),
  23004. this.renderer.autoClear = V
  23005. }
  23006. }(),
  23007. n.prototype.copyCubeMap = function() {
  23008. var e = !1
  23009. , t = null
  23010. , i = null
  23011. , a = null
  23012. , s = null
  23013. , l = null
  23014. , c = new r.Euler;
  23015. new r.Vector3;
  23016. return function(h, u, d, p, f, g, m, v, A) {
  23017. this.renderer;
  23018. if (!e) {
  23019. var y = 2;
  23020. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  23021. i.position.set(0, 0, 0),
  23022. t = new r.Scene,
  23023. t.add(i),
  23024. a = new r.ShaderMaterial({
  23025. uniforms: {
  23026. tDiffuse: {
  23027. type: "t",
  23028. value: null
  23029. },
  23030. alpha: {
  23031. type: "f",
  23032. value: 1
  23033. }
  23034. },
  23035. vertexShader: o.copyCubeMap.vertexShader,
  23036. fragmentShader: o.copyCubeMap.fragmentShader,
  23037. depthWrite: !1,
  23038. depthTest: !1,
  23039. side: r.DoubleSide
  23040. }),
  23041. s = new r.BoxGeometry(y,y,y),
  23042. l = new r.Mesh(s,a),
  23043. t.add(l),
  23044. e = !0
  23045. }
  23046. for (var C = 0; C < 6; C++)
  23047. n.getCubeOrientationForCubeFace(C, c),
  23048. l.rotation.copy(c),
  23049. l.matrixWorldNeedsUpdate = !0,
  23050. l.updateMatrixWorld(),
  23051. a.uniforms.tDiffuse.value = h,
  23052. a.blending = m || r.NoBlending,
  23053. a.transparent = !!v,
  23054. void 0 !== A && null !== A || (A = 1),
  23055. a.uniforms.alpha.value = A,
  23056. a.needUpdate = !0,
  23057. u.activeCubeFace = C,
  23058. u.viewport.set(0, 0, f, g),
  23059. this.renderer.render(t, i, u, !1)
  23060. }
  23061. }(),
  23062. n.getLookAtForCubeFace = function(e, t) {
  23063. switch (e) {
  23064. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23065. t.set(1, 0, 0);
  23066. break;
  23067. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23068. t.set(-1, 0, 0);
  23069. break;
  23070. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23071. t.set(0, 1, 0);
  23072. break;
  23073. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23074. t.set(0, -1, 0);
  23075. break;
  23076. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23077. t.set(0, 0, 1);
  23078. break;
  23079. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23080. t.set(0, 0, -1)
  23081. }
  23082. }
  23083. ,
  23084. n.getCubeOrientationForCubeFace = function(e, t) {
  23085. switch (e) {
  23086. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23087. t.set(0, -Math.PI / 2, 0);
  23088. break;
  23089. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23090. t.set(0, Math.PI / 2, 0);
  23091. break;
  23092. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23093. t.set(Math.PI / 2, Math.PI, 0);
  23094. break;
  23095. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23096. t.set(-Math.PI / 2, Math.PI, 0);
  23097. break;
  23098. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23099. t.set(0, -Math.PI, 0);
  23100. break;
  23101. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23102. t.set(0, 0, 0)
  23103. }
  23104. }
  23105. ,
  23106. t.exports = n
  23107. }
  23108. , {
  23109. "../enum/GLCubeFaces": 25,
  23110. "../enum/GLTextureType": 26,
  23111. "../enum/SceneRendererEvents": 43,
  23112. "../exception/BasicException": 55,
  23113. "../exception/RendererCreationException": 57,
  23114. "../settings": 166,
  23115. "../shaders": 167,
  23116. events: 202,
  23117. three: 217
  23118. }],
  23119. 159: [function(e, t, i) {
  23120. "use strict";
  23121. function n(e) {
  23122. this.messenger = new a(e),
  23123. this.clientKey = null
  23124. }
  23125. var r = e("../util/ajax")
  23126. , o = e("./PostMessageType")
  23127. , a = e("./postmessage")
  23128. , s = e("./VersionInfo")
  23129. , l = e("events").EventEmitter
  23130. , c = window.location.origin + "/api/v1/user/";
  23131. n.prototype = Object.create(l.prototype),
  23132. n.prototype.bindEvents = function() {
  23133. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  23134. }
  23135. ,
  23136. n.prototype.waitForConnection = function() {
  23137. var e = new Promise(function(e, t) {
  23138. this.messenger.on(o.CONNECT, function(i) {
  23139. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  23140. }
  23141. .bind(this))
  23142. }
  23143. .bind(this));
  23144. return e
  23145. }
  23146. ,
  23147. n.prototype.onConnectionReceived = function(e) {
  23148. return this.messenger.setTarget(e.source, e.origin),
  23149. this.verifyConnection(e).then(function(t, i) {
  23150. this.messenger.send({
  23151. type: o.ACCEPT,
  23152. toId: e.fromId,
  23153. warning: i
  23154. }),
  23155. this.clientKey = t,
  23156. this.messenger.removeAllListeners(o.CONNECT),
  23157. this.bindEvents()
  23158. }
  23159. .bind(this), function(t) {
  23160. this.messenger.send({
  23161. type: o.REJECT,
  23162. toId: e.fromId,
  23163. reason: t
  23164. }),
  23165. this.messenger.setTarget()
  23166. }
  23167. .bind(this))
  23168. }
  23169. ,
  23170. n.prototype.verifyConnection = function(e) {
  23171. return new Promise(function(t, i) {
  23172. var n;
  23173. if (s.isDeprecated(e.sdkVersion))
  23174. n = "This version of the SDK is being deprecated. Please see http://www.port.com for more info";
  23175. else if (!s.isSupported(e.sdkVersion))
  23176. return i("This version of the SDK isn't supported. Get the latest version here: http://www.port.com");
  23177. var o = {
  23178. cache: !1,
  23179. headers: {
  23180. "X-port-Application-Key": e.applicationKey,
  23181. "X-port-Referrer": e.origin
  23182. }
  23183. };
  23184. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  23185. }
  23186. )
  23187. }
  23188. ,
  23189. n.prototype.onMessageReceived = function(e) {
  23190. if (this.validateClientApplicationKey(e.applicationKey)) {
  23191. var t = this;
  23192. e.onDone = function(i) {
  23193. i.toId = e.fromId,
  23194. i.uid = e.uid,
  23195. i.type = o.RESPONSE,
  23196. t.messenger.send(i)
  23197. }
  23198. ,
  23199. this.emit(o.ACTION, e)
  23200. }
  23201. }
  23202. ,
  23203. n.prototype.validateClientApplicationKey = function(e) {
  23204. return this.clientKey === e
  23205. }
  23206. ,
  23207. n.prototype.sendEvent = function(e, t) {
  23208. this.messenger.send({
  23209. type: o.EVENT,
  23210. eventType: e,
  23211. eventData: t
  23212. })
  23213. }
  23214. ,
  23215. t.exports = n
  23216. }
  23217. , {
  23218. "../util/ajax": 181,
  23219. "./PostMessageType": 160,
  23220. "./VersionInfo": 163,
  23221. "./postmessage": 165,
  23222. events: 202
  23223. }],
  23224. 160: [function(e, t, i) {
  23225. "use strict";
  23226. t.exports = Object.freeze({
  23227. CONNECT: "postmessage.connect",
  23228. ACCEPT: "postmessage.accept",
  23229. REJECT: "postmessage.reject",
  23230. ACTION: "postmessage.action",
  23231. RESPONSE: "postmessage.response",
  23232. EVENT: "postmessage.event"
  23233. })
  23234. }
  23235. , {}],
  23236. 161: [function(e, t, i) {
  23237. "use strict";
  23238. t.exports = Object.freeze({
  23239. MOVE: "sdk.move",
  23240. ENTER_PANO: "sdk.enterpano",
  23241. MODEL_LOADED: "sdk.modelloaded"
  23242. })
  23243. }
  23244. , {}],
  23245. 162: [function(e, t, i) {
  23246. "use strict";
  23247. t.exports = Object.freeze({
  23248. FLY: "transition.fly",
  23249. FADEOUT: "transition.fade",
  23250. INSTANT: "transition.instant"
  23251. })
  23252. }
  23253. , {}],
  23254. 163: [function(e, t, i) {
  23255. "use strict";
  23256. t.exports = {
  23257. current: "1.0",
  23258. supported: ["1.0"],
  23259. deprecated: [],
  23260. isSupported: function(e) {
  23261. return this.supported.indexOf(e) !== -1
  23262. },
  23263. isDeprecated: function(e) {
  23264. return this.deprecated.indexOf(e) !== -1
  23265. },
  23266. isValid: function(e) {
  23267. return this.isSupported(e) || this.isDeprecated(e)
  23268. }
  23269. }
  23270. }
  23271. , {}],
  23272. 164: [function(e, t, i) {
  23273. (function(i) {
  23274. "use strict";
  23275. function n(e, t, i) {
  23276. e && (e = e.toLowerCase().trim());
  23277. var n = new I.UP.clone
  23278. , r = Math.PI / 3
  23279. , o = Math.PI / 2;
  23280. switch (e) {
  23281. case "left":
  23282. i.copy(t),
  23283. i.applyAxisAngle(n, o);
  23284. break;
  23285. case "right":
  23286. i.copy(t),
  23287. i.applyAxisAngle(n, -o);
  23288. break;
  23289. case "forwardleft":
  23290. i.copy(t),
  23291. i.applyAxisAngle(n, r);
  23292. break;
  23293. case "forwardright":
  23294. i.copy(t),
  23295. i.applyAxisAngle(n, -r);
  23296. break;
  23297. case "forward":
  23298. default:
  23299. i.copy(t)
  23300. }
  23301. return i
  23302. }
  23303. function r(e, t) {
  23304. if (e) {
  23305. var i = {
  23306. pano: e,
  23307. lookAtPoint: null,
  23308. duration: null,
  23309. maxDistanceOverride: null,
  23310. skipWarpingCheck: !1
  23311. };
  23312. this.player.flyToPano(i, function() {
  23313. t && t({
  23314. success: !0,
  23315. message: "Transition complete."
  23316. })
  23317. })
  23318. } else
  23319. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23320. t && t({
  23321. success: !1,
  23322. error: "Unable to find pano."
  23323. })
  23324. }
  23325. function o(e, t) {
  23326. var i = this.findRankedPano(e, t);
  23327. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  23328. null)
  23329. }
  23330. function a(e, t) {
  23331. var i = this.findRankedtag(e, t);
  23332. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  23333. null)
  23334. }
  23335. function s(e, t) {
  23336. t.copy(I.FORWARD),
  23337. e.getDirection(t)
  23338. }
  23339. function l(e) {
  23340. function t(e) {
  23341. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23342. return {
  23343. x: c.Math.radToDeg(t._x),
  23344. y: c.Math.radToDeg(t._y),
  23345. z: c.Math.radToDeg(t._z)
  23346. }
  23347. }
  23348. var i = function(e) {
  23349. return e.alignmentType !== m.ALIGNED ? null : {
  23350. x: e.position.x,
  23351. y: e.position.y,
  23352. z: e.position.z
  23353. }
  23354. };
  23355. return {
  23356. panos: e.panos.list.map(function(n) {
  23357. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23358. return {
  23359. uuid: n.id,
  23360. aligned: n.alignmentType === m.ALIGNED,
  23361. neighbourUUIDs: n.neighbourUUIDs.slice(),
  23362. position: i(n),
  23363. rotation: t(n),
  23364. thumbnail: r
  23365. }
  23366. })
  23367. }
  23368. }
  23369. var c = e("three")
  23370. , h = e("./ApiHost")
  23371. , u = e("../util/logger")
  23372. , d = e("../util/common")
  23373. , p = e("../util/math")
  23374. , f = e("../enum/ModelManagerEvents")
  23375. , g = e("./PostMessageType")
  23376. , m = e("../enum/AlignmentType")
  23377. , v = e("../enum/Direction")
  23378. , A = e("./TransitionStyles")
  23379. , y = e("../util/panorama")
  23380. , C = e("../enum/GLCubeFaces")
  23381. , I = e("../enum/Vectors")
  23382. , E = e("../enum/Viewmode")
  23383. , b = e("../enum/WarpStyle")
  23384. , w = (e("../enum/Keys"),
  23385. e("../enum/PlayerEvents"))
  23386. , _ = e("../sdk/SdkEvents")
  23387. , I = e("../enum/Vectors")
  23388. , T = e("../enum/ControlEvents")
  23389. , x = e("../enum/RenderLayers")
  23390. , S = (e("../constants"),
  23391. e("../settings"))
  23392. , M = e("../lib/jpeg_encoder")
  23393. , R = new u(i)
  23394. , P = function() {
  23395. var e = function e() {
  23396. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23397. e.player.getDirection(e.playerDirection),
  23398. e.projectVectors();
  23399. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  23400. if (e.angleTravelled += Math.abs(t),
  23401. e.angleTravelled >= Math.abs(e.angle)) {
  23402. if (e.active = !1,
  23403. e.onDone) {
  23404. var i = e.onDone;
  23405. i()
  23406. }
  23407. } else
  23408. e.lastFacingDirection.copy(e.playerDirection),
  23409. window.setTimeout(e, 4)
  23410. };
  23411. return e.active = !1,
  23412. e.angle = 0,
  23413. e.angleTravelled = 0,
  23414. e.playerDirection = new c.Vector3,
  23415. e.lastFacingDirection = new c.Vector3,
  23416. e.onDone = null,
  23417. e.player = null,
  23418. e.start = function(t, i, n, r) {
  23419. e.active = !0,
  23420. t && i && (i = 0),
  23421. e.angle = t || i,
  23422. e.xAngle = t,
  23423. e.yAngle = i,
  23424. e.angleTravelled = 0,
  23425. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23426. n.getDirection(e.playerDirection),
  23427. e.lastFacingDirection.copy(e.playerDirection),
  23428. e.projectVectors(),
  23429. e.onDone = r,
  23430. e.player = n,
  23431. e()
  23432. }
  23433. ,
  23434. e.projectVectors = function() {
  23435. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  23436. e.lastFacingDirection.projectOnPlane(I.UP))
  23437. }
  23438. ,
  23439. e
  23440. }()
  23441. , O = function() {
  23442. var e = new c.Vector3;
  23443. return function(t) {
  23444. t ? (e.copy(t.position),
  23445. e.add(t.discPosition),
  23446. p.projectPositionToCanvas(e, this.player.camera, e),
  23447. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  23448. }
  23449. }()
  23450. , L = function() {
  23451. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  23452. }
  23453. , D = function() {
  23454. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  23455. }
  23456. , N = function(e) {
  23457. var t = new c.Vector3;
  23458. return function(e) {
  23459. var i = this.player.getDirection();
  23460. t.copy(i);
  23461. var n = t.y;
  23462. t.y = 0,
  23463. t.normalize();
  23464. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  23465. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  23466. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23467. 0;
  23468. this.player.mode === E.DOLLHOUSE && (r = -r);
  23469. var o = L.call(this) - .1
  23470. , a = D.call(this) + .1
  23471. , s = r + e;
  23472. s > o ? s = o : s < a && (s = a);
  23473. var l = s - r;
  23474. return e > 0 && l < .01 && (l = 0),
  23475. e < 0 && l > -.01 && (l = 0),
  23476. l
  23477. }
  23478. }()
  23479. , B = function() {
  23480. var e = new c.Euler;
  23481. return function(t) {
  23482. return e.setFromQuaternion(t.quaternion, "YXZ"),
  23483. {
  23484. position: {
  23485. x: t.position.x,
  23486. y: t.position.y,
  23487. z: t.position.z
  23488. },
  23489. rotation: {
  23490. x: c.Math.radToDeg(e.x),
  23491. y: c.Math.radToDeg(e.y),
  23492. z: 0
  23493. },
  23494. pano: t.currentPano ? t.currentPano.id : null,
  23495. mode: t.mode
  23496. }
  23497. }
  23498. }()
  23499. , F = null;
  23500. t.exports = {
  23501. init: function(e, t, i, n, r) {
  23502. V.init(e, t, i, r),
  23503. F = new Promise(function(e, t) {
  23504. i.on(w.Ready, function() {
  23505. e()
  23506. })
  23507. }
  23508. .bind(this));
  23509. var o = new h(window)
  23510. , a = o.waitForConnection();
  23511. a.then(function(e) {
  23512. o.on(g.ACTION, V.onMessageReceive.bind(V))
  23513. });
  23514. var s = function() {
  23515. var e = Date.now();
  23516. return function() {
  23517. if (!(Date.now() - e < 100)) {
  23518. var t = B(i);
  23519. o.sendEvent(_.MOVE, {
  23520. state: t
  23521. }),
  23522. e = Date.now()
  23523. }
  23524. }
  23525. }();
  23526. i.on(w.Move, s),
  23527. i.on(w.ViewChanged, s),
  23528. n.on(f.ActiveModelChanged, function(e) {
  23529. function t(e) {
  23530. var t, i = e.newPano.id;
  23531. e.oldPano && (t = e.oldPano.id),
  23532. i !== t && o.sendEvent(_.ENTER_PANO, {
  23533. oldPano: t,
  23534. newPano: i
  23535. })
  23536. }
  23537. var i = e.model
  23538. , n = e.oldModel;
  23539. V.model = i,
  23540. a.then(function() {
  23541. o.sendEvent(_.MODEL_LOADED, {
  23542. metadata: l(i)
  23543. })
  23544. }),
  23545. n && n.panos.forEach(function(e) {
  23546. e.removeEventListener("enter", t)
  23547. }),
  23548. i.panos.forEach(function(e) {
  23549. e.on("enter", t)
  23550. })
  23551. })
  23552. }
  23553. };
  23554. var V = {
  23555. director: null,
  23556. player: null,
  23557. controls: null,
  23558. sceneRenderer: null,
  23559. model: null,
  23560. init: function(e, t, i, n) {
  23561. this.director = e,
  23562. this.player = i,
  23563. this.controls = t,
  23564. this.sceneRenderer = n
  23565. },
  23566. handleToObject: {},
  23567. objectToHandle: {},
  23568. handleCount: 0,
  23569. onMessageReceive: function(e) {
  23570. if (e) {
  23571. var t = e.targetFunction
  23572. , i = e.params
  23573. , n = e.onDone;
  23574. t && this[t] && this[t](i, n)
  23575. }
  23576. },
  23577. waitForInit: function(e, t) {
  23578. F.then(t.bind({
  23579. success: !0,
  23580. message: "Init complete."
  23581. }))
  23582. },
  23583. moveToPano: function(e, t) {
  23584. var i = new c.Euler(0,0,0,"YXZ")
  23585. , n = new c.Quaternion;
  23586. return function(e, t) {
  23587. var r = e.pano
  23588. , o = e.rotation
  23589. , a = e.transition;
  23590. if (!this.model)
  23591. return t({
  23592. success: !1,
  23593. error: "The model has not been loaded yet"
  23594. });
  23595. var s = this.model.panos.get(r);
  23596. if (!s)
  23597. return t({
  23598. success: !1,
  23599. error: r + " does not exist in this model"
  23600. });
  23601. if (!o)
  23602. return t({
  23603. sucess: !1,
  23604. erorr: o + " is not a valid rotation"
  23605. });
  23606. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  23607. console.log(o.z);
  23608. var l = {
  23609. success: !0,
  23610. message: r
  23611. };
  23612. if (a === A.FADEOUT)
  23613. n.setFromEuler(i),
  23614. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  23615. else {
  23616. var h, u;
  23617. a === A.INSTANT && (h = 0,
  23618. u = 0);
  23619. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  23620. this.player.flyToPano({
  23621. pano: s,
  23622. lookAtPoint: d,
  23623. duration: h,
  23624. aimDuration: u
  23625. }, t.bind(this, l))
  23626. }
  23627. }
  23628. }(),
  23629. moveInDirection: function(e, t) {
  23630. var i = e.direction;
  23631. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23632. void (t && t({
  23633. success: !1,
  23634. error: "Invalid direction."
  23635. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  23636. t(e ? {
  23637. success: !0,
  23638. message: "moved " + i
  23639. } : {
  23640. success: !1,
  23641. error: "Cannot move in direction: " + i
  23642. })
  23643. })
  23644. },
  23645. getPose: function(e, t) {
  23646. this.player.camera.position,
  23647. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  23648. return t({
  23649. success: !0,
  23650. message: B(this.player)
  23651. })
  23652. },
  23653. takeScreenShot: function() {
  23654. var e = new c.PerspectiveCamera
  23655. , t = new c.WebGLRenderTarget;
  23656. return function(i, n) {
  23657. if (!i.resolution)
  23658. return n({
  23659. success: !1,
  23660. error: "An invalid resolution was specified"
  23661. });
  23662. if (i.resolution.width === -1 || i.resolution.height === -1) {
  23663. var r = this.sceneRenderer.renderer.getSize();
  23664. i.resolution.width = r.width,
  23665. i.resolution.height = r.height
  23666. }
  23667. e.layers.set(x.DEFAULT),
  23668. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  23669. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  23670. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  23671. var o = i.resolution.width
  23672. , a = i.resolution.height
  23673. , s = o / a;
  23674. e.position.copy(this.sceneRenderer.camera.position),
  23675. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  23676. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  23677. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  23678. t.setSize(o, a),
  23679. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  23680. var l = new Uint8Array(o * a * 4);
  23681. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  23682. var c = M.encode({
  23683. data: l,
  23684. width: o,
  23685. height: a,
  23686. heading: 180,
  23687. pitch: 0
  23688. }, {
  23689. quality: 75,
  23690. flipY: !0
  23691. })
  23692. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  23693. n({
  23694. success: !0,
  23695. message: h
  23696. })
  23697. }
  23698. }(),
  23699. findRankedPano: function(e, t) {
  23700. var i = new c.Vector3
  23701. , r = new c.Vector3;
  23702. return function(e, t) {
  23703. s(this.player, r),
  23704. n(t, r, i);
  23705. var o = this.player.rankedPanoInDirection(e, i);
  23706. if (o) {
  23707. var a = this.objectToHandle[o.id];
  23708. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  23709. this.handleToObject[a] = o),
  23710. a
  23711. }
  23712. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  23713. -1
  23714. }
  23715. }(),
  23716. findRankedtag: function(e, t) {
  23717. var i = new c.Vector3
  23718. , r = new c.Vector3;
  23719. return function(e, t) {
  23720. s(this.player, r),
  23721. n(t, r, i);
  23722. var o = this.player.rankedtagInDirection(e, i);
  23723. if (o) {
  23724. var a = this.objectToHandle[o.sid];
  23725. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  23726. this.handleToObject[a] = o),
  23727. a
  23728. }
  23729. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  23730. -1
  23731. }
  23732. }(),
  23733. clickNearesttag: function(e) {
  23734. this.clickRankedtag(0, e)
  23735. },
  23736. clickRankedtag: function(e, t) {
  23737. var i = a.call(this, e, t);
  23738. i && O.call(this, i)
  23739. },
  23740. clickNearestPano: function(e, t) {
  23741. this.clickRankedPano(0, e, t)
  23742. },
  23743. clickRankedPano: function(e, t, i) {
  23744. var n = o.call(this, e, t);
  23745. n ? r.call(this, n, i) : i(null)
  23746. },
  23747. clickPano: function(e, t) {
  23748. var i = this.handleTable[e];
  23749. i ? r.call(this, i, t) : t(null)
  23750. },
  23751. rotateDirection: function() {
  23752. return function(e, t) {
  23753. var i = e.direction
  23754. , n = e.angle;
  23755. if (!P.active) {
  23756. var r = 0
  23757. , o = 0
  23758. , a = 0
  23759. , s = 0;
  23760. if (!n || isNaN(n))
  23761. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  23762. void (t && t({
  23763. success: !1,
  23764. error: "Invalid rotation angle."
  23765. }));
  23766. if (this.player.mode === E.TRANSITIONING)
  23767. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  23768. void (t && t({
  23769. success: !1,
  23770. error: "Cannot rotate while transitioning"
  23771. }));
  23772. if (i === v.RIGHT || i === v.LEFT)
  23773. i === v.RIGHT && (n = -n),
  23774. r = n > 0 ? -1 : 1,
  23775. a = n;
  23776. else {
  23777. if (i !== v.UP && i !== v.DOWN)
  23778. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  23779. void (t && t({
  23780. success: !1,
  23781. error: "Invalid direction for rotation."
  23782. }));
  23783. if (this.player.mode === E.FLOORPLAN)
  23784. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  23785. void (t && t({
  23786. success: !1,
  23787. error: "Cannot rotate " + i + " in floorplan mode"
  23788. }));
  23789. if (i === v.DOWN && (n = -n),
  23790. n = N.call(this, n),
  23791. 0 === n)
  23792. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  23793. void (t && t({
  23794. success: !1,
  23795. error: "Already at maximum rotation in direction: " + i
  23796. }));
  23797. o = n > 0 ? 1 : -1,
  23798. s = n
  23799. }
  23800. var l = n;
  23801. n = c.Math.degToRad(n),
  23802. a = c.Math.degToRad(a),
  23803. s = c.Math.degToRad(s);
  23804. var h = this.controls.activeControl
  23805. , u = function() {
  23806. h.stopRotating(!0),
  23807. t && t({
  23808. success: !0,
  23809. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  23810. })
  23811. };
  23812. h.startRotating(r, o),
  23813. P.start(a, s, this.player, u)
  23814. }
  23815. }
  23816. }(),
  23817. rotate: function() {
  23818. var e = new c.Vector3
  23819. , t = new c.Vector3;
  23820. return function(i, n) {
  23821. var r = i.xAngle
  23822. , o = i.yAngle;
  23823. if (!P.active) {
  23824. if (r = r || 0,
  23825. o = o || 0,
  23826. isNaN(r) || isNaN(o))
  23827. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  23828. void (n && n({
  23829. success: !1,
  23830. error: "Invalid rotation angle."
  23831. }));
  23832. if (this.player.mode === E.TRANSITIONING)
  23833. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  23834. void (n && n({
  23835. success: !1,
  23836. error: "Cannot rotate while transitioning"
  23837. }));
  23838. Math.abs(r) < .01 && (r = 0),
  23839. Math.abs(o) < .01 && (o = 0);
  23840. var a = o;
  23841. o = N.call(this, o),
  23842. r = -r;
  23843. var s = a > 0 ? "UP" : "DOWN";
  23844. if (!r && a && !o)
  23845. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  23846. void (n && n({
  23847. success: !1,
  23848. error: "Already at maximum rotation in direction: " + s
  23849. }));
  23850. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  23851. var l = o;
  23852. o = c.Math.degToRad(o),
  23853. r = c.Math.degToRad(r),
  23854. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23855. this.player.getDirection(e),
  23856. t.copy(e).applyAxisAngle(I.UP, r),
  23857. t.applyAxisAngle(I.RIGHT, o);
  23858. var h = (e.angleTo(t),
  23859. r > 0 ? -1 : r < 0 ? 1 : 0)
  23860. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  23861. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  23862. var d = this.controls.activeControl
  23863. , p = function() {
  23864. d.stopRotating(!0),
  23865. n && n({
  23866. success: !0,
  23867. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  23868. })
  23869. };
  23870. d.startRotating(h, u),
  23871. P.start(r, o, this.player, p)
  23872. }
  23873. }
  23874. }(),
  23875. panCamera: function(e, t) {
  23876. function i(e) {
  23877. switch (r.removeAllListeners(T.AutoPanComplete),
  23878. r.removeAllListeners(T.AutoPanInterrupt),
  23879. r.removeAllListeners(T.AutoPanClamped),
  23880. e) {
  23881. case T.AutoPanInterrupt:
  23882. t({
  23883. success: !0,
  23884. message: "Camera panning interrupted."
  23885. });
  23886. break;
  23887. case T.AutoPanClamped:
  23888. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  23889. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  23890. return void t({
  23891. success: !1,
  23892. error: "Already at edge of current model bounds."
  23893. });
  23894. var i = "The view point is outside the bounds for the current model. ";
  23895. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  23896. console.warn(i)
  23897. }
  23898. case T.AutoPanComplete:
  23899. t({
  23900. success: !0,
  23901. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  23902. })
  23903. }
  23904. }
  23905. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  23906. return t({
  23907. success: !1,
  23908. error: "Camera panning is not available in the current mode: " + this.player.mode
  23909. });
  23910. var n = e.position
  23911. , r = this.player.control;
  23912. r.setAutoPanPosition(n.x, n.z),
  23913. r.autoPan = !0;
  23914. var o = function(e, t) {
  23915. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  23916. };
  23917. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  23918. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  23919. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  23920. },
  23921. click: function(e, t) {
  23922. var i = e.x
  23923. , n = e.y
  23924. , r = e.percentage;
  23925. r === !0 && (i = i / 100 * $("#player").width(),
  23926. n = n / 100 * $("#player").height()),
  23927. this.player.handleInputStart(i, n),
  23928. this.player.updateIntersect(),
  23929. this.player.handleInputEnd(i, n)
  23930. },
  23931. mouseOver: function(e, t) {
  23932. var i = e.x
  23933. , n = e.y
  23934. , r = e.percentage;
  23935. r === !0 && (i = i / 100 * $("#player").width(),
  23936. n = n / 100 * $("#player").height()),
  23937. this.player.handleInputMove(i, n),
  23938. this.player.updateIntersect()
  23939. },
  23940. moveToMode: function(e, t) {
  23941. function i(e) {
  23942. t(e ? {
  23943. success: !1,
  23944. error: "Failed to load new mode: " + e
  23945. } : {
  23946. success: !0,
  23947. message: "Moved to new mode: " + n
  23948. })
  23949. }
  23950. var n = e.mode;
  23951. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  23952. i()
  23953. }, function(e) {
  23954. i(e)
  23955. }) : t({
  23956. success: !1,
  23957. error: "Invalid mode selection"
  23958. })
  23959. }
  23960. }
  23961. }
  23962. ).call(this, "/js/sdk/automation.js")
  23963. }
  23964. , {
  23965. "../constants": 8,
  23966. "../enum/AlignmentType": 17,
  23967. "../enum/ControlEvents": 21,
  23968. "../enum/Direction": 22,
  23969. "../enum/GLCubeFaces": 25,
  23970. "../enum/Keys": 30,
  23971. "../enum/ModelManagerEvents": 33,
  23972. "../enum/PlayerEvents": 40,
  23973. "../enum/RenderLayers": 41,
  23974. "../enum/Vectors": 50,
  23975. "../enum/Viewmode": 51,
  23976. "../enum/WarpStyle": 52,
  23977. "../lib/jpeg_encoder": 94,
  23978. "../sdk/SdkEvents": 161,
  23979. "../settings": 166,
  23980. "../util/common": 185,
  23981. "../util/logger": 189,
  23982. "../util/math": 190,
  23983. "../util/panorama": 191,
  23984. "./ApiHost": 159,
  23985. "./PostMessageType": 160,
  23986. "./TransitionStyles": 162,
  23987. three: 217
  23988. }],
  23989. 165: [function(e, t, i) {
  23990. "use strict";
  23991. function n(e) {
  23992. this.sourceWindow = e,
  23993. this.targetWindow = null,
  23994. this.targetOrigin = null,
  23995. this.id = Math.floor(1e5 * Math.random()),
  23996. this.bindEvents()
  23997. }
  23998. var r = e("./PostMessageType")
  23999. , o = e("events").EventEmitter;
  24000. n.prototype = Object.create(o.prototype),
  24001. n.prototype.bindEvents = function() {
  24002. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24003. }
  24004. ,
  24005. n.prototype.setTarget = function(e, t) {
  24006. this.targetWindow = e,
  24007. this.targetOrigin = t
  24008. }
  24009. ,
  24010. n.prototype.onPostmessageReceived = function(e) {
  24011. var t = e.origin || e.originalEvent.origin
  24012. , i = e.source;
  24013. switch (e.data.type) {
  24014. case r.CONNECT:
  24015. break;
  24016. case r.RESPONSE:
  24017. if (this.id !== e.data.toId)
  24018. return;
  24019. default:
  24020. if (!this.validateMessageOrigin(t))
  24021. return
  24022. }
  24023. var n = e.data;
  24024. n.source = i,
  24025. n.origin = t,
  24026. n.timestamp = Date.now(),
  24027. this.emit(e.data.type, n)
  24028. }
  24029. ,
  24030. n.prototype.validateMessageOrigin = function(e) {
  24031. return "*" === this.targetOrigin || e === this.targetOrigin
  24032. }
  24033. ,
  24034. n.prototype.send = function(e) {
  24035. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24036. this.targetWindow.postMessage(e, this.targetOrigin))
  24037. }
  24038. ,
  24039. t.exports = n
  24040. }
  24041. , {
  24042. "./PostMessageType": 160,
  24043. events: 202
  24044. }],
  24045. 166: [function(e, t, i) {
  24046. "use strict";
  24047. var n = e("three")
  24048. , r = e("./util/browser")
  24049. , o = e("./enum/Viewmode")
  24050. , a = e("./enum/VROption")
  24051. , s = e("./enum/Colors")
  24052. , l = e("./enum/WarpStyle")
  24053. , c = e("./util/easing")
  24054. , h = e("./util/common")
  24055. , u = e("./util/showcase")
  24056. , d = e("./constants")
  24057. , p = {
  24058. debug: !1,
  24059. version: "2.25.6-0-gd87e5b1",
  24060. languageTag: r.valueFromHash("lang", null),
  24061. pageTitle: "port 3D Showcase",
  24062. authorizationHeader: u.getAuthorizationHeader(),
  24063. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24064. logLevel: r.valueFromHash("log", 2),
  24065. skyboxRadius: 2500,
  24066. modelBoundsPadding: 5,
  24067. showNeighbors: !1,
  24068. brand: r.valueFromHash("brand", !0),
  24069. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24070. startHighlights: r.valueFromHash("hl", -1),
  24071. specialEdition: r.valueFromHash("bn", 0),
  24072. useWheel: r.valueFromHash("wh", !0),
  24073. crossOrigin: "anonymous",
  24074. fancierTransition: !1,
  24075. wireframe: !1,
  24076. skyboxWireframe: !1,
  24077. modelAlpha: 1,
  24078. highlightPanoSelection: !1,
  24079. showSweeps: !0,
  24080. showSkyboxes: !1,
  24081. showMesh: !0,
  24082. showFloors: !1,
  24083. showFloorDuration: 300,
  24084. showFloorDelay: 300,
  24085. hideFloorDuration: 300,
  24086. hideFloorDelay: 0,
  24087. reticuleOpacityTransitionTime: 250,
  24088. reticuleColor: s.newBlue,
  24089. markerOpacityTransitionTime: 500,
  24090. guiAnimationSpeed: 250,
  24091. highlightAnimationDuration: 500,
  24092. modelComponentLoadSpinnerDelay: 150,
  24093. captureErrors: !1,
  24094. maxMobileTextures: 6,
  24095. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24096. startupFlyinDelay: 3e3,
  24097. dollhouseDefault: {
  24098. minDistance: 15,
  24099. maxDistance: 50,
  24100. minPolarAngle: n.Math.degToRad(10),
  24101. maxPolarAngle: n.Math.degToRad(90)
  24102. },
  24103. hideReticuleTimeout: 1e3,
  24104. analytics: {
  24105. inactivityThreshold: 30,
  24106. sessionTrackingRate: .15,
  24107. maxTrackedErrors: 20,
  24108. sessionDurationPingFrequency: 10,
  24109. sessionDurationTimeout: 15
  24110. },
  24111. flydown: {
  24112. movementEasing: "easeInOutQuad",
  24113. movementDelay: .001,
  24114. rotationEasing: "easeInOutQuad",
  24115. rotationDelay: .5,
  24116. modelTextureDelay: .75,
  24117. skyboxDelay: .75
  24118. },
  24119. transition: {
  24120. flySpeed: .01,
  24121. flyTime: 750,
  24122. flytimeMaxDistanceThreshold: 5,
  24123. flytimeDistanceMultiplier: 150,
  24124. aimTime: 1500,
  24125. aimSlowFactor: 1.5,
  24126. blur: .8,
  24127. movementEasing: "easeInOutQuad",
  24128. blendEasing: "easeInOutQuad",
  24129. fastForwardFactor: r.valueFromHash("mfis", 3)
  24130. },
  24131. show360Views: {
  24132. enabled: !0,
  24133. transitionTime: 1e3
  24134. },
  24135. quickstart: {
  24136. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24137. animation: 1400,
  24138. showTextDelay: 500,
  24139. fadeOutDelay: 3e3,
  24140. fovChange: 10
  24141. },
  24142. appConfig: {
  24143. webvr_version: null,
  24144. segment_key: null,
  24145. embedly_key: null,
  24146. branch_key: null,
  24147. keen_write_key: null,
  24148. keen_project_id: null
  24149. },
  24150. vr: {
  24151. enabled: !0,
  24152. allowWebVR: !1,
  24153. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24154. },
  24155. share: {
  24156. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24157. },
  24158. input: {
  24159. longTapThreshold: 200,
  24160. moveToleranceNDC: .08,
  24161. touchMoveThreshold: 25
  24162. },
  24163. help: {
  24164. modalStayDuration: 600
  24165. },
  24166. immersive: {
  24167. timeToShowAgain: 1250,
  24168. uiStayDuration: 600
  24169. },
  24170. tourInteraction: {
  24171. disabled: "0" === r.valueFromHash("tourcta", null),
  24172. showPauseButton: 1e3,
  24173. showModal: 1500,
  24174. allowNextClick: 200,
  24175. largeModal: "1" === r.valueFromHash("tourcta", null),
  24176. smallModal: "2" === r.valueFromHash("tourcta", null)
  24177. },
  24178. labels: {
  24179. enabled: !1,
  24180. hideUntilStart: !0,
  24181. fadeInDuration: 250,
  24182. fadeInDelay: 250,
  24183. fadeOutDuration: 250,
  24184. fadeOutDelay: 0,
  24185. zoomHideThreshhold: {
  24186. mobile: r.isSmallScreen() ? .45 : .6,
  24187. desktop: 2
  24188. },
  24189. zoomTruncateThreshhold: {
  24190. mobile: r.isSmallScreen() ? .35 : .45,
  24191. desktop: .85
  24192. },
  24193. minLengthForTruncate: 16,
  24194. truncateLength: 12,
  24195. truncateSuffix: "..."
  24196. },
  24197. tags: {
  24198. enabled: r.valueFromHash("mt", 1),
  24199. startup: {
  24200. hideUntilStart: !0,
  24201. fadeInDuration: 500,
  24202. fadeInDelay: 100
  24203. },
  24204. visibility: {
  24205. anyDistance: !0,
  24206. visibleDistance: 8,
  24207. cameraClearance: .1,
  24208. alphaTestLevel: .05,
  24209. hideViaFloor: !0,
  24210. hideOffScreenDisc: !1,
  24211. hideOffScreenObject: !1
  24212. },
  24213. disc: {
  24214. opacity: 1,
  24215. disabledOpacity: .5,
  24216. scale: {
  24217. nearBound: 1.5,
  24218. farBound: 4.8,
  24219. linkFarBound: !1,
  24220. linkPercent: 40,
  24221. maxSize: 80,
  24222. minSize: 40,
  24223. baseViewportSize: 800,
  24224. responsiveness: 100
  24225. }
  24226. },
  24227. pole: {
  24228. enabled: !0,
  24229. height: .5,
  24230. width: 2,
  24231. opacity: .5,
  24232. color: "white"
  24233. },
  24234. navigate: {
  24235. nearestPano: !0,
  24236. lineOfSight: !0,
  24237. reactivate: !0,
  24238. aimAt: "disc",
  24239. tiltTolerance: 25,
  24240. rotateSpeedFactor: .6
  24241. }
  24242. },
  24243. path: {
  24244. color: s.newBlue,
  24245. colorUp: s._desat(s.newBlue, .5),
  24246. colorDown: s._darken(s.newBlue, .35),
  24247. opacity: .5,
  24248. style: "ribbon",
  24249. height: .025,
  24250. ribbonWidth: .24,
  24251. outsideHeight: .5,
  24252. waypointRadius: .5,
  24253. waypointIndoorRadius: .24,
  24254. waypointPulse: 1e3,
  24255. typ: l.BLACK,
  24256. meshFree: r.valueFromHash("mf", 1),
  24257. mapGuides: r.valueFromHash("guides", !0),
  24258. fadeInTime: 400,
  24259. fadeOutTime: 300
  24260. },
  24261. warp: {
  24262. nearPanoDist: .1,
  24263. matchCam: !1,
  24264. blur: .33,
  24265. fastTime: 1500,
  24266. teleportTime: 1500,
  24267. outsideTime: 2e3,
  24268. lookAheadMax: .3,
  24269. lookAheadDist: 2.5,
  24270. softPushDist: .37,
  24271. softPushEnd: .3,
  24272. softBendAngle: 8,
  24273. softBendTilt: 4,
  24274. softBendEnd: .3,
  24275. doBurns: r.valueFromHash("kb", !0),
  24276. burnsAngle: 35,
  24277. minBurnsAngle: 35,
  24278. minDownAngle: -35,
  24279. maxTurnPerSec: 280,
  24280. maxAimPerSec: 35,
  24281. minRotation: 12,
  24282. maxAimRotation: 33.2,
  24283. turnFriction: .2,
  24284. flySpeed: .01,
  24285. minWarpTime: 1200,
  24286. warpInterruptionRedirectTime: 500,
  24287. tourStepDelay: r.valueFromHash("st", 0),
  24288. walkDelay: 0,
  24289. walkMaxDist: 50,
  24290. walkMinDist: .8,
  24291. walkSlideShowThreshhold: 3e3,
  24292. walkExtraPanosDistance: .4,
  24293. timePerMeter: 800,
  24294. motionLeadTime: 500,
  24295. movementEasing: "easeInOutQuad",
  24296. blendEasing: "easeInOutQuad",
  24297. showBunny: !1,
  24298. loop: r.valueFromHash("lp", !1),
  24299. auto: r.valueFromHash("ts", -1),
  24300. eOrder: "YXZ",
  24301. stepFactor: .25,
  24302. brakeStrength: 2,
  24303. minBrakeAngle: .1,
  24304. maxBrakeAngle: 1.8,
  24305. climbEffort: 4
  24306. },
  24307. rotationFriction: .05,
  24308. rotationAccelerationInside: 4.5,
  24309. rotationAccelerationOutside: .15,
  24310. rotationAfterMoveMultiplier: 40,
  24311. rotationAfterMoveHistoryCount: 5,
  24312. panFriction: .09,
  24313. panAccelerationOutside: 60,
  24314. onload: r.valueFromHash("onload", o.PANORAMA),
  24315. zoomNearLimit: .1,
  24316. zoomFarLimit: 10,
  24317. navigation: {
  24318. panoScores: !1,
  24319. mouseDirection: !0,
  24320. filterStrictness: .75,
  24321. angleFactor: -30,
  24322. directionFactor: 10,
  24323. distanceFactor: -1,
  24324. optionalityFactor: 3
  24325. },
  24326. sdkInit: !1,
  24327. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24328. console: r.valueFromHash("console", !1),
  24329. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24330. panoramaNeighbourMaxDistance: 5,
  24331. panoFloorClickRadius: .35,
  24332. showScreenshotLocations: !1,
  24333. showAxis: !1,
  24334. showNeighbourRaycasts: !1,
  24335. colorMarkerOnLoad: !1,
  24336. colorMarkerByFloor: !1,
  24337. tiling: {
  24338. panoPreRenderRepeatDelay: 2500,
  24339. panoPreRenderDelay: 500,
  24340. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24341. tilingFlagNames: ["usetiles", "tiles"],
  24342. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24343. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24344. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24345. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24346. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24347. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24348. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24349. customCompression: r.valueFromHash("tilecustcomp", 0),
  24350. mobileHighQualityOverride: !1,
  24351. allowUltraHighResolution: !1
  24352. },
  24353. zoom: {
  24354. enabled: !1,
  24355. forceOff: r.valueFromHash("nozoom", 0),
  24356. overridemax: r.valueFromHash("maxzoom", null),
  24357. overridemin: r.valueFromHash("minzoom", null),
  24358. max: d.highQualityMaxZoom,
  24359. min: 1,
  24360. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24361. activationThreshold: 1.1,
  24362. restoreTime: 500
  24363. },
  24364. profiling: {
  24365. enabled: r.valueFromHash("mem", !1)
  24366. }
  24367. };
  24368. p = h.deepExtend(p, d, {
  24369. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24370. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24371. panorama: {
  24372. transitionTime: 1e3,
  24373. modelAlpha: 0,
  24374. modelAlphaDelay: p.flydown.modelTextureDelay,
  24375. modelAlphaLength: 1,
  24376. skyboxOpacity: 1,
  24377. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24378. skyboxOpacityLength: .9,
  24379. fovLength: 1,
  24380. fovDelay: 0,
  24381. cameraMatrixDuration: .8,
  24382. cameraMatrixDelay: 0,
  24383. cameraMatrixEase: c.easeInCubic,
  24384. reticuleOpacity: 1,
  24385. markerOpacity: .3,
  24386. markerOpacityOnHover: 1
  24387. },
  24388. dollhouse: {
  24389. transitionTime: 1e3,
  24390. modelAlpha: 1,
  24391. modelAlphaDelay: 0,
  24392. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24393. skyboxOpacity: 0,
  24394. skyboxOpacityDelay: 0,
  24395. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24396. fovLength: 1,
  24397. fovDelay: 0,
  24398. cameraMatrixDuration: .8,
  24399. cameraMatrixDelay: .3,
  24400. cameraMatrixEase: c.easeInCubic,
  24401. reticuleOpacity: 1,
  24402. markerOpacity: 0,
  24403. markerOpacityOnHover: 0
  24404. },
  24405. floorplan: {
  24406. transitionTime: 1e3,
  24407. modelAlpha: 1,
  24408. modelAlphaDelay: 0,
  24409. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24410. skyboxOpacity: 0,
  24411. skyboxOpacityDelay: 0,
  24412. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24413. fovLength: 1,
  24414. fovDelay: 0,
  24415. cameraMatrixDuration: .5,
  24416. cameraMatrixDelay: 0,
  24417. cameraMatrixEase: c.easeOutCubic,
  24418. reticuleOpacity: 1,
  24419. markerOpacity: 0,
  24420. markerOpacityOnHover: 0,
  24421. cameraHeight: 50
  24422. },
  24423. transitioning: {
  24424. reticuleOpacity: 0,
  24425. markerOpacity: .3,
  24426. markerOpacityOnHover: 1
  24427. },
  24428. "floorplan-dollhouse": {
  24429. rotationDelay: 0,
  24430. rotationDuration: 1
  24431. },
  24432. "floorplan-panorama": {
  24433. rotationDelay: .5,
  24434. rotationDuration: 1
  24435. },
  24436. "dollhouse-panorama": {
  24437. rotationDelay: .5,
  24438. rotationDuration: 1
  24439. },
  24440. "dollhouse-floorplan": {
  24441. rotationDelay: 0,
  24442. rotationDuration: 1,
  24443. cameraMatrixDuration: 1.05,
  24444. cameraMatrixDelay: .5
  24445. },
  24446. "panorama-dollhouse": {
  24447. rotationDelay: 0,
  24448. rotationDuration: .5
  24449. },
  24450. "panorama-floorplan": {
  24451. transitionTime: 1500,
  24452. rotationDelay: 0,
  24453. rotationDuration: .5
  24454. }
  24455. }),
  24456. p.path.meshFree && (p.path.typ = l.WALK),
  24457. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24458. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24459. t.exports = p
  24460. }
  24461. , {
  24462. "./constants": 8,
  24463. "./enum/Colors": 19,
  24464. "./enum/VROption": 47,
  24465. "./enum/Viewmode": 51,
  24466. "./enum/WarpStyle": 52,
  24467. "./util/browser": 182,
  24468. "./util/common": 185,
  24469. "./util/easing": 186,
  24470. "./util/showcase": 193,
  24471. three: 217
  24472. }],
  24473. 167: [function(e, t, i) {
  24474. "use strict";
  24475. var n = e("three")
  24476. , r = e("./settings")
  24477. , 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"
  24478. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24479. t.exports = {
  24480. basicTextured: {
  24481. uniforms: {
  24482. tDiffuse: {
  24483. type: "t",
  24484. value: null
  24485. },
  24486. alpha: {
  24487. type: "f",
  24488. value: 1
  24489. }
  24490. },
  24491. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24492. 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}"
  24493. },
  24494. copyCubeMap: {
  24495. uniforms: {
  24496. tDiffuse: {
  24497. type: "t",
  24498. value: null
  24499. },
  24500. alpha: {
  24501. type: "f",
  24502. value: 1
  24503. }
  24504. },
  24505. 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}",
  24506. 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}"
  24507. },
  24508. cube: {
  24509. uniforms: {
  24510. map: {
  24511. type: "t",
  24512. value: null
  24513. },
  24514. opacity: {
  24515. type: "f",
  24516. value: 1
  24517. }
  24518. },
  24519. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24520. 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"
  24521. },
  24522. model: {
  24523. uniforms: {
  24524. map: {
  24525. type: "t",
  24526. value: null
  24527. },
  24528. modelAlpha: {
  24529. type: "f",
  24530. value: r.modelAlpha
  24531. },
  24532. opacity: {
  24533. type: "f",
  24534. value: 1
  24535. },
  24536. progress: {
  24537. type: "f",
  24538. value: 0
  24539. },
  24540. blackout: {
  24541. type: "i",
  24542. value: 0
  24543. },
  24544. pano0Map: {
  24545. type: "t",
  24546. value: null
  24547. },
  24548. pano0Position: {
  24549. type: "v3",
  24550. value: new n.Vector3
  24551. },
  24552. pano0Matrix: {
  24553. type: "m4",
  24554. value: new n.Matrix4
  24555. },
  24556. pano1Map: {
  24557. type: "t",
  24558. value: null
  24559. },
  24560. pano1Position: {
  24561. type: "v3",
  24562. value: new n.Vector3
  24563. },
  24564. pano1Matrix: {
  24565. type: "m4",
  24566. value: new n.Matrix4
  24567. }
  24568. },
  24569. 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",
  24570. 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"
  24571. },
  24572. hot:{
  24573. uniforms:{
  24574. color:{
  24575. type: "c",
  24576. value: new n.Color( 0xff2200 )
  24577. },
  24578. opac:{
  24579. type: "f",
  24580. value: 0
  24581. },
  24582. texture1:{
  24583. type: "t",
  24584. value: null
  24585. },
  24586. texture2:{
  24587. type: "t",
  24588. value: null
  24589. }
  24590. },
  24591. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24592. 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 = tcolor1+ vec4(opac)*tcolor2;}\n"
  24593. },
  24594. modelOutside: {
  24595. uniforms: {
  24596. map: {
  24597. type: "t",
  24598. value: null
  24599. },
  24600. opacity: {
  24601. type: "f",
  24602. value: 1
  24603. }
  24604. },
  24605. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24606. 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"
  24607. },
  24608. ribbon: {
  24609. uniforms: {
  24610. map: {
  24611. type: "t",
  24612. value: null
  24613. },
  24614. opacity: {
  24615. type: "f",
  24616. value: 1
  24617. },
  24618. color: {
  24619. type: "c",
  24620. value: new n.Color(r.path.color)
  24621. }
  24622. },
  24623. 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",
  24624. 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"
  24625. },
  24626. waypoint: {
  24627. uniforms: {
  24628. map: {
  24629. type: "t",
  24630. value: null
  24631. },
  24632. opacity: {
  24633. type: "f",
  24634. value: 1
  24635. },
  24636. pulse: {
  24637. type: "f",
  24638. value: 1
  24639. },
  24640. nearFade: {
  24641. type: "v2",
  24642. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24643. },
  24644. color: {
  24645. type: "c",
  24646. value: new n.Color(r.reticuleColor)
  24647. }
  24648. },
  24649. 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",
  24650. 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"
  24651. },
  24652. modelDebug: {
  24653. uniforms: {
  24654. map: {
  24655. type: "t",
  24656. value: null
  24657. },
  24658. modelAlpha: {
  24659. type: "f",
  24660. value: r.modelAlpha
  24661. },
  24662. depthmapRatio: {
  24663. type: "f",
  24664. value: 0
  24665. },
  24666. opacity: {
  24667. type: "f",
  24668. value: 1
  24669. },
  24670. progress: {
  24671. type: "f",
  24672. value: 0
  24673. },
  24674. considerOcclusion: {
  24675. type: "i",
  24676. value: r.fancierTransition
  24677. },
  24678. highlightPanoSelection: {
  24679. type: "i",
  24680. value: 0
  24681. },
  24682. useThirdPano: {
  24683. type: "i",
  24684. value: r.useThirdPano
  24685. },
  24686. pano0Map: {
  24687. type: "t",
  24688. value: null
  24689. },
  24690. pano0Depth: {
  24691. type: "t",
  24692. value: null
  24693. },
  24694. pano0Position: {
  24695. type: "v3",
  24696. value: new n.Vector3
  24697. },
  24698. pano0Matrix: {
  24699. type: "m4",
  24700. value: new n.Matrix4
  24701. },
  24702. pano0Weight: {
  24703. type: "f",
  24704. value: r.transition.pano0Weight
  24705. },
  24706. pano1Map: {
  24707. type: "t",
  24708. value: null
  24709. },
  24710. pano1Depth: {
  24711. type: "t",
  24712. value: null
  24713. },
  24714. pano1Position: {
  24715. type: "v3",
  24716. value: new n.Vector3
  24717. },
  24718. pano1Matrix: {
  24719. type: "m4",
  24720. value: new n.Matrix4
  24721. },
  24722. pano1Weight: {
  24723. type: "f",
  24724. value: r.transition.pano1Weight
  24725. },
  24726. pano2Map: {
  24727. type: "t",
  24728. value: null
  24729. },
  24730. pano2Depth: {
  24731. type: "t",
  24732. value: null
  24733. },
  24734. pano2Position: {
  24735. type: "v3",
  24736. value: new n.Vector3
  24737. },
  24738. pano2Matrix: {
  24739. type: "m4",
  24740. value: new n.Matrix4
  24741. },
  24742. pano2Weight: {
  24743. type: "f",
  24744. value: r.transition.pano2Weight
  24745. }
  24746. },
  24747. 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",
  24748. 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"
  24749. },
  24750. customDepth: {
  24751. uniforms: {
  24752. panoPosition: {
  24753. type: "v3",
  24754. value: new n.Vector3
  24755. }
  24756. },
  24757. 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",
  24758. 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"
  24759. },
  24760. skysphere: {
  24761. uniforms: {
  24762. radius: {
  24763. type: "f",
  24764. value: 0
  24765. }
  24766. },
  24767. 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",
  24768. 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"
  24769. },
  24770. tagDisc: {
  24771. uniforms: {
  24772. opacity: {
  24773. type: "f",
  24774. value: 0
  24775. },
  24776. color: {
  24777. type: "c",
  24778. value: new n.Color
  24779. },
  24780. bg: {
  24781. type: "t",
  24782. value: null
  24783. },
  24784. mask: {
  24785. type: "t",
  24786. value: null
  24787. }
  24788. },
  24789. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24790. 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"
  24791. }
  24792. }
  24793. }
  24794. , {
  24795. "./settings": 166,
  24796. three: 217
  24797. }],
  24798. 168: [function(e, t, i) {
  24799. (function(i) {
  24800. "use strict";
  24801. var n = e("three")
  24802. , r = (e("url"),
  24803. e("./util/ajax"))
  24804. , o = e("./settings")
  24805. , a = e("./util/logger")
  24806. , s = e("./util/math")
  24807. , l = e("./util/showcase")
  24808. , c = e("./objects/Panorama")
  24809. , h = new a(i)
  24810. , u = e("./model/Model")
  24811. , d = e("./shaders")
  24812. , p = e("./util/transitions")
  24813. , f = e("./objects/Chunk")
  24814. , g = e("./objects/Reticule")
  24815. , m = e("./objects/Skybox")
  24816. , v = e("./objects/Floor")
  24817. , A = e("./cameras/DollhouseCamera")
  24818. , y = e("./cameras/FloorplanCamera")
  24819. , C = e("./cameras/PanoramaCamera")
  24820. , I = e("./controls/DollhouseControls")
  24821. , E = e("./controls/FloorplanControls")
  24822. , b = e("./controls/PanoramaControls");
  24823. n.ImageUtils.crossOrigin = o.crossOrigin,
  24824. t.exports = {
  24825. shaders: d,
  24826. transitions: p,
  24827. Model: u,
  24828. Chunk: f,
  24829. Floor: v,
  24830. Skybox: m,
  24831. Reticule: g,
  24832. Panorama: c,
  24833. DollhouseCamera: A,
  24834. FloorplanCamera: y,
  24835. PanoramaCamera: C,
  24836. DollhouseControls: I,
  24837. FloorplanControls: E,
  24838. PanoramaControls: b,
  24839. getModel: function(e) {
  24840. if (!e.url)
  24841. throw 'getModel(): missing parameter "url"';
  24842. e.autoload = void 0 === e.autoload || e.autoload;
  24843. var t = l.parseSidUrl(e.url);
  24844. e.urlBase = t.urlBase,
  24845. e.urlModel = t.urlModel,
  24846. e.urlFiles = t.urlFiles;
  24847. var i = this._getPlatformError();
  24848. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  24849. this._loadModel().then(this._buildModel.bind(this)))
  24850. },
  24851. _getPlatformError: function() {
  24852. 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"
  24853. },
  24854. _loadModel: function() {
  24855. return r.get(this.options.urlModel, {
  24856. responseType: "json",
  24857. prefetchFrom: "model",
  24858. auth: l.getAuthorizationHeader()
  24859. }).then(null, function() {
  24860. return h.warn("Model loading failed at initial metadata load"),
  24861. "loading-failed"
  24862. })
  24863. },
  24864. _buildModel: function(e) {
  24865. e = l.normalizeModeldata(e, s);
  24866. var t = new u(this.options,e);
  24867. return this.options.autoload ? t.load(!0) : $.when(t)
  24868. }
  24869. }
  24870. }
  24871. ).call(this, "/js/showcase.js")
  24872. }
  24873. , {
  24874. "./cameras/DollhouseCamera": 5,
  24875. "./cameras/FloorplanCamera": 6,
  24876. "./cameras/PanoramaCamera": 7,
  24877. "./controls/DollhouseControls": 10,
  24878. "./controls/FloorplanControls": 11,
  24879. "./controls/PanoramaControls": 13,
  24880. "./model/Model": 139,
  24881. "./objects/Chunk": 144,
  24882. "./objects/Floor": 146,
  24883. "./objects/Panorama": 148,
  24884. "./objects/Reticule": 149,
  24885. "./objects/Skybox": 152,
  24886. "./settings": 166,
  24887. "./shaders": 167,
  24888. "./util/ajax": 181,
  24889. "./util/logger": 189,
  24890. "./util/math": 190,
  24891. "./util/showcase": 193,
  24892. "./util/transitions": 195,
  24893. three: 217,
  24894. url: 208
  24895. }],
  24896. 169: [function(e, t, i) {
  24897. "use strict";
  24898. function n() {
  24899. var e = {
  24900. renderTarget: null,
  24901. inUse: !1,
  24902. size: -1,
  24903. pano: null
  24904. };
  24905. return e
  24906. }
  24907. function r(e) {
  24908. M.push(e)
  24909. }
  24910. function o(e) {
  24911. var t = n();
  24912. return t.inUse = !0,
  24913. t.size = e,
  24914. r(t),
  24915. t
  24916. }
  24917. function a(e) {
  24918. for (var t = 0; t < M.length; t++) {
  24919. var i = M[t];
  24920. if (!i.inUse && i.size === e)
  24921. return i.inUse = !0,
  24922. i
  24923. }
  24924. return null
  24925. }
  24926. function s(e) {
  24927. for (var t = 0; t < M.length; t++) {
  24928. var i = M[t];
  24929. if (i.renderTarget === e)
  24930. return i.inUse = !1,
  24931. !0
  24932. }
  24933. return !1
  24934. }
  24935. function l() {
  24936. this.tileDirectory = {},
  24937. this.activeRenderTargetDescriptors = {},
  24938. this.activePanos = [],
  24939. this.panoLODDescriptors = {},
  24940. this.panoDescriptors = {},
  24941. this.tileTrees = {},
  24942. this.sceneRenderer = null,
  24943. this.tileDownloader = null,
  24944. this.forceQueue = [],
  24945. this.uploadQueues = {},
  24946. this.uploadInterval = null,
  24947. this.uploadIntervalCancelled = !1,
  24948. this.usingTileOverlay = !1,
  24949. this.overlayTilesLoaded = !1,
  24950. this.overlayTileBase = null,
  24951. this.overlayTilesBasic = {},
  24952. this.overlayTilesEnhanced = {},
  24953. this.zoomRenderTarget = null,
  24954. this.zoomPano = null,
  24955. this.zoomingActive = !1,
  24956. this.zoomPanoId = null,
  24957. this.zoomPanoRenderingDisabled = !1,
  24958. this.direction = new h.Vector3,
  24959. this.initTime = -1,
  24960. this.maxBaseUploadsPerFrame = x,
  24961. this.maxNonBaseUploadsPerFrame = T
  24962. }
  24963. function c() {
  24964. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  24965. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  24966. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  24967. }
  24968. var h = e("three")
  24969. , u = e("../exception/BasicException")
  24970. , d = e("../settings")
  24971. , p = e("../enum/PanoSizeClass")
  24972. , f = (e("../objects/Panorama"),
  24973. e("../enum/PanoRendererEvents"))
  24974. , g = e("../enum/SceneRendererEvents")
  24975. , m = e("../enum/TileDownloaderEvents")
  24976. , v = e("../enum/Vectors")
  24977. , A = (e("../enum/GLCubeFaces"),
  24978. e("../objects/Panorama"),
  24979. e("./TileTree"))
  24980. , y = (e("./TileDownloader"),
  24981. e("./TilePrioritizer"))
  24982. , C = e("./TileUtils")
  24983. , p = e("../enum/PanoSizeClass")
  24984. , I = (e("../util/browser"),
  24985. e("../util/panorama"))
  24986. , E = e("events").EventEmitter
  24987. , b = !1
  24988. , w = d.tiling.uploadIntervalDelay
  24989. , _ = d.tiling.initialIntervalDelay
  24990. , T = d.tiling.maxNonBaseUploadsPerFrame
  24991. , x = d.tiling.maxBaseUploadsPerFrame
  24992. , S = {
  24993. Base: 0,
  24994. Remaining: 1
  24995. }
  24996. , M = [];
  24997. l.prototype = Object.create(E.prototype),
  24998. l.prototype.init = function(e, t, i) {
  24999. this.sceneRenderer = e,
  25000. this.tileDownloader = t,
  25001. this.qualityManager = i,
  25002. this.bindEvents(),
  25003. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  25004. this.initTime = performance.now()
  25005. }
  25006. ,
  25007. l.prototype.getActivePanoTextures = function(e) {
  25008. e = e || [];
  25009. for (var t = 0; t < M.length; t++) {
  25010. var i = M[t];
  25011. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25012. }
  25013. }
  25014. ,
  25015. l.prototype.hasQueuedTiles = function() {
  25016. var e = this.peekNextFromUploadQueue();
  25017. return null !== e && void 0 !== e
  25018. }
  25019. ,
  25020. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  25021. return this.activeRenderTargetDescriptors[e]
  25022. }
  25023. ,
  25024. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25025. this.activeRenderTargetDescriptors[e] = t
  25026. }
  25027. ,
  25028. l.prototype.loadOverlayTiles = function() {
  25029. if (0 !== d.tiling.overlayStyle) {
  25030. var e = 0
  25031. , t = function(t, n, r) {
  25032. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  25033. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  25034. e++,
  25035. e === i.length && (this.overlayTilesLoaded = !0)
  25036. }
  25037. .bind(this)
  25038. , i = [["images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  25039. i.forEach(function(e) {
  25040. this.tileDownloader.loadImage(e[0], 0, e[1])
  25041. }
  25042. .bind(this)),
  25043. this.usingTileOverlay = !0
  25044. } else
  25045. this.usingTileOverlay = !1
  25046. }
  25047. ,
  25048. l.prototype.bindEvents = function() {
  25049. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25050. }
  25051. ,
  25052. l.prototype.setupZoomRenderTarget = function() {
  25053. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25054. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25055. return;
  25056. var e = this.zoomRenderTarget;
  25057. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25058. e) {
  25059. var t = e.width
  25060. , i = this.zoomRenderTarget.width;
  25061. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25062. e.texture.dispose(),
  25063. e.texture.loaded = !1,
  25064. e.texture.version = 0,
  25065. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25066. e.texture = null
  25067. }
  25068. this.zoomPanoRenderingDisabled = !1
  25069. } else
  25070. this.zoomPanoRenderingDisabled = !0
  25071. }
  25072. ,
  25073. l.prototype.enableUltraHighQualityMode = function(e) {
  25074. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25075. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25076. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  25077. t && (this.qualityManager.enableUltraHighQualityMode(),
  25078. this.setupZoomRenderTarget(),
  25079. e())
  25080. }
  25081. .bind(this))
  25082. }
  25083. }
  25084. ,
  25085. l.prototype.activateTiledPano = function(e, t, i) {
  25086. i && this.clearAllQueuedUploads();
  25087. for (var n = 0; n < C.FACES_PER_PANO; n++)
  25088. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25089. this.linkAllTilesAndNodes(e);
  25090. var r = this.getActiveRenderTargetDescriptor(e.id)
  25091. , l = t;
  25092. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  25093. !r || l !== r.size) {
  25094. if (r && s(r.renderTarget),
  25095. r = a(l),
  25096. !r) {
  25097. var c = this.initTiledPano(l, !1);
  25098. r = o(c.width),
  25099. r.renderTarget = c
  25100. }
  25101. r.pano = e,
  25102. this.resetPanoDescriptor(e.id),
  25103. this.resetPanoLODDescriptors(e.id),
  25104. this.resetRenderStatus(e.id, !0, !0)
  25105. }
  25106. this.setActiveRenderTargetDescriptor(e.id, r);
  25107. var h = i ? 0 : 1;
  25108. return this.updateActivePanos(e, h),
  25109. r.renderTarget
  25110. }
  25111. ,
  25112. l.prototype.deactivateTiledPano = function(e) {
  25113. var t = this.getActiveRenderTargetDescriptor(e.id);
  25114. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  25115. this.setActiveRenderTargetDescriptor(e.id, null);
  25116. var i = this.getUploadQueueForPano(e.id);
  25117. this.clearUploadQueue(i),
  25118. this.updateActivePanos()
  25119. }
  25120. ,
  25121. l.prototype.updateActivePanos = function() {
  25122. var e = [];
  25123. return function(t, i) {
  25124. e.length = 0;
  25125. for (var n = 0; n < this.activePanos.length; n++) {
  25126. t && e.length === i && e.push(t);
  25127. var r = this.activePanos[n]
  25128. , o = this.getActiveRenderTargetDescriptor(r.id);
  25129. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  25130. }
  25131. t && i >= e.length && e.push(t),
  25132. this.activePanos.length = 0,
  25133. this.activePanos.push.apply(this.activePanos, e)
  25134. }
  25135. }(),
  25136. l.prototype.getActivePanoCount = function() {
  25137. return this.activePanos.length
  25138. }
  25139. ,
  25140. l.prototype.resetRenderStatus = function(e, t, i, n) {
  25141. var r = null;
  25142. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  25143. for (var o = function(e, n, r, o) {
  25144. i && (n.tile.zoomUploaded = !1),
  25145. t && (n.tile.uploaded = !1)
  25146. }, a = 0; a < C.FACES_PER_PANO; a++) {
  25147. var s = this.getTileTree(e, a);
  25148. s.breadthFirst({
  25149. callback: o.bind(this, a),
  25150. minLevel: r
  25151. })
  25152. }
  25153. }
  25154. ,
  25155. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25156. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25157. t.tile.zoomUploaded = t.tile.uploaded,
  25158. t.zoomCovered = t.covered
  25159. }, n = 0; n < C.FACES_PER_PANO; n++) {
  25160. var r = this.getTileTree(e, n);
  25161. r.breadthFirst({
  25162. callback: i.bind(this, n),
  25163. maxLevel: t
  25164. })
  25165. }
  25166. }
  25167. ,
  25168. l.prototype.renderPanoTiles = function() {
  25169. var e = [];
  25170. return function(t, i, n, r) {
  25171. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25172. i = i || this.direction || v.FORWARD;
  25173. var o = this.getActiveRenderTargetDescriptor(t);
  25174. if (!this.isRenderTargetDescriptorValid(o))
  25175. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25176. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  25177. var s = this.getTileTree(t, a);
  25178. e.length = 0,
  25179. s.breadthFirst({
  25180. saveVisited: e
  25181. });
  25182. for (var l = 0; l < e.length; l++) {
  25183. var c = e[l];
  25184. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  25185. }
  25186. }
  25187. this.updateDirection(i)
  25188. }
  25189. }(),
  25190. l.prototype.isRenderTargetDescriptorValid = function(e) {
  25191. return e && e.renderTarget
  25192. }
  25193. ,
  25194. l.prototype.isPanoActive = function(e) {
  25195. var t = this.getActiveRenderTargetDescriptor(e);
  25196. return this.isRenderTargetDescriptorValid(t)
  25197. }
  25198. ,
  25199. l.prototype.isPanoZoomed = function(e) {
  25200. return this.zoomingActive && this.zoomPanoId === e
  25201. }
  25202. ,
  25203. l.prototype.initTileTree = function(e, t, i) {
  25204. var n = this.tileTrees[e];
  25205. n || (n = [],
  25206. this.tileTrees[e] = n);
  25207. var r = n[t];
  25208. if (!r) {
  25209. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  25210. r = new A(C.TILE_SIZE,o),
  25211. n[t] = r
  25212. }
  25213. }
  25214. ,
  25215. l.prototype.getTileTree = function(e, t) {
  25216. var i = this.tileTrees[e];
  25217. if (!i)
  25218. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25219. var n = i[t];
  25220. if (!n)
  25221. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25222. return n
  25223. }
  25224. ,
  25225. l.prototype.initTiledPano = function(e, t) {
  25226. var i = this.sceneRenderer.renderer
  25227. , n = (i.context,
  25228. new h.WebGLRenderTargetCube(e,e,{
  25229. stencilBuffer: !1
  25230. }))
  25231. , r = new h.CubeTexture([]);
  25232. n.texture = r,
  25233. r.image = [null, null, null, null, null, null],
  25234. r.flipY = !0,
  25235. t ? (r.generateMipmaps = !0,
  25236. r.magFilter = h.LinearFilter,
  25237. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25238. r.magFilter = h.LinearFilter,
  25239. r.minFilter = h.LinearFilter),
  25240. r.format = h.RGBAFormat,
  25241. i.setRenderTarget(n),
  25242. i.setRenderTarget(null);
  25243. var o = i.properties.get(r);
  25244. return o.__image__webglTextureCube = o.__webglTexture,
  25245. n
  25246. }
  25247. ,
  25248. l.prototype.getUploadQueueForPano = function(e) {
  25249. var t = this.uploadQueues[e];
  25250. return t || (t = [],
  25251. this.uploadQueues[e] = t),
  25252. t
  25253. }
  25254. ,
  25255. l.prototype.isTileUploaded = function(e) {
  25256. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25257. }
  25258. ,
  25259. l.prototype.setUploaded = function(e, t) {
  25260. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25261. }
  25262. ,
  25263. l.prototype.queueTileUpload = function(e, t, i) {
  25264. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25265. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25266. var r = this.getUploadQueueForPano(e.panoId);
  25267. 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),
  25268. e.uploadQueued = !0,
  25269. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25270. }
  25271. }
  25272. ,
  25273. l.prototype.shoulPushToFrontOfQueue = function(e) {
  25274. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  25275. }
  25276. ,
  25277. l.prototype.getTopUploadQueue = function() {
  25278. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  25279. for (var n = 0; n < this.activePanos.length; n++)
  25280. if (e = this.activePanos[n],
  25281. t = this.getUploadQueueForPano(e.id),
  25282. t.length > 0)
  25283. switch (i) {
  25284. case S.Base:
  25285. if (0 === t[0].level)
  25286. return t;
  25287. break;
  25288. case S.Remaining:
  25289. return t
  25290. }
  25291. return null
  25292. }
  25293. ,
  25294. l.prototype.getNextFromUploadQueue = function() {
  25295. var e = function(e) {
  25296. var t = e.shift();
  25297. return t.uploadQueued = !1,
  25298. t
  25299. };
  25300. return function() {
  25301. if (this.forceQueue.length > 0)
  25302. return e(this.forceQueue);
  25303. var t = this.getTopUploadQueue();
  25304. return t && t.length > 0 ? e(t) : null
  25305. }
  25306. }(),
  25307. l.prototype.peekNextFromUploadQueue = function() {
  25308. if (this.forceQueue.length > 0)
  25309. return this.forceQueue[0];
  25310. var e = this.getTopUploadQueue();
  25311. return e && e.length > 0 ? e[0] : null
  25312. }
  25313. ,
  25314. l.prototype.clearAllQueuedUploads = function() {
  25315. this.clearAllUploadQueues(null, 0)
  25316. }
  25317. ,
  25318. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  25319. this.clearAllUploadQueues(e, 0)
  25320. }
  25321. ,
  25322. l.prototype.clearAllUploadQueues = function(e, t) {
  25323. if (e)
  25324. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25325. this.clearUploadQueue(this.forceQueue, t, e);
  25326. else {
  25327. for (var i = 0; i < this.activePanos.length; i++) {
  25328. var n = this.activePanos[i];
  25329. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25330. }
  25331. this.clearUploadQueue(this.forceQueue, t)
  25332. }
  25333. }
  25334. ,
  25335. l.prototype.clearUploadQueue = function(e, t, i) {
  25336. void 0 !== t && null !== t || (t = 0);
  25337. for (var n = 0; n < e.length; ) {
  25338. var r = e[n];
  25339. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25340. e.splice(n, 1)) : n++
  25341. }
  25342. }
  25343. ,
  25344. l.prototype.refreshUploadInterval = function() {
  25345. var e = null;
  25346. return function(t) {
  25347. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  25348. null !== t && void 0 !== t || (t = w),
  25349. b || (t = _),
  25350. this.uploadInterval = window.setTimeout(e, t),
  25351. this.uploadIntervalDelay = t)
  25352. }
  25353. }(),
  25354. l.prototype.update = function() {
  25355. var e = performance.now()
  25356. , t = 0;
  25357. return function() {
  25358. this.uploadIntervalCancelled = !0,
  25359. window.clearTimeout(this.uploadInterval),
  25360. this.uploadInterval = null;
  25361. var i = performance.now() - e;
  25362. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25363. e = performance.now()),
  25364. t++
  25365. }
  25366. }(),
  25367. l.prototype.updateUploadQueue = function(e, t) {
  25368. e || (e = 1);
  25369. for (var i = 0, n = 0; ; ) {
  25370. if (n >= t || i >= e)
  25371. break;
  25372. var r = this.getNextFromUploadQueue();
  25373. if (!r)
  25374. break;
  25375. if (0 !== r.level ? i++ : n++,
  25376. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25377. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25378. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25379. }
  25380. }
  25381. }
  25382. ,
  25383. l.prototype.updateDirection = function(e) {
  25384. if (e = e || this.direction) {
  25385. this.direction = e;
  25386. for (var t = 0; t < this.activePanos.length; t++) {
  25387. var i = this.activePanos[t]
  25388. , n = this.getUploadQueueForPano(i.id);
  25389. y.sortPanoTiles(n, i, this.direction)
  25390. }
  25391. }
  25392. }
  25393. ,
  25394. l.prototype.uploadTile = function() {
  25395. var e = {}
  25396. , t = (new h.Vector4,
  25397. d.tiling.overlayStyle);
  25398. return function(i, n) {
  25399. var r = i.panoId
  25400. , o = i.image
  25401. , a = i.tileSize
  25402. , s = i.panoSize
  25403. , l = i.tileIndex
  25404. , c = (i.faceTileIndex,
  25405. i.totalTiles)
  25406. , u = (i.face,
  25407. i.tileX)
  25408. , d = i.tileY
  25409. , p = !0
  25410. , g = !1
  25411. , m = (this.getPanoDescriptor(r),
  25412. this.getPanoLODDescriptor(r, s))
  25413. , v = this.getActiveRenderTargetDescriptor(r)
  25414. , A = v.renderTarget
  25415. , y = v.size;
  25416. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  25417. y = this.qualityManager.getMaxZoomPanoSize()),
  25418. this.isRenderTargetDescriptorValid(v) || (p = !1,
  25419. g = !1),
  25420. n || (this.anyUploaded(i.node) && (p = !1,
  25421. g = !0),
  25422. this.isTileUploaded(i) && (p = !1,
  25423. g = !1)),
  25424. p) {
  25425. var C = u * a
  25426. , I = d * a
  25427. , E = a / s * y
  25428. , b = C / s * y
  25429. , w = I / s * y;
  25430. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  25431. var _ = e[a];
  25432. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  25433. 1 === t || 2 === t) {
  25434. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25435. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  25436. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  25437. } else
  25438. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  25439. m.uploadCount++,
  25440. this.emit(f.TileRenderSuccess, r, s, l, c),
  25441. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  25442. this.setUploaded(i, !0),
  25443. this.addCoverageForNode(i.node)
  25444. } else
  25445. this.setUploaded(i, !1);
  25446. return i.uploadAttempted || (m.uploadAttempts++,
  25447. this.emit(f.TileUploadAttempted, r, s, l, c)),
  25448. i.uploadAttempted = !0,
  25449. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  25450. g
  25451. }
  25452. }(),
  25453. l.prototype.linkTileAndNode = function(e, t) {
  25454. t.tile = e,
  25455. e.node = t
  25456. }
  25457. ,
  25458. l.prototype.linkAllTilesAndNodes = function(e) {
  25459. for (var t = function(t, i, n, r, o) {
  25460. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  25461. this.linkTileAndNode(a, n)
  25462. }, i = 0; i < C.FACES_PER_PANO; i++) {
  25463. var n = this.getTileTree(e.id, i);
  25464. n.breadthFirst({
  25465. callback: t.bind(this, n, i)
  25466. })
  25467. }
  25468. }
  25469. ,
  25470. l.prototype.anyUploaded = function(e) {
  25471. if (!e)
  25472. return !1;
  25473. if (e.tile && this.isTileUploaded(e.tile))
  25474. return !0;
  25475. if (e.children)
  25476. for (var t = 0; t < e.children.length; t++) {
  25477. var i = e.children[t];
  25478. if (this.anyUploaded(i))
  25479. return !0
  25480. }
  25481. return !1
  25482. }
  25483. ,
  25484. l.prototype.setNodeCovered = function(e, t) {
  25485. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25486. }
  25487. ,
  25488. l.prototype.isNodeCovered = function(e) {
  25489. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25490. }
  25491. ,
  25492. l.prototype.addCoverageForNode = function(e) {
  25493. if (this.setNodeCovered(e, !0),
  25494. e.parent && e.covered) {
  25495. var t = e.parent;
  25496. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25497. }
  25498. }
  25499. ,
  25500. l.prototype.calcFullCoverage = function(e) {
  25501. var t = !1;
  25502. if (e.children)
  25503. for (var i = 0; i < e.children.length; i++) {
  25504. var n = e.children[i];
  25505. t = t || this.calcFullCoverage(n)
  25506. }
  25507. e.covered = e.tile.uploaded || t
  25508. }
  25509. ,
  25510. l.prototype.nodeSubcovered = function(e) {
  25511. if (!e.children)
  25512. return !1;
  25513. for (var t = 0; t < e.children.length; t++)
  25514. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25515. return !1;
  25516. return !0
  25517. }
  25518. ,
  25519. l.prototype.resetPanoDescriptor = function(e) {
  25520. this.getPanoDescriptor(e)
  25521. }
  25522. ,
  25523. l.prototype.getPanoDescriptor = function(e) {
  25524. var t = this.panoDescriptors[e];
  25525. return t || (t = {},
  25526. this.panoDescriptors[e] = t),
  25527. t
  25528. }
  25529. ,
  25530. l.prototype.resetPanoLODDescriptors = function(e) {
  25531. var t = this.getPanoLODDescriptors(e);
  25532. for (var i in t)
  25533. if (t.hasOwnProperty(i)) {
  25534. var n = t[i];
  25535. n.uploadCount = 0,
  25536. n.uploadAttempts = 0
  25537. }
  25538. }
  25539. ,
  25540. l.prototype.getPanoLODDescriptor = function(e, t) {
  25541. var i = this.getPanoLODDescriptors(e)
  25542. , n = i[t];
  25543. return n || (n = {
  25544. uploadCount: 0,
  25545. uploadAttempts: 0
  25546. },
  25547. i[t] = n),
  25548. n
  25549. }
  25550. ,
  25551. l.prototype.getPanoLODDescriptors = function(e) {
  25552. var t = this.panoLODDescriptors[e];
  25553. return t || (t = {},
  25554. this.panoLODDescriptors[e] = t),
  25555. t
  25556. }
  25557. ,
  25558. l.prototype.onTileDownloaded = function(e) {
  25559. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  25560. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25561. if (i.downloaded = !0,
  25562. i.image = e.image,
  25563. i.panoSize = e.panoSize,
  25564. i.tileX = e.tileX,
  25565. i.tileY = e.tileY,
  25566. i.totalTiles = e.totalTiles,
  25567. i.tileIndex = e.tileIndex,
  25568. i.faceTileIndex = e.faceTileIndex,
  25569. i.face = e.face,
  25570. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  25571. i.panoId = e.panoId,
  25572. i.tileSize = e.tileSize,
  25573. i.direction = (new h.Vector3).copy(e.direction),
  25574. i.node = null,
  25575. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  25576. this.isPanoActive(i.panoId)) {
  25577. var n = this.getTileTree(i.panoId, i.face)
  25578. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  25579. this.linkTileAndNode(i, r),
  25580. this.queueTileUpload(i, !0)
  25581. }
  25582. }
  25583. ,
  25584. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25585. var r = this.tileDirectory[e];
  25586. r || (r = {},
  25587. this.tileDirectory[e] = r);
  25588. var o = 16384 * t + 1024 * i + n
  25589. , a = r[o];
  25590. return a || (a = {
  25591. downloaded: !1,
  25592. uploaded: !1,
  25593. zoomUploaded: !1
  25594. },
  25595. r[o] = a),
  25596. a._key = e + ":" + t + ":" + i + ":" + n,
  25597. a._tileKey = o,
  25598. a
  25599. }
  25600. ,
  25601. l.prototype.setZoomingActive = function(e, t, i) {
  25602. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25603. this.zoomPanoId = t.id,
  25604. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25605. }
  25606. ,
  25607. l.prototype.updateZoomedPanoFromBase = function(e) {
  25608. if (!this.zoomPanoRenderingDisabled) {
  25609. var t = this.getActiveRenderTargetDescriptor(e.id);
  25610. if (t && t.renderTarget) {
  25611. var i = this.qualityManager.getMaxZoomPanoSize()
  25612. , n = t.renderTarget
  25613. , r = t.size;
  25614. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25615. this.copyBaseRenderStatusToZoomed(e.id)
  25616. }
  25617. }
  25618. }
  25619. ,
  25620. t.exports = l
  25621. }
  25622. , {
  25623. "../enum/GLCubeFaces": 25,
  25624. "../enum/PanoRendererEvents": 35,
  25625. "../enum/PanoSizeClass": 36,
  25626. "../enum/SceneRendererEvents": 43,
  25627. "../enum/TileDownloaderEvents": 45,
  25628. "../enum/Vectors": 50,
  25629. "../exception/BasicException": 55,
  25630. "../objects/Panorama": 148,
  25631. "../settings": 166,
  25632. "../util/browser": 182,
  25633. "../util/panorama": 191,
  25634. "./TileDownloader": 171,
  25635. "./TilePrioritizer": 172,
  25636. "./TileTree": 173,
  25637. "./TileUtils": 174,
  25638. events: 202,
  25639. three: 217
  25640. }],
  25641. 170: [function(e, t, i) {
  25642. "use strict";
  25643. function n(e, t, i) {
  25644. this.maxNavPanoSize = -1,
  25645. this.maxZoomPanoSize = -1,
  25646. this.devicePixelDensity = e,
  25647. this.deviceScreenSize = t,
  25648. this.clientBandwidth = i,
  25649. this.panoSizeClassMap = {},
  25650. this.useHighResolutionPanos = !0,
  25651. this.useUltraHighResolutionPanos = !1,
  25652. this.modelHasUltraHighPanos = !1
  25653. }
  25654. var r = e("../enum/PanoSizeClass")
  25655. , o = e("../settings")
  25656. , a = e("../util/browser")
  25657. , s = e("../constants")
  25658. , l = e("../util/showcase")
  25659. , c = e("../enum/ModelManagerEvents");
  25660. n.prototype.init = function(e) {
  25661. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25662. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25663. this.highSize = this.getPanoSize(r.HIGH),
  25664. this.standardSize = this.getPanoSize(r.STANDARD),
  25665. this.baseSize = this.getPanoSize(r.BASE),
  25666. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25667. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25668. this.updateMaximums(),
  25669. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25670. }
  25671. ,
  25672. n.prototype.updateFromModel = function(e) {
  25673. this.updateHighResolutionSettings(e),
  25674. this.updateUltraHighResolutionSettings(e)
  25675. }
  25676. ,
  25677. n.prototype.updateHighResolutionSettings = function(e) {
  25678. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25679. this.updateMaximums()
  25680. }
  25681. ,
  25682. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25683. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25684. this.updateMaximums()
  25685. }
  25686. ,
  25687. n.prototype.enableUltraHighQualityMode = function() {
  25688. this.modelHasUltraHighPanos = !0,
  25689. this.updateUltraHighResolutionSettings(null)
  25690. }
  25691. ,
  25692. n.prototype.ultraHighQualityModeEnabled = function() {
  25693. return this.modelHasUltraHighPanos
  25694. }
  25695. ,
  25696. n.prototype.onModelChanged = function(e) {
  25697. this.updateFromModel(e.model),
  25698. this.updateMaximums()
  25699. }
  25700. ,
  25701. n.prototype.updateMaximums = function() {
  25702. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25703. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25704. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25705. }
  25706. ,
  25707. n.prototype.buildPanoSizeClassMap = function() {
  25708. this.panoSizeClassMap[r.BASE] = 512,
  25709. this.panoSizeClassMap[r.STANDARD] = 1024,
  25710. this.panoSizeClassMap[r.HIGH] = 2048,
  25711. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25712. }
  25713. ,
  25714. n.prototype.getPanoSize = function(e) {
  25715. return this.panoSizeClassMap[e]
  25716. }
  25717. ,
  25718. n.prototype.getMaxPossiblePanoSize = function() {
  25719. return this.getPanoSize(r.ULTRAHIGH)
  25720. }
  25721. ,
  25722. n.prototype.getMaxPanoSize = function() {
  25723. return this.maxZoomPanoSize
  25724. }
  25725. ,
  25726. n.prototype.getMaxNavPanoSize = function() {
  25727. return this.maxNavPanoSize
  25728. }
  25729. ,
  25730. n.prototype.getMaxZoomPanoSize = function() {
  25731. return this.maxZoomPanoSize
  25732. }
  25733. ,
  25734. n.prototype.detectMaxNavPanoSizeClass = function() {
  25735. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  25736. }
  25737. ,
  25738. n.prototype.detectMaxNavPanoSize = function() {
  25739. var e = this.detectMaxNavPanoSizeClass();
  25740. return this.getPanoSize(e)
  25741. }
  25742. ,
  25743. n.prototype.detectMaxZoomPanoSize = function() {
  25744. 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)
  25745. }
  25746. ,
  25747. t.exports = n
  25748. }
  25749. , {
  25750. "../constants": 8,
  25751. "../enum/ModelManagerEvents": 33,
  25752. "../enum/PanoSizeClass": 36,
  25753. "../settings": 166,
  25754. "../util/browser": 182,
  25755. "../util/showcase": 193
  25756. }],
  25757. 171: [function(e, t, i) {
  25758. (function(i) {
  25759. "use strict";
  25760. function n(e) {
  25761. this.panos = null,
  25762. this.retryMinimumTime = 1e4,
  25763. this.urls = null,
  25764. this.panoLoadCallbacks = {},
  25765. this.downloadDescriptors = {},
  25766. this.priorityQueue = [],
  25767. this.forceQueue = [],
  25768. this.activeDownloads = [],
  25769. this.qualityManager = null,
  25770. this.tilePrioritizer = null,
  25771. this.refreshInterval = null,
  25772. this.processPriorityQueue = !1,
  25773. this.concurrentDownloads = e.concurrentDownloads || 1,
  25774. this.downloadTestResults = {}
  25775. }
  25776. var r = e("three")
  25777. , o = (e("../enum/Viewmode"),
  25778. e("../settings"))
  25779. , a = (e("../objects/Panorama"),
  25780. e("../util/logger"))
  25781. , s = (e("../enum/Vectors"),
  25782. e("../enum/PanoSizeClass"),
  25783. e("../enum/TileDownloaderEvents"))
  25784. , l = e("./TilePrioritizer")
  25785. , c = e("./TileUtils")
  25786. , h = (e("../enum/GLCubeFaces"),
  25787. e("../enum/DownloadStatus"))
  25788. , u = e("../util/panorama")
  25789. , d = e("../util/ajax")
  25790. , p = e("../ab")
  25791. , f = e("events").EventEmitter
  25792. , g = (new a(i),
  25793. Object.freeze({
  25794. Testing: 1,
  25795. Success: 2,
  25796. Fail: 3
  25797. }));
  25798. n.prototype = Object.create(f.prototype),
  25799. n.IDLE_REFRESH_DELAY = 500,
  25800. n.ACTIVE_REFRESH_DELAY = 16,
  25801. n.DOWNLOAD_RETRIES = 4,
  25802. n.prototype.init = function(e) {
  25803. this.qualityManager = e
  25804. }
  25805. ,
  25806. n.prototype.setUrls = function(e) {
  25807. this.urls = e
  25808. }
  25809. ,
  25810. n.prototype.setPanoData = function(e, t, i) {
  25811. this.panos = e,
  25812. this.imagePanos = t,
  25813. this.panoGroupId = i
  25814. }
  25815. ,
  25816. n.prototype.start = function() {
  25817. this.refreshUpdateInterval(0)
  25818. }
  25819. ,
  25820. n.prototype.stop = function() {
  25821. window.cancel(this.refreshInterval)
  25822. }
  25823. ,
  25824. n.prototype.refreshUpdateInterval = function(e) {
  25825. e || (e = 0),
  25826. this.refreshInterval = window.setTimeout(function() {
  25827. var e = this.update();
  25828. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  25829. }
  25830. .bind(this), e)
  25831. }
  25832. ,
  25833. n.prototype.update = function() {
  25834. var e = this.forceQueue.length > 0;
  25835. return this.processQueueForDownloading(this.forceQueue),
  25836. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  25837. this.priorityQueue.length > 0 && (e = !0),
  25838. this.processQueueForDownloading(this.priorityQueue)),
  25839. e
  25840. }
  25841. ,
  25842. n.prototype.forceQueueTilesForPano = function() {
  25843. var e = []
  25844. , t = [];
  25845. return function(i, n, r, o, a, s) {
  25846. e.length = 0;
  25847. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  25848. var p = u[d];
  25849. p.status !== h.None && p.status !== h.Queued || e.push(p)
  25850. }
  25851. if (r && e.length > 0) {
  25852. l.sortPanoTiles(e, i, r),
  25853. t.length = 0,
  25854. c.matchingTilesInDirection(i, n, r, o, a, t);
  25855. for (var f = 0, g = function(e) {
  25856. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  25857. }; f < e.length; ) {
  25858. var m = e[f]
  25859. , v = t.findIndex(g);
  25860. v < 0 ? e.splice(f, 1) : f++
  25861. }
  25862. }
  25863. for (var A = 0; A < e.length; A++)
  25864. this.forceQueue.push(e[A]);
  25865. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  25866. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  25867. s && this.processQueueForDownloading(this.forceQueue, !0)
  25868. }
  25869. }(),
  25870. n.prototype.clearForceQueue = function() {
  25871. this.clearQueue(this.forceQueue)
  25872. }
  25873. ,
  25874. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  25875. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  25876. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  25877. this.clearFromQueue(this.priorityQueue, h.None, !0),
  25878. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  25879. }
  25880. ,
  25881. n.prototype.clearQueue = function(e) {
  25882. this.setStatusForAllDescriptors(e, h.None),
  25883. e.length = 0
  25884. }
  25885. ,
  25886. n.prototype.clearFromQueue = function(e, t, i) {
  25887. for (var n = 0; n < e.length; n++) {
  25888. var r = e[n];
  25889. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  25890. }
  25891. }
  25892. ,
  25893. n.prototype.setStatusForAllDescriptors = function(e, t) {
  25894. for (var i = 0; i < e.length; i++) {
  25895. var n = e[i];
  25896. n && (n.status = t)
  25897. }
  25898. }
  25899. ,
  25900. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  25901. for (var i = 0; i < e.length; i++) {
  25902. var n = e[i];
  25903. n && (n.status !== t ? n.status = t : e[i] = null)
  25904. }
  25905. }
  25906. ,
  25907. n.prototype.getTileDownloadDescriptors = function(e, t) {
  25908. var i = this.getAllTileDownloadDescriptorsForPano(e)
  25909. , n = i[t];
  25910. return n || (n = this.buildDownloadDescriptorArray(t),
  25911. i[t] = n,
  25912. this.initTileDownloadDescriptors(n, e, t)),
  25913. n
  25914. }
  25915. ,
  25916. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  25917. var t = this.downloadDescriptors[e.id];
  25918. return t || (t = {},
  25919. this.downloadDescriptors[e.id] = t),
  25920. t
  25921. }
  25922. ,
  25923. n.prototype.processQueueForDownloading = function(e, t) {
  25924. if (this.cleanupActiveDownloads(),
  25925. this.activeDownloads.length < this.concurrentDownloads || t)
  25926. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  25927. var o = e.shift();
  25928. o && (this.startDownload(o),
  25929. n++)
  25930. }
  25931. }
  25932. ,
  25933. n.prototype.testDownload = function(e, t, i) {
  25934. var n = this.downloadTestResults[e];
  25935. if (n)
  25936. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  25937. this.downloadTestResults[e] = g.Testing;
  25938. var r = this.panos.list[0]
  25939. , o = this.getTileUrl(r.id, e, t, 0)
  25940. , a = function(t) {
  25941. this.downloadTestResults[e] = g.Success,
  25942. i(!0)
  25943. }
  25944. .bind(this)
  25945. , s = function() {
  25946. this.downloadTestResults[e] = g.Fail,
  25947. i(!1)
  25948. }
  25949. .bind(this);
  25950. this.loadImage(o, 0, a, s)
  25951. }
  25952. ,
  25953. n.prototype.startDownload = function(e) {
  25954. e.status = h.Downloading;
  25955. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  25956. this.activeDownloads.push(e),
  25957. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  25958. }
  25959. ,
  25960. n.prototype.downloadFailed = function(e, t) {}
  25961. ,
  25962. n.prototype.downloadComplete = function(e, t) {
  25963. if (e.panoGroupId === this.panoGroupId) {
  25964. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  25965. e.status = h.Downloaded,
  25966. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  25967. var n = {
  25968. panoId: e.pano.id,
  25969. image: t,
  25970. tileSize: e.tileSize,
  25971. panoSize: e.panoSize,
  25972. tileIndex: e.tileIndex,
  25973. faceTileIndex: e.faceTileIndex,
  25974. totalTiles: e.totalTiles,
  25975. face: e.face,
  25976. tileX: e.tileX,
  25977. tileY: e.tileY,
  25978. direction: e.direction
  25979. };
  25980. e.image = t,
  25981. this.emit(s.TileDownloadSuccess, n),
  25982. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  25983. panoId: e.pano.id,
  25984. tileSize: e.tileSize,
  25985. panoSize: e.panoSize
  25986. },
  25987. this.emit(s.PanoDownloadComplete, n),
  25988. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  25989. }
  25990. }
  25991. ,
  25992. n.prototype.cleanupActiveDownloads = function() {
  25993. var e = [];
  25994. return function() {
  25995. e.length = 0;
  25996. for (var t = 0; t < this.activeDownloads.length; t++) {
  25997. var i = this.activeDownloads[t];
  25998. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  25999. }
  26000. this.activeDownloads.length = 0,
  26001. this.activeDownloads.push.apply(this.activeDownloads, e)
  26002. }
  26003. }(),
  26004. n.prototype.isPanoDownloaded = function(e, t) {
  26005. var i = this.getTileDownloadDescriptors(e, t);
  26006. if (i.length <= 0)
  26007. return !1;
  26008. for (var n = 0; n < i.length; n++) {
  26009. var r = i[n];
  26010. if (r.status !== h.Downloaded)
  26011. return !1
  26012. }
  26013. return !0
  26014. }
  26015. ,
  26016. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26017. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26018. this.panoLoadCallbacks[o] = {
  26019. onLoad: i,
  26020. onFail: n,
  26021. onProgress: r
  26022. }
  26023. }
  26024. ,
  26025. n.prototype.getPanoLoadCallbacks = function(e, t) {
  26026. var i = e.id + ":" + t;
  26027. return this.panoLoadCallbacks[i]
  26028. }
  26029. ,
  26030. n.prototype.buildDownloadDescriptorArray = function(e) {
  26031. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26032. var r = this.buildDownloadDescriptor();
  26033. i.push(r)
  26034. }
  26035. return i
  26036. }
  26037. ,
  26038. n.prototype.buildDownloadDescriptor = function() {
  26039. var e = {
  26040. panoGroupId: null,
  26041. pano: null,
  26042. panoSize: -1,
  26043. tileSize: -1,
  26044. tileIndex: -1,
  26045. totalTiles: -1,
  26046. faceTileIndex: -1,
  26047. status: h.None,
  26048. url: null,
  26049. image: null,
  26050. direction: new r.Vector3,
  26051. face: -1,
  26052. cubeFace: -1,
  26053. tileX: -1,
  26054. tileY: -1
  26055. };
  26056. return e
  26057. }
  26058. ,
  26059. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26060. for (var n = 0; n < e.length; n++) {
  26061. var r = e[n];
  26062. this.initTileDownloadDescriptor(r, t, i, n)
  26063. }
  26064. }
  26065. ,
  26066. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26067. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  26068. e.face = c.getFaceForTile(i, n),
  26069. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  26070. e.panoGroupId = this.panoGroupId,
  26071. e.pano = t,
  26072. e.panoSize = i,
  26073. e.tileSize = r,
  26074. e.tileIndex = n,
  26075. e.totalTiles = c.getTileCountForSize(i),
  26076. e.status = h.None,
  26077. e.image = null,
  26078. c.getTileLocation(e.panoSize, e.tileIndex, e),
  26079. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  26080. }
  26081. ,
  26082. n.prototype.getTileUrl = function() {
  26083. var e = {
  26084. 256: "256",
  26085. 512: "512",
  26086. 1024: "1k",
  26087. 2048: "2k",
  26088. 4096: "4k"
  26089. }
  26090. , t = {
  26091. face: -1,
  26092. faceTileIndex: -1,
  26093. tileX: -1,
  26094. tileY: -1
  26095. };
  26096. return function(i, n, r, a) {
  26097. c.getTileLocation(n, a, t);
  26098. var s = Math.floor(n / r)
  26099. , l = s * s
  26100. , h = Math.floor(a / l)
  26101. , u = "";
  26102. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  26103. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  26104. return d = p.changeIfTileGenerating(d)
  26105. }
  26106. }(),
  26107. n.prototype.loadImage = function(e, t, i, n) {
  26108. d.getImage(e, t).then(function(e) {
  26109. i(e)
  26110. }).fail(n)
  26111. }
  26112. ,
  26113. t.exports = n
  26114. }
  26115. ).call(this, "/js/tile/TileDownloader.js")
  26116. }
  26117. , {
  26118. "../ab": 3,
  26119. "../enum/DownloadStatus": 24,
  26120. "../enum/GLCubeFaces": 25,
  26121. "../enum/PanoSizeClass": 36,
  26122. "../enum/TileDownloaderEvents": 45,
  26123. "../enum/Vectors": 50,
  26124. "../enum/Viewmode": 51,
  26125. "../objects/Panorama": 148,
  26126. "../settings": 166,
  26127. "../util/ajax": 181,
  26128. "../util/logger": 189,
  26129. "../util/panorama": 191,
  26130. "./TilePrioritizer": 172,
  26131. "./TileUtils": 174,
  26132. events: 202,
  26133. three: 217
  26134. }],
  26135. 172: [function(e, t, i) {
  26136. (function(i) {
  26137. "use strict";
  26138. function n(e, t, i, o, a) {
  26139. this.qualityManager = e,
  26140. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26141. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26142. this.baseSize = t,
  26143. this.standardSize = i,
  26144. this.highSize = o,
  26145. this.ultraHighSize = a,
  26146. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  26147. }
  26148. var r = e("three")
  26149. , o = (e("../enum/Viewmode"),
  26150. e("../settings"),
  26151. e("../settings"),
  26152. e("../objects/Panorama"))
  26153. , a = e("../util/logger")
  26154. , s = (e("../enum/Vectors"),
  26155. e("../enum/PanoSizeClass"),
  26156. e("../enum/ModelManagerEvents"),
  26157. e("../enum/GLCubeFaces"),
  26158. e("../enum/DownloadStatus"))
  26159. , l = (e("../util/browser"),
  26160. e("./TileUtils"))
  26161. , c = e("../util/math")
  26162. , h = (e("events").EventEmitter,
  26163. new a(i),
  26164. Object.freeze({
  26165. None: 0,
  26166. DirectionalFOV: 1
  26167. }));
  26168. n.PriorityCriteria = function(e, t, i, n, o) {
  26169. this.pano = e,
  26170. this.cameraPosition = (new r.Vector3).copy(t),
  26171. this.cameraDir = (new r.Vector3).copy(i),
  26172. this.panoSpaceDir = (new r.Vector3).copy(n),
  26173. this.upcomingPanos = o,
  26174. this.copy = function(e) {
  26175. this.pano = e.pano,
  26176. this.cameraPosition.copy(e.cameraPosition),
  26177. this.cameraDir.copy(e.cameraDir),
  26178. this.panoSpaceDir.copy(e.panoSpaceDir),
  26179. this.upcomingPanos = o
  26180. }
  26181. ,
  26182. this.zoomingActive = !1
  26183. }
  26184. ,
  26185. n.DIRECTIONAL_FOV = 180,
  26186. n.DIRECTIONAL_FOV_NARROW = 120,
  26187. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26188. n.MAX_SCORED_PANOS_TOADD = 2,
  26189. n.MAX_UPCOMING_PANOS_TOADD = 3,
  26190. n.DIRECTION_SCORE_STRICTNESS = .75,
  26191. n.appendQueue = function(e, t) {
  26192. if (e && t)
  26193. for (var i = 0; i < t.length; i++)
  26194. e.push(t[i])
  26195. }
  26196. ,
  26197. n.prototype.updateCriteria = function(e, t, i, n) {
  26198. this.priorityCriteria.pano = e,
  26199. this.priorityCriteria.cameraPosition.copy(t),
  26200. this.priorityCriteria.cameraDir.copy(i),
  26201. this.priorityCriteria.upcomingPanos = n,
  26202. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26203. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26204. }
  26205. ,
  26206. n.prototype.filterAndPrioritize = function() {
  26207. var e = []
  26208. , t = []
  26209. , i = [];
  26210. return function(r, o, a) {
  26211. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  26212. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  26213. var s = this.baseSize
  26214. , l = this.standardSize
  26215. , c = this.highSize
  26216. , h = this.ultraHighSize;
  26217. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  26218. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  26219. i.length = 0,
  26220. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26221. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26222. n.appendQueue(r, i),
  26223. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  26224. i.length = 0,
  26225. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26226. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26227. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26228. n.appendQueue(r, i),
  26229. i.length = 0,
  26230. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26231. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26232. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26233. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26234. n.appendQueue(r, i),
  26235. this.queueTilesForPanos(r, e, a, s)
  26236. }
  26237. }(),
  26238. n.prototype.canDownloadSize = function(e) {
  26239. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26240. }
  26241. ,
  26242. n.prototype.populateNeighborPanos = function(e, t, i) {
  26243. i = i || [],
  26244. i.length = 0;
  26245. var n = t.getNeighbours(e);
  26246. for (var r in n)
  26247. if (n.hasOwnProperty(r)) {
  26248. var o = t.get(r);
  26249. i.push(o)
  26250. }
  26251. return i
  26252. }
  26253. ,
  26254. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  26255. i = i || [],
  26256. i.length = 0;
  26257. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  26258. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  26259. , c = t.sortByScore(s, l);
  26260. if (c)
  26261. for (var h = 0; h < c.length && h < a; h++) {
  26262. var u = c[h].pano;
  26263. i.push(u)
  26264. }
  26265. return i
  26266. }
  26267. ,
  26268. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26269. for (var o = 0, a = 0; a < t.length; a++) {
  26270. var s = t[a]
  26271. , l = this.queueTilesForPano(e, i, s, n);
  26272. if (o += l > 0 ? 1 : 0,
  26273. r && o >= r)
  26274. break
  26275. }
  26276. return o
  26277. }
  26278. ,
  26279. n.prototype.queueTilesForPano = function() {
  26280. var e = {
  26281. filter: h.None
  26282. };
  26283. return function(t, i, n, r) {
  26284. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  26285. }
  26286. }(),
  26287. n.prototype.queueTilesForPanosInDirection = function() {
  26288. var e = new r.Vector3;
  26289. return function(t, i, n, r, o, a, s, l) {
  26290. for (var h = 0, u = 0; u < n.length; u++) {
  26291. var d = n[u];
  26292. e.copy(d.position),
  26293. e.sub(o),
  26294. e.normalize();
  26295. var p = Math.max(Math.min(a.dot(e), 1), -1)
  26296. , f = c.getFOVDotThreshold(s);
  26297. if (p >= f) {
  26298. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  26299. if (h += g > 0 ? 1 : 0,
  26300. l && h >= l)
  26301. break
  26302. }
  26303. }
  26304. return h
  26305. }
  26306. }(),
  26307. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26308. for (var l = 0, c = 0; c < i.length; c++) {
  26309. var h = i[c]
  26310. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  26311. if (l += u > 0 ? 1 : 0,
  26312. s && l >= s)
  26313. break
  26314. }
  26315. return l
  26316. }
  26317. ,
  26318. n.prototype.queueTilesInDirectionForPano = function() {
  26319. var e = {
  26320. filter: h.DirectionalFOV,
  26321. direction: new r.Vector3,
  26322. fov: 60
  26323. }
  26324. , t = new r.Vector3;
  26325. return function(i, n, r, o, a, s, c) {
  26326. return t.copy(s),
  26327. l.getRelativeDirection(r.quaternion, t),
  26328. e.direction.copy(t),
  26329. e.fov = c,
  26330. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  26331. }
  26332. }(),
  26333. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  26334. var e = [];
  26335. return function(t, i, n, r, o) {
  26336. var a = i.getTileDownloadDescriptors(n, r);
  26337. e.length = 0,
  26338. this.filterTileDownloadDescriptors(n, a, e, o);
  26339. for (var s = 0, l = 0; l < e.length; l++) {
  26340. var c = e[l];
  26341. c && (t.push(c),
  26342. s++)
  26343. }
  26344. return s
  26345. }
  26346. }(),
  26347. n.prototype.filterTileDownloadDescriptors = function() {
  26348. new r.Vector3;
  26349. return function(e, t, i, n) {
  26350. var r, o;
  26351. switch (n.filter) {
  26352. case h.DirectionalFOV:
  26353. for (r = 0; r < t.length; r++)
  26354. o = t[r],
  26355. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26356. break;
  26357. default:
  26358. for (r = 0; r < t.length; r++)
  26359. o = t[r],
  26360. i.push(o)
  26361. }
  26362. for (r = 0; r < i.length; r++)
  26363. o = i[r],
  26364. this.canIncludeDescriptor(o) || (i[r] = null)
  26365. }
  26366. }(),
  26367. n.prototype.canIncludeDescriptor = function(e) {
  26368. return e.status !== s.Downloading && e.status !== s.Downloaded
  26369. }
  26370. ,
  26371. n.prototype.canIncludePano = function(e, t) {
  26372. return !e.isLoaded(t)
  26373. }
  26374. ,
  26375. n.getFOVDotThreshold = function(e) {
  26376. return Math.cos(r.Math.degToRad(e / 2))
  26377. }
  26378. ;
  26379. var u = function() {
  26380. var e = function e(t, i) {
  26381. var n = e._panoSpaceDir
  26382. , r = e._fovThreshold
  26383. , o = e._fovThresholdNarrow
  26384. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  26385. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  26386. return t._dot = a,
  26387. i._dot = s,
  26388. a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o ? 1 : t.panoSize > i.panoSize ? 1 : i.panoSize > t.panoSize ? -1 : -(a - s)
  26389. };
  26390. return e._panoSpaceDir = new r.Vector3,
  26391. e._fovThreshold = -1,
  26392. e._fovThresholdNarrow = -1,
  26393. e
  26394. }();
  26395. n.sortPanoTiles = function(e, t, i) {
  26396. u._panoSpaceDir.copy(i),
  26397. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  26398. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  26399. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  26400. e.sort(u)
  26401. }
  26402. ,
  26403. n.insertSortedPanoTile = function(e, t, i, r) {
  26404. u._panoSpaceDir.copy(r),
  26405. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  26406. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  26407. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  26408. for (var o = -1, a = 0; a < e.length; a++) {
  26409. var s = u(t, e[a]);
  26410. if (s <= 0) {
  26411. o = a;
  26412. break
  26413. }
  26414. }
  26415. if (o === -1)
  26416. e[e.length] = t;
  26417. else {
  26418. for (var h = e.length; h > o; h--)
  26419. e[h] = e[h - 1];
  26420. e[o] = t
  26421. }
  26422. }
  26423. ,
  26424. n.prototype.setZoomingActive = function(e) {
  26425. e !== this.zoomingActive && (this.zoomingActive = e)
  26426. }
  26427. ,
  26428. t.exports = n
  26429. }
  26430. ).call(this, "/js/tile/TilePrioritizer.js")
  26431. }
  26432. , {
  26433. "../enum/DownloadStatus": 24,
  26434. "../enum/GLCubeFaces": 25,
  26435. "../enum/ModelManagerEvents": 33,
  26436. "../enum/PanoSizeClass": 36,
  26437. "../enum/Vectors": 50,
  26438. "../enum/Viewmode": 51,
  26439. "../objects/Panorama": 148,
  26440. "../settings": 166,
  26441. "../util/browser": 182,
  26442. "../util/logger": 189,
  26443. "../util/math": 190,
  26444. "./TileUtils": 174,
  26445. events: 202,
  26446. three: 217
  26447. }],
  26448. 173: [function(e, t, i) {
  26449. "use strict";
  26450. function n(e, t) {
  26451. this.levels = t,
  26452. this.tileSize = e,
  26453. this.root = null,
  26454. this.allNodes = [],
  26455. a(this)
  26456. }
  26457. function r(e, t) {
  26458. this.tree = e,
  26459. this.parent = t,
  26460. this.children = [],
  26461. this.id = ++u
  26462. }
  26463. function o(e, t, i, r, a, s, l, h) {
  26464. if (e) {
  26465. l = l || n.TraversalType.PreOrder;
  26466. var u = r * c + i;
  26467. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  26468. s && s.push(e)),
  26469. e.children && 0 !== e.children.length) {
  26470. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  26471. for (var g = 0; g < c; g++)
  26472. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  26473. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  26474. s && s.push(e))
  26475. }
  26476. }
  26477. }
  26478. function a(e) {
  26479. e.root = s(e, null, 0)
  26480. }
  26481. function s(e, t, i) {
  26482. if (i > e.levels)
  26483. return null;
  26484. var n = new r(e,t);
  26485. e.allNodes.push(n);
  26486. for (var o = 0; o < h; o++)
  26487. n.children[o] = s(e, n, i + 1);
  26488. return n
  26489. }
  26490. function l(e, t, i, n, r) {
  26491. if (!e)
  26492. return null;
  26493. if (0 === i)
  26494. return e;
  26495. if (!e.children || 0 === e.children.length)
  26496. return null;
  26497. var o = Math.pow(c, i)
  26498. , a = o / c
  26499. , s = n % a
  26500. , h = r % a
  26501. , u = Math.floor(r / a)
  26502. , d = Math.floor(n / a)
  26503. , p = u * c + d
  26504. , f = e.children[p];
  26505. return l(f, t + 1, i - 1, s, h)
  26506. }
  26507. var c = (e("three"),
  26508. e("./TileUtils"),
  26509. e("../objects/Panorama"),
  26510. e("../util/panorama"),
  26511. e("events").EventEmitter,
  26512. 2)
  26513. , h = c * c;
  26514. n.TraversalType = Object.freeze({
  26515. PreOrder: 0,
  26516. PostOrder: 1
  26517. });
  26518. var u = 0;
  26519. n.getLevelCountForSize = function(e, t) {
  26520. var i = 0;
  26521. for (t < e && (t = e); ; ) {
  26522. if (t /= c,
  26523. t < e)
  26524. break;
  26525. i++
  26526. }
  26527. return i
  26528. }
  26529. ,
  26530. n.getSizeForLevel = function(e, t) {
  26531. return Math.pow(c, t) * e
  26532. }
  26533. ,
  26534. n.prototype.getSubNode = function(e, t, i) {
  26535. (!t || e < this.tileSize) && (t = 0),
  26536. (!i || e < this.tileSize) && (i = 0),
  26537. e < this.tileSize && (e = this.tileSize);
  26538. var r = n.getLevelCountForSize(this.tileSize, e)
  26539. , o = l(this.root, 0, r, t, i);
  26540. return o
  26541. }
  26542. ,
  26543. n.prototype.breadthFirst = function(e) {
  26544. e = e || {};
  26545. var t = !!e.nullLevelEnd
  26546. , i = e.maxLevel
  26547. , n = e.minLevel
  26548. , r = e.callback
  26549. , o = e.saveVisited
  26550. , a = []
  26551. , s = {}
  26552. , l = 0
  26553. , c = 0;
  26554. for (a.push(this.root),
  26555. a.push(s); a.length > 0 && !(i && l > i); ) {
  26556. var h = a.shift();
  26557. if (h === s)
  26558. (!n || l >= n) && (r && t && r(null),
  26559. o && t && o.push(null)),
  26560. a.length > 0 && a.push(s),
  26561. l++,
  26562. c = 0;
  26563. else {
  26564. if (h.children)
  26565. for (var u = 0; u < h.children.length; u++) {
  26566. var d = h.children[u];
  26567. d && a.push(h.children[u])
  26568. }
  26569. var p = this.getFaceIndexFromNode(h);
  26570. (!n || l >= n) && (r && r(h, l, p),
  26571. o && o.push(h)),
  26572. c++
  26573. }
  26574. }
  26575. }
  26576. ,
  26577. n.prototype.getFaceIndexFromNode = function(e) {
  26578. if (!e)
  26579. return -1;
  26580. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26581. var o = i.parent;
  26582. if (!o)
  26583. break;
  26584. for (var a = -1, s = 0; s < o.children.length; s++)
  26585. o.children[s] === i && (a = s);
  26586. var l = a % c
  26587. , h = Math.floor(a / c);
  26588. n = l * t + n,
  26589. r = h * t + r,
  26590. t *= c,
  26591. i = o
  26592. }
  26593. return r * t + n
  26594. }
  26595. ,
  26596. n.prototype.depthFirst = function(e, t, i) {
  26597. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26598. }
  26599. ,
  26600. t.exports = n
  26601. }
  26602. , {
  26603. "../objects/Panorama": 148,
  26604. "../util/panorama": 191,
  26605. "./TileUtils": 174,
  26606. events: 202,
  26607. three: 217
  26608. }],
  26609. 174: [function(e, t, i) {
  26610. "use strict";
  26611. var n = e("../enum/GLCubeFaces")
  26612. , r = e("../util/MathLight")
  26613. , o = {};
  26614. o.TILE_SIZE = 512,
  26615. o.FACES_PER_PANO = 6,
  26616. o.LocationOnTile = {
  26617. Center: 0,
  26618. UpperLeft: 1,
  26619. UpperRight: 2,
  26620. LowerRight: 3,
  26621. LowerLeft: 4
  26622. },
  26623. o.getTileVector = function() {
  26624. return function(e, t, i, a, s, l, c, h) {
  26625. l = l || o.LocationOnTile.Center;
  26626. var u = e / t
  26627. , d = a / u;
  26628. s = -s + (u - 1);
  26629. var p = s / u
  26630. , f = t / e
  26631. , g = 2 * f
  26632. , m = g / 2
  26633. , v = 2 * d - 1 + m
  26634. , A = 2 * p - 1 + m;
  26635. switch (l) {
  26636. case o.LocationOnTile.UpperLeft:
  26637. v -= m,
  26638. A += m,
  26639. v += c * g;
  26640. break;
  26641. case o.LocationOnTile.UpperRight:
  26642. v += m,
  26643. A += m,
  26644. A -= c * g;
  26645. break;
  26646. case o.LocationOnTile.LowerRight:
  26647. v += m,
  26648. A -= m,
  26649. v -= c * g;
  26650. break;
  26651. case o.LocationOnTile.LowerLeft:
  26652. v -= m,
  26653. A -= m,
  26654. A += c * g;
  26655. break;
  26656. case o.LocationOnTile.Center:
  26657. }
  26658. switch (i) {
  26659. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26660. r.setVector(h, -1, A, -v);
  26661. break;
  26662. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26663. r.setVector(h, 1, A, v);
  26664. break;
  26665. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26666. r.setVector(h, -v, 1, -A);
  26667. break;
  26668. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26669. r.setVector(h, -v, -1, A);
  26670. break;
  26671. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26672. r.setVector(h, -v, A, 1);
  26673. break;
  26674. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26675. r.setVector(h, v, A, -1)
  26676. }
  26677. r.normalize(h)
  26678. }
  26679. }(),
  26680. o.getFaceForTile = function(e, t) {
  26681. var i = o.TILE_SIZE;
  26682. e < o.TILE_SIZE && (i = e);
  26683. var n = Math.floor(e / i)
  26684. , r = n * n;
  26685. return Math.floor(t / r)
  26686. }
  26687. ,
  26688. o.getTileLocation = function(e, t, i) {
  26689. var n = o.TILE_SIZE;
  26690. e < o.TILE_SIZE && (n = e);
  26691. var r = o.getFaceForTile(e, t)
  26692. , a = Math.floor(e / n)
  26693. , s = a * a
  26694. , l = t - r * s;
  26695. i.tileX = l % a,
  26696. i.tileY = Math.floor(l / a),
  26697. i.face = r,
  26698. i.faceTileIndex = l
  26699. }
  26700. ,
  26701. o.getTileCountForSize = function(e) {
  26702. if (e <= o.TILE_SIZE)
  26703. return o.FACES_PER_PANO;
  26704. var t = Math.floor(e / o.TILE_SIZE)
  26705. , i = t * t
  26706. , n = i * o.FACES_PER_PANO;
  26707. return n
  26708. }
  26709. ,
  26710. o.getRelativeDirection = function() {
  26711. var e = new r.Matrix4
  26712. , t = new r.Quaternion;
  26713. return function(i, n) {
  26714. t.copy(i),
  26715. t.inverse(),
  26716. e.makeRotationFromQuaternion(t),
  26717. e.applyToVector3(n),
  26718. r.normalize(n)
  26719. }
  26720. }(),
  26721. o.matchingTilesInDirection = function() {
  26722. var e = new r.Vector3
  26723. , t = new r.Vector3(0,0,-1)
  26724. , i = new r.Quaternion
  26725. , n = function(e, t) {
  26726. e.push({
  26727. face: t.face,
  26728. faceTileIndex: t.faceTileIndex,
  26729. tileX: t.tileX,
  26730. tileY: t.tileY
  26731. })
  26732. }
  26733. , a = function() {
  26734. var e = {
  26735. face: -1,
  26736. faceTileIndex: -1,
  26737. tileX: -1,
  26738. tileY: -1
  26739. };
  26740. return function(t, i, r) {
  26741. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  26742. o.getTileLocation(t, l, e),
  26743. i && !i(e) || (s++,
  26744. r && n(r, e));
  26745. return s
  26746. }
  26747. }();
  26748. return function(n, s, l, c, h, u) {
  26749. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  26750. o.getTileCountForSize(s);
  26751. if (!c && !h)
  26752. return a(s, null, u);
  26753. var p = !!h;
  26754. if (h = h || c,
  26755. h = Math.max(0, Math.min(h, 360)),
  26756. c = Math.max(0, Math.min(c, 360)),
  26757. r.copyVector(l, e),
  26758. o.getRelativeDirection(n.quaternion, e),
  26759. p) {
  26760. i.setFromUnitVectors(e, t);
  26761. var f = function(e) {
  26762. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  26763. };
  26764. return a(s, f, u)
  26765. }
  26766. var g = function(t) {
  26767. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  26768. };
  26769. return a(s, g, u)
  26770. }
  26771. }(),
  26772. o.isTileWithinFrustum = function() {
  26773. var e = new r.Vector3
  26774. , t = 1e-5;
  26775. return function(i, n, a, s, l, c, h, u) {
  26776. for (var d = Math.tan(.5 * u * r.RADIANS_PER_DEGREE), p = -d, f = Math.tan(.5 * h * r.RADIANS_PER_DEGREE), g = -f, m = o.mapFaceToCubemapFace(a), v = 0, A = 0, y = 0, C = 0, I = 0, E = 0, b = o.LocationOnTile.Center; b <= o.LocationOnTile.LowerLeft; b++)
  26777. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  26778. r.applyQuaternionToVector(c, e),
  26779. e.z >= -t)
  26780. I++;
  26781. else {
  26782. var w = -1 / e.z
  26783. , _ = e.x * w
  26784. , T = e.y * w;
  26785. T > d ? v++ : T < p && A++,
  26786. _ > f ? y++ : _ < g && C++,
  26787. E++
  26788. }
  26789. return A !== E && v !== E && y !== E && C !== E
  26790. }
  26791. }(),
  26792. o.isTileWithinFOV = function() {
  26793. var e = new r.Vector3
  26794. , t = new r.Vector3(0,1,0)
  26795. , i = new r.Vector3(1,0,0);
  26796. return function(n, a, s, l, c, h, u) {
  26797. var d = o.mapFaceToCubemapFace(s);
  26798. if (r.cross(h, t, i),
  26799. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  26800. o.isWithinFOV(e, h, u, null))
  26801. return !0;
  26802. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  26803. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  26804. if (o.getTileVector(n, a, d, l, c, v, g, e),
  26805. o.isWithinFOV(e, h, u, null))
  26806. return !0;
  26807. g += p
  26808. }
  26809. return !1
  26810. }
  26811. }(),
  26812. o.isWithinFOV = function() {
  26813. var e = new r.Vector3
  26814. , t = new r.Vector3;
  26815. return function(i, n, o, a) {
  26816. if (r.copyVector(i, t),
  26817. a) {
  26818. r.copyVector(a, e),
  26819. r.normalize(e);
  26820. var s = r.dot(e, i);
  26821. e.x *= s,
  26822. e.y *= s,
  26823. e.z *= s,
  26824. r.subVector(t, e)
  26825. }
  26826. var l = o / 2 * r.RADIANS_PER_DEGREE
  26827. , c = Math.cos(l)
  26828. , h = r.dot(t, n);
  26829. return h >= c
  26830. }
  26831. }(),
  26832. o.mapFaceToCubemapFace = function() {
  26833. var e = {
  26834. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  26835. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  26836. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  26837. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  26838. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  26839. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  26840. };
  26841. return function(t) {
  26842. return e[t]
  26843. }
  26844. }(),
  26845. t.exports = o
  26846. }
  26847. , {
  26848. "../enum/GLCubeFaces": 25,
  26849. "../util/MathLight": 176
  26850. }],
  26851. 175: [function(e, t, i) {
  26852. (function(i) {
  26853. "use strict";
  26854. function n() {
  26855. this.list = [],
  26856. this.index = {},
  26857. Object.defineProperty(this, "length", {
  26858. get: function() {
  26859. return this.list.length
  26860. }
  26861. })
  26862. }
  26863. var r = (e("./common"),
  26864. e("./logger"));
  26865. new r(i);
  26866. n.prototype.forEach = function(e) {
  26867. this.list.forEach(e)
  26868. }
  26869. ,
  26870. n.prototype.add = function(e) {
  26871. this.list.push(e),
  26872. this.index[this.getIndex(e)] = e
  26873. }
  26874. ,
  26875. n.prototype.getIndex = function(e) {
  26876. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  26877. }
  26878. ,
  26879. n.prototype.extend = function(e) {
  26880. for (var t = 0; t < e.length; t++)
  26881. this.add(e[t])
  26882. }
  26883. ,
  26884. n.prototype.get = function(e) {
  26885. return this.index[e]
  26886. }
  26887. ,
  26888. n.prototype.first = function() {
  26889. return this.list[0]
  26890. }
  26891. ,
  26892. n.prototype.last = function() {
  26893. return this.list[this.list.length - 1]
  26894. }
  26895. ,
  26896. n.prototype.reIndex = function() {
  26897. this.index = {};
  26898. var e = this;
  26899. this.forEach(function(t) {
  26900. e.index[e.getIndex(t)] = t
  26901. })
  26902. }
  26903. ,
  26904. n.prototype.filter = function(e) {
  26905. var t = this.list.filter(e);
  26906. return this.reIndex(),
  26907. t
  26908. }
  26909. ,
  26910. n.prototype.reduce = function(e, t) {
  26911. return this.list.reduce(e, t)
  26912. }
  26913. ,
  26914. n.prototype.sort = function(e) {
  26915. return this.list.sort(e)
  26916. }
  26917. ,
  26918. n.prototype.indexOf = function(e) {
  26919. for (var t = 0; t < this.list.length; ++t)
  26920. if (this.list[t] === e)
  26921. return t;
  26922. return -1
  26923. }
  26924. ,
  26925. t.exports = n
  26926. }
  26927. ).call(this, "/js/util/IndexedCollection.js")
  26928. }
  26929. , {
  26930. "./common": 185,
  26931. "./logger": 189
  26932. }],
  26933. 176: [function(e, t, i) {
  26934. "use strict";
  26935. var n = e("../constants")
  26936. , r = {};
  26937. r.RADIANS_PER_DEGREE = Math.PI / 180,
  26938. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  26939. r.Vector3 = function(e, t, i) {
  26940. this.x = e || 0,
  26941. this.y = t || 0,
  26942. this.z = i || 0
  26943. }
  26944. ,
  26945. r.Matrix4 = function() {
  26946. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  26947. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  26948. }
  26949. ,
  26950. r.Matrix4.prototype = {
  26951. identity: function() {
  26952. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  26953. this
  26954. },
  26955. copy: function(e) {
  26956. return this.elements.set(e.elements),
  26957. this
  26958. },
  26959. applyToVector3: function(e) {
  26960. var t = e.x
  26961. , i = e.y
  26962. , n = e.z
  26963. , r = this.elements;
  26964. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  26965. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  26966. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  26967. this
  26968. },
  26969. getInverse: function(e, t) {
  26970. var i = this.elements
  26971. , n = e.elements
  26972. , r = n[0]
  26973. , o = n[1]
  26974. , a = n[2]
  26975. , s = n[3]
  26976. , l = n[4]
  26977. , c = n[5]
  26978. , h = n[6]
  26979. , u = n[7]
  26980. , d = n[8]
  26981. , p = n[9]
  26982. , f = n[10]
  26983. , g = n[11]
  26984. , m = n[12]
  26985. , v = n[13]
  26986. , A = n[14]
  26987. , y = n[15]
  26988. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  26989. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  26990. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  26991. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  26992. , w = r * C + o * I + a * E + s * b;
  26993. if (0 === w) {
  26994. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  26995. if (t)
  26996. throw new Error(_);
  26997. return console.warn(_),
  26998. this.identity()
  26999. }
  27000. var T = 1 / w;
  27001. return i[0] = C * T,
  27002. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  27003. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  27004. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27005. i[4] = I * T,
  27006. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  27007. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  27008. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27009. i[8] = E * T,
  27010. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  27011. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  27012. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27013. i[12] = b * T,
  27014. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  27015. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  27016. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27017. this
  27018. },
  27019. makeRotationFromQuaternion: function(e) {
  27020. var t = this.elements
  27021. , i = e.x
  27022. , n = e.y
  27023. , r = e.z
  27024. , o = e.w
  27025. , a = i + i
  27026. , s = n + n
  27027. , l = r + r
  27028. , c = i * a
  27029. , h = i * s
  27030. , u = i * l
  27031. , d = n * s
  27032. , p = n * l
  27033. , f = r * l
  27034. , g = o * a
  27035. , m = o * s
  27036. , v = o * l;
  27037. return t[0] = 1 - (d + f),
  27038. t[4] = h - v,
  27039. t[8] = u + m,
  27040. t[1] = h + v,
  27041. t[5] = 1 - (c + f),
  27042. t[9] = p - g,
  27043. t[2] = u - m,
  27044. t[6] = p + g,
  27045. t[10] = 1 - (c + d),
  27046. t[3] = 0,
  27047. t[7] = 0,
  27048. t[11] = 0,
  27049. t[12] = 0,
  27050. t[13] = 0,
  27051. t[14] = 0,
  27052. t[15] = 1,
  27053. this
  27054. }
  27055. },
  27056. r.Quaternion = function(e, t, i, n) {
  27057. this._x = e || 0,
  27058. this._y = t || 0,
  27059. this._z = i || 0,
  27060. this._w = void 0 !== n ? n : 1
  27061. }
  27062. ,
  27063. r.Quaternion.prototype = {
  27064. get x() {
  27065. return this._x
  27066. },
  27067. set x(e) {
  27068. this._x = e
  27069. },
  27070. get y() {
  27071. return this._y
  27072. },
  27073. set y(e) {
  27074. this._y = e
  27075. },
  27076. get z() {
  27077. return this._z
  27078. },
  27079. set z(e) {
  27080. this._z = e
  27081. },
  27082. get w() {
  27083. return this._w
  27084. },
  27085. set w(e) {
  27086. this._w = e
  27087. },
  27088. copy: function(e) {
  27089. this._x = e.x,
  27090. this._y = e.y,
  27091. this._z = e.z,
  27092. this._w = e.w
  27093. },
  27094. inverse: function() {
  27095. return this.conjugate().normalize()
  27096. },
  27097. conjugate: function() {
  27098. return this._x *= -1,
  27099. this._y *= -1,
  27100. this._z *= -1,
  27101. this
  27102. },
  27103. length: function() {
  27104. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27105. },
  27106. normalize: function() {
  27107. var e = this.length();
  27108. return 0 === e ? (this._x = 0,
  27109. this._y = 0,
  27110. this._z = 0,
  27111. this._w = 1) : (e = 1 / e,
  27112. this._x = this._x * e,
  27113. this._y = this._y * e,
  27114. this._z = this._z * e,
  27115. this._w = this._w * e),
  27116. this
  27117. },
  27118. setFromAxisAngle: function(e, t) {
  27119. var i = t / 2
  27120. , n = Math.sin(i);
  27121. return this._x = e.x * n,
  27122. this._y = e.y * n,
  27123. this._z = e.z * n,
  27124. this._w = Math.cos(i),
  27125. this
  27126. },
  27127. setFromUnitVectors: function() {
  27128. var e, t, i = 1e-6;
  27129. return function(n, o) {
  27130. return void 0 === e && (e = new r.Vector3),
  27131. t = r.dot(n, o) + 1,
  27132. t < i ? (t = 0,
  27133. Math.abs(n.x) > Math.abs(n.z) ? r.setVector(e, -n.y, n.x, 0) : r.setVector(e, 0, -n.z, n.y)) : r.cross(n, o, e),
  27134. this._x = e.x,
  27135. this._y = e.y,
  27136. this._z = e.z,
  27137. this._w = t,
  27138. this.normalize()
  27139. }
  27140. }(),
  27141. multiply: function(e) {
  27142. return this.multiplyQuaternions(this, e)
  27143. },
  27144. premultiply: function(e) {
  27145. return this.multiplyQuaternions(e, this)
  27146. },
  27147. multiplyQuaternions: function(e, t) {
  27148. var i = e._x
  27149. , n = e._y
  27150. , r = e._z
  27151. , o = e._w
  27152. , a = t._x
  27153. , s = t._y
  27154. , l = t._z
  27155. , c = t._w;
  27156. return this._x = i * c + o * a + n * l - r * s,
  27157. this._y = n * c + o * s + r * a - i * l,
  27158. this._z = r * c + o * l + i * s - n * a,
  27159. this._w = o * c - i * a - n * s - r * l,
  27160. this
  27161. }
  27162. },
  27163. r.convertWorkshopVector = function(e) {
  27164. return new r.Vector3(-e.x,e.y,e.z)
  27165. }
  27166. ,
  27167. r.convertWorkshopQuaternion = function(e) {
  27168. return new r.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new r.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  27169. }
  27170. ;
  27171. r.convertWorkshopOrthoZoom = function(e) {//xzw
  27172. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  27173. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  27174. }
  27175. ,
  27176. r.convertWorkshopPanoramaQuaternion = function(e) {
  27177. return new r.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), 270 * r.RADIANS_PER_DEGREE))
  27178. }
  27179. ,
  27180. r.normalize = function(e) {
  27181. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27182. , i = Math.sqrt(t);
  27183. e.x /= i,
  27184. e.y /= i,
  27185. e.z /= i
  27186. }
  27187. ,
  27188. r.dot = function(e, t) {
  27189. return e.x * t.x + e.y * t.y + e.z * t.z
  27190. }
  27191. ,
  27192. r.cross = function(e, t, i) {
  27193. var n = e.x
  27194. , r = e.y
  27195. , o = e.z;
  27196. i.x = r * t.z - o * t.y,
  27197. i.y = o * t.x - n * t.z,
  27198. i.z = n * t.y - r * t.x
  27199. }
  27200. ,
  27201. r.setVector = function(e, t, i, n) {
  27202. e.x = t,
  27203. e.y = i,
  27204. e.z = n
  27205. }
  27206. ,
  27207. r.copyVector = function(e, t) {
  27208. t.x = e.x,
  27209. t.y = e.y,
  27210. t.z = e.z
  27211. }
  27212. ,
  27213. r.addVector = function(e, t) {
  27214. e.x += t.x,
  27215. e.y += t.y,
  27216. e.z += t.z
  27217. }
  27218. ,
  27219. r.subVector = function(e, t) {
  27220. e.x -= t.x,
  27221. e.y -= t.y,
  27222. e.z -= t.z
  27223. }
  27224. ,
  27225. r.applyQuaternionToVector = function(e, t) {
  27226. var i = t.x
  27227. , n = t.y
  27228. , r = t.z
  27229. , o = e.x
  27230. , a = e.y
  27231. , s = e.z
  27232. , l = e.w
  27233. , c = l * i + a * r - s * n
  27234. , h = l * n + s * i - o * r
  27235. , u = l * r + o * n - a * i
  27236. , d = -o * i - a * n - s * r;
  27237. t.x = c * l + d * -o + h * -s - u * -a,
  27238. t.y = h * l + d * -a + u * -o - c * -s,
  27239. t.z = u * l + d * -s + c * -a - h * -o
  27240. }
  27241. ,
  27242. r.angleBetweenVectors = function(e, t) {
  27243. return Math.acos(r.dot(e, t))
  27244. }
  27245. ,
  27246. t.exports = r
  27247. }
  27248. , {
  27249. "../constants": 8
  27250. }],
  27251. 177: [function(e, t, i) {
  27252. (function(i) {
  27253. "use strict";
  27254. function n(e) {
  27255. this.cache = null,
  27256. this.expires = 0
  27257. }
  27258. function r() {
  27259. this.baseUrl = null,
  27260. this.cache = null,
  27261. this.expires = 0
  27262. }
  27263. function o() {
  27264. this.baseUrl = null,
  27265. this.expires = 0
  27266. }
  27267. function a(e) {
  27268. this.initialLoadingPromise = null,
  27269. this.endpoint = e + "?type=3",
  27270. this.urlContainer = null,
  27271. this.authorizationHeader = h.getAuthorizationHeader(),
  27272. this.containerClasses = [o, r, n]
  27273. }
  27274. var s = e("./ajax")
  27275. , l = e("./logger")
  27276. , c = e("../constants")
  27277. , h = e("./showcase")
  27278. , u = (e("../ab"),
  27279. new l(i));
  27280. n.prototype = {
  27281. version: 1,
  27282. validate: function(e) {
  27283. return "catalog.json"in e && Object.keys(e).length > 0
  27284. },
  27285. update: function(e) {
  27286. return this.cache = e,
  27287. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27288. $.when()
  27289. },
  27290. get: function(e) {
  27291. return this.cache[e]
  27292. }
  27293. },
  27294. r.prototype = {
  27295. version: 2,
  27296. validate: function(e) {
  27297. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  27298. },
  27299. update: function(e) {
  27300. return this.baseUrl = e["base.url"],
  27301. this.cache = e,
  27302. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27303. $.when()
  27304. },
  27305. get: function(e) {
  27306. var t = this.cache[e];
  27307. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27308. }
  27309. },
  27310. o.prototype = {
  27311. version: 3,
  27312. validate: function(e) {
  27313. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27314. },
  27315. update: function(e) {
  27316. return this.baseUrl = e.templates[0],
  27317. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27318. $.when()
  27319. },
  27320. get: function(e) {
  27321. return this.baseUrl.replace("{{filename}}", e)
  27322. }
  27323. },
  27324. a.prototype = {
  27325. init: function() {
  27326. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  27327. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27328. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  27329. this.refresh().done(function() {
  27330. u.debug("Refreshed")
  27331. }).fail(function() {
  27332. u.error("Failed url refresh, urls might go stale soon")
  27333. }))
  27334. }
  27335. .bind(this), c.signedUrlCheckInterval),
  27336. this.initialLoadingPromise = this.refresh(),
  27337. this.initialLoadingPromise)
  27338. },
  27339. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  27340. e = e || {};
  27341. /*var t = void 0 === e.cache || e.cache;
  27342. return s.get( this.endpoint , { //file
  27343. responseType: "json",
  27344. prefetchFrom: t ? "files" : null,
  27345. cache: t,
  27346. auth: this.authorizationHeader
  27347. }).then(function(e) {
  27348. if (this.urlContainer && this.urlContainer.validate(e))
  27349. return this.urlContainer.update(e);
  27350. for (var i = 0; i < this.containerClasses.length; i++) {
  27351. var n = this.containerClasses[i]
  27352. , r = new n;
  27353. if (r.validate(e))
  27354. return u.info("Using urls version " + r.version),
  27355. this.urlContainer = r,
  27356. this.urlContainer.update(e)
  27357. }
  27358. return t ? this.refresh({
  27359. cache: !1
  27360. }) : $.Deferred().reject("missing-urls")
  27361. }
  27362. .bind(this), function(e) {
  27363. return "loading-failed"
  27364. }) */
  27365. return $.Deferred().resolve();
  27366. },
  27367. get: function(e) {
  27368. //return this.urlContainer.get(e)
  27369. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27370. }
  27371. },
  27372. t.exports = a
  27373. }
  27374. ).call(this, "/js/util/ModelUrls.js")
  27375. }
  27376. , {
  27377. "../ab": 3,
  27378. "../constants": 8,
  27379. "./ajax": 181,
  27380. "./logger": 189,
  27381. "./showcase": 193
  27382. }],
  27383. 178: [function(e, t, i) {
  27384. (function(i) {
  27385. "use strict";
  27386. function n() {
  27387. u.call(this),
  27388. this.neighbourMap = {},
  27389. this.map = null
  27390. }
  27391. var r = e("three")
  27392. , o = e("./common")
  27393. , a = e("../settings")
  27394. , s = e("../objects/Panorama")
  27395. , a = e("../settings")
  27396. , l = e("./aStar")
  27397. , c = e("./logger")
  27398. , h = new c(i)
  27399. , u = e("./IndexedCollection")
  27400. , d = e("./transitions");
  27401. o.inherit(n, u),
  27402. n.prototype.getIndex = function(e) {
  27403. return e.id
  27404. }
  27405. ,
  27406. n.prototype.find = function(e, t) {
  27407. var i = o.filterAll(this.list, e);
  27408. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27409. i = o.stableSort(i, e)
  27410. }),
  27411. i[0])
  27412. }
  27413. ,
  27414. n.prototype.sortByScore = function(e, t) {
  27415. var i = o.filterAll(this.list, e);
  27416. return 0 === i.length ? null : i = i.map(function(e) {
  27417. return {
  27418. pano: e,
  27419. score: t.reduce(function(t, i) {
  27420. return t + i(e)
  27421. }, 0)
  27422. }
  27423. }).sort(function(e, t) {
  27424. return t.score - e.score;
  27425. })
  27426. }
  27427. ,
  27428. n.prototype.lowestByScore = function(e, t, i) {
  27429. return this.findRankedByScore(0, e, t, i)
  27430. }
  27431. ,
  27432. n.prototype.findRankedByScore = function(e, t, i, n) {
  27433. n && (n.candidates = null,
  27434. n.pano = null),
  27435. e || (e = 0);
  27436. var r = this.sortByScore(t, i);
  27437. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27438. n.pano = r[e].pano),
  27439. r[e].pano)
  27440. }
  27441. ,
  27442. n.prototype.showPanoScores = function(e) {
  27443. this.list.forEach(function(e) {
  27444. e.removeTextSprite()
  27445. });
  27446. var t = 6344768;
  27447. e.forEach(function(e) {
  27448. e.pano.addTextSprite(e.score.toFixed(2), t),
  27449. t = 16428055
  27450. })
  27451. }
  27452. ,
  27453. n.prototype.isNeighbour = function(e, t) {
  27454. return this.neighbourMap[e.id][t.id]
  27455. }
  27456. ,
  27457. n.prototype.getNeighbours = function(e) {
  27458. return this.neighbourMap[e.id]
  27459. }
  27460. ,
  27461. n.prototype.setNeighbour = function(e, t, i) {
  27462. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27463. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27464. this.neighbourMap[e.id][e.id] = !0,
  27465. this.neighbourMap[t.id][t.id] = !0,
  27466. this.neighbourMap[e.id][t.id] = i,
  27467. this.neighbourMap[t.id][e.id] = i,
  27468. this.neighbourMap[e.id]
  27469. }
  27470. ,
  27471. n.prototype.findClosest = function(e, t) {
  27472. var i = [s.filters.isPanoAligned()];
  27473. return t && i.push(s.filters.inDirection(e, t, .75)),
  27474. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  27475. }
  27476. ,
  27477. n.prototype.dualNeighbors = function(e, t) {
  27478. var i, n = [];
  27479. for (i in this.neighbourMap[e.id])
  27480. this.neighbourMap[t.id][i] && n.push(i);
  27481. return n
  27482. }
  27483. ,
  27484. n.prototype.populate_path_graph = function() {
  27485. var e, t, i, n, o, a, s, l, c = Date.now(), u = {}, d = 0, p = new r.Vector3(0,0,0), f = 0, g = 0;
  27486. for (e = 0; e < this.list.length; e += 1) {
  27487. o = this.list[e],
  27488. s = {},
  27489. l = !1,
  27490. i = o.neighbourPanos || o.findNeighourPanos();
  27491. for (t in i)
  27492. if (i[t]) {
  27493. a = this.index[t],
  27494. p.copy(o.floorPosition),
  27495. p.sub(a.floorPosition);
  27496. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  27497. , v = (Math.abs(p.y) / Math.max(m, .01),
  27498. Math.max(0, Math.abs(p.y) - .2));
  27499. v > 0 ? (f += 1,
  27500. v = Math.pow(4 * v, 2),
  27501. m = Math.pow(m, 2),
  27502. n = Math.sqrt(v * v + m * m)) : (g += 1,
  27503. n = p.length()),
  27504. s[a.id] = n,
  27505. l = !0
  27506. }
  27507. l ? u[o.id] = s : d += 1
  27508. }
  27509. this.map = u,
  27510. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  27511. }
  27512. ,
  27513. n.prototype.aStarSearch = function(e, t) {
  27514. var i = Date.now()
  27515. , n = new l({
  27516. start: e,
  27517. isEnd: function(e) {
  27518. return e === t
  27519. },
  27520. neighbor: function(e) {
  27521. var t = e.neighbourPanos || e.findNeighourPanos()
  27522. , i = [];
  27523. for (var n in t)
  27524. i.push(this.index[n]);
  27525. return i
  27526. }
  27527. .bind(this),
  27528. distance: function(e, t) {
  27529. var i = this.map[e.id]
  27530. , n = i[t.id];
  27531. return n
  27532. }
  27533. .bind(this),
  27534. heuristic: function(e, t) {
  27535. return 1
  27536. }
  27537. .bind(this),
  27538. hash: function(e) {
  27539. return e.id
  27540. },
  27541. timeout: 5e3
  27542. });
  27543. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  27544. "success" !== n.status)
  27545. return h.debug("Did not find A* path from " + e + " to " + t),
  27546. null;
  27547. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27548. var r = [];
  27549. return n.path.forEach(function(e) {
  27550. r.push(e.id)
  27551. }),
  27552. r
  27553. }
  27554. ,
  27555. n.prototype.includeNodesNearPath = function() {
  27556. var e = new r.Vector3
  27557. , t = new r.Vector3
  27558. , i = new r.Vector3
  27559. , n = new r.Vector3
  27560. , o = new r.Vector3
  27561. , a = new r.Vector3
  27562. , s = new r.Vector3
  27563. , l = new r.Vector3
  27564. , c = []
  27565. , h = new r.Vector3
  27566. , u = new r.Vector3;
  27567. return function(r, d) {
  27568. if (r)
  27569. for (var p = function(e, t, i) {
  27570. return o.copy(t).sub(e),
  27571. o.dot(i)
  27572. }, f = function(e, t) {
  27573. return p(h, e.position, i) - p(h, t.position, i)
  27574. }, g = 0; g < r.length - 1; ) {
  27575. var m = r[g]
  27576. , v = r[g + 1]
  27577. , A = this.index[m]
  27578. , y = this.index[v];
  27579. h.copy(A.position),
  27580. u.copy(y.position),
  27581. c.length = 0,
  27582. e.copy(u).sub(h),
  27583. i.copy(e).normalize();
  27584. for (var C = 0; C < this.list.length; C++) {
  27585. var I = this.list[C];
  27586. o.copy(I.position).sub(h);
  27587. var E = o.dot(i);
  27588. if (E > 0) {
  27589. s.copy(i),
  27590. s.multiplyScalar(E),
  27591. a.copy(o),
  27592. a.sub(s);
  27593. var b = a.length();
  27594. if (b < d) {
  27595. t.copy(e).negate(),
  27596. n.copy(t).normalize(),
  27597. l.copy(I.position).sub(u);
  27598. var w = l.dot(n);
  27599. w > 0 && c.push(I)
  27600. }
  27601. }
  27602. }
  27603. if (c.length > 0) {
  27604. c.sort(f);
  27605. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  27606. r[_] = r[_ - c.length];
  27607. for (var T = 0; T < c.length; T++)
  27608. r[T + g + 1] = c[T].id
  27609. }
  27610. g += c.length + 1
  27611. }
  27612. }
  27613. }(),
  27614. n.prototype.fadeMarkerOpacity = function(e, t) {
  27615. var i = void 0 === e ? a.panorama.markerOpacity : e
  27616. , n = this.list.findIndex(function(e) {
  27617. return e.marker
  27618. });
  27619. if (!(n < 0)) {
  27620. var r = this.list[n].marker.material.opacity;
  27621. if (r !== e) {
  27622. var o = i - r;
  27623. d.trigger({
  27624. func: function(e, t) {
  27625. var i = r + e * o;
  27626. this.forEach(function(e) {
  27627. e.marker && (e.marker.material.opacity = i)
  27628. })
  27629. }
  27630. .bind(this),
  27631. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27632. name: "_fpm"
  27633. })
  27634. }
  27635. }
  27636. }
  27637. ,
  27638. t.exports = n
  27639. }
  27640. ).call(this, "/js/util/PanoramaCollection.js")
  27641. }
  27642. , {
  27643. "../objects/Panorama": 148,
  27644. "../settings": 166,
  27645. "./IndexedCollection": 175,
  27646. "./aStar": 180,
  27647. "./common": 185,
  27648. "./logger": 189,
  27649. "./transitions": 195,
  27650. three: 217
  27651. }],
  27652. 179: [function(e, t, i) {
  27653. "use strict";
  27654. function n() {
  27655. this.actionSequence = [],
  27656. this.actionSequenceInProgress = !1
  27657. }
  27658. function r(e, t, i, n) {
  27659. s.trackAlways("zoom_" + e, {
  27660. from: t,
  27661. to: i,
  27662. pano: n
  27663. })
  27664. }
  27665. function o(e, t) {
  27666. r("initial", 1, e, t)
  27667. }
  27668. function a(e, t, i) {
  27669. r("followup", e, t, i)
  27670. }
  27671. var s = e("../analytics");
  27672. n.prototype.reset = function(e) {
  27673. this.actionSequenceInProgress = !1,
  27674. this.actionSequence.length = 0
  27675. }
  27676. ,
  27677. n.prototype.addZoomAction = function() {
  27678. var e = null
  27679. , t = null
  27680. , i = !1
  27681. , n = function() {
  27682. if (e = null,
  27683. this.actionSequence.length > 0) {
  27684. var i = this.actionSequence[0].start
  27685. , n = this.actionSequence[this.actionSequence.length - 1].end;
  27686. 1 === i ? o(n, t) : a(i, n, t)
  27687. }
  27688. this.reset()
  27689. };
  27690. return function(r, o, a) {
  27691. if (r !== o) {
  27692. i || (n = n.bind(this),
  27693. i = !0),
  27694. e && (window.clearTimeout(e),
  27695. e = null),
  27696. a === t && this.actionSequenceInProgress || (this.reset(),
  27697. t = a),
  27698. this.actionSequenceInProgress = !0;
  27699. var s = {
  27700. start: r,
  27701. end: o
  27702. };
  27703. this.actionSequence.push(s),
  27704. e = window.setTimeout(n, 150)
  27705. }
  27706. }
  27707. }(),
  27708. t.exports = n
  27709. }
  27710. , {
  27711. "../analytics": 4
  27712. }],
  27713. 180: [function(e, t, i) {
  27714. "use strict";
  27715. function n(e) {
  27716. void 0 === e.timeout && (e.timeout = 1 / 0);
  27717. var t = e.hash || o
  27718. , i = {
  27719. data: e.start,
  27720. g: 0,
  27721. h: e.heuristic(e.start)
  27722. }
  27723. , n = i;
  27724. i.f = i.h;
  27725. var h = new s
  27726. , u = new l(a)
  27727. , d = c();
  27728. u.push(i),
  27729. d.set(t(i.data), i);
  27730. for (var p = new Date; u.size(); ) {
  27731. if (new Date - p > e.timeout)
  27732. return {
  27733. status: "timeout",
  27734. cost: n.g,
  27735. path: r(n)
  27736. };
  27737. var f = u.pop();
  27738. if (d.delete(t(f.data)),
  27739. e.isEnd(f.data))
  27740. return {
  27741. status: "success",
  27742. cost: f.g,
  27743. path: r(f)
  27744. };
  27745. h.add(t(f.data));
  27746. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  27747. var v = g[m];
  27748. if (!h.contains(t(v))) {
  27749. var A = f.g + e.distance(f.data, v)
  27750. , y = d.get(t(v))
  27751. , C = !1;
  27752. if (void 0 === y)
  27753. y = {
  27754. data: v
  27755. },
  27756. d.set(t(v), y);
  27757. else {
  27758. if (y.g < A)
  27759. continue;
  27760. C = !0
  27761. }
  27762. y.parent = f,
  27763. y.g = A,
  27764. y.h = e.heuristic(v),
  27765. y.f = A + y.h,
  27766. y.h < n.h && (n = y),
  27767. C ? u.heapify() : u.push(y)
  27768. }
  27769. }
  27770. }
  27771. return {
  27772. status: "noPath",
  27773. cost: n.g,
  27774. path: r(n)
  27775. }
  27776. }
  27777. function r(e) {
  27778. if (void 0 !== e.parent) {
  27779. var t = r(e.parent);
  27780. return t.push(e.data),
  27781. t
  27782. }
  27783. return [e.data]
  27784. }
  27785. function o(e) {
  27786. return e.toString()
  27787. }
  27788. function a(e, t) {
  27789. return e.f - t.f
  27790. }
  27791. var s = e("Set")
  27792. , l = e("heap")
  27793. , c = e("dict");
  27794. t.exports = n
  27795. }
  27796. , {
  27797. Set: 196,
  27798. dict: 210,
  27799. heap: 211
  27800. }],
  27801. 181: [function(e, t, i) {
  27802. (function(i) {
  27803. "use strict";
  27804. function n(e, t, i) {
  27805. var n = new XMLHttpRequest;
  27806. if (i && "withCredentials"in n)
  27807. n.open(e, t, i);
  27808. else if ("undefined" != typeof XDomainRequest)
  27809. n = new XDomainRequest,
  27810. n.open(e, t);
  27811. else {
  27812. if (i)
  27813. throw "Browser does not support CORS!";
  27814. n.open(e, t)
  27815. }
  27816. return n
  27817. }
  27818. function r(e, t, i) {
  27819. function o() {
  27820. u.warn("Retrying ", t),
  27821. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  27822. }
  27823. function a(e, t) {
  27824. var i = e.response;
  27825. if ("json" === t && "object" != typeof i)
  27826. try {
  27827. i = JSON.parse(e.responseText)
  27828. } catch (e) {
  27829. return void c.reject({
  27830. error: "Failed parsing JSON"
  27831. })
  27832. }
  27833. else if ("image/jpeg" === t) {
  27834. var n = new Uint8Array(e.response)
  27835. , r = new Blob([n],{
  27836. type: "image/jpeg"
  27837. })
  27838. , o = URL.createObjectURL(r);
  27839. i = new Image,
  27840. i.src = o,
  27841. i.crossOrigin = "Anonymous",
  27842. i.onload = function() {
  27843. URL.revokeObjectURL(o)
  27844. }
  27845. }
  27846. return i
  27847. }
  27848. var s = n(e, t, !1);
  27849. if (i = i || {},
  27850. i.retries = void 0 !== i.retries ? i.retries : 0,
  27851. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27852. i.responseType)
  27853. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  27854. s.responseType = i.responseType;
  27855. else {
  27856. if ("image/jpeg" !== i.responseType)
  27857. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27858. s.responseType = "arraybuffer"
  27859. }
  27860. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  27861. i.auth && s.setRequestHeader("Authorization", i.auth),
  27862. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27863. s.setRequestHeader("Content-Type", "application/json")),
  27864. "object" == typeof i.headers)
  27865. for (var l in i.headers)
  27866. s.setRequestHeader(l, i.headers[l]);
  27867. var c = $.Deferred();
  27868. return s.onreadystatechange = function(e) {
  27869. if (4 === this.readyState)
  27870. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  27871. i.retries++,
  27872. setTimeout(o, 1e3);
  27873. else if (200 === this.status) {
  27874. var t = a(this, i.responseType);
  27875. c.resolve(t)
  27876. } else
  27877. c.reject(this)
  27878. }
  27879. ,
  27880. s.onprogress = function(e) {
  27881. c.notify(e)
  27882. }
  27883. ,
  27884. s.send(i.data),
  27885. c.promise()
  27886. }
  27887. function o(e) {
  27888. return Object.keys(e).sort().map(function(t) {
  27889. return {
  27890. key: t,
  27891. value: e[t]
  27892. }
  27893. })
  27894. }
  27895. function a(e, t) {
  27896. var i = t.responseType || null
  27897. , n = t.auth || null
  27898. , r = t.prefetchFrom || null
  27899. , a = e + "__" + i + "__" + n + "__" + r;
  27900. return t.headers && o(t.headers).forEach(function(e) {
  27901. a += "__" + e.key + ":" + e.value
  27902. }),
  27903. a
  27904. }
  27905. function s(e, t) {
  27906. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  27907. }
  27908. function l(e, t, i) {
  27909. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  27910. }
  27911. var c = e("./logger")
  27912. , h = e("../ab")
  27913. , u = new c(i);
  27914. window.URL = window.URL || window.webkitURL,
  27915. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  27916. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  27917. /* setTimeout(function() {//MP-- xzw delete
  27918. window.MP_REQUEST_CACHE = null,
  27919. window.MP_PREFETCHED_MODELDATA = {}
  27920. }, 6e4),
  27921. window.onpageshow = function(e) {
  27922. e.persisted && (window.MP_REQUEST_CACHE = null,
  27923. window.MP_PREFETCHED_MODELDATA = {})
  27924. } */
  27925. ,
  27926. t.exports = {
  27927. get: function(e, t) {
  27928. t = t || {};
  27929. var i = void 0 === t.cache || t.cache;
  27930. if (i) {
  27931. var n = s(e, t);
  27932. if (n)
  27933. return n
  27934. }
  27935. var o;
  27936. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  27937. i && l(e, t, o),
  27938. o
  27939. },
  27940. post: function(e, t) {
  27941. return r("POST", e, t)
  27942. },
  27943. patch: function(e, t) {
  27944. return r("PATCH", e, t)
  27945. },
  27946. getImage: function(e, t) {
  27947. function i() {
  27948. u.warn("Retrying ", e),
  27949. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  27950. }
  27951. var n = $.Deferred()
  27952. , r = new Image
  27953. , o = this;
  27954. return e = h.changeIfImageOptimzing(e),
  27955. null !== t && void 0 !== t || (t = 3),
  27956. r.onerror = function() {
  27957. t > 0 ? setTimeout(i, 1e3) : n.reject()
  27958. }
  27959. ,
  27960. r.onload = function() {
  27961. n.resolve(r)
  27962. }
  27963. ,
  27964. r.crossOrigin = "anonymous",
  27965. r.src = e,
  27966. n
  27967. }
  27968. }
  27969. }
  27970. ).call(this, "/js/util/ajax.js")
  27971. }
  27972. , {
  27973. "../ab": 3,
  27974. "./logger": 189
  27975. }],
  27976. 182: [function(e, t, i) {
  27977. "use strict";
  27978. function n(e, t) {
  27979. var i = window.navigator.userAgent
  27980. , n = i.match(e);
  27981. return n = n ? n[1].split(t) : [],
  27982. {
  27983. major: parseInt(n[0]) || 0,
  27984. minor: parseInt(n[1]) || 0,
  27985. patch: parseInt(n[2]) || 0
  27986. }
  27987. }
  27988. var r = e("../exception/DeviceMismatchException");
  27989. t.exports = {
  27990. isFullscreen: function() {
  27991. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  27992. },
  27993. supportsFullscreen: function() {
  27994. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  27995. },
  27996. isPointerLocked: function() {
  27997. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  27998. },
  27999. requestFullscreen: function(e, t) {
  28000. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28001. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28002. },
  28003. requestPointerLock: function() {
  28004. var e;
  28005. if (document.fullscreenElement)
  28006. e = document.fullscreenElement();
  28007. else if (document.mozFullscreenElement)
  28008. e = document.mozFullscreenElement();
  28009. else if (document.mozFullScreenElement)
  28010. e = document.mozFullScreenElement();
  28011. else {
  28012. if (!document.webkitFullscreenElement)
  28013. return;
  28014. e = document.webkitFullscreenElement()
  28015. }
  28016. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28017. e.requestPointerLock(),
  28018. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28019. },
  28020. exitPointerLock: function() {
  28021. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28022. document.exitPointerLock()
  28023. },
  28024. exitFullscreen: function() {
  28025. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28026. },
  28027. details: function() {
  28028. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28029. return e ? {
  28030. name: e[1],
  28031. version: parseInt(e[2]),
  28032. platform: navigator.platform
  28033. } : {}
  28034. },
  28035. is: function(e) {
  28036. return this.details() && this.details().name === e
  28037. },
  28038. inIframe: function() {
  28039. return window.parent !== window
  28040. },
  28041. aspectRatio: function() {
  28042. var e = $("#player").width() / $("#player").height();
  28043. return isFinite(e) ? e : 0
  28044. },
  28045. userAgent: function() {
  28046. return window.navigator.userAgent
  28047. },
  28048. isMobile: function() {
  28049. var e = navigator.userAgent || navigator.vendor || window.opera;
  28050. 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))
  28051. },
  28052. isLandscape: function() {
  28053. return this.isMobile && this.aspectRatio() > 1
  28054. },
  28055. isSmallScreen: function() {
  28056. var e = screen.width / window.devicePixelRatio;
  28057. return e < 240
  28058. },
  28059. detectIE: function() {
  28060. var e = window.navigator.userAgent
  28061. , t = e.indexOf("MSIE ");
  28062. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28063. },
  28064. detectSafari: function() {
  28065. var e = window.navigator.userAgent
  28066. , t = e.indexOf("Safari");
  28067. return t !== -1 && !this.detectChrome()
  28068. },
  28069. detectFirefox: function() {
  28070. var e = window.navigator.userAgent;
  28071. return e.indexOf("Firefox") !== -1
  28072. },
  28073. detectChrome: function() {
  28074. var e = window.navigator.userAgent;
  28075. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  28076. },
  28077. detectOpera: function() {
  28078. var e = window.navigator.userAgent;
  28079. return e.indexOf("OPR") !== -1
  28080. },
  28081. detectIOS: function() {
  28082. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28083. },
  28084. detectIPad: function() {
  28085. var e = window.navigator.userAgent
  28086. , t = /iPad/;
  28087. return t.test(e)
  28088. },
  28089. detectIPod: function() {
  28090. var e = window.navigator.userAgent
  28091. , t = /iPod/;
  28092. return t.test(e)
  28093. },
  28094. detectIPhone: function() {
  28095. var e = window.navigator.userAgent
  28096. , t = /iPhone/;
  28097. return t.test(e)
  28098. },
  28099. detectAndroid: function() {
  28100. var e = window.navigator.userAgent;
  28101. return e.indexOf("Android") !== -1
  28102. },
  28103. detectAndroidMobile: function() {
  28104. var e = window.navigator.userAgent;
  28105. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  28106. },
  28107. detectSamsungNative: function() {
  28108. var e = window.navigator.userAgent;
  28109. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  28110. },
  28111. detectSamsungS6: function() {
  28112. var e = window.navigator.userAgent;
  28113. return e.indexOf("SM-G92") !== -1
  28114. },
  28115. detectWebVR: function() {
  28116. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28117. },
  28118. getVRDisplay: function() {
  28119. var e = $.Deferred();
  28120. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  28121. t.length >= 1 && e.resolve(t[0]),
  28122. e.reject(null)
  28123. }),
  28124. e) : e.reject(null)
  28125. },
  28126. iosVersion: function() {
  28127. if (!this.detectIOS())
  28128. throw new r("Did not detect an iDevice");
  28129. var e = /((?:\d+\_?){1,3}) like Mac OS/
  28130. , t = "_";
  28131. return n(e, t)
  28132. },
  28133. androidVersion: function() {
  28134. if (!this.detectAndroid())
  28135. throw new r("Did not detect an Android based device");
  28136. var e = /Android ((?:\d+\.?){1,3})/
  28137. , t = ".";
  28138. return n(e, t)
  28139. },
  28140. valueFromCookie: function(e, t) {
  28141. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28142. if (!i)
  28143. return t;
  28144. var n = i[1];
  28145. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28146. },
  28147. valueFromHash: function(e, t) {
  28148. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  28149. , n = i.exec(window.location.href);
  28150. if (!n)
  28151. return t;
  28152. var r = n[1];
  28153. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  28154. }
  28155. }
  28156. }
  28157. , {
  28158. "../exception/DeviceMismatchException": 56
  28159. }],
  28160. 183: [function(e, t, i) {
  28161. (function(i) {
  28162. "use strict";
  28163. function n(e, t) {
  28164. var i = r(t);
  28165. if (Object.keys(i).length > 0)
  28166. return i;
  28167. if (e.heroImage)
  28168. i = o(e, t);
  28169. else if (e.data.camera_start) {
  28170. var n = e.data.camera_start;
  28171. try {
  28172. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  28173. i.position = n.camera.position,
  28174. //i.quaternion = n.camera.quaternion,
  28175. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  28176. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  28177. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28178. d.debug("Using camera_start"),
  28179. d.debug("Modeldata pano: ", i.pano.quaternion),
  28180. d.debug("Camera start pano: ", n.pano.quaternion)),
  28181. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  28182. } catch (e) {
  28183. d.warn(e.message)
  28184. }
  28185. }
  28186. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  28187. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  28188. i.pano = t.findClosest(i.position),
  28189. i.quaternion = i.pano.quaternion),
  28190. 0 === Object.keys(i).length) {
  28191. var a = t.list[0];
  28192. a && (i.mode = h.PANORAMA,
  28193. i.pano = a,
  28194. i.position = a.position,
  28195. i.quaternion = a.quaternion,
  28196. d.info("Starting at 1st pano " + a.id))
  28197. }
  28198. return i.mode = i.mode || h.DOLLHOUSE,
  28199. i
  28200. }
  28201. function r(e) {
  28202. var t = c.valueFromHash("start", "")
  28203. , i = {};
  28204. if ("" !== t) {
  28205. d.debug("Start override found in parameters, trying to parse..."),
  28206. i = a(t) || {};
  28207. var n = c.valueFromHash("tag", null);
  28208. n && (i.tag = n),
  28209. i.panoId && (i.pano = e.get(i.panoId))
  28210. }
  28211. return i
  28212. }
  28213. function o(e, t) {
  28214. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28215. return {};
  28216. var i = {}
  28217. , n = e.heroImage.metadata;
  28218. d.debug("Using start position from thumbnail image"),
  28219. i.position = n.camera_position,
  28220. i.quaternion = n.camera_quaternion;
  28221. try {
  28222. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  28223. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28224. } catch (e) {
  28225. d.debug(e.message)
  28226. }
  28227. return i
  28228. }
  28229. function a(e) {
  28230. return s.deserialize(e)
  28231. }
  28232. var s = e("../controls/serializer")
  28233. , l = e("../util/math")
  28234. , c = e("./browser")
  28235. , h = e("../enum/Viewmode")
  28236. , u = e("../util/logger")
  28237. , th = e("three")//xzw
  28238. , d = new u(i);
  28239. t.exports = {
  28240. getStartCameraOptions: n
  28241. }
  28242. }
  28243. ).call(this, "/js/util/camera.js")
  28244. }
  28245. , {
  28246. "../controls/serializer": 14,
  28247. "../enum/Viewmode": 51,
  28248. "../util/logger": 189,
  28249. "../util/math": 190,
  28250. "./browser": 182,
  28251. "three": 217
  28252. }],
  28253. 184: [function(e, t, i) {
  28254. "use strict";
  28255. function n(e, t, i) {
  28256. return o(e.fov, t, i)
  28257. }
  28258. var r = e("./MathLight")
  28259. , o = function(e, t, i) {
  28260. var n = t
  28261. , o = i
  28262. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  28263. return a
  28264. }
  28265. , a = function(e, t, i) {
  28266. var n = t
  28267. , o = i
  28268. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  28269. return a
  28270. }
  28271. , s = function(e, t, i, n) {
  28272. var r = o(e, i, n);
  28273. return r > t ? a(t, i, n) : e
  28274. };
  28275. t.exports = {
  28276. clampVFOV: s,
  28277. getHFOVForCamera: n,
  28278. getHFOVFromVFOV: o,
  28279. getVFOVFromHFOV: a
  28280. }
  28281. }
  28282. , {
  28283. "./MathLight": 176
  28284. }],
  28285. 185: [function(e, t, i) {
  28286. "use strict";
  28287. var n = e("three");
  28288. t.exports = {
  28289. delayOneFrame: function(e) {
  28290. window.setTimeout(e, 1)
  28291. },
  28292. normalizeUrl: function(e) {
  28293. return e.replace("https://", "http://")
  28294. },
  28295. domainFromUrl: function(e) {
  28296. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28297. return t ? t[3] : e
  28298. },
  28299. average: function(e, t) {
  28300. if (0 === e.length)
  28301. return null;
  28302. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28303. var o = t ? e[r][t] : e[r];
  28304. i += o,
  28305. n++
  28306. }
  28307. return i / n
  28308. },
  28309. countUnique: function(e) {
  28310. for (var t = {}, i = 0; i < e.length; i++)
  28311. t[e[i]] = 1 + (t[e[i]] || 0);
  28312. return Object.keys(t).length
  28313. },
  28314. averageVectors: function(e, t) {
  28315. var i = new n.Vector3;
  28316. if (0 === e.length)
  28317. return i;
  28318. for (var r = 0, o = 0; o < e.length; o++) {
  28319. var a = t ? e[o][t] : e[o];
  28320. i.add(a),
  28321. r++
  28322. }
  28323. return i.divideScalar(r)
  28324. },
  28325. equalLists: function(e, t) {
  28326. if (e.length !== t.length)
  28327. return !1;
  28328. for (var i = 0; i < e.length; i++)
  28329. if (e[i] !== t[i])
  28330. return !1;
  28331. return !0
  28332. },
  28333. lowerMedian: function(e, t) {
  28334. if (0 === e.length)
  28335. return null;
  28336. t = t || 2,
  28337. e.sort(function(e, t) {
  28338. return e - t
  28339. });
  28340. var i = Math.floor(e.length / t);
  28341. return e[i]
  28342. },
  28343. stableSort: function(e, t) {
  28344. return e.map(function(e, t) {
  28345. return {
  28346. value: e,
  28347. index: t
  28348. }
  28349. }).sort(function(e, i) {
  28350. var n = t(e.value, i.value);
  28351. return 0 !== n ? n : e.index - i.index
  28352. }).map(function(e) {
  28353. return e.value
  28354. })
  28355. },
  28356. filterAll: function(e, t) {
  28357. return e.filter(function(e) {
  28358. return t.every(function(t) {
  28359. return t(e)
  28360. })
  28361. })
  28362. },
  28363. formatDate: function(e) {
  28364. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28365. },
  28366. formatDatetime: function(e) {
  28367. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28368. },
  28369. randomString: function(e) {
  28370. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28371. t += i.charAt(Math.floor(Math.random() * i.length));
  28372. return t
  28373. },
  28374. uint8ToBase64: function(e, t) {
  28375. t && "number" == typeof t || (t = 8192);
  28376. for (var i = [], n = 0; n < e.length; n += t)
  28377. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28378. return btoa(i.join(""))
  28379. },
  28380. uuid4: function e(t) {
  28381. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28382. },
  28383. nth: function(e) {
  28384. return e %= 10,
  28385. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28386. },
  28387. extendObject: function(e, t) {
  28388. return Object.keys(t).forEach(function(i) {
  28389. e[i] = t[i]
  28390. }),
  28391. e
  28392. },
  28393. deepExtend: function e(t) {
  28394. t = t || {};
  28395. for (var i = 1; i < arguments.length; i++) {
  28396. var n = arguments[i];
  28397. if (n)
  28398. for (var r in n)
  28399. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28400. }
  28401. return t
  28402. },
  28403. inherit: function(e, t) {
  28404. e.prototype = Object.create(t.prototype),
  28405. e.prototype.constructor = e
  28406. },
  28407. extend: function(e, t) {
  28408. for (var i in t.prototype)
  28409. e.prototype[i] = t.prototype[i]
  28410. }
  28411. },
  28412. Math.sign = function(e) {
  28413. return e < 0 ? -1 : 1
  28414. }
  28415. }
  28416. , {
  28417. three: 217
  28418. }],
  28419. 186: [function(e, t, i) {
  28420. "use strict";
  28421. var n = {};
  28422. n.linearTween = function(e, t, i, n) {
  28423. return i * e / n + t
  28424. }
  28425. ,
  28426. n.easeInQuad = function(e, t, i, n) {
  28427. return e /= n,
  28428. i * e * e + t
  28429. }
  28430. ,
  28431. n.easeOutQuad = function(e, t, i, n) {
  28432. return e /= n,
  28433. -i * e * (e - 2) + t
  28434. }
  28435. ,
  28436. n.easeInOutQuad = function(e, t, i, n) {
  28437. return e /= n / 2,
  28438. e < 1 ? i / 2 * e * e + t : (e--,
  28439. -i / 2 * (e * (e - 2) - 1) + t)
  28440. }
  28441. ,
  28442. n.easeInCubic = function(e, t, i, n) {
  28443. return e /= n,
  28444. i * e * e * e + t
  28445. }
  28446. ,
  28447. n.easeOutCubic = function(e, t, i, n) {
  28448. return e /= n,
  28449. e--,
  28450. i * (e * e * e + 1) + t
  28451. }
  28452. ,
  28453. n.easeInOutCubic = function(e, t, i, n) {
  28454. return e /= n / 2,
  28455. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  28456. i / 2 * (e * e * e + 2) + t)
  28457. }
  28458. ,
  28459. n.easeInQuart = function(e, t, i, n) {
  28460. return e /= n,
  28461. i * e * e * e * e + t
  28462. }
  28463. ,
  28464. n.easeOutQuart = function(e, t, i, n) {
  28465. return e /= n,
  28466. e--,
  28467. -i * (e * e * e * e - 1) + t
  28468. }
  28469. ,
  28470. n.easeInOutQuart = function(e, t, i, n) {
  28471. return e /= n / 2,
  28472. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  28473. -i / 2 * (e * e * e * e - 2) + t)
  28474. }
  28475. ,
  28476. n.easeInQuint = function(e, t, i, n) {
  28477. return e /= n,
  28478. i * e * e * e * e * e + t
  28479. }
  28480. ,
  28481. n.easeOutQuint = function(e, t, i, n) {
  28482. return e /= n,
  28483. e--,
  28484. i * (e * e * e * e * e + 1) + t
  28485. }
  28486. ,
  28487. n.easeInOutQuint = function(e, t, i, n) {
  28488. return e /= n / 2,
  28489. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  28490. i / 2 * (e * e * e * e * e + 2) + t)
  28491. }
  28492. ,
  28493. n.easeInSine = function(e, t, i, n) {
  28494. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28495. }
  28496. ,
  28497. n.easeOutSine = function(e, t, i, n) {
  28498. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28499. }
  28500. ,
  28501. n.easeInOutSine = function(e, t, i, n) {
  28502. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28503. }
  28504. ,
  28505. n.easeInExpo = function(e, t, i, n) {
  28506. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28507. }
  28508. ,
  28509. n.easeOutExpo = function(e, t, i, n) {
  28510. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  28511. }
  28512. ,
  28513. n.easeInOutExpo = function(e, t, i, n) {
  28514. return e /= n / 2,
  28515. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28516. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  28517. }
  28518. ,
  28519. n.easeInCirc = function(e, t, i, n) {
  28520. return e /= n,
  28521. -i * (Math.sqrt(1 - e * e) - 1) + t
  28522. }
  28523. ,
  28524. n.easeOutCirc = function(e, t, i, n) {
  28525. return e /= n,
  28526. e--,
  28527. i * Math.sqrt(1 - e * e) + t
  28528. }
  28529. ,
  28530. n.easeInOutCirc = function(e, t, i, n) {
  28531. return e /= n / 2,
  28532. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28533. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28534. }
  28535. ,
  28536. n.easeInElastic = function(e, t, i, n) {
  28537. var r = 1.70158
  28538. , o = 0
  28539. , a = i;
  28540. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  28541. a < Math.abs(i) ? (a = i,
  28542. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28543. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  28544. }
  28545. ,
  28546. n.easeOutElastic = function(e, t, i, n) {
  28547. var r = 1.70158
  28548. , o = 0
  28549. , a = i;
  28550. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  28551. a < Math.abs(i) ? (a = i,
  28552. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28553. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28554. }
  28555. ,
  28556. n.easeInOutElastic = function(e, t, i, n) {
  28557. var r = 1.70158
  28558. , o = 0
  28559. , a = i;
  28560. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  28561. a < Math.abs(i) ? (a = i,
  28562. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28563. e < 1 ? -.5 * (a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  28564. }
  28565. ,
  28566. n.easeInBack = function(e, t, i, n, r) {
  28567. return void 0 === r && (r = 1.70158),
  28568. i * (e /= n) * e * ((r + 1) * e - r) + t
  28569. }
  28570. ,
  28571. n.easeOutBack = function(e, t, i, n, r) {
  28572. return void 0 === r && (r = 1.70158),
  28573. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28574. }
  28575. ,
  28576. n.easeInOutBack = function(e, t, i, n, r) {
  28577. return void 0 === r && (r = 1.70158),
  28578. (e /= n / 2) < 1 ? i / 2 * (e * e * (((r *= 1.525) + 1) * e - r)) + t : i / 2 * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  28579. }
  28580. ,
  28581. n.easeOutBounce = function(e, t, i, n) {
  28582. 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
  28583. }
  28584. ,
  28585. n.easeInBounce = function(e, t, i, r) {
  28586. return i - n.easeOutBounce(r - e, 0, i, r) + t
  28587. }
  28588. ,
  28589. n.easeInOutBounce = function(e, t, i, r) {
  28590. return e < r / 2 ? .5 * n.easeInBounce(2 * e, 0, i, r) + t : .5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + .5 * i + t
  28591. }
  28592. ,
  28593. t.exports = n
  28594. }
  28595. , {}],
  28596. 187: [function(e, t, i) {
  28597. "use strict";
  28598. function n() {
  28599. this.events = [],
  28600. this.valid = !1
  28601. }
  28602. var r = e("../enum/Joystick");
  28603. n.prototype.push = function(e, t) {
  28604. this.events.push({
  28605. direction: e,
  28606. pano: t
  28607. }),
  28608. this.valid = !0
  28609. }
  28610. ,
  28611. n.prototype.pop = function(e) {
  28612. var t = this.events.pop();
  28613. return this.events.length < 1 && (this.valid = !1),
  28614. t
  28615. }
  28616. ,
  28617. n.prototype.peek = function() {
  28618. return this.events.length ? this.events[this.events.length - 1] : {
  28619. direction: null,
  28620. pano: null
  28621. }
  28622. }
  28623. ,
  28624. n.prototype.invalidate = function() {
  28625. this.events = [],
  28626. this.valid = !1
  28627. }
  28628. ,
  28629. n.prototype.reversePano = function(e) {
  28630. if (!this.valid)
  28631. return null;
  28632. var t = this.peek();
  28633. return r.opposite(e) === t.direction ? (this.pop(),
  28634. t.pano) : null
  28635. }
  28636. ,
  28637. t.exports = n
  28638. }
  28639. , {
  28640. "../enum/Joystick": 29
  28641. }],
  28642. 188: [function(e, t, i) {
  28643. "use strict";
  28644. t.exports = {
  28645. vector: function(e, t) {
  28646. var i = e.clone();
  28647. return t = t.clone(),
  28648. function(n) {
  28649. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  28650. }
  28651. },
  28652. quaternion: function(e, t) {
  28653. var i = e.clone();
  28654. return function(n) {
  28655. e.copy(i).slerp(t, n)
  28656. }
  28657. },
  28658. property: function(e, t, i, n) {
  28659. var r = e[t];
  28660. return function(o) {
  28661. e[t] = r * (1 - o) + i * o,
  28662. n && n(e[t])
  28663. }
  28664. },
  28665. uniform: function(e, t, i) {
  28666. var n = e.material.uniforms[t].value;
  28667. return function(r) {
  28668. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  28669. }
  28670. },
  28671. matrix4: function(e, t) {
  28672. var i = e.clone();
  28673. return function(n) {
  28674. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  28675. r[s] = o[s] * (1 - n) + a[s] * n
  28676. }
  28677. },
  28678. allUniforms: function(e, t, i) {
  28679. var n = e.map(function(e) {
  28680. return this.uniform(e, t, i)
  28681. }
  28682. .bind(this));
  28683. return function(e) {
  28684. n.forEach(function(t) {
  28685. t(e)
  28686. })
  28687. }
  28688. }
  28689. }
  28690. }
  28691. , {}],
  28692. 189: [function(e, t, i) {
  28693. "use strict";
  28694. function n(e) {
  28695. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  28696. if (n.consoleEnabled) {
  28697. var h = function(e) {
  28698. $("#debug-console").append("<p>" + e + "</p>"),
  28699. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28700. };
  28701. t = function(e) {
  28702. h(Array.prototype.slice.call(arguments).join(" "))
  28703. }
  28704. ,
  28705. i = function(e) {
  28706. h(Array.prototype.slice.call(arguments).join(" "))
  28707. }
  28708. ,
  28709. o = function(e) {
  28710. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28711. }
  28712. ,
  28713. a = function(e) {
  28714. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28715. }
  28716. } else
  28717. console.log ? (t = console.log,
  28718. i = console.info ? console.info : console.log,
  28719. o = console.warn ? console.warn : console.log,
  28720. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  28721. ;
  28722. var u = function(e) {
  28723. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  28724. }
  28725. , d = function(t, i) {
  28726. if (r) {
  28727. var o = Array.prototype.slice.call(t).join(" ");
  28728. r.captureMessage(o, {
  28729. level: i,
  28730. path: e,
  28731. timestamp: n.timestamp()
  28732. })
  28733. }
  28734. }
  28735. , p = function(t, i) {
  28736. if (r) {
  28737. var o = Array.prototype.slice.call(t).join(" ");
  28738. r.captureException(new Error(o), {
  28739. level: i,
  28740. path: e,
  28741. timestamp: n.timestamp()
  28742. })
  28743. }
  28744. };
  28745. return {
  28746. debug: function() {
  28747. n.level >= n.levels.debug && t.apply(console, u(arguments))
  28748. },
  28749. info: function() {
  28750. n.level >= n.levels.info && i.apply(console, u(arguments))
  28751. },
  28752. warn: function() {
  28753. d(arguments, "warn"),
  28754. n.level >= n.levels.warn && o.apply(console, u(arguments))
  28755. },
  28756. error: function() {
  28757. p(arguments, "error"),
  28758. n.level >= n.levels.error && a.apply(console, u(arguments))
  28759. },
  28760. v3str: function(e, t) {
  28761. var i = void 0 === t ? 2 : t;
  28762. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28763. },
  28764. eulstr: function(e, t) {
  28765. var i = void 0 === t ? 2 : t;
  28766. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28767. },
  28768. time: function(e) {
  28769. n.level >= n.levels.debug && (c[e] = Date.now())
  28770. },
  28771. timeEnd: function(e) {
  28772. if (n.level >= n.levels.debug) {
  28773. var t = c[e];
  28774. if (!t)
  28775. return;
  28776. var i = (Date.now() - t) / 1e3;
  28777. this.debug(e, i + "s")
  28778. }
  28779. }
  28780. }
  28781. }
  28782. var r = window.Raven;
  28783. n.timestamp = function() {
  28784. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28785. }
  28786. ,
  28787. n.levels = {
  28788. debug: 3,
  28789. info: 2,
  28790. warn: 1,
  28791. error: 0
  28792. },
  28793. n.level = n.levels.info,
  28794. t.exports = n
  28795. }
  28796. , {}],
  28797. 190: [function(e, t, i) {
  28798. "use strict";
  28799. var n = e("three")
  28800. , r = e("../enum/GLCubeFaces")
  28801. , o = e("../constants");
  28802. t.exports = {
  28803. convertVisionVector: function(e) {
  28804. return new n.Vector3(e.x,e.z,-e.y)
  28805. },
  28806. convertVisionQuaternion: function(e) {
  28807. return new n.Quaternion(e.x,e.z,-e.y,e.w).multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(90)))
  28808. },
  28809. convertWorkshopVector: function(e) {
  28810. return new n.Vector3(-e.x,e.y,e.z)
  28811. },
  28812. convertWorkshopQuaternion: function(e) {
  28813. return new n.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new n.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  28814. },
  28815. convertWorkshopPanoramaQuaternion: function(e) {
  28816. return new n.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(270)))
  28817. },
  28818. convertWorkshopOrthoZoom: function(e) {// xzw
  28819. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  28820. //return e;
  28821. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  28822. },
  28823. toPrecision: function(e, t) {//xzw change
  28824. var f = function(e, t){
  28825. var i = Math.pow(10, t);
  28826. return Math.round(e * i) / i
  28827. }
  28828. if(e instanceof Array){
  28829. for(var s=0; s<e.length; s++){
  28830. e[s] = f(e[s],t);
  28831. }
  28832. return e;
  28833. }
  28834. else return f(e,t)
  28835. },
  28836. isEmptyQuaternion: function(e) {
  28837. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28838. },
  28839. projectPositionToCanvas: function(e, t, i) {
  28840. i = i || new n.Vector3,
  28841. i.copy(e);
  28842. var r = .5 * $("#player").width()
  28843. , o = .5 * $("#player").height();
  28844. return i.project(t),
  28845. i.x = i.x * r + r,
  28846. i.y = -(i.y * o) + o,
  28847. i
  28848. },
  28849. convertScreenPositionToNDC: function(e, t, i) {
  28850. return i = i || new n.Vector2,
  28851. i.x = e / $("#player").width() * 2 - 1,
  28852. i.y = 2 * -(t / $("#player").height()) + 1,
  28853. i
  28854. },
  28855. constrainedTurn: function(e) {
  28856. var t = e % (2 * Math.PI);
  28857. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28858. },
  28859. getFOVDotThreshold: function(e) {
  28860. return Math.cos(n.Math.degToRad(e / 2))
  28861. },
  28862. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28863. switch (e) {
  28864. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28865. i.set(1, t.y, t.x);
  28866. break;
  28867. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28868. i.set(-1, t.y, -t.x);
  28869. break;
  28870. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28871. i.set(-t.x, 1, -t.y);
  28872. break;
  28873. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28874. i.set(-t.x, -1, t.y);
  28875. break;
  28876. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28877. i.set(-t.x, t.y, 1);
  28878. break;
  28879. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28880. i.set(t.x, t.y, -1)
  28881. }
  28882. n && i.normalize()
  28883. }
  28884. }
  28885. }
  28886. , {
  28887. "../constants": 8,
  28888. "../enum/GLCubeFaces": 25,
  28889. three: 217
  28890. }],
  28891. 191: [function(e, t, i) {
  28892. "use strict";
  28893. function n(e, t, i) {
  28894. return a.map(function(n, o) {
  28895. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  28896. }
  28897. .bind(this))
  28898. }
  28899. function r(e) {
  28900. return s[e]
  28901. }
  28902. var o = e("../enum/GLCubeFaces")
  28903. , a = [0, 1, 2, 3, 4, 5]
  28904. , s = {
  28905. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28906. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28907. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28908. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28909. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28910. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28911. };
  28912. t.exports = {
  28913. mapFaceToCubemapFace: r,
  28914. getCubemapUrls: n
  28915. }
  28916. }
  28917. , {
  28918. "../enum/GLCubeFaces": 25
  28919. }],
  28920. 192: [function(e, t, i) {
  28921. "use strict";
  28922. t.exports = {
  28923. captureErrors: function(e, t, i) {
  28924. if ("Raven"in window) {
  28925. Raven.config(e, t).install(),
  28926. i && Raven.setTagsContext(i);
  28927. var n = console.warn
  28928. , r = console.error;
  28929. console.warn = function() {
  28930. var e = Array.prototype.slice.call(arguments);
  28931. Raven.captureMessage(e.join(" "), {
  28932. level: "warning"
  28933. }),
  28934. n.apply(console, e)
  28935. }
  28936. ,
  28937. console.error = function() {
  28938. var e = Array.prototype.slice.call(arguments);
  28939. Raven.captureException(new Error(e.join(" ")), {
  28940. level: "error"
  28941. }),
  28942. r.apply(console, e)
  28943. }
  28944. } else
  28945. console.error("Raven not found, not capturing errors.")
  28946. }
  28947. }
  28948. }
  28949. , {}],
  28950. 193: [function(e, t, i) {
  28951. (function(i) {
  28952. "use strict";
  28953. var n = e("./browser")
  28954. , r = e("../constants")
  28955. , o = e("url")
  28956. , a = e("./logger")
  28957. , ss = e('three')
  28958. , s = new a(i)
  28959. , l = {
  28960. getAuthorizationHeader: function() {
  28961. var e = n.valueFromHash("auth");
  28962. if (e)
  28963. return e.replace(",", " ");
  28964. var t = n.valueFromCookie("token");
  28965. return t ? "Token " + t : null
  28966. },
  28967. parseSidUrl: function(e) {
  28968. var t, i;
  28969. if (e = e || "",
  28970. e.match(/^https?/)) {
  28971. var n = o.parse(e);
  28972. t = n.protocol + "//" + n.host,
  28973. i = e
  28974. } else //xzw 原先的不能用
  28975. //t = window.location.protocol + "//" + window.location.host, //MP
  28976. t = ""
  28977. //i = t + "/api/player/models/" + e; //MP
  28978. i = t + "data/" + e;
  28979. return {
  28980. urlBase: t,
  28981. urlModel: i,
  28982. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  28983. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  28984. }
  28985. },
  28986. getModelIDFromQueryString: function() {
  28987. return n.valueFromHash("model") || n.valueFromHash("m")
  28988. },
  28989. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  28990. e = JSON.parse(JSON.stringify(e));
  28991. var i = null;
  28992. if (e.images.forEach(function(n) {
  28993. if(!n.metadata) return;
  28994. if ("string" == typeof n.metadata)
  28995. try {
  28996. n.metadata = JSON.parse(n.metadata)
  28997. } catch (e) {
  28998. s.warn("Unable to parse image metadata"),
  28999. n.metadata = null
  29000. }
  29001. else{
  29002. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29003. }
  29004. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29005. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  29006. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  29007. }else{
  29008. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29009. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  29010. }
  29011. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29012. }),
  29013. //icon初始视角的:
  29014. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29015. var n = {};
  29016. n.pano = {
  29017. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29018. position: t.convertWorkshopVector(i.scan_position),
  29019. uuid: i.scan_id
  29020. },
  29021. n.camera = {
  29022. quaternion: i.camera_quaternion,
  29023. position: i.camera_position
  29024. },
  29025. e.startPano = n
  29026. }
  29027. return e
  29028. },
  29029. visionVersionToInt: function() {
  29030. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  29031. return function(t) {
  29032. if (!t)
  29033. throw new Error("Vision version is required");
  29034. var i = e.exec(t);
  29035. if (null === i)
  29036. throw new Error("String is not a vision version: " + t);
  29037. return parseInt(i[1])
  29038. }
  29039. }(),
  29040. modelDataPromisesTiles: function(e) {
  29041. if (e.vision_version)
  29042. try {
  29043. return l.visionVersionToInt(e.vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29044. } catch (t) {
  29045. s.warn("Invalid vision version: " + e.vision_version)
  29046. }
  29047. var t = e.created ? new Date(e.created) : null;
  29048. return t && t >= r.visionTilingStartDate
  29049. }
  29050. };
  29051. t.exports = l
  29052. }
  29053. ).call(this, "/js/util/showcase.js")
  29054. }
  29055. , {
  29056. "../constants": 8,
  29057. "./browser": 182,
  29058. "./logger": 189,
  29059. three:217,
  29060. url: 208
  29061. }],
  29062. 194: [function(e, t, i) {
  29063. "use strict";
  29064. var n = e("../util/ajax")
  29065. , r = e("three")
  29066. , o = e("../settings")
  29067. , a = {};
  29068. t.exports = {
  29069. load: function(e, t, i) {
  29070. var s = a[e];
  29071. return s ? (t && setTimeout(function() {
  29072. t(s)
  29073. }, 1),
  29074. s) : (s = new r.Texture,
  29075. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  29076. s.magFilter = r.LinearFilter,
  29077. s.generateMipmaps = !1),
  29078. s.sourceFile = e,
  29079. a[e] = s,
  29080. n.getImage(e).then(function(e) {
  29081. s.image = e,
  29082. s.needsUpdate = !0,
  29083. t && t(s)
  29084. }).fail(i),
  29085. s)
  29086. },
  29087. loadBase64: function(e, t) {
  29088. t = t || "png";
  29089. var i = new r.Texture;
  29090. return i.image = document.createElement("img"),
  29091. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29092. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  29093. i.magFilter = r.LinearFilter,
  29094. i.generateMipmaps = !1),
  29095. i.needsUpdate = !0,
  29096. i
  29097. },
  29098. isLoaded: function(e) {
  29099. return !!a[e]
  29100. }
  29101. }
  29102. }
  29103. , {
  29104. "../settings": 166,
  29105. "../util/ajax": 181,
  29106. three: 217
  29107. }],
  29108. 195: [function(e, t, i) {
  29109. "use strict";
  29110. var n = e("./easing");
  29111. t.exports = {
  29112. globalDone: null,
  29113. funcs: [],
  29114. counter: 0,
  29115. uniqueID: 0,
  29116. start: function(e, t, i, r, o, a, s) {
  29117. return r = r || 0,
  29118. this.funcs.push({
  29119. func: e,
  29120. current: -r * Math.abs(t),
  29121. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  29122. done: i,
  29123. easing: o || n.linearTween,
  29124. cycling: t < 0,
  29125. running: !0,
  29126. debug: r < 0,
  29127. name: a || "T" + this.counter,
  29128. id: void 0 === s ? this.counter : s,
  29129. paused: !1
  29130. }),
  29131. e(0, 16),
  29132. this.counter += 1,
  29133. e
  29134. },
  29135. trigger: function(e) {
  29136. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29137. , i = e.func || function() {}
  29138. , r = void 0 === e.duration ? 0 : e.duration;
  29139. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  29140. var o = e.done || null
  29141. , a = e.easing || n.linearTween
  29142. , s = e.name || "R" + this.counter
  29143. , l = void 0 === e.id ? this.counter : e.id;
  29144. return this.start(i, r, o, t, a, s, l)
  29145. },
  29146. setTimeout: function(e, t, i) {
  29147. var n = void 0 === i ? this.counter : i;
  29148. return this.trigger({
  29149. done: e,
  29150. duration: void 0 === t ? 0 : t,
  29151. name: "O" + this.counter,
  29152. id: n
  29153. })
  29154. },
  29155. pause: function() {
  29156. this.paused = !0
  29157. },
  29158. resume: function() {
  29159. this.paused = !1
  29160. },
  29161. update: function(e) {
  29162. this.funcs.forEach(function(t) {
  29163. if (!(t.paused || (t.current += 1e3 * e,
  29164. t.current < 0)))
  29165. if (t.current >= t.duration && !t.cycling) {
  29166. var i = t.easing(1, 0, 1, 1);
  29167. t.func(i, 1e3 * e),
  29168. t.done && t.done(),
  29169. t.running = !1
  29170. } else {
  29171. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  29172. , r = t.func(n, 1e3 * e) || !1;
  29173. r && (t.done && t.done(),
  29174. t.running = !1)
  29175. }
  29176. });
  29177. var t = this.funcs.length;
  29178. this.funcs = this.funcs.filter(function(e) {
  29179. return e.running
  29180. });
  29181. var i = this.funcs.length;
  29182. if (t > 0 && 0 === i && this.globalDone) {
  29183. var n = this.globalDone;
  29184. this.globalDone = null,
  29185. n()
  29186. }
  29187. },
  29188. adjustSpeed: function(e, t) {
  29189. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29190. var r = i[n];
  29191. r.duration /= t,
  29192. r.current /= t
  29193. }
  29194. },
  29195. getById: function(e) {
  29196. return this.funcs.filter(function(t) {
  29197. return e === t.id
  29198. })
  29199. },
  29200. get: function(e) {
  29201. for (var t = 0; t < this.funcs.length; t += 1)
  29202. if (this.funcs[t].func === e)
  29203. return this.funcs[t];
  29204. return null
  29205. },
  29206. isRunning: function(e) {
  29207. var t = this.get(e);
  29208. return null !== t && t.running
  29209. },
  29210. countActive: function() {
  29211. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29212. e += this.funcs[t].running;
  29213. return e
  29214. },
  29215. listActive: function() {
  29216. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29217. this.funcs[t].running && e.push(this.funcs[t].name);
  29218. return e
  29219. },
  29220. done: function(e) {
  29221. this.globalDone = e
  29222. },
  29223. cancelById: function(e) {
  29224. var t = void 0 === e ? 0 : e;
  29225. this.funcs = this.funcs.filter(function(e) {
  29226. return e.id !== t
  29227. })
  29228. },
  29229. cancel: function(e) {
  29230. this.funcs = this.funcs.filter(function(t) {
  29231. return t.func !== e
  29232. })
  29233. },
  29234. getUniqueId: function() {
  29235. return this.uniqueID -= 1,
  29236. this.uniqueID
  29237. }
  29238. }
  29239. }
  29240. , {
  29241. "./easing": 186
  29242. }],
  29243. 196: [function(e, t, i) {
  29244. function n(e) {
  29245. if (this.set = {},
  29246. this.infContains = function() {
  29247. return !0
  29248. }
  29249. ,
  29250. "object" == typeof e)
  29251. if (e instanceof Array)
  29252. for (var t = 0; t < e.length; t++)
  29253. this.set[e[t]] = !0;
  29254. else
  29255. this.set = e;
  29256. else if ("function" == typeof e)
  29257. this.infContains = e;
  29258. else if ("undefined" != typeof e)
  29259. throw new Error("set must be either an array or an object.")
  29260. }
  29261. t.exports = n,
  29262. n.prototype.contains = function(e) {
  29263. return !!this.set[e]
  29264. }
  29265. ,
  29266. n.prototype.has = n.prototype.contains,
  29267. n.prototype.add = function(e) {
  29268. if (1 == arguments.length)
  29269. this.set[e] = !0;
  29270. else
  29271. for (var t = 0; t < arguments.length; t++)
  29272. this.set[arguments[t]] = !0
  29273. }
  29274. ,
  29275. n.prototype.addAll = function(e) {
  29276. if ("object" != typeof e && !(e instanceof Array))
  29277. throw new Error("arr must be an array.");
  29278. for (var t = 0; t < e.length; t++)
  29279. this.add(e[t])
  29280. }
  29281. ,
  29282. n.prototype.remove = function(e) {
  29283. if (1 == arguments.length)
  29284. delete this.set[e];
  29285. else
  29286. for (var t = 0; t < arguments.length; t++)
  29287. delete this.set[arguments[t]]
  29288. }
  29289. ,
  29290. n.prototype.delete = n.prototype.remove,
  29291. n.prototype.clear = function() {
  29292. this.set = {}
  29293. }
  29294. ,
  29295. n.prototype.size = function() {
  29296. return Object.keys(this.set).length
  29297. }
  29298. ,
  29299. n.prototype.toString = function() {
  29300. return "{" + Object.keys(this.set).toString() + "}"
  29301. }
  29302. ,
  29303. n.prototype.toArray = function() {
  29304. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  29305. }
  29306. ,
  29307. n.prototype["*values"] = n.prototype.toArray
  29308. }
  29309. , {}],
  29310. 197: [function(e, t, i) {}
  29311. , {}],
  29312. 198: [function(e, t, i) {
  29313. (function(t) {
  29314. "use strict";
  29315. function n() {
  29316. try {
  29317. var e = new Uint8Array(1);
  29318. return e.__proto__ = {
  29319. __proto__: Uint8Array.prototype,
  29320. foo: function() {
  29321. return 42
  29322. }
  29323. },
  29324. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29325. } catch (e) {
  29326. return !1
  29327. }
  29328. }
  29329. function r() {
  29330. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29331. }
  29332. function o(e, t) {
  29333. if (r() < t)
  29334. throw new RangeError("Invalid typed array length");
  29335. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  29336. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  29337. e.length = t),
  29338. e
  29339. }
  29340. function a(e, t, i) {
  29341. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  29342. return new a(e,t,i);
  29343. if ("number" == typeof e) {
  29344. if ("string" == typeof t)
  29345. throw new Error("If encoding is specified then the first argument must be a string");
  29346. return h(this, e)
  29347. }
  29348. return s(this, e, t, i)
  29349. }
  29350. function s(e, t, i, n) {
  29351. if ("number" == typeof t)
  29352. throw new TypeError('"value" argument must not be a number');
  29353. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  29354. }
  29355. function l(e) {
  29356. if ("number" != typeof e)
  29357. throw new TypeError('"size" argument must be a number');
  29358. if (e < 0)
  29359. throw new RangeError('"size" argument must not be negative')
  29360. }
  29361. function c(e, t, i, n) {
  29362. return l(t),
  29363. 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)
  29364. }
  29365. function h(e, t) {
  29366. if (l(t),
  29367. e = o(e, t < 0 ? 0 : 0 | g(t)),
  29368. !a.TYPED_ARRAY_SUPPORT)
  29369. for (var i = 0; i < t; ++i)
  29370. e[i] = 0;
  29371. return e
  29372. }
  29373. function u(e, t, i) {
  29374. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29375. !a.isEncoding(i))
  29376. throw new TypeError('"encoding" must be a valid string encoding');
  29377. var n = 0 | v(t, i);
  29378. e = o(e, n);
  29379. var r = e.write(t, i);
  29380. return r !== n && (e = e.slice(0, r)),
  29381. e
  29382. }
  29383. function d(e, t) {
  29384. var i = t.length < 0 ? 0 : 0 | g(t.length);
  29385. e = o(e, i);
  29386. for (var n = 0; n < i; n += 1)
  29387. e[n] = 255 & t[n];
  29388. return e
  29389. }
  29390. function p(e, t, i, n) {
  29391. if (t.byteLength,
  29392. i < 0 || t.byteLength < i)
  29393. throw new RangeError("'offset' is out of bounds");
  29394. if (t.byteLength < i + (n || 0))
  29395. throw new RangeError("'length' is out of bounds");
  29396. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29397. a.TYPED_ARRAY_SUPPORT ? (e = t,
  29398. e.__proto__ = a.prototype) : e = d(e, t),
  29399. e
  29400. }
  29401. function f(e, t) {
  29402. if (a.isBuffer(t)) {
  29403. var i = 0 | g(t.length);
  29404. return e = o(e, i),
  29405. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  29406. e)
  29407. }
  29408. if (t) {
  29409. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29410. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  29411. if ("Buffer" === t.type && $(t.data))
  29412. return d(e, t.data)
  29413. }
  29414. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29415. }
  29416. function g(e) {
  29417. if (e >= r())
  29418. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  29419. return 0 | e
  29420. }
  29421. function m(e) {
  29422. return +e != e && (e = 0),
  29423. a.alloc(+e)
  29424. }
  29425. function v(e, t) {
  29426. if (a.isBuffer(e))
  29427. return e.length;
  29428. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29429. return e.byteLength;
  29430. "string" != typeof e && (e = "" + e);
  29431. var i = e.length;
  29432. if (0 === i)
  29433. return 0;
  29434. for (var n = !1; ; )
  29435. switch (t) {
  29436. case "ascii":
  29437. case "latin1":
  29438. case "binary":
  29439. return i;
  29440. case "utf8":
  29441. case "utf-8":
  29442. case void 0:
  29443. return j(e).length;
  29444. case "ucs2":
  29445. case "ucs-2":
  29446. case "utf16le":
  29447. case "utf-16le":
  29448. return 2 * i;
  29449. case "hex":
  29450. return i >>> 1;
  29451. case "base64":
  29452. return Z(e).length;
  29453. default:
  29454. if (n)
  29455. return j(e).length;
  29456. t = ("" + t).toLowerCase(),
  29457. n = !0
  29458. }
  29459. }
  29460. function A(e, t, i) {
  29461. var n = !1;
  29462. if ((void 0 === t || t < 0) && (t = 0),
  29463. t > this.length)
  29464. return "";
  29465. if ((void 0 === i || i > this.length) && (i = this.length),
  29466. i <= 0)
  29467. return "";
  29468. if (i >>>= 0,
  29469. t >>>= 0,
  29470. i <= t)
  29471. return "";
  29472. for (e || (e = "utf8"); ; )
  29473. switch (e) {
  29474. case "hex":
  29475. return L(this, t, i);
  29476. case "utf8":
  29477. case "utf-8":
  29478. return M(this, t, i);
  29479. case "ascii":
  29480. return P(this, t, i);
  29481. case "latin1":
  29482. case "binary":
  29483. return O(this, t, i);
  29484. case "base64":
  29485. return S(this, t, i);
  29486. case "ucs2":
  29487. case "ucs-2":
  29488. case "utf16le":
  29489. case "utf-16le":
  29490. return D(this, t, i);
  29491. default:
  29492. if (n)
  29493. throw new TypeError("Unknown encoding: " + e);
  29494. e = (e + "").toLowerCase(),
  29495. n = !0
  29496. }
  29497. }
  29498. function y(e, t, i) {
  29499. var n = e[t];
  29500. e[t] = e[i],
  29501. e[i] = n
  29502. }
  29503. function C(e, t, i, n, r) {
  29504. if (0 === e.length)
  29505. return -1;
  29506. if ("string" == typeof i ? (n = i,
  29507. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29508. i = +i,
  29509. isNaN(i) && (i = r ? 0 : e.length - 1),
  29510. i < 0 && (i = e.length + i),
  29511. i >= e.length) {
  29512. if (r)
  29513. return -1;
  29514. i = e.length - 1
  29515. } else if (i < 0) {
  29516. if (!r)
  29517. return -1;
  29518. i = 0
  29519. }
  29520. if ("string" == typeof t && (t = a.from(t, n)),
  29521. a.isBuffer(t))
  29522. return 0 === t.length ? -1 : I(e, t, i, n, r);
  29523. if ("number" == typeof t)
  29524. return t &= 255,
  29525. a.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : I(e, [t], i, n, r);
  29526. throw new TypeError("val must be string, number or Buffer")
  29527. }
  29528. function I(e, t, i, n, r) {
  29529. function o(e, t) {
  29530. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  29531. }
  29532. var a = 1
  29533. , s = e.length
  29534. , l = t.length;
  29535. if (void 0 !== n && (n = String(n).toLowerCase(),
  29536. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29537. if (e.length < 2 || t.length < 2)
  29538. return -1;
  29539. a = 2,
  29540. s /= 2,
  29541. l /= 2,
  29542. i /= 2
  29543. }
  29544. var c;
  29545. if (r) {
  29546. var h = -1;
  29547. for (c = i; c < s; c++)
  29548. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  29549. if (h === -1 && (h = c),
  29550. c - h + 1 === l)
  29551. return h * a
  29552. } else
  29553. h !== -1 && (c -= c - h),
  29554. h = -1
  29555. } else
  29556. for (i + l > s && (i = s - l),
  29557. c = i; c >= 0; c--) {
  29558. for (var u = !0, d = 0; d < l; d++)
  29559. if (o(e, c + d) !== o(t, d)) {
  29560. u = !1;
  29561. break
  29562. }
  29563. if (u)
  29564. return c
  29565. }
  29566. return -1
  29567. }
  29568. function E(e, t, i, n) {
  29569. i = Number(i) || 0;
  29570. var r = e.length - i;
  29571. n ? (n = Number(n),
  29572. n > r && (n = r)) : n = r;
  29573. var o = t.length;
  29574. if (o % 2 !== 0)
  29575. throw new TypeError("Invalid hex string");
  29576. n > o / 2 && (n = o / 2);
  29577. for (var a = 0; a < n; ++a) {
  29578. var s = parseInt(t.substr(2 * a, 2), 16);
  29579. if (isNaN(s))
  29580. return a;
  29581. e[i + a] = s
  29582. }
  29583. return a
  29584. }
  29585. function b(e, t, i, n) {
  29586. return q(j(t, e.length - i), e, i, n)
  29587. }
  29588. function w(e, t, i, n) {
  29589. return q(Y(t), e, i, n)
  29590. }
  29591. function _(e, t, i, n) {
  29592. return w(e, t, i, n)
  29593. }
  29594. function T(e, t, i, n) {
  29595. return q(Z(t), e, i, n)
  29596. }
  29597. function x(e, t, i, n) {
  29598. return q(X(t, e.length - i), e, i, n)
  29599. }
  29600. function S(e, t, i) {
  29601. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  29602. }
  29603. function M(e, t, i) {
  29604. i = Math.min(e.length, i);
  29605. for (var n = [], r = t; r < i; ) {
  29606. var o = e[r]
  29607. , a = null
  29608. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  29609. if (r + s <= i) {
  29610. var l, c, h, u;
  29611. switch (s) {
  29612. case 1:
  29613. o < 128 && (a = o);
  29614. break;
  29615. case 2:
  29616. l = e[r + 1],
  29617. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  29618. u > 127 && (a = u));
  29619. break;
  29620. case 3:
  29621. l = e[r + 1],
  29622. c = e[r + 2],
  29623. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  29624. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  29625. break;
  29626. case 4:
  29627. l = e[r + 1],
  29628. c = e[r + 2],
  29629. h = e[r + 3],
  29630. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  29631. u > 65535 && u < 1114112 && (a = u))
  29632. }
  29633. }
  29634. null === a ? (a = 65533,
  29635. s = 1) : a > 65535 && (a -= 65536,
  29636. n.push(a >>> 10 & 1023 | 55296),
  29637. a = 56320 | 1023 & a),
  29638. n.push(a),
  29639. r += s
  29640. }
  29641. return R(n)
  29642. }
  29643. function R(e) {
  29644. var t = e.length;
  29645. if (t <= ee)
  29646. return String.fromCharCode.apply(String, e);
  29647. for (var i = "", n = 0; n < t; )
  29648. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  29649. return i
  29650. }
  29651. function P(e, t, i) {
  29652. var n = "";
  29653. i = Math.min(e.length, i);
  29654. for (var r = t; r < i; ++r)
  29655. n += String.fromCharCode(127 & e[r]);
  29656. return n
  29657. }
  29658. function O(e, t, i) {
  29659. var n = "";
  29660. i = Math.min(e.length, i);
  29661. for (var r = t; r < i; ++r)
  29662. n += String.fromCharCode(e[r]);
  29663. return n
  29664. }
  29665. function L(e, t, i) {
  29666. var n = e.length;
  29667. (!t || t < 0) && (t = 0),
  29668. (!i || i < 0 || i > n) && (i = n);
  29669. for (var r = "", o = t; o < i; ++o)
  29670. r += W(e[o]);
  29671. return r
  29672. }
  29673. function D(e, t, i) {
  29674. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29675. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29676. return r
  29677. }
  29678. function N(e, t, i) {
  29679. if (e % 1 !== 0 || e < 0)
  29680. throw new RangeError("offset is not uint");
  29681. if (e + t > i)
  29682. throw new RangeError("Trying to access beyond buffer length")
  29683. }
  29684. function B(e, t, i, n, r, o) {
  29685. if (!a.isBuffer(e))
  29686. throw new TypeError('"buffer" argument must be a Buffer instance');
  29687. if (t > r || t < o)
  29688. throw new RangeError('"value" argument is out of bounds');
  29689. if (i + n > e.length)
  29690. throw new RangeError("Index out of range")
  29691. }
  29692. function F(e, t, i, n) {
  29693. t < 0 && (t = 65535 + t + 1);
  29694. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29695. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29696. }
  29697. function V(e, t, i, n) {
  29698. t < 0 && (t = 4294967295 + t + 1);
  29699. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29700. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29701. }
  29702. function U(e, t, i, n, r, o) {
  29703. if (i + n > e.length)
  29704. throw new RangeError("Index out of range");
  29705. if (i < 0)
  29706. throw new RangeError("Index out of range")
  29707. }
  29708. function k(e, t, i, n, r) {
  29709. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  29710. J.write(e, t, i, n, 23, 4),
  29711. i + 4
  29712. }
  29713. function H(e, t, i, n, r) {
  29714. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  29715. J.write(e, t, i, n, 52, 8),
  29716. i + 8
  29717. }
  29718. function G(e) {
  29719. if (e = z(e).replace(te, ""),
  29720. e.length < 2)
  29721. return "";
  29722. for (; e.length % 4 !== 0; )
  29723. e += "=";
  29724. return e
  29725. }
  29726. function z(e) {
  29727. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29728. }
  29729. function W(e) {
  29730. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  29731. }
  29732. function j(e, t) {
  29733. t = t || 1 / 0;
  29734. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29735. if (i = e.charCodeAt(a),
  29736. i > 55295 && i < 57344) {
  29737. if (!r) {
  29738. if (i > 56319) {
  29739. (t -= 3) > -1 && o.push(239, 191, 189);
  29740. continue
  29741. }
  29742. if (a + 1 === n) {
  29743. (t -= 3) > -1 && o.push(239, 191, 189);
  29744. continue
  29745. }
  29746. r = i;
  29747. continue
  29748. }
  29749. if (i < 56320) {
  29750. (t -= 3) > -1 && o.push(239, 191, 189),
  29751. r = i;
  29752. continue
  29753. }
  29754. i = (r - 55296 << 10 | i - 56320) + 65536
  29755. } else
  29756. r && (t -= 3) > -1 && o.push(239, 191, 189);
  29757. if (r = null,
  29758. i < 128) {
  29759. if ((t -= 1) < 0)
  29760. break;
  29761. o.push(i)
  29762. } else if (i < 2048) {
  29763. if ((t -= 2) < 0)
  29764. break;
  29765. o.push(i >> 6 | 192, 63 & i | 128)
  29766. } else if (i < 65536) {
  29767. if ((t -= 3) < 0)
  29768. break;
  29769. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29770. } else {
  29771. if (!(i < 1114112))
  29772. throw new Error("Invalid code point");
  29773. if ((t -= 4) < 0)
  29774. break;
  29775. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29776. }
  29777. }
  29778. return o
  29779. }
  29780. function Y(e) {
  29781. for (var t = [], i = 0; i < e.length; ++i)
  29782. t.push(255 & e.charCodeAt(i));
  29783. return t
  29784. }
  29785. function X(e, t) {
  29786. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  29787. i = e.charCodeAt(a),
  29788. n = i >> 8,
  29789. r = i % 256,
  29790. o.push(r),
  29791. o.push(n);
  29792. return o
  29793. }
  29794. function Z(e) {
  29795. return Q.toByteArray(G(e))
  29796. }
  29797. function q(e, t, i, n) {
  29798. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29799. t[r + i] = e[r];
  29800. return r
  29801. }
  29802. function K(e) {
  29803. return e !== e
  29804. }
  29805. var Q = e("base64-js")
  29806. , J = e("ieee754")
  29807. , $ = e("isarray");
  29808. i.Buffer = a,
  29809. i.SlowBuffer = m,
  29810. i.INSPECT_MAX_BYTES = 50,
  29811. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  29812. i.kMaxLength = r(),
  29813. a.poolSize = 8192,
  29814. a._augment = function(e) {
  29815. return e.__proto__ = a.prototype,
  29816. e
  29817. }
  29818. ,
  29819. a.from = function(e, t, i) {
  29820. return s(null, e, t, i)
  29821. }
  29822. ,
  29823. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  29824. a.__proto__ = Uint8Array,
  29825. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  29826. value: null,
  29827. configurable: !0
  29828. })),
  29829. a.alloc = function(e, t, i) {
  29830. return c(null, e, t, i)
  29831. }
  29832. ,
  29833. a.allocUnsafe = function(e) {
  29834. return h(null, e)
  29835. }
  29836. ,
  29837. a.allocUnsafeSlow = function(e) {
  29838. return h(null, e)
  29839. }
  29840. ,
  29841. a.isBuffer = function(e) {
  29842. return !(null == e || !e._isBuffer)
  29843. }
  29844. ,
  29845. a.compare = function(e, t) {
  29846. if (!a.isBuffer(e) || !a.isBuffer(t))
  29847. throw new TypeError("Arguments must be Buffers");
  29848. if (e === t)
  29849. return 0;
  29850. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29851. if (e[r] !== t[r]) {
  29852. i = e[r],
  29853. n = t[r];
  29854. break
  29855. }
  29856. return i < n ? -1 : n < i ? 1 : 0
  29857. }
  29858. ,
  29859. a.isEncoding = function(e) {
  29860. switch (String(e).toLowerCase()) {
  29861. case "hex":
  29862. case "utf8":
  29863. case "utf-8":
  29864. case "ascii":
  29865. case "latin1":
  29866. case "binary":
  29867. case "base64":
  29868. case "ucs2":
  29869. case "ucs-2":
  29870. case "utf16le":
  29871. case "utf-16le":
  29872. return !0;
  29873. default:
  29874. return !1
  29875. }
  29876. }
  29877. ,
  29878. a.concat = function(e, t) {
  29879. if (!$(e))
  29880. throw new TypeError('"list" argument must be an Array of Buffers');
  29881. if (0 === e.length)
  29882. return a.alloc(0);
  29883. var i;
  29884. if (void 0 === t)
  29885. for (t = 0,
  29886. i = 0; i < e.length; ++i)
  29887. t += e[i].length;
  29888. var n = a.allocUnsafe(t)
  29889. , r = 0;
  29890. for (i = 0; i < e.length; ++i) {
  29891. var o = e[i];
  29892. if (!a.isBuffer(o))
  29893. throw new TypeError('"list" argument must be an Array of Buffers');
  29894. o.copy(n, r),
  29895. r += o.length
  29896. }
  29897. return n
  29898. }
  29899. ,
  29900. a.byteLength = v,
  29901. a.prototype._isBuffer = !0,
  29902. a.prototype.swap16 = function() {
  29903. var e = this.length;
  29904. if (e % 2 !== 0)
  29905. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29906. for (var t = 0; t < e; t += 2)
  29907. y(this, t, t + 1);
  29908. return this
  29909. }
  29910. ,
  29911. a.prototype.swap32 = function() {
  29912. var e = this.length;
  29913. if (e % 4 !== 0)
  29914. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29915. for (var t = 0; t < e; t += 4)
  29916. y(this, t, t + 3),
  29917. y(this, t + 1, t + 2);
  29918. return this
  29919. }
  29920. ,
  29921. a.prototype.swap64 = function() {
  29922. var e = this.length;
  29923. if (e % 8 !== 0)
  29924. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29925. for (var t = 0; t < e; t += 8)
  29926. y(this, t, t + 7),
  29927. y(this, t + 1, t + 6),
  29928. y(this, t + 2, t + 5),
  29929. y(this, t + 3, t + 4);
  29930. return this
  29931. }
  29932. ,
  29933. a.prototype.toString = function() {
  29934. var e = 0 | this.length;
  29935. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  29936. }
  29937. ,
  29938. a.prototype.equals = function(e) {
  29939. if (!a.isBuffer(e))
  29940. throw new TypeError("Argument must be a Buffer");
  29941. return this === e || 0 === a.compare(this, e)
  29942. }
  29943. ,
  29944. a.prototype.inspect = function() {
  29945. var e = ""
  29946. , t = i.INSPECT_MAX_BYTES;
  29947. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29948. this.length > t && (e += " ... ")),
  29949. "<Buffer " + e + ">"
  29950. }
  29951. ,
  29952. a.prototype.compare = function(e, t, i, n, r) {
  29953. if (!a.isBuffer(e))
  29954. throw new TypeError("Argument must be a Buffer");
  29955. if (void 0 === t && (t = 0),
  29956. void 0 === i && (i = e ? e.length : 0),
  29957. void 0 === n && (n = 0),
  29958. void 0 === r && (r = this.length),
  29959. t < 0 || i > e.length || n < 0 || r > this.length)
  29960. throw new RangeError("out of range index");
  29961. if (n >= r && t >= i)
  29962. return 0;
  29963. if (n >= r)
  29964. return -1;
  29965. if (t >= i)
  29966. return 1;
  29967. if (t >>>= 0,
  29968. i >>>= 0,
  29969. n >>>= 0,
  29970. r >>>= 0,
  29971. this === e)
  29972. return 0;
  29973. for (var o = r - n, s = i - t, l = Math.min(o, s), c = this.slice(n, r), h = e.slice(t, i), u = 0; u < l; ++u)
  29974. if (c[u] !== h[u]) {
  29975. o = c[u],
  29976. s = h[u];
  29977. break
  29978. }
  29979. return o < s ? -1 : s < o ? 1 : 0
  29980. }
  29981. ,
  29982. a.prototype.includes = function(e, t, i) {
  29983. return this.indexOf(e, t, i) !== -1
  29984. }
  29985. ,
  29986. a.prototype.indexOf = function(e, t, i) {
  29987. return C(this, e, t, i, !0)
  29988. }
  29989. ,
  29990. a.prototype.lastIndexOf = function(e, t, i) {
  29991. return C(this, e, t, i, !1)
  29992. }
  29993. ,
  29994. a.prototype.write = function(e, t, i, n) {
  29995. if (void 0 === t)
  29996. n = "utf8",
  29997. i = this.length,
  29998. t = 0;
  29999. else if (void 0 === i && "string" == typeof t)
  30000. n = t,
  30001. i = this.length,
  30002. t = 0;
  30003. else {
  30004. if (!isFinite(t))
  30005. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30006. t |= 0,
  30007. isFinite(i) ? (i |= 0,
  30008. void 0 === n && (n = "utf8")) : (n = i,
  30009. i = void 0)
  30010. }
  30011. var r = this.length - t;
  30012. if ((void 0 === i || i > r) && (i = r),
  30013. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  30014. throw new RangeError("Attempt to write outside buffer bounds");
  30015. n || (n = "utf8");
  30016. for (var o = !1; ; )
  30017. switch (n) {
  30018. case "hex":
  30019. return E(this, e, t, i);
  30020. case "utf8":
  30021. case "utf-8":
  30022. return b(this, e, t, i);
  30023. case "ascii":
  30024. return w(this, e, t, i);
  30025. case "latin1":
  30026. case "binary":
  30027. return _(this, e, t, i);
  30028. case "base64":
  30029. return T(this, e, t, i);
  30030. case "ucs2":
  30031. case "ucs-2":
  30032. case "utf16le":
  30033. case "utf-16le":
  30034. return x(this, e, t, i);
  30035. default:
  30036. if (o)
  30037. throw new TypeError("Unknown encoding: " + n);
  30038. n = ("" + n).toLowerCase(),
  30039. o = !0
  30040. }
  30041. }
  30042. ,
  30043. a.prototype.toJSON = function() {
  30044. return {
  30045. type: "Buffer",
  30046. data: Array.prototype.slice.call(this._arr || this, 0)
  30047. }
  30048. }
  30049. ;
  30050. var ee = 4096;
  30051. a.prototype.slice = function(e, t) {
  30052. var i = this.length;
  30053. e = ~~e,
  30054. t = void 0 === t ? i : ~~t,
  30055. e < 0 ? (e += i,
  30056. e < 0 && (e = 0)) : e > i && (e = i),
  30057. t < 0 ? (t += i,
  30058. t < 0 && (t = 0)) : t > i && (t = i),
  30059. t < e && (t = e);
  30060. var n;
  30061. if (a.TYPED_ARRAY_SUPPORT)
  30062. n = this.subarray(e, t),
  30063. n.__proto__ = a.prototype;
  30064. else {
  30065. var r = t - e;
  30066. n = new a(r,void 0);
  30067. for (var o = 0; o < r; ++o)
  30068. n[o] = this[o + e]
  30069. }
  30070. return n
  30071. }
  30072. ,
  30073. a.prototype.readUIntLE = function(e, t, i) {
  30074. e |= 0,
  30075. t |= 0,
  30076. i || N(e, t, this.length);
  30077. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30078. n += this[e + o] * r;
  30079. return n
  30080. }
  30081. ,
  30082. a.prototype.readUIntBE = function(e, t, i) {
  30083. e |= 0,
  30084. t |= 0,
  30085. i || N(e, t, this.length);
  30086. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  30087. n += this[e + --t] * r;
  30088. return n
  30089. }
  30090. ,
  30091. a.prototype.readUInt8 = function(e, t) {
  30092. return t || N(e, 1, this.length),
  30093. this[e]
  30094. }
  30095. ,
  30096. a.prototype.readUInt16LE = function(e, t) {
  30097. return t || N(e, 2, this.length),
  30098. this[e] | this[e + 1] << 8
  30099. }
  30100. ,
  30101. a.prototype.readUInt16BE = function(e, t) {
  30102. return t || N(e, 2, this.length),
  30103. this[e] << 8 | this[e + 1]
  30104. }
  30105. ,
  30106. a.prototype.readUInt32LE = function(e, t) {
  30107. return t || N(e, 4, this.length),
  30108. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30109. }
  30110. ,
  30111. a.prototype.readUInt32BE = function(e, t) {
  30112. return t || N(e, 4, this.length),
  30113. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30114. }
  30115. ,
  30116. a.prototype.readIntLE = function(e, t, i) {
  30117. e |= 0,
  30118. t |= 0,
  30119. i || N(e, t, this.length);
  30120. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30121. n += this[e + o] * r;
  30122. return r *= 128,
  30123. n >= r && (n -= Math.pow(2, 8 * t)),
  30124. n
  30125. }
  30126. ,
  30127. a.prototype.readIntBE = function(e, t, i) {
  30128. e |= 0,
  30129. t |= 0,
  30130. i || N(e, t, this.length);
  30131. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  30132. o += this[e + --n] * r;
  30133. return r *= 128,
  30134. o >= r && (o -= Math.pow(2, 8 * t)),
  30135. o
  30136. }
  30137. ,
  30138. a.prototype.readInt8 = function(e, t) {
  30139. return t || N(e, 1, this.length),
  30140. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  30141. }
  30142. ,
  30143. a.prototype.readInt16LE = function(e, t) {
  30144. t || N(e, 2, this.length);
  30145. var i = this[e] | this[e + 1] << 8;
  30146. return 32768 & i ? 4294901760 | i : i
  30147. }
  30148. ,
  30149. a.prototype.readInt16BE = function(e, t) {
  30150. t || N(e, 2, this.length);
  30151. var i = this[e + 1] | this[e] << 8;
  30152. return 32768 & i ? 4294901760 | i : i
  30153. }
  30154. ,
  30155. a.prototype.readInt32LE = function(e, t) {
  30156. return t || N(e, 4, this.length),
  30157. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30158. }
  30159. ,
  30160. a.prototype.readInt32BE = function(e, t) {
  30161. return t || N(e, 4, this.length),
  30162. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30163. }
  30164. ,
  30165. a.prototype.readFloatLE = function(e, t) {
  30166. return t || N(e, 4, this.length),
  30167. J.read(this, e, !0, 23, 4)
  30168. }
  30169. ,
  30170. a.prototype.readFloatBE = function(e, t) {
  30171. return t || N(e, 4, this.length),
  30172. J.read(this, e, !1, 23, 4)
  30173. }
  30174. ,
  30175. a.prototype.readDoubleLE = function(e, t) {
  30176. return t || N(e, 8, this.length),
  30177. J.read(this, e, !0, 52, 8)
  30178. }
  30179. ,
  30180. a.prototype.readDoubleBE = function(e, t) {
  30181. return t || N(e, 8, this.length),
  30182. J.read(this, e, !1, 52, 8)
  30183. }
  30184. ,
  30185. a.prototype.writeUIntLE = function(e, t, i, n) {
  30186. if (e = +e,
  30187. t |= 0,
  30188. i |= 0,
  30189. !n) {
  30190. var r = Math.pow(2, 8 * i) - 1;
  30191. B(this, e, t, i, r, 0)
  30192. }
  30193. var o = 1
  30194. , a = 0;
  30195. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  30196. this[t + a] = e / o & 255;
  30197. return t + i
  30198. }
  30199. ,
  30200. a.prototype.writeUIntBE = function(e, t, i, n) {
  30201. if (e = +e,
  30202. t |= 0,
  30203. i |= 0,
  30204. !n) {
  30205. var r = Math.pow(2, 8 * i) - 1;
  30206. B(this, e, t, i, r, 0)
  30207. }
  30208. var o = i - 1
  30209. , a = 1;
  30210. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  30211. this[t + o] = e / a & 255;
  30212. return t + i
  30213. }
  30214. ,
  30215. a.prototype.writeUInt8 = function(e, t, i) {
  30216. return e = +e,
  30217. t |= 0,
  30218. i || B(this, e, t, 1, 255, 0),
  30219. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30220. this[t] = 255 & e,
  30221. t + 1
  30222. }
  30223. ,
  30224. a.prototype.writeUInt16LE = function(e, t, i) {
  30225. return e = +e,
  30226. t |= 0,
  30227. i || B(this, e, t, 2, 65535, 0),
  30228. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30229. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  30230. t + 2
  30231. }
  30232. ,
  30233. a.prototype.writeUInt16BE = function(e, t, i) {
  30234. return e = +e,
  30235. t |= 0,
  30236. i || B(this, e, t, 2, 65535, 0),
  30237. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30238. this[t + 1] = 255 & e) : F(this, e, t, !1),
  30239. t + 2
  30240. }
  30241. ,
  30242. a.prototype.writeUInt32LE = function(e, t, i) {
  30243. return e = +e,
  30244. t |= 0,
  30245. i || B(this, e, t, 4, 4294967295, 0),
  30246. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30247. this[t + 2] = e >>> 16,
  30248. this[t + 1] = e >>> 8,
  30249. this[t] = 255 & e) : V(this, e, t, !0),
  30250. t + 4
  30251. }
  30252. ,
  30253. a.prototype.writeUInt32BE = function(e, t, i) {
  30254. return e = +e,
  30255. t |= 0,
  30256. i || B(this, e, t, 4, 4294967295, 0),
  30257. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30258. this[t + 1] = e >>> 16,
  30259. this[t + 2] = e >>> 8,
  30260. this[t + 3] = 255 & e) : V(this, e, t, !1),
  30261. t + 4
  30262. }
  30263. ,
  30264. a.prototype.writeIntLE = function(e, t, i, n) {
  30265. if (e = +e,
  30266. t |= 0,
  30267. !n) {
  30268. var r = Math.pow(2, 8 * i - 1);
  30269. B(this, e, t, i, r - 1, -r)
  30270. }
  30271. var o = 0
  30272. , a = 1
  30273. , s = 0;
  30274. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30275. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30276. this[t + o] = (e / a >> 0) - s & 255;
  30277. return t + i
  30278. }
  30279. ,
  30280. a.prototype.writeIntBE = function(e, t, i, n) {
  30281. if (e = +e,
  30282. t |= 0,
  30283. !n) {
  30284. var r = Math.pow(2, 8 * i - 1);
  30285. B(this, e, t, i, r - 1, -r)
  30286. }
  30287. var o = i - 1
  30288. , a = 1
  30289. , s = 0;
  30290. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  30291. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30292. this[t + o] = (e / a >> 0) - s & 255;
  30293. return t + i
  30294. }
  30295. ,
  30296. a.prototype.writeInt8 = function(e, t, i) {
  30297. return e = +e,
  30298. t |= 0,
  30299. i || B(this, e, t, 1, 127, -128),
  30300. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30301. e < 0 && (e = 255 + e + 1),
  30302. this[t] = 255 & e,
  30303. t + 1
  30304. }
  30305. ,
  30306. a.prototype.writeInt16LE = function(e, t, i) {
  30307. return e = +e,
  30308. t |= 0,
  30309. i || B(this, e, t, 2, 32767, -32768),
  30310. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30311. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  30312. t + 2
  30313. }
  30314. ,
  30315. a.prototype.writeInt16BE = function(e, t, i) {
  30316. return e = +e,
  30317. t |= 0,
  30318. i || B(this, e, t, 2, 32767, -32768),
  30319. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30320. this[t + 1] = 255 & e) : F(this, e, t, !1),
  30321. t + 2
  30322. }
  30323. ,
  30324. a.prototype.writeInt32LE = function(e, t, i) {
  30325. return e = +e,
  30326. t |= 0,
  30327. i || B(this, e, t, 4, 2147483647, -2147483648),
  30328. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30329. this[t + 1] = e >>> 8,
  30330. this[t + 2] = e >>> 16,
  30331. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  30332. t + 4
  30333. }
  30334. ,
  30335. a.prototype.writeInt32BE = function(e, t, i) {
  30336. return e = +e,
  30337. t |= 0,
  30338. i || B(this, e, t, 4, 2147483647, -2147483648),
  30339. e < 0 && (e = 4294967295 + e + 1),
  30340. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30341. this[t + 1] = e >>> 16,
  30342. this[t + 2] = e >>> 8,
  30343. this[t + 3] = 255 & e) : V(this, e, t, !1),
  30344. t + 4
  30345. }
  30346. ,
  30347. a.prototype.writeFloatLE = function(e, t, i) {
  30348. return k(this, e, t, !0, i)
  30349. }
  30350. ,
  30351. a.prototype.writeFloatBE = function(e, t, i) {
  30352. return k(this, e, t, !1, i)
  30353. }
  30354. ,
  30355. a.prototype.writeDoubleLE = function(e, t, i) {
  30356. return H(this, e, t, !0, i)
  30357. }
  30358. ,
  30359. a.prototype.writeDoubleBE = function(e, t, i) {
  30360. return H(this, e, t, !1, i)
  30361. }
  30362. ,
  30363. a.prototype.copy = function(e, t, i, n) {
  30364. if (i || (i = 0),
  30365. n || 0 === n || (n = this.length),
  30366. t >= e.length && (t = e.length),
  30367. t || (t = 0),
  30368. n > 0 && n < i && (n = i),
  30369. n === i)
  30370. return 0;
  30371. if (0 === e.length || 0 === this.length)
  30372. return 0;
  30373. if (t < 0)
  30374. throw new RangeError("targetStart out of bounds");
  30375. if (i < 0 || i >= this.length)
  30376. throw new RangeError("sourceStart out of bounds");
  30377. if (n < 0)
  30378. throw new RangeError("sourceEnd out of bounds");
  30379. n > this.length && (n = this.length),
  30380. e.length - t < n - i && (n = e.length - t + i);
  30381. var r, o = n - i;
  30382. if (this === e && i < t && t < n)
  30383. for (r = o - 1; r >= 0; --r)
  30384. e[r + t] = this[r + i];
  30385. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  30386. for (r = 0; r < o; ++r)
  30387. e[r + t] = this[r + i];
  30388. else
  30389. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30390. return o
  30391. }
  30392. ,
  30393. a.prototype.fill = function(e, t, i, n) {
  30394. if ("string" == typeof e) {
  30395. if ("string" == typeof t ? (n = t,
  30396. t = 0,
  30397. i = this.length) : "string" == typeof i && (n = i,
  30398. i = this.length),
  30399. 1 === e.length) {
  30400. var r = e.charCodeAt(0);
  30401. r < 256 && (e = r)
  30402. }
  30403. if (void 0 !== n && "string" != typeof n)
  30404. throw new TypeError("encoding must be a string");
  30405. if ("string" == typeof n && !a.isEncoding(n))
  30406. throw new TypeError("Unknown encoding: " + n)
  30407. } else
  30408. "number" == typeof e && (e &= 255);
  30409. if (t < 0 || this.length < t || this.length < i)
  30410. throw new RangeError("Out of range index");
  30411. if (i <= t)
  30412. return this;
  30413. t >>>= 0,
  30414. i = void 0 === i ? this.length : i >>> 0,
  30415. e || (e = 0);
  30416. var o;
  30417. if ("number" == typeof e)
  30418. for (o = t; o < i; ++o)
  30419. this[o] = e;
  30420. else {
  30421. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  30422. , l = s.length;
  30423. for (o = 0; o < i - t; ++o)
  30424. this[o + t] = s[o % l]
  30425. }
  30426. return this
  30427. }
  30428. ;
  30429. var te = /[^+\/0-9A-Za-z-_]/g
  30430. }
  30431. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30432. }
  30433. , {
  30434. "base64-js": 199,
  30435. ieee754: 200,
  30436. isarray: 201
  30437. }],
  30438. 199: [function(e, t, i) {
  30439. "use strict";
  30440. function n(e) {
  30441. var t = e.length;
  30442. if (t % 4 > 0)
  30443. throw new Error("Invalid string. Length must be a multiple of 4");
  30444. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30445. }
  30446. function r(e) {
  30447. return 3 * e.length / 4 - n(e)
  30448. }
  30449. function o(e) {
  30450. var t, i, r, o, a, s, l = e.length;
  30451. a = n(e),
  30452. s = new u(3 * l / 4 - a),
  30453. r = a > 0 ? l - 4 : l;
  30454. var c = 0;
  30455. for (t = 0,
  30456. i = 0; t < r; t += 4,
  30457. i += 3)
  30458. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  30459. s[c++] = o >> 16 & 255,
  30460. s[c++] = o >> 8 & 255,
  30461. s[c++] = 255 & o;
  30462. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  30463. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  30464. s[c++] = o >> 8 & 255,
  30465. s[c++] = 255 & o),
  30466. s
  30467. }
  30468. function a(e) {
  30469. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  30470. }
  30471. function s(e, t, i) {
  30472. for (var n, r = [], o = t; o < i; o += 3)
  30473. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30474. r.push(a(n));
  30475. return r.join("")
  30476. }
  30477. function l(e) {
  30478. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  30479. o.push(s(e, l, l + a > h ? h : l + a));
  30480. return 1 === n ? (t = e[i - 1],
  30481. r += c[t >> 2],
  30482. r += c[t << 4 & 63],
  30483. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  30484. r += c[t >> 10],
  30485. r += c[t >> 4 & 63],
  30486. r += c[t << 2 & 63],
  30487. r += "="),
  30488. o.push(r),
  30489. o.join("")
  30490. }
  30491. i.byteLength = r,
  30492. i.toByteArray = o,
  30493. i.fromByteArray = l;
  30494. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  30495. c[p] = d[p],
  30496. h[d.charCodeAt(p)] = p;
  30497. h["-".charCodeAt(0)] = 62,
  30498. h["_".charCodeAt(0)] = 63
  30499. }
  30500. , {}],
  30501. 200: [function(e, t, i) {
  30502. i.read = function(e, t, i, n, r) {
  30503. 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];
  30504. for (u += d,
  30505. o = p & (1 << -h) - 1,
  30506. p >>= -h,
  30507. h += s; h > 0; o = 256 * o + e[t + u],
  30508. u += d,
  30509. h -= 8)
  30510. ;
  30511. for (a = o & (1 << -h) - 1,
  30512. o >>= -h,
  30513. h += n; h > 0; a = 256 * a + e[t + u],
  30514. u += d,
  30515. h -= 8)
  30516. ;
  30517. if (0 === o)
  30518. o = 1 - c;
  30519. else {
  30520. if (o === l)
  30521. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  30522. a += Math.pow(2, n),
  30523. o -= c
  30524. }
  30525. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30526. }
  30527. ,
  30528. i.write = function(e, t, i, n, r, o) {
  30529. 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;
  30530. for (t = Math.abs(t),
  30531. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30532. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30533. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30534. l *= 2),
  30535. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  30536. t * l >= 2 && (a++,
  30537. l /= 2),
  30538. a + u >= h ? (s = 0,
  30539. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  30540. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30541. a = 0)); r >= 8; e[i + p] = 255 & s,
  30542. p += f,
  30543. s /= 256,
  30544. r -= 8)
  30545. ;
  30546. for (a = a << r | s,
  30547. c += r; c > 0; e[i + p] = 255 & a,
  30548. p += f,
  30549. a /= 256,
  30550. c -= 8)
  30551. ;
  30552. e[i + p - f] |= 128 * g
  30553. }
  30554. }
  30555. , {}],
  30556. 201: [function(e, t, i) {
  30557. var n = {}.toString;
  30558. t.exports = Array.isArray || function(e) {
  30559. return "[object Array]" == n.call(e)
  30560. }
  30561. }
  30562. , {}],
  30563. 202: [function(e, t, i) {
  30564. function n() {
  30565. this._events = this._events || {},
  30566. this._maxListeners = this._maxListeners || void 0
  30567. }
  30568. function r(e) {
  30569. return "function" == typeof e
  30570. }
  30571. function o(e) {
  30572. return "number" == typeof e
  30573. }
  30574. function a(e) {
  30575. return "object" == typeof e && null !== e
  30576. }
  30577. function s(e) {
  30578. return void 0 === e
  30579. }
  30580. t.exports = n,
  30581. n.EventEmitter = n,
  30582. n.prototype._events = void 0,
  30583. n.prototype._maxListeners = void 0,
  30584. n.defaultMaxListeners = 10,
  30585. n.prototype.setMaxListeners = function(e) {
  30586. if (!o(e) || e < 0 || isNaN(e))
  30587. throw TypeError("n must be a positive number");
  30588. return this._maxListeners = e,
  30589. this
  30590. }
  30591. ,
  30592. n.prototype.emit = function(e) {
  30593. var t, i, n, o, l, c;
  30594. if (this._events || (this._events = {}),
  30595. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  30596. if (t = arguments[1],
  30597. t instanceof Error)
  30598. throw t;
  30599. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30600. throw h.context = t,
  30601. h
  30602. }
  30603. if (i = this._events[e],
  30604. s(i))
  30605. return !1;
  30606. if (r(i))
  30607. switch (arguments.length) {
  30608. case 1:
  30609. i.call(this);
  30610. break;
  30611. case 2:
  30612. i.call(this, arguments[1]);
  30613. break;
  30614. case 3:
  30615. i.call(this, arguments[1], arguments[2]);
  30616. break;
  30617. default:
  30618. o = Array.prototype.slice.call(arguments, 1),
  30619. i.apply(this, o)
  30620. }
  30621. else if (a(i))
  30622. for (o = Array.prototype.slice.call(arguments, 1),
  30623. c = i.slice(),
  30624. n = c.length,
  30625. l = 0; l < n; l++)
  30626. c[l].apply(this, o);
  30627. return !0
  30628. }
  30629. ,
  30630. n.prototype.addListener = function(e, t) {
  30631. var i;
  30632. if (!r(t))
  30633. throw TypeError("listener must be a function");
  30634. return this._events || (this._events = {}),
  30635. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  30636. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30637. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  30638. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  30639. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30640. "function" == typeof console.trace && console.trace())),
  30641. this
  30642. }
  30643. ,
  30644. n.prototype.on = n.prototype.addListener,
  30645. n.prototype.once = function(e, t) {
  30646. function i() {
  30647. this.removeListener(e, i),
  30648. n || (n = !0,
  30649. t.apply(this, arguments))
  30650. }
  30651. if (!r(t))
  30652. throw TypeError("listener must be a function");
  30653. var n = !1;
  30654. return i.listener = t,
  30655. this.on(e, i),
  30656. this
  30657. }
  30658. ,
  30659. n.prototype.removeListener = function(e, t) {
  30660. var i, n, o, s;
  30661. if (!r(t))
  30662. throw TypeError("listener must be a function");
  30663. if (!this._events || !this._events[e])
  30664. return this;
  30665. if (i = this._events[e],
  30666. o = i.length,
  30667. n = -1,
  30668. i === t || r(i.listener) && i.listener === t)
  30669. delete this._events[e],
  30670. this._events.removeListener && this.emit("removeListener", e, t);
  30671. else if (a(i)) {
  30672. for (s = o; s-- > 0; )
  30673. if (i[s] === t || i[s].listener && i[s].listener === t) {
  30674. n = s;
  30675. break
  30676. }
  30677. if (n < 0)
  30678. return this;
  30679. 1 === i.length ? (i.length = 0,
  30680. delete this._events[e]) : i.splice(n, 1),
  30681. this._events.removeListener && this.emit("removeListener", e, t)
  30682. }
  30683. return this
  30684. }
  30685. ,
  30686. n.prototype.removeAllListeners = function(e) {
  30687. var t, i;
  30688. if (!this._events)
  30689. return this;
  30690. if (!this._events.removeListener)
  30691. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30692. this;
  30693. if (0 === arguments.length) {
  30694. for (t in this._events)
  30695. "removeListener" !== t && this.removeAllListeners(t);
  30696. return this.removeAllListeners("removeListener"),
  30697. this._events = {},
  30698. this
  30699. }
  30700. if (i = this._events[e],
  30701. r(i))
  30702. this.removeListener(e, i);
  30703. else if (i)
  30704. for (; i.length; )
  30705. this.removeListener(e, i[i.length - 1]);
  30706. return delete this._events[e],
  30707. this
  30708. }
  30709. ,
  30710. n.prototype.listeners = function(e) {
  30711. var t;
  30712. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30713. }
  30714. ,
  30715. n.prototype.listenerCount = function(e) {
  30716. if (this._events) {
  30717. var t = this._events[e];
  30718. if (r(t))
  30719. return 1;
  30720. if (t)
  30721. return t.length
  30722. }
  30723. return 0
  30724. }
  30725. ,
  30726. n.listenerCount = function(e, t) {
  30727. return e.listenerCount(t)
  30728. }
  30729. }
  30730. , {}],
  30731. 203: [function(e, t, i) {
  30732. function n() {
  30733. throw new Error("setTimeout has not been defined")
  30734. }
  30735. function r() {
  30736. throw new Error("clearTimeout has not been defined")
  30737. }
  30738. function o(e) {
  30739. if (u === setTimeout)
  30740. return setTimeout(e, 0);
  30741. if ((u === n || !u) && setTimeout)
  30742. return u = setTimeout,
  30743. setTimeout(e, 0);
  30744. try {
  30745. return u(e, 0)
  30746. } catch (t) {
  30747. try {
  30748. return u.call(null, e, 0)
  30749. } catch (t) {
  30750. return u.call(this, e, 0)
  30751. }
  30752. }
  30753. }
  30754. function a(e) {
  30755. if (d === clearTimeout)
  30756. return clearTimeout(e);
  30757. if ((d === r || !d) && clearTimeout)
  30758. return d = clearTimeout,
  30759. clearTimeout(e);
  30760. try {
  30761. return d(e)
  30762. } catch (t) {
  30763. try {
  30764. return d.call(null, e)
  30765. } catch (t) {
  30766. return d.call(this, e)
  30767. }
  30768. }
  30769. }
  30770. function s() {
  30771. m && f && (m = !1,
  30772. f.length ? g = f.concat(g) : v = -1,
  30773. g.length && l())
  30774. }
  30775. function l() {
  30776. if (!m) {
  30777. var e = o(s);
  30778. m = !0;
  30779. for (var t = g.length; t; ) {
  30780. for (f = g,
  30781. g = []; ++v < t; )
  30782. f && f[v].run();
  30783. v = -1,
  30784. t = g.length
  30785. }
  30786. f = null,
  30787. m = !1,
  30788. a(e)
  30789. }
  30790. }
  30791. function c(e, t) {
  30792. this.fun = e,
  30793. this.array = t
  30794. }
  30795. function h() {}
  30796. var u, d, p = t.exports = {};
  30797. !function() {
  30798. try {
  30799. u = "function" == typeof setTimeout ? setTimeout : n
  30800. } catch (e) {
  30801. u = n
  30802. }
  30803. try {
  30804. d = "function" == typeof clearTimeout ? clearTimeout : r
  30805. } catch (e) {
  30806. d = r
  30807. }
  30808. }();
  30809. var f, g = [], m = !1, v = -1;
  30810. p.nextTick = function(e) {
  30811. var t = new Array(arguments.length - 1);
  30812. if (arguments.length > 1)
  30813. for (var i = 1; i < arguments.length; i++)
  30814. t[i - 1] = arguments[i];
  30815. g.push(new c(e,t)),
  30816. 1 !== g.length || m || o(l)
  30817. }
  30818. ,
  30819. c.prototype.run = function() {
  30820. this.fun.apply(null, this.array)
  30821. }
  30822. ,
  30823. p.title = "browser",
  30824. p.browser = !0,
  30825. p.env = {},
  30826. p.argv = [],
  30827. p.version = "",
  30828. p.versions = {},
  30829. p.on = h,
  30830. p.addListener = h,
  30831. p.once = h,
  30832. p.off = h,
  30833. p.removeListener = h,
  30834. p.removeAllListeners = h,
  30835. p.emit = h,
  30836. p.binding = function(e) {
  30837. throw new Error("process.binding is not supported")
  30838. }
  30839. ,
  30840. p.cwd = function() {
  30841. return "/"
  30842. }
  30843. ,
  30844. p.chdir = function(e) {
  30845. throw new Error("process.chdir is not supported")
  30846. }
  30847. ,
  30848. p.umask = function() {
  30849. return 0
  30850. }
  30851. }
  30852. , {}],
  30853. 204: [function(e, t, i) {
  30854. (function(e) {
  30855. !function(n) {
  30856. function r(e) {
  30857. throw new RangeError(L[e])
  30858. }
  30859. function o(e, t) {
  30860. for (var i = e.length, n = []; i--; )
  30861. n[i] = t(e[i]);
  30862. return n
  30863. }
  30864. function a(e, t) {
  30865. var i = e.split("@")
  30866. , n = "";
  30867. i.length > 1 && (n = i[0] + "@",
  30868. e = i[1]),
  30869. e = e.replace(O, ".");
  30870. var r = e.split(".")
  30871. , a = o(r, t).join(".");
  30872. return n + a
  30873. }
  30874. function s(e) {
  30875. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30876. t = e.charCodeAt(r++),
  30877. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  30878. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  30879. r--)) : n.push(t);
  30880. return n
  30881. }
  30882. function l(e) {
  30883. return o(e, function(e) {
  30884. var t = "";
  30885. return e > 65535 && (e -= 65536,
  30886. t += B(e >>> 10 & 1023 | 55296),
  30887. e = 56320 | 1023 & e),
  30888. t += B(e)
  30889. }).join("")
  30890. }
  30891. function c(e) {
  30892. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  30893. }
  30894. function h(e, t) {
  30895. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30896. }
  30897. function u(e, t, i) {
  30898. var n = 0;
  30899. for (e = i ? N(e / T) : e >> 1,
  30900. e += N(e / t); e > D * w >> 1; n += E)
  30901. e = N(e / D);
  30902. return N(n + (D + 1) * e / (e + _))
  30903. }
  30904. function d(e) {
  30905. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  30906. for (i = e.lastIndexOf(M),
  30907. i < 0 && (i = 0),
  30908. n = 0; n < i; ++n)
  30909. e.charCodeAt(n) >= 128 && r("not-basic"),
  30910. g.push(e.charCodeAt(n));
  30911. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  30912. for (a = v,
  30913. s = 1,
  30914. h = E; o >= m && r("invalid-input"),
  30915. d = c(e.charCodeAt(o++)),
  30916. (d >= E || d > N((I - v) / s)) && r("overflow"),
  30917. v += d * s,
  30918. p = h <= y ? b : h >= y + w ? w : h - y,
  30919. !(d < p); h += E)
  30920. f = E - p,
  30921. s > N(I / f) && r("overflow"),
  30922. s *= f;
  30923. t = g.length + 1,
  30924. y = u(v - a, t, 0 == a),
  30925. N(v / t) > I - A && r("overflow"),
  30926. A += N(v / t),
  30927. v %= t,
  30928. g.splice(v++, 0, A)
  30929. }
  30930. return l(g)
  30931. }
  30932. function p(e) {
  30933. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  30934. for (e = s(e),
  30935. m = e.length,
  30936. t = S,
  30937. i = 0,
  30938. a = x,
  30939. l = 0; l < m; ++l)
  30940. g = e[l],
  30941. g < 128 && C.push(B(g));
  30942. for (n = o = C.length,
  30943. o && C.push(M); n < m; ) {
  30944. for (c = I,
  30945. l = 0; l < m; ++l)
  30946. g = e[l],
  30947. g >= t && g < c && (c = g);
  30948. for (v = n + 1,
  30949. c - t > N((I - i) / v) && r("overflow"),
  30950. i += (c - t) * v,
  30951. t = c,
  30952. l = 0; l < m; ++l)
  30953. if (g = e[l],
  30954. g < t && ++i > I && r("overflow"),
  30955. g == t) {
  30956. for (d = i,
  30957. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  30958. !(d < f); p += E)
  30959. y = d - f,
  30960. A = E - f,
  30961. C.push(B(h(f + y % A, 0))),
  30962. d = N(y / A);
  30963. C.push(B(h(d, 0))),
  30964. a = u(i, v, n == o),
  30965. i = 0,
  30966. ++n
  30967. }
  30968. ++i,
  30969. ++t
  30970. }
  30971. return C.join("")
  30972. }
  30973. function f(e) {
  30974. return a(e, function(e) {
  30975. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  30976. })
  30977. }
  30978. function g(e) {
  30979. return a(e, function(e) {
  30980. return P.test(e) ? "xn--" + p(e) : e
  30981. })
  30982. }
  30983. var m = "object" == typeof i && i && !i.nodeType && i
  30984. , v = "object" == typeof t && t && !t.nodeType && t
  30985. , A = "object" == typeof e && e;
  30986. A.global !== A && A.window !== A && A.self !== A || (n = A);
  30987. var y, C, I = 2147483647, E = 36, b = 1, w = 26, _ = 38, T = 700, x = 72, S = 128, M = "-", R = /^xn--/, P = /[^\x20-\x7E]/, O = /[\x2E\u3002\uFF0E\uFF61]/g, L = {
  30988. overflow: "Overflow: input needs wider integers to process",
  30989. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30990. "invalid-input": "Invalid input"
  30991. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  30992. if (y = {
  30993. version: "1.4.1",
  30994. ucs2: {
  30995. decode: s,
  30996. encode: l
  30997. },
  30998. decode: d,
  30999. encode: p,
  31000. toASCII: g,
  31001. toUnicode: f
  31002. },
  31003. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31004. define("punycode", function() {
  31005. return y
  31006. });
  31007. else if (m && v)
  31008. if (t.exports == m)
  31009. v.exports = y;
  31010. else
  31011. for (C in y)
  31012. y.hasOwnProperty(C) && (m[C] = y[C]);
  31013. else
  31014. n.punycode = y
  31015. }(this)
  31016. }
  31017. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31018. }
  31019. , {}],
  31020. 205: [function(e, t, i) {
  31021. "use strict";
  31022. function n(e, t) {
  31023. return Object.prototype.hasOwnProperty.call(e, t)
  31024. }
  31025. t.exports = function(e, t, i, o) {
  31026. t = t || "&",
  31027. i = i || "=";
  31028. var a = {};
  31029. if ("string" != typeof e || 0 === e.length)
  31030. return a;
  31031. var s = /\+/g;
  31032. e = e.split(t);
  31033. var l = 1e3;
  31034. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  31035. var c = e.length;
  31036. l > 0 && c > l && (c = l);
  31037. for (var h = 0; h < c; ++h) {
  31038. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  31039. m >= 0 ? (u = g.substr(0, m),
  31040. d = g.substr(m + 1)) : (u = g,
  31041. d = ""),
  31042. p = decodeURIComponent(u),
  31043. f = decodeURIComponent(d),
  31044. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  31045. }
  31046. return a
  31047. }
  31048. ;
  31049. var r = Array.isArray || function(e) {
  31050. return "[object Array]" === Object.prototype.toString.call(e)
  31051. }
  31052. }
  31053. , {}],
  31054. 206: [function(e, t, i) {
  31055. "use strict";
  31056. function n(e, t) {
  31057. if (e.map)
  31058. return e.map(t);
  31059. for (var i = [], n = 0; n < e.length; n++)
  31060. i.push(t(e[n], n));
  31061. return i
  31062. }
  31063. var r = function(e) {
  31064. switch (typeof e) {
  31065. case "string":
  31066. return e;
  31067. case "boolean":
  31068. return e ? "true" : "false";
  31069. case "number":
  31070. return isFinite(e) ? e : "";
  31071. default:
  31072. return ""
  31073. }
  31074. };
  31075. t.exports = function(e, t, i, s) {
  31076. return t = t || "&",
  31077. i = i || "=",
  31078. null === e && (e = void 0),
  31079. "object" == typeof e ? n(a(e), function(a) {
  31080. var s = encodeURIComponent(r(a)) + i;
  31081. return o(e[a]) ? n(e[a], function(e) {
  31082. return s + encodeURIComponent(r(e))
  31083. }).join(t) : s + encodeURIComponent(r(e[a]))
  31084. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  31085. }
  31086. ;
  31087. var o = Array.isArray || function(e) {
  31088. return "[object Array]" === Object.prototype.toString.call(e)
  31089. }
  31090. , a = Object.keys || function(e) {
  31091. var t = [];
  31092. for (var i in e)
  31093. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31094. return t
  31095. }
  31096. }
  31097. , {}],
  31098. 207: [function(e, t, i) {
  31099. "use strict";
  31100. i.decode = i.parse = e("./decode"),
  31101. i.encode = i.stringify = e("./encode")
  31102. }
  31103. , {
  31104. "./decode": 205,
  31105. "./encode": 206
  31106. }],
  31107. 208: [function(e, t, i) {
  31108. "use strict";
  31109. function n() {
  31110. this.protocol = null,
  31111. this.slashes = null,
  31112. this.auth = null,
  31113. this.host = null,
  31114. this.port = null,
  31115. this.hostname = null,
  31116. this.hash = null,
  31117. this.search = null,
  31118. this.query = null,
  31119. this.pathname = null,
  31120. this.path = null,
  31121. this.href = null
  31122. }
  31123. function r(e, t, i) {
  31124. if (e && c.isObject(e) && e instanceof n)
  31125. return e;
  31126. var r = new n;
  31127. return r.parse(e, t, i),
  31128. r
  31129. }
  31130. function o(e) {
  31131. return c.isString(e) && (e = r(e)),
  31132. e instanceof n ? e.format() : n.prototype.format.call(e)
  31133. }
  31134. function a(e, t) {
  31135. return r(e, !1, !0).resolve(t)
  31136. }
  31137. function s(e, t) {
  31138. return e ? r(e, !1, !0).resolveObject(t) : t
  31139. }
  31140. var l = e("punycode")
  31141. , c = e("./util");
  31142. i.parse = r,
  31143. i.resolve = a,
  31144. i.resolveObject = s,
  31145. i.format = o,
  31146. i.Url = n;
  31147. var h = /^([a-z0-9.+-]+:)/i
  31148. , u = /:[0-9]*$/
  31149. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31150. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  31151. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  31152. , g = ["'"].concat(f)
  31153. , m = ["%", "/", "?", ";", "#"].concat(g)
  31154. , v = ["/", "?", "#"]
  31155. , A = 255
  31156. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  31157. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31158. , I = {
  31159. javascript: !0,
  31160. "javascript:": !0
  31161. }
  31162. , E = {
  31163. javascript: !0,
  31164. "javascript:": !0
  31165. }
  31166. , b = {
  31167. http: !0,
  31168. https: !0,
  31169. ftp: !0,
  31170. gopher: !0,
  31171. file: !0,
  31172. "http:": !0,
  31173. "https:": !0,
  31174. "ftp:": !0,
  31175. "gopher:": !0,
  31176. "file:": !0
  31177. }
  31178. , w = e("querystring");
  31179. n.prototype.parse = function(e, t, i) {
  31180. if (!c.isString(e))
  31181. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31182. var n = e.indexOf("?")
  31183. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  31184. , o = e.split(r)
  31185. , a = /\\/g;
  31186. o[0] = o[0].replace(a, "/"),
  31187. e = o.join(r);
  31188. var s = e;
  31189. if (s = s.trim(),
  31190. !i && 1 === e.split("#").length) {
  31191. var u = d.exec(s);
  31192. if (u)
  31193. return this.path = s,
  31194. this.href = s,
  31195. this.pathname = u[1],
  31196. u[2] ? (this.search = u[2],
  31197. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  31198. this.query = {}),
  31199. this
  31200. }
  31201. var p = h.exec(s);
  31202. if (p) {
  31203. p = p[0];
  31204. var f = p.toLowerCase();
  31205. this.protocol = f,
  31206. s = s.substr(p.length)
  31207. }
  31208. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31209. var _ = "//" === s.substr(0, 2);
  31210. !_ || p && E[p] || (s = s.substr(2),
  31211. this.slashes = !0)
  31212. }
  31213. if (!E[p] && (_ || p && !b[p])) {
  31214. for (var T = -1, x = 0; x < v.length; x++) {
  31215. var S = s.indexOf(v[x]);
  31216. S !== -1 && (T === -1 || S < T) && (T = S)
  31217. }
  31218. var M, R;
  31219. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  31220. R !== -1 && (M = s.slice(0, R),
  31221. s = s.slice(R + 1),
  31222. this.auth = decodeURIComponent(M)),
  31223. T = -1;
  31224. for (var x = 0; x < m.length; x++) {
  31225. var S = s.indexOf(m[x]);
  31226. S !== -1 && (T === -1 || S < T) && (T = S)
  31227. }
  31228. T === -1 && (T = s.length),
  31229. this.host = s.slice(0, T),
  31230. s = s.slice(T),
  31231. this.parseHost(),
  31232. this.hostname = this.hostname || "";
  31233. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31234. if (!P)
  31235. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  31236. var D = O[x];
  31237. if (D && !D.match(y)) {
  31238. for (var N = "", B = 0, F = D.length; B < F; B++)
  31239. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  31240. if (!N.match(y)) {
  31241. var V = O.slice(0, x)
  31242. , U = O.slice(x + 1)
  31243. , k = D.match(C);
  31244. k && (V.push(k[1]),
  31245. U.unshift(k[2])),
  31246. U.length && (s = "/" + U.join(".") + s),
  31247. this.hostname = V.join(".");
  31248. break
  31249. }
  31250. }
  31251. }
  31252. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31253. P || (this.hostname = l.toASCII(this.hostname));
  31254. var H = this.port ? ":" + this.port : ""
  31255. , G = this.hostname || "";
  31256. this.host = G + H,
  31257. this.href += this.host,
  31258. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31259. "/" !== s[0] && (s = "/" + s))
  31260. }
  31261. if (!I[f])
  31262. for (var x = 0, L = g.length; x < L; x++) {
  31263. var z = g[x];
  31264. if (s.indexOf(z) !== -1) {
  31265. var W = encodeURIComponent(z);
  31266. W === z && (W = escape(z)),
  31267. s = s.split(z).join(W)
  31268. }
  31269. }
  31270. var j = s.indexOf("#");
  31271. j !== -1 && (this.hash = s.substr(j),
  31272. s = s.slice(0, j));
  31273. var Y = s.indexOf("?");
  31274. if (Y !== -1 ? (this.search = s.substr(Y),
  31275. this.query = s.substr(Y + 1),
  31276. t && (this.query = w.parse(this.query)),
  31277. s = s.slice(0, Y)) : t && (this.search = "",
  31278. this.query = {}),
  31279. s && (this.pathname = s),
  31280. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  31281. this.pathname || this.search) {
  31282. var H = this.pathname || ""
  31283. , X = this.search || "";
  31284. this.path = H + X
  31285. }
  31286. return this.href = this.format(),
  31287. this
  31288. }
  31289. ,
  31290. n.prototype.format = function() {
  31291. var e = this.auth || "";
  31292. e && (e = encodeURIComponent(e),
  31293. e = e.replace(/%3A/i, ":"),
  31294. e += "@");
  31295. var t = this.protocol || ""
  31296. , i = this.pathname || ""
  31297. , n = this.hash || ""
  31298. , r = !1
  31299. , o = "";
  31300. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  31301. this.port && (r += ":" + this.port)),
  31302. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  31303. var a = this.search || o && "?" + o || "";
  31304. return t && ":" !== t.substr(-1) && (t += ":"),
  31305. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  31306. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  31307. n && "#" !== n.charAt(0) && (n = "#" + n),
  31308. a && "?" !== a.charAt(0) && (a = "?" + a),
  31309. i = i.replace(/[?#]/g, function(e) {
  31310. return encodeURIComponent(e)
  31311. }),
  31312. a = a.replace("#", "%23"),
  31313. t + r + i + a + n
  31314. }
  31315. ,
  31316. n.prototype.resolve = function(e) {
  31317. return this.resolveObject(r(e, !1, !0)).format()
  31318. }
  31319. ,
  31320. n.prototype.resolveObject = function(e) {
  31321. if (c.isString(e)) {
  31322. var t = new n;
  31323. t.parse(e, !1, !0),
  31324. e = t
  31325. }
  31326. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  31327. var a = r[o];
  31328. i[a] = this[a]
  31329. }
  31330. if (i.hash = e.hash,
  31331. "" === e.href)
  31332. return i.href = i.format(),
  31333. i;
  31334. if (e.slashes && !e.protocol) {
  31335. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  31336. var h = s[l];
  31337. "protocol" !== h && (i[h] = e[h])
  31338. }
  31339. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31340. i.href = i.format(),
  31341. i
  31342. }
  31343. if (e.protocol && e.protocol !== i.protocol) {
  31344. if (!b[e.protocol]) {
  31345. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  31346. var p = u[d];
  31347. i[p] = e[p]
  31348. }
  31349. return i.href = i.format(),
  31350. i
  31351. }
  31352. if (i.protocol = e.protocol,
  31353. e.host || E[e.protocol])
  31354. i.pathname = e.pathname;
  31355. else {
  31356. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  31357. ;
  31358. e.host || (e.host = ""),
  31359. e.hostname || (e.hostname = ""),
  31360. "" !== f[0] && f.unshift(""),
  31361. f.length < 2 && f.unshift(""),
  31362. i.pathname = f.join("/")
  31363. }
  31364. if (i.search = e.search,
  31365. i.query = e.query,
  31366. i.host = e.host || "",
  31367. i.auth = e.auth,
  31368. i.hostname = e.hostname || e.host,
  31369. i.port = e.port,
  31370. i.pathname || i.search) {
  31371. var g = i.pathname || ""
  31372. , m = i.search || "";
  31373. i.path = g + m
  31374. }
  31375. return i.slashes = i.slashes || e.slashes,
  31376. i.href = i.format(),
  31377. i
  31378. }
  31379. var v = i.pathname && "/" === i.pathname.charAt(0)
  31380. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31381. , y = A || v || i.host && e.pathname
  31382. , C = y
  31383. , I = i.pathname && i.pathname.split("/") || []
  31384. , f = e.pathname && e.pathname.split("/") || []
  31385. , w = i.protocol && !b[i.protocol];
  31386. if (w && (i.hostname = "",
  31387. i.port = null,
  31388. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  31389. i.host = "",
  31390. e.protocol && (e.hostname = null,
  31391. e.port = null,
  31392. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  31393. e.host = null),
  31394. y = y && ("" === f[0] || "" === I[0])),
  31395. A)
  31396. i.host = e.host || "" === e.host ? e.host : i.host,
  31397. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31398. i.search = e.search,
  31399. i.query = e.query,
  31400. I = f;
  31401. else if (f.length)
  31402. I || (I = []),
  31403. I.pop(),
  31404. I = I.concat(f),
  31405. i.search = e.search,
  31406. i.query = e.query;
  31407. else if (!c.isNullOrUndefined(e.search)) {
  31408. if (w) {
  31409. i.hostname = i.host = I.shift();
  31410. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  31411. _ && (i.auth = _.shift(),
  31412. i.host = i.hostname = _.shift())
  31413. }
  31414. return i.search = e.search,
  31415. i.query = e.query,
  31416. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31417. i.href = i.format(),
  31418. i
  31419. }
  31420. if (!I.length)
  31421. return i.pathname = null,
  31422. i.search ? i.path = "/" + i.search : i.path = null,
  31423. i.href = i.format(),
  31424. i;
  31425. for (var T = I.slice(-1)[0], x = (i.host || e.host || I.length > 1) && ("." === T || ".." === T) || "" === T, S = 0, M = I.length; M >= 0; M--)
  31426. T = I[M],
  31427. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  31428. S++) : S && (I.splice(M, 1),
  31429. S--);
  31430. if (!y && !C)
  31431. for (; S--; S)
  31432. I.unshift("..");
  31433. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  31434. x && "/" !== I.join("/").substr(-1) && I.push("");
  31435. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  31436. if (w) {
  31437. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  31438. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  31439. _ && (i.auth = _.shift(),
  31440. i.host = i.hostname = _.shift())
  31441. }
  31442. return y = y || i.host && I.length,
  31443. y && !R && I.unshift(""),
  31444. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  31445. i.path = null),
  31446. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31447. i.auth = e.auth || i.auth,
  31448. i.slashes = i.slashes || e.slashes,
  31449. i.href = i.format(),
  31450. i
  31451. }
  31452. ,
  31453. n.prototype.parseHost = function() {
  31454. var e = this.host
  31455. , t = u.exec(e);
  31456. t && (t = t[0],
  31457. ":" !== t && (this.port = t.substr(1)),
  31458. e = e.substr(0, e.length - t.length)),
  31459. e && (this.hostname = e)
  31460. }
  31461. }
  31462. , {
  31463. "./util": 209,
  31464. punycode: 204,
  31465. querystring: 207
  31466. }],
  31467. 209: [function(e, t, i) {
  31468. "use strict";
  31469. t.exports = {
  31470. isString: function(e) {
  31471. return "string" == typeof e
  31472. },
  31473. isObject: function(e) {
  31474. return "object" == typeof e && null !== e
  31475. },
  31476. isNull: function(e) {
  31477. return null === e
  31478. },
  31479. isNullOrUndefined: function(e) {
  31480. return null == e
  31481. }
  31482. }
  31483. }
  31484. , {}],
  31485. 210: [function(e, t, i) {
  31486. "use strict";
  31487. function n(e) {
  31488. return l + e
  31489. }
  31490. function r(e) {
  31491. return e.substring(l.length)
  31492. }
  31493. function o(e, t) {
  31494. for (var i in t)
  31495. Object.defineProperty(e, i, {
  31496. value: t[i],
  31497. configurable: !0,
  31498. writable: !0
  31499. })
  31500. }
  31501. function a(e) {
  31502. if ("string" != typeof e)
  31503. throw new TypeError("key must be a string.")
  31504. }
  31505. var s = Object.prototype.hasOwnProperty
  31506. , l = "~";
  31507. t.exports = function(e) {
  31508. var t = Object.create(null)
  31509. , i = 0
  31510. , l = {};
  31511. return o(l, {
  31512. get: function(e, i) {
  31513. a(e);
  31514. var r = n(e);
  31515. return r in t ? t[r] : i
  31516. },
  31517. set: function(e, r) {
  31518. a(e);
  31519. var o = n(e);
  31520. return o in t || ++i,
  31521. t[o] = r
  31522. },
  31523. has: function(e) {
  31524. return a(e),
  31525. n(e)in t
  31526. },
  31527. delete: function(e) {
  31528. a(e);
  31529. var r = n(e);
  31530. return r in t && (--i,
  31531. delete t[r],
  31532. !0)
  31533. },
  31534. clear: function() {
  31535. t = Object.create(null),
  31536. i = 0
  31537. },
  31538. forEach: function(e, i) {
  31539. if ("function" != typeof e)
  31540. throw new TypeError("`callback` must be a function");
  31541. for (var n in t)
  31542. if (s.call(t, n)) {
  31543. var o = r(n)
  31544. , a = t[n];
  31545. e.call(i, a, o, l)
  31546. }
  31547. }
  31548. }),
  31549. Object.defineProperty(l, "size", {
  31550. get: function() {
  31551. return i
  31552. },
  31553. configurable: !0
  31554. }),
  31555. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  31556. l.set(t, e[t])
  31557. }),
  31558. l
  31559. }
  31560. }
  31561. , {}],
  31562. 211: [function(e, t, i) {
  31563. t.exports = e("./lib/heap")
  31564. }
  31565. , {
  31566. "./lib/heap": 212
  31567. }],
  31568. 212: [function(e, t, i) {
  31569. (function() {
  31570. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  31571. r = Math.floor,
  31572. u = Math.min,
  31573. n = function(e, t) {
  31574. return e < t ? -1 : e > t ? 1 : 0
  31575. }
  31576. ,
  31577. h = function(e, t, i, o, a) {
  31578. var s;
  31579. if (null == i && (i = 0),
  31580. null == a && (a = n),
  31581. i < 0)
  31582. throw new Error("lo must be non-negative");
  31583. for (null == o && (o = e.length); i < o; )
  31584. s = r((i + o) / 2),
  31585. a(t, e[s]) < 0 ? o = s : i = s + 1;
  31586. return [].splice.apply(e, [i, i - i].concat(t)),
  31587. t
  31588. }
  31589. ,
  31590. s = function(e, t, i) {
  31591. return null == i && (i = n),
  31592. e.push(t),
  31593. g(e, 0, e.length - 1, i)
  31594. }
  31595. ,
  31596. a = function(e, t) {
  31597. var i, r;
  31598. return null == t && (t = n),
  31599. i = e.pop(),
  31600. e.length ? (r = e[0],
  31601. e[0] = i,
  31602. m(e, 0, t)) : r = i,
  31603. r
  31604. }
  31605. ,
  31606. c = function(e, t, i) {
  31607. var r;
  31608. return null == i && (i = n),
  31609. r = e[0],
  31610. e[0] = t,
  31611. m(e, 0, i),
  31612. r
  31613. }
  31614. ,
  31615. l = function(e, t, i) {
  31616. var r;
  31617. return null == i && (i = n),
  31618. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  31619. t = r[0],
  31620. e[0] = r[1],
  31621. m(e, 0, i)),
  31622. t
  31623. }
  31624. ,
  31625. o = function(e, t) {
  31626. var i, o, a, s, l, c;
  31627. for (null == t && (t = n),
  31628. s = function() {
  31629. c = [];
  31630. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  31631. c.push(t);
  31632. return c
  31633. }
  31634. .apply(this).reverse(),
  31635. l = [],
  31636. o = 0,
  31637. a = s.length; o < a; o++)
  31638. i = s[o],
  31639. l.push(m(e, i, t));
  31640. return l
  31641. }
  31642. ,
  31643. f = function(e, t, i) {
  31644. var r;
  31645. if (null == i && (i = n),
  31646. r = e.indexOf(t),
  31647. r !== -1)
  31648. return g(e, 0, r, i),
  31649. m(e, r, i)
  31650. }
  31651. ,
  31652. d = function(e, t, i) {
  31653. var r, a, s, c, h;
  31654. if (null == i && (i = n),
  31655. a = e.slice(0, t),
  31656. !a.length)
  31657. return a;
  31658. for (o(a, i),
  31659. h = e.slice(t),
  31660. s = 0,
  31661. c = h.length; s < c; s++)
  31662. r = h[s],
  31663. l(a, r, i);
  31664. return a.sort(i).reverse()
  31665. }
  31666. ,
  31667. p = function(e, t, i) {
  31668. var r, s, l, c, d, p, f, g, m, v;
  31669. if (null == i && (i = n),
  31670. 10 * t <= e.length) {
  31671. if (c = e.slice(0, t).sort(i),
  31672. !c.length)
  31673. return c;
  31674. for (l = c[c.length - 1],
  31675. g = e.slice(t),
  31676. d = 0,
  31677. f = g.length; d < f; d++)
  31678. r = g[d],
  31679. i(r, l) < 0 && (h(c, r, 0, null, i),
  31680. c.pop(),
  31681. l = c[c.length - 1]);
  31682. return c
  31683. }
  31684. for (o(e, i),
  31685. v = [],
  31686. s = p = 0,
  31687. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  31688. v.push(a(e, i));
  31689. return v
  31690. }
  31691. ,
  31692. g = function(e, t, i, r) {
  31693. var o, a, s;
  31694. for (null == r && (r = n),
  31695. o = e[i]; i > t && (s = i - 1 >> 1,
  31696. a = e[s],
  31697. r(o, a) < 0); )
  31698. e[i] = a,
  31699. i = s;
  31700. return e[i] = o
  31701. }
  31702. ,
  31703. m = function(e, t, i) {
  31704. var r, o, a, s, l;
  31705. for (null == i && (i = n),
  31706. o = e.length,
  31707. l = t,
  31708. a = e[t],
  31709. r = 2 * t + 1; r < o; )
  31710. s = r + 1,
  31711. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  31712. e[t] = e[r],
  31713. t = r,
  31714. r = 2 * t + 1;
  31715. return e[t] = a,
  31716. g(e, l, t, i)
  31717. }
  31718. ,
  31719. e = function() {
  31720. function e(e) {
  31721. this.cmp = null != e ? e : n,
  31722. this.nodes = []
  31723. }
  31724. return e.push = s,
  31725. e.pop = a,
  31726. e.replace = c,
  31727. e.pushpop = l,
  31728. e.heapify = o,
  31729. e.updateItem = f,
  31730. e.nlargest = d,
  31731. e.nsmallest = p,
  31732. e.prototype.push = function(e) {
  31733. return s(this.nodes, e, this.cmp)
  31734. }
  31735. ,
  31736. e.prototype.pop = function() {
  31737. return a(this.nodes, this.cmp)
  31738. }
  31739. ,
  31740. e.prototype.peek = function() {
  31741. return this.nodes[0]
  31742. }
  31743. ,
  31744. e.prototype.contains = function(e) {
  31745. return this.nodes.indexOf(e) !== -1
  31746. }
  31747. ,
  31748. e.prototype.replace = function(e) {
  31749. return c(this.nodes, e, this.cmp)
  31750. }
  31751. ,
  31752. e.prototype.pushpop = function(e) {
  31753. return l(this.nodes, e, this.cmp)
  31754. }
  31755. ,
  31756. e.prototype.heapify = function() {
  31757. return o(this.nodes, this.cmp)
  31758. }
  31759. ,
  31760. e.prototype.updateItem = function(e) {
  31761. return f(this.nodes, e, this.cmp)
  31762. }
  31763. ,
  31764. e.prototype.clear = function() {
  31765. return this.nodes = []
  31766. }
  31767. ,
  31768. e.prototype.empty = function() {
  31769. return 0 === this.nodes.length
  31770. }
  31771. ,
  31772. e.prototype.size = function() {
  31773. return this.nodes.length
  31774. }
  31775. ,
  31776. e.prototype.clone = function() {
  31777. var t;
  31778. return t = new e,
  31779. t.nodes = this.nodes.slice(0),
  31780. t
  31781. }
  31782. ,
  31783. e.prototype.toArray = function() {
  31784. return this.nodes.slice(0)
  31785. }
  31786. ,
  31787. e.prototype.insert = e.prototype.push,
  31788. e.prototype.top = e.prototype.peek,
  31789. e.prototype.front = e.prototype.peek,
  31790. e.prototype.has = e.prototype.contains,
  31791. e.prototype.copy = e.prototype.clone,
  31792. e
  31793. }(),
  31794. function(e, n) {
  31795. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  31796. }(this, function() {
  31797. return e
  31798. })
  31799. }
  31800. ).call(this)
  31801. }
  31802. , {}],
  31803. 213: [function(e, t, i) {
  31804. !function(e) {
  31805. function i() {}
  31806. function n(e, t) {
  31807. return function() {
  31808. e.apply(t, arguments)
  31809. }
  31810. }
  31811. function r(e) {
  31812. if ("object" != typeof this)
  31813. throw new TypeError("Promises must be constructed via new");
  31814. if ("function" != typeof e)
  31815. throw new TypeError("not a function");
  31816. this._state = 0,
  31817. this._handled = !1,
  31818. this._value = void 0,
  31819. this._deferreds = [],
  31820. h(e, this)
  31821. }
  31822. function o(e, t) {
  31823. for (; 3 === e._state; )
  31824. e = e._value;
  31825. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  31826. void r._immediateFn(function() {
  31827. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  31828. if (null === i)
  31829. return void (1 === e._state ? a : s)(t.promise, e._value);
  31830. var n;
  31831. try {
  31832. n = i(e._value)
  31833. } catch (e) {
  31834. return void s(t.promise, e)
  31835. }
  31836. a(t.promise, n)
  31837. }))
  31838. }
  31839. function a(e, t) {
  31840. try {
  31841. if (t === e)
  31842. throw new TypeError("A promise cannot be resolved with itself.");
  31843. if (t && ("object" == typeof t || "function" == typeof t)) {
  31844. var i = t.then;
  31845. if (t instanceof r)
  31846. return e._state = 3,
  31847. e._value = t,
  31848. void l(e);
  31849. if ("function" == typeof i)
  31850. return void h(n(i, t), e)
  31851. }
  31852. e._state = 1,
  31853. e._value = t,
  31854. l(e)
  31855. } catch (t) {
  31856. s(e, t)
  31857. }
  31858. }
  31859. function s(e, t) {
  31860. e._state = 2,
  31861. e._value = t,
  31862. l(e)
  31863. }
  31864. function l(e) {
  31865. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  31866. e._handled || r._unhandledRejectionFn(e._value)
  31867. });
  31868. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31869. o(e, e._deferreds[t]);
  31870. e._deferreds = null
  31871. }
  31872. function c(e, t, i) {
  31873. this.onFulfilled = "function" == typeof e ? e : null,
  31874. this.onRejected = "function" == typeof t ? t : null,
  31875. this.promise = i
  31876. }
  31877. function h(e, t) {
  31878. var i = !1;
  31879. try {
  31880. e(function(e) {
  31881. i || (i = !0,
  31882. a(t, e))
  31883. }, function(e) {
  31884. i || (i = !0,
  31885. s(t, e))
  31886. })
  31887. } catch (e) {
  31888. if (i)
  31889. return;
  31890. i = !0,
  31891. s(t, e)
  31892. }
  31893. }
  31894. var u = setTimeout;
  31895. r.prototype.catch = function(e) {
  31896. return this.then(null, e)
  31897. }
  31898. ,
  31899. r.prototype.then = function(e, t) {
  31900. var n = new this.constructor(i);
  31901. return o(this, new c(e,t,n)),
  31902. n
  31903. }
  31904. ,
  31905. r.all = function(e) {
  31906. var t = Array.prototype.slice.call(e);
  31907. return new r(function(e, i) {
  31908. function n(o, a) {
  31909. try {
  31910. if (a && ("object" == typeof a || "function" == typeof a)) {
  31911. var s = a.then;
  31912. if ("function" == typeof s)
  31913. return void s.call(a, function(e) {
  31914. n(o, e)
  31915. }, i)
  31916. }
  31917. t[o] = a,
  31918. 0 === --r && e(t)
  31919. } catch (e) {
  31920. i(e)
  31921. }
  31922. }
  31923. if (0 === t.length)
  31924. return e([]);
  31925. for (var r = t.length, o = 0; o < t.length; o++)
  31926. n(o, t[o])
  31927. }
  31928. )
  31929. }
  31930. ,
  31931. r.resolve = function(e) {
  31932. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  31933. t(e)
  31934. }
  31935. )
  31936. }
  31937. ,
  31938. r.reject = function(e) {
  31939. return new r(function(t, i) {
  31940. i(e)
  31941. }
  31942. )
  31943. }
  31944. ,
  31945. r.race = function(e) {
  31946. return new r(function(t, i) {
  31947. for (var n = 0, r = e.length; n < r; n++)
  31948. e[n].then(t, i)
  31949. }
  31950. )
  31951. }
  31952. ,
  31953. r._immediateFn = "function" == typeof setImmediate && function(e) {
  31954. setImmediate(e)
  31955. }
  31956. || function(e) {
  31957. u(e, 0)
  31958. }
  31959. ,
  31960. r._unhandledRejectionFn = function(e) {
  31961. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31962. }
  31963. ,
  31964. r._setImmediateFn = function(e) {
  31965. r._immediateFn = e
  31966. }
  31967. ,
  31968. r._setUnhandledRejectionFn = function(e) {
  31969. r._unhandledRejectionFn = e
  31970. }
  31971. ,
  31972. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  31973. }(this)
  31974. }
  31975. , {}],
  31976. 214: [function(e, t, i) {
  31977. (function(i) {
  31978. !function(i, n) {
  31979. "function" == typeof define && define.amd ? define(["bytebuffer"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n(e("bytebuffer"), !0) : (i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer)
  31980. }(this, function(t, n) {
  31981. "use strict";
  31982. var r = {};
  31983. return r.ByteBuffer = t,
  31984. r.Long = t.Long || null,
  31985. r.VERSION = "5.0.1",
  31986. r.WIRE_TYPES = {},
  31987. r.WIRE_TYPES.VARINT = 0,
  31988. r.WIRE_TYPES.BITS64 = 1,
  31989. r.WIRE_TYPES.LDELIM = 2,
  31990. r.WIRE_TYPES.STARTGROUP = 3,
  31991. r.WIRE_TYPES.ENDGROUP = 4,
  31992. r.WIRE_TYPES.BITS32 = 5,
  31993. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  31994. r.TYPES = {
  31995. int32: {
  31996. name: "int32",
  31997. wireType: r.WIRE_TYPES.VARINT,
  31998. defaultValue: 0
  31999. },
  32000. uint32: {
  32001. name: "uint32",
  32002. wireType: r.WIRE_TYPES.VARINT,
  32003. defaultValue: 0
  32004. },
  32005. sint32: {
  32006. name: "sint32",
  32007. wireType: r.WIRE_TYPES.VARINT,
  32008. defaultValue: 0
  32009. },
  32010. int64: {
  32011. name: "int64",
  32012. wireType: r.WIRE_TYPES.VARINT,
  32013. defaultValue: r.Long ? r.Long.ZERO : void 0
  32014. },
  32015. uint64: {
  32016. name: "uint64",
  32017. wireType: r.WIRE_TYPES.VARINT,
  32018. defaultValue: r.Long ? r.Long.UZERO : void 0
  32019. },
  32020. sint64: {
  32021. name: "sint64",
  32022. wireType: r.WIRE_TYPES.VARINT,
  32023. defaultValue: r.Long ? r.Long.ZERO : void 0
  32024. },
  32025. bool: {
  32026. name: "bool",
  32027. wireType: r.WIRE_TYPES.VARINT,
  32028. defaultValue: !1
  32029. },
  32030. double: {
  32031. name: "double",
  32032. wireType: r.WIRE_TYPES.BITS64,
  32033. defaultValue: 0
  32034. },
  32035. string: {
  32036. name: "string",
  32037. wireType: r.WIRE_TYPES.LDELIM,
  32038. defaultValue: ""
  32039. },
  32040. bytes: {
  32041. name: "bytes",
  32042. wireType: r.WIRE_TYPES.LDELIM,
  32043. defaultValue: null
  32044. },
  32045. fixed32: {
  32046. name: "fixed32",
  32047. wireType: r.WIRE_TYPES.BITS32,
  32048. defaultValue: 0
  32049. },
  32050. sfixed32: {
  32051. name: "sfixed32",
  32052. wireType: r.WIRE_TYPES.BITS32,
  32053. defaultValue: 0
  32054. },
  32055. fixed64: {
  32056. name: "fixed64",
  32057. wireType: r.WIRE_TYPES.BITS64,
  32058. defaultValue: r.Long ? r.Long.UZERO : void 0
  32059. },
  32060. sfixed64: {
  32061. name: "sfixed64",
  32062. wireType: r.WIRE_TYPES.BITS64,
  32063. defaultValue: r.Long ? r.Long.ZERO : void 0
  32064. },
  32065. float: {
  32066. name: "float",
  32067. wireType: r.WIRE_TYPES.BITS32,
  32068. defaultValue: 0
  32069. },
  32070. enum: {
  32071. name: "enum",
  32072. wireType: r.WIRE_TYPES.VARINT,
  32073. defaultValue: 0
  32074. },
  32075. message: {
  32076. name: "message",
  32077. wireType: r.WIRE_TYPES.LDELIM,
  32078. defaultValue: null
  32079. },
  32080. group: {
  32081. name: "group",
  32082. wireType: r.WIRE_TYPES.STARTGROUP,
  32083. defaultValue: null
  32084. }
  32085. },
  32086. r.MAP_KEY_TYPES = [r.TYPES.int32, r.TYPES.sint32, r.TYPES.sfixed32, r.TYPES.uint32, r.TYPES.fixed32, r.TYPES.int64, r.TYPES.sint64, r.TYPES.sfixed64, r.TYPES.uint64, r.TYPES.fixed64, r.TYPES.bool, r.TYPES.string, r.TYPES.bytes],
  32087. r.ID_MIN = 1,
  32088. r.ID_MAX = 536870911,
  32089. r.convertFieldsToCamelCase = !1,
  32090. r.populateAccessors = !0,
  32091. r.populateDefaults = !0,
  32092. r.Util = function() {
  32093. var t = {};
  32094. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  32095. t.XHR = function() {
  32096. for (var e = [function() {
  32097. return new XMLHttpRequest
  32098. }
  32099. , function() {
  32100. return new ActiveXObject("Msxml2.XMLHTTP")
  32101. }
  32102. , function() {
  32103. return new ActiveXObject("Msxml3.XMLHTTP")
  32104. }
  32105. , function() {
  32106. return new ActiveXObject("Microsoft.XMLHTTP")
  32107. }
  32108. ], t = null, i = 0; i < e.length; i++) {
  32109. try {
  32110. t = e[i]()
  32111. } catch (e) {
  32112. continue
  32113. }
  32114. break
  32115. }
  32116. if (!t)
  32117. throw Error("XMLHttpRequest is not supported");
  32118. return t
  32119. }
  32120. ,
  32121. t.fetch = function(i, n) {
  32122. if (n && "function" != typeof n && (n = null),
  32123. t.IS_NODE) {
  32124. var r = e("fs");
  32125. if (n)
  32126. r.readFile(i, function(e, t) {
  32127. n(e ? null : "" + t)
  32128. });
  32129. else
  32130. try {
  32131. return r.readFileSync(i)
  32132. } catch (e) {
  32133. return null
  32134. }
  32135. } else {
  32136. var o = t.XHR();
  32137. if (o.open("GET", i, !!n),
  32138. o.setRequestHeader("Accept", "text/plain"),
  32139. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  32140. !n)
  32141. return o.send(null),
  32142. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  32143. if (o.onreadystatechange = function() {
  32144. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  32145. }
  32146. ,
  32147. 4 == o.readyState)
  32148. return;
  32149. o.send(null)
  32150. }
  32151. }
  32152. ,
  32153. t.toCamelCase = function(e) {
  32154. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32155. return t.toUpperCase()
  32156. })
  32157. }
  32158. ,
  32159. t
  32160. }(),
  32161. r.Lang = {
  32162. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32163. RULE: /^(?:required|optional|repeated|map)$/,
  32164. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32165. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32166. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32167. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32168. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32169. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32170. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32171. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32172. NUMBER_OCT: /^0[0-7]+$/,
  32173. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32174. BOOL: /^(?:true|false)$/i,
  32175. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32176. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32177. WHITESPACE: /\s/,
  32178. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32179. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32180. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32181. },
  32182. r.DotProto = function(e, t) {
  32183. function i(e, i) {
  32184. var n = -1
  32185. , r = 1;
  32186. if ("-" == e.charAt(0) && (r = -1,
  32187. e = e.substring(1)),
  32188. t.NUMBER_DEC.test(e))
  32189. n = parseInt(e);
  32190. else if (t.NUMBER_HEX.test(e))
  32191. n = parseInt(e.substring(2), 16);
  32192. else {
  32193. if (!t.NUMBER_OCT.test(e))
  32194. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  32195. n = parseInt(e.substring(1), 8)
  32196. }
  32197. if (n = r * n | 0,
  32198. !i && n < 0)
  32199. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  32200. return n
  32201. }
  32202. function n(e) {
  32203. var i = 1;
  32204. if ("-" == e.charAt(0) && (i = -1,
  32205. e = e.substring(1)),
  32206. t.NUMBER_DEC.test(e))
  32207. return i * parseInt(e, 10);
  32208. if (t.NUMBER_HEX.test(e))
  32209. return i * parseInt(e.substring(2), 16);
  32210. if (t.NUMBER_OCT.test(e))
  32211. return i * parseInt(e.substring(1), 8);
  32212. if ("inf" === e)
  32213. return i * (1 / 0);
  32214. if ("nan" === e)
  32215. return NaN;
  32216. if (t.NUMBER_FLT.test(e))
  32217. return i * parseFloat(e);
  32218. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  32219. }
  32220. function r(e, t, i) {
  32221. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32222. e[t].push(i))
  32223. }
  32224. var o = {}
  32225. , a = function(e) {
  32226. this.source = e + "",
  32227. this.index = 0,
  32228. this.line = 1,
  32229. this.stack = [],
  32230. this._stringOpen = null
  32231. }
  32232. , s = a.prototype;
  32233. s._readString = function() {
  32234. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  32235. e.lastIndex = this.index - 1;
  32236. var i = e.exec(this.source);
  32237. if (!i)
  32238. throw Error("unterminated string");
  32239. return this.index = e.lastIndex,
  32240. this.stack.push(this._stringOpen),
  32241. this._stringOpen = null,
  32242. i[1]
  32243. }
  32244. ,
  32245. s.next = function() {
  32246. if (this.stack.length > 0)
  32247. return this.stack.shift();
  32248. if (this.index >= this.source.length)
  32249. return null;
  32250. if (null !== this._stringOpen)
  32251. return this._readString();
  32252. var e, i, n;
  32253. do {
  32254. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  32255. if ("\n" === n && ++this.line,
  32256. ++this.index === this.source.length)
  32257. return null;
  32258. if ("/" === this.source.charAt(this.index))
  32259. if (++this.index,
  32260. "/" === this.source.charAt(this.index)) {
  32261. for (; "\n" !== this.source.charAt(++this.index); )
  32262. if (this.index == this.source.length)
  32263. return null;
  32264. ++this.index,
  32265. ++this.line,
  32266. e = !0
  32267. } else {
  32268. if ("*" !== (n = this.source.charAt(this.index)))
  32269. return "/";
  32270. do {
  32271. if ("\n" === n && ++this.line,
  32272. ++this.index === this.source.length)
  32273. return null;
  32274. i = n,
  32275. n = this.source.charAt(this.index)
  32276. } while ("*" !== i || "/" !== n);++this.index,
  32277. e = !0
  32278. }
  32279. } while (e);if (this.index === this.source.length)
  32280. return null;
  32281. var r = this.index;
  32282. t.DELIM.lastIndex = 0;
  32283. var o = t.DELIM.test(this.source.charAt(r++));
  32284. if (!o)
  32285. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  32286. ++r;
  32287. var a = this.source.substring(this.index, this.index = r);
  32288. return '"' !== a && "'" !== a || (this._stringOpen = a),
  32289. a
  32290. }
  32291. ,
  32292. s.peek = function() {
  32293. if (0 === this.stack.length) {
  32294. var e = this.next();
  32295. if (null === e)
  32296. return null;
  32297. this.stack.push(e)
  32298. }
  32299. return this.stack[0]
  32300. }
  32301. ,
  32302. s.skip = function(e) {
  32303. var t = this.next();
  32304. if (t !== e)
  32305. throw Error("illegal '" + t + "', '" + e + "' expected")
  32306. }
  32307. ,
  32308. s.omit = function(e) {
  32309. return this.peek() === e && (this.next(),
  32310. !0)
  32311. }
  32312. ,
  32313. s.toString = function() {
  32314. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32315. }
  32316. ,
  32317. o.Tokenizer = a;
  32318. var l = function(e) {
  32319. this.tn = new a(e),
  32320. this.proto3 = !1
  32321. }
  32322. , c = l.prototype;
  32323. return c.parse = function() {
  32324. var e, i, n = {
  32325. name: "[ROOT]",
  32326. package: null,
  32327. messages: [],
  32328. enums: [],
  32329. imports: [],
  32330. options: {},
  32331. services: []
  32332. }, r = !0;
  32333. try {
  32334. for (; e = this.tn.next(); )
  32335. switch (e) {
  32336. case "package":
  32337. if (!r || null !== n.package)
  32338. throw Error("unexpected 'package'");
  32339. if (e = this.tn.next(),
  32340. !t.TYPEREF.test(e))
  32341. throw Error("illegal package name: " + e);
  32342. this.tn.skip(";"),
  32343. n.package = e;
  32344. break;
  32345. case "import":
  32346. if (!r)
  32347. throw Error("unexpected 'import'");
  32348. e = this.tn.peek(),
  32349. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  32350. e = this._readString(),
  32351. this.tn.skip(";"),
  32352. i || n.imports.push(e);
  32353. break;
  32354. case "syntax":
  32355. if (!r)
  32356. throw Error("unexpected 'syntax'");
  32357. this.tn.skip("="),
  32358. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  32359. this.tn.skip(";");
  32360. break;
  32361. case "message":
  32362. this._parseMessage(n, null),
  32363. r = !1;
  32364. break;
  32365. case "enum":
  32366. this._parseEnum(n),
  32367. r = !1;
  32368. break;
  32369. case "option":
  32370. this._parseOption(n);
  32371. break;
  32372. case "service":
  32373. this._parseService(n);
  32374. break;
  32375. case "extend":
  32376. this._parseExtend(n);
  32377. break;
  32378. default:
  32379. throw Error("unexpected '" + e + "'")
  32380. }
  32381. } catch (e) {
  32382. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32383. e
  32384. }
  32385. return delete n.name,
  32386. n
  32387. }
  32388. ,
  32389. l.parse = function(e) {
  32390. return new l(e).parse()
  32391. }
  32392. ,
  32393. c._readString = function() {
  32394. var e, t, i = "";
  32395. do {
  32396. if (t = this.tn.next(),
  32397. "'" !== t && '"' !== t)
  32398. throw Error("illegal string delimiter: " + t);
  32399. i += this.tn.next(),
  32400. this.tn.skip(t),
  32401. e = this.tn.peek()
  32402. } while ('"' === e || '"' === e);return i
  32403. }
  32404. ,
  32405. c._readValue = function(e) {
  32406. var i = this.tn.peek();
  32407. if ('"' === i || "'" === i)
  32408. return this._readString();
  32409. if (this.tn.next(),
  32410. t.NUMBER.test(i))
  32411. return n(i);
  32412. if (t.BOOL.test(i))
  32413. return "true" === i.toLowerCase();
  32414. if (e && t.TYPEREF.test(i))
  32415. return i;
  32416. throw Error("illegal value: " + i)
  32417. }
  32418. ,
  32419. c._parseOption = function(e, i) {
  32420. var n = this.tn.next()
  32421. , r = !1;
  32422. if ("(" === n && (r = !0,
  32423. n = this.tn.next()),
  32424. !t.TYPEREF.test(n))
  32425. throw Error("illegal option name: " + n);
  32426. var o = n;
  32427. r && (this.tn.skip(")"),
  32428. o = "(" + o + ")",
  32429. n = this.tn.peek(),
  32430. t.FQTYPEREF.test(n) && (o += n,
  32431. this.tn.next())),
  32432. this.tn.skip("="),
  32433. this._parseOptionValue(e, o),
  32434. i || this.tn.skip(";")
  32435. }
  32436. ,
  32437. c._parseOptionValue = function(e, i) {
  32438. var n = this.tn.peek();
  32439. if ("{" !== n)
  32440. r(e.options, i, this._readValue(!0));
  32441. else
  32442. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  32443. if (!t.NAME.test(n))
  32444. throw Error("illegal option name: " + i + "." + n);
  32445. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  32446. }
  32447. }
  32448. ,
  32449. c._parseService = function(e) {
  32450. var i = this.tn.next();
  32451. if (!t.NAME.test(i))
  32452. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  32453. var n = i
  32454. , r = {
  32455. name: n,
  32456. rpc: {},
  32457. options: {}
  32458. };
  32459. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32460. if ("option" === i)
  32461. this._parseOption(r);
  32462. else {
  32463. if ("rpc" !== i)
  32464. throw Error("illegal service token: " + i);
  32465. this._parseServiceRPC(r)
  32466. }
  32467. this.tn.omit(";"),
  32468. e.services.push(r)
  32469. }
  32470. ,
  32471. c._parseServiceRPC = function(e) {
  32472. var i = "rpc"
  32473. , n = this.tn.next();
  32474. if (!t.NAME.test(n))
  32475. throw Error("illegal rpc service method name: " + n);
  32476. var r = n
  32477. , o = {
  32478. request: null,
  32479. response: null,
  32480. request_stream: !1,
  32481. response_stream: !1,
  32482. options: {}
  32483. };
  32484. if (this.tn.skip("("),
  32485. n = this.tn.next(),
  32486. "stream" === n.toLowerCase() && (o.request_stream = !0,
  32487. n = this.tn.next()),
  32488. !t.TYPEREF.test(n))
  32489. throw Error("illegal rpc service request type: " + n);
  32490. if (o.request = n,
  32491. this.tn.skip(")"),
  32492. n = this.tn.next(),
  32493. "returns" !== n.toLowerCase())
  32494. throw Error("illegal rpc service request type delimiter: " + n);
  32495. if (this.tn.skip("("),
  32496. n = this.tn.next(),
  32497. "stream" === n.toLowerCase() && (o.response_stream = !0,
  32498. n = this.tn.next()),
  32499. o.response = n,
  32500. this.tn.skip(")"),
  32501. n = this.tn.peek(),
  32502. "{" === n) {
  32503. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  32504. if ("option" !== n)
  32505. throw Error("illegal rpc service token: " + n);
  32506. this._parseOption(o)
  32507. }
  32508. this.tn.omit(";")
  32509. } else
  32510. this.tn.skip(";");
  32511. "undefined" == typeof e[i] && (e[i] = {}),
  32512. e[i][r] = o
  32513. }
  32514. ,
  32515. c._parseMessage = function(e, n) {
  32516. var r = !!n
  32517. , o = this.tn.next()
  32518. , a = {
  32519. name: "",
  32520. fields: [],
  32521. enums: [],
  32522. messages: [],
  32523. options: {},
  32524. services: [],
  32525. oneofs: {}
  32526. };
  32527. if (!t.NAME.test(o))
  32528. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  32529. for (a.name = o,
  32530. r && (this.tn.skip("="),
  32531. n.id = i(this.tn.next()),
  32532. a.isGroup = !0),
  32533. o = this.tn.peek(),
  32534. "[" === o && n && this._parseFieldOptions(n),
  32535. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  32536. if (t.RULE.test(o))
  32537. this._parseMessageField(a, o);
  32538. else if ("oneof" === o)
  32539. this._parseMessageOneOf(a);
  32540. else if ("enum" === o)
  32541. this._parseEnum(a);
  32542. else if ("message" === o)
  32543. this._parseMessage(a);
  32544. else if ("option" === o)
  32545. this._parseOption(a);
  32546. else if ("service" === o)
  32547. this._parseService(a);
  32548. else if ("extensions" === o)
  32549. a.extensions = this._parseExtensionRanges();
  32550. else if ("reserved" === o)
  32551. this._parseIgnored();
  32552. else if ("extend" === o)
  32553. this._parseExtend(a);
  32554. else {
  32555. if (!t.TYPEREF.test(o))
  32556. throw Error("illegal message token: " + o);
  32557. if (!this.proto3)
  32558. throw Error("illegal field rule: " + o);
  32559. this._parseMessageField(a, "optional", o)
  32560. }
  32561. return this.tn.omit(";"),
  32562. e.messages.push(a),
  32563. a
  32564. }
  32565. ,
  32566. c._parseIgnored = function() {
  32567. for (; ";" !== this.tn.peek(); )
  32568. this.tn.next();
  32569. this.tn.skip(";")
  32570. }
  32571. ,
  32572. c._parseMessageField = function(e, n, r) {
  32573. if (!t.RULE.test(n))
  32574. throw Error("illegal message field rule: " + n);
  32575. var o, a = {
  32576. rule: n,
  32577. type: "",
  32578. name: "",
  32579. options: {},
  32580. id: 0
  32581. };
  32582. if ("map" === n) {
  32583. if (r)
  32584. throw Error("illegal type: " + r);
  32585. if (this.tn.skip("<"),
  32586. o = this.tn.next(),
  32587. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  32588. throw Error("illegal message field type: " + o);
  32589. if (a.keytype = o,
  32590. this.tn.skip(","),
  32591. o = this.tn.next(),
  32592. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  32593. throw Error("illegal message field: " + o);
  32594. if (a.type = o,
  32595. this.tn.skip(">"),
  32596. o = this.tn.next(),
  32597. !t.NAME.test(o))
  32598. throw Error("illegal message field name: " + o);
  32599. a.name = o,
  32600. this.tn.skip("="),
  32601. a.id = i(this.tn.next()),
  32602. o = this.tn.peek(),
  32603. "[" === o && this._parseFieldOptions(a),
  32604. this.tn.skip(";")
  32605. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  32606. "group" === r) {
  32607. var s = this._parseMessage(e, a);
  32608. if (!/^[A-Z]/.test(s.name))
  32609. throw Error("illegal group name: " + s.name);
  32610. a.type = s.name,
  32611. a.name = s.name.toLowerCase(),
  32612. this.tn.omit(";")
  32613. } else {
  32614. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  32615. throw Error("illegal message field type: " + r);
  32616. if (a.type = r,
  32617. o = this.tn.next(),
  32618. !t.NAME.test(o))
  32619. throw Error("illegal message field name: " + o);
  32620. a.name = o,
  32621. this.tn.skip("="),
  32622. a.id = i(this.tn.next()),
  32623. o = this.tn.peek(),
  32624. "[" === o && this._parseFieldOptions(a),
  32625. this.tn.skip(";")
  32626. }
  32627. return e.fields.push(a),
  32628. a
  32629. }
  32630. ,
  32631. c._parseMessageOneOf = function(e) {
  32632. var i = this.tn.next();
  32633. if (!t.NAME.test(i))
  32634. throw Error("illegal oneof name: " + i);
  32635. var n, r = i, o = [];
  32636. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32637. n = this._parseMessageField(e, "optional", i),
  32638. n.oneof = r,
  32639. o.push(n.id);
  32640. this.tn.omit(";"),
  32641. e.oneofs[r] = o
  32642. }
  32643. ,
  32644. c._parseFieldOptions = function(e) {
  32645. this.tn.skip("[");
  32646. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  32647. i || this.tn.skip(","),
  32648. this._parseOption(e, !0),
  32649. i = !1;
  32650. this.tn.next()
  32651. }
  32652. ,
  32653. c._parseEnum = function(e) {
  32654. var n = {
  32655. name: "",
  32656. values: [],
  32657. options: {}
  32658. }
  32659. , r = this.tn.next();
  32660. if (!t.NAME.test(r))
  32661. throw Error("illegal name: " + r);
  32662. for (n.name = r,
  32663. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  32664. if ("option" === r)
  32665. this._parseOption(n);
  32666. else {
  32667. if (!t.NAME.test(r))
  32668. throw Error("illegal name: " + r);
  32669. this.tn.skip("=");
  32670. var o = {
  32671. name: r,
  32672. id: i(this.tn.next(), !0)
  32673. };
  32674. r = this.tn.peek(),
  32675. "[" === r && this._parseFieldOptions({
  32676. options: {}
  32677. }),
  32678. this.tn.skip(";"),
  32679. n.values.push(o)
  32680. }
  32681. this.tn.omit(";"),
  32682. e.enums.push(n)
  32683. }
  32684. ,
  32685. c._parseExtensionRanges = function() {
  32686. var t, i, r, o = [];
  32687. do {
  32688. for (i = []; ; ) {
  32689. switch (t = this.tn.next()) {
  32690. case "min":
  32691. r = e.ID_MIN;
  32692. break;
  32693. case "max":
  32694. r = e.ID_MAX;
  32695. break;
  32696. default:
  32697. r = n(t)
  32698. }
  32699. if (i.push(r),
  32700. 2 === i.length)
  32701. break;
  32702. if ("to" !== this.tn.peek()) {
  32703. i.push(r);
  32704. break
  32705. }
  32706. this.tn.next()
  32707. }
  32708. o.push(i)
  32709. } while (this.tn.omit(","));return this.tn.skip(";"),
  32710. o
  32711. }
  32712. ,
  32713. c._parseExtend = function(e) {
  32714. var i = this.tn.next();
  32715. if (!t.TYPEREF.test(i))
  32716. throw Error("illegal extend reference: " + i);
  32717. var n = {
  32718. ref: i,
  32719. fields: []
  32720. };
  32721. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32722. if (t.RULE.test(i))
  32723. this._parseMessageField(n, i);
  32724. else {
  32725. if (!t.TYPEREF.test(i))
  32726. throw Error("illegal extend token: " + i);
  32727. if (!this.proto3)
  32728. throw Error("illegal field rule: " + i);
  32729. this._parseMessageField(n, "optional", i)
  32730. }
  32731. return this.tn.omit(";"),
  32732. e.messages.push(n),
  32733. n
  32734. }
  32735. ,
  32736. c.toString = function() {
  32737. return "Parser at line " + this.tn.line
  32738. }
  32739. ,
  32740. o.Parser = l,
  32741. o
  32742. }(r, r.Lang),
  32743. r.Reflect = function(e) {
  32744. function i(i) {
  32745. if ("string" == typeof i && (i = e.TYPES[i]),
  32746. "undefined" == typeof i.defaultValue)
  32747. throw Error("default value for type " + i.name + " is not supported");
  32748. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  32749. }
  32750. function n(t, i) {
  32751. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  32752. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  32753. if ("string" == typeof t)
  32754. return e.Long.fromString(t, i || !1, 10);
  32755. if ("number" == typeof t)
  32756. return e.Long.fromNumber(t, i || !1);
  32757. throw Error("not convertible to Long")
  32758. }
  32759. function r(t, i) {
  32760. var n = i.readVarint32()
  32761. , o = 7 & n
  32762. , a = n >>> 3;
  32763. switch (o) {
  32764. case e.WIRE_TYPES.VARINT:
  32765. do
  32766. n = i.readUint8();
  32767. while (128 === (128 & n));break;
  32768. case e.WIRE_TYPES.BITS64:
  32769. i.offset += 8;
  32770. break;
  32771. case e.WIRE_TYPES.LDELIM:
  32772. n = i.readVarint32(),
  32773. i.offset += n;
  32774. break;
  32775. case e.WIRE_TYPES.STARTGROUP:
  32776. r(a, i);
  32777. break;
  32778. case e.WIRE_TYPES.ENDGROUP:
  32779. if (a === t)
  32780. return !1;
  32781. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  32782. case e.WIRE_TYPES.BITS32:
  32783. i.offset += 4;
  32784. break;
  32785. default:
  32786. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  32787. }
  32788. return !0
  32789. }
  32790. var o = {}
  32791. , a = function(e, t, i) {
  32792. this.builder = e,
  32793. this.parent = t,
  32794. this.name = i,
  32795. this.className
  32796. }
  32797. , s = a.prototype;
  32798. s.fqn = function() {
  32799. for (var e = this.name, t = this; ; ) {
  32800. if (t = t.parent,
  32801. null == t)
  32802. break;
  32803. e = t.name + "." + e
  32804. }
  32805. return e
  32806. }
  32807. ,
  32808. s.toString = function(e) {
  32809. return (e ? this.className + " " : "") + this.fqn()
  32810. }
  32811. ,
  32812. s.build = function() {
  32813. throw Error(this.toString(!0) + " cannot be built directly")
  32814. }
  32815. ,
  32816. o.T = a;
  32817. var l = function(e, t, i, n, r) {
  32818. a.call(this, e, t, i),
  32819. this.className = "Namespace",
  32820. this.children = [],
  32821. this.options = n || {},
  32822. this.syntax = r || "proto2"
  32823. }
  32824. , c = l.prototype = Object.create(a.prototype);
  32825. c.getChildren = function(e) {
  32826. if (e = e || null,
  32827. null == e)
  32828. return this.children.slice();
  32829. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32830. this.children[i]instanceof e && t.push(this.children[i]);
  32831. return t
  32832. }
  32833. ,
  32834. c.addChild = function(e) {
  32835. var t;
  32836. if (t = this.getChild(e.name))
  32837. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32838. t.name = t.originalName;
  32839. else {
  32840. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32841. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32842. e.name = e.originalName
  32843. }
  32844. this.children.push(e)
  32845. }
  32846. ,
  32847. c.getChild = function(e) {
  32848. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32849. if (this.children[i][t] === e)
  32850. return this.children[i];
  32851. return null
  32852. }
  32853. ,
  32854. c.resolve = function(e, t) {
  32855. var i = "string" == typeof e ? e.split(".") : e
  32856. , n = this
  32857. , r = 0;
  32858. if ("" === i[r]) {
  32859. for (; null !== n.parent; )
  32860. n = n.parent;
  32861. r++
  32862. }
  32863. var a;
  32864. do {
  32865. do {
  32866. if (!(n instanceof o.Namespace)) {
  32867. n = null;
  32868. break
  32869. }
  32870. if (a = n.getChild(i[r]),
  32871. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  32872. n = null;
  32873. break
  32874. }
  32875. n = a,
  32876. r++
  32877. } while (r < i.length);if (null != n)
  32878. break;
  32879. if (null !== this.parent)
  32880. return this.parent.resolve(e, t)
  32881. } while (null != n);return n
  32882. }
  32883. ,
  32884. c.qn = function(e) {
  32885. var t = []
  32886. , i = e;
  32887. do
  32888. t.unshift(i.name),
  32889. i = i.parent;
  32890. while (null !== i);for (var n = 1; n <= t.length; n++) {
  32891. var r = t.slice(t.length - n);
  32892. if (e === this.resolve(r, e instanceof o.Namespace))
  32893. return r.join(".")
  32894. }
  32895. return e.fqn()
  32896. }
  32897. ,
  32898. c.build = function() {
  32899. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32900. e = i[n],
  32901. e instanceof l && (t[e.name] = e.build());
  32902. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32903. value: this.buildOpt()
  32904. }),
  32905. t
  32906. }
  32907. ,
  32908. c.buildOpt = function() {
  32909. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32910. var r = t[i]
  32911. , o = this.options[t[i]];
  32912. e[r] = o
  32913. }
  32914. return e
  32915. }
  32916. ,
  32917. c.getOption = function(e) {
  32918. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  32919. }
  32920. ,
  32921. o.Namespace = l;
  32922. var h = function(t, i, n, r) {
  32923. if (this.type = t,
  32924. this.resolvedType = i,
  32925. this.isMapKey = n,
  32926. this.syntax = r,
  32927. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  32928. throw Error("Invalid map key type: " + t.name)
  32929. }
  32930. , u = h.prototype;
  32931. h.defaultFieldValue = i,
  32932. u.verifyValue = function(i) {
  32933. function r(e, t) {
  32934. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  32935. }
  32936. var o = this;
  32937. switch (this.type) {
  32938. case e.TYPES.int32:
  32939. case e.TYPES.sint32:
  32940. case e.TYPES.sfixed32:
  32941. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  32942. i > 4294967295 ? 0 | i : i;
  32943. case e.TYPES.uint32:
  32944. case e.TYPES.fixed32:
  32945. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  32946. i < 0 ? i >>> 0 : i;
  32947. case e.TYPES.int64:
  32948. case e.TYPES.sint64:
  32949. case e.TYPES.sfixed64:
  32950. if (e.Long)
  32951. try {
  32952. return n(i, !1)
  32953. } catch (e) {
  32954. r(typeof i, e.message)
  32955. }
  32956. else
  32957. r(typeof i, "requires Long.js");
  32958. case e.TYPES.uint64:
  32959. case e.TYPES.fixed64:
  32960. if (e.Long)
  32961. try {
  32962. return n(i, !0)
  32963. } catch (e) {
  32964. r(typeof i, e.message)
  32965. }
  32966. else
  32967. r(typeof i, "requires Long.js");
  32968. case e.TYPES.bool:
  32969. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  32970. i;
  32971. case e.TYPES.float:
  32972. case e.TYPES.double:
  32973. return "number" != typeof i && r(typeof i, "not a number"),
  32974. i;
  32975. case e.TYPES.string:
  32976. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  32977. "" + i;
  32978. case e.TYPES.bytes:
  32979. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  32980. case e.TYPES.enum:
  32981. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  32982. for (l = 0; l < a.length; l++) {
  32983. if (a[l].name == i)
  32984. return a[l].id;
  32985. if (a[l].id == i)
  32986. return a[l].id
  32987. }
  32988. if ("proto3" === this.syntax)
  32989. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  32990. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  32991. i;
  32992. r(i, "not a valid enum value");
  32993. case e.TYPES.group:
  32994. case e.TYPES.message:
  32995. if (i && "object" == typeof i || r(typeof i, "object expected"),
  32996. i instanceof this.resolvedType.clazz)
  32997. return i;
  32998. if (i instanceof e.Builder.Message) {
  32999. var s = {};
  33000. for (var l in i)
  33001. i.hasOwnProperty(l) && (s[l] = i[l]);
  33002. i = s
  33003. }
  33004. return new this.resolvedType.clazz(i)
  33005. }
  33006. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  33007. }
  33008. ,
  33009. u.calculateLength = function(i, n) {
  33010. if (null === n)
  33011. return 0;
  33012. var r;
  33013. switch (this.type) {
  33014. case e.TYPES.int32:
  33015. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  33016. case e.TYPES.uint32:
  33017. return t.calculateVarint32(n);
  33018. case e.TYPES.sint32:
  33019. return t.calculateVarint32(t.zigZagEncode32(n));
  33020. case e.TYPES.fixed32:
  33021. case e.TYPES.sfixed32:
  33022. case e.TYPES.float:
  33023. return 4;
  33024. case e.TYPES.int64:
  33025. case e.TYPES.uint64:
  33026. return t.calculateVarint64(n);
  33027. case e.TYPES.sint64:
  33028. return t.calculateVarint64(t.zigZagEncode64(n));
  33029. case e.TYPES.fixed64:
  33030. case e.TYPES.sfixed64:
  33031. return 8;
  33032. case e.TYPES.bool:
  33033. return 1;
  33034. case e.TYPES.enum:
  33035. return t.calculateVarint32(n);
  33036. case e.TYPES.double:
  33037. return 8;
  33038. case e.TYPES.string:
  33039. return r = t.calculateUTF8Bytes(n),
  33040. t.calculateVarint32(r) + r;
  33041. case e.TYPES.bytes:
  33042. if (n.remaining() < 0)
  33043. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  33044. return t.calculateVarint32(n.remaining()) + n.remaining();
  33045. case e.TYPES.message:
  33046. return r = this.resolvedType.calculate(n),
  33047. t.calculateVarint32(r) + r;
  33048. case e.TYPES.group:
  33049. return r = this.resolvedType.calculate(n),
  33050. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  33051. }
  33052. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  33053. }
  33054. ,
  33055. u.encodeValue = function(i, n, r) {
  33056. if (null === n)
  33057. return r;
  33058. switch (this.type) {
  33059. case e.TYPES.int32:
  33060. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  33061. break;
  33062. case e.TYPES.uint32:
  33063. r.writeVarint32(n);
  33064. break;
  33065. case e.TYPES.sint32:
  33066. r.writeVarint32ZigZag(n);
  33067. break;
  33068. case e.TYPES.fixed32:
  33069. r.writeUint32(n);
  33070. break;
  33071. case e.TYPES.sfixed32:
  33072. r.writeInt32(n);
  33073. break;
  33074. case e.TYPES.int64:
  33075. case e.TYPES.uint64:
  33076. r.writeVarint64(n);
  33077. break;
  33078. case e.TYPES.sint64:
  33079. r.writeVarint64ZigZag(n);
  33080. break;
  33081. case e.TYPES.fixed64:
  33082. r.writeUint64(n);
  33083. break;
  33084. case e.TYPES.sfixed64:
  33085. r.writeInt64(n);
  33086. break;
  33087. case e.TYPES.bool:
  33088. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  33089. break;
  33090. case e.TYPES.enum:
  33091. r.writeVarint32(n);
  33092. break;
  33093. case e.TYPES.float:
  33094. r.writeFloat32(n);
  33095. break;
  33096. case e.TYPES.double:
  33097. r.writeFloat64(n);
  33098. break;
  33099. case e.TYPES.string:
  33100. r.writeVString(n);
  33101. break;
  33102. case e.TYPES.bytes:
  33103. if (n.remaining() < 0)
  33104. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  33105. var o = n.offset;
  33106. r.writeVarint32(n.remaining()),
  33107. r.append(n),
  33108. n.offset = o;
  33109. break;
  33110. case e.TYPES.message:
  33111. var a = (new t).LE();
  33112. this.resolvedType.encode(n, a),
  33113. r.writeVarint32(a.offset),
  33114. r.append(a.flip());
  33115. break;
  33116. case e.TYPES.group:
  33117. this.resolvedType.encode(n, r),
  33118. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  33119. break;
  33120. default:
  33121. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  33122. }
  33123. return r
  33124. }
  33125. ,
  33126. u.decode = function(t, i, n) {
  33127. if (i != this.type.wireType)
  33128. throw Error("Unexpected wire type for element");
  33129. var r, o;
  33130. switch (this.type) {
  33131. case e.TYPES.int32:
  33132. return 0 | t.readVarint32();
  33133. case e.TYPES.uint32:
  33134. return t.readVarint32() >>> 0;
  33135. case e.TYPES.sint32:
  33136. return 0 | t.readVarint32ZigZag();
  33137. case e.TYPES.fixed32:
  33138. return t.readUint32() >>> 0;
  33139. case e.TYPES.sfixed32:
  33140. return 0 | t.readInt32();
  33141. case e.TYPES.int64:
  33142. return t.readVarint64();
  33143. case e.TYPES.uint64:
  33144. return t.readVarint64().toUnsigned();
  33145. case e.TYPES.sint64:
  33146. return t.readVarint64ZigZag();
  33147. case e.TYPES.fixed64:
  33148. return t.readUint64();
  33149. case e.TYPES.sfixed64:
  33150. return t.readInt64();
  33151. case e.TYPES.bool:
  33152. return !!t.readVarint32();
  33153. case e.TYPES.enum:
  33154. return t.readVarint32();
  33155. case e.TYPES.float:
  33156. return t.readFloat();
  33157. case e.TYPES.double:
  33158. return t.readDouble();
  33159. case e.TYPES.string:
  33160. return t.readVString();
  33161. case e.TYPES.bytes:
  33162. if (o = t.readVarint32(),
  33163. t.remaining() < o)
  33164. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  33165. return r = t.clone(),
  33166. r.limit = r.offset + o,
  33167. t.offset += o,
  33168. r;
  33169. case e.TYPES.message:
  33170. return o = t.readVarint32(),
  33171. this.resolvedType.decode(t, o);
  33172. case e.TYPES.group:
  33173. return this.resolvedType.decode(t, -1, n)
  33174. }
  33175. throw Error("[INTERNAL] Illegal decode type")
  33176. }
  33177. ,
  33178. u.valueFromString = function(i) {
  33179. if (!this.isMapKey)
  33180. throw Error("valueFromString() called on non-map-key element");
  33181. switch (this.type) {
  33182. case e.TYPES.int32:
  33183. case e.TYPES.sint32:
  33184. case e.TYPES.sfixed32:
  33185. case e.TYPES.uint32:
  33186. case e.TYPES.fixed32:
  33187. return this.verifyValue(parseInt(i));
  33188. case e.TYPES.int64:
  33189. case e.TYPES.sint64:
  33190. case e.TYPES.sfixed64:
  33191. case e.TYPES.uint64:
  33192. case e.TYPES.fixed64:
  33193. return this.verifyValue(i);
  33194. case e.TYPES.bool:
  33195. return "true" === i;
  33196. case e.TYPES.string:
  33197. return this.verifyValue(i);
  33198. case e.TYPES.bytes:
  33199. return t.fromBinary(i)
  33200. }
  33201. }
  33202. ,
  33203. u.valueToString = function(t) {
  33204. if (!this.isMapKey)
  33205. throw Error("valueToString() called on non-map-key element");
  33206. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  33207. }
  33208. ,
  33209. o.Element = h;
  33210. var d = function(e, t, i, n, r, o) {
  33211. l.call(this, e, t, i, n, o),
  33212. this.className = "Message",
  33213. this.extensions = void 0,
  33214. this.clazz = null,
  33215. this.isGroup = !!r,
  33216. this._fields = null,
  33217. this._fieldsById = null,
  33218. this._fieldsByName = null
  33219. }
  33220. , p = d.prototype = Object.create(l.prototype);
  33221. p.build = function(i) {
  33222. if (this.clazz && !i)
  33223. return this.clazz;
  33224. var n = function(e, i) {
  33225. function n(i, r, o, a) {
  33226. if (null === i || "object" != typeof i) {
  33227. if (a && a instanceof e.Reflect.Enum) {
  33228. var s = e.Reflect.Enum.getName(a.object, i);
  33229. if (null !== s)
  33230. return s
  33231. }
  33232. return i
  33233. }
  33234. if (t.isByteBuffer(i))
  33235. return r ? i.toBase64() : i.toBuffer();
  33236. if (e.Long.isLong(i))
  33237. return o ? i.toString() : e.Long.fromValue(i);
  33238. var l;
  33239. if (Array.isArray(i))
  33240. return l = [],
  33241. i.forEach(function(e, t) {
  33242. l[t] = n(e, r, o, a)
  33243. }),
  33244. l;
  33245. if (l = {},
  33246. i instanceof e.Map) {
  33247. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  33248. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  33249. return l
  33250. }
  33251. var u = i.$type
  33252. , d = void 0;
  33253. for (var p in i)
  33254. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  33255. return l
  33256. }
  33257. var r = i.getChildren(e.Reflect.Message.Field)
  33258. , o = i.getChildren(e.Reflect.Message.OneOf)
  33259. , a = function(n, s) {
  33260. e.Builder.Message.call(this);
  33261. for (var l = 0, c = o.length; l < c; ++l)
  33262. this[o[l].name] = null;
  33263. for (l = 0,
  33264. c = r.length; l < c; ++l) {
  33265. var h = r[l];
  33266. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  33267. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  33268. }
  33269. if (arguments.length > 0) {
  33270. var u;
  33271. if (1 !== arguments.length || null === n || "object" != typeof n || !("function" != typeof n.encode || n instanceof a) || Array.isArray(n) || n instanceof e.Map || t.isByteBuffer(n) || n instanceof ArrayBuffer || e.Long && n instanceof e.Long)
  33272. for (l = 0,
  33273. c = arguments.length; l < c; ++l)
  33274. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  33275. else
  33276. this.$set(n)
  33277. }
  33278. }
  33279. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  33280. s.add = function(t, n, r) {
  33281. var o = i._fieldsByName[t];
  33282. if (!r) {
  33283. if (!o)
  33284. throw Error(this + "#" + t + " is undefined");
  33285. if (!(o instanceof e.Reflect.Message.Field))
  33286. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  33287. if (!o.repeated)
  33288. throw Error(this + "#" + t + " is not a repeated field");
  33289. n = o.verifyValue(n, !0)
  33290. }
  33291. return null === this[t] && (this[t] = []),
  33292. this[t].push(n),
  33293. this
  33294. }
  33295. ,
  33296. s.$add = s.add,
  33297. s.set = function(t, n, r) {
  33298. if (t && "object" == typeof t) {
  33299. r = n;
  33300. for (var o in t)
  33301. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  33302. return this
  33303. }
  33304. var a = i._fieldsByName[t];
  33305. if (r)
  33306. this[t] = n;
  33307. else {
  33308. if (!a)
  33309. throw Error(this + "#" + t + " is not a field: undefined");
  33310. if (!(a instanceof e.Reflect.Message.Field))
  33311. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  33312. this[a.name] = n = a.verifyValue(n)
  33313. }
  33314. if (a && a.oneof) {
  33315. var s = this[a.oneof.name];
  33316. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  33317. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  33318. }
  33319. return this
  33320. }
  33321. ,
  33322. s.$set = s.set,
  33323. s.get = function(t, n) {
  33324. if (n)
  33325. return this[t];
  33326. var r = i._fieldsByName[t];
  33327. if (!(r && r instanceof e.Reflect.Message.Field))
  33328. throw Error(this + "#" + t + " is not a field: undefined");
  33329. if (!(r instanceof e.Reflect.Message.Field))
  33330. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  33331. return this[r.name]
  33332. }
  33333. ,
  33334. s.$get = s.get;
  33335. for (var l = 0; l < r.length; l++) {
  33336. var c = r[l];
  33337. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  33338. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33339. return e.toUpperCase().replace("_", "")
  33340. });
  33341. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  33342. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  33343. return "_" + e
  33344. })
  33345. , r = function(t, i) {
  33346. return this[e.name] = i ? t : e.verifyValue(t),
  33347. this
  33348. }
  33349. , o = function() {
  33350. return this[e.name]
  33351. };
  33352. null === i.getChild("set" + t) && (s["set" + t] = r),
  33353. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  33354. null === i.getChild("get" + t) && (s["get" + t] = o),
  33355. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  33356. }(c)
  33357. }
  33358. s.encode = function(e, n) {
  33359. "boolean" == typeof e && (n = e,
  33360. e = void 0);
  33361. var r = !1;
  33362. e || (e = new t,
  33363. r = !0);
  33364. var o = e.littleEndian;
  33365. try {
  33366. return i.encode(this, e.LE(), n),
  33367. (r ? e.flip() : e).LE(o)
  33368. } catch (t) {
  33369. throw e.LE(o),
  33370. t
  33371. }
  33372. }
  33373. ,
  33374. a.encode = function(e, t, i) {
  33375. return new a(e).encode(t, i)
  33376. }
  33377. ,
  33378. s.calculate = function() {
  33379. return i.calculate(this)
  33380. }
  33381. ,
  33382. s.encodeDelimited = function(e, n) {
  33383. var r = !1;
  33384. e || (e = new t,
  33385. r = !0);
  33386. var o = (new t).LE();
  33387. return i.encode(this, o, n).flip(),
  33388. e.writeVarint32(o.remaining()),
  33389. e.append(o),
  33390. r ? e.flip() : e
  33391. }
  33392. ,
  33393. s.encodeAB = function() {
  33394. try {
  33395. return this.encode().toArrayBuffer()
  33396. } catch (e) {
  33397. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33398. e
  33399. }
  33400. }
  33401. ,
  33402. s.toArrayBuffer = s.encodeAB,
  33403. s.encodeNB = function() {
  33404. try {
  33405. return this.encode().toBuffer()
  33406. } catch (e) {
  33407. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33408. e
  33409. }
  33410. }
  33411. ,
  33412. s.toBuffer = s.encodeNB,
  33413. s.encode64 = function() {
  33414. try {
  33415. return this.encode().toBase64()
  33416. } catch (e) {
  33417. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33418. e
  33419. }
  33420. }
  33421. ,
  33422. s.toBase64 = s.encode64,
  33423. s.encodeHex = function() {
  33424. try {
  33425. return this.encode().toHex()
  33426. } catch (e) {
  33427. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33428. e
  33429. }
  33430. }
  33431. ,
  33432. s.toHex = s.encodeHex,
  33433. s.toRaw = function(e, t) {
  33434. return n(this, !!e, !!t, this.$type)
  33435. }
  33436. ,
  33437. s.encodeJSON = function() {
  33438. return JSON.stringify(n(this, !0, !0, this.$type))
  33439. }
  33440. ,
  33441. a.decode = function(e, n, r) {
  33442. "string" == typeof n && (r = n,
  33443. n = -1),
  33444. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  33445. e = t.isByteBuffer(e) ? e : t.wrap(e);
  33446. var o = e.littleEndian;
  33447. try {
  33448. var a = i.decode(e.LE());
  33449. return e.LE(o),
  33450. a
  33451. } catch (t) {
  33452. throw e.LE(o),
  33453. t
  33454. }
  33455. }
  33456. ,
  33457. a.decodeDelimited = function(e, n) {
  33458. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  33459. e = t.isByteBuffer(e) ? e : t.wrap(e),
  33460. e.remaining() < 1)
  33461. return null;
  33462. var r = e.offset
  33463. , o = e.readVarint32();
  33464. if (e.remaining() < o)
  33465. return e.offset = r,
  33466. null;
  33467. try {
  33468. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  33469. return e.offset += o,
  33470. a
  33471. } catch (t) {
  33472. throw e.offset += o,
  33473. t
  33474. }
  33475. }
  33476. ,
  33477. a.decode64 = function(e) {
  33478. return a.decode(e, "base64")
  33479. }
  33480. ,
  33481. a.decodeHex = function(e) {
  33482. return a.decode(e, "hex")
  33483. }
  33484. ,
  33485. a.decodeJSON = function(e) {
  33486. return new a(JSON.parse(e))
  33487. }
  33488. ,
  33489. s.toString = function() {
  33490. return i.toString()
  33491. }
  33492. ;
  33493. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  33494. value: i.buildOpt()
  33495. }),
  33496. Object.defineProperty(s, "$options", {
  33497. value: a.$options
  33498. }),
  33499. Object.defineProperty(a, "$type", {
  33500. value: i
  33501. }),
  33502. Object.defineProperty(s, "$type", {
  33503. value: i
  33504. })),
  33505. a
  33506. }(e, this);
  33507. this._fields = [],
  33508. this._fieldsById = {},
  33509. this._fieldsByName = {};
  33510. for (var r, o = 0, a = this.children.length; o < a; o++)
  33511. if (r = this.children[o],
  33512. r instanceof A || r instanceof d || r instanceof E) {
  33513. if (n.hasOwnProperty(r.name))
  33514. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  33515. n[r.name] = r.build()
  33516. } else if (r instanceof d.Field)
  33517. r.build(),
  33518. this._fields.push(r),
  33519. this._fieldsById[r.id] = r,
  33520. this._fieldsByName[r.name] = r;
  33521. else if (!(r instanceof d.OneOf || r instanceof I))
  33522. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  33523. return this.clazz = n
  33524. }
  33525. ,
  33526. p.encode = function(e, t, i) {
  33527. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33528. n = this._fields[a],
  33529. r = e[n.name],
  33530. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33531. if (null !== o) {
  33532. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33533. throw l.encoded = t,
  33534. l
  33535. }
  33536. return t
  33537. }
  33538. ,
  33539. p.calculate = function(e) {
  33540. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33541. if (t = this._fields[r],
  33542. i = e[t.name],
  33543. t.required && null === i)
  33544. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33545. n += t.calculate(i, e)
  33546. }
  33547. return n
  33548. }
  33549. ,
  33550. p.decode = function(t, i, n) {
  33551. i = "number" == typeof i ? i : -1;
  33552. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  33553. if (o = t.readVarint32(),
  33554. a = 7 & o,
  33555. s = o >>> 3,
  33556. a === e.WIRE_TYPES.ENDGROUP) {
  33557. if (s !== n)
  33558. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  33559. break
  33560. }
  33561. if (l = this._fieldsById[s]) {
  33562. if (l.repeated && !l.options.packed)
  33563. h[l.name].push(l.decode(a, t));
  33564. else if (l.map) {
  33565. var u = l.decode(a, t);
  33566. h[l.name].set(u[0], u[1])
  33567. } else if (h[l.name] = l.decode(a, t),
  33568. l.oneof) {
  33569. var d = h[l.oneof.name];
  33570. null !== d && d !== l.name && (h[d] = null),
  33571. h[l.oneof.name] = l.name
  33572. }
  33573. } else
  33574. switch (a) {
  33575. case e.WIRE_TYPES.VARINT:
  33576. t.readVarint32();
  33577. break;
  33578. case e.WIRE_TYPES.BITS32:
  33579. t.offset += 4;
  33580. break;
  33581. case e.WIRE_TYPES.BITS64:
  33582. t.offset += 8;
  33583. break;
  33584. case e.WIRE_TYPES.LDELIM:
  33585. var p = t.readVarint32();
  33586. t.offset += p;
  33587. break;
  33588. case e.WIRE_TYPES.STARTGROUP:
  33589. for (; r(s, t); )
  33590. ;
  33591. break;
  33592. default:
  33593. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  33594. }
  33595. }
  33596. for (var f = 0, g = this._fields.length; f < g; ++f)
  33597. if (l = this._fields[f],
  33598. null === h[l.name])
  33599. if ("proto3" === this.syntax)
  33600. h[l.name] = l.defaultValue;
  33601. else {
  33602. if (l.required) {
  33603. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  33604. throw m.decoded = h,
  33605. m
  33606. }
  33607. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  33608. }
  33609. return h
  33610. }
  33611. ,
  33612. o.Message = d;
  33613. var f = function(t, i, n, r, o, s, l, c, h, u) {
  33614. a.call(this, t, i, s),
  33615. this.className = "Message.Field",
  33616. this.required = "required" === n,
  33617. this.repeated = "repeated" === n,
  33618. this.map = "map" === n,
  33619. this.keyType = r || null,
  33620. this.type = o,
  33621. this.resolvedType = null,
  33622. this.id = l,
  33623. this.options = c || {},
  33624. this.defaultValue = null,
  33625. this.oneof = h || null,
  33626. this.syntax = u || "proto2",
  33627. this.originalName = this.name,
  33628. this.element = null,
  33629. this.keyElement = null,
  33630. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  33631. }
  33632. , g = f.prototype = Object.create(a.prototype);
  33633. g.build = function() {
  33634. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  33635. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  33636. "proto3" !== this.syntax || this.repeated || this.map ? "undefined" != typeof this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = h.defaultFieldValue(this.type)
  33637. }
  33638. ,
  33639. g.verifyValue = function(t, i) {
  33640. function n(e, t) {
  33641. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33642. }
  33643. i = i || !1;
  33644. var r = this;
  33645. if (null === t)
  33646. return this.required && n(typeof t, "required"),
  33647. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  33648. null;
  33649. var o;
  33650. if (this.repeated && !i) {
  33651. Array.isArray(t) || (t = [t]);
  33652. var a = [];
  33653. for (o = 0; o < t.length; o++)
  33654. a.push(this.element.verifyValue(t[o]));
  33655. return a
  33656. }
  33657. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  33658. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  33659. this.element.verifyValue(t))
  33660. }
  33661. ,
  33662. g.hasWirePresence = function(t, i) {
  33663. if ("proto3" !== this.syntax)
  33664. return null !== t;
  33665. if (this.oneof && i[this.oneof.name] === this.name)
  33666. return !0;
  33667. switch (this.type) {
  33668. case e.TYPES.int32:
  33669. case e.TYPES.sint32:
  33670. case e.TYPES.sfixed32:
  33671. case e.TYPES.uint32:
  33672. case e.TYPES.fixed32:
  33673. return 0 !== t;
  33674. case e.TYPES.int64:
  33675. case e.TYPES.sint64:
  33676. case e.TYPES.sfixed64:
  33677. case e.TYPES.uint64:
  33678. case e.TYPES.fixed64:
  33679. return 0 !== t.low || 0 !== t.high;
  33680. case e.TYPES.bool:
  33681. return t;
  33682. case e.TYPES.float:
  33683. case e.TYPES.double:
  33684. return 0 !== t;
  33685. case e.TYPES.string:
  33686. return t.length > 0;
  33687. case e.TYPES.bytes:
  33688. return t.remaining() > 0;
  33689. case e.TYPES.enum:
  33690. return 0 !== t;
  33691. case e.TYPES.message:
  33692. return null !== t;
  33693. default:
  33694. return !0
  33695. }
  33696. }
  33697. ,
  33698. g.encode = function(i, n, r) {
  33699. if (null === this.type || "object" != typeof this.type)
  33700. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33701. if (null === i || this.repeated && 0 == i.length)
  33702. return n;
  33703. try {
  33704. if (this.repeated) {
  33705. var o;
  33706. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  33707. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33708. n.ensureCapacity(n.offset += 1);
  33709. var a = n.offset;
  33710. for (o = 0; o < i.length; o++)
  33711. this.element.encodeValue(this.id, i[o], n);
  33712. var s = n.offset - a
  33713. , l = t.calculateVarint32(s);
  33714. if (l > 1) {
  33715. var c = n.slice(a, n.offset);
  33716. a += l - 1,
  33717. n.offset = a,
  33718. n.append(c)
  33719. }
  33720. n.writeVarint32(s, a - l)
  33721. } else
  33722. for (o = 0; o < i.length; o++)
  33723. n.writeVarint32(this.id << 3 | this.type.wireType),
  33724. this.element.encodeValue(this.id, i[o], n)
  33725. } else
  33726. this.map ? i.forEach(function(i, r, o) {
  33727. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  33728. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33729. n.writeVarint32(a),
  33730. n.writeVarint32(8 | this.keyType.wireType),
  33731. this.keyElement.encodeValue(1, r, n),
  33732. n.writeVarint32(16 | this.type.wireType),
  33733. this.element.encodeValue(2, i, n)
  33734. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  33735. this.element.encodeValue(this.id, i, n))
  33736. } catch (e) {
  33737. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  33738. }
  33739. return n
  33740. }
  33741. ,
  33742. g.calculate = function(i, n) {
  33743. if (i = this.verifyValue(i),
  33744. null === this.type || "object" != typeof this.type)
  33745. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33746. if (null === i || this.repeated && 0 == i.length)
  33747. return 0;
  33748. var r = 0;
  33749. try {
  33750. if (this.repeated) {
  33751. var o, a;
  33752. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  33753. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33754. a = 0,
  33755. o = 0; o < i.length; o++)
  33756. a += this.element.calculateLength(this.id, i[o]);
  33757. r += t.calculateVarint32(a),
  33758. r += a
  33759. } else
  33760. for (o = 0; o < i.length; o++)
  33761. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  33762. r += this.element.calculateLength(this.id, i[o])
  33763. } else
  33764. this.map ? i.forEach(function(i, n, o) {
  33765. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  33766. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33767. r += t.calculateVarint32(a),
  33768. r += a
  33769. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  33770. r += this.element.calculateLength(this.id, i))
  33771. } catch (e) {
  33772. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  33773. }
  33774. return r
  33775. }
  33776. ,
  33777. g.decode = function(t, i, n) {
  33778. var r, o, a = !this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM;
  33779. if (!a)
  33780. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  33781. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  33782. o = i.readVarint32(),
  33783. o = i.offset + o;
  33784. for (var s = []; i.offset < o; )
  33785. s.push(this.decode(this.type.wireType, i, !0));
  33786. return s
  33787. }
  33788. if (this.map) {
  33789. var l = h.defaultFieldValue(this.keyType);
  33790. if (r = h.defaultFieldValue(this.type),
  33791. o = i.readVarint32(),
  33792. i.remaining() < o)
  33793. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  33794. var c = i.clone();
  33795. for (c.limit = c.offset + o,
  33796. i.offset += o; c.remaining() > 0; ) {
  33797. var u = c.readVarint32();
  33798. t = 7 & u;
  33799. var d = u >>> 3;
  33800. if (1 === d)
  33801. l = this.keyElement.decode(c, t, d);
  33802. else {
  33803. if (2 !== d)
  33804. throw Error("Unexpected tag in map field key/value submessage");
  33805. r = this.element.decode(c, t, d)
  33806. }
  33807. }
  33808. return [l, r]
  33809. }
  33810. return this.element.decode(i, t, this.id)
  33811. }
  33812. ,
  33813. o.Message.Field = f;
  33814. var m = function(e, t, i, n, r, o, a) {
  33815. f.call(this, e, t, i, null, n, r, o, a),
  33816. this.extension
  33817. };
  33818. m.prototype = Object.create(f.prototype),
  33819. o.Message.ExtensionField = m;
  33820. var v = function(e, t, i) {
  33821. a.call(this, e, t, i),
  33822. this.fields = []
  33823. };
  33824. o.Message.OneOf = v;
  33825. var A = function(e, t, i, n, r) {
  33826. l.call(this, e, t, i, n, r),
  33827. this.className = "Enum",
  33828. this.object = null
  33829. };
  33830. A.getName = function(e, t) {
  33831. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33832. if (e[i = n[r]] === t)
  33833. return i;
  33834. return null
  33835. }
  33836. ;
  33837. var y = A.prototype = Object.create(l.prototype);
  33838. y.build = function(t) {
  33839. if (this.object && !t)
  33840. return this.object;
  33841. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  33842. i[n[r].name] = n[r].id;
  33843. return Object.defineProperty && Object.defineProperty(i, "$options", {
  33844. value: this.buildOpt(),
  33845. enumerable: !1
  33846. }),
  33847. this.object = i
  33848. }
  33849. ,
  33850. o.Enum = A;
  33851. var C = function(e, t, i, n) {
  33852. a.call(this, e, t, i),
  33853. this.className = "Enum.Value",
  33854. this.id = n
  33855. };
  33856. C.prototype = Object.create(a.prototype),
  33857. o.Enum.Value = C;
  33858. var I = function(e, t, i, n) {
  33859. a.call(this, e, t, i),
  33860. this.field = n
  33861. };
  33862. I.prototype = Object.create(a.prototype),
  33863. o.Extension = I;
  33864. var E = function(e, t, i, n) {
  33865. l.call(this, e, t, i, n),
  33866. this.className = "Service",
  33867. this.clazz = null
  33868. }
  33869. , b = E.prototype = Object.create(l.prototype);
  33870. b.build = function(i) {
  33871. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  33872. for (var n = function(t) {
  33873. e.Builder.Service.call(this),
  33874. this.rpcImpl = t || function(e, t, i) {
  33875. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33876. }
  33877. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  33878. !function(e) {
  33879. r[e.name] = function(n, r) {
  33880. try {
  33881. try {
  33882. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  33883. } catch (e) {
  33884. if (!(e instanceof TypeError))
  33885. throw e
  33886. }
  33887. if (null === n || "object" != typeof n)
  33888. throw Error("Illegal arguments");
  33889. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  33890. this.rpcImpl(e.fqn(), n, function(t, n) {
  33891. if (t)
  33892. return void r(t);
  33893. null === n && (n = "");
  33894. try {
  33895. n = e.resolvedResponseType.clazz.decode(n)
  33896. } catch (e) {}
  33897. return n && n instanceof e.resolvedResponseType.clazz ? void r(null, n) : void r(Error("Illegal response type received in service method " + i.name + "#" + e.name))
  33898. })
  33899. } catch (e) {
  33900. setTimeout(r.bind(this, e), 0)
  33901. }
  33902. }
  33903. ,
  33904. n[e.name] = function(t, i, r) {
  33905. new n(t)[e.name](i, r)
  33906. }
  33907. ,
  33908. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  33909. value: e.buildOpt()
  33910. }),
  33911. Object.defineProperty(r[e.name], "$options", {
  33912. value: n[e.name].$options
  33913. }))
  33914. }(o[a]);
  33915. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  33916. value: i.buildOpt()
  33917. }),
  33918. Object.defineProperty(r, "$options", {
  33919. value: n.$options
  33920. }),
  33921. Object.defineProperty(n, "$type", {
  33922. value: i
  33923. }),
  33924. Object.defineProperty(r, "$type", {
  33925. value: i
  33926. })),
  33927. n
  33928. }(e, this)
  33929. }
  33930. ,
  33931. o.Service = E;
  33932. var w = function(e, t, i, n) {
  33933. a.call(this, e, t, i),
  33934. this.className = "Service.Method",
  33935. this.options = n || {}
  33936. }
  33937. , _ = w.prototype = Object.create(a.prototype);
  33938. _.buildOpt = c.buildOpt,
  33939. o.Service.Method = w;
  33940. var T = function(e, t, i, n, r, o, a, s) {
  33941. w.call(this, e, t, i, s),
  33942. this.className = "Service.RPCMethod",
  33943. this.requestName = n,
  33944. this.responseName = r,
  33945. this.requestStream = o,
  33946. this.responseStream = a,
  33947. this.resolvedRequestType = null,
  33948. this.resolvedResponseType = null
  33949. };
  33950. return T.prototype = Object.create(w.prototype),
  33951. o.Service.RPCMethod = T,
  33952. o
  33953. }(r),
  33954. r.Builder = function(t, i, n) {
  33955. function r(e) {
  33956. e.messages && e.messages.forEach(function(t) {
  33957. t.syntax = e.syntax,
  33958. r(t)
  33959. }),
  33960. e.enums && e.enums.forEach(function(t) {
  33961. t.syntax = e.syntax
  33962. })
  33963. }
  33964. var o = function(e) {
  33965. this.ns = new n.Namespace(this,null,""),
  33966. this.ptr = this.ns,
  33967. this.resolved = !1,
  33968. this.result = null,
  33969. this.files = {},
  33970. this.importRoot = null,
  33971. this.options = e || {}
  33972. }
  33973. , a = o.prototype;
  33974. return o.isMessage = function(e) {
  33975. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  33976. }
  33977. ,
  33978. o.isMessageField = function(e) {
  33979. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  33980. }
  33981. ,
  33982. o.isEnum = function(e) {
  33983. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33984. }
  33985. ,
  33986. o.isService = function(e) {
  33987. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33988. }
  33989. ,
  33990. o.isExtend = function(e) {
  33991. return "string" == typeof e.ref
  33992. }
  33993. ,
  33994. a.reset = function() {
  33995. return this.ptr = this.ns,
  33996. this
  33997. }
  33998. ,
  33999. a.define = function(e) {
  34000. if ("string" != typeof e || !i.TYPEREF.test(e))
  34001. throw Error("illegal namespace: " + e);
  34002. return e.split(".").forEach(function(e) {
  34003. var t = this.ptr.getChild(e);
  34004. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  34005. this.ptr = t
  34006. }, this),
  34007. this
  34008. }
  34009. ,
  34010. a.create = function(e) {
  34011. if (!e)
  34012. return this;
  34013. if (Array.isArray(e)) {
  34014. if (0 === e.length)
  34015. return this;
  34016. e = e.slice()
  34017. } else
  34018. e = [e];
  34019. for (var i = [e]; i.length > 0; ) {
  34020. if (e = i.pop(),
  34021. !Array.isArray(e))
  34022. throw Error("not a valid namespace: " + JSON.stringify(e));
  34023. for (; e.length > 0; ) {
  34024. var r = e.shift();
  34025. if (o.isMessage(r)) {
  34026. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  34027. , s = {};
  34028. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  34029. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  34030. }, this),
  34031. r.fields && r.fields.forEach(function(e) {
  34032. if (null !== a.getChild(0 | e.id))
  34033. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  34034. if (e.options && "object" != typeof e.options)
  34035. throw Error("illegal field options in " + a.name + "#" + e.name);
  34036. var t = null;
  34037. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  34038. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  34039. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  34040. t && t.fields.push(e),
  34041. a.addChild(e)
  34042. }, this);
  34043. var l = [];
  34044. if (r.enums && r.enums.forEach(function(e) {
  34045. l.push(e)
  34046. }),
  34047. r.messages && r.messages.forEach(function(e) {
  34048. l.push(e)
  34049. }),
  34050. r.services && r.services.forEach(function(e) {
  34051. l.push(e)
  34052. }),
  34053. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  34054. this.ptr.addChild(a),
  34055. l.length > 0) {
  34056. i.push(e),
  34057. e = l,
  34058. l = null,
  34059. this.ptr = a,
  34060. a = null;
  34061. continue
  34062. }
  34063. l = null
  34064. } else if (o.isEnum(r))
  34065. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  34066. r.values.forEach(function(e) {
  34067. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  34068. }, this),
  34069. this.ptr.addChild(a);
  34070. else if (o.isService(r))
  34071. a = new n.Service(this,this.ptr,r.name,r.options),
  34072. Object.keys(r.rpc).forEach(function(e) {
  34073. var t = r.rpc[e];
  34074. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34075. }, this),
  34076. this.ptr.addChild(a);
  34077. else {
  34078. if (!o.isExtend(r))
  34079. throw Error("not a valid definition: " + JSON.stringify(r));
  34080. if (a = this.ptr.resolve(r.ref, !0))
  34081. r.fields.forEach(function(e) {
  34082. if (null !== a.getChild(0 | e.id))
  34083. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  34084. if (a.extensions) {
  34085. var i = !1;
  34086. if (a.extensions.forEach(function(t) {
  34087. e.id >= t[0] && e.id <= t[1] && (i = !0)
  34088. }),
  34089. !i)
  34090. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  34091. }
  34092. var r = e.name;
  34093. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  34094. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  34095. , s = new n.Extension(this,this.ptr,e.name,o);
  34096. o.extension = s,
  34097. this.ptr.addChild(s),
  34098. a.addChild(o)
  34099. }, this);
  34100. else if (!/\.?google\.protobuf\./.test(r.ref))
  34101. throw Error("extended message " + r.ref + " is not defined")
  34102. }
  34103. r = null,
  34104. a = null
  34105. }
  34106. e = null,
  34107. this.ptr = this.ptr.parent
  34108. }
  34109. return this.resolved = !1,
  34110. this.result = null,
  34111. this
  34112. }
  34113. ,
  34114. a.import = function(i, n) {
  34115. var o = "/";
  34116. if ("string" == typeof n) {
  34117. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  34118. this.files[n] === !0)
  34119. return this.reset();
  34120. this.files[n] = !0
  34121. } else if ("object" == typeof n) {
  34122. var a = n.root;
  34123. t.Util.IS_NODE && (a = e("path").resolve(a)),
  34124. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  34125. var s = a + o + n.file;
  34126. if (this.files[s] === !0)
  34127. return this.reset();
  34128. this.files[s] = !0
  34129. }
  34130. if (i.imports && i.imports.length > 0) {
  34131. var l, c = !1;
  34132. "object" == typeof n ? (this.importRoot = n.root,
  34133. c = !0,
  34134. l = this.importRoot,
  34135. n = n.file,
  34136. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  34137. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  34138. o = "\\") : l = "." : l = null;
  34139. for (var h = 0; h < i.imports.length; h++)
  34140. if ("string" == typeof i.imports[h]) {
  34141. if (!l)
  34142. throw Error("cannot determine import root");
  34143. var u = i.imports[h];
  34144. if ("google/protobuf/descriptor.proto" === u)
  34145. continue;
  34146. if (u = l + o + u,
  34147. this.files[u] === !0)
  34148. continue;
  34149. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  34150. var d = t.Util.fetch(u);
  34151. if (null === d)
  34152. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  34153. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  34154. } else
  34155. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34156. return t + "_import" + h + "." + i
  34157. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  34158. c && (this.importRoot = null)
  34159. }
  34160. i.package && this.define(i.package),
  34161. i.syntax && r(i);
  34162. var p = this.ptr;
  34163. return i.options && Object.keys(i.options).forEach(function(e) {
  34164. p.options[e] = i.options[e]
  34165. }),
  34166. i.messages && (this.create(i.messages),
  34167. this.ptr = p),
  34168. i.enums && (this.create(i.enums),
  34169. this.ptr = p),
  34170. i.services && (this.create(i.services),
  34171. this.ptr = p),
  34172. i.extends && this.create(i.extends),
  34173. this.reset()
  34174. }
  34175. ,
  34176. a.resolveAll = function() {
  34177. var e;
  34178. if (null == this.ptr || "object" == typeof this.ptr.type)
  34179. return this;
  34180. if (this.ptr instanceof n.Namespace)
  34181. this.ptr.children.forEach(function(e) {
  34182. this.ptr = e,
  34183. this.resolveAll()
  34184. }, this);
  34185. else if (this.ptr instanceof n.Message.Field) {
  34186. if (i.TYPE.test(this.ptr.type))
  34187. this.ptr.type = t.TYPES[this.ptr.type];
  34188. else {
  34189. if (!i.TYPEREF.test(this.ptr.type))
  34190. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34191. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  34192. !e)
  34193. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34194. if (this.ptr.resolvedType = e,
  34195. e instanceof n.Enum) {
  34196. if (this.ptr.type = t.TYPES.enum,
  34197. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34198. throw Error("proto3 message cannot reference proto2 enum")
  34199. } else {
  34200. if (!(e instanceof n.Message))
  34201. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34202. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  34203. }
  34204. }
  34205. if (this.ptr.map) {
  34206. if (!i.TYPE.test(this.ptr.keyType))
  34207. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34208. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  34209. }
  34210. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  34211. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  34212. throw Error("illegal service type in " + this.ptr.toString(!0));
  34213. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  34214. !(e && e instanceof t.Reflect.Message))
  34215. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34216. if (this.ptr.resolvedRequestType = e,
  34217. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  34218. !(e && e instanceof t.Reflect.Message))
  34219. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34220. this.ptr.resolvedResponseType = e
  34221. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  34222. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34223. return this.reset()
  34224. }
  34225. ,
  34226. a.build = function(e) {
  34227. if (this.reset(),
  34228. this.resolved || (this.resolveAll(),
  34229. this.resolved = !0,
  34230. this.result = null),
  34231. null === this.result && (this.result = this.ns.build()),
  34232. !e)
  34233. return this.result;
  34234. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34235. if (!i[t[n]]) {
  34236. i = null;
  34237. break
  34238. }
  34239. i = i[t[n]]
  34240. }
  34241. return i
  34242. }
  34243. ,
  34244. a.lookup = function(e, t) {
  34245. return e ? this.ns.resolve(e, t) : this.ns
  34246. }
  34247. ,
  34248. a.toString = function() {
  34249. return "Builder"
  34250. }
  34251. ,
  34252. o.Message = function() {}
  34253. ,
  34254. o.Enum = function() {}
  34255. ,
  34256. o.Service = function() {}
  34257. ,
  34258. o
  34259. }(r, r.Lang, r.Reflect),
  34260. r.Map = function(e, t) {
  34261. function i(e) {
  34262. var t = 0;
  34263. return {
  34264. next: function() {
  34265. return t < e.length ? {
  34266. done: !1,
  34267. value: e[t++]
  34268. } : {
  34269. done: !0
  34270. }
  34271. }
  34272. }
  34273. }
  34274. var n = function(e, i) {
  34275. if (!e.map)
  34276. throw Error("field is not a map");
  34277. if (this.field = e,
  34278. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  34279. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  34280. this.map = {},
  34281. Object.defineProperty(this, "size", {
  34282. get: function() {
  34283. return Object.keys(this.map).length
  34284. }
  34285. }),
  34286. i)
  34287. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  34288. var o = this.keyElem.valueFromString(n[r])
  34289. , a = this.valueElem.verifyValue(i[n[r]]);
  34290. this.map[this.keyElem.valueToString(o)] = {
  34291. key: o,
  34292. value: a
  34293. }
  34294. }
  34295. }
  34296. , r = n.prototype;
  34297. return r.clear = function() {
  34298. this.map = {}
  34299. }
  34300. ,
  34301. r.delete = function(e) {
  34302. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34303. , i = t in this.map;
  34304. return delete this.map[t],
  34305. i
  34306. }
  34307. ,
  34308. r.entries = function() {
  34309. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  34310. t.push([(e = this.map[n[r]]).key, e.value]);
  34311. return i(t)
  34312. }
  34313. ,
  34314. r.keys = function() {
  34315. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  34316. e.push(this.map[t[n]].key);
  34317. return i(e)
  34318. }
  34319. ,
  34320. r.values = function() {
  34321. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  34322. e.push(this.map[t[n]].value);
  34323. return i(e)
  34324. }
  34325. ,
  34326. r.forEach = function(e, t) {
  34327. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34328. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34329. }
  34330. ,
  34331. r.set = function(e, t) {
  34332. var i = this.keyElem.verifyValue(e)
  34333. , n = this.valueElem.verifyValue(t);
  34334. return this.map[this.keyElem.valueToString(i)] = {
  34335. key: i,
  34336. value: n
  34337. },
  34338. this
  34339. }
  34340. ,
  34341. r.get = function(e) {
  34342. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34343. if (t in this.map)
  34344. return this.map[t].value
  34345. }
  34346. ,
  34347. r.has = function(e) {
  34348. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34349. return t in this.map
  34350. }
  34351. ,
  34352. n
  34353. }(r, r.Reflect),
  34354. r.loadProto = function(e, t, i) {
  34355. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34356. t = void 0),
  34357. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  34358. }
  34359. ,
  34360. r.protoFromString = r.loadProto,
  34361. r.loadProtoFile = function(e, t, i) {
  34362. if (t && "object" == typeof t ? (i = t,
  34363. t = null) : t && "function" == typeof t || (t = null),
  34364. t)
  34365. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  34366. if (null === n)
  34367. return void t(Error("Failed to fetch file"));
  34368. try {
  34369. t(null, r.loadProto(n, i, e))
  34370. } catch (e) {
  34371. t(e)
  34372. }
  34373. });
  34374. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  34375. return null === n ? null : r.loadProto(n, i, e)
  34376. }
  34377. ,
  34378. r.protoFromFile = r.loadProtoFile,
  34379. r.newBuilder = function(e) {
  34380. return e = e || {},
  34381. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  34382. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  34383. new r.Builder(e)
  34384. }
  34385. ,
  34386. r.loadJson = function(e, t, i) {
  34387. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34388. t = null),
  34389. t && "object" == typeof t || (t = r.newBuilder()),
  34390. "string" == typeof e && (e = JSON.parse(e)),
  34391. t.import(e, i),
  34392. t.resolveAll(),
  34393. t
  34394. }
  34395. ,
  34396. r.loadJsonFile = function(e, t, i) {
  34397. if (t && "object" == typeof t ? (i = t,
  34398. t = null) : t && "function" == typeof t || (t = null),
  34399. t)
  34400. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  34401. if (null === n)
  34402. return void t(Error("Failed to fetch file"));
  34403. try {
  34404. t(null, r.loadJson(JSON.parse(n), i, e))
  34405. } catch (e) {
  34406. t(e)
  34407. }
  34408. });
  34409. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  34410. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  34411. }
  34412. ,
  34413. r
  34414. })
  34415. }
  34416. ).call(this, e("_process"))
  34417. }
  34418. , {
  34419. _process: 203,
  34420. bytebuffer: 215,
  34421. fs: 197,
  34422. path: 197
  34423. }],
  34424. 215: [function(e, t, i) {
  34425. !function(i, n) {
  34426. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  34427. var t;
  34428. try {
  34429. t = e("long")
  34430. } catch (e) {}
  34431. return n(t)
  34432. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  34433. }(this, function(e) {
  34434. "use strict";
  34435. function t(e) {
  34436. var t = 0;
  34437. return function() {
  34438. return t < e.length ? e.charCodeAt(t++) : null
  34439. }
  34440. }
  34441. function i() {
  34442. var e = []
  34443. , t = [];
  34444. return function() {
  34445. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  34446. e.length = 0),
  34447. void Array.prototype.push.apply(e, arguments))
  34448. }
  34449. }
  34450. function n(e, t, i, n, r) {
  34451. 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];
  34452. for (u += d,
  34453. o = p & (1 << -h) - 1,
  34454. p >>= -h,
  34455. h += s; h > 0; o = 256 * o + e[t + u],
  34456. u += d,
  34457. h -= 8)
  34458. ;
  34459. for (a = o & (1 << -h) - 1,
  34460. o >>= -h,
  34461. h += n; h > 0; a = 256 * a + e[t + u],
  34462. u += d,
  34463. h -= 8)
  34464. ;
  34465. if (0 === o)
  34466. o = 1 - c;
  34467. else {
  34468. if (o === l)
  34469. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  34470. a += Math.pow(2, n),
  34471. o -= c
  34472. }
  34473. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34474. }
  34475. function r(e, t, i, n, r, o) {
  34476. 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;
  34477. for (t = Math.abs(t),
  34478. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34479. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34480. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34481. l *= 2),
  34482. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  34483. t * l >= 2 && (a++,
  34484. l /= 2),
  34485. a + u >= h ? (s = 0,
  34486. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  34487. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34488. a = 0)); r >= 8; e[i + p] = 255 & s,
  34489. p += f,
  34490. s /= 256,
  34491. r -= 8)
  34492. ;
  34493. for (a = a << r | s,
  34494. c += r; c > 0; e[i + p] = 255 & a,
  34495. p += f,
  34496. a /= 256,
  34497. c -= 8)
  34498. ;
  34499. e[i + p - f] |= 128 * g
  34500. }
  34501. var o = function(e, t, i) {
  34502. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  34503. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  34504. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  34505. !i) {
  34506. if (e |= 0,
  34507. e < 0)
  34508. throw RangeError("Illegal capacity");
  34509. t = !!t,
  34510. i = !!i
  34511. }
  34512. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  34513. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34514. this.offset = 0,
  34515. this.markedOffset = -1,
  34516. this.limit = e,
  34517. this.littleEndian = t,
  34518. this.noAssert = i
  34519. };
  34520. o.VERSION = "5.0.1",
  34521. o.LITTLE_ENDIAN = !0,
  34522. o.BIG_ENDIAN = !1,
  34523. o.DEFAULT_CAPACITY = 16,
  34524. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  34525. o.DEFAULT_NOASSERT = !1,
  34526. o.Long = e || null;
  34527. var a = o.prototype;
  34528. a.__isByteBuffer__,
  34529. Object.defineProperty(a, "__isByteBuffer__", {
  34530. value: !0,
  34531. enumerable: !1,
  34532. configurable: !1
  34533. });
  34534. var s = new ArrayBuffer(0)
  34535. , l = String.fromCharCode;
  34536. o.accessor = function() {
  34537. return Uint8Array
  34538. }
  34539. ,
  34540. o.allocate = function(e, t, i) {
  34541. return new o(e,t,i)
  34542. }
  34543. ,
  34544. o.concat = function(e, t, i, n) {
  34545. "boolean" != typeof t && "string" == typeof t || (n = i,
  34546. i = t,
  34547. t = void 0);
  34548. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  34549. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  34550. r = e[s].limit - e[s].offset,
  34551. r > 0 && (a += r);
  34552. if (0 === a)
  34553. return new o(0,i,n);
  34554. var c, h = new o(a,i,n);
  34555. for (s = 0; s < l; )
  34556. c = e[s++],
  34557. r = c.limit - c.offset,
  34558. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  34559. h.offset += r);
  34560. return h.limit = h.offset,
  34561. h.offset = 0,
  34562. h
  34563. }
  34564. ,
  34565. o.isByteBuffer = function(e) {
  34566. return (e && e.__isByteBuffer__) === !0
  34567. }
  34568. ,
  34569. o.type = function() {
  34570. return ArrayBuffer
  34571. }
  34572. ,
  34573. o.wrap = function(e, t, i, n) {
  34574. if ("string" != typeof t && (n = i,
  34575. i = t,
  34576. t = void 0),
  34577. "string" == typeof e)
  34578. switch ("undefined" == typeof t && (t = "utf8"),
  34579. t) {
  34580. case "base64":
  34581. return o.fromBase64(e, i);
  34582. case "hex":
  34583. return o.fromHex(e, i);
  34584. case "binary":
  34585. return o.fromBinary(e, i);
  34586. case "utf8":
  34587. return o.fromUTF8(e, i);
  34588. case "debug":
  34589. return o.fromDebug(e, i);
  34590. default:
  34591. throw Error("Unsupported encoding: " + t)
  34592. }
  34593. if (null === e || "object" != typeof e)
  34594. throw TypeError("Illegal buffer");
  34595. var r;
  34596. if (o.isByteBuffer(e))
  34597. return r = a.clone.call(e),
  34598. r.markedOffset = -1,
  34599. r;
  34600. if (e instanceof Uint8Array)
  34601. r = new o(0,i,n),
  34602. e.length > 0 && (r.buffer = e.buffer,
  34603. r.offset = e.byteOffset,
  34604. r.limit = e.byteOffset + e.byteLength,
  34605. r.view = new Uint8Array(e.buffer));
  34606. else if (e instanceof ArrayBuffer)
  34607. r = new o(0,i,n),
  34608. e.byteLength > 0 && (r.buffer = e,
  34609. r.offset = 0,
  34610. r.limit = e.byteLength,
  34611. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  34612. else {
  34613. if ("[object Array]" !== Object.prototype.toString.call(e))
  34614. throw TypeError("Illegal buffer");
  34615. r = new o(e.length,i,n),
  34616. r.limit = e.length;
  34617. for (var s = 0; s < e.length; ++s)
  34618. r.view[s] = e[s]
  34619. }
  34620. return r
  34621. }
  34622. ,
  34623. a.writeBitSet = function(e, t) {
  34624. var i = "undefined" == typeof t;
  34625. if (i && (t = this.offset),
  34626. !this.noAssert) {
  34627. if (!(e instanceof Array))
  34628. throw TypeError("Illegal BitSet: Not an array");
  34629. if ("number" != typeof t || t % 1 !== 0)
  34630. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34631. if (t >>>= 0,
  34632. t < 0 || t + 0 > this.buffer.byteLength)
  34633. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34634. }
  34635. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34636. for (t += this.writeVarint32(o, t); a--; )
  34637. 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,
  34638. this.writeByte(n, t++);
  34639. if (s < o) {
  34640. var l = 0;
  34641. for (n = 0; s < o; )
  34642. n |= (1 & !!e[s++]) << l++;
  34643. this.writeByte(n, t++)
  34644. }
  34645. return i ? (this.offset = t,
  34646. this) : t - r
  34647. }
  34648. ,
  34649. a.readBitSet = function(e) {
  34650. var t = "undefined" == typeof e;
  34651. t && (e = this.offset);
  34652. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34653. for (e += n.length; o--; )
  34654. i = this.readByte(e++),
  34655. s[a++] = !!(1 & i),
  34656. s[a++] = !!(2 & i),
  34657. s[a++] = !!(4 & i),
  34658. s[a++] = !!(8 & i),
  34659. s[a++] = !!(16 & i),
  34660. s[a++] = !!(32 & i),
  34661. s[a++] = !!(64 & i),
  34662. s[a++] = !!(128 & i);
  34663. if (a < r) {
  34664. var l = 0;
  34665. for (i = this.readByte(e++); a < r; )
  34666. s[a++] = !!(i >> l++ & 1)
  34667. }
  34668. return t && (this.offset = e),
  34669. s
  34670. }
  34671. ,
  34672. a.readBytes = function(e, t) {
  34673. var i = "undefined" == typeof t;
  34674. if (i && (t = this.offset),
  34675. !this.noAssert) {
  34676. if ("number" != typeof t || t % 1 !== 0)
  34677. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34678. if (t >>>= 0,
  34679. t < 0 || t + e > this.buffer.byteLength)
  34680. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34681. }
  34682. var n = this.slice(t, t + e);
  34683. return i && (this.offset += e),
  34684. n
  34685. }
  34686. ,
  34687. a.writeBytes = a.append,
  34688. a.writeInt8 = function(e, t) {
  34689. var i = "undefined" == typeof t;
  34690. if (i && (t = this.offset),
  34691. !this.noAssert) {
  34692. if ("number" != typeof e || e % 1 !== 0)
  34693. throw TypeError("Illegal value: " + e + " (not an integer)");
  34694. if (e |= 0,
  34695. "number" != typeof t || t % 1 !== 0)
  34696. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34697. if (t >>>= 0,
  34698. t < 0 || t + 0 > this.buffer.byteLength)
  34699. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34700. }
  34701. t += 1;
  34702. var n = this.buffer.byteLength;
  34703. return t > n && this.resize((n *= 2) > t ? n : t),
  34704. t -= 1,
  34705. this.view[t] = e,
  34706. i && (this.offset += 1),
  34707. this
  34708. }
  34709. ,
  34710. a.writeByte = a.writeInt8,
  34711. a.readInt8 = function(e) {
  34712. var t = "undefined" == typeof 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,
  34718. e < 0 || e + 1 > this.buffer.byteLength)
  34719. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34720. }
  34721. var i = this.view[e];
  34722. return 128 === (128 & i) && (i = -(255 - i + 1)),
  34723. t && (this.offset += 1),
  34724. i
  34725. }
  34726. ,
  34727. a.readByte = a.readInt8,
  34728. a.writeUint8 = function(e, t) {
  34729. var i = "undefined" == typeof t;
  34730. if (i && (t = this.offset),
  34731. !this.noAssert) {
  34732. if ("number" != typeof e || e % 1 !== 0)
  34733. throw TypeError("Illegal value: " + e + " (not an integer)");
  34734. if (e >>>= 0,
  34735. "number" != typeof t || t % 1 !== 0)
  34736. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34737. if (t >>>= 0,
  34738. t < 0 || t + 0 > this.buffer.byteLength)
  34739. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34740. }
  34741. t += 1;
  34742. var n = this.buffer.byteLength;
  34743. return t > n && this.resize((n *= 2) > t ? n : t),
  34744. t -= 1,
  34745. this.view[t] = e,
  34746. i && (this.offset += 1),
  34747. this
  34748. }
  34749. ,
  34750. a.writeUInt8 = a.writeUint8,
  34751. a.readUint8 = function(e) {
  34752. var t = "undefined" == typeof e;
  34753. if (t && (e = this.offset),
  34754. !this.noAssert) {
  34755. if ("number" != typeof e || e % 1 !== 0)
  34756. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34757. if (e >>>= 0,
  34758. e < 0 || e + 1 > this.buffer.byteLength)
  34759. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34760. }
  34761. var i = this.view[e];
  34762. return t && (this.offset += 1),
  34763. i
  34764. }
  34765. ,
  34766. a.readUInt8 = a.readUint8,
  34767. a.writeInt16 = function(e, t) {
  34768. var i = "undefined" == typeof t;
  34769. if (i && (t = this.offset),
  34770. !this.noAssert) {
  34771. if ("number" != typeof e || e % 1 !== 0)
  34772. throw TypeError("Illegal value: " + e + " (not an integer)");
  34773. if (e |= 0,
  34774. "number" != typeof t || t % 1 !== 0)
  34775. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34776. if (t >>>= 0,
  34777. t < 0 || t + 0 > this.buffer.byteLength)
  34778. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34779. }
  34780. t += 2;
  34781. var n = this.buffer.byteLength;
  34782. return t > n && this.resize((n *= 2) > t ? n : t),
  34783. t -= 2,
  34784. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34785. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34786. this.view[t + 1] = 255 & e),
  34787. i && (this.offset += 2),
  34788. this
  34789. }
  34790. ,
  34791. a.writeShort = a.writeInt16,
  34792. a.readInt16 = function(e) {
  34793. var t = "undefined" == typeof e;
  34794. if (t && (e = this.offset),
  34795. !this.noAssert) {
  34796. if ("number" != typeof e || e % 1 !== 0)
  34797. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34798. if (e >>>= 0,
  34799. e < 0 || e + 2 > this.buffer.byteLength)
  34800. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34801. }
  34802. var i = 0;
  34803. return this.littleEndian ? (i = this.view[e],
  34804. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34805. i |= this.view[e + 1]),
  34806. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  34807. t && (this.offset += 2),
  34808. i
  34809. }
  34810. ,
  34811. a.readShort = a.readInt16,
  34812. a.writeUint16 = function(e, t) {
  34813. var i = "undefined" == typeof t;
  34814. if (i && (t = this.offset),
  34815. !this.noAssert) {
  34816. if ("number" != typeof e || e % 1 !== 0)
  34817. throw TypeError("Illegal value: " + e + " (not an integer)");
  34818. if (e >>>= 0,
  34819. "number" != typeof t || t % 1 !== 0)
  34820. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34821. if (t >>>= 0,
  34822. t < 0 || t + 0 > this.buffer.byteLength)
  34823. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34824. }
  34825. t += 2;
  34826. var n = this.buffer.byteLength;
  34827. return t > n && this.resize((n *= 2) > t ? n : t),
  34828. t -= 2,
  34829. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34830. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34831. this.view[t + 1] = 255 & e),
  34832. i && (this.offset += 2),
  34833. this
  34834. }
  34835. ,
  34836. a.writeUInt16 = a.writeUint16,
  34837. a.readUint16 = function(e) {
  34838. var t = "undefined" == typeof e;
  34839. if (t && (e = this.offset),
  34840. !this.noAssert) {
  34841. if ("number" != typeof e || e % 1 !== 0)
  34842. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34843. if (e >>>= 0,
  34844. e < 0 || e + 2 > this.buffer.byteLength)
  34845. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34846. }
  34847. var i = 0;
  34848. return this.littleEndian ? (i = this.view[e],
  34849. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34850. i |= this.view[e + 1]),
  34851. t && (this.offset += 2),
  34852. i
  34853. }
  34854. ,
  34855. a.readUInt16 = a.readUint16,
  34856. a.writeInt32 = function(e, t) {
  34857. var i = "undefined" == typeof t;
  34858. if (i && (t = this.offset),
  34859. !this.noAssert) {
  34860. if ("number" != typeof e || e % 1 !== 0)
  34861. throw TypeError("Illegal value: " + e + " (not an integer)");
  34862. if (e |= 0,
  34863. "number" != typeof t || t % 1 !== 0)
  34864. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34865. if (t >>>= 0,
  34866. t < 0 || t + 0 > this.buffer.byteLength)
  34867. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34868. }
  34869. t += 4;
  34870. var n = this.buffer.byteLength;
  34871. return t > n && this.resize((n *= 2) > t ? n : t),
  34872. t -= 4,
  34873. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34874. this.view[t + 2] = e >>> 16 & 255,
  34875. this.view[t + 1] = e >>> 8 & 255,
  34876. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34877. this.view[t + 1] = e >>> 16 & 255,
  34878. this.view[t + 2] = e >>> 8 & 255,
  34879. this.view[t + 3] = 255 & e),
  34880. i && (this.offset += 4),
  34881. this
  34882. }
  34883. ,
  34884. a.writeInt = a.writeInt32,
  34885. a.readInt32 = function(e) {
  34886. var t = "undefined" == typeof e;
  34887. if (t && (e = this.offset),
  34888. !this.noAssert) {
  34889. if ("number" != typeof e || e % 1 !== 0)
  34890. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34891. if (e >>>= 0,
  34892. e < 0 || e + 4 > this.buffer.byteLength)
  34893. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34894. }
  34895. var i = 0;
  34896. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34897. i |= this.view[e + 1] << 8,
  34898. i |= this.view[e],
  34899. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34900. i |= this.view[e + 2] << 8,
  34901. i |= this.view[e + 3],
  34902. i += this.view[e] << 24 >>> 0),
  34903. i |= 0,
  34904. t && (this.offset += 4),
  34905. i
  34906. }
  34907. ,
  34908. a.readInt = a.readInt32,
  34909. a.writeUint32 = function(e, t) {
  34910. var i = "undefined" == typeof t;
  34911. if (i && (t = this.offset),
  34912. !this.noAssert) {
  34913. if ("number" != typeof e || e % 1 !== 0)
  34914. throw TypeError("Illegal value: " + e + " (not an integer)");
  34915. if (e >>>= 0,
  34916. "number" != typeof t || t % 1 !== 0)
  34917. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34918. if (t >>>= 0,
  34919. t < 0 || t + 0 > this.buffer.byteLength)
  34920. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34921. }
  34922. t += 4;
  34923. var n = this.buffer.byteLength;
  34924. return t > n && this.resize((n *= 2) > t ? n : t),
  34925. t -= 4,
  34926. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34927. this.view[t + 2] = e >>> 16 & 255,
  34928. this.view[t + 1] = e >>> 8 & 255,
  34929. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34930. this.view[t + 1] = e >>> 16 & 255,
  34931. this.view[t + 2] = e >>> 8 & 255,
  34932. this.view[t + 3] = 255 & e),
  34933. i && (this.offset += 4),
  34934. this
  34935. }
  34936. ,
  34937. a.writeUInt32 = a.writeUint32,
  34938. a.readUint32 = function(e) {
  34939. var t = "undefined" == typeof e;
  34940. if (t && (e = this.offset),
  34941. !this.noAssert) {
  34942. if ("number" != typeof e || e % 1 !== 0)
  34943. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34944. if (e >>>= 0,
  34945. e < 0 || e + 4 > this.buffer.byteLength)
  34946. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34947. }
  34948. var i = 0;
  34949. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34950. i |= this.view[e + 1] << 8,
  34951. i |= this.view[e],
  34952. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34953. i |= this.view[e + 2] << 8,
  34954. i |= this.view[e + 3],
  34955. i += this.view[e] << 24 >>> 0),
  34956. t && (this.offset += 4),
  34957. i
  34958. }
  34959. ,
  34960. a.readUInt32 = a.readUint32,
  34961. e && (a.writeInt64 = function(t, i) {
  34962. var n = "undefined" == typeof i;
  34963. if (n && (i = this.offset),
  34964. !this.noAssert) {
  34965. if ("number" == typeof t)
  34966. t = e.fromNumber(t);
  34967. else if ("string" == typeof t)
  34968. t = e.fromString(t);
  34969. else if (!(t && t instanceof e))
  34970. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  34971. if ("number" != typeof i || i % 1 !== 0)
  34972. throw TypeError("Illegal offset: " + i + " (not an integer)");
  34973. if (i >>>= 0,
  34974. i < 0 || i + 0 > this.buffer.byteLength)
  34975. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  34976. }
  34977. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  34978. i += 8;
  34979. var r = this.buffer.byteLength;
  34980. i > r && this.resize((r *= 2) > i ? r : i),
  34981. i -= 8;
  34982. var o = t.low
  34983. , a = t.high;
  34984. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  34985. this.view[i + 2] = o >>> 16 & 255,
  34986. this.view[i + 1] = o >>> 8 & 255,
  34987. this.view[i] = 255 & o,
  34988. i += 4,
  34989. this.view[i + 3] = a >>> 24 & 255,
  34990. this.view[i + 2] = a >>> 16 & 255,
  34991. this.view[i + 1] = a >>> 8 & 255,
  34992. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  34993. this.view[i + 1] = a >>> 16 & 255,
  34994. this.view[i + 2] = a >>> 8 & 255,
  34995. this.view[i + 3] = 255 & a,
  34996. i += 4,
  34997. this.view[i] = o >>> 24 & 255,
  34998. this.view[i + 1] = o >>> 16 & 255,
  34999. this.view[i + 2] = o >>> 8 & 255,
  35000. this.view[i + 3] = 255 & o),
  35001. n && (this.offset += 8),
  35002. this
  35003. }
  35004. ,
  35005. a.writeLong = a.writeInt64,
  35006. a.readInt64 = function(t) {
  35007. var i = "undefined" == typeof t;
  35008. if (i && (t = this.offset),
  35009. !this.noAssert) {
  35010. if ("number" != typeof t || t % 1 !== 0)
  35011. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35012. if (t >>>= 0,
  35013. t < 0 || t + 8 > this.buffer.byteLength)
  35014. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  35015. }
  35016. var n = 0
  35017. , r = 0;
  35018. this.littleEndian ? (n = this.view[t + 2] << 16,
  35019. n |= this.view[t + 1] << 8,
  35020. n |= this.view[t],
  35021. n += this.view[t + 3] << 24 >>> 0,
  35022. t += 4,
  35023. r = this.view[t + 2] << 16,
  35024. r |= this.view[t + 1] << 8,
  35025. r |= this.view[t],
  35026. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  35027. r |= this.view[t + 2] << 8,
  35028. r |= this.view[t + 3],
  35029. r += this.view[t] << 24 >>> 0,
  35030. t += 4,
  35031. n = this.view[t + 1] << 16,
  35032. n |= this.view[t + 2] << 8,
  35033. n |= this.view[t + 3],
  35034. n += this.view[t] << 24 >>> 0);
  35035. var o = new e(n,r,!1);
  35036. return i && (this.offset += 8),
  35037. o
  35038. }
  35039. ,
  35040. a.readLong = a.readInt64,
  35041. a.writeUint64 = function(t, i) {
  35042. var n = "undefined" == typeof i;
  35043. if (n && (i = this.offset),
  35044. !this.noAssert) {
  35045. if ("number" == typeof t)
  35046. t = e.fromNumber(t);
  35047. else if ("string" == typeof t)
  35048. t = e.fromString(t);
  35049. else if (!(t && t instanceof e))
  35050. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35051. if ("number" != typeof i || i % 1 !== 0)
  35052. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35053. if (i >>>= 0,
  35054. i < 0 || i + 0 > this.buffer.byteLength)
  35055. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35056. }
  35057. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  35058. i += 8;
  35059. var r = this.buffer.byteLength;
  35060. i > r && this.resize((r *= 2) > i ? r : i),
  35061. i -= 8;
  35062. var o = t.low
  35063. , a = t.high;
  35064. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  35065. this.view[i + 2] = o >>> 16 & 255,
  35066. this.view[i + 1] = o >>> 8 & 255,
  35067. this.view[i] = 255 & o,
  35068. i += 4,
  35069. this.view[i + 3] = a >>> 24 & 255,
  35070. this.view[i + 2] = a >>> 16 & 255,
  35071. this.view[i + 1] = a >>> 8 & 255,
  35072. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  35073. this.view[i + 1] = a >>> 16 & 255,
  35074. this.view[i + 2] = a >>> 8 & 255,
  35075. this.view[i + 3] = 255 & a,
  35076. i += 4,
  35077. this.view[i] = o >>> 24 & 255,
  35078. this.view[i + 1] = o >>> 16 & 255,
  35079. this.view[i + 2] = o >>> 8 & 255,
  35080. this.view[i + 3] = 255 & o),
  35081. n && (this.offset += 8),
  35082. this
  35083. }
  35084. ,
  35085. a.writeUInt64 = a.writeUint64,
  35086. a.readUint64 = function(t) {
  35087. var i = "undefined" == typeof t;
  35088. if (i && (t = this.offset),
  35089. !this.noAssert) {
  35090. if ("number" != typeof t || t % 1 !== 0)
  35091. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35092. if (t >>>= 0,
  35093. t < 0 || t + 8 > this.buffer.byteLength)
  35094. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  35095. }
  35096. var n = 0
  35097. , r = 0;
  35098. this.littleEndian ? (n = this.view[t + 2] << 16,
  35099. n |= this.view[t + 1] << 8,
  35100. n |= this.view[t],
  35101. n += this.view[t + 3] << 24 >>> 0,
  35102. t += 4,
  35103. r = this.view[t + 2] << 16,
  35104. r |= this.view[t + 1] << 8,
  35105. r |= this.view[t],
  35106. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  35107. r |= this.view[t + 2] << 8,
  35108. r |= this.view[t + 3],
  35109. r += this.view[t] << 24 >>> 0,
  35110. t += 4,
  35111. n = this.view[t + 1] << 16,
  35112. n |= this.view[t + 2] << 8,
  35113. n |= this.view[t + 3],
  35114. n += this.view[t] << 24 >>> 0);
  35115. var o = new e(n,r,!0);
  35116. return i && (this.offset += 8),
  35117. o
  35118. }
  35119. ,
  35120. a.readUInt64 = a.readUint64),
  35121. a.writeFloat32 = function(e, t) {
  35122. var i = "undefined" == typeof t;
  35123. if (i && (t = this.offset),
  35124. !this.noAssert) {
  35125. if ("number" != typeof e)
  35126. throw TypeError("Illegal value: " + e + " (not a number)");
  35127. if ("number" != typeof t || t % 1 !== 0)
  35128. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35129. if (t >>>= 0,
  35130. t < 0 || t + 0 > this.buffer.byteLength)
  35131. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35132. }
  35133. t += 4;
  35134. var n = this.buffer.byteLength;
  35135. return t > n && this.resize((n *= 2) > t ? n : t),
  35136. t -= 4,
  35137. r(this.view, e, t, this.littleEndian, 23, 4),
  35138. i && (this.offset += 4),
  35139. this
  35140. }
  35141. ,
  35142. a.writeFloat = a.writeFloat32,
  35143. a.readFloat32 = function(e) {
  35144. var t = "undefined" == typeof e;
  35145. if (t && (e = this.offset),
  35146. !this.noAssert) {
  35147. if ("number" != typeof e || e % 1 !== 0)
  35148. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35149. if (e >>>= 0,
  35150. e < 0 || e + 4 > this.buffer.byteLength)
  35151. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35152. }
  35153. var i = n(this.view, e, this.littleEndian, 23, 4);
  35154. return t && (this.offset += 4),
  35155. i
  35156. }
  35157. ,
  35158. a.readFloat = a.readFloat32,
  35159. a.writeFloat64 = function(e, t) {
  35160. var i = "undefined" == typeof t;
  35161. if (i && (t = this.offset),
  35162. !this.noAssert) {
  35163. if ("number" != typeof e)
  35164. throw TypeError("Illegal value: " + e + " (not a number)");
  35165. if ("number" != typeof t || t % 1 !== 0)
  35166. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35167. if (t >>>= 0,
  35168. t < 0 || t + 0 > this.buffer.byteLength)
  35169. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35170. }
  35171. t += 8;
  35172. var n = this.buffer.byteLength;
  35173. return t > n && this.resize((n *= 2) > t ? n : t),
  35174. t -= 8,
  35175. r(this.view, e, t, this.littleEndian, 52, 8),
  35176. i && (this.offset += 8),
  35177. this
  35178. }
  35179. ,
  35180. a.writeDouble = a.writeFloat64,
  35181. a.readFloat64 = function(e) {
  35182. var t = "undefined" == typeof e;
  35183. if (t && (e = this.offset),
  35184. !this.noAssert) {
  35185. if ("number" != typeof e || e % 1 !== 0)
  35186. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35187. if (e >>>= 0,
  35188. e < 0 || e + 8 > this.buffer.byteLength)
  35189. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35190. }
  35191. var i = n(this.view, e, this.littleEndian, 52, 8);
  35192. return t && (this.offset += 8),
  35193. i
  35194. }
  35195. ,
  35196. a.readDouble = a.readFloat64,
  35197. o.MAX_VARINT32_BYTES = 5,
  35198. o.calculateVarint32 = function(e) {
  35199. return e >>>= 0,
  35200. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35201. }
  35202. ,
  35203. o.zigZagEncode32 = function(e) {
  35204. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35205. }
  35206. ,
  35207. o.zigZagDecode32 = function(e) {
  35208. return e >>> 1 ^ -(1 & e) | 0
  35209. }
  35210. ,
  35211. a.writeVarint32 = function(e, t) {
  35212. var i = "undefined" == typeof t;
  35213. if (i && (t = this.offset),
  35214. !this.noAssert) {
  35215. if ("number" != typeof e || e % 1 !== 0)
  35216. throw TypeError("Illegal value: " + e + " (not an integer)");
  35217. if (e |= 0,
  35218. "number" != typeof t || t % 1 !== 0)
  35219. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35220. if (t >>>= 0,
  35221. t < 0 || t + 0 > this.buffer.byteLength)
  35222. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35223. }
  35224. var n, r = o.calculateVarint32(e);
  35225. t += r;
  35226. var a = this.buffer.byteLength;
  35227. for (t > a && this.resize((a *= 2) > t ? a : t),
  35228. t -= r,
  35229. e >>>= 0; e >= 128; )
  35230. n = 127 & e | 128,
  35231. this.view[t++] = n,
  35232. e >>>= 7;
  35233. return this.view[t++] = e,
  35234. i ? (this.offset = t,
  35235. this) : r
  35236. }
  35237. ,
  35238. a.writeVarint32ZigZag = function(e, t) {
  35239. return this.writeVarint32(o.zigZagEncode32(e), t)
  35240. }
  35241. ,
  35242. a.readVarint32 = function(e) {
  35243. var t = "undefined" == typeof e;
  35244. if (t && (e = this.offset),
  35245. !this.noAssert) {
  35246. if ("number" != typeof e || e % 1 !== 0)
  35247. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35248. if (e >>>= 0,
  35249. e < 0 || e + 1 > this.buffer.byteLength)
  35250. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35251. }
  35252. var i, n = 0, r = 0;
  35253. do {
  35254. if (!this.noAssert && e > this.limit) {
  35255. var o = Error("Truncated");
  35256. throw o.truncated = !0,
  35257. o
  35258. }
  35259. i = this.view[e++],
  35260. n < 5 && (r |= (127 & i) << 7 * n),
  35261. ++n
  35262. } while (0 !== (128 & i));return r |= 0,
  35263. t ? (this.offset = e,
  35264. r) : {
  35265. value: r,
  35266. length: n
  35267. }
  35268. }
  35269. ,
  35270. a.readVarint32ZigZag = function(e) {
  35271. var t = this.readVarint32(e);
  35272. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  35273. t
  35274. }
  35275. ,
  35276. e && (o.MAX_VARINT64_BYTES = 10,
  35277. o.calculateVarint64 = function(t) {
  35278. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  35279. var i = t.toInt() >>> 0
  35280. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  35281. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  35282. return 0 == r ? 0 == n ? i < 16384 ? i < 128 ? 1 : 2 : i < 1 << 21 ? 3 : 4 : n < 16384 ? n < 128 ? 5 : 6 : n < 1 << 21 ? 7 : 8 : r < 128 ? 9 : 10
  35283. }
  35284. ,
  35285. o.zigZagEncode64 = function(t) {
  35286. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  35287. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  35288. }
  35289. ,
  35290. o.zigZagDecode64 = function(t) {
  35291. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  35292. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  35293. }
  35294. ,
  35295. a.writeVarint64 = function(t, i) {
  35296. var n = "undefined" == typeof i;
  35297. if (n && (i = this.offset),
  35298. !this.noAssert) {
  35299. if ("number" == typeof t)
  35300. t = e.fromNumber(t);
  35301. else if ("string" == typeof t)
  35302. t = e.fromString(t);
  35303. else if (!(t && t instanceof e))
  35304. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35305. if ("number" != typeof i || i % 1 !== 0)
  35306. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35307. if (i >>>= 0,
  35308. i < 0 || i + 0 > this.buffer.byteLength)
  35309. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35310. }
  35311. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  35312. var r = o.calculateVarint64(t)
  35313. , a = t.toInt() >>> 0
  35314. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  35315. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  35316. i += r;
  35317. var c = this.buffer.byteLength;
  35318. switch (i > c && this.resize((c *= 2) > i ? c : i),
  35319. i -= r,
  35320. r) {
  35321. case 10:
  35322. this.view[i + 9] = l >>> 7 & 1;
  35323. case 9:
  35324. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  35325. case 8:
  35326. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  35327. case 7:
  35328. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  35329. case 6:
  35330. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  35331. case 5:
  35332. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  35333. case 4:
  35334. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  35335. case 3:
  35336. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  35337. case 2:
  35338. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  35339. case 1:
  35340. this.view[i] = 1 !== r ? 128 | a : 127 & a
  35341. }
  35342. return n ? (this.offset += r,
  35343. this) : r
  35344. }
  35345. ,
  35346. a.writeVarint64ZigZag = function(e, t) {
  35347. return this.writeVarint64(o.zigZagEncode64(e), t)
  35348. }
  35349. ,
  35350. a.readVarint64 = function(t) {
  35351. var i = "undefined" == typeof t;
  35352. if (i && (t = this.offset),
  35353. !this.noAssert) {
  35354. if ("number" != typeof t || t % 1 !== 0)
  35355. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35356. if (t >>>= 0,
  35357. t < 0 || t + 1 > this.buffer.byteLength)
  35358. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  35359. }
  35360. var n = t
  35361. , r = 0
  35362. , o = 0
  35363. , a = 0
  35364. , s = 0;
  35365. if (s = this.view[t++],
  35366. r = 127 & s,
  35367. 128 & s && (s = this.view[t++],
  35368. r |= (127 & s) << 7,
  35369. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35370. r |= (127 & s) << 14,
  35371. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35372. r |= (127 & s) << 21,
  35373. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35374. o = 127 & s,
  35375. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35376. o |= (127 & s) << 7,
  35377. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35378. o |= (127 & s) << 14,
  35379. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35380. o |= (127 & s) << 21,
  35381. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35382. a = 127 & s,
  35383. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35384. a |= (127 & s) << 7,
  35385. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  35386. throw Error("Buffer overrun");
  35387. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  35388. return i ? (this.offset = t,
  35389. l) : {
  35390. value: l,
  35391. length: t - n
  35392. }
  35393. }
  35394. ,
  35395. a.readVarint64ZigZag = function(t) {
  35396. var i = this.readVarint64(t);
  35397. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  35398. i
  35399. }
  35400. ),
  35401. a.writeCString = function(e, i) {
  35402. var n = "undefined" == typeof i;
  35403. n && (i = this.offset);
  35404. var r, o = e.length;
  35405. if (!this.noAssert) {
  35406. if ("string" != typeof e)
  35407. throw TypeError("Illegal str: Not a string");
  35408. for (r = 0; r < o; ++r)
  35409. if (0 === e.charCodeAt(r))
  35410. throw RangeError("Illegal str: Contains NULL-characters");
  35411. if ("number" != typeof i || i % 1 !== 0)
  35412. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35413. if (i >>>= 0,
  35414. i < 0 || i + 0 > this.buffer.byteLength)
  35415. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35416. }
  35417. o = h.calculateUTF16asUTF8(t(e))[1],
  35418. i += o + 1;
  35419. var a = this.buffer.byteLength;
  35420. return i > a && this.resize((a *= 2) > i ? a : i),
  35421. i -= o + 1,
  35422. h.encodeUTF16toUTF8(t(e), function(e) {
  35423. this.view[i++] = e
  35424. }
  35425. .bind(this)),
  35426. this.view[i++] = 0,
  35427. n ? (this.offset = i,
  35428. this) : o
  35429. }
  35430. ,
  35431. a.readCString = function(e) {
  35432. var t = "undefined" == typeof e;
  35433. if (t && (e = this.offset),
  35434. !this.noAssert) {
  35435. if ("number" != typeof e || e % 1 !== 0)
  35436. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35437. if (e >>>= 0,
  35438. e < 0 || e + 1 > this.buffer.byteLength)
  35439. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35440. }
  35441. var n, r = e, o = -1;
  35442. return h.decodeUTF8toUTF16(function() {
  35443. if (0 === o)
  35444. return null;
  35445. if (e >= this.limit)
  35446. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35447. return o = this.view[e++],
  35448. 0 === o ? null : o
  35449. }
  35450. .bind(this), n = i(), !0),
  35451. t ? (this.offset = e,
  35452. n()) : {
  35453. string: n(),
  35454. length: e - r
  35455. }
  35456. }
  35457. ,
  35458. a.writeIString = function(e, i) {
  35459. var n = "undefined" == typeof i;
  35460. if (n && (i = this.offset),
  35461. !this.noAssert) {
  35462. if ("string" != typeof e)
  35463. throw TypeError("Illegal str: Not a string");
  35464. if ("number" != typeof i || i % 1 !== 0)
  35465. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35466. if (i >>>= 0,
  35467. i < 0 || i + 0 > this.buffer.byteLength)
  35468. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35469. }
  35470. var r, o = i;
  35471. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  35472. i += 4 + r;
  35473. var a = this.buffer.byteLength;
  35474. if (i > a && this.resize((a *= 2) > i ? a : i),
  35475. i -= 4 + r,
  35476. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  35477. this.view[i + 2] = r >>> 16 & 255,
  35478. this.view[i + 1] = r >>> 8 & 255,
  35479. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  35480. this.view[i + 1] = r >>> 16 & 255,
  35481. this.view[i + 2] = r >>> 8 & 255,
  35482. this.view[i + 3] = 255 & r),
  35483. i += 4,
  35484. h.encodeUTF16toUTF8(t(e), function(e) {
  35485. this.view[i++] = e
  35486. }
  35487. .bind(this)),
  35488. i !== o + 4 + r)
  35489. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  35490. return n ? (this.offset = i,
  35491. this) : i - o
  35492. }
  35493. ,
  35494. a.readIString = function(e) {
  35495. var t = "undefined" == typeof e;
  35496. if (t && (e = this.offset),
  35497. !this.noAssert) {
  35498. if ("number" != typeof e || e % 1 !== 0)
  35499. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35500. if (e >>>= 0,
  35501. e < 0 || e + 4 > this.buffer.byteLength)
  35502. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35503. }
  35504. var i = e
  35505. , n = this.readUint32(e)
  35506. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  35507. return e += r.length,
  35508. t ? (this.offset = e,
  35509. r.string) : {
  35510. string: r.string,
  35511. length: e - i
  35512. }
  35513. }
  35514. ,
  35515. o.METRICS_CHARS = "c",
  35516. o.METRICS_BYTES = "b",
  35517. a.writeUTF8String = function(e, i) {
  35518. var n = "undefined" == typeof i;
  35519. if (n && (i = this.offset),
  35520. !this.noAssert) {
  35521. if ("number" != typeof i || i % 1 !== 0)
  35522. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35523. if (i >>>= 0,
  35524. i < 0 || i + 0 > this.buffer.byteLength)
  35525. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35526. }
  35527. var r, o = i;
  35528. r = h.calculateUTF16asUTF8(t(e))[1],
  35529. i += r;
  35530. var a = this.buffer.byteLength;
  35531. return i > a && this.resize((a *= 2) > i ? a : i),
  35532. i -= r,
  35533. h.encodeUTF16toUTF8(t(e), function(e) {
  35534. this.view[i++] = e
  35535. }
  35536. .bind(this)),
  35537. n ? (this.offset = i,
  35538. this) : i - o
  35539. }
  35540. ,
  35541. a.writeString = a.writeUTF8String,
  35542. o.calculateUTF8Chars = function(e) {
  35543. return h.calculateUTF16asUTF8(t(e))[0]
  35544. }
  35545. ,
  35546. o.calculateUTF8Bytes = function(e) {
  35547. return h.calculateUTF16asUTF8(t(e))[1]
  35548. }
  35549. ,
  35550. o.calculateString = o.calculateUTF8Bytes,
  35551. a.readUTF8String = function(e, t, n) {
  35552. "number" == typeof t && (n = t,
  35553. t = void 0);
  35554. var r = "undefined" == typeof n;
  35555. if (r && (n = this.offset),
  35556. "undefined" == typeof t && (t = o.METRICS_CHARS),
  35557. !this.noAssert) {
  35558. if ("number" != typeof e || e % 1 !== 0)
  35559. throw TypeError("Illegal length: " + e + " (not an integer)");
  35560. if (e |= 0,
  35561. "number" != typeof n || n % 1 !== 0)
  35562. throw TypeError("Illegal offset: " + n + " (not an integer)");
  35563. if (n >>>= 0,
  35564. n < 0 || n + 0 > this.buffer.byteLength)
  35565. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  35566. }
  35567. var a, s = 0, l = n;
  35568. if (t === o.METRICS_CHARS) {
  35569. if (a = i(),
  35570. h.decodeUTF8(function() {
  35571. return s < e && n < this.limit ? this.view[n++] : null
  35572. }
  35573. .bind(this), function(e) {
  35574. ++s,
  35575. h.UTF8toUTF16(e, a)
  35576. }),
  35577. s !== e)
  35578. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  35579. return r ? (this.offset = n,
  35580. a()) : {
  35581. string: a(),
  35582. length: n - l
  35583. }
  35584. }
  35585. if (t === o.METRICS_BYTES) {
  35586. if (!this.noAssert) {
  35587. if ("number" != typeof n || n % 1 !== 0)
  35588. throw TypeError("Illegal offset: " + n + " (not an integer)");
  35589. if (n >>>= 0,
  35590. n < 0 || n + e > this.buffer.byteLength)
  35591. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  35592. }
  35593. var c = n + e;
  35594. if (h.decodeUTF8toUTF16(function() {
  35595. return n < c ? this.view[n++] : null
  35596. }
  35597. .bind(this), a = i(), this.noAssert),
  35598. n !== c)
  35599. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  35600. return r ? (this.offset = n,
  35601. a()) : {
  35602. string: a(),
  35603. length: n - l
  35604. }
  35605. }
  35606. throw TypeError("Unsupported metrics: " + t)
  35607. }
  35608. ,
  35609. a.readString = a.readUTF8String,
  35610. a.writeVString = function(e, i) {
  35611. var n = "undefined" == typeof i;
  35612. if (n && (i = this.offset),
  35613. !this.noAssert) {
  35614. if ("string" != typeof e)
  35615. throw TypeError("Illegal str: Not a string");
  35616. if ("number" != typeof i || i % 1 !== 0)
  35617. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35618. if (i >>>= 0,
  35619. i < 0 || i + 0 > this.buffer.byteLength)
  35620. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35621. }
  35622. var r, a, s = i;
  35623. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  35624. a = o.calculateVarint32(r),
  35625. i += a + r;
  35626. var l = this.buffer.byteLength;
  35627. if (i > l && this.resize((l *= 2) > i ? l : i),
  35628. i -= a + r,
  35629. i += this.writeVarint32(r, i),
  35630. h.encodeUTF16toUTF8(t(e), function(e) {
  35631. this.view[i++] = e
  35632. }
  35633. .bind(this)),
  35634. i !== s + r + a)
  35635. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  35636. return n ? (this.offset = i,
  35637. this) : i - s
  35638. }
  35639. ,
  35640. a.readVString = function(e) {
  35641. var t = "undefined" == typeof e;
  35642. if (t && (e = this.offset),
  35643. !this.noAssert) {
  35644. if ("number" != typeof e || e % 1 !== 0)
  35645. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35646. if (e >>>= 0,
  35647. e < 0 || e + 1 > this.buffer.byteLength)
  35648. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35649. }
  35650. var i = e
  35651. , n = this.readVarint32(e)
  35652. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  35653. return e += r.length,
  35654. t ? (this.offset = e,
  35655. r.string) : {
  35656. string: r.string,
  35657. length: e - i
  35658. }
  35659. }
  35660. ,
  35661. a.append = function(e, t, i) {
  35662. "number" != typeof t && "string" == typeof t || (i = t,
  35663. t = void 0);
  35664. var n = "undefined" == typeof i;
  35665. if (n && (i = this.offset),
  35666. !this.noAssert) {
  35667. if ("number" != typeof i || i % 1 !== 0)
  35668. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35669. if (i >>>= 0,
  35670. i < 0 || i + 0 > this.buffer.byteLength)
  35671. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35672. }
  35673. e instanceof o || (e = o.wrap(e, t));
  35674. var r = e.limit - e.offset;
  35675. if (r <= 0)
  35676. return this;
  35677. i += r;
  35678. var a = this.buffer.byteLength;
  35679. return i > a && this.resize((a *= 2) > i ? a : i),
  35680. i -= r,
  35681. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35682. e.offset += r,
  35683. n && (this.offset += r),
  35684. this
  35685. }
  35686. ,
  35687. a.appendTo = function(e, t) {
  35688. return e.append(this, t),
  35689. this
  35690. }
  35691. ,
  35692. a.assert = function(e) {
  35693. return this.noAssert = !e,
  35694. this
  35695. }
  35696. ,
  35697. a.capacity = function() {
  35698. return this.buffer.byteLength
  35699. }
  35700. ,
  35701. a.clear = function() {
  35702. return this.offset = 0,
  35703. this.limit = this.buffer.byteLength,
  35704. this.markedOffset = -1,
  35705. this
  35706. }
  35707. ,
  35708. a.clone = function(e) {
  35709. var t = new o(0,this.littleEndian,this.noAssert);
  35710. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35711. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35712. t.view = this.view),
  35713. t.offset = this.offset,
  35714. t.markedOffset = this.markedOffset,
  35715. t.limit = this.limit,
  35716. t
  35717. }
  35718. ,
  35719. a.compact = function(e, t) {
  35720. if ("undefined" == typeof e && (e = this.offset),
  35721. "undefined" == typeof t && (t = this.limit),
  35722. !this.noAssert) {
  35723. if ("number" != typeof e || e % 1 !== 0)
  35724. throw TypeError("Illegal begin: Not an integer");
  35725. if (e >>>= 0,
  35726. "number" != typeof t || t % 1 !== 0)
  35727. throw TypeError("Illegal end: Not an integer");
  35728. if (t >>>= 0,
  35729. e < 0 || e > t || t > this.buffer.byteLength)
  35730. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35731. }
  35732. if (0 === e && t === this.buffer.byteLength)
  35733. return this;
  35734. var i = t - e;
  35735. if (0 === i)
  35736. return this.buffer = s,
  35737. this.view = null,
  35738. this.markedOffset >= 0 && (this.markedOffset -= e),
  35739. this.offset = 0,
  35740. this.limit = 0,
  35741. this;
  35742. var n = new ArrayBuffer(i)
  35743. , r = new Uint8Array(n);
  35744. return r.set(this.view.subarray(e, t)),
  35745. this.buffer = n,
  35746. this.view = r,
  35747. this.markedOffset >= 0 && (this.markedOffset -= e),
  35748. this.offset = 0,
  35749. this.limit = i,
  35750. this
  35751. }
  35752. ,
  35753. a.copy = function(e, t) {
  35754. if ("undefined" == typeof e && (e = this.offset),
  35755. "undefined" == typeof t && (t = this.limit),
  35756. !this.noAssert) {
  35757. if ("number" != typeof e || e % 1 !== 0)
  35758. throw TypeError("Illegal begin: Not an integer");
  35759. if (e >>>= 0,
  35760. "number" != typeof t || t % 1 !== 0)
  35761. throw TypeError("Illegal end: Not an integer");
  35762. if (t >>>= 0,
  35763. e < 0 || e > t || t > this.buffer.byteLength)
  35764. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35765. }
  35766. if (e === t)
  35767. return new o(0,this.littleEndian,this.noAssert);
  35768. var i = t - e
  35769. , n = new o(i,this.littleEndian,this.noAssert);
  35770. return n.offset = 0,
  35771. n.limit = i,
  35772. n.markedOffset >= 0 && (n.markedOffset -= e),
  35773. this.copyTo(n, 0, e, t),
  35774. n
  35775. }
  35776. ,
  35777. a.copyTo = function(e, t, i, n) {
  35778. var r, a;
  35779. if (!this.noAssert && !o.isByteBuffer(e))
  35780. throw TypeError("Illegal target: Not a ByteBuffer");
  35781. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  35782. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  35783. n = "undefined" == typeof n ? this.limit : 0 | n,
  35784. t < 0 || t > e.buffer.byteLength)
  35785. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35786. if (i < 0 || n > this.buffer.byteLength)
  35787. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35788. var s = n - i;
  35789. return 0 === s ? e : (e.ensureCapacity(t + s),
  35790. e.view.set(this.view.subarray(i, n), t),
  35791. r && (this.offset += s),
  35792. a && (e.offset += s),
  35793. this)
  35794. }
  35795. ,
  35796. a.ensureCapacity = function(e) {
  35797. var t = this.buffer.byteLength;
  35798. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35799. }
  35800. ,
  35801. a.fill = function(e, t, i) {
  35802. var n = "undefined" == typeof t;
  35803. if (n && (t = this.offset),
  35804. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  35805. "undefined" == typeof t && (t = this.offset),
  35806. "undefined" == typeof i && (i = this.limit),
  35807. !this.noAssert) {
  35808. if ("number" != typeof e || e % 1 !== 0)
  35809. throw TypeError("Illegal value: " + e + " (not an integer)");
  35810. if (e |= 0,
  35811. "number" != typeof t || t % 1 !== 0)
  35812. throw TypeError("Illegal begin: Not an integer");
  35813. if (t >>>= 0,
  35814. "number" != typeof i || i % 1 !== 0)
  35815. throw TypeError("Illegal end: Not an integer");
  35816. if (i >>>= 0,
  35817. t < 0 || t > i || i > this.buffer.byteLength)
  35818. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35819. }
  35820. if (t >= i)
  35821. return this;
  35822. for (; t < i; )
  35823. this.view[t++] = e;
  35824. return n && (this.offset = t),
  35825. this
  35826. }
  35827. ,
  35828. a.flip = function() {
  35829. return this.limit = this.offset,
  35830. this.offset = 0,
  35831. this
  35832. }
  35833. ,
  35834. a.mark = function(e) {
  35835. if (e = "undefined" == typeof e ? this.offset : e,
  35836. !this.noAssert) {
  35837. if ("number" != typeof e || e % 1 !== 0)
  35838. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35839. if (e >>>= 0,
  35840. e < 0 || e + 0 > this.buffer.byteLength)
  35841. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35842. }
  35843. return this.markedOffset = e,
  35844. this
  35845. }
  35846. ,
  35847. a.order = function(e) {
  35848. if (!this.noAssert && "boolean" != typeof e)
  35849. throw TypeError("Illegal littleEndian: Not a boolean");
  35850. return this.littleEndian = !!e,
  35851. this
  35852. }
  35853. ,
  35854. a.LE = function(e) {
  35855. return this.littleEndian = "undefined" == typeof e || !!e,
  35856. this
  35857. }
  35858. ,
  35859. a.BE = function(e) {
  35860. return this.littleEndian = "undefined" != typeof e && !e,
  35861. this
  35862. }
  35863. ,
  35864. a.prepend = function(e, t, i) {
  35865. "number" != typeof t && "string" == typeof t || (i = t,
  35866. t = void 0);
  35867. var n = "undefined" == typeof i;
  35868. if (n && (i = this.offset),
  35869. !this.noAssert) {
  35870. if ("number" != typeof i || i % 1 !== 0)
  35871. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35872. if (i >>>= 0,
  35873. i < 0 || i + 0 > this.buffer.byteLength)
  35874. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35875. }
  35876. e instanceof o || (e = o.wrap(e, t));
  35877. var r = e.limit - e.offset;
  35878. if (r <= 0)
  35879. return this;
  35880. var a = r - i;
  35881. if (a > 0) {
  35882. var s = new ArrayBuffer(this.buffer.byteLength + a)
  35883. , l = new Uint8Array(s);
  35884. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  35885. this.buffer = s,
  35886. this.view = l,
  35887. this.offset += a,
  35888. this.markedOffset >= 0 && (this.markedOffset += a),
  35889. this.limit += a,
  35890. i += a
  35891. } else {
  35892. new Uint8Array(this.buffer)
  35893. }
  35894. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35895. e.offset = e.limit,
  35896. n && (this.offset -= r),
  35897. this
  35898. }
  35899. ,
  35900. a.prependTo = function(e, t) {
  35901. return e.prepend(this, t),
  35902. this
  35903. }
  35904. ,
  35905. a.printDebug = function(e) {
  35906. "function" != typeof e && (e = console.log.bind(console)),
  35907. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35908. }
  35909. ,
  35910. a.remaining = function() {
  35911. return this.limit - this.offset
  35912. }
  35913. ,
  35914. a.reset = function() {
  35915. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  35916. this.markedOffset = -1) : this.offset = 0,
  35917. this
  35918. }
  35919. ,
  35920. a.resize = function(e) {
  35921. if (!this.noAssert) {
  35922. if ("number" != typeof e || e % 1 !== 0)
  35923. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35924. if (e |= 0,
  35925. e < 0)
  35926. throw RangeError("Illegal capacity: 0 <= " + e)
  35927. }
  35928. if (this.buffer.byteLength < e) {
  35929. var t = new ArrayBuffer(e)
  35930. , i = new Uint8Array(t);
  35931. i.set(this.view),
  35932. this.buffer = t,
  35933. this.view = i
  35934. }
  35935. return this
  35936. }
  35937. ,
  35938. a.reverse = function(e, t) {
  35939. if ("undefined" == typeof e && (e = this.offset),
  35940. "undefined" == typeof t && (t = this.limit),
  35941. !this.noAssert) {
  35942. if ("number" != typeof e || e % 1 !== 0)
  35943. throw TypeError("Illegal begin: Not an integer");
  35944. if (e >>>= 0,
  35945. "number" != typeof t || t % 1 !== 0)
  35946. throw TypeError("Illegal end: Not an integer");
  35947. if (t >>>= 0,
  35948. e < 0 || e > t || t > this.buffer.byteLength)
  35949. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35950. }
  35951. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  35952. this)
  35953. }
  35954. ,
  35955. a.skip = function(e) {
  35956. if (!this.noAssert) {
  35957. if ("number" != typeof e || e % 1 !== 0)
  35958. throw TypeError("Illegal length: " + e + " (not an integer)");
  35959. e |= 0
  35960. }
  35961. var t = this.offset + e;
  35962. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35963. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35964. return this.offset = t,
  35965. this
  35966. }
  35967. ,
  35968. a.slice = function(e, t) {
  35969. if ("undefined" == typeof e && (e = this.offset),
  35970. "undefined" == typeof t && (t = this.limit),
  35971. !this.noAssert) {
  35972. if ("number" != typeof e || e % 1 !== 0)
  35973. throw TypeError("Illegal begin: Not an integer");
  35974. if (e >>>= 0,
  35975. "number" != typeof t || t % 1 !== 0)
  35976. throw TypeError("Illegal end: Not an integer");
  35977. if (t >>>= 0,
  35978. e < 0 || e > t || t > this.buffer.byteLength)
  35979. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35980. }
  35981. var i = this.clone();
  35982. return i.offset = e,
  35983. i.limit = t,
  35984. i
  35985. }
  35986. ,
  35987. a.toBuffer = function(e) {
  35988. var t = this.offset
  35989. , i = this.limit;
  35990. if (!this.noAssert) {
  35991. if ("number" != typeof t || t % 1 !== 0)
  35992. throw TypeError("Illegal offset: Not an integer");
  35993. if (t >>>= 0,
  35994. "number" != typeof i || i % 1 !== 0)
  35995. throw TypeError("Illegal limit: Not an integer");
  35996. if (i >>>= 0,
  35997. t < 0 || t > i || i > this.buffer.byteLength)
  35998. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35999. }
  36000. if (!e && 0 === t && i === this.buffer.byteLength)
  36001. return this.buffer;
  36002. if (t === i)
  36003. return s;
  36004. var n = new ArrayBuffer(i - t);
  36005. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36006. n
  36007. }
  36008. ,
  36009. a.toArrayBuffer = a.toBuffer,
  36010. a.toString = function(e, t, i) {
  36011. if ("undefined" == typeof e)
  36012. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36013. switch ("number" == typeof e && (e = "utf8",
  36014. t = e,
  36015. i = t),
  36016. e) {
  36017. case "utf8":
  36018. return this.toUTF8(t, i);
  36019. case "base64":
  36020. return this.toBase64(t, i);
  36021. case "hex":
  36022. return this.toHex(t, i);
  36023. case "binary":
  36024. return this.toBinary(t, i);
  36025. case "debug":
  36026. return this.toDebug();
  36027. case "columns":
  36028. return this.toColumns();
  36029. default:
  36030. throw Error("Unsupported encoding: " + e)
  36031. }
  36032. }
  36033. ;
  36034. var c = function() {
  36035. for (var e = {}, t = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], i = [], n = 0, r = t.length; n < r; ++n)
  36036. i[t[n]] = n;
  36037. return e.encode = function(e, i) {
  36038. for (var n, r; null !== (n = e()); )
  36039. i(t[n >> 2 & 63]),
  36040. r = (3 & n) << 4,
  36041. null !== (n = e()) ? (r |= n >> 4 & 15,
  36042. i(t[63 & (r | n >> 4 & 15)]),
  36043. r = (15 & n) << 2,
  36044. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  36045. i(t[63 & n])) : (i(t[63 & r]),
  36046. i(61))) : (i(t[63 & r]),
  36047. i(61),
  36048. i(61))
  36049. }
  36050. ,
  36051. e.decode = function(e, t) {
  36052. function n(e) {
  36053. throw Error("Illegal character code: " + e)
  36054. }
  36055. for (var r, o, a; null !== (r = e()); )
  36056. if (o = i[r],
  36057. "undefined" == typeof o && n(r),
  36058. null !== (r = e()) && (a = i[r],
  36059. "undefined" == typeof a && n(r),
  36060. t(o << 2 >>> 0 | (48 & a) >> 4),
  36061. null !== (r = e()))) {
  36062. if (o = i[r],
  36063. "undefined" == typeof o) {
  36064. if (61 === r)
  36065. break;
  36066. n(r)
  36067. }
  36068. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  36069. null !== (r = e())) {
  36070. if (a = i[r],
  36071. "undefined" == typeof a) {
  36072. if (61 === r)
  36073. break;
  36074. n(r)
  36075. }
  36076. t((3 & o) << 6 >>> 0 | a)
  36077. }
  36078. }
  36079. }
  36080. ,
  36081. e.test = function(e) {
  36082. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36083. }
  36084. ,
  36085. e
  36086. }();
  36087. a.toBase64 = function(e, t) {
  36088. if ("undefined" == typeof e && (e = this.offset),
  36089. "undefined" == typeof t && (t = this.limit),
  36090. e |= 0,
  36091. t |= 0,
  36092. e < 0 || t > this.capacity || e > t)
  36093. throw RangeError("begin, end");
  36094. var n;
  36095. return c.encode(function() {
  36096. return e < t ? this.view[e++] : null
  36097. }
  36098. .bind(this), n = i()),
  36099. n()
  36100. }
  36101. ,
  36102. o.fromBase64 = function(e, i) {
  36103. if ("string" != typeof e)
  36104. throw TypeError("str");
  36105. var n = new o(e.length / 4 * 3,i)
  36106. , r = 0;
  36107. return c.decode(t(e), function(e) {
  36108. n.view[r++] = e
  36109. }),
  36110. n.limit = r,
  36111. n
  36112. }
  36113. ,
  36114. o.btoa = function(e) {
  36115. return o.fromBinary(e).toBase64()
  36116. }
  36117. ,
  36118. o.atob = function(e) {
  36119. return o.fromBase64(e).toBinary()
  36120. }
  36121. ,
  36122. a.toBinary = function(e, t) {
  36123. if ("undefined" == typeof e && (e = this.offset),
  36124. "undefined" == typeof t && (t = this.limit),
  36125. e |= 0,
  36126. t |= 0,
  36127. e < 0 || t > this.capacity() || e > t)
  36128. throw RangeError("begin, end");
  36129. if (e === t)
  36130. return "";
  36131. for (var i = [], n = []; e < t; )
  36132. i.push(this.view[e++]),
  36133. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  36134. i = []);
  36135. return n.join("") + String.fromCharCode.apply(String, i)
  36136. }
  36137. ,
  36138. o.fromBinary = function(e, t) {
  36139. if ("string" != typeof e)
  36140. throw TypeError("str");
  36141. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  36142. if (i = e.charCodeAt(n),
  36143. i > 255)
  36144. throw RangeError("illegal char code: " + i);
  36145. a.view[n++] = i
  36146. }
  36147. return a.limit = r,
  36148. a
  36149. }
  36150. ,
  36151. a.toDebug = function(e) {
  36152. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36153. if (i !== -1 && (t = this.view[i],
  36154. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36155. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  36156. ++i,
  36157. e && i > 0 && i % 16 === 0 && i !== n) {
  36158. for (; r.length < 51; )
  36159. r += " ";
  36160. a += r + o + "\n",
  36161. r = o = ""
  36162. }
  36163. 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 ? " " : ""
  36164. }
  36165. if (e && " " !== r) {
  36166. for (; r.length < 51; )
  36167. r += " ";
  36168. a += r + o + "\n"
  36169. }
  36170. return e ? a : r
  36171. }
  36172. ,
  36173. o.fromDebug = function(e, t, i) {
  36174. for (var n, r, a = e.length, s = new o((a + 1) / 3 | 0,t,i), l = 0, c = 0, h = !1, u = !1, d = !1, p = !1, f = !1; l < a; ) {
  36175. switch (n = e.charAt(l++)) {
  36176. case "!":
  36177. if (!i) {
  36178. if (u || d || p) {
  36179. f = !0;
  36180. break
  36181. }
  36182. u = d = p = !0
  36183. }
  36184. s.offset = s.markedOffset = s.limit = c,
  36185. h = !1;
  36186. break;
  36187. case "|":
  36188. if (!i) {
  36189. if (u || p) {
  36190. f = !0;
  36191. break
  36192. }
  36193. u = p = !0
  36194. }
  36195. s.offset = s.limit = c,
  36196. h = !1;
  36197. break;
  36198. case "[":
  36199. if (!i) {
  36200. if (u || d) {
  36201. f = !0;
  36202. break
  36203. }
  36204. u = d = !0
  36205. }
  36206. s.offset = s.markedOffset = c,
  36207. h = !1;
  36208. break;
  36209. case "<":
  36210. if (!i) {
  36211. if (u) {
  36212. f = !0;
  36213. break
  36214. }
  36215. u = !0
  36216. }
  36217. s.offset = c,
  36218. h = !1;
  36219. break;
  36220. case "]":
  36221. if (!i) {
  36222. if (p || d) {
  36223. f = !0;
  36224. break
  36225. }
  36226. p = d = !0
  36227. }
  36228. s.limit = s.markedOffset = c,
  36229. h = !1;
  36230. break;
  36231. case ">":
  36232. if (!i) {
  36233. if (p) {
  36234. f = !0;
  36235. break
  36236. }
  36237. p = !0
  36238. }
  36239. s.limit = c,
  36240. h = !1;
  36241. break;
  36242. case "'":
  36243. if (!i) {
  36244. if (d) {
  36245. f = !0;
  36246. break
  36247. }
  36248. d = !0
  36249. }
  36250. s.markedOffset = c,
  36251. h = !1;
  36252. break;
  36253. case " ":
  36254. h = !1;
  36255. break;
  36256. default:
  36257. if (!i && h) {
  36258. f = !0;
  36259. break
  36260. }
  36261. if (r = parseInt(n + e.charAt(l++), 16),
  36262. !i && (isNaN(r) || r < 0 || r > 255))
  36263. throw TypeError("Illegal str: Not a debug encoded string");
  36264. s.view[c++] = r,
  36265. h = !0
  36266. }
  36267. if (f)
  36268. throw TypeError("Illegal str: Invalid symbol at " + l)
  36269. }
  36270. if (!i) {
  36271. if (!u || !p)
  36272. throw TypeError("Illegal str: Missing offset or limit");
  36273. if (c < s.buffer.byteLength)
  36274. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  36275. }
  36276. return s
  36277. }
  36278. ,
  36279. a.toHex = function(e, t) {
  36280. if (e = "undefined" == typeof e ? this.offset : e,
  36281. t = "undefined" == typeof t ? this.limit : t,
  36282. !this.noAssert) {
  36283. if ("number" != typeof e || e % 1 !== 0)
  36284. throw TypeError("Illegal begin: Not an integer");
  36285. if (e >>>= 0,
  36286. "number" != typeof t || t % 1 !== 0)
  36287. throw TypeError("Illegal end: Not an integer");
  36288. if (t >>>= 0,
  36289. e < 0 || e > t || t > this.buffer.byteLength)
  36290. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36291. }
  36292. for (var i, n = new Array(t - e); e < t; )
  36293. i = this.view[e++],
  36294. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36295. return n.join("")
  36296. }
  36297. ,
  36298. o.fromHex = function(e, t, i) {
  36299. if (!i) {
  36300. if ("string" != typeof e)
  36301. throw TypeError("Illegal str: Not a string");
  36302. if (e.length % 2 !== 0)
  36303. throw TypeError("Illegal str: Length not a multiple of 2")
  36304. }
  36305. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  36306. if (n = parseInt(e.substring(s, s + 2), 16),
  36307. !i && (!isFinite(n) || n < 0 || n > 255))
  36308. throw TypeError("Illegal str: Contains non-hex characters");
  36309. a.view[l++] = n
  36310. }
  36311. return a.limit = l,
  36312. a
  36313. }
  36314. ;
  36315. var h = function() {
  36316. var e = {};
  36317. return e.MAX_CODEPOINT = 1114111,
  36318. e.encodeUTF8 = function(e, t) {
  36319. var i = null;
  36320. for ("number" == typeof e && (i = e,
  36321. e = function() {
  36322. return null
  36323. }
  36324. ); null !== i || null !== (i = e()); )
  36325. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  36326. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  36327. t(i >> 6 & 63 | 128),
  36328. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  36329. t(i >> 12 & 63 | 128),
  36330. t(i >> 6 & 63 | 128),
  36331. t(63 & i | 128)),
  36332. i = null
  36333. }
  36334. ,
  36335. e.decodeUTF8 = function(e, t) {
  36336. for (var i, n, r, o, a = function(e) {
  36337. e = e.slice(0, e.indexOf(null));
  36338. var t = Error(e.toString());
  36339. throw t.name = "TruncatedError",
  36340. t.bytes = e,
  36341. t
  36342. }; null !== (i = e()); )
  36343. if (0 === (128 & i))
  36344. t(i);
  36345. else if (192 === (224 & i))
  36346. null === (n = e()) && a([i, n]),
  36347. t((31 & i) << 6 | 63 & n);
  36348. else if (224 === (240 & i))
  36349. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  36350. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36351. else {
  36352. if (240 !== (248 & i))
  36353. throw RangeError("Illegal starting byte: " + i);
  36354. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  36355. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36356. }
  36357. }
  36358. ,
  36359. e.UTF16toUTF8 = function(e, t) {
  36360. for (var i, n = null; ; ) {
  36361. if (null === (i = null !== n ? n : e()))
  36362. break;
  36363. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36364. n = null) : t(i)
  36365. }
  36366. null !== n && t(n)
  36367. }
  36368. ,
  36369. e.UTF8toUTF16 = function(e, t) {
  36370. var i = null;
  36371. for ("number" == typeof e && (i = e,
  36372. e = function() {
  36373. return null
  36374. }
  36375. ); null !== i || null !== (i = e()); )
  36376. i <= 65535 ? t(i) : (i -= 65536,
  36377. t((i >> 10) + 55296),
  36378. t(i % 1024 + 56320)),
  36379. i = null
  36380. }
  36381. ,
  36382. e.encodeUTF16toUTF8 = function(t, i) {
  36383. e.UTF16toUTF8(t, function(t) {
  36384. e.encodeUTF8(t, i)
  36385. })
  36386. }
  36387. ,
  36388. e.decodeUTF8toUTF16 = function(t, i) {
  36389. e.decodeUTF8(t, function(t) {
  36390. e.UTF8toUTF16(t, i)
  36391. })
  36392. }
  36393. ,
  36394. e.calculateCodePoint = function(e) {
  36395. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36396. }
  36397. ,
  36398. e.calculateUTF8 = function(e) {
  36399. for (var t, i = 0; null !== (t = e()); )
  36400. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36401. return i
  36402. }
  36403. ,
  36404. e.calculateUTF16asUTF8 = function(t) {
  36405. var i = 0
  36406. , n = 0;
  36407. return e.UTF16toUTF8(t, function(e) {
  36408. ++i,
  36409. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36410. }),
  36411. [i, n]
  36412. }
  36413. ,
  36414. e
  36415. }();
  36416. return a.toUTF8 = function(e, t) {
  36417. if ("undefined" == typeof e && (e = this.offset),
  36418. "undefined" == typeof t && (t = this.limit),
  36419. !this.noAssert) {
  36420. if ("number" != typeof e || e % 1 !== 0)
  36421. throw TypeError("Illegal begin: Not an integer");
  36422. if (e >>>= 0,
  36423. "number" != typeof t || t % 1 !== 0)
  36424. throw TypeError("Illegal end: Not an integer");
  36425. if (t >>>= 0,
  36426. e < 0 || e > t || t > this.buffer.byteLength)
  36427. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36428. }
  36429. var n;
  36430. try {
  36431. h.decodeUTF8toUTF16(function() {
  36432. return e < t ? this.view[e++] : null
  36433. }
  36434. .bind(this), n = i())
  36435. } catch (i) {
  36436. if (e !== t)
  36437. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  36438. }
  36439. return n()
  36440. }
  36441. ,
  36442. o.fromUTF8 = function(e, i, n) {
  36443. if (!n && "string" != typeof e)
  36444. throw TypeError("Illegal str: Not a string");
  36445. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  36446. , a = 0;
  36447. return h.encodeUTF16toUTF8(t(e), function(e) {
  36448. r.view[a++] = e
  36449. }),
  36450. r.limit = a,
  36451. r
  36452. }
  36453. ,
  36454. o
  36455. })
  36456. }
  36457. , {
  36458. long: 216
  36459. }],
  36460. 216: [function(e, t, i) {
  36461. !function(i, n) {
  36462. "function" == typeof define && define.amd ? define([], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n() : (i.dcodeIO = i.dcodeIO || {}).Long = n()
  36463. }(this, function() {
  36464. "use strict";
  36465. function e(e, t, i) {
  36466. this.low = 0 | e,
  36467. this.high = 0 | t,
  36468. this.unsigned = !!i
  36469. }
  36470. function t(e) {
  36471. return (e && e.__isLong__) === !0
  36472. }
  36473. function i(e, t) {
  36474. var i, n, o;
  36475. return t ? (e >>>= 0,
  36476. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  36477. o && (l[e] = i),
  36478. i)) : (e |= 0,
  36479. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  36480. o && (s[e] = i),
  36481. i))
  36482. }
  36483. function n(e, t) {
  36484. if (isNaN(e) || !isFinite(e))
  36485. return t ? m : g;
  36486. if (t) {
  36487. if (e < 0)
  36488. return m;
  36489. if (e >= d)
  36490. return I
  36491. } else {
  36492. if (e <= -p)
  36493. return E;
  36494. if (e + 1 >= p)
  36495. return C
  36496. }
  36497. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  36498. }
  36499. function r(t, i, n) {
  36500. return new e(t,i,n)
  36501. }
  36502. function o(e, t, i) {
  36503. if (0 === e.length)
  36504. throw Error("empty string");
  36505. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36506. return g;
  36507. if ("number" == typeof t ? (i = t,
  36508. t = !1) : t = !!t,
  36509. i = i || 10,
  36510. i < 2 || 36 < i)
  36511. throw RangeError("radix");
  36512. var r;
  36513. if ((r = e.indexOf("-")) > 0)
  36514. throw Error("interior hyphen");
  36515. if (0 === r)
  36516. return o(e.substring(1), t, i).neg();
  36517. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  36518. var h = Math.min(8, e.length - l)
  36519. , u = parseInt(e.substring(l, l + h), i);
  36520. if (h < 8) {
  36521. var d = n(c(i, h));
  36522. s = s.mul(d).add(n(u))
  36523. } else
  36524. s = s.mul(a),
  36525. s = s.add(n(u))
  36526. }
  36527. return s.unsigned = t,
  36528. s
  36529. }
  36530. function a(t) {
  36531. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  36532. }
  36533. e.prototype.__isLong__,
  36534. Object.defineProperty(e.prototype, "__isLong__", {
  36535. value: !0,
  36536. enumerable: !1,
  36537. configurable: !1
  36538. }),
  36539. e.isLong = t;
  36540. var s = {}
  36541. , l = {};
  36542. e.fromInt = i,
  36543. e.fromNumber = n,
  36544. e.fromBits = r;
  36545. var c = Math.pow;
  36546. e.fromString = o,
  36547. e.fromValue = a;
  36548. var h = 1 << 24
  36549. , u = 4294967296
  36550. , d = 0x10000000000000000
  36551. , p = d / 2
  36552. , f = i(h)
  36553. , g = i(0);
  36554. e.ZERO = g;
  36555. var m = i(0, !0);
  36556. e.UZERO = m;
  36557. var v = i(1);
  36558. e.ONE = v;
  36559. var A = i(1, !0);
  36560. e.UONE = A;
  36561. var y = i(-1);
  36562. e.NEG_ONE = y;
  36563. var C = r(-1, 2147483647, !1);
  36564. e.MAX_VALUE = C;
  36565. var I = r(-1, -1, !0);
  36566. e.MAX_UNSIGNED_VALUE = I;
  36567. var E = r(0, -2147483648, !1);
  36568. e.MIN_VALUE = E;
  36569. var b = e.prototype;
  36570. return b.toInt = function() {
  36571. return this.unsigned ? this.low >>> 0 : this.low
  36572. }
  36573. ,
  36574. b.toNumber = function() {
  36575. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  36576. }
  36577. ,
  36578. b.toString = function(e) {
  36579. if (e = e || 10,
  36580. e < 2 || 36 < e)
  36581. throw RangeError("radix");
  36582. if (this.isZero())
  36583. return "0";
  36584. if (this.isNegative()) {
  36585. if (this.eq(E)) {
  36586. var t = n(e)
  36587. , i = this.div(t)
  36588. , r = i.mul(t).sub(this);
  36589. return i.toString(e) + r.toInt().toString(e)
  36590. }
  36591. return "-" + this.neg().toString(e)
  36592. }
  36593. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  36594. var l = a.div(o)
  36595. , h = a.sub(l.mul(o)).toInt() >>> 0
  36596. , u = h.toString(e);
  36597. if (a = l,
  36598. a.isZero())
  36599. return u + s;
  36600. for (; u.length < 6; )
  36601. u = "0" + u;
  36602. s = "" + u + s
  36603. }
  36604. }
  36605. ,
  36606. b.getHighBits = function() {
  36607. return this.high
  36608. }
  36609. ,
  36610. b.getHighBitsUnsigned = function() {
  36611. return this.high >>> 0
  36612. }
  36613. ,
  36614. b.getLowBits = function() {
  36615. return this.low
  36616. }
  36617. ,
  36618. b.getLowBitsUnsigned = function() {
  36619. return this.low >>> 0
  36620. }
  36621. ,
  36622. b.getNumBitsAbs = function() {
  36623. if (this.isNegative())
  36624. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36625. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  36626. ;
  36627. return 0 != this.high ? t + 33 : t + 1
  36628. }
  36629. ,
  36630. b.isZero = function() {
  36631. return 0 === this.high && 0 === this.low
  36632. }
  36633. ,
  36634. b.isNegative = function() {
  36635. return !this.unsigned && this.high < 0
  36636. }
  36637. ,
  36638. b.isPositive = function() {
  36639. return this.unsigned || this.high >= 0
  36640. }
  36641. ,
  36642. b.isOdd = function() {
  36643. return 1 === (1 & this.low)
  36644. }
  36645. ,
  36646. b.isEven = function() {
  36647. return 0 === (1 & this.low)
  36648. }
  36649. ,
  36650. b.equals = function(e) {
  36651. return t(e) || (e = a(e)),
  36652. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  36653. }
  36654. ,
  36655. b.eq = b.equals,
  36656. b.notEquals = function(e) {
  36657. return !this.eq(e)
  36658. }
  36659. ,
  36660. b.neq = b.notEquals,
  36661. b.lessThan = function(e) {
  36662. return this.comp(e) < 0
  36663. }
  36664. ,
  36665. b.lt = b.lessThan,
  36666. b.lessThanOrEqual = function(e) {
  36667. return this.comp(e) <= 0
  36668. }
  36669. ,
  36670. b.lte = b.lessThanOrEqual,
  36671. b.greaterThan = function(e) {
  36672. return this.comp(e) > 0
  36673. }
  36674. ,
  36675. b.gt = b.greaterThan,
  36676. b.greaterThanOrEqual = function(e) {
  36677. return this.comp(e) >= 0
  36678. }
  36679. ,
  36680. b.gte = b.greaterThanOrEqual,
  36681. b.compare = function(e) {
  36682. if (t(e) || (e = a(e)),
  36683. this.eq(e))
  36684. return 0;
  36685. var i = this.isNegative()
  36686. , n = e.isNegative();
  36687. return i && !n ? -1 : !i && n ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  36688. }
  36689. ,
  36690. b.comp = b.compare,
  36691. b.negate = function() {
  36692. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  36693. }
  36694. ,
  36695. b.neg = b.negate,
  36696. b.add = function(e) {
  36697. t(e) || (e = a(e));
  36698. var i = this.high >>> 16
  36699. , n = 65535 & this.high
  36700. , o = this.low >>> 16
  36701. , s = 65535 & this.low
  36702. , l = e.high >>> 16
  36703. , c = 65535 & e.high
  36704. , h = e.low >>> 16
  36705. , u = 65535 & e.low
  36706. , d = 0
  36707. , p = 0
  36708. , f = 0
  36709. , g = 0;
  36710. return g += s + u,
  36711. f += g >>> 16,
  36712. g &= 65535,
  36713. f += o + h,
  36714. p += f >>> 16,
  36715. f &= 65535,
  36716. p += n + c,
  36717. d += p >>> 16,
  36718. p &= 65535,
  36719. d += i + l,
  36720. d &= 65535,
  36721. r(f << 16 | g, d << 16 | p, this.unsigned)
  36722. }
  36723. ,
  36724. b.subtract = function(e) {
  36725. return t(e) || (e = a(e)),
  36726. this.add(e.neg())
  36727. }
  36728. ,
  36729. b.sub = b.subtract,
  36730. b.multiply = function(e) {
  36731. if (this.isZero())
  36732. return g;
  36733. if (t(e) || (e = a(e)),
  36734. e.isZero())
  36735. return g;
  36736. if (this.eq(E))
  36737. return e.isOdd() ? E : g;
  36738. if (e.eq(E))
  36739. return this.isOdd() ? E : g;
  36740. if (this.isNegative())
  36741. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36742. if (e.isNegative())
  36743. return this.mul(e.neg()).neg();
  36744. if (this.lt(f) && e.lt(f))
  36745. return n(this.toNumber() * e.toNumber(), this.unsigned);
  36746. var i = this.high >>> 16
  36747. , o = 65535 & this.high
  36748. , s = this.low >>> 16
  36749. , l = 65535 & this.low
  36750. , c = e.high >>> 16
  36751. , h = 65535 & e.high
  36752. , u = e.low >>> 16
  36753. , d = 65535 & e.low
  36754. , p = 0
  36755. , m = 0
  36756. , v = 0
  36757. , A = 0;
  36758. return A += l * d,
  36759. v += A >>> 16,
  36760. A &= 65535,
  36761. v += s * d,
  36762. m += v >>> 16,
  36763. v &= 65535,
  36764. v += l * u,
  36765. m += v >>> 16,
  36766. v &= 65535,
  36767. m += o * d,
  36768. p += m >>> 16,
  36769. m &= 65535,
  36770. m += s * u,
  36771. p += m >>> 16,
  36772. m &= 65535,
  36773. m += l * h,
  36774. p += m >>> 16,
  36775. m &= 65535,
  36776. p += i * d + o * u + s * h + l * c,
  36777. p &= 65535,
  36778. r(v << 16 | A, p << 16 | m, this.unsigned)
  36779. }
  36780. ,
  36781. b.mul = b.multiply,
  36782. b.divide = function(e) {
  36783. if (t(e) || (e = a(e)),
  36784. e.isZero())
  36785. throw Error("division by zero");
  36786. if (this.isZero())
  36787. return this.unsigned ? m : g;
  36788. var i, r, o;
  36789. if (this.unsigned) {
  36790. if (e.unsigned || (e = e.toUnsigned()),
  36791. e.gt(this))
  36792. return m;
  36793. if (e.gt(this.shru(1)))
  36794. return A;
  36795. o = m
  36796. } else {
  36797. if (this.eq(E)) {
  36798. if (e.eq(v) || e.eq(y))
  36799. return E;
  36800. if (e.eq(E))
  36801. return v;
  36802. var s = this.shr(1);
  36803. return i = s.div(e).shl(1),
  36804. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  36805. o = i.add(r.div(e)))
  36806. }
  36807. if (e.eq(E))
  36808. return this.unsigned ? m : g;
  36809. if (this.isNegative())
  36810. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36811. if (e.isNegative())
  36812. return this.div(e.neg()).neg();
  36813. o = g
  36814. }
  36815. for (r = this; r.gte(e); ) {
  36816. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  36817. for (var l = Math.ceil(Math.log(i) / Math.LN2), h = l <= 48 ? 1 : c(2, l - 48), u = n(i), d = u.mul(e); d.isNegative() || d.gt(r); )
  36818. i -= h,
  36819. u = n(i, this.unsigned),
  36820. d = u.mul(e);
  36821. u.isZero() && (u = v),
  36822. o = o.add(u),
  36823. r = r.sub(d)
  36824. }
  36825. return o
  36826. }
  36827. ,
  36828. b.div = b.divide,
  36829. b.modulo = function(e) {
  36830. return t(e) || (e = a(e)),
  36831. this.sub(this.div(e).mul(e))
  36832. }
  36833. ,
  36834. b.mod = b.modulo,
  36835. b.not = function() {
  36836. return r(~this.low, ~this.high, this.unsigned)
  36837. }
  36838. ,
  36839. b.and = function(e) {
  36840. return t(e) || (e = a(e)),
  36841. r(this.low & e.low, this.high & e.high, this.unsigned)
  36842. }
  36843. ,
  36844. b.or = function(e) {
  36845. return t(e) || (e = a(e)),
  36846. r(this.low | e.low, this.high | e.high, this.unsigned)
  36847. }
  36848. ,
  36849. b.xor = function(e) {
  36850. return t(e) || (e = a(e)),
  36851. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36852. }
  36853. ,
  36854. b.shiftLeft = function(e) {
  36855. return t(e) && (e = e.toInt()),
  36856. 0 === (e &= 63) ? this : e < 32 ? r(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : r(0, this.low << e - 32, this.unsigned)
  36857. }
  36858. ,
  36859. b.shl = b.shiftLeft,
  36860. b.shiftRight = function(e) {
  36861. return t(e) && (e = e.toInt()),
  36862. 0 === (e &= 63) ? this : e < 32 ? r(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : r(this.high >> e - 32, this.high >= 0 ? 0 : -1, this.unsigned)
  36863. }
  36864. ,
  36865. b.shr = b.shiftRight,
  36866. b.shiftRightUnsigned = function(e) {
  36867. if (t(e) && (e = e.toInt()),
  36868. e &= 63,
  36869. 0 === e)
  36870. return this;
  36871. var i = this.high;
  36872. if (e < 32) {
  36873. var n = this.low;
  36874. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  36875. }
  36876. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  36877. }
  36878. ,
  36879. b.shru = b.shiftRightUnsigned,
  36880. b.toSigned = function() {
  36881. return this.unsigned ? r(this.low, this.high, !1) : this
  36882. }
  36883. ,
  36884. b.toUnsigned = function() {
  36885. return this.unsigned ? this : r(this.low, this.high, !0)
  36886. }
  36887. ,
  36888. b.toBytes = function(e) {
  36889. return e ? this.toBytesLE() : this.toBytesBE()
  36890. }
  36891. ,
  36892. b.toBytesLE = function() {
  36893. var e = this.high
  36894. , t = this.low;
  36895. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36896. }
  36897. ,
  36898. b.toBytesBE = function() {
  36899. var e = this.high
  36900. , t = this.low;
  36901. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36902. }
  36903. ,
  36904. e
  36905. })
  36906. }
  36907. , {}],
  36908. 217: [function(e, t, i) {
  36909. var n = {
  36910. REVISION: "75"
  36911. };
  36912. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  36913. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36914. void 0 === Math.sign && (Math.sign = function(e) {
  36915. return e < 0 ? -1 : e > 0 ? 1 : +e
  36916. }
  36917. ),
  36918. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36919. get: function() {
  36920. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36921. }
  36922. }),
  36923. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36924. writable: !0,
  36925. configurable: !0,
  36926. value: function(e) {
  36927. "use strict";
  36928. if (void 0 === e || null === e)
  36929. throw new TypeError("Cannot convert first argument to object");
  36930. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36931. var r = arguments[i];
  36932. if (void 0 !== r && null !== r) {
  36933. r = Object(r);
  36934. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36935. var l = o[a]
  36936. , c = Object.getOwnPropertyDescriptor(r, l);
  36937. void 0 !== c && c.enumerable && (t[l] = r[l])
  36938. }
  36939. }
  36940. }
  36941. return t
  36942. }
  36943. }),
  36944. n.MOUSE = {
  36945. LEFT: 0,
  36946. MIDDLE: 1,
  36947. RIGHT: 2
  36948. },
  36949. n.CullFaceNone = 0,
  36950. n.CullFaceBack = 1,
  36951. n.CullFaceFront = 2,
  36952. n.CullFaceFrontBack = 3,
  36953. n.FrontFaceDirectionCW = 0,
  36954. n.FrontFaceDirectionCCW = 1,
  36955. n.BasicShadowMap = 0,
  36956. n.PCFShadowMap = 1,
  36957. n.PCFSoftShadowMap = 2,
  36958. n.FrontSide = 0,
  36959. n.BackSide = 1,
  36960. n.DoubleSide = 2,
  36961. n.FlatShading = 1,
  36962. n.SmoothShading = 2,
  36963. n.NoColors = 0,
  36964. n.FaceColors = 1,
  36965. n.VertexColors = 2,
  36966. n.NoBlending = 0,
  36967. n.NormalBlending = 1,
  36968. n.AdditiveBlending = 2,
  36969. n.SubtractiveBlending = 3,
  36970. n.MultiplyBlending = 4,
  36971. n.CustomBlending = 5,
  36972. n.AddEquation = 100,
  36973. n.SubtractEquation = 101,
  36974. n.ReverseSubtractEquation = 102,
  36975. n.MinEquation = 103,
  36976. n.MaxEquation = 104,
  36977. n.ZeroFactor = 200,
  36978. n.OneFactor = 201,
  36979. n.SrcColorFactor = 202,
  36980. n.OneMinusSrcColorFactor = 203,
  36981. n.SrcAlphaFactor = 204,
  36982. n.OneMinusSrcAlphaFactor = 205,
  36983. n.DstAlphaFactor = 206,
  36984. n.OneMinusDstAlphaFactor = 207,
  36985. n.DstColorFactor = 208,
  36986. n.OneMinusDstColorFactor = 209,
  36987. n.SrcAlphaSaturateFactor = 210,
  36988. n.NeverDepth = 0,
  36989. n.AlwaysDepth = 1,
  36990. n.LessDepth = 2,
  36991. n.LessEqualDepth = 3,
  36992. n.EqualDepth = 4,
  36993. n.GreaterEqualDepth = 5,
  36994. n.GreaterDepth = 6,
  36995. n.NotEqualDepth = 7,
  36996. n.MultiplyOperation = 0,
  36997. n.MixOperation = 1,
  36998. n.AddOperation = 2,
  36999. n.NoToneMapping = 0,
  37000. n.LinearToneMapping = 1,
  37001. n.ReinhardToneMapping = 2,
  37002. n.Uncharted2ToneMapping = 3,
  37003. n.CineonToneMapping = 4,
  37004. n.UVMapping = 300,
  37005. n.CubeReflectionMapping = 301,
  37006. n.CubeRefractionMapping = 302,
  37007. n.EquirectangularReflectionMapping = 303,
  37008. n.EquirectangularRefractionMapping = 304,
  37009. n.SphericalReflectionMapping = 305,
  37010. n.CubeUVReflectionMapping = 306,
  37011. n.CubeUVRefractionMapping = 307,
  37012. n.RepeatWrapping = 1e3,
  37013. n.ClampToEdgeWrapping = 1001,
  37014. n.MirroredRepeatWrapping = 1002,
  37015. n.NearestFilter = 1003,
  37016. n.NearestMipMapNearestFilter = 1004,
  37017. n.NearestMipMapLinearFilter = 1005,
  37018. n.LinearFilter = 1006,
  37019. n.LinearMipMapNearestFilter = 1007,
  37020. n.LinearMipMapLinearFilter = 1008,
  37021. n.UnsignedByteType = 1009,
  37022. n.ByteType = 1010,
  37023. n.ShortType = 1011,
  37024. n.UnsignedShortType = 1012,
  37025. n.IntType = 1013,
  37026. n.UnsignedIntType = 1014,
  37027. n.FloatType = 1015,
  37028. n.HalfFloatType = 1025,
  37029. n.UnsignedShort4444Type = 1016,
  37030. n.UnsignedShort5551Type = 1017,
  37031. n.UnsignedShort565Type = 1018,
  37032. n.AlphaFormat = 1019,
  37033. n.RGBFormat = 1020,
  37034. n.RGBAFormat = 1021,
  37035. n.LuminanceFormat = 1022,
  37036. n.LuminanceAlphaFormat = 1023,
  37037. n.RGBEFormat = n.RGBAFormat,
  37038. n.RGB_S3TC_DXT1_Format = 2001,
  37039. n.RGBA_S3TC_DXT1_Format = 2002,
  37040. n.RGBA_S3TC_DXT3_Format = 2003,
  37041. n.RGBA_S3TC_DXT5_Format = 2004,
  37042. n.RGB_PVRTC_4BPPV1_Format = 2100,
  37043. n.RGB_PVRTC_2BPPV1_Format = 2101,
  37044. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  37045. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  37046. n.RGB_ETC1_Format = 2151,
  37047. n.LoopOnce = 2200,
  37048. n.LoopRepeat = 2201,
  37049. n.LoopPingPong = 2202,
  37050. n.InterpolateDiscrete = 2300,
  37051. n.InterpolateLinear = 2301,
  37052. n.InterpolateSmooth = 2302,
  37053. n.ZeroCurvatureEnding = 2400,
  37054. n.ZeroSlopeEnding = 2401,
  37055. n.WrapAroundEnding = 2402,
  37056. n.TrianglesDrawMode = 0,
  37057. n.TriangleStripDrawMode = 1,
  37058. n.TriangleFanDrawMode = 2,
  37059. n.LinearEncoding = 3e3,
  37060. n.sRGBEncoding = 3001,
  37061. n.GammaEncoding = 3007,
  37062. n.RGBEEncoding = 3002,
  37063. n.LogLuvEncoding = 3003,
  37064. n.RGBM7Encoding = 3004,
  37065. n.RGBM16Encoding = 3005,
  37066. n.RGBDEncoding = 3006,
  37067. n.Color = function(e) {
  37068. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37069. }
  37070. ,
  37071. n.Color.prototype = {
  37072. constructor: n.Color,
  37073. r: 1,
  37074. g: 1,
  37075. b: 1,
  37076. set: function(e) {
  37077. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37078. this
  37079. },
  37080. setScalar: function(e) {
  37081. this.r = e,
  37082. this.g = e,
  37083. this.b = e
  37084. },
  37085. setHex: function(e) {
  37086. return e = Math.floor(e),
  37087. this.r = (e >> 16 & 255) / 255,
  37088. this.g = (e >> 8 & 255) / 255,
  37089. this.b = (255 & e) / 255,
  37090. this
  37091. },
  37092. setRGB: function(e, t, i) {
  37093. return this.r = e,
  37094. this.g = t,
  37095. this.b = i,
  37096. this
  37097. },
  37098. setHSL: function() {
  37099. function e(e, t, i) {
  37100. return i < 0 && (i += 1),
  37101. i > 1 && (i -= 1),
  37102. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37103. }
  37104. return function(t, i, r) {
  37105. if (t = n.Math.euclideanModulo(t, 1),
  37106. i = n.Math.clamp(i, 0, 1),
  37107. r = n.Math.clamp(r, 0, 1),
  37108. 0 === i)
  37109. this.r = this.g = this.b = r;
  37110. else {
  37111. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  37112. , a = 2 * r - o;
  37113. this.r = e(a, o, t + 1 / 3),
  37114. this.g = e(a, o, t),
  37115. this.b = e(a, o, t - 1 / 3)
  37116. }
  37117. return this
  37118. }
  37119. }(),
  37120. setStyle: function(e) {
  37121. function t(t) {
  37122. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  37123. }
  37124. var i;
  37125. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  37126. var r, o = i[1], a = i[2];
  37127. switch (o) {
  37128. case "rgb":
  37129. case "rgba":
  37130. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  37131. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  37132. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  37133. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  37134. t(r[5]),
  37135. this;
  37136. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  37137. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  37138. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  37139. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  37140. t(r[5]),
  37141. this;
  37142. break;
  37143. case "hsl":
  37144. case "hsla":
  37145. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  37146. var s = parseFloat(r[1]) / 360
  37147. , l = parseInt(r[2], 10) / 100
  37148. , c = parseInt(r[3], 10) / 100;
  37149. return t(r[5]),
  37150. this.setHSL(s, l, c)
  37151. }
  37152. }
  37153. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  37154. var h = i[1]
  37155. , u = h.length;
  37156. if (3 === u)
  37157. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  37158. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  37159. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  37160. this;
  37161. if (6 === u)
  37162. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  37163. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  37164. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  37165. this
  37166. }
  37167. if (e && e.length > 0) {
  37168. var h = n.ColorKeywords[e];
  37169. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  37170. }
  37171. return this
  37172. },
  37173. clone: function() {
  37174. return new this.constructor(this.r,this.g,this.b)
  37175. },
  37176. copy: function(e) {
  37177. return this.r = e.r,
  37178. this.g = e.g,
  37179. this.b = e.b,
  37180. this
  37181. },
  37182. copyGammaToLinear: function(e, t) {
  37183. return void 0 === t && (t = 2),
  37184. this.r = Math.pow(e.r, t),
  37185. this.g = Math.pow(e.g, t),
  37186. this.b = Math.pow(e.b, t),
  37187. this
  37188. },
  37189. copyLinearToGamma: function(e, t) {
  37190. void 0 === t && (t = 2);
  37191. var i = t > 0 ? 1 / t : 1;
  37192. return this.r = Math.pow(e.r, i),
  37193. this.g = Math.pow(e.g, i),
  37194. this.b = Math.pow(e.b, i),
  37195. this
  37196. },
  37197. convertGammaToLinear: function() {
  37198. var e = this.r
  37199. , t = this.g
  37200. , i = this.b;
  37201. return this.r = e * e,
  37202. this.g = t * t,
  37203. this.b = i * i,
  37204. this
  37205. },
  37206. convertLinearToGamma: function() {
  37207. return this.r = Math.sqrt(this.r),
  37208. this.g = Math.sqrt(this.g),
  37209. this.b = Math.sqrt(this.b),
  37210. this
  37211. },
  37212. getHex: function() {
  37213. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37214. },
  37215. getHexString: function() {
  37216. return ("000000" + this.getHex().toString(16)).slice(-6)
  37217. },
  37218. getHSL: function(e) {
  37219. var t, i, n = e || {
  37220. h: 0,
  37221. s: 0,
  37222. l: 0
  37223. }, 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;
  37224. if (l === s)
  37225. t = 0,
  37226. i = 0;
  37227. else {
  37228. var h = s - l;
  37229. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37230. s) {
  37231. case r:
  37232. t = (o - a) / h + (o < a ? 6 : 0);
  37233. break;
  37234. case o:
  37235. t = (a - r) / h + 2;
  37236. break;
  37237. case a:
  37238. t = (r - o) / h + 4
  37239. }
  37240. t /= 6
  37241. }
  37242. return n.h = t,
  37243. n.s = i,
  37244. n.l = c,
  37245. n
  37246. },
  37247. getStyle: function() {
  37248. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37249. },
  37250. offsetHSL: function(e, t, i) {
  37251. var n = this.getHSL();
  37252. return n.h += e,
  37253. n.s += t,
  37254. n.l += i,
  37255. this.setHSL(n.h, n.s, n.l),
  37256. this
  37257. },
  37258. add: function(e) {
  37259. return this.r += e.r,
  37260. this.g += e.g,
  37261. this.b += e.b,
  37262. this
  37263. },
  37264. addColors: function(e, t) {
  37265. return this.r = e.r + t.r,
  37266. this.g = e.g + t.g,
  37267. this.b = e.b + t.b,
  37268. this
  37269. },
  37270. addScalar: function(e) {
  37271. return this.r += e,
  37272. this.g += e,
  37273. this.b += e,
  37274. this
  37275. },
  37276. multiply: function(e) {
  37277. return this.r *= e.r,
  37278. this.g *= e.g,
  37279. this.b *= e.b,
  37280. this
  37281. },
  37282. multiplyScalar: function(e) {
  37283. return this.r *= e,
  37284. this.g *= e,
  37285. this.b *= e,
  37286. this
  37287. },
  37288. lerp: function(e, t) {
  37289. return this.r += (e.r - this.r) * t,
  37290. this.g += (e.g - this.g) * t,
  37291. this.b += (e.b - this.b) * t,
  37292. this
  37293. },
  37294. equals: function(e) {
  37295. return e.r === this.r && e.g === this.g && e.b === this.b
  37296. },
  37297. fromArray: function(e, t) {
  37298. return void 0 === t && (t = 0),
  37299. this.r = e[t],
  37300. this.g = e[t + 1],
  37301. this.b = e[t + 2],
  37302. this
  37303. },
  37304. toArray: function(e, t) {
  37305. return void 0 === e && (e = []),
  37306. void 0 === t && (t = 0),
  37307. e[t] = this.r,
  37308. e[t + 1] = this.g,
  37309. e[t + 2] = this.b,
  37310. e
  37311. }
  37312. },
  37313. n.ColorKeywords = {
  37314. aliceblue: 15792383,
  37315. antiquewhite: 16444375,
  37316. aqua: 65535,
  37317. aquamarine: 8388564,
  37318. azure: 15794175,
  37319. beige: 16119260,
  37320. bisque: 16770244,
  37321. black: 0,
  37322. blanchedalmond: 16772045,
  37323. blue: 255,
  37324. blueviolet: 9055202,
  37325. brown: 10824234,
  37326. burlywood: 14596231,
  37327. cadetblue: 6266528,
  37328. chartreuse: 8388352,
  37329. chocolate: 13789470,
  37330. coral: 16744272,
  37331. cornflowerblue: 6591981,
  37332. cornsilk: 16775388,
  37333. crimson: 14423100,
  37334. cyan: 65535,
  37335. darkblue: 139,
  37336. darkcyan: 35723,
  37337. darkgoldenrod: 12092939,
  37338. darkgray: 11119017,
  37339. darkgreen: 25600,
  37340. darkgrey: 11119017,
  37341. darkkhaki: 12433259,
  37342. darkmagenta: 9109643,
  37343. darkolivegreen: 5597999,
  37344. darkorange: 16747520,
  37345. darkorchid: 10040012,
  37346. darkred: 9109504,
  37347. darksalmon: 15308410,
  37348. darkseagreen: 9419919,
  37349. darkslateblue: 4734347,
  37350. darkslategray: 3100495,
  37351. darkslategrey: 3100495,
  37352. darkturquoise: 52945,
  37353. darkviolet: 9699539,
  37354. deeppink: 16716947,
  37355. deepskyblue: 49151,
  37356. dimgray: 6908265,
  37357. dimgrey: 6908265,
  37358. dodgerblue: 2003199,
  37359. firebrick: 11674146,
  37360. floralwhite: 16775920,
  37361. forestgreen: 2263842,
  37362. fuchsia: 16711935,
  37363. gainsboro: 14474460,
  37364. ghostwhite: 16316671,
  37365. gold: 16766720,
  37366. goldenrod: 14329120,
  37367. gray: 8421504,
  37368. green: 32768,
  37369. greenyellow: 11403055,
  37370. grey: 8421504,
  37371. honeydew: 15794160,
  37372. hotpink: 16738740,
  37373. indianred: 13458524,
  37374. indigo: 4915330,
  37375. ivory: 16777200,
  37376. khaki: 15787660,
  37377. lavender: 15132410,
  37378. lavenderblush: 16773365,
  37379. lawngreen: 8190976,
  37380. lemonchiffon: 16775885,
  37381. lightblue: 11393254,
  37382. lightcoral: 15761536,
  37383. lightcyan: 14745599,
  37384. lightgoldenrodyellow: 16448210,
  37385. lightgray: 13882323,
  37386. lightgreen: 9498256,
  37387. lightgrey: 13882323,
  37388. lightpink: 16758465,
  37389. lightsalmon: 16752762,
  37390. lightseagreen: 2142890,
  37391. lightskyblue: 8900346,
  37392. lightslategray: 7833753,
  37393. lightslategrey: 7833753,
  37394. lightsteelblue: 11584734,
  37395. lightyellow: 16777184,
  37396. lime: 65280,
  37397. limegreen: 3329330,
  37398. linen: 16445670,
  37399. magenta: 16711935,
  37400. maroon: 8388608,
  37401. mediumaquamarine: 6737322,
  37402. mediumblue: 205,
  37403. mediumorchid: 12211667,
  37404. mediumpurple: 9662683,
  37405. mediumseagreen: 3978097,
  37406. mediumslateblue: 8087790,
  37407. mediumspringgreen: 64154,
  37408. mediumturquoise: 4772300,
  37409. mediumvioletred: 13047173,
  37410. midnightblue: 1644912,
  37411. mintcream: 16121850,
  37412. mistyrose: 16770273,
  37413. moccasin: 16770229,
  37414. navajowhite: 16768685,
  37415. navy: 128,
  37416. oldlace: 16643558,
  37417. olive: 8421376,
  37418. olivedrab: 7048739,
  37419. orange: 16753920,
  37420. orangered: 16729344,
  37421. orchid: 14315734,
  37422. palegoldenrod: 15657130,
  37423. palegreen: 10025880,
  37424. paleturquoise: 11529966,
  37425. palevioletred: 14381203,
  37426. papayawhip: 16773077,
  37427. peachpuff: 16767673,
  37428. peru: 13468991,
  37429. pink: 16761035,
  37430. plum: 14524637,
  37431. powderblue: 11591910,
  37432. purple: 8388736,
  37433. red: 16711680,
  37434. rosybrown: 12357519,
  37435. royalblue: 4286945,
  37436. saddlebrown: 9127187,
  37437. salmon: 16416882,
  37438. sandybrown: 16032864,
  37439. seagreen: 3050327,
  37440. seashell: 16774638,
  37441. sienna: 10506797,
  37442. silver: 12632256,
  37443. skyblue: 8900331,
  37444. slateblue: 6970061,
  37445. slategray: 7372944,
  37446. slategrey: 7372944,
  37447. snow: 16775930,
  37448. springgreen: 65407,
  37449. steelblue: 4620980,
  37450. tan: 13808780,
  37451. teal: 32896,
  37452. thistle: 14204888,
  37453. tomato: 16737095,
  37454. turquoise: 4251856,
  37455. violet: 15631086,
  37456. wheat: 16113331,
  37457. white: 16777215,
  37458. whitesmoke: 16119285,
  37459. yellow: 16776960,
  37460. yellowgreen: 10145074
  37461. },
  37462. n.Quaternion = function(e, t, i, n) {
  37463. this._x = e || 0,
  37464. this._y = t || 0,
  37465. this._z = i || 0,
  37466. this._w = void 0 !== n ? n : 1
  37467. }
  37468. ,
  37469. n.Quaternion.prototype = {
  37470. constructor: n.Quaternion,
  37471. get x() {
  37472. return this._x
  37473. },
  37474. set x(e) {
  37475. this._x = e,
  37476. this.onChangeCallback()
  37477. },
  37478. get y() {
  37479. return this._y
  37480. },
  37481. set y(e) {
  37482. this._y = e,
  37483. this.onChangeCallback()
  37484. },
  37485. get z() {
  37486. return this._z
  37487. },
  37488. set z(e) {
  37489. this._z = e,
  37490. this.onChangeCallback()
  37491. },
  37492. get w() {
  37493. return this._w
  37494. },
  37495. set w(e) {
  37496. this._w = e,
  37497. this.onChangeCallback()
  37498. },
  37499. set: function(e, t, i, n) {
  37500. return this._x = e,
  37501. this._y = t,
  37502. this._z = i,
  37503. this._w = n,
  37504. this.onChangeCallback(),
  37505. this
  37506. },
  37507. clone: function() {
  37508. return new this.constructor(this._x,this._y,this._z,this._w)
  37509. },
  37510. copy: function(e) {
  37511. return this._x = e.x,
  37512. this._y = e.y,
  37513. this._z = e.z,
  37514. this._w = e.w,
  37515. this.onChangeCallback(),
  37516. this
  37517. },
  37518. setFromEuler: function(e, t) {
  37519. if (e instanceof n.Euler == !1)
  37520. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37521. var i = Math.cos(e._x / 2)
  37522. , r = Math.cos(e._y / 2)
  37523. , o = Math.cos(e._z / 2)
  37524. , a = Math.sin(e._x / 2)
  37525. , s = Math.sin(e._y / 2)
  37526. , l = Math.sin(e._z / 2)
  37527. , c = e.order;
  37528. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  37529. this._y = i * s * o - a * r * l,
  37530. this._z = i * r * l + a * s * o,
  37531. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  37532. this._y = i * s * o - a * r * l,
  37533. this._z = i * r * l - a * s * o,
  37534. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  37535. this._y = i * s * o + a * r * l,
  37536. this._z = i * r * l + a * s * o,
  37537. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  37538. this._y = i * s * o + a * r * l,
  37539. this._z = i * r * l - a * s * o,
  37540. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  37541. this._y = i * s * o + a * r * l,
  37542. this._z = i * r * l - a * s * o,
  37543. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  37544. this._y = i * s * o - a * r * l,
  37545. this._z = i * r * l + a * s * o,
  37546. this._w = i * r * o + a * s * l),
  37547. t !== !1 && this.onChangeCallback(),
  37548. this
  37549. },
  37550. setFromAxisAngle: function(e, t) {
  37551. var i = t / 2
  37552. , n = Math.sin(i);
  37553. return this._x = e.x * n,
  37554. this._y = e.y * n,
  37555. this._z = e.z * n,
  37556. this._w = Math.cos(i),
  37557. this.onChangeCallback(),
  37558. this
  37559. },
  37560. setFromRotationMatrix: function(e) {
  37561. 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;
  37562. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  37563. this._w = .25 / t,
  37564. this._x = (h - l) * t,
  37565. this._y = (o - c) * t,
  37566. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  37567. this._w = (h - l) / t,
  37568. this._x = .25 * t,
  37569. this._y = (r + a) / t,
  37570. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  37571. this._w = (o - c) / t,
  37572. this._x = (r + a) / t,
  37573. this._y = .25 * t,
  37574. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37575. this._w = (a - r) / t,
  37576. this._x = (o + c) / t,
  37577. this._y = (l + h) / t,
  37578. this._z = .25 * t),
  37579. this.onChangeCallback(),
  37580. this
  37581. },
  37582. setFromUnitVectors: function() {
  37583. var e, t, i = 1e-6;
  37584. return function(r, o) {
  37585. return void 0 === e && (e = new n.Vector3),
  37586. t = r.dot(o) + 1,
  37587. t < i ? (t = 0,
  37588. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y)) : e.crossVectors(r, o),
  37589. this._x = e.x,
  37590. this._y = e.y,
  37591. this._z = e.z,
  37592. this._w = t,
  37593. this.normalize(),
  37594. this
  37595. }
  37596. }(),
  37597. inverse: function() {
  37598. return this.conjugate().normalize(),
  37599. this
  37600. },
  37601. conjugate: function() {
  37602. return this._x *= -1,
  37603. this._y *= -1,
  37604. this._z *= -1,
  37605. this.onChangeCallback(),
  37606. this
  37607. },
  37608. dot: function(e) {
  37609. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37610. },
  37611. lengthSq: function() {
  37612. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37613. },
  37614. length: function() {
  37615. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37616. },
  37617. normalize: function() {
  37618. var e = this.length();
  37619. return 0 === e ? (this._x = 0,
  37620. this._y = 0,
  37621. this._z = 0,
  37622. this._w = 1) : (e = 1 / e,
  37623. this._x = this._x * e,
  37624. this._y = this._y * e,
  37625. this._z = this._z * e,
  37626. this._w = this._w * e),
  37627. this.onChangeCallback(),
  37628. this
  37629. },
  37630. multiply: function(e, t) {
  37631. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37632. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37633. },
  37634. multiplyQuaternions: function(e, t) {
  37635. var i = e._x
  37636. , n = e._y
  37637. , r = e._z
  37638. , o = e._w
  37639. , a = t._x
  37640. , s = t._y
  37641. , l = t._z
  37642. , c = t._w;
  37643. return this._x = i * c + o * a + n * l - r * s,
  37644. this._y = n * c + o * s + r * a - i * l,
  37645. this._z = r * c + o * l + i * s - n * a,
  37646. this._w = o * c - i * a - n * s - r * l,
  37647. this.onChangeCallback(),
  37648. this
  37649. },
  37650. slerp: function(e, t) {
  37651. if (0 === t)
  37652. return this;
  37653. if (1 === t)
  37654. return this.copy(e);
  37655. var i = this._x
  37656. , n = this._y
  37657. , r = this._z
  37658. , o = this._w
  37659. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37660. if (a < 0 ? (this._w = -e._w,
  37661. this._x = -e._x,
  37662. this._y = -e._y,
  37663. this._z = -e._z,
  37664. a = -a) : this.copy(e),
  37665. a >= 1)
  37666. return this._w = o,
  37667. this._x = i,
  37668. this._y = n,
  37669. this._z = r,
  37670. this;
  37671. var s = Math.sqrt(1 - a * a);
  37672. if (Math.abs(s) < .001)
  37673. return this._w = .5 * (o + this._w),
  37674. this._x = .5 * (i + this._x),
  37675. this._y = .5 * (n + this._y),
  37676. this._z = .5 * (r + this._z),
  37677. this;
  37678. var l = Math.atan2(s, a)
  37679. , c = Math.sin((1 - t) * l) / s
  37680. , h = Math.sin(t * l) / s;
  37681. return this._w = o * c + this._w * h,
  37682. this._x = i * c + this._x * h,
  37683. this._y = n * c + this._y * h,
  37684. this._z = r * c + this._z * h,
  37685. this.onChangeCallback(),
  37686. this
  37687. },
  37688. equals: function(e) {
  37689. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37690. },
  37691. fromArray: function(e, t) {
  37692. return void 0 === t && (t = 0),
  37693. this._x = e[t],
  37694. this._y = e[t + 1],
  37695. this._z = e[t + 2],
  37696. this._w = e[t + 3],
  37697. this.onChangeCallback(),
  37698. this
  37699. },
  37700. toArray: function(e, t) {
  37701. return void 0 === e && (e = []),
  37702. void 0 === t && (t = 0),
  37703. e[t] = this._x,
  37704. e[t + 1] = this._y,
  37705. e[t + 2] = this._z,
  37706. e[t + 3] = this._w,
  37707. e
  37708. },
  37709. onChange: function(e) {
  37710. return this.onChangeCallback = e,
  37711. this
  37712. },
  37713. onChangeCallback: function() {}
  37714. },
  37715. Object.assign(n.Quaternion, {
  37716. slerp: function(e, t, i, n) {
  37717. return i.copy(e).slerp(t, n)
  37718. },
  37719. slerpFlat: function(e, t, i, n, r, o, a) {
  37720. var s = i[n + 0]
  37721. , l = i[n + 1]
  37722. , c = i[n + 2]
  37723. , h = i[n + 3]
  37724. , u = r[o + 0]
  37725. , d = r[o + 1]
  37726. , p = r[o + 2]
  37727. , f = r[o + 3];
  37728. if (h !== f || s !== u || l !== d || c !== p) {
  37729. var g = 1 - a
  37730. , m = s * u + l * d + c * p + h * f
  37731. , v = m >= 0 ? 1 : -1
  37732. , A = 1 - m * m;
  37733. if (A > Number.EPSILON) {
  37734. var y = Math.sqrt(A)
  37735. , C = Math.atan2(y, m * v);
  37736. g = Math.sin(g * C) / y,
  37737. a = Math.sin(a * C) / y
  37738. }
  37739. var I = a * v;
  37740. if (s = s * g + u * I,
  37741. l = l * g + d * I,
  37742. c = c * g + p * I,
  37743. h = h * g + f * I,
  37744. g === 1 - a) {
  37745. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37746. s *= E,
  37747. l *= E,
  37748. c *= E,
  37749. h *= E
  37750. }
  37751. }
  37752. e[t] = s,
  37753. e[t + 1] = l,
  37754. e[t + 2] = c,
  37755. e[t + 3] = h
  37756. }
  37757. }),
  37758. n.Vector2 = function(e, t) {
  37759. this.x = e || 0,
  37760. this.y = t || 0
  37761. }
  37762. ,
  37763. n.Vector2.prototype = {
  37764. constructor: n.Vector2,
  37765. get width() {
  37766. return this.x
  37767. },
  37768. set width(e) {
  37769. this.x = e
  37770. },
  37771. get height() {
  37772. return this.y
  37773. },
  37774. set height(e) {
  37775. this.y = e
  37776. },
  37777. set: function(e, t) {
  37778. return this.x = e,
  37779. this.y = t,
  37780. this
  37781. },
  37782. setScalar: function(e) {
  37783. return this.x = e,
  37784. this.y = e,
  37785. this
  37786. },
  37787. setX: function(e) {
  37788. return this.x = e,
  37789. this
  37790. },
  37791. setY: function(e) {
  37792. return this.y = e,
  37793. this
  37794. },
  37795. setComponent: function(e, t) {
  37796. switch (e) {
  37797. case 0:
  37798. this.x = t;
  37799. break;
  37800. case 1:
  37801. this.y = t;
  37802. break;
  37803. default:
  37804. throw new Error("index is out of range: " + e)
  37805. }
  37806. },
  37807. getComponent: function(e) {
  37808. switch (e) {
  37809. case 0:
  37810. return this.x;
  37811. case 1:
  37812. return this.y;
  37813. default:
  37814. throw new Error("index is out of range: " + e)
  37815. }
  37816. },
  37817. clone: function() {
  37818. return new this.constructor(this.x,this.y)
  37819. },
  37820. copy: function(e) {
  37821. return this.x = e.x,
  37822. this.y = e.y,
  37823. this
  37824. },
  37825. add: function(e, t) {
  37826. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37827. this.addVectors(e, t)) : (this.x += e.x,
  37828. this.y += e.y,
  37829. this)
  37830. },
  37831. addScalar: function(e) {
  37832. return this.x += e,
  37833. this.y += e,
  37834. this
  37835. },
  37836. addVectors: function(e, t) {
  37837. return this.x = e.x + t.x,
  37838. this.y = e.y + t.y,
  37839. this
  37840. },
  37841. addScaledVector: function(e, t) {
  37842. return this.x += e.x * t,
  37843. this.y += e.y * t,
  37844. this
  37845. },
  37846. sub: function(e, t) {
  37847. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37848. this.subVectors(e, t)) : (this.x -= e.x,
  37849. this.y -= e.y,
  37850. this)
  37851. },
  37852. subScalar: function(e) {
  37853. return this.x -= e,
  37854. this.y -= e,
  37855. this
  37856. },
  37857. subVectors: function(e, t) {
  37858. return this.x = e.x - t.x,
  37859. this.y = e.y - t.y,
  37860. this
  37861. },
  37862. multiply: function(e) {
  37863. return this.x *= e.x,
  37864. this.y *= e.y,
  37865. this
  37866. },
  37867. multiplyScalar: function(e) {
  37868. return isFinite(e) ? (this.x *= e,
  37869. this.y *= e) : (this.x = 0,
  37870. this.y = 0),
  37871. this
  37872. },
  37873. divide: function(e) {
  37874. return this.x /= e.x,
  37875. this.y /= e.y,
  37876. this
  37877. },
  37878. divideScalar: function(e) {
  37879. return this.multiplyScalar(1 / e)
  37880. },
  37881. min: function(e) {
  37882. return this.x = Math.min(this.x, e.x),
  37883. this.y = Math.min(this.y, e.y),
  37884. this
  37885. },
  37886. max: function(e) {
  37887. return this.x = Math.max(this.x, e.x),
  37888. this.y = Math.max(this.y, e.y),
  37889. this
  37890. },
  37891. clamp: function(e, t) {
  37892. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37893. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37894. this
  37895. },
  37896. clampScalar: function() {
  37897. var e, t;
  37898. return function(i, r) {
  37899. return void 0 === e && (e = new n.Vector2,
  37900. t = new n.Vector2),
  37901. e.set(i, i),
  37902. t.set(r, r),
  37903. this.clamp(e, t)
  37904. }
  37905. }(),
  37906. clampLength: function(e, t) {
  37907. var i = this.length();
  37908. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37909. this
  37910. },
  37911. floor: function() {
  37912. return this.x = Math.floor(this.x),
  37913. this.y = Math.floor(this.y),
  37914. this
  37915. },
  37916. ceil: function() {
  37917. return this.x = Math.ceil(this.x),
  37918. this.y = Math.ceil(this.y),
  37919. this
  37920. },
  37921. round: function() {
  37922. return this.x = Math.round(this.x),
  37923. this.y = Math.round(this.y),
  37924. this
  37925. },
  37926. roundToZero: function() {
  37927. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37928. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37929. this
  37930. },
  37931. negate: function() {
  37932. return this.x = -this.x,
  37933. this.y = -this.y,
  37934. this
  37935. },
  37936. dot: function(e) {
  37937. return this.x * e.x + this.y * e.y
  37938. },
  37939. lengthSq: function() {
  37940. return this.x * this.x + this.y * this.y
  37941. },
  37942. length: function() {
  37943. return Math.sqrt(this.x * this.x + this.y * this.y)
  37944. },
  37945. lengthManhattan: function() {
  37946. return Math.abs(this.x) + Math.abs(this.y)
  37947. },
  37948. normalize: function() {
  37949. return this.divideScalar(this.length())
  37950. },
  37951. angle: function() {
  37952. var e = Math.atan2(this.y, this.x);
  37953. return e < 0 && (e += 2 * Math.PI),
  37954. e
  37955. },
  37956. distanceTo: function(e) {
  37957. return Math.sqrt(this.distanceToSquared(e))
  37958. },
  37959. distanceToSquared: function(e) {
  37960. var t = this.x - e.x
  37961. , i = this.y - e.y;
  37962. return t * t + i * i
  37963. },
  37964. setLength: function(e) {
  37965. return this.multiplyScalar(e / this.length())
  37966. },
  37967. lerp: function(e, t) {
  37968. return this.x += (e.x - this.x) * t,
  37969. this.y += (e.y - this.y) * t,
  37970. this
  37971. },
  37972. lerpVectors: function(e, t, i) {
  37973. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37974. this
  37975. },
  37976. equals: function(e) {
  37977. return e.x === this.x && e.y === this.y
  37978. },
  37979. fromArray: function(e, t) {
  37980. return void 0 === t && (t = 0),
  37981. this.x = e[t],
  37982. this.y = e[t + 1],
  37983. this
  37984. },
  37985. toArray: function(e, t) {
  37986. return void 0 === e && (e = []),
  37987. void 0 === t && (t = 0),
  37988. e[t] = this.x,
  37989. e[t + 1] = this.y,
  37990. e
  37991. },
  37992. fromAttribute: function(e, t, i) {
  37993. return void 0 === i && (i = 0),
  37994. t = t * e.itemSize + i,
  37995. this.x = e.array[t],
  37996. this.y = e.array[t + 1],
  37997. this
  37998. },
  37999. rotateAround: function(e, t) {
  38000. var i = Math.cos(t)
  38001. , n = Math.sin(t)
  38002. , r = this.x - e.x
  38003. , o = this.y - e.y;
  38004. return this.x = r * i - o * n + e.x,
  38005. this.y = r * n + o * i + e.y,
  38006. this
  38007. }
  38008. },
  38009. n.Vector3 = function(e, t, i) {
  38010. this.x = e || 0,
  38011. this.y = t || 0,
  38012. this.z = i || 0
  38013. }
  38014. ,
  38015. n.Vector3.prototype = {
  38016. constructor: n.Vector3,
  38017. set: function(e, t, i) {
  38018. return this.x = e,
  38019. this.y = t,
  38020. this.z = i,
  38021. this
  38022. },
  38023. setScalar: function(e) {
  38024. return this.x = e,
  38025. this.y = e,
  38026. this.z = e,
  38027. this
  38028. },
  38029. setX: function(e) {
  38030. return this.x = e,
  38031. this
  38032. },
  38033. setY: function(e) {
  38034. return this.y = e,
  38035. this
  38036. },
  38037. setZ: function(e) {
  38038. return this.z = e,
  38039. this
  38040. },
  38041. setComponent: function(e, t) {
  38042. switch (e) {
  38043. case 0:
  38044. this.x = t;
  38045. break;
  38046. case 1:
  38047. this.y = t;
  38048. break;
  38049. case 2:
  38050. this.z = t;
  38051. break;
  38052. default:
  38053. throw new Error("index is out of range: " + e)
  38054. }
  38055. },
  38056. getComponent: function(e) {
  38057. switch (e) {
  38058. case 0:
  38059. return this.x;
  38060. case 1:
  38061. return this.y;
  38062. case 2:
  38063. return this.z;
  38064. default:
  38065. throw new Error("index is out of range: " + e)
  38066. }
  38067. },
  38068. clone: function() {
  38069. return new this.constructor(this.x,this.y,this.z)
  38070. },
  38071. copy: function(e) {
  38072. return this.x = e.x,
  38073. this.y = e.y,
  38074. this.z = e.z,
  38075. this
  38076. },
  38077. add: function(e, t) {
  38078. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38079. this.addVectors(e, t)) : (this.x += e.x,
  38080. this.y += e.y,
  38081. this.z += e.z,
  38082. this)
  38083. },
  38084. addScalar: function(e) {
  38085. return this.x += e,
  38086. this.y += e,
  38087. this.z += e,
  38088. this
  38089. },
  38090. addVectors: function(e, t) {
  38091. return this.x = e.x + t.x,
  38092. this.y = e.y + t.y,
  38093. this.z = e.z + t.z,
  38094. this
  38095. },
  38096. addScaledVector: function(e, t) {
  38097. return this.x += e.x * t,
  38098. this.y += e.y * t,
  38099. this.z += e.z * t,
  38100. this
  38101. },
  38102. sub: function(e, t) {
  38103. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38104. this.subVectors(e, t)) : (this.x -= e.x,
  38105. this.y -= e.y,
  38106. this.z -= e.z,
  38107. this)
  38108. },
  38109. subScalar: function(e) {
  38110. return this.x -= e,
  38111. this.y -= e,
  38112. this.z -= e,
  38113. this
  38114. },
  38115. subVectors: function(e, t) {
  38116. return this.x = e.x - t.x,
  38117. this.y = e.y - t.y,
  38118. this.z = e.z - t.z,
  38119. this
  38120. },
  38121. multiply: function(e, t) {
  38122. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38123. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38124. this.y *= e.y,
  38125. this.z *= e.z,
  38126. this)
  38127. },
  38128. multiplyScalar: function(e) {
  38129. return isFinite(e) ? (this.x *= e,
  38130. this.y *= e,
  38131. this.z *= e) : (this.x = 0,
  38132. this.y = 0,
  38133. this.z = 0),
  38134. this
  38135. },
  38136. multiplyVectors: function(e, t) {
  38137. return this.x = e.x * t.x,
  38138. this.y = e.y * t.y,
  38139. this.z = e.z * t.z,
  38140. this
  38141. },
  38142. applyEuler: function() {
  38143. var e;
  38144. return function(t) {
  38145. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38146. void 0 === e && (e = new n.Quaternion),
  38147. this.applyQuaternion(e.setFromEuler(t)),
  38148. this
  38149. }
  38150. }(),
  38151. applyAxisAngle: function() {
  38152. var e;
  38153. return function(t, i) {
  38154. return void 0 === e && (e = new n.Quaternion),
  38155. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  38156. this
  38157. }
  38158. }(),
  38159. applyMatrix3: function(e) {
  38160. var t = this.x
  38161. , i = this.y
  38162. , n = this.z
  38163. , r = e.elements;
  38164. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38165. this.y = r[1] * t + r[4] * i + r[7] * n,
  38166. this.z = r[2] * t + r[5] * i + r[8] * n,
  38167. this
  38168. },
  38169. applyMatrix4: function(e) {
  38170. var t = this.x
  38171. , i = this.y
  38172. , n = this.z
  38173. , r = e.elements;
  38174. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38175. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38176. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38177. this
  38178. },
  38179. applyProjection: function(e) {
  38180. var t = this.x
  38181. , i = this.y
  38182. , n = this.z
  38183. , r = e.elements
  38184. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38185. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38186. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38187. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38188. this
  38189. },
  38190. applyQuaternion: function(e) {
  38191. var t = this.x
  38192. , i = this.y
  38193. , n = this.z
  38194. , r = e.x
  38195. , o = e.y
  38196. , a = e.z
  38197. , s = e.w
  38198. , l = s * t + o * n - a * i
  38199. , c = s * i + a * t - r * n
  38200. , h = s * n + r * i - o * t
  38201. , u = -r * t - o * i - a * n;
  38202. return this.x = l * s + u * -r + c * -a - h * -o,
  38203. this.y = c * s + u * -o + h * -r - l * -a,
  38204. this.z = h * s + u * -a + l * -o - c * -r,
  38205. this
  38206. },
  38207. project: function() {
  38208. var e;
  38209. return function(t) {
  38210. return void 0 === e && (e = new n.Matrix4),
  38211. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  38212. this.applyProjection(e)
  38213. }
  38214. }(),
  38215. unproject: function() {
  38216. var e;
  38217. return function(t) {
  38218. return void 0 === e && (e = new n.Matrix4),
  38219. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  38220. this.applyProjection(e)
  38221. }
  38222. }(),
  38223. transformDirection: function(e) {
  38224. var t = this.x
  38225. , i = this.y
  38226. , n = this.z
  38227. , r = e.elements;
  38228. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38229. this.y = r[1] * t + r[5] * i + r[9] * n,
  38230. this.z = r[2] * t + r[6] * i + r[10] * n,
  38231. this.normalize(),
  38232. this
  38233. },
  38234. divide: function(e) {
  38235. return this.x /= e.x,
  38236. this.y /= e.y,
  38237. this.z /= e.z,
  38238. this
  38239. },
  38240. divideScalar: function(e) {
  38241. return this.multiplyScalar(1 / e)
  38242. },
  38243. min: function(e) {
  38244. return this.x = Math.min(this.x, e.x),
  38245. this.y = Math.min(this.y, e.y),
  38246. this.z = Math.min(this.z, e.z),
  38247. this
  38248. },
  38249. max: function(e) {
  38250. return this.x = Math.max(this.x, e.x),
  38251. this.y = Math.max(this.y, e.y),
  38252. this.z = Math.max(this.z, e.z),
  38253. this
  38254. },
  38255. clamp: function(e, t) {
  38256. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38257. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38258. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38259. this
  38260. },
  38261. clampScalar: function() {
  38262. var e, t;
  38263. return function(i, r) {
  38264. return void 0 === e && (e = new n.Vector3,
  38265. t = new n.Vector3),
  38266. e.set(i, i, i),
  38267. t.set(r, r, r),
  38268. this.clamp(e, t)
  38269. }
  38270. }(),
  38271. clampLength: function(e, t) {
  38272. var i = this.length();
  38273. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38274. this
  38275. },
  38276. floor: function() {
  38277. return this.x = Math.floor(this.x),
  38278. this.y = Math.floor(this.y),
  38279. this.z = Math.floor(this.z),
  38280. this
  38281. },
  38282. ceil: function() {
  38283. return this.x = Math.ceil(this.x),
  38284. this.y = Math.ceil(this.y),
  38285. this.z = Math.ceil(this.z),
  38286. this
  38287. },
  38288. round: function() {
  38289. return this.x = Math.round(this.x),
  38290. this.y = Math.round(this.y),
  38291. this.z = Math.round(this.z),
  38292. this
  38293. },
  38294. roundToZero: function() {
  38295. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38296. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38297. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38298. this
  38299. },
  38300. negate: function() {
  38301. return this.x = -this.x,
  38302. this.y = -this.y,
  38303. this.z = -this.z,
  38304. this
  38305. },
  38306. dot: function(e) {
  38307. return this.x * e.x + this.y * e.y + this.z * e.z
  38308. },
  38309. lengthSq: function() {
  38310. return this.x * this.x + this.y * this.y + this.z * this.z
  38311. },
  38312. length: function() {
  38313. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38314. },
  38315. lengthManhattan: function() {
  38316. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38317. },
  38318. normalize: function() {
  38319. return this.divideScalar(this.length())
  38320. },
  38321. setLength: function(e) {
  38322. return this.multiplyScalar(e / this.length())
  38323. },
  38324. lerp: function(e, t) {
  38325. return this.x += (e.x - this.x) * t,
  38326. this.y += (e.y - this.y) * t,
  38327. this.z += (e.z - this.z) * t,
  38328. this
  38329. },
  38330. lerpVectors: function(e, t, i) {
  38331. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38332. this
  38333. },
  38334. cross: function(e, t) {
  38335. if (void 0 !== t)
  38336. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38337. this.crossVectors(e, t);
  38338. var i = this.x
  38339. , n = this.y
  38340. , r = this.z;
  38341. return this.x = n * e.z - r * e.y,
  38342. this.y = r * e.x - i * e.z,
  38343. this.z = i * e.y - n * e.x,
  38344. this
  38345. },
  38346. crossVectors: function(e, t) {
  38347. var i = e.x
  38348. , n = e.y
  38349. , r = e.z
  38350. , o = t.x
  38351. , a = t.y
  38352. , s = t.z;
  38353. return this.x = n * s - r * a,
  38354. this.y = r * o - i * s,
  38355. this.z = i * a - n * o,
  38356. this
  38357. },
  38358. projectOnVector: function() {
  38359. var e, t;
  38360. return function(i) {
  38361. return void 0 === e && (e = new n.Vector3),
  38362. e.copy(i).normalize(),
  38363. t = this.dot(e),
  38364. this.copy(e).multiplyScalar(t)
  38365. }
  38366. }(),
  38367. projectOnPlane: function() {
  38368. var e;
  38369. return function(t) {
  38370. return void 0 === e && (e = new n.Vector3),
  38371. e.copy(this).projectOnVector(t),
  38372. this.sub(e)
  38373. }
  38374. }(),
  38375. reflect: function() {
  38376. var e;
  38377. return function(t) {
  38378. return void 0 === e && (e = new n.Vector3),
  38379. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  38380. }
  38381. }(),
  38382. angleTo: function(e) {
  38383. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38384. return Math.acos(n.Math.clamp(t, -1, 1))
  38385. },
  38386. distanceTo: function(e) {
  38387. return Math.sqrt(this.distanceToSquared(e))
  38388. },
  38389. distanceToSquared: function(e) {
  38390. var t = this.x - e.x
  38391. , i = this.y - e.y
  38392. , n = this.z - e.z;
  38393. return t * t + i * i + n * n
  38394. },
  38395. setFromSpherical: function(e) {
  38396. var t = Math.sin(e.phi) * e.radius;
  38397. return this.x = t * Math.sin(e.theta),
  38398. this.y = Math.cos(e.phi) * e.radius,
  38399. this.z = t * Math.cos(e.theta),
  38400. this
  38401. },
  38402. setFromMatrixPosition: function(e) {
  38403. return this.setFromMatrixColumn(e, 3)
  38404. },
  38405. setFromMatrixScale: function(e) {
  38406. var t = this.setFromMatrixColumn(e, 0).length()
  38407. , i = this.setFromMatrixColumn(e, 1).length()
  38408. , n = this.setFromMatrixColumn(e, 2).length();
  38409. return this.x = t,
  38410. this.y = i,
  38411. this.z = n,
  38412. this
  38413. },
  38414. setFromMatrixColumn: function(e, t) {
  38415. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38416. e = arguments[1],
  38417. t = arguments[0]),
  38418. this.fromArray(e.elements, 4 * t)
  38419. },
  38420. equals: function(e) {
  38421. return e.x === this.x && e.y === this.y && e.z === this.z
  38422. },
  38423. fromArray: function(e, t) {
  38424. return void 0 === t && (t = 0),
  38425. this.x = e[t],
  38426. this.y = e[t + 1],
  38427. this.z = e[t + 2],
  38428. this
  38429. },
  38430. toArray: function(e, t) {
  38431. return void 0 === e && (e = []),
  38432. void 0 === t && (t = 0),
  38433. e[t] = this.x,
  38434. e[t + 1] = this.y,
  38435. e[t + 2] = this.z,
  38436. e
  38437. },
  38438. fromAttribute: function(e, t, i) {
  38439. return void 0 === i && (i = 0),
  38440. t = t * e.itemSize + i,
  38441. this.x = e.array[t],
  38442. this.y = e.array[t + 1],
  38443. this.z = e.array[t + 2],
  38444. this
  38445. }
  38446. },
  38447. n.Vector4 = function(e, t, i, n) {
  38448. this.x = e || 0,
  38449. this.y = t || 0,
  38450. this.z = i || 0,
  38451. this.w = void 0 !== n ? n : 1
  38452. }
  38453. ,
  38454. n.Vector4.prototype = {
  38455. constructor: n.Vector4,
  38456. set: function(e, t, i, n) {
  38457. return this.x = e,
  38458. this.y = t,
  38459. this.z = i,
  38460. this.w = n,
  38461. this
  38462. },
  38463. setScalar: function(e) {
  38464. return this.x = e,
  38465. this.y = e,
  38466. this.z = e,
  38467. this.w = e,
  38468. this
  38469. },
  38470. setX: function(e) {
  38471. return this.x = e,
  38472. this
  38473. },
  38474. setY: function(e) {
  38475. return this.y = e,
  38476. this
  38477. },
  38478. setZ: function(e) {
  38479. return this.z = e,
  38480. this
  38481. },
  38482. setW: function(e) {
  38483. return this.w = e,
  38484. this
  38485. },
  38486. setComponent: function(e, t) {
  38487. switch (e) {
  38488. case 0:
  38489. this.x = t;
  38490. break;
  38491. case 1:
  38492. this.y = t;
  38493. break;
  38494. case 2:
  38495. this.z = t;
  38496. break;
  38497. case 3:
  38498. this.w = t;
  38499. break;
  38500. default:
  38501. throw new Error("index is out of range: " + e)
  38502. }
  38503. },
  38504. getComponent: function(e) {
  38505. switch (e) {
  38506. case 0:
  38507. return this.x;
  38508. case 1:
  38509. return this.y;
  38510. case 2:
  38511. return this.z;
  38512. case 3:
  38513. return this.w;
  38514. default:
  38515. throw new Error("index is out of range: " + e)
  38516. }
  38517. },
  38518. clone: function() {
  38519. return new this.constructor(this.x,this.y,this.z,this.w)
  38520. },
  38521. copy: function(e) {
  38522. return this.x = e.x,
  38523. this.y = e.y,
  38524. this.z = e.z,
  38525. this.w = void 0 !== e.w ? e.w : 1,
  38526. this
  38527. },
  38528. add: function(e, t) {
  38529. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38530. this.addVectors(e, t)) : (this.x += e.x,
  38531. this.y += e.y,
  38532. this.z += e.z,
  38533. this.w += e.w,
  38534. this)
  38535. },
  38536. addScalar: function(e) {
  38537. return this.x += e,
  38538. this.y += e,
  38539. this.z += e,
  38540. this.w += e,
  38541. this
  38542. },
  38543. addVectors: function(e, t) {
  38544. return this.x = e.x + t.x,
  38545. this.y = e.y + t.y,
  38546. this.z = e.z + t.z,
  38547. this.w = e.w + t.w,
  38548. this
  38549. },
  38550. addScaledVector: function(e, t) {
  38551. return this.x += e.x * t,
  38552. this.y += e.y * t,
  38553. this.z += e.z * t,
  38554. this.w += e.w * t,
  38555. this
  38556. },
  38557. sub: function(e, t) {
  38558. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38559. this.subVectors(e, t)) : (this.x -= e.x,
  38560. this.y -= e.y,
  38561. this.z -= e.z,
  38562. this.w -= e.w,
  38563. this)
  38564. },
  38565. subScalar: function(e) {
  38566. return this.x -= e,
  38567. this.y -= e,
  38568. this.z -= e,
  38569. this.w -= e,
  38570. this
  38571. },
  38572. subVectors: function(e, t) {
  38573. return this.x = e.x - t.x,
  38574. this.y = e.y - t.y,
  38575. this.z = e.z - t.z,
  38576. this.w = e.w - t.w,
  38577. this
  38578. },
  38579. multiplyScalar: function(e) {
  38580. return isFinite(e) ? (this.x *= e,
  38581. this.y *= e,
  38582. this.z *= e,
  38583. this.w *= e) : (this.x = 0,
  38584. this.y = 0,
  38585. this.z = 0,
  38586. this.w = 0),
  38587. this
  38588. },
  38589. applyMatrix4: function(e) {
  38590. var t = this.x
  38591. , i = this.y
  38592. , n = this.z
  38593. , r = this.w
  38594. , o = e.elements;
  38595. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38596. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38597. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38598. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38599. this
  38600. },
  38601. divideScalar: function(e) {
  38602. return this.multiplyScalar(1 / e)
  38603. },
  38604. setAxisAngleFromQuaternion: function(e) {
  38605. this.w = 2 * Math.acos(e.w);
  38606. var t = Math.sqrt(1 - e.w * e.w);
  38607. return t < 1e-4 ? (this.x = 1,
  38608. this.y = 0,
  38609. this.z = 0) : (this.x = e.x / t,
  38610. this.y = e.y / t,
  38611. this.z = e.z / t),
  38612. this
  38613. },
  38614. setAxisAngleFromRotationMatrix: function(e) {
  38615. var t, i, n, r, o = .01, a = .1, s = e.elements, l = s[0], c = s[4], h = s[8], u = s[1], d = s[5], p = s[9], f = s[2], g = s[6], m = s[10];
  38616. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  38617. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  38618. return this.set(1, 0, 0, 0),
  38619. this;
  38620. t = Math.PI;
  38621. var v = (l + 1) / 2
  38622. , A = (d + 1) / 2
  38623. , y = (m + 1) / 2
  38624. , C = (c + u) / 4
  38625. , I = (h + f) / 4
  38626. , E = (p + g) / 4;
  38627. return v > A && v > y ? v < o ? (i = 0,
  38628. n = .707106781,
  38629. r = .707106781) : (i = Math.sqrt(v),
  38630. n = C / i,
  38631. r = I / i) : A > y ? A < o ? (i = .707106781,
  38632. n = 0,
  38633. r = .707106781) : (n = Math.sqrt(A),
  38634. i = C / n,
  38635. r = E / n) : y < o ? (i = .707106781,
  38636. n = .707106781,
  38637. r = 0) : (r = Math.sqrt(y),
  38638. i = I / r,
  38639. n = E / r),
  38640. this.set(i, n, r, t),
  38641. this
  38642. }
  38643. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  38644. return Math.abs(b) < .001 && (b = 1),
  38645. this.x = (g - p) / b,
  38646. this.y = (h - f) / b,
  38647. this.z = (u - c) / b,
  38648. this.w = Math.acos((l + d + m - 1) / 2),
  38649. this
  38650. },
  38651. min: function(e) {
  38652. return this.x = Math.min(this.x, e.x),
  38653. this.y = Math.min(this.y, e.y),
  38654. this.z = Math.min(this.z, e.z),
  38655. this.w = Math.min(this.w, e.w),
  38656. this
  38657. },
  38658. max: function(e) {
  38659. return this.x = Math.max(this.x, e.x),
  38660. this.y = Math.max(this.y, e.y),
  38661. this.z = Math.max(this.z, e.z),
  38662. this.w = Math.max(this.w, e.w),
  38663. this
  38664. },
  38665. clamp: function(e, t) {
  38666. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38667. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38668. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38669. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38670. this
  38671. },
  38672. clampScalar: function() {
  38673. var e, t;
  38674. return function(i, r) {
  38675. return void 0 === e && (e = new n.Vector4,
  38676. t = new n.Vector4),
  38677. e.set(i, i, i, i),
  38678. t.set(r, r, r, r),
  38679. this.clamp(e, t)
  38680. }
  38681. }(),
  38682. floor: function() {
  38683. return this.x = Math.floor(this.x),
  38684. this.y = Math.floor(this.y),
  38685. this.z = Math.floor(this.z),
  38686. this.w = Math.floor(this.w),
  38687. this
  38688. },
  38689. ceil: function() {
  38690. return this.x = Math.ceil(this.x),
  38691. this.y = Math.ceil(this.y),
  38692. this.z = Math.ceil(this.z),
  38693. this.w = Math.ceil(this.w),
  38694. this
  38695. },
  38696. round: function() {
  38697. return this.x = Math.round(this.x),
  38698. this.y = Math.round(this.y),
  38699. this.z = Math.round(this.z),
  38700. this.w = Math.round(this.w),
  38701. this
  38702. },
  38703. roundToZero: function() {
  38704. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38705. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38706. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38707. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38708. this
  38709. },
  38710. negate: function() {
  38711. return this.x = -this.x,
  38712. this.y = -this.y,
  38713. this.z = -this.z,
  38714. this.w = -this.w,
  38715. this
  38716. },
  38717. dot: function(e) {
  38718. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38719. },
  38720. lengthSq: function() {
  38721. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38722. },
  38723. length: function() {
  38724. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38725. },
  38726. lengthManhattan: function() {
  38727. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38728. },
  38729. normalize: function() {
  38730. return this.divideScalar(this.length())
  38731. },
  38732. setLength: function(e) {
  38733. return this.multiplyScalar(e / this.length())
  38734. },
  38735. lerp: function(e, t) {
  38736. return this.x += (e.x - this.x) * t,
  38737. this.y += (e.y - this.y) * t,
  38738. this.z += (e.z - this.z) * t,
  38739. this.w += (e.w - this.w) * t,
  38740. this
  38741. },
  38742. lerpVectors: function(e, t, i) {
  38743. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38744. this
  38745. },
  38746. equals: function(e) {
  38747. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38748. },
  38749. fromArray: function(e, t) {
  38750. return void 0 === t && (t = 0),
  38751. this.x = e[t],
  38752. this.y = e[t + 1],
  38753. this.z = e[t + 2],
  38754. this.w = e[t + 3],
  38755. this
  38756. },
  38757. toArray: function(e, t) {
  38758. return void 0 === e && (e = []),
  38759. void 0 === t && (t = 0),
  38760. e[t] = this.x,
  38761. e[t + 1] = this.y,
  38762. e[t + 2] = this.z,
  38763. e[t + 3] = this.w,
  38764. e
  38765. },
  38766. fromAttribute: function(e, t, i) {
  38767. return void 0 === i && (i = 0),
  38768. t = t * e.itemSize + i,
  38769. this.x = e.array[t],
  38770. this.y = e.array[t + 1],
  38771. this.z = e.array[t + 2],
  38772. this.w = e.array[t + 3],
  38773. this
  38774. }
  38775. },
  38776. n.Euler = function(e, t, i, r) {
  38777. this._x = e || 0,
  38778. this._y = t || 0,
  38779. this._z = i || 0,
  38780. this._order = r || n.Euler.DefaultOrder
  38781. }
  38782. ,
  38783. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38784. n.Euler.DefaultOrder = "XYZ",
  38785. n.Euler.prototype = {
  38786. constructor: n.Euler,
  38787. get x() {
  38788. return this._x
  38789. },
  38790. set x(e) {
  38791. this._x = e,
  38792. this.onChangeCallback()
  38793. },
  38794. get y() {
  38795. return this._y
  38796. },
  38797. set y(e) {
  38798. this._y = e,
  38799. this.onChangeCallback()
  38800. },
  38801. get z() {
  38802. return this._z
  38803. },
  38804. set z(e) {
  38805. this._z = e,
  38806. this.onChangeCallback()
  38807. },
  38808. get order() {
  38809. return this._order
  38810. },
  38811. set order(e) {
  38812. this._order = e,
  38813. this.onChangeCallback()
  38814. },
  38815. set: function(e, t, i, n) {
  38816. return this._x = e,
  38817. this._y = t,
  38818. this._z = i,
  38819. this._order = n || this._order,
  38820. this.onChangeCallback(),
  38821. this
  38822. },
  38823. clone: function() {
  38824. return new this.constructor(this._x,this._y,this._z,this._order)
  38825. },
  38826. copy: function(e) {
  38827. return this._x = e._x,
  38828. this._y = e._y,
  38829. this._z = e._z,
  38830. this._order = e._order,
  38831. this.onChangeCallback(),
  38832. this
  38833. },
  38834. setFromRotationMatrix: function(e, t, i) {
  38835. var r = n.Math.clamp
  38836. , o = e.elements
  38837. , a = o[0]
  38838. , s = o[4]
  38839. , l = o[8]
  38840. , c = o[1]
  38841. , h = o[5]
  38842. , u = o[9]
  38843. , d = o[2]
  38844. , p = o[6]
  38845. , f = o[10];
  38846. return t = t || this._order,
  38847. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  38848. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  38849. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  38850. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  38851. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  38852. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  38853. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  38854. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  38855. this._z = Math.atan2(-s, h)) : (this._y = 0,
  38856. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  38857. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  38858. this._z = Math.atan2(c, a)) : (this._x = 0,
  38859. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  38860. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  38861. this._y = Math.atan2(-d, a)) : (this._x = 0,
  38862. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  38863. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  38864. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  38865. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38866. this._order = t,
  38867. i !== !1 && this.onChangeCallback(),
  38868. this
  38869. },
  38870. setFromQuaternion: function() {
  38871. var e;
  38872. return function(t, i, r) {
  38873. return void 0 === e && (e = new n.Matrix4),
  38874. e.makeRotationFromQuaternion(t),
  38875. this.setFromRotationMatrix(e, i, r),
  38876. this
  38877. }
  38878. }(),
  38879. setFromVector3: function(e, t) {
  38880. return this.set(e.x, e.y, e.z, t || this._order)
  38881. },
  38882. reorder: function() {
  38883. var e = new n.Quaternion;
  38884. return function(t) {
  38885. e.setFromEuler(this),
  38886. this.setFromQuaternion(e, t)
  38887. }
  38888. }(),
  38889. equals: function(e) {
  38890. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38891. },
  38892. fromArray: function(e) {
  38893. return this._x = e[0],
  38894. this._y = e[1],
  38895. this._z = e[2],
  38896. void 0 !== e[3] && (this._order = e[3]),
  38897. this.onChangeCallback(),
  38898. this
  38899. },
  38900. toArray: function(e, t) {
  38901. return void 0 === e && (e = []),
  38902. void 0 === t && (t = 0),
  38903. e[t] = this._x,
  38904. e[t + 1] = this._y,
  38905. e[t + 2] = this._z,
  38906. e[t + 3] = this._order,
  38907. e
  38908. },
  38909. toVector3: function(e) {
  38910. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  38911. },
  38912. onChange: function(e) {
  38913. return this.onChangeCallback = e,
  38914. this
  38915. },
  38916. onChangeCallback: function() {}
  38917. },
  38918. n.Line3 = function(e, t) {
  38919. this.start = void 0 !== e ? e : new n.Vector3,
  38920. this.end = void 0 !== t ? t : new n.Vector3
  38921. }
  38922. ,
  38923. n.Line3.prototype = {
  38924. constructor: n.Line3,
  38925. set: function(e, t) {
  38926. return this.start.copy(e),
  38927. this.end.copy(t),
  38928. this
  38929. },
  38930. clone: function() {
  38931. return (new this.constructor).copy(this)
  38932. },
  38933. copy: function(e) {
  38934. return this.start.copy(e.start),
  38935. this.end.copy(e.end),
  38936. this
  38937. },
  38938. center: function(e) {
  38939. var t = e || new n.Vector3;
  38940. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  38941. },
  38942. delta: function(e) {
  38943. var t = e || new n.Vector3;
  38944. return t.subVectors(this.end, this.start)
  38945. },
  38946. distanceSq: function() {
  38947. return this.start.distanceToSquared(this.end)
  38948. },
  38949. distance: function() {
  38950. return this.start.distanceTo(this.end)
  38951. },
  38952. at: function(e, t) {
  38953. var i = t || new n.Vector3;
  38954. return this.delta(i).multiplyScalar(e).add(this.start)
  38955. },
  38956. closestPointToPointParameter: function() {
  38957. var e = new n.Vector3
  38958. , t = new n.Vector3;
  38959. return function(i, r) {
  38960. e.subVectors(i, this.start),
  38961. t.subVectors(this.end, this.start);
  38962. var o = t.dot(t)
  38963. , a = t.dot(e)
  38964. , s = a / o;
  38965. return r && (s = n.Math.clamp(s, 0, 1)),
  38966. s
  38967. }
  38968. }(),
  38969. closestPointToPoint: function(e, t, i) {
  38970. var r = this.closestPointToPointParameter(e, t)
  38971. , o = i || new n.Vector3;
  38972. return this.delta(o).multiplyScalar(r).add(this.start)
  38973. },
  38974. applyMatrix4: function(e) {
  38975. return this.start.applyMatrix4(e),
  38976. this.end.applyMatrix4(e),
  38977. this
  38978. },
  38979. equals: function(e) {
  38980. return e.start.equals(this.start) && e.end.equals(this.end)
  38981. }
  38982. },
  38983. n.Box2 = function(e, t) {
  38984. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  38985. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  38986. }
  38987. ,
  38988. n.Box2.prototype = {
  38989. constructor: n.Box2,
  38990. set: function(e, t) {
  38991. return this.min.copy(e),
  38992. this.max.copy(t),
  38993. this
  38994. },
  38995. setFromPoints: function(e) {
  38996. this.makeEmpty();
  38997. for (var t = 0, i = e.length; t < i; t++)
  38998. this.expandByPoint(e[t]);
  38999. return this
  39000. },
  39001. setFromCenterAndSize: function() {
  39002. var e = new n.Vector2;
  39003. return function(t, i) {
  39004. var n = e.copy(i).multiplyScalar(.5);
  39005. return this.min.copy(t).sub(n),
  39006. this.max.copy(t).add(n),
  39007. this
  39008. }
  39009. }(),
  39010. clone: function() {
  39011. return (new this.constructor).copy(this)
  39012. },
  39013. copy: function(e) {
  39014. return this.min.copy(e.min),
  39015. this.max.copy(e.max),
  39016. this
  39017. },
  39018. makeEmpty: function() {
  39019. return this.min.x = this.min.y = +(1 / 0),
  39020. this.max.x = this.max.y = -(1 / 0),
  39021. this
  39022. },
  39023. isEmpty: function() {
  39024. return this.max.x < this.min.x || this.max.y < this.min.y
  39025. },
  39026. center: function(e) {
  39027. var t = e || new n.Vector2;
  39028. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  39029. },
  39030. size: function(e) {
  39031. var t = e || new n.Vector2;
  39032. return t.subVectors(this.max, this.min)
  39033. },
  39034. expandByPoint: function(e) {
  39035. return this.min.min(e),
  39036. this.max.max(e),
  39037. this
  39038. },
  39039. expandByVector: function(e) {
  39040. return this.min.sub(e),
  39041. this.max.add(e),
  39042. this
  39043. },
  39044. expandByScalar: function(e) {
  39045. return this.min.addScalar(-e),
  39046. this.max.addScalar(e),
  39047. this
  39048. },
  39049. containsPoint: function(e) {
  39050. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39051. },
  39052. containsBox: function(e) {
  39053. 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
  39054. },
  39055. getParameter: function(e, t) {
  39056. var i = t || new n.Vector2;
  39057. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  39058. },
  39059. intersectsBox: function(e) {
  39060. 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)
  39061. },
  39062. clampPoint: function(e, t) {
  39063. var i = t || new n.Vector2;
  39064. return i.copy(e).clamp(this.min, this.max)
  39065. },
  39066. distanceToPoint: function() {
  39067. var e = new n.Vector2;
  39068. return function(t) {
  39069. var i = e.copy(t).clamp(this.min, this.max);
  39070. return i.sub(t).length()
  39071. }
  39072. }(),
  39073. intersect: function(e) {
  39074. return this.min.max(e.min),
  39075. this.max.min(e.max),
  39076. this
  39077. },
  39078. union: function(e) {
  39079. return this.min.min(e.min),
  39080. this.max.max(e.max),
  39081. this
  39082. },
  39083. translate: function(e) {
  39084. return this.min.add(e),
  39085. this.max.add(e),
  39086. this
  39087. },
  39088. equals: function(e) {
  39089. return e.min.equals(this.min) && e.max.equals(this.max)
  39090. }
  39091. },
  39092. n.Box3 = function(e, t) {
  39093. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  39094. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  39095. }
  39096. ,
  39097. n.Box3.prototype = {
  39098. constructor: n.Box3,
  39099. set: function(e, t) {
  39100. return this.min.copy(e),
  39101. this.max.copy(t),
  39102. this
  39103. },
  39104. setFromArray: function(e) {
  39105. this.makeEmpty();
  39106. 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) {
  39107. var c = e[s]
  39108. , h = e[s + 1]
  39109. , u = e[s + 2];
  39110. c < t && (t = c),
  39111. h < i && (i = h),
  39112. u < n && (n = u),
  39113. c > r && (r = c),
  39114. h > o && (o = h),
  39115. u > a && (a = u)
  39116. }
  39117. this.min.set(t, i, n),
  39118. this.max.set(r, o, a)
  39119. },
  39120. setFromPoints: function(e) {
  39121. this.makeEmpty();
  39122. for (var t = 0, i = e.length; t < i; t++)
  39123. this.expandByPoint(e[t]);
  39124. return this
  39125. },
  39126. setFromCenterAndSize: function() {
  39127. var e = new n.Vector3;
  39128. return function(t, i) {
  39129. var n = e.copy(i).multiplyScalar(.5);
  39130. return this.min.copy(t).sub(n),
  39131. this.max.copy(t).add(n),
  39132. this
  39133. }
  39134. }(),
  39135. setFromObject: function() {
  39136. var e;
  39137. return function(t) {
  39138. void 0 === e && (e = new n.Box3);
  39139. var i = this;
  39140. return this.makeEmpty(),
  39141. t.updateMatrixWorld(!0),
  39142. t.traverse(function(t) {
  39143. var n = t.geometry;
  39144. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  39145. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  39146. e.applyMatrix4(t.matrixWorld),
  39147. i.union(e)))
  39148. }),
  39149. this
  39150. }
  39151. }(),
  39152. clone: function() {
  39153. return (new this.constructor).copy(this)
  39154. },
  39155. copy: function(e) {
  39156. return this.min.copy(e.min),
  39157. this.max.copy(e.max),
  39158. this
  39159. },
  39160. makeEmpty: function() {
  39161. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  39162. this.max.x = this.max.y = this.max.z = -(1 / 0),
  39163. this
  39164. },
  39165. isEmpty: function() {
  39166. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39167. },
  39168. center: function(e) {
  39169. var t = e || new n.Vector3;
  39170. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  39171. },
  39172. size: function(e) {
  39173. var t = e || new n.Vector3;
  39174. return t.subVectors(this.max, this.min)
  39175. },
  39176. expandByPoint: function(e) {
  39177. return this.min.min(e),
  39178. this.max.max(e),
  39179. this
  39180. },
  39181. expandByVector: function(e) {
  39182. return this.min.sub(e),
  39183. this.max.add(e),
  39184. this
  39185. },
  39186. expandByScalar: function(e) {
  39187. return this.min.addScalar(-e),
  39188. this.max.addScalar(e),
  39189. this
  39190. },
  39191. containsPoint: function(e) {
  39192. 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)
  39193. },
  39194. containsBox: function(e) {
  39195. 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
  39196. },
  39197. getParameter: function(e, t) {
  39198. var i = t || new n.Vector3;
  39199. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  39200. },
  39201. intersectsBox: function(e) {
  39202. 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)
  39203. },
  39204. intersectsSphere: function() {
  39205. var e;
  39206. return function(t) {
  39207. return void 0 === e && (e = new n.Vector3),
  39208. this.clampPoint(t.center, e),
  39209. e.distanceToSquared(t.center) <= t.radius * t.radius
  39210. }
  39211. }(),
  39212. intersectsPlane: function(e) {
  39213. var t, i;
  39214. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  39215. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39216. i = e.normal.x * this.min.x),
  39217. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  39218. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39219. i += e.normal.y * this.min.y),
  39220. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  39221. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39222. i += e.normal.z * this.min.z),
  39223. t <= e.constant && i >= e.constant
  39224. },
  39225. clampPoint: function(e, t) {
  39226. var i = t || new n.Vector3;
  39227. return i.copy(e).clamp(this.min, this.max)
  39228. },
  39229. distanceToPoint: function() {
  39230. var e = new n.Vector3;
  39231. return function(t) {
  39232. var i = e.copy(t).clamp(this.min, this.max);
  39233. return i.sub(t).length()
  39234. }
  39235. }(),
  39236. getBoundingSphere: function() {
  39237. var e = new n.Vector3;
  39238. return function(t) {
  39239. var i = t || new n.Sphere;
  39240. return i.center = this.center(),
  39241. i.radius = .5 * this.size(e).length(),
  39242. i
  39243. }
  39244. }(),
  39245. intersect: function(e) {
  39246. return this.min.max(e.min),
  39247. this.max.min(e.max),
  39248. this
  39249. },
  39250. union: function(e) {
  39251. return this.min.min(e.min),
  39252. this.max.max(e.max),
  39253. this
  39254. },
  39255. applyMatrix4: function() {
  39256. var e = [new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3];
  39257. return function(t) {
  39258. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  39259. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  39260. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  39261. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  39262. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  39263. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  39264. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  39265. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  39266. this.makeEmpty(),
  39267. this.setFromPoints(e),
  39268. this
  39269. }
  39270. }(),
  39271. translate: function(e) {
  39272. return this.min.add(e),
  39273. this.max.add(e),
  39274. this
  39275. },
  39276. equals: function(e) {
  39277. return e.min.equals(this.min) && e.max.equals(this.max)
  39278. }
  39279. },
  39280. n.Matrix3 = function() {
  39281. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39282. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39283. }
  39284. ,
  39285. n.Matrix3.prototype = {
  39286. constructor: n.Matrix3,
  39287. set: function(e, t, i, n, r, o, a, s, l) {
  39288. var c = this.elements;
  39289. return c[0] = e,
  39290. c[1] = n,
  39291. c[2] = a,
  39292. c[3] = t,
  39293. c[4] = r,
  39294. c[5] = s,
  39295. c[6] = i,
  39296. c[7] = o,
  39297. c[8] = l,
  39298. this
  39299. },
  39300. identity: function() {
  39301. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39302. this
  39303. },
  39304. clone: function() {
  39305. return (new this.constructor).fromArray(this.elements)
  39306. },
  39307. copy: function(e) {
  39308. var t = e.elements;
  39309. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39310. this
  39311. },
  39312. setFromMatrix4: function(e) {
  39313. var t = e.elements;
  39314. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39315. this
  39316. },
  39317. applyToVector3Array: function() {
  39318. var e;
  39319. return function(t, i, r) {
  39320. void 0 === e && (e = new n.Vector3),
  39321. void 0 === i && (i = 0),
  39322. void 0 === r && (r = t.length);
  39323. for (var o = 0, a = i; o < r; o += 3,
  39324. a += 3)
  39325. e.fromArray(t, a),
  39326. e.applyMatrix3(this),
  39327. e.toArray(t, a);
  39328. return t
  39329. }
  39330. }(),
  39331. applyToBuffer: function() {
  39332. var e;
  39333. return function(t, i, r) {
  39334. void 0 === e && (e = new n.Vector3),
  39335. void 0 === i && (i = 0),
  39336. void 0 === r && (r = t.length / t.itemSize);
  39337. for (var o = 0, a = i; o < r; o++,
  39338. a++)
  39339. e.x = t.getX(a),
  39340. e.y = t.getY(a),
  39341. e.z = t.getZ(a),
  39342. e.applyMatrix3(this),
  39343. t.setXYZ(e.x, e.y, e.z);
  39344. return t
  39345. }
  39346. }(),
  39347. multiplyScalar: function(e) {
  39348. var t = this.elements;
  39349. return t[0] *= e,
  39350. t[3] *= e,
  39351. t[6] *= e,
  39352. t[1] *= e,
  39353. t[4] *= e,
  39354. t[7] *= e,
  39355. t[2] *= e,
  39356. t[5] *= e,
  39357. t[8] *= e,
  39358. this
  39359. },
  39360. determinant: function() {
  39361. var e = this.elements
  39362. , t = e[0]
  39363. , i = e[1]
  39364. , n = e[2]
  39365. , r = e[3]
  39366. , o = e[4]
  39367. , a = e[5]
  39368. , s = e[6]
  39369. , l = e[7]
  39370. , c = e[8];
  39371. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39372. },
  39373. getInverse: function(e, t) {
  39374. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39375. var i = e.elements
  39376. , r = this.elements
  39377. , o = i[0]
  39378. , a = i[1]
  39379. , s = i[2]
  39380. , l = i[3]
  39381. , c = i[4]
  39382. , h = i[5]
  39383. , u = i[6]
  39384. , d = i[7]
  39385. , p = i[8]
  39386. , f = p * c - h * d
  39387. , g = h * u - p * l
  39388. , m = d * l - c * u
  39389. , v = o * f + a * g + s * m;
  39390. if (0 === v) {
  39391. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39392. if (t)
  39393. throw new Error(A);
  39394. return console.warn(A),
  39395. this.identity()
  39396. }
  39397. return r[0] = f,
  39398. r[1] = s * d - p * a,
  39399. r[2] = h * a - s * c,
  39400. r[3] = g,
  39401. r[4] = p * o - s * u,
  39402. r[5] = s * l - h * o,
  39403. r[6] = m,
  39404. r[7] = a * u - d * o,
  39405. r[8] = c * o - a * l,
  39406. this.multiplyScalar(1 / v)
  39407. },
  39408. transpose: function() {
  39409. var e, t = this.elements;
  39410. return e = t[1],
  39411. t[1] = t[3],
  39412. t[3] = e,
  39413. e = t[2],
  39414. t[2] = t[6],
  39415. t[6] = e,
  39416. e = t[5],
  39417. t[5] = t[7],
  39418. t[7] = e,
  39419. this
  39420. },
  39421. flattenToArrayOffset: function(e, t) {
  39422. var i = this.elements;
  39423. return e[t] = i[0],
  39424. e[t + 1] = i[1],
  39425. e[t + 2] = i[2],
  39426. e[t + 3] = i[3],
  39427. e[t + 4] = i[4],
  39428. e[t + 5] = i[5],
  39429. e[t + 6] = i[6],
  39430. e[t + 7] = i[7],
  39431. e[t + 8] = i[8],
  39432. e
  39433. },
  39434. getNormalMatrix: function(e) {
  39435. return this.setFromMatrix4(e).getInverse(this).transpose()
  39436. },
  39437. transposeIntoArray: function(e) {
  39438. var t = this.elements;
  39439. return e[0] = t[0],
  39440. e[1] = t[3],
  39441. e[2] = t[6],
  39442. e[3] = t[1],
  39443. e[4] = t[4],
  39444. e[5] = t[7],
  39445. e[6] = t[2],
  39446. e[7] = t[5],
  39447. e[8] = t[8],
  39448. this
  39449. },
  39450. fromArray: function(e) {
  39451. return this.elements.set(e),
  39452. this
  39453. },
  39454. toArray: function() {
  39455. var e = this.elements;
  39456. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39457. }
  39458. },
  39459. n.Matrix4 = function() {
  39460. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39461. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39462. }
  39463. ,
  39464. n.Matrix4.prototype = {
  39465. constructor: n.Matrix4,
  39466. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39467. var m = this.elements;
  39468. return m[0] = e,
  39469. m[4] = t,
  39470. m[8] = i,
  39471. m[12] = n,
  39472. m[1] = r,
  39473. m[5] = o,
  39474. m[9] = a,
  39475. m[13] = s,
  39476. m[2] = l,
  39477. m[6] = c,
  39478. m[10] = h,
  39479. m[14] = u,
  39480. m[3] = d,
  39481. m[7] = p,
  39482. m[11] = f,
  39483. m[15] = g,
  39484. this
  39485. },
  39486. identity: function() {
  39487. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39488. this
  39489. },
  39490. clone: function() {
  39491. return (new n.Matrix4).fromArray(this.elements)
  39492. },
  39493. copy: function(e) {
  39494. return this.elements.set(e.elements),
  39495. this
  39496. },
  39497. copyPosition: function(e) {
  39498. var t = this.elements
  39499. , i = e.elements;
  39500. return t[12] = i[12],
  39501. t[13] = i[13],
  39502. t[14] = i[14],
  39503. this
  39504. },
  39505. extractBasis: function(e, t, i) {
  39506. return e.setFromMatrixColumn(this, 0),
  39507. t.setFromMatrixColumn(this, 1),
  39508. i.setFromMatrixColumn(this, 2),
  39509. this
  39510. },
  39511. makeBasis: function(e, t, i) {
  39512. 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),
  39513. this
  39514. },
  39515. extractRotation: function() {
  39516. var e;
  39517. return function(t) {
  39518. void 0 === e && (e = new n.Vector3);
  39519. var i = this.elements
  39520. , r = t.elements
  39521. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  39522. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  39523. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  39524. return i[0] = r[0] * o,
  39525. i[1] = r[1] * o,
  39526. i[2] = r[2] * o,
  39527. i[4] = r[4] * a,
  39528. i[5] = r[5] * a,
  39529. i[6] = r[6] * a,
  39530. i[8] = r[8] * s,
  39531. i[9] = r[9] * s,
  39532. i[10] = r[10] * s,
  39533. this
  39534. }
  39535. }(),
  39536. makeRotationFromEuler: function(e) {
  39537. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39538. var t = this.elements
  39539. , i = e.x
  39540. , r = e.y
  39541. , o = e.z
  39542. , a = Math.cos(i)
  39543. , s = Math.sin(i)
  39544. , l = Math.cos(r)
  39545. , c = Math.sin(r)
  39546. , h = Math.cos(o)
  39547. , u = Math.sin(o);
  39548. if ("XYZ" === e.order) {
  39549. var d = a * h
  39550. , p = a * u
  39551. , f = s * h
  39552. , g = s * u;
  39553. t[0] = l * h,
  39554. t[4] = -l * u,
  39555. t[8] = c,
  39556. t[1] = p + f * c,
  39557. t[5] = d - g * c,
  39558. t[9] = -s * l,
  39559. t[2] = g - d * c,
  39560. t[6] = f + p * c,
  39561. t[10] = a * l
  39562. } else if ("YXZ" === e.order) {
  39563. var m = l * h
  39564. , v = l * u
  39565. , A = c * h
  39566. , y = c * u;
  39567. t[0] = m + y * s,
  39568. t[4] = A * s - v,
  39569. t[8] = a * c,
  39570. t[1] = a * u,
  39571. t[5] = a * h,
  39572. t[9] = -s,
  39573. t[2] = v * s - A,
  39574. t[6] = y + m * s,
  39575. t[10] = a * l
  39576. } else if ("ZXY" === e.order) {
  39577. var m = l * h
  39578. , v = l * u
  39579. , A = c * h
  39580. , y = c * u;
  39581. t[0] = m - y * s,
  39582. t[4] = -a * u,
  39583. t[8] = A + v * s,
  39584. t[1] = v + A * s,
  39585. t[5] = a * h,
  39586. t[9] = y - m * s,
  39587. t[2] = -a * c,
  39588. t[6] = s,
  39589. t[10] = a * l
  39590. } else if ("ZYX" === e.order) {
  39591. var d = a * h
  39592. , p = a * u
  39593. , f = s * h
  39594. , g = s * u;
  39595. t[0] = l * h,
  39596. t[4] = f * c - p,
  39597. t[8] = d * c + g,
  39598. t[1] = l * u,
  39599. t[5] = g * c + d,
  39600. t[9] = p * c - f,
  39601. t[2] = -c,
  39602. t[6] = s * l,
  39603. t[10] = a * l
  39604. } else if ("YZX" === e.order) {
  39605. var C = a * l
  39606. , I = a * c
  39607. , E = s * l
  39608. , b = s * c;
  39609. t[0] = l * h,
  39610. t[4] = b - C * u,
  39611. t[8] = E * u + I,
  39612. t[1] = u,
  39613. t[5] = a * h,
  39614. t[9] = -s * h,
  39615. t[2] = -c * h,
  39616. t[6] = I * u + E,
  39617. t[10] = C - b * u
  39618. } else if ("XZY" === e.order) {
  39619. var C = a * l
  39620. , I = a * c
  39621. , E = s * l
  39622. , b = s * c;
  39623. t[0] = l * h,
  39624. t[4] = -u,
  39625. t[8] = c * h,
  39626. t[1] = C * u + b,
  39627. t[5] = a * h,
  39628. t[9] = I * u - E,
  39629. t[2] = E * u - I,
  39630. t[6] = s * h,
  39631. t[10] = b * u + C
  39632. }
  39633. return t[3] = 0,
  39634. t[7] = 0,
  39635. t[11] = 0,
  39636. t[12] = 0,
  39637. t[13] = 0,
  39638. t[14] = 0,
  39639. t[15] = 1,
  39640. this
  39641. },
  39642. makeRotationFromQuaternion: function(e) {
  39643. var t = this.elements
  39644. , i = e.x
  39645. , n = e.y
  39646. , r = e.z
  39647. , o = e.w
  39648. , a = i + i
  39649. , s = n + n
  39650. , l = r + r
  39651. , c = i * a
  39652. , h = i * s
  39653. , u = i * l
  39654. , d = n * s
  39655. , p = n * l
  39656. , f = r * l
  39657. , g = o * a
  39658. , m = o * s
  39659. , v = o * l;
  39660. return t[0] = 1 - (d + f),
  39661. t[4] = h - v,
  39662. t[8] = u + m,
  39663. t[1] = h + v,
  39664. t[5] = 1 - (c + f),
  39665. t[9] = p - g,
  39666. t[2] = u - m,
  39667. t[6] = p + g,
  39668. t[10] = 1 - (c + d),
  39669. t[3] = 0,
  39670. t[7] = 0,
  39671. t[11] = 0,
  39672. t[12] = 0,
  39673. t[13] = 0,
  39674. t[14] = 0,
  39675. t[15] = 1,
  39676. this
  39677. },
  39678. lookAt: function() {
  39679. var e, t, i;
  39680. return function(r, o, a) {
  39681. void 0 === e && (e = new n.Vector3),
  39682. void 0 === t && (t = new n.Vector3),
  39683. void 0 === i && (i = new n.Vector3);
  39684. var s = this.elements;
  39685. return i.subVectors(r, o).normalize(),
  39686. 0 === i.lengthSq() && (i.z = 1),
  39687. e.crossVectors(a, i).normalize(),
  39688. 0 === e.lengthSq() && (i.x += 1e-4,
  39689. e.crossVectors(a, i).normalize()),
  39690. t.crossVectors(i, e),
  39691. s[0] = e.x,
  39692. s[4] = t.x,
  39693. s[8] = i.x,
  39694. s[1] = e.y,
  39695. s[5] = t.y,
  39696. s[9] = i.y,
  39697. s[2] = e.z,
  39698. s[6] = t.z,
  39699. s[10] = i.z,
  39700. this
  39701. }
  39702. }(),
  39703. multiply: function(e, t) {
  39704. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39705. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39706. },
  39707. multiplyMatrices: function(e, t) {
  39708. var i = e.elements
  39709. , n = t.elements
  39710. , r = this.elements
  39711. , o = i[0]
  39712. , a = i[4]
  39713. , s = i[8]
  39714. , l = i[12]
  39715. , c = i[1]
  39716. , h = i[5]
  39717. , u = i[9]
  39718. , d = i[13]
  39719. , p = i[2]
  39720. , f = i[6]
  39721. , g = i[10]
  39722. , m = i[14]
  39723. , v = i[3]
  39724. , A = i[7]
  39725. , y = i[11]
  39726. , C = i[15]
  39727. , I = n[0]
  39728. , E = n[4]
  39729. , b = n[8]
  39730. , w = n[12]
  39731. , _ = n[1]
  39732. , T = n[5]
  39733. , x = n[9]
  39734. , S = n[13]
  39735. , M = n[2]
  39736. , R = n[6]
  39737. , P = n[10]
  39738. , O = n[14]
  39739. , L = n[3]
  39740. , D = n[7]
  39741. , N = n[11]
  39742. , B = n[15];
  39743. return r[0] = o * I + a * _ + s * M + l * L,
  39744. r[4] = o * E + a * T + s * R + l * D,
  39745. r[8] = o * b + a * x + s * P + l * N,
  39746. r[12] = o * w + a * S + s * O + l * B,
  39747. r[1] = c * I + h * _ + u * M + d * L,
  39748. r[5] = c * E + h * T + u * R + d * D,
  39749. r[9] = c * b + h * x + u * P + d * N,
  39750. r[13] = c * w + h * S + u * O + d * B,
  39751. r[2] = p * I + f * _ + g * M + m * L,
  39752. r[6] = p * E + f * T + g * R + m * D,
  39753. r[10] = p * b + f * x + g * P + m * N,
  39754. r[14] = p * w + f * S + g * O + m * B,
  39755. r[3] = v * I + A * _ + y * M + C * L,
  39756. r[7] = v * E + A * T + y * R + C * D,
  39757. r[11] = v * b + A * x + y * P + C * N,
  39758. r[15] = v * w + A * S + y * O + C * B,
  39759. this
  39760. },
  39761. multiplyToArray: function(e, t, i) {
  39762. var n = this.elements;
  39763. return this.multiplyMatrices(e, t),
  39764. i[0] = n[0],
  39765. i[1] = n[1],
  39766. i[2] = n[2],
  39767. i[3] = n[3],
  39768. i[4] = n[4],
  39769. i[5] = n[5],
  39770. i[6] = n[6],
  39771. i[7] = n[7],
  39772. i[8] = n[8],
  39773. i[9] = n[9],
  39774. i[10] = n[10],
  39775. i[11] = n[11],
  39776. i[12] = n[12],
  39777. i[13] = n[13],
  39778. i[14] = n[14],
  39779. i[15] = n[15],
  39780. this
  39781. },
  39782. multiplyScalar: function(e) {
  39783. var t = this.elements;
  39784. return t[0] *= e,
  39785. t[4] *= e,
  39786. t[8] *= e,
  39787. t[12] *= e,
  39788. t[1] *= e,
  39789. t[5] *= e,
  39790. t[9] *= e,
  39791. t[13] *= e,
  39792. t[2] *= e,
  39793. t[6] *= e,
  39794. t[10] *= e,
  39795. t[14] *= e,
  39796. t[3] *= e,
  39797. t[7] *= e,
  39798. t[11] *= e,
  39799. t[15] *= e,
  39800. this
  39801. },
  39802. applyToVector3Array: function() {
  39803. var e;
  39804. return function(t, i, r) {
  39805. void 0 === e && (e = new n.Vector3),
  39806. void 0 === i && (i = 0),
  39807. void 0 === r && (r = t.length);
  39808. for (var o = 0, a = i; o < r; o += 3,
  39809. a += 3)
  39810. e.fromArray(t, a),
  39811. e.applyMatrix4(this),
  39812. e.toArray(t, a);
  39813. return t
  39814. }
  39815. }(),
  39816. applyToBuffer: function() {
  39817. var e;
  39818. return function(t, i, r) {
  39819. void 0 === e && (e = new n.Vector3),
  39820. void 0 === i && (i = 0),
  39821. void 0 === r && (r = t.length / t.itemSize);
  39822. for (var o = 0, a = i; o < r; o++,
  39823. a++)
  39824. e.x = t.getX(a),
  39825. e.y = t.getY(a),
  39826. e.z = t.getZ(a),
  39827. e.applyMatrix4(this),
  39828. t.setXYZ(e.x, e.y, e.z);
  39829. return t
  39830. }
  39831. }(),
  39832. determinant: function() {
  39833. var e = this.elements
  39834. , t = e[0]
  39835. , i = e[4]
  39836. , n = e[8]
  39837. , r = e[12]
  39838. , o = e[1]
  39839. , a = e[5]
  39840. , s = e[9]
  39841. , l = e[13]
  39842. , c = e[2]
  39843. , h = e[6]
  39844. , u = e[10]
  39845. , d = e[14]
  39846. , p = e[3]
  39847. , f = e[7]
  39848. , g = e[11]
  39849. , m = e[15];
  39850. return p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  39851. },
  39852. transpose: function() {
  39853. var e, t = this.elements;
  39854. return e = t[1],
  39855. t[1] = t[4],
  39856. t[4] = e,
  39857. e = t[2],
  39858. t[2] = t[8],
  39859. t[8] = e,
  39860. e = t[6],
  39861. t[6] = t[9],
  39862. t[9] = e,
  39863. e = t[3],
  39864. t[3] = t[12],
  39865. t[12] = e,
  39866. e = t[7],
  39867. t[7] = t[13],
  39868. t[13] = e,
  39869. e = t[11],
  39870. t[11] = t[14],
  39871. t[14] = e,
  39872. this
  39873. },
  39874. flattenToArrayOffset: function(e, t) {
  39875. var i = this.elements;
  39876. return e[t] = i[0],
  39877. e[t + 1] = i[1],
  39878. e[t + 2] = i[2],
  39879. e[t + 3] = i[3],
  39880. e[t + 4] = i[4],
  39881. e[t + 5] = i[5],
  39882. e[t + 6] = i[6],
  39883. e[t + 7] = i[7],
  39884. e[t + 8] = i[8],
  39885. e[t + 9] = i[9],
  39886. e[t + 10] = i[10],
  39887. e[t + 11] = i[11],
  39888. e[t + 12] = i[12],
  39889. e[t + 13] = i[13],
  39890. e[t + 14] = i[14],
  39891. e[t + 15] = i[15],
  39892. e
  39893. },
  39894. getPosition: function() {
  39895. var e;
  39896. return function() {
  39897. return void 0 === e && (e = new n.Vector3),
  39898. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39899. e.setFromMatrixColumn(this, 3)
  39900. }
  39901. }(),
  39902. setPosition: function(e) {
  39903. var t = this.elements;
  39904. return t[12] = e.x,
  39905. t[13] = e.y,
  39906. t[14] = e.z,
  39907. this
  39908. },
  39909. getInverse: function(e, t) {
  39910. var i = this.elements
  39911. , n = e.elements
  39912. , r = n[0]
  39913. , o = n[1]
  39914. , a = n[2]
  39915. , s = n[3]
  39916. , l = n[4]
  39917. , c = n[5]
  39918. , h = n[6]
  39919. , u = n[7]
  39920. , d = n[8]
  39921. , p = n[9]
  39922. , f = n[10]
  39923. , g = n[11]
  39924. , m = n[12]
  39925. , v = n[13]
  39926. , A = n[14]
  39927. , y = n[15]
  39928. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  39929. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  39930. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  39931. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  39932. , w = r * C + o * I + a * E + s * b;
  39933. if (0 === w) {
  39934. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39935. if (t)
  39936. throw new Error(_);
  39937. return console.warn(_),
  39938. this.identity()
  39939. }
  39940. return i[0] = C,
  39941. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  39942. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  39943. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39944. i[4] = I,
  39945. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  39946. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  39947. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39948. i[8] = E,
  39949. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  39950. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  39951. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39952. i[12] = b,
  39953. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  39954. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  39955. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39956. this.multiplyScalar(1 / w)
  39957. },
  39958. scale: function(e) {
  39959. var t = this.elements
  39960. , i = e.x
  39961. , n = e.y
  39962. , r = e.z;
  39963. return t[0] *= i,
  39964. t[4] *= n,
  39965. t[8] *= r,
  39966. t[1] *= i,
  39967. t[5] *= n,
  39968. t[9] *= r,
  39969. t[2] *= i,
  39970. t[6] *= n,
  39971. t[10] *= r,
  39972. t[3] *= i,
  39973. t[7] *= n,
  39974. t[11] *= r,
  39975. this
  39976. },
  39977. getMaxScaleOnAxis: function() {
  39978. var e = this.elements
  39979. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39980. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39981. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39982. return Math.sqrt(Math.max(t, i, n))
  39983. },
  39984. makeTranslation: function(e, t, i) {
  39985. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39986. this
  39987. },
  39988. makeRotationX: function(e) {
  39989. var t = Math.cos(e)
  39990. , i = Math.sin(e);
  39991. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39992. this
  39993. },
  39994. makeRotationY: function(e) {
  39995. var t = Math.cos(e)
  39996. , i = Math.sin(e);
  39997. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39998. this
  39999. },
  40000. makeRotationZ: function(e) {
  40001. var t = Math.cos(e)
  40002. , i = Math.sin(e);
  40003. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40004. this
  40005. },
  40006. makeRotationAxis: function(e, t) {
  40007. var i = Math.cos(t)
  40008. , n = Math.sin(t)
  40009. , r = 1 - i
  40010. , o = e.x
  40011. , a = e.y
  40012. , s = e.z
  40013. , l = r * o
  40014. , c = r * a;
  40015. 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),
  40016. this
  40017. },
  40018. makeScale: function(e, t, i) {
  40019. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40020. this
  40021. },
  40022. compose: function(e, t, i) {
  40023. return this.makeRotationFromQuaternion(t),
  40024. this.scale(i),
  40025. this.setPosition(e),
  40026. this
  40027. },
  40028. decompose: function() {
  40029. var e, t;
  40030. return function(i, r, o) {
  40031. void 0 === e && (e = new n.Vector3),
  40032. void 0 === t && (t = new n.Matrix4);
  40033. var a = this.elements
  40034. , s = e.set(a[0], a[1], a[2]).length()
  40035. , l = e.set(a[4], a[5], a[6]).length()
  40036. , c = e.set(a[8], a[9], a[10]).length()
  40037. , h = this.determinant();
  40038. h < 0 && (s = -s),
  40039. i.x = a[12],
  40040. i.y = a[13],
  40041. i.z = a[14],
  40042. t.elements.set(this.elements);
  40043. var u = 1 / s
  40044. , d = 1 / l
  40045. , p = 1 / c;
  40046. return t.elements[0] *= u,
  40047. t.elements[1] *= u,
  40048. t.elements[2] *= u,
  40049. t.elements[4] *= d,
  40050. t.elements[5] *= d,
  40051. t.elements[6] *= d,
  40052. t.elements[8] *= p,
  40053. t.elements[9] *= p,
  40054. t.elements[10] *= p,
  40055. r.setFromRotationMatrix(t),
  40056. o.x = s,
  40057. o.y = l,
  40058. o.z = c,
  40059. this
  40060. }
  40061. }(),
  40062. makeFrustum: function(e, t, i, n, r, o) {
  40063. var a = this.elements
  40064. , s = 2 * r / (t - e)
  40065. , l = 2 * r / (n - i)
  40066. , c = (t + e) / (t - e)
  40067. , h = (n + i) / (n - i)
  40068. , u = -(o + r) / (o - r)
  40069. , d = -2 * o * r / (o - r);
  40070. return a[0] = s,
  40071. a[4] = 0,
  40072. a[8] = c,
  40073. a[12] = 0,
  40074. a[1] = 0,
  40075. a[5] = l,
  40076. a[9] = h,
  40077. a[13] = 0,
  40078. a[2] = 0,
  40079. a[6] = 0,
  40080. a[10] = u,
  40081. a[14] = d,
  40082. a[3] = 0,
  40083. a[7] = 0,
  40084. a[11] = -1,
  40085. a[15] = 0,
  40086. this
  40087. },
  40088. makePerspective: function(e, t, i, r) {
  40089. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  40090. , a = -o
  40091. , s = a * t
  40092. , l = o * t;
  40093. return this.makeFrustum(s, l, a, o, i, r)
  40094. },
  40095. makeOrthographic: function(e, t, i, n, r, o) {
  40096. var a = this.elements
  40097. , s = 1 / (t - e)
  40098. , l = 1 / (i - n)
  40099. , c = 1 / (o - r)
  40100. , h = (t + e) * s
  40101. , u = (i + n) * l
  40102. , d = (o + r) * c;
  40103. return a[0] = 2 * s,
  40104. a[4] = 0,
  40105. a[8] = 0,
  40106. a[12] = -h,
  40107. a[1] = 0,
  40108. a[5] = 2 * l,
  40109. a[9] = 0,
  40110. a[13] = -u,
  40111. a[2] = 0,
  40112. a[6] = 0,
  40113. a[10] = -2 * c,
  40114. a[14] = -d,
  40115. a[3] = 0,
  40116. a[7] = 0,
  40117. a[11] = 0,
  40118. a[15] = 1,
  40119. this
  40120. },
  40121. equals: function(e) {
  40122. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40123. if (t[n] !== i[n])
  40124. return !1;
  40125. return !0
  40126. },
  40127. fromArray: function(e) {
  40128. return this.elements.set(e),
  40129. this
  40130. },
  40131. toArray: function() {
  40132. var e = this.elements;
  40133. 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]]
  40134. }
  40135. },
  40136. n.Ray = function(e, t) {
  40137. this.origin = void 0 !== e ? e : new n.Vector3,
  40138. this.direction = void 0 !== t ? t : new n.Vector3
  40139. }
  40140. ,
  40141. n.Ray.prototype = {
  40142. constructor: n.Ray,
  40143. set: function(e, t) {
  40144. return this.origin.copy(e),
  40145. this.direction.copy(t),
  40146. this
  40147. },
  40148. clone: function() {
  40149. return (new this.constructor).copy(this)
  40150. },
  40151. copy: function(e) {
  40152. return this.origin.copy(e.origin),
  40153. this.direction.copy(e.direction),
  40154. this
  40155. },
  40156. at: function(e, t) {
  40157. var i = t || new n.Vector3;
  40158. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  40159. },
  40160. lookAt: function(e) {
  40161. this.direction.copy(e).sub(this.origin).normalize()
  40162. },
  40163. recast: function() {
  40164. var e = new n.Vector3;
  40165. return function(t) {
  40166. return this.origin.copy(this.at(t, e)),
  40167. this
  40168. }
  40169. }(),
  40170. closestPointToPoint: function(e, t) {
  40171. var i = t || new n.Vector3;
  40172. i.subVectors(e, this.origin);
  40173. var r = i.dot(this.direction);
  40174. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  40175. },
  40176. distanceToPoint: function(e) {
  40177. return Math.sqrt(this.distanceSqToPoint(e))
  40178. },
  40179. distanceSqToPoint: function() {
  40180. var e = new n.Vector3;
  40181. return function(t) {
  40182. var i = e.subVectors(t, this.origin).dot(this.direction);
  40183. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  40184. e.distanceToSquared(t))
  40185. }
  40186. }(),
  40187. distanceSqToSegment: function() {
  40188. var e = new n.Vector3
  40189. , t = new n.Vector3
  40190. , i = new n.Vector3;
  40191. return function(n, r, o, a) {
  40192. e.copy(n).add(r).multiplyScalar(.5),
  40193. t.copy(r).sub(n).normalize(),
  40194. i.copy(this.origin).sub(e);
  40195. var s, l, c, h, u = .5 * n.distanceTo(r), d = -this.direction.dot(t), p = i.dot(this.direction), f = -i.dot(t), g = i.lengthSq(), m = Math.abs(1 - d * d);
  40196. if (m > 0)
  40197. if (s = d * f - p,
  40198. l = d * p - f,
  40199. h = u * m,
  40200. s >= 0)
  40201. if (l >= -h)
  40202. if (l <= h) {
  40203. var v = 1 / m;
  40204. s *= v,
  40205. l *= v,
  40206. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  40207. } else
  40208. l = u,
  40209. s = Math.max(0, -(d * l + p)),
  40210. c = -s * s + l * (l + 2 * f) + g;
  40211. else
  40212. l = -u,
  40213. s = Math.max(0, -(d * l + p)),
  40214. c = -s * s + l * (l + 2 * f) + g;
  40215. else
  40216. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  40217. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  40218. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  40219. l = Math.min(Math.max(-u, -f), u),
  40220. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  40221. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  40222. c = -s * s + l * (l + 2 * f) + g);
  40223. else
  40224. l = d > 0 ? -u : u,
  40225. s = Math.max(0, -(d * l + p)),
  40226. c = -s * s + l * (l + 2 * f) + g;
  40227. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  40228. a && a.copy(t).multiplyScalar(l).add(e),
  40229. c
  40230. }
  40231. }(),
  40232. intersectSphere: function() {
  40233. var e = new n.Vector3;
  40234. return function(t, i) {
  40235. e.subVectors(t.center, this.origin);
  40236. var n = e.dot(this.direction)
  40237. , r = e.dot(e) - n * n
  40238. , o = t.radius * t.radius;
  40239. if (r > o)
  40240. return null;
  40241. var a = Math.sqrt(o - r)
  40242. , s = n - a
  40243. , l = n + a;
  40244. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  40245. }
  40246. }(),
  40247. intersectsSphere: function(e) {
  40248. return this.distanceToPoint(e.center) <= e.radius
  40249. },
  40250. distanceToPlane: function(e) {
  40251. var t = e.normal.dot(this.direction);
  40252. if (0 === t)
  40253. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40254. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40255. return i >= 0 ? i : null
  40256. },
  40257. intersectPlane: function(e, t) {
  40258. var i = this.distanceToPlane(e);
  40259. return null === i ? null : this.at(i, t)
  40260. },
  40261. intersectsPlane: function(e) {
  40262. var t = e.distanceToPoint(this.origin);
  40263. if (0 === t)
  40264. return !0;
  40265. var i = e.normal.dot(this.direction);
  40266. return i * t < 0
  40267. },
  40268. intersectBox: function(e, t) {
  40269. 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;
  40270. return l >= 0 ? (i = (e.min.x - u.x) * l,
  40271. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40272. n = (e.min.x - u.x) * l),
  40273. c >= 0 ? (r = (e.min.y - u.y) * c,
  40274. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40275. o = (e.min.y - u.y) * c),
  40276. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  40277. (o < n || n !== n) && (n = o),
  40278. h >= 0 ? (a = (e.min.z - u.z) * h,
  40279. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40280. s = (e.min.z - u.z) * h),
  40281. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  40282. (s < n || n !== n) && (n = s),
  40283. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  40284. },
  40285. intersectsBox: function() {
  40286. var e = new n.Vector3;
  40287. return function(t) {
  40288. return null !== this.intersectBox(t, e)
  40289. }
  40290. }(),
  40291. intersectTriangle: function() {
  40292. var e = new n.Vector3
  40293. , t = new n.Vector3
  40294. , i = new n.Vector3
  40295. , r = new n.Vector3;
  40296. return function(n, o, a, s, l) {
  40297. t.subVectors(o, n),
  40298. i.subVectors(a, n),
  40299. r.crossVectors(t, i);
  40300. var c, h = this.direction.dot(r);
  40301. if (h > 0) {
  40302. if (s)
  40303. return null;
  40304. c = 1
  40305. } else {
  40306. if (!(h < 0))
  40307. return null;
  40308. c = -1,
  40309. h = -h
  40310. }
  40311. e.subVectors(this.origin, n);
  40312. var u = c * this.direction.dot(i.crossVectors(e, i));
  40313. if (u < 0)
  40314. return null;
  40315. var d = c * this.direction.dot(t.cross(e));
  40316. if (d < 0)
  40317. return null;
  40318. if (u + d > h)
  40319. return null;
  40320. var p = -c * e.dot(r);
  40321. return p < 0 ? null : this.at(p / h, l)
  40322. }
  40323. }(),
  40324. applyMatrix4: function(e) {
  40325. return this.direction.add(this.origin).applyMatrix4(e),
  40326. this.origin.applyMatrix4(e),
  40327. this.direction.sub(this.origin),
  40328. this.direction.normalize(),
  40329. this
  40330. },
  40331. equals: function(e) {
  40332. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40333. }
  40334. },
  40335. n.Sphere = function(e, t) {
  40336. this.center = void 0 !== e ? e : new n.Vector3,
  40337. this.radius = void 0 !== t ? t : 0
  40338. }
  40339. ,
  40340. n.Sphere.prototype = {
  40341. constructor: n.Sphere,
  40342. set: function(e, t) {
  40343. return this.center.copy(e),
  40344. this.radius = t,
  40345. this
  40346. },
  40347. setFromPoints: function() {
  40348. var e = new n.Box3;
  40349. return function(t, i) {
  40350. var n = this.center;
  40351. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  40352. for (var r = 0, o = 0, a = t.length; o < a; o++)
  40353. r = Math.max(r, n.distanceToSquared(t[o]));
  40354. return this.radius = Math.sqrt(r),
  40355. this
  40356. }
  40357. }(),
  40358. clone: function() {
  40359. return (new this.constructor).copy(this)
  40360. },
  40361. copy: function(e) {
  40362. return this.center.copy(e.center),
  40363. this.radius = e.radius,
  40364. this
  40365. },
  40366. empty: function() {
  40367. return this.radius <= 0
  40368. },
  40369. containsPoint: function(e) {
  40370. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40371. },
  40372. distanceToPoint: function(e) {
  40373. return e.distanceTo(this.center) - this.radius
  40374. },
  40375. intersectsSphere: function(e) {
  40376. var t = this.radius + e.radius;
  40377. return e.center.distanceToSquared(this.center) <= t * t
  40378. },
  40379. intersectsBox: function(e) {
  40380. return e.intersectsSphere(this)
  40381. },
  40382. intersectsPlane: function(e) {
  40383. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40384. },
  40385. clampPoint: function(e, t) {
  40386. var i = this.center.distanceToSquared(e)
  40387. , r = t || new n.Vector3;
  40388. return r.copy(e),
  40389. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  40390. r.multiplyScalar(this.radius).add(this.center)),
  40391. r
  40392. },
  40393. getBoundingBox: function(e) {
  40394. var t = e || new n.Box3;
  40395. return t.set(this.center, this.center),
  40396. t.expandByScalar(this.radius),
  40397. t
  40398. },
  40399. applyMatrix4: function(e) {
  40400. return this.center.applyMatrix4(e),
  40401. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40402. this
  40403. },
  40404. translate: function(e) {
  40405. return this.center.add(e),
  40406. this
  40407. },
  40408. equals: function(e) {
  40409. return e.center.equals(this.center) && e.radius === this.radius
  40410. }
  40411. },
  40412. n.Frustum = function(e, t, i, r, o, a) {
  40413. this.planes = [void 0 !== e ? e : new n.Plane, void 0 !== t ? t : new n.Plane, void 0 !== i ? i : new n.Plane, void 0 !== r ? r : new n.Plane, void 0 !== o ? o : new n.Plane, void 0 !== a ? a : new n.Plane]
  40414. }
  40415. ,
  40416. n.Frustum.prototype = {
  40417. constructor: n.Frustum,
  40418. set: function(e, t, i, n, r, o) {
  40419. var a = this.planes;
  40420. return a[0].copy(e),
  40421. a[1].copy(t),
  40422. a[2].copy(i),
  40423. a[3].copy(n),
  40424. a[4].copy(r),
  40425. a[5].copy(o),
  40426. this
  40427. },
  40428. clone: function() {
  40429. return (new this.constructor).copy(this)
  40430. },
  40431. copy: function(e) {
  40432. for (var t = this.planes, i = 0; i < 6; i++)
  40433. t[i].copy(e.planes[i]);
  40434. return this
  40435. },
  40436. setFromMatrix: function(e) {
  40437. var t = this.planes
  40438. , i = e.elements
  40439. , n = i[0]
  40440. , r = i[1]
  40441. , o = i[2]
  40442. , a = i[3]
  40443. , s = i[4]
  40444. , l = i[5]
  40445. , c = i[6]
  40446. , h = i[7]
  40447. , u = i[8]
  40448. , d = i[9]
  40449. , p = i[10]
  40450. , f = i[11]
  40451. , g = i[12]
  40452. , m = i[13]
  40453. , v = i[14]
  40454. , A = i[15];
  40455. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  40456. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  40457. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  40458. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  40459. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  40460. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  40461. this
  40462. },
  40463. intersectsObject: function() {
  40464. var e = new n.Sphere;
  40465. return function(t) {
  40466. var i = t.geometry;
  40467. return null === i.boundingSphere && i.computeBoundingSphere(),
  40468. e.copy(i.boundingSphere),
  40469. e.applyMatrix4(t.matrixWorld),
  40470. this.intersectsSphere(e)
  40471. }
  40472. }(),
  40473. intersectsSphere: function(e) {
  40474. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40475. var o = t[r].distanceToPoint(i);
  40476. if (o < n)
  40477. return !1
  40478. }
  40479. return !0
  40480. },
  40481. intersectsBox: function() {
  40482. var e = new n.Vector3
  40483. , t = new n.Vector3;
  40484. return function(i) {
  40485. for (var n = this.planes, r = 0; r < 6; r++) {
  40486. var o = n[r];
  40487. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  40488. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  40489. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  40490. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  40491. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  40492. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  40493. var a = o.distanceToPoint(e)
  40494. , s = o.distanceToPoint(t);
  40495. if (a < 0 && s < 0)
  40496. return !1
  40497. }
  40498. return !0
  40499. }
  40500. }(),
  40501. containsPoint: function(e) {
  40502. for (var t = this.planes, i = 0; i < 6; i++)
  40503. if (t[i].distanceToPoint(e) < 0)
  40504. return !1;
  40505. return !0
  40506. }
  40507. },
  40508. n.Plane = function(e, t) {
  40509. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  40510. this.constant = void 0 !== t ? t : 0
  40511. }
  40512. ,
  40513. n.Plane.prototype = {
  40514. constructor: n.Plane,
  40515. set: function(e, t) {
  40516. return this.normal.copy(e),
  40517. this.constant = t,
  40518. this
  40519. },
  40520. setComponents: function(e, t, i, n) {
  40521. return this.normal.set(e, t, i),
  40522. this.constant = n,
  40523. this
  40524. },
  40525. setFromNormalAndCoplanarPoint: function(e, t) {
  40526. return this.normal.copy(e),
  40527. this.constant = -t.dot(this.normal),
  40528. this
  40529. },
  40530. setFromCoplanarPoints: function() {
  40531. var e = new n.Vector3
  40532. , t = new n.Vector3;
  40533. return function(i, n, r) {
  40534. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  40535. return this.setFromNormalAndCoplanarPoint(o, i),
  40536. this
  40537. }
  40538. }(),
  40539. clone: function() {
  40540. return (new this.constructor).copy(this)
  40541. },
  40542. copy: function(e) {
  40543. return this.normal.copy(e.normal),
  40544. this.constant = e.constant,
  40545. this
  40546. },
  40547. normalize: function() {
  40548. var e = 1 / this.normal.length();
  40549. return this.normal.multiplyScalar(e),
  40550. this.constant *= e,
  40551. this
  40552. },
  40553. negate: function() {
  40554. return this.constant *= -1,
  40555. this.normal.negate(),
  40556. this
  40557. },
  40558. distanceToPoint: function(e) {
  40559. return this.normal.dot(e) + this.constant
  40560. },
  40561. distanceToSphere: function(e) {
  40562. return this.distanceToPoint(e.center) - e.radius
  40563. },
  40564. projectPoint: function(e, t) {
  40565. return this.orthoPoint(e, t).sub(e).negate()
  40566. },
  40567. orthoPoint: function(e, t) {
  40568. var i = this.distanceToPoint(e)
  40569. , r = t || new n.Vector3;
  40570. return r.copy(this.normal).multiplyScalar(i)
  40571. },
  40572. intersectLine: function() {
  40573. var e = new n.Vector3;
  40574. return function(t, i) {
  40575. var r = i || new n.Vector3
  40576. , o = t.delta(e)
  40577. , a = this.normal.dot(o);
  40578. if (0 !== a) {
  40579. var s = -(t.start.dot(this.normal) + this.constant) / a;
  40580. if (!(s < 0 || s > 1))
  40581. return r.copy(o).multiplyScalar(s).add(t.start)
  40582. } else if (0 === this.distanceToPoint(t.start))
  40583. return r.copy(t.start)
  40584. }
  40585. }(),
  40586. intersectsLine: function(e) {
  40587. var t = this.distanceToPoint(e.start)
  40588. , i = this.distanceToPoint(e.end);
  40589. return t < 0 && i > 0 || i < 0 && t > 0
  40590. },
  40591. intersectsBox: function(e) {
  40592. return e.intersectsPlane(this)
  40593. },
  40594. intersectsSphere: function(e) {
  40595. return e.intersectsPlane(this)
  40596. },
  40597. coplanarPoint: function(e) {
  40598. var t = e || new n.Vector3;
  40599. return t.copy(this.normal).multiplyScalar(-this.constant)
  40600. },
  40601. applyMatrix4: function() {
  40602. var e = new n.Vector3
  40603. , t = new n.Vector3
  40604. , i = new n.Matrix3;
  40605. return function(n, r) {
  40606. var o = r || i.getNormalMatrix(n)
  40607. , a = e.copy(this.normal).applyMatrix3(o)
  40608. , s = this.coplanarPoint(t);
  40609. return s.applyMatrix4(n),
  40610. this.setFromNormalAndCoplanarPoint(a, s),
  40611. this
  40612. }
  40613. }(),
  40614. translate: function(e) {
  40615. return this.constant = this.constant - e.dot(this.normal),
  40616. this
  40617. },
  40618. equals: function(e) {
  40619. return e.normal.equals(this.normal) && e.constant === this.constant
  40620. }
  40621. },
  40622. n.Spherical = function(e, t, i) {
  40623. return this.radius = void 0 !== e ? e : 1,
  40624. this.phi = void 0 !== t ? t : 0,
  40625. this.theta = void 0 !== i ? i : 0,
  40626. this
  40627. }
  40628. ,
  40629. n.Spherical.prototype = {
  40630. constructor: n.Spherical,
  40631. set: function(e, t, i) {
  40632. this.radius = e,
  40633. this.phi = t,
  40634. this.theta = i
  40635. },
  40636. clone: function() {
  40637. return (new this.constructor).copy(this)
  40638. },
  40639. copy: function(e) {
  40640. return this.radius.copy(e.radius),
  40641. this.phi.copy(e.phi),
  40642. this.theta.copy(e.theta),
  40643. this
  40644. },
  40645. makeSafe: function() {
  40646. var e = 1e-6;
  40647. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  40648. },
  40649. setFromVector3: function(e) {
  40650. return this.radius = e.length(),
  40651. 0 === this.radius ? (this.theta = 0,
  40652. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40653. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  40654. this
  40655. }
  40656. },
  40657. n.Math = {
  40658. generateUUID: function() {
  40659. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  40660. return function() {
  40661. for (var r = 0; r < 36; r++)
  40662. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  40663. e = 15 & n,
  40664. n >>= 4,
  40665. i[r] = t[19 === r ? 3 & e | 8 : e]);
  40666. return i.join("")
  40667. }
  40668. }(),
  40669. clamp: function(e, t, i) {
  40670. return Math.max(t, Math.min(i, e))
  40671. },
  40672. euclideanModulo: function(e, t) {
  40673. return (e % t + t) % t
  40674. },
  40675. mapLinear: function(e, t, i, n, r) {
  40676. return n + (e - t) * (r - n) / (i - t)
  40677. },
  40678. smoothstep: function(e, t, i) {
  40679. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  40680. e * e * (3 - 2 * e))
  40681. },
  40682. smootherstep: function(e, t, i) {
  40683. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  40684. e * e * e * (e * (6 * e - 15) + 10))
  40685. },
  40686. random16: function() {
  40687. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40688. Math.random()
  40689. },
  40690. randInt: function(e, t) {
  40691. return e + Math.floor(Math.random() * (t - e + 1))
  40692. },
  40693. randFloat: function(e, t) {
  40694. return e + Math.random() * (t - e)
  40695. },
  40696. randFloatSpread: function(e) {
  40697. return e * (.5 - Math.random())
  40698. },
  40699. degToRad: function() {
  40700. var e = Math.PI / 180;
  40701. return function(t) {
  40702. return t * e
  40703. }
  40704. }(),
  40705. radToDeg: function() {
  40706. var e = 180 / Math.PI;
  40707. return function(t) {
  40708. return t * e
  40709. }
  40710. }(),
  40711. isPowerOfTwo: function(e) {
  40712. return 0 === (e & e - 1) && 0 !== e
  40713. },
  40714. nearestPowerOfTwo: function(e) {
  40715. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40716. },
  40717. nextPowerOfTwo: function(e) {
  40718. return e--,
  40719. e |= e >> 1,
  40720. e |= e >> 2,
  40721. e |= e >> 4,
  40722. e |= e >> 8,
  40723. e |= e >> 16,
  40724. e++,
  40725. e
  40726. }
  40727. },
  40728. n.Spline = function(e) {
  40729. function t(e, t, i, n, r, o, a) {
  40730. var s = .5 * (i - e)
  40731. , l = .5 * (n - t);
  40732. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40733. }
  40734. this.points = e;
  40735. var i, r, o, a, s, l, c, h, u, d = [], p = {
  40736. x: 0,
  40737. y: 0,
  40738. z: 0
  40739. };
  40740. this.initFromArray = function(e) {
  40741. this.points = [];
  40742. for (var t = 0; t < e.length; t++)
  40743. this.points[t] = {
  40744. x: e[t][0],
  40745. y: e[t][1],
  40746. z: e[t][2]
  40747. }
  40748. }
  40749. ,
  40750. this.getPoint = function(e) {
  40751. return i = (this.points.length - 1) * e,
  40752. r = Math.floor(i),
  40753. o = i - r,
  40754. d[0] = 0 === r ? r : r - 1,
  40755. d[1] = r,
  40756. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  40757. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  40758. l = this.points[d[0]],
  40759. c = this.points[d[1]],
  40760. h = this.points[d[2]],
  40761. u = this.points[d[3]],
  40762. a = o * o,
  40763. s = o * a,
  40764. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  40765. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  40766. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  40767. p
  40768. }
  40769. ,
  40770. this.getControlPointsArray = function() {
  40771. var e, t, i = this.points.length, n = [];
  40772. for (e = 0; e < i; e++)
  40773. t = this.points[e],
  40774. n[e] = [t.x, t.y, t.z];
  40775. return n
  40776. }
  40777. ,
  40778. this.getLength = function(e) {
  40779. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  40780. for (u[0] = 0,
  40781. e || (e = 100),
  40782. r = this.points.length * e,
  40783. c.copy(this.points[0]),
  40784. t = 1; t < r; t++)
  40785. i = t / r,
  40786. o = this.getPoint(i),
  40787. h.copy(o),
  40788. d += h.distanceTo(c),
  40789. c.copy(o),
  40790. a = (this.points.length - 1) * i,
  40791. s = Math.floor(a),
  40792. s !== l && (u[s] = d,
  40793. l = s);
  40794. return u[u.length] = d,
  40795. {
  40796. chunks: u,
  40797. total: d
  40798. }
  40799. }
  40800. ,
  40801. this.reparametrizeByArcLength = function(e) {
  40802. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  40803. for (h.push(u.copy(this.points[0]).clone()),
  40804. t = 1; t < this.points.length; t++) {
  40805. for (s = d.chunks[t] - d.chunks[t - 1],
  40806. l = Math.ceil(e * s / d.total),
  40807. o = (t - 1) / (this.points.length - 1),
  40808. a = t / (this.points.length - 1),
  40809. i = 1; i < l - 1; i++)
  40810. r = o + i * (1 / l) * (a - o),
  40811. c = this.getPoint(r),
  40812. h.push(u.copy(c).clone());
  40813. h.push(u.copy(this.points[t]).clone())
  40814. }
  40815. this.points = h
  40816. }
  40817. }
  40818. ,
  40819. n.Triangle = function(e, t, i) {
  40820. this.a = void 0 !== e ? e : new n.Vector3,
  40821. this.b = void 0 !== t ? t : new n.Vector3,
  40822. this.c = void 0 !== i ? i : new n.Vector3
  40823. }
  40824. ,
  40825. n.Triangle.normal = function() {
  40826. var e = new n.Vector3;
  40827. return function(t, i, r, o) {
  40828. var a = o || new n.Vector3;
  40829. a.subVectors(r, i),
  40830. e.subVectors(t, i),
  40831. a.cross(e);
  40832. var s = a.lengthSq();
  40833. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  40834. }
  40835. }(),
  40836. n.Triangle.barycoordFromPoint = function() {
  40837. var e = new n.Vector3
  40838. , t = new n.Vector3
  40839. , i = new n.Vector3;
  40840. return function(r, o, a, s, l) {
  40841. e.subVectors(s, o),
  40842. t.subVectors(a, o),
  40843. i.subVectors(r, o);
  40844. var c = e.dot(e)
  40845. , h = e.dot(t)
  40846. , u = e.dot(i)
  40847. , d = t.dot(t)
  40848. , p = t.dot(i)
  40849. , f = c * d - h * h
  40850. , g = l || new n.Vector3;
  40851. if (0 === f)
  40852. return g.set(-2, -1, -1);
  40853. var m = 1 / f
  40854. , v = (d * u - h * p) * m
  40855. , A = (c * p - h * u) * m;
  40856. return g.set(1 - v - A, A, v)
  40857. }
  40858. }(),
  40859. n.Triangle.containsPoint = function() {
  40860. var e = new n.Vector3;
  40861. return function(t, i, r, o) {
  40862. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  40863. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  40864. }
  40865. }(),
  40866. n.Triangle.prototype = {
  40867. constructor: n.Triangle,
  40868. set: function(e, t, i) {
  40869. return this.a.copy(e),
  40870. this.b.copy(t),
  40871. this.c.copy(i),
  40872. this
  40873. },
  40874. setFromPointsAndIndices: function(e, t, i, n) {
  40875. return this.a.copy(e[t]),
  40876. this.b.copy(e[i]),
  40877. this.c.copy(e[n]),
  40878. this
  40879. },
  40880. clone: function() {
  40881. return (new this.constructor).copy(this)
  40882. },
  40883. copy: function(e) {
  40884. return this.a.copy(e.a),
  40885. this.b.copy(e.b),
  40886. this.c.copy(e.c),
  40887. this
  40888. },
  40889. area: function() {
  40890. var e = new n.Vector3
  40891. , t = new n.Vector3;
  40892. return function() {
  40893. return e.subVectors(this.c, this.b),
  40894. t.subVectors(this.a, this.b),
  40895. .5 * e.cross(t).length()
  40896. }
  40897. }(),
  40898. midpoint: function(e) {
  40899. var t = e || new n.Vector3;
  40900. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40901. },
  40902. normal: function(e) {
  40903. return n.Triangle.normal(this.a, this.b, this.c, e)
  40904. },
  40905. plane: function(e) {
  40906. var t = e || new n.Plane;
  40907. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  40908. },
  40909. barycoordFromPoint: function(e, t) {
  40910. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40911. },
  40912. containsPoint: function(e) {
  40913. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  40914. },
  40915. equals: function(e) {
  40916. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40917. }
  40918. },
  40919. n.Interpolant = function(e, t, i, n) {
  40920. this.parameterPositions = e,
  40921. this._cachedIndex = 0,
  40922. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40923. this.sampleValues = t,
  40924. this.valueSize = i
  40925. }
  40926. ,
  40927. n.Interpolant.prototype = {
  40928. constructor: n.Interpolant,
  40929. evaluate: function(e) {
  40930. var t = this.parameterPositions
  40931. , i = this._cachedIndex
  40932. , n = t[i]
  40933. , r = t[i - 1];
  40934. e: {
  40935. t: {
  40936. var o;
  40937. i: {
  40938. n: if (!(e < n)) {
  40939. for (var a = i + 2; ; ) {
  40940. if (void 0 === n) {
  40941. if (e < r)
  40942. break n;
  40943. return i = t.length,
  40944. this._cachedIndex = i,
  40945. this.afterEnd_(i - 1, e, r)
  40946. }
  40947. if (i === a)
  40948. break;
  40949. if (r = n,
  40950. n = t[++i],
  40951. e < n)
  40952. break t
  40953. }
  40954. o = t.length;
  40955. break i
  40956. }
  40957. {
  40958. if (e >= r)
  40959. break e;
  40960. var s = t[1];
  40961. e < s && (i = 2,
  40962. r = s);
  40963. for (var a = i - 2; ; ) {
  40964. if (void 0 === r)
  40965. return this._cachedIndex = 0,
  40966. this.beforeStart_(0, e, n);
  40967. if (i === a)
  40968. break;
  40969. if (n = r,
  40970. r = t[--i - 1],
  40971. e >= r)
  40972. break t
  40973. }
  40974. o = i,
  40975. i = 0
  40976. }
  40977. }
  40978. for (; i < o; ) {
  40979. var l = i + o >>> 1;
  40980. e < t[l] ? o = l : i = l + 1
  40981. }
  40982. if (n = t[i],
  40983. r = t[i - 1],
  40984. void 0 === r)
  40985. return this._cachedIndex = 0,
  40986. this.beforeStart_(0, e, n);
  40987. if (void 0 === n)
  40988. return i = t.length,
  40989. this._cachedIndex = i,
  40990. this.afterEnd_(i - 1, r, e)
  40991. }
  40992. this._cachedIndex = i,
  40993. this.intervalChanged_(i, r, n)
  40994. }
  40995. return this.interpolate_(i, r, e, n)
  40996. },
  40997. settings: null,
  40998. DefaultSettings_: {},
  40999. getSettings_: function() {
  41000. return this.settings || this.DefaultSettings_
  41001. },
  41002. copySampleValue_: function(e) {
  41003. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41004. t[o] = i[r + o];
  41005. return t
  41006. },
  41007. interpolate_: function(e, t, i, n) {
  41008. throw new Error("call to abstract method")
  41009. },
  41010. intervalChanged_: function(e, t, i) {}
  41011. },
  41012. Object.assign(n.Interpolant.prototype, {
  41013. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  41014. afterEnd_: n.Interpolant.prototype.copySampleValue_
  41015. }),
  41016. n.CubicInterpolant = function(e, t, i, r) {
  41017. n.Interpolant.call(this, e, t, i, r),
  41018. this._weightPrev = -0,
  41019. this._offsetPrev = -0,
  41020. this._weightNext = -0,
  41021. this._offsetNext = -0
  41022. }
  41023. ,
  41024. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41025. constructor: n.CubicInterpolant,
  41026. DefaultSettings_: {
  41027. endingStart: n.ZeroCurvatureEnding,
  41028. endingEnd: n.ZeroCurvatureEnding
  41029. },
  41030. intervalChanged_: function(e, t, i) {
  41031. var r = this.parameterPositions
  41032. , o = e - 2
  41033. , a = e + 1
  41034. , s = r[o]
  41035. , l = r[a];
  41036. if (void 0 === s)
  41037. switch (this.getSettings_().endingStart) {
  41038. case n.ZeroSlopeEnding:
  41039. o = e,
  41040. s = 2 * t - i;
  41041. break;
  41042. case n.WrapAroundEnding:
  41043. o = r.length - 2,
  41044. s = t + r[o] - r[o + 1];
  41045. break;
  41046. default:
  41047. o = e,
  41048. s = i
  41049. }
  41050. if (void 0 === l)
  41051. switch (this.getSettings_().endingEnd) {
  41052. case n.ZeroSlopeEnding:
  41053. a = e,
  41054. l = 2 * i - t;
  41055. break;
  41056. case n.WrapAroundEnding:
  41057. a = 1,
  41058. l = i + r[1] - r[0];
  41059. break;
  41060. default:
  41061. a = e - 1,
  41062. l = t
  41063. }
  41064. var c = .5 * (i - t)
  41065. , h = this.valueSize;
  41066. this._weightPrev = c / (t - s),
  41067. this._weightNext = c / (l - i),
  41068. this._offsetPrev = o * h,
  41069. this._offsetNext = a * h
  41070. },
  41071. interpolate_: function(e, t, i, n) {
  41072. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, A = (-1 - d) * g + (1.5 + d) * f + .5 * p, y = d * g - d * f, C = 0; C !== a; ++C)
  41073. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  41074. return r
  41075. }
  41076. }),
  41077. n.DiscreteInterpolant = function(e, t, i, r) {
  41078. n.Interpolant.call(this, e, t, i, r)
  41079. }
  41080. ,
  41081. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41082. constructor: n.DiscreteInterpolant,
  41083. interpolate_: function(e, t, i, n) {
  41084. return this.copySampleValue_(e - 1)
  41085. }
  41086. }),
  41087. n.LinearInterpolant = function(e, t, i, r) {
  41088. n.Interpolant.call(this, e, t, i, r)
  41089. }
  41090. ,
  41091. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41092. constructor: n.LinearInterpolant,
  41093. interpolate_: function(e, t, i, n) {
  41094. 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)
  41095. r[u] = o[l + u] * h + o[s + u] * c;
  41096. return r
  41097. }
  41098. }),
  41099. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  41100. n.Interpolant.call(this, e, t, i, r)
  41101. }
  41102. ,
  41103. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41104. constructor: n.QuaternionLinearInterpolant,
  41105. interpolate_: function(e, t, i, r) {
  41106. for (var o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, l = e * s, c = (i - t) / (r - t), h = l + s; l !== h; l += 4)
  41107. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  41108. return o
  41109. }
  41110. }),
  41111. n.Clock = function(e) {
  41112. this.autoStart = void 0 === e || e,
  41113. this.startTime = 0,
  41114. this.oldTime = 0,
  41115. this.elapsedTime = 0,
  41116. this.running = !1
  41117. }
  41118. ,
  41119. n.Clock.prototype = {
  41120. constructor: n.Clock,
  41121. start: function() {
  41122. this.startTime = performance.now(),
  41123. this.oldTime = this.startTime,
  41124. this.running = !0
  41125. },
  41126. stop: function() {
  41127. this.getElapsedTime(),
  41128. this.running = !1
  41129. },
  41130. getElapsedTime: function() {
  41131. return this.getDelta(),
  41132. this.elapsedTime
  41133. },
  41134. getDelta: function() {
  41135. var e = 0;
  41136. if (this.autoStart && !this.running && this.start(),
  41137. this.running) {
  41138. var t = performance.now();
  41139. e = .001 * (t - this.oldTime),
  41140. this.oldTime = t,
  41141. this.elapsedTime += e
  41142. }
  41143. return e
  41144. }
  41145. },
  41146. n.EventDispatcher = function() {}
  41147. ,
  41148. n.EventDispatcher.prototype = {
  41149. constructor: n.EventDispatcher,
  41150. apply: function(e) {
  41151. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  41152. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  41153. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  41154. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  41155. },
  41156. addEventListener: function(e, t) {
  41157. void 0 === this._listeners && (this._listeners = {});
  41158. var i = this._listeners;
  41159. void 0 === i[e] && (i[e] = []),
  41160. i[e].indexOf(t) === -1 && i[e].push(t)
  41161. },
  41162. hasEventListener: function(e, t) {
  41163. if (void 0 === this._listeners)
  41164. return !1;
  41165. var i = this._listeners;
  41166. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  41167. },
  41168. removeEventListener: function(e, t) {
  41169. if (void 0 !== this._listeners) {
  41170. var i = this._listeners
  41171. , n = i[e];
  41172. if (void 0 !== n) {
  41173. var r = n.indexOf(t);
  41174. r !== -1 && n.splice(r, 1)
  41175. }
  41176. }
  41177. },
  41178. dispatchEvent: function(e) {
  41179. if (void 0 !== this._listeners) {
  41180. var t = this._listeners
  41181. , i = t[e.type];
  41182. if (void 0 !== i) {
  41183. e.target = this;
  41184. for (var n = [], r = i.length, o = 0; o < r; o++)
  41185. n[o] = i[o];
  41186. for (var o = 0; o < r; o++)
  41187. n[o].call(this, e)
  41188. }
  41189. }
  41190. }
  41191. },
  41192. n.Layers = function() {
  41193. this.mask = 1
  41194. }
  41195. ,
  41196. n.Layers.prototype = {
  41197. constructor: n.Layers,
  41198. set: function(e) {
  41199. this.mask = 1 << e
  41200. },
  41201. enable: function(e) {
  41202. this.mask |= 1 << e
  41203. },
  41204. toggle: function(e) {
  41205. this.mask ^= 1 << e
  41206. },
  41207. disable: function(e) {
  41208. this.mask &= ~(1 << e)
  41209. },
  41210. test: function(e) {
  41211. return 0 !== (this.mask & e.mask)
  41212. }
  41213. },
  41214. function(e) {
  41215. function t(e, t) {
  41216. return e.distance - t.distance
  41217. }
  41218. function i(e, t, n, r) {
  41219. if (e.visible !== !1 && (e.raycast(t, n),
  41220. r === !0))
  41221. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  41222. i(o[a], t, n, !0)
  41223. }
  41224. e.Raycaster = function(t, i, n, r) {
  41225. this.ray = new e.Ray(t,i),
  41226. this.near = n || 0,
  41227. this.far = r || 1 / 0,
  41228. this.params = {
  41229. Mesh: {},
  41230. Line: {},
  41231. LOD: {},
  41232. Points: {
  41233. threshold: 1
  41234. },
  41235. Sprite: {}
  41236. },
  41237. Object.defineProperties(this.params, {
  41238. PointCloud: {
  41239. get: function() {
  41240. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41241. this.Points
  41242. }
  41243. }
  41244. })
  41245. }
  41246. ,
  41247. e.Raycaster.prototype = {
  41248. constructor: e.Raycaster,
  41249. linePrecision: 1,
  41250. set: function(e, t) {
  41251. this.ray.set(e, t)
  41252. },
  41253. setFromCamera: function(t, i) {
  41254. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  41255. this.ray.direction.set(t.x, t.y, .5).unproject(i).sub(this.ray.origin).normalize()) : i instanceof e.OrthographicCamera ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  41256. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41257. },
  41258. intersectObject: function(e, n) {
  41259. var r = [];
  41260. return i(e, this, r, n),
  41261. r.sort(t),
  41262. r
  41263. },
  41264. intersectObjects: function(e, n) {
  41265. var r = [];
  41266. if (Array.isArray(e) === !1)
  41267. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41268. r;
  41269. for (var o = 0, a = e.length; o < a; o++)
  41270. i(e[o], this, r, n);
  41271. return r.sort(t),
  41272. r
  41273. }
  41274. }
  41275. }(n),
  41276. n.Object3D = function() {
  41277. function e() {
  41278. o.setFromEuler(r, !1)
  41279. }
  41280. function t() {
  41281. r.setFromQuaternion(o, void 0, !1)
  41282. }
  41283. Object.defineProperty(this, "id", {
  41284. value: n.Object3DIdCount++
  41285. }),
  41286. this.uuid = n.Math.generateUUID(),
  41287. this.name = "",
  41288. this.type = "Object3D",
  41289. this.parent = null,
  41290. this.children = [],
  41291. this.up = n.Object3D.DefaultUp.clone();
  41292. var i = new n.Vector3
  41293. , r = new n.Euler
  41294. , o = new n.Quaternion
  41295. , a = new n.Vector3(1,1,1);
  41296. r.onChange(e),
  41297. o.onChange(t),
  41298. Object.defineProperties(this, {
  41299. position: {
  41300. enumerable: !0,
  41301. value: i
  41302. },
  41303. rotation: {
  41304. enumerable: !0,
  41305. value: r
  41306. },
  41307. quaternion: {
  41308. enumerable: !0,
  41309. value: o
  41310. },
  41311. scale: {
  41312. enumerable: !0,
  41313. value: a
  41314. },
  41315. modelViewMatrix: {
  41316. value: new n.Matrix4
  41317. },
  41318. normalMatrix: {
  41319. value: new n.Matrix3
  41320. }
  41321. }),
  41322. this.rotationAutoUpdate = !0,
  41323. this.matrix = new n.Matrix4,
  41324. this.matrixWorld = new n.Matrix4,
  41325. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  41326. this.matrixWorldNeedsUpdate = !1,
  41327. this.layers = new n.Layers,
  41328. this.visible = !0,
  41329. this.castShadow = !1,
  41330. this.receiveShadow = !1,
  41331. this.frustumCulled = !0,
  41332. this.renderOrder = 0,
  41333. this.userData = {}
  41334. }
  41335. ,
  41336. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  41337. n.Object3D.DefaultMatrixAutoUpdate = !0,
  41338. n.Object3D.prototype = {
  41339. constructor: n.Object3D,
  41340. applyMatrix: function(e) {
  41341. this.matrix.multiplyMatrices(e, this.matrix),
  41342. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41343. },
  41344. setRotationFromAxisAngle: function(e, t) {
  41345. this.quaternion.setFromAxisAngle(e, t)
  41346. },
  41347. setRotationFromEuler: function(e) {
  41348. this.quaternion.setFromEuler(e, !0)
  41349. },
  41350. setRotationFromMatrix: function(e) {
  41351. this.quaternion.setFromRotationMatrix(e)
  41352. },
  41353. setRotationFromQuaternion: function(e) {
  41354. this.quaternion.copy(e)
  41355. },
  41356. rotateOnAxis: function() {
  41357. var e = new n.Quaternion;
  41358. return function(t, i) {
  41359. return e.setFromAxisAngle(t, i),
  41360. this.quaternion.multiply(e),
  41361. this
  41362. }
  41363. }(),
  41364. rotateX: function() {
  41365. var e = new n.Vector3(1,0,0);
  41366. return function(t) {
  41367. return this.rotateOnAxis(e, t)
  41368. }
  41369. }(),
  41370. rotateY: function() {
  41371. var e = new n.Vector3(0,1,0);
  41372. return function(t) {
  41373. return this.rotateOnAxis(e, t)
  41374. }
  41375. }(),
  41376. rotateZ: function() {
  41377. var e = new n.Vector3(0,0,1);
  41378. return function(t) {
  41379. return this.rotateOnAxis(e, t)
  41380. }
  41381. }(),
  41382. translateOnAxis: function() {
  41383. var e = new n.Vector3;
  41384. return function(t, i) {
  41385. return e.copy(t).applyQuaternion(this.quaternion),
  41386. this.position.add(e.multiplyScalar(i)),
  41387. this
  41388. }
  41389. }(),
  41390. translateX: function() {
  41391. var e = new n.Vector3(1,0,0);
  41392. return function(t) {
  41393. return this.translateOnAxis(e, t)
  41394. }
  41395. }(),
  41396. translateY: function() {
  41397. var e = new n.Vector3(0,1,0);
  41398. return function(t) {
  41399. return this.translateOnAxis(e, t)
  41400. }
  41401. }(),
  41402. translateZ: function() {
  41403. var e = new n.Vector3(0,0,1);
  41404. return function(t) {
  41405. return this.translateOnAxis(e, t)
  41406. }
  41407. }(),
  41408. localToWorld: function(e) {
  41409. return e.applyMatrix4(this.matrixWorld)
  41410. },
  41411. worldToLocal: function() {
  41412. var e = new n.Matrix4;
  41413. return function(t) {
  41414. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  41415. }
  41416. }(),
  41417. lookAt: function() {
  41418. var e = new n.Matrix4;
  41419. return function(t) {
  41420. e.lookAt(t, this.position, this.up),
  41421. this.quaternion.setFromRotationMatrix(e)
  41422. }
  41423. }(),
  41424. add: function(e) {
  41425. if (arguments.length > 1) {
  41426. for (var t = 0; t < arguments.length; t++)
  41427. this.add(arguments[t]);
  41428. return this
  41429. }
  41430. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  41431. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  41432. e.parent = this,
  41433. e.dispatchEvent({
  41434. type: "added"
  41435. }),
  41436. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41437. this)
  41438. },
  41439. remove: function(e) {
  41440. if (arguments.length > 1)
  41441. for (var t = 0; t < arguments.length; t++)
  41442. this.remove(arguments[t]);
  41443. var i = this.children.indexOf(e);
  41444. i !== -1 && (e.parent = null,
  41445. e.dispatchEvent({
  41446. type: "removed"
  41447. }),
  41448. this.children.splice(i, 1))
  41449. },
  41450. getObjectById: function(e) {
  41451. return this.getObjectByProperty("id", e)
  41452. },
  41453. getObjectByName: function(e) {
  41454. return this.getObjectByProperty("name", e)
  41455. },
  41456. getObjectByProperty: function(e, t) {
  41457. if (this[e] === t)
  41458. return this;
  41459. for (var i = 0, n = this.children.length; i < n; i++) {
  41460. var r = this.children[i]
  41461. , o = r.getObjectByProperty(e, t);
  41462. if (void 0 !== o)
  41463. return o
  41464. }
  41465. },
  41466. getWorldPosition: function(e) {
  41467. var t = e || new n.Vector3;
  41468. return this.updateMatrixWorld(!0),
  41469. t.setFromMatrixPosition(this.matrixWorld)
  41470. },
  41471. getWorldQuaternion: function() {
  41472. var e = new n.Vector3
  41473. , t = new n.Vector3;
  41474. return function(i) {
  41475. var r = i || new n.Quaternion;
  41476. return this.updateMatrixWorld(!0),
  41477. this.matrixWorld.decompose(e, r, t),
  41478. r
  41479. }
  41480. }(),
  41481. getWorldRotation: function() {
  41482. var e = new n.Quaternion;
  41483. return function(t) {
  41484. var i = t || new n.Euler;
  41485. return this.getWorldQuaternion(e),
  41486. i.setFromQuaternion(e, this.rotation.order, !1)
  41487. }
  41488. }(),
  41489. getWorldScale: function() {
  41490. var e = new n.Vector3
  41491. , t = new n.Quaternion;
  41492. return function(i) {
  41493. var r = i || new n.Vector3;
  41494. return this.updateMatrixWorld(!0),
  41495. this.matrixWorld.decompose(e, t, r),
  41496. r
  41497. }
  41498. }(),
  41499. getWorldDirection: function() {
  41500. var e = new n.Quaternion;
  41501. return function(t) {
  41502. var i = t || new n.Vector3;
  41503. return this.getWorldQuaternion(e),
  41504. i.set(0, 0, 1).applyQuaternion(e)
  41505. }
  41506. }(),
  41507. raycast: function() {},
  41508. traverse: function(e) {
  41509. e(this);
  41510. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41511. t[i].traverse(e)
  41512. },
  41513. traverseVisible: function(e) {
  41514. if (this.visible !== !1) {
  41515. e(this);
  41516. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41517. t[i].traverseVisible(e)
  41518. }
  41519. },
  41520. traverseAncestors: function(e) {
  41521. var t = this.parent;
  41522. null !== t && (e(t),
  41523. t.traverseAncestors(e))
  41524. },
  41525. updateMatrix: function() {
  41526. this.matrix.compose(this.position, this.quaternion, this.scale),
  41527. this.matrixWorldNeedsUpdate = !0
  41528. },
  41529. updateMatrixWorld: function(e) {
  41530. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  41531. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41532. this.matrixWorldNeedsUpdate = !1,
  41533. e = !0);
  41534. for (var t = 0, i = this.children.length; t < i; t++)
  41535. this.children[t].updateMatrixWorld(e)
  41536. },
  41537. toJSON: function(e) {
  41538. function t(e) {
  41539. var t = [];
  41540. for (var i in e) {
  41541. var n = e[i];
  41542. delete n.metadata,
  41543. t.push(n)
  41544. }
  41545. return t
  41546. }
  41547. var i = void 0 === e
  41548. , n = {};
  41549. i && (e = {
  41550. geometries: {},
  41551. materials: {},
  41552. textures: {},
  41553. images: {}
  41554. },
  41555. n.metadata = {
  41556. version: 4.4,
  41557. type: "Object",
  41558. generator: "Object3D.toJSON"
  41559. });
  41560. var r = {};
  41561. if (r.uuid = this.uuid,
  41562. r.type = this.type,
  41563. "" !== this.name && (r.name = this.name),
  41564. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41565. this.castShadow === !0 && (r.castShadow = !0),
  41566. this.receiveShadow === !0 && (r.receiveShadow = !0),
  41567. this.visible === !1 && (r.visible = !1),
  41568. r.matrix = this.matrix.toArray(),
  41569. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41570. r.geometry = this.geometry.uuid),
  41571. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41572. r.material = this.material.uuid),
  41573. this.children.length > 0) {
  41574. r.children = [];
  41575. for (var o = 0; o < this.children.length; o++)
  41576. r.children.push(this.children[o].toJSON(e).object)
  41577. }
  41578. if (i) {
  41579. var a = t(e.geometries)
  41580. , s = t(e.materials)
  41581. , l = t(e.textures)
  41582. , c = t(e.images);
  41583. a.length > 0 && (n.geometries = a),
  41584. s.length > 0 && (n.materials = s),
  41585. l.length > 0 && (n.textures = l),
  41586. c.length > 0 && (n.images = c)
  41587. }
  41588. return n.object = r,
  41589. n
  41590. },
  41591. clone: function(e) {
  41592. return (new this.constructor).copy(this, e)
  41593. },
  41594. copy: function(e, t) {
  41595. if (void 0 === t && (t = !0),
  41596. this.name = e.name,
  41597. this.up.copy(e.up),
  41598. this.position.copy(e.position),
  41599. this.quaternion.copy(e.quaternion),
  41600. this.scale.copy(e.scale),
  41601. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41602. this.matrix.copy(e.matrix),
  41603. this.matrixWorld.copy(e.matrixWorld),
  41604. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41605. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41606. this.visible = e.visible,
  41607. this.castShadow = e.castShadow,
  41608. this.receiveShadow = e.receiveShadow,
  41609. this.frustumCulled = e.frustumCulled,
  41610. this.renderOrder = e.renderOrder,
  41611. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41612. t === !0)
  41613. for (var i = 0; i < e.children.length; i++) {
  41614. var n = e.children[i];
  41615. this.add(n.clone())
  41616. }
  41617. return this
  41618. }
  41619. },
  41620. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  41621. n.Object3DIdCount = 0,
  41622. n.Face3 = function(e, t, i, r, o, a) {
  41623. this.a = e,
  41624. this.b = t,
  41625. this.c = i,
  41626. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  41627. this.vertexNormals = Array.isArray(r) ? r : [],
  41628. this.color = o instanceof n.Color ? o : new n.Color,
  41629. this.vertexColors = Array.isArray(o) ? o : [],
  41630. this.materialIndex = void 0 !== a ? a : 0
  41631. }
  41632. ,
  41633. n.Face3.prototype = {
  41634. constructor: n.Face3,
  41635. clone: function() {
  41636. return (new this.constructor).copy(this)
  41637. },
  41638. copy: function(e) {
  41639. this.a = e.a,
  41640. this.b = e.b,
  41641. this.c = e.c,
  41642. this.normal.copy(e.normal),
  41643. this.color.copy(e.color),
  41644. this.materialIndex = e.materialIndex;
  41645. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41646. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41647. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  41648. this.vertexColors[t] = e.vertexColors[t].clone();
  41649. return this
  41650. }
  41651. },
  41652. n.BufferAttribute = function(e, t) {
  41653. this.uuid = n.Math.generateUUID(),
  41654. this.array = e,
  41655. this.itemSize = t,
  41656. this.dynamic = !1,
  41657. this.updateRange = {
  41658. offset: 0,
  41659. count: -1
  41660. },
  41661. this.version = 0
  41662. }
  41663. ,
  41664. n.BufferAttribute.prototype = {
  41665. constructor: n.BufferAttribute,
  41666. get count() {
  41667. return this.array.length / this.itemSize
  41668. },
  41669. set needsUpdate(e) {
  41670. e === !0 && this.version++
  41671. },
  41672. setDynamic: function(e) {
  41673. return this.dynamic = e,
  41674. this
  41675. },
  41676. copy: function(e) {
  41677. return this.array = new e.array.constructor(e.array),
  41678. this.itemSize = e.itemSize,
  41679. this.dynamic = e.dynamic,
  41680. this
  41681. },
  41682. copyAt: function(e, t, i) {
  41683. e *= this.itemSize,
  41684. i *= t.itemSize;
  41685. for (var n = 0, r = this.itemSize; n < r; n++)
  41686. this.array[e + n] = t.array[i + n];
  41687. return this
  41688. },
  41689. copyArray: function(e) {
  41690. return this.array.set(e),
  41691. this
  41692. },
  41693. copyColorsArray: function(e) {
  41694. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41695. var a = e[r];
  41696. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  41697. a = new n.Color),
  41698. t[i++] = a.r,
  41699. t[i++] = a.g,
  41700. t[i++] = a.b
  41701. }
  41702. return this
  41703. },
  41704. copyIndicesArray: function(e) {
  41705. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41706. var o = e[n];
  41707. t[i++] = o.a,
  41708. t[i++] = o.b,
  41709. t[i++] = o.c
  41710. }
  41711. return this
  41712. },
  41713. copyVector2sArray: function(e) {
  41714. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41715. var a = e[r];
  41716. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  41717. a = new n.Vector2),
  41718. t[i++] = a.x,
  41719. t[i++] = a.y
  41720. }
  41721. return this
  41722. },
  41723. copyVector3sArray: function(e) {
  41724. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41725. var a = e[r];
  41726. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  41727. a = new n.Vector3),
  41728. t[i++] = a.x,
  41729. t[i++] = a.y,
  41730. t[i++] = a.z
  41731. }
  41732. return this
  41733. },
  41734. copyVector4sArray: function(e) {
  41735. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41736. var a = e[r];
  41737. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  41738. a = new n.Vector4),
  41739. t[i++] = a.x,
  41740. t[i++] = a.y,
  41741. t[i++] = a.z,
  41742. t[i++] = a.w
  41743. }
  41744. return this
  41745. },
  41746. set: function(e, t) {
  41747. return void 0 === t && (t = 0),
  41748. this.array.set(e, t),
  41749. this
  41750. },
  41751. getX: function(e) {
  41752. return this.array[e * this.itemSize]
  41753. },
  41754. setX: function(e, t) {
  41755. return this.array[e * this.itemSize] = t,
  41756. this
  41757. },
  41758. getY: function(e) {
  41759. return this.array[e * this.itemSize + 1]
  41760. },
  41761. setY: function(e, t) {
  41762. return this.array[e * this.itemSize + 1] = t,
  41763. this
  41764. },
  41765. getZ: function(e) {
  41766. return this.array[e * this.itemSize + 2]
  41767. },
  41768. setZ: function(e, t) {
  41769. return this.array[e * this.itemSize + 2] = t,
  41770. this
  41771. },
  41772. getW: function(e) {
  41773. return this.array[e * this.itemSize + 3]
  41774. },
  41775. setW: function(e, t) {
  41776. return this.array[e * this.itemSize + 3] = t,
  41777. this
  41778. },
  41779. setXY: function(e, t, i) {
  41780. return e *= this.itemSize,
  41781. this.array[e + 0] = t,
  41782. this.array[e + 1] = i,
  41783. this
  41784. },
  41785. setXYZ: function(e, t, i, n) {
  41786. return e *= this.itemSize,
  41787. this.array[e + 0] = t,
  41788. this.array[e + 1] = i,
  41789. this.array[e + 2] = n,
  41790. this
  41791. },
  41792. setXYZW: function(e, t, i, n, r) {
  41793. return e *= this.itemSize,
  41794. this.array[e + 0] = t,
  41795. this.array[e + 1] = i,
  41796. this.array[e + 2] = n,
  41797. this.array[e + 3] = r,
  41798. this
  41799. },
  41800. clone: function() {
  41801. return (new this.constructor).copy(this)
  41802. }
  41803. },
  41804. n.Int8Attribute = function(e, t) {
  41805. return new n.BufferAttribute(new Int8Array(e),t)
  41806. }
  41807. ,
  41808. n.Uint8Attribute = function(e, t) {
  41809. return new n.BufferAttribute(new Uint8Array(e),t)
  41810. }
  41811. ,
  41812. n.Uint8ClampedAttribute = function(e, t) {
  41813. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  41814. }
  41815. ,
  41816. n.Int16Attribute = function(e, t) {
  41817. return new n.BufferAttribute(new Int16Array(e),t)
  41818. }
  41819. ,
  41820. n.Uint16Attribute = function(e, t) {
  41821. return new n.BufferAttribute(new Uint16Array(e),t)
  41822. }
  41823. ;
  41824. n.Int32Attribute = function(e, t) {
  41825. return new n.BufferAttribute(new Int32Array(e),t)
  41826. }
  41827. ;
  41828. n.Uint32Attribute = function(e, t) {
  41829. return new n.BufferAttribute(new Uint32Array(e),t)
  41830. }
  41831. ,
  41832. n.Float32Attribute = function(e, t) {
  41833. return new n.BufferAttribute(new Float32Array(e),t)
  41834. }
  41835. ,
  41836. n.Float64Attribute = function(e, t) {
  41837. return new n.BufferAttribute(new Float64Array(e),t)
  41838. }
  41839. ,
  41840. n.DynamicBufferAttribute = function(e, t) {
  41841. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41842. new n.BufferAttribute(e,t).setDynamic(!0)
  41843. }
  41844. ,
  41845. n.InstancedBufferAttribute = function(e, t, i) {
  41846. n.BufferAttribute.call(this, e, t),
  41847. this.meshPerAttribute = i || 1
  41848. }
  41849. ,
  41850. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  41851. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  41852. n.InstancedBufferAttribute.prototype.copy = function(e) {
  41853. return n.BufferAttribute.prototype.copy.call(this, e),
  41854. this.meshPerAttribute = e.meshPerAttribute,
  41855. this
  41856. }
  41857. ,
  41858. n.InterleavedBuffer = function(e, t) {
  41859. this.uuid = n.Math.generateUUID(),
  41860. this.array = e,
  41861. this.stride = t,
  41862. this.dynamic = !1,
  41863. this.updateRange = {
  41864. offset: 0,
  41865. count: -1
  41866. },
  41867. this.version = 0
  41868. }
  41869. ,
  41870. n.InterleavedBuffer.prototype = {
  41871. constructor: n.InterleavedBuffer,
  41872. get length() {
  41873. return this.array.length
  41874. },
  41875. get count() {
  41876. return this.array.length / this.stride
  41877. },
  41878. set needsUpdate(e) {
  41879. e === !0 && this.version++
  41880. },
  41881. setDynamic: function(e) {
  41882. return this.dynamic = e,
  41883. this
  41884. },
  41885. copy: function(e) {
  41886. return this.array = new e.array.constructor(e.array),
  41887. this.stride = e.stride,
  41888. this.dynamic = e.dynamic,
  41889. this
  41890. },
  41891. copyAt: function(e, t, i) {
  41892. e *= this.stride,
  41893. i *= t.stride;
  41894. for (var n = 0, r = this.stride; n < r; n++)
  41895. this.array[e + n] = t.array[i + n];
  41896. return this
  41897. },
  41898. set: function(e, t) {
  41899. return void 0 === t && (t = 0),
  41900. this.array.set(e, t),
  41901. this
  41902. },
  41903. clone: function() {
  41904. return (new this.constructor).copy(this)
  41905. }
  41906. },
  41907. n.InstancedInterleavedBuffer = function(e, t, i) {
  41908. n.InterleavedBuffer.call(this, e, t),
  41909. this.meshPerAttribute = i || 1
  41910. }
  41911. ,
  41912. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  41913. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  41914. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41915. return n.InterleavedBuffer.prototype.copy.call(this, e),
  41916. this.meshPerAttribute = e.meshPerAttribute,
  41917. this
  41918. }
  41919. ,
  41920. n.InterleavedBufferAttribute = function(e, t, i) {
  41921. this.uuid = n.Math.generateUUID(),
  41922. this.data = e,
  41923. this.itemSize = t,
  41924. this.offset = i
  41925. }
  41926. ,
  41927. n.InterleavedBufferAttribute.prototype = {
  41928. constructor: n.InterleavedBufferAttribute,
  41929. get length() {
  41930. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41931. this.array.length
  41932. },
  41933. get count() {
  41934. return this.data.count
  41935. },
  41936. setX: function(e, t) {
  41937. return this.data.array[e * this.data.stride + this.offset] = t,
  41938. this
  41939. },
  41940. setY: function(e, t) {
  41941. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41942. this
  41943. },
  41944. setZ: function(e, t) {
  41945. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41946. this
  41947. },
  41948. setW: function(e, t) {
  41949. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41950. this
  41951. },
  41952. getX: function(e) {
  41953. return this.data.array[e * this.data.stride + this.offset]
  41954. },
  41955. getY: function(e) {
  41956. return this.data.array[e * this.data.stride + this.offset + 1]
  41957. },
  41958. getZ: function(e) {
  41959. return this.data.array[e * this.data.stride + this.offset + 2]
  41960. },
  41961. getW: function(e) {
  41962. return this.data.array[e * this.data.stride + this.offset + 3]
  41963. },
  41964. setXY: function(e, t, i) {
  41965. return e = e * this.data.stride + this.offset,
  41966. this.data.array[e + 0] = t,
  41967. this.data.array[e + 1] = i,
  41968. this
  41969. },
  41970. setXYZ: function(e, t, i, n) {
  41971. return e = e * this.data.stride + this.offset,
  41972. this.data.array[e + 0] = t,
  41973. this.data.array[e + 1] = i,
  41974. this.data.array[e + 2] = n,
  41975. this
  41976. },
  41977. setXYZW: function(e, t, i, n, r) {
  41978. return e = e * this.data.stride + this.offset,
  41979. this.data.array[e + 0] = t,
  41980. this.data.array[e + 1] = i,
  41981. this.data.array[e + 2] = n,
  41982. this.data.array[e + 3] = r,
  41983. this
  41984. }
  41985. },
  41986. n.Geometry = function() {
  41987. Object.defineProperty(this, "id", {
  41988. value: n.GeometryIdCount++
  41989. }),
  41990. this.uuid = n.Math.generateUUID(),
  41991. this.name = "",
  41992. this.type = "Geometry",
  41993. this.vertices = [],
  41994. this.colors = [],
  41995. this.faces = [],
  41996. this.faceVertexUvs = [[]],
  41997. this.morphTargets = [],
  41998. this.morphNormals = [],
  41999. this.skinWeights = [],
  42000. this.skinIndices = [],
  42001. this.lineDistances = [],
  42002. this.boundingBox = null,
  42003. this.boundingSphere = null,
  42004. this.verticesNeedUpdate = !1,
  42005. this.elementsNeedUpdate = !1,
  42006. this.uvsNeedUpdate = !1,
  42007. this.normalsNeedUpdate = !1,
  42008. this.colorsNeedUpdate = !1,
  42009. this.lineDistancesNeedUpdate = !1,
  42010. this.groupsNeedUpdate = !1
  42011. }
  42012. ,
  42013. n.Geometry.prototype = {
  42014. constructor: n.Geometry,
  42015. applyMatrix: function(e) {
  42016. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  42017. var o = this.vertices[i];
  42018. o.applyMatrix4(e)
  42019. }
  42020. for (var i = 0, r = this.faces.length; i < r; i++) {
  42021. var a = this.faces[i];
  42022. a.normal.applyMatrix3(t).normalize();
  42023. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  42024. a.vertexNormals[s].applyMatrix3(t).normalize()
  42025. }
  42026. return null !== this.boundingBox && this.computeBoundingBox(),
  42027. null !== this.boundingSphere && this.computeBoundingSphere(),
  42028. this.verticesNeedUpdate = !0,
  42029. this.normalsNeedUpdate = !0,
  42030. this
  42031. },
  42032. rotateX: function() {
  42033. var e;
  42034. return function(t) {
  42035. return void 0 === e && (e = new n.Matrix4),
  42036. e.makeRotationX(t),
  42037. this.applyMatrix(e),
  42038. this
  42039. }
  42040. }(),
  42041. rotateY: function() {
  42042. var e;
  42043. return function(t) {
  42044. return void 0 === e && (e = new n.Matrix4),
  42045. e.makeRotationY(t),
  42046. this.applyMatrix(e),
  42047. this
  42048. }
  42049. }(),
  42050. rotateZ: function() {
  42051. var e;
  42052. return function(t) {
  42053. return void 0 === e && (e = new n.Matrix4),
  42054. e.makeRotationZ(t),
  42055. this.applyMatrix(e),
  42056. this
  42057. }
  42058. }(),
  42059. translate: function() {
  42060. var e;
  42061. return function(t, i, r) {
  42062. return void 0 === e && (e = new n.Matrix4),
  42063. e.makeTranslation(t, i, r),
  42064. this.applyMatrix(e),
  42065. this
  42066. }
  42067. }(),
  42068. scale: function() {
  42069. var e;
  42070. return function(t, i, r) {
  42071. return void 0 === e && (e = new n.Matrix4),
  42072. e.makeScale(t, i, r),
  42073. this.applyMatrix(e),
  42074. this
  42075. }
  42076. }(),
  42077. lookAt: function() {
  42078. var e;
  42079. return function(t) {
  42080. void 0 === e && (e = new n.Object3D),
  42081. e.lookAt(t),
  42082. e.updateMatrix(),
  42083. this.applyMatrix(e.matrix)
  42084. }
  42085. }(),
  42086. fromBufferGeometry: function(e) {
  42087. function t(e, t, r, o) {
  42088. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  42089. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  42090. , g = new n.Face3(e,t,r,a,f,o);
  42091. i.faces.push(g),
  42092. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  42093. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  42094. }
  42095. var i = this
  42096. , r = null !== e.index ? e.index.array : void 0
  42097. , o = e.attributes
  42098. , a = o.position.array
  42099. , s = void 0 !== o.normal ? o.normal.array : void 0
  42100. , l = void 0 !== o.color ? o.color.array : void 0
  42101. , c = void 0 !== o.uv ? o.uv.array : void 0
  42102. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  42103. void 0 !== h && (this.faceVertexUvs[1] = []);
  42104. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  42105. g += 2)
  42106. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  42107. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  42108. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  42109. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  42110. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  42111. if (void 0 !== r) {
  42112. var m = e.groups;
  42113. if (m.length > 0)
  42114. for (var f = 0; f < m.length; f++)
  42115. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  42116. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  42117. else
  42118. for (var f = 0; f < r.length; f += 3)
  42119. t(r[f], r[f + 1], r[f + 2])
  42120. } else
  42121. for (var f = 0; f < a.length / 3; f += 3)
  42122. t(f, f + 1, f + 2);
  42123. return this.computeFaceNormals(),
  42124. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42125. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42126. this
  42127. },
  42128. center: function() {
  42129. this.computeBoundingBox();
  42130. var e = this.boundingBox.center().negate();
  42131. return this.translate(e.x, e.y, e.z),
  42132. e
  42133. },
  42134. normalize: function() {
  42135. this.computeBoundingSphere();
  42136. var e = this.boundingSphere.center
  42137. , t = this.boundingSphere.radius
  42138. , i = 0 === t ? 1 : 1 / t
  42139. , r = new n.Matrix4;
  42140. return r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  42141. this.applyMatrix(r),
  42142. this
  42143. },
  42144. computeFaceNormals: function() {
  42145. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  42146. var o = this.faces[i]
  42147. , a = this.vertices[o.a]
  42148. , s = this.vertices[o.b]
  42149. , l = this.vertices[o.c];
  42150. e.subVectors(l, s),
  42151. t.subVectors(a, s),
  42152. e.cross(t),
  42153. e.normalize(),
  42154. o.normal.copy(e)
  42155. }
  42156. },
  42157. computeVertexNormals: function(e) {
  42158. void 0 === e && (e = !0);
  42159. var t, i, r, o, a, s;
  42160. for (s = new Array(this.vertices.length),
  42161. t = 0,
  42162. i = this.vertices.length; t < i; t++)
  42163. s[t] = new n.Vector3;
  42164. if (e) {
  42165. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  42166. for (r = 0,
  42167. o = this.faces.length; r < o; r++)
  42168. a = this.faces[r],
  42169. l = this.vertices[a.a],
  42170. c = this.vertices[a.b],
  42171. h = this.vertices[a.c],
  42172. u.subVectors(h, c),
  42173. d.subVectors(l, c),
  42174. u.cross(d),
  42175. s[a.a].add(u),
  42176. s[a.b].add(u),
  42177. s[a.c].add(u)
  42178. } else
  42179. for (r = 0,
  42180. o = this.faces.length; r < o; r++)
  42181. a = this.faces[r],
  42182. s[a.a].add(a.normal),
  42183. s[a.b].add(a.normal),
  42184. s[a.c].add(a.normal);
  42185. for (t = 0,
  42186. i = this.vertices.length; t < i; t++)
  42187. s[t].normalize();
  42188. for (r = 0,
  42189. o = this.faces.length; r < o; r++) {
  42190. a = this.faces[r];
  42191. var p = a.vertexNormals;
  42192. 3 === p.length ? (p[0].copy(s[a.a]),
  42193. p[1].copy(s[a.b]),
  42194. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  42195. p[1] = s[a.b].clone(),
  42196. p[2] = s[a.c].clone())
  42197. }
  42198. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  42199. },
  42200. computeMorphNormals: function() {
  42201. var e, t, i, r, o;
  42202. for (i = 0,
  42203. r = this.faces.length; i < r; i++)
  42204. for (o = this.faces[i],
  42205. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  42206. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  42207. e = 0,
  42208. t = o.vertexNormals.length; e < t; e++)
  42209. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  42210. var a = new n.Geometry;
  42211. for (a.faces = this.faces,
  42212. e = 0,
  42213. t = this.morphTargets.length; e < t; e++) {
  42214. if (!this.morphNormals[e]) {
  42215. this.morphNormals[e] = {},
  42216. this.morphNormals[e].faceNormals = [],
  42217. this.morphNormals[e].vertexNormals = [];
  42218. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  42219. for (i = 0,
  42220. r = this.faces.length; i < r; i++)
  42221. s = new n.Vector3,
  42222. l = {
  42223. a: new n.Vector3,
  42224. b: new n.Vector3,
  42225. c: new n.Vector3
  42226. },
  42227. c.push(s),
  42228. h.push(l)
  42229. }
  42230. var u = this.morphNormals[e];
  42231. a.vertices = this.morphTargets[e].vertices,
  42232. a.computeFaceNormals(),
  42233. a.computeVertexNormals();
  42234. var s, l;
  42235. for (i = 0,
  42236. r = this.faces.length; i < r; i++)
  42237. o = this.faces[i],
  42238. s = u.faceNormals[i],
  42239. l = u.vertexNormals[i],
  42240. s.copy(o.normal),
  42241. l.a.copy(o.vertexNormals[0]),
  42242. l.b.copy(o.vertexNormals[1]),
  42243. l.c.copy(o.vertexNormals[2])
  42244. }
  42245. for (i = 0,
  42246. r = this.faces.length; i < r; i++)
  42247. o = this.faces[i],
  42248. o.normal = o.__originalFaceNormal,
  42249. o.vertexNormals = o.__originalVertexNormals
  42250. },
  42251. computeTangents: function() {
  42252. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42253. },
  42254. computeLineDistances: function() {
  42255. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42256. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  42257. this.lineDistances[i] = e
  42258. },
  42259. computeBoundingBox: function() {
  42260. null === this.boundingBox && (this.boundingBox = new n.Box3),
  42261. this.boundingBox.setFromPoints(this.vertices)
  42262. },
  42263. computeBoundingSphere: function() {
  42264. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  42265. this.boundingSphere.setFromPoints(this.vertices)
  42266. },
  42267. merge: function(e, t, i) {
  42268. if (e instanceof n.Geometry == !1)
  42269. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  42270. var r, o = this.vertices.length, a = this.vertices, s = e.vertices, l = this.faces, c = e.faces, h = this.faceVertexUvs[0], u = e.faceVertexUvs[0];
  42271. void 0 === i && (i = 0),
  42272. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  42273. for (var d = 0, p = s.length; d < p; d++) {
  42274. var f = s[d]
  42275. , g = f.clone();
  42276. void 0 !== t && g.applyMatrix4(t),
  42277. a.push(g)
  42278. }
  42279. for (d = 0,
  42280. p = c.length; d < p; d++) {
  42281. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  42282. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  42283. m.normal.copy(y.normal),
  42284. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  42285. for (var E = 0, b = C.length; E < b; E++)
  42286. v = C[E].clone(),
  42287. void 0 !== r && v.applyMatrix3(r).normalize(),
  42288. m.vertexNormals.push(v);
  42289. m.color.copy(y.color);
  42290. for (var E = 0, b = I.length; E < b; E++)
  42291. A = I[E],
  42292. m.vertexColors.push(A.clone());
  42293. m.materialIndex = y.materialIndex + i,
  42294. l.push(m)
  42295. }
  42296. for (d = 0,
  42297. p = u.length; d < p; d++) {
  42298. var w = u[d]
  42299. , _ = [];
  42300. if (void 0 !== w) {
  42301. for (var E = 0, b = w.length; E < b; E++)
  42302. _.push(w[E].clone());
  42303. h.push(_)
  42304. }
  42305. }
  42306. },
  42307. mergeMesh: function(e) {
  42308. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42309. void this.merge(e.geometry, e.matrix))
  42310. },
  42311. mergeVertices: function() {
  42312. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  42313. for (i = 0,
  42314. n = this.vertices.length; i < n; i++)
  42315. e = this.vertices[i],
  42316. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  42317. void 0 === l[t] ? (l[t] = i,
  42318. c.push(this.vertices[i]),
  42319. h[i] = c.length - 1) : h[i] = h[l[t]];
  42320. var p = [];
  42321. for (i = 0,
  42322. n = this.faces.length; i < n; i++) {
  42323. r = this.faces[i],
  42324. r.a = h[r.a],
  42325. r.b = h[r.b],
  42326. r.c = h[r.c],
  42327. o = [r.a, r.b, r.c];
  42328. for (var f = -1, g = 0; g < 3; g++)
  42329. if (o[g] === o[(g + 1) % 3]) {
  42330. f = g,
  42331. p.push(i);
  42332. break
  42333. }
  42334. }
  42335. for (i = p.length - 1; i >= 0; i--) {
  42336. var m = p[i];
  42337. for (this.faces.splice(m, 1),
  42338. a = 0,
  42339. s = this.faceVertexUvs.length; a < s; a++)
  42340. this.faceVertexUvs[a].splice(m, 1)
  42341. }
  42342. var v = this.vertices.length - c.length;
  42343. return this.vertices = c,
  42344. v
  42345. },
  42346. sortFacesByMaterialIndex: function() {
  42347. function e(e, t) {
  42348. return e.materialIndex - t.materialIndex
  42349. }
  42350. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  42351. t[n]._id = n;
  42352. t.sort(e);
  42353. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  42354. a && a.length === i && (r = []),
  42355. s && s.length === i && (o = []);
  42356. for (var n = 0; n < i; n++) {
  42357. var l = t[n]._id;
  42358. r && r.push(a[l]),
  42359. o && o.push(s[l])
  42360. }
  42361. r && (this.faceVertexUvs[0] = r),
  42362. o && (this.faceVertexUvs[1] = o)
  42363. },
  42364. toJSON: function() {
  42365. function e(e, t, i) {
  42366. return i ? e | 1 << t : e & ~(1 << t)
  42367. }
  42368. function t(e) {
  42369. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42370. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  42371. u.push(e.x, e.y, e.z),
  42372. d[t])
  42373. }
  42374. function i(e) {
  42375. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42376. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  42377. p.push(e.getHex()),
  42378. f[t])
  42379. }
  42380. function n(e) {
  42381. var t = e.x.toString() + e.y.toString();
  42382. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  42383. g.push(e.x, e.y),
  42384. m[t])
  42385. }
  42386. var r = {
  42387. metadata: {
  42388. version: 4.4,
  42389. type: "Geometry",
  42390. generator: "Geometry.toJSON"
  42391. }
  42392. };
  42393. if (r.uuid = this.uuid,
  42394. r.type = this.type,
  42395. "" !== this.name && (r.name = this.name),
  42396. void 0 !== this.parameters) {
  42397. var o = this.parameters;
  42398. for (var a in o)
  42399. void 0 !== o[a] && (r[a] = o[a]);
  42400. return r
  42401. }
  42402. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42403. var c = this.vertices[l];
  42404. s.push(c.x, c.y, c.z)
  42405. }
  42406. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  42407. var v = this.faces[l]
  42408. , A = !0
  42409. , y = !1
  42410. , C = void 0 !== this.faceVertexUvs[0][l]
  42411. , I = v.normal.length() > 0
  42412. , E = v.vertexNormals.length > 0
  42413. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42414. , w = v.vertexColors.length > 0
  42415. , _ = 0;
  42416. if (_ = e(_, 0, 0),
  42417. _ = e(_, 1, A),
  42418. _ = e(_, 2, y),
  42419. _ = e(_, 3, C),
  42420. _ = e(_, 4, I),
  42421. _ = e(_, 5, E),
  42422. _ = e(_, 6, b),
  42423. _ = e(_, 7, w),
  42424. h.push(_),
  42425. h.push(v.a, v.b, v.c),
  42426. h.push(v.materialIndex),
  42427. C) {
  42428. var T = this.faceVertexUvs[0][l];
  42429. h.push(n(T[0]), n(T[1]), n(T[2]))
  42430. }
  42431. if (I && h.push(t(v.normal)),
  42432. E) {
  42433. var x = v.vertexNormals;
  42434. h.push(t(x[0]), t(x[1]), t(x[2]))
  42435. }
  42436. if (b && h.push(i(v.color)),
  42437. w) {
  42438. var S = v.vertexColors;
  42439. h.push(i(S[0]), i(S[1]), i(S[2]))
  42440. }
  42441. }
  42442. return r.data = {},
  42443. r.data.vertices = s,
  42444. r.data.normals = u,
  42445. p.length > 0 && (r.data.colors = p),
  42446. g.length > 0 && (r.data.uvs = [g]),
  42447. r.data.faces = h,
  42448. r
  42449. },
  42450. clone: function() {
  42451. return (new n.Geometry).copy(this)
  42452. },
  42453. copy: function(e) {
  42454. this.vertices = [],
  42455. this.faces = [],
  42456. this.faceVertexUvs = [[]];
  42457. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42458. this.vertices.push(t[i].clone());
  42459. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  42460. this.faces.push(r[i].clone());
  42461. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  42462. var o = e.faceVertexUvs[i];
  42463. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42464. for (var a = 0, s = o.length; a < s; a++) {
  42465. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42466. var d = l[h];
  42467. c.push(d.clone())
  42468. }
  42469. this.faceVertexUvs[i].push(c)
  42470. }
  42471. }
  42472. return this
  42473. },
  42474. dispose: function() {
  42475. this.dispatchEvent({
  42476. type: "dispose"
  42477. })
  42478. }
  42479. },
  42480. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  42481. n.GeometryIdCount = 0,
  42482. n.DirectGeometry = function() {
  42483. Object.defineProperty(this, "id", {
  42484. value: n.GeometryIdCount++
  42485. }),
  42486. this.uuid = n.Math.generateUUID(),
  42487. this.name = "",
  42488. this.type = "DirectGeometry",
  42489. this.indices = [],
  42490. this.vertices = [],
  42491. this.normals = [],
  42492. this.colors = [],
  42493. this.uvs = [],
  42494. this.uvs2 = [],
  42495. this.groups = [],
  42496. this.morphTargets = {},
  42497. this.skinWeights = [],
  42498. this.skinIndices = [],
  42499. this.boundingBox = null,
  42500. this.boundingSphere = null,
  42501. this.verticesNeedUpdate = !1,
  42502. this.normalsNeedUpdate = !1,
  42503. this.colorsNeedUpdate = !1,
  42504. this.uvsNeedUpdate = !1,
  42505. this.groupsNeedUpdate = !1
  42506. }
  42507. ,
  42508. n.DirectGeometry.prototype = {
  42509. constructor: n.DirectGeometry,
  42510. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  42511. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  42512. computeFaceNormals: function() {
  42513. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42514. },
  42515. computeVertexNormals: function() {
  42516. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42517. },
  42518. computeGroups: function(e) {
  42519. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42520. var a = r[o];
  42521. a.materialIndex !== i && (i = a.materialIndex,
  42522. void 0 !== t && (t.count = 3 * o - t.start,
  42523. n.push(t)),
  42524. t = {
  42525. start: 3 * o,
  42526. materialIndex: i
  42527. })
  42528. }
  42529. void 0 !== t && (t.count = 3 * o - t.start,
  42530. n.push(t)),
  42531. this.groups = n
  42532. },
  42533. fromGeometry: function(e) {
  42534. var t, i = e.faces, r = e.vertices, o = e.faceVertexUvs, a = o[0] && o[0].length > 0, s = o[1] && o[1].length > 0, l = e.morphTargets, c = l.length;
  42535. if (c > 0) {
  42536. t = [];
  42537. for (var h = 0; h < c; h++)
  42538. t[h] = [];
  42539. this.morphTargets.position = t
  42540. }
  42541. var u, d = e.morphNormals, p = d.length;
  42542. if (p > 0) {
  42543. u = [];
  42544. for (var h = 0; h < p; h++)
  42545. u[h] = [];
  42546. this.morphTargets.normal = u
  42547. }
  42548. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  42549. var A = i[h];
  42550. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  42551. var y = A.vertexNormals;
  42552. if (3 === y.length)
  42553. this.normals.push(y[0], y[1], y[2]);
  42554. else {
  42555. var C = A.normal;
  42556. this.normals.push(C, C, C)
  42557. }
  42558. var I = A.vertexColors;
  42559. if (3 === I.length)
  42560. this.colors.push(I[0], I[1], I[2]);
  42561. else {
  42562. var E = A.color;
  42563. this.colors.push(E, E, E)
  42564. }
  42565. if (a === !0) {
  42566. var b = o[0][h];
  42567. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  42568. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  42569. }
  42570. if (s === !0) {
  42571. var b = o[1][h];
  42572. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  42573. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  42574. }
  42575. for (var w = 0; w < c; w++) {
  42576. var _ = l[w].vertices;
  42577. t[w].push(_[A.a], _[A.b], _[A.c])
  42578. }
  42579. for (var w = 0; w < p; w++) {
  42580. var T = d[w].vertexNormals[h];
  42581. u[w].push(T.a, T.b, T.c)
  42582. }
  42583. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  42584. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  42585. }
  42586. return this.computeGroups(e),
  42587. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42588. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42589. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42590. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42591. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42592. this
  42593. },
  42594. dispose: function() {
  42595. this.dispatchEvent({
  42596. type: "dispose"
  42597. })
  42598. }
  42599. },
  42600. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  42601. n.BufferGeometry = function() {
  42602. Object.defineProperty(this, "id", {
  42603. value: n.GeometryIdCount++
  42604. }),
  42605. this.uuid = n.Math.generateUUID(),
  42606. this.name = "",
  42607. this.type = "BufferGeometry",
  42608. this.index = null,
  42609. this.attributes = {},
  42610. this.morphAttributes = {},
  42611. this.groups = [],
  42612. this.boundingBox = null,
  42613. this.boundingSphere = null,
  42614. this.drawRange = {
  42615. start: 0,
  42616. count: 1 / 0
  42617. }
  42618. }
  42619. ,
  42620. n.BufferGeometry.prototype = {
  42621. constructor: n.BufferGeometry,
  42622. getIndex: function() {
  42623. return this.index
  42624. },
  42625. setIndex: function(e) {
  42626. this.index = e
  42627. },
  42628. addAttribute: function(e, t) {
  42629. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42630. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42631. void this.setIndex(t)) : (this.attributes[e] = t,
  42632. this)
  42633. },
  42634. getAttribute: function(e) {
  42635. return this.attributes[e]
  42636. },
  42637. removeAttribute: function(e) {
  42638. return delete this.attributes[e],
  42639. this
  42640. },
  42641. addGroup: function(e, t, i) {
  42642. this.groups.push({
  42643. start: e,
  42644. count: t,
  42645. materialIndex: void 0 !== i ? i : 0
  42646. })
  42647. },
  42648. clearGroups: function() {
  42649. this.groups = []
  42650. },
  42651. setDrawRange: function(e, t) {
  42652. this.drawRange.start = e,
  42653. this.drawRange.count = t
  42654. },
  42655. applyMatrix: function(e) {
  42656. var t = this.attributes.position;
  42657. void 0 !== t && (e.applyToVector3Array(t.array),
  42658. t.needsUpdate = !0);
  42659. var i = this.attributes.normal;
  42660. if (void 0 !== i) {
  42661. var r = (new n.Matrix3).getNormalMatrix(e);
  42662. r.applyToVector3Array(i.array),
  42663. i.needsUpdate = !0
  42664. }
  42665. return null !== this.boundingBox && this.computeBoundingBox(),
  42666. null !== this.boundingSphere && this.computeBoundingSphere(),
  42667. this
  42668. },
  42669. rotateX: function() {
  42670. var e;
  42671. return function(t) {
  42672. return void 0 === e && (e = new n.Matrix4),
  42673. e.makeRotationX(t),
  42674. this.applyMatrix(e),
  42675. this
  42676. }
  42677. }(),
  42678. rotateY: function() {
  42679. var e;
  42680. return function(t) {
  42681. return void 0 === e && (e = new n.Matrix4),
  42682. e.makeRotationY(t),
  42683. this.applyMatrix(e),
  42684. this
  42685. }
  42686. }(),
  42687. rotateZ: function() {
  42688. var e;
  42689. return function(t) {
  42690. return void 0 === e && (e = new n.Matrix4),
  42691. e.makeRotationZ(t),
  42692. this.applyMatrix(e),
  42693. this
  42694. }
  42695. }(),
  42696. translate: function() {
  42697. var e;
  42698. return function(t, i, r) {
  42699. return void 0 === e && (e = new n.Matrix4),
  42700. e.makeTranslation(t, i, r),
  42701. this.applyMatrix(e),
  42702. this
  42703. }
  42704. }(),
  42705. scale: function() {
  42706. var e;
  42707. return function(t, i, r) {
  42708. return void 0 === e && (e = new n.Matrix4),
  42709. e.makeScale(t, i, r),
  42710. this.applyMatrix(e),
  42711. this
  42712. }
  42713. }(),
  42714. lookAt: function() {
  42715. var e;
  42716. return function(t) {
  42717. void 0 === e && (e = new n.Object3D),
  42718. e.lookAt(t),
  42719. e.updateMatrix(),
  42720. this.applyMatrix(e.matrix)
  42721. }
  42722. }(),
  42723. center: function() {
  42724. this.computeBoundingBox();
  42725. var e = this.boundingBox.center().negate();
  42726. return this.translate(e.x, e.y, e.z),
  42727. e
  42728. },
  42729. setFromObject: function(e) {
  42730. var t = e.geometry;
  42731. if (e instanceof n.Points || e instanceof n.Line) {
  42732. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  42733. , r = new n.Float32Attribute(3 * t.colors.length,3);
  42734. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42735. this.addAttribute("color", r.copyColorsArray(t.colors)),
  42736. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42737. var o = new n.Float32Attribute(t.lineDistances.length,1);
  42738. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  42739. }
  42740. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42741. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42742. } else
  42743. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  42744. return this
  42745. },
  42746. updateFromObject: function(e) {
  42747. var t = e.geometry;
  42748. if (e instanceof n.Mesh) {
  42749. var i = t.__directGeometry;
  42750. if (void 0 === i)
  42751. return this.fromGeometry(t);
  42752. i.verticesNeedUpdate = t.verticesNeedUpdate,
  42753. i.normalsNeedUpdate = t.normalsNeedUpdate,
  42754. i.colorsNeedUpdate = t.colorsNeedUpdate,
  42755. i.uvsNeedUpdate = t.uvsNeedUpdate,
  42756. i.groupsNeedUpdate = t.groupsNeedUpdate,
  42757. t.verticesNeedUpdate = !1,
  42758. t.normalsNeedUpdate = !1,
  42759. t.colorsNeedUpdate = !1,
  42760. t.uvsNeedUpdate = !1,
  42761. t.groupsNeedUpdate = !1,
  42762. t = i
  42763. }
  42764. if (t.verticesNeedUpdate === !0) {
  42765. var r = this.attributes.position;
  42766. void 0 !== r && (r.copyVector3sArray(t.vertices),
  42767. r.needsUpdate = !0),
  42768. t.verticesNeedUpdate = !1
  42769. }
  42770. if (t.normalsNeedUpdate === !0) {
  42771. var r = this.attributes.normal;
  42772. void 0 !== r && (r.copyVector3sArray(t.normals),
  42773. r.needsUpdate = !0),
  42774. t.normalsNeedUpdate = !1
  42775. }
  42776. if (t.colorsNeedUpdate === !0) {
  42777. var r = this.attributes.color;
  42778. void 0 !== r && (r.copyColorsArray(t.colors),
  42779. r.needsUpdate = !0),
  42780. t.colorsNeedUpdate = !1
  42781. }
  42782. if (t.uvsNeedUpdate) {
  42783. var r = this.attributes.uv;
  42784. void 0 !== r && (r.copyVector2sArray(t.uvs),
  42785. r.needsUpdate = !0),
  42786. t.uvsNeedUpdate = !1
  42787. }
  42788. if (t.lineDistancesNeedUpdate) {
  42789. var r = this.attributes.lineDistance;
  42790. void 0 !== r && (r.copyArray(t.lineDistances),
  42791. r.needsUpdate = !0),
  42792. t.lineDistancesNeedUpdate = !1
  42793. }
  42794. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  42795. this.groups = t.groups,
  42796. t.groupsNeedUpdate = !1),
  42797. this
  42798. },
  42799. fromGeometry: function(e) {
  42800. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  42801. this.fromDirectGeometry(e.__directGeometry)
  42802. },
  42803. fromDirectGeometry: function(e) {
  42804. var t = new Float32Array(3 * e.vertices.length);
  42805. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42806. e.normals.length > 0) {
  42807. var i = new Float32Array(3 * e.normals.length);
  42808. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42809. }
  42810. if (e.colors.length > 0) {
  42811. var r = new Float32Array(3 * e.colors.length);
  42812. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  42813. }
  42814. if (e.uvs.length > 0) {
  42815. var o = new Float32Array(2 * e.uvs.length);
  42816. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  42817. }
  42818. if (e.uvs2.length > 0) {
  42819. var a = new Float32Array(2 * e.uvs2.length);
  42820. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  42821. }
  42822. if (e.indices.length > 0) {
  42823. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  42824. , l = new s(3 * e.indices.length);
  42825. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  42826. }
  42827. this.groups = e.groups;
  42828. for (var c in e.morphTargets) {
  42829. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  42830. var f = u[d]
  42831. , g = new n.Float32Attribute(3 * f.length,3);
  42832. h.push(g.copyVector3sArray(f))
  42833. }
  42834. this.morphAttributes[c] = h
  42835. }
  42836. if (e.skinIndices.length > 0) {
  42837. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  42838. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  42839. }
  42840. if (e.skinWeights.length > 0) {
  42841. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  42842. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  42843. }
  42844. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42845. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42846. this
  42847. },
  42848. computeBoundingBox: function() {
  42849. new n.Vector3;
  42850. return function() {
  42851. null === this.boundingBox && (this.boundingBox = new n.Box3);
  42852. var e = this.attributes.position.array;
  42853. e && this.boundingBox.setFromArray(e),
  42854. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42855. this.boundingBox.max.set(0, 0, 0)),
  42856. (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)
  42857. }
  42858. }(),
  42859. computeBoundingSphere: function() {
  42860. var e = new n.Box3
  42861. , t = new n.Vector3;
  42862. return function() {
  42863. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  42864. var i = this.attributes.position.array;
  42865. if (i) {
  42866. var r = this.boundingSphere.center;
  42867. e.setFromArray(i),
  42868. e.center(r);
  42869. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  42870. t.fromArray(i, a),
  42871. o = Math.max(o, r.distanceToSquared(t));
  42872. this.boundingSphere.radius = Math.sqrt(o),
  42873. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42874. }
  42875. }
  42876. }(),
  42877. computeFaceNormals: function() {},
  42878. computeVertexNormals: function() {
  42879. var e = this.index
  42880. , t = this.attributes
  42881. , i = this.groups;
  42882. if (t.position) {
  42883. var r = t.position.array;
  42884. if (void 0 === t.normal)
  42885. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  42886. else
  42887. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  42888. o[a] = 0;
  42889. var l, c, h, u = t.normal.array, d = new n.Vector3, p = new n.Vector3, f = new n.Vector3, g = new n.Vector3, m = new n.Vector3;
  42890. if (e) {
  42891. var v = e.array;
  42892. 0 === i.length && this.addGroup(0, v.length);
  42893. for (var A = 0, y = i.length; A < y; ++A)
  42894. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  42895. l = 3 * v[a + 0],
  42896. c = 3 * v[a + 1],
  42897. h = 3 * v[a + 2],
  42898. d.fromArray(r, l),
  42899. p.fromArray(r, c),
  42900. f.fromArray(r, h),
  42901. g.subVectors(f, p),
  42902. m.subVectors(d, p),
  42903. g.cross(m),
  42904. u[l] += g.x,
  42905. u[l + 1] += g.y,
  42906. u[l + 2] += g.z,
  42907. u[c] += g.x,
  42908. u[c + 1] += g.y,
  42909. u[c + 2] += g.z,
  42910. u[h] += g.x,
  42911. u[h + 1] += g.y,
  42912. u[h + 2] += g.z
  42913. } else
  42914. for (var a = 0, s = r.length; a < s; a += 9)
  42915. d.fromArray(r, a),
  42916. p.fromArray(r, a + 3),
  42917. f.fromArray(r, a + 6),
  42918. g.subVectors(f, p),
  42919. m.subVectors(d, p),
  42920. g.cross(m),
  42921. u[a] = g.x,
  42922. u[a + 1] = g.y,
  42923. u[a + 2] = g.z,
  42924. u[a + 3] = g.x,
  42925. u[a + 4] = g.y,
  42926. u[a + 5] = g.z,
  42927. u[a + 6] = g.x,
  42928. u[a + 7] = g.y,
  42929. u[a + 8] = g.z;
  42930. this.normalizeNormals(),
  42931. t.normal.needsUpdate = !0
  42932. }
  42933. },
  42934. merge: function(e, t) {
  42935. if (e instanceof n.BufferGeometry == !1)
  42936. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  42937. void 0 === t && (t = 0);
  42938. var i = this.attributes;
  42939. for (var r in i)
  42940. if (void 0 !== e.attributes[r])
  42941. for (var o = i[r], a = o.array, s = e.attributes[r], l = s.array, c = s.itemSize, h = 0, u = c * t; h < l.length; h++,
  42942. u++)
  42943. a[u] = l[h];
  42944. return this
  42945. },
  42946. normalizeNormals: function() {
  42947. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42948. e = r[o],
  42949. t = r[o + 1],
  42950. i = r[o + 2],
  42951. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42952. r[o] *= n,
  42953. r[o + 1] *= n,
  42954. r[o + 2] *= n
  42955. },
  42956. toNonIndexed: function() {
  42957. if (null === this.index)
  42958. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42959. this;
  42960. var e = new n.BufferGeometry
  42961. , t = this.index.array
  42962. , i = this.attributes;
  42963. for (var r in i) {
  42964. for (var o = i[r], a = o.array, s = o.itemSize, l = new a.constructor(t.length * s), c = 0, h = 0, u = 0, d = t.length; u < d; u++) {
  42965. c = t[u] * s;
  42966. for (var p = 0; p < s; p++)
  42967. l[h++] = a[c++]
  42968. }
  42969. e.addAttribute(r, new n.BufferAttribute(l,s))
  42970. }
  42971. return e
  42972. },
  42973. toJSON: function() {
  42974. var e = {
  42975. metadata: {
  42976. version: 4.4,
  42977. type: "BufferGeometry",
  42978. generator: "BufferGeometry.toJSON"
  42979. }
  42980. };
  42981. if (e.uuid = this.uuid,
  42982. e.type = this.type,
  42983. "" !== this.name && (e.name = this.name),
  42984. void 0 !== this.parameters) {
  42985. var t = this.parameters;
  42986. for (var i in t)
  42987. void 0 !== t[i] && (e[i] = t[i]);
  42988. return e
  42989. }
  42990. e.data = {
  42991. attributes: {}
  42992. };
  42993. var n = this.index;
  42994. if (null !== n) {
  42995. var r = Array.prototype.slice.call(n.array);
  42996. e.data.index = {
  42997. type: n.array.constructor.name,
  42998. array: r
  42999. }
  43000. }
  43001. var o = this.attributes;
  43002. for (var i in o) {
  43003. var a = o[i]
  43004. , r = Array.prototype.slice.call(a.array);
  43005. e.data.attributes[i] = {
  43006. itemSize: a.itemSize,
  43007. type: a.array.constructor.name,
  43008. array: r
  43009. }
  43010. }
  43011. var s = this.groups;
  43012. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  43013. var l = this.boundingSphere;
  43014. return null !== l && (e.data.boundingSphere = {
  43015. center: l.center.toArray(),
  43016. radius: l.radius
  43017. }),
  43018. e
  43019. },
  43020. clone: function() {
  43021. return (new n.BufferGeometry).copy(this)
  43022. },
  43023. copy: function(e) {
  43024. var t = e.index;
  43025. null !== t && this.setIndex(t.clone());
  43026. var i = e.attributes;
  43027. for (var n in i) {
  43028. var r = i[n];
  43029. this.addAttribute(n, r.clone())
  43030. }
  43031. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43032. var l = o[a];
  43033. this.addGroup(l.start, l.count)
  43034. }
  43035. return this
  43036. },
  43037. dispose: function() {
  43038. this.dispatchEvent({
  43039. type: "dispose"
  43040. })
  43041. }
  43042. },
  43043. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  43044. n.BufferGeometry.MaxIndex = 65535,
  43045. n.InstancedBufferGeometry = function() {
  43046. n.BufferGeometry.call(this),
  43047. this.type = "InstancedBufferGeometry",
  43048. this.maxInstancedCount = void 0
  43049. }
  43050. ,
  43051. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  43052. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  43053. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43054. this.groups.push({
  43055. start: e,
  43056. count: t,
  43057. instances: i
  43058. })
  43059. }
  43060. ,
  43061. n.InstancedBufferGeometry.prototype.copy = function(e) {
  43062. var t = e.index;
  43063. null !== t && this.setIndex(t.clone());
  43064. var i = e.attributes;
  43065. for (var n in i) {
  43066. var r = i[n];
  43067. this.addAttribute(n, r.clone())
  43068. }
  43069. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43070. var l = o[a];
  43071. this.addGroup(l.start, l.count, l.instances)
  43072. }
  43073. return this
  43074. }
  43075. ,
  43076. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  43077. n.Uniform = function(e, t) {
  43078. this.type = e,
  43079. this.value = t,
  43080. this.dynamic = !1
  43081. }
  43082. ,
  43083. n.Uniform.prototype = {
  43084. constructor: n.Uniform,
  43085. onUpdate: function(e) {
  43086. return this.dynamic = !0,
  43087. this.onUpdateCallback = e,
  43088. this
  43089. }
  43090. },
  43091. n.AnimationClip = function(e, t, i) {
  43092. this.name = e || n.Math.generateUUID(),
  43093. this.tracks = i,
  43094. this.duration = void 0 !== t ? t : -1,
  43095. this.duration < 0 && this.resetDuration(),
  43096. this.trim(),
  43097. this.optimize()
  43098. }
  43099. ,
  43100. n.AnimationClip.prototype = {
  43101. constructor: n.AnimationClip,
  43102. resetDuration: function() {
  43103. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  43104. var r = this.tracks[i];
  43105. t = Math.max(t, r.times[r.times.length - 1])
  43106. }
  43107. this.duration = t
  43108. },
  43109. trim: function() {
  43110. for (var e = 0; e < this.tracks.length; e++)
  43111. this.tracks[e].trim(0, this.duration);
  43112. return this
  43113. },
  43114. optimize: function() {
  43115. for (var e = 0; e < this.tracks.length; e++)
  43116. this.tracks[e].optimize();
  43117. return this
  43118. }
  43119. },
  43120. Object.assign(n.AnimationClip, {
  43121. parse: function(e) {
  43122. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  43123. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  43124. return new n.AnimationClip(e.name,e.duration,t)
  43125. },
  43126. toJSON: function(e) {
  43127. for (var t = [], i = e.tracks, r = {
  43128. name: e.name,
  43129. duration: e.duration,
  43130. tracks: t
  43131. }, o = 0, a = i.length; o !== a; ++o)
  43132. t.push(n.KeyframeTrack.toJSON(i[o]));
  43133. return r
  43134. },
  43135. CreateFromMorphTargetSequence: function(e, t, i) {
  43136. for (var r = t.length, o = [], a = 0; a < r; a++) {
  43137. var s = []
  43138. , l = [];
  43139. s.push((a + r - 1) % r, a, (a + 1) % r),
  43140. l.push(0, 1, 0);
  43141. var c = n.AnimationUtils.getKeyframeOrder(s);
  43142. s = n.AnimationUtils.sortedArray(s, 1, c),
  43143. l = n.AnimationUtils.sortedArray(l, 1, c),
  43144. 0 === s[0] && (s.push(r),
  43145. l.push(l[0])),
  43146. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  43147. }
  43148. return new n.AnimationClip(e,-1,o)
  43149. },
  43150. findByName: function(e, t) {
  43151. for (var i = 0; i < e.length; i++)
  43152. if (e[i].name === t)
  43153. return e[i];
  43154. return null
  43155. },
  43156. CreateClipsFromMorphTargetSequences: function(e, t) {
  43157. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  43158. var s = e[o]
  43159. , l = s.name.match(r);
  43160. if (l && l.length > 1) {
  43161. var c = l[1]
  43162. , h = i[c];
  43163. h || (i[c] = h = []),
  43164. h.push(s)
  43165. }
  43166. }
  43167. var u = [];
  43168. for (var c in i)
  43169. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  43170. return u
  43171. },
  43172. parseAnimation: function(e, t, i) {
  43173. if (!e)
  43174. return console.error(" no animation in JSONLoader data"),
  43175. null;
  43176. for (var r = function(e, t, i, r, o) {
  43177. if (0 !== i.length) {
  43178. var a = []
  43179. , s = [];
  43180. n.AnimationUtils.flattenJSON(i, a, s, r),
  43181. 0 !== a.length && o.push(new e(t,a,s))
  43182. }
  43183. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  43184. var u = c[h].keys;
  43185. if (u && 0 != u.length)
  43186. if (u[0].morphTargets) {
  43187. for (var d = {}, p = 0; p < u.length; p++)
  43188. if (u[p].morphTargets)
  43189. for (var f = 0; f < u[p].morphTargets.length; f++)
  43190. d[u[p].morphTargets[f]] = -1;
  43191. for (var g in d) {
  43192. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  43193. var A = u[p];
  43194. m.push(A.time),
  43195. v.push(A.morphTarget === g ? 1 : 0)
  43196. }
  43197. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  43198. }
  43199. s = d.length * (l || 1)
  43200. } else {
  43201. var y = ".bones[" + t[h].name + "]";
  43202. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  43203. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  43204. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  43205. }
  43206. }
  43207. if (0 === o.length)
  43208. return null;
  43209. var C = new n.AnimationClip(a,s,o);
  43210. return C
  43211. }
  43212. }),
  43213. n.AnimationMixer = function(e) {
  43214. this._root = e,
  43215. this._initMemoryManager(),
  43216. this._accuIndex = 0,
  43217. this.time = 0,
  43218. this.timeScale = 1
  43219. }
  43220. ,
  43221. n.AnimationMixer.prototype = {
  43222. constructor: n.AnimationMixer,
  43223. clipAction: function(e, t) {
  43224. var i, r = t || this._root, o = r.uuid, a = "string" == typeof e ? e : e.name, s = e !== a ? e : null, l = this._actionsByClip[a];
  43225. if (void 0 !== l) {
  43226. var c = l.actionByRoot[o];
  43227. if (void 0 !== c)
  43228. return c;
  43229. if (i = l.knownActions[0],
  43230. s = i._clip,
  43231. e !== a && e !== s)
  43232. throw new Error("Different clips with the same name detected!")
  43233. }
  43234. if (null === s)
  43235. return null;
  43236. var h = new n.AnimationMixer._Action(this,s,t);
  43237. return this._bindAction(h, i),
  43238. this._addInactiveAction(h, a, o),
  43239. h
  43240. },
  43241. existingAction: function(e, t) {
  43242. var i = t || this._root
  43243. , n = i.uuid
  43244. , r = "string" == typeof e ? e : e.name
  43245. , o = this._actionsByClip[r];
  43246. return void 0 !== o ? o.actionByRoot[n] || null : null
  43247. },
  43248. stopAllAction: function() {
  43249. var e = this._actions
  43250. , t = this._nActiveActions
  43251. , i = this._bindings
  43252. , n = this._nActiveBindings;
  43253. this._nActiveActions = 0,
  43254. this._nActiveBindings = 0;
  43255. for (var r = 0; r !== t; ++r)
  43256. e[r].reset();
  43257. for (var r = 0; r !== n; ++r)
  43258. i[r].useCount = 0;
  43259. return this
  43260. },
  43261. update: function(e) {
  43262. e *= this.timeScale;
  43263. 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) {
  43264. var s = t[a];
  43265. s.enabled && s._update(n, e, r, o)
  43266. }
  43267. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  43268. l[a].apply(o);
  43269. return this
  43270. },
  43271. getRoot: function() {
  43272. return this._root
  43273. },
  43274. uncacheClip: function(e) {
  43275. var t = this._actions
  43276. , i = e.name
  43277. , n = this._actionsByClip
  43278. , r = n[i];
  43279. if (void 0 !== r) {
  43280. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43281. var l = o[a];
  43282. this._deactivateAction(l);
  43283. var c = l._cacheIndex
  43284. , h = t[t.length - 1];
  43285. l._cacheIndex = null,
  43286. l._byClipCacheIndex = null,
  43287. h._cacheIndex = c,
  43288. t[c] = h,
  43289. t.pop(),
  43290. this._removeInactiveBindingsForAction(l)
  43291. }
  43292. delete n[i]
  43293. }
  43294. },
  43295. uncacheRoot: function(e) {
  43296. var t = e.uuid
  43297. , i = this._actionsByClip;
  43298. for (var n in i) {
  43299. var r = i[n].actionByRoot
  43300. , o = r[t];
  43301. void 0 !== o && (this._deactivateAction(o),
  43302. this._removeInactiveAction(o))
  43303. }
  43304. var a = this._bindingsByRootAndName
  43305. , s = a[t];
  43306. if (void 0 !== s)
  43307. for (var l in s) {
  43308. var c = s[l];
  43309. c.restoreOriginalState(),
  43310. this._removeInactiveBinding(c)
  43311. }
  43312. },
  43313. uncacheAction: function(e, t) {
  43314. var i = this.existingAction(e, t);
  43315. null !== i && (this._deactivateAction(i),
  43316. this._removeInactiveAction(i))
  43317. }
  43318. },
  43319. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  43320. n.AnimationMixer._Action = function(e, t, i) {
  43321. this._mixer = e,
  43322. this._clip = t,
  43323. this._localRoot = i || null;
  43324. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  43325. endingStart: n.ZeroCurvatureEnding,
  43326. endingEnd: n.ZeroCurvatureEnding
  43327. }, l = 0; l !== o; ++l) {
  43328. var c = r[l].createInterpolant(null);
  43329. a[l] = c,
  43330. c.settings = s
  43331. }
  43332. this._interpolantSettings = s,
  43333. this._interpolants = a,
  43334. this._propertyBindings = new Array(o),
  43335. this._cacheIndex = null,
  43336. this._byClipCacheIndex = null,
  43337. this._timeScaleInterpolant = null,
  43338. this._weightInterpolant = null,
  43339. this.loop = n.LoopRepeat,
  43340. this._loopCount = -1,
  43341. this._startTime = null,
  43342. this.time = 0,
  43343. this.timeScale = 1,
  43344. this._effectiveTimeScale = 1,
  43345. this.weight = 1,
  43346. this._effectiveWeight = 1,
  43347. this.repetitions = 1 / 0,
  43348. this.paused = !1,
  43349. this.enabled = !0,
  43350. this.clampWhenFinished = !1,
  43351. this.zeroSlopeAtStart = !0,
  43352. this.zeroSlopeAtEnd = !0
  43353. }
  43354. ,
  43355. n.AnimationMixer._Action.prototype = {
  43356. constructor: n.AnimationMixer._Action,
  43357. play: function() {
  43358. return this._mixer._activateAction(this),
  43359. this
  43360. },
  43361. stop: function() {
  43362. return this._mixer._deactivateAction(this),
  43363. this.reset()
  43364. },
  43365. reset: function() {
  43366. return this.paused = !1,
  43367. this.enabled = !0,
  43368. this.time = 0,
  43369. this._loopCount = -1,
  43370. this._startTime = null,
  43371. this.stopFading().stopWarping()
  43372. },
  43373. isRunning: function() {
  43374. this._startTime;
  43375. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43376. },
  43377. isScheduled: function() {
  43378. return this._mixer._isActiveAction(this)
  43379. },
  43380. startAt: function(e) {
  43381. return this._startTime = e,
  43382. this
  43383. },
  43384. setLoop: function(e, t) {
  43385. return this.loop = e,
  43386. this.repetitions = t,
  43387. this
  43388. },
  43389. setEffectiveWeight: function(e) {
  43390. return this.weight = e,
  43391. this._effectiveWeight = this.enabled ? e : 0,
  43392. this.stopFading()
  43393. },
  43394. getEffectiveWeight: function() {
  43395. return this._effectiveWeight
  43396. },
  43397. fadeIn: function(e) {
  43398. return this._scheduleFading(e, 0, 1)
  43399. },
  43400. fadeOut: function(e) {
  43401. return this._scheduleFading(e, 1, 0)
  43402. },
  43403. crossFadeFrom: function(e, t, i) {
  43404. this._mixer;
  43405. if (e.fadeOut(t),
  43406. this.fadeIn(t),
  43407. i) {
  43408. var n = this._clip.duration
  43409. , r = e._clip.duration
  43410. , o = r / n
  43411. , a = n / r;
  43412. e.warp(1, o, t),
  43413. this.warp(a, 1, t)
  43414. }
  43415. return this
  43416. },
  43417. crossFadeTo: function(e, t, i) {
  43418. return e.crossFadeFrom(this, t, i)
  43419. },
  43420. stopFading: function() {
  43421. var e = this._weightInterpolant;
  43422. return null !== e && (this._weightInterpolant = null,
  43423. this._mixer._takeBackControlInterpolant(e)),
  43424. this
  43425. },
  43426. setEffectiveTimeScale: function(e) {
  43427. return this.timeScale = e,
  43428. this._effectiveTimeScale = this.paused ? 0 : e,
  43429. this.stopWarping()
  43430. },
  43431. getEffectiveTimeScale: function() {
  43432. return this._effectiveTimeScale
  43433. },
  43434. setDuration: function(e) {
  43435. return this.timeScale = this._clip.duration / e,
  43436. this.stopWarping()
  43437. },
  43438. syncWith: function(e) {
  43439. return this.time = e.time,
  43440. this.timeScale = e.timeScale,
  43441. this.stopWarping()
  43442. },
  43443. halt: function(e) {
  43444. return this.warp(this._currentTimeScale, 0, e)
  43445. },
  43446. warp: function(e, t, i) {
  43447. var n = this._mixer
  43448. , r = n.time
  43449. , o = this._timeScaleInterpolant
  43450. , a = this.timeScale;
  43451. null === o && (o = n._lendControlInterpolant(),
  43452. this._timeScaleInterpolant = o);
  43453. var s = o.parameterPositions
  43454. , l = o.sampleValues;
  43455. return s[0] = r,
  43456. s[1] = r + i,
  43457. l[0] = e / a,
  43458. l[1] = t / a,
  43459. this
  43460. },
  43461. stopWarping: function() {
  43462. var e = this._timeScaleInterpolant;
  43463. return null !== e && (this._timeScaleInterpolant = null,
  43464. this._mixer._takeBackControlInterpolant(e)),
  43465. this
  43466. },
  43467. getMixer: function() {
  43468. return this._mixer
  43469. },
  43470. getClip: function() {
  43471. return this._clip
  43472. },
  43473. getRoot: function() {
  43474. return this._localRoot || this._mixer._root
  43475. },
  43476. _update: function(e, t, i, n) {
  43477. var r = this._startTime;
  43478. if (null !== r) {
  43479. var o = (e - r) * i;
  43480. if (o < 0 || 0 === i)
  43481. return;
  43482. this._startTime = null,
  43483. t = i * o
  43484. }
  43485. t *= this._updateTimeScale(e);
  43486. var a = this._updateTime(t)
  43487. , s = this._updateWeight(e);
  43488. if (s > 0)
  43489. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43490. l[h].evaluate(a),
  43491. c[h].accumulate(n, s)
  43492. },
  43493. _updateWeight: function(e) {
  43494. var t = 0;
  43495. if (this.enabled) {
  43496. t = this.weight;
  43497. var i = this._weightInterpolant;
  43498. if (null !== i) {
  43499. var n = i.evaluate(e)[0];
  43500. t *= n,
  43501. e > i.parameterPositions[1] && (this.stopFading(),
  43502. 0 === n && (this.enabled = !1))
  43503. }
  43504. }
  43505. return this._effectiveWeight = t,
  43506. t
  43507. },
  43508. _updateTimeScale: function(e) {
  43509. var t = 0;
  43510. if (!this.paused) {
  43511. t = this.timeScale;
  43512. var i = this._timeScaleInterpolant;
  43513. if (null !== i) {
  43514. var n = i.evaluate(e)[0];
  43515. t *= n,
  43516. e > i.parameterPositions[1] && (this.stopWarping(),
  43517. 0 === t ? this.pause = !0 : this.timeScale = t)
  43518. }
  43519. }
  43520. return this._effectiveTimeScale = t,
  43521. t
  43522. },
  43523. _updateTime: function(e) {
  43524. var t = this.time + e;
  43525. if (0 === e)
  43526. return t;
  43527. var i = this._clip.duration
  43528. , r = this.loop
  43529. , o = this._loopCount
  43530. , a = !1;
  43531. switch (r) {
  43532. case n.LoopOnce:
  43533. if (o === -1 && (this.loopCount = 0,
  43534. this._setEndings(!0, !0, !1)),
  43535. t >= i)
  43536. t = i;
  43537. else {
  43538. if (!(t < 0))
  43539. break;
  43540. t = 0
  43541. }
  43542. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43543. this._mixer.dispatchEvent({
  43544. type: "finished",
  43545. action: this,
  43546. direction: e < 0 ? -1 : 1
  43547. });
  43548. break;
  43549. case n.LoopPingPong:
  43550. a = !0;
  43551. case n.LoopRepeat:
  43552. if (o === -1 && (e > 0 ? (o = 0,
  43553. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  43554. t >= i || t < 0) {
  43555. var s = Math.floor(t / i);
  43556. t -= i * s,
  43557. o += Math.abs(s);
  43558. var l = this.repetitions - o;
  43559. if (l < 0) {
  43560. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43561. t = e > 0 ? i : 0,
  43562. this._mixer.dispatchEvent({
  43563. type: "finished",
  43564. action: this,
  43565. direction: e > 0 ? 1 : -1
  43566. });
  43567. break
  43568. }
  43569. if (0 === l) {
  43570. var c = e < 0;
  43571. this._setEndings(c, !c, a)
  43572. } else
  43573. this._setEndings(!1, !1, a);
  43574. this._loopCount = o,
  43575. this._mixer.dispatchEvent({
  43576. type: "loop",
  43577. action: this,
  43578. loopDelta: s
  43579. })
  43580. }
  43581. if (r === n.LoopPingPong && 1 === (1 & o))
  43582. return this.time = t,
  43583. i - t
  43584. }
  43585. return this.time = t,
  43586. t
  43587. },
  43588. _setEndings: function(e, t, i) {
  43589. var r = this._interpolantSettings;
  43590. i ? (r.endingStart = n.ZeroSlopeEnding,
  43591. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  43592. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  43593. },
  43594. _scheduleFading: function(e, t, i) {
  43595. var n = this._mixer
  43596. , r = n.time
  43597. , o = this._weightInterpolant;
  43598. null === o && (o = n._lendControlInterpolant(),
  43599. this._weightInterpolant = o);
  43600. var a = o.parameterPositions
  43601. , s = o.sampleValues;
  43602. return a[0] = r,
  43603. s[0] = t,
  43604. a[1] = r + e,
  43605. s[1] = i,
  43606. this
  43607. }
  43608. },
  43609. Object.assign(n.AnimationMixer.prototype, {
  43610. _bindAction: function(e, t) {
  43611. var i = e._localRoot || this._root
  43612. , r = e._clip.tracks
  43613. , o = r.length
  43614. , a = e._propertyBindings
  43615. , s = e._interpolants
  43616. , l = i.uuid
  43617. , c = this._bindingsByRootAndName
  43618. , h = c[l];
  43619. void 0 === h && (h = {},
  43620. c[l] = h);
  43621. for (var u = 0; u !== o; ++u) {
  43622. var d = r[u]
  43623. , p = d.name
  43624. , f = h[p];
  43625. if (void 0 !== f)
  43626. a[u] = f;
  43627. else {
  43628. if (f = a[u],
  43629. void 0 !== f) {
  43630. null === f._cacheIndex && (++f.referenceCount,
  43631. this._addInactiveBinding(f, l, p));
  43632. continue
  43633. }
  43634. var g = t && t._propertyBindings[u].binding.parsedPath;
  43635. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  43636. ++f.referenceCount,
  43637. this._addInactiveBinding(f, l, p),
  43638. a[u] = f
  43639. }
  43640. s[u].resultBuffer = f.buffer
  43641. }
  43642. },
  43643. _activateAction: function(e) {
  43644. if (!this._isActiveAction(e)) {
  43645. if (null === e._cacheIndex) {
  43646. var t = (e._localRoot || this._root).uuid
  43647. , i = e._clip.name
  43648. , n = this._actionsByClip[i];
  43649. this._bindAction(e, n && n.knownActions[0]),
  43650. this._addInactiveAction(e, i, t)
  43651. }
  43652. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43653. var s = r[o];
  43654. 0 === s.useCount++ && (this._lendBinding(s),
  43655. s.saveOriginalState())
  43656. }
  43657. this._lendAction(e)
  43658. }
  43659. },
  43660. _deactivateAction: function(e) {
  43661. if (this._isActiveAction(e)) {
  43662. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43663. var r = t[i];
  43664. 0 === --r.useCount && (r.restoreOriginalState(),
  43665. this._takeBackBinding(r))
  43666. }
  43667. this._takeBackAction(e)
  43668. }
  43669. },
  43670. _initMemoryManager: function() {
  43671. this._actions = [],
  43672. this._nActiveActions = 0,
  43673. this._actionsByClip = {},
  43674. this._bindings = [],
  43675. this._nActiveBindings = 0,
  43676. this._bindingsByRootAndName = {},
  43677. this._controlInterpolants = [],
  43678. this._nActiveControlInterpolants = 0;
  43679. var e = this;
  43680. this.stats = {
  43681. actions: {
  43682. get total() {
  43683. return e._actions.length
  43684. },
  43685. get inUse() {
  43686. return e._nActiveActions
  43687. }
  43688. },
  43689. bindings: {
  43690. get total() {
  43691. return e._bindings.length
  43692. },
  43693. get inUse() {
  43694. return e._nActiveBindings
  43695. }
  43696. },
  43697. controlInterpolants: {
  43698. get total() {
  43699. return e._controlInterpolants.length
  43700. },
  43701. get inUse() {
  43702. return e._nActiveControlInterpolants
  43703. }
  43704. }
  43705. }
  43706. },
  43707. _isActiveAction: function(e) {
  43708. var t = e._cacheIndex;
  43709. return null !== t && t < this._nActiveActions
  43710. },
  43711. _addInactiveAction: function(e, t, i) {
  43712. var n = this._actions
  43713. , r = this._actionsByClip
  43714. , o = r[t];
  43715. if (void 0 === o)
  43716. o = {
  43717. knownActions: [e],
  43718. actionByRoot: {}
  43719. },
  43720. e._byClipCacheIndex = 0,
  43721. r[t] = o;
  43722. else {
  43723. var a = o.knownActions;
  43724. e._byClipCacheIndex = a.length,
  43725. a.push(e)
  43726. }
  43727. e._cacheIndex = n.length,
  43728. n.push(e),
  43729. o.actionByRoot[i] = e
  43730. },
  43731. _removeInactiveAction: function(e) {
  43732. var t = this._actions
  43733. , i = t[t.length - 1]
  43734. , n = e._cacheIndex;
  43735. i._cacheIndex = n,
  43736. t[n] = i,
  43737. t.pop(),
  43738. e._cacheIndex = null;
  43739. var r = e._clip.name
  43740. , o = this._actionsByClip
  43741. , a = o[r]
  43742. , s = a.knownActions
  43743. , l = s[s.length - 1]
  43744. , c = e._byClipCacheIndex;
  43745. l._byClipCacheIndex = c,
  43746. s[c] = l,
  43747. s.pop(),
  43748. e._byClipCacheIndex = null;
  43749. var h = a.actionByRoot
  43750. , u = (t._localRoot || this._root).uuid;
  43751. delete h[u],
  43752. 0 === s.length && delete o[r],
  43753. this._removeInactiveBindingsForAction(e)
  43754. },
  43755. _removeInactiveBindingsForAction: function(e) {
  43756. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43757. var r = t[i];
  43758. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  43759. }
  43760. },
  43761. _lendAction: function(e) {
  43762. var t = this._actions
  43763. , i = e._cacheIndex
  43764. , n = this._nActiveActions++
  43765. , r = t[n];
  43766. e._cacheIndex = n,
  43767. t[n] = e,
  43768. r._cacheIndex = i,
  43769. t[i] = r
  43770. },
  43771. _takeBackAction: function(e) {
  43772. var t = this._actions
  43773. , i = e._cacheIndex
  43774. , n = --this._nActiveActions
  43775. , r = t[n];
  43776. e._cacheIndex = n,
  43777. t[n] = e,
  43778. r._cacheIndex = i,
  43779. t[i] = r
  43780. },
  43781. _addInactiveBinding: function(e, t, i) {
  43782. var n = this._bindingsByRootAndName
  43783. , r = n[t]
  43784. , o = this._bindings;
  43785. void 0 === r && (r = {},
  43786. n[t] = r),
  43787. r[i] = e,
  43788. e._cacheIndex = o.length,
  43789. o.push(e)
  43790. },
  43791. _removeInactiveBinding: function(e) {
  43792. var t = this._bindings
  43793. , i = e.binding
  43794. , n = i.rootNode.uuid
  43795. , r = i.path
  43796. , o = this._bindingsByRootAndName
  43797. , a = o[n]
  43798. , s = t[t.length - 1]
  43799. , l = e._cacheIndex;
  43800. s._cacheIndex = l,
  43801. t[l] = s,
  43802. t.pop(),
  43803. delete a[r];
  43804. e: {
  43805. for (var c in a)
  43806. break e;
  43807. delete o[n]
  43808. }
  43809. },
  43810. _lendBinding: function(e) {
  43811. var t = this._bindings
  43812. , i = e._cacheIndex
  43813. , n = this._nActiveBindings++
  43814. , r = t[n];
  43815. e._cacheIndex = n,
  43816. t[n] = e,
  43817. r._cacheIndex = i,
  43818. t[i] = r
  43819. },
  43820. _takeBackBinding: function(e) {
  43821. var t = this._bindings
  43822. , i = e._cacheIndex
  43823. , n = --this._nActiveBindings
  43824. , r = t[n];
  43825. e._cacheIndex = n,
  43826. t[n] = e,
  43827. r._cacheIndex = i,
  43828. t[i] = r
  43829. },
  43830. _lendControlInterpolant: function() {
  43831. var e = this._controlInterpolants
  43832. , t = this._nActiveControlInterpolants++
  43833. , i = e[t];
  43834. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  43835. i.__cacheIndex = t,
  43836. e[t] = i),
  43837. i
  43838. },
  43839. _takeBackControlInterpolant: function(e) {
  43840. var t = this._controlInterpolants
  43841. , i = e.__cacheIndex
  43842. , n = --this._nActiveControlInterpolants
  43843. , r = t[n];
  43844. e.__cacheIndex = n,
  43845. t[n] = e,
  43846. r.__cacheIndex = i,
  43847. t[i] = r
  43848. },
  43849. _controlInterpolantsResultBuffer: new Float32Array(1)
  43850. }),
  43851. n.AnimationObjectGroup = function(e) {
  43852. this.uuid = n.Math.generateUUID(),
  43853. this._objects = Array.prototype.slice.call(arguments),
  43854. this.nCachedObjects_ = 0;
  43855. var t = {};
  43856. this._indicesByUUID = t;
  43857. for (var i = 0, r = arguments.length; i !== r; ++i)
  43858. t[arguments[i].uuid] = i;
  43859. this._paths = [],
  43860. this._parsedPaths = [],
  43861. this._bindings = [],
  43862. this._bindingsIndicesByPath = {};
  43863. var o = this;
  43864. this.stats = {
  43865. objects: {
  43866. get total() {
  43867. return o._objects.length
  43868. },
  43869. get inUse() {
  43870. return this.total - o.nCachedObjects_
  43871. }
  43872. },
  43873. get bindingsPerObject() {
  43874. return o._bindings.length
  43875. }
  43876. }
  43877. }
  43878. ,
  43879. n.AnimationObjectGroup.prototype = {
  43880. constructor: n.AnimationObjectGroup,
  43881. add: function(e) {
  43882. for (var t = this._objects, i = t.length, r = this.nCachedObjects_, o = this._indicesByUUID, a = this._paths, s = this._parsedPaths, l = this._bindings, c = l.length, h = 0, u = arguments.length; h !== u; ++h) {
  43883. var d = arguments[h]
  43884. , p = d.uuid
  43885. , f = o[p];
  43886. if (void 0 === f) {
  43887. f = i++,
  43888. o[p] = f,
  43889. t.push(d);
  43890. for (var g = 0, m = c; g !== m; ++g)
  43891. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  43892. } else if (f < r) {
  43893. var v = t[f]
  43894. , A = --r
  43895. , y = t[A];
  43896. o[y.uuid] = f,
  43897. t[f] = y,
  43898. o[p] = A,
  43899. t[A] = d;
  43900. for (var g = 0, m = c; g !== m; ++g) {
  43901. var C = l[g]
  43902. , I = C[A]
  43903. , E = C[f];
  43904. C[f] = I,
  43905. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  43906. C[A] = E
  43907. }
  43908. } else
  43909. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43910. }
  43911. this.nCachedObjects_ = r
  43912. },
  43913. remove: function(e) {
  43914. for (var t = this._objects, i = (t.length,
  43915. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43916. var l = arguments[a]
  43917. , c = l.uuid
  43918. , h = n[c];
  43919. if (void 0 !== h && h >= i) {
  43920. var u = i++
  43921. , d = t[u];
  43922. n[d.uuid] = h,
  43923. t[h] = d,
  43924. n[c] = u,
  43925. t[u] = l;
  43926. for (var p = 0, f = o; p !== f; ++p) {
  43927. var g = r[p]
  43928. , m = g[u]
  43929. , v = g[h];
  43930. g[h] = m,
  43931. g[u] = v
  43932. }
  43933. }
  43934. }
  43935. this.nCachedObjects_ = i
  43936. },
  43937. uncache: function(e) {
  43938. 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) {
  43939. var c = arguments[s]
  43940. , h = c.uuid
  43941. , u = r[h];
  43942. if (void 0 !== u)
  43943. if (delete r[h],
  43944. u < n) {
  43945. var d = --n
  43946. , p = t[d]
  43947. , f = --i
  43948. , g = t[f];
  43949. r[p.uuid] = u,
  43950. t[u] = p,
  43951. r[g.uuid] = d,
  43952. t[d] = g,
  43953. t.pop();
  43954. for (var m = 0, v = a; m !== v; ++m) {
  43955. var A = o[m]
  43956. , y = A[d]
  43957. , C = A[f];
  43958. A[u] = y,
  43959. A[d] = C,
  43960. A.pop()
  43961. }
  43962. } else {
  43963. var f = --i
  43964. , g = t[f];
  43965. r[g.uuid] = u,
  43966. t[u] = g,
  43967. t.pop();
  43968. for (var m = 0, v = a; m !== v; ++m) {
  43969. var A = o[m];
  43970. A[u] = A[f],
  43971. A.pop()
  43972. }
  43973. }
  43974. }
  43975. this.nCachedObjects_ = n
  43976. },
  43977. subscribe_: function(e, t) {
  43978. var i = this._bindingsIndicesByPath
  43979. , r = i[e]
  43980. , o = this._bindings;
  43981. if (void 0 !== r)
  43982. return o[r];
  43983. var a = this._paths
  43984. , s = this._parsedPaths
  43985. , l = this._objects
  43986. , c = l.length
  43987. , h = this.nCachedObjects_
  43988. , u = new Array(c);
  43989. r = o.length,
  43990. i[e] = r,
  43991. a.push(e),
  43992. s.push(t),
  43993. o.push(u);
  43994. for (var d = h, p = l.length; d !== p; ++d) {
  43995. var f = l[d];
  43996. u[d] = new n.PropertyBinding(f,e,t)
  43997. }
  43998. return u
  43999. },
  44000. unsubscribe_: function(e) {
  44001. var t = this._bindingsIndicesByPath
  44002. , i = t[e];
  44003. if (void 0 !== i) {
  44004. var n = this._paths
  44005. , r = this._parsedPaths
  44006. , o = this._bindings
  44007. , a = o.length - 1
  44008. , s = o[a]
  44009. , l = e[a];
  44010. t[l] = i,
  44011. o[i] = s,
  44012. o.pop(),
  44013. r[i] = r[a],
  44014. r.pop(),
  44015. n[i] = n[a],
  44016. n.pop()
  44017. }
  44018. }
  44019. },
  44020. n.AnimationUtils = {
  44021. arraySlice: function(e, t, i) {
  44022. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  44023. },
  44024. convertArray: function(e, t, i) {
  44025. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  44026. },
  44027. isTypedArray: function(e) {
  44028. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  44029. },
  44030. getKeyframeOrder: function(e) {
  44031. function t(t, i) {
  44032. return e[t] - e[i]
  44033. }
  44034. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  44035. n[r] = r;
  44036. return n.sort(t),
  44037. n
  44038. },
  44039. sortedArray: function(e, t, i) {
  44040. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  44041. for (var s = i[o] * t, l = 0; l !== t; ++l)
  44042. r[a++] = e[s + l];
  44043. return r
  44044. },
  44045. flattenJSON: function(e, t, i, n) {
  44046. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  44047. o = e[r++];
  44048. if (void 0 !== o) {
  44049. var a = o[n];
  44050. if (void 0 !== a)
  44051. if (Array.isArray(a)) {
  44052. do
  44053. a = o[n],
  44054. void 0 !== a && (t.push(o.time),
  44055. i.push.apply(i, a)),
  44056. o = e[r++];
  44057. while (void 0 !== o)
  44058. } else if (void 0 !== a.toArray) {
  44059. do
  44060. a = o[n],
  44061. void 0 !== a && (t.push(o.time),
  44062. a.toArray(i, i.length)),
  44063. o = e[r++];
  44064. while (void 0 !== o)
  44065. } else
  44066. do
  44067. a = o[n],
  44068. void 0 !== a && (t.push(o.time),
  44069. i.push(a)),
  44070. o = e[r++];
  44071. while (void 0 !== o)
  44072. }
  44073. }
  44074. },
  44075. n.KeyframeTrack = function(e, t, i, r) {
  44076. if (void 0 === e)
  44077. throw new Error("track name is undefined");
  44078. if (void 0 === t || 0 === t.length)
  44079. throw new Error("no keyframes in track named " + e);
  44080. this.name = e,
  44081. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  44082. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  44083. this.setInterpolation(r || this.DefaultInterpolation),
  44084. this.validate(),
  44085. this.optimize()
  44086. }
  44087. ,
  44088. n.KeyframeTrack.prototype = {
  44089. constructor: n.KeyframeTrack,
  44090. TimeBufferType: Float32Array,
  44091. ValueBufferType: Float32Array,
  44092. DefaultInterpolation: n.InterpolateLinear,
  44093. InterpolantFactoryMethodDiscrete: function(e) {
  44094. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  44095. },
  44096. InterpolantFactoryMethodLinear: function(e) {
  44097. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44098. },
  44099. InterpolantFactoryMethodSmooth: function(e) {
  44100. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  44101. },
  44102. setInterpolation: function(e) {
  44103. var t = void 0;
  44104. switch (e) {
  44105. case n.InterpolateDiscrete:
  44106. t = this.InterpolantFactoryMethodDiscrete;
  44107. break;
  44108. case n.InterpolateLinear:
  44109. t = this.InterpolantFactoryMethodLinear;
  44110. break;
  44111. case n.InterpolateSmooth:
  44112. t = this.InterpolantFactoryMethodSmooth
  44113. }
  44114. if (void 0 === t) {
  44115. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  44116. if (void 0 === this.createInterpolant) {
  44117. if (e === this.DefaultInterpolation)
  44118. throw new Error(i);
  44119. this.setInterpolation(this.DefaultInterpolation)
  44120. }
  44121. return void console.warn(i)
  44122. }
  44123. this.createInterpolant = t
  44124. },
  44125. getInterpolation: function() {
  44126. switch (this.createInterpolant) {
  44127. case this.InterpolantFactoryMethodDiscrete:
  44128. return n.InterpolateDiscrete;
  44129. case this.InterpolantFactoryMethodLinear:
  44130. return n.InterpolateLinear;
  44131. case this.InterpolantFactoryMethodSmooth:
  44132. return n.InterpolateSmooth
  44133. }
  44134. },
  44135. getValueSize: function() {
  44136. return this.values.length / this.times.length
  44137. },
  44138. shift: function(e) {
  44139. if (0 !== e)
  44140. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44141. t[i] += e;
  44142. return this
  44143. },
  44144. scale: function(e) {
  44145. if (1 !== e)
  44146. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44147. t[i] *= e;
  44148. return this
  44149. },
  44150. trim: function(e, t) {
  44151. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  44152. ++o;
  44153. for (; a !== -1 && i[a] > t; )
  44154. --a;
  44155. if (++a,
  44156. 0 !== o || a !== r) {
  44157. o >= a && (a = Math.max(a, 1),
  44158. o = a - 1);
  44159. var s = this.getValueSize();
  44160. this.times = n.AnimationUtils.arraySlice(i, o, a),
  44161. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  44162. }
  44163. return this
  44164. },
  44165. validate: function() {
  44166. var e = !0
  44167. , t = this.getValueSize();
  44168. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  44169. e = !1);
  44170. var i = this.times
  44171. , r = this.values
  44172. , o = i.length;
  44173. 0 === o && (console.error("track is empty", this),
  44174. e = !1);
  44175. for (var a = null, s = 0; s !== o; s++) {
  44176. var l = i[s];
  44177. if ("number" == typeof l && isNaN(l)) {
  44178. console.error("time is not a valid number", this, s, l),
  44179. e = !1;
  44180. break
  44181. }
  44182. if (null !== a && a > l) {
  44183. console.error("out of order keys", this, s, l, a),
  44184. e = !1;
  44185. break
  44186. }
  44187. a = l
  44188. }
  44189. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  44190. for (var s = 0, c = r.length; s !== c; ++s) {
  44191. var h = r[s];
  44192. if (isNaN(h)) {
  44193. console.error("value is not a valid number", this, s, h),
  44194. e = !1;
  44195. break
  44196. }
  44197. }
  44198. return e
  44199. },
  44200. optimize: function() {
  44201. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  44202. var s = !1
  44203. , l = e[o]
  44204. , c = e[o + 1];
  44205. if (l !== c && (1 !== o || l !== l[0]))
  44206. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  44207. var f = t[h + p];
  44208. if (f !== t[u + p] || f !== t[d + p]) {
  44209. s = !0;
  44210. break
  44211. }
  44212. }
  44213. if (s) {
  44214. if (o !== r) {
  44215. e[r] = e[o];
  44216. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  44217. t[m + p] = t[g + p]
  44218. }
  44219. ++r
  44220. }
  44221. }
  44222. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  44223. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  44224. this
  44225. }
  44226. },
  44227. Object.assign(n.KeyframeTrack, {
  44228. parse: function(e) {
  44229. if (void 0 === e.type)
  44230. throw new Error("track type undefined, can not parse");
  44231. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44232. if (void 0 === e.times) {
  44233. console.warn("legacy JSON format detected, converting");
  44234. var i = []
  44235. , r = [];
  44236. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  44237. e.times = i,
  44238. e.values = r
  44239. }
  44240. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44241. },
  44242. toJSON: function(e) {
  44243. var t, i = e.constructor;
  44244. if (void 0 !== i.toJSON)
  44245. t = i.toJSON(e);
  44246. else {
  44247. t = {
  44248. name: e.name,
  44249. times: n.AnimationUtils.convertArray(e.times, Array),
  44250. values: n.AnimationUtils.convertArray(e.values, Array)
  44251. };
  44252. var r = e.getInterpolation();
  44253. r !== e.DefaultInterpolation && (t.interpolation = r)
  44254. }
  44255. return t.type = e.ValueTypeName,
  44256. t
  44257. },
  44258. _getTrackTypeForValueTypeName: function(e) {
  44259. switch (e.toLowerCase()) {
  44260. case "scalar":
  44261. case "double":
  44262. case "float":
  44263. case "number":
  44264. case "integer":
  44265. return n.NumberKeyframeTrack;
  44266. case "vector":
  44267. case "vector2":
  44268. case "vector3":
  44269. case "vector4":
  44270. return n.VectorKeyframeTrack;
  44271. case "color":
  44272. return n.ColorKeyframeTrack;
  44273. case "quaternion":
  44274. return n.QuaternionKeyframeTrack;
  44275. case "bool":
  44276. case "boolean":
  44277. return n.BooleanKeyframeTrack;
  44278. case "string":
  44279. return n.StringKeyframeTrack
  44280. }
  44281. throw new Error("Unsupported typeName: " + e)
  44282. }
  44283. }),
  44284. n.PropertyBinding = function(e, t, i) {
  44285. this.path = t,
  44286. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  44287. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44288. this.rootNode = e
  44289. }
  44290. ,
  44291. n.PropertyBinding.prototype = {
  44292. constructor: n.PropertyBinding,
  44293. getValue: function(e, t) {
  44294. this.bind(),
  44295. this.getValue(e, t)
  44296. },
  44297. setValue: function(e, t) {
  44298. this.bind(),
  44299. this.setValue(e, t)
  44300. },
  44301. bind: function() {
  44302. var e = this.node
  44303. , t = this.parsedPath
  44304. , i = t.objectName
  44305. , r = t.propertyName
  44306. , o = t.propertyIndex;
  44307. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44308. this.node = e),
  44309. this.getValue = this._getValue_unavailable,
  44310. this.setValue = this._setValue_unavailable,
  44311. !e)
  44312. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  44313. if (i) {
  44314. var a = t.objectIndex;
  44315. switch (i) {
  44316. case "materials":
  44317. if (!e.material)
  44318. return void console.error(" can not bind to material as node does not have a material", this);
  44319. if (!e.material.materials)
  44320. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44321. e = e.material.materials;
  44322. break;
  44323. case "bones":
  44324. if (!e.skeleton)
  44325. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44326. e = e.skeleton.bones;
  44327. for (var s = 0; s < e.length; s++)
  44328. if (e[s].name === a) {
  44329. a = s;
  44330. break
  44331. }
  44332. break;
  44333. default:
  44334. if (void 0 === e[i])
  44335. return void console.error(" can not bind to objectName of node, undefined", this);
  44336. e = e[i]
  44337. }
  44338. if (void 0 !== a) {
  44339. if (void 0 === e[a])
  44340. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44341. e = e[a]
  44342. }
  44343. }
  44344. var l = e[r];
  44345. if (!l) {
  44346. var c = t.nodeName;
  44347. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  44348. }
  44349. var h = this.Versioning.None;
  44350. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  44351. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  44352. this.targetObject = e);
  44353. var u = this.BindingType.Direct;
  44354. if (void 0 !== o) {
  44355. if ("morphTargetInfluences" === r) {
  44356. if (!e.geometry)
  44357. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44358. if (!e.geometry.morphTargets)
  44359. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44360. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  44361. if (e.geometry.morphTargets[s].name === o) {
  44362. o = s;
  44363. break
  44364. }
  44365. }
  44366. u = this.BindingType.ArrayElement,
  44367. this.resolvedProperty = l,
  44368. this.propertyIndex = o
  44369. } else
  44370. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  44371. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  44372. this.resolvedProperty = l) : this.propertyName = r;
  44373. this.getValue = this.GetterByBindingType[u],
  44374. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  44375. },
  44376. unbind: function() {
  44377. this.node = null,
  44378. this.getValue = this._getValue_unbound,
  44379. this.setValue = this._setValue_unbound
  44380. }
  44381. },
  44382. Object.assign(n.PropertyBinding.prototype, {
  44383. _getValue_unavailable: function() {},
  44384. _setValue_unavailable: function() {},
  44385. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  44386. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  44387. BindingType: {
  44388. Direct: 0,
  44389. EntireArray: 1,
  44390. ArrayElement: 2,
  44391. HasFromToArray: 3
  44392. },
  44393. Versioning: {
  44394. None: 0,
  44395. NeedsUpdate: 1,
  44396. MatrixWorldNeedsUpdate: 2
  44397. },
  44398. GetterByBindingType: [function(e, t) {
  44399. e[t] = this.node[this.propertyName]
  44400. }
  44401. , function(e, t) {
  44402. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44403. e[t++] = i[n]
  44404. }
  44405. , function(e, t) {
  44406. e[t] = this.resolvedProperty[this.propertyIndex]
  44407. }
  44408. , function(e, t) {
  44409. this.resolvedProperty.toArray(e, t)
  44410. }
  44411. ],
  44412. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44413. this.node[this.propertyName] = e[t]
  44414. }
  44415. , function(e, t) {
  44416. this.node[this.propertyName] = e[t],
  44417. this.targetObject.needsUpdate = !0
  44418. }
  44419. , function(e, t) {
  44420. this.node[this.propertyName] = e[t],
  44421. this.targetObject.matrixWorldNeedsUpdate = !0
  44422. }
  44423. ], [function(e, t) {
  44424. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44425. i[n] = e[t++]
  44426. }
  44427. , function(e, t) {
  44428. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44429. i[n] = e[t++];
  44430. this.targetObject.needsUpdate = !0
  44431. }
  44432. , function(e, t) {
  44433. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44434. i[n] = e[t++];
  44435. this.targetObject.matrixWorldNeedsUpdate = !0
  44436. }
  44437. ], [function(e, t) {
  44438. this.resolvedProperty[this.propertyIndex] = e[t]
  44439. }
  44440. , function(e, t) {
  44441. this.resolvedProperty[this.propertyIndex] = e[t],
  44442. this.targetObject.needsUpdate = !0
  44443. }
  44444. , function(e, t) {
  44445. this.resolvedProperty[this.propertyIndex] = e[t],
  44446. this.targetObject.matrixWorldNeedsUpdate = !0
  44447. }
  44448. ], [function(e, t) {
  44449. this.resolvedProperty.fromArray(e, t)
  44450. }
  44451. , function(e, t) {
  44452. this.resolvedProperty.fromArray(e, t),
  44453. this.targetObject.needsUpdate = !0
  44454. }
  44455. , function(e, t) {
  44456. this.resolvedProperty.fromArray(e, t),
  44457. this.targetObject.matrixWorldNeedsUpdate = !0
  44458. }
  44459. ]]
  44460. }),
  44461. n.PropertyBinding.Composite = function(e, t, i) {
  44462. var r = i || n.PropertyBinding.parseTrackName(t);
  44463. this._targetGroup = e,
  44464. this._bindings = e.subscribe_(t, r)
  44465. }
  44466. ,
  44467. n.PropertyBinding.Composite.prototype = {
  44468. constructor: n.PropertyBinding.Composite,
  44469. getValue: function(e, t) {
  44470. this.bind();
  44471. var i = this._targetGroup.nCachedObjects_
  44472. , n = this._bindings[i];
  44473. void 0 !== n && n.getValue(e, t)
  44474. },
  44475. setValue: function(e, t) {
  44476. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44477. i[n].setValue(e, t)
  44478. },
  44479. bind: function() {
  44480. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44481. e[t].bind()
  44482. },
  44483. unbind: function() {
  44484. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44485. e[t].unbind()
  44486. }
  44487. },
  44488. n.PropertyBinding.create = function(e, t, i) {
  44489. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  44490. }
  44491. ,
  44492. n.PropertyBinding.parseTrackName = function(e) {
  44493. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44494. , i = t.exec(e);
  44495. if (!i)
  44496. throw new Error("cannot parse trackName at all: " + e);
  44497. i.index === t.lastIndex && t.lastIndex++;
  44498. var n = {
  44499. nodeName: i[3],
  44500. objectName: i[5],
  44501. objectIndex: i[7],
  44502. propertyName: i[9],
  44503. propertyIndex: i[11]
  44504. };
  44505. if (null === n.propertyName || 0 === n.propertyName.length)
  44506. throw new Error("can not parse propertyName from trackName: " + e);
  44507. return n
  44508. }
  44509. ,
  44510. n.PropertyBinding.findNode = function(e, t) {
  44511. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  44512. return e;
  44513. if (e.skeleton) {
  44514. var i = function(e) {
  44515. for (var i = 0; i < e.bones.length; i++) {
  44516. var n = e.bones[i];
  44517. if (n.name === t)
  44518. return n
  44519. }
  44520. return null
  44521. }
  44522. , n = i(e.skeleton);
  44523. if (n)
  44524. return n
  44525. }
  44526. if (e.children) {
  44527. var r = function(e) {
  44528. for (var i = 0; i < e.length; i++) {
  44529. var n = e[i];
  44530. if (n.name === t || n.uuid === t)
  44531. return n;
  44532. var o = r(n.children);
  44533. if (o)
  44534. return o
  44535. }
  44536. return null
  44537. }
  44538. , o = r(e.children);
  44539. if (o)
  44540. return o
  44541. }
  44542. return null
  44543. }
  44544. ,
  44545. n.PropertyMixer = function(e, t, i) {
  44546. this.binding = e,
  44547. this.valueSize = i;
  44548. var n, r = Float64Array;
  44549. switch (t) {
  44550. case "quaternion":
  44551. n = this._slerp;
  44552. break;
  44553. case "string":
  44554. case "bool":
  44555. r = Array,
  44556. n = this._select;
  44557. break;
  44558. default:
  44559. n = this._lerp
  44560. }
  44561. this.buffer = new r(4 * i),
  44562. this._mixBufferRegion = n,
  44563. this.cumulativeWeight = 0,
  44564. this.useCount = 0,
  44565. this.referenceCount = 0
  44566. }
  44567. ,
  44568. n.PropertyMixer.prototype = {
  44569. constructor: n.PropertyMixer,
  44570. accumulate: function(e, t) {
  44571. var i = this.buffer
  44572. , n = this.valueSize
  44573. , r = e * n + n
  44574. , o = this.cumulativeWeight;
  44575. if (0 === o) {
  44576. for (var a = 0; a !== n; ++a)
  44577. i[r + a] = i[a];
  44578. o = t
  44579. } else {
  44580. o += t;
  44581. var s = t / o;
  44582. this._mixBufferRegion(i, r, 0, s, n)
  44583. }
  44584. this.cumulativeWeight = o
  44585. },
  44586. apply: function(e) {
  44587. var t = this.valueSize
  44588. , i = this.buffer
  44589. , n = e * t + t
  44590. , r = this.cumulativeWeight
  44591. , o = this.binding;
  44592. if (this.cumulativeWeight = 0,
  44593. r < 1) {
  44594. var a = 3 * t;
  44595. this._mixBufferRegion(i, n, a, 1 - r, t)
  44596. }
  44597. for (var s = t, l = t + t; s !== l; ++s)
  44598. if (i[s] !== i[s + t]) {
  44599. o.setValue(i, n);
  44600. break
  44601. }
  44602. },
  44603. saveOriginalState: function() {
  44604. var e = this.binding
  44605. , t = this.buffer
  44606. , i = this.valueSize
  44607. , n = 3 * i;
  44608. e.getValue(t, n);
  44609. for (var r = i, o = n; r !== o; ++r)
  44610. t[r] = t[n + r % i];
  44611. this.cumulativeWeight = 0
  44612. },
  44613. restoreOriginalState: function() {
  44614. var e = 3 * this.valueSize;
  44615. this.binding.setValue(this.buffer, e)
  44616. },
  44617. _select: function(e, t, i, n, r) {
  44618. if (n >= .5)
  44619. for (var o = 0; o !== r; ++o)
  44620. e[t + o] = e[i + o]
  44621. },
  44622. _slerp: function(e, t, i, r, o) {
  44623. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  44624. },
  44625. _lerp: function(e, t, i, n, r) {
  44626. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44627. var s = t + a;
  44628. e[s] = e[s] * o + e[i + a] * n
  44629. }
  44630. }
  44631. },
  44632. n.BooleanKeyframeTrack = function(e, t, i) {
  44633. n.KeyframeTrack.call(this, e, t, i)
  44634. }
  44635. ,
  44636. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44637. constructor: n.BooleanKeyframeTrack,
  44638. ValueTypeName: "bool",
  44639. ValueBufferType: Array,
  44640. DefaultInterpolation: n.IntepolateDiscrete,
  44641. InterpolantFactoryMethodLinear: void 0,
  44642. InterpolantFactoryMethodSmooth: void 0
  44643. }),
  44644. n.NumberKeyframeTrack = function(e, t, i, r) {
  44645. n.KeyframeTrack.call(this, e, t, i, r)
  44646. }
  44647. ,
  44648. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44649. constructor: n.NumberKeyframeTrack,
  44650. ValueTypeName: "number"
  44651. }),
  44652. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  44653. n.KeyframeTrack.call(this, e, t, i, r)
  44654. }
  44655. ,
  44656. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44657. constructor: n.QuaternionKeyframeTrack,
  44658. ValueTypeName: "quaternion",
  44659. DefaultInterpolation: n.InterpolateLinear,
  44660. InterpolantFactoryMethodLinear: function(e) {
  44661. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44662. },
  44663. InterpolantFactoryMethodSmooth: void 0
  44664. }),
  44665. n.StringKeyframeTrack = function(e, t, i, r) {
  44666. n.KeyframeTrack.call(this, e, t, i, r)
  44667. }
  44668. ,
  44669. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44670. constructor: n.StringKeyframeTrack,
  44671. ValueTypeName: "string",
  44672. ValueBufferType: Array,
  44673. DefaultInterpolation: n.IntepolateDiscrete,
  44674. InterpolantFactoryMethodLinear: void 0,
  44675. InterpolantFactoryMethodSmooth: void 0
  44676. }),
  44677. n.VectorKeyframeTrack = function(e, t, i, r) {
  44678. n.KeyframeTrack.call(this, e, t, i, r)
  44679. }
  44680. ,
  44681. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44682. constructor: n.VectorKeyframeTrack,
  44683. ValueTypeName: "vector"
  44684. }),
  44685. n.Audio = function(e) {
  44686. n.Object3D.call(this),
  44687. this.type = "Audio",
  44688. this.context = e.context,
  44689. this.source = this.context.createBufferSource(),
  44690. this.source.onended = this.onEnded.bind(this),
  44691. this.gain = this.context.createGain(),
  44692. this.gain.connect(e.getInput()),
  44693. this.autoplay = !1,
  44694. this.startTime = 0,
  44695. this.playbackRate = 1,
  44696. this.isPlaying = !1,
  44697. this.hasPlaybackControl = !0,
  44698. this.sourceType = "empty",
  44699. this.filter = null
  44700. }
  44701. ,
  44702. n.Audio.prototype = Object.create(n.Object3D.prototype),
  44703. n.Audio.prototype.constructor = n.Audio,
  44704. n.Audio.prototype.getOutput = function() {
  44705. return this.gain
  44706. }
  44707. ,
  44708. n.Audio.prototype.load = function(e) {
  44709. var t = new n.AudioBuffer(this.context);
  44710. return t.load(e),
  44711. this.setBuffer(t),
  44712. this
  44713. }
  44714. ,
  44715. n.Audio.prototype.setNodeSource = function(e) {
  44716. return this.hasPlaybackControl = !1,
  44717. this.sourceType = "audioNode",
  44718. this.source = e,
  44719. this.connect(),
  44720. this
  44721. }
  44722. ,
  44723. n.Audio.prototype.setBuffer = function(e) {
  44724. var t = this;
  44725. return e.onReady(function(e) {
  44726. t.source.buffer = e,
  44727. t.sourceType = "buffer",
  44728. t.autoplay && t.play()
  44729. }),
  44730. this
  44731. }
  44732. ,
  44733. n.Audio.prototype.play = function() {
  44734. if (this.isPlaying === !0)
  44735. return void console.warn("THREE.Audio: Audio is already playing.");
  44736. if (this.hasPlaybackControl === !1)
  44737. return void console.warn("THREE.Audio: this Audio has no playback control.");
  44738. var e = this.context.createBufferSource();
  44739. e.buffer = this.source.buffer,
  44740. e.loop = this.source.loop,
  44741. e.onended = this.source.onended,
  44742. e.start(0, this.startTime),
  44743. e.playbackRate.value = this.playbackRate,
  44744. this.isPlaying = !0,
  44745. this.source = e,
  44746. this.connect()
  44747. }
  44748. ,
  44749. n.Audio.prototype.pause = function() {
  44750. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44751. void (this.startTime = this.context.currentTime))
  44752. }
  44753. ,
  44754. n.Audio.prototype.stop = function() {
  44755. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44756. void (this.startTime = 0))
  44757. }
  44758. ,
  44759. n.Audio.prototype.connect = function() {
  44760. null !== this.filter ? (this.source.connect(this.filter),
  44761. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44762. }
  44763. ,
  44764. n.Audio.prototype.disconnect = function() {
  44765. null !== this.filter ? (this.source.disconnect(this.filter),
  44766. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44767. }
  44768. ,
  44769. n.Audio.prototype.getFilter = function() {
  44770. return this.filter
  44771. }
  44772. ,
  44773. n.Audio.prototype.setFilter = function(e) {
  44774. void 0 === e && (e = null),
  44775. this.isPlaying === !0 ? (this.disconnect(),
  44776. this.filter = e,
  44777. this.connect()) : this.filter = e
  44778. }
  44779. ,
  44780. n.Audio.prototype.setPlaybackRate = function(e) {
  44781. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44782. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  44783. }
  44784. ,
  44785. n.Audio.prototype.getPlaybackRate = function() {
  44786. return this.playbackRate
  44787. }
  44788. ,
  44789. n.Audio.prototype.onEnded = function() {
  44790. this.isPlaying = !1
  44791. }
  44792. ,
  44793. n.Audio.prototype.setLoop = function(e) {
  44794. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44795. }
  44796. ,
  44797. n.Audio.prototype.getLoop = function() {
  44798. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44799. !1) : this.source.loop
  44800. }
  44801. ,
  44802. n.Audio.prototype.setVolume = function(e) {
  44803. this.gain.gain.value = e
  44804. }
  44805. ,
  44806. n.Audio.prototype.getVolume = function() {
  44807. return this.gain.gain.value
  44808. }
  44809. ,
  44810. n.AudioAnalyser = function(e, t) {
  44811. this.analyser = e.context.createAnalyser(),
  44812. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44813. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44814. e.getOutput().connect(this.analyser)
  44815. }
  44816. ,
  44817. n.AudioAnalyser.prototype = {
  44818. constructor: n.AudioAnalyser,
  44819. getData: function() {
  44820. return this.analyser.getByteFrequencyData(this.data),
  44821. this.data
  44822. }
  44823. },
  44824. n.AudioBuffer = function(e) {
  44825. this.context = e,
  44826. this.ready = !1,
  44827. this.readyCallbacks = []
  44828. }
  44829. ,
  44830. n.AudioBuffer.prototype.load = function(e) {
  44831. var t = this
  44832. , i = new XMLHttpRequest;
  44833. return i.open("GET", e, !0),
  44834. i.responseType = "arraybuffer",
  44835. i.onload = function(e) {
  44836. t.context.decodeAudioData(this.response, function(e) {
  44837. t.buffer = e,
  44838. t.ready = !0;
  44839. for (var i = 0; i < t.readyCallbacks.length; i++)
  44840. t.readyCallbacks[i](t.buffer);
  44841. t.readyCallbacks = []
  44842. })
  44843. }
  44844. ,
  44845. i.send(),
  44846. this
  44847. }
  44848. ,
  44849. n.AudioBuffer.prototype.onReady = function(e) {
  44850. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44851. }
  44852. ,
  44853. n.PositionalAudio = function(e) {
  44854. n.Audio.call(this, e),
  44855. this.panner = this.context.createPanner(),
  44856. this.panner.connect(this.gain)
  44857. }
  44858. ,
  44859. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  44860. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  44861. n.PositionalAudio.prototype.getOutput = function() {
  44862. return this.panner
  44863. }
  44864. ,
  44865. n.PositionalAudio.prototype.setRefDistance = function(e) {
  44866. this.panner.refDistance = e
  44867. }
  44868. ,
  44869. n.PositionalAudio.prototype.getRefDistance = function() {
  44870. return this.panner.refDistance
  44871. }
  44872. ,
  44873. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44874. this.panner.rolloffFactor = e
  44875. }
  44876. ,
  44877. n.PositionalAudio.prototype.getRolloffFactor = function() {
  44878. return this.panner.rolloffFactor
  44879. }
  44880. ,
  44881. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  44882. this.panner.distanceModel = e
  44883. }
  44884. ,
  44885. n.PositionalAudio.prototype.getDistanceModel = function() {
  44886. return this.panner.distanceModel
  44887. }
  44888. ,
  44889. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  44890. this.panner.maxDistance = e
  44891. }
  44892. ,
  44893. n.PositionalAudio.prototype.getMaxDistance = function() {
  44894. return this.panner.maxDistance
  44895. }
  44896. ,
  44897. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  44898. var e = new n.Vector3;
  44899. return function(t) {
  44900. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  44901. e.setFromMatrixPosition(this.matrixWorld),
  44902. this.panner.setPosition(e.x, e.y, e.z)
  44903. }
  44904. }(),
  44905. n.AudioListener = function() {
  44906. n.Object3D.call(this),
  44907. this.type = "AudioListener",
  44908. this.context = new (window.AudioContext || window.webkitAudioContext),
  44909. this.gain = this.context.createGain(),
  44910. this.gain.connect(this.context.destination),
  44911. this.filter = null
  44912. }
  44913. ,
  44914. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  44915. n.AudioListener.prototype.constructor = n.AudioListener,
  44916. n.AudioListener.prototype.getInput = function() {
  44917. return this.gain
  44918. }
  44919. ,
  44920. n.AudioListener.prototype.removeFilter = function() {
  44921. null !== this.filter && (this.gain.disconnect(this.filter),
  44922. this.filter.disconnect(this.context.destination),
  44923. this.gain.connect(this.context.destination),
  44924. this.filter = null)
  44925. }
  44926. ,
  44927. n.AudioListener.prototype.setFilter = function(e) {
  44928. null !== this.filter ? (this.gain.disconnect(this.filter),
  44929. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44930. this.filter = e,
  44931. this.gain.connect(this.filter),
  44932. this.filter.connect(this.context.destination)
  44933. }
  44934. ,
  44935. n.AudioListener.prototype.getFilter = function() {
  44936. return this.filter
  44937. }
  44938. ,
  44939. n.AudioListener.prototype.setMasterVolume = function(e) {
  44940. this.gain.gain.value = e
  44941. }
  44942. ,
  44943. n.AudioListener.prototype.getMasterVolume = function() {
  44944. return this.gain.gain.value
  44945. }
  44946. ,
  44947. n.AudioListener.prototype.updateMatrixWorld = function() {
  44948. var e = new n.Vector3
  44949. , t = new n.Quaternion
  44950. , i = new n.Vector3
  44951. , r = new n.Vector3;
  44952. return function(o) {
  44953. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  44954. var a = this.context.listener
  44955. , s = this.up;
  44956. this.matrixWorld.decompose(e, t, i),
  44957. r.set(0, 0, -1).applyQuaternion(t),
  44958. a.setPosition(e.x, e.y, e.z),
  44959. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  44960. }
  44961. }(),
  44962. n.Camera = function() {
  44963. n.Object3D.call(this),
  44964. this.type = "Camera",
  44965. this.matrixWorldInverse = new n.Matrix4,
  44966. this.projectionMatrix = new n.Matrix4
  44967. }
  44968. ,
  44969. n.Camera.prototype = Object.create(n.Object3D.prototype),
  44970. n.Camera.prototype.constructor = n.Camera,
  44971. n.Camera.prototype.getWorldDirection = function() {
  44972. var e = new n.Quaternion;
  44973. return function(t) {
  44974. var i = t || new n.Vector3;
  44975. return this.getWorldQuaternion(e),
  44976. i.set(0, 0, -1).applyQuaternion(e)
  44977. }
  44978. }(),
  44979. n.Camera.prototype.lookAt = function() {
  44980. var e = new n.Matrix4;
  44981. return function(t) {
  44982. e.lookAt(this.position, t, this.up),
  44983. this.quaternion.setFromRotationMatrix(e)
  44984. }
  44985. }(),
  44986. n.Camera.prototype.clone = function() {
  44987. return (new this.constructor).copy(this)
  44988. }
  44989. ,
  44990. n.Camera.prototype.copy = function(e) {
  44991. return n.Object3D.prototype.copy.call(this, e),
  44992. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44993. this.projectionMatrix.copy(e.projectionMatrix),
  44994. this
  44995. }
  44996. ,
  44997. n.CubeCamera = function(e, t, i) {
  44998. n.Object3D.call(this),
  44999. this.type = "CubeCamera";
  45000. var r = 90
  45001. , o = 1
  45002. , a = new n.PerspectiveCamera(r,o,e,t);
  45003. a.up.set(0, -1, 0),
  45004. a.lookAt(new n.Vector3(1,0,0)),
  45005. this.add(a);
  45006. var s = new n.PerspectiveCamera(r,o,e,t);
  45007. s.up.set(0, -1, 0),
  45008. s.lookAt(new n.Vector3(-1,0,0)),
  45009. this.add(s);
  45010. var l = new n.PerspectiveCamera(r,o,e,t);
  45011. l.up.set(0, 0, 1),
  45012. l.lookAt(new n.Vector3(0,1,0)),
  45013. this.add(l);
  45014. var c = new n.PerspectiveCamera(r,o,e,t);
  45015. c.up.set(0, 0, -1),
  45016. c.lookAt(new n.Vector3(0,-1,0)),
  45017. this.add(c);
  45018. var h = new n.PerspectiveCamera(r,o,e,t);
  45019. h.up.set(0, -1, 0),
  45020. h.lookAt(new n.Vector3(0,0,1)),
  45021. this.add(h);
  45022. var u = new n.PerspectiveCamera(r,o,e,t);
  45023. u.up.set(0, -1, 0),
  45024. u.lookAt(new n.Vector3(0,0,-1)),
  45025. this.add(u);
  45026. var d = {
  45027. format: n.RGBFormat,
  45028. magFilter: n.LinearFilter,
  45029. minFilter: n.LinearFilter
  45030. };
  45031. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  45032. this.updateCubeMap = function(e, t) {
  45033. null === this.parent && this.updateMatrixWorld();
  45034. var i = this.renderTarget
  45035. , n = i.texture.generateMipmaps;
  45036. i.texture.generateMipmaps = !1,
  45037. i.activeCubeFace = 0,
  45038. e.render(t, a, i),
  45039. i.activeCubeFace = 1,
  45040. e.render(t, s, i),
  45041. i.activeCubeFace = 2,
  45042. e.render(t, l, i),
  45043. i.activeCubeFace = 3,
  45044. e.render(t, c, i),
  45045. i.activeCubeFace = 4,
  45046. e.render(t, h, i),
  45047. i.texture.generateMipmaps = n,
  45048. i.activeCubeFace = 5,
  45049. e.render(t, u, i),
  45050. e.setRenderTarget(null)
  45051. }
  45052. }
  45053. ,
  45054. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  45055. n.CubeCamera.prototype.constructor = n.CubeCamera,
  45056. n.OrthographicCamera = function(e, t, i, r, o, a) {
  45057. n.Camera.call(this),
  45058. this.type = "OrthographicCamera",
  45059. this.zoom = 1,
  45060. this.left = e,
  45061. this.right = t,
  45062. this.top = i,
  45063. this.bottom = r,
  45064. this.near = void 0 !== o ? o : .1,
  45065. this.far = void 0 !== a ? a : 2e3,
  45066. this.updateProjectionMatrix()
  45067. }
  45068. ,
  45069. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  45070. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  45071. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  45072. var e = (this.right - this.left) / (2 * this.zoom)
  45073. , t = (this.top - this.bottom) / (2 * this.zoom)
  45074. , i = (this.right + this.left) / 2
  45075. , n = (this.top + this.bottom) / 2;
  45076. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  45077. }
  45078. ,
  45079. n.OrthographicCamera.prototype.copy = function(e) {
  45080. return n.Camera.prototype.copy.call(this, e),
  45081. this.left = e.left,
  45082. this.right = e.right,
  45083. this.top = e.top,
  45084. this.bottom = e.bottom,
  45085. this.near = e.near,
  45086. this.far = e.far,
  45087. this.zoom = e.zoom,
  45088. this
  45089. }
  45090. ,
  45091. n.OrthographicCamera.prototype.toJSON = function(e) {
  45092. var t = n.Object3D.prototype.toJSON.call(this, e);
  45093. return t.object.zoom = this.zoom,
  45094. t.object.left = this.left,
  45095. t.object.right = this.right,
  45096. t.object.top = this.top,
  45097. t.object.bottom = this.bottom,
  45098. t.object.near = this.near,
  45099. t.object.far = this.far,
  45100. t
  45101. }
  45102. ,
  45103. n.PerspectiveCamera = function(e, t, i, r) {
  45104. n.Camera.call(this),
  45105. this.type = "PerspectiveCamera",
  45106. this.focalLength = 10,
  45107. this.zoom = 1,
  45108. this.fov = void 0 !== e ? e : 50,
  45109. this.aspect = void 0 !== t ? t : 1,
  45110. this.near = void 0 !== i ? i : .1,
  45111. this.far = void 0 !== r ? r : 2e3,
  45112. this.updateProjectionMatrix()
  45113. }
  45114. ,
  45115. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  45116. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  45117. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  45118. void 0 === t && (t = 24),
  45119. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  45120. this.updateProjectionMatrix()
  45121. }
  45122. ,
  45123. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  45124. this.fullWidth = e,
  45125. this.fullHeight = t,
  45126. this.x = i,
  45127. this.y = n,
  45128. this.width = r,
  45129. this.height = o,
  45130. this.updateProjectionMatrix()
  45131. }
  45132. ,
  45133. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45134. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  45135. if (this.fullWidth) {
  45136. var t = this.fullWidth / this.fullHeight
  45137. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  45138. , r = -i
  45139. , o = t * r
  45140. , a = t * i
  45141. , s = Math.abs(a - o)
  45142. , l = Math.abs(i - r);
  45143. this.projectionMatrix.makeFrustum(o + this.x * s / this.fullWidth, o + (this.x + this.width) * s / this.fullWidth, i - (this.y + this.height) * l / this.fullHeight, i - this.y * l / this.fullHeight, this.near, this.far)
  45144. } else
  45145. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45146. }
  45147. ,
  45148. n.PerspectiveCamera.prototype.copy = function(e) {
  45149. return n.Camera.prototype.copy.call(this, e),
  45150. this.focalLength = e.focalLength,
  45151. this.zoom = e.zoom,
  45152. this.fov = e.fov,
  45153. this.aspect = e.aspect,
  45154. this.near = e.near,
  45155. this.far = e.far,
  45156. this
  45157. }
  45158. ,
  45159. n.PerspectiveCamera.prototype.toJSON = function(e) {
  45160. var t = n.Object3D.prototype.toJSON.call(this, e);
  45161. return t.object.focalLength = this.focalLength,
  45162. t.object.zoom = this.zoom,
  45163. t.object.fov = this.fov,
  45164. t.object.aspect = this.aspect,
  45165. t.object.near = this.near,
  45166. t.object.far = this.far,
  45167. t
  45168. }
  45169. ,
  45170. n.StereoCamera = function() {
  45171. this.type = "StereoCamera",
  45172. this.aspect = 1,
  45173. this.cameraL = new n.PerspectiveCamera,
  45174. this.cameraL.layers.enable(1),
  45175. this.cameraL.matrixAutoUpdate = !1,
  45176. this.cameraR = new n.PerspectiveCamera,
  45177. this.cameraR.layers.enable(2),
  45178. this.cameraR.matrixAutoUpdate = !1
  45179. }
  45180. ,
  45181. n.StereoCamera.prototype = {
  45182. constructor: n.StereoCamera,
  45183. update: function() {
  45184. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  45185. return function(l) {
  45186. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  45187. if (c) {
  45188. e = l.focalLength,
  45189. t = l.fov,
  45190. i = l.aspect * this.aspect,
  45191. r = l.near,
  45192. o = l.far;
  45193. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  45194. s.elements[12] = -p,
  45195. a.elements[12] = p,
  45196. h = -g * i + f,
  45197. u = g * i + f,
  45198. d.elements[0] = 2 * r / (u - h),
  45199. d.elements[8] = (u + h) / (u - h),
  45200. this.cameraL.projectionMatrix.copy(d),
  45201. h = -g * i - f,
  45202. u = g * i - f,
  45203. d.elements[0] = 2 * r / (u - h),
  45204. d.elements[8] = (u + h) / (u - h),
  45205. this.cameraR.projectionMatrix.copy(d)
  45206. }
  45207. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  45208. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  45209. }
  45210. }()
  45211. },
  45212. n.Light = function(e, t) {
  45213. n.Object3D.call(this),
  45214. this.type = "Light",
  45215. this.color = new n.Color(e),
  45216. this.intensity = void 0 !== t ? t : 1,
  45217. this.receiveShadow = void 0
  45218. }
  45219. ,
  45220. n.Light.prototype = Object.create(n.Object3D.prototype),
  45221. n.Light.prototype.constructor = n.Light,
  45222. n.Light.prototype.copy = function(e) {
  45223. return n.Object3D.prototype.copy.call(this, e),
  45224. this.color.copy(e.color),
  45225. this.intensity = e.intensity,
  45226. this
  45227. }
  45228. ,
  45229. n.Light.prototype.toJSON = function(e) {
  45230. var t = n.Object3D.prototype.toJSON.call(this, e);
  45231. return t.object.color = this.color.getHex(),
  45232. t.object.intensity = this.intensity,
  45233. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45234. void 0 !== this.distance && (t.object.distance = this.distance),
  45235. void 0 !== this.angle && (t.object.angle = this.angle),
  45236. void 0 !== this.decay && (t.object.decay = this.decay),
  45237. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45238. t
  45239. }
  45240. ,
  45241. n.LightShadow = function(e) {
  45242. this.camera = e,
  45243. this.bias = 0,
  45244. this.radius = 1,
  45245. this.mapSize = new n.Vector2(512,512),
  45246. this.map = null,
  45247. this.matrix = new n.Matrix4
  45248. }
  45249. ,
  45250. n.LightShadow.prototype = {
  45251. constructor: n.LightShadow,
  45252. copy: function(e) {
  45253. return this.camera = e.camera.clone(),
  45254. this.bias = e.bias,
  45255. this.radius = e.radius,
  45256. this.mapSize.copy(e.mapSize),
  45257. this
  45258. },
  45259. clone: function() {
  45260. return (new this.constructor).copy(this)
  45261. }
  45262. },
  45263. n.AmbientLight = function(e, t) {
  45264. n.Light.call(this, e, t),
  45265. this.type = "AmbientLight",
  45266. this.castShadow = void 0
  45267. }
  45268. ,
  45269. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  45270. n.AmbientLight.prototype.constructor = n.AmbientLight,
  45271. n.DirectionalLight = function(e, t) {
  45272. n.Light.call(this, e, t),
  45273. this.type = "DirectionalLight",
  45274. this.position.set(0, 1, 0),
  45275. this.updateMatrix(),
  45276. this.target = new n.Object3D,
  45277. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  45278. }
  45279. ,
  45280. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  45281. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  45282. n.DirectionalLight.prototype.copy = function(e) {
  45283. return n.Light.prototype.copy.call(this, e),
  45284. this.target = e.target.clone(),
  45285. this.shadow = e.shadow.clone(),
  45286. this
  45287. }
  45288. ,
  45289. n.HemisphereLight = function(e, t, i) {
  45290. n.Light.call(this, e, i),
  45291. this.type = "HemisphereLight",
  45292. this.castShadow = void 0,
  45293. this.position.set(0, 1, 0),
  45294. this.updateMatrix(),
  45295. this.groundColor = new n.Color(t)
  45296. }
  45297. ,
  45298. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  45299. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  45300. n.HemisphereLight.prototype.copy = function(e) {
  45301. return n.Light.prototype.copy.call(this, e),
  45302. this.groundColor.copy(e.groundColor),
  45303. this
  45304. }
  45305. ,
  45306. n.PointLight = function(e, t, i, r) {
  45307. n.Light.call(this, e, t),
  45308. this.type = "PointLight",
  45309. this.distance = void 0 !== i ? i : 0,
  45310. this.decay = void 0 !== r ? r : 1,
  45311. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  45312. }
  45313. ,
  45314. n.PointLight.prototype = Object.create(n.Light.prototype),
  45315. n.PointLight.prototype.constructor = n.PointLight,
  45316. Object.defineProperty(n.PointLight.prototype, "power", {
  45317. get: function() {
  45318. return 4 * this.intensity * Math.PI
  45319. },
  45320. set: function(e) {
  45321. this.intensity = e / (4 * Math.PI)
  45322. }
  45323. }),
  45324. n.PointLight.prototype.copy = function(e) {
  45325. return n.Light.prototype.copy.call(this, e),
  45326. this.distance = e.distance,
  45327. this.decay = e.decay,
  45328. this.shadow = e.shadow.clone(),
  45329. this
  45330. }
  45331. ,
  45332. n.SpotLight = function(e, t, i, r, o, a) {
  45333. n.Light.call(this, e, t),
  45334. this.type = "SpotLight",
  45335. this.position.set(0, 1, 0),
  45336. this.updateMatrix(),
  45337. this.target = new n.Object3D,
  45338. this.distance = void 0 !== i ? i : 0,
  45339. this.angle = void 0 !== r ? r : Math.PI / 3,
  45340. this.penumbra = void 0 !== o ? o : 0,
  45341. this.decay = void 0 !== a ? a : 1,
  45342. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  45343. }
  45344. ,
  45345. n.SpotLight.prototype = Object.create(n.Light.prototype),
  45346. n.SpotLight.prototype.constructor = n.SpotLight,
  45347. Object.defineProperty(n.SpotLight.prototype, "power", {
  45348. get: function() {
  45349. return this.intensity * Math.PI
  45350. },
  45351. set: function(e) {
  45352. this.intensity = e / Math.PI
  45353. }
  45354. }),
  45355. n.SpotLight.prototype.copy = function(e) {
  45356. return n.Light.prototype.copy.call(this, e),
  45357. this.distance = e.distance,
  45358. this.angle = e.angle,
  45359. this.penumbra = e.penumbra,
  45360. this.decay = e.decay,
  45361. this.target = e.target.clone(),
  45362. this.shadow = e.shadow.clone(),
  45363. this
  45364. }
  45365. ,
  45366. n.Cache = {
  45367. enabled: !1,
  45368. files: {},
  45369. add: function(e, t) {
  45370. this.enabled !== !1 && (this.files[e] = t)
  45371. },
  45372. get: function(e) {
  45373. if (this.enabled !== !1)
  45374. return this.files[e]
  45375. },
  45376. remove: function(e) {
  45377. delete this.files[e]
  45378. },
  45379. clear: function() {
  45380. this.files = {}
  45381. }
  45382. },
  45383. n.Loader = function() {
  45384. this.onLoadStart = function() {}
  45385. ,
  45386. this.onLoadProgress = function() {}
  45387. ,
  45388. this.onLoadComplete = function() {}
  45389. }
  45390. ,
  45391. n.Loader.prototype = {
  45392. constructor: n.Loader,
  45393. crossOrigin: void 0,
  45394. extractUrlBase: function(e) {
  45395. var t = e.split("/");
  45396. return 1 === t.length ? "./" : (t.pop(),
  45397. t.join("/") + "/")
  45398. },
  45399. initMaterials: function(e, t, i) {
  45400. for (var n = [], r = 0; r < e.length; ++r)
  45401. n[r] = this.createMaterial(e[r], t, i);
  45402. return n
  45403. },
  45404. createMaterial: function() {
  45405. var e, t, i;
  45406. return function(r, o, a) {
  45407. function s(e, i, r, s, c) {
  45408. var h, u = o + e, d = n.Loader.Handlers.get(u);
  45409. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  45410. h = t.load(u)),
  45411. void 0 !== i && (h.repeat.fromArray(i),
  45412. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  45413. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  45414. void 0 !== r && h.offset.fromArray(r),
  45415. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  45416. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  45417. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  45418. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  45419. void 0 !== c && (h.anisotropy = c);
  45420. var p = n.Math.generateUUID();
  45421. return l[p] = h,
  45422. p
  45423. }
  45424. void 0 === e && (e = new n.Color),
  45425. void 0 === t && (t = new n.TextureLoader),
  45426. void 0 === i && (i = new n.MaterialLoader);
  45427. var l = {}
  45428. , c = {
  45429. uuid: n.Math.generateUUID(),
  45430. type: "MeshLambertMaterial"
  45431. };
  45432. for (var h in r) {
  45433. var u = r[h];
  45434. switch (h) {
  45435. case "DbgColor":
  45436. case "DbgIndex":
  45437. case "opticalDensity":
  45438. case "illumination":
  45439. break;
  45440. case "DbgName":
  45441. c.name = u;
  45442. break;
  45443. case "blending":
  45444. c.blending = n[u];
  45445. break;
  45446. case "colorAmbient":
  45447. case "mapAmbient":
  45448. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  45449. break;
  45450. case "colorDiffuse":
  45451. c.color = e.fromArray(u).getHex();
  45452. break;
  45453. case "colorSpecular":
  45454. c.specular = e.fromArray(u).getHex();
  45455. break;
  45456. case "colorEmissive":
  45457. c.emissive = e.fromArray(u).getHex();
  45458. break;
  45459. case "specularCoef":
  45460. c.shininess = u;
  45461. break;
  45462. case "shading":
  45463. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  45464. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  45465. break;
  45466. case "mapDiffuse":
  45467. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  45468. break;
  45469. case "mapDiffuseRepeat":
  45470. case "mapDiffuseOffset":
  45471. case "mapDiffuseWrap":
  45472. case "mapDiffuseAnisotropy":
  45473. break;
  45474. case "mapLight":
  45475. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  45476. break;
  45477. case "mapLightRepeat":
  45478. case "mapLightOffset":
  45479. case "mapLightWrap":
  45480. case "mapLightAnisotropy":
  45481. break;
  45482. case "mapAO":
  45483. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  45484. break;
  45485. case "mapAORepeat":
  45486. case "mapAOOffset":
  45487. case "mapAOWrap":
  45488. case "mapAOAnisotropy":
  45489. break;
  45490. case "mapBump":
  45491. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  45492. break;
  45493. case "mapBumpScale":
  45494. c.bumpScale = u;
  45495. break;
  45496. case "mapBumpRepeat":
  45497. case "mapBumpOffset":
  45498. case "mapBumpWrap":
  45499. case "mapBumpAnisotropy":
  45500. break;
  45501. case "mapNormal":
  45502. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  45503. break;
  45504. case "mapNormalFactor":
  45505. c.normalScale = [u, u];
  45506. break;
  45507. case "mapNormalRepeat":
  45508. case "mapNormalOffset":
  45509. case "mapNormalWrap":
  45510. case "mapNormalAnisotropy":
  45511. break;
  45512. case "mapSpecular":
  45513. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  45514. break;
  45515. case "mapSpecularRepeat":
  45516. case "mapSpecularOffset":
  45517. case "mapSpecularWrap":
  45518. case "mapSpecularAnisotropy":
  45519. break;
  45520. case "mapAlpha":
  45521. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  45522. break;
  45523. case "mapAlphaRepeat":
  45524. case "mapAlphaOffset":
  45525. case "mapAlphaWrap":
  45526. case "mapAlphaAnisotropy":
  45527. break;
  45528. case "flipSided":
  45529. c.side = n.BackSide;
  45530. break;
  45531. case "doubleSided":
  45532. c.side = n.DoubleSide;
  45533. break;
  45534. case "transparency":
  45535. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45536. c.opacity = u;
  45537. break;
  45538. case "depthTest":
  45539. case "depthWrite":
  45540. case "colorWrite":
  45541. case "opacity":
  45542. case "reflectivity":
  45543. case "transparent":
  45544. case "visible":
  45545. case "wireframe":
  45546. c[h] = u;
  45547. break;
  45548. case "vertexColors":
  45549. u === !0 && (c.vertexColors = n.VertexColors),
  45550. "face" === u && (c.vertexColors = n.FaceColors);
  45551. break;
  45552. default:
  45553. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  45554. }
  45555. }
  45556. return "MeshBasicMaterial" === c.type && delete c.emissive,
  45557. "MeshPhongMaterial" !== c.type && delete c.specular,
  45558. c.opacity < 1 && (c.transparent = !0),
  45559. i.setTextures(l),
  45560. i.parse(c)
  45561. }
  45562. }()
  45563. },
  45564. n.Loader.Handlers = {
  45565. handlers: [],
  45566. add: function(e, t) {
  45567. this.handlers.push(e, t)
  45568. },
  45569. get: function(e) {
  45570. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45571. var r = t[i]
  45572. , o = t[i + 1];
  45573. if (r.test(e))
  45574. return o
  45575. }
  45576. return null
  45577. }
  45578. },
  45579. n.XHRLoader = function(e) {
  45580. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45581. }
  45582. ,
  45583. n.XHRLoader.prototype = {
  45584. constructor: n.XHRLoader,
  45585. load: function(e, t, i, r) {
  45586. void 0 !== this.path && (e = this.path + e);
  45587. var o = this
  45588. , a = n.Cache.get(e);
  45589. if (void 0 !== a)
  45590. return t && setTimeout(function() {
  45591. t(a)
  45592. }, 0),
  45593. a;
  45594. var s = new XMLHttpRequest;
  45595. return s.overrideMimeType("text/plain"),
  45596. s.open("GET", e, !0),
  45597. s.addEventListener("load", function(i) {
  45598. var a = i.target.response;
  45599. n.Cache.add(e, a),
  45600. 200 === this.status ? (t && t(a),
  45601. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45602. t && t(a),
  45603. o.manager.itemEnd(e)) : (r && r(i),
  45604. o.manager.itemError(e))
  45605. }, !1),
  45606. void 0 !== i && s.addEventListener("progress", function(e) {
  45607. i(e)
  45608. }, !1),
  45609. s.addEventListener("error", function(t) {
  45610. r && r(t),
  45611. o.manager.itemError(e)
  45612. }, !1),
  45613. void 0 !== this.responseType && (s.responseType = this.responseType),
  45614. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  45615. s.send(null),
  45616. o.manager.itemStart(e),
  45617. s
  45618. },
  45619. setPath: function(e) {
  45620. this.path = e
  45621. },
  45622. setResponseType: function(e) {
  45623. this.responseType = e
  45624. },
  45625. setWithCredentials: function(e) {
  45626. this.withCredentials = e
  45627. }
  45628. },
  45629. n.FontLoader = function(e) {
  45630. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45631. }
  45632. ,
  45633. n.FontLoader.prototype = {
  45634. constructor: n.FontLoader,
  45635. load: function(e, t, i, r) {
  45636. var o = new n.XHRLoader(this.manager);
  45637. o.load(e, function(e) {
  45638. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  45639. }, i, r)
  45640. }
  45641. },
  45642. n.ImageLoader = function(e) {
  45643. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45644. }
  45645. ,
  45646. n.ImageLoader.prototype = {
  45647. constructor: n.ImageLoader,
  45648. load: function(e, t, i, r) {
  45649. void 0 !== this.path && (e = this.path + e);
  45650. var o = this
  45651. , a = n.Cache.get(e);
  45652. if (void 0 !== a)
  45653. return o.manager.itemStart(e),
  45654. t ? setTimeout(function() {
  45655. t(a),
  45656. o.manager.itemEnd(e)
  45657. }, 0) : o.manager.itemEnd(e),
  45658. a;
  45659. var s = document.createElement("img");
  45660. return s.addEventListener("load", function(i) {
  45661. n.Cache.add(e, this),
  45662. t && t(this),
  45663. o.manager.itemEnd(e)
  45664. }, !1),
  45665. void 0 !== i && s.addEventListener("progress", function(e) {
  45666. i(e)
  45667. }, !1),
  45668. s.addEventListener("error", function(t) {
  45669. r && r(t),
  45670. o.manager.itemError(e)
  45671. }, !1),
  45672. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  45673. o.manager.itemStart(e),
  45674. s.src = e,
  45675. s
  45676. },
  45677. setCrossOrigin: function(e) {
  45678. this.crossOrigin = e
  45679. },
  45680. setPath: function(e) {
  45681. this.path = e
  45682. }
  45683. },
  45684. n.JSONLoader = function(e) {
  45685. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45686. e = void 0),
  45687. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  45688. this.withCredentials = !1
  45689. }
  45690. ,
  45691. n.JSONLoader.prototype = {
  45692. constructor: n.JSONLoader,
  45693. get statusDomElement() {
  45694. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45695. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45696. this._statusDomElement
  45697. },
  45698. load: function(e, t, i, r) {
  45699. var o = this
  45700. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  45701. , s = new n.XHRLoader(this.manager);
  45702. s.setWithCredentials(this.withCredentials),
  45703. s.load(e, function(i) {
  45704. var n = JSON.parse(i)
  45705. , r = n.metadata;
  45706. if (void 0 !== r) {
  45707. var s = r.type;
  45708. if (void 0 !== s) {
  45709. if ("object" === s.toLowerCase())
  45710. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  45711. if ("scene" === s.toLowerCase())
  45712. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  45713. }
  45714. }
  45715. var l = o.parse(n, a);
  45716. t(l.geometry, l.materials)
  45717. }, i, r)
  45718. },
  45719. setTexturePath: function(e) {
  45720. this.texturePath = e
  45721. },
  45722. parse: function(e, t) {
  45723. function i(t) {
  45724. function i(e, t) {
  45725. return e & 1 << t
  45726. }
  45727. var r, o, a, l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M, R, P, O = e.faces, L = e.vertices, D = e.normals, N = e.colors, B = 0;
  45728. if (void 0 !== e.uvs) {
  45729. for (r = 0; r < e.uvs.length; r++)
  45730. e.uvs[r].length && B++;
  45731. for (r = 0; r < B; r++)
  45732. s.faceVertexUvs[r] = []
  45733. }
  45734. for (l = 0,
  45735. c = L.length; l < c; )
  45736. E = new n.Vector3,
  45737. E.x = L[l++] * t,
  45738. E.y = L[l++] * t,
  45739. E.z = L[l++] * t,
  45740. s.vertices.push(E);
  45741. for (l = 0,
  45742. c = O.length; l < c; )
  45743. if (f = O[l++],
  45744. g = i(f, 0),
  45745. m = i(f, 1),
  45746. v = i(f, 3),
  45747. A = i(f, 4),
  45748. y = i(f, 5),
  45749. C = i(f, 6),
  45750. I = i(f, 7),
  45751. g) {
  45752. if (w = new n.Face3,
  45753. w.a = O[l],
  45754. w.b = O[l + 1],
  45755. w.c = O[l + 3],
  45756. _ = new n.Face3,
  45757. _.a = O[l + 1],
  45758. _.b = O[l + 2],
  45759. _.c = O[l + 3],
  45760. l += 4,
  45761. m && (p = O[l++],
  45762. w.materialIndex = p,
  45763. _.materialIndex = p),
  45764. a = s.faces.length,
  45765. v)
  45766. for (r = 0; r < B; r++)
  45767. for (S = e.uvs[r],
  45768. s.faceVertexUvs[r][a] = [],
  45769. s.faceVertexUvs[r][a + 1] = [],
  45770. o = 0; o < 4; o++)
  45771. d = O[l++],
  45772. R = S[2 * d],
  45773. P = S[2 * d + 1],
  45774. M = new n.Vector2(R,P),
  45775. 2 !== o && s.faceVertexUvs[r][a].push(M),
  45776. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  45777. if (A && (u = 3 * O[l++],
  45778. w.normal.set(D[u++], D[u++], D[u]),
  45779. _.normal.copy(w.normal)),
  45780. y)
  45781. for (r = 0; r < 4; r++)
  45782. u = 3 * O[l++],
  45783. x = new n.Vector3(D[u++],D[u++],D[u]),
  45784. 2 !== r && w.vertexNormals.push(x),
  45785. 0 !== r && _.vertexNormals.push(x);
  45786. if (C && (h = O[l++],
  45787. T = N[h],
  45788. w.color.setHex(T),
  45789. _.color.setHex(T)),
  45790. I)
  45791. for (r = 0; r < 4; r++)
  45792. h = O[l++],
  45793. T = N[h],
  45794. 2 !== r && w.vertexColors.push(new n.Color(T)),
  45795. 0 !== r && _.vertexColors.push(new n.Color(T));
  45796. s.faces.push(w),
  45797. s.faces.push(_)
  45798. } else {
  45799. if (b = new n.Face3,
  45800. b.a = O[l++],
  45801. b.b = O[l++],
  45802. b.c = O[l++],
  45803. m && (p = O[l++],
  45804. b.materialIndex = p),
  45805. a = s.faces.length,
  45806. v)
  45807. for (r = 0; r < B; r++)
  45808. for (S = e.uvs[r],
  45809. s.faceVertexUvs[r][a] = [],
  45810. o = 0; o < 3; o++)
  45811. d = O[l++],
  45812. R = S[2 * d],
  45813. P = S[2 * d + 1],
  45814. M = new n.Vector2(R,P),
  45815. s.faceVertexUvs[r][a].push(M);
  45816. if (A && (u = 3 * O[l++],
  45817. b.normal.set(D[u++], D[u++], D[u])),
  45818. y)
  45819. for (r = 0; r < 3; r++)
  45820. u = 3 * O[l++],
  45821. x = new n.Vector3(D[u++],D[u++],D[u]),
  45822. b.vertexNormals.push(x);
  45823. if (C && (h = O[l++],
  45824. b.color.setHex(N[h])),
  45825. I)
  45826. for (r = 0; r < 3; r++)
  45827. h = O[l++],
  45828. b.vertexColors.push(new n.Color(N[h]));
  45829. s.faces.push(b)
  45830. }
  45831. }
  45832. function r() {
  45833. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  45834. if (e.skinWeights)
  45835. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  45836. var o = e.skinWeights[i]
  45837. , a = t > 1 ? e.skinWeights[i + 1] : 0
  45838. , l = t > 2 ? e.skinWeights[i + 2] : 0
  45839. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  45840. s.skinWeights.push(new n.Vector4(o,a,l,c))
  45841. }
  45842. if (e.skinIndices)
  45843. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  45844. var h = e.skinIndices[i]
  45845. , u = t > 1 ? e.skinIndices[i + 1] : 0
  45846. , d = t > 2 ? e.skinIndices[i + 2] : 0
  45847. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  45848. s.skinIndices.push(new n.Vector4(h,u,d,p))
  45849. }
  45850. s.bones = e.bones,
  45851. s.bones && s.bones.length > 0 && (s.skinWeights.length !== s.skinIndices.length || s.skinIndices.length !== s.vertices.length) && console.warn("When skinning, number of vertices (" + s.vertices.length + "), skinIndices (" + s.skinIndices.length + "), and skinWeights (" + s.skinWeights.length + ") should match.")
  45852. }
  45853. function o(t) {
  45854. if (void 0 !== e.morphTargets)
  45855. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  45856. s.morphTargets[i] = {},
  45857. s.morphTargets[i].name = e.morphTargets[i].name,
  45858. s.morphTargets[i].vertices = [];
  45859. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  45860. var h = new n.Vector3;
  45861. h.x = a[l] * t,
  45862. h.y = a[l + 1] * t,
  45863. h.z = a[l + 2] * t,
  45864. o.push(h)
  45865. }
  45866. }
  45867. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  45868. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45869. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  45870. u[i].color.fromArray(d, 3 * i)
  45871. }
  45872. }
  45873. function a() {
  45874. var t = []
  45875. , i = [];
  45876. void 0 !== e.animation && i.push(e.animation),
  45877. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  45878. for (var r = 0; r < i.length; r++) {
  45879. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  45880. o && t.push(o)
  45881. }
  45882. if (s.morphTargets) {
  45883. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  45884. t = t.concat(a)
  45885. }
  45886. t.length > 0 && (s.animations = t)
  45887. }
  45888. var s = new n.Geometry
  45889. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  45890. if (i(l),
  45891. r(),
  45892. o(l),
  45893. a(),
  45894. s.computeFaceNormals(),
  45895. s.computeBoundingSphere(),
  45896. void 0 === e.materials || 0 === e.materials.length)
  45897. return {
  45898. geometry: s
  45899. };
  45900. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  45901. return {
  45902. geometry: s,
  45903. materials: c
  45904. }
  45905. }
  45906. },
  45907. n.LoadingManager = function(e, t, i) {
  45908. var n = this
  45909. , r = !1
  45910. , o = 0
  45911. , a = 0;
  45912. this.onStart = void 0,
  45913. this.onLoad = e,
  45914. this.onProgress = t,
  45915. this.onError = i,
  45916. this.itemStart = function(e) {
  45917. a++,
  45918. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  45919. r = !0
  45920. }
  45921. ,
  45922. this.itemEnd = function(e) {
  45923. o++,
  45924. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45925. o === a && (r = !1,
  45926. void 0 !== n.onLoad && n.onLoad())
  45927. }
  45928. ,
  45929. this.itemError = function(e) {
  45930. void 0 !== n.onError && n.onError(e)
  45931. }
  45932. }
  45933. ,
  45934. n.DefaultLoadingManager = new n.LoadingManager,
  45935. n.BufferGeometryLoader = function(e) {
  45936. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45937. }
  45938. ,
  45939. n.BufferGeometryLoader.prototype = {
  45940. constructor: n.BufferGeometryLoader,
  45941. load: function(e, t, i, r) {
  45942. var o = this
  45943. , a = new n.XHRLoader(o.manager);
  45944. a.load(e, function(e) {
  45945. t(o.parse(JSON.parse(e)))
  45946. }, i, r)
  45947. },
  45948. parse: function(e) {
  45949. var t = new n.BufferGeometry
  45950. , i = e.data.index
  45951. , r = {
  45952. Int8Array: Int8Array,
  45953. Uint8Array: Uint8Array,
  45954. Uint8ClampedArray: Uint8ClampedArray,
  45955. Int16Array: Int16Array,
  45956. Uint16Array: Uint16Array,
  45957. Int32Array: Int32Array,
  45958. Uint32Array: Uint32Array,
  45959. Float32Array: Float32Array,
  45960. Float64Array: Float64Array
  45961. };
  45962. if (void 0 !== i) {
  45963. var o = new r[i.type](i.array);
  45964. t.setIndex(new n.BufferAttribute(o,1))
  45965. }
  45966. var a = e.data.attributes;
  45967. for (var s in a) {
  45968. var l = a[s]
  45969. , o = new r[l.type](l.array);
  45970. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  45971. }
  45972. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  45973. if (void 0 !== c)
  45974. for (var h = 0, u = c.length; h !== u; ++h) {
  45975. var d = c[h];
  45976. t.addGroup(d.start, d.count, d.materialIndex)
  45977. }
  45978. var p = e.data.boundingSphere;
  45979. if (void 0 !== p) {
  45980. var f = new n.Vector3;
  45981. void 0 !== p.center && f.fromArray(p.center),
  45982. t.boundingSphere = new n.Sphere(f,p.radius)
  45983. }
  45984. return t
  45985. }
  45986. },
  45987. n.MaterialLoader = function(e) {
  45988. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  45989. this.textures = {}
  45990. }
  45991. ,
  45992. n.MaterialLoader.prototype = {
  45993. constructor: n.MaterialLoader,
  45994. load: function(e, t, i, r) {
  45995. var o = this
  45996. , a = new n.XHRLoader(o.manager);
  45997. a.load(e, function(e) {
  45998. t(o.parse(JSON.parse(e)))
  45999. }, i, r)
  46000. },
  46001. setTextures: function(e) {
  46002. this.textures = e
  46003. },
  46004. getTexture: function(e) {
  46005. var t = this.textures;
  46006. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  46007. t[e]
  46008. },
  46009. parse: function(e) {
  46010. var t = new n[e.type];
  46011. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  46012. void 0 !== e.name && (t.name = e.name),
  46013. void 0 !== e.color && t.color.setHex(e.color),
  46014. void 0 !== e.roughness && (t.roughness = e.roughness),
  46015. void 0 !== e.metalness && (t.metalness = e.metalness),
  46016. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  46017. void 0 !== e.specular && t.specular.setHex(e.specular),
  46018. void 0 !== e.shininess && (t.shininess = e.shininess),
  46019. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  46020. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  46021. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  46022. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  46023. void 0 !== e.shading && (t.shading = e.shading),
  46024. void 0 !== e.blending && (t.blending = e.blending),
  46025. void 0 !== e.side && (t.side = e.side),
  46026. void 0 !== e.opacity && (t.opacity = e.opacity),
  46027. void 0 !== e.transparent && (t.transparent = e.transparent),
  46028. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  46029. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  46030. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  46031. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  46032. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  46033. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  46034. void 0 !== e.size && (t.size = e.size),
  46035. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  46036. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  46037. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  46038. t.transparent = !0),
  46039. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  46040. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  46041. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  46042. void 0 !== e.normalScale) {
  46043. var i = e.normalScale;
  46044. Array.isArray(i) === !1 && (i = [i, i]),
  46045. t.normalScale = (new n.Vector2).fromArray(i)
  46046. }
  46047. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  46048. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  46049. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  46050. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  46051. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  46052. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  46053. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  46054. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  46055. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  46056. t.combine = n.MultiplyOperation),
  46057. e.reflectivity && (t.reflectivity = e.reflectivity),
  46058. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  46059. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  46060. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  46061. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  46062. void 0 !== e.materials)
  46063. for (var r = 0, o = e.materials.length; r < o; r++)
  46064. t.materials.push(this.parse(e.materials[r]));
  46065. return t
  46066. }
  46067. },
  46068. n.ObjectLoader = function(e) {
  46069. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46070. this.texturePath = ""
  46071. }
  46072. ,
  46073. n.ObjectLoader.prototype = {
  46074. constructor: n.ObjectLoader,
  46075. load: function(e, t, i, r) {
  46076. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  46077. var o = this
  46078. , a = new n.XHRLoader(o.manager);
  46079. a.load(e, function(e) {
  46080. o.parse(JSON.parse(e), t)
  46081. }, i, r)
  46082. },
  46083. setTexturePath: function(e) {
  46084. this.texturePath = e
  46085. },
  46086. setCrossOrigin: function(e) {
  46087. this.crossOrigin = e
  46088. },
  46089. parse: function(e, t) {
  46090. var i = this.parseGeometries(e.geometries)
  46091. , n = this.parseImages(e.images, function() {
  46092. void 0 !== t && t(a)
  46093. })
  46094. , r = this.parseTextures(e.textures, n)
  46095. , o = this.parseMaterials(e.materials, r)
  46096. , a = this.parseObject(e.object, i, o);
  46097. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  46098. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  46099. a
  46100. },
  46101. parseGeometries: function(e) {
  46102. var t = {};
  46103. if (void 0 !== e)
  46104. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  46105. var s, l = e[o];
  46106. switch (l.type) {
  46107. case "PlaneGeometry":
  46108. case "PlaneBufferGeometry":
  46109. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  46110. break;
  46111. case "BoxGeometry":
  46112. case "BoxBufferGeometry":
  46113. case "CubeGeometry":
  46114. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  46115. break;
  46116. case "CircleGeometry":
  46117. case "CircleBufferGeometry":
  46118. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  46119. break;
  46120. case "CylinderGeometry":
  46121. case "CylinderBufferGeometry":
  46122. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  46123. break;
  46124. case "SphereGeometry":
  46125. case "SphereBufferGeometry":
  46126. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  46127. break;
  46128. case "DodecahedronGeometry":
  46129. s = new n.DodecahedronGeometry(l.radius,l.detail);
  46130. break;
  46131. case "IcosahedronGeometry":
  46132. s = new n.IcosahedronGeometry(l.radius,l.detail);
  46133. break;
  46134. case "OctahedronGeometry":
  46135. s = new n.OctahedronGeometry(l.radius,l.detail);
  46136. break;
  46137. case "TetrahedronGeometry":
  46138. s = new n.TetrahedronGeometry(l.radius,l.detail);
  46139. break;
  46140. case "RingGeometry":
  46141. case "RingBufferGeometry":
  46142. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  46143. break;
  46144. case "TorusGeometry":
  46145. case "TorusBufferGeometry":
  46146. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  46147. break;
  46148. case "TorusKnotGeometry":
  46149. case "TorusKnotBufferGeometry":
  46150. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  46151. break;
  46152. case "LatheGeometry":
  46153. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  46154. break;
  46155. case "BufferGeometry":
  46156. s = r.parse(l);
  46157. break;
  46158. case "Geometry":
  46159. s = i.parse(l.data, this.texturePath).geometry;
  46160. break;
  46161. default:
  46162. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  46163. continue
  46164. }
  46165. s.uuid = l.uuid,
  46166. void 0 !== l.name && (s.name = l.name),
  46167. t[l.uuid] = s
  46168. }
  46169. return t
  46170. },
  46171. parseMaterials: function(e, t) {
  46172. var i = {};
  46173. if (void 0 !== e) {
  46174. var r = new n.MaterialLoader;
  46175. r.setTextures(t);
  46176. for (var o = 0, a = e.length; o < a; o++) {
  46177. var s = r.parse(e[o]);
  46178. i[s.uuid] = s
  46179. }
  46180. }
  46181. return i
  46182. },
  46183. parseAnimations: function(e) {
  46184. for (var t = [], i = 0; i < e.length; i++) {
  46185. var r = n.AnimationClip.parse(e[i]);
  46186. t.push(r)
  46187. }
  46188. return t
  46189. },
  46190. parseImages: function(e, t) {
  46191. function i(e) {
  46192. return r.manager.itemStart(e),
  46193. s.load(e, function() {
  46194. r.manager.itemEnd(e)
  46195. })
  46196. }
  46197. var r = this
  46198. , o = {};
  46199. if (void 0 !== e && e.length > 0) {
  46200. var a = new n.LoadingManager(t)
  46201. , s = new n.ImageLoader(a);
  46202. s.setCrossOrigin(this.crossOrigin);
  46203. for (var l = 0, c = e.length; l < c; l++) {
  46204. var h = e[l]
  46205. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  46206. o[h.uuid] = i(u)
  46207. }
  46208. }
  46209. return o
  46210. },
  46211. parseTextures: function(e, t) {
  46212. function i(e) {
  46213. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46214. n[e])
  46215. }
  46216. var r = {};
  46217. if (void 0 !== e)
  46218. for (var o = 0, a = e.length; o < a; o++) {
  46219. var s = e[o];
  46220. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  46221. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  46222. var l = new n.Texture(t[s.image]);
  46223. l.needsUpdate = !0,
  46224. l.uuid = s.uuid,
  46225. void 0 !== s.name && (l.name = s.name),
  46226. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  46227. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  46228. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  46229. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  46230. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  46231. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  46232. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  46233. l.wrapT = i(s.wrap[1])),
  46234. r[s.uuid] = l
  46235. }
  46236. return r
  46237. },
  46238. parseObject: function() {
  46239. var e = new n.Matrix4;
  46240. return function(t, i, r) {
  46241. function o(e) {
  46242. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46243. i[e]
  46244. }
  46245. function a(e) {
  46246. if (void 0 !== e)
  46247. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46248. r[e]
  46249. }
  46250. var s;
  46251. switch (t.type) {
  46252. case "Scene":
  46253. s = new n.Scene;
  46254. break;
  46255. case "PerspectiveCamera":
  46256. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  46257. break;
  46258. case "OrthographicCamera":
  46259. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  46260. break;
  46261. case "AmbientLight":
  46262. s = new n.AmbientLight(t.color,t.intensity);
  46263. break;
  46264. case "DirectionalLight":
  46265. s = new n.DirectionalLight(t.color,t.intensity);
  46266. break;
  46267. case "PointLight":
  46268. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  46269. break;
  46270. case "SpotLight":
  46271. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  46272. break;
  46273. case "HemisphereLight":
  46274. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  46275. break;
  46276. case "Mesh":
  46277. var l = o(t.geometry)
  46278. , c = a(t.material);
  46279. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  46280. break;
  46281. case "LOD":
  46282. s = new n.LOD;
  46283. break;
  46284. case "Line":
  46285. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  46286. break;
  46287. case "PointCloud":
  46288. case "Points":
  46289. s = new n.Points(o(t.geometry),a(t.material));
  46290. break;
  46291. case "Sprite":
  46292. s = new n.Sprite(a(t.material));
  46293. break;
  46294. case "Group":
  46295. s = new n.Group;
  46296. break;
  46297. default:
  46298. s = new n.Object3D
  46299. }
  46300. if (s.uuid = t.uuid,
  46301. void 0 !== t.name && (s.name = t.name),
  46302. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  46303. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  46304. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  46305. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  46306. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  46307. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  46308. void 0 !== t.visible && (s.visible = t.visible),
  46309. void 0 !== t.userData && (s.userData = t.userData),
  46310. void 0 !== t.children)
  46311. for (var h in t.children)
  46312. s.add(this.parseObject(t.children[h], i, r));
  46313. if ("LOD" === t.type)
  46314. for (var u = t.levels, d = 0; d < u.length; d++) {
  46315. var p = u[d]
  46316. , h = s.getObjectByProperty("uuid", p.object);
  46317. void 0 !== h && s.addLevel(h, p.distance)
  46318. }
  46319. return s
  46320. }
  46321. }()
  46322. },
  46323. n.TextureLoader = function(e) {
  46324. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46325. }
  46326. ,
  46327. n.TextureLoader.prototype = {
  46328. constructor: n.TextureLoader,
  46329. load: function(e, t, i, r) {
  46330. var o = new n.Texture
  46331. , a = new n.ImageLoader(this.manager);
  46332. return a.setCrossOrigin(this.crossOrigin),
  46333. a.setPath(this.path),
  46334. a.load(e, function(e) {
  46335. o.image = e,
  46336. o.needsUpdate = !0,
  46337. void 0 !== t && t(o)
  46338. }, i, r),
  46339. o
  46340. },
  46341. setCrossOrigin: function(e) {
  46342. this.crossOrigin = e
  46343. },
  46344. setPath: function(e) {
  46345. this.path = e
  46346. }
  46347. },
  46348. n.CubeTextureLoader = function(e) {
  46349. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46350. }
  46351. ,
  46352. n.CubeTextureLoader.prototype = {
  46353. constructor: n.CubeTextureLoader,
  46354. load: function(e, t, i, r) {
  46355. function o(i) {
  46356. s.load(e[i], function(e) {
  46357. a.images[i] = e,
  46358. l++,
  46359. 6 === l && (a.needsUpdate = !0,
  46360. t && t(a))
  46361. }, void 0, r)
  46362. }
  46363. var a = new n.CubeTexture
  46364. , s = new n.ImageLoader(this.manager);
  46365. s.setCrossOrigin(this.crossOrigin),
  46366. s.setPath(this.path);
  46367. for (var l = 0, c = 0; c < e.length; ++c)
  46368. o(c);
  46369. return a
  46370. },
  46371. setCrossOrigin: function(e) {
  46372. this.crossOrigin = e
  46373. },
  46374. setPath: function(e) {
  46375. this.path = e
  46376. }
  46377. },
  46378. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  46379. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46380. this._parser = null
  46381. }
  46382. ,
  46383. n.BinaryTextureLoader.prototype = {
  46384. constructor: n.BinaryTextureLoader,
  46385. load: function(e, t, i, r) {
  46386. var o = this
  46387. , a = new n.DataTexture
  46388. , s = new n.XHRLoader(this.manager);
  46389. return s.setResponseType("arraybuffer"),
  46390. s.load(e, function(e) {
  46391. var i = o._parser(e);
  46392. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  46393. a.image.height = i.height,
  46394. a.image.data = i.data),
  46395. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  46396. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  46397. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  46398. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  46399. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  46400. void 0 !== i.format && (a.format = i.format),
  46401. void 0 !== i.type && (a.type = i.type),
  46402. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  46403. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  46404. a.needsUpdate = !0,
  46405. t && t(a, i))
  46406. }, i, r),
  46407. a
  46408. }
  46409. },
  46410. n.CompressedTextureLoader = function(e) {
  46411. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46412. this._parser = null
  46413. }
  46414. ;
  46415. n.CompressedTextureLoader.prototype = {
  46416. constructor: n.CompressedTextureLoader,
  46417. load: function(e, t, i, r) {
  46418. function o(o) {
  46419. c.load(e[o], function(e) {
  46420. var i = a._parser(e, !0);
  46421. s[o] = {
  46422. width: i.width,
  46423. height: i.height,
  46424. format: i.format,
  46425. mipmaps: i.mipmaps
  46426. },
  46427. h += 1,
  46428. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  46429. l.format = i.format,
  46430. l.needsUpdate = !0,
  46431. t && t(l))
  46432. }, i, r)
  46433. }
  46434. var a = this
  46435. , s = []
  46436. , l = new n.CompressedTexture;
  46437. l.image = s;
  46438. var c = new n.XHRLoader(this.manager);
  46439. if (c.setPath(this.path),
  46440. c.setResponseType("arraybuffer"),
  46441. Array.isArray(e))
  46442. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  46443. o(u);
  46444. else
  46445. c.load(e, function(e) {
  46446. var i = a._parser(e, !0);
  46447. if (i.isCubemap)
  46448. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  46449. s[o] = {
  46450. mipmaps: []
  46451. };
  46452. for (var c = 0; c < i.mipmapCount; c++)
  46453. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  46454. s[o].format = i.format,
  46455. s[o].width = i.width,
  46456. s[o].height = i.height
  46457. }
  46458. else
  46459. l.image.width = i.width,
  46460. l.image.height = i.height,
  46461. l.mipmaps = i.mipmaps;
  46462. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  46463. l.format = i.format,
  46464. l.needsUpdate = !0,
  46465. t && t(l)
  46466. }, i, r);
  46467. return l
  46468. },
  46469. setPath: function(e) {
  46470. this.path = e
  46471. }
  46472. };
  46473. n.Material = function() {
  46474. Object.defineProperty(this, "id", {
  46475. value: n.MaterialIdCount++
  46476. }),
  46477. this.uuid = n.Math.generateUUID(),
  46478. this.name = "",
  46479. this.type = "Material",
  46480. this.side = n.FrontSide,
  46481. this.opacity = 1,
  46482. this.transparent = !1,
  46483. this.blending = n.NormalBlending,
  46484. this.blendSrc = n.SrcAlphaFactor,
  46485. this.blendDst = n.OneMinusSrcAlphaFactor,
  46486. this.blendEquation = n.AddEquation,
  46487. this.blendSrcAlpha = null,
  46488. this.blendDstAlpha = null,
  46489. this.blendEquationAlpha = null,
  46490. this.depthFunc = n.LessEqualDepth,
  46491. this.depthTest = !0,
  46492. this.depthWrite = !0,
  46493. this.colorWrite = !0,
  46494. this.precision = null,
  46495. this.polygonOffset = !1,
  46496. this.polygonOffsetFactor = 0,
  46497. this.polygonOffsetUnits = 0,
  46498. this.alphaTest = 0,
  46499. this.premultipliedAlpha = !1,
  46500. this.overdraw = 0,
  46501. this.visible = !0,
  46502. this._needsUpdate = !0
  46503. }
  46504. ,
  46505. n.Material.prototype = {
  46506. constructor: n.Material,
  46507. get needsUpdate() {
  46508. return this._needsUpdate
  46509. },
  46510. set needsUpdate(e) {
  46511. e === !0 && this.update(),
  46512. this._needsUpdate = e
  46513. },
  46514. setValues: function(e) {
  46515. if (void 0 !== e)
  46516. for (var t in e) {
  46517. var i = e[t];
  46518. if (void 0 !== i) {
  46519. var r = this[t];
  46520. void 0 !== r ? r instanceof n.Color ? r.set(i) : r instanceof n.Vector3 && i instanceof n.Vector3 ? r.copy(i) : "overdraw" === t ? this[t] = Number(i) : this[t] = i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  46521. } else
  46522. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46523. }
  46524. },
  46525. toJSON: function(e) {
  46526. function t(e) {
  46527. var t = [];
  46528. for (var i in e) {
  46529. var n = e[i];
  46530. delete n.metadata,
  46531. t.push(n)
  46532. }
  46533. return t
  46534. }
  46535. var i = void 0 === e;
  46536. i && (e = {
  46537. textures: {},
  46538. images: {}
  46539. });
  46540. var r = {
  46541. metadata: {
  46542. version: 4.4,
  46543. type: "Material",
  46544. generator: "Material.toJSON"
  46545. }
  46546. };
  46547. if (r.uuid = this.uuid,
  46548. r.type = this.type,
  46549. "" !== this.name && (r.name = this.name),
  46550. this.color instanceof n.Color && (r.color = this.color.getHex()),
  46551. .5 !== this.roughness && (r.roughness = this.roughness),
  46552. .5 !== this.metalness && (r.metalness = this.metalness),
  46553. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  46554. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  46555. void 0 !== this.shininess && (r.shininess = this.shininess),
  46556. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  46557. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  46558. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  46559. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  46560. r.bumpScale = this.bumpScale),
  46561. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  46562. r.normalScale = this.normalScale.toArray()),
  46563. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  46564. r.displacementScale = this.displacementScale,
  46565. r.displacementBias = this.displacementBias),
  46566. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46567. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46568. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46569. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  46570. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  46571. r.reflectivity = this.reflectivity),
  46572. void 0 !== this.size && (r.size = this.size),
  46573. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  46574. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  46575. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  46576. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  46577. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  46578. this.opacity < 1 && (r.opacity = this.opacity),
  46579. this.transparent === !0 && (r.transparent = this.transparent),
  46580. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  46581. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  46582. this.wireframe === !0 && (r.wireframe = this.wireframe),
  46583. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  46584. i) {
  46585. var o = t(e.textures)
  46586. , a = t(e.images);
  46587. o.length > 0 && (r.textures = o),
  46588. a.length > 0 && (r.images = a)
  46589. }
  46590. return r
  46591. },
  46592. clone: function() {
  46593. return (new this.constructor).copy(this)
  46594. },
  46595. copy: function(e) {
  46596. return this.name = e.name,
  46597. this.side = e.side,
  46598. this.opacity = e.opacity,
  46599. this.transparent = e.transparent,
  46600. this.blending = e.blending,
  46601. this.blendSrc = e.blendSrc,
  46602. this.blendDst = e.blendDst,
  46603. this.blendEquation = e.blendEquation,
  46604. this.blendSrcAlpha = e.blendSrcAlpha,
  46605. this.blendDstAlpha = e.blendDstAlpha,
  46606. this.blendEquationAlpha = e.blendEquationAlpha,
  46607. this.depthFunc = e.depthFunc,
  46608. this.depthTest = e.depthTest,
  46609. this.depthWrite = e.depthWrite,
  46610. this.colorWrite = e.colorWrite,
  46611. this.precision = e.precision,
  46612. this.polygonOffset = e.polygonOffset,
  46613. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46614. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46615. this.alphaTest = e.alphaTest,
  46616. this.premultipliedAlpha = e.premultipliedAlpha,
  46617. this.overdraw = e.overdraw,
  46618. this.visible = e.visible,
  46619. this
  46620. },
  46621. update: function() {
  46622. this.dispatchEvent({
  46623. type: "update"
  46624. })
  46625. },
  46626. dispose: function() {
  46627. this.dispatchEvent({
  46628. type: "dispose"
  46629. })
  46630. }
  46631. },
  46632. n.EventDispatcher.prototype.apply(n.Material.prototype),
  46633. n.MaterialIdCount = 0,
  46634. n.LineBasicMaterial = function(e) {
  46635. n.Material.call(this),
  46636. this.type = "LineBasicMaterial",
  46637. this.color = new n.Color(16777215),
  46638. this.linewidth = 1,
  46639. this.linecap = "round",
  46640. this.linejoin = "round",
  46641. this.blending = n.NormalBlending,
  46642. this.vertexColors = n.NoColors,
  46643. this.fog = !0,
  46644. this.setValues(e)
  46645. }
  46646. ,
  46647. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  46648. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  46649. n.LineBasicMaterial.prototype.copy = function(e) {
  46650. return n.Material.prototype.copy.call(this, e),
  46651. this.color.copy(e.color),
  46652. this.linewidth = e.linewidth,
  46653. this.linecap = e.linecap,
  46654. this.linejoin = e.linejoin,
  46655. this.vertexColors = e.vertexColors,
  46656. this.fog = e.fog,
  46657. this
  46658. }
  46659. ,
  46660. n.LineDashedMaterial = function(e) {
  46661. n.Material.call(this),
  46662. this.type = "LineDashedMaterial",
  46663. this.color = new n.Color(16777215),
  46664. this.linewidth = 1,
  46665. this.scale = 1,
  46666. this.dashSize = 3,
  46667. this.gapSize = 1,
  46668. this.blending = n.NormalBlending,
  46669. this.vertexColors = n.NoColors,
  46670. this.fog = !0,
  46671. this.setValues(e)
  46672. }
  46673. ,
  46674. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  46675. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  46676. n.LineDashedMaterial.prototype.copy = function(e) {
  46677. return n.Material.prototype.copy.call(this, e),
  46678. this.color.copy(e.color),
  46679. this.linewidth = e.linewidth,
  46680. this.scale = e.scale,
  46681. this.dashSize = e.dashSize,
  46682. this.gapSize = e.gapSize,
  46683. this.vertexColors = e.vertexColors,
  46684. this.fog = e.fog,
  46685. this
  46686. }
  46687. ,
  46688. n.MeshBasicMaterial = function(e) {
  46689. n.Material.call(this),
  46690. this.type = "MeshBasicMaterial",
  46691. this.color = new n.Color(16777215),
  46692. this.map = null,
  46693. this.aoMap = null,
  46694. this.aoMapIntensity = 1,
  46695. this.specularMap = null,
  46696. this.alphaMap = null,
  46697. this.envMap = null,
  46698. this.combine = n.MultiplyOperation,
  46699. this.reflectivity = 1,
  46700. this.refractionRatio = .98,
  46701. this.fog = !0,
  46702. this.shading = n.SmoothShading,
  46703. this.blending = n.NormalBlending,
  46704. this.wireframe = !1,
  46705. this.wireframeLinewidth = 1,
  46706. this.wireframeLinecap = "round",
  46707. this.wireframeLinejoin = "round",
  46708. this.vertexColors = n.NoColors,
  46709. this.skinning = !1,
  46710. this.morphTargets = !1,
  46711. this.setValues(e)
  46712. }
  46713. ,
  46714. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  46715. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  46716. n.MeshBasicMaterial.prototype.copy = function(e) {
  46717. return n.Material.prototype.copy.call(this, e),
  46718. this.color.copy(e.color),
  46719. this.map = e.map,
  46720. this.aoMap = e.aoMap,
  46721. this.aoMapIntensity = e.aoMapIntensity,
  46722. this.specularMap = e.specularMap,
  46723. this.alphaMap = e.alphaMap,
  46724. this.envMap = e.envMap,
  46725. this.combine = e.combine,
  46726. this.reflectivity = e.reflectivity,
  46727. this.refractionRatio = e.refractionRatio,
  46728. this.fog = e.fog,
  46729. this.shading = e.shading,
  46730. this.wireframe = e.wireframe,
  46731. this.wireframeLinewidth = e.wireframeLinewidth,
  46732. this.wireframeLinecap = e.wireframeLinecap,
  46733. this.wireframeLinejoin = e.wireframeLinejoin,
  46734. this.vertexColors = e.vertexColors,
  46735. this.skinning = e.skinning,
  46736. this.morphTargets = e.morphTargets,
  46737. this
  46738. }
  46739. ,
  46740. n.MeshLambertMaterial = function(e) {
  46741. n.Material.call(this),
  46742. this.type = "MeshLambertMaterial",
  46743. this.color = new n.Color(16777215),
  46744. this.map = null,
  46745. this.lightMap = null,
  46746. this.lightMapIntensity = 1,
  46747. this.aoMap = null,
  46748. this.aoMapIntensity = 1,
  46749. this.emissive = new n.Color(0),
  46750. this.emissiveIntensity = 1,
  46751. this.emissiveMap = null,
  46752. this.specularMap = null,
  46753. this.alphaMap = null,
  46754. this.envMap = null,
  46755. this.combine = n.MultiplyOperation,
  46756. this.reflectivity = 1,
  46757. this.refractionRatio = .98,
  46758. this.fog = !0,
  46759. this.blending = n.NormalBlending,
  46760. this.wireframe = !1,
  46761. this.wireframeLinewidth = 1,
  46762. this.wireframeLinecap = "round",
  46763. this.wireframeLinejoin = "round",
  46764. this.vertexColors = n.NoColors,
  46765. this.skinning = !1,
  46766. this.morphTargets = !1,
  46767. this.morphNormals = !1,
  46768. this.setValues(e)
  46769. }
  46770. ,
  46771. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  46772. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  46773. n.MeshLambertMaterial.prototype.copy = function(e) {
  46774. return n.Material.prototype.copy.call(this, e),
  46775. this.color.copy(e.color),
  46776. this.map = e.map,
  46777. this.lightMap = e.lightMap,
  46778. this.lightMapIntensity = e.lightMapIntensity,
  46779. this.aoMap = e.aoMap,
  46780. this.aoMapIntensity = e.aoMapIntensity,
  46781. this.emissive.copy(e.emissive),
  46782. this.emissiveMap = e.emissiveMap,
  46783. this.emissiveIntensity = e.emissiveIntensity,
  46784. this.specularMap = e.specularMap,
  46785. this.alphaMap = e.alphaMap,
  46786. this.envMap = e.envMap,
  46787. this.combine = e.combine,
  46788. this.reflectivity = e.reflectivity,
  46789. this.refractionRatio = e.refractionRatio,
  46790. this.fog = e.fog,
  46791. this.wireframe = e.wireframe,
  46792. this.wireframeLinewidth = e.wireframeLinewidth,
  46793. this.wireframeLinecap = e.wireframeLinecap,
  46794. this.wireframeLinejoin = e.wireframeLinejoin,
  46795. this.vertexColors = e.vertexColors,
  46796. this.skinning = e.skinning,
  46797. this.morphTargets = e.morphTargets,
  46798. this.morphNormals = e.morphNormals,
  46799. this
  46800. }
  46801. ,
  46802. n.MeshPhongMaterial = function(e) {
  46803. n.Material.call(this),
  46804. this.type = "MeshPhongMaterial",
  46805. this.color = new n.Color(16777215),
  46806. this.specular = new n.Color(1118481),
  46807. this.shininess = 30,
  46808. this.map = null,
  46809. this.lightMap = null,
  46810. this.lightMapIntensity = 1,
  46811. this.aoMap = null,
  46812. this.aoMapIntensity = 1,
  46813. this.emissive = new n.Color(0),
  46814. this.emissiveIntensity = 1,
  46815. this.emissiveMap = null,
  46816. this.bumpMap = null,
  46817. this.bumpScale = 1,
  46818. this.normalMap = null,
  46819. this.normalScale = new n.Vector2(1,1),
  46820. this.displacementMap = null,
  46821. this.displacementScale = 1,
  46822. this.displacementBias = 0,
  46823. this.specularMap = null,
  46824. this.alphaMap = null,
  46825. this.envMap = null,
  46826. this.combine = n.MultiplyOperation,
  46827. this.reflectivity = 1,
  46828. this.refractionRatio = .98,
  46829. this.fog = !0,
  46830. this.shading = n.SmoothShading,
  46831. this.blending = n.NormalBlending,
  46832. this.wireframe = !1,
  46833. this.wireframeLinewidth = 1,
  46834. this.wireframeLinecap = "round",
  46835. this.wireframeLinejoin = "round",
  46836. this.vertexColors = n.NoColors,
  46837. this.skinning = !1,
  46838. this.morphTargets = !1,
  46839. this.morphNormals = !1,
  46840. this.setValues(e)
  46841. }
  46842. ,
  46843. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  46844. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  46845. n.MeshPhongMaterial.prototype.copy = function(e) {
  46846. return n.Material.prototype.copy.call(this, e),
  46847. this.color.copy(e.color),
  46848. this.specular.copy(e.specular),
  46849. this.shininess = e.shininess,
  46850. this.map = e.map,
  46851. this.lightMap = e.lightMap,
  46852. this.lightMapIntensity = e.lightMapIntensity,
  46853. this.aoMap = e.aoMap,
  46854. this.aoMapIntensity = e.aoMapIntensity,
  46855. this.emissive.copy(e.emissive),
  46856. this.emissiveMap = e.emissiveMap,
  46857. this.emissiveIntensity = e.emissiveIntensity,
  46858. this.bumpMap = e.bumpMap,
  46859. this.bumpScale = e.bumpScale,
  46860. this.normalMap = e.normalMap,
  46861. this.normalScale.copy(e.normalScale),
  46862. this.displacementMap = e.displacementMap,
  46863. this.displacementScale = e.displacementScale,
  46864. this.displacementBias = e.displacementBias,
  46865. this.specularMap = e.specularMap,
  46866. this.alphaMap = e.alphaMap,
  46867. this.envMap = e.envMap,
  46868. this.combine = e.combine,
  46869. this.reflectivity = e.reflectivity,
  46870. this.refractionRatio = e.refractionRatio,
  46871. this.fog = e.fog,
  46872. this.shading = e.shading,
  46873. this.wireframe = e.wireframe,
  46874. this.wireframeLinewidth = e.wireframeLinewidth,
  46875. this.wireframeLinecap = e.wireframeLinecap,
  46876. this.wireframeLinejoin = e.wireframeLinejoin,
  46877. this.vertexColors = e.vertexColors,
  46878. this.skinning = e.skinning,
  46879. this.morphTargets = e.morphTargets,
  46880. this.morphNormals = e.morphNormals,
  46881. this
  46882. }
  46883. ,
  46884. n.MeshStandardMaterial = function(e) {
  46885. n.Material.call(this),
  46886. this.type = "MeshStandardMaterial",
  46887. this.color = new n.Color(16777215),
  46888. this.roughness = .5,
  46889. this.metalness = .5,
  46890. this.map = null,
  46891. this.lightMap = null,
  46892. this.lightMapIntensity = 1,
  46893. this.aoMap = null,
  46894. this.aoMapIntensity = 1,
  46895. this.emissive = new n.Color(0),
  46896. this.emissiveIntensity = 1,
  46897. this.emissiveMap = null,
  46898. this.bumpMap = null,
  46899. this.bumpScale = 1,
  46900. this.normalMap = null,
  46901. this.normalScale = new n.Vector2(1,1),
  46902. this.displacementMap = null,
  46903. this.displacementScale = 1,
  46904. this.displacementBias = 0,
  46905. this.roughnessMap = null,
  46906. this.metalnessMap = null,
  46907. this.alphaMap = null,
  46908. this.envMap = null,
  46909. this.envMapIntensity = 1,
  46910. this.refractionRatio = .98,
  46911. this.fog = !0,
  46912. this.shading = n.SmoothShading,
  46913. this.blending = n.NormalBlending,
  46914. this.wireframe = !1,
  46915. this.wireframeLinewidth = 1,
  46916. this.wireframeLinecap = "round",
  46917. this.wireframeLinejoin = "round",
  46918. this.vertexColors = n.NoColors,
  46919. this.skinning = !1,
  46920. this.morphTargets = !1,
  46921. this.morphNormals = !1,
  46922. this.setValues(e)
  46923. }
  46924. ,
  46925. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  46926. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  46927. n.MeshStandardMaterial.prototype.copy = function(e) {
  46928. return n.Material.prototype.copy.call(this, e),
  46929. this.color.copy(e.color),
  46930. this.roughness = e.roughness,
  46931. this.metalness = e.metalness,
  46932. this.map = e.map,
  46933. this.lightMap = e.lightMap,
  46934. this.lightMapIntensity = e.lightMapIntensity,
  46935. this.aoMap = e.aoMap,
  46936. this.aoMapIntensity = e.aoMapIntensity,
  46937. this.emissive.copy(e.emissive),
  46938. this.emissiveMap = e.emissiveMap,
  46939. this.emissiveIntensity = e.emissiveIntensity,
  46940. this.bumpMap = e.bumpMap,
  46941. this.bumpScale = e.bumpScale,
  46942. this.normalMap = e.normalMap,
  46943. this.normalScale.copy(e.normalScale),
  46944. this.displacementMap = e.displacementMap,
  46945. this.displacementScale = e.displacementScale,
  46946. this.displacementBias = e.displacementBias,
  46947. this.roughnessMap = e.roughnessMap,
  46948. this.metalnessMap = e.metalnessMap,
  46949. this.alphaMap = e.alphaMap,
  46950. this.envMap = e.envMap,
  46951. this.envMapIntensity = e.envMapIntensity,
  46952. this.refractionRatio = e.refractionRatio,
  46953. this.fog = e.fog,
  46954. this.shading = e.shading,
  46955. this.wireframe = e.wireframe,
  46956. this.wireframeLinewidth = e.wireframeLinewidth,
  46957. this.wireframeLinecap = e.wireframeLinecap,
  46958. this.wireframeLinejoin = e.wireframeLinejoin,
  46959. this.vertexColors = e.vertexColors,
  46960. this.skinning = e.skinning,
  46961. this.morphTargets = e.morphTargets,
  46962. this.morphNormals = e.morphNormals,
  46963. this
  46964. }
  46965. ,
  46966. n.MeshDepthMaterial = function(e) {
  46967. n.Material.call(this),
  46968. this.type = "MeshDepthMaterial",
  46969. this.morphTargets = !1,
  46970. this.wireframe = !1,
  46971. this.wireframeLinewidth = 1,
  46972. this.setValues(e)
  46973. }
  46974. ,
  46975. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  46976. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  46977. n.MeshDepthMaterial.prototype.copy = function(e) {
  46978. return n.Material.prototype.copy.call(this, e),
  46979. this.wireframe = e.wireframe,
  46980. this.wireframeLinewidth = e.wireframeLinewidth,
  46981. this
  46982. }
  46983. ,
  46984. n.MeshNormalMaterial = function(e) {
  46985. n.Material.call(this, e),
  46986. this.type = "MeshNormalMaterial",
  46987. this.wireframe = !1,
  46988. this.wireframeLinewidth = 1,
  46989. this.morphTargets = !1,
  46990. this.setValues(e)
  46991. }
  46992. ,
  46993. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  46994. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  46995. n.MeshNormalMaterial.prototype.copy = function(e) {
  46996. return n.Material.prototype.copy.call(this, e),
  46997. this.wireframe = e.wireframe,
  46998. this.wireframeLinewidth = e.wireframeLinewidth,
  46999. this
  47000. }
  47001. ,
  47002. n.MultiMaterial = function(e) {
  47003. this.uuid = n.Math.generateUUID(),
  47004. this.type = "MultiMaterial",
  47005. this.materials = e instanceof Array ? e : [],
  47006. this.visible = !0
  47007. }
  47008. ,
  47009. n.MultiMaterial.prototype = {
  47010. constructor: n.MultiMaterial,
  47011. toJSON: function(e) {
  47012. for (var t = {
  47013. metadata: {
  47014. version: 4.2,
  47015. type: "material",
  47016. generator: "MaterialExporter"
  47017. },
  47018. uuid: this.uuid,
  47019. type: this.type,
  47020. materials: []
  47021. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  47022. var o = i[n].toJSON(e);
  47023. delete o.metadata,
  47024. t.materials.push(o)
  47025. }
  47026. return t.visible = this.visible,
  47027. t
  47028. },
  47029. clone: function() {
  47030. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  47031. e.materials.push(this.materials[t].clone());
  47032. return e.visible = this.visible,
  47033. e
  47034. }
  47035. },
  47036. n.PointsMaterial = function(e) {
  47037. n.Material.call(this),
  47038. this.type = "PointsMaterial",
  47039. this.color = new n.Color(16777215),
  47040. this.map = null,
  47041. this.size = 1,
  47042. this.sizeAttenuation = !0,
  47043. this.blending = n.NormalBlending,
  47044. this.vertexColors = n.NoColors,
  47045. this.fog = !0,
  47046. this.setValues(e)
  47047. }
  47048. ,
  47049. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  47050. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  47051. n.PointsMaterial.prototype.copy = function(e) {
  47052. return n.Material.prototype.copy.call(this, e),
  47053. this.color.copy(e.color),
  47054. this.map = e.map,
  47055. this.size = e.size,
  47056. this.sizeAttenuation = e.sizeAttenuation,
  47057. this.vertexColors = e.vertexColors,
  47058. this.fog = e.fog,
  47059. this
  47060. }
  47061. ,
  47062. n.ShaderMaterial = function(e) {
  47063. n.Material.call(this),
  47064. this.type = "ShaderMaterial",
  47065. this.defines = {},
  47066. this.uniforms = {},
  47067. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  47068. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  47069. this.shading = n.SmoothShading,
  47070. this.linewidth = 1,
  47071. this.wireframe = !1,
  47072. this.wireframeLinewidth = 1,
  47073. this.fog = !1,
  47074. this.lights = !1,
  47075. this.vertexColors = n.NoColors,
  47076. this.skinning = !1,
  47077. this.morphTargets = !1,
  47078. this.morphNormals = !1,
  47079. this.extensions = {
  47080. derivatives: !1,
  47081. fragDepth: !1,
  47082. drawBuffers: !1,
  47083. shaderTextureLOD: !1
  47084. },
  47085. this.defaultAttributeValues = {
  47086. color: [1, 1, 1],
  47087. uv: [0, 0],
  47088. uv2: [0, 0]
  47089. },
  47090. this.index0AttributeName = void 0,
  47091. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  47092. this.setValues(e))
  47093. }
  47094. ,
  47095. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  47096. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  47097. n.ShaderMaterial.prototype.copy = function(e) {
  47098. return n.Material.prototype.copy.call(this, e),
  47099. this.fragmentShader = e.fragmentShader,
  47100. this.vertexShader = e.vertexShader,
  47101. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  47102. this.defines = e.defines,
  47103. this.shading = e.shading,
  47104. this.wireframe = e.wireframe,
  47105. this.wireframeLinewidth = e.wireframeLinewidth,
  47106. this.fog = e.fog,
  47107. this.lights = e.lights,
  47108. this.vertexColors = e.vertexColors,
  47109. this.skinning = e.skinning,
  47110. this.morphTargets = e.morphTargets,
  47111. this.morphNormals = e.morphNormals,
  47112. this.extensions = e.extensions,
  47113. this
  47114. }
  47115. ,
  47116. n.ShaderMaterial.prototype.toJSON = function(e) {
  47117. var t = n.Material.prototype.toJSON.call(this, e);
  47118. return t.uniforms = this.uniforms,
  47119. t.vertexShader = this.vertexShader,
  47120. t.fragmentShader = this.fragmentShader,
  47121. t
  47122. }
  47123. ,
  47124. n.RawShaderMaterial = function(e) {
  47125. n.ShaderMaterial.call(this, e),
  47126. this.type = "RawShaderMaterial"
  47127. }
  47128. ,
  47129. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  47130. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  47131. n.SpriteMaterial = function(e) {
  47132. n.Material.call(this),
  47133. this.type = "SpriteMaterial",
  47134. this.color = new n.Color(16777215),
  47135. this.map = null,
  47136. this.rotation = 0,
  47137. this.fog = !1,
  47138. this.setValues(e)
  47139. }
  47140. ,
  47141. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  47142. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  47143. n.SpriteMaterial.prototype.copy = function(e) {
  47144. return n.Material.prototype.copy.call(this, e),
  47145. this.color.copy(e.color),
  47146. this.map = e.map,
  47147. this.rotation = e.rotation,
  47148. this.fog = e.fog,
  47149. this
  47150. }
  47151. ,
  47152. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  47153. Object.defineProperty(this, "id", {
  47154. value: n.TextureIdCount++
  47155. }),
  47156. this.uuid = n.Math.generateUUID(),
  47157. this.name = "",
  47158. this.sourceFile = "",
  47159. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  47160. this.mipmaps = [],
  47161. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  47162. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  47163. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  47164. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  47165. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  47166. this.anisotropy = void 0 !== c ? c : 1,
  47167. this.format = void 0 !== s ? s : n.RGBAFormat,
  47168. this.type = void 0 !== l ? l : n.UnsignedByteType,
  47169. this.offset = new n.Vector2(0,0),
  47170. this.repeat = new n.Vector2(1,1),
  47171. this.generateMipmaps = !0,
  47172. this.premultiplyAlpha = !1,
  47173. this.flipY = !0,
  47174. this.unpackAlignment = 4,
  47175. this.encoding = n.LinearEncoding,
  47176. this.version = 0,
  47177. this.onUpdate = null
  47178. }
  47179. ,
  47180. n.Texture.DEFAULT_IMAGE = void 0,
  47181. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  47182. n.Texture.prototype = {
  47183. constructor: n.Texture,
  47184. set needsUpdate(e) {
  47185. e === !0 && this.version++
  47186. },
  47187. clone: function() {
  47188. return (new this.constructor).copy(this)
  47189. },
  47190. copy: function(e) {
  47191. return this.image = e.image,
  47192. this.mipmaps = e.mipmaps.slice(0),
  47193. this.mapping = e.mapping,
  47194. this.wrapS = e.wrapS,
  47195. this.wrapT = e.wrapT,
  47196. this.magFilter = e.magFilter,
  47197. this.minFilter = e.minFilter,
  47198. this.anisotropy = e.anisotropy,
  47199. this.format = e.format,
  47200. this.type = e.type,
  47201. this.offset.copy(e.offset),
  47202. this.repeat.copy(e.repeat),
  47203. this.generateMipmaps = e.generateMipmaps,
  47204. this.premultiplyAlpha = e.premultiplyAlpha,
  47205. this.flipY = e.flipY,
  47206. this.unpackAlignment = e.unpackAlignment,
  47207. this.encoding = e.encoding,
  47208. this
  47209. },
  47210. toJSON: function(e) {
  47211. function t(e) {
  47212. var t;
  47213. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  47214. t.width = e.width,
  47215. t.height = e.height,
  47216. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  47217. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  47218. }
  47219. if (void 0 !== e.textures[this.uuid])
  47220. return e.textures[this.uuid];
  47221. var i = {
  47222. metadata: {
  47223. version: 4.4,
  47224. type: "Texture",
  47225. generator: "Texture.toJSON"
  47226. },
  47227. uuid: this.uuid,
  47228. name: this.name,
  47229. mapping: this.mapping,
  47230. repeat: [this.repeat.x, this.repeat.y],
  47231. offset: [this.offset.x, this.offset.y],
  47232. wrap: [this.wrapS, this.wrapT],
  47233. minFilter: this.minFilter,
  47234. magFilter: this.magFilter,
  47235. anisotropy: this.anisotropy
  47236. };
  47237. if (void 0 !== this.image) {
  47238. var r = this.image;
  47239. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  47240. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47241. uuid: r.uuid,
  47242. url: t(r)
  47243. }),
  47244. i.image = r.uuid
  47245. }
  47246. return e.textures[this.uuid] = i,
  47247. i
  47248. },
  47249. dispose: function() {
  47250. this.dispatchEvent({
  47251. type: "dispose"
  47252. })
  47253. },
  47254. transformUv: function(e) {
  47255. if (this.mapping === n.UVMapping) {
  47256. if (e.multiply(this.repeat),
  47257. e.add(this.offset),
  47258. e.x < 0 || e.x > 1)
  47259. switch (this.wrapS) {
  47260. case n.RepeatWrapping:
  47261. e.x = e.x - Math.floor(e.x);
  47262. break;
  47263. case n.ClampToEdgeWrapping:
  47264. e.x = e.x < 0 ? 0 : 1;
  47265. break;
  47266. case n.MirroredRepeatWrapping:
  47267. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47268. }
  47269. if (e.y < 0 || e.y > 1)
  47270. switch (this.wrapT) {
  47271. case n.RepeatWrapping:
  47272. e.y = e.y - Math.floor(e.y);
  47273. break;
  47274. case n.ClampToEdgeWrapping:
  47275. e.y = e.y < 0 ? 0 : 1;
  47276. break;
  47277. case n.MirroredRepeatWrapping:
  47278. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47279. }
  47280. this.flipY && (e.y = 1 - e.y)
  47281. }
  47282. }
  47283. },
  47284. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  47285. n.TextureIdCount = 0,
  47286. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  47287. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47288. this.needsUpdate = !0
  47289. }
  47290. ,
  47291. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  47292. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  47293. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  47294. e = void 0 !== e ? e : [],
  47295. t = void 0 !== t ? t : n.CubeReflectionMapping,
  47296. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47297. this.flipY = !1
  47298. }
  47299. ,
  47300. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  47301. n.CubeTexture.prototype.constructor = n.CubeTexture,
  47302. Object.defineProperty(n.CubeTexture.prototype, "images", {
  47303. get: function() {
  47304. return this.image
  47305. },
  47306. set: function(e) {
  47307. this.image = e
  47308. }
  47309. }),
  47310. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  47311. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  47312. this.image = {
  47313. width: t,
  47314. height: i
  47315. },
  47316. this.mipmaps = e,
  47317. this.flipY = !1,
  47318. this.generateMipmaps = !1
  47319. }
  47320. ,
  47321. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  47322. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  47323. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  47324. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  47325. this.image = {
  47326. data: e,
  47327. width: t,
  47328. height: i
  47329. },
  47330. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  47331. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  47332. this.flipY = !1,
  47333. this.generateMipmaps = !1
  47334. }
  47335. ,
  47336. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  47337. n.DataTexture.prototype.constructor = n.DataTexture,
  47338. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  47339. function h() {
  47340. requestAnimationFrame(h),
  47341. e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
  47342. }
  47343. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47344. this.generateMipmaps = !1;
  47345. var u = this;
  47346. h()
  47347. }
  47348. ,
  47349. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  47350. n.VideoTexture.prototype.constructor = n.VideoTexture,
  47351. n.Group = function() {
  47352. n.Object3D.call(this),
  47353. this.type = "Group"
  47354. }
  47355. ,
  47356. n.Group.prototype = Object.create(n.Object3D.prototype),
  47357. n.Group.prototype.constructor = n.Group,
  47358. n.Points = function(e, t) {
  47359. n.Object3D.call(this),
  47360. this.type = "Points",
  47361. this.geometry = void 0 !== e ? e : new n.Geometry,
  47362. this.material = void 0 !== t ? t : new n.PointsMaterial({
  47363. color: 16777215 * Math.random()
  47364. })
  47365. }
  47366. ,
  47367. n.Points.prototype = Object.create(n.Object3D.prototype),
  47368. n.Points.prototype.constructor = n.Points,
  47369. n.Points.prototype.raycast = function() {
  47370. var e = new n.Matrix4
  47371. , t = new n.Ray
  47372. , i = new n.Sphere;
  47373. return function(r, o) {
  47374. function a(e, i) {
  47375. var n = t.distanceSqToPoint(e);
  47376. if (n < d) {
  47377. var a = t.closestPointToPoint(e);
  47378. a.applyMatrix4(c);
  47379. var l = r.ray.origin.distanceTo(a);
  47380. if (l < r.near || l > r.far)
  47381. return;
  47382. o.push({
  47383. distance: l,
  47384. distanceToRay: Math.sqrt(n),
  47385. point: a.clone(),
  47386. index: i,
  47387. face: null,
  47388. object: s
  47389. })
  47390. }
  47391. }
  47392. var s = this
  47393. , l = this.geometry
  47394. , c = this.matrixWorld
  47395. , h = r.params.Points.threshold;
  47396. if (null === l.boundingSphere && l.computeBoundingSphere(),
  47397. i.copy(l.boundingSphere),
  47398. i.applyMatrix4(c),
  47399. r.ray.intersectsSphere(i) !== !1) {
  47400. e.getInverse(c),
  47401. t.copy(r.ray).applyMatrix4(e);
  47402. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47403. , d = u * u
  47404. , p = new n.Vector3;
  47405. if (l instanceof n.BufferGeometry) {
  47406. var f = l.index
  47407. , g = l.attributes
  47408. , m = g.position.array;
  47409. if (null !== f)
  47410. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  47411. var C = v[A];
  47412. p.fromArray(m, 3 * C),
  47413. a(p, C)
  47414. }
  47415. else
  47416. for (var A = 0, I = m.length / 3; A < I; A++)
  47417. p.fromArray(m, 3 * A),
  47418. a(p, A)
  47419. } else
  47420. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  47421. a(E[A], A)
  47422. }
  47423. }
  47424. }(),
  47425. n.Points.prototype.clone = function() {
  47426. return new this.constructor(this.geometry,this.material).copy(this)
  47427. }
  47428. ,
  47429. n.Line = function(e, t, i) {
  47430. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47431. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  47432. this.type = "Line",
  47433. this.geometry = void 0 !== e ? e : new n.Geometry,
  47434. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  47435. color: 16777215 * Math.random()
  47436. })))
  47437. }
  47438. ,
  47439. n.Line.prototype = Object.create(n.Object3D.prototype),
  47440. n.Line.prototype.constructor = n.Line,
  47441. n.Line.prototype.raycast = function() {
  47442. var e = new n.Matrix4
  47443. , t = new n.Ray
  47444. , i = new n.Sphere;
  47445. return function(r, o) {
  47446. var a = r.linePrecision
  47447. , s = a * a
  47448. , l = this.geometry
  47449. , c = this.matrixWorld;
  47450. if (null === l.boundingSphere && l.computeBoundingSphere(),
  47451. i.copy(l.boundingSphere),
  47452. i.applyMatrix4(c),
  47453. r.ray.intersectsSphere(i) !== !1) {
  47454. e.getInverse(c),
  47455. t.copy(r.ray).applyMatrix4(e);
  47456. var h = new n.Vector3
  47457. , u = new n.Vector3
  47458. , d = new n.Vector3
  47459. , p = new n.Vector3
  47460. , f = this instanceof n.LineSegments ? 2 : 1;
  47461. if (l instanceof n.BufferGeometry) {
  47462. var g = l.index
  47463. , m = l.attributes
  47464. , v = m.position.array;
  47465. if (null !== g)
  47466. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  47467. var I = A[y]
  47468. , E = A[y + 1];
  47469. h.fromArray(v, 3 * I),
  47470. u.fromArray(v, 3 * E);
  47471. var b = t.distanceSqToSegment(h, u, p, d);
  47472. if (!(b > s)) {
  47473. p.applyMatrix4(this.matrixWorld);
  47474. var w = r.ray.origin.distanceTo(p);
  47475. w < r.near || w > r.far || o.push({
  47476. distance: w,
  47477. point: d.clone().applyMatrix4(this.matrixWorld),
  47478. index: y,
  47479. face: null,
  47480. faceIndex: null,
  47481. object: this
  47482. })
  47483. }
  47484. }
  47485. else
  47486. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  47487. h.fromArray(v, 3 * y),
  47488. u.fromArray(v, 3 * y + 3);
  47489. var b = t.distanceSqToSegment(h, u, p, d);
  47490. if (!(b > s)) {
  47491. p.applyMatrix4(this.matrixWorld);
  47492. var w = r.ray.origin.distanceTo(p);
  47493. w < r.near || w > r.far || o.push({
  47494. distance: w,
  47495. point: d.clone().applyMatrix4(this.matrixWorld),
  47496. index: y,
  47497. face: null,
  47498. faceIndex: null,
  47499. object: this
  47500. })
  47501. }
  47502. }
  47503. } else if (l instanceof n.Geometry)
  47504. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  47505. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  47506. if (!(b > s)) {
  47507. p.applyMatrix4(this.matrixWorld);
  47508. var w = r.ray.origin.distanceTo(p);
  47509. w < r.near || w > r.far || o.push({
  47510. distance: w,
  47511. point: d.clone().applyMatrix4(this.matrixWorld),
  47512. index: y,
  47513. face: null,
  47514. faceIndex: null,
  47515. object: this
  47516. })
  47517. }
  47518. }
  47519. }
  47520. }
  47521. }(),
  47522. n.Line.prototype.clone = function() {
  47523. return new this.constructor(this.geometry,this.material).copy(this)
  47524. }
  47525. ,
  47526. n.LineStrip = 0,
  47527. n.LinePieces = 1,
  47528. n.LineSegments = function(e, t) {
  47529. n.Line.call(this, e, t),
  47530. this.type = "LineSegments"
  47531. }
  47532. ,
  47533. n.LineSegments.prototype = Object.create(n.Line.prototype),
  47534. n.LineSegments.prototype.constructor = n.LineSegments,
  47535. n.Mesh = function(e, t) {
  47536. n.Object3D.call(this),
  47537. this.type = "Mesh",
  47538. this.geometry = void 0 !== e ? e : new n.Geometry,
  47539. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  47540. color: 16777215 * Math.random()
  47541. }),
  47542. this.drawMode = n.TrianglesDrawMode,
  47543. this.updateMorphTargets()
  47544. }
  47545. ,
  47546. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  47547. n.Mesh.prototype.constructor = n.Mesh,
  47548. n.Mesh.prototype.setDrawMode = function(e) {
  47549. this.drawMode = e
  47550. }
  47551. ,
  47552. n.Mesh.prototype.updateMorphTargets = function() {
  47553. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  47554. this.morphTargetBase = -1,
  47555. this.morphTargetInfluences = [],
  47556. this.morphTargetDictionary = {};
  47557. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47558. this.morphTargetInfluences.push(0),
  47559. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47560. }
  47561. }
  47562. ,
  47563. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47564. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47565. 0)
  47566. }
  47567. ,
  47568. n.Mesh.prototype.raycast = function() {
  47569. function e(e, t, i, r, o, a, s) {
  47570. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  47571. o.multiplyScalar(m.x),
  47572. a.multiplyScalar(m.y),
  47573. s.multiplyScalar(m.z),
  47574. o.add(a).add(s),
  47575. o.clone()
  47576. }
  47577. function t(e, t, i, r, o, a, s) {
  47578. var l, c = e.material;
  47579. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  47580. null === l)
  47581. return null;
  47582. A.copy(s),
  47583. A.applyMatrix4(e.matrixWorld);
  47584. var h = t.ray.origin.distanceTo(A);
  47585. return h < t.near || h > t.far ? null : {
  47586. distance: h,
  47587. point: A.clone(),
  47588. object: e
  47589. }
  47590. }
  47591. function i(i, r, o, a, h, u, d, m) {
  47592. s.fromArray(a, 3 * u),
  47593. l.fromArray(a, 3 * d),
  47594. c.fromArray(a, 3 * m);
  47595. var A = t(i, r, o, s, l, c, v);
  47596. return A && (h && (p.fromArray(h, 2 * u),
  47597. f.fromArray(h, 2 * d),
  47598. g.fromArray(h, 2 * m),
  47599. A.uv = e(v, s, l, c, p, f, g)),
  47600. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  47601. A.faceIndex = u),
  47602. A
  47603. }
  47604. var r = new n.Matrix4
  47605. , o = new n.Ray
  47606. , a = new n.Sphere
  47607. , s = new n.Vector3
  47608. , l = new n.Vector3
  47609. , c = new n.Vector3
  47610. , h = new n.Vector3
  47611. , u = new n.Vector3
  47612. , d = new n.Vector3
  47613. , p = new n.Vector2
  47614. , f = new n.Vector2
  47615. , g = new n.Vector2
  47616. , m = new n.Vector3
  47617. , v = new n.Vector3
  47618. , A = new n.Vector3;
  47619. return function(m, A) {
  47620. var y = this.geometry
  47621. , C = this.material
  47622. , I = this.matrixWorld;
  47623. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  47624. a.copy(y.boundingSphere),
  47625. a.applyMatrix4(I),
  47626. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  47627. o.copy(m.ray).applyMatrix4(r),
  47628. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  47629. var E, b;
  47630. if (y instanceof n.BufferGeometry) {
  47631. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  47632. if (void 0 !== S.uv && (E = S.uv.array),
  47633. null !== x)
  47634. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  47635. w = R[P],
  47636. _ = R[P + 1],
  47637. T = R[P + 2],
  47638. b = i(this, m, o, M, E, w, _, T),
  47639. b && (b.faceIndex = Math.floor(P / 3),
  47640. A.push(b));
  47641. else
  47642. for (var P = 0, O = M.length; P < O; P += 9)
  47643. w = P / 3,
  47644. _ = w + 1,
  47645. T = w + 2,
  47646. b = i(this, m, o, M, E, w, _, T),
  47647. b && (b.index = w,
  47648. A.push(b))
  47649. } else if (y instanceof n.Geometry) {
  47650. var L, D, N, B = C instanceof n.MultiMaterial, F = B === !0 ? C.materials : null, V = y.vertices, U = y.faces, k = y.faceVertexUvs[0];
  47651. k.length > 0 && (E = k);
  47652. for (var H = 0, G = U.length; H < G; H++) {
  47653. var z = U[H]
  47654. , W = B === !0 ? F[z.materialIndex] : C;
  47655. if (void 0 !== W) {
  47656. if (L = V[z.a],
  47657. D = V[z.b],
  47658. N = V[z.c],
  47659. W.morphTargets === !0) {
  47660. var j = y.morphTargets
  47661. , Y = this.morphTargetInfluences;
  47662. s.set(0, 0, 0),
  47663. l.set(0, 0, 0),
  47664. c.set(0, 0, 0);
  47665. for (var X = 0, Z = j.length; X < Z; X++) {
  47666. var q = Y[X];
  47667. if (0 !== q) {
  47668. var K = j[X].vertices;
  47669. s.addScaledVector(h.subVectors(K[z.a], L), q),
  47670. l.addScaledVector(u.subVectors(K[z.b], D), q),
  47671. c.addScaledVector(d.subVectors(K[z.c], N), q)
  47672. }
  47673. }
  47674. s.add(L),
  47675. l.add(D),
  47676. c.add(N),
  47677. L = s,
  47678. D = l,
  47679. N = c
  47680. }
  47681. if (b = t(this, m, o, L, D, N, v)) {
  47682. if (E) {
  47683. var Q = E[H];
  47684. p.copy(Q[0]),
  47685. f.copy(Q[1]),
  47686. g.copy(Q[2]),
  47687. b.uv = e(v, L, D, N, p, f, g)
  47688. }
  47689. b.face = z,
  47690. b.faceIndex = H,
  47691. A.push(b)
  47692. }
  47693. }
  47694. }
  47695. }
  47696. }
  47697. }
  47698. }(),
  47699. n.Mesh.prototype.clone = function() {
  47700. return new this.constructor(this.geometry,this.material).copy(this)
  47701. }
  47702. ,
  47703. n.Bone = function(e) {
  47704. n.Object3D.call(this),
  47705. this.type = "Bone",
  47706. this.skin = e
  47707. }
  47708. ,
  47709. n.Bone.prototype = Object.create(n.Object3D.prototype),
  47710. n.Bone.prototype.constructor = n.Bone,
  47711. n.Bone.prototype.copy = function(e) {
  47712. return n.Object3D.prototype.copy.call(this, e),
  47713. this.skin = e.skin,
  47714. this
  47715. }
  47716. ,
  47717. n.Skeleton = function(e, t, i) {
  47718. if (this.useVertexTexture = void 0 === i || i,
  47719. this.identityMatrix = new n.Matrix4,
  47720. e = e || [],
  47721. this.bones = e.slice(0),
  47722. this.useVertexTexture) {
  47723. var r = Math.sqrt(4 * this.bones.length);
  47724. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  47725. r = Math.max(r, 4),
  47726. this.boneTextureWidth = r,
  47727. this.boneTextureHeight = r,
  47728. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47729. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  47730. } else
  47731. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47732. if (void 0 === t)
  47733. this.calculateInverses();
  47734. else if (this.bones.length === t.length)
  47735. this.boneInverses = t.slice(0);
  47736. else {
  47737. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47738. this.boneInverses = [];
  47739. for (var o = 0, a = this.bones.length; o < a; o++)
  47740. this.boneInverses.push(new n.Matrix4)
  47741. }
  47742. }
  47743. ,
  47744. n.Skeleton.prototype.calculateInverses = function() {
  47745. this.boneInverses = [];
  47746. for (var e = 0, t = this.bones.length; e < t; e++) {
  47747. var i = new n.Matrix4;
  47748. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47749. this.boneInverses.push(i)
  47750. }
  47751. }
  47752. ,
  47753. n.Skeleton.prototype.pose = function() {
  47754. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47755. e = this.bones[t],
  47756. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  47757. for (var t = 0, i = this.bones.length; t < i; t++)
  47758. e = this.bones[t],
  47759. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47760. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47761. e.matrix.decompose(e.position, e.quaternion, e.scale));
  47762. }
  47763. ,
  47764. n.Skeleton.prototype.update = function() {
  47765. var e = new n.Matrix4;
  47766. return function() {
  47767. for (var t = 0, i = this.bones.length; t < i; t++) {
  47768. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  47769. e.multiplyMatrices(n, this.boneInverses[t]),
  47770. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  47771. }
  47772. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47773. }
  47774. }(),
  47775. n.Skeleton.prototype.clone = function() {
  47776. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47777. }
  47778. ,
  47779. n.SkinnedMesh = function(e, t, i) {
  47780. n.Mesh.call(this, e, t),
  47781. this.type = "SkinnedMesh",
  47782. this.bindMode = "attached",
  47783. this.bindMatrix = new n.Matrix4,
  47784. this.bindMatrixInverse = new n.Matrix4;
  47785. var r = [];
  47786. if (this.geometry && void 0 !== this.geometry.bones) {
  47787. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  47788. a = this.geometry.bones[s],
  47789. o = new n.Bone(this),
  47790. r.push(o),
  47791. o.name = a.name,
  47792. o.position.fromArray(a.pos),
  47793. o.quaternion.fromArray(a.rotq),
  47794. void 0 !== a.scl && o.scale.fromArray(a.scl);
  47795. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  47796. a = this.geometry.bones[s],
  47797. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  47798. }
  47799. this.normalizeSkinWeights(),
  47800. this.updateMatrixWorld(!0),
  47801. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  47802. }
  47803. ,
  47804. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  47805. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  47806. n.SkinnedMesh.prototype.bind = function(e, t) {
  47807. this.skeleton = e,
  47808. void 0 === t && (this.updateMatrixWorld(!0),
  47809. this.skeleton.calculateInverses(),
  47810. t = this.matrixWorld),
  47811. this.bindMatrix.copy(t),
  47812. this.bindMatrixInverse.getInverse(t)
  47813. }
  47814. ,
  47815. n.SkinnedMesh.prototype.pose = function() {
  47816. this.skeleton.pose()
  47817. }
  47818. ,
  47819. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47820. if (this.geometry instanceof n.Geometry)
  47821. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47822. var t = this.geometry.skinWeights[e]
  47823. , i = 1 / t.lengthManhattan();
  47824. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  47825. }
  47826. else if (this.geometry instanceof n.BufferGeometry)
  47827. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  47828. r.x = o.getX(e),
  47829. r.y = o.getY(e),
  47830. r.z = o.getZ(e),
  47831. r.w = o.getW(e);
  47832. var i = 1 / r.lengthManhattan();
  47833. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  47834. o.setXYZW(e, r.x, r.y, r.z, r.w)
  47835. }
  47836. }
  47837. ,
  47838. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47839. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47840. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47841. }
  47842. ,
  47843. n.SkinnedMesh.prototype.clone = function() {
  47844. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47845. }
  47846. ,
  47847. n.LOD = function() {
  47848. n.Object3D.call(this),
  47849. this.type = "LOD",
  47850. Object.defineProperties(this, {
  47851. levels: {
  47852. enumerable: !0,
  47853. value: []
  47854. },
  47855. objects: {
  47856. get: function() {
  47857. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47858. this.levels
  47859. }
  47860. }
  47861. })
  47862. }
  47863. ,
  47864. n.LOD.prototype = Object.create(n.Object3D.prototype),
  47865. n.LOD.prototype.constructor = n.LOD,
  47866. n.LOD.prototype.addLevel = function(e, t) {
  47867. void 0 === t && (t = 0),
  47868. t = Math.abs(t);
  47869. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47870. ;
  47871. i.splice(n, 0, {
  47872. distance: t,
  47873. object: e
  47874. }),
  47875. this.add(e)
  47876. }
  47877. ,
  47878. n.LOD.prototype.getObjectForDistance = function(e) {
  47879. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47880. ;
  47881. return t[i - 1].object
  47882. }
  47883. ,
  47884. n.LOD.prototype.raycast = function() {
  47885. var e = new n.Vector3;
  47886. return function(t, i) {
  47887. e.setFromMatrixPosition(this.matrixWorld);
  47888. var n = t.ray.origin.distanceTo(e);
  47889. this.getObjectForDistance(n).raycast(t, i)
  47890. }
  47891. }(),
  47892. n.LOD.prototype.update = function() {
  47893. var e = new n.Vector3
  47894. , t = new n.Vector3;
  47895. return function(i) {
  47896. var n = this.levels;
  47897. if (n.length > 1) {
  47898. e.setFromMatrixPosition(i.matrixWorld),
  47899. t.setFromMatrixPosition(this.matrixWorld);
  47900. var r = e.distanceTo(t);
  47901. n[0].object.visible = !0;
  47902. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  47903. n[o - 1].object.visible = !1,
  47904. n[o].object.visible = !0;
  47905. for (; o < a; o++)
  47906. n[o].object.visible = !1
  47907. }
  47908. }
  47909. }(),
  47910. n.LOD.prototype.copy = function(e) {
  47911. n.Object3D.prototype.copy.call(this, e, !1);
  47912. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  47913. var o = t[i];
  47914. this.addLevel(o.object.clone(), o.distance)
  47915. }
  47916. return this
  47917. }
  47918. ,
  47919. n.LOD.prototype.toJSON = function(e) {
  47920. var t = n.Object3D.prototype.toJSON.call(this, e);
  47921. t.object.levels = [];
  47922. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  47923. var a = i[r];
  47924. t.object.levels.push({
  47925. object: a.object.uuid,
  47926. distance: a.distance
  47927. })
  47928. }
  47929. return t
  47930. }
  47931. ,
  47932. n.Sprite = function() {
  47933. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  47934. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  47935. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  47936. , r = new n.BufferGeometry;
  47937. return r.setIndex(new n.BufferAttribute(e,1)),
  47938. r.addAttribute("position", new n.BufferAttribute(t,3)),
  47939. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  47940. function(e) {
  47941. n.Object3D.call(this),
  47942. this.type = "Sprite",
  47943. this.geometry = r,
  47944. this.material = void 0 !== e ? e : new n.SpriteMaterial
  47945. }
  47946. }(),
  47947. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  47948. n.Sprite.prototype.constructor = n.Sprite,
  47949. n.Sprite.prototype.raycast = function() {
  47950. var e = new n.Vector3;
  47951. return function(t, i) {
  47952. e.setFromMatrixPosition(this.matrixWorld);
  47953. var n = t.ray.distanceSqToPoint(e)
  47954. , r = this.scale.x * this.scale.y;
  47955. n > r || i.push({
  47956. distance: Math.sqrt(n),
  47957. point: this.position,
  47958. face: null,
  47959. object: this
  47960. })
  47961. }
  47962. }(),
  47963. n.Sprite.prototype.clone = function() {
  47964. return new this.constructor(this.material).copy(this)
  47965. }
  47966. ,
  47967. n.Particle = n.Sprite,
  47968. n.LensFlare = function(e, t, i, r, o) {
  47969. n.Object3D.call(this),
  47970. this.lensFlares = [],
  47971. this.positionScreen = new n.Vector3,
  47972. this.customUpdateCallback = void 0,
  47973. void 0 !== e && this.add(e, t, i, r, o)
  47974. }
  47975. ,
  47976. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  47977. n.LensFlare.prototype.constructor = n.LensFlare,
  47978. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  47979. void 0 === t && (t = -1),
  47980. void 0 === i && (i = 0),
  47981. void 0 === a && (a = 1),
  47982. void 0 === o && (o = new n.Color(16777215)),
  47983. void 0 === r && (r = n.NormalBlending),
  47984. i = Math.min(i, Math.max(0, i)),
  47985. this.lensFlares.push({
  47986. texture: e,
  47987. size: t,
  47988. distance: i,
  47989. x: 0,
  47990. y: 0,
  47991. z: 0,
  47992. scale: 1,
  47993. rotation: 0,
  47994. opacity: a,
  47995. color: o,
  47996. blending: r
  47997. })
  47998. }
  47999. ,
  48000. n.LensFlare.prototype.updateLensFlares = function() {
  48001. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  48002. for (e = 0; e < i; e++)
  48003. t = this.lensFlares[e],
  48004. t.x = this.positionScreen.x + n * t.distance,
  48005. t.y = this.positionScreen.y + r * t.distance,
  48006. t.wantedRotation = t.x * Math.PI * .25,
  48007. t.rotation += .25 * (t.wantedRotation - t.rotation)
  48008. }
  48009. ,
  48010. n.LensFlare.prototype.copy = function(e) {
  48011. n.Object3D.prototype.copy.call(this, e),
  48012. this.positionScreen.copy(e.positionScreen),
  48013. this.customUpdateCallback = e.customUpdateCallback;
  48014. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  48015. this.lensFlares.push(e.lensFlares[t]);
  48016. return this
  48017. }
  48018. ,
  48019. n.Scene = function() {
  48020. n.Object3D.call(this),
  48021. this.type = "Scene",
  48022. this.fog = null,
  48023. this.overrideMaterial = null,
  48024. this.autoUpdate = !0
  48025. }
  48026. ,
  48027. n.Scene.prototype = Object.create(n.Object3D.prototype),
  48028. n.Scene.prototype.constructor = n.Scene,
  48029. n.Scene.prototype.copy = function(e, t) {
  48030. return n.Object3D.prototype.copy.call(this, e, t),
  48031. null !== e.fog && (this.fog = e.fog.clone()),
  48032. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  48033. this.autoUpdate = e.autoUpdate,
  48034. this.matrixAutoUpdate = e.matrixAutoUpdate,
  48035. this
  48036. }
  48037. ,
  48038. n.Fog = function(e, t, i) {
  48039. this.name = "",
  48040. this.color = new n.Color(e),
  48041. this.near = void 0 !== t ? t : 1,
  48042. this.far = void 0 !== i ? i : 1e3
  48043. }
  48044. ,
  48045. n.Fog.prototype.clone = function() {
  48046. return new n.Fog(this.color.getHex(),this.near,this.far)
  48047. }
  48048. ,
  48049. n.FogExp2 = function(e, t) {
  48050. this.name = "",
  48051. this.color = new n.Color(e),
  48052. this.density = void 0 !== t ? t : 25e-5
  48053. }
  48054. ,
  48055. n.FogExp2.prototype.clone = function() {
  48056. return new n.FogExp2(this.color.getHex(),this.density)
  48057. }
  48058. ,
  48059. n.ShaderChunk = {},
  48060. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  48061. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  48062. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  48063. n.ShaderChunk.aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",
  48064. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  48065. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  48066. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  48067. n.ShaderChunk.bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",
  48068. n.ShaderChunk.bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",
  48069. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  48070. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  48071. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  48072. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  48073. n.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",
  48074. n.ShaderChunk.cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n",
  48075. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  48076. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  48077. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  48078. n.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  48079. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  48080. n.ShaderChunk.encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",
  48081. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  48082. n.ShaderChunk.envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",
  48083. n.ShaderChunk.envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",
  48084. n.ShaderChunk.envmap_pars_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",
  48085. n.ShaderChunk.envmap_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",
  48086. n.ShaderChunk.fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",
  48087. n.ShaderChunk.fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",
  48088. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  48089. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  48090. n.ShaderChunk.lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
  48091. n.ShaderChunk.lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",
  48092. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  48093. n.ShaderChunk.lights_phong_pars_fragment = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",
  48094. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  48095. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  48096. n.ShaderChunk.lights_standard_fragment = "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",
  48097. n.ShaderChunk.lights_standard_pars_fragment = "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",
  48098. n.ShaderChunk.lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",
  48099. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  48100. n.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
  48101. n.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",
  48102. n.ShaderChunk.logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",
  48103. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  48104. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  48105. n.ShaderChunk.map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",
  48106. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  48107. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  48108. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  48109. n.ShaderChunk.morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",
  48110. n.ShaderChunk.morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif";
  48111. n.ShaderChunk.morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n";
  48112. n.ShaderChunk.normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",
  48113. n.ShaderChunk.normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",
  48114. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  48115. n.ShaderChunk.project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",
  48116. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  48117. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  48118. n.ShaderChunk.shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",
  48119. n.ShaderChunk.shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
  48120. n.ShaderChunk.shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",
  48121. n.ShaderChunk.shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",
  48122. n.ShaderChunk.skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",
  48123. n.ShaderChunk.skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",
  48124. n.ShaderChunk.skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",
  48125. n.ShaderChunk.skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",
  48126. n.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  48127. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  48128. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  48129. n.ShaderChunk.tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",
  48130. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  48131. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  48132. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  48133. n.ShaderChunk.uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",
  48134. n.ShaderChunk.uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",
  48135. n.ShaderChunk.uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",
  48136. n.ShaderChunk.worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",
  48137. n.UniformsUtils = {
  48138. merge: function(e) {
  48139. for (var t = {}, i = 0; i < e.length; i++) {
  48140. var n = this.clone(e[i]);
  48141. for (var r in n)
  48142. t[r] = n[r]
  48143. }
  48144. return t
  48145. },
  48146. clone: function(e) {
  48147. var t = {};
  48148. for (var i in e) {
  48149. t[i] = {};
  48150. for (var r in e[i]) {
  48151. var o = e[i][r];
  48152. o instanceof n.Color || o instanceof n.Vector2 || o instanceof n.Vector3 || o instanceof n.Vector4 || o instanceof n.Matrix3 || o instanceof n.Matrix4 || o instanceof n.Texture ? t[i][r] = o.clone() : Array.isArray(o) ? t[i][r] = o.slice() : t[i][r] = o
  48153. }
  48154. }
  48155. return t
  48156. }
  48157. },
  48158. n.UniformsLib = {
  48159. common: {
  48160. diffuse: {
  48161. type: "c",
  48162. value: new n.Color(15658734)
  48163. },
  48164. opacity: {
  48165. type: "f",
  48166. value: 1
  48167. },
  48168. map: {
  48169. type: "t",
  48170. value: null
  48171. },
  48172. offsetRepeat: {
  48173. type: "v4",
  48174. value: new n.Vector4(0,0,1,1)
  48175. },
  48176. specularMap: {
  48177. type: "t",
  48178. value: null
  48179. },
  48180. alphaMap: {
  48181. type: "t",
  48182. value: null
  48183. },
  48184. envMap: {
  48185. type: "t",
  48186. value: null
  48187. },
  48188. flipEnvMap: {
  48189. type: "f",
  48190. value: -1
  48191. },
  48192. reflectivity: {
  48193. type: "f",
  48194. value: 1
  48195. },
  48196. refractionRatio: {
  48197. type: "f",
  48198. value: .98
  48199. }
  48200. },
  48201. aomap: {
  48202. aoMap: {
  48203. type: "t",
  48204. value: null
  48205. },
  48206. aoMapIntensity: {
  48207. type: "f",
  48208. value: 1
  48209. }
  48210. },
  48211. lightmap: {
  48212. lightMap: {
  48213. type: "t",
  48214. value: null
  48215. },
  48216. lightMapIntensity: {
  48217. type: "f",
  48218. value: 1
  48219. }
  48220. },
  48221. emissivemap: {
  48222. emissiveMap: {
  48223. type: "t",
  48224. value: null
  48225. }
  48226. },
  48227. bumpmap: {
  48228. bumpMap: {
  48229. type: "t",
  48230. value: null
  48231. },
  48232. bumpScale: {
  48233. type: "f",
  48234. value: 1
  48235. }
  48236. },
  48237. normalmap: {
  48238. normalMap: {
  48239. type: "t",
  48240. value: null
  48241. },
  48242. normalScale: {
  48243. type: "v2",
  48244. value: new n.Vector2(1,1)
  48245. }
  48246. },
  48247. displacementmap: {
  48248. displacementMap: {
  48249. type: "t",
  48250. value: null
  48251. },
  48252. displacementScale: {
  48253. type: "f",
  48254. value: 1
  48255. },
  48256. displacementBias: {
  48257. type: "f",
  48258. value: 0
  48259. }
  48260. },
  48261. roughnessmap: {
  48262. roughnessMap: {
  48263. type: "t",
  48264. value: null
  48265. }
  48266. },
  48267. metalnessmap: {
  48268. metalnessMap: {
  48269. type: "t",
  48270. value: null
  48271. }
  48272. },
  48273. fog: {
  48274. fogDensity: {
  48275. type: "f",
  48276. value: 25e-5
  48277. },
  48278. fogNear: {
  48279. type: "f",
  48280. value: 1
  48281. },
  48282. fogFar: {
  48283. type: "f",
  48284. value: 2e3
  48285. },
  48286. fogColor: {
  48287. type: "c",
  48288. value: new n.Color(16777215)
  48289. }
  48290. },
  48291. lights: {
  48292. ambientLightColor: {
  48293. type: "fv",
  48294. value: []
  48295. },
  48296. directionalLights: {
  48297. type: "sa",
  48298. value: [],
  48299. properties: {
  48300. direction: {
  48301. type: "v3"
  48302. },
  48303. color: {
  48304. type: "c"
  48305. },
  48306. shadow: {
  48307. type: "i"
  48308. },
  48309. shadowBias: {
  48310. type: "f"
  48311. },
  48312. shadowRadius: {
  48313. type: "f"
  48314. },
  48315. shadowMapSize: {
  48316. type: "v2"
  48317. }
  48318. }
  48319. },
  48320. directionalShadowMap: {
  48321. type: "tv",
  48322. value: []
  48323. },
  48324. directionalShadowMatrix: {
  48325. type: "m4v",
  48326. value: []
  48327. },
  48328. spotLights: {
  48329. type: "sa",
  48330. value: [],
  48331. properties: {
  48332. color: {
  48333. type: "c"
  48334. },
  48335. position: {
  48336. type: "v3"
  48337. },
  48338. direction: {
  48339. type: "v3"
  48340. },
  48341. distance: {
  48342. type: "f"
  48343. },
  48344. coneCos: {
  48345. type: "f"
  48346. },
  48347. penumbraCos: {
  48348. type: "f"
  48349. },
  48350. decay: {
  48351. type: "f"
  48352. },
  48353. shadow: {
  48354. type: "i"
  48355. },
  48356. shadowBias: {
  48357. type: "f"
  48358. },
  48359. shadowRadius: {
  48360. type: "f"
  48361. },
  48362. shadowMapSize: {
  48363. type: "v2"
  48364. }
  48365. }
  48366. },
  48367. spotShadowMap: {
  48368. type: "tv",
  48369. value: []
  48370. },
  48371. spotShadowMatrix: {
  48372. type: "m4v",
  48373. value: []
  48374. },
  48375. pointLights: {
  48376. type: "sa",
  48377. value: [],
  48378. properties: {
  48379. color: {
  48380. type: "c"
  48381. },
  48382. position: {
  48383. type: "v3"
  48384. },
  48385. decay: {
  48386. type: "f"
  48387. },
  48388. distance: {
  48389. type: "f"
  48390. },
  48391. shadow: {
  48392. type: "i"
  48393. },
  48394. shadowBias: {
  48395. type: "f"
  48396. },
  48397. shadowRadius: {
  48398. type: "f"
  48399. },
  48400. shadowMapSize: {
  48401. type: "v2"
  48402. }
  48403. }
  48404. },
  48405. pointShadowMap: {
  48406. type: "tv",
  48407. value: []
  48408. },
  48409. pointShadowMatrix: {
  48410. type: "m4v",
  48411. value: []
  48412. },
  48413. hemisphereLights: {
  48414. type: "sa",
  48415. value: [],
  48416. properties: {
  48417. direction: {
  48418. type: "v3"
  48419. },
  48420. skyColor: {
  48421. type: "c"
  48422. },
  48423. groundColor: {
  48424. type: "c"
  48425. }
  48426. }
  48427. }
  48428. },
  48429. points: {
  48430. diffuse: {
  48431. type: "c",
  48432. value: new n.Color(15658734)
  48433. },
  48434. opacity: {
  48435. type: "f",
  48436. value: 1
  48437. },
  48438. size: {
  48439. type: "f",
  48440. value: 1
  48441. },
  48442. scale: {
  48443. type: "f",
  48444. value: 1
  48445. },
  48446. map: {
  48447. type: "t",
  48448. value: null
  48449. },
  48450. offsetRepeat: {
  48451. type: "v4",
  48452. value: new n.Vector4(0,0,1,1)
  48453. }
  48454. }
  48455. },
  48456. n.ShaderChunk.cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n",
  48457. n.ShaderChunk.cube_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  48458. n.ShaderChunk.depth_frag = "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n",
  48459. n.ShaderChunk.depth_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48460. n.ShaderChunk.depthRGBA_frag = "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n",
  48461. n.ShaderChunk.depthRGBA_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48462. n.ShaderChunk.distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n",
  48463. n.ShaderChunk.distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n",
  48464. n.ShaderChunk.equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n",
  48465. n.ShaderChunk.equirect_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  48466. n.ShaderChunk.linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48467. n.ShaderChunk.linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n",
  48468. n.ShaderChunk.meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48469. n.ShaderChunk.meshbasic_vert = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n",
  48470. n.ShaderChunk.meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48471. n.ShaderChunk.meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48472. n.ShaderChunk.meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48473. n.ShaderChunk.meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48474. n.ShaderChunk.meshstandard_frag = "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48475. n.ShaderChunk.meshstandard_vert = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48476. n.ShaderChunk.normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n",
  48477. n.ShaderChunk.normal_vert = "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48478. n.ShaderChunk.points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48479. n.ShaderChunk.points_vert = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48480. n.ShaderLib = {
  48481. basic: {
  48482. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  48483. vertexShader: n.ShaderChunk.meshbasic_vert,
  48484. fragmentShader: n.ShaderChunk.meshbasic_frag
  48485. },
  48486. lambert: {
  48487. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48488. emissive: {
  48489. type: "c",
  48490. value: new n.Color(0)
  48491. }
  48492. }]),
  48493. vertexShader: n.ShaderChunk.meshlambert_vert,
  48494. fragmentShader: n.ShaderChunk.meshlambert_frag
  48495. },
  48496. phong: {
  48497. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48498. emissive: {
  48499. type: "c",
  48500. value: new n.Color(0)
  48501. },
  48502. specular: {
  48503. type: "c",
  48504. value: new n.Color(1118481)
  48505. },
  48506. shininess: {
  48507. type: "f",
  48508. value: 30
  48509. }
  48510. }]),
  48511. vertexShader: n.ShaderChunk.meshphong_vert,
  48512. fragmentShader: n.ShaderChunk.meshphong_frag
  48513. },
  48514. standard: {
  48515. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.roughnessmap, n.UniformsLib.metalnessmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48516. emissive: {
  48517. type: "c",
  48518. value: new n.Color(0)
  48519. },
  48520. roughness: {
  48521. type: "f",
  48522. value: .5
  48523. },
  48524. metalness: {
  48525. type: "f",
  48526. value: 0
  48527. },
  48528. envMapIntensity: {
  48529. type: "f",
  48530. value: 1
  48531. }
  48532. }]),
  48533. vertexShader: n.ShaderChunk.meshstandard_vert,
  48534. fragmentShader: n.ShaderChunk.meshstandard_frag
  48535. },
  48536. points: {
  48537. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  48538. vertexShader: n.ShaderChunk.points_vert,
  48539. fragmentShader: n.ShaderChunk.points_frag
  48540. },
  48541. dashed: {
  48542. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  48543. scale: {
  48544. type: "f",
  48545. value: 1
  48546. },
  48547. dashSize: {
  48548. type: "f",
  48549. value: 1
  48550. },
  48551. totalSize: {
  48552. type: "f",
  48553. value: 2
  48554. }
  48555. }]),
  48556. vertexShader: n.ShaderChunk.linedashed_vert,
  48557. fragmentShader: n.ShaderChunk.linedashed_frag
  48558. },
  48559. depth: {
  48560. uniforms: {
  48561. mNear: {
  48562. type: "f",
  48563. value: 1
  48564. },
  48565. mFar: {
  48566. type: "f",
  48567. value: 2e3
  48568. },
  48569. opacity: {
  48570. type: "f",
  48571. value: 1
  48572. }
  48573. },
  48574. vertexShader: n.ShaderChunk.depth_vert,
  48575. fragmentShader: n.ShaderChunk.depth_frag
  48576. },
  48577. normal: {
  48578. uniforms: {
  48579. opacity: {
  48580. type: "f",
  48581. value: 1
  48582. }
  48583. },
  48584. vertexShader: n.ShaderChunk.normal_vert,
  48585. fragmentShader: n.ShaderChunk.normal_frag
  48586. },
  48587. cube: {
  48588. uniforms: {
  48589. tCube: {
  48590. type: "t",
  48591. value: null
  48592. },
  48593. tFlip: {
  48594. type: "f",
  48595. value: -1
  48596. }
  48597. },
  48598. vertexShader: n.ShaderChunk.cube_vert,
  48599. fragmentShader: n.ShaderChunk.cube_frag
  48600. },
  48601. equirect: {
  48602. uniforms: {
  48603. tEquirect: {
  48604. type: "t",
  48605. value: null
  48606. },
  48607. tFlip: {
  48608. type: "f",
  48609. value: -1
  48610. }
  48611. },
  48612. vertexShader: n.ShaderChunk.equirect_vert,
  48613. fragmentShader: n.ShaderChunk.equirect_frag
  48614. },
  48615. depthRGBA: {
  48616. uniforms: {},
  48617. vertexShader: n.ShaderChunk.depthRGBA_vert,
  48618. fragmentShader: n.ShaderChunk.depthRGBA_frag
  48619. },
  48620. distanceRGBA: {
  48621. uniforms: {
  48622. lightPos: {
  48623. type: "v3",
  48624. value: new n.Vector3(0,0,0)
  48625. }
  48626. },
  48627. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  48628. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  48629. }
  48630. },
  48631. n.WebGLRenderer = function(e) {
  48632. function t() {
  48633. return null === ye ? Oe : 1
  48634. }
  48635. function i(e, t, i, n) {
  48636. se === !0 && (e *= n,
  48637. t *= n,
  48638. i *= n),
  48639. Ye.clearColor(e, t, i, n)
  48640. }
  48641. function r() {
  48642. Ye.init(),
  48643. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  48644. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  48645. i(Se.r, Se.g, Se.b, Me)
  48646. }
  48647. function o() {
  48648. Ae = null,
  48649. be = null,
  48650. Ee = "",
  48651. Ie = -1,
  48652. Ye.reset()
  48653. }
  48654. function a(e) {
  48655. e.preventDefault(),
  48656. o(),
  48657. r(),
  48658. Xe.clear()
  48659. }
  48660. function s(e) {
  48661. var t = e.target;
  48662. t.removeEventListener("dispose", s),
  48663. h(t),
  48664. ke.textures--
  48665. }
  48666. function l(e) {
  48667. var t = e.target;
  48668. t.removeEventListener("dispose", l),
  48669. u(t),
  48670. ke.textures--
  48671. }
  48672. function c(e) {
  48673. var t = e.target;
  48674. t.removeEventListener("dispose", c),
  48675. d(t)
  48676. }
  48677. function h(e) {
  48678. var t = Xe.get(e);
  48679. if (e.image && t.__image__webglTextureCube)
  48680. Ge.deleteTexture(t.__image__webglTextureCube);
  48681. else {
  48682. if (void 0 === t.__webglInit)
  48683. return;
  48684. Ge.deleteTexture(t.__webglTexture)
  48685. }
  48686. Xe.delete(e)
  48687. }
  48688. function u(e) {
  48689. var t = Xe.get(e)
  48690. , i = Xe.get(e.texture);
  48691. if (e && void 0 !== i.__webglTexture) {
  48692. if (Ge.deleteTexture(i.__webglTexture),
  48693. e instanceof n.WebGLRenderTargetCube)
  48694. for (var r = 0; r < 6; r++)
  48695. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  48696. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  48697. else
  48698. Ge.deleteFramebuffer(t.__webglFramebuffer),
  48699. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  48700. Xe.delete(e.texture),
  48701. Xe.delete(e)
  48702. }
  48703. }
  48704. function d(e) {
  48705. p(e),
  48706. Xe.delete(e)
  48707. }
  48708. function p(e) {
  48709. var t = Xe.get(e).program;
  48710. e.program = void 0,
  48711. void 0 !== t && qe.releaseProgram(t)
  48712. }
  48713. function f(e, t, i, r) {
  48714. var o;
  48715. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  48716. null === o))
  48717. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  48718. void 0 === r && (r = 0),
  48719. Ye.initAttributes();
  48720. var a = i.attributes
  48721. , s = t.getAttributes()
  48722. , l = e.defaultAttributeValues;
  48723. for (var c in s) {
  48724. var h = s[c];
  48725. if (h >= 0) {
  48726. var u = a[c];
  48727. if (void 0 !== u) {
  48728. var d = u.itemSize
  48729. , p = Ze.getAttributeBuffer(u);
  48730. if (u instanceof n.InterleavedBufferAttribute) {
  48731. var f = u.data
  48732. , g = f.stride
  48733. , m = u.offset;
  48734. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  48735. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  48736. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  48737. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  48738. } else
  48739. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  48740. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  48741. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  48742. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  48743. } else if (void 0 !== l) {
  48744. var v = l[c];
  48745. if (void 0 !== v)
  48746. switch (v.length) {
  48747. case 2:
  48748. Ge.vertexAttrib2fv(h, v);
  48749. break;
  48750. case 3:
  48751. Ge.vertexAttrib3fv(h, v);
  48752. break;
  48753. case 4:
  48754. Ge.vertexAttrib4fv(h, v);
  48755. break;
  48756. default:
  48757. Ge.vertexAttrib1fv(h, v)
  48758. }
  48759. }
  48760. }
  48761. }
  48762. Ye.disableUnusedAttributes()
  48763. }
  48764. function g(e, t) {
  48765. return Math.abs(t[0]) - Math.abs(e[0])
  48766. }
  48767. function m(e, t) {
  48768. 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
  48769. }
  48770. function v(e, t) {
  48771. 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
  48772. }
  48773. function A(e, t, i, n, r) {
  48774. var o, a;
  48775. i.transparent ? (o = de,
  48776. a = ++pe) : (o = he,
  48777. a = ++ue);
  48778. var s = o[a];
  48779. void 0 !== s ? (s.id = e.id,
  48780. s.object = e,
  48781. s.geometry = t,
  48782. s.material = i,
  48783. s.z = Ve.z,
  48784. s.group = r) : (s = {
  48785. id: e.id,
  48786. object: e,
  48787. geometry: t,
  48788. material: i,
  48789. z: Ve.z,
  48790. group: r
  48791. },
  48792. o.push(s))
  48793. }
  48794. function y(e, t) {
  48795. if (e.visible !== !1) {
  48796. if (e.layers.test(t.layers))
  48797. if (e instanceof n.Light)
  48798. ce.push(e);
  48799. else if (e instanceof n.Sprite)
  48800. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  48801. else if (e instanceof n.LensFlare)
  48802. me.push(e);
  48803. else if (e instanceof n.ImmediateRenderObject)
  48804. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  48805. Ve.applyProjection(Fe)),
  48806. A(e, null, e.material, Ve.z, null);
  48807. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  48808. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  48809. var i = e.material;
  48810. if (i.visible === !0) {
  48811. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  48812. Ve.applyProjection(Fe));
  48813. var r = Ze.update(e);
  48814. if (i instanceof n.MultiMaterial)
  48815. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  48816. var c = o[s]
  48817. , h = a[c.materialIndex];
  48818. h.visible === !0 && A(e, r, h, Ve.z, c)
  48819. }
  48820. else
  48821. A(e, r, i, Ve.z, null)
  48822. }
  48823. }
  48824. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  48825. y(u[s], t)
  48826. }
  48827. }
  48828. function C(e, t, i, r) {
  48829. for (var o = 0, a = e.length; o < a; o++) {
  48830. var s = e[o]
  48831. , l = s.object
  48832. , c = s.geometry
  48833. , h = void 0 === r ? s.material : r
  48834. , u = s.group;
  48835. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  48836. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  48837. l instanceof n.ImmediateRenderObject) {
  48838. E(h);
  48839. var d = w(t, i, h, l);
  48840. Ee = "",
  48841. l.render(function(e) {
  48842. ve.renderBufferImmediate(e, d, h)
  48843. })
  48844. } else
  48845. ve.renderBufferDirect(t, i, c, h, l, u)
  48846. }
  48847. }
  48848. function I(e, t, i) {
  48849. var r = Xe.get(e)
  48850. , o = qe.getParameters(e, Ue, t, i)
  48851. , a = qe.getProgramCode(e, o)
  48852. , s = r.program
  48853. , l = !0;
  48854. if (void 0 === s)
  48855. e.addEventListener("dispose", c);
  48856. else if (s.code !== a)
  48857. p(e);
  48858. else {
  48859. if (void 0 !== o.shaderID)
  48860. return;
  48861. l = !1
  48862. }
  48863. if (l) {
  48864. if (o.shaderID) {
  48865. var h = n.ShaderLib[o.shaderID];
  48866. r.__webglShader = {
  48867. name: e.type,
  48868. uniforms: n.UniformsUtils.clone(h.uniforms),
  48869. vertexShader: h.vertexShader,
  48870. fragmentShader: h.fragmentShader
  48871. }
  48872. } else
  48873. r.__webglShader = {
  48874. name: e.type,
  48875. uniforms: e.uniforms,
  48876. vertexShader: e.vertexShader,
  48877. fragmentShader: e.fragmentShader
  48878. };
  48879. e.__webglShader = r.__webglShader,
  48880. s = qe.acquireProgram(e, o, a),
  48881. r.program = s,
  48882. e.program = s
  48883. }
  48884. var u = s.getAttributes();
  48885. if (e.morphTargets) {
  48886. e.numSupportedMorphTargets = 0;
  48887. for (var d = 0; d < ve.maxMorphTargets; d++)
  48888. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  48889. }
  48890. if (e.morphNormals) {
  48891. e.numSupportedMorphNormals = 0;
  48892. for (var d = 0; d < ve.maxMorphNormals; d++)
  48893. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  48894. }
  48895. r.uniformsList = [];
  48896. var f = r.__webglShader.uniforms
  48897. , g = r.program.getUniforms();
  48898. for (var m in f) {
  48899. var v = g[m];
  48900. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  48901. }
  48902. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  48903. f.ambientLightColor.value = Ue.ambient,
  48904. f.directionalLights.value = Ue.directional,
  48905. f.spotLights.value = Ue.spot,
  48906. f.pointLights.value = Ue.point,
  48907. f.hemisphereLights.value = Ue.hemi,
  48908. f.directionalShadowMap.value = Ue.directionalShadowMap,
  48909. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  48910. f.spotShadowMap.value = Ue.spotShadowMap,
  48911. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  48912. f.pointShadowMap.value = Ue.pointShadowMap,
  48913. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  48914. r.hasDynamicUniforms = !1;
  48915. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  48916. var C = r.uniformsList[A][0];
  48917. if (C.dynamic === !0) {
  48918. r.hasDynamicUniforms = !0;
  48919. break
  48920. }
  48921. }
  48922. }
  48923. function E(e) {
  48924. b(e),
  48925. e.transparent === !0 ? Ye.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : Ye.setBlending(n.NoBlending),
  48926. Ye.setDepthFunc(e.depthFunc),
  48927. Ye.setDepthTest(e.depthTest),
  48928. Ye.setDepthWrite(e.depthWrite),
  48929. Ye.setColorWrite(e.colorWrite),
  48930. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48931. }
  48932. function b(e) {
  48933. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  48934. Ye.setFlipSided(e.side === n.BackSide)
  48935. }
  48936. function w(e, t, i, r) {
  48937. xe = 0;
  48938. var o = Xe.get(i);
  48939. void 0 === o.program && (i.needsUpdate = !0),
  48940. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  48941. i.needsUpdate && (I(i, t, r),
  48942. i.needsUpdate = !1);
  48943. var a = !1
  48944. , s = !1
  48945. , l = !1
  48946. , c = o.program
  48947. , h = c.getUniforms()
  48948. , u = o.__webglShader.uniforms;
  48949. if (c.id !== Ae && (Ge.useProgram(c.program),
  48950. Ae = c.id,
  48951. a = !0,
  48952. s = !0,
  48953. l = !0),
  48954. i.id !== Ie && (Ie = i.id,
  48955. s = !0),
  48956. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  48957. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48958. e !== be && (be = e,
  48959. s = !0,
  48960. l = !0),
  48961. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  48962. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  48963. (i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshBasicMaterial || i instanceof n.MeshStandardMaterial || i instanceof n.ShaderMaterial || i.skinning) && void 0 !== h.viewMatrix && Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  48964. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  48965. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  48966. i.skinning)
  48967. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  48968. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  48969. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  48970. if (void 0 !== h.boneTexture) {
  48971. var d = B();
  48972. Ge.uniform1i(h.boneTexture, d),
  48973. ve.setTexture(r.skeleton.boneTexture, d)
  48974. }
  48975. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  48976. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  48977. } else
  48978. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  48979. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  48980. t && i.fog && R(u, t),
  48981. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  48982. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  48983. S(u, i)) : i instanceof n.PointsMaterial ? M(u, i) : i instanceof n.MeshLambertMaterial ? P(u, i) : i instanceof n.MeshPhongMaterial ? O(u, i) : i instanceof n.MeshStandardMaterial ? L(u, i) : i instanceof n.MeshDepthMaterial ? (u.mNear.value = e.near,
  48984. u.mFar.value = e.far,
  48985. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  48986. V(o.uniformsList)),
  48987. N(h, r),
  48988. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  48989. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  48990. c
  48991. }
  48992. function _(e, t, i) {
  48993. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48994. var a = e[r][0]
  48995. , s = a.onUpdateCallback;
  48996. void 0 !== s && (s.bind(a)(t, i),
  48997. n.push(e[r]))
  48998. }
  48999. V(n)
  49000. }
  49001. function T(e, t) {
  49002. e.opacity.value = t.opacity,
  49003. e.diffuse.value = t.color,
  49004. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  49005. e.map.value = t.map,
  49006. e.specularMap.value = t.specularMap,
  49007. e.alphaMap.value = t.alphaMap,
  49008. t.aoMap && (e.aoMap.value = t.aoMap,
  49009. e.aoMapIntensity.value = t.aoMapIntensity);
  49010. var i;
  49011. if (t.map ? i = t.map : t.specularMap ? i = t.specularMap : t.displacementMap ? i = t.displacementMap : t.normalMap ? i = t.normalMap : t.bumpMap ? i = t.bumpMap : t.roughnessMap ? i = t.roughnessMap : t.metalnessMap ? i = t.metalnessMap : t.alphaMap ? i = t.alphaMap : t.emissiveMap && (i = t.emissiveMap),
  49012. void 0 !== i) {
  49013. i instanceof n.WebGLRenderTarget && (i = i.texture);
  49014. var r = i.offset
  49015. , o = i.repeat;
  49016. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  49017. }
  49018. e.envMap.value = t.envMap,
  49019. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  49020. e.reflectivity.value = t.reflectivity,
  49021. e.refractionRatio.value = t.refractionRatio
  49022. }
  49023. function x(e, t) {
  49024. e.diffuse.value = t.color,
  49025. e.opacity.value = t.opacity
  49026. }
  49027. function S(e, t) {
  49028. e.dashSize.value = t.dashSize,
  49029. e.totalSize.value = t.dashSize + t.gapSize,
  49030. e.scale.value = t.scale
  49031. }
  49032. function M(e, t) {
  49033. if (e.diffuse.value = t.color,
  49034. e.opacity.value = t.opacity,
  49035. e.size.value = t.size * Oe,
  49036. e.scale.value = te.clientHeight / 2,
  49037. e.map.value = t.map,
  49038. null !== t.map) {
  49039. var i = t.map.offset
  49040. , n = t.map.repeat;
  49041. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  49042. }
  49043. }
  49044. function R(e, t) {
  49045. e.fogColor.value = t.color,
  49046. t instanceof n.Fog ? (e.fogNear.value = t.near,
  49047. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  49048. }
  49049. function P(e, t) {
  49050. t.lightMap && (e.lightMap.value = t.lightMap,
  49051. e.lightMapIntensity.value = t.lightMapIntensity),
  49052. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  49053. }
  49054. function O(e, t) {
  49055. e.specular.value = t.specular,
  49056. e.shininess.value = Math.max(t.shininess, 1e-4),
  49057. t.lightMap && (e.lightMap.value = t.lightMap,
  49058. e.lightMapIntensity.value = t.lightMapIntensity),
  49059. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49060. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49061. e.bumpScale.value = t.bumpScale),
  49062. t.normalMap && (e.normalMap.value = t.normalMap,
  49063. e.normalScale.value.copy(t.normalScale)),
  49064. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49065. e.displacementScale.value = t.displacementScale,
  49066. e.displacementBias.value = t.displacementBias)
  49067. }
  49068. function L(e, t) {
  49069. e.roughness.value = t.roughness,
  49070. e.metalness.value = t.metalness,
  49071. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  49072. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  49073. t.lightMap && (e.lightMap.value = t.lightMap,
  49074. e.lightMapIntensity.value = t.lightMapIntensity),
  49075. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49076. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49077. e.bumpScale.value = t.bumpScale),
  49078. t.normalMap && (e.normalMap.value = t.normalMap,
  49079. e.normalScale.value.copy(t.normalScale)),
  49080. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49081. e.displacementScale.value = t.displacementScale,
  49082. e.displacementBias.value = t.displacementBias),
  49083. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  49084. }
  49085. function D(e, t) {
  49086. e.ambientLightColor.needsUpdate = t,
  49087. e.directionalLights.needsUpdate = t,
  49088. e.pointLights.needsUpdate = t,
  49089. e.spotLights.needsUpdate = t,
  49090. e.hemisphereLights.needsUpdate = t
  49091. }
  49092. function N(e, t) {
  49093. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  49094. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  49095. }
  49096. function B() {
  49097. var e = xe;
  49098. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  49099. xe += 1,
  49100. e
  49101. }
  49102. function F(e, t, i, r) {
  49103. var o, a;
  49104. if ("1i" === t)
  49105. Ge.uniform1i(i, r);
  49106. else if ("1f" === t)
  49107. Ge.uniform1f(i, r);
  49108. else if ("2f" === t)
  49109. Ge.uniform2f(i, r[0], r[1]);
  49110. else if ("3f" === t)
  49111. Ge.uniform3f(i, r[0], r[1], r[2]);
  49112. else if ("4f" === t)
  49113. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  49114. else if ("1iv" === t)
  49115. Ge.uniform1iv(i, r);
  49116. else if ("3iv" === t)
  49117. Ge.uniform3iv(i, r);
  49118. else if ("1fv" === t)
  49119. Ge.uniform1fv(i, r);
  49120. else if ("2fv" === t)
  49121. Ge.uniform2fv(i, r);
  49122. else if ("3fv" === t)
  49123. Ge.uniform3fv(i, r);
  49124. else if ("4fv" === t)
  49125. Ge.uniform4fv(i, r);
  49126. else if ("Matrix2fv" === t)
  49127. Ge.uniformMatrix2fv(i, !1, r);
  49128. else if ("Matrix3fv" === t)
  49129. Ge.uniformMatrix3fv(i, !1, r);
  49130. else if ("Matrix4fv" === t)
  49131. Ge.uniformMatrix4fv(i, !1, r);
  49132. else if ("i" === t)
  49133. Ge.uniform1i(i, r);
  49134. else if ("f" === t)
  49135. Ge.uniform1f(i, r);
  49136. else if ("v2" === t)
  49137. Ge.uniform2f(i, r.x, r.y);
  49138. else if ("v3" === t)
  49139. Ge.uniform3f(i, r.x, r.y, r.z);
  49140. else if ("v4" === t)
  49141. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  49142. else if ("c" === t)
  49143. Ge.uniform3f(i, r.r, r.g, r.b);
  49144. else if ("s" === t) {
  49145. var s = e.properties;
  49146. for (var l in s) {
  49147. var c = s[l]
  49148. , h = i[l]
  49149. , u = r[l];
  49150. F(c, c.type, h, u)
  49151. }
  49152. } else if ("sa" === t)
  49153. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  49154. for (var l in s) {
  49155. var c = s[l]
  49156. , h = i[d][l]
  49157. , u = r[d][l];
  49158. F(c, c.type, h, u)
  49159. }
  49160. else if ("iv1" === t)
  49161. Ge.uniform1iv(i, r);
  49162. else if ("iv" === t)
  49163. Ge.uniform3iv(i, r);
  49164. else if ("fv1" === t)
  49165. Ge.uniform1fv(i, r);
  49166. else if ("fv" === t)
  49167. Ge.uniform3fv(i, r);
  49168. else if ("v2v" === t) {
  49169. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  49170. for (var d = 0, f = 0, g = r.length; d < g; d++,
  49171. f += 2)
  49172. e._array[f + 0] = r[d].x,
  49173. e._array[f + 1] = r[d].y;
  49174. Ge.uniform2fv(i, e._array)
  49175. } else if ("v3v" === t) {
  49176. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  49177. for (var d = 0, m = 0, g = r.length; d < g; d++,
  49178. m += 3)
  49179. e._array[m + 0] = r[d].x,
  49180. e._array[m + 1] = r[d].y,
  49181. e._array[m + 2] = r[d].z;
  49182. Ge.uniform3fv(i, e._array)
  49183. } else if ("v4v" === t) {
  49184. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  49185. for (var d = 0, v = 0, g = r.length; d < g; d++,
  49186. v += 4)
  49187. e._array[v + 0] = r[d].x,
  49188. e._array[v + 1] = r[d].y,
  49189. e._array[v + 2] = r[d].z,
  49190. e._array[v + 3] = r[d].w;
  49191. Ge.uniform4fv(i, e._array)
  49192. } else if ("m2" === t)
  49193. Ge.uniformMatrix2fv(i, !1, r.elements);
  49194. else if ("m3" === t)
  49195. Ge.uniformMatrix3fv(i, !1, r.elements);
  49196. else if ("m3v" === t) {
  49197. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  49198. for (var d = 0, g = r.length; d < g; d++)
  49199. r[d].flattenToArrayOffset(e._array, 9 * d);
  49200. Ge.uniformMatrix3fv(i, !1, e._array)
  49201. } else if ("m4" === t)
  49202. Ge.uniformMatrix4fv(i, !1, r.elements);
  49203. else if ("m4v" === t) {
  49204. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  49205. for (var d = 0, g = r.length; d < g; d++)
  49206. r[d].flattenToArrayOffset(e._array, 16 * d);
  49207. Ge.uniformMatrix4fv(i, !1, e._array)
  49208. } else if ("t" === t) {
  49209. if (o = r,
  49210. a = B(),
  49211. Ge.uniform1i(i, a),
  49212. !o)
  49213. return;
  49214. o instanceof n.CubeTexture || Array.isArray(o.image) && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : ve.setTexture(o, a)
  49215. } else if ("tv" === t) {
  49216. void 0 === e._array && (e._array = []);
  49217. for (var d = 0, g = e.value.length; d < g; d++)
  49218. e._array[d] = B();
  49219. Ge.uniform1iv(i, e._array);
  49220. for (var d = 0, g = e.value.length; d < g; d++)
  49221. o = e.value[d],
  49222. a = e._array[d],
  49223. o && (o instanceof n.CubeTexture || o.image instanceof Array && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : ve.setTexture(o, a))
  49224. } else
  49225. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  49226. }
  49227. function V(e) {
  49228. for (var t = 0, i = e.length; t < i; t++) {
  49229. var n = e[t][0];
  49230. if (n.needsUpdate !== !1) {
  49231. var r = n.type
  49232. , o = e[t][1]
  49233. , a = n.value;
  49234. F(n, r, o, a)
  49235. }
  49236. }
  49237. }
  49238. function U(e, t) {
  49239. var i, r, o, a, s, l, c = 0, h = 0, u = 0, d = t.matrixWorldInverse, p = 0, f = 0, g = 0, m = 0, v = 0;
  49240. for (Ue.shadowsPointLight = 0,
  49241. i = 0,
  49242. r = e.length; i < r; i++)
  49243. if (o = e[i],
  49244. a = o.color,
  49245. s = o.intensity,
  49246. l = o.distance,
  49247. o instanceof n.AmbientLight)
  49248. c += a.r * s,
  49249. h += a.g * s,
  49250. u += a.b * s;
  49251. else if (o instanceof n.DirectionalLight) {
  49252. var A = Ke.get(o);
  49253. A.color.copy(o.color).multiplyScalar(o.intensity),
  49254. A.direction.setFromMatrixPosition(o.matrixWorld),
  49255. Ve.setFromMatrixPosition(o.target.matrixWorld),
  49256. A.direction.sub(Ve),
  49257. A.direction.transformDirection(d),
  49258. A.shadow = o.castShadow,
  49259. o.castShadow && (A.shadowBias = o.shadow.bias,
  49260. A.shadowRadius = o.shadow.radius,
  49261. A.shadowMapSize = o.shadow.mapSize,
  49262. Ue.shadows[v++] = o),
  49263. Ue.directionalShadowMap[p] = o.shadow.map,
  49264. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  49265. Ue.directional[p++] = A
  49266. } else if (o instanceof n.SpotLight) {
  49267. var A = Ke.get(o);
  49268. A.position.setFromMatrixPosition(o.matrixWorld),
  49269. A.position.applyMatrix4(d),
  49270. A.color.copy(a).multiplyScalar(s),
  49271. A.distance = l,
  49272. A.direction.setFromMatrixPosition(o.matrixWorld),
  49273. Ve.setFromMatrixPosition(o.target.matrixWorld),
  49274. A.direction.sub(Ve),
  49275. A.direction.transformDirection(d),
  49276. A.coneCos = Math.cos(o.angle),
  49277. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  49278. A.decay = 0 === o.distance ? 0 : o.decay,
  49279. A.shadow = o.castShadow,
  49280. o.castShadow && (A.shadowBias = o.shadow.bias,
  49281. A.shadowRadius = o.shadow.radius,
  49282. A.shadowMapSize = o.shadow.mapSize,
  49283. Ue.shadows[v++] = o),
  49284. Ue.spotShadowMap[g] = o.shadow.map,
  49285. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  49286. Ue.spot[g++] = A
  49287. } else if (o instanceof n.PointLight) {
  49288. var A = Ke.get(o);
  49289. A.position.setFromMatrixPosition(o.matrixWorld),
  49290. A.position.applyMatrix4(d),
  49291. A.color.copy(o.color).multiplyScalar(o.intensity),
  49292. A.distance = o.distance,
  49293. A.decay = 0 === o.distance ? 0 : o.decay,
  49294. A.shadow = o.castShadow,
  49295. o.castShadow && (A.shadowBias = o.shadow.bias,
  49296. A.shadowRadius = o.shadow.radius,
  49297. A.shadowMapSize = o.shadow.mapSize,
  49298. Ue.shadows[v++] = o),
  49299. Ue.pointShadowMap[f] = o.shadow.map,
  49300. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  49301. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  49302. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  49303. Ue.point[f++] = A
  49304. } else if (o instanceof n.HemisphereLight) {
  49305. var A = Ke.get(o);
  49306. A.direction.setFromMatrixPosition(o.matrixWorld),
  49307. A.direction.transformDirection(d),
  49308. A.direction.normalize(),
  49309. A.skyColor.copy(o.color).multiplyScalar(s),
  49310. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  49311. Ue.hemi[m++] = A
  49312. }
  49313. Ue.ambient[0] = c,
  49314. Ue.ambient[1] = h,
  49315. Ue.ambient[2] = u,
  49316. Ue.directional.length = p,
  49317. Ue.spot.length = g,
  49318. Ue.point.length = f,
  49319. Ue.hemi.length = m,
  49320. Ue.shadows.length = v,
  49321. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  49322. }
  49323. function k(e, t, i) {
  49324. var r;
  49325. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  49326. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  49327. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  49328. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  49329. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  49330. t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  49331. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  49332. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  49333. t.minFilter !== n.NearestFilter && t.minFilter !== n.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  49334. r = We.get("EXT_texture_filter_anisotropic")) {
  49335. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  49336. return;
  49337. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  49338. return;
  49339. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  49340. Xe.get(t).__currentAnisotropy = t.anisotropy)
  49341. }
  49342. }
  49343. function H(e, t, i) {
  49344. void 0 === e.__webglInit && (e.__webglInit = !0,
  49345. t.addEventListener("dispose", s),
  49346. e.__webglTexture = Ge.createTexture(),
  49347. ke.textures++),
  49348. Ye.activeTexture(Ge.TEXTURE0 + i),
  49349. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  49350. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49351. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49352. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  49353. var r = G(t.image, je.maxTextureSize);
  49354. W(t) && z(r) === !1 && (r = j(r));
  49355. var o = z(r)
  49356. , a = ee(t.format)
  49357. , l = ee(t.type);
  49358. k(Ge.TEXTURE_2D, t, o);
  49359. var c, h = t.mipmaps;
  49360. if (t instanceof n.DataTexture)
  49361. if (h.length > 0 && o) {
  49362. for (var u = 0, d = h.length; u < d; u++)
  49363. c = h[u],
  49364. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  49365. t.generateMipmaps = !1
  49366. } else
  49367. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  49368. else if (t instanceof n.CompressedTexture)
  49369. for (var u = 0, d = h.length; u < d; u++)
  49370. c = h[u],
  49371. t.format !== n.RGBAFormat && t.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(a) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  49372. else if (h.length > 0 && o) {
  49373. for (var u = 0, d = h.length; u < d; u++)
  49374. c = h[u],
  49375. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  49376. t.generateMipmaps = !1
  49377. } else
  49378. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  49379. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  49380. e.__version = t.version,
  49381. t.onUpdate && t.onUpdate(t)
  49382. }
  49383. function G(e, t) {
  49384. if (e.width > t || e.height > t) {
  49385. var i = t / Math.max(e.width, e.height)
  49386. , n = document.createElement("canvas");
  49387. n.width = Math.floor(e.width * i),
  49388. n.height = Math.floor(e.height * i);
  49389. var r = n.getContext("2d");
  49390. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49391. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49392. n
  49393. }
  49394. return e
  49395. }
  49396. function z(e) {
  49397. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  49398. }
  49399. function W(e) {
  49400. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  49401. }
  49402. function j(e) {
  49403. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49404. var t = document.createElement("canvas");
  49405. t.width = n.Math.nearestPowerOfTwo(e.width),
  49406. t.height = n.Math.nearestPowerOfTwo(e.height);
  49407. var i = t.getContext("2d");
  49408. return i.drawImage(e, 0, 0, t.width, t.height),
  49409. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49410. t
  49411. }
  49412. return e
  49413. }
  49414. function Y(e, t) {
  49415. var i = Xe.get(e);
  49416. if (6 === e.image.length)
  49417. if (e.version > 0 && i.__version !== e.version) {
  49418. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  49419. i.__image__webglTextureCube = Ge.createTexture(),
  49420. ke.textures++),
  49421. Ye.activeTexture(Ge.TEXTURE0 + t),
  49422. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49423. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49424. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  49425. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  49426. var c = a[0]
  49427. , h = z(c)
  49428. , u = ee(e.format)
  49429. , d = ee(e.type);
  49430. k(Ge.TEXTURE_CUBE_MAP, e, h);
  49431. for (var l = 0; l < 6; l++)
  49432. if (r)
  49433. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  49434. p = f[g],
  49435. e.format !== n.RGBAFormat && e.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(u) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, p.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, u, d, p.data);
  49436. else
  49437. o ? Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, a[l].width, a[l].height, 0, u, d, a[l].data) : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l]);
  49438. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  49439. i.__version = e.version,
  49440. e.onUpdate && e.onUpdate(e)
  49441. } else
  49442. Ye.activeTexture(Ge.TEXTURE0 + t),
  49443. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49444. }
  49445. function X(e, t) {
  49446. Ye.activeTexture(Ge.TEXTURE0 + t),
  49447. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  49448. }
  49449. function Z(e, t, i, n) {
  49450. var r = ee(t.texture.format)
  49451. , o = ee(t.texture.type);
  49452. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49453. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  49454. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  49455. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  49456. }
  49457. function q(e, t) {
  49458. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  49459. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  49460. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_ATTACHMENT, Ge.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  49461. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  49462. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  49463. }
  49464. function K(e) {
  49465. var t = Xe.get(e)
  49466. , i = e instanceof n.WebGLRenderTargetCube;
  49467. if (i) {
  49468. t.__webglDepthbuffer = [];
  49469. for (var r = 0; r < 6; r++)
  49470. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  49471. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  49472. q(t.__webglDepthbuffer[r], e)
  49473. } else
  49474. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  49475. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  49476. q(t.__webglDepthbuffer, e);
  49477. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  49478. }
  49479. function Q(e) {
  49480. var t = Xe.get(e)
  49481. , i = Xe.get(e.texture);
  49482. e.addEventListener("dispose", l),
  49483. i.__webglTexture = Ge.createTexture(),
  49484. ke.textures++;
  49485. var r = e instanceof n.WebGLRenderTargetCube
  49486. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  49487. if (r) {
  49488. t.__webglFramebuffer = [];
  49489. for (var a = 0; a < 6; a++)
  49490. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  49491. } else
  49492. t.__webglFramebuffer = Ge.createFramebuffer();
  49493. if (r) {
  49494. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  49495. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  49496. for (var a = 0; a < 6; a++)
  49497. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  49498. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  49499. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  49500. } else
  49501. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  49502. k(Ge.TEXTURE_2D, e.texture, o),
  49503. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  49504. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  49505. Ye.bindTexture(Ge.TEXTURE_2D, null);
  49506. e.depthBuffer && K(e)
  49507. }
  49508. function J(e) {
  49509. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  49510. , i = Xe.get(e.texture).__webglTexture;
  49511. Ye.bindTexture(t, i),
  49512. Ge.generateMipmap(t),
  49513. Ye.bindTexture(t, null)
  49514. }
  49515. function $(e) {
  49516. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  49517. }
  49518. function ee(e) {
  49519. var t;
  49520. if (e === n.RepeatWrapping)
  49521. return Ge.REPEAT;
  49522. if (e === n.ClampToEdgeWrapping)
  49523. return Ge.CLAMP_TO_EDGE;
  49524. if (e === n.MirroredRepeatWrapping)
  49525. return Ge.MIRRORED_REPEAT;
  49526. if (e === n.NearestFilter)
  49527. return Ge.NEAREST;
  49528. if (e === n.NearestMipMapNearestFilter)
  49529. return Ge.NEAREST_MIPMAP_NEAREST;
  49530. if (e === n.NearestMipMapLinearFilter)
  49531. return Ge.NEAREST_MIPMAP_LINEAR;
  49532. if (e === n.LinearFilter)
  49533. return Ge.LINEAR;
  49534. if (e === n.LinearMipMapNearestFilter)
  49535. return Ge.LINEAR_MIPMAP_NEAREST;
  49536. if (e === n.LinearMipMapLinearFilter)
  49537. return Ge.LINEAR_MIPMAP_LINEAR;
  49538. if (e === n.UnsignedByteType)
  49539. return Ge.UNSIGNED_BYTE;
  49540. if (e === n.UnsignedShort4444Type)
  49541. return Ge.UNSIGNED_SHORT_4_4_4_4;
  49542. if (e === n.UnsignedShort5551Type)
  49543. return Ge.UNSIGNED_SHORT_5_5_5_1;
  49544. if (e === n.UnsignedShort565Type)
  49545. return Ge.UNSIGNED_SHORT_5_6_5;
  49546. if (e === n.ByteType)
  49547. return Ge.BYTE;
  49548. if (e === n.ShortType)
  49549. return Ge.SHORT;
  49550. if (e === n.UnsignedShortType)
  49551. return Ge.UNSIGNED_SHORT;
  49552. if (e === n.IntType)
  49553. return Ge.INT;
  49554. if (e === n.UnsignedIntType)
  49555. return Ge.UNSIGNED_INT;
  49556. if (e === n.FloatType)
  49557. return Ge.FLOAT;
  49558. if (t = We.get("OES_texture_half_float"),
  49559. null !== t && e === n.HalfFloatType)
  49560. return t.HALF_FLOAT_OES;
  49561. if (e === n.AlphaFormat)
  49562. return Ge.ALPHA;
  49563. if (e === n.RGBFormat)
  49564. return Ge.RGB;
  49565. if (e === n.RGBAFormat)
  49566. return Ge.RGBA;
  49567. if (e === n.LuminanceFormat)
  49568. return Ge.LUMINANCE;
  49569. if (e === n.LuminanceAlphaFormat)
  49570. return Ge.LUMINANCE_ALPHA;
  49571. if (e === n.AddEquation)
  49572. return Ge.FUNC_ADD;
  49573. if (e === n.SubtractEquation)
  49574. return Ge.FUNC_SUBTRACT;
  49575. if (e === n.ReverseSubtractEquation)
  49576. return Ge.FUNC_REVERSE_SUBTRACT;
  49577. if (e === n.ZeroFactor)
  49578. return Ge.ZERO;
  49579. if (e === n.OneFactor)
  49580. return Ge.ONE;
  49581. if (e === n.SrcColorFactor)
  49582. return Ge.SRC_COLOR;
  49583. if (e === n.OneMinusSrcColorFactor)
  49584. return Ge.ONE_MINUS_SRC_COLOR;
  49585. if (e === n.SrcAlphaFactor)
  49586. return Ge.SRC_ALPHA;
  49587. if (e === n.OneMinusSrcAlphaFactor)
  49588. return Ge.ONE_MINUS_SRC_ALPHA;
  49589. if (e === n.DstAlphaFactor)
  49590. return Ge.DST_ALPHA;
  49591. if (e === n.OneMinusDstAlphaFactor)
  49592. return Ge.ONE_MINUS_DST_ALPHA;
  49593. if (e === n.DstColorFactor)
  49594. return Ge.DST_COLOR;
  49595. if (e === n.OneMinusDstColorFactor)
  49596. return Ge.ONE_MINUS_DST_COLOR;
  49597. if (e === n.SrcAlphaSaturateFactor)
  49598. return Ge.SRC_ALPHA_SATURATE;
  49599. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  49600. null !== t) {
  49601. if (e === n.RGB_S3TC_DXT1_Format)
  49602. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49603. if (e === n.RGBA_S3TC_DXT1_Format)
  49604. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49605. if (e === n.RGBA_S3TC_DXT3_Format)
  49606. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49607. if (e === n.RGBA_S3TC_DXT5_Format)
  49608. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49609. }
  49610. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  49611. null !== t) {
  49612. if (e === n.RGB_PVRTC_4BPPV1_Format)
  49613. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49614. if (e === n.RGB_PVRTC_2BPPV1_Format)
  49615. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49616. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  49617. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49618. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  49619. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49620. }
  49621. if (t = We.get("WEBGL_compressed_texture_etc1"),
  49622. null !== t && e === n.RGB_ETC1_Format)
  49623. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49624. if (t = We.get("EXT_blend_minmax"),
  49625. null !== t) {
  49626. if (e === n.MinEquation)
  49627. return t.MIN_EXT;
  49628. if (e === n.MaxEquation)
  49629. return t.MAX_EXT
  49630. }
  49631. return 0
  49632. }
  49633. console.log("THREE.WebGLRenderer", n.REVISION),
  49634. e = e || {};
  49635. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  49636. , ie = void 0 !== e.context ? e.context : null
  49637. , ne = void 0 !== e.alpha && e.alpha
  49638. , re = void 0 === e.depth || e.depth
  49639. , oe = void 0 === e.stencil || e.stencil
  49640. , ae = void 0 !== e.antialias && e.antialias
  49641. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49642. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49643. , ce = []
  49644. , he = []
  49645. , ue = -1
  49646. , de = []
  49647. , pe = -1
  49648. , fe = new Float32Array(8)
  49649. , ge = []
  49650. , me = [];
  49651. this.domElement = te,
  49652. this.context = null,
  49653. this.autoClear = !0,
  49654. this.autoClearColor = !0,
  49655. this.autoClearDepth = !0,
  49656. this.autoClearStencil = !0,
  49657. this.sortObjects = !0,
  49658. this.gammaFactor = 2,
  49659. this.gammaInput = !1,
  49660. this.gammaOutput = !1,
  49661. this.physicallyCorrectLights = !1,
  49662. this.toneMapping = n.LinearToneMapping,
  49663. this.toneMappingExposure = 1,
  49664. this.toneMappingWhitePoint = 1,
  49665. this.maxMorphTargets = 8,
  49666. this.maxMorphNormals = 4,
  49667. this.autoScaleCubemaps = !0;
  49668. var ve = this
  49669. , Ae = null
  49670. , ye = null
  49671. , Ce = null
  49672. , Ie = -1
  49673. , Ee = ""
  49674. , be = null
  49675. , we = new n.Vector4
  49676. , _e = null
  49677. , Te = new n.Vector4
  49678. , xe = 0
  49679. , Se = new n.Color(0)
  49680. , Me = 0
  49681. , Re = te.width
  49682. , Pe = te.height
  49683. , Oe = 1
  49684. , Le = new n.Vector4(0,0,Re,Pe)
  49685. , De = !1
  49686. , Ne = new n.Vector4(0,0,Re,Pe)
  49687. , Be = new n.Frustum
  49688. , Fe = new n.Matrix4
  49689. , Ve = new n.Vector3
  49690. , Ue = {
  49691. hash: "",
  49692. ambient: [0, 0, 0],
  49693. directional: [],
  49694. directionalShadowMap: [],
  49695. directionalShadowMatrix: [],
  49696. spot: [],
  49697. spotShadowMap: [],
  49698. spotShadowMatrix: [],
  49699. point: [],
  49700. pointShadowMap: [],
  49701. pointShadowMatrix: [],
  49702. hemi: [],
  49703. shadows: [],
  49704. shadowsPointLight: 0
  49705. }
  49706. , ke = {
  49707. geometries: 0,
  49708. textures: 0
  49709. }
  49710. , He = {
  49711. calls: 0,
  49712. vertices: 0,
  49713. faces: 0,
  49714. points: 0
  49715. };
  49716. this.info = {
  49717. render: He,
  49718. memory: ke,
  49719. programs: null
  49720. };
  49721. var Ge;
  49722. try {
  49723. var ze = {
  49724. alpha: ne,
  49725. depth: re,
  49726. stencil: oe,
  49727. antialias: ae,
  49728. premultipliedAlpha: se,
  49729. preserveDrawingBuffer: le
  49730. };
  49731. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  49732. null === Ge)
  49733. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49734. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  49735. return {
  49736. rangeMin: 1,
  49737. rangeMax: 1,
  49738. precision: 1
  49739. }
  49740. }
  49741. ),
  49742. te.addEventListener("webglcontextlost", a, !1)
  49743. } catch (e) {
  49744. console.error("THREE.WebGLRenderer: " + e)
  49745. }
  49746. var We = new n.WebGLExtensions(Ge);
  49747. We.get("OES_texture_float"),
  49748. We.get("OES_texture_float_linear"),
  49749. We.get("OES_texture_half_float"),
  49750. We.get("OES_texture_half_float_linear"),
  49751. We.get("OES_standard_derivatives"),
  49752. We.get("ANGLE_instanced_arrays"),
  49753. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  49754. var je = new n.WebGLCapabilities(Ge,We,e)
  49755. , Ye = new n.WebGLState(Ge,We,ee)
  49756. , Xe = new n.WebGLProperties
  49757. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  49758. , qe = new n.WebGLPrograms(this,je)
  49759. , Ke = new n.WebGLLights;
  49760. this.info.programs = qe.programs;
  49761. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  49762. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  49763. r(),
  49764. this.context = Ge,
  49765. this.capabilities = je,
  49766. this.extensions = We,
  49767. this.properties = Xe,
  49768. this.state = Ye;
  49769. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  49770. this.shadowMap = $e;
  49771. var et = new n.SpritePlugin(this,ge)
  49772. , tt = new n.LensFlarePlugin(this,me);
  49773. this.getContext = function() {
  49774. return Ge
  49775. }
  49776. ,
  49777. this.getContextAttributes = function() {
  49778. return Ge.getContextAttributes()
  49779. }
  49780. ,
  49781. this.forceContextLoss = function() {
  49782. We.get("WEBGL_lose_context").loseContext()
  49783. }
  49784. ,
  49785. this.getMaxAnisotropy = function() {
  49786. var e;
  49787. return function() {
  49788. if (void 0 !== e)
  49789. return e;
  49790. var t = We.get("EXT_texture_filter_anisotropic");
  49791. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49792. }
  49793. }(),
  49794. this.getPrecision = function() {
  49795. return je.precision
  49796. }
  49797. ,
  49798. this.getPixelRatio = function() {
  49799. return Oe
  49800. }
  49801. ,
  49802. this.setPixelRatio = function(e) {
  49803. void 0 !== e && (Oe = e,
  49804. this.setSize(Ne.z, Ne.w, !1))
  49805. }
  49806. ,
  49807. this.getSize = function() {
  49808. return {
  49809. width: Re,
  49810. height: Pe
  49811. }
  49812. }
  49813. ,
  49814. this.setSize = function(e, t, i, devicePixelRatio) {
  49815. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  49816. Re = e,
  49817. Pe = t,
  49818. te.width = e * Oe,
  49819. te.height = t * Oe,
  49820. i !== !1 && (te.style.width = e + "px",
  49821. te.style.height = t + "px"),
  49822. this.setViewport(0, 0, e, t)
  49823. }
  49824. ,
  49825. this.setViewport = function(e, t, i, n) {
  49826. Ye.viewport(Ne.set(e, t, i, n))
  49827. }
  49828. ,
  49829. this.setScissor = function(e, t, i, n) {
  49830. Ye.scissor(Le.set(e, t, i, n))
  49831. }
  49832. ,
  49833. this.setScissorTest = function(e) {
  49834. Ye.setScissorTest(De = e)
  49835. }
  49836. ,
  49837. this.getClearColor = function() {
  49838. return Se
  49839. }
  49840. ,
  49841. this.setClearColor = function(e, t) {
  49842. Se.set(e),
  49843. Me = void 0 !== t ? t : 1,
  49844. i(Se.r, Se.g, Se.b, Me)
  49845. }
  49846. ,
  49847. this.getClearAlpha = function() {
  49848. return Me
  49849. }
  49850. ,
  49851. this.setClearAlpha = function(e) {
  49852. Me = e,
  49853. i(Se.r, Se.g, Se.b, Me)
  49854. }
  49855. ,
  49856. this.clear = function(e, t, i) {
  49857. var n = 0;
  49858. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  49859. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  49860. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  49861. Ge.clear(n)
  49862. }
  49863. ,
  49864. this.clearColor = function() {
  49865. this.clear(!0, !1, !1)
  49866. }
  49867. ,
  49868. this.clearDepth = function() {
  49869. this.clear(!1, !0, !1)
  49870. }
  49871. ,
  49872. this.clearStencil = function() {
  49873. this.clear(!1, !1, !0)
  49874. }
  49875. ,
  49876. this.clearTarget = function(e, t, i, n) {
  49877. this.setRenderTarget(e),
  49878. this.clear(t, i, n)
  49879. }
  49880. ,
  49881. this.resetGLState = o,
  49882. this.dispose = function() {
  49883. te.removeEventListener("webglcontextlost", a, !1)
  49884. }
  49885. ,
  49886. this.renderBufferImmediate = function(e, t, i) {
  49887. Ye.initAttributes();
  49888. var r = Xe.get(e);
  49889. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  49890. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  49891. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  49892. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  49893. var o = t.getAttributes();
  49894. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  49895. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  49896. Ye.enableAttribute(o.position),
  49897. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  49898. e.hasNormals) {
  49899. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  49900. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  49901. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  49902. var l = e.normalArray
  49903. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  49904. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  49905. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  49906. l[a + 0] = c,
  49907. l[a + 1] = h,
  49908. l[a + 2] = u,
  49909. l[a + 3] = c,
  49910. l[a + 4] = h,
  49911. l[a + 5] = u,
  49912. l[a + 6] = c,
  49913. l[a + 7] = h,
  49914. l[a + 8] = u
  49915. }
  49916. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  49917. Ye.enableAttribute(o.normal),
  49918. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  49919. }
  49920. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  49921. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  49922. Ye.enableAttribute(o.uv),
  49923. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  49924. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  49925. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  49926. Ye.enableAttribute(o.color),
  49927. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  49928. Ye.disableUnusedAttributes(),
  49929. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  49930. e.count = 0
  49931. }
  49932. ,
  49933. this.renderBufferDirect = function(e, i, r, o, a, s) {
  49934. E(o);
  49935. var l = w(e, i, o, a)
  49936. , c = !1
  49937. , h = r.id + "_" + l.id + "_" + o.wireframe;
  49938. h !== Ee && (Ee = h,
  49939. c = !0);
  49940. var u = a.morphTargetInfluences;
  49941. if (void 0 !== u) {
  49942. for (var d = [], p = 0, m = u.length; p < m; p++) {
  49943. var v = u[p];
  49944. d.push([v, p])
  49945. }
  49946. d.sort(g),
  49947. d.length > 8 && (d.length = 8);
  49948. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  49949. var v = d[p];
  49950. if (fe[p] = v[0],
  49951. 0 !== v[0]) {
  49952. var y = v[1];
  49953. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  49954. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  49955. } else
  49956. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  49957. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  49958. }
  49959. var C = l.getUniforms();
  49960. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  49961. c = !0
  49962. }
  49963. var y = r.index
  49964. , I = r.attributes.position;
  49965. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  49966. var b;
  49967. null !== y ? (b = Je,
  49968. b.setIndex(y)) : b = Qe,
  49969. c && (f(o, l, r),
  49970. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  49971. var _ = 0
  49972. , T = 1 / 0;
  49973. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  49974. var x = r.drawRange.start
  49975. , S = r.drawRange.count
  49976. , M = null !== s ? s.start : 0
  49977. , R = null !== s ? s.count : 1 / 0
  49978. , P = Math.max(_, x, M)
  49979. , O = Math.min(_ + T, x + S, M + R) - 1
  49980. , L = Math.max(0, O - P + 1);
  49981. if (a instanceof n.Mesh)
  49982. if (o.wireframe === !0)
  49983. Ye.setLineWidth(o.wireframeLinewidth * t()),
  49984. b.setMode(Ge.LINES);
  49985. else
  49986. switch (a.drawMode) {
  49987. case n.TrianglesDrawMode:
  49988. b.setMode(Ge.TRIANGLES);
  49989. break;
  49990. case n.TriangleStripDrawMode:
  49991. b.setMode(Ge.TRIANGLE_STRIP);
  49992. break;
  49993. case n.TriangleFanDrawMode:
  49994. b.setMode(Ge.TRIANGLE_FAN)
  49995. }
  49996. else if (a instanceof n.Line) {
  49997. var D = o.linewidth;
  49998. void 0 === D && (D = 1),
  49999. Ye.setLineWidth(D * t()),
  50000. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  50001. } else
  50002. a instanceof n.Points && b.setMode(Ge.POINTS);
  50003. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  50004. }
  50005. ,
  50006. this.render = function(e, t, i, r) {
  50007. if (t instanceof n.Camera == !1)
  50008. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  50009. var o = e.fog;
  50010. if (Ee = "",
  50011. Ie = -1,
  50012. be = null,
  50013. e.autoUpdate === !0 && e.updateMatrixWorld(),
  50014. null === t.parent && t.updateMatrixWorld(),
  50015. t.matrixWorldInverse.getInverse(t.matrixWorld),
  50016. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  50017. Be.setFromMatrix(Fe),
  50018. ce.length = 0,
  50019. ue = -1,
  50020. pe = -1,
  50021. ge.length = 0,
  50022. me.length = 0,
  50023. y(e, t),
  50024. he.length = ue + 1,
  50025. de.length = pe + 1,
  50026. ve.sortObjects === !0 && (he.sort(m),
  50027. de.sort(v)),
  50028. U(ce, t),
  50029. $e.render(e, t),
  50030. He.calls = 0,
  50031. He.vertices = 0,
  50032. He.faces = 0,
  50033. He.points = 0,
  50034. void 0 === i && (i = null),
  50035. this.setRenderTarget(i),
  50036. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  50037. e.overrideMaterial) {
  50038. var a = e.overrideMaterial;
  50039. C(he, t, o, a),
  50040. C(de, t, o, a)
  50041. } else
  50042. Ye.setBlending(n.NoBlending),
  50043. C(he, t, o),
  50044. C(de, t, o);
  50045. if (et.render(e, t),
  50046. tt.render(e, t, Te),
  50047. i) {
  50048. var s = i.texture;
  50049. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  50050. }
  50051. Ye.setDepthTest(!0),
  50052. Ye.setDepthWrite(!0),
  50053. Ye.setColorWrite(!0)
  50054. }
  50055. ,
  50056. this.setFaceCulling = function(e, t) {
  50057. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  50058. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  50059. Ye.enable(Ge.CULL_FACE))
  50060. }
  50061. ,
  50062. this.setTexture = function(e, t) {
  50063. var i = Xe.get(e);
  50064. if (e.version > 0 && i.__version !== e.version) {
  50065. var n = e.image;
  50066. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : n.complete === !1 ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void H(i, e, t)
  50067. }
  50068. Ye.activeTexture(Ge.TEXTURE0 + t),
  50069. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  50070. }
  50071. ,
  50072. this.getCurrentRenderTarget = function() {
  50073. return ye
  50074. }
  50075. ,
  50076. this.setRenderTarget = function(e) {
  50077. ye = e,
  50078. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  50079. var t, i = e instanceof n.WebGLRenderTargetCube;
  50080. if (e) {
  50081. var r = Xe.get(e);
  50082. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  50083. we.copy(e.scissor),
  50084. _e = e.scissorTest,
  50085. Te.copy(e.viewport)
  50086. } else
  50087. t = null,
  50088. we.copy(Le).multiplyScalar(Oe),
  50089. _e = De,
  50090. Te.copy(Ne).multiplyScalar(Oe);
  50091. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  50092. Ce = t),
  50093. Ye.scissor(we),
  50094. Ye.setScissorTest(_e),
  50095. Ye.viewport(Te),
  50096. i) {
  50097. var o = Xe.get(e.texture);
  50098. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  50099. }
  50100. }
  50101. ,
  50102. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  50103. if (e instanceof n.WebGLRenderTarget == !1)
  50104. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  50105. var s = Xe.get(e).__webglFramebuffer;
  50106. if (s) {
  50107. var l = !1;
  50108. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  50109. l = !0);
  50110. try {
  50111. var c = e.texture;
  50112. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  50113. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  50114. if (!(c.type === n.UnsignedByteType || ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) || c.type === n.FloatType && We.get("WEBGL_color_buffer_float") || c.type === n.HalfFloatType && We.get("EXT_color_buffer_half_float")))
  50115. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  50116. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  50117. } finally {
  50118. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  50119. }
  50120. }
  50121. }
  50122. }
  50123. ,
  50124. n.WebGLRenderTarget = function(e, t, i) {
  50125. this.uuid = n.Math.generateUUID(),
  50126. this.width = e,
  50127. this.height = t,
  50128. this.scissor = new n.Vector4(0,0,e,t),
  50129. this.scissorTest = !1,
  50130. this.viewport = new n.Vector4(0,0,e,t),
  50131. i = i || {},
  50132. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  50133. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  50134. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  50135. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  50136. }
  50137. ,
  50138. n.WebGLRenderTarget.prototype = {
  50139. constructor: n.WebGLRenderTarget,
  50140. setSize: function(e, t) {
  50141. this.width === e && this.height === t || (this.width = e,
  50142. this.height = t,
  50143. this.dispose()),
  50144. this.viewport.set(0, 0, e, t),
  50145. this.scissor.set(0, 0, e, t)
  50146. },
  50147. clone: function() {
  50148. return (new this.constructor).copy(this)
  50149. },
  50150. copy: function(e) {
  50151. return this.width = e.width,
  50152. this.height = e.height,
  50153. this.viewport.copy(e.viewport),
  50154. this.texture = e.texture.clone(),
  50155. this.depthBuffer = e.depthBuffer,
  50156. this.stencilBuffer = e.stencilBuffer,
  50157. this
  50158. },
  50159. dispose: function() {
  50160. this.dispatchEvent({
  50161. type: "dispose"
  50162. })
  50163. }
  50164. },
  50165. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  50166. n.WebGLRenderTargetCube = function(e, t, i) {
  50167. n.WebGLRenderTarget.call(this, e, t, i),
  50168. this.activeCubeFace = 0,
  50169. this.activeMipMapLevel = 0
  50170. }
  50171. ,
  50172. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  50173. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  50174. n.WebGLBufferRenderer = function(e, t, i) {
  50175. function r(e) {
  50176. s = e
  50177. }
  50178. function o(t, n) {
  50179. e.drawArrays(s, t, n),
  50180. i.calls++,
  50181. i.vertices += n,
  50182. s === e.TRIANGLES && (i.faces += n / 3)
  50183. }
  50184. function a(r) {
  50185. var o = t.get("ANGLE_instanced_arrays");
  50186. if (null === o)
  50187. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  50188. var a = r.attributes.position
  50189. , l = 0;
  50190. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  50191. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  50192. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  50193. i.calls++,
  50194. i.vertices += l * r.maxInstancedCount,
  50195. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  50196. }
  50197. var s;
  50198. this.setMode = r,
  50199. this.render = o,
  50200. this.renderInstances = a
  50201. }
  50202. ,
  50203. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  50204. function n(e) {
  50205. s = e
  50206. }
  50207. function r(i) {
  50208. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  50209. c = 4) : (l = e.UNSIGNED_SHORT,
  50210. c = 2)
  50211. }
  50212. function o(t, n) {
  50213. e.drawElements(s, n, l, t * c),
  50214. i.calls++,
  50215. i.vertices += n,
  50216. s === e.TRIANGLES && (i.faces += n / 3)
  50217. }
  50218. function a(n, r, o) {
  50219. var a = t.get("ANGLE_instanced_arrays");
  50220. return null === a ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  50221. i.calls++,
  50222. i.vertices += o * n.maxInstancedCount,
  50223. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  50224. }
  50225. var s, l, c;
  50226. this.setMode = n,
  50227. this.setIndex = r,
  50228. this.render = o,
  50229. this.renderInstances = a
  50230. }
  50231. ,
  50232. n.WebGLExtensions = function(e) {
  50233. var t = {};
  50234. this.get = function(i) {
  50235. if (void 0 !== t[i])
  50236. return t[i];
  50237. var n;
  50238. switch (i) {
  50239. case "EXT_texture_filter_anisotropic":
  50240. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  50241. break;
  50242. case "WEBGL_compressed_texture_s3tc":
  50243. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  50244. break;
  50245. case "WEBGL_compressed_texture_pvrtc":
  50246. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  50247. break;
  50248. case "WEBGL_compressed_texture_etc1":
  50249. n = e.getExtension("WEBGL_compressed_texture_etc1");
  50250. break;
  50251. default:
  50252. n = e.getExtension(i)
  50253. }
  50254. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  50255. t[i] = n,
  50256. n
  50257. }
  50258. }
  50259. ,
  50260. n.WebGLCapabilities = function(e, t, i) {
  50261. function n(t) {
  50262. if ("highp" === t) {
  50263. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  50264. return "highp";
  50265. t = "mediump"
  50266. }
  50267. return "mediump" === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp"
  50268. }
  50269. this.getMaxPrecision = n,
  50270. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50271. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50272. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  50273. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50274. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  50275. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  50276. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  50277. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  50278. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  50279. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  50280. this.vertexTextures = this.maxVertexTextures > 0,
  50281. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  50282. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50283. var r = n(this.precision);
  50284. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50285. this.precision = r),
  50286. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  50287. }
  50288. ,
  50289. n.WebGLGeometries = function(e, t, i) {
  50290. function r(e) {
  50291. var t = e.geometry;
  50292. if (void 0 !== h[t.id])
  50293. return h[t.id];
  50294. t.addEventListener("dispose", o);
  50295. var r;
  50296. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  50297. r = t._bufferGeometry),
  50298. h[t.id] = r,
  50299. i.memory.geometries++,
  50300. r
  50301. }
  50302. function o(e) {
  50303. var n = e.target
  50304. , r = h[n.id];
  50305. null !== r.index && s(r.index),
  50306. l(r.attributes),
  50307. n.removeEventListener("dispose", o),
  50308. delete h[n.id];
  50309. var a = t.get(n);
  50310. a.wireframe && s(a.wireframe),
  50311. t.delete(n);
  50312. var c = t.get(r);
  50313. c.wireframe && s(c.wireframe),
  50314. t.delete(r),
  50315. i.memory.geometries--
  50316. }
  50317. function a(e) {
  50318. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  50319. }
  50320. function s(t) {
  50321. var i = a(t);
  50322. void 0 !== i && (e.deleteBuffer(i),
  50323. c(t))
  50324. }
  50325. function l(e) {
  50326. for (var t in e)
  50327. s(e[t])
  50328. }
  50329. function c(e) {
  50330. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  50331. }
  50332. var h = {};
  50333. this.get = r
  50334. }
  50335. ,
  50336. n.WebGLLights = function() {
  50337. var e = {};
  50338. this.get = function(t) {
  50339. if (void 0 !== e[t.id])
  50340. return e[t.id];
  50341. var i;
  50342. switch (t.type) {
  50343. case "DirectionalLight":
  50344. i = {
  50345. direction: new n.Vector3,
  50346. color: new n.Color,
  50347. shadow: !1,
  50348. shadowBias: 0,
  50349. shadowRadius: 1,
  50350. shadowMapSize: new n.Vector2
  50351. };
  50352. break;
  50353. case "SpotLight":
  50354. i = {
  50355. position: new n.Vector3,
  50356. direction: new n.Vector3,
  50357. color: new n.Color,
  50358. distance: 0,
  50359. coneCos: 0,
  50360. penumbraCos: 0,
  50361. decay: 0,
  50362. shadow: !1,
  50363. shadowBias: 0,
  50364. shadowRadius: 1,
  50365. shadowMapSize: new n.Vector2
  50366. };
  50367. break;
  50368. case "PointLight":
  50369. i = {
  50370. position: new n.Vector3,
  50371. color: new n.Color,
  50372. distance: 0,
  50373. decay: 0,
  50374. shadow: !1,
  50375. shadowBias: 0,
  50376. shadowRadius: 1,
  50377. shadowMapSize: new n.Vector2
  50378. };
  50379. break;
  50380. case "HemisphereLight":
  50381. i = {
  50382. direction: new n.Vector3,
  50383. skyColor: new n.Color,
  50384. groundColor: new n.Color
  50385. }
  50386. }
  50387. return e[t.id] = i,
  50388. i
  50389. }
  50390. }
  50391. ,
  50392. n.WebGLObjects = function(e, t, i) {
  50393. function r(t) {
  50394. var i = u.get(t);
  50395. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  50396. var r = i.index
  50397. , a = i.attributes;
  50398. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  50399. for (var s in a)
  50400. o(a[s], e.ARRAY_BUFFER);
  50401. var l = i.morphAttributes;
  50402. for (var s in l)
  50403. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  50404. o(c[h], e.ARRAY_BUFFER);
  50405. return i
  50406. }
  50407. function o(e, i) {
  50408. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  50409. , o = t.get(r);
  50410. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  50411. }
  50412. function a(t, i, n) {
  50413. t.__webglBuffer = e.createBuffer(),
  50414. e.bindBuffer(n, t.__webglBuffer);
  50415. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  50416. e.bufferData(n, i.array, r),
  50417. t.version = i.version
  50418. }
  50419. function s(t, i, n) {
  50420. e.bindBuffer(n, t.__webglBuffer),
  50421. i.dynamic === !1 || i.updateRange.count === -1 ? e.bufferSubData(n, 0, i.array) : 0 === i.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (e.bufferSubData(n, i.updateRange.offset * i.array.BYTES_PER_ELEMENT, i.array.subarray(i.updateRange.offset, i.updateRange.offset + i.updateRange.count)),
  50422. i.updateRange.count = 0),
  50423. t.version = i.version
  50424. }
  50425. function l(e) {
  50426. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  50427. }
  50428. function c(i) {
  50429. var r = t.get(i);
  50430. if (void 0 !== r.wireframe)
  50431. return r.wireframe;
  50432. var a = []
  50433. , s = i.index
  50434. , l = i.attributes
  50435. , c = l.position;
  50436. if (null !== s)
  50437. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  50438. var g = d[p + 0]
  50439. , m = d[p + 1]
  50440. , v = d[p + 2];
  50441. h(u, g, m) && a.push(g, m),
  50442. h(u, m, v) && a.push(m, v),
  50443. h(u, v, g) && a.push(v, g)
  50444. }
  50445. else
  50446. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  50447. var g = p + 0
  50448. , m = p + 1
  50449. , v = p + 2;
  50450. a.push(g, m, m, v, v, g)
  50451. }
  50452. var A = c.count > 65535 ? Uint32Array : Uint16Array
  50453. , y = new n.BufferAttribute(new A(a),1);
  50454. return o(y, e.ELEMENT_ARRAY_BUFFER),
  50455. r.wireframe = y,
  50456. y
  50457. }
  50458. function h(e, t, i) {
  50459. if (t > i) {
  50460. var n = t;
  50461. t = i,
  50462. i = n
  50463. }
  50464. var r = e[t];
  50465. return void 0 === r ? (e[t] = [i],
  50466. !0) : r.indexOf(i) === -1 && (r.push(i),
  50467. !0)
  50468. }
  50469. var u = new n.WebGLGeometries(e,t,i);
  50470. this.getAttributeBuffer = l,
  50471. this.getWireframeAttribute = c,
  50472. this.update = r
  50473. }
  50474. ,
  50475. n.WebGLProgram = function() {
  50476. function e(e) {
  50477. switch (e) {
  50478. case n.LinearEncoding:
  50479. return ["Linear", "( value )"];
  50480. case n.sRGBEncoding:
  50481. return ["sRGB", "( value )"];
  50482. case n.RGBEEncoding:
  50483. return ["RGBE", "( value )"];
  50484. case n.RGBM7Encoding:
  50485. return ["RGBM", "( value, 7.0 )"];
  50486. case n.RGBM16Encoding:
  50487. return ["RGBM", "( value, 16.0 )"];
  50488. case n.RGBDEncoding:
  50489. return ["RGBD", "( value, 256.0 )"];
  50490. case n.GammaEncoding:
  50491. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  50492. default:
  50493. throw new Error("unsupported encoding: " + e)
  50494. }
  50495. }
  50496. function t(t, i) {
  50497. var n = e(i);
  50498. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  50499. }
  50500. function i(t, i) {
  50501. var n = e(i);
  50502. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  50503. }
  50504. function r(e, t) {
  50505. var i;
  50506. switch (t) {
  50507. case n.LinearToneMapping:
  50508. i = "Linear";
  50509. break;
  50510. case n.ReinhardToneMapping:
  50511. i = "Reinhard";
  50512. break;
  50513. case n.Uncharted2ToneMapping:
  50514. i = "Uncharted2";
  50515. break;
  50516. case n.CineonToneMapping:
  50517. i = "OptimizedCineon";
  50518. break;
  50519. default:
  50520. throw new Error("unsupported toneMapping: " + t)
  50521. }
  50522. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50523. }
  50524. function o(e, t, i) {
  50525. e = e || {};
  50526. var n = [e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""];
  50527. return n.filter(c).join("\n")
  50528. }
  50529. function a(e) {
  50530. var t = [];
  50531. for (var i in e) {
  50532. var n = e[i];
  50533. n !== !1 && t.push("#define " + i + " " + n)
  50534. }
  50535. return t.join("\n")
  50536. }
  50537. function s(e, t, i) {
  50538. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  50539. var a = e.getActiveUniform(t, o)
  50540. , s = a.name
  50541. , l = e.getUniformLocation(t, s)
  50542. , c = f.exec(s);
  50543. if (c) {
  50544. var h = c[1]
  50545. , u = c[2]
  50546. , d = n[h];
  50547. d || (d = n[h] = {}),
  50548. d[u] = l
  50549. } else if (c = g.exec(s)) {
  50550. var p = c[1]
  50551. , v = c[2]
  50552. , A = c[3]
  50553. , y = n[p];
  50554. y || (y = n[p] = []);
  50555. var C = y[v];
  50556. C || (C = y[v] = {}),
  50557. C[A] = l
  50558. } else if (c = m.exec(s)) {
  50559. var p = c[1];
  50560. n[p] = l
  50561. } else
  50562. n[s] = l
  50563. }
  50564. return n
  50565. }
  50566. function l(e, t, i) {
  50567. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  50568. var a = e.getActiveAttrib(t, o)
  50569. , s = a.name;
  50570. n[s] = e.getAttribLocation(t, s)
  50571. }
  50572. return n
  50573. }
  50574. function c(e) {
  50575. return "" !== e
  50576. }
  50577. function h(e, t) {
  50578. 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)
  50579. }
  50580. function u(e) {
  50581. function t(e, t) {
  50582. var i = n.ShaderChunk[t];
  50583. if (void 0 === i)
  50584. throw new Error("Can not resolve #include <" + t + ">");
  50585. return u(i)
  50586. }
  50587. var i = /#include +<([\w\d.]+)>/g;
  50588. return e.replace(i, t)
  50589. }
  50590. function d(e) {
  50591. function t(e, t, i, n) {
  50592. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  50593. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  50594. return r
  50595. }
  50596. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  50597. return e.replace(i, t)
  50598. }
  50599. var p = 0
  50600. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  50601. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  50602. , m = /^([\w\d_]+)\[0\]$/;
  50603. return function(e, f, g, m) {
  50604. var v = e.context
  50605. , A = g.extensions
  50606. , y = g.defines
  50607. , C = g.__webglShader.vertexShader
  50608. , I = g.__webglShader.fragmentShader
  50609. , E = "SHADOWMAP_TYPE_BASIC";
  50610. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  50611. var b = "ENVMAP_TYPE_CUBE"
  50612. , w = "ENVMAP_MODE_REFLECTION"
  50613. , _ = "ENVMAP_BLENDING_MULTIPLY";
  50614. if (m.envMap) {
  50615. switch (g.envMap.mapping) {
  50616. case n.CubeReflectionMapping:
  50617. case n.CubeRefractionMapping:
  50618. b = "ENVMAP_TYPE_CUBE";
  50619. break;
  50620. case n.CubeUVReflectionMapping:
  50621. case n.CubeUVRefractionMapping:
  50622. b = "ENVMAP_TYPE_CUBE_UV";
  50623. break;
  50624. case n.EquirectangularReflectionMapping:
  50625. case n.EquirectangularRefractionMapping:
  50626. b = "ENVMAP_TYPE_EQUIREC";
  50627. break;
  50628. case n.SphericalReflectionMapping:
  50629. b = "ENVMAP_TYPE_SPHERE"
  50630. }
  50631. switch (g.envMap.mapping) {
  50632. case n.CubeRefractionMapping:
  50633. case n.EquirectangularRefractionMapping:
  50634. w = "ENVMAP_MODE_REFRACTION"
  50635. }
  50636. switch (g.combine) {
  50637. case n.MultiplyOperation:
  50638. _ = "ENVMAP_BLENDING_MULTIPLY";
  50639. break;
  50640. case n.MixOperation:
  50641. _ = "ENVMAP_BLENDING_MIX";
  50642. break;
  50643. case n.AddOperation:
  50644. _ = "ENVMAP_BLENDING_ADD"
  50645. }
  50646. }
  50647. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  50648. g instanceof n.RawShaderMaterial ? (T = "",
  50649. x = "") : (T = ["precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + S, "#define MAX_BONES " + m.maxBones, m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + w : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.displacementMap && m.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.skinning ? "#define USE_SKINNING" : "", m.useVertexTexture ? "#define BONE_TEXTURE" : "", m.morphTargets ? "#define USE_MORPHTARGETS" : "", m.morphNormals && m.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(c).join("\n"),
  50650. x = [M, "precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.alphaTest ? "#define ALPHATEST " + m.alphaTest : "", "#define GAMMA_FACTOR " + S, m.useFog && m.fog ? "#define USE_FOG" : "", m.useFog && m.fogExp ? "#define FOG_EXP2" : "", m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + b : "", m.envMap ? "#define " + w : "", m.envMap ? "#define " + _ : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", m.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", m.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", m.toneMapping !== n.NoToneMapping ? "#define TONE_MAPPING" : "", m.toneMapping !== n.NoToneMapping ? n.ShaderChunk.tonemapping_pars_fragment : "", m.toneMapping !== n.NoToneMapping ? r("toneMapping", m.toneMapping) : "", m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding ? n.ShaderChunk.encodings_pars_fragment : "", m.mapEncoding ? t("mapTexelToLinear", m.mapEncoding) : "", m.envMapEncoding ? t("envMapTexelToLinear", m.envMapEncoding) : "", m.emissiveMapEncoding ? t("emissiveMapTexelToLinear", m.emissiveMapEncoding) : "", m.outputEncoding ? i("linearToOutputTexel", m.outputEncoding) : "", "\n"].filter(c).join("\n")),
  50651. C = u(C, m),
  50652. C = h(C, m),
  50653. I = u(I, m),
  50654. I = h(I, m),
  50655. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  50656. I = d(I));
  50657. var O = T + C
  50658. , L = x + I
  50659. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  50660. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  50661. v.attachShader(P, D),
  50662. v.attachShader(P, N),
  50663. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  50664. v.linkProgram(P);
  50665. var B = v.getProgramInfoLog(P)
  50666. , F = v.getShaderInfoLog(D)
  50667. , V = v.getShaderInfoLog(N)
  50668. , U = !0
  50669. , k = !0;
  50670. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  50671. console.error("THREE.WebGLProgram: shader error: ", v.getError(), "gl.VALIDATE_STATUS", v.getProgramParameter(P, v.VALIDATE_STATUS), "gl.getProgramInfoLog", B, F, V)) : "" !== B ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", B) : "" !== F && "" !== V || (k = !1),
  50672. k && (this.diagnostics = {
  50673. runnable: U,
  50674. material: g,
  50675. programLog: B,
  50676. vertexShader: {
  50677. log: F,
  50678. prefix: T
  50679. },
  50680. fragmentShader: {
  50681. log: V,
  50682. prefix: x
  50683. }
  50684. }),
  50685. v.deleteShader(D),
  50686. v.deleteShader(N);
  50687. var H;
  50688. this.getUniforms = function() {
  50689. return void 0 === H && (H = s(v, P)),
  50690. H
  50691. }
  50692. ;
  50693. var G;
  50694. return this.getAttributes = function() {
  50695. return void 0 === G && (G = l(v, P)),
  50696. G
  50697. }
  50698. ,
  50699. this.destroy = function() {
  50700. v.deleteProgram(P),
  50701. this.program = void 0
  50702. }
  50703. ,
  50704. Object.defineProperties(this, {
  50705. uniforms: {
  50706. get: function() {
  50707. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50708. this.getUniforms()
  50709. }
  50710. },
  50711. attributes: {
  50712. get: function() {
  50713. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50714. this.getAttributes()
  50715. }
  50716. }
  50717. }),
  50718. this.id = p++,
  50719. this.code = f,
  50720. this.usedTimes = 1,
  50721. this.program = P,
  50722. this.vertexShader = D,
  50723. this.fragmentShader = N,
  50724. this
  50725. }
  50726. }(),
  50727. n.WebGLPrograms = function(e, t) {
  50728. function i(e) {
  50729. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50730. return 1024;
  50731. var i = t.maxVertexUniforms
  50732. , r = Math.floor((i - 20) / 4)
  50733. , o = r;
  50734. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  50735. o < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + o + " (try OpenGL instead of ANGLE)")),
  50736. o
  50737. }
  50738. function r(e, t) {
  50739. var i;
  50740. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  50741. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  50742. i
  50743. }
  50744. var o = []
  50745. , a = {
  50746. MeshDepthMaterial: "depth",
  50747. MeshNormalMaterial: "normal",
  50748. MeshBasicMaterial: "basic",
  50749. MeshLambertMaterial: "lambert",
  50750. MeshPhongMaterial: "phong",
  50751. MeshStandardMaterial: "standard",
  50752. LineBasicMaterial: "basic",
  50753. LineDashedMaterial: "dashed",
  50754. PointsMaterial: "points"
  50755. }
  50756. , s = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  50757. this.getParameters = function(o, s, l, c) {
  50758. var h = a[o.type]
  50759. , u = i(c)
  50760. , d = e.getPrecision();
  50761. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  50762. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  50763. var p = {
  50764. shaderID: h,
  50765. precision: d,
  50766. supportsVertexTextures: t.vertexTextures,
  50767. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  50768. map: !!o.map,
  50769. mapEncoding: r(o.map, e.gammaInput),
  50770. envMap: !!o.envMap,
  50771. envMapMode: o.envMap && o.envMap.mapping,
  50772. envMapEncoding: r(o.envMap, e.gammaInput),
  50773. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  50774. lightMap: !!o.lightMap,
  50775. aoMap: !!o.aoMap,
  50776. emissiveMap: !!o.emissiveMap,
  50777. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  50778. bumpMap: !!o.bumpMap,
  50779. normalMap: !!o.normalMap,
  50780. displacementMap: !!o.displacementMap,
  50781. roughnessMap: !!o.roughnessMap,
  50782. metalnessMap: !!o.metalnessMap,
  50783. specularMap: !!o.specularMap,
  50784. alphaMap: !!o.alphaMap,
  50785. combine: o.combine,
  50786. vertexColors: o.vertexColors,
  50787. fog: l,
  50788. useFog: o.fog,
  50789. fogExp: l instanceof n.FogExp2,
  50790. flatShading: o.shading === n.FlatShading,
  50791. sizeAttenuation: o.sizeAttenuation,
  50792. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  50793. skinning: o.skinning,
  50794. maxBones: u,
  50795. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  50796. morphTargets: o.morphTargets,
  50797. morphNormals: o.morphNormals,
  50798. maxMorphTargets: e.maxMorphTargets,
  50799. maxMorphNormals: e.maxMorphNormals,
  50800. numDirLights: s.directional.length,
  50801. numPointLights: s.point.length,
  50802. numSpotLights: s.spot.length,
  50803. numHemiLights: s.hemi.length,
  50804. pointLightShadows: s.shadowsPointLight,
  50805. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  50806. shadowMapType: e.shadowMap.type,
  50807. toneMapping: e.toneMapping,
  50808. physicallyCorrectLights: e.physicallyCorrectLights,
  50809. premultipliedAlpha: o.premultipliedAlpha,
  50810. alphaTest: o.alphaTest,
  50811. doubleSided: o.side === n.DoubleSide,
  50812. flipSided: o.side === n.BackSide
  50813. };
  50814. return p
  50815. }
  50816. ,
  50817. this.getProgramCode = function(e, t) {
  50818. var i = [];
  50819. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50820. i.push(e.vertexShader)),
  50821. void 0 !== e.defines)
  50822. for (var n in e.defines)
  50823. i.push(n),
  50824. i.push(e.defines[n]);
  50825. for (var r = 0; r < s.length; r++) {
  50826. var o = s[r];
  50827. i.push(o),
  50828. i.push(t[o])
  50829. }
  50830. return i.join()
  50831. }
  50832. ,
  50833. this.acquireProgram = function(t, i, r) {
  50834. for (var a, s = 0, l = o.length; s < l; s++) {
  50835. var c = o[s];
  50836. if (c.code === r) {
  50837. a = c,
  50838. ++a.usedTimes;
  50839. break
  50840. }
  50841. }
  50842. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  50843. o.push(a)),
  50844. a
  50845. }
  50846. ,
  50847. this.releaseProgram = function(e) {
  50848. if (0 === --e.usedTimes) {
  50849. var t = o.indexOf(e);
  50850. o[t] = o[o.length - 1],
  50851. o.pop(),
  50852. e.destroy()
  50853. }
  50854. }
  50855. ,
  50856. this.programs = o
  50857. }
  50858. ,
  50859. n.WebGLProperties = function() {
  50860. var e = {};
  50861. this.get = function(t) {
  50862. var i = t.uuid
  50863. , n = e[i];
  50864. return void 0 === n && (n = {},
  50865. e[i] = n),
  50866. n
  50867. }
  50868. ,
  50869. this.delete = function(t) {
  50870. delete e[t.uuid]
  50871. }
  50872. ,
  50873. this.clear = function() {
  50874. e = {}
  50875. }
  50876. }
  50877. ,
  50878. n.WebGLShader = function() {
  50879. function e(e) {
  50880. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50881. t[i] = i + 1 + ": " + t[i];
  50882. return t.join("\n")
  50883. }
  50884. return function(t, i, n) {
  50885. var r = t.createShader(i);
  50886. return t.shaderSource(r, n),
  50887. t.compileShader(r),
  50888. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50889. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  50890. r
  50891. }
  50892. }(),
  50893. n.WebGLShadowMap = function(e, t, i) {
  50894. function r(e, t, i, r) {
  50895. var o = e.geometry
  50896. , a = null
  50897. , s = v
  50898. , l = e.customDepthMaterial;
  50899. if (i && (s = A,
  50900. l = e.customDistanceMaterial),
  50901. l)
  50902. a = l;
  50903. else {
  50904. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  50905. , h = e instanceof n.SkinnedMesh && t.skinning
  50906. , u = 0;
  50907. c && (u |= f),
  50908. h && (u |= g),
  50909. a = s[u]
  50910. }
  50911. return a.visible = t.visible,
  50912. a.wireframe = t.wireframe,
  50913. a.wireframeLinewidth = t.wireframeLinewidth,
  50914. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  50915. a
  50916. }
  50917. function o(e, t, i) {
  50918. if (e.visible !== !1) {
  50919. if (e.layers.test(t.layers) && (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && e.castShadow && (e.frustumCulled === !1 || l.intersectsObject(e) === !0)) {
  50920. var r = e.material;
  50921. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50922. p.push(e))
  50923. }
  50924. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  50925. o(a[s], t, i)
  50926. }
  50927. }
  50928. for (var a = e.context, s = e.state, l = new n.Frustum, c = new n.Matrix4, h = new n.Vector2, u = new n.Vector3, d = new n.Vector3, p = [], f = 1, g = 2, m = (f | g) + 1, v = new Array(m), A = new Array(m), y = [new n.Vector3(1,0,0), new n.Vector3(-1,0,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1), new n.Vector3(0,1,0), new n.Vector3(0,-1,0)], C = [new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1)], I = [new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4], E = n.ShaderLib.depthRGBA, b = n.UniformsUtils.clone(E.uniforms), w = n.ShaderLib.distanceRGBA, _ = n.UniformsUtils.clone(w.uniforms), T = 0; T !== m; ++T) {
  50929. var x = 0 !== (T & f)
  50930. , S = 0 !== (T & g)
  50931. , M = new n.ShaderMaterial({
  50932. uniforms: b,
  50933. vertexShader: E.vertexShader,
  50934. fragmentShader: E.fragmentShader,
  50935. morphTargets: x,
  50936. skinning: S
  50937. });
  50938. v[T] = M;
  50939. var R = new n.ShaderMaterial({
  50940. defines: {
  50941. USE_SHADOWMAP: ""
  50942. },
  50943. uniforms: _,
  50944. vertexShader: w.vertexShader,
  50945. fragmentShader: w.fragmentShader,
  50946. morphTargets: x,
  50947. skinning: S
  50948. });
  50949. A[T] = R
  50950. }
  50951. var P = this;
  50952. this.enabled = !1,
  50953. this.autoUpdate = !0,
  50954. this.needsUpdate = !1,
  50955. this.type = n.PCFShadowMap,
  50956. this.cullFace = n.CullFaceFront,
  50957. this.render = function(f, g) {
  50958. var m, v, A = t.shadows;
  50959. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  50960. s.clearColor(1, 1, 1, 1),
  50961. s.disable(a.BLEND),
  50962. s.enable(a.CULL_FACE),
  50963. a.frontFace(a.CCW),
  50964. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  50965. s.setDepthTest(!0),
  50966. s.setScissorTest(!1);
  50967. for (var E = 0, b = A.length; E < b; E++) {
  50968. var w = A[E]
  50969. , _ = w.shadow
  50970. , T = _.camera;
  50971. if (h.copy(_.mapSize),
  50972. w instanceof n.PointLight) {
  50973. m = 6,
  50974. v = !0;
  50975. var x = h.x
  50976. , S = h.y;
  50977. I[0].set(2 * x, S, x, S),
  50978. I[1].set(0, S, x, S),
  50979. I[2].set(3 * x, S, x, S),
  50980. I[3].set(x, S, x, S),
  50981. I[4].set(3 * x, 0, x, S),
  50982. I[5].set(x, 0, x, S),
  50983. h.x *= 4,
  50984. h.y *= 2
  50985. } else
  50986. m = 1,
  50987. v = !1;
  50988. if (null === _.map) {
  50989. var M = {
  50990. minFilter: n.NearestFilter,
  50991. magFilter: n.NearestFilter,
  50992. format: n.RGBAFormat
  50993. };
  50994. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  50995. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  50996. T.updateProjectionMatrix()
  50997. }
  50998. var R = _.map
  50999. , O = _.matrix;
  51000. d.setFromMatrixPosition(w.matrixWorld),
  51001. T.position.copy(d),
  51002. e.setRenderTarget(R),
  51003. e.clear();
  51004. for (var L = 0; L < m; L++) {
  51005. if (v) {
  51006. u.copy(T.position),
  51007. u.add(y[L]),
  51008. T.up.copy(C[L]),
  51009. T.lookAt(u);
  51010. var D = I[L];
  51011. s.viewport(D)
  51012. } else
  51013. u.setFromMatrixPosition(w.target.matrixWorld),
  51014. T.lookAt(u);
  51015. T.updateMatrixWorld(),
  51016. T.matrixWorldInverse.getInverse(T.matrixWorld),
  51017. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  51018. O.multiply(T.projectionMatrix),
  51019. O.multiply(T.matrixWorldInverse),
  51020. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  51021. l.setFromMatrix(c),
  51022. p.length = 0,
  51023. o(f, g, T);
  51024. for (var N = 0, B = p.length; N < B; N++) {
  51025. var F = p[N]
  51026. , V = i.update(F)
  51027. , U = F.material;
  51028. if (U instanceof n.MultiMaterial)
  51029. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  51030. var W = k[G]
  51031. , j = H[W.materialIndex];
  51032. if (j.visible === !0) {
  51033. var Y = r(F, j, v, d);
  51034. e.renderBufferDirect(T, null, V, Y, F, W)
  51035. }
  51036. }
  51037. else {
  51038. var Y = r(F, U, v, d);
  51039. e.renderBufferDirect(T, null, V, Y, F, null)
  51040. }
  51041. }
  51042. }
  51043. }
  51044. var X = e.getClearColor()
  51045. , Z = e.getClearAlpha();
  51046. e.setClearColor(X, Z),
  51047. s.enable(a.BLEND),
  51048. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  51049. P.needsUpdate = !1
  51050. }
  51051. }
  51052. }
  51053. ,
  51054. n.WebGLState = function(e, t, i) {
  51055. var r = this
  51056. , o = new n.Vector4
  51057. , a = new Uint8Array(16)
  51058. , s = new Uint8Array(16)
  51059. , l = new Uint8Array(16)
  51060. , c = {}
  51061. , h = null
  51062. , u = null
  51063. , d = null
  51064. , p = null
  51065. , f = null
  51066. , g = null
  51067. , m = null
  51068. , v = null
  51069. , A = !1
  51070. , y = null
  51071. , C = null
  51072. , I = null
  51073. , E = null
  51074. , b = null
  51075. , w = null
  51076. , _ = null
  51077. , T = null
  51078. , x = null
  51079. , S = null
  51080. , M = null
  51081. , R = null
  51082. , P = null
  51083. , O = null
  51084. , L = null
  51085. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  51086. , N = void 0
  51087. , B = {}
  51088. , F = new n.Vector4
  51089. , V = null
  51090. , U = null
  51091. , k = new n.Vector4
  51092. , H = new n.Vector4
  51093. , G = e.createTexture();
  51094. e.bindTexture(e.TEXTURE_2D, G),
  51095. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  51096. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  51097. this.init = function() {
  51098. this.clearColor(0, 0, 0, 1),
  51099. this.clearDepth(1),
  51100. this.clearStencil(0),
  51101. this.enable(e.DEPTH_TEST),
  51102. e.depthFunc(e.LEQUAL),
  51103. e.frontFace(e.CCW),
  51104. e.cullFace(e.BACK),
  51105. this.enable(e.CULL_FACE),
  51106. this.enable(e.BLEND),
  51107. e.blendEquation(e.FUNC_ADD),
  51108. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  51109. }
  51110. ,
  51111. this.initAttributes = function() {
  51112. for (var e = 0, t = a.length; e < t; e++)
  51113. a[e] = 0
  51114. }
  51115. ,
  51116. this.enableAttribute = function(i) {
  51117. if (a[i] = 1,
  51118. 0 === s[i] && (e.enableVertexAttribArray(i),
  51119. s[i] = 1),
  51120. 0 !== l[i]) {
  51121. var n = t.get("ANGLE_instanced_arrays");
  51122. n.vertexAttribDivisorANGLE(i, 0),
  51123. l[i] = 0
  51124. }
  51125. }
  51126. ,
  51127. this.enableAttributeAndDivisor = function(t, i, n) {
  51128. a[t] = 1,
  51129. 0 === s[t] && (e.enableVertexAttribArray(t),
  51130. s[t] = 1),
  51131. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  51132. l[t] = i)
  51133. }
  51134. ,
  51135. this.disableUnusedAttributes = function() {
  51136. for (var t = 0, i = s.length; t < i; t++)
  51137. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  51138. s[t] = 0)
  51139. }
  51140. ,
  51141. this.enable = function(t) {
  51142. c[t] !== !0 && (e.enable(t),
  51143. c[t] = !0)
  51144. }
  51145. ,
  51146. this.disable = function(t) {
  51147. c[t] !== !1 && (e.disable(t),
  51148. c[t] = !1)
  51149. }
  51150. ,
  51151. this.getCompressedTextureFormats = function() {
  51152. if (null === h && (h = [],
  51153. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  51154. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  51155. h.push(i[n]);
  51156. return h
  51157. }
  51158. ,
  51159. this.setBlending = function(t, r, o, a, s, l, c, h) {
  51160. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  51161. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51162. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  51163. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51164. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  51165. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51166. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  51167. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51168. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51169. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  51170. u = t,
  51171. A = h),
  51172. t === n.CustomBlending ? (s = s || r,
  51173. l = l || o,
  51174. c = c || a,
  51175. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  51176. d = r,
  51177. g = s),
  51178. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  51179. p = o,
  51180. f = a,
  51181. m = l,
  51182. v = c)) : (d = null,
  51183. p = null,
  51184. f = null,
  51185. g = null,
  51186. m = null,
  51187. v = null)
  51188. }
  51189. ,
  51190. this.setDepthFunc = function(t) {
  51191. if (y !== t) {
  51192. if (t)
  51193. switch (t) {
  51194. case n.NeverDepth:
  51195. e.depthFunc(e.NEVER);
  51196. break;
  51197. case n.AlwaysDepth:
  51198. e.depthFunc(e.ALWAYS);
  51199. break;
  51200. case n.LessDepth:
  51201. e.depthFunc(e.LESS);
  51202. break;
  51203. case n.LessEqualDepth:
  51204. e.depthFunc(e.LEQUAL);
  51205. break;
  51206. case n.EqualDepth:
  51207. e.depthFunc(e.EQUAL);
  51208. break;
  51209. case n.GreaterEqualDepth:
  51210. e.depthFunc(e.GEQUAL);
  51211. break;
  51212. case n.GreaterDepth:
  51213. e.depthFunc(e.GREATER);
  51214. break;
  51215. case n.NotEqualDepth:
  51216. e.depthFunc(e.NOTEQUAL);
  51217. break;
  51218. default:
  51219. e.depthFunc(e.LEQUAL)
  51220. }
  51221. else
  51222. e.depthFunc(e.LEQUAL);
  51223. y = t
  51224. }
  51225. }
  51226. ,
  51227. this.setDepthTest = function(t) {
  51228. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  51229. }
  51230. ,
  51231. this.setDepthWrite = function(t) {
  51232. C !== t && (e.depthMask(t),
  51233. C = t)
  51234. }
  51235. ,
  51236. this.setColorWrite = function(t) {
  51237. I !== t && (e.colorMask(t, t, t, t),
  51238. I = t)
  51239. }
  51240. ,
  51241. this.setStencilFunc = function(t, i, n) {
  51242. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  51243. b = t,
  51244. w = i,
  51245. _ = n)
  51246. }
  51247. ,
  51248. this.setStencilOp = function(t, i, n) {
  51249. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  51250. T = t,
  51251. x = i,
  51252. S = n)
  51253. }
  51254. ,
  51255. this.setStencilTest = function(t) {
  51256. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  51257. }
  51258. ,
  51259. this.setStencilWrite = function(t) {
  51260. E !== t && (e.stencilMask(t),
  51261. E = t)
  51262. }
  51263. ,
  51264. this.setFlipSided = function(t) {
  51265. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  51266. M = t)
  51267. }
  51268. ,
  51269. this.setLineWidth = function(t) {
  51270. t !== R && (e.lineWidth(t),
  51271. R = t)
  51272. }
  51273. ,
  51274. this.setPolygonOffset = function(t, i, n) {
  51275. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  51276. !t || P === i && O === n || (e.polygonOffset(i, n),
  51277. P = i,
  51278. O = n)
  51279. }
  51280. ,
  51281. this.getScissorTest = function() {
  51282. return L
  51283. }
  51284. ,
  51285. this.setScissorTest = function(t) {
  51286. L = t,
  51287. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  51288. }
  51289. ,
  51290. this.activeTexture = function(t) {
  51291. void 0 === t && (t = e.TEXTURE0 + D - 1),
  51292. N !== t && (e.activeTexture(t),
  51293. N = t)
  51294. }
  51295. ,
  51296. this.bindTexture = function(t, i) {
  51297. void 0 === N && r.activeTexture();
  51298. var n = B[N];
  51299. void 0 === n && (n = {
  51300. type: void 0,
  51301. texture: void 0
  51302. },
  51303. B[N] = n),
  51304. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  51305. n.type = t,
  51306. n.texture = i)
  51307. }
  51308. ,
  51309. this.compressedTexImage2D = function() {
  51310. try {
  51311. e.compressedTexImage2D.apply(e, arguments)
  51312. } catch (e) {
  51313. console.error(e)
  51314. }
  51315. }
  51316. ,
  51317. this.texImage2D = function() {
  51318. try {
  51319. e.texImage2D.apply(e, arguments)
  51320. } catch (e) {
  51321. console.error(e)
  51322. }
  51323. }
  51324. ,
  51325. this.clearColor = function(t, i, n, r) {
  51326. o.set(t, i, n, r),
  51327. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  51328. F.copy(o))
  51329. }
  51330. ,
  51331. this.clearDepth = function(t) {
  51332. V !== t && (e.clearDepth(t),
  51333. V = t)
  51334. }
  51335. ,
  51336. this.clearStencil = function(t) {
  51337. U !== t && (e.clearStencil(t),
  51338. U = t)
  51339. }
  51340. ,
  51341. this.scissor = function(t) {
  51342. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  51343. k.copy(t))
  51344. }
  51345. ,
  51346. this.viewport = function(t) {
  51347. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  51348. H.copy(t))
  51349. }
  51350. ,
  51351. this.reset = function() {
  51352. for (var t = 0; t < s.length; t++)
  51353. 1 === s[t] && (e.disableVertexAttribArray(t),
  51354. s[t] = 0);
  51355. c = {},
  51356. h = null,
  51357. N = void 0,
  51358. B = {},
  51359. u = null,
  51360. I = null,
  51361. C = null,
  51362. E = null,
  51363. M = null
  51364. }
  51365. }
  51366. ,
  51367. n.LensFlarePlugin = function(e, t) {
  51368. function i() {
  51369. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  51370. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51371. o = p.createBuffer(),
  51372. a = p.createBuffer(),
  51373. p.bindBuffer(p.ARRAY_BUFFER, o),
  51374. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  51375. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  51376. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  51377. u = p.createTexture(),
  51378. d = p.createTexture(),
  51379. f.bindTexture(p.TEXTURE_2D, u),
  51380. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  51381. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  51382. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  51383. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  51384. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  51385. f.bindTexture(p.TEXTURE_2D, d),
  51386. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  51387. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  51388. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  51389. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  51390. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  51391. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  51392. var i;
  51393. i = h ? {
  51394. 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"),
  51395. 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")
  51396. } : {
  51397. 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"),
  51398. 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")
  51399. },
  51400. s = r(i),
  51401. l = {
  51402. vertex: p.getAttribLocation(s, "position"),
  51403. uv: p.getAttribLocation(s, "uv")
  51404. },
  51405. c = {
  51406. renderType: p.getUniformLocation(s, "renderType"),
  51407. map: p.getUniformLocation(s, "map"),
  51408. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  51409. opacity: p.getUniformLocation(s, "opacity"),
  51410. color: p.getUniformLocation(s, "color"),
  51411. scale: p.getUniformLocation(s, "scale"),
  51412. rotation: p.getUniformLocation(s, "rotation"),
  51413. screenPosition: p.getUniformLocation(s, "screenPosition")
  51414. }
  51415. }
  51416. function r(t) {
  51417. var i = p.createProgram()
  51418. , n = p.createShader(p.FRAGMENT_SHADER)
  51419. , r = p.createShader(p.VERTEX_SHADER)
  51420. , o = "precision " + e.getPrecision() + " float;\n";
  51421. return p.shaderSource(n, o + t.fragmentShader),
  51422. p.shaderSource(r, o + t.vertexShader),
  51423. p.compileShader(n),
  51424. p.compileShader(r),
  51425. p.attachShader(i, n),
  51426. p.attachShader(i, r),
  51427. p.linkProgram(i),
  51428. i
  51429. }
  51430. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  51431. this.render = function(r, g, m) {
  51432. if (0 !== t.length) {
  51433. var v = new n.Vector3
  51434. , A = m.w / m.z
  51435. , y = .5 * m.z
  51436. , C = .5 * m.w
  51437. , I = 16 / m.w
  51438. , E = new n.Vector2(I * A,I)
  51439. , b = new n.Vector3(1,1,0)
  51440. , w = new n.Vector2(1,1);
  51441. void 0 === s && i(),
  51442. p.useProgram(s),
  51443. f.initAttributes(),
  51444. f.enableAttribute(l.vertex),
  51445. f.enableAttribute(l.uv),
  51446. f.disableUnusedAttributes(),
  51447. p.uniform1i(c.occlusionMap, 0),
  51448. p.uniform1i(c.map, 1),
  51449. p.bindBuffer(p.ARRAY_BUFFER, o),
  51450. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  51451. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  51452. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  51453. f.disable(p.CULL_FACE),
  51454. f.setDepthWrite(!1);
  51455. for (var _ = 0, T = t.length; _ < T; _++) {
  51456. I = 16 / m.w,
  51457. E.set(I * A, I);
  51458. var x = t[_];
  51459. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  51460. v.applyMatrix4(g.matrixWorldInverse),
  51461. v.applyProjection(g.projectionMatrix),
  51462. b.copy(v),
  51463. w.x = b.x * y + y,
  51464. w.y = b.y * C + C,
  51465. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  51466. f.activeTexture(p.TEXTURE0),
  51467. f.bindTexture(p.TEXTURE_2D, null),
  51468. f.activeTexture(p.TEXTURE1),
  51469. f.bindTexture(p.TEXTURE_2D, u),
  51470. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  51471. p.uniform1i(c.renderType, 0),
  51472. p.uniform2f(c.scale, E.x, E.y),
  51473. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  51474. f.disable(p.BLEND),
  51475. f.enable(p.DEPTH_TEST),
  51476. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  51477. f.activeTexture(p.TEXTURE0),
  51478. f.bindTexture(p.TEXTURE_2D, d),
  51479. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  51480. p.uniform1i(c.renderType, 1),
  51481. f.disable(p.DEPTH_TEST),
  51482. f.activeTexture(p.TEXTURE1),
  51483. f.bindTexture(p.TEXTURE_2D, u),
  51484. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  51485. x.positionScreen.copy(b),
  51486. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  51487. p.uniform1i(c.renderType, 2),
  51488. f.enable(p.BLEND);
  51489. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  51490. var R = x.lensFlares[S];
  51491. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  51492. b.y = R.y,
  51493. b.z = R.z,
  51494. I = R.size * R.scale / m.w,
  51495. E.x = I * A,
  51496. E.y = I,
  51497. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  51498. p.uniform2f(c.scale, E.x, E.y),
  51499. p.uniform1f(c.rotation, R.rotation),
  51500. p.uniform1f(c.opacity, R.opacity),
  51501. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  51502. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  51503. e.setTexture(R.texture, 1),
  51504. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  51505. }
  51506. }
  51507. }
  51508. f.enable(p.CULL_FACE),
  51509. f.enable(p.DEPTH_TEST),
  51510. f.setDepthWrite(!0),
  51511. e.resetGLState()
  51512. }
  51513. }
  51514. }
  51515. ,
  51516. n.SpritePlugin = function(e, t) {
  51517. function i() {
  51518. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51519. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51520. a = d.createBuffer(),
  51521. s = d.createBuffer(),
  51522. d.bindBuffer(d.ARRAY_BUFFER, a),
  51523. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  51524. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  51525. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  51526. l = r(),
  51527. c = {
  51528. position: d.getAttribLocation(l, "position"),
  51529. uv: d.getAttribLocation(l, "uv")
  51530. },
  51531. h = {
  51532. uvOffset: d.getUniformLocation(l, "uvOffset"),
  51533. uvScale: d.getUniformLocation(l, "uvScale"),
  51534. rotation: d.getUniformLocation(l, "rotation"),
  51535. scale: d.getUniformLocation(l, "scale"),
  51536. color: d.getUniformLocation(l, "color"),
  51537. map: d.getUniformLocation(l, "map"),
  51538. opacity: d.getUniformLocation(l, "opacity"),
  51539. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  51540. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  51541. fogType: d.getUniformLocation(l, "fogType"),
  51542. fogDensity: d.getUniformLocation(l, "fogDensity"),
  51543. fogNear: d.getUniformLocation(l, "fogNear"),
  51544. fogFar: d.getUniformLocation(l, "fogFar"),
  51545. fogColor: d.getUniformLocation(l, "fogColor"),
  51546. alphaTest: d.getUniformLocation(l, "alphaTest")
  51547. };
  51548. var i = document.createElement("canvas");
  51549. i.width = 8,
  51550. i.height = 8;
  51551. var o = i.getContext("2d");
  51552. o.fillStyle = "white",
  51553. o.fillRect(0, 0, 8, 8),
  51554. u = new n.Texture(i),
  51555. u.needsUpdate = !0
  51556. }
  51557. function r() {
  51558. var t = d.createProgram()
  51559. , i = d.createShader(d.VERTEX_SHADER)
  51560. , n = d.createShader(d.FRAGMENT_SHADER);
  51561. return d.shaderSource(i, ["precision " + e.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")),
  51562. d.shaderSource(n, ["precision " + e.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")),
  51563. d.compileShader(i),
  51564. d.compileShader(n),
  51565. d.attachShader(t, i),
  51566. d.attachShader(t, n),
  51567. d.linkProgram(t),
  51568. t
  51569. }
  51570. function o(e, t) {
  51571. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51572. }
  51573. var a, s, l, c, h, u, d = e.context, p = e.state, f = new n.Vector3, g = new n.Quaternion, m = new n.Vector3;
  51574. this.render = function(r, v) {
  51575. if (0 !== t.length) {
  51576. void 0 === l && i(),
  51577. d.useProgram(l),
  51578. p.initAttributes(),
  51579. p.enableAttribute(c.position),
  51580. p.enableAttribute(c.uv),
  51581. p.disableUnusedAttributes(),
  51582. p.disable(d.CULL_FACE),
  51583. p.enable(d.BLEND),
  51584. d.bindBuffer(d.ARRAY_BUFFER, a),
  51585. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  51586. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  51587. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  51588. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  51589. p.activeTexture(d.TEXTURE0),
  51590. d.uniform1i(h.map, 0);
  51591. var A = 0
  51592. , y = 0
  51593. , C = r.fog;
  51594. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  51595. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  51596. d.uniform1f(h.fogFar, C.far),
  51597. d.uniform1i(h.fogType, 1),
  51598. A = 1,
  51599. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  51600. d.uniform1i(h.fogType, 2),
  51601. A = 2,
  51602. y = 2)) : (d.uniform1i(h.fogType, 0),
  51603. A = 0,
  51604. y = 0);
  51605. for (var I = 0, E = t.length; I < E; I++) {
  51606. var b = t[I];
  51607. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  51608. b.z = -b.modelViewMatrix.elements[14]
  51609. }
  51610. t.sort(o);
  51611. for (var w = [], I = 0, E = t.length; I < E; I++) {
  51612. var b = t[I]
  51613. , _ = b.material;
  51614. d.uniform1f(h.alphaTest, _.alphaTest),
  51615. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  51616. b.matrixWorld.decompose(f, g, m),
  51617. w[0] = m.x,
  51618. w[1] = m.y;
  51619. var T = 0;
  51620. r.fog && _.fog && (T = y),
  51621. A !== T && (d.uniform1i(h.fogType, T),
  51622. A = T),
  51623. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  51624. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  51625. d.uniform2f(h.uvScale, 1, 1)),
  51626. d.uniform1f(h.opacity, _.opacity),
  51627. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  51628. d.uniform1f(h.rotation, _.rotation),
  51629. d.uniform2fv(h.scale, w),
  51630. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  51631. p.setDepthTest(_.depthTest),
  51632. p.setDepthWrite(_.depthWrite),
  51633. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  51634. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  51635. }
  51636. p.enable(d.CULL_FACE),
  51637. e.resetGLState()
  51638. }
  51639. }
  51640. }
  51641. ,
  51642. Object.defineProperties(n.Box2.prototype, {
  51643. empty: {
  51644. value: function() {
  51645. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51646. this.isEmpty()
  51647. }
  51648. },
  51649. isIntersectionBox: {
  51650. value: function(e) {
  51651. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51652. this.intersectsBox(e)
  51653. }
  51654. }
  51655. }),
  51656. Object.defineProperties(n.Box3.prototype, {
  51657. empty: {
  51658. value: function() {
  51659. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51660. this.isEmpty()
  51661. }
  51662. },
  51663. isIntersectionBox: {
  51664. value: function(e) {
  51665. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51666. this.intersectsBox(e)
  51667. }
  51668. },
  51669. isIntersectionSphere: {
  51670. value: function(e) {
  51671. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51672. this.intersectsSphere(e)
  51673. }
  51674. }
  51675. }),
  51676. Object.defineProperties(n.Matrix3.prototype, {
  51677. multiplyVector3: {
  51678. value: function(e) {
  51679. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51680. e.applyMatrix3(this)
  51681. }
  51682. },
  51683. multiplyVector3Array: {
  51684. value: function(e) {
  51685. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51686. this.applyToVector3Array(e)
  51687. }
  51688. }
  51689. }),
  51690. Object.defineProperties(n.Matrix4.prototype, {
  51691. extractPosition: {
  51692. value: function(e) {
  51693. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51694. this.copyPosition(e)
  51695. }
  51696. },
  51697. setRotationFromQuaternion: {
  51698. value: function(e) {
  51699. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51700. this.makeRotationFromQuaternion(e)
  51701. }
  51702. },
  51703. multiplyVector3: {
  51704. value: function(e) {
  51705. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51706. e.applyProjection(this)
  51707. }
  51708. },
  51709. multiplyVector4: {
  51710. value: function(e) {
  51711. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51712. e.applyMatrix4(this)
  51713. }
  51714. },
  51715. multiplyVector3Array: {
  51716. value: function(e) {
  51717. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51718. this.applyToVector3Array(e)
  51719. }
  51720. },
  51721. rotateAxis: {
  51722. value: function(e) {
  51723. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51724. e.transformDirection(this)
  51725. }
  51726. },
  51727. crossVector: {
  51728. value: function(e) {
  51729. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51730. e.applyMatrix4(this)
  51731. }
  51732. },
  51733. translate: {
  51734. value: function(e) {
  51735. console.error("THREE.Matrix4: .translate() has been removed.")
  51736. }
  51737. },
  51738. rotateX: {
  51739. value: function(e) {
  51740. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51741. }
  51742. },
  51743. rotateY: {
  51744. value: function(e) {
  51745. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51746. }
  51747. },
  51748. rotateZ: {
  51749. value: function(e) {
  51750. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51751. }
  51752. },
  51753. rotateByAxis: {
  51754. value: function(e, t) {
  51755. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51756. }
  51757. }
  51758. }),
  51759. Object.defineProperties(n.Plane.prototype, {
  51760. isIntersectionLine: {
  51761. value: function(e) {
  51762. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51763. this.intersectsLine(e)
  51764. }
  51765. }
  51766. }),
  51767. Object.defineProperties(n.Quaternion.prototype, {
  51768. multiplyVector3: {
  51769. value: function(e) {
  51770. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51771. e.applyQuaternion(this)
  51772. }
  51773. }
  51774. }),
  51775. Object.defineProperties(n.Ray.prototype, {
  51776. isIntersectionBox: {
  51777. value: function(e) {
  51778. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51779. this.intersectsBox(e)
  51780. }
  51781. },
  51782. isIntersectionPlane: {
  51783. value: function(e) {
  51784. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51785. this.intersectsPlane(e)
  51786. }
  51787. },
  51788. isIntersectionSphere: {
  51789. value: function(e) {
  51790. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51791. this.intersectsSphere(e)
  51792. }
  51793. }
  51794. }),
  51795. Object.defineProperties(n.Vector3.prototype, {
  51796. setEulerFromRotationMatrix: {
  51797. value: function() {
  51798. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51799. }
  51800. },
  51801. setEulerFromQuaternion: {
  51802. value: function() {
  51803. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51804. }
  51805. },
  51806. getPositionFromMatrix: {
  51807. value: function(e) {
  51808. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51809. this.setFromMatrixPosition(e)
  51810. }
  51811. },
  51812. getScaleFromMatrix: {
  51813. value: function(e) {
  51814. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51815. this.setFromMatrixScale(e)
  51816. }
  51817. },
  51818. getColumnFromMatrix: {
  51819. value: function(e, t) {
  51820. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51821. this.setFromMatrixColumn(e, t)
  51822. }
  51823. }
  51824. }),
  51825. n.Face4 = function(e, t, i, r, o, a, s) {
  51826. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51827. new n.Face3(e,t,i,o,a,s)
  51828. }
  51829. ,
  51830. n.Vertex = function(e, t, i) {
  51831. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51832. new n.Vector3(e,t,i)
  51833. }
  51834. ,
  51835. Object.defineProperties(n.Object3D.prototype, {
  51836. eulerOrder: {
  51837. get: function() {
  51838. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51839. this.rotation.order
  51840. },
  51841. set: function(e) {
  51842. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51843. this.rotation.order = e
  51844. }
  51845. },
  51846. getChildByName: {
  51847. value: function(e) {
  51848. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51849. this.getObjectByName(e)
  51850. }
  51851. },
  51852. renderDepth: {
  51853. set: function(e) {
  51854. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51855. }
  51856. },
  51857. translate: {
  51858. value: function(e, t) {
  51859. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51860. this.translateOnAxis(t, e)
  51861. }
  51862. },
  51863. useQuaternion: {
  51864. get: function() {
  51865. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51866. },
  51867. set: function(e) {
  51868. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51869. }
  51870. }
  51871. }),
  51872. Object.defineProperties(n, {
  51873. PointCloud: {
  51874. value: function(e, t) {
  51875. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51876. new n.Points(e,t)
  51877. }
  51878. },
  51879. ParticleSystem: {
  51880. value: function(e, t) {
  51881. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51882. new n.Points(e,t)
  51883. }
  51884. }
  51885. }),
  51886. Object.defineProperties(n.Light.prototype, {
  51887. onlyShadow: {
  51888. set: function(e) {
  51889. console.warn("THREE.Light: .onlyShadow has been removed.")
  51890. }
  51891. },
  51892. shadowCameraFov: {
  51893. set: function(e) {
  51894. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51895. this.shadow.camera.fov = e
  51896. }
  51897. },
  51898. shadowCameraLeft: {
  51899. set: function(e) {
  51900. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51901. this.shadow.camera.left = e
  51902. }
  51903. },
  51904. shadowCameraRight: {
  51905. set: function(e) {
  51906. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51907. this.shadow.camera.right = e
  51908. }
  51909. },
  51910. shadowCameraTop: {
  51911. set: function(e) {
  51912. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51913. this.shadow.camera.top = e
  51914. }
  51915. },
  51916. shadowCameraBottom: {
  51917. set: function(e) {
  51918. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51919. this.shadow.camera.bottom = e
  51920. }
  51921. },
  51922. shadowCameraNear: {
  51923. set: function(e) {
  51924. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51925. this.shadow.camera.near = e
  51926. }
  51927. },
  51928. shadowCameraFar: {
  51929. set: function(e) {
  51930. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51931. this.shadow.camera.far = e
  51932. }
  51933. },
  51934. shadowCameraVisible: {
  51935. set: function(e) {
  51936. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51937. }
  51938. },
  51939. shadowBias: {
  51940. set: function(e) {
  51941. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51942. this.shadow.bias = e
  51943. }
  51944. },
  51945. shadowDarkness: {
  51946. set: function(e) {
  51947. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51948. }
  51949. },
  51950. shadowMapWidth: {
  51951. set: function(e) {
  51952. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51953. this.shadow.mapSize.width = e
  51954. }
  51955. },
  51956. shadowMapHeight: {
  51957. set: function(e) {
  51958. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51959. this.shadow.mapSize.height = e
  51960. }
  51961. }
  51962. }),
  51963. Object.defineProperties(n.BufferAttribute.prototype, {
  51964. length: {
  51965. get: function() {
  51966. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51967. this.array.length
  51968. }
  51969. }
  51970. }),
  51971. Object.defineProperties(n.BufferGeometry.prototype, {
  51972. drawcalls: {
  51973. get: function() {
  51974. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51975. this.groups
  51976. }
  51977. },
  51978. offsets: {
  51979. get: function() {
  51980. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51981. this.groups
  51982. }
  51983. },
  51984. addIndex: {
  51985. value: function(e) {
  51986. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51987. this.setIndex(e)
  51988. }
  51989. },
  51990. addDrawCall: {
  51991. value: function(e, t, i) {
  51992. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51993. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51994. this.addGroup(e, t)
  51995. }
  51996. },
  51997. clearDrawCalls: {
  51998. value: function() {
  51999. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  52000. this.clearGroups()
  52001. }
  52002. },
  52003. computeTangents: {
  52004. value: function() {
  52005. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  52006. }
  52007. },
  52008. computeOffsets: {
  52009. value: function() {
  52010. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  52011. }
  52012. }
  52013. }),
  52014. Object.defineProperties(n.Material.prototype, {
  52015. wrapAround: {
  52016. get: function() {
  52017. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  52018. },
  52019. set: function(e) {
  52020. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  52021. }
  52022. },
  52023. wrapRGB: {
  52024. get: function() {
  52025. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  52026. new n.Color
  52027. }
  52028. }
  52029. }),
  52030. Object.defineProperties(n, {
  52031. PointCloudMaterial: {
  52032. value: function(e) {
  52033. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  52034. new n.PointsMaterial(e)
  52035. }
  52036. },
  52037. ParticleBasicMaterial: {
  52038. value: function(e) {
  52039. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  52040. new n.PointsMaterial(e)
  52041. }
  52042. },
  52043. ParticleSystemMaterial: {
  52044. value: function(e) {
  52045. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  52046. new n.PointsMaterial(e)
  52047. }
  52048. }
  52049. }),
  52050. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  52051. metal: {
  52052. get: function() {
  52053. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  52054. !1
  52055. },
  52056. set: function(e) {
  52057. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  52058. }
  52059. }
  52060. }),
  52061. Object.defineProperties(n.ShaderMaterial.prototype, {
  52062. derivatives: {
  52063. get: function() {
  52064. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52065. this.extensions.derivatives
  52066. },
  52067. set: function(e) {
  52068. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52069. this.extensions.derivatives = e
  52070. }
  52071. }
  52072. }),
  52073. Object.defineProperties(n.WebGLRenderer.prototype, {
  52074. supportsFloatTextures: {
  52075. value: function() {
  52076. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  52077. this.extensions.get("OES_texture_float")
  52078. }
  52079. },
  52080. supportsHalfFloatTextures: {
  52081. value: function() {
  52082. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  52083. this.extensions.get("OES_texture_half_float")
  52084. }
  52085. },
  52086. supportsStandardDerivatives: {
  52087. value: function() {
  52088. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  52089. this.extensions.get("OES_standard_derivatives")
  52090. }
  52091. },
  52092. supportsCompressedTextureS3TC: {
  52093. value: function() {
  52094. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  52095. this.extensions.get("WEBGL_compressed_texture_s3tc")
  52096. }
  52097. },
  52098. supportsCompressedTexturePVRTC: {
  52099. value: function() {
  52100. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  52101. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  52102. }
  52103. },
  52104. supportsBlendMinMax: {
  52105. value: function() {
  52106. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  52107. this.extensions.get("EXT_blend_minmax")
  52108. }
  52109. },
  52110. supportsVertexTextures: {
  52111. value: function() {
  52112. return this.capabilities.vertexTextures
  52113. }
  52114. },
  52115. supportsInstancedArrays: {
  52116. value: function() {
  52117. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  52118. this.extensions.get("ANGLE_instanced_arrays")
  52119. }
  52120. },
  52121. enableScissorTest: {
  52122. value: function(e) {
  52123. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  52124. this.setScissorTest(e)
  52125. }
  52126. },
  52127. initMaterial: {
  52128. value: function() {
  52129. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  52130. }
  52131. },
  52132. addPrePlugin: {
  52133. value: function() {
  52134. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  52135. }
  52136. },
  52137. addPostPlugin: {
  52138. value: function() {
  52139. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  52140. }
  52141. },
  52142. updateShadowMap: {
  52143. value: function() {
  52144. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  52145. }
  52146. },
  52147. shadowMapEnabled: {
  52148. get: function() {
  52149. return this.shadowMap.enabled
  52150. },
  52151. set: function(e) {
  52152. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  52153. this.shadowMap.enabled = e
  52154. }
  52155. },
  52156. shadowMapType: {
  52157. get: function() {
  52158. return this.shadowMap.type
  52159. },
  52160. set: function(e) {
  52161. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  52162. this.shadowMap.type = e
  52163. }
  52164. },
  52165. shadowMapCullFace: {
  52166. get: function() {
  52167. return this.shadowMap.cullFace
  52168. },
  52169. set: function(e) {
  52170. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  52171. this.shadowMap.cullFace = e
  52172. }
  52173. }
  52174. }),
  52175. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  52176. wrapS: {
  52177. get: function() {
  52178. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52179. this.texture.wrapS
  52180. },
  52181. set: function(e) {
  52182. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52183. this.texture.wrapS = e
  52184. }
  52185. },
  52186. wrapT: {
  52187. get: function() {
  52188. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52189. this.texture.wrapT
  52190. },
  52191. set: function(e) {
  52192. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52193. this.texture.wrapT = e
  52194. }
  52195. },
  52196. magFilter: {
  52197. get: function() {
  52198. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52199. this.texture.magFilter
  52200. },
  52201. set: function(e) {
  52202. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52203. this.texture.magFilter = e
  52204. }
  52205. },
  52206. minFilter: {
  52207. get: function() {
  52208. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52209. this.texture.minFilter
  52210. },
  52211. set: function(e) {
  52212. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52213. this.texture.minFilter = e
  52214. }
  52215. },
  52216. anisotropy: {
  52217. get: function() {
  52218. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52219. this.texture.anisotropy
  52220. },
  52221. set: function(e) {
  52222. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52223. this.texture.anisotropy = e
  52224. }
  52225. },
  52226. offset: {
  52227. get: function() {
  52228. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52229. this.texture.offset
  52230. },
  52231. set: function(e) {
  52232. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52233. this.texture.offset = e
  52234. }
  52235. },
  52236. repeat: {
  52237. get: function() {
  52238. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52239. this.texture.repeat
  52240. },
  52241. set: function(e) {
  52242. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52243. this.texture.repeat = e
  52244. }
  52245. },
  52246. format: {
  52247. get: function() {
  52248. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52249. this.texture.format
  52250. },
  52251. set: function(e) {
  52252. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52253. this.texture.format = e
  52254. }
  52255. },
  52256. type: {
  52257. get: function() {
  52258. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52259. this.texture.type
  52260. },
  52261. set: function(e) {
  52262. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52263. this.texture.type = e
  52264. }
  52265. },
  52266. generateMipmaps: {
  52267. get: function() {
  52268. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52269. this.texture.generateMipmaps
  52270. },
  52271. set: function(e) {
  52272. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52273. this.texture.generateMipmaps = e
  52274. }
  52275. }
  52276. }),
  52277. n.GeometryUtils = {
  52278. merge: function(e, t, i) {
  52279. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  52280. var r;
  52281. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  52282. r = t.matrix,
  52283. t = t.geometry),
  52284. e.merge(t, r, i)
  52285. },
  52286. center: function(e) {
  52287. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52288. e.center()
  52289. }
  52290. },
  52291. n.ImageUtils = {
  52292. crossOrigin: void 0,
  52293. loadTexture: function(e, t, i, r) {
  52294. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52295. var o = new n.TextureLoader;
  52296. o.setCrossOrigin(this.crossOrigin);
  52297. var a = o.load(e, i, void 0, r);
  52298. return t && (a.mapping = t),
  52299. a
  52300. },
  52301. loadTextureCube: function(e, t, i, r) {
  52302. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52303. var o = new n.CubeTextureLoader;
  52304. o.setCrossOrigin(this.crossOrigin);
  52305. var a = o.load(e, i, void 0, r);
  52306. return t && (a.mapping = t),
  52307. a
  52308. },
  52309. loadCompressedTexture: function() {
  52310. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52311. },
  52312. loadCompressedTextureCube: function() {
  52313. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52314. }
  52315. },
  52316. n.Projector = function() {
  52317. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52318. this.projectVector = function(e, t) {
  52319. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52320. e.project(t)
  52321. }
  52322. ,
  52323. this.unprojectVector = function(e, t) {
  52324. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52325. e.unproject(t)
  52326. }
  52327. ,
  52328. this.pickingRay = function(e, t) {
  52329. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52330. }
  52331. }
  52332. ,
  52333. n.CanvasRenderer = function() {
  52334. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52335. this.domElement = document.createElement("canvas"),
  52336. this.clear = function() {}
  52337. ,
  52338. this.render = function() {}
  52339. ,
  52340. this.setClearColor = function() {}
  52341. ,
  52342. this.setSize = function() {}
  52343. }
  52344. ,
  52345. n.MeshFaceMaterial = n.MultiMaterial,
  52346. n.CurveUtils = {
  52347. tangentQuadraticBezier: function(e, t, i, n) {
  52348. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52349. },
  52350. tangentCubicBezier: function(e, t, i, n, r) {
  52351. 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
  52352. },
  52353. tangentSpline: function(e, t, i, n, r) {
  52354. var o = 6 * e * e - 6 * e
  52355. , a = 3 * e * e - 4 * e + 1
  52356. , s = -6 * e * e + 6 * e
  52357. , l = 3 * e * e - 2 * e;
  52358. return o + a + s + l
  52359. },
  52360. interpolate: function(e, t, i, n, r) {
  52361. var o = .5 * (i - e)
  52362. , a = .5 * (n - t)
  52363. , s = r * r
  52364. , l = r * s;
  52365. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52366. }
  52367. },
  52368. n.SceneUtils = {
  52369. createMultiMaterialObject: function(e, t) {
  52370. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  52371. i.add(new n.Mesh(e,t[r]));
  52372. return i
  52373. },
  52374. detach: function(e, t, i) {
  52375. e.applyMatrix(t.matrixWorld),
  52376. t.remove(e),
  52377. i.add(e)
  52378. },
  52379. attach: function(e, t, i) {
  52380. var r = new n.Matrix4;
  52381. r.getInverse(i.matrixWorld),
  52382. e.applyMatrix(r),
  52383. t.remove(e),
  52384. i.add(e)
  52385. }
  52386. },
  52387. n.ShapeUtils = {
  52388. area: function(e) {
  52389. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52390. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52391. return .5 * i
  52392. },
  52393. triangulate: function() {
  52394. function e(e, t, i, n, r, o) {
  52395. var a, s, l, c, h, u, d, p, f;
  52396. if (s = e[o[t]].x,
  52397. l = e[o[t]].y,
  52398. c = e[o[i]].x,
  52399. h = e[o[i]].y,
  52400. u = e[o[n]].x,
  52401. d = e[o[n]].y,
  52402. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  52403. return !1;
  52404. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  52405. for (g = u - c,
  52406. m = d - h,
  52407. v = s - u,
  52408. A = l - d,
  52409. y = c - s,
  52410. C = h - l,
  52411. a = 0; a < r; a++)
  52412. if (p = e[o[a]].x,
  52413. f = e[o[a]].y,
  52414. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  52415. E = f - l,
  52416. b = p - c,
  52417. w = f - h,
  52418. _ = p - u,
  52419. T = f - d,
  52420. M = g * w - m * b,
  52421. x = y * E - C * I,
  52422. S = v * T - A * _,
  52423. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  52424. return !1;
  52425. return !0
  52426. }
  52427. return function(t, i) {
  52428. var r = t.length;
  52429. if (r < 3)
  52430. return null;
  52431. var o, a, s, l = [], c = [], h = [];
  52432. if (n.ShapeUtils.area(t) > 0)
  52433. for (a = 0; a < r; a++)
  52434. c[a] = a;
  52435. else
  52436. for (a = 0; a < r; a++)
  52437. c[a] = r - 1 - a;
  52438. var u = r
  52439. , d = 2 * u;
  52440. for (a = u - 1; u > 2; ) {
  52441. if (d-- <= 0)
  52442. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52443. i ? h : l;
  52444. if (o = a,
  52445. u <= o && (o = 0),
  52446. a = o + 1,
  52447. u <= a && (a = 0),
  52448. s = a + 1,
  52449. u <= s && (s = 0),
  52450. e(t, o, a, s, u, c)) {
  52451. var p, f, g, m, v;
  52452. for (p = c[o],
  52453. f = c[a],
  52454. g = c[s],
  52455. l.push([t[p], t[f], t[g]]),
  52456. h.push([c[o], c[a], c[s]]),
  52457. m = a,
  52458. v = a + 1; v < u; m++,
  52459. v++)
  52460. c[m] = c[v];
  52461. u--,
  52462. d = 2 * u
  52463. }
  52464. }
  52465. return i ? h : l
  52466. }
  52467. }(),
  52468. triangulateShape: function(e, t) {
  52469. function i(e, t, i) {
  52470. 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
  52471. }
  52472. function r(e, t, n, r, o) {
  52473. var a = t.x - e.x
  52474. , s = t.y - e.y
  52475. , l = r.x - n.x
  52476. , c = r.y - n.y
  52477. , h = e.x - n.x
  52478. , u = e.y - n.y
  52479. , d = s * l - a * c
  52480. , p = s * h - a * u;
  52481. if (Math.abs(d) > Number.EPSILON) {
  52482. var f;
  52483. if (d > 0) {
  52484. if (p < 0 || p > d)
  52485. return [];
  52486. if (f = c * h - l * u,
  52487. f < 0 || f > d)
  52488. return []
  52489. } else {
  52490. if (p > 0 || p < d)
  52491. return [];
  52492. if (f = c * h - l * u,
  52493. f > 0 || f < d)
  52494. return []
  52495. }
  52496. if (0 === f)
  52497. return !o || 0 !== p && p !== d ? [e] : [];
  52498. if (f === d)
  52499. return !o || 0 !== p && p !== d ? [t] : [];
  52500. if (0 === p)
  52501. return [n];
  52502. if (p === d)
  52503. return [r];
  52504. var g = f / d;
  52505. return [{
  52506. x: e.x + g * a,
  52507. y: e.y + g * s
  52508. }]
  52509. }
  52510. if (0 !== p || c * h !== l * u)
  52511. return [];
  52512. var m = 0 === a && 0 === s
  52513. , v = 0 === l && 0 === c;
  52514. if (m && v)
  52515. return e.x !== n.x || e.y !== n.y ? [] : [e];
  52516. if (m)
  52517. return i(n, r, e) ? [e] : [];
  52518. if (v)
  52519. return i(e, t, n) ? [n] : [];
  52520. var A, y, C, I, E, b, w, _;
  52521. return 0 !== a ? (e.x < t.x ? (A = e,
  52522. C = e.x,
  52523. y = t,
  52524. I = t.x) : (A = t,
  52525. C = t.x,
  52526. y = e,
  52527. I = e.x),
  52528. n.x < r.x ? (E = n,
  52529. w = n.x,
  52530. b = r,
  52531. _ = r.x) : (E = r,
  52532. w = r.x,
  52533. b = n,
  52534. _ = n.x)) : (e.y < t.y ? (A = e,
  52535. C = e.y,
  52536. y = t,
  52537. I = t.y) : (A = t,
  52538. C = t.y,
  52539. y = e,
  52540. I = e.y),
  52541. n.y < r.y ? (E = n,
  52542. w = n.y,
  52543. b = r,
  52544. _ = r.y) : (E = r,
  52545. w = r.y,
  52546. b = n,
  52547. _ = n.y)),
  52548. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  52549. }
  52550. function o(e, t, i, n) {
  52551. var r = t.x - e.x
  52552. , o = t.y - e.y
  52553. , a = i.x - e.x
  52554. , s = i.y - e.y
  52555. , l = n.x - e.x
  52556. , c = n.y - e.y
  52557. , h = r * s - o * a
  52558. , u = r * c - o * l;
  52559. if (Math.abs(h) > Number.EPSILON) {
  52560. var d = l * s - c * a;
  52561. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  52562. }
  52563. return u > 0
  52564. }
  52565. function a(e, t) {
  52566. function i(e, t) {
  52567. var i = A.length - 1
  52568. , n = e - 1;
  52569. n < 0 && (n = i);
  52570. var r = e + 1;
  52571. r > i && (r = 0);
  52572. var a = o(A[e], A[n], A[r], s[t]);
  52573. if (!a)
  52574. return !1;
  52575. var l = s.length - 1
  52576. , c = t - 1;
  52577. c < 0 && (c = l);
  52578. var h = t + 1;
  52579. return h > l && (h = 0),
  52580. a = o(s[t], s[c], s[h], A[e]),
  52581. !!a
  52582. }
  52583. function n(e, t) {
  52584. var i, n, o;
  52585. for (i = 0; i < A.length; i++)
  52586. if (n = i + 1,
  52587. n %= A.length,
  52588. o = r(e, t, A[i], A[n], !0),
  52589. o.length > 0)
  52590. return !0;
  52591. return !1
  52592. }
  52593. function a(e, i) {
  52594. var n, o, a, s, l;
  52595. for (n = 0; n < y.length; n++)
  52596. for (o = t[y[n]],
  52597. a = 0; a < o.length; a++)
  52598. if (s = a + 1,
  52599. s %= o.length,
  52600. l = r(e, i, o[a], o[s], !0),
  52601. l.length > 0)
  52602. return !0;
  52603. return !1
  52604. }
  52605. for (var s, l, c, h, u, d, p, f, g, m, v, A = e.concat(), y = [], C = [], I = 0, E = t.length; I < E; I++)
  52606. y.push(I);
  52607. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  52608. if (w--,
  52609. w < 0) {
  52610. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  52611. break
  52612. }
  52613. for (c = b; c < A.length; c++) {
  52614. h = A[c],
  52615. l = -1;
  52616. for (var I = 0; I < y.length; I++)
  52617. if (d = y[I],
  52618. p = h.x + ":" + h.y + ":" + d,
  52619. void 0 === C[p]) {
  52620. s = t[d];
  52621. for (var _ = 0; _ < s.length; _++)
  52622. if (u = s[_],
  52623. i(c, _) && !n(h, u) && !a(h, u)) {
  52624. l = _,
  52625. y.splice(I, 1),
  52626. f = A.slice(0, c + 1),
  52627. g = A.slice(c),
  52628. m = s.slice(l),
  52629. v = s.slice(0, l + 1),
  52630. A = f.concat(m).concat(v).concat(g),
  52631. b = c;
  52632. break
  52633. }
  52634. if (l >= 0)
  52635. break;
  52636. C[p] = !0
  52637. }
  52638. if (l >= 0)
  52639. break
  52640. }
  52641. }
  52642. return A
  52643. }
  52644. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  52645. Array.prototype.push.apply(f, t[g]);
  52646. for (s = 0,
  52647. l = f.length; s < l; s++)
  52648. u = f[s].x + ":" + f[s].y,
  52649. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  52650. p[u] = s;
  52651. var v = a(e, t)
  52652. , A = n.ShapeUtils.triangulate(v, !1);
  52653. for (s = 0,
  52654. l = A.length; s < l; s++)
  52655. for (h = A[s],
  52656. c = 0; c < 3; c++)
  52657. u = h[c].x + ":" + h[c].y,
  52658. d = p[u],
  52659. void 0 !== d && (h[c] = d);
  52660. return A.concat()
  52661. },
  52662. isClockWise: function(e) {
  52663. return n.ShapeUtils.area(e) < 0
  52664. },
  52665. b2: function() {
  52666. function e(e, t) {
  52667. var i = 1 - e;
  52668. return i * i * t
  52669. }
  52670. function t(e, t) {
  52671. return 2 * (1 - e) * e * t
  52672. }
  52673. function i(e, t) {
  52674. return e * e * t
  52675. }
  52676. return function(n, r, o, a) {
  52677. return e(n, r) + t(n, o) + i(n, a)
  52678. }
  52679. }(),
  52680. b3: function() {
  52681. function e(e, t) {
  52682. var i = 1 - e;
  52683. return i * i * i * t
  52684. }
  52685. function t(e, t) {
  52686. var i = 1 - e;
  52687. return 3 * i * i * e * t
  52688. }
  52689. function i(e, t) {
  52690. var i = 1 - e;
  52691. return 3 * i * e * e * t
  52692. }
  52693. function n(e, t) {
  52694. return e * e * e * t
  52695. }
  52696. return function(r, o, a, s, l) {
  52697. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  52698. }
  52699. }()
  52700. },
  52701. n.Curve = function() {}
  52702. ,
  52703. n.Curve.prototype = {
  52704. constructor: n.Curve,
  52705. getPoint: function(e) {
  52706. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52707. null
  52708. },
  52709. getPointAt: function(e) {
  52710. var t = this.getUtoTmapping(e);
  52711. return this.getPoint(t)
  52712. },
  52713. getPoints: function(e) {
  52714. e || (e = 5);
  52715. var t, i = [];
  52716. for (t = 0; t <= e; t++)
  52717. i.push(this.getPoint(t / e));
  52718. return i
  52719. },
  52720. getSpacedPoints: function(e) {
  52721. e || (e = 5);
  52722. var t, i = [];
  52723. for (t = 0; t <= e; t++)
  52724. i.push(this.getPointAt(t / e));
  52725. return i
  52726. },
  52727. getLength: function() {
  52728. var e = this.getLengths();
  52729. return e[e.length - 1]
  52730. },
  52731. getLengths: function(e) {
  52732. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52733. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52734. return this.cacheArcLengths;
  52735. this.needsUpdate = !1;
  52736. var t, i, n = [], r = this.getPoint(0), o = 0;
  52737. for (n.push(0),
  52738. i = 1; i <= e; i++)
  52739. t = this.getPoint(i / e),
  52740. o += t.distanceTo(r),
  52741. n.push(o),
  52742. r = t;
  52743. return this.cacheArcLengths = n,
  52744. n
  52745. },
  52746. updateArcLengths: function() {
  52747. this.needsUpdate = !0,
  52748. this.getLengths()
  52749. },
  52750. getUtoTmapping: function(e, t) {
  52751. var i, n = this.getLengths(), r = 0, o = n.length;
  52752. i = t ? t : e * n[o - 1];
  52753. for (var a, s = 0, l = o - 1; s <= l; )
  52754. if (r = Math.floor(s + (l - s) / 2),
  52755. a = n[r] - i,
  52756. a < 0)
  52757. s = r + 1;
  52758. else {
  52759. if (!(a > 0)) {
  52760. l = r;
  52761. break
  52762. }
  52763. l = r - 1
  52764. }
  52765. if (r = l,
  52766. n[r] === i) {
  52767. var c = r / (o - 1);
  52768. return c
  52769. }
  52770. var h = n[r]
  52771. , u = n[r + 1]
  52772. , d = u - h
  52773. , p = (i - h) / d
  52774. , c = (r + p) / (o - 1);
  52775. return c
  52776. },
  52777. getTangent: function(e) {
  52778. var t = 1e-4
  52779. , i = e - t
  52780. , n = e + t;
  52781. i < 0 && (i = 0),
  52782. n > 1 && (n = 1);
  52783. var r = this.getPoint(i)
  52784. , o = this.getPoint(n)
  52785. , a = o.clone().sub(r);
  52786. return a.normalize()
  52787. },
  52788. getTangentAt: function(e) {
  52789. var t = this.getUtoTmapping(e);
  52790. return this.getTangent(t)
  52791. }
  52792. },
  52793. n.Curve.create = function(e, t) {
  52794. return e.prototype = Object.create(n.Curve.prototype),
  52795. e.prototype.constructor = e,
  52796. e.prototype.getPoint = t,
  52797. e
  52798. }
  52799. ,
  52800. n.CurvePath = function() {
  52801. this.curves = [],
  52802. this.autoClose = !1
  52803. }
  52804. ,
  52805. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  52806. n.CurvePath.prototype.constructor = n.CurvePath,
  52807. n.CurvePath.prototype.add = function(e) {
  52808. this.curves.push(e)
  52809. }
  52810. ,
  52811. n.CurvePath.prototype.closePath = function() {
  52812. var e = this.curves[0].getPoint(0)
  52813. , t = this.curves[this.curves.length - 1].getPoint(1);
  52814. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  52815. }
  52816. ,
  52817. n.CurvePath.prototype.getPoint = function(e) {
  52818. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52819. if (i[n] >= t) {
  52820. var r = i[n] - t
  52821. , o = this.curves[n]
  52822. , a = 1 - r / o.getLength();
  52823. return o.getPointAt(a)
  52824. }
  52825. n++
  52826. }
  52827. return null
  52828. }
  52829. ,
  52830. n.CurvePath.prototype.getLength = function() {
  52831. var e = this.getCurveLengths();
  52832. return e[e.length - 1]
  52833. }
  52834. ,
  52835. n.CurvePath.prototype.getCurveLengths = function() {
  52836. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52837. return this.cacheLengths;
  52838. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52839. t += this.curves[i].getLength(),
  52840. e.push(t);
  52841. return this.cacheLengths = e,
  52842. e
  52843. }
  52844. ,
  52845. n.CurvePath.prototype.createPointsGeometry = function(e) {
  52846. var t = this.getPoints(e);
  52847. return this.createGeometry(t)
  52848. }
  52849. ,
  52850. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52851. var t = this.getSpacedPoints(e);
  52852. return this.createGeometry(t)
  52853. }
  52854. ,
  52855. n.CurvePath.prototype.createGeometry = function(e) {
  52856. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  52857. var o = e[i];
  52858. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  52859. }
  52860. return t
  52861. }
  52862. ,
  52863. n.Font = function(e) {
  52864. this.data = e
  52865. }
  52866. ,
  52867. n.Font.prototype = {
  52868. constructor: n.Font,
  52869. generateShapes: function(e, t, i) {
  52870. function r(e) {
  52871. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  52872. var c = o(i[l], n, r);
  52873. r += c.offset,
  52874. s.push(c.path)
  52875. }
  52876. return s
  52877. }
  52878. function o(e, t, r) {
  52879. var o = a.glyphs[e] || a.glyphs["?"];
  52880. if (o) {
  52881. var s, l, c, h, u, d, p, f, g, m, v, A = new n.Path, y = [], C = n.ShapeUtils.b2, I = n.ShapeUtils.b3;
  52882. if (o.o)
  52883. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  52884. var _ = E[b++];
  52885. switch (_) {
  52886. case "m":
  52887. s = E[b++] * t + r,
  52888. l = E[b++] * t,
  52889. A.moveTo(s, l);
  52890. break;
  52891. case "l":
  52892. s = E[b++] * t + r,
  52893. l = E[b++] * t,
  52894. A.lineTo(s, l);
  52895. break;
  52896. case "q":
  52897. if (c = E[b++] * t + r,
  52898. h = E[b++] * t,
  52899. p = E[b++] * t + r,
  52900. f = E[b++] * t,
  52901. A.quadraticCurveTo(p, f, c, h),
  52902. v = y[y.length - 1]) {
  52903. u = v.x,
  52904. d = v.y;
  52905. for (var T = 1; T <= i; T++) {
  52906. var x = T / i;
  52907. C(x, u, p, c),
  52908. C(x, d, f, h)
  52909. }
  52910. }
  52911. break;
  52912. case "b":
  52913. if (c = E[b++] * t + r,
  52914. h = E[b++] * t,
  52915. p = E[b++] * t + r,
  52916. f = E[b++] * t,
  52917. g = E[b++] * t + r,
  52918. m = E[b++] * t,
  52919. A.bezierCurveTo(p, f, g, m, c, h),
  52920. v = y[y.length - 1]) {
  52921. u = v.x,
  52922. d = v.y;
  52923. for (var T = 1; T <= i; T++) {
  52924. var x = T / i;
  52925. I(x, u, p, g, c),
  52926. I(x, d, f, m, h)
  52927. }
  52928. }
  52929. }
  52930. }
  52931. return {
  52932. offset: o.ha * t,
  52933. path: A
  52934. }
  52935. }
  52936. }
  52937. void 0 === t && (t = 100),
  52938. void 0 === i && (i = 4);
  52939. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  52940. Array.prototype.push.apply(l, s[c].toShapes());
  52941. return l
  52942. }
  52943. },
  52944. n.Path = function(e) {
  52945. n.CurvePath.call(this),
  52946. this.actions = [],
  52947. e && this.fromPoints(e)
  52948. }
  52949. ,
  52950. n.Path.prototype = Object.create(n.CurvePath.prototype),
  52951. n.Path.prototype.constructor = n.Path,
  52952. n.Path.prototype.fromPoints = function(e) {
  52953. this.moveTo(e[0].x, e[0].y);
  52954. for (var t = 1, i = e.length; t < i; t++)
  52955. this.lineTo(e[t].x, e[t].y)
  52956. }
  52957. ,
  52958. n.Path.prototype.moveTo = function(e, t) {
  52959. this.actions.push({
  52960. action: "moveTo",
  52961. args: [e, t]
  52962. })
  52963. }
  52964. ,
  52965. n.Path.prototype.lineTo = function(e, t) {
  52966. var i = this.actions[this.actions.length - 1].args
  52967. , r = i[i.length - 2]
  52968. , o = i[i.length - 1]
  52969. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  52970. this.curves.push(a),
  52971. this.actions.push({
  52972. action: "lineTo",
  52973. args: [e, t]
  52974. })
  52975. }
  52976. ,
  52977. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  52978. var o = this.actions[this.actions.length - 1].args
  52979. , a = o[o.length - 2]
  52980. , s = o[o.length - 1]
  52981. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  52982. this.curves.push(l),
  52983. this.actions.push({
  52984. action: "quadraticCurveTo",
  52985. args: [e, t, i, r]
  52986. })
  52987. }
  52988. ,
  52989. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  52990. var s = this.actions[this.actions.length - 1].args
  52991. , l = s[s.length - 2]
  52992. , c = s[s.length - 1]
  52993. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  52994. this.curves.push(h),
  52995. this.actions.push({
  52996. action: "bezierCurveTo",
  52997. args: [e, t, i, r, o, a]
  52998. })
  52999. }
  53000. ,
  53001. n.Path.prototype.splineThru = function(e) {
  53002. var t = Array.prototype.slice.call(arguments)
  53003. , i = this.actions[this.actions.length - 1].args
  53004. , r = i[i.length - 2]
  53005. , o = i[i.length - 1]
  53006. , a = [new n.Vector2(r,o)];
  53007. Array.prototype.push.apply(a, e);
  53008. var s = new n.SplineCurve(a);
  53009. this.curves.push(s),
  53010. this.actions.push({
  53011. action: "splineThru",
  53012. args: t
  53013. })
  53014. }
  53015. ,
  53016. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  53017. var a = this.actions[this.actions.length - 1].args
  53018. , s = a[a.length - 2]
  53019. , l = a[a.length - 1];
  53020. this.absarc(e + s, t + l, i, n, r, o)
  53021. }
  53022. ,
  53023. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  53024. this.absellipse(e, t, i, i, n, r, o)
  53025. }
  53026. ,
  53027. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  53028. var l = this.actions[this.actions.length - 1].args
  53029. , c = l[l.length - 2]
  53030. , h = l[l.length - 1];
  53031. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  53032. }
  53033. ,
  53034. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  53035. var c = [e, t, i, r, o, a, s, l || 0]
  53036. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  53037. this.curves.push(h);
  53038. var u = h.getPoint(1);
  53039. c.push(u.x),
  53040. c.push(u.y),
  53041. this.actions.push({
  53042. action: "ellipse",
  53043. args: c
  53044. })
  53045. }
  53046. ,
  53047. n.Path.prototype.getSpacedPoints = function(e) {
  53048. e || (e = 40);
  53049. for (var t = [], i = 0; i < e; i++)
  53050. t.push(this.getPoint(i / e));
  53051. return this.autoClose && t.push(t[0]),
  53052. t
  53053. }
  53054. ,
  53055. n.Path.prototype.getPoints = function(e) {
  53056. e = e || 12;
  53057. for (var t, i, r, o, a, s, l, c, h, u, d, p = n.ShapeUtils.b2, f = n.ShapeUtils.b3, g = [], m = 0, v = this.actions.length; m < v; m++) {
  53058. var A = this.actions[m]
  53059. , y = A.action
  53060. , C = A.args;
  53061. switch (y) {
  53062. case "moveTo":
  53063. g.push(new n.Vector2(C[0],C[1]));
  53064. break;
  53065. case "lineTo":
  53066. g.push(new n.Vector2(C[0],C[1]));
  53067. break;
  53068. case "quadraticCurveTo":
  53069. t = C[2],
  53070. i = C[3],
  53071. a = C[0],
  53072. s = C[1],
  53073. g.length > 0 ? (h = g[g.length - 1],
  53074. l = h.x,
  53075. c = h.y) : (h = this.actions[m - 1].args,
  53076. l = h[h.length - 2],
  53077. c = h[h.length - 1]);
  53078. for (var I = 1; I <= e; I++) {
  53079. var E = I / e;
  53080. u = p(E, l, a, t),
  53081. d = p(E, c, s, i),
  53082. g.push(new n.Vector2(u,d))
  53083. }
  53084. break;
  53085. case "bezierCurveTo":
  53086. t = C[4],
  53087. i = C[5],
  53088. a = C[0],
  53089. s = C[1],
  53090. r = C[2],
  53091. o = C[3],
  53092. g.length > 0 ? (h = g[g.length - 1],
  53093. l = h.x,
  53094. c = h.y) : (h = this.actions[m - 1].args,
  53095. l = h[h.length - 2],
  53096. c = h[h.length - 1]);
  53097. for (var I = 1; I <= e; I++) {
  53098. var E = I / e;
  53099. u = f(E, l, a, r, t),
  53100. d = f(E, c, s, o, i),
  53101. g.push(new n.Vector2(u,d))
  53102. }
  53103. break;
  53104. case "splineThru":
  53105. h = this.actions[m - 1].args;
  53106. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  53107. , w = [b]
  53108. , _ = e * C[0].length;
  53109. w = w.concat(C[0]);
  53110. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  53111. g.push(T.getPointAt(I / _));
  53112. break;
  53113. case "arc":
  53114. for (var x, S = C[0], M = C[1], R = C[2], P = C[3], O = C[4], L = !!C[5], D = O - P, N = 2 * e, I = 1; I <= N; I++) {
  53115. var E = I / N;
  53116. L || (E = 1 - E),
  53117. x = P + E * D,
  53118. u = S + R * Math.cos(x),
  53119. d = M + R * Math.sin(x),
  53120. g.push(new n.Vector2(u,d))
  53121. }
  53122. break;
  53123. case "ellipse":
  53124. var x, B, F, S = C[0], M = C[1], V = C[2], U = C[3], P = C[4], O = C[5], L = !!C[6], k = C[7], D = O - P, N = 2 * e;
  53125. 0 !== k && (B = Math.cos(k),
  53126. F = Math.sin(k));
  53127. for (var I = 1; I <= N; I++) {
  53128. var E = I / N;
  53129. if (L || (E = 1 - E),
  53130. x = P + E * D,
  53131. u = S + V * Math.cos(x),
  53132. d = M + U * Math.sin(x),
  53133. 0 !== k) {
  53134. var H = u
  53135. , G = d;
  53136. u = (H - S) * B - (G - M) * F + S,
  53137. d = (H - S) * F + (G - M) * B + M
  53138. }
  53139. g.push(new n.Vector2(u,d))
  53140. }
  53141. }
  53142. }
  53143. var z = g[g.length - 1];
  53144. return Math.abs(z.x - g[0].x) < Number.EPSILON && Math.abs(z.y - g[0].y) < Number.EPSILON && g.splice(g.length - 1, 1),
  53145. this.autoClose && g.push(g[0]),
  53146. g
  53147. }
  53148. ,
  53149. n.Path.prototype.toShapes = function(e, t) {
  53150. function i(e) {
  53151. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  53152. var a = e[r]
  53153. , s = a.args
  53154. , l = a.action;
  53155. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  53156. i = new n.Path),
  53157. i[l].apply(i, s)
  53158. }
  53159. return 0 !== i.actions.length && t.push(i),
  53160. t
  53161. }
  53162. function r(e) {
  53163. for (var t = [], i = 0, r = e.length; i < r; i++) {
  53164. var o = e[i]
  53165. , a = new n.Shape;
  53166. a.actions = o.actions,
  53167. a.curves = o.curves,
  53168. t.push(a)
  53169. }
  53170. return t
  53171. }
  53172. function o(e, t) {
  53173. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  53174. var a = t[r]
  53175. , s = t[o]
  53176. , l = s.x - a.x
  53177. , c = s.y - a.y;
  53178. if (Math.abs(c) > Number.EPSILON) {
  53179. if (c < 0 && (a = t[o],
  53180. l = -l,
  53181. s = t[r],
  53182. c = -c),
  53183. e.y < a.y || e.y > s.y)
  53184. continue;
  53185. if (e.y === a.y) {
  53186. if (e.x === a.x)
  53187. return !0
  53188. } else {
  53189. var h = c * (e.x - a.x) - l * (e.y - a.y);
  53190. if (0 === h)
  53191. return !0;
  53192. if (h < 0)
  53193. continue;
  53194. n = !n
  53195. }
  53196. } else {
  53197. if (e.y !== a.y)
  53198. continue;
  53199. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  53200. return !0
  53201. }
  53202. }
  53203. return n
  53204. }
  53205. var a = n.ShapeUtils.isClockWise
  53206. , s = i(this.actions);
  53207. if (0 === s.length)
  53208. return [];
  53209. if (t === !0)
  53210. return r(s);
  53211. var l, c, h, u = [];
  53212. if (1 === s.length)
  53213. return c = s[0],
  53214. h = new n.Shape,
  53215. h.actions = c.actions,
  53216. h.curves = c.curves,
  53217. u.push(h),
  53218. u;
  53219. var d = !a(s[0].getPoints());
  53220. d = e ? !d : d;
  53221. var p, f = [], g = [], m = [], v = 0;
  53222. g[v] = void 0,
  53223. m[v] = [];
  53224. for (var A = 0, y = s.length; A < y; A++)
  53225. c = s[A],
  53226. p = c.getPoints(),
  53227. l = a(p),
  53228. l = e ? !l : l,
  53229. l ? (!d && g[v] && v++,
  53230. g[v] = {
  53231. s: new n.Shape,
  53232. p: p
  53233. },
  53234. g[v].s.actions = c.actions,
  53235. g[v].s.curves = c.curves,
  53236. d && v++,
  53237. m[v] = []) : m[v].push({
  53238. h: c,
  53239. p: p[0]
  53240. });
  53241. if (!g[0])
  53242. return r(s);
  53243. if (g.length > 1) {
  53244. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  53245. f[E] = [];
  53246. for (var E = 0, b = g.length; E < b; E++)
  53247. for (var w = m[E], _ = 0; _ < w.length; _++) {
  53248. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  53249. o(T.p, g[S].p) && (E !== S && I.push({
  53250. froms: E,
  53251. tos: S,
  53252. hole: _
  53253. }),
  53254. x ? (x = !1,
  53255. f[S].push(T)) : C = !0);
  53256. x && f[E].push(T)
  53257. }
  53258. I.length > 0 && (C || (m = f))
  53259. }
  53260. for (var M, A = 0, R = g.length; A < R; A++) {
  53261. h = g[A].s,
  53262. u.push(h),
  53263. M = m[A];
  53264. for (var P = 0, O = M.length; P < O; P++)
  53265. h.holes.push(M[P].h)
  53266. }
  53267. return u
  53268. }
  53269. ,
  53270. n.Shape = function() {
  53271. n.Path.apply(this, arguments),
  53272. this.holes = []
  53273. }
  53274. ,
  53275. n.Shape.prototype = Object.create(n.Path.prototype),
  53276. n.Shape.prototype.constructor = n.Shape,
  53277. n.Shape.prototype.extrude = function(e) {
  53278. return new n.ExtrudeGeometry(this,e)
  53279. }
  53280. ,
  53281. n.Shape.prototype.makeGeometry = function(e) {
  53282. return new n.ShapeGeometry(this,e)
  53283. }
  53284. ,
  53285. n.Shape.prototype.getPointsHoles = function(e) {
  53286. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  53287. t[i] = this.holes[i].getPoints(e);
  53288. return t
  53289. }
  53290. ,
  53291. n.Shape.prototype.extractAllPoints = function(e) {
  53292. return {
  53293. shape: this.getPoints(e),
  53294. holes: this.getPointsHoles(e)
  53295. }
  53296. }
  53297. ,
  53298. n.Shape.prototype.extractPoints = function(e) {
  53299. return this.extractAllPoints(e)
  53300. }
  53301. ,
  53302. n.LineCurve = function(e, t) {
  53303. this.v1 = e,
  53304. this.v2 = t
  53305. }
  53306. ,
  53307. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  53308. n.LineCurve.prototype.constructor = n.LineCurve,
  53309. n.LineCurve.prototype.getPoint = function(e) {
  53310. var t = this.v2.clone().sub(this.v1);
  53311. return t.multiplyScalar(e).add(this.v1),
  53312. t
  53313. }
  53314. ,
  53315. n.LineCurve.prototype.getPointAt = function(e) {
  53316. return this.getPoint(e)
  53317. }
  53318. ,
  53319. n.LineCurve.prototype.getTangent = function(e) {
  53320. var t = this.v2.clone().sub(this.v1);
  53321. return t.normalize()
  53322. }
  53323. ,
  53324. n.QuadraticBezierCurve = function(e, t, i) {
  53325. this.v0 = e,
  53326. this.v1 = t,
  53327. this.v2 = i
  53328. }
  53329. ,
  53330. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  53331. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  53332. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  53333. var t = n.ShapeUtils.b2;
  53334. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  53335. }
  53336. ,
  53337. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  53338. var t = n.CurveUtils.tangentQuadraticBezier;
  53339. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  53340. }
  53341. ,
  53342. n.CubicBezierCurve = function(e, t, i, n) {
  53343. this.v0 = e,
  53344. this.v1 = t,
  53345. this.v2 = i,
  53346. this.v3 = n
  53347. }
  53348. ,
  53349. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  53350. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  53351. n.CubicBezierCurve.prototype.getPoint = function(e) {
  53352. var t = n.ShapeUtils.b3;
  53353. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  53354. }
  53355. ,
  53356. n.CubicBezierCurve.prototype.getTangent = function(e) {
  53357. var t = n.CurveUtils.tangentCubicBezier;
  53358. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  53359. }
  53360. ,
  53361. n.SplineCurve = function(e) {
  53362. this.points = void 0 == e ? [] : e
  53363. }
  53364. ,
  53365. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  53366. n.SplineCurve.prototype.constructor = n.SplineCurve,
  53367. n.SplineCurve.prototype.getPoint = function(e) {
  53368. var t = this.points
  53369. , i = (t.length - 1) * e
  53370. , r = Math.floor(i)
  53371. , o = i - r
  53372. , a = t[0 === r ? r : r - 1]
  53373. , s = t[r]
  53374. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  53375. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  53376. , h = n.CurveUtils.interpolate;
  53377. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  53378. }
  53379. ,
  53380. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  53381. this.aX = e,
  53382. this.aY = t,
  53383. this.xRadius = i,
  53384. this.yRadius = n,
  53385. this.aStartAngle = r,
  53386. this.aEndAngle = o,
  53387. this.aClockwise = a,
  53388. this.aRotation = s || 0
  53389. }
  53390. ,
  53391. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  53392. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  53393. n.EllipseCurve.prototype.getPoint = function(e) {
  53394. var t = this.aEndAngle - this.aStartAngle;
  53395. t < 0 && (t += 2 * Math.PI),
  53396. t > 2 * Math.PI && (t -= 2 * Math.PI);
  53397. var i;
  53398. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  53399. var r = this.aX + this.xRadius * Math.cos(i)
  53400. , o = this.aY + this.yRadius * Math.sin(i);
  53401. if (0 !== this.aRotation) {
  53402. var a = Math.cos(this.aRotation)
  53403. , s = Math.sin(this.aRotation)
  53404. , l = r
  53405. , c = o;
  53406. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  53407. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  53408. }
  53409. return new n.Vector2(r,o)
  53410. }
  53411. ,
  53412. n.ArcCurve = function(e, t, i, r, o, a) {
  53413. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  53414. }
  53415. ,
  53416. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  53417. n.ArcCurve.prototype.constructor = n.ArcCurve,
  53418. n.LineCurve3 = n.Curve.create(function(e, t) {
  53419. this.v1 = e,
  53420. this.v2 = t
  53421. }, function(e) {
  53422. var t = new n.Vector3;
  53423. return t.subVectors(this.v2, this.v1),
  53424. t.multiplyScalar(e),
  53425. t.add(this.v1),
  53426. t
  53427. }),
  53428. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  53429. this.v0 = e,
  53430. this.v1 = t,
  53431. this.v2 = i
  53432. }, function(e) {
  53433. var t = n.ShapeUtils.b2;
  53434. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y),t(e, this.v0.z, this.v1.z, this.v2.z))
  53435. }),
  53436. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  53437. this.v0 = e,
  53438. this.v1 = t,
  53439. this.v2 = i,
  53440. this.v3 = n
  53441. }, function(e) {
  53442. var t = n.ShapeUtils.b3;
  53443. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  53444. }),
  53445. n.SplineCurve3 = n.Curve.create(function(e) {
  53446. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53447. this.points = void 0 == e ? [] : e
  53448. }, function(e) {
  53449. var t = this.points
  53450. , i = (t.length - 1) * e
  53451. , r = Math.floor(i)
  53452. , o = i - r
  53453. , a = t[0 == r ? r : r - 1]
  53454. , s = t[r]
  53455. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  53456. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  53457. , h = n.CurveUtils.interpolate;
  53458. return new n.Vector3(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o),h(a.z, s.z, l.z, c.z, o))
  53459. }),
  53460. n.CatmullRomCurve3 = function() {
  53461. function e() {}
  53462. var t = new n.Vector3
  53463. , i = new e
  53464. , r = new e
  53465. , o = new e;
  53466. return e.prototype.init = function(e, t, i, n) {
  53467. this.c0 = e,
  53468. this.c1 = i,
  53469. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53470. this.c3 = 2 * e - 2 * t + i + n
  53471. }
  53472. ,
  53473. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53474. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53475. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53476. s *= o,
  53477. l *= o,
  53478. this.init(t, i, s, l)
  53479. }
  53480. ,
  53481. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  53482. this.init(t, i, r * (i - e), r * (n - t))
  53483. }
  53484. ,
  53485. e.prototype.calc = function(e) {
  53486. var t = e * e
  53487. , i = t * e;
  53488. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53489. }
  53490. ,
  53491. n.Curve.create(function(e) {
  53492. this.points = e || [],
  53493. this.closed = !1
  53494. }, function(e) {
  53495. var a, s, l, c, h = this.points;
  53496. c = h.length,
  53497. c < 2 && console.log("duh, you need at least 2 points"),
  53498. a = (c - (this.closed ? 0 : 1)) * e,
  53499. s = Math.floor(a),
  53500. l = a - s,
  53501. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  53502. l = 1);
  53503. var u, d, p, f;
  53504. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  53505. u = t),
  53506. d = h[s % c],
  53507. p = h[(s + 1) % c],
  53508. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  53509. f = t),
  53510. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53511. var g = "chordal" === this.type ? .5 : .25
  53512. , m = Math.pow(u.distanceToSquared(d), g)
  53513. , v = Math.pow(d.distanceToSquared(p), g)
  53514. , A = Math.pow(p.distanceToSquared(f), g);
  53515. v < 1e-4 && (v = 1),
  53516. m < 1e-4 && (m = v),
  53517. A < 1e-4 && (A = v),
  53518. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  53519. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  53520. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  53521. } else if ("catmullrom" === this.type) {
  53522. var y = void 0 !== this.tension ? this.tension : .5;
  53523. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  53524. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  53525. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  53526. }
  53527. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  53528. return C
  53529. })
  53530. }(),
  53531. n.ClosedSplineCurve3 = function(e) {
  53532. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53533. n.CatmullRomCurve3.call(this, e),
  53534. this.type = "catmullrom",
  53535. this.closed = !0
  53536. }
  53537. ,
  53538. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  53539. n.BoxGeometry = function(e, t, i, r, o, a) {
  53540. n.Geometry.call(this),
  53541. this.type = "BoxGeometry",
  53542. this.parameters = {
  53543. width: e,
  53544. height: t,
  53545. depth: i,
  53546. widthSegments: r,
  53547. heightSegments: o,
  53548. depthSegments: a
  53549. },
  53550. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  53551. this.mergeVertices()
  53552. }
  53553. ,
  53554. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  53555. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  53556. n.CubeGeometry = n.BoxGeometry,
  53557. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  53558. function s(e, t, i) {
  53559. var n = 0;
  53560. return n += e * t * 2,
  53561. n += e * i * 2,
  53562. n += i * t * 2,
  53563. 4 * n
  53564. }
  53565. function l(e, t, i, r, o, a, s, l, h, u, I) {
  53566. for (var E = a / h, b = s / u, w = a / 2, _ = s / 2, T = l / 2, x = h + 1, S = u + 1, M = 0, R = 0, P = new n.Vector3, O = 0; O < S; O++)
  53567. for (var L = O * b - _, D = 0; D < x; D++) {
  53568. var N = D * E - w;
  53569. P[e] = N * r,
  53570. P[t] = L * o,
  53571. P[i] = T,
  53572. p[m] = P.x,
  53573. p[m + 1] = P.y,
  53574. p[m + 2] = P.z,
  53575. P[e] = 0,
  53576. P[t] = 0,
  53577. P[i] = l > 0 ? 1 : -1,
  53578. f[m] = P.x,
  53579. f[m + 1] = P.y,
  53580. f[m + 2] = P.z,
  53581. g[v] = D / h,
  53582. g[v + 1] = 1 - O / u,
  53583. m += 3,
  53584. v += 2,
  53585. M += 1
  53586. }
  53587. for (O = 0; O < u; O++)
  53588. for (D = 0; D < h; D++) {
  53589. var B = y + D + x * O
  53590. , F = y + D + x * (O + 1)
  53591. , V = y + (D + 1) + x * (O + 1)
  53592. , U = y + (D + 1) + x * O;
  53593. d[A] = B,
  53594. d[A + 1] = F,
  53595. d[A + 2] = U,
  53596. d[A + 3] = F,
  53597. d[A + 4] = V,
  53598. d[A + 5] = U,
  53599. A += 6,
  53600. R += 6
  53601. }
  53602. c.addGroup(C, R, I),
  53603. C += R,
  53604. y += M
  53605. }
  53606. n.BufferGeometry.call(this),
  53607. this.type = "BoxBufferGeometry",
  53608. this.parameters = {
  53609. width: e,
  53610. height: t,
  53611. depth: i,
  53612. widthSegments: r,
  53613. heightSegments: o,
  53614. depthSegments: a
  53615. };
  53616. var c = this;
  53617. r = Math.floor(r) || 1,
  53618. o = Math.floor(o) || 1,
  53619. a = Math.floor(a) || 1;
  53620. var h = s(r, o, a)
  53621. , u = h / 4 * 6
  53622. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  53623. , p = new Float32Array(3 * h)
  53624. , f = new Float32Array(3 * h)
  53625. , g = new Float32Array(2 * h)
  53626. , m = 0
  53627. , v = 0
  53628. , A = 0
  53629. , y = 0
  53630. , C = 0;
  53631. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  53632. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  53633. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  53634. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  53635. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  53636. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  53637. this.setIndex(new n.BufferAttribute(d,1)),
  53638. this.addAttribute("position", new n.BufferAttribute(p,3)),
  53639. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  53640. this.addAttribute("uv", new n.BufferAttribute(g,2))
  53641. }
  53642. ,
  53643. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53644. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  53645. n.CircleGeometry = function(e, t, i, r) {
  53646. n.Geometry.call(this),
  53647. this.type = "CircleGeometry",
  53648. this.parameters = {
  53649. radius: e,
  53650. segments: t,
  53651. thetaStart: i,
  53652. thetaLength: r
  53653. },
  53654. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  53655. }
  53656. ,
  53657. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  53658. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  53659. n.CircleBufferGeometry = function(e, t, i, r) {
  53660. n.BufferGeometry.call(this),
  53661. this.type = "CircleBufferGeometry",
  53662. this.parameters = {
  53663. radius: e,
  53664. segments: t,
  53665. thetaStart: i,
  53666. thetaLength: r
  53667. },
  53668. e = e || 50,
  53669. t = void 0 !== t ? Math.max(3, t) : 8,
  53670. i = void 0 !== i ? i : 0,
  53671. r = void 0 !== r ? r : 2 * Math.PI;
  53672. var o = t + 2
  53673. , a = new Float32Array(3 * o)
  53674. , s = new Float32Array(3 * o)
  53675. , l = new Float32Array(2 * o);
  53676. s[2] = 1,
  53677. l[0] = .5,
  53678. l[1] = .5;
  53679. for (var c = 0, h = 3, u = 2; c <= t; c++,
  53680. h += 3,
  53681. u += 2) {
  53682. var d = i + c / t * r;
  53683. a[h] = e * Math.cos(d),
  53684. a[h + 1] = e * Math.sin(d),
  53685. s[h + 2] = 1,
  53686. l[u] = (a[h] / e + 1) / 2,
  53687. l[u + 1] = (a[h + 1] / e + 1) / 2
  53688. }
  53689. for (var p = [], h = 1; h <= t; h++)
  53690. p.push(h, h + 1, 0);
  53691. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  53692. this.addAttribute("position", new n.BufferAttribute(a,3)),
  53693. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  53694. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  53695. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  53696. }
  53697. ,
  53698. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53699. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  53700. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  53701. function c() {
  53702. var e = (r + 1) * (o + 1);
  53703. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  53704. e
  53705. }
  53706. function h() {
  53707. var e = r * o * 2 * 3;
  53708. return a === !1 && (e += 2 * r * 3),
  53709. e
  53710. }
  53711. function u() {
  53712. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  53713. for (c = 0; c <= o; c++) {
  53714. var p = []
  53715. , f = c / o
  53716. , b = f * (t - e) + e;
  53717. for (a = 0; a <= r; a++) {
  53718. var w = a / r;
  53719. u.x = b * Math.sin(w * l + s),
  53720. u.y = -f * i + E,
  53721. u.z = b * Math.cos(w * l + s),
  53722. m.setXYZ(y, u.x, u.y, u.z),
  53723. h.copy(u),
  53724. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  53725. h.z = Math.cos(w * l + s)),
  53726. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  53727. v.setXYZ(y, h.x, h.y, h.z),
  53728. A.setXY(y, w, 1 - f),
  53729. p.push(y),
  53730. y++
  53731. }
  53732. I.push(p)
  53733. }
  53734. for (a = 0; a < r; a++)
  53735. for (c = 0; c < o; c++) {
  53736. var _ = I[c][a]
  53737. , T = I[c + 1][a]
  53738. , x = I[c + 1][a + 1]
  53739. , S = I[c][a + 1];
  53740. g.setX(C, _),
  53741. C++,
  53742. g.setX(C, T),
  53743. C++,
  53744. g.setX(C, S),
  53745. C++,
  53746. g.setX(C, T),
  53747. C++,
  53748. g.setX(C, x),
  53749. C++,
  53750. g.setX(C, S),
  53751. C++
  53752. }
  53753. }
  53754. function d(i) {
  53755. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  53756. for (a = y,
  53757. o = 1; o <= r; o++)
  53758. m.setXYZ(y, 0, E * p, 0),
  53759. v.setXYZ(y, 0, p, 0),
  53760. i === !0 ? (h.x = o / r,
  53761. h.y = 0) : (h.x = (o - 1) / r,
  53762. h.y = 1),
  53763. A.setXY(y, h.x, h.y),
  53764. y++;
  53765. for (c = y,
  53766. o = 0; o <= r; o++) {
  53767. var f = o / r;
  53768. u.x = d * Math.sin(f * l + s),
  53769. u.y = E * p,
  53770. u.z = d * Math.cos(f * l + s),
  53771. m.setXYZ(y, u.x, u.y, u.z),
  53772. v.setXYZ(y, 0, p, 0),
  53773. A.setXY(y, f, i === !0 ? 1 : 0),
  53774. y++
  53775. }
  53776. for (o = 0; o < r; o++) {
  53777. var I = a + o
  53778. , b = c + o;
  53779. i === !0 ? (g.setX(C, b),
  53780. C++,
  53781. g.setX(C, b + 1),
  53782. C++,
  53783. g.setX(C, I),
  53784. C++) : (g.setX(C, b + 1),
  53785. C++,
  53786. g.setX(C, b),
  53787. C++,
  53788. g.setX(C, I),
  53789. C++)
  53790. }
  53791. }
  53792. n.BufferGeometry.call(this),
  53793. this.type = "CylinderBufferGeometry",
  53794. this.parameters = {
  53795. radiusTop: e,
  53796. radiusBottom: t,
  53797. height: i,
  53798. radialSegments: r,
  53799. heightSegments: o,
  53800. openEnded: a,
  53801. thetaStart: s,
  53802. thetaLength: l
  53803. },
  53804. e = void 0 !== e ? e : 20,
  53805. t = void 0 !== t ? t : 20,
  53806. i = void 0 !== i ? i : 100,
  53807. r = Math.floor(r) || 8,
  53808. o = Math.floor(o) || 1,
  53809. a = void 0 !== a && a,
  53810. s = void 0 !== s ? s : 0,
  53811. l = void 0 !== l ? l : 2 * Math.PI;
  53812. var p = c()
  53813. , f = h()
  53814. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  53815. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  53816. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  53817. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  53818. , y = 0
  53819. , C = 0
  53820. , I = []
  53821. , E = i / 2;
  53822. u(),
  53823. a === !1 && (e > 0 && d(!0),
  53824. t > 0 && d(!1)),
  53825. this.setIndex(g),
  53826. this.addAttribute("position", m),
  53827. this.addAttribute("normal", v),
  53828. this.addAttribute("uv", A)
  53829. }
  53830. ,
  53831. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53832. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  53833. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  53834. n.Geometry.call(this),
  53835. this.type = "CylinderGeometry",
  53836. this.parameters = {
  53837. radiusTop: e,
  53838. radiusBottom: t,
  53839. height: i,
  53840. radialSegments: r,
  53841. heightSegments: o,
  53842. openEnded: a,
  53843. thetaStart: s,
  53844. thetaLength: l
  53845. },
  53846. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  53847. this.mergeVertices()
  53848. }
  53849. ,
  53850. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  53851. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  53852. n.EdgesGeometry = function(e, t) {
  53853. function i(e, t) {
  53854. return e - t
  53855. }
  53856. n.BufferGeometry.call(this),
  53857. t = void 0 !== t ? t : 1;
  53858. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  53859. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  53860. r.fromBufferGeometry(e)) : r = e.clone(),
  53861. r.mergeVertices(),
  53862. r.computeFaceNormals();
  53863. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  53864. for (var p = h[u], f = 0; f < 3; f++) {
  53865. a[0] = p[l[f]],
  53866. a[1] = p[l[(f + 1) % 3]],
  53867. a.sort(i);
  53868. var g = a.toString();
  53869. void 0 === s[g] ? s[g] = {
  53870. vert1: a[0],
  53871. vert2: a[1],
  53872. face1: u,
  53873. face2: void 0
  53874. } : s[g].face2 = u
  53875. }
  53876. var m = [];
  53877. for (var g in s) {
  53878. var v = s[g];
  53879. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  53880. var A = c[v.vert1];
  53881. m.push(A.x),
  53882. m.push(A.y),
  53883. m.push(A.z),
  53884. A = c[v.vert2],
  53885. m.push(A.x),
  53886. m.push(A.y),
  53887. m.push(A.z)
  53888. }
  53889. }
  53890. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  53891. }
  53892. ,
  53893. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53894. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  53895. n.ExtrudeGeometry = function(e, t) {
  53896. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  53897. this.type = "ExtrudeGeometry",
  53898. e = Array.isArray(e) ? e : [e],
  53899. this.addShapeList(e, t),
  53900. void this.computeFaceNormals())
  53901. }
  53902. ;
  53903. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  53904. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  53905. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53906. for (var i = e.length, n = 0; n < i; n++) {
  53907. var r = e[n];
  53908. this.addShape(r, t)
  53909. }
  53910. }
  53911. ,
  53912. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53913. function i(e, t, i) {
  53914. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53915. t.clone().multiplyScalar(i).add(e)
  53916. }
  53917. function r(e, t, i) {
  53918. var r, o, a = 1, s = e.x - t.x, l = e.y - t.y, c = i.x - e.x, h = i.y - e.y, u = s * s + l * l, d = s * h - l * c;
  53919. if (Math.abs(d) > Number.EPSILON) {
  53920. var p = Math.sqrt(u)
  53921. , f = Math.sqrt(c * c + h * h)
  53922. , g = t.x - l / p
  53923. , m = t.y + s / p
  53924. , v = i.x - h / f
  53925. , A = i.y + c / f
  53926. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  53927. r = g + s * y - e.x,
  53928. o = m + l * y - e.y;
  53929. var C = r * r + o * o;
  53930. if (C <= 2)
  53931. return new n.Vector2(r,o);
  53932. a = Math.sqrt(C / 2)
  53933. } else {
  53934. var I = !1;
  53935. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  53936. I ? (r = -l,
  53937. o = s,
  53938. a = Math.sqrt(u)) : (r = s,
  53939. o = l,
  53940. a = Math.sqrt(u / 2))
  53941. }
  53942. return new n.Vector2(r / a,o / a)
  53943. }
  53944. function o() {
  53945. if (C) {
  53946. var e = 0
  53947. , t = z * e;
  53948. for (Y = 0; Y < W; Y++)
  53949. G = N[Y],
  53950. c(G[2] + t, G[1] + t, G[0] + t);
  53951. for (e = E + 2 * y,
  53952. t = z * e,
  53953. Y = 0; Y < W; Y++)
  53954. G = N[Y],
  53955. c(G[0] + t, G[1] + t, G[2] + t)
  53956. } else {
  53957. for (Y = 0; Y < W; Y++)
  53958. G = N[Y],
  53959. c(G[2], G[1], G[0]);
  53960. for (Y = 0; Y < W; Y++)
  53961. G = N[Y],
  53962. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  53963. }
  53964. }
  53965. function a() {
  53966. var e = 0;
  53967. for (s(B, e),
  53968. e += B.length,
  53969. x = 0,
  53970. S = L.length; x < S; x++)
  53971. T = L[x],
  53972. s(T, e),
  53973. e += T.length
  53974. }
  53975. function s(e, t) {
  53976. var i, n;
  53977. for (Y = e.length; --Y >= 0; ) {
  53978. i = Y,
  53979. n = Y - 1,
  53980. n < 0 && (n = e.length - 1);
  53981. var r = 0
  53982. , o = E + 2 * y;
  53983. for (r = 0; r < o; r++) {
  53984. var a = z * r
  53985. , s = z * (r + 1)
  53986. , l = t + i + a
  53987. , c = t + n + a
  53988. , u = t + n + s
  53989. , d = t + i + s;
  53990. h(l, c, u, d, e, r, o, i, n)
  53991. }
  53992. }
  53993. }
  53994. function l(e, t, i) {
  53995. M.vertices.push(new n.Vector3(e,t,i))
  53996. }
  53997. function c(e, t, i) {
  53998. e += R,
  53999. t += R,
  54000. i += R,
  54001. M.faces.push(new n.Face3(e,t,i,null,null,0));
  54002. var r = _.generateTopUV(M, e, t, i);
  54003. M.faceVertexUvs[0].push(r)
  54004. }
  54005. function h(e, t, i, r, o, a, s, l, c) {
  54006. e += R,
  54007. t += R,
  54008. i += R,
  54009. r += R,
  54010. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  54011. M.faces.push(new n.Face3(t,i,r,null,null,1));
  54012. var h = _.generateSideWallUV(M, e, t, i, r);
  54013. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  54014. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  54015. }
  54016. var u, d, p, f, g, m = void 0 !== t.amount ? t.amount : 100, v = void 0 !== t.bevelThickness ? t.bevelThickness : 6, A = void 0 !== t.bevelSize ? t.bevelSize : v - 2, y = void 0 !== t.bevelSegments ? t.bevelSegments : 3, C = void 0 === t.bevelEnabled || t.bevelEnabled, I = void 0 !== t.curveSegments ? t.curveSegments : 12, E = void 0 !== t.steps ? t.steps : 1, b = t.extrudePath, w = !1, _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator;
  54017. b && (u = b.getSpacedPoints(E),
  54018. w = !0,
  54019. C = !1,
  54020. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  54021. p = new n.Vector3,
  54022. f = new n.Vector3,
  54023. g = new n.Vector3),
  54024. C || (y = 0,
  54025. v = 0,
  54026. A = 0);
  54027. var T, x, S, M = this, R = this.vertices.length, P = e.extractPoints(I), O = P.shape, L = P.holes, D = !n.ShapeUtils.isClockWise(O);
  54028. if (D) {
  54029. for (O = O.reverse(),
  54030. x = 0,
  54031. S = L.length; x < S; x++)
  54032. T = L[x],
  54033. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  54034. D = !1
  54035. }
  54036. var N = n.ShapeUtils.triangulateShape(O, L)
  54037. , B = O;
  54038. for (x = 0,
  54039. S = L.length; x < S; x++)
  54040. T = L[x],
  54041. O = O.concat(T);
  54042. for (var F, V, U, k, H, G, z = O.length, W = N.length, j = [], Y = 0, X = B.length, Z = X - 1, q = Y + 1; Y < X; Y++,
  54043. Z++,
  54044. q++)
  54045. Z === X && (Z = 0),
  54046. q === X && (q = 0),
  54047. j[Y] = r(B[Y], B[Z], B[q]);
  54048. var K, Q = [], J = j.concat();
  54049. for (x = 0,
  54050. S = L.length; x < S; x++) {
  54051. for (T = L[x],
  54052. K = [],
  54053. Y = 0,
  54054. X = T.length,
  54055. Z = X - 1,
  54056. q = Y + 1; Y < X; Y++,
  54057. Z++,
  54058. q++)
  54059. Z === X && (Z = 0),
  54060. q === X && (q = 0),
  54061. K[Y] = r(T[Y], T[Z], T[q]);
  54062. Q.push(K),
  54063. J = J.concat(K)
  54064. }
  54065. for (F = 0; F < y; F++) {
  54066. for (U = F / y,
  54067. k = v * (1 - U),
  54068. V = A * Math.sin(U * Math.PI / 2),
  54069. Y = 0,
  54070. X = B.length; Y < X; Y++)
  54071. H = i(B[Y], j[Y], V),
  54072. l(H.x, H.y, -k);
  54073. for (x = 0,
  54074. S = L.length; x < S; x++)
  54075. for (T = L[x],
  54076. K = Q[x],
  54077. Y = 0,
  54078. X = T.length; Y < X; Y++)
  54079. H = i(T[Y], K[Y], V),
  54080. l(H.x, H.y, -k)
  54081. }
  54082. for (V = A,
  54083. Y = 0; Y < z; Y++)
  54084. H = C ? i(O[Y], J[Y], V) : O[Y],
  54085. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  54086. p.copy(d.binormals[0]).multiplyScalar(H.y),
  54087. g.copy(u[0]).add(f).add(p),
  54088. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  54089. var $;
  54090. for ($ = 1; $ <= E; $++)
  54091. for (Y = 0; Y < z; Y++)
  54092. H = C ? i(O[Y], J[Y], V) : O[Y],
  54093. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  54094. p.copy(d.binormals[$]).multiplyScalar(H.y),
  54095. g.copy(u[$]).add(f).add(p),
  54096. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  54097. for (F = y - 1; F >= 0; F--) {
  54098. for (U = F / y,
  54099. k = v * (1 - U),
  54100. V = A * Math.sin(U * Math.PI / 2),
  54101. Y = 0,
  54102. X = B.length; Y < X; Y++)
  54103. H = i(B[Y], j[Y], V),
  54104. l(H.x, H.y, m + k);
  54105. for (x = 0,
  54106. S = L.length; x < S; x++)
  54107. for (T = L[x],
  54108. K = Q[x],
  54109. Y = 0,
  54110. X = T.length; Y < X; Y++)
  54111. H = i(T[Y], K[Y], V),
  54112. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  54113. }
  54114. o(),
  54115. a()
  54116. }
  54117. ,
  54118. n.ExtrudeGeometry.WorldUVGenerator = {
  54119. generateTopUV: function(e, t, i, r) {
  54120. var o = e.vertices
  54121. , a = o[t]
  54122. , s = o[i]
  54123. , l = o[r];
  54124. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  54125. },
  54126. generateSideWallUV: function(e, t, i, r, o) {
  54127. var a = e.vertices
  54128. , s = a[t]
  54129. , l = a[i]
  54130. , c = a[r]
  54131. , h = a[o];
  54132. return Math.abs(s.y - l.y) < .01 ? [new n.Vector2(s.x,1 - s.z), new n.Vector2(l.x,1 - l.z), new n.Vector2(c.x,1 - c.z), new n.Vector2(h.x,1 - h.z)] : [new n.Vector2(s.y,1 - s.z), new n.Vector2(l.y,1 - l.z), new n.Vector2(c.y,1 - c.z), new n.Vector2(h.y,1 - h.z)]
  54133. }
  54134. },
  54135. n.ShapeGeometry = function(e, t) {
  54136. n.Geometry.call(this),
  54137. this.type = "ShapeGeometry",
  54138. Array.isArray(e) === !1 && (e = [e]),
  54139. this.addShapeList(e, t),
  54140. this.computeFaceNormals()
  54141. }
  54142. ,
  54143. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  54144. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  54145. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  54146. for (var i = 0, n = e.length; i < n; i++)
  54147. this.addShape(e[i], t);
  54148. return this
  54149. }
  54150. ,
  54151. n.ShapeGeometry.prototype.addShape = function(e, t) {
  54152. void 0 === t && (t = {});
  54153. var i, r, o, a = void 0 !== t.curveSegments ? t.curveSegments : 12, s = t.material, l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, c = this.vertices.length, h = e.extractPoints(a), u = h.shape, d = h.holes, p = !n.ShapeUtils.isClockWise(u);
  54154. if (p) {
  54155. for (u = u.reverse(),
  54156. i = 0,
  54157. r = d.length; i < r; i++)
  54158. o = d[i],
  54159. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  54160. p = !1
  54161. }
  54162. var f = n.ShapeUtils.triangulateShape(u, d);
  54163. for (i = 0,
  54164. r = d.length; i < r; i++)
  54165. o = d[i],
  54166. u = u.concat(o);
  54167. var g, m, v = u.length, A = f.length;
  54168. for (i = 0; i < v; i++)
  54169. g = u[i],
  54170. this.vertices.push(new n.Vector3(g.x,g.y,0));
  54171. for (i = 0; i < A; i++) {
  54172. m = f[i];
  54173. var y = m[0] + c
  54174. , C = m[1] + c
  54175. , I = m[2] + c;
  54176. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  54177. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  54178. }
  54179. }
  54180. ,
  54181. n.LatheBufferGeometry = function(e, t, i, r) {
  54182. n.BufferGeometry.call(this),
  54183. this.type = "LatheBufferGeometry",
  54184. this.parameters = {
  54185. points: e,
  54186. segments: t,
  54187. phiStart: i,
  54188. phiLength: r
  54189. },
  54190. t = Math.floor(t) || 12,
  54191. i = i || 0,
  54192. r = r || 2 * Math.PI,
  54193. r = n.Math.clamp(r, 0, 2 * Math.PI);
  54194. var o, a, s, l = (t + 1) * e.length, c = t * e.length * 2 * 3, h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c),1), u = new n.BufferAttribute(new Float32Array(3 * l),3), d = new n.BufferAttribute(new Float32Array(2 * l),2), p = 0, f = 0, g = (1 / (e.length - 1),
  54195. 1 / t), m = new n.Vector3, v = new n.Vector2;
  54196. for (a = 0; a <= t; a++) {
  54197. var A = i + a * g * r
  54198. , y = Math.sin(A)
  54199. , C = Math.cos(A);
  54200. for (s = 0; s <= e.length - 1; s++)
  54201. m.x = e[s].x * y,
  54202. m.y = e[s].y,
  54203. m.z = e[s].x * C,
  54204. u.setXYZ(p, m.x, m.y, m.z),
  54205. v.x = a / t,
  54206. v.y = s / (e.length - 1),
  54207. d.setXY(p, v.x, v.y),
  54208. p++
  54209. }
  54210. for (a = 0; a < t; a++)
  54211. for (s = 0; s < e.length - 1; s++) {
  54212. o = s + a * e.length;
  54213. var I = o
  54214. , E = o + e.length
  54215. , b = o + e.length + 1
  54216. , w = o + 1;
  54217. h.setX(f, I),
  54218. f++,
  54219. h.setX(f, E),
  54220. f++,
  54221. h.setX(f, w),
  54222. f++,
  54223. h.setX(f, E),
  54224. f++,
  54225. h.setX(f, b),
  54226. f++,
  54227. h.setX(f, w),
  54228. f++
  54229. }
  54230. if (this.setIndex(h),
  54231. this.addAttribute("position", u),
  54232. this.addAttribute("uv", d),
  54233. this.computeVertexNormals(),
  54234. r === 2 * Math.PI) {
  54235. var _ = this.attributes.normal.array
  54236. , T = new n.Vector3
  54237. , x = new n.Vector3
  54238. , S = new n.Vector3;
  54239. for (o = t * e.length * 3,
  54240. a = 0,
  54241. s = 0; a < e.length; a++,
  54242. s += 3)
  54243. T.x = _[s + 0],
  54244. T.y = _[s + 1],
  54245. T.z = _[s + 2],
  54246. x.x = _[o + s + 0],
  54247. x.y = _[o + s + 1],
  54248. x.z = _[o + s + 2],
  54249. S.addVectors(T, x).normalize(),
  54250. _[s + 0] = _[o + s + 0] = S.x,
  54251. _[s + 1] = _[o + s + 1] = S.y,
  54252. _[s + 2] = _[o + s + 2] = S.z
  54253. }
  54254. }
  54255. ,
  54256. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54257. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  54258. n.LatheGeometry = function(e, t, i, r) {
  54259. n.Geometry.call(this),
  54260. this.type = "LatheGeometry",
  54261. this.parameters = {
  54262. points: e,
  54263. segments: t,
  54264. phiStart: i,
  54265. phiLength: r
  54266. },
  54267. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  54268. this.mergeVertices()
  54269. }
  54270. ,
  54271. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  54272. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  54273. n.PlaneGeometry = function(e, t, i, r) {
  54274. n.Geometry.call(this),
  54275. this.type = "PlaneGeometry",
  54276. this.parameters = {
  54277. width: e,
  54278. height: t,
  54279. widthSegments: i,
  54280. heightSegments: r
  54281. },
  54282. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  54283. }
  54284. ,
  54285. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  54286. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  54287. n.PlaneBufferGeometry = function(e, t, i, r) {
  54288. n.BufferGeometry.call(this),
  54289. this.type = "PlaneBufferGeometry",
  54290. this.parameters = {
  54291. width: e,
  54292. height: t,
  54293. widthSegments: i,
  54294. heightSegments: r
  54295. };
  54296. for (var o = e / 2, a = t / 2, s = Math.floor(i) || 1, l = Math.floor(r) || 1, c = s + 1, h = l + 1, u = e / s, d = t / l, p = new Float32Array(c * h * 3), f = new Float32Array(c * h * 3), g = new Float32Array(c * h * 2), m = 0, v = 0, A = 0; A < h; A++)
  54297. for (var y = A * d - a, C = 0; C < c; C++) {
  54298. var I = C * u - o;
  54299. p[m] = I,
  54300. p[m + 1] = -y,
  54301. f[m + 2] = 1,
  54302. g[v] = C / s,
  54303. g[v + 1] = 1 - A / l,
  54304. m += 3,
  54305. v += 2
  54306. }
  54307. m = 0;
  54308. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  54309. for (var C = 0; C < s; C++) {
  54310. var b = C + c * A
  54311. , w = C + c * (A + 1)
  54312. , _ = C + 1 + c * (A + 1)
  54313. , T = C + 1 + c * A;
  54314. E[m] = b,
  54315. E[m + 1] = w,
  54316. E[m + 2] = T,
  54317. E[m + 3] = w,
  54318. E[m + 4] = _,
  54319. E[m + 5] = T,
  54320. m += 6
  54321. }
  54322. this.setIndex(new n.BufferAttribute(E,1)),
  54323. this.addAttribute("position", new n.BufferAttribute(p,3)),
  54324. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  54325. this.addAttribute("uv", new n.BufferAttribute(g,2))
  54326. }
  54327. ,
  54328. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54329. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  54330. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  54331. n.BufferGeometry.call(this),
  54332. this.type = "RingBufferGeometry",
  54333. this.parameters = {
  54334. innerRadius: e,
  54335. outerRadius: t,
  54336. thetaSegments: i,
  54337. phiSegments: r,
  54338. thetaStart: o,
  54339. thetaLength: a
  54340. },
  54341. e = e || 20,
  54342. t = t || 50,
  54343. o = void 0 !== o ? o : 0,
  54344. a = void 0 !== a ? a : 2 * Math.PI,
  54345. i = void 0 !== i ? Math.max(3, i) : 8,
  54346. r = void 0 !== r ? Math.max(1, r) : 1;
  54347. var s, l, c, h = (i + 1) * (r + 1), u = i * r * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = e, y = (t - e) / r, C = new n.Vector3, I = new n.Vector2;
  54348. for (l = 0; l <= r; l++) {
  54349. for (c = 0; c <= i; c++)
  54350. s = o + c / i * a,
  54351. C.x = A * Math.cos(s),
  54352. C.y = A * Math.sin(s),
  54353. p.setXYZ(m, C.x, C.y, C.z),
  54354. f.setXYZ(m, 0, 0, 1),
  54355. I.x = (C.x / t + 1) / 2,
  54356. I.y = (C.y / t + 1) / 2,
  54357. g.setXY(m, I.x, I.y),
  54358. m++;
  54359. A += y
  54360. }
  54361. for (l = 0; l < r; l++) {
  54362. var E = l * (i + 1);
  54363. for (c = 0; c < i; c++) {
  54364. s = c + E;
  54365. var b = s
  54366. , w = s + i + 1
  54367. , _ = s + i + 2
  54368. , T = s + 1;
  54369. d.setX(v, b),
  54370. v++,
  54371. d.setX(v, w),
  54372. v++,
  54373. d.setX(v, _),
  54374. v++,
  54375. d.setX(v, b),
  54376. v++,
  54377. d.setX(v, _),
  54378. v++,
  54379. d.setX(v, T),
  54380. v++
  54381. }
  54382. }
  54383. this.setIndex(d),
  54384. this.addAttribute("position", p),
  54385. this.addAttribute("normal", f),
  54386. this.addAttribute("uv", g)
  54387. }
  54388. ,
  54389. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54390. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  54391. n.RingGeometry = function(e, t, i, r, o, a) {
  54392. n.Geometry.call(this),
  54393. this.type = "RingGeometry",
  54394. this.parameters = {
  54395. innerRadius: e,
  54396. outerRadius: t,
  54397. thetaSegments: i,
  54398. phiSegments: r,
  54399. thetaStart: o,
  54400. thetaLength: a
  54401. },
  54402. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  54403. }
  54404. ,
  54405. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  54406. n.RingGeometry.prototype.constructor = n.RingGeometry,
  54407. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  54408. n.Geometry.call(this),
  54409. this.type = "SphereGeometry",
  54410. this.parameters = {
  54411. radius: e,
  54412. widthSegments: t,
  54413. heightSegments: i,
  54414. phiStart: r,
  54415. phiLength: o,
  54416. thetaStart: a,
  54417. thetaLength: s
  54418. },
  54419. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  54420. }
  54421. ,
  54422. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  54423. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  54424. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  54425. n.BufferGeometry.call(this),
  54426. this.type = "SphereBufferGeometry",
  54427. this.parameters = {
  54428. radius: e,
  54429. widthSegments: t,
  54430. heightSegments: i,
  54431. phiStart: r,
  54432. phiLength: o,
  54433. thetaStart: a,
  54434. thetaLength: s
  54435. },
  54436. e = e || 50,
  54437. t = Math.max(3, Math.floor(t) || 8),
  54438. i = Math.max(2, Math.floor(i) || 6),
  54439. r = void 0 !== r ? r : 0,
  54440. o = void 0 !== o ? o : 2 * Math.PI,
  54441. a = void 0 !== a ? a : 0,
  54442. s = void 0 !== s ? s : Math.PI;
  54443. for (var l = a + s, c = (t + 1) * (i + 1), h = new n.BufferAttribute(new Float32Array(3 * c),3), u = new n.BufferAttribute(new Float32Array(3 * c),3), d = new n.BufferAttribute(new Float32Array(2 * c),2), p = 0, f = [], g = new n.Vector3, m = 0; m <= i; m++) {
  54444. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  54445. var C = y / t
  54446. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  54447. , E = e * Math.cos(a + A * s)
  54448. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  54449. g.set(I, E, b).normalize(),
  54450. h.setXYZ(p, I, E, b),
  54451. u.setXYZ(p, g.x, g.y, g.z),
  54452. d.setXY(p, C, 1 - A),
  54453. v.push(p),
  54454. p++
  54455. }
  54456. f.push(v)
  54457. }
  54458. for (var w = [], m = 0; m < i; m++)
  54459. for (var y = 0; y < t; y++) {
  54460. var _ = f[m][y + 1]
  54461. , T = f[m][y]
  54462. , x = f[m + 1][y]
  54463. , S = f[m + 1][y + 1];
  54464. (0 !== m || a > 0) && w.push(_, T, S),
  54465. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  54466. }
  54467. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  54468. this.addAttribute("position", h),
  54469. this.addAttribute("normal", u),
  54470. this.addAttribute("uv", d),
  54471. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  54472. }
  54473. ,
  54474. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54475. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  54476. n.TextGeometry = function(e, t) {
  54477. t = t || {};
  54478. var i = t.font;
  54479. if (i instanceof n.Font == !1)
  54480. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54481. new n.Geometry;
  54482. var r = i.generateShapes(e, t.size, t.curveSegments);
  54483. t.amount = void 0 !== t.height ? t.height : 50,
  54484. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54485. void 0 === t.bevelSize && (t.bevelSize = 8),
  54486. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54487. n.ExtrudeGeometry.call(this, r, t),
  54488. this.type = "TextGeometry"
  54489. }
  54490. ,
  54491. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  54492. n.TextGeometry.prototype.constructor = n.TextGeometry,
  54493. n.TorusBufferGeometry = function(e, t, i, r, o) {
  54494. n.BufferGeometry.call(this),
  54495. this.type = "TorusBufferGeometry",
  54496. this.parameters = {
  54497. radius: e,
  54498. tube: t,
  54499. radialSegments: i,
  54500. tubularSegments: r,
  54501. arc: o
  54502. },
  54503. e = e || 100,
  54504. t = t || 40,
  54505. i = Math.floor(i) || 8,
  54506. r = Math.floor(r) || 6,
  54507. o = o || 2 * Math.PI;
  54508. var a, s, l = (i + 1) * (r + 1), c = i * r * 2 * 3, h = new (c > 65535 ? Uint32Array : Uint16Array)(c), u = new Float32Array(3 * l), d = new Float32Array(3 * l), p = new Float32Array(2 * l), f = 0, g = 0, m = 0, v = new n.Vector3, A = new n.Vector3, y = new n.Vector3;
  54509. for (a = 0; a <= i; a++)
  54510. for (s = 0; s <= r; s++) {
  54511. var C = s / r * o
  54512. , I = a / i * Math.PI * 2;
  54513. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  54514. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  54515. A.z = t * Math.sin(I),
  54516. u[f] = A.x,
  54517. u[f + 1] = A.y,
  54518. u[f + 2] = A.z,
  54519. v.x = e * Math.cos(C),
  54520. v.y = e * Math.sin(C),
  54521. y.subVectors(A, v).normalize(),
  54522. d[f] = y.x,
  54523. d[f + 1] = y.y,
  54524. d[f + 2] = y.z,
  54525. p[g] = s / r,
  54526. p[g + 1] = a / i,
  54527. f += 3,
  54528. g += 2
  54529. }
  54530. for (a = 1; a <= i; a++)
  54531. for (s = 1; s <= r; s++) {
  54532. var E = (r + 1) * a + s - 1
  54533. , b = (r + 1) * (a - 1) + s - 1
  54534. , w = (r + 1) * (a - 1) + s
  54535. , _ = (r + 1) * a + s;
  54536. h[m] = E,
  54537. h[m + 1] = b,
  54538. h[m + 2] = _,
  54539. h[m + 3] = b,
  54540. h[m + 4] = w,
  54541. h[m + 5] = _,
  54542. m += 6
  54543. }
  54544. this.setIndex(new n.BufferAttribute(h,1)),
  54545. this.addAttribute("position", new n.BufferAttribute(u,3)),
  54546. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  54547. this.addAttribute("uv", new n.BufferAttribute(p,2))
  54548. }
  54549. ,
  54550. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54551. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  54552. n.TorusGeometry = function(e, t, i, r, o) {
  54553. n.Geometry.call(this),
  54554. this.type = "TorusGeometry",
  54555. this.parameters = {
  54556. radius: e,
  54557. tube: t,
  54558. radialSegments: i,
  54559. tubularSegments: r,
  54560. arc: o
  54561. },
  54562. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  54563. }
  54564. ,
  54565. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  54566. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  54567. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  54568. function s(e, t, i, n, r) {
  54569. var o = Math.cos(e)
  54570. , a = Math.sin(e)
  54571. , s = i / t * e
  54572. , l = Math.cos(s);
  54573. r.x = n * (2 + l) * .5 * o,
  54574. r.y = n * (2 + l) * a * .5,
  54575. r.z = n * Math.sin(s) * .5
  54576. }
  54577. n.BufferGeometry.call(this),
  54578. this.type = "TorusKnotBufferGeometry",
  54579. this.parameters = {
  54580. radius: e,
  54581. tube: t,
  54582. tubularSegments: i,
  54583. radialSegments: r,
  54584. p: o,
  54585. q: a
  54586. },
  54587. e = e || 100,
  54588. t = t || 40,
  54589. i = Math.floor(i) || 64,
  54590. r = Math.floor(r) || 8,
  54591. o = o || 2,
  54592. a = a || 3;
  54593. var l, c, h = (r + 1) * (i + 1), u = r * i * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = new n.Vector3, y = new n.Vector3, C = new n.Vector2, I = new n.Vector3, E = new n.Vector3, b = new n.Vector3, w = new n.Vector3, _ = new n.Vector3;
  54594. for (l = 0; l <= i; ++l) {
  54595. var T = l / i * o * Math.PI * 2;
  54596. for (s(T, o, a, e, I),
  54597. s(T + .01, o, a, e, E),
  54598. w.subVectors(E, I),
  54599. _.addVectors(E, I),
  54600. b.crossVectors(w, _),
  54601. _.crossVectors(b, w),
  54602. b.normalize(),
  54603. _.normalize(),
  54604. c = 0; c <= r; ++c) {
  54605. var x = c / r * Math.PI * 2
  54606. , S = -t * Math.cos(x)
  54607. , M = t * Math.sin(x);
  54608. A.x = I.x + (S * _.x + M * b.x),
  54609. A.y = I.y + (S * _.y + M * b.y),
  54610. A.z = I.z + (S * _.z + M * b.z),
  54611. p.setXYZ(m, A.x, A.y, A.z),
  54612. y.subVectors(A, I).normalize(),
  54613. f.setXYZ(m, y.x, y.y, y.z),
  54614. C.x = l / i,
  54615. C.y = c / r,
  54616. g.setXY(m, C.x, C.y),
  54617. m++
  54618. }
  54619. }
  54620. for (c = 1; c <= i; c++)
  54621. for (l = 1; l <= r; l++) {
  54622. var R = (r + 1) * (c - 1) + (l - 1)
  54623. , P = (r + 1) * c + (l - 1)
  54624. , O = (r + 1) * c + l
  54625. , L = (r + 1) * (c - 1) + l;
  54626. d.setX(v, R),
  54627. v++,
  54628. d.setX(v, P),
  54629. v++,
  54630. d.setX(v, L),
  54631. v++,
  54632. d.setX(v, P),
  54633. v++,
  54634. d.setX(v, O),
  54635. v++,
  54636. d.setX(v, L),
  54637. v++
  54638. }
  54639. this.setIndex(d),
  54640. this.addAttribute("position", p),
  54641. this.addAttribute("normal", f),
  54642. this.addAttribute("uv", g)
  54643. }
  54644. ,
  54645. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54646. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  54647. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  54648. n.Geometry.call(this),
  54649. this.type = "TorusKnotGeometry",
  54650. this.parameters = {
  54651. radius: e,
  54652. tube: t,
  54653. tubularSegments: i,
  54654. radialSegments: r,
  54655. p: o,
  54656. q: a
  54657. },
  54658. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54659. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  54660. this.mergeVertices()
  54661. }
  54662. ,
  54663. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  54664. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  54665. n.TubeGeometry = function(e, t, i, r, o, a) {
  54666. function s(e, t, i) {
  54667. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  54668. }
  54669. n.Geometry.call(this),
  54670. this.type = "TubeGeometry",
  54671. this.parameters = {
  54672. path: e,
  54673. segments: t,
  54674. radius: i,
  54675. radialSegments: r,
  54676. closed: o,
  54677. taper: a
  54678. },
  54679. t = t || 64,
  54680. i = i || 1,
  54681. r = r || 8,
  54682. o = o || !1,
  54683. a = a || n.TubeGeometry.NoTaper;
  54684. var l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M = [], R = this, P = t + 1, O = new n.Vector3, L = new n.TubeGeometry.FrenetFrames(e,t,o), D = L.tangents, N = L.normals, B = L.binormals;
  54685. for (this.tangents = D,
  54686. this.normals = N,
  54687. this.binormals = B,
  54688. v = 0; v < P; v++)
  54689. for (M[v] = [],
  54690. u = v / (P - 1),
  54691. m = e.getPointAt(u),
  54692. l = D[v],
  54693. c = N[v],
  54694. h = B[v],
  54695. p = i * a(u),
  54696. A = 0; A < r; A++)
  54697. d = A / r * 2 * Math.PI,
  54698. f = -p * Math.cos(d),
  54699. g = p * Math.sin(d),
  54700. O.copy(m),
  54701. O.x += f * c.x + g * h.x,
  54702. O.y += f * c.y + g * h.y,
  54703. O.z += f * c.z + g * h.z,
  54704. M[v][A] = s(O.x, O.y, O.z);
  54705. for (v = 0; v < t; v++)
  54706. for (A = 0; A < r; A++)
  54707. y = o ? (v + 1) % t : v + 1,
  54708. C = (A + 1) % r,
  54709. I = M[v][A],
  54710. E = M[y][A],
  54711. b = M[y][C],
  54712. w = M[v][C],
  54713. _ = new n.Vector2(v / t,A / r),
  54714. T = new n.Vector2((v + 1) / t,A / r),
  54715. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  54716. S = new n.Vector2(v / t,(A + 1) / r),
  54717. this.faces.push(new n.Face3(I,E,w)),
  54718. this.faceVertexUvs[0].push([_, T, S]),
  54719. this.faces.push(new n.Face3(E,b,w)),
  54720. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  54721. this.computeFaceNormals(),
  54722. this.computeVertexNormals()
  54723. }
  54724. ,
  54725. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  54726. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  54727. n.TubeGeometry.NoTaper = function(e) {
  54728. return 1
  54729. }
  54730. ,
  54731. n.TubeGeometry.SinusoidalTaper = function(e) {
  54732. return Math.sin(Math.PI * e)
  54733. }
  54734. ,
  54735. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  54736. function r() {
  54737. f[0] = new n.Vector3,
  54738. g[0] = new n.Vector3,
  54739. a = Number.MAX_VALUE,
  54740. s = Math.abs(p[0].x),
  54741. l = Math.abs(p[0].y),
  54742. c = Math.abs(p[0].z),
  54743. s <= a && (a = s,
  54744. d.set(1, 0, 0)),
  54745. l <= a && (a = l,
  54746. d.set(0, 1, 0)),
  54747. c <= a && d.set(0, 0, 1),
  54748. m.crossVectors(p[0], d).normalize(),
  54749. f[0].crossVectors(p[0], m),
  54750. g[0].crossVectors(p[0], f[0])
  54751. }
  54752. var o, a, s, l, c, h, u, d = new n.Vector3, p = [], f = [], g = [], m = new n.Vector3, v = new n.Matrix4, A = t + 1;
  54753. for (this.tangents = p,
  54754. this.normals = f,
  54755. this.binormals = g,
  54756. h = 0; h < A; h++)
  54757. u = h / (A - 1),
  54758. p[h] = e.getTangentAt(u),
  54759. p[h].normalize();
  54760. for (r(),
  54761. h = 1; h < A; h++)
  54762. f[h] = f[h - 1].clone(),
  54763. g[h] = g[h - 1].clone(),
  54764. m.crossVectors(p[h - 1], p[h]),
  54765. m.length() > Number.EPSILON && (m.normalize(),
  54766. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  54767. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  54768. g[h].crossVectors(p[h], f[h]);
  54769. if (i)
  54770. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  54771. o /= A - 1,
  54772. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  54773. h = 1; h < A; h++)
  54774. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  54775. g[h].crossVectors(p[h], f[h])
  54776. }
  54777. ,
  54778. n.PolyhedronGeometry = function(e, t, i, r) {
  54779. function o(e) {
  54780. var t = e.normalize().clone();
  54781. t.index = u.vertices.push(t) - 1;
  54782. var i = l(e) / 2 / Math.PI + .5
  54783. , r = c(e) / Math.PI + .5;
  54784. return t.uv = new n.Vector2(i,1 - r),
  54785. t
  54786. }
  54787. function a(e, t, i, r) {
  54788. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  54789. u.faces.push(o),
  54790. C.copy(e).add(t).add(i).divideScalar(3);
  54791. var a = l(C);
  54792. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  54793. }
  54794. function s(e, t) {
  54795. for (var i = Math.pow(2, t), n = o(u.vertices[e.a]), r = o(u.vertices[e.b]), s = o(u.vertices[e.c]), l = [], c = e.materialIndex, h = 0; h <= i; h++) {
  54796. l[h] = [];
  54797. for (var d = o(n.clone().lerp(s, h / i)), p = o(r.clone().lerp(s, h / i)), f = i - h, g = 0; g <= f; g++)
  54798. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  54799. }
  54800. for (var h = 0; h < i; h++)
  54801. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  54802. var m = Math.floor(g / 2);
  54803. g % 2 === 0 ? a(l[h][m + 1], l[h + 1][m], l[h][m], c) : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c)
  54804. }
  54805. }
  54806. function l(e) {
  54807. return Math.atan2(e.z, -e.x)
  54808. }
  54809. function c(e) {
  54810. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54811. }
  54812. function h(e, t, i) {
  54813. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  54814. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  54815. e.clone()
  54816. }
  54817. n.Geometry.call(this),
  54818. this.type = "PolyhedronGeometry",
  54819. this.parameters = {
  54820. vertices: e,
  54821. indices: t,
  54822. radius: i,
  54823. detail: r
  54824. },
  54825. i = i || 1,
  54826. r = r || 0;
  54827. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  54828. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  54829. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  54830. m++) {
  54831. var v = f[t[d]]
  54832. , A = f[t[d + 1]]
  54833. , y = f[t[d + 2]];
  54834. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  54835. }
  54836. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  54837. s(g[d], r);
  54838. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  54839. var I = this.faceVertexUvs[0][d]
  54840. , E = I[0].x
  54841. , b = I[1].x
  54842. , w = I[2].x
  54843. , _ = Math.max(E, b, w)
  54844. , T = Math.min(E, b, w);
  54845. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  54846. b < .2 && (I[1].x += 1),
  54847. w < .2 && (I[2].x += 1))
  54848. }
  54849. for (var d = 0, p = this.vertices.length; d < p; d++)
  54850. this.vertices[d].multiplyScalar(i);
  54851. this.mergeVertices(),
  54852. this.computeFaceNormals(),
  54853. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  54854. }
  54855. ,
  54856. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  54857. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  54858. n.DodecahedronGeometry = function(e, t) {
  54859. var i = (1 + Math.sqrt(5)) / 2
  54860. , r = 1 / i
  54861. , o = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, 0, -i, 0, -r, i, 0, -r, -i, 0, r, i, 0, r]
  54862. , a = [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9];
  54863. n.PolyhedronGeometry.call(this, o, a, e, t),
  54864. this.type = "DodecahedronGeometry",
  54865. this.parameters = {
  54866. radius: e,
  54867. detail: t
  54868. }
  54869. }
  54870. ,
  54871. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54872. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  54873. n.IcosahedronGeometry = function(e, t) {
  54874. var i = (1 + Math.sqrt(5)) / 2
  54875. , r = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1]
  54876. , o = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1];
  54877. n.PolyhedronGeometry.call(this, r, o, e, t),
  54878. this.type = "IcosahedronGeometry",
  54879. this.parameters = {
  54880. radius: e,
  54881. detail: t
  54882. }
  54883. }
  54884. ,
  54885. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54886. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  54887. n.OctahedronGeometry = function(e, t) {
  54888. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  54889. , r = [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2];
  54890. n.PolyhedronGeometry.call(this, i, r, e, t),
  54891. this.type = "OctahedronGeometry",
  54892. this.parameters = {
  54893. radius: e,
  54894. detail: t
  54895. }
  54896. }
  54897. ,
  54898. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54899. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  54900. n.TetrahedronGeometry = function(e, t) {
  54901. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  54902. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  54903. n.PolyhedronGeometry.call(this, i, r, e, t),
  54904. this.type = "TetrahedronGeometry",
  54905. this.parameters = {
  54906. radius: e,
  54907. detail: t
  54908. }
  54909. }
  54910. ,
  54911. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54912. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  54913. n.ParametricGeometry = function(e, t, i) {
  54914. n.Geometry.call(this),
  54915. this.type = "ParametricGeometry",
  54916. this.parameters = {
  54917. func: e,
  54918. slices: t,
  54919. stacks: i
  54920. };
  54921. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  54922. for (r = 0; r <= i; r++)
  54923. for (l = r / i,
  54924. o = 0; o <= t; o++)
  54925. s = o / t,
  54926. a = e(s, l),
  54927. c.push(a);
  54928. var p, f, g, m, v, A, y, C;
  54929. for (r = 0; r < i; r++)
  54930. for (o = 0; o < t; o++)
  54931. p = r * d + o,
  54932. f = r * d + o + 1,
  54933. g = (r + 1) * d + o + 1,
  54934. m = (r + 1) * d + o,
  54935. v = new n.Vector2(o / t,r / i),
  54936. A = new n.Vector2((o + 1) / t,r / i),
  54937. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  54938. C = new n.Vector2(o / t,(r + 1) / i),
  54939. h.push(new n.Face3(p,f,m)),
  54940. u.push([v, A, C]),
  54941. h.push(new n.Face3(f,g,m)),
  54942. u.push([A.clone(), y, C.clone()]);
  54943. this.computeFaceNormals(),
  54944. this.computeVertexNormals()
  54945. }
  54946. ,
  54947. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  54948. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  54949. n.WireframeGeometry = function(e) {
  54950. function t(e, t) {
  54951. return e - t
  54952. }
  54953. n.BufferGeometry.call(this);
  54954. var i = [0, 0]
  54955. , r = {}
  54956. , o = ["a", "b", "c"];
  54957. if (e instanceof n.Geometry) {
  54958. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  54959. for (var d = s[h], p = 0; p < 3; p++) {
  54960. i[0] = d[o[p]],
  54961. i[1] = d[o[(p + 1) % 3]],
  54962. i.sort(t);
  54963. var f = i.toString();
  54964. void 0 === r[f] && (c[2 * l] = i[0],
  54965. c[2 * l + 1] = i[1],
  54966. r[f] = !0,
  54967. l++)
  54968. }
  54969. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  54970. for (var p = 0; p < 2; p++) {
  54971. var m = a[c[2 * h + p]]
  54972. , v = 6 * h + 3 * p;
  54973. g[v + 0] = m.x,
  54974. g[v + 1] = m.y,
  54975. g[v + 2] = m.z
  54976. }
  54977. this.addAttribute("position", new n.BufferAttribute(g,3))
  54978. } else if (e instanceof n.BufferGeometry)
  54979. if (null !== e.index) {
  54980. var A = e.index.array
  54981. , a = e.attributes.position
  54982. , y = e.groups
  54983. , l = 0;
  54984. 0 === y.length && e.addGroup(0, A.length);
  54985. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  54986. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  54987. for (var p = 0; p < 3; p++) {
  54988. i[0] = A[h + p],
  54989. i[1] = A[h + (p + 1) % 3],
  54990. i.sort(t);
  54991. var f = i.toString();
  54992. void 0 === r[f] && (c[2 * l] = i[0],
  54993. c[2 * l + 1] = i[1],
  54994. r[f] = !0,
  54995. l++)
  54996. }
  54997. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  54998. for (var p = 0; p < 2; p++) {
  54999. var v = 6 * h + 3 * p
  55000. , T = c[2 * h + p];
  55001. g[v + 0] = a.getX(T),
  55002. g[v + 1] = a.getY(T),
  55003. g[v + 2] = a.getZ(T)
  55004. }
  55005. this.addAttribute("position", new n.BufferAttribute(g,3))
  55006. } else {
  55007. for (var a = e.attributes.position.array, l = a.length / 3, x = l / 3, g = new Float32Array(2 * l * 3), h = 0, u = x; h < u; h++)
  55008. for (var p = 0; p < 3; p++) {
  55009. var v = 18 * h + 6 * p
  55010. , S = 9 * h + 3 * p;
  55011. g[v + 0] = a[S],
  55012. g[v + 1] = a[S + 1],
  55013. g[v + 2] = a[S + 2];
  55014. var T = 9 * h + 3 * ((p + 1) % 3);
  55015. g[v + 3] = a[T],
  55016. g[v + 4] = a[T + 1],
  55017. g[v + 5] = a[T + 2]
  55018. }
  55019. this.addAttribute("position", new n.BufferAttribute(g,3))
  55020. }
  55021. }
  55022. ,
  55023. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55024. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  55025. n.AxisHelper = function(e) {
  55026. e = e || 1;
  55027. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  55028. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  55029. , r = new n.BufferGeometry;
  55030. r.addAttribute("position", new n.BufferAttribute(t,3)),
  55031. r.addAttribute("color", new n.BufferAttribute(i,3));
  55032. var o = new n.LineBasicMaterial({
  55033. vertexColors: n.VertexColors
  55034. });
  55035. n.LineSegments.call(this, r, o)
  55036. }
  55037. ,
  55038. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  55039. n.AxisHelper.prototype.constructor = n.AxisHelper,
  55040. n.ArrowHelper = function() {
  55041. var e = new n.Geometry;
  55042. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  55043. var t = new n.CylinderGeometry(0,.5,1,5,1);
  55044. return t.translate(0, -.5, 0),
  55045. function(i, r, o, a, s, l) {
  55046. n.Object3D.call(this),
  55047. void 0 === a && (a = 16776960),
  55048. void 0 === o && (o = 1),
  55049. void 0 === s && (s = .2 * o),
  55050. void 0 === l && (l = .2 * s),
  55051. this.position.copy(r),
  55052. this.line = new n.Line(e,new n.LineBasicMaterial({
  55053. color: a
  55054. })),
  55055. this.line.matrixAutoUpdate = !1,
  55056. this.add(this.line),
  55057. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  55058. color: a
  55059. })),
  55060. this.cone.matrixAutoUpdate = !1,
  55061. this.add(this.cone),
  55062. this.setDirection(i),
  55063. this.setLength(o, s, l)
  55064. }
  55065. }(),
  55066. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  55067. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  55068. n.ArrowHelper.prototype.setDirection = function() {
  55069. var e, t = new n.Vector3;
  55070. return function(i) {
  55071. i.y > .99999 ? this.quaternion.set(0, 0, 0, 1) : i.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (t.set(i.z, 0, -i.x).normalize(),
  55072. e = Math.acos(i.y),
  55073. this.quaternion.setFromAxisAngle(t, e))
  55074. }
  55075. }(),
  55076. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  55077. void 0 === t && (t = .2 * e),
  55078. void 0 === i && (i = .2 * t),
  55079. this.line.scale.set(1, Math.max(0, e - t), 1),
  55080. this.line.updateMatrix(),
  55081. this.cone.scale.set(i, t, i),
  55082. this.cone.position.y = e,
  55083. this.cone.updateMatrix()
  55084. }
  55085. ,
  55086. n.ArrowHelper.prototype.setColor = function(e) {
  55087. this.line.material.color.set(e),
  55088. this.cone.material.color.set(e)
  55089. }
  55090. ,
  55091. n.BoxHelper = function(e) {
  55092. 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])
  55093. , i = new Float32Array(24)
  55094. , r = new n.BufferGeometry;
  55095. r.setIndex(new n.BufferAttribute(t,1)),
  55096. r.addAttribute("position", new n.BufferAttribute(i,3)),
  55097. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  55098. color: 16776960
  55099. })),
  55100. void 0 !== e && this.update(e)
  55101. }
  55102. ,
  55103. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  55104. n.BoxHelper.prototype.constructor = n.BoxHelper,
  55105. n.BoxHelper.prototype.update = function() {
  55106. var e = new n.Box3;
  55107. return function(t) {
  55108. if (e.setFromObject(t),
  55109. !e.isEmpty()) {
  55110. var i = e.min
  55111. , n = e.max
  55112. , r = this.geometry.attributes.position
  55113. , o = r.array;
  55114. o[0] = n.x,
  55115. o[1] = n.y,
  55116. o[2] = n.z,
  55117. o[3] = i.x,
  55118. o[4] = n.y,
  55119. o[5] = n.z,
  55120. o[6] = i.x,
  55121. o[7] = i.y,
  55122. o[8] = n.z,
  55123. o[9] = n.x,
  55124. o[10] = i.y,
  55125. o[11] = n.z,
  55126. o[12] = n.x,
  55127. o[13] = n.y,
  55128. o[14] = i.z,
  55129. o[15] = i.x,
  55130. o[16] = n.y,
  55131. o[17] = i.z,
  55132. o[18] = i.x,
  55133. o[19] = i.y,
  55134. o[20] = i.z,
  55135. o[21] = n.x,
  55136. o[22] = i.y,
  55137. o[23] = i.z,
  55138. r.needsUpdate = !0,
  55139. this.geometry.computeBoundingSphere()
  55140. }
  55141. }
  55142. }(),
  55143. n.BoundingBoxHelper = function(e, t) {
  55144. var i = void 0 !== t ? t : 8947848;
  55145. this.object = e,
  55146. this.box = new n.Box3,
  55147. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  55148. color: i,
  55149. wireframe: !0
  55150. }))
  55151. }
  55152. ,
  55153. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  55154. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  55155. n.BoundingBoxHelper.prototype.update = function() {
  55156. this.box.setFromObject(this.object),
  55157. this.box.size(this.scale),
  55158. this.box.center(this.position)
  55159. }
  55160. ,
  55161. n.CameraHelper = function(e) {
  55162. function t(e, t, n) {
  55163. i(e, n),
  55164. i(t, n)
  55165. }
  55166. function i(e, t) {
  55167. r.vertices.push(new n.Vector3),
  55168. r.colors.push(new n.Color(t)),
  55169. void 0 === a[e] && (a[e] = []),
  55170. a[e].push(r.vertices.length - 1)
  55171. }
  55172. var r = new n.Geometry
  55173. , o = new n.LineBasicMaterial({
  55174. color: 16777215,
  55175. vertexColors: n.FaceColors
  55176. })
  55177. , a = {}
  55178. , s = 16755200
  55179. , l = 16711680
  55180. , c = 43775
  55181. , h = 16777215
  55182. , u = 3355443;
  55183. t("n1", "n2", s),
  55184. t("n2", "n4", s),
  55185. t("n4", "n3", s),
  55186. t("n3", "n1", s),
  55187. t("f1", "f2", s),
  55188. t("f2", "f4", s),
  55189. t("f4", "f3", s),
  55190. t("f3", "f1", s),
  55191. t("n1", "f1", s),
  55192. t("n2", "f2", s),
  55193. t("n3", "f3", s),
  55194. t("n4", "f4", s),
  55195. t("p", "n1", l),
  55196. t("p", "n2", l),
  55197. t("p", "n3", l),
  55198. t("p", "n4", l),
  55199. t("u1", "u2", c),
  55200. t("u2", "u3", c),
  55201. t("u3", "u1", c),
  55202. t("c", "t", h),
  55203. t("p", "c", u),
  55204. t("cn1", "cn2", u),
  55205. t("cn3", "cn4", u),
  55206. t("cf1", "cf2", u),
  55207. t("cf3", "cf4", u),
  55208. n.LineSegments.call(this, r, o),
  55209. this.camera = e,
  55210. this.camera.updateProjectionMatrix(),
  55211. this.matrix = e.matrixWorld,
  55212. this.matrixAutoUpdate = !1,
  55213. this.pointMap = a,
  55214. this.update()
  55215. }
  55216. ,
  55217. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  55218. n.CameraHelper.prototype.constructor = n.CameraHelper,
  55219. n.CameraHelper.prototype.update = function() {
  55220. function e(e, n, a, s) {
  55221. r.set(n, a, s).unproject(o);
  55222. var l = i[e];
  55223. if (void 0 !== l)
  55224. for (var c = 0, h = l.length; c < h; c++)
  55225. t.vertices[l[c]].copy(r)
  55226. }
  55227. var t, i, r = new n.Vector3, o = new n.Camera;
  55228. return function() {
  55229. t = this.geometry,
  55230. i = this.pointMap;
  55231. var n = 1
  55232. , r = 1;
  55233. o.projectionMatrix.copy(this.camera.projectionMatrix),
  55234. e("c", 0, 0, -1),
  55235. e("t", 0, 0, 1),
  55236. e("n1", -n, -r, -1),
  55237. e("n2", n, -r, -1),
  55238. e("n3", -n, r, -1),
  55239. e("n4", n, r, -1),
  55240. e("f1", -n, -r, 1),
  55241. e("f2", n, -r, 1),
  55242. e("f3", -n, r, 1),
  55243. e("f4", n, r, 1),
  55244. e("u1", .7 * n, 1.1 * r, -1),
  55245. e("u2", .7 * -n, 1.1 * r, -1),
  55246. e("u3", 0, 2 * r, -1),
  55247. e("cf1", -n, 0, 1),
  55248. e("cf2", n, 0, 1),
  55249. e("cf3", 0, -r, 1),
  55250. e("cf4", 0, r, 1),
  55251. e("cn1", -n, 0, -1),
  55252. e("cn2", n, 0, -1),
  55253. e("cn3", 0, -r, -1),
  55254. e("cn4", 0, r, -1),
  55255. t.verticesNeedUpdate = !0
  55256. }
  55257. }(),
  55258. n.DirectionalLightHelper = function(e, t) {
  55259. n.Object3D.call(this),
  55260. this.light = e,
  55261. this.light.updateMatrixWorld(),
  55262. this.matrix = e.matrixWorld,
  55263. this.matrixAutoUpdate = !1,
  55264. t = t || 1;
  55265. var i = new n.Geometry;
  55266. i.vertices.push(new n.Vector3(-t,t,0), new n.Vector3(t,t,0), new n.Vector3(t,-t,0), new n.Vector3(-t,-t,0), new n.Vector3(-t,t,0));
  55267. var r = new n.LineBasicMaterial({
  55268. fog: !1
  55269. });
  55270. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55271. this.lightPlane = new n.Line(i,r),
  55272. this.add(this.lightPlane),
  55273. i = new n.Geometry,
  55274. i.vertices.push(new n.Vector3, new n.Vector3),
  55275. r = new n.LineBasicMaterial({
  55276. fog: !1
  55277. }),
  55278. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55279. this.targetLine = new n.Line(i,r),
  55280. this.add(this.targetLine),
  55281. this.update()
  55282. }
  55283. ,
  55284. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  55285. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  55286. n.DirectionalLightHelper.prototype.dispose = function() {
  55287. this.lightPlane.geometry.dispose(),
  55288. this.lightPlane.material.dispose(),
  55289. this.targetLine.geometry.dispose(),
  55290. this.targetLine.material.dispose()
  55291. }
  55292. ,
  55293. n.DirectionalLightHelper.prototype.update = function() {
  55294. var e = new n.Vector3
  55295. , t = new n.Vector3
  55296. , i = new n.Vector3;
  55297. return function() {
  55298. e.setFromMatrixPosition(this.light.matrixWorld),
  55299. t.setFromMatrixPosition(this.light.target.matrixWorld),
  55300. i.subVectors(t, e),
  55301. this.lightPlane.lookAt(i),
  55302. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55303. this.targetLine.geometry.vertices[1].copy(i),
  55304. this.targetLine.geometry.verticesNeedUpdate = !0,
  55305. this.targetLine.material.color.copy(this.lightPlane.material.color)
  55306. }
  55307. }(),
  55308. n.EdgesHelper = function(e, t, i) {
  55309. var r = void 0 !== t ? t : 16777215;
  55310. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  55311. color: r
  55312. })),
  55313. this.matrix = e.matrixWorld,
  55314. this.matrixAutoUpdate = !1
  55315. }
  55316. ,
  55317. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  55318. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  55319. n.FaceNormalsHelper = function(e, t, i, r) {
  55320. this.object = e,
  55321. this.size = void 0 !== t ? t : 1;
  55322. var o = void 0 !== i ? i : 16776960
  55323. , a = void 0 !== r ? r : 1
  55324. , s = 0
  55325. , l = this.object.geometry;
  55326. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  55327. var c = new n.BufferGeometry
  55328. , h = new n.Float32Attribute(2 * s * 3,3);
  55329. c.addAttribute("position", h),
  55330. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  55331. color: o,
  55332. linewidth: a
  55333. })),
  55334. this.matrixAutoUpdate = !1,
  55335. this.update()
  55336. }
  55337. ,
  55338. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  55339. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  55340. n.FaceNormalsHelper.prototype.update = function() {
  55341. var e = new n.Vector3
  55342. , t = new n.Vector3
  55343. , i = new n.Matrix3;
  55344. return function() {
  55345. this.object.updateMatrixWorld(!0),
  55346. i.getNormalMatrix(this.object.matrixWorld);
  55347. for (var n = this.object.matrixWorld, r = this.geometry.attributes.position, o = this.object.geometry, a = o.vertices, s = o.faces, l = 0, c = 0, h = s.length; c < h; c++) {
  55348. var u = s[c]
  55349. , d = u.normal;
  55350. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  55351. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55352. r.setXYZ(l, e.x, e.y, e.z),
  55353. l += 1,
  55354. r.setXYZ(l, t.x, t.y, t.z),
  55355. l += 1
  55356. }
  55357. return r.needsUpdate = !0,
  55358. this
  55359. }
  55360. }(),
  55361. n.GridHelper = function(e, t) {
  55362. var i = new n.Geometry
  55363. , r = new n.LineBasicMaterial({
  55364. vertexColors: n.VertexColors
  55365. });
  55366. this.color1 = new n.Color(4473924),
  55367. this.color2 = new n.Color(8947848);
  55368. for (var o = -e; o <= e; o += t) {
  55369. i.vertices.push(new n.Vector3(-e,0,o), new n.Vector3(e,0,o), new n.Vector3(o,0,-e), new n.Vector3(o,0,e));
  55370. var a = 0 === o ? this.color1 : this.color2;
  55371. i.colors.push(a, a, a, a)
  55372. }
  55373. n.LineSegments.call(this, i, r)
  55374. }
  55375. ,
  55376. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  55377. n.GridHelper.prototype.constructor = n.GridHelper,
  55378. n.GridHelper.prototype.setColors = function(e, t) {
  55379. this.color1.set(e),
  55380. this.color2.set(t),
  55381. this.geometry.colorsNeedUpdate = !0
  55382. }
  55383. ,
  55384. n.HemisphereLightHelper = function(e, t) {
  55385. n.Object3D.call(this),
  55386. this.light = e,
  55387. this.light.updateMatrixWorld(),
  55388. this.matrix = e.matrixWorld,
  55389. this.matrixAutoUpdate = !1,
  55390. this.colors = [new n.Color, new n.Color];
  55391. var i = new n.SphereGeometry(t,4,2);
  55392. i.rotateX(-Math.PI / 2);
  55393. for (var r = 0, o = 8; r < o; r++)
  55394. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  55395. var a = new n.MeshBasicMaterial({
  55396. vertexColors: n.FaceColors,
  55397. wireframe: !0
  55398. });
  55399. this.lightSphere = new n.Mesh(i,a),
  55400. this.add(this.lightSphere),
  55401. this.update()
  55402. }
  55403. ,
  55404. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  55405. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  55406. n.HemisphereLightHelper.prototype.dispose = function() {
  55407. this.lightSphere.geometry.dispose(),
  55408. this.lightSphere.material.dispose()
  55409. }
  55410. ,
  55411. n.HemisphereLightHelper.prototype.update = function() {
  55412. var e = new n.Vector3;
  55413. return function() {
  55414. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  55415. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  55416. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  55417. this.lightSphere.geometry.colorsNeedUpdate = !0
  55418. }
  55419. }(),
  55420. n.PointLightHelper = function(e, t) {
  55421. this.light = e,
  55422. this.light.updateMatrixWorld();
  55423. var i = new n.SphereGeometry(t,4,2)
  55424. , r = new n.MeshBasicMaterial({
  55425. wireframe: !0,
  55426. fog: !1
  55427. });
  55428. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55429. n.Mesh.call(this, i, r),
  55430. this.matrix = this.light.matrixWorld,
  55431. this.matrixAutoUpdate = !1
  55432. }
  55433. ,
  55434. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  55435. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  55436. n.PointLightHelper.prototype.dispose = function() {
  55437. this.geometry.dispose(),
  55438. this.material.dispose()
  55439. }
  55440. ,
  55441. n.PointLightHelper.prototype.update = function() {
  55442. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55443. }
  55444. ,
  55445. n.SkeletonHelper = function(e) {
  55446. this.bones = this.getBoneList(e);
  55447. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  55448. var r = this.bones[i];
  55449. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  55450. t.vertices.push(new n.Vector3),
  55451. t.colors.push(new n.Color(0,0,1)),
  55452. t.colors.push(new n.Color(0,1,0)))
  55453. }
  55454. t.dynamic = !0;
  55455. var o = new n.LineBasicMaterial({
  55456. vertexColors: n.VertexColors,
  55457. depthTest: !1,
  55458. depthWrite: !1,
  55459. transparent: !0
  55460. });
  55461. n.LineSegments.call(this, t, o),
  55462. this.root = e,
  55463. this.matrix = e.matrixWorld,
  55464. this.matrixAutoUpdate = !1,
  55465. this.update()
  55466. }
  55467. ,
  55468. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  55469. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  55470. n.SkeletonHelper.prototype.getBoneList = function(e) {
  55471. var t = [];
  55472. e instanceof n.Bone && t.push(e);
  55473. for (var i = 0; i < e.children.length; i++)
  55474. t.push.apply(t, this.getBoneList(e.children[i]));
  55475. return t
  55476. }
  55477. ,
  55478. n.SkeletonHelper.prototype.update = function() {
  55479. for (var e = this.geometry, t = (new n.Matrix4).getInverse(this.root.matrixWorld), i = new n.Matrix4, r = 0, o = 0; o < this.bones.length; o++) {
  55480. var a = this.bones[o];
  55481. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  55482. e.vertices[r].setFromMatrixPosition(i),
  55483. i.multiplyMatrices(t, a.parent.matrixWorld),
  55484. e.vertices[r + 1].setFromMatrixPosition(i),
  55485. r += 2)
  55486. }
  55487. e.verticesNeedUpdate = !0,
  55488. e.computeBoundingSphere()
  55489. }
  55490. ,
  55491. n.SpotLightHelper = function(e) {
  55492. n.Object3D.call(this),
  55493. this.light = e,
  55494. this.light.updateMatrixWorld(),
  55495. this.matrix = e.matrixWorld,
  55496. this.matrixAutoUpdate = !1;
  55497. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  55498. t.translate(0, -.5, 0),
  55499. t.rotateX(-Math.PI / 2);
  55500. var i = new n.MeshBasicMaterial({
  55501. wireframe: !0,
  55502. fog: !1
  55503. });
  55504. this.cone = new n.Mesh(t,i),
  55505. this.add(this.cone),
  55506. this.update()
  55507. }
  55508. ,
  55509. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  55510. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  55511. n.SpotLightHelper.prototype.dispose = function() {
  55512. this.cone.geometry.dispose(),
  55513. this.cone.material.dispose()
  55514. }
  55515. ,
  55516. n.SpotLightHelper.prototype.update = function() {
  55517. var e = new n.Vector3
  55518. , t = new n.Vector3;
  55519. return function() {
  55520. var i = this.light.distance ? this.light.distance : 1e4
  55521. , n = i * Math.tan(this.light.angle);
  55522. this.cone.scale.set(n, n, i),
  55523. e.setFromMatrixPosition(this.light.matrixWorld),
  55524. t.setFromMatrixPosition(this.light.target.matrixWorld),
  55525. this.cone.lookAt(t.sub(e)),
  55526. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55527. }
  55528. }(),
  55529. n.VertexNormalsHelper = function(e, t, i, r) {
  55530. this.object = e,
  55531. this.size = void 0 !== t ? t : 1;
  55532. var o = void 0 !== i ? i : 16711680
  55533. , a = void 0 !== r ? r : 1
  55534. , s = 0
  55535. , l = this.object.geometry;
  55536. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  55537. var c = new n.BufferGeometry
  55538. , h = new n.Float32Attribute(2 * s * 3,3);
  55539. c.addAttribute("position", h),
  55540. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  55541. color: o,
  55542. linewidth: a
  55543. })),
  55544. this.matrixAutoUpdate = !1,
  55545. this.update()
  55546. }
  55547. ,
  55548. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  55549. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  55550. n.VertexNormalsHelper.prototype.update = function() {
  55551. var e = new n.Vector3
  55552. , t = new n.Vector3
  55553. , i = new n.Matrix3;
  55554. return function() {
  55555. var r = ["a", "b", "c"];
  55556. this.object.updateMatrixWorld(!0),
  55557. i.getNormalMatrix(this.object.matrixWorld);
  55558. var o = this.object.matrixWorld
  55559. , a = this.geometry.attributes.position
  55560. , s = this.object.geometry;
  55561. if (s instanceof n.Geometry)
  55562. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  55563. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  55564. var m = l[p[r[f]]]
  55565. , v = p.vertexNormals[f];
  55566. e.copy(m).applyMatrix4(o),
  55567. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55568. a.setXYZ(h, e.x, e.y, e.z),
  55569. h += 1,
  55570. a.setXYZ(h, t.x, t.y, t.z),
  55571. h += 1
  55572. }
  55573. else if (s instanceof n.BufferGeometry)
  55574. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  55575. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  55576. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  55577. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55578. a.setXYZ(h, e.x, e.y, e.z),
  55579. h += 1,
  55580. a.setXYZ(h, t.x, t.y, t.z),
  55581. h += 1;
  55582. return a.needsUpdate = !0,
  55583. this
  55584. }
  55585. }(),
  55586. n.WireframeHelper = function(e, t) {
  55587. var i = void 0 !== t ? t : 16777215;
  55588. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  55589. color: i
  55590. })),
  55591. this.matrix = e.matrixWorld,
  55592. this.matrixAutoUpdate = !1
  55593. }
  55594. ,
  55595. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  55596. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  55597. n.ImmediateRenderObject = function(e) {
  55598. n.Object3D.call(this),
  55599. this.material = e,
  55600. this.render = function(e) {}
  55601. }
  55602. ,
  55603. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  55604. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  55605. n.MorphBlendMesh = function(e, t) {
  55606. n.Mesh.call(this, e, t),
  55607. this.animationsMap = {},
  55608. this.animationsList = [];
  55609. var i = this.geometry.morphTargets.length
  55610. , r = "__default"
  55611. , o = 0
  55612. , a = i - 1
  55613. , s = i / 1;
  55614. this.createAnimation(r, o, a, s),
  55615. this.setAnimationWeight(r, 1)
  55616. }
  55617. ,
  55618. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  55619. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  55620. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55621. var r = {
  55622. start: t,
  55623. end: i,
  55624. length: i - t + 1,
  55625. fps: n,
  55626. duration: (i - t) / n,
  55627. lastFrame: 0,
  55628. currentFrame: 0,
  55629. active: !1,
  55630. time: 0,
  55631. direction: 1,
  55632. weight: 1,
  55633. directionBackwards: !1,
  55634. mirroredLoop: !1
  55635. };
  55636. this.animationsMap[e] = r,
  55637. this.animationsList.push(r)
  55638. }
  55639. ,
  55640. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55641. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55642. var s = r.morphTargets[o]
  55643. , l = s.name.match(i);
  55644. if (l && l.length > 1) {
  55645. var c = l[1];
  55646. n[c] || (n[c] = {
  55647. start: 1 / 0,
  55648. end: -(1 / 0)
  55649. });
  55650. var h = n[c];
  55651. o < h.start && (h.start = o),
  55652. o > h.end && (h.end = o),
  55653. t || (t = c)
  55654. }
  55655. }
  55656. for (var c in n) {
  55657. var h = n[c];
  55658. this.createAnimation(c, h.start, h.end, e)
  55659. }
  55660. this.firstAnimation = t
  55661. }
  55662. ,
  55663. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55664. var t = this.animationsMap[e];
  55665. t && (t.direction = 1,
  55666. t.directionBackwards = !1)
  55667. }
  55668. ,
  55669. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55670. var t = this.animationsMap[e];
  55671. t && (t.direction = -1,
  55672. t.directionBackwards = !0)
  55673. }
  55674. ,
  55675. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55676. var i = this.animationsMap[e];
  55677. i && (i.fps = t,
  55678. i.duration = (i.end - i.start) / i.fps)
  55679. }
  55680. ,
  55681. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55682. var i = this.animationsMap[e];
  55683. i && (i.duration = t,
  55684. i.fps = (i.end - i.start) / i.duration)
  55685. }
  55686. ,
  55687. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55688. var i = this.animationsMap[e];
  55689. i && (i.weight = t)
  55690. }
  55691. ,
  55692. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55693. var i = this.animationsMap[e];
  55694. i && (i.time = t)
  55695. }
  55696. ,
  55697. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55698. var t = 0
  55699. , i = this.animationsMap[e];
  55700. return i && (t = i.time),
  55701. t
  55702. }
  55703. ,
  55704. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55705. var t = -1
  55706. , i = this.animationsMap[e];
  55707. return i && (t = i.duration),
  55708. t
  55709. }
  55710. ,
  55711. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  55712. var t = this.animationsMap[e];
  55713. t ? (t.time = 0,
  55714. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55715. }
  55716. ,
  55717. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55718. var t = this.animationsMap[e];
  55719. t && (t.active = !1)
  55720. }
  55721. ,
  55722. n.MorphBlendMesh.prototype.update = function(e) {
  55723. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55724. var r = this.animationsList[t];
  55725. if (r.active) {
  55726. var o = r.duration / r.length;
  55727. r.time += r.direction * e,
  55728. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  55729. r.time > r.duration && (r.time = r.duration,
  55730. r.directionBackwards = !0),
  55731. r.time < 0 && (r.time = 0,
  55732. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  55733. r.time < 0 && (r.time += r.duration));
  55734. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  55735. , s = r.weight;
  55736. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  55737. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  55738. this.morphTargetInfluences[a] = 0,
  55739. r.lastFrame = r.currentFrame,
  55740. r.currentFrame = a);
  55741. var l = r.time % o / o;
  55742. r.directionBackwards && (l = 1 - l),
  55743. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  55744. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  55745. }
  55746. }
  55747. }
  55748. ,
  55749. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  55750. i.THREE = n) : this.THREE = n
  55751. }
  55752. , {}]
  55753. }, {}, [116]);