main_2020_edit.js 2.4 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832
  1. var dom = {
  2. getOffset: function(e, t, i) {
  3. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  4. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  5. left += "left" == e ? t.offsetLeft : t.offsetTop;
  6. return left
  7. }
  8. };
  9. if (function() {
  10. "use strict";
  11. function o(e, t) {
  12. return typeof e === t
  13. }
  14. function a(e, t) {
  15. return e instanceof t
  16. }
  17. function s(e) {
  18. return e && e.nodeType
  19. }
  20. function l(e) {
  21. return s(e) ? e : a(e, y) ? e[0] : void 0
  22. }
  23. function e(e, i, n) {
  24. return y.each(e, function(e, t) {
  25. n = i.call(t, n, e, t)
  26. }),
  27. n
  28. }
  29. function t(e, t, i) {
  30. var n, r, o;
  31. if (e === t)
  32. return !0;
  33. if (!e || !t || e.constructor !== t.constructor)
  34. return !1;
  35. for (n = 0,
  36. r = i.length; n < r; n += 1) {
  37. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  38. return !1;
  39. if (e[o] !== t[o])
  40. return !1
  41. }
  42. return !0
  43. }
  44. function c(e, t, i, n) {
  45. this.left = w(e),
  46. this.top = w(t),
  47. this.width = w(i),
  48. this.height = w(n),
  49. this.right = this.left + this.width,
  50. this.bottom = this.top + this.height
  51. }
  52. function h(e, t, i, n) {
  53. this.visible = e || 0,
  54. this.viewport = t || 0,
  55. this.possible = i || 0,
  56. this.rects = n && I({}, n) || null
  57. }
  58. function r(e, t) {
  59. this.els = e,
  60. this.viewport = t
  61. }
  62. function n(e, t) {
  63. return e.val - t.val
  64. }
  65. function u(e, t) {
  66. return t.val - e.val
  67. }
  68. function d(e) {
  69. var t = c.ofContent(e, !0)
  70. , i = c.ofViewport(e, !0)
  71. , n = t.width - i.width
  72. , r = t.height - i.height;
  73. this.content = t,
  74. this.viewport = i,
  75. this.width = n <= 0 ? null : i.left / n,
  76. this.height = r <= 0 ? null : i.top / r,
  77. this.left = i.left,
  78. this.top = i.top,
  79. this.right = t.right - i.right,
  80. this.bottom = t.bottom - i.bottom
  81. }
  82. function p(e) {
  83. this.el = e || window
  84. }
  85. function f(e, t) {
  86. this.context = e,
  87. this.viewport = t,
  88. this.init()
  89. }
  90. function g(e, t, i, n) {
  91. this.context = new r(e,t),
  92. this.property = i,
  93. this.descending = n,
  94. this.init()
  95. }
  96. function m(e) {
  97. e && e !== window && e !== document ? (this.context = e,
  98. this.$autoTarget = y(e)) : this.context = window,
  99. this.init()
  100. }
  101. var i, v, y = jQuery, A = y(window), C = y(document), I = y.extend, E = y.isFunction, _ = Math.max, b = Math.min, w = Math.round, T = (i = {},
  102. v = 1,
  103. function(e) {
  104. return e ? (i[e] || (i[e] = v,
  105. v += 1),
  106. i[e]) : 0
  107. }
  108. );
  109. I(c.prototype, {
  110. equals: function(e) {
  111. return t(this, e, ["left", "top", "width", "height"])
  112. },
  113. area: function() {
  114. return this.width * this.height
  115. },
  116. relativeTo: function(e) {
  117. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  118. },
  119. intersection: function(e) {
  120. if (!a(e, c))
  121. return null;
  122. var t = _(this.left, e.left)
  123. , i = b(this.right, e.right)
  124. , n = _(this.top, e.top)
  125. , r = i - t
  126. , o = b(this.bottom, e.bottom) - n;
  127. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  128. },
  129. envelope: function(e) {
  130. if (!a(e, c))
  131. return this;
  132. var t = b(this.left, e.left)
  133. , i = _(this.right, e.right)
  134. , n = b(this.top, e.top);
  135. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  136. }
  137. }),
  138. I(c, {
  139. ofContent: function(e, t) {
  140. return e && e !== document && e !== window ? t ? new c(0,0,e.scrollWidth,e.scrollHeight) : new c(e.offsetLeft - e.scrollLeft,e.offsetTop - e.scrollTop,e.scrollWidth,e.scrollHeight) : new c(0,0,C.width(),C.height())
  141. },
  142. ofViewport: function(e, t) {
  143. return e && e !== document && e !== window ? t ? new c(e.scrollLeft,e.scrollTop,e.clientWidth,e.clientHeight) : new c(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight) : new c(A.scrollLeft(),A.scrollTop(),A.width(),A.height())
  144. },
  145. ofElement: function(e) {
  146. var t = y(e);
  147. if (!t.is(":visible"))
  148. return null;
  149. var i = t.offset();
  150. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  151. }
  152. }),
  153. I(h.prototype, {
  154. equals: function(e) {
  155. return this.fracsEqual(e) && this.rectsEqual(e)
  156. },
  157. fracsEqual: function(e) {
  158. return t(this, e, ["visible", "viewport", "possible"])
  159. },
  160. rectsEqual: function(e) {
  161. return t(this.rects, e.rects, ["document", "element", "viewport"])
  162. }
  163. }),
  164. I(h, {
  165. of: function(e, t) {
  166. var i, n, r;
  167. return e = s(e) && c.ofElement(e) || e,
  168. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  169. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  170. r = b(e.width, t.width) * b(e.height, t.height),
  171. new h(n / e.area(),n / t.area(),n / r,{
  172. document: i,
  173. element: i.relativeTo(e),
  174. viewport: i.relativeTo(t)
  175. })) : new h
  176. }
  177. });
  178. var x = ["width", "height", "left", "right", "top", "bottom"]
  179. , S = ["possible", "visible", "viewport"];
  180. I(r.prototype, {
  181. sorted: function(t, e) {
  182. var i = this.viewport;
  183. return y.map(this.els, function(e) {
  184. return {
  185. el: e,
  186. val: function(e, t, i) {
  187. var n;
  188. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  189. n ? n[i] : 0
  190. }(e, i, t)
  191. }
  192. }).sort(e ? u : n)
  193. },
  194. best: function(e, t) {
  195. return this.els.length ? this.sorted(e, t)[0] : null
  196. }
  197. }),
  198. I(d.prototype, {
  199. equals: function(e) {
  200. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  201. }
  202. }),
  203. I(p.prototype, {
  204. equals: function(e) {
  205. return t(this, e, ["el"])
  206. },
  207. scrollState: function() {
  208. return new d(this.el)
  209. },
  210. scrollTo: function(e, t, i) {
  211. var n = y(this.el === window ? "html,body" : this.el);
  212. e = e || 0,
  213. t = t || 0,
  214. i = isNaN(i) ? 1e3 : i,
  215. n.stop(!0).animate({
  216. scrollLeft: e,
  217. scrollTop: t
  218. }, i)
  219. },
  220. scroll: function(e, t, i) {
  221. var n = this.el === window ? A : y(this.el);
  222. e = e || 0,
  223. t = t || 0,
  224. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  225. },
  226. scrollToRect: function(e, t, i, n) {
  227. t = t || 0,
  228. i = i || 0,
  229. this.scrollTo(e.left - t, e.top - i, n)
  230. },
  231. scrollToElement: function(e, t, i, n) {
  232. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  233. this.scrollToRect(r, t, i, n)
  234. }
  235. });
  236. var M = {
  237. init: function() {
  238. this.callbacks = y.Callbacks("memory unique"),
  239. this.currVal = null,
  240. this.prevVal = null,
  241. this.checkProxy = y.proxy(this.check, this),
  242. this.autoCheck()
  243. },
  244. bind: function(e) {
  245. this.callbacks.add(e)
  246. },
  247. unbind: function(e) {
  248. e ? this.callbacks.remove(e) : this.callbacks.empty()
  249. },
  250. trigger: function() {
  251. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  252. },
  253. check: function(e) {
  254. var t = this.updatedValue(e);
  255. return void 0 !== t && (this.prevVal = this.currVal,
  256. this.currVal = t,
  257. this.trigger(),
  258. !0)
  259. },
  260. $autoTarget: A,
  261. autoEvents: "load resize scroll",
  262. autoCheck: function(e) {
  263. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  264. }
  265. };
  266. I(f.prototype, M, {
  267. updatedValue: function() {
  268. var e = h.of(this.context, this.viewport);
  269. return this.currVal && this.currVal.equals(e) ? void 0 : e
  270. }
  271. }),
  272. I(g.prototype, M, {
  273. updatedValue: function() {
  274. var e = this.context.best(this.property, this.descending);
  275. return e && (e = 0 < e.val ? e.el : null,
  276. this.currVal !== e) ? e : void 0
  277. }
  278. }),
  279. I(m.prototype, M, {
  280. updatedValue: function() {
  281. var e = new d(this.context);
  282. return this.currVal && this.currVal.equals(e) ? void 0 : e
  283. }
  284. });
  285. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  286. function H(e, t, i, n) {
  287. return i = N(i) ? i.apply(e, t) : i,
  288. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  289. }
  290. R = U,
  291. P = {
  292. statics: {
  293. version: "0.15.0",
  294. Rect: c,
  295. Fractions: h,
  296. Group: r,
  297. ScrollState: d,
  298. Viewport: p,
  299. FracsCallbacks: f,
  300. GroupCallbacks: g,
  301. ScrollStateCallbacks: m,
  302. fracs: function(e, t) {
  303. return h.of(e, t)
  304. }
  305. },
  306. methods: {
  307. content: function(e) {
  308. return this.length ? c.ofContent(this[0], e) : null
  309. },
  310. envelope: function() {
  311. return e(this, function(e) {
  312. var t = c.ofElement(this);
  313. return e ? e.envelope(t) : t
  314. })
  315. },
  316. fracs: function(e, i, n) {
  317. o(e, "string") || (n = i,
  318. i = e,
  319. e = null),
  320. E(i) || (n = i,
  321. i = null),
  322. n = l(n);
  323. var r = U + ".fracs." + T(n);
  324. return "unbind" === e ? this.each(function() {
  325. var e = y(this).data(r);
  326. e && e.unbind(i)
  327. }) : "check" === e ? this.each(function() {
  328. var e = y(this).data(r);
  329. e && e.check()
  330. }) : E(i) ? this.each(function() {
  331. var e = y(this)
  332. , t = e.data(r);
  333. t || (t = new f(this,n),
  334. e.data(r, t)),
  335. t.bind(i)
  336. }) : this.length ? h.of(this[0], n) : null
  337. },
  338. intersection: function() {
  339. return e(this, function(e) {
  340. var t = c.ofElement(this);
  341. return e ? e.intersection(t) : t
  342. })
  343. },
  344. max: function(e, t, i) {
  345. return E(t) || (i = t,
  346. t = null),
  347. i = l(i),
  348. t ? (new g(this,i,e,!0).bind(t),
  349. this) : this.pushStack(new r(this,i).best(e, !0).el)
  350. },
  351. min: function(e, t, i) {
  352. return E(t) || (i = t,
  353. t = null),
  354. i = l(i),
  355. t ? (new g(this,i,e).bind(t),
  356. this) : this.pushStack(new r(this,i).best(e).el)
  357. },
  358. rect: function() {
  359. return this.length ? c.ofElement(this[0]) : null
  360. },
  361. scrollState: function(e, i) {
  362. var n = U + ".scrollState";
  363. return o(e, "string") || (i = e,
  364. e = null),
  365. "unbind" === e ? this.each(function() {
  366. var e = y(this).data(n);
  367. e && e.unbind(i)
  368. }) : "check" === e ? this.each(function() {
  369. var e = y(this).data(n);
  370. e && e.check()
  371. }) : E(i) ? this.each(function() {
  372. var e = y(this)
  373. , t = e.data(n);
  374. t || (t = new m(this),
  375. e.data(n, t)),
  376. t.bind(i)
  377. }) : this.length ? new d(this[0]) : null
  378. },
  379. scroll: function(e, t, i) {
  380. return this.each(function() {
  381. new p(this).scroll(e, t, i)
  382. })
  383. },
  384. scrollTo: function(e, t, i, n) {
  385. return y.isNumeric(e) && (n = i,
  386. i = t,
  387. t = e,
  388. e = null),
  389. e = l(e),
  390. this.each(function() {
  391. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  392. })
  393. },
  394. scrollToThis: function(e, t, i, n) {
  395. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  396. this
  397. },
  398. softLink: function(t, i, n, r) {
  399. return r = new p(l(r)),
  400. this.filter("a[href^=#]").each(function() {
  401. var e = y(this);
  402. e.on("click", function() {
  403. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  404. })
  405. })
  406. },
  407. sort: function(e, t, i) {
  408. return o(t, "boolean") || (i = t,
  409. t = null),
  410. i = l(i),
  411. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  412. return e.el
  413. }))
  414. },
  415. viewport: function(e) {
  416. return this.length ? c.ofViewport(this[0], e) : null
  417. }
  418. },
  419. defaultStatic: "fracs",
  420. defaultMethod: "fracs"
  421. },
  422. O = [].slice,
  423. L = jQuery,
  424. D = L.extend,
  425. N = L.isFunction,
  426. F = D({}, P),
  427. B = function() {
  428. return H(this, O.call(arguments), F.defaultStatic, B)
  429. }
  430. ,
  431. V = function(e) {
  432. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  433. }
  434. ,
  435. (k = function(e) {
  436. e && (D(B, e.statics),
  437. D(V, e.methods)),
  438. B.modplug = k
  439. }
  440. ).prev = {
  441. statics: L[R],
  442. methods: L.fn[R]
  443. },
  444. k(P),
  445. L[R] = B,
  446. L.fn[R] = V
  447. }(),
  448. "undefined" == typeof jQuery)
  449. throw new Error("Bootstrap's JavaScript requires jQuery");
  450. !function(m) {
  451. "use strict";
  452. function r(e, t) {
  453. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  454. this.init("tooltip", e, t)
  455. }
  456. r.VERSION = "3.2.0",
  457. r.DEFAULTS = {
  458. animation: !0,
  459. placement: "top",
  460. selector: !1,
  461. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  462. trigger: "hover focus",
  463. title: "",
  464. delay: 0,
  465. html: !1,
  466. container: !1,
  467. viewport: {
  468. selector: "body",
  469. padding: 0
  470. }
  471. },
  472. r.prototype.init = function(e, t, i) {
  473. this.enabled = !0,
  474. this.type = e,
  475. this.$element = m(t),
  476. this.options = this.getOptions(i),
  477. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  478. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  479. var o = n[r];
  480. if ("click" == o)
  481. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  482. else if ("manual" != o) {
  483. var a = "hover" == o ? "mouseenter" : "focusin"
  484. , s = "hover" == o ? "mouseleave" : "focusout";
  485. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  486. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  487. }
  488. }
  489. this.options.selector ? this._options = m.extend({}, this.options, {
  490. trigger: "manual",
  491. selector: ""
  492. }) : this.fixTitle()
  493. }
  494. ,
  495. r.prototype.getDefaults = function() {
  496. return r.DEFAULTS
  497. }
  498. ,
  499. r.prototype.getOptions = function(e) {
  500. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  501. show: e.delay,
  502. hide: e.delay
  503. }),
  504. e
  505. }
  506. ,
  507. r.prototype.getDelegateOptions = function() {
  508. var i = {}
  509. , n = this.getDefaults();
  510. return this._options && m.each(this._options, function(e, t) {
  511. n[e] != t && (i[e] = t)
  512. }),
  513. i
  514. }
  515. ,
  516. r.prototype.enter = function(e) {
  517. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  518. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  519. m(e.currentTarget).data("bs." + this.type, t)),
  520. clearTimeout(t.timeout),
  521. t.hoverState = "in",
  522. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  523. }
  524. ,
  525. r.prototype.leave = function(e) {
  526. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  527. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  528. m(e.currentTarget).data("bs." + this.type, t)),
  529. clearTimeout(t.timeout),
  530. t.hoverState = "out",
  531. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  532. "out" == t.hoverState && t.hide()
  533. }, t.options.delay.hide)) : t.hide()
  534. }
  535. ,
  536. r.prototype.show = function() {
  537. var e = m.Event("show.bs." + this.type);
  538. if (this.hasContent() && this.enabled) {
  539. this.$element.trigger(e);
  540. var t = m.contains(document.documentElement, this.$element[0]);
  541. if (e.isDefaultPrevented() || !t)
  542. return;
  543. var i = this
  544. , n = this.tip()
  545. , r = this.getUID(this.type);
  546. this.setContent(),
  547. n.attr("id", r),
  548. this.$element.attr("aria-describedby", r),
  549. this.options.animation && n.addClass("fade");
  550. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  551. , a = /\s?auto?\s?/i
  552. , s = a.test(o);
  553. s && (o = o.replace(a, "") || "top"),
  554. n.detach().css({
  555. top: 0,
  556. left: 0,
  557. display: "block"
  558. }).addClass(o).data("bs." + this.type, this),
  559. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  560. var l = this.getPosition()
  561. , c = n[0].offsetWidth
  562. , h = n[0].offsetHeight;
  563. if (s) {
  564. var u = o
  565. , d = this.$element.parent()
  566. , p = this.getPosition(d);
  567. o = "bottom" == o && l.top + l.height + h - p.scroll > p.height ? "top" : "top" == o && l.top - p.scroll - h < 0 ? "bottom" : "right" == o && l.right + c > p.width ? "left" : "left" == o && l.left - c < p.left ? "right" : o,
  568. n.removeClass(u).addClass(o)
  569. }
  570. var f = this.getCalculatedOffset(o, l, c, h);
  571. this.applyPlacement(f, o);
  572. var g = function() {
  573. i.$element.trigger("shown.bs." + i.type),
  574. i.hoverState = null
  575. };
  576. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  577. }
  578. }
  579. ,
  580. r.prototype.applyPlacement = function(e, t) {
  581. var i = this.tip()
  582. , n = i[0].offsetWidth
  583. , r = i[0].offsetHeight
  584. , o = parseInt(i.css("margin-top"), 10)
  585. , a = parseInt(i.css("margin-left"), 10);
  586. isNaN(o) && (o = 0),
  587. isNaN(a) && (a = 0),
  588. e.top = e.top + o,
  589. e.left = e.left + a,
  590. m.offset.setOffset(i[0], m.extend({
  591. using: function(e) {
  592. i.css({
  593. top: Math.round(e.top),
  594. left: Math.round(e.left)
  595. })
  596. }
  597. }, e), 0),
  598. i.addClass("in");
  599. var s = i[0].offsetWidth
  600. , l = i[0].offsetHeight;
  601. "top" == t && l != r && (e.top = e.top + r - l);
  602. var c = this.getViewportAdjustedDelta(t, e, s, l);
  603. c.left ? e.left += c.left : e.top += c.top;
  604. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  605. , u = c.left ? "left" : "top"
  606. , d = c.left ? "offsetWidth" : "offsetHeight";
  607. i.offset(e),
  608. this.replaceArrow(h, i[0][d], u)
  609. }
  610. ,
  611. r.prototype.replaceArrow = function(e, t, i) {
  612. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  613. }
  614. ,
  615. r.prototype.setContent = function() {
  616. var e = this.tip()
  617. , t = this.getTitle();
  618. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  619. e.removeClass("fade in top bottom left right")
  620. }
  621. ,
  622. r.prototype.hide = function() {
  623. function e() {
  624. "in" != t.hoverState && i.detach(),
  625. t.$element.trigger("hidden.bs." + t.type)
  626. }
  627. var t = this
  628. , i = this.tip()
  629. , n = m.Event("hide.bs." + this.type);
  630. if (this.$element.removeAttr("aria-describedby"),
  631. this.$element.trigger(n),
  632. !n.isDefaultPrevented())
  633. return i.removeClass("in"),
  634. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  635. this.hoverState = null,
  636. this
  637. }
  638. ,
  639. r.prototype.fixTitle = function() {
  640. var e = this.$element;
  641. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  642. }
  643. ,
  644. r.prototype.hasContent = function() {
  645. return this.getTitle()
  646. }
  647. ,
  648. r.prototype.getPosition = function(e) {
  649. var t = (e = e || this.$element)[0]
  650. , i = "BODY" == t.tagName;
  651. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  652. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  653. width: i ? m(window).width() : e.outerWidth(),
  654. height: i ? m(window).height() : e.outerHeight()
  655. }, i ? {
  656. top: 0,
  657. left: 0
  658. } : e.offset())
  659. }
  660. ,
  661. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  662. return "bottom" == e ? {
  663. top: t.top + t.height,
  664. left: t.left + t.width / 2 - i / 2
  665. } : "top" == e ? {
  666. top: t.top - n,
  667. left: t.left + t.width / 2 - i / 2
  668. } : "left" == e ? {
  669. top: t.top + t.height / 2 - n / 2,
  670. left: t.left - i
  671. } : {
  672. top: t.top + t.height / 2 - n / 2,
  673. left: t.left + t.width
  674. }
  675. }
  676. ,
  677. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  678. var r = {
  679. top: 0,
  680. left: 0
  681. };
  682. if (!this.$viewport)
  683. return r;
  684. var o = this.options.viewport && this.options.viewport.padding || 0
  685. , a = this.getPosition(this.$viewport);
  686. if (/right|left/.test(e)) {
  687. var s = t.top - o - a.scroll
  688. , l = t.top + o - a.scroll + n;
  689. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  690. } else {
  691. var c = t.left - o
  692. , h = t.left + o + i;
  693. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  694. }
  695. return r
  696. }
  697. ,
  698. r.prototype.getTitle = function() {
  699. var e = this.$element
  700. , t = this.options;
  701. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  702. }
  703. ,
  704. r.prototype.getUID = function(e) {
  705. for (; e += ~~(1e6 * Math.random()),
  706. document.getElementById(e); )
  707. ;
  708. return e
  709. }
  710. ,
  711. r.prototype.tip = function() {
  712. return this.$tip = this.$tip || m(this.options.template)
  713. }
  714. ,
  715. r.prototype.arrow = function() {
  716. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  717. }
  718. ,
  719. r.prototype.validate = function() {
  720. this.$element[0].parentNode || (this.hide(),
  721. this.$element = null,
  722. this.options = null)
  723. }
  724. ,
  725. r.prototype.enable = function() {
  726. this.enabled = !0
  727. }
  728. ,
  729. r.prototype.disable = function() {
  730. this.enabled = !1
  731. }
  732. ,
  733. r.prototype.toggleEnabled = function() {
  734. this.enabled = !this.enabled
  735. }
  736. ,
  737. r.prototype.toggle = function(e) {
  738. var t = this;
  739. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  740. m(e.currentTarget).data("bs." + this.type, t))),
  741. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  742. }
  743. ,
  744. r.prototype.destroy = function() {
  745. clearTimeout(this.timeout),
  746. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  747. }
  748. ;
  749. var e = m.fn.tooltip;
  750. m.fn.tooltip = function(n) {
  751. return this.each(function() {
  752. var e = m(this)
  753. , t = e.data("bs.tooltip")
  754. , i = "object" == typeof n && n;
  755. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  756. "string" == typeof n && t[n]())
  757. })
  758. }
  759. ,
  760. m.fn.tooltip.Constructor = r,
  761. m.fn.tooltip.noConflict = function() {
  762. return m.fn.tooltip = e,
  763. this
  764. }
  765. }(jQuery),
  766. function(e, t, i) {
  767. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  768. }(0, this, function() {
  769. "use strict";
  770. function Keen() {
  771. return _init.apply(this, arguments)
  772. }
  773. function _init(e) {
  774. if (_isUndefined(e))
  775. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  776. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  777. throw new Error("Please provide a projectId");
  778. this.configure(e)
  779. }
  780. function _extend(e) {
  781. for (var t = 1; t < arguments.length; t++)
  782. for (var i in arguments[t])
  783. e[i] = arguments[t][i];
  784. return e
  785. }
  786. function _isUndefined(e) {
  787. return void 0 === e
  788. }
  789. function _type(e) {
  790. var t = e && e.constructor ? e.constructor.toString() : void 0;
  791. return t ? t.match(/function (.*)\(/)[1] : "Null"
  792. }
  793. function _each(e, t, i) {
  794. var n;
  795. if (!e)
  796. return 0;
  797. if (i = i || e,
  798. "array" === _type(e)) {
  799. for (n = 0; n < e.length; n++)
  800. if (!1 === t.call(i, e[n], n, e))
  801. return 0
  802. } else
  803. for (n in e)
  804. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  805. return 0;
  806. return 1
  807. }
  808. function _parse_params(e) {
  809. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  810. return decodeURIComponent(e.replace(n, " "))
  811. }, a = e.split("?")[1]; t = r.exec(a); )
  812. i[o(t[1])] = o(t[2]);
  813. return i
  814. }
  815. function _set_protocol(e) {
  816. switch (e) {
  817. case "http":
  818. return "http";
  819. case "auto":
  820. return location.protocol.replace(/:/g, "");
  821. case "https":
  822. case void 0:
  823. default:
  824. return "https"
  825. }
  826. }
  827. function _set_request_type(e) {
  828. var t = e || "jsonp"
  829. , i = !1;
  830. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  831. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  832. }
  833. function _build_url(e) {
  834. return this.client.endpoint + "/projects/" + this.client.projectId + e
  835. }
  836. function _uploadEvent(e, t, i, n, r) {
  837. var o = _build_url.apply(this, ["/events/" + e])
  838. , a = {};
  839. for (var s in i = !1 !== i,
  840. this.client.globalProperties && (a = this.client.globalProperties(e)),
  841. t)
  842. t.hasOwnProperty(s) && (a[s] = t[s]);
  843. switch (this.client.requestType) {
  844. case "xhr":
  845. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  846. break;
  847. case "jsonp":
  848. var l = JSON.stringify(a)
  849. , c = Keen.Base64.encode(l);
  850. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  851. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  852. break;
  853. case "beacon":
  854. l = JSON.stringify(a),
  855. c = Keen.Base64.encode(l);
  856. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  857. o += "&c=clv1",
  858. _request.beacon.apply(this, [o, null, n, r])
  859. }
  860. }
  861. Keen.prototype.configure = function(e) {
  862. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  863. e.protocol = _set_protocol(e.protocol),
  864. e.requestType = _set_request_type(e.requestType),
  865. this.client = {
  866. projectId: e.projectId,
  867. writeKey: e.writeKey,
  868. readKey: e.readKey,
  869. globalProperties: null,
  870. endpoint: e.protocol + "://" + e.host,
  871. requestType: e.requestType
  872. },
  873. Keen.trigger("client", this, e),
  874. this.trigger("ready"),
  875. this
  876. }
  877. ;
  878. var _request = {
  879. xhr: function(e, t, i, n, r, o, a, s) {
  880. if (!r)
  881. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  882. var l = new XMLHttpRequest;
  883. if (l.onreadystatechange = function() {
  884. if (4 == l.readyState)
  885. if (200 <= l.status && l.status < 300) {
  886. var e;
  887. try {
  888. e = JSON.parse(l.responseText)
  889. } catch (e) {
  890. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  891. s && s(l, e)
  892. }
  893. a && e && a(e)
  894. } else
  895. Keen.log("HTTP request failed."),
  896. s && s(l, null)
  897. }
  898. ,
  899. l.open(e, t, o),
  900. r && l.setRequestHeader("Authorization", r),
  901. n && l.setRequestHeader("Content-Type", "application/json"),
  902. i)
  903. for (var c in i)
  904. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  905. var h = n ? JSON.stringify(n) : null;
  906. l.send(h)
  907. },
  908. jsonp: function(e, t, i, n) {
  909. if (!t)
  910. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  911. if (t && e.indexOf("api_key") < 0) {
  912. var r = 0 < e.indexOf("?") ? "&" : "?";
  913. e = e + r + "api_key=" + t
  914. }
  915. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  916. o += "a";
  917. var a = !1;
  918. window[o] = function(e) {
  919. a = !0,
  920. i && e && i(e),
  921. window[o] = void 0
  922. }
  923. ,
  924. e = e + "&jsonp=" + o;
  925. var s = document.createElement("script");
  926. s.id = "keen-jsonp",
  927. s.src = e,
  928. document.getElementsByTagName("head")[0].appendChild(s),
  929. s.onreadystatechange = function() {
  930. !1 === a && "loaded" === this.readyState && (a = !0,
  931. n && n())
  932. }
  933. ,
  934. s.onerror = function() {
  935. !1 === a && (a = !0,
  936. n && n())
  937. }
  938. },
  939. beacon: function(e, t, i, n) {
  940. if (t && e.indexOf("api_key") < 0) {
  941. var r = 0 < e.indexOf("?") ? "&" : "?";
  942. e = e + r + "api_key=" + t
  943. }
  944. var o = document.createElement("img");
  945. o.onload = function() {
  946. if (!0,
  947. "naturalHeight"in this) {
  948. if (this.naturalHeight + this.naturalWidth === 0)
  949. return void this.onerror()
  950. } else if (this.width + this.height === 0)
  951. return void this.onerror();
  952. i && i({
  953. created: !0
  954. })
  955. }
  956. ,
  957. o.onerror = function() {
  958. !0,
  959. n && n()
  960. }
  961. ,
  962. o.src = e
  963. }
  964. }
  965. , Events = Keen.Events = {
  966. on: function(e, t) {
  967. return this.listeners || (this.listeners = {}),
  968. (this.listeners[e] || (this.listeners[e] = [])).push({
  969. callback: t
  970. }),
  971. this
  972. },
  973. off: function(e, t) {
  974. if (!e && !t)
  975. return this.listeners = void 0,
  976. delete this.listeners,
  977. this;
  978. for (var i = this.listeners[e] || [], n = i.length; n--; )
  979. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  980. t && 0 != i.length || (this.listeners[e] = void 0,
  981. delete this.listeners[e]);
  982. return this
  983. },
  984. trigger: function(e) {
  985. if (!this.listeners)
  986. return this;
  987. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  988. i[n].callback.apply(this, t);
  989. return this
  990. }
  991. };
  992. _extend(Keen.prototype, Events),
  993. _extend(Keen, Events),
  994. Keen.loaded = !0,
  995. Keen.utils = {
  996. each: _each,
  997. extend: _extend,
  998. parseParams: _parse_params
  999. },
  1000. Keen.ready = function(e) {
  1001. Keen.loaded ? e() : Keen.on("ready", e)
  1002. }
  1003. ,
  1004. Keen.log = function(e) {
  1005. "object" == typeof console && console.log("[Keen IO]", e)
  1006. }
  1007. ;
  1008. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1009. Keen.prototype.addEvent = function() {
  1010. _uploadEvent.apply(this, arguments)
  1011. }
  1012. ,
  1013. Keen.prototype.addEventSync = function(e, t, i, n) {
  1014. _uploadEvent.apply(this, [e, t, !1, i, n])
  1015. }
  1016. ,
  1017. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1018. var o = e
  1019. , a = o.metaKey
  1020. , s = o.target
  1021. , l = !1
  1022. , c = function() {};
  1023. return void 0 === n && (n = 500),
  1024. "A" === s.nodeName ? c = function() {
  1025. a || l || (l = !0,
  1026. window.location = s.href)
  1027. }
  1028. : "FORM" === s.nodeName && (c = function() {
  1029. l || (l = !0,
  1030. s.submit())
  1031. }
  1032. ),
  1033. r && (c = function() {
  1034. l || (l = !0,
  1035. r())
  1036. }
  1037. ),
  1038. _uploadEvent.call(this, t, i, c, c),
  1039. setTimeout(function() {
  1040. c()
  1041. }, n),
  1042. !!a && void 0
  1043. }
  1044. ,
  1045. Keen.prototype.setGlobalProperties = function(e) {
  1046. if (!this.client)
  1047. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1048. if (!e || "function" != typeof e)
  1049. throw new Error("Invalid value for global properties: " + e);
  1050. this.client.globalProperties = e
  1051. }
  1052. ,
  1053. Keen.Base64 = {
  1054. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1055. encode: function(e) {
  1056. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1057. for (e = this.utf8.encode(e); c < e.length; )
  1058. t = e.charCodeAt(c++),
  1059. i = e.charCodeAt(c++),
  1060. n = e.charCodeAt(c++),
  1061. r = t >> 2,
  1062. o = (3 & t) << 4 | i >> 4,
  1063. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1064. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1065. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1066. return l
  1067. },
  1068. decode: function(e) {
  1069. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1070. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1071. t = c.indexOf(e.charAt(l++)),
  1072. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1073. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1074. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1075. return this.utf8.decode(s)
  1076. },
  1077. utf8: {
  1078. encode: function(e) {
  1079. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1080. i += (t = e.charCodeAt(n++)) < 128 ? r(t) : 127 < t && t < 2048 ? r(t >> 6 | 192) + r(63 & t | 128) : r(t >> 12 | 224) + r(t >> 6 & 63 | 128) + r(63 & t | 128);
  1081. return i
  1082. },
  1083. decode: function(e) {
  1084. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1085. i += (t = e.charCodeAt(n)) < 128 ? [r(t), n++][0] : 191 < t && t < 224 ? [r((31 & t) << 6 | 63 & e.charCodeAt(n + 1)), n += 2][0] : [r((15 & t) << 12 | (63 & e.charCodeAt(n + 1)) << 6 | 63 & (c3 = e.charCodeAt(n + 2))), n += 3][0];
  1086. return i
  1087. }
  1088. }
  1089. },
  1090. "object" != typeof JSON && (JSON = {}),
  1091. function() {
  1092. function f(e) {
  1093. return e < 10 ? "0" + e : e
  1094. }
  1095. function quote(e) {
  1096. return escapable.lastIndex = 0,
  1097. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1098. var t = meta[e];
  1099. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1100. }) + '"' : '"' + e + '"'
  1101. }
  1102. function str(e, t) {
  1103. var i, n, r, o, a, s = gap, l = t[e];
  1104. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1105. "function" == typeof rep && (l = rep.call(t, e, l)),
  1106. typeof l) {
  1107. case "string":
  1108. return quote(l);
  1109. case "number":
  1110. return isFinite(l) ? String(l) : "null";
  1111. case "boolean":
  1112. case "null":
  1113. return String(l);
  1114. case "object":
  1115. if (!l)
  1116. return "null";
  1117. if (gap += indent,
  1118. a = [],
  1119. "[object Array]" === Object.prototype.toString.apply(l)) {
  1120. for (o = l.length,
  1121. i = 0; i < o; i += 1)
  1122. a[i] = str(i, l) || "null";
  1123. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1124. gap = s,
  1125. r
  1126. }
  1127. if (rep && "object" == typeof rep)
  1128. for (o = rep.length,
  1129. i = 0; i < o; i += 1)
  1130. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1131. else
  1132. for (n in l)
  1133. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1134. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1135. gap = s,
  1136. r
  1137. }
  1138. }
  1139. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1140. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  1141. }
  1142. ,
  1143. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1144. return this.valueOf()
  1145. }
  1146. );
  1147. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
  1148. "\b": "\\b",
  1149. "\t": "\\t",
  1150. "\n": "\\n",
  1151. "\f": "\\f",
  1152. "\r": "\\r",
  1153. '"': '\\"',
  1154. "\\": "\\\\"
  1155. }, rep;
  1156. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1157. var n;
  1158. if (indent = gap = "",
  1159. "number" == typeof i)
  1160. for (n = 0; n < i; n += 1)
  1161. indent += " ";
  1162. else
  1163. "string" == typeof i && (indent = i);
  1164. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1165. throw new Error("JSON.stringify");
  1166. return str("", {
  1167. "": e
  1168. })
  1169. }
  1170. ),
  1171. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1172. function walk(e, t) {
  1173. var i, n, r = e[t];
  1174. if (r && "object" == typeof r)
  1175. for (i in r)
  1176. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1177. return reviver.call(e, t, r)
  1178. }
  1179. var j;
  1180. if (text = String(text),
  1181. cx.lastIndex = 0,
  1182. cx.test(text) && (text = text.replace(cx, function(e) {
  1183. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1184. })),
  1185. /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")))
  1186. return j = eval("(" + text + ")"),
  1187. "function" == typeof reviver ? walk({
  1188. "": j
  1189. }, "") : j;
  1190. throw new SyntaxError("JSON.parse")
  1191. }
  1192. )
  1193. }(),
  1194. Hh = Keen.utils,
  1195. Ih = function(i) {
  1196. function e(e) {
  1197. for (u = 1; e = n.shift(); )
  1198. e()
  1199. }
  1200. var t, n = [], r = document, o = r.documentElement, a = o.doScroll, s = "DOMContentLoaded", l = "addEventListener", c = "onreadystatechange", h = "readyState", u = (a ? /^loaded|^c/ : /^loaded|c/).test(r[h]);
  1201. return r[l] && r[l](s, t = function() {
  1202. r.removeEventListener(s, t, !1),
  1203. e()
  1204. }
  1205. , !1),
  1206. a && r.attachEvent(c, t = function() {
  1207. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1208. e())
  1209. }
  1210. ),
  1211. i = a ? function(t) {
  1212. self != top ? u ? t() : n.push(t) : function() {
  1213. try {
  1214. o.doScroll("left")
  1215. } catch (e) {
  1216. return setTimeout(function() {
  1217. i(t)
  1218. }, 50)
  1219. }
  1220. t()
  1221. }()
  1222. }
  1223. : function(e) {
  1224. u ? e() : n.push(e)
  1225. }
  1226. }
  1227. ,
  1228. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1229. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1230. if (loaded && cached) {
  1231. for (var instance in clients = cached.clients || {},
  1232. ready = cached.ready || [],
  1233. clients)
  1234. if (clients.hasOwnProperty(instance)) {
  1235. var client = clients[instance];
  1236. for (var method in Keen.prototype)
  1237. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1238. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1239. ,
  1240. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1241. ,
  1242. client._config && (client.configure.call(client, client._config),
  1243. delete client._config),
  1244. client._setGlobalProperties) {
  1245. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1246. client.setGlobalProperties.apply(client, globals[i]);
  1247. delete client._setGlobalProperties
  1248. }
  1249. if (client._addEvent) {
  1250. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1251. client.addEvent.apply(client, queue[i]);
  1252. delete client._addEvent
  1253. }
  1254. var callback = client._on || [];
  1255. if (client._on) {
  1256. for (var i = 0; i < callback.length; i++)
  1257. client.on.apply(client, callback[i]);
  1258. client.trigger("ready"),
  1259. delete client._on
  1260. }
  1261. }
  1262. for (var i = 0; i < ready.length; i++) {
  1263. var callback = ready[i];
  1264. Keen.on("ready", function() {
  1265. callback()
  1266. })
  1267. }
  1268. }
  1269. return Keen.loaded && setTimeout(function() {
  1270. Keen.utils.domready(function() {
  1271. Keen.trigger("ready")
  1272. })
  1273. }, 0),
  1274. Keen
  1275. }),
  1276. function() {
  1277. var i = window.analytics = window.analytics || [];
  1278. if (!i.initialize) {
  1279. if (i.invoked)
  1280. return window.console && console.error && console.error("Segment snippet included twice.");
  1281. i.invoked = !0,
  1282. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1283. i.factory = function(t) {
  1284. return function() {
  1285. var e = Array.prototype.slice.call(arguments);
  1286. return e.unshift(t),
  1287. i.push(e),
  1288. i
  1289. }
  1290. }
  1291. ;
  1292. for (var e = 0; e < i.methods.length; e++) {
  1293. var t = i.methods[e];
  1294. i[t] = i.factory(t)
  1295. }
  1296. i.load = function(e) {
  1297. var t = document.createElement("script");
  1298. t.type = "text/javascript",
  1299. t.async = !0,
  1300. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1301. var i = document.getElementsByTagName("script")[0];
  1302. i.parentNode.insertBefore(t, i)
  1303. }
  1304. ,
  1305. i.SNIPPET_VERSION = "4.0.0"
  1306. }
  1307. }(),
  1308. function(i, u) {
  1309. "use strict";
  1310. var d = "function"
  1311. , p = "undefined"
  1312. , f = "object"
  1313. , e = "major"
  1314. , t = "model"
  1315. , n = "name"
  1316. , r = "type"
  1317. , o = "vendor"
  1318. , a = "version"
  1319. , s = "architecture"
  1320. , l = "console"
  1321. , c = "mobile"
  1322. , h = "tablet"
  1323. , g = {
  1324. has: function(e, t) {
  1325. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1326. },
  1327. lowerize: function(e) {
  1328. return e.toLowerCase()
  1329. }
  1330. }
  1331. , m = {
  1332. rgx: function() {
  1333. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1334. var c = l[s]
  1335. , h = l[s + 1];
  1336. if (typeof e == p)
  1337. for (n in e = {},
  1338. h)
  1339. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1340. for (t = i = 0; t < c.length; t++)
  1341. if (o = c[t].exec(this.getUA())) {
  1342. for (n = 0; n < h.length; n++)
  1343. a = o[++i],
  1344. typeof (r = h[n]) == f && 0 < r.length ? 2 == r.length ? typeof r[1] == d ? e[r[0]] = r[1].call(this, a) : e[r[0]] = r[1] : 3 == r.length ? typeof r[1] != d || r[1].exec && r[1].test ? e[r[0]] = a ? a.replace(r[1], r[2]) : u : e[r[0]] = a ? r[1].call(this, a, r[2]) : u : 4 == r.length && (e[r[0]] = a ? r[3].call(this, a.replace(r[1], r[2])) : u) : e[r] = a || u;
  1345. break
  1346. }
  1347. if (o)
  1348. break
  1349. }
  1350. return e
  1351. },
  1352. str: function(e, t) {
  1353. for (var i in t)
  1354. if (typeof t[i] == f && 0 < t[i].length) {
  1355. for (var n = 0; n < t[i].length; n++)
  1356. if (g.has(t[i][n], e))
  1357. return "?" === i ? u : i
  1358. } else if (g.has(t[i], e))
  1359. return "?" === i ? u : i;
  1360. return e
  1361. }
  1362. }
  1363. , v = {
  1364. browser: {
  1365. oldsafari: {
  1366. major: {
  1367. 1: ["/8", "/1", "/3"],
  1368. 2: "/4",
  1369. "?": "/"
  1370. },
  1371. version: {
  1372. "1.0": "/8",
  1373. 1.2: "/1",
  1374. 1.3: "/3",
  1375. "2.0": "/412",
  1376. "2.0.2": "/416",
  1377. "2.0.3": "/417",
  1378. "2.0.4": "/419",
  1379. "?": "/"
  1380. }
  1381. }
  1382. },
  1383. device: {
  1384. sprint: {
  1385. model: {
  1386. "Evo Shift 4G": "7373KT"
  1387. },
  1388. vendor: {
  1389. HTC: "APA",
  1390. Sprint: "Sprint"
  1391. }
  1392. }
  1393. },
  1394. os: {
  1395. windows: {
  1396. version: {
  1397. ME: "4.90",
  1398. "NT 3.11": "NT3.51",
  1399. "NT 4.0": "NT4.0",
  1400. 2e3: "NT 5.0",
  1401. XP: ["NT 5.1", "NT 5.2"],
  1402. Vista: "NT 6.0",
  1403. 7: "NT 6.1",
  1404. 8: "NT 6.2",
  1405. 8.1: "NT 6.3",
  1406. RT: "ARM"
  1407. }
  1408. }
  1409. }
  1410. }
  1411. , y = {
  1412. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [n, a, e], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[n, "Opera"], a, e], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [n, a, e], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[n, "IE"], a, e], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[n, "Yandex"], a, e], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[n, /_/g, " "], a, e], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [n, a, e], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[n, "Dolphin"], a, e], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[n, "Chrome"], a, e], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [a, e, [n, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [a, e, n], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [n, [e, m.str, v.browser.oldsafari.major], [a, m.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [n, a, e], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[n, "Netscape"], a, e], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [n, a, e], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [n, a, e], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [n, a], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(flrp)\/((\d+)[\w\.-]+)/i], [[n, "Flip Player"], a, e], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [n], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [n, a, e], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [n, a, e], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[n, /_/g, " "], a, e], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [n, a], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [n, a, e], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [n], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [n, a, e], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [n, a, e], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [n, a, e], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [n], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(smp)((\d+)[\d\.]+)/i], [n, a, e], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [n, a, e], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[n, /-/g, " "], a, e], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [a, e, [n, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [n, a, e], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[n, "rad.io"], a, e]],
  1413. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[s, "amd64"]], [/(ia32(?=;))/i], [[s, g.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[s, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[s, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[s, /ower/, "", g.lowerize]], [/(sun4\w)[;\)]/i], [[s, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [s, g.lowerize]],
  1414. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [t, o, [r, h]], [/applecoremedia\/[\w\.]+ \((ipad)/], [t, [o, "Apple"], [r, h]], [/(apple\s{0,1}tv)/i], [[t, "Apple TV"], [o, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [o, t, [r, h]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [t, o, [r, c]], [/\((ip[honed|\s\w*]+);/i], [t, [o, "Apple"], [r, c]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [o, t, [r, c]], [/\((bb10);\s(\w+)/i], [[o, "BlackBerry"], t, [r, c]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[o, "Asus"], t, [r, h]], [/(sony)\s(tablet\s[ps])/i], [o, t, [r, h]], [/(nintendo)\s([wids3u]+)/i], [o, t, [r, l]], [/((playstation)\s[3portablevi]+)/i], [[o, "Sony"], t, [r, l]], [/(sprint\s(\w+))/i], [[o, m.str, v.device.sprint.vendor], [t, m.str, v.device.sprint.model], [r, c]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [o, [t, /_/g, " "], [r, c]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[o, "Motorola"], t, [r, c]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[o, "Motorola"], t, [r, h]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[o, "Samsung"], t, [r, h]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[o, "Samsung"], t, [r, c]], [/(sie)-(\w+)*/i], [[o, "Siemens"], t, [r, c]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[o, "Nokia"], t, [r, c]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[o, "Acer"], t, [r, h]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[o, "LG"], t, [r, h]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[o, "LG"], t, [r, c]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[o, "Lenovo"], t, [r, h]], [/(lg) netcast\.tv/i], [o, [r, "smarttv"]], [/(mobile|tablet);.+rv\:.+gecko\//i], [r, o, t]],
  1415. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [n, a], [/rv\:([\w\.]+).*(gecko)/i], [a, n]],
  1416. os: [[/microsoft\s(windows)\s(vista|xp)/i], [n, a], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [n, [a, m.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[n, "Windows"], [a, m.str, v.os.windows.version]], [/\((bb)(10);/i], [[n, "BlackBerry"], a], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [n, a], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[n, "Symbian"], a], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[n, "Firefox OS"], a], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [n, a], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[n, "Chromium OS"], a], [/(sunos)\s?([\w\.]+\d)*/i], [[n, "Solaris"], a], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [n, a], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[n, "iOS"], [a, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [n, [a, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [n, a]]
  1417. }
  1418. , A = function(e) {
  1419. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1420. return this instanceof A ? (this.getBrowser = function() {
  1421. return m.rgx.apply(this, y.browser)
  1422. }
  1423. ,
  1424. this.getCPU = function() {
  1425. return m.rgx.apply(this, y.cpu)
  1426. }
  1427. ,
  1428. this.getDevice = function() {
  1429. return m.rgx.apply(this, y.device)
  1430. }
  1431. ,
  1432. this.getEngine = function() {
  1433. return m.rgx.apply(this, y.engine)
  1434. }
  1435. ,
  1436. this.getOS = function() {
  1437. return m.rgx.apply(this, y.os)
  1438. }
  1439. ,
  1440. this.getResult = function() {
  1441. return {
  1442. ua: this.getUA(),
  1443. browser: this.getBrowser(),
  1444. engine: this.getEngine(),
  1445. os: this.getOS(),
  1446. device: this.getDevice(),
  1447. cpu: this.getCPU()
  1448. }
  1449. }
  1450. ,
  1451. this.getUA = function() {
  1452. return t
  1453. }
  1454. ,
  1455. this.setUA = function(e) {
  1456. return t = e,
  1457. this
  1458. }
  1459. ,
  1460. void this.setUA(t)) : new A(e).getResult()
  1461. };
  1462. if (typeof exports != p)
  1463. typeof module != p && module.exports && (exports = module.exports = A),
  1464. exports.UAParser = A;
  1465. else if (i.UAParser = A,
  1466. typeof define == d && define.amd && define(function() {
  1467. return A
  1468. }),
  1469. typeof i.jQuery != p) {
  1470. var C = i.jQuery
  1471. , I = new A;
  1472. C.ua = I.getResult(),
  1473. C.ua.get = function() {
  1474. return I.getUA()
  1475. }
  1476. ,
  1477. C.ua.set = function(e) {
  1478. I.setUA(e);
  1479. var t = I.getResult();
  1480. for (var i in t)
  1481. C.ua[i] = t[i]
  1482. }
  1483. }
  1484. }(this),
  1485. window.Modernizr = function(e, t) {
  1486. function i(e, t) {
  1487. return typeof e === t
  1488. }
  1489. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1490. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1491. return t in e && i(e.constructor.prototype[t], "undefined")
  1492. }
  1493. : function(e, t) {
  1494. return p.call(e, t)
  1495. }
  1496. ,
  1497. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1498. var r = this;
  1499. if ("function" != typeof r)
  1500. throw new TypeError;
  1501. var o = d.call(arguments, 1)
  1502. , a = function() {
  1503. if (this instanceof a) {
  1504. function e() {}
  1505. e.prototype = r.prototype;
  1506. var t = new e
  1507. , i = r.apply(t, o.concat(d.call(arguments)));
  1508. return Object(i) === i ? i : t
  1509. }
  1510. return r.apply(n, o.concat(d.call(arguments)))
  1511. };
  1512. return a
  1513. }
  1514. ),
  1515. h.webgl = function() {
  1516. return !!e.WebGLRenderingContext
  1517. }
  1518. ,
  1519. h)
  1520. r(h, f) && (n = f.toLowerCase(),
  1521. a[n] = h[f](),
  1522. u.push((a[n] ? "" : "no-") + n));
  1523. return a.addTest = function(e, t) {
  1524. if ("object" == typeof e)
  1525. for (var i in e)
  1526. r(e, i) && a.addTest(i, e[i]);
  1527. else {
  1528. if (e = e.toLowerCase(),
  1529. void 0 !== a[e])
  1530. return a;
  1531. t = "function" == typeof t ? t() : t,
  1532. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1533. a[e] = t
  1534. }
  1535. return a
  1536. }
  1537. ,
  1538. o = "",
  1539. c.cssText = o,
  1540. l = null,
  1541. a._version = "2.8.2",
  1542. a
  1543. }(this, this.document),
  1544. function(xe, e, Se) {
  1545. "use strict";
  1546. function Me(s, e, n) {
  1547. function a(e) {
  1548. var t = Q.length;
  1549. if (G.old = xe.extend({}, G),
  1550. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1551. Y = W[F.horizontal ? "width" : "height"](),
  1552. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1553. Q.length = 0,
  1554. G.start = 0,
  1555. G.end = nt(z - H, 0),
  1556. le) {
  1557. $.length,
  1558. J = U.children(F.itemSelector),
  1559. $.length = 0;
  1560. var h, u = Ne(U, F.horizontal ? "paddingLeft" : "paddingTop"), d = Ne(U, F.horizontal ? "paddingRight" : "paddingBottom"), i = "border-box" === xe(J).css("boxSizing"), p = "none" !== J.css("float"), f = 0, g = J.length - 1;
  1561. z = 0,
  1562. J.each(function(e, t) {
  1563. var i = xe(t)
  1564. , n = t.getBoundingClientRect()
  1565. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1566. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1567. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1568. , s = r + o + a
  1569. , l = !o || !a
  1570. , c = {};
  1571. c.el = t,
  1572. c.size = l ? r : s,
  1573. c.half = c.size / 2,
  1574. c.start = z + (l ? o : 0),
  1575. c.center = c.start - it(H / 2 - c.size / 2),
  1576. c.end = c.start - H + c.size,
  1577. e || (z += u),
  1578. z += s,
  1579. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1580. e === g && (c.end += d,
  1581. z += d,
  1582. f = l ? a : 0),
  1583. $.push(c),
  1584. h = c
  1585. }),
  1586. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1587. z -= f,
  1588. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1589. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1590. }
  1591. if (G.center = it(G.end / 2 + G.start / 2),
  1592. v(),
  1593. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1594. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1595. X.end = Y - q,
  1596. _e || c()),
  1597. !V && 0 < H) {
  1598. var n = G.start
  1599. , r = "";
  1600. if (le)
  1601. xe.each($, function(e, t) {
  1602. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1603. Q.push(n),
  1604. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1605. });
  1606. else
  1607. for (; n - H < G.end; )
  1608. Q.push(n),
  1609. n += H;
  1610. if (Z[0] && t !== Q.length) {
  1611. for (var o = 0; o < Q.length; o++)
  1612. r += F.pageBuilder.call(B, o);
  1613. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1614. }
  1615. }
  1616. if (ee.slideeSize = z,
  1617. ee.frameSize = H,
  1618. ee.sbSize = Y,
  1619. ee.handleSize = q,
  1620. le) {
  1621. e && null != F.startAt && (m(F.startAt),
  1622. B[se ? "toCenter" : "toStart"](F.startAt));
  1623. var a = $[ee.activeItem];
  1624. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1625. } else
  1626. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1627. L("load")
  1628. }
  1629. function l(e, t, i) {
  1630. if (le && Ie.released && !i) {
  1631. var n = d(e)
  1632. , r = e > G.start && e < G.end;
  1633. se ? (r && (e = $[n.centerItem].center),
  1634. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1635. }
  1636. Ie.init && Ie.slidee && F.elasticBounds ? e > G.end ? e = G.end + (e - G.end) / 6 : e < G.start && (e = G.start + (e - G.start) / 6) : e = Fe(e, G.start, G.end),
  1637. Ae.start = +new Date,
  1638. Ae.time = 0,
  1639. Ae.from = G.cur,
  1640. Ae.to = e,
  1641. Ae.delta = e - G.cur,
  1642. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1643. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1644. Ie.tweese = 0,
  1645. e !== G.dest && (G.dest = e,
  1646. L("change"),
  1647. _e || o()),
  1648. g(),
  1649. v(),
  1650. p(),
  1651. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1652. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1653. L("activePage", ye.page))
  1654. }
  1655. function o() {
  1656. if (B.initialized) {
  1657. if (!_e)
  1658. return _e = Ge(o),
  1659. void (Ie.released && L("moveStart"));
  1660. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1661. $e(Ae.tweeseDelta) < .1 ? G.cur = Ae.to : G.cur += Ae.tweeseDelta * (Ie.released ? F.swingSpeed : F.syncSpeed)) : (Ae.time = rt(+new Date - Ae.start, F.speed),
  1662. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1663. Ae.to === G.cur ? (G.cur = Ae.to,
  1664. Ie.tweese = _e = 0) : _e = Ge(o),
  1665. L("move"),
  1666. V || (Ve ? U[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + -G.cur + "px)" : U[0].style[F.horizontal ? "left" : "top"] = -it(G.cur) + "px"),
  1667. !_e && Ie.released && L("moveEnd"),
  1668. c()
  1669. }
  1670. }
  1671. function c() {
  1672. j.length && (X.cur = G.start === G.end ? 0 : ((Ie.init && !Ie.slidee ? G.dest : G.cur) - G.start) / (G.end - G.start) * X.end,
  1673. X.cur = Fe(it(X.cur), X.start, X.end),
  1674. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1675. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1676. }
  1677. function t() {
  1678. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1679. Te = Ie.init ? Ge(t) : 0,
  1680. Ce.now = +new Date,
  1681. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1682. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1683. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1684. Ce.lastTime = Ce.now
  1685. }
  1686. function i(e, t, i) {
  1687. if ("boolean" === Re(t) && (i = t,
  1688. t = Se),
  1689. t === Se)
  1690. l(G[e], i);
  1691. else {
  1692. if (se && "center" !== e)
  1693. return;
  1694. var n = B.getPos(t);
  1695. n && l(n[e], i, !se)
  1696. }
  1697. }
  1698. function h(e) {
  1699. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1700. }
  1701. function u(e) {
  1702. return h(De(e) && e < 0 ? e + $.length : e)
  1703. }
  1704. function m(e, t) {
  1705. var i = h(e);
  1706. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1707. J.eq(i).addClass(F.activeClass),
  1708. ye.active = ee.activeItem = i,
  1709. p(),
  1710. L("active", i)),
  1711. i)
  1712. }
  1713. function d(e) {
  1714. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1715. var t = {}
  1716. , i = ae ? 0 : H / 2;
  1717. if (!V)
  1718. for (var n = 0, r = Q.length; n < r; n++) {
  1719. if (e >= G.end || n === Q.length - 1) {
  1720. t.activePage = Q.length - 1;
  1721. break
  1722. }
  1723. if (e <= Q[n] + i) {
  1724. t.activePage = n;
  1725. break
  1726. }
  1727. }
  1728. if (le) {
  1729. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1730. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1731. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1732. l === c - 1 || e <= $[l].end + $[l].half) {
  1733. a = l;
  1734. break
  1735. }
  1736. t.firstItem = De(o) ? o : 0,
  1737. t.centerItem = De(s) ? s : t.firstItem,
  1738. t.lastItem = De(a) ? a : t.centerItem
  1739. }
  1740. return t
  1741. }
  1742. function v(e) {
  1743. xe.extend(ee, d(e))
  1744. }
  1745. function p() {
  1746. var e = G.dest <= G.start
  1747. , t = G.dest >= G.end
  1748. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1749. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1750. ge.is("button,input") && ge.prop("disabled", e),
  1751. me.is("button,input") && me.prop("disabled", t),
  1752. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1753. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1754. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1755. de.is("button,input") && de.prop("disabled", e),
  1756. ue.is("button,input") && ue.prop("disabled", t)),
  1757. le && null != ee.activeItem) {
  1758. var n = 0 === ee.activeItem
  1759. , r = ee.activeItem >= $.length - 1
  1760. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1761. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1762. pe.is("button,input") && pe.prop("disabled", n),
  1763. fe.is("button,input") && fe.prop("disabled", r),
  1764. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1765. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1766. }
  1767. }
  1768. function r(e, t, i) {
  1769. if (e = u(e),
  1770. t = u(t),
  1771. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1772. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1773. var n = e < t ? e : i ? t : t - 1
  1774. , r = t < e ? e : i ? t + 1 : t
  1775. , o = t < e;
  1776. null != ee.activeItem && (e === ee.activeItem ? ye.active = ee.activeItem = i ? o ? t + 1 : t : o ? t : t - 1 : ee.activeItem > n && ee.activeItem < r && (ye.active = ee.activeItem += o ? 1 : -1)),
  1777. a()
  1778. }
  1779. }
  1780. function f(e, t) {
  1781. for (var i = 0, n = ve[e].length; i < n; i++)
  1782. if (ve[e][i] === t)
  1783. return i;
  1784. return -1
  1785. }
  1786. function g() {
  1787. Ie.released && !B.isPaused && B.resume()
  1788. }
  1789. function y(e) {
  1790. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1791. }
  1792. function A() {
  1793. Ie.history[0] = Ie.history[1],
  1794. Ie.history[1] = Ie.history[2],
  1795. Ie.history[2] = Ie.history[3],
  1796. Ie.history[3] = Ie.delta
  1797. }
  1798. function C(e) {
  1799. Ie.released = 0,
  1800. Ie.source = e,
  1801. Ie.slidee = "slidee" === e
  1802. }
  1803. function I(e) {
  1804. var t = "touchstart" === e.type
  1805. , i = e.data.source
  1806. , n = "slidee" === i;
  1807. Ie.init || !t && b(e.target) || !("handle" !== i || F.dragHandle && X.start !== X.end) || n && !(t ? F.touchDragging : F.mouseDragging && e.which < 2) || (t || Pe(e),
  1808. C(i),
  1809. Ie.init = 0,
  1810. Ie.$source = xe(e.target),
  1811. Ie.touch = t,
  1812. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1813. Ie.initX = Ie.pointer.pageX,
  1814. Ie.initY = Ie.pointer.pageY,
  1815. Ie.initPos = n ? G.cur : X.cur,
  1816. Ie.start = +new Date,
  1817. Ie.time = 0,
  1818. Ie.path = 0,
  1819. Ie.delta = 0,
  1820. Ie.locked = 0,
  1821. Ie.history = [0, 0, 0, 0],
  1822. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1823. We.on(t ? qe : Ye, E),
  1824. B.pause(1),
  1825. (n ? U : j).addClass(F.draggedClass),
  1826. L("moveStart"),
  1827. n && (be = setInterval(A, 10)))
  1828. }
  1829. function E(e) {
  1830. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1831. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1832. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1833. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1834. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1835. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1836. Ie.released || !(Ie.path < 1)) {
  1837. if (!Ie.init) {
  1838. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1839. return _();
  1840. Ie.init = 1
  1841. }
  1842. Pe(e),
  1843. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1844. Ie.$source.on(Ze, Oe)),
  1845. Ie.released && (_(),
  1846. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1847. Ie.delta += Ie.swing,
  1848. Ie.tweese = 10 < $e(Ie.swing))),
  1849. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1850. }
  1851. }
  1852. function _() {
  1853. clearInterval(be),
  1854. Ie.released = !0,
  1855. We.off(Ie.touch ? qe : Ye, E),
  1856. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1857. setTimeout(function() {
  1858. Ie.$source.off(Ze, Oe)
  1859. }),
  1860. G.cur === G.dest && Ie.init && L("moveEnd"),
  1861. B.resume(1),
  1862. Ie.init = 0
  1863. }
  1864. function b(e) {
  1865. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1866. }
  1867. function w() {
  1868. B.stop(),
  1869. We.off("mouseup", w)
  1870. }
  1871. function T(e) {
  1872. switch (Pe(e),
  1873. this) {
  1874. case ue[0]:
  1875. case de[0]:
  1876. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1877. We.on("mouseup", w);
  1878. break;
  1879. case pe[0]:
  1880. B.prev();
  1881. break;
  1882. case fe[0]:
  1883. B.next();
  1884. break;
  1885. case ge[0]:
  1886. B.prevPage();
  1887. break;
  1888. case me[0]:
  1889. B.nextPage()
  1890. }
  1891. }
  1892. function x(e) {
  1893. e.originalEvent[He] = B;
  1894. var t = +new Date;
  1895. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1896. ot = t;
  1897. else if (F.scrollBy && G.start !== G.end) {
  1898. var i = function(e) {
  1899. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1900. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1901. le ? (Ue = +new Date,
  1902. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1903. Ee.last = Ue,
  1904. Ee.delta += Ee.curDelta,
  1905. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1906. Ee.delta %= 1),
  1907. Ee.finalDelta) : Ee.curDelta
  1908. }(e.originalEvent);
  1909. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1910. B.slideBy(F.scrollBy * i)
  1911. }
  1912. }
  1913. function S(e) {
  1914. F.clickBar && e.target === W[0] && (Pe(e),
  1915. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1916. }
  1917. function M(e) {
  1918. if (F.keyboardNavBy)
  1919. switch (e.which) {
  1920. case F.horizontal ? 37 : 38:
  1921. Pe(e),
  1922. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1923. break;
  1924. case F.horizontal ? 39 : 40:
  1925. Pe(e),
  1926. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1927. }
  1928. }
  1929. function R(e) {
  1930. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1931. }
  1932. function P() {
  1933. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1934. }
  1935. function O(e) {
  1936. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1937. }
  1938. function L(e, t) {
  1939. if (ve[e]) {
  1940. for (N = ve[e].length,
  1941. Je.length = 0,
  1942. D = 0; D < N; D++)
  1943. Je.push(ve[e][D]);
  1944. for (D = 0; D < N; D++)
  1945. Je[D].call(B, e, t)
  1946. }
  1947. }
  1948. var D, N, F = xe.extend({}, Me.defaults, e), B = this, V = De(s), k = xe(s), U = F.slidee ? xe(F.slidee).eq(0) : k.children().eq(0), H = 0, z = 0, G = {
  1949. start: 0,
  1950. center: 0,
  1951. end: 0,
  1952. cur: 0,
  1953. dest: 0
  1954. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1955. start: 0,
  1956. end: 0,
  1957. cur: 0
  1958. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1959. firstItem: 0,
  1960. lastItem: 0,
  1961. centerItem: 0,
  1962. activeItem: null,
  1963. activePage: 0
  1964. }, te = new Be(k[0]), ie = new Be(U[0]), ne = new Be(W[0]), re = new Be(j[0]), oe = "basic" === F.itemNav, ae = "forceCentered" === F.itemNav, se = "centered" === F.itemNav || ae, le = !V && (oe || se || ae), ce = F.scrollSource ? xe(F.scrollSource) : k, he = F.dragSource ? xe(F.dragSource) : k, ue = xe(F.forward), de = xe(F.backward), pe = xe(F.prev), fe = xe(F.next), ge = xe(F.prevPage), me = xe(F.nextPage), ve = {}, ye = {}, Ae = {}, Ce = {}, Ie = {
  1965. released: 1
  1966. }, Ee = {
  1967. last: 0,
  1968. delta: 0,
  1969. resetTime: 200
  1970. }, _e = 0, be = 0, we = 0, Te = 0;
  1971. V || (s = k[0]),
  1972. B.initialized = 0,
  1973. B.frame = s,
  1974. B.slidee = U[0],
  1975. B.pos = G,
  1976. B.rel = ee,
  1977. B.items = $,
  1978. B.pages = Q,
  1979. B.isPaused = 0,
  1980. B.options = F,
  1981. B.dragging = Ie,
  1982. B.reload = function() {
  1983. a()
  1984. }
  1985. ,
  1986. B.getPos = function(e) {
  1987. if (le) {
  1988. var t = h(e);
  1989. return -1 !== t && $[t]
  1990. }
  1991. var i = U.find(e).eq(0);
  1992. if (i[0]) {
  1993. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  1994. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  1995. return {
  1996. start: n,
  1997. center: n - H / 2 + r / 2,
  1998. end: n - H + r,
  1999. size: r
  2000. }
  2001. }
  2002. return !1
  2003. }
  2004. ,
  2005. B.moveBy = function(e) {
  2006. Ce.speed = e,
  2007. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2008. Ce.startPos = G.cur,
  2009. C("button"),
  2010. Ie.init = 1,
  2011. L("moveStart"),
  2012. ze(Te),
  2013. t())
  2014. }
  2015. ,
  2016. B.stop = function() {
  2017. "button" === Ie.source && (Ie.init = 0,
  2018. Ie.released = 1)
  2019. }
  2020. ,
  2021. B.prev = function() {
  2022. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2023. }
  2024. ,
  2025. B.next = function() {
  2026. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2027. }
  2028. ,
  2029. B.prevPage = function() {
  2030. B.activatePage(ee.activePage - 1)
  2031. }
  2032. ,
  2033. B.nextPage = function() {
  2034. B.activatePage(ee.activePage + 1)
  2035. }
  2036. ,
  2037. B.slideBy = function(e, t) {
  2038. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2039. }
  2040. ,
  2041. B.slideTo = function(e, t) {
  2042. l(e, t)
  2043. }
  2044. ,
  2045. B.toStart = function(e, t) {
  2046. i("start", e, t)
  2047. }
  2048. ,
  2049. B.toEnd = function(e, t) {
  2050. i("end", e, t)
  2051. }
  2052. ,
  2053. B.toCenter = function(e, t) {
  2054. i("center", e, t)
  2055. }
  2056. ,
  2057. B.getIndex = h,
  2058. B.activate = function(e, t) {
  2059. var i = m(e);
  2060. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2061. }
  2062. ,
  2063. B.activatePage = function(e, t) {
  2064. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2065. }
  2066. ,
  2067. B.resume = function(e) {
  2068. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2069. we ? we = clearTimeout(we) : L("resume"),
  2070. we = setTimeout(function() {
  2071. switch (L("cycle"),
  2072. F.cycleBy) {
  2073. case "items":
  2074. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2075. break;
  2076. case "pages":
  2077. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2078. }
  2079. }, F.cycleInterval))
  2080. }
  2081. ,
  2082. B.pause = function(e) {
  2083. e < B.isPaused || (B.isPaused = e || 100,
  2084. we && (we = clearTimeout(we),
  2085. L("pause")))
  2086. }
  2087. ,
  2088. B.toggle = function() {
  2089. B[we ? "pause" : "resume"]()
  2090. }
  2091. ,
  2092. B.set = function(e, t) {
  2093. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2094. }
  2095. ,
  2096. B.add = function(e, t) {
  2097. var i = xe(e);
  2098. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2099. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2100. a()
  2101. }
  2102. ,
  2103. B.remove = function(e) {
  2104. if (le) {
  2105. var t = u(e);
  2106. if (-1 < t) {
  2107. J.eq(t).remove();
  2108. var i = t === ee.activeItem;
  2109. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2110. a(),
  2111. i && (ye.active = null,
  2112. B.activate(ee.activeItem))
  2113. }
  2114. } else
  2115. xe(e).remove(),
  2116. a()
  2117. }
  2118. ,
  2119. B.moveAfter = function(e, t) {
  2120. r(e, t, 1)
  2121. }
  2122. ,
  2123. B.moveBefore = function(e, t) {
  2124. r(e, t)
  2125. }
  2126. ,
  2127. B.on = function(e, t) {
  2128. if ("object" === Re(e))
  2129. for (var i in e)
  2130. e.hasOwnProperty(i) && B.on(i, e[i]);
  2131. else if ("function" === Re(t))
  2132. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2133. ve[n[r]] = ve[n[r]] || [],
  2134. -1 === f(n[r], t) && ve[n[r]].push(t);
  2135. else if ("array" === Re(t))
  2136. for (var a = 0, s = t.length; a < s; a++)
  2137. B.on(e, t[a])
  2138. }
  2139. ,
  2140. B.one = function(t, i) {
  2141. B.on(t, function e() {
  2142. i.apply(B, arguments),
  2143. B.off(t, e)
  2144. })
  2145. }
  2146. ,
  2147. B.off = function(e, t) {
  2148. if (t instanceof Array)
  2149. for (var i = 0, n = t.length; i < n; i++)
  2150. B.off(e, t[i]);
  2151. else
  2152. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2153. if (ve[r[o]] = ve[r[o]] || [],
  2154. null == t)
  2155. ve[r[o]].length = 0;
  2156. else {
  2157. var s = f(r[o], t);
  2158. -1 !== s && ve[r[o]].splice(s, 1)
  2159. }
  2160. }
  2161. ,
  2162. B.destroy = function() {
  2163. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2164. We.off("keydown", M),
  2165. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2166. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2167. Z.empty(),
  2168. V || (k.off("." + He),
  2169. te.restore(),
  2170. ie.restore(),
  2171. ne.restore(),
  2172. re.restore(),
  2173. xe.removeData(s, He)),
  2174. $.length = Q.length = 0,
  2175. ye = {},
  2176. B.initialized = 0,
  2177. B
  2178. }
  2179. ,
  2180. B.init = function() {
  2181. if (!B.initialized) {
  2182. B.on(n);
  2183. var e = ["overflow", "position"]
  2184. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2185. te.save.apply(te, e),
  2186. ne.save.apply(ne, e),
  2187. ie.save.apply(ie, t),
  2188. re.save.apply(re, t);
  2189. var i = j;
  2190. return V || (i = i.add(U),
  2191. k.css("overflow", "hidden"),
  2192. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2193. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2194. i.css({
  2195. position: "absolute"
  2196. })),
  2197. F.forward && ue.on(Ke, T),
  2198. F.backward && de.on(Ke, T),
  2199. F.prev && pe.on(Ze, T),
  2200. F.next && fe.on(Ze, T),
  2201. F.prevPage && ge.on(Ze, T),
  2202. F.nextPage && me.on(Ze, T),
  2203. ce.on(Xe, x),
  2204. W[0] && W.on(Ze, S),
  2205. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2206. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2207. he.on(je, {
  2208. source: "slidee"
  2209. }, I),
  2210. j && j.on(je, {
  2211. source: "handle"
  2212. }, I),
  2213. We.on("keydown", M),
  2214. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2215. k.on("scroll." + He, Le)),
  2216. B.initialized = 1,
  2217. a(!0),
  2218. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2219. B
  2220. }
  2221. }
  2222. }
  2223. function Re(e) {
  2224. return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase() || "object" : typeof e
  2225. }
  2226. function Pe(e, t) {
  2227. e.preventDefault(),
  2228. t && e.stopPropagation()
  2229. }
  2230. function Oe(e) {
  2231. Pe(e, 1),
  2232. xe(this).off(e.type, Oe)
  2233. }
  2234. function Le() {
  2235. this.scrollLeft = 0,
  2236. this.scrollTop = 0
  2237. }
  2238. function De(e) {
  2239. return !isNaN(parseFloat(e)) && isFinite(e)
  2240. }
  2241. function Ne(e, t) {
  2242. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2243. }
  2244. function Fe(e, t, i) {
  2245. return e < t ? t : i < e ? i : e
  2246. }
  2247. function Be(t) {
  2248. var i = {
  2249. style: {},
  2250. save: function() {
  2251. if (t && t.nodeType) {
  2252. for (var e = 0; e < arguments.length; e++)
  2253. i.style[arguments[e]] = t.style[arguments[e]];
  2254. return i
  2255. }
  2256. },
  2257. restore: function() {
  2258. if (t && t.nodeType) {
  2259. for (var e in i.style)
  2260. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2261. return i
  2262. }
  2263. }
  2264. };
  2265. return i
  2266. }
  2267. var Ve, ke, Ue, r, o, He = "sly", ze = e.cancelAnimationFrame || e.cancelRequestAnimationFrame, Ge = e.requestAnimationFrame, We = xe(document), je = "touchstart." + He + " mousedown." + He, Ye = "mousemove." + He + " mouseup." + He, qe = "touchmove." + He + " touchend." + He, Xe = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + He, Ze = "click." + He, Ke = "mousedown." + He, Qe = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], Je = [], $e = Math.abs, et = Math.sqrt, tt = Math.pow, it = Math.round, nt = Math.max, rt = Math.min, ot = 0;
  2268. function t(e) {
  2269. for (var t = 0, i = r.length; t < i; t++) {
  2270. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2271. if (null != o.style[n])
  2272. return n
  2273. }
  2274. }
  2275. We.on(Xe, function(e) {
  2276. var t = e.originalEvent[He]
  2277. , i = +new Date;
  2278. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2279. }),
  2280. function(t) {
  2281. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2282. var t = (new Date).getTime()
  2283. , i = Math.max(0, 16 - (t - r))
  2284. , n = setTimeout(e, i);
  2285. return r = t,
  2286. n
  2287. }
  2288. ;
  2289. var r = (new Date).getTime()
  2290. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2291. ze = function(e) {
  2292. i.call(t, e)
  2293. }
  2294. }(window),
  2295. r = ["", "webkit", "moz", "ms", "o"],
  2296. o = document.createElement("div"),
  2297. Ve = t("transform"),
  2298. ke = t("perspective") ? "translateZ(0) " : "",
  2299. e.Sly = Me,
  2300. xe.fn.sly = function(n, r) {
  2301. var o, a;
  2302. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2303. a = Array.prototype.slice.call(arguments, 1)),
  2304. n = {}),
  2305. this.each(function(e, t) {
  2306. var i = xe.data(t, He);
  2307. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2308. })
  2309. }
  2310. ,
  2311. Me.defaults = {
  2312. slidee: null,
  2313. horizontal: !1,
  2314. itemNav: null,
  2315. itemSelector: null,
  2316. smart: !1,
  2317. activateOn: null,
  2318. activateMiddle: !1,
  2319. scrollSource: null,
  2320. scrollBy: 0,
  2321. scrollHijack: 300,
  2322. scrollTrap: !1,
  2323. dragSource: null,
  2324. mouseDragging: !1,
  2325. touchDragging: !1,
  2326. releaseSwing: !1,
  2327. swingSpeed: .2,
  2328. elasticBounds: !1,
  2329. interactive: null,
  2330. scrollBar: null,
  2331. dragHandle: !1,
  2332. dynamicHandle: !1,
  2333. minHandleSize: 50,
  2334. clickBar: !1,
  2335. syncSpeed: .5,
  2336. pagesBar: null,
  2337. activatePageOn: null,
  2338. pageBuilder: function(e) {
  2339. return "<li>" + (e + 1) + "</li>"
  2340. },
  2341. forward: null,
  2342. backward: null,
  2343. prev: null,
  2344. next: null,
  2345. prevPage: null,
  2346. nextPage: null,
  2347. cycleBy: null,
  2348. cycleInterval: 5e3,
  2349. pauseOnHover: !1,
  2350. startPaused: !1,
  2351. moveBy: 300,
  2352. speed: 0,
  2353. easing: "swing",
  2354. startAt: null,
  2355. keyboardNavBy: null,
  2356. draggedClass: "dragged",
  2357. activeClass: "active",
  2358. disabledClass: "disabled"
  2359. }
  2360. }(jQuery, window),
  2361. function o(a, s, l) {
  2362. function c(i, e) {
  2363. if (!s[i]) {
  2364. if (!a[i]) {
  2365. var t = "function" == typeof require && require;
  2366. if (!e && t)
  2367. return t(i, !0);
  2368. if (h)
  2369. return h(i, !0);
  2370. var n = new Error("Cannot find module '" + i + "'");
  2371. throw n.code = "MODULE_NOT_FOUND",
  2372. n
  2373. }
  2374. var r = s[i] = {
  2375. exports: {}
  2376. };
  2377. a[i][0].call(r.exports, function(e) {
  2378. var t = a[i][1][e];
  2379. return c(t || e)
  2380. }, r, r.exports, o, a, s, l)
  2381. }
  2382. return s[i].exports
  2383. }
  2384. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2385. c(l[e]);
  2386. return c
  2387. }({
  2388. 1: [function(p, f, e) {
  2389. (function(e) {
  2390. "use strict";
  2391. function t(e) {
  2392. this.player = null,
  2393. this.director = null,
  2394. this.modelManager = null,
  2395. this.container = null,
  2396. this.tagManager = null,
  2397. this.fadeInSpeed = e,
  2398. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2399. }
  2400. var r = p("three")
  2401. , i = p("./util/logger")
  2402. , n = (p("./util/common"),
  2403. p("./enum/PlayerEvents"))
  2404. , o = p("./enum/DirectorEvents")
  2405. , a = p("./settings")
  2406. , s = p("./enum/Viewmode")
  2407. , l = (p("./enum/WarpStyle"),
  2408. p("./enum/BlackoutStyle"),
  2409. p("./enum/ModelManagerEvents"))
  2410. , c = p("./enum/tagEvents")
  2411. , h = p("./util/transitions")
  2412. , u = p("./util/lerp")
  2413. , d = new i(e);
  2414. window.THREE = r,
  2415. t.prototype.init = function(e, t, i, n, r) {
  2416. (window.app = this).player = t,
  2417. this.director = e,
  2418. this.modelManager = i,
  2419. this.tagManager = n,
  2420. this.container = r,
  2421. this.updateModel(),
  2422. this.bindEvents()
  2423. }
  2424. ,
  2425. t.prototype.bindEvents = function() {
  2426. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2427. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2428. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2429. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2430. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2431. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2432. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2433. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2434. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2435. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2436. }
  2437. ,
  2438. t.prototype.updateModel = function() {
  2439. this.model = this.modelManager.getActiveModel()
  2440. }
  2441. ,
  2442. t.prototype.handleWarpStarted = function() {
  2443. this.hidePlayerReticule()
  2444. }
  2445. ,
  2446. t.prototype.ontagActivated = function() {
  2447. this.hidePlayerReticule()
  2448. }
  2449. ,
  2450. t.prototype.onNavigationTotag = function() {
  2451. this.hidePlayerReticule()
  2452. }
  2453. ,
  2454. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2455. var n = this.modelManager.getActiveModel()
  2456. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2457. n.fadePanoMarkers(r),
  2458. n.setMode(t)
  2459. }
  2460. ,
  2461. t.prototype.handlePlayerModeChanged = function(e, t) {
  2462. var i = this.modelManager.getActiveModel()
  2463. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2464. i.setSide(n),
  2465. i.setMode(t)
  2466. }
  2467. ,
  2468. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2469. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2470. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2471. }
  2472. ,
  2473. t.prototype.handleActionInterruption = function() {}
  2474. ,
  2475. t.prototype.handleStartInside = function(e) {
  2476. var t = a[this.player.mode]
  2477. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2478. this.fadeIn(this.fadeInSpeed),
  2479. this.model.alpha = 0,
  2480. this.model.skybox.material.uniforms.opacity.value = 1,
  2481. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2482. var n = this.player.reticule;
  2483. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2484. }
  2485. ,
  2486. t.prototype.handleStartOutside = function(e) {
  2487. this.fadeIn(e)
  2488. }
  2489. ,
  2490. t.prototype.fadeIn = function(e) {
  2491. null != e || (e = 2e3,
  2492. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2493. $(this.container).fadeIn(e)
  2494. }
  2495. ,
  2496. t.prototype.hidePlayerReticule = function() {
  2497. this.player.reticule.hide()
  2498. }
  2499. ,
  2500. f.exports = t
  2501. }
  2502. ).call(this, "/js/DisplayController.js")
  2503. }
  2504. , {
  2505. "./enum/BlackoutStyle": 18,
  2506. "./enum/DirectorEvents": 23,
  2507. "./enum/tagEvents": 32,
  2508. "./enum/ModelManagerEvents": 33,
  2509. "./enum/PlayerEvents": 40,
  2510. "./enum/Viewmode": 51,
  2511. "./enum/WarpStyle": 52,
  2512. "./settings": 166,
  2513. "./util/common": 185,
  2514. "./util/lerp": 188,
  2515. "./util/logger": 189,
  2516. "./util/transitions": 195,
  2517. three: 217
  2518. }],
  2519. 2: [function(e, t, i) {
  2520. "use strict";
  2521. function n() {
  2522. this.baseStartTime = performance.timing.navigationStart,
  2523. this.loadingStartTime = null,
  2524. this.waitingStartTime = null,
  2525. this.appReadyTime = null
  2526. }
  2527. n.prototype.setBaseStartTime = function(e) {
  2528. this.baseStartTime = e || Date.now()
  2529. }
  2530. ,
  2531. n.prototype.setWaitingStartTime = function(e) {
  2532. this.waitingStartTime = e || Date.now()
  2533. }
  2534. ,
  2535. n.prototype.setLoadingStartTime = function(e) {
  2536. this.loadingStartTime = e || Date.now()
  2537. }
  2538. ,
  2539. n.prototype.setAppReadyTime = function(e) {
  2540. this.appReadyTime = e || Date.now()
  2541. }
  2542. ,
  2543. n.prototype.calcFullLoadingTime = function() {
  2544. var e = this.appReadyTime - this.baseStartTime;
  2545. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2546. e
  2547. }
  2548. ,
  2549. t.exports = n
  2550. }
  2551. , {}],
  2552. 3: [function(i, n, e) {
  2553. (function(e) {
  2554. "use strict";
  2555. function a() {
  2556. return 100 * Math.random()
  2557. }
  2558. var t = i("./util/logger")
  2559. , s = i("./util/browser")
  2560. , l = new t(e)
  2561. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2562. initialized: !1,
  2563. init: function(e, t) {
  2564. if (t = t || {},
  2565. !this.initialized) {
  2566. for (var i in this.initialized = !0,
  2567. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2568. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2569. e) {
  2570. var n = i.match("^sc_tilegen_([0-9]+)$");
  2571. n && (c.tilegen = a() < parseInt(n[1]));
  2572. var r = i.match("^sc_imgopt_([0-9]+)$");
  2573. r && (c.imgopt = a() < parseInt(r[1]))
  2574. }
  2575. for (var o in t)
  2576. c[o] = t[o],
  2577. l.debug("A/B override:", o, c[o])
  2578. }
  2579. },
  2580. changeIfTileGenerating: function(e) {
  2581. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2582. e += ""),
  2583. e
  2584. },
  2585. changeIfImageOptimzing: function(e) {
  2586. if(e.includes("blob:http"))return e;//add
  2587. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2588. e += ""),
  2589. e
  2590. },
  2591. tilegen: !1,
  2592. imgopt: !1
  2593. };
  2594. n.exports = c
  2595. }
  2596. ).call(this, "/js/ab.js")
  2597. }
  2598. , {
  2599. "./util/browser": 182,
  2600. "./util/logger": 189
  2601. }],
  2602. 4: [function(u, d, e) {
  2603. (function(e) {
  2604. "use strict";
  2605. function r(n, e, t, i) {
  2606. function r(e) {
  2607. a[e.sid] = !0;
  2608. var t = e.billboard.media && e.billboard.media.type
  2609. , i = {
  2610. tag_id: e.sid,
  2611. tags_visited: Object.keys(a).length,
  2612. tag_count: Object.keys(n.tags).length,
  2613. tag_view_count: ++d,
  2614. has_media: !!t
  2615. };
  2616. t && (i.media_type = t),
  2617. g("tag_opened", i)
  2618. }
  2619. var o, a = {}, s = Date.now() - P, l = null;
  2620. i && (l = Date.now() - window.navigationStart);
  2621. try {
  2622. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2623. } catch (n) {
  2624. o = !1
  2625. }
  2626. var c, h = n.supportsVR;
  2627. h || (c = "VR disabled at the model/account level",
  2628. y.valueFromHash("vr") === w.NONE ? c = "VR disabled, using &vr=0" : y.detectAndroid() ? _.isDeviceSupported(b.Android) || (c = "VR disabled, unsupported Android version") : y.detectIOS() && (_.isDeviceSupported(b.IOS) || (c = "VR disabled, unsupported iOS version"))),
  2629. g("model_loaded", {
  2630. duration: s,
  2631. duration_from_navigation_start: l,
  2632. has_hlr: o,
  2633. has_vr: h,
  2634. vr_reason: c
  2635. });
  2636. var u = 0;
  2637. n.panos.forEach(function(e) {
  2638. e.on("enter", function() {
  2639. f("pano_viewed", {
  2640. pano_id: e.id,
  2641. pano_view_count: ++u,
  2642. alignment_type: e.alignmentType,
  2643. interaction_source: R,
  2644. navigation_source: v
  2645. })
  2646. })
  2647. });
  2648. var d = 0;
  2649. for (var p in n.tags)
  2650. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2651. e.on("tour_auto", function(e) {
  2652. v = "tour_" + e
  2653. }),
  2654. e.on("tour_manual", function(e) {
  2655. R = "gui-" + e,
  2656. v = "tour_manual"
  2657. }),
  2658. t.on(C.InteractionKey, function() {
  2659. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2660. }),
  2661. t.on(C.InteractionDirect, function() {
  2662. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2663. }),
  2664. function(t) {
  2665. I.on(T.OPENED, function() {
  2666. f("showcase_share_intent", {
  2667. pano_id: t.currentPano && t.currentPano.id
  2668. })
  2669. }),
  2670. I.on(T.LINK_CLICKED, function(e) {
  2671. f("showcase_share_action", {
  2672. channel: e.channel,
  2673. pano_id: t.currentPano && t.currentPano.id
  2674. })
  2675. }),
  2676. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2677. f("showcase_share_origin_link_clicked")
  2678. })
  2679. }(e),
  2680. function() {
  2681. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2682. gui_action: "click_vr_button"
  2683. })),
  2684. _.on(S.LAUNCH, function(e) {
  2685. f("showcase_gui", {
  2686. gui_action: "launch_vr",
  2687. vr_platform: e.vr_platform,
  2688. vr_app: e.vr_app
  2689. })
  2690. }),
  2691. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2692. gui_action: "vr_modal_prev"
  2693. })),
  2694. _.on(S.NEXT, function(e) {
  2695. f("showcase_gui", {
  2696. gui_action: e.nextAction
  2697. })
  2698. }),
  2699. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2700. gui_action: "vr_modal_close"
  2701. })),
  2702. _.on(S.falseICECHOSEN, function(e) {
  2703. f("showcase_gui", {
  2704. gui_action: e.name + " "
  2705. })
  2706. }),
  2707. _.on(S.STORE, function(e) {
  2708. f("showcase_gui", {
  2709. gui_action: "launch_store",
  2710. store: e
  2711. })
  2712. })
  2713. }()
  2714. }
  2715. function f(e, t) {
  2716. if (t = t || {},
  2717. i)
  2718. try {
  2719. window.analytics.track(e, s.extendObject(t, c), {
  2720. context: {
  2721. app: {
  2722. name: "showcase",
  2723. version: "2.25.6-0-gd87e5b1"
  2724. },
  2725. screen: {
  2726. width: window.screen.width,
  2727. height: window.screen.height,
  2728. density: window.devicePixelRatio
  2729. }
  2730. }
  2731. })
  2732. } catch (t) {
  2733. console.warn("Failed to send data to segment for " + e)
  2734. }
  2735. }
  2736. function g(e, t) {
  2737. f(e, t = t || {})
  2738. }
  2739. function m(e, t) {
  2740. R = e === C.InteractionGui ? "gui-" + t : e,
  2741. v = "self_guided"
  2742. }
  2743. var v, o, a = (u("three"),
  2744. u("./util/ajax"),
  2745. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2746. u("./enum/Viewmode")), C = u("./enum/ControlEvents"), I = u("./gui/sharing/modal"), E = u("./gui/title/titleBar"), _ = u("./gui/vr/vrModal"), b = u("./enum/VRPlatforms"), w = u("./enum/VROption"), T = u("./gui/sharing/ShareEvents"), x = u("./gui/title/TitleEvents"), S = u("./gui/vr/vrEvent"), M = u("./tag/Billboard/BillboardEvent"), l = new (u("./util/logger"))(e), R = (u("./enum/PlayerEvents"),
  2747. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2748. d.exports = {
  2749. report: function(e, t, i, n) {
  2750. !function(e, t) {
  2751. if (o)
  2752. try {
  2753. o.addEvent(e, s.extendObject({
  2754. host: window.location.host,
  2755. keen: {
  2756. addons: [{
  2757. name: "keen:ua_parser",
  2758. input: {
  2759. ua_string: "user_agent"
  2760. },
  2761. output: "parsed_user_agent"
  2762. }]
  2763. },
  2764. user_agent: "${keen.user_agent}",
  2765. referrer: {
  2766. url: s.normalizeUrl(document.referrer),
  2767. domain: s.domainFromUrl(document.referrer),
  2768. url_original: document.referrer
  2769. },
  2770. embedded: y.inIframe(),
  2771. is_mobile: y.isMobile(),
  2772. version: "2.25.6-0-gd87e5b1"
  2773. }, t))
  2774. } catch (e) {
  2775. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2776. }
  2777. }("Session starts", {
  2778. model: e,
  2779. status: t,
  2780. loadtime: Date.now() - (P || Date.now()),
  2781. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2782. autoplay: i,
  2783. quickstart: n,
  2784. ab_tilegen: a.tilegen,
  2785. ab_imgopt: a.imgopt
  2786. })
  2787. },
  2788. impression: function(e) {
  2789. g("impression", {
  2790. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2791. url_params: (void 0 !== e.immediate && e.immediate,
  2792. window.location.search.substr(1).split("&"))
  2793. })
  2794. },
  2795. initKeen: function(e) {
  2796. return e.token && e.appId ? void (o = new Keen({
  2797. projectId: e.appId,
  2798. writeKey: e.token,
  2799. readKey: "",
  2800. requestType: "xhr"
  2801. })) : void l.warn("no keen token/appId")
  2802. },
  2803. initSegment: function(e) {
  2804. return e.token ? (i = e.token,
  2805. window.analytics.load(e.token),
  2806. c = {
  2807. model_id: e.model,
  2808. start_source: e.startSource,
  2809. autoplay: e.autoplay,
  2810. quickstart: e.quickstart,
  2811. language_tag: t.languageTag,
  2812. is_mobile: y.isMobile(),
  2813. iframe: y.inIframe(),
  2814. aspect_ratio: y.aspectRatio(),
  2815. session_id: h,
  2816. window: {
  2817. width: $("#player").width(),
  2818. height: $("#player").height()
  2819. },
  2820. platform: {
  2821. browser: {
  2822. name: $.ua.browser.name,
  2823. major: $.ua.browser.major,
  2824. version: $.ua.browser.version
  2825. },
  2826. os: {
  2827. name: $.ua.os.name,
  2828. version: $.ua.os.version
  2829. },
  2830. device: {
  2831. vendor: $.ua.device.vendor,
  2832. model: $.ua.device.model,
  2833. type: $.ua.device.type
  2834. }
  2835. }
  2836. },
  2837. n = Math.random() < t.analytics.sessionTrackingRate,
  2838. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2839. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2840. },
  2841. sessionStart: function(e) {
  2842. l.debug("analytics user_session_start"),
  2843. f("session_started"),
  2844. P = Date.now(),
  2845. window.addEventListener("unload", function() {
  2846. !function(e, t) {
  2847. if (t = t || {},
  2848. navigator.sendBeacon && i)
  2849. try {
  2850. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2851. event: e,
  2852. anonymousId: window.analytics.user().anonymousId(),
  2853. properties: s.extendObject(t, c),
  2854. writeKey: i,
  2855. sentAt: Date.now(),
  2856. type: "track",
  2857. context: {
  2858. userAgent: y.userAgent(),
  2859. library: {
  2860. name: "showcase-beacon",
  2861. version: "2.25.6-0-gd87e5b1"
  2862. },
  2863. app: {
  2864. name: "showcase",
  2865. version: "2.25.6-0-gd87e5b1"
  2866. }
  2867. }
  2868. }))
  2869. } catch (e) {
  2870. console.warn("Failed to send async segment request")
  2871. }
  2872. }("session_ended", {
  2873. duration: Date.now() - P
  2874. })
  2875. })
  2876. },
  2877. modelLoaded: function(e, t, i, n) {
  2878. r(e, t, i, n)
  2879. },
  2880. loadComplete: function(e) {
  2881. f("load_times", {
  2882. time_to_app_start: e
  2883. })
  2884. },
  2885. track: function(e, t) {
  2886. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2887. f(e, t))
  2888. },
  2889. trackAlways: function(e, t) {
  2890. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2891. f(e, t)
  2892. },
  2893. getSessionId: function() {
  2894. return h
  2895. },
  2896. updateInteraction: m
  2897. }
  2898. }
  2899. ).call(this, "/js/analytics.js")
  2900. }
  2901. , {
  2902. "./ab": 3,
  2903. "./enum/ControlEvents": 21,
  2904. "./enum/PlayerEvents": 40,
  2905. "./enum/VROption": 47,
  2906. "./enum/VRPlatforms": 49,
  2907. "./enum/Viewmode": 51,
  2908. "./gui/sharing/ShareEvents": 76,
  2909. "./gui/sharing/modal": 77,
  2910. "./gui/title/TitleEvents": 80,
  2911. "./gui/title/titleBar": 82,
  2912. "./gui/vr/vrEvent": 85,
  2913. "./gui/vr/vrModal": 87,
  2914. "./localization/localize": 108,
  2915. "./tag/Billboard/BillboardEvent": 120,
  2916. "./settings": 166,
  2917. "./util/ajax": 181,
  2918. "./util/browser": 182,
  2919. "./util/common": 185,
  2920. "./util/logger": 189,
  2921. three: 217
  2922. }],
  2923. 5: [function(e, t, i) {
  2924. "use strict";
  2925. function n() {
  2926. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2927. this.controls = null
  2928. }
  2929. var r = e("three")
  2930. , o = e("../constants")
  2931. , a = e("../util/cameraLight");
  2932. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2933. this.aspect = e,
  2934. this.updateProjectionMatrix()
  2935. }
  2936. ,
  2937. t.exports = n
  2938. }
  2939. , {
  2940. "../constants": 8,
  2941. "../util/cameraLight": 184,
  2942. three: 217
  2943. }],
  2944. 6: [function(e, t, i) {
  2945. "use strict";
  2946. function n() {
  2947. var e = $("#player").width() / $("#player").height();
  2948. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2949. this.controls = null,
  2950. this.updateAspect(e)
  2951. }
  2952. var r = e("three")
  2953. , o = e("../constants");
  2954. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2955. this.aspect = e,
  2956. this.top = o.orthoBase / e,
  2957. this.bottom = -o.orthoBase / e,
  2958. this.updateProjectionMatrix()
  2959. }
  2960. ,
  2961. t.exports = n
  2962. }
  2963. , {
  2964. "../constants": 8,
  2965. three: 217
  2966. }],
  2967. 7: [function(e, t, i) {
  2968. "use strict";
  2969. function n() {
  2970. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2971. this.controls = null
  2972. }
  2973. var r = e("three")
  2974. , o = e("../settings")
  2975. , a = e("../util/cameraLight");
  2976. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2977. this.aspect = e,
  2978. this.updateProjectionMatrix()
  2979. }
  2980. ,
  2981. t.exports = n
  2982. }
  2983. , {
  2984. "../settings": 166,
  2985. "../util/cameraLight": 184,
  2986. three: 217
  2987. }],
  2988. 8: [function(e, t, i) {
  2989. "use strict";
  2990. t.exports = {
  2991. signedUrlDefaultExpireTime: 24e4,
  2992. signedUrlCheckInterval: 1e4,
  2993. signedUrlRefreshBuffer: 15e3,
  2994. dollhouseFOV: 70,
  2995. dollhouseNear: 1,
  2996. dollhouseFar: 5e3,
  2997. insideFOV: 70,
  2998. insideFOVMax: 120,
  2999. insideNear: .1,
  3000. insideFar: 5e3,
  3001. insideLookSpeed: .12,
  3002. insideLookLimitUp: 40,
  3003. insideLookLimitDown: -40,
  3004. orthoNear: 1,
  3005. orthoFar: 5e3,
  3006. orthoBase: 10,
  3007. narrowLandscapeHeight: 290,
  3008. reallyNarrowLandscapeHeight: 250,
  3009. visionTilingStartDate: new Date("8/26/2016"),
  3010. visionTilingStartVersion: "1.1.407.13667",
  3011. windowHeightHighQualityThreshold: 900,
  3012. tourStepDelayDefault: 3500,
  3013. tourStepDelaySlideShow: 5e3,
  3014. workshopApsect: 9 / 16,
  3015. highQualityMaxZoom: 2,
  3016. ultraHighQualityMaxZoom: 3
  3017. }
  3018. }
  3019. , {}],
  3020. 9: [function(e, t, i) {
  3021. "use strict";
  3022. function n() {
  3023. this.activeControl = null,
  3024. this.controls = {},
  3025. this.cameras = {}
  3026. }
  3027. var a = e("./PanoramaControls")
  3028. , s = e("./DollhouseControls")
  3029. , l = e("./FloorplanControls")
  3030. , c = e("../cameras/PanoramaCamera")
  3031. , h = e("../cameras/DollhouseCamera")
  3032. , u = e("../cameras/FloorplanCamera")
  3033. , r = e("events").EventEmitter
  3034. , d = e("../enum/ControlEvents")
  3035. , o = e("../enum/ModelManagerEvents")
  3036. , p = e("../enum/Viewmode")
  3037. , f = e("../settings");
  3038. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3039. this.setUpControls(),
  3040. this.bindEvents(e, t)
  3041. }
  3042. ,
  3043. n.prototype.activateControls = function(e) {
  3044. this.activeControl && (this.activeControl.reset(),
  3045. this.activeControl.enabled = !1),
  3046. this.controls[e] && (this.controls[e].enabled = !0),
  3047. this.activeControl = this.controls[e]
  3048. }
  3049. ,
  3050. n.prototype.setUpControls = function() {
  3051. var i = {}
  3052. , n = {}
  3053. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3054. , r = [c, h, u]
  3055. , o = [a, s, l];
  3056. e.forEach(function(e, t) {
  3057. i[e] = new r[t],
  3058. n[e] = new o[t](i[e]),
  3059. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3060. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3061. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3062. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3063. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3064. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3065. }
  3066. .bind(this)),
  3067. this.controls = n,
  3068. this.cameras = i
  3069. }
  3070. ,
  3071. n.prototype.bindEvents = function(e, t) {
  3072. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3073. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3074. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3075. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3076. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3077. passive: !1
  3078. }),
  3079. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3080. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3081. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3082. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3083. e.addEventListener("contextmenu", function(e) {
  3084. e.preventDefault()
  3085. }),
  3086. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3087. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3088. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3089. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3090. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3091. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3092. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3093. t.on(o.ActiveModelChanged, function(e) {
  3094. this.setModelForControls(e.model)
  3095. }
  3096. .bind(this))
  3097. }
  3098. ,
  3099. n.prototype.setModelForControls = function(e) {
  3100. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3101. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3102. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3103. this.controls[e].setBounds(t)
  3104. }
  3105. .bind(this))
  3106. }
  3107. ,
  3108. n.prototype.onMouseDown = function(e) {
  3109. e.preventDefault(),
  3110. this.activeControl && this.activeControl.onMouseDown(e)
  3111. }
  3112. ,
  3113. n.prototype.onMouseMove = function(e) {
  3114. e.preventDefault(),
  3115. this.activeControl && this.activeControl.onMouseMove(e)
  3116. }
  3117. ,
  3118. n.prototype.onMouseUp = function(e) {
  3119. e.preventDefault(),
  3120. this.activeControl && this.activeControl.onMouseUp(e)
  3121. }
  3122. ,
  3123. n.prototype.onMouseOver = function(e) {
  3124. e.preventDefault(),
  3125. this.activeControl && this.activeControl.onMouseOver(e)
  3126. }
  3127. ,
  3128. n.prototype.onMouseWheel = function(e) {
  3129. e.preventDefault(),
  3130. this.activeControl && this.activeControl.onMouseWheel(e)
  3131. }
  3132. ,
  3133. n.prototype.onTouchStart = function(e) {
  3134. e.preventDefault(),
  3135. this.activeControl && this.activeControl.onTouchStart(e),
  3136. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3137. $("#hotListContent ul .active").removeClass("active"),
  3138. $("#hotList")[0].classList.remove("active")
  3139. }
  3140. ,
  3141. n.prototype.onTouchMove = function(e) {
  3142. e.preventDefault(),
  3143. this.activeControl && this.activeControl.onTouchMove(e)
  3144. }
  3145. ,
  3146. n.prototype.onTouchEnd = function(e) {
  3147. e.preventDefault(),
  3148. this.activeControl && this.activeControl.onTouchEnd(e)
  3149. }
  3150. ,
  3151. n.prototype.onPointerDown = function(e) {
  3152. if (e.preventDefault(),
  3153. this.activeControl)
  3154. switch (e.pointerType) {
  3155. case "mouse":
  3156. this.activeControl.onMouseDown(e);
  3157. break;
  3158. default:
  3159. this.activeControl.onPointerDown(e)
  3160. }
  3161. }
  3162. ,
  3163. n.prototype.onPointerMove = function(e) {
  3164. if (e.preventDefault(),
  3165. this.activeControl)
  3166. switch (e.pointerType) {
  3167. case "mouse":
  3168. this.activeControl.onMouseMove(e);
  3169. break;
  3170. default:
  3171. this.activeControl.onPointerMove(e)
  3172. }
  3173. }
  3174. ,
  3175. n.prototype.onPointerUp = function(e) {
  3176. if (e.preventDefault(),
  3177. this.activeControl)
  3178. switch (e.pointerType) {
  3179. case "mouse":
  3180. this.activeControl.onMouseUp(e);
  3181. break;
  3182. default:
  3183. this.activeControl.onPointerUp(e)
  3184. }
  3185. }
  3186. ,
  3187. n.prototype.onPointerCancel = function(e) {
  3188. e.preventDefault(),
  3189. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3190. }
  3191. ,
  3192. n.prototype.onKeyDown = function(e) {
  3193. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3194. this.activeControl && this.activeControl.onKeyDown(e))
  3195. }
  3196. ,
  3197. n.prototype.onKeyUp = function(e) {
  3198. e.preventDefault(),
  3199. this.activeControl && this.activeControl.onKeyUp(e)
  3200. }
  3201. ,
  3202. t.exports = n
  3203. }
  3204. , {
  3205. "../cameras/DollhouseCamera": 5,
  3206. "../cameras/FloorplanCamera": 6,
  3207. "../cameras/PanoramaCamera": 7,
  3208. "../enum/ControlEvents": 21,
  3209. "../enum/ModelManagerEvents": 33,
  3210. "../enum/Viewmode": 51,
  3211. "../settings": 166,
  3212. "./DollhouseControls": 10,
  3213. "./FloorplanControls": 11,
  3214. "./PanoramaControls": 13,
  3215. events: 202
  3216. }],
  3217. 10: [function(e, t, i) {
  3218. "use strict";
  3219. function n(e) {
  3220. a.call(this, e),
  3221. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3222. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3223. this.minDistance = o.dollhouseDefault.minDistance,
  3224. this.maxDistance = o.dollhouseDefault.maxDistance,
  3225. this.adjustedMinDistance = this.minDistance,
  3226. this.adjustedMaxDistance = this.maxDistance
  3227. }
  3228. var r = e("three")
  3229. , o = e("../settings")
  3230. , a = e("./OutsideControls");
  3231. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3232. this.camera.updateMatrix();
  3233. var i = this.camera.position.clone().sub(this.target).length();
  3234. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3235. this.panLeft(2 * e * i / $("#player").height()),
  3236. this.panUp(-2 * t * i / $("#player").height())
  3237. }
  3238. ,
  3239. n.prototype.updateZoom = function() {
  3240. return this.offset.length() * this.scale
  3241. }
  3242. ,
  3243. n.prototype.setZoomBounds = function(e) {
  3244. var t = e.min.distanceTo(e.max);
  3245. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3246. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3247. this.minDistance = this.adjustedMinDistance,
  3248. this.maxDistance = this.adjustedMaxDistance
  3249. }
  3250. ,
  3251. n.prototype.resetRanges = function(e, t) {
  3252. e ? (this.minDistance = Math.min(e, this.minDistance),
  3253. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3254. this.maxDistance = this.adjustedMaxDistance),
  3255. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3256. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3257. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3258. }
  3259. ,
  3260. n.prototype.toJSON = function() {
  3261. return a.prototype.toJSON.call(this)
  3262. }
  3263. ,
  3264. t.exports = n
  3265. }
  3266. , {
  3267. "../settings": 166,
  3268. "./OutsideControls": 12,
  3269. three: 217
  3270. }],
  3271. 11: [function(e, t, i) {
  3272. "use strict";
  3273. function n(e) {
  3274. c.call(this, e),
  3275. this.minDistance = 15,
  3276. this.maxDistance = 50,
  3277. this.noRotateUpDown = !0,
  3278. this.minPolarAngle = 0,
  3279. this.maxPolarAngle = 0,
  3280. this.mouseActions[u.LEFT] = h.PAN,
  3281. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3282. this.mouseActions[u.RIGHT] = h.ROTATE,
  3283. this.touchActions[1] = h.PAN,
  3284. this.touchActions[2] = h.ROTATE_DOLLY,
  3285. this.absoluteScale = 1,
  3286. this.currentScale = 1
  3287. }
  3288. var r, o, a, s = e("three"), l = e("../settings"), c = e("./OutsideControls"), h = e("../enum/ControlActions"), u = e("../enum/MouseButton"), d = e("../util/math"), p = e("../util/browser");
  3289. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3290. var t = Math.max(e.x, e.z)
  3291. , i = Math.min(e.x, e.z)
  3292. , n = Math.max(t, i * this.camera.aspect)
  3293. , r = Math.max(i, t * this.camera.aspect);
  3294. this.absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2,
  3295. this.currentScale = this.absoluteScale
  3296. }
  3297. ,
  3298. n.prototype.rotateToView = function(e, t) {
  3299. var i = 0;
  3300. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3301. this.rotateLeft(i),
  3302. this.update(0)
  3303. }
  3304. ,
  3305. n.prototype.pan = function(e, t) {
  3306. this.camera.updateMatrix(),
  3307. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3308. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3309. }
  3310. ,
  3311. n.prototype.updateZoom = function() {
  3312. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3313. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3314. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3315. this.camera.left = -l.orthoBase * this.currentScale,
  3316. this.camera.right = l.orthoBase * this.currentScale,
  3317. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3318. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3319. this.camera.updateProjectionMatrix(),
  3320. this.offset.length()
  3321. }
  3322. ,
  3323. n.prototype.toJSON = (r = new s.Quaternion,
  3324. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3325. a = new s.Quaternion,
  3326. function() {
  3327. var e = c.prototype.toJSON.call(this);
  3328. return r.copy(e.camera_quaternion),
  3329. a.copy(o),
  3330. a.multiply(r),
  3331. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3332. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3333. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3334. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3335. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3336. e
  3337. }
  3338. ),
  3339. t.exports = n
  3340. }
  3341. , {
  3342. "../enum/ControlActions": 20,
  3343. "../enum/MouseButton": 34,
  3344. "../settings": 166,
  3345. "../util/browser": 182,
  3346. "../util/math": 190,
  3347. "./OutsideControls": 12,
  3348. three: 217
  3349. }],
  3350. 12: [function(e, t, i) {
  3351. "use strict";
  3352. function n(e) {
  3353. this.camera = e,
  3354. (this.camera.controls = this).enabled = !1,
  3355. this.target = new a.Vector3,
  3356. this.targetBounds = new a.Box3,
  3357. this.zoomSpeed = 2,//编辑时缩放快一些
  3358. this.minDistance = 0,
  3359. this.maxDistance = 1 / 0,
  3360. this.noRotateUpDown = !1,
  3361. this.rotateSpeed = 1,
  3362. this.keyboardZoomSpeed = 0,
  3363. this.keyPanSpeed = 7,
  3364. this.autoRotate = !1,
  3365. this.autoRotateSpeed = 2,
  3366. this.autoPan = !1,
  3367. this.autoPanPosition = new a.Vector3,
  3368. this.minPolarAngle = a.Math.degToRad(25),
  3369. this.maxPolarAngle = a.Math.degToRad(65),
  3370. this.rotationAcceleration = new a.Vector2,
  3371. this.rotationSpeed = new a.Vector2,
  3372. this.panAcceleration = new a.Vector2,
  3373. this.panSpeed = new a.Vector2,
  3374. this.rotateStart = new a.Vector2,
  3375. this.rotateEnd = new a.Vector2,
  3376. this.rotateDelta = new a.Vector2,
  3377. this.panStart = new a.Vector2,
  3378. this.panEnd = new a.Vector2,
  3379. this.panDelta = new a.Vector2,
  3380. this.panOffset = new a.Vector3,
  3381. this.offset = new a.Vector3,
  3382. this.dollyStart = new a.Vector2,
  3383. this.dollyEnd = new a.Vector2,
  3384. this.dollyDelta = new a.Vector2,
  3385. this.phiDelta = 0,
  3386. this.thetaDelta = 0,
  3387. this.scale = 1,
  3388. this.panVector = new a.Vector3,
  3389. this.lastPosition = new a.Vector3,
  3390. this.state = u.NONE,
  3391. this.mouseActions = {},
  3392. this.mouseActions[d.LEFT] = u.ROTATE,
  3393. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3394. this.mouseActions[d.RIGHT] = u.PAN,
  3395. this.touchActions = {},
  3396. this.touchActions[1] = u.ROTATE,
  3397. this.touchActions[2] = u.PAN_DOLLY,
  3398. this.lastMoveTime = 0,
  3399. this.pointersLimit = 2,
  3400. this.pointers = []
  3401. }
  3402. var r, o, a = e("three"), c = e("../settings"), h = e("../util/common"), s = e("../util/math"), l = e("../enum/Vectors"), u = e("../enum/ControlActions"), d = e("../enum/MouseButton"), p = e("../enum/Keys"), f = e("../enum/ControlEvents"), g = e("events").EventEmitter;
  3403. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3404. this.targetBounds = e
  3405. }
  3406. ,
  3407. n.prototype.isEngaged = function() {
  3408. return this.state !== u.NONE
  3409. }
  3410. ,
  3411. n.prototype.rotateLeft = function(e) {
  3412. void 0 === e && (e = this.getAutoRotationAngle()),
  3413. this.thetaDelta -= e
  3414. }
  3415. ,
  3416. n.prototype.rotateUp = function(e) {
  3417. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3418. this.phiDelta -= e)
  3419. }
  3420. ,
  3421. n.prototype.panLeft = function(e) {
  3422. var t = this.camera.matrix.elements;
  3423. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3424. this.panOffset.multiplyScalar(-e),
  3425. this.panVector.add(this.panOffset)
  3426. }
  3427. ,
  3428. n.prototype.panUp = function(e) {
  3429. var t = this.camera.matrix.elements;
  3430. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3431. this.panOffset.multiplyScalar(-e),
  3432. this.panVector.add(this.panOffset)
  3433. }
  3434. ,
  3435. n.prototype.startRotating = function(e, t) {
  3436. e && this.navRotationAcc("x", e),
  3437. t && this.navRotationAcc("y", t)
  3438. }
  3439. ,
  3440. n.prototype.stopRotating = function(e) {
  3441. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3442. this.navRotationAcc("x", 0),
  3443. this.navRotationAcc("y", 0)
  3444. }
  3445. ,
  3446. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3447. o = new a.Vector3,
  3448. function(e, t) {
  3449. r.copy(this.camera.position),
  3450. void 0 === e && null === e || r.setX(e),
  3451. void 0 === t && null === t || r.setZ(t);
  3452. var i = this.camera.position.distanceTo(this.target)
  3453. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3454. this.targetClamped = !1,
  3455. o.copy(r).addScaledVector(n, i),
  3456. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3457. r.copy(o).addScaledVector(n, -i),
  3458. this.targetClamped = !0),
  3459. this.autoPanPosition.x = r.x,
  3460. this.autoPanPosition.z = r.z,
  3461. this.autoPan && this.stopAutoPanning()
  3462. }
  3463. ),
  3464. n.prototype.stopAutoPanning = function() {
  3465. var e = this.autoPan;
  3466. this.autoPan = !1,
  3467. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3468. }
  3469. ,
  3470. n.prototype.dollyIn = function(e) {
  3471. void 0 === e && (e = this.getZoomScale()),
  3472. this.scale /= e
  3473. }
  3474. ,
  3475. n.prototype.dollyOut = function(e) {
  3476. void 0 === e && (e = this.getZoomScale()),
  3477. this.scale *= e
  3478. }
  3479. ,
  3480. n.prototype.updatePan = function(e) {
  3481. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3482. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3483. this.autoPan) {
  3484. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3485. t.setY(0).clampLength(0, 50 * e),
  3486. this.target.add(t),
  3487. this.camera.position.add(t),
  3488. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3489. this.stopAutoPanning())
  3490. }
  3491. }
  3492. ,
  3493. n.prototype.update = function(e) {
  3494. e = e || 1 / 60,
  3495. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3496. this.rotateLeft(-this.rotationSpeed.x),
  3497. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3498. this.updatePan(e);
  3499. var t = this.camera.position;
  3500. this.offset.copy(t).sub(this.target);
  3501. var i = Math.atan2(this.offset.x, this.offset.z)
  3502. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3503. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3504. i += this.thetaDelta,
  3505. n += this.phiDelta,
  3506. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3507. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3508. var r = this.updateZoom();
  3509. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3510. this.target.add(this.panVector),
  3511. this.targetBounds.clampPoint(this.target, this.target),
  3512. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3513. this.offset.y = r * Math.cos(n),
  3514. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3515. t.copy(this.target).add(this.offset),
  3516. this.camera.lookAt(this.target),
  3517. this.thetaDelta = 0,
  3518. this.phiDelta = 0,
  3519. this.scale = 1,
  3520. this.panVector.set(0, 0, 0),
  3521. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3522. }
  3523. ,
  3524. n.prototype.getAutoRotationAngle = function() {
  3525. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3526. }
  3527. ,
  3528. n.prototype.getZoomScale = function() {
  3529. return Math.pow(.95, this.zoomSpeed)
  3530. }
  3531. ,
  3532. n.prototype.onMouseDown = function(e) {
  3533. if (this.enabled) {
  3534. switch (e.preventDefault(),
  3535. this.stopAutoPanning(),
  3536. this.mouseDown = !0,
  3537. this.state = this.mouseActions[e.button],
  3538. this.state) {
  3539. case u.ROTATE:
  3540. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3541. this.rotationSpeed.set(0, 0);
  3542. break;
  3543. case u.DOLLY:
  3544. this.dollyStart.set(e.clientX, e.clientY);
  3545. break;
  3546. case u.PAN:
  3547. this.panStart.set(e.clientX, e.clientY)
  3548. }
  3549. this.emit(f.InputStart, "mouse")
  3550. }
  3551. }
  3552. ,
  3553. n.prototype.onMouseMove = function(e) {
  3554. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3555. switch (e.preventDefault(),
  3556. this.state) {
  3557. case u.ROTATE:
  3558. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3559. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3560. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3561. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3562. this.rotateStart.copy(this.rotateEnd);
  3563. break;
  3564. case u.DOLLY:
  3565. this.dollyEnd.set(e.clientX, e.clientY),
  3566. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3567. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3568. this.dollyStart.copy(this.dollyEnd);
  3569. break;
  3570. case u.PAN:
  3571. this.panEnd.set(e.clientX, e.clientY),
  3572. this.panDelta.subVectors(this.panEnd, this.panStart),
  3573. this.pan(this.panDelta.x, this.panDelta.y),
  3574. this.panStart.copy(this.panEnd)
  3575. }
  3576. this.emit(f.Move, "mouse"),
  3577. this.lastMoveTime = e.timeStamp,
  3578. this.update()
  3579. }
  3580. }
  3581. ,
  3582. n.prototype.onMouseUp = function(e) {
  3583. this.enabled && (this.mouseDown = !1,
  3584. this.state = u.NONE,
  3585. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3586. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3587. this.update(),
  3588. this.rotationAcceleration.set(0, 0),
  3589. this.rotateDelta.set(0, 0)))
  3590. }
  3591. ,
  3592. n.prototype.onMouseOver = function(e) {
  3593. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3594. }
  3595. ,
  3596. n.prototype.onMouseWheel = function(e) {
  3597. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3598. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3599. this.update())
  3600. }
  3601. ,
  3602. n.prototype.onKeyDown = function(e) {
  3603. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3604. this.handleKeyDown(e.which)))
  3605. }
  3606. ,
  3607. n.prototype.navRotationAcc = function(e, t) {
  3608. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3609. }
  3610. ,
  3611. n.prototype.navPanAcc = function(e, t) {
  3612. this.stopAutoPanning(),
  3613. this.panAcceleration[e] = t
  3614. }
  3615. ,
  3616. n.prototype.handleKeyDown = function(e) {
  3617. var t = !0;
  3618. switch (e) {
  3619. case p.UPARROW:
  3620. case p.I:
  3621. this.navRotationAcc("y", 1);
  3622. break;
  3623. case p.DOWNARROW:
  3624. case p.K:
  3625. this.navRotationAcc("y", -1);
  3626. break;
  3627. case p.LEFTARROW:
  3628. case p.J:
  3629. this.navRotationAcc("x", -1);
  3630. break;
  3631. case p.RIGHTARROW:
  3632. case p.L:
  3633. this.navRotationAcc("x", 1);
  3634. break;
  3635. case p.W:
  3636. this.navPanAcc("y", 1);
  3637. break;
  3638. case p.S:
  3639. this.navPanAcc("y", -1);
  3640. break;
  3641. case p.A:
  3642. this.navPanAcc("x", -1);
  3643. break;
  3644. case p.D:
  3645. this.navPanAcc("x", 1);
  3646. break;
  3647. default:
  3648. t = !1
  3649. }
  3650. t && this.emit(f.Move, "key")
  3651. }
  3652. ,
  3653. n.prototype.onKeyUp = function(e) {
  3654. this.enabled && (e.preventDefault(),
  3655. e.stopPropagation(),
  3656. this.handleKeyUp(e.which))
  3657. }
  3658. ,
  3659. n.prototype.handleKeyUp = function(e) {
  3660. switch (e) {
  3661. case p.I:
  3662. case p.K:
  3663. case p.UPARROW:
  3664. case p.DOWNARROW:
  3665. this.keyboardZoomSpeed = 0,
  3666. this.rotationAcceleration.y = 0;
  3667. break;
  3668. case p.J:
  3669. case p.L:
  3670. case p.LEFTARROW:
  3671. case p.RIGHTARROW:
  3672. this.rotationAcceleration.x = 0;
  3673. break;
  3674. case p.S:
  3675. case p.W:
  3676. this.panAcceleration.y = 0;
  3677. break;
  3678. case p.A:
  3679. case p.D:
  3680. this.panAcceleration.x = 0
  3681. }
  3682. }
  3683. ,
  3684. n.prototype.onTouchStart = function(i) {
  3685. if (this.enabled || this.state === u.NONE) {
  3686. i.preventDefault(),
  3687. i.stopPropagation(),
  3688. this.stopAutoPanning();
  3689. var e = function() {
  3690. if (2 === i.touches.length) {
  3691. var e = i.touches[0].pageX - i.touches[1].pageX
  3692. , t = i.touches[0].pageY - i.touches[1].pageY;
  3693. this.dollyStart.set(e, t)
  3694. }
  3695. }
  3696. .bind(this)
  3697. , t = function() {
  3698. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3699. }
  3700. .bind(this)
  3701. , n = function() {
  3702. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3703. }
  3704. .bind(this);
  3705. switch (this.state = this.touchActions[i.touches.length],
  3706. this.state) {
  3707. case u.PAN_DOLLY:
  3708. e();
  3709. case u.PAN:
  3710. t();
  3711. break;
  3712. case u.ROTATE_DOLLY:
  3713. e();
  3714. case u.ROTATE:
  3715. n()
  3716. }
  3717. this.rotationSpeed.set(0, 0),
  3718. this.emit(f.InputStart, "touch")
  3719. }
  3720. }
  3721. ,
  3722. n.prototype.onTouchMove = function(a) {
  3723. if (this.enabled && this.state !== u.NONE) {
  3724. a.preventDefault(),
  3725. a.stopPropagation();
  3726. var s = function() {
  3727. var e = a.touches[0].pageX - a.touches[1].pageX
  3728. , t = a.touches[0].pageY - a.touches[1].pageY;
  3729. this.dollyEnd.set(e, t);
  3730. var i = this.dollyStart.length() - this.dollyEnd.length();
  3731. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3732. this.dollyStart.copy(this.dollyEnd)
  3733. }
  3734. .bind(this)
  3735. , e = function() {
  3736. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3737. this.panDelta.subVectors(this.panEnd, this.panStart),
  3738. this.pan(this.panDelta.x, this.panDelta.y),
  3739. this.panStart.copy(this.panEnd),
  3740. this.rotateDelta.set(0, 0)
  3741. }
  3742. .bind(this)
  3743. , l = function() {
  3744. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3745. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3746. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3747. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3748. this.rotateStart.copy(this.rotateEnd)
  3749. }
  3750. .bind(this)
  3751. , t = function() {
  3752. if (2 === a.touches.length) {
  3753. var e = window.devicePixelRatio || 1
  3754. , t = a.touches[1].pageX - a.touches[0].pageX
  3755. , i = a.touches[1].pageY - a.touches[0].pageY
  3756. , n = Math.sqrt(t * t + i * i);
  3757. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3758. this.state = u.DOLLY,
  3759. s();
  3760. else {
  3761. var r = h.average(a.touches, "pageX")
  3762. , o = h.average(a.touches, "pageY");
  3763. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3764. this.rotateStart.set(r, o),
  3765. l())
  3766. }
  3767. }
  3768. }
  3769. .bind(this);
  3770. switch (this.state) {
  3771. case u.PAN_DOLLY:
  3772. s();
  3773. case u.PAN:
  3774. e();
  3775. break;
  3776. case u.ROTATE_DOLLY:
  3777. t();
  3778. break;
  3779. case u.DOLLY:
  3780. s();
  3781. break;
  3782. case u.ROTATE:
  3783. l();
  3784. break;
  3785. default:
  3786. this.state = u.NONE
  3787. }
  3788. this.lastMoveTime = a.timeStamp,
  3789. this.emit(f.Move, "touch")
  3790. }
  3791. }
  3792. ,
  3793. n.prototype.onTouchEnd = function(e) {
  3794. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3795. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3796. this.state = u.NONE,
  3797. this.update(),
  3798. this.rotationAcceleration.set(0, 0),
  3799. this.rotateDelta.set(0, 0))
  3800. }
  3801. ,
  3802. n.prototype.onPointerDown = function(e) {
  3803. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3804. id: e.pointerId,
  3805. pageX: e.pageX,
  3806. pageY: e.pageY
  3807. }),
  3808. e.touches = this.pointers,
  3809. this.onTouchStart(e)),
  3810. this.emit(f.InputStart, "pointer"))
  3811. }
  3812. ,
  3813. n.prototype.onPointerMove = function(t) {
  3814. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3815. t.pointerId === e.id && (e.pageX = t.pageX,
  3816. e.pageY = t.pageY)
  3817. }),
  3818. t.touches = this.pointers,
  3819. this.onTouchMove(t))
  3820. }
  3821. ,
  3822. n.prototype.onPointerUp = function(i) {
  3823. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3824. i.pointerId === e.id && this.pointers.splice(t, 1)
  3825. }
  3826. .bind(this)),
  3827. i.touches = this.pointers,
  3828. this.onTouchEnd(i))
  3829. }
  3830. ,
  3831. n.prototype.reset = function() {
  3832. this.state = u.NONE,
  3833. this.stopAutoPanning(),
  3834. this.rotationSpeed.set(0, 0),
  3835. this.rotationAcceleration.set(0, 0),
  3836. this.panSpeed.set(0, 0),
  3837. this.panAcceleration.set(0, 0)
  3838. }
  3839. ,
  3840. n.prototype.toJSON = function() {
  3841. return {
  3842. camera_position: {
  3843. x: s.toPrecision(this.camera.position.x, 4),
  3844. y: s.toPrecision(this.camera.position.y, 4),
  3845. z: s.toPrecision(this.camera.position.z, 4)
  3846. },
  3847. camera_quaternion: {
  3848. x: s.toPrecision(this.camera.quaternion.x, 4),
  3849. y: s.toPrecision(this.camera.quaternion.y, 4),
  3850. z: s.toPrecision(this.camera.quaternion.z, 4),
  3851. w: s.toPrecision(this.camera.quaternion.w, 4)
  3852. }
  3853. }
  3854. }
  3855. ,
  3856. t.exports = n
  3857. }
  3858. , {
  3859. "../enum/ControlActions": 20,
  3860. "../enum/ControlEvents": 21,
  3861. "../enum/Keys": 30,
  3862. "../enum/MouseButton": 34,
  3863. "../enum/Vectors": 50,
  3864. "../settings": 166,
  3865. "../util/common": 185,
  3866. "../util/math": 190,
  3867. events: 202,
  3868. three: 217
  3869. }],
  3870. 13: [function(u, d, e) {
  3871. (function(e) {
  3872. "use strict";
  3873. function t(e) {
  3874. this.camera = e,
  3875. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3876. this.lookVector = new s.Vector3,
  3877. this.lookSpeed = .05,
  3878. this.rotationAcc = new s.Vector2,
  3879. this.rotationSpeed = new s.Vector2,
  3880. this.lat = 0,
  3881. this.lon = 0,
  3882. this.phi = 0,
  3883. this.theta = 0,
  3884. this.enabled = !1,
  3885. this.locked = !1,
  3886. this.pointer = new s.Vector2(0,0),
  3887. this.rotationHistory = [],
  3888. this.rotationDifference = new s.Vector2,
  3889. this.pointerDragOn = !1,
  3890. this.pointerDragStart = new s.Vector2(0,0),
  3891. this.pinchDistance = 0,
  3892. this.moveStart = new s.Vector2,
  3893. this.moveTolerance = .01,
  3894. this.pointersLimit = 2,
  3895. this.pointers = []
  3896. }
  3897. var s = u("three")
  3898. , i = u("../util/logger")
  3899. , n = u("../settings")
  3900. , r = u("../util/common")
  3901. , o = u("../util/math")
  3902. , a = (u("../enum/Vectors"),
  3903. u("../enum/MouseButton"))
  3904. , l = u("../enum/Keys")
  3905. , c = u("../enum/ControlEvents")
  3906. , h = u("events").EventEmitter;
  3907. new i(e),
  3908. (t.prototype = Object.create(h.prototype)).usable = function() {
  3909. return this.enabled && !this.locked
  3910. }
  3911. ,
  3912. t.prototype.lookAt = function(e) {
  3913. var t = this.camera.position.clone().sub(e)
  3914. , i = Math.atan(t.z / t.x);
  3915. i += t.x < 0 ? Math.PI : 0,
  3916. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3917. this.lon = s.Math.radToDeg(i) + 180;
  3918. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3919. , r = Math.atan(t.y / n);
  3920. this.lat = -s.Math.radToDeg(r)
  3921. }
  3922. ,
  3923. t.prototype.startRotationFrom = function(e, t) {
  3924. o.convertScreenPositionToNDC(e, t, this.pointer),
  3925. this.pointerDragOn = !0,
  3926. this.pointerDragStart.copy(this.pointer),
  3927. this.moveStart.copy(this.pointer),
  3928. this.rotationHistory = [],
  3929. this.rotationSpeed.set(0, 0)
  3930. }
  3931. ,
  3932. t.prototype.onMouseOver = function(e) {
  3933. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3934. }
  3935. ,
  3936. t.prototype.onTouchStart = function(e) {
  3937. if (this.usable()) {
  3938. switch (e.preventDefault(),
  3939. e.stopPropagation(),
  3940. e.touches.length) {
  3941. case 1:
  3942. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3943. break;
  3944. case 2:
  3945. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3946. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3947. this.pinchDistance = Math.sqrt(t * t + i * i)
  3948. }
  3949. this.emit(c.InputStart, "touch")
  3950. }
  3951. }
  3952. ,
  3953. t.prototype.onPointerDown = function(e) {
  3954. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3955. id: e.pointerId,
  3956. clientX: e.clientX,
  3957. clientY: e.clientY
  3958. }),
  3959. e.touches = this.pointers,
  3960. this.onTouchStart(e),
  3961. this.emit(c.InputStart, "pointer"))
  3962. }
  3963. ,
  3964. t.prototype.onMouseDown = function(e) {
  3965. if (this.usable()) {
  3966. switch (e.preventDefault(),
  3967. e.stopPropagation(),
  3968. e.button) {
  3969. case a.LEFT:
  3970. this.startRotationFrom(e.clientX, e.clientY)
  3971. }
  3972. this.emit(c.InputStart, "mouse")
  3973. }
  3974. }
  3975. ,
  3976. t.prototype.updateRotation = function() {
  3977. if (this.usable() && this.pointerDragOn) {
  3978. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  3979. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  3980. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  3981. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  3982. , r = Math.atan2(e.y, i)
  3983. , o = Math.atan2(t.y, n);
  3984. this.rotationDifference.y = s.Math.radToDeg(r - o),
  3985. e.y = 0,
  3986. t.y = 0;
  3987. var a = Math.acos(e.dot(t) / e.length() / t.length());
  3988. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  3989. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  3990. this.pointerDragStart.copy(this.pointer)
  3991. }
  3992. }
  3993. ,
  3994. t.prototype.onMouseMove = function(e) {
  3995. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  3996. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(c.Move, "mouse"))
  3997. }
  3998. ,
  3999. t.prototype.onTouchMove = function(e) {
  4000. if (this.usable())
  4001. switch (this.emit(c.Move, "touch"),
  4002. e.touches.length) {
  4003. case 1:
  4004. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4005. break;
  4006. case 2:
  4007. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4008. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4009. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4010. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4011. this.emit(c.Pinch, n),
  4012. this.pinchDistance -= n)
  4013. }
  4014. }
  4015. ,
  4016. t.prototype.onPointerMove = function(t) {
  4017. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4018. t.pointerId === e.id && (e.clientX = t.clientX,
  4019. e.clientY = t.clientY)
  4020. }),
  4021. t.touches = this.pointers,
  4022. this.onTouchMove(t))
  4023. }
  4024. ,
  4025. t.prototype.endRotation = function() {
  4026. this.pointerDragOn = !1;
  4027. var e = r.averageVectors(this.rotationHistory);
  4028. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4029. }
  4030. ,
  4031. t.prototype.onTouchEnd = function(e) {
  4032. this.usable() && (e.preventDefault(),
  4033. e.stopPropagation(),
  4034. this.endRotation())
  4035. }
  4036. ,
  4037. t.prototype.onMouseUp = function(e) {
  4038. this.usable() && (e.preventDefault(),
  4039. e.stopPropagation(),
  4040. this.endRotation())
  4041. }
  4042. ,
  4043. t.prototype.onPointerUp = function(i) {
  4044. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4045. i.pointerId === e.id && this.pointers.splice(t, 1)
  4046. }
  4047. .bind(this)),
  4048. i.touches = this.pointers,
  4049. this.onTouchEnd(i))
  4050. }
  4051. ,
  4052. t.prototype.update = function(e) {
  4053. for (this.lon,
  4054. this.lat,
  4055. this.updateRotation(),
  4056. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4057. this.rotationHistory.shift();
  4058. this.lon += this.rotationDifference.x,
  4059. this.lat += this.rotationDifference.y,
  4060. this.rotationDifference.set(0, 0),
  4061. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4062. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4063. this.lon += this.rotationSpeed.x * e,
  4064. this.lat += this.rotationSpeed.y * e,
  4065. this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4066. this.phi = s.Math.degToRad(90 - this.lat),
  4067. this.theta = s.Math.degToRad(this.lon),
  4068. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4069. this.lookVector.y = Math.cos(this.phi),
  4070. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4071. this.target.copy(this.lookVector).add(this.camera.position),
  4072. this.camera.lookAt(this.target)
  4073. }
  4074. ,
  4075. t.prototype.onMouseWheel = function(e) {
  4076. if (this.usable()) {
  4077. var t = e.wheelDelta || -e.detail;
  4078. this.emit(c.InteractionDirect),
  4079. this.emit(c.Scroll, t)
  4080. }
  4081. }
  4082. ,
  4083. t.prototype.onKeyDown = function(e) {
  4084. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4085. this.handleKeyDown(e.which)))
  4086. }
  4087. ,
  4088. t.prototype.handleKeyDown = function(e) {
  4089. var t = function(e, t) {
  4090. this.rotationAcc[e] = t
  4091. }
  4092. .bind(this);
  4093. this.emit(c.InteractionKey);
  4094. var i = !0;
  4095. switch (e) {
  4096. case l.LEFTARROW:
  4097. case l.J:
  4098. t("x", -1);
  4099. break;
  4100. case l.RIGHTARROW:
  4101. case l.L:
  4102. t("x", 1);
  4103. break;
  4104. case l.I:
  4105. t("y", 1);
  4106. break;
  4107. case l.K:
  4108. t("y", -1);
  4109. break;
  4110. default:
  4111. i = !1
  4112. }
  4113. i && this.emit(c.Move, "key")
  4114. }
  4115. ,
  4116. t.prototype.onKeyUp = function(e) {
  4117. this.usable() && (e.preventDefault(),
  4118. e.stopPropagation(),
  4119. this.handleKeyUp(e.which))
  4120. }
  4121. ,
  4122. t.prototype.handleKeyUp = function(e) {
  4123. switch (e) {
  4124. case l.LEFTARROW:
  4125. case l.J:
  4126. case l.RIGHTARROW:
  4127. case l.L:
  4128. this.rotationAcc.x = 0;
  4129. break;
  4130. case l.I:
  4131. case l.K:
  4132. this.rotationAcc.y = 0
  4133. }
  4134. }
  4135. ,
  4136. t.prototype.startRotating = function(e, t) {
  4137. e && (this.rotationAcc.x = e),
  4138. t && (this.rotationAcc.y = t)
  4139. }
  4140. ,
  4141. t.prototype.stopRotating = function(e) {
  4142. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4143. this.rotationAcc.set(0, 0)
  4144. }
  4145. ,
  4146. t.prototype.reset = function() {
  4147. this.pointerDragOn = !1,
  4148. this.rotationAcc.set(0, 0),
  4149. this.rotationSpeed.set(0, 0),
  4150. this.pointers = []
  4151. }
  4152. ,
  4153. t.prototype.toJSON = function() {
  4154. return {
  4155. camera_position: {
  4156. x: o.toPrecision(this.camera.position.x, 4),
  4157. y: o.toPrecision(this.camera.position.y, 4),
  4158. z: o.toPrecision(this.camera.position.z, 4)
  4159. },
  4160. camera_quaternion: {
  4161. x: o.toPrecision(this.camera.quaternion.x, 4),
  4162. y: o.toPrecision(this.camera.quaternion.y, 4),
  4163. z: o.toPrecision(this.camera.quaternion.z, 4),
  4164. w: o.toPrecision(this.camera.quaternion.w, 4)
  4165. }
  4166. }
  4167. }
  4168. ,
  4169. t.prototype.setStateFromJSON = function(e) {
  4170. this.camera.position.copy(e.camera_position),
  4171. this.camera.quaternion.copy(e.camera_quaternion)
  4172. }
  4173. ,
  4174. d.exports = t
  4175. }
  4176. ).call(this, "/js/controls/PanoramaControls.js")
  4177. }
  4178. , {
  4179. "../enum/ControlEvents": 21,
  4180. "../enum/Keys": 30,
  4181. "../enum/MouseButton": 34,
  4182. "../enum/Vectors": 50,
  4183. "../settings": 166,
  4184. "../util/common": 185,
  4185. "../util/logger": 189,
  4186. "../util/math": 190,
  4187. events: 202,
  4188. three: 217
  4189. }],
  4190. 14: [function(t, i, e) {
  4191. (function(e) {
  4192. "use strict";
  4193. var c = t("three")
  4194. , h = t("../enum/Viewmode")
  4195. , u = new (t("../util/logger"))(e);
  4196. i.exports = {
  4197. serialize: function(e) {
  4198. return encodeURI(JSON.stringify(e))
  4199. },
  4200. deserialize: function(e) {
  4201. function t(e) {
  4202. return e.reduce(function(e, t) {
  4203. return e && "number" == typeof t && !isNaN(t)
  4204. }, !0)
  4205. }
  4206. try {
  4207. var i = JSON.parse(decodeURI(e))
  4208. , n = {
  4209. mode: h.fromInt(i.camera_mode),
  4210. panoId: i.scan_id,
  4211. position: (new c.Vector3).copy(i.camera_position),
  4212. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4213. zoom: i.ortho_zoom,
  4214. floorVisibility: i.floor_visibility
  4215. }
  4216. , r = n.position;
  4217. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4218. var o = n.quaternion;
  4219. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4220. n
  4221. } catch (i) {
  4222. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4223. try {
  4224. var a = e.split(",")
  4225. , s = {
  4226. x: parseFloat(a[2]),
  4227. y: parseFloat(a[3]),
  4228. z: parseFloat(a[4])
  4229. }
  4230. , l = {
  4231. x: parseFloat(a[5]),
  4232. y: parseFloat(a[6]),
  4233. z: parseFloat(a[7]),
  4234. w: parseFloat(a[8])
  4235. };
  4236. return t([s.x, s.y, s.z]) || (s.x = 0,
  4237. s.y = 0,
  4238. s.z = 0),
  4239. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4240. l.y = 0,
  4241. l.z = 0,
  4242. l.w = 1),
  4243. {
  4244. mode: h.fromInt(a[0]),
  4245. panoId: a[1],
  4246. position: (new c.Vector3).copy(s),
  4247. quaternion: (new c.Quaternion).copy(l)
  4248. }
  4249. } catch (t) {
  4250. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4251. }
  4252. }
  4253. return null
  4254. }
  4255. }
  4256. }
  4257. ).call(this, "/js/controls/serializer.js")
  4258. }
  4259. , {
  4260. "../enum/Viewmode": 51,
  4261. "../util/logger": 189,
  4262. three: 217
  4263. }],
  4264. 15: [function(C, I, e) {
  4265. (function(e) {
  4266. "use strict";
  4267. function t() {
  4268. this.endlessLoop = r.warp.loop,
  4269. this.clock = new i.Clock(!0),
  4270. this.model = null,
  4271. this.player = null,
  4272. this.currentItem = null,
  4273. this.destinationItem = null,
  4274. this.tourIsPlaying = !1,
  4275. this.transitionStage = v.None,
  4276. this.nextFunc = null,
  4277. this.onTheBus = !1,
  4278. this.tourInProgress = !1,
  4279. this.reachSource = null,
  4280. this.interrupted = !1,
  4281. this.nItems = 0,
  4282. this.walkingSectionPaused = !1
  4283. }
  4284. var i = C("three")
  4285. , n = C("./util/logger")
  4286. , r = C("./settings")
  4287. , o = C("./util/transitions")
  4288. , a = C("events").EventEmitter
  4289. , s = C("./enum/Viewmode")
  4290. , l = C("./analytics")
  4291. , c = C("./enum/WarpStyle")
  4292. , h = (o = C("./util/transitions"),
  4293. C("./model/ModelManager"),
  4294. C("./enum/ModelManagerEvents"))
  4295. , u = C("./enum/DirectorEvents")
  4296. , d = C("./enum/PlayerEvents")
  4297. , p = (C("./enum/ControlEvents"),
  4298. C("./enum/BlackoutStyle"))
  4299. , f = C("./enum/PathDiscardMode")
  4300. , g = C("./enum/PathDisplayMode")
  4301. , m = (C("./player"),
  4302. new n(e))
  4303. , v = Object.freeze({
  4304. None: 0,
  4305. Moving: 1,
  4306. Aiming: 2,
  4307. Interlude: 3
  4308. })
  4309. , y = Object.freeze({
  4310. Forward: 1,
  4311. NoChange: 0,
  4312. Backwards: -1
  4313. })
  4314. , A = o.getUniqueId();
  4315. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4316. this.player = e,
  4317. this.modelManager = t,
  4318. this.updateModel(),
  4319. this.resetAll(),
  4320. this.bindEvents()
  4321. }
  4322. ,
  4323. t.prototype.resetAll = function() {
  4324. if (this.currentItem = null,
  4325. this.destinationItem = null,
  4326. this.tourIsPlaying = !1,
  4327. this.bgmReplay(),
  4328. this.transitionStage = v.None,
  4329. this.nextFunc = null,
  4330. this.onTheBus = !1,
  4331. this.reachSource = null,
  4332. this.interrupted = !1,
  4333. this.model) {
  4334. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4335. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4336. } else
  4337. this.defaultWarpStyle = c.BLACK,
  4338. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4339. this.resetSpecialTransition()
  4340. }
  4341. ,
  4342. t.prototype.updateModel = function() {
  4343. this.model = this.modelManager.getActiveModel(),
  4344. this.nItems = this.model.heroLocations.length
  4345. }
  4346. ,
  4347. t.prototype.bindEvents = function() {
  4348. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4349. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4350. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4351. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4352. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4353. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4354. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4355. this.player.once(d.Move, function() {
  4356. o.cancelById(A)
  4357. })
  4358. }
  4359. ,
  4360. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4361. return e === c.WALK && (this.interrupt(p.NONE),
  4362. this.pauseWalkingSection(),
  4363. this.player.fastForwardActivePanoFlight(),
  4364. !0)
  4365. }
  4366. ,
  4367. t.prototype.handlePlayerMove = function(e) {
  4368. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4369. this.emit("update.controls")
  4370. }
  4371. ,
  4372. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4373. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4374. this.emit("update.controls"))
  4375. }
  4376. ,
  4377. t.prototype.handlePlayerModeChanged = function(e, t) {
  4378. this.intermediateState() || e === t || (this.onTheBus = !1,
  4379. this.emit("update.controls"))
  4380. }
  4381. ,
  4382. t.prototype.handlePlayerInputStart = function(e) {
  4383. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4384. }
  4385. ,
  4386. t.prototype.handlePlayerFlyingStarted = function() {
  4387. this.clearWalkingSectionPaused()
  4388. }
  4389. ,
  4390. t.prototype.describe = function() {
  4391. return {
  4392. nItems: this.nItems,
  4393. currentItem: this.currentItem,
  4394. destinationItem: this.destinationItem,
  4395. tourIsPlaying: this.tourIsPlaying,
  4396. onTheBus: this.onTheBus,
  4397. endlessLoop: this.endlessLoop,
  4398. viewMode: this.player.mode,
  4399. inTransition: this._inTransition(),
  4400. transitionStage: this.transitionStage,
  4401. tourInProgress: this.tourInProgress
  4402. }
  4403. }
  4404. ,
  4405. t.prototype._inTransition = function() {
  4406. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4407. }
  4408. ,
  4409. t.prototype.bounceable = function() {
  4410. var e = this.clock.getDelta();
  4411. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4412. }
  4413. ,
  4414. t.prototype.currentMoveDirection = function() {
  4415. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4416. }
  4417. ,
  4418. t.prototype.clearPath = function() {
  4419. this._inTransition() || this.player.path.discardPathObject()
  4420. }
  4421. ,
  4422. t.prototype.allFloors = function() {
  4423. this.model.toggleAllFloors()
  4424. }
  4425. ,
  4426. t.prototype.actionComplete = function(e) {
  4427. if (this.interrupted = !1,
  4428. this.transitionStage = v.None,
  4429. this.resetSpecialTransition(),
  4430. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4431. this.tourIsPlaying || (this.player.disablePreRendering(),
  4432. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4433. this.emit("update.controls"),
  4434. this.nextFunc) {
  4435. var t = this.nextFunc;
  4436. this.nextFunc = null,
  4437. t()
  4438. }
  4439. }
  4440. ,
  4441. t.prototype.awaitCompletion = function(e, t) {
  4442. this.nextFunc = t,
  4443. e()
  4444. }
  4445. ,
  4446. t.prototype.updateSuccessFunction = function(e) {
  4447. this.nextFunc = e
  4448. }
  4449. ,
  4450. t.prototype.interrupt = function(e, t) {
  4451. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4452. this.tourIsPlaying = !1,
  4453. this.bgmReplay(),
  4454. this.interrupted = !0,
  4455. this.nextFunc = null,
  4456. this.emit(u.ActionInterrupted),
  4457. null != e || (e = p.BEGINNING),
  4458. this.player.interruptAndFastForward(e, t),
  4459. !0)
  4460. }
  4461. ,
  4462. t.prototype.wouldInterrupt = function() {
  4463. return this.transitionStage !== v.None
  4464. }
  4465. ,
  4466. t.prototype.intermediateState = function() {
  4467. return this.transitionStage !== v.None
  4468. }
  4469. ,
  4470. t.prototype.isInterrupted = function() {
  4471. return this.interrupted
  4472. }
  4473. ,
  4474. t.prototype.pauseWalkingSection = function() {
  4475. this.walkingSectionPaused = !0
  4476. }
  4477. ,
  4478. t.prototype.clearWalkingSectionPaused = function() {
  4479. this.walkingSectionPaused = !1
  4480. }
  4481. ,
  4482. t.prototype.autoTour = function() {
  4483. var i = Date.now();
  4484. this.model.auxDataPromise.then(function() {
  4485. i = Date.now() - i;
  4486. var e = r.warp.auto
  4487. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4488. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4489. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4490. done: function() {
  4491. this.playTour()
  4492. }
  4493. .bind(this),
  4494. name: "_atr",
  4495. id: A
  4496. })
  4497. }
  4498. .bind(this))
  4499. }
  4500. ,
  4501. t.prototype.atDestinationPano = function() {
  4502. if (!this.player.currentPano || null === this.destinationItem)
  4503. return !1;
  4504. var e = this.player.currentPano.id;
  4505. if (void 0 === e)
  4506. return !1;
  4507. var t = this.model.heroLocations;
  4508. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4509. }
  4510. ,
  4511. t.prototype.redirectToItem = function(e, t) {
  4512. if (null != e)
  4513. if (this.wouldInterrupt())
  4514. if (this.player.mode !== s.TRANSITIONING) {
  4515. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4516. var i = function() {
  4517. o.setTimeout(function() {
  4518. this.setDestinationItem(e),
  4519. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4520. }
  4521. .bind(this), 0)
  4522. }
  4523. .bind(this);
  4524. this.interrupt(p.END, 0),
  4525. this.updateSuccessFunction(i)
  4526. } else
  4527. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4528. else
  4529. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4530. else
  4531. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4532. }
  4533. ,
  4534. t.prototype.useSpecialTransition = function(e) {
  4535. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4536. this.nextWarpStyle = c.BLACK
  4537. }
  4538. ,
  4539. t.prototype.resetSpecialTransition = function() {
  4540. this.nextWarpStyle = this.defaultWarpStyle
  4541. }
  4542. ,
  4543. t.prototype.arrivedAtDestination = function(e) {
  4544. if (this.player.flying || this.player.isWarping())
  4545. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4546. else {
  4547. this.transitionStage = v.Aiming;
  4548. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4549. this.player.model.fadePanoMarkers(0),
  4550. this.awaitCompletion(function() {
  4551. this.resetSpecialTransition(),
  4552. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4553. }
  4554. .bind(this), t)
  4555. }
  4556. }
  4557. ,
  4558. t.prototype.goToDestination = function(e, t, i, n) {
  4559. if (void 0 !== g_data2.tourAudio && null !== g_data2.tourAudio) {
  4560. var r = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4561. if (r && 0 < r.music.length) {
  4562. var o = r.music.includes(g_Prefix.slice(-10)) ? r.music : g_Prefix + r.music;
  4563. g_tourAudio.src = o;
  4564. g_tourAudio.load(),
  4565. g_tourAudio.crossOrigin = "anonymous",
  4566. g_tourAudio.oncanplaythrough = function() {
  4567. g_tourAudio.play();
  4568. if(g_bgAudio && !g_bgAudio.paused){
  4569. manage.switchBgmState(false);
  4570. g_bgAudio.pauseByTour = true
  4571. }
  4572. g_playAudio = g_tourAudio;
  4573. }
  4574. }
  4575. }
  4576. if (this.onTheBus = !0,
  4577. this.emit("update.controls"),
  4578. this.player.updateLastView(),
  4579. n || !this.atDestinationPano())
  4580. if (this.player.flying || this.player.isWarping())
  4581. m.warn("Cannot go to new destination while player is flying or warping.");
  4582. else {
  4583. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4584. , s = null
  4585. , l = null;
  4586. if (a.isPano()) {
  4587. o = window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4588. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o, !0, i, this.actionComplete.bind(this)),
  4589. s = this.arrivedAtDestination.bind(this, !0)
  4590. } else
  4591. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4592. s = this.arrivedAtDestination.bind(this, !1);
  4593. this.transitionStage = v.Moving,
  4594. this.model.fadePanoMarkers(0),
  4595. this.awaitCompletion(function() {
  4596. l()
  4597. }
  4598. .bind(this), s),
  4599. this.emit("update.controls")
  4600. }
  4601. else
  4602. this.arrivedAtDestination(!0)
  4603. }
  4604. ,
  4605. t.prototype.tourInterlude = function() {
  4606. if (l.trackAlways("reach_highlight", {
  4607. reach_source: this.reachSource
  4608. }),
  4609. this.model.fadePanoMarkers(0),
  4610. this.emit("update.controls"),
  4611. this.tourIsPlaying)
  4612. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4613. this.stopTour(),
  4614. this.emit(u.TourEnd),
  4615. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4616. this.transitionStage = v.Interlude,
  4617. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4618. }
  4619. .bind(this), this.goNext.bind(this))
  4620. }
  4621. ,
  4622. t.prototype.playTour = function() {
  4623. if (!this.bounceable())
  4624. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4625. this.tourInProgress = !0,
  4626. this.reachSource = "play",
  4627. this.tourIsPlaying = !0,
  4628. this.wasZoomEnabled = this.player.zoomEnabled,
  4629. this.player.zoomEnabled = !1,
  4630. this.resetSpecialTransition(),
  4631. this.emit("update.controls"),
  4632. this.emit(u.TourStart),
  4633. this.player.enablePreRendering(),
  4634. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4635. this.goToDestination()) : this.goNext()))
  4636. }
  4637. ,
  4638. t.prototype.bgmReplay = function() {
  4639. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4640. g_playAudio = g_bgAudio;
  4641. g_tourAudio && g_tourAudio.pause();
  4642. //window.tourAudio && window.tourAudio.pause();
  4643. manage.switchBgmState(true);
  4644. }
  4645. }
  4646. ,
  4647. t.prototype.stopTour = function() {
  4648. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4649. this.tourIsPlaying = !1,
  4650. this.bgmReplay(),
  4651. this.interrupt(),
  4652. this.clearWalkingSectionPaused(),
  4653. this.resetSpecialTransition(),
  4654. this.emit("update.controls")),
  4655. window.tourAudio && window.tourAudio.pause(),
  4656. g_tourAudio && 0 == g_tourAudio.paused && (g_tourAudio.pause(),
  4657. g_tourAudio.src = "")
  4658. }
  4659. ,
  4660. t.prototype.endTourProgress = function() {
  4661. this.tourInProgress = !1,
  4662. this.emit("update.controls"),
  4663. this.emit(u.TourEnd)
  4664. }
  4665. ,
  4666. t.prototype.goToHighlight = function(e) {
  4667. if (this.wouldInterrupt())
  4668. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4669. else {
  4670. if (m.debug("<tour.goto " + e + ">"),
  4671. this.isInterrupted())
  4672. return;
  4673. this.clearWalkingSectionPaused(),
  4674. this.setDestinationItem(e),
  4675. this.useSpecialTransition("Hilight"),
  4676. this.goToDestination(),
  4677. l.trackAlways("reach_highlight", {
  4678. reach_source: "thumb"
  4679. })
  4680. }
  4681. }
  4682. ,
  4683. t.prototype.prevHighlight = function() {
  4684. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4685. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4686. this.reachSource = "prev",
  4687. this.goPrev()))
  4688. }
  4689. ,
  4690. t.prototype.nextHighlight = function() {
  4691. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4692. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4693. this.reachSource = "next",
  4694. this.goNext()))
  4695. }
  4696. ,
  4697. t.prototype.changeMode = function(e) {
  4698. var t = $.Deferred()
  4699. , i = t.resolve.bind(t)
  4700. , n = t.reject.bind(t);
  4701. if (this.emit(u.StartModeChange),
  4702. !function() {
  4703. return this.clearWalkingSectionPaused(),
  4704. !!this.wouldInterrupt() && (this.interrupt(),
  4705. !0)
  4706. }
  4707. .bind(this)()) {
  4708. switch (e) {
  4709. case s.PANORAMA:
  4710. this.player.mode === s.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4711. break;
  4712. case s.DOLLHOUSE:
  4713. case s.FLOORPLAN:
  4714. this.player.flyToNewMode({
  4715. mode: e
  4716. }).done(i).fail(n);
  4717. break;
  4718. case s.OUTDOOR:
  4719. this.player.model.has360Views && (this.player.mode !== s.PANORAMA || this.player.mode === s.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4720. }
  4721. return t.promise()
  4722. }
  4723. }
  4724. ,
  4725. t.prototype.atEndOfTour = function() {
  4726. return this.currentItem >= this.nItems - 1
  4727. }
  4728. ,
  4729. t.prototype.firstDestination = function() {
  4730. return 0 < this.nItems ? 0 : null
  4731. }
  4732. ,
  4733. t.prototype.finalDestination = function() {
  4734. return 0 < this.nItems ? this.nItems - 1 : null
  4735. }
  4736. ,
  4737. t.prototype.goPrev = function() {
  4738. this.tourAdvance(-1)
  4739. }
  4740. ,
  4741. t.prototype.goNext = function() {
  4742. this.tourAdvance(1)
  4743. }
  4744. ,
  4745. t.prototype.setDestinationItem = function(e) {
  4746. this.destinationItem = e,
  4747. this.emit("update.controls")
  4748. }
  4749. ,
  4750. t.prototype.setCurrentItem = function(e) {
  4751. this.currentItem = e,
  4752. this.emit("update.controls")
  4753. }
  4754. ,
  4755. t.prototype.nextItem = function(e) {
  4756. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4757. }
  4758. ,
  4759. t.prototype.prevItem = function(e) {
  4760. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4761. }
  4762. ,
  4763. t.prototype.tourAdvance = function(e) {
  4764. if (m.debug("tourAdvance(" + e + ")"),
  4765. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4766. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4767. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4768. this.useSpecialTransition("looping back to start")),
  4769. "black" === window.MP_PREFETCHED_MODELDATA.momentTour) {
  4770. var i = this.player.zoomLevel;
  4771. this.player.zoomEnabled = !0;
  4772. var t = function(e, t) {
  4773. this.player.zoomTo((1 - e) * i, !0)
  4774. }
  4775. .bind(this);
  4776. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4777. }
  4778. this.goToDestination()
  4779. }
  4780. ,
  4781. I.exports = t
  4782. }
  4783. ).call(this, "/js/director.js")
  4784. }
  4785. , {
  4786. "./analytics": 4,
  4787. "./enum/BlackoutStyle": 18,
  4788. "./enum/ControlEvents": 21,
  4789. "./enum/DirectorEvents": 23,
  4790. "./enum/ModelManagerEvents": 33,
  4791. "./enum/PathDiscardMode": 38,
  4792. "./enum/PathDisplayMode": 39,
  4793. "./enum/PlayerEvents": 40,
  4794. "./enum/Viewmode": 51,
  4795. "./enum/WarpStyle": 52,
  4796. "./model/ModelManager": 140,
  4797. "./player": 155,
  4798. "./settings": 166,
  4799. "./util/logger": 189,
  4800. "./util/transitions": 195,
  4801. events: 202,
  4802. three: 217
  4803. }],
  4804. 16: [function(e, t, i) {
  4805. "use strict";
  4806. var n = e("three")
  4807. , r = e("./enum/Viewmode")
  4808. , o = (e("./settings"),
  4809. e("./util/transitions"))
  4810. , a = e("./enum/PlayerEvents")
  4811. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4812. , l = new n.ShaderPass(n.VerticalBlurShader);
  4813. l.renderToScreen = !0;
  4814. var c = $("#player").width() / $("#player").height();
  4815. isNaN(c) && (c = 1);
  4816. var h = {
  4817. currentBlur: 0,
  4818. aspect: c,
  4819. blurStrength: 1,
  4820. hblurPass: s,
  4821. vblurPass: l,
  4822. bindEvents: function(e) {
  4823. e.on(a.ModeChanged, function(e, t) {
  4824. e === r.PANORAMA && (o.cancel(h.blur),
  4825. o.cancel(h.addBlur),
  4826. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4827. })
  4828. },
  4829. blur: function(e) {
  4830. var t = (h.currentBlur = e) * h.blurStrength;
  4831. l.uniforms.v.value = t / 512 * h.aspect,
  4832. s.uniforms.h.value = t / 512
  4833. },
  4834. addBlur: function(e) {
  4835. e = Math.max(e, h.currentBlur),
  4836. h.blur(e)
  4837. },
  4838. removeBlur: function(e) {
  4839. e = Math.min(1 - e, h.currentBlur),
  4840. h.blur(e)
  4841. }
  4842. };
  4843. h.blur(0),
  4844. t.exports = h
  4845. }
  4846. , {
  4847. "./enum/PlayerEvents": 40,
  4848. "./enum/Viewmode": 51,
  4849. "./settings": 166,
  4850. "./util/transitions": 195,
  4851. three: 217
  4852. }],
  4853. 17: [function(e, t, i) {
  4854. "use strict";
  4855. t.exports = {
  4856. UNKNOWN: 0,
  4857. ALIGNED: 1,
  4858. UNALIGNED: 2,
  4859. PLACED: 3
  4860. }
  4861. }
  4862. , {}],
  4863. 18: [function(e, t, i) {
  4864. "use strict";
  4865. t.exports = {
  4866. NONE: 0,
  4867. MIDDLE: 1,
  4868. END: 2,
  4869. BEGINNING: 3,
  4870. FADEIN: 4
  4871. }
  4872. }
  4873. , {}],
  4874. 19: [function(e, t, i) {
  4875. "use strict";
  4876. var r = e("three");
  4877. t.exports = {
  4878. newBlue: new r.Color(4967932),
  4879. altBlue: new r.Color(47355),
  4880. tagDefault: new r.Color(223357),
  4881. classicBlue: new r.Color(53759),
  4882. mpYellow: new r.Color(16502016),
  4883. mpOrange: new r.Color(16428055),
  4884. mpBlue: new r.Color(12096),
  4885. mpLtGrey: new r.Color(13751252),
  4886. mpDkGrey: new r.Color(10000019),
  4887. mpRed: new r.Color(12525854),
  4888. mpOrangeDesat: new r.Color(16764529),
  4889. mpBlueDesat: new r.Color(4034734),
  4890. mpRedDesat: new r.Color(14705505),
  4891. white: new r.Color(16777215),
  4892. black: new r.Color(0),
  4893. _desat: function(e, t) {
  4894. var i = t || .3
  4895. , n = (new r.Color).copy(e).getHSL();
  4896. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  4897. },
  4898. _darken: function(e, t) {
  4899. var i = t || .2
  4900. , n = e.getHSL();
  4901. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  4902. }
  4903. }
  4904. }
  4905. , {
  4906. three: 217
  4907. }],
  4908. 20: [function(e, t, i) {
  4909. "use strict";
  4910. t.exports = {
  4911. NONE: -1,
  4912. ROTATE: 0,
  4913. DOLLY: 1,
  4914. PAN: 2,
  4915. ROTATE_DOLLY: 3,
  4916. PAN_DOLLY: 4
  4917. }
  4918. }
  4919. , {}],
  4920. 21: [function(e, t, i) {
  4921. "use strict";
  4922. t.exports = {
  4923. Move: "move",
  4924. InteractionDirect: "interaction.direct",
  4925. InteractionKey: "interaction.key",
  4926. InteractionGui: "interaction.gui",
  4927. FlyInDirection: "fly.direction",
  4928. InputStart: "input.start",
  4929. Pinch: "input.pinch",
  4930. Scroll: "input.scroll",
  4931. AutoPanInterrupt: "autopan.interrupt",
  4932. AutoPanComplete: "autopan.complete",
  4933. AutoPanClamped: "autopan.clamped",
  4934. LongTap: "longtap"
  4935. }
  4936. }
  4937. , {}],
  4938. 22: [function(e, t, i) {
  4939. "use strict";
  4940. t.exports = Object.freeze({
  4941. FORWARD: "FORWARD",
  4942. LEFT: "LEFT",
  4943. RIGHT: "RIGHT",
  4944. BACK: "BACK",
  4945. UP: "UP",
  4946. DOWN: "DOWN"
  4947. })
  4948. }
  4949. , {}],
  4950. 23: [function(e, t, i) {
  4951. "use strict";
  4952. t.exports = {
  4953. ActionInterrupted: "action.interrupted",
  4954. TourStart: "tour.start",
  4955. TourEnd: "tour.end",
  4956. StartModeChange: "mode.startChange"
  4957. }
  4958. }
  4959. , {}],
  4960. 24: [function(e, t, i) {
  4961. "use strict";
  4962. t.exports = Object.freeze({
  4963. None: 0,
  4964. Queued: 1,
  4965. ForceQueued: 2,
  4966. Downloading: 3,
  4967. Downloaded: 4,
  4968. DownloadFailed: 5
  4969. })
  4970. }
  4971. , {}],
  4972. 25: [function(e, t, i) {
  4973. "use strict";
  4974. t.exports = {
  4975. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  4976. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  4977. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  4978. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  4979. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  4980. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  4981. }
  4982. }
  4983. , {}],
  4984. 26: [function(e, t, i) {
  4985. "use strict";
  4986. t.exports = {
  4987. Texture2D: 0,
  4988. TextureCube: 1
  4989. }
  4990. }
  4991. , {}],
  4992. 27: [function(e, t, i) {
  4993. "use strict";
  4994. t.exports = {
  4995. SMALL: "small",
  4996. LARGE: "large"
  4997. }
  4998. }
  4999. , {}],
  5000. 28: [function(e, t, i) {
  5001. "use strict";
  5002. var n = e("./Viewmode")
  5003. , r = {
  5004. LANDING: {},
  5005. NAVIGATION: "navigation",
  5006. MORE_HELP: "moreHelp",
  5007. TOUR_INTERACTION: {}
  5008. };
  5009. r.LANDING[n.PANORAMA] = "panorama.landing",
  5010. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5011. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5012. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5013. r.TOUR_INTERACTION.standard = "standard.tour",
  5014. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5015. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5016. t.exports = r
  5017. }
  5018. , {
  5019. "./Viewmode": 51
  5020. }],
  5021. 29: [function(e, t, i) {
  5022. "use strict";
  5023. var n = {
  5024. UP: 1,
  5025. DOWN: -1,
  5026. LEFT: "L",
  5027. RIGHT: "R",
  5028. FORWARD: "F",
  5029. BACK: "B",
  5030. reverse: {},
  5031. opposite: function(e) {
  5032. return this.reverse[e.toString()]
  5033. }
  5034. };
  5035. n.reverse[n.UP] = n.DOWN,
  5036. n.reverse[n.DOWN] = n.UP,
  5037. n.reverse[n.LEFT] = n.RIGHT,
  5038. n.reverse[n.RIGHT] = n.LEFT,
  5039. n.reverse[n.FORWARD] = n.BACK,
  5040. n.reverse[n.BACK] = n.FORWARD,
  5041. t.exports = n
  5042. }
  5043. , {}],
  5044. 30: [function(e, t, i) {
  5045. "use strict";
  5046. var n = {
  5047. ZERO: 48,
  5048. ONE: 49,
  5049. TWO: 50,
  5050. THREE: 51,
  5051. FOUR: 52,
  5052. FIVE: 53,
  5053. SIX: 54,
  5054. SEVEN: 55,
  5055. EIGHT: 56,
  5056. NINE: 57,
  5057. LEFTARROW: 37,
  5058. UPARROW: 38,
  5059. RIGHTARROW: 39,
  5060. DOWNARROW: 40,
  5061. A: 65,
  5062. B: 66,
  5063. C: 67,
  5064. D: 68,
  5065. E: 69,
  5066. F: 70,
  5067. G: 71,
  5068. H: 72,
  5069. I: 73,
  5070. J: 74,
  5071. K: 75,
  5072. L: 76,
  5073. M: 77,
  5074. N: 78,
  5075. O: 79,
  5076. P: 80,
  5077. Q: 81,
  5078. R: 82,
  5079. S: 83,
  5080. T: 84,
  5081. U: 85,
  5082. V: 86,
  5083. W: 87,
  5084. X: 88,
  5085. Y: 89,
  5086. Z: 90,
  5087. SPACE: 32,
  5088. RETURN: 13,
  5089. SEMICOLON: 186,
  5090. PLUSEQUALS: 187,
  5091. DASHUNDERSCORE: 189,
  5092. OPENBRACKET: 219
  5093. };
  5094. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5095. n.PLUSEQUALS = 61,
  5096. n.DASHUNDERSCORE = 173),
  5097. t.exports = n
  5098. }
  5099. , {
  5100. "../util/browser": 182
  5101. }],
  5102. 31: [function(e, t, i) {
  5103. "use strict";
  5104. t.exports = {
  5105. EN_US: "en-US",
  5106. ES_MX: "es-MX",
  5107. FR_FR: "fr-FR",
  5108. DE_DE: "de-DE",
  5109. RU_RU: "ru-RU",
  5110. CN_CN: "cn-CN",
  5111. JP_JP: "jp-JP"
  5112. }
  5113. }
  5114. , {}],
  5115. 32: [function(e, t, i) {
  5116. "use strict";
  5117. t.exports = {
  5118. TagActivated: "tag.activated",
  5119. TagDismissed: "tag.dismissed",
  5120. TagNavigation: "tag.navigation"
  5121. }
  5122. }
  5123. , {}],
  5124. 33: [function(e, t, i) {
  5125. "use strict";
  5126. t.exports = {
  5127. ModelAdded: "model-added",
  5128. ActiveModelChanged: "active-model-changed"
  5129. }
  5130. }
  5131. , {}],
  5132. 34: [function(e, t, i) {
  5133. "use strict";
  5134. t.exports = {
  5135. LEFT: 0,
  5136. MIDDLE: 1,
  5137. RIGHT: 2
  5138. }
  5139. }
  5140. , {}],
  5141. 35: [function(e, t, i) {
  5142. "use strict";
  5143. t.exports = {
  5144. PanoRenderComplete: "panorama.render.complete",
  5145. TileRenderFailure: "panorama.tile.render.failed",
  5146. TileRenderSuccess: "panorama.tile.render.success",
  5147. TileUploadAttempted: "panorama.tile.upload.attempted",
  5148. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5149. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5150. }
  5151. }
  5152. , {}],
  5153. 36: [function(e, t, i) {
  5154. "use strict";
  5155. t.exports = {
  5156. BASE: 1,
  5157. STANDARD: 2,
  5158. HIGH: 3,
  5159. ULTRAHIGH: 4
  5160. }
  5161. }
  5162. , {}],
  5163. 37: [function(e, t, i) {
  5164. "use strict";
  5165. t.exports = {
  5166. LoadComplete: "panorama.load.complete",
  5167. LoadFailed: "panorama.load.failed",
  5168. TileLoaded: "panorama.tile.loaded"
  5169. }
  5170. }
  5171. , {}],
  5172. 38: [function(e, t, i) {
  5173. "use strict";
  5174. t.exports = Object.freeze({
  5175. Standard: 0,
  5176. Slow: 1,
  5177. Retain: 2
  5178. })
  5179. }
  5180. , {}],
  5181. 39: [function(e, t, i) {
  5182. "use strict";
  5183. t.exports = Object.freeze({
  5184. Show: 0,
  5185. Hide: 1,
  5186. Retain: 2
  5187. })
  5188. }
  5189. , {}],
  5190. 40: [function(e, t, i) {
  5191. "use strict";
  5192. t.exports = {
  5193. Move: "move",
  5194. MoveComplete: "move.complete",
  5195. ModeChanged: "mode.changed",
  5196. ModeChanging: "mode.changing",
  5197. PanoChosen: "pano.chosen",
  5198. ClosestPanoChanging: "closest.pano.changing",
  5199. WarpStarted: "warp.started",
  5200. WarpInterrupted: "warp.interrupted",
  5201. WarpEnded: "warp.ended",
  5202. FlyinFinished: "flyin.finished",
  5203. FlyingStarted: "flying.started",
  5204. FlyingInterrupted: "flying.interrupted",
  5205. FlyingEnded: "flying.ended",
  5206. Ready: "ready",
  5207. StartInside: "start.inside",
  5208. StartOutside: "start.outside",
  5209. ViewChanged: "view.changed",
  5210. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5211. InputStart: "input.start"
  5212. }
  5213. }
  5214. , {}],
  5215. 41: [function(e, t, i) {
  5216. "use strict";
  5217. t.exports = Object.freeze({
  5218. DEFAULT: 0,
  5219. PANOMARKERS: 1,
  5220. RETICULE: 2,
  5221. TAG: 3
  5222. })
  5223. }
  5224. , {}],
  5225. 42: [function(e, t, i) {
  5226. "use strict";
  5227. t.exports = {
  5228. visibleFloor: 1,
  5229. ghostFloor: 3,
  5230. boundingSkybox: 1,
  5231. panoMarker: 2,
  5232. reticule: 3,
  5233. tagStem: 4,
  5234. tagDisc: 5,
  5235. ribbon: 100
  5236. }
  5237. }
  5238. , {}],
  5239. 43: [function(e, t, i) {
  5240. "use strict";
  5241. t.exports = {
  5242. ContextCreated: "scene-renderer-context-created",
  5243. AfterRender: "after-render",
  5244. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5245. }
  5246. }
  5247. , {}],
  5248. 44: [function(e, t, i) {
  5249. "use strict";
  5250. t.exports = {
  5251. IDLE: "idle",
  5252. BROWSE: "browse",
  5253. EXAMINE: "examine"
  5254. }
  5255. }
  5256. , {}],
  5257. 45: [function(e, t, i) {
  5258. "use strict";
  5259. t.exports = {
  5260. TileDownloadSuccess: "tiledownloader.download.success",
  5261. TileDownloadFailure: "tiledownloader.download.failure",
  5262. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5263. }
  5264. }
  5265. , {}],
  5266. 46: [function(e, t, i) {
  5267. "use strict";
  5268. t.exports = {
  5269. CardboardAndroid: "googlevr",
  5270. GearVR: "gearvr",
  5271. CardboardIOS: "googlevrios",
  5272. Cardboard: "googlevr"
  5273. }
  5274. }
  5275. , {}],
  5276. 47: [function(e, t, i) {
  5277. "use strict";
  5278. t.exports = {
  5279. NONE: 0,
  5280. CONTEXTUAL: 1,
  5281. ANDROID: 2
  5282. }
  5283. }
  5284. , {}],
  5285. 48: [function(e, t, i) {
  5286. "use strict";
  5287. var n = {
  5288. Title: 0,
  5289. Cardboard: 1
  5290. }
  5291. , r = {
  5292. Title: 0,
  5293. Cardboard: 1,
  5294. Gear: 2
  5295. };
  5296. [n, r].forEach(function(e) {
  5297. e.pageCount = Object.keys(e).length
  5298. }),
  5299. t.exports.ios = n,
  5300. t.exports.standard = r
  5301. }
  5302. , {}],
  5303. 49: [function(e, t, i) {
  5304. "use strict";
  5305. t.exports = {
  5306. Android: "android",
  5307. IOS: "ios",
  5308. Desktop: "desktop",
  5309. UnsupportedAndroid: "android-unsupported"
  5310. }
  5311. }
  5312. , {}],
  5313. 50: [function(e, t, i) {
  5314. "use strict";
  5315. var n = e("three");
  5316. t.exports = {
  5317. UP: new n.Vector3(0,1,0),
  5318. DOWN: new n.Vector3(0,-1,0),
  5319. LEFT: new n.Vector3(-1,0,0),
  5320. RIGHT: new n.Vector3(1,0,0),
  5321. FORWARD: new n.Vector3(0,0,-1),
  5322. BACK: new n.Vector3(0,0,1)
  5323. }
  5324. }
  5325. , {
  5326. three: 217
  5327. }],
  5328. 51: [function(e, t, i) {
  5329. "use strict";
  5330. var n = e("../exception/ViewmodeConvertException")
  5331. , r = e("./coreViewmodes")
  5332. , o = {
  5333. MESH: "mesh",
  5334. OUTDOOR: "outdoor",
  5335. TRANSITIONING: "transitioning",
  5336. toInt: function(e) {
  5337. switch (e) {
  5338. case this.PANORAMA:
  5339. return 1;
  5340. case this.DOLLHOUSE:
  5341. return 2;
  5342. case this.FLOORPLAN:
  5343. return 3;
  5344. case this.OUTDOOR:
  5345. return 4;
  5346. case this.TRANSITIONING:
  5347. return -1
  5348. }
  5349. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5350. },
  5351. fromInt: function(e) {
  5352. switch (e) {
  5353. case "1":
  5354. case 1:
  5355. return this.PANORAMA;
  5356. case "2":
  5357. case 2:
  5358. return this.DOLLHOUSE;
  5359. case "3":
  5360. case 3:
  5361. return this.FLOORPLAN;
  5362. case "4":
  5363. case 4:
  5364. return this.OUTDOOR
  5365. }
  5366. throw new n("No known conversion for int to viewmode for int: " + e)
  5367. },
  5368. convertWorkshopModeInt: function(e) {
  5369. switch (e) {
  5370. case "0":
  5371. case 0:
  5372. case void 0:
  5373. return this.PANORAMA;
  5374. case "1":
  5375. case 1:
  5376. return this.FLOORPLAN;
  5377. case "2":
  5378. case 2:
  5379. return this.DOLLHOUSE;
  5380. case "3":
  5381. case 3:
  5382. return this.MESH
  5383. }
  5384. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5385. }
  5386. };
  5387. e("../util/common").extendObject(o, r),
  5388. t.exports = o
  5389. }
  5390. , {
  5391. "../exception/ViewmodeConvertException": 58,
  5392. "../util/common": 185,
  5393. "./coreViewmodes": 54
  5394. }],
  5395. 52: [function(e, t, i) {
  5396. "use strict";
  5397. t.exports = {
  5398. BLACK: "black",
  5399. STD: "std",
  5400. WALK: "walk"
  5401. }
  5402. }
  5403. , {}],
  5404. 53: [function(e, t, i) {
  5405. "use strict";
  5406. t.exports = {
  5407. ZoomIn: "zoom.in",
  5408. ZoomOut: "zoom.out",
  5409. ZoomMax: "zoom.max",
  5410. ZoomMin: "zoom.min"
  5411. }
  5412. }
  5413. , {}],
  5414. 54: [function(e, t, i) {
  5415. "use strict";
  5416. t.exports = {
  5417. PANORAMA: "panorama",
  5418. DOLLHOUSE: "dollhouse",
  5419. FLOORPLAN: "floorplan"
  5420. }
  5421. }
  5422. , {}],
  5423. 55: [function(e, t, i) {
  5424. "use strict";
  5425. t.exports = function(e) {
  5426. this.message = e
  5427. }
  5428. }
  5429. , {}],
  5430. 56: [function(e, t, i) {
  5431. "use strict";
  5432. function n(e) {
  5433. r.call(this, e)
  5434. }
  5435. var r = e("./BasicException");
  5436. n.prototype = Object.create(r.prototype),
  5437. t.exports = n
  5438. }
  5439. , {
  5440. "./BasicException": 55
  5441. }],
  5442. 57: [function(e, t, i) {
  5443. "use strict";
  5444. function n(e) {
  5445. r.call(this, e)
  5446. }
  5447. var r = e("./BasicException");
  5448. n.prototype = Object.create(r.prototype),
  5449. t.exports = n
  5450. }
  5451. , {
  5452. "./BasicException": 55
  5453. }],
  5454. 58: [function(e, t, i) {
  5455. "use strict";
  5456. function n(e) {
  5457. r.call(this, e)
  5458. }
  5459. var r = e("./BasicException");
  5460. n.prototype = Object.create(r.prototype),
  5461. t.exports = n
  5462. }
  5463. , {
  5464. "./BasicException": 55
  5465. }],
  5466. 59: [function(a, s, e) {
  5467. (function(e) {
  5468. "use strict";
  5469. var i = a("./util/ajax")
  5470. , n = a("./util/showcase")
  5471. , t = a("./util/logger")
  5472. , r = new t(e)
  5473. , o = {};
  5474. s.exports = {
  5475. loadFeatureFlags: function(e) {
  5476. var t = $.Deferred();
  5477. return i.get(e.urlBase + "", {
  5478. responseType: "json",
  5479. prefetchFrom: "user",
  5480. auth: n.getAuthorizationHeader()
  5481. }).done(function(e) {
  5482. (o = function(e) {
  5483. var t = {};
  5484. if (e) {
  5485. var i = e.flags;
  5486. if (i)
  5487. for (var n in i)
  5488. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5489. return t
  5490. }
  5491. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5492. null
  5493. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5494. }).fail(function() {
  5495. r.debug("Retrieval of feature flags failed."),
  5496. t.reject("loading-failed")
  5497. }),
  5498. t.promise()
  5499. },
  5500. getFlags: function() {
  5501. return o
  5502. },
  5503. updateDependentSettings: function(e, t) {
  5504. (e = e || o).labels && (t.labels.enabled = !0),
  5505. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5506. e.showcase_sdk && (t.sdkInit = !0),
  5507. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5508. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5509. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5510. e.hide_sc_sharing && (t.share.enabled = !1)
  5511. }
  5512. }
  5513. }
  5514. ).call(this, "/js/featureflags.js")
  5515. }
  5516. , {
  5517. "./util/ajax": 181,
  5518. "./util/logger": 189,
  5519. "./util/showcase": 193
  5520. }],
  5521. 60: [function(e, t, i) {
  5522. "use strict";
  5523. var n = (e("../util/common"),
  5524. {
  5525. status: 0,
  5526. set: function(e) {
  5527. if (isNaN(e))
  5528. return !1;
  5529. var t = $(".progressbar");
  5530. e < 0 && (e = 0),
  5531. 100 < e && (e = 100);
  5532. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5533. , n = Math.round(e)
  5534. , r = parseInt(i) - 15;
  5535. t.find(".bar").css("width", i),
  5536. t.find(".label").css("left", r),
  5537. t.find(".perc").text(n + "%"),
  5538. this.status = e
  5539. },
  5540. done: function(e) {
  5541. return e || this.status ? (this.status = null,
  5542. this.set(100)) : this
  5543. }
  5544. });
  5545. t.exports.circleLoader = n
  5546. }
  5547. , {
  5548. "../util/common": 185
  5549. }],
  5550. 61: [function(e, t, i) {
  5551. "use strict";
  5552. t.exports = Object.freeze({
  5553. CLOSE: "modal.closer.close"
  5554. })
  5555. }
  5556. , {}],
  5557. 62: [function(e, t, i) {
  5558. "use strict";
  5559. function n(t, e) {
  5560. function i() {
  5561. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5562. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5563. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5564. c.classList.remove("closeByFooter")))
  5565. }
  5566. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5567. }
  5568. var r = e("../../settings")
  5569. , o = (e("../../tag/Media/MediaEvent"),
  5570. e("../../util/browser"))
  5571. , a = e("../../util/common")
  5572. , s = e("./ModalCloserEvent")
  5573. , l = e("events").EventEmitter
  5574. , c = document.getElementsByClassName("footer")[0]
  5575. , h = c.querySelectorAll(".close")[0]
  5576. , u = null
  5577. , d = null
  5578. , p = null
  5579. , f = (o.isMobile(),
  5580. {
  5581. open: function(e) {
  5582. e && (n(e),
  5583. u && h.removeEventListener("click", u, !0),
  5584. u = function(e, t) {
  5585. t && (t.stopPropagation(),
  5586. t.preventDefault()),
  5587. e && this.emit(s.CLOSE, e),
  5588. f.reset()
  5589. }
  5590. .bind(this, e.id),
  5591. h.addEventListener("click", u, !0),
  5592. d && window.removeEventListener("resize", d, !0),
  5593. d = n.bind(this, e),
  5594. window.addEventListener("resize", d, !0))
  5595. },
  5596. reset: function() {
  5597. c.classList.remove("closeByFooter"),
  5598. h.removeEventListener("click", u, !0),
  5599. window.removeEventListener("resize", d, !0),
  5600. u = d = p = null
  5601. }
  5602. });
  5603. a.extendObject(f, l.prototype),
  5604. t.exports = f
  5605. }
  5606. , {
  5607. "../../tag/Media/MediaEvent": 131,
  5608. "../../settings": 166,
  5609. "../../util/browser": 182,
  5610. "../../util/common": 185,
  5611. "./ModalCloserEvent": 61,
  5612. events: 202
  5613. }],
  5614. 63: [function(e, t, i) {
  5615. "use strict";
  5616. var A = e("../lib/dat.gui")
  5617. , C = e("three")
  5618. , I = e("../util/easing")
  5619. , E = e("../enum/Viewmode")
  5620. , _ = e("../enum/Colors")
  5621. , b = e("../enum/WarpStyle")
  5622. , w = e("../settings");
  5623. e("../tag/tag"),
  5624. A.GUI.prototype.removeFolder = function(e) {
  5625. var t = this.__folders[e];
  5626. t && (t.close(),
  5627. this.__ul.removeChild(t.domElement.parentNode),
  5628. delete this.__folders[e],
  5629. this.onResize())
  5630. }
  5631. ,
  5632. t.exports.toggle = function(t, e, i) {
  5633. var n = new A.GUI({
  5634. width: 400
  5635. })
  5636. , r = n.addFolder("Flydown from Dollhouse");
  5637. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5638. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5639. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5640. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5641. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5642. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5643. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5644. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5645. var o = n.addFolder("Transition between panos");
  5646. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5647. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5648. w.transition.flyTime = 0,
  5649. o.__controllers.forEach(function(e) {
  5650. e.updateDisplay()
  5651. })
  5652. }),
  5653. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5654. w.transition.flySpeed = 0,
  5655. o.__controllers.forEach(function(e) {
  5656. e.updateDisplay()
  5657. })
  5658. }),
  5659. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5660. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5661. o.add(w.transition, "movementEasing", Object.keys(I));
  5662. var a = n.addFolder("Path Display");
  5663. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5664. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5665. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5666. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5667. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5668. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5669. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5670. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5671. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5672. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5673. w.path.color = _[w.path.color],
  5674. w.path.colorUp = _._desat(w.path.color),
  5675. w.path.colorDown = _.darken(w.path.color)
  5676. }),
  5677. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5678. w.reticuleColor = _[w.reticuleColor]
  5679. });
  5680. var s = n.addFolder("Warping")
  5681. , l = s.addFolder("Warp/Teleport");
  5682. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5683. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5684. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5685. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5686. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5687. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5688. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5689. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5690. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5691. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5692. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5693. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5694. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5695. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5696. w.path.typ = b[w.path.typ]
  5697. }),
  5698. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5699. e.endlessLoop = w.warp.loop
  5700. }),
  5701. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5702. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5703. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5704. var c = s.addFolder("Long Warp Only");
  5705. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5706. w.warp.flySpeed = 0,
  5707. c.__controllers.forEach(function(e) {
  5708. e.updateDisplay()
  5709. })
  5710. }),
  5711. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5712. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5713. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5714. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5715. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5716. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5717. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5718. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5719. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5720. var h = n.addFolder("Warp Esoterica");
  5721. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5722. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5723. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5724. w.warp.minWarpTime = 0,
  5725. h.__controllers.forEach(function(e) {
  5726. e.updateDisplay()
  5727. })
  5728. }),
  5729. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5730. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5731. h.add(w.warp, "movementEasing", Object.keys(I));
  5732. var u = n.addFolder("Misc");
  5733. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5734. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5735. }),
  5736. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5737. i.cameras[E.PANORAMA].fov = w.insideFOV
  5738. }),
  5739. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5740. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5741. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5742. var d = n.addFolder("Navigation");
  5743. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5744. w.navigation.panoScores || t.panos.forEach(function(e) {
  5745. e.floor.remove(e.text3d),
  5746. e.text3d = null
  5747. })
  5748. }),
  5749. d.add(w.navigation, "mouseDirection"),
  5750. d.add(w.navigation, "filterStrictness", 0, 1),
  5751. d.add(w.navigation, "angleFactor", -60, 0),
  5752. d.add(w.navigation, "directionFactor", 1, 20),
  5753. d.add(w.navigation, "distanceFactor", -5, 5),
  5754. d.add(w.navigation, "optionalityFactor", .1, 10);
  5755. var p = n.addFolder("tags")
  5756. , f = p.addFolder("Tag Creation");
  5757. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5758. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5759. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5760. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5761. var g = p.addFolder("Visibility");
  5762. g.add(w.tags.visibility, "anyDistance"),
  5763. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5764. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5765. g.add(w.tags.visibility, "hideViaFloor"),
  5766. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5767. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5768. var m = p.addFolder("Disc Parameters");
  5769. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5770. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5771. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5772. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5773. }),
  5774. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5775. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5776. }),
  5777. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5778. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5779. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5780. var v = p.addFolder("Navigate");
  5781. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5782. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5783. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5784. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5785. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5786. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5787. var y = n.addFolder("Debug");
  5788. y.add(w, "wireframe").onFinishChange(function() {
  5789. t.chunks.forEach(function(e) {
  5790. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5791. e.wireframeTwin.material.depthWrite = !1,
  5792. e.wireframeTwin.material.depthTest = !1,
  5793. e.wireframeTwin.material.opacity = .5,
  5794. e.wireframeTwin.material.transparent = !0),
  5795. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5796. })
  5797. }),
  5798. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5799. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5800. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5801. t.skybox.wireframe = null)
  5802. }),
  5803. y.add(w, "showSweeps").onFinishChange(function() {
  5804. t.setSweepVisibility(w.showSweeps)
  5805. }),
  5806. y.add(w, "showMesh").onFinishChange(function() {
  5807. t.chunks.forEach(function(e) {
  5808. e.visible = w.showMesh
  5809. })
  5810. }),
  5811. y.add(w, "showFloors").onFinishChange(function() {
  5812. t.floors.forEach(function(e) {
  5813. e.collider.children.forEach(function(e) {
  5814. e.material.visible = w.showFloors
  5815. })
  5816. })
  5817. }),
  5818. y.add(w, "showSkyboxes").onFinishChange(function() {
  5819. t.panos.forEach(function(e) {
  5820. e.skyboxMesh.visible = w.showSkyboxes
  5821. })
  5822. }),
  5823. y.add(w, "showNeighbors").onChange(function() {}),
  5824. y.add(t, "alpha", 0, 1)
  5825. }
  5826. }
  5827. , {
  5828. "../enum/Colors": 19,
  5829. "../enum/Viewmode": 51,
  5830. "../enum/WarpStyle": 52,
  5831. "../lib/dat.gui": 93,
  5832. "../tag/tag": 123,
  5833. "../settings": 166,
  5834. "../util/easing": 186,
  5835. three: 217
  5836. }],
  5837. 64: [function(c, h, e) {
  5838. (function(e) {
  5839. "use strict";
  5840. function i(e, t, i, n) {
  5841. $(".gui-error .error-problem-text").text(e),
  5842. $(".gui-error .error-solution-text").text(t),
  5843. $(".gui-error .error-explanation").text(i),
  5844. $(".gui-error .error-actions").html(n),
  5845. $(window).resize(),
  5846. $(".gui-error").fadeIn(),
  5847. $("#bottom-logo").fadeIn()
  5848. }
  5849. function n(e) {
  5850. var t = ['<div class="browser-tiles">', '<div class="tile">', '<a href="https://www.google.com/chrome/browser/" target="_blank">', '<img class="icon" src="images/icon_Google_Chrome_2011.png" ', 'rel="tiletip" title="Chrome"></a>', "</div>", '<div class="tile">', '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">', '<img class="icon" src="images/icon_Mozilla_Firefox.png" ', 'rel="tiletip" title="Firefox"></a>', "</div>", '<div class="tile">', '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">', '<img class="icon" src="images/icon_Internet_Explorer_10.png" ', 'rel="tiletip" title="Internet Explorer"></a>', "</div>", '<div class="tile">', '<a href="https://support.apple.com/en-us/HT204416" target="_blank">', '<img class="icon" src="images/icon_MacOSX_Safari.png" ', 'rel="tiletip" title="Safari"></a>', "</div>", "</div>"].join("");
  5851. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  5852. r.isMobile() || $("[rel=tiletip]").tooltip({
  5853. placement: "bottom",
  5854. delay: {
  5855. show: 50,
  5856. hide: 0
  5857. },
  5858. trigger: "hover",
  5859. viewport: {
  5860. selector: "body",
  5861. padding: 10
  5862. }
  5863. })
  5864. }
  5865. function t() {
  5866. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  5867. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  5868. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  5869. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5870. e.preventDefault(),
  5871. e.stopPropagation(),
  5872. n(" ")
  5873. })
  5874. }
  5875. var r = c("./../util/browser")
  5876. , o = c("./../analytics")
  5877. , a = c("./../settings")
  5878. , s = c("../localization/localize")
  5879. , l = new (c("./../util/logger"))(e);
  5880. h.exports.error = function(e) {
  5881. if ($("head title").text(a.pageTitle),
  5882. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5883. $("#gui-loading").fadeOut(250),
  5884. $("#quick-blackout").hide(),
  5885. o.track("showcase_error", {
  5886. error_key: e
  5887. }),
  5888. s.locale || s.init(),
  5889. "webgl-unsupported" === e)
  5890. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5891. else if ("webgl-ios" === e)
  5892. i(s.ERROR_WEBGL_IOS_PROBLEM, s.ERROR_WEBGL_IOS_SOLUTION, "", s.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  5893. else if ("webgl-safari" === e)
  5894. i(s.ERROR_WEBGL_SAFARI_PROBLEM, "", "", s.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + s.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  5895. else if ("webgl-generic" === e)
  5896. t();
  5897. else if ("missing-urls" === e)
  5898. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  5899. else if ("loading-failed" === e)
  5900. i(s.ERROR_LOADING_FAILED_PROBLEM, "", "", s.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href="https://support.port.com/hc/articles/208220058">' + s.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  5901. else {
  5902. if ("loading-failed-maintenance" !== e)
  5903. return void l.error("Unhandled error: " + e);
  5904. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  5905. }
  5906. }
  5907. }
  5908. ).call(this, "/js/gui/error.js")
  5909. }
  5910. , {
  5911. "../localization/localize": 108,
  5912. "./../analytics": 4,
  5913. "./../settings": 166,
  5914. "./../util/browser": 182,
  5915. "./../util/logger": 189
  5916. }],
  5917. 65: [function(Oe, Le, e) {
  5918. (function(e) {
  5919. "use strict";
  5920. function c() {
  5921. for (var e in Ce)
  5922. if (Ce.hasOwnProperty(e)) {
  5923. var t = Ce[e];
  5924. if (!t.visible)
  5925. for (var i = 0; i < t.elements.length; i++)
  5926. $(t.elements[i]).hide()
  5927. }
  5928. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  5929. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  5930. ge = [],
  5931. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  5932. ge.push(".hideTarget", ".pinTop.right")
  5933. }
  5934. function v(e, t) {
  5935. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  5936. $("#gui-zoomin").toggle(i),
  5937. $("#gui-zoomout").toggle(i)
  5938. }
  5939. function l() {
  5940. n(),
  5941. $(".pinBottom").toggleClass("open"),
  5942. $("#drawer").toggleClass("open"),
  5943. $(".footer").toggleClass("open"),
  5944. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  5945. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  5946. O.resetDrawer()),
  5947. setTimeout(function() {
  5948. $("#pullTab").toggleClass("opened")
  5949. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  5950. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  5951. }
  5952. function t(e) {
  5953. var t;
  5954. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  5955. t = e.position().top + e.outerHeight(),
  5956. e.attr("style", "display: none")),
  5957. $("#player").outerHeight() - 130 < t + 25
  5958. }
  5959. function y(e) {
  5960. "touchstart" === e.type && e.preventDefault(),
  5961. e.stopPropagation()
  5962. }
  5963. function n() {
  5964. w && (w.reload(),
  5965. w.init())
  5966. }
  5967. function r() {
  5968. $("#gui-spinner").stop(!0, !0),
  5969. $("#gui-spinner").fadeOut(1e3),
  5970. !(Ae = !0)
  5971. }
  5972. function A(e, t) {
  5973. var i = e.mode
  5974. , n = t || e.currentPano;
  5975. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  5976. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  5977. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  5978. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  5979. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  5980. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  5981. $("#gui-modes-outside").removeClass("desktop-only")),
  5982. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  5983. pe = i,
  5984. $("#gui-modes-outside").addClass("hidden"),
  5985. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  5986. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  5987. }
  5988. function C(t, i) {
  5989. function e() {
  5990. document.getElementById("vr").classList.remove("hidden"),
  5991. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  5992. S.supportsFullscreen() ? function(e) {
  5993. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  5994. Q.init(t.data, i, e, x),
  5995. Q.on(J.OPENED, _e.bind(gui, "vr")),
  5996. Q.on(J.SHOW_TERMS, W.show.bind(W))
  5997. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  5998. $(".improper-embed").toggleClass("hidden", !1),
  5999. n())
  6000. }, function(e) {
  6001. n()
  6002. }) : n()
  6003. }
  6004. function n() {
  6005. var e;
  6006. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6007. X.init(t.data, x),
  6008. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6009. function() {
  6010. _e("vr"),
  6011. V.open(e)
  6012. }
  6013. )),
  6014. X.on(Z.CLOSED, V.reset)
  6015. }
  6016. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6017. switch (M.vr.option) {
  6018. case le.CONTEXTUAL:
  6019. e();
  6020. break;
  6021. case le.ANDROID:
  6022. S.detectAndroid() && e();
  6023. break;
  6024. case le.NONE:
  6025. }
  6026. }
  6027. function h(e, i) {
  6028. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6029. if ("372" !== getQueryVariable("m")) {
  6030. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6031. $(".gui-floor").find(".container").prepend(r)
  6032. }
  6033. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6034. n.on("click", function(e) {
  6035. y(e),
  6036. _e("floor"),
  6037. n.toggleClass("open")
  6038. }),
  6039. $(".floorChoice").on("click", function(e) {
  6040. y(e);
  6041. var t = $(this).data("index");
  6042. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6043. i.player.gotoFloor(t),
  6044. R.track("showcase_gui", {
  6045. gui_action: "click_floor_select_button",
  6046. interaction_source: "gui"
  6047. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6048. _e("move"),
  6049. i.allFloors(),
  6050. R.track("showcase_gui", {
  6051. gui_action: "click_toggle_all_floors_button",
  6052. interaction_source: "gui"
  6053. })),
  6054. n.removeClass("open")
  6055. })
  6056. }
  6057. function I(e, t) {
  6058. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6059. $(".gui-floor-icon").hide(),
  6060. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6061. $(".gui-floor-icon").show(),
  6062. $(".gui-floor-title").hide()),
  6063. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6064. $(".gui-floor-number").text(se.FLOOR_ALL),
  6065. $(".floorChoice").removeClass("active"),
  6066. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6067. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6068. $(".floorChoice").removeClass("active"),
  6069. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6070. }
  6071. function E() {
  6072. var e = $("#player").width() - 20
  6073. , t = $("#scroller")
  6074. , i = $("#drawer")
  6075. , n = $(".pinBottom");
  6076. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6077. i.addClass("noScroll"),
  6078. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6079. i.toggleClass("noScroll"),
  6080. n.toggleClass("noScroll"))
  6081. }
  6082. function _(e) {
  6083. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6084. e = e || 0,
  6085. Ae = !1,
  6086. window.setTimeout(function() {
  6087. Ae || (!0,
  6088. $("#gui-spinner").stop(!0, !0).show())
  6089. }
  6090. .bind(this), e)
  6091. }(M.modelComponentLoadSpinnerDelay)
  6092. }
  6093. function b(e, t) {
  6094. for (var i = []; e; )
  6095. i.push(e),
  6096. e = e.parentNode;
  6097. for (; t && -1 === i.indexOf(t); )
  6098. t = t.parentNode;
  6099. return t
  6100. }
  6101. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6102. Oe("../util/ajax"),
  6103. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6104. Oe("../util/camera"),
  6105. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6106. Oe("./helpManager")), O = Oe("./immersiveMode"), L = Oe("./loadingScreen"), D = Oe("./landingScreen"), N = Oe("./playButton"), F = Oe("./populateModal"), B = Oe("./memoryUsage"), V = Oe("./closer/modalCloser"), k = Oe("./closer/ModalCloserEvent"), U = Oe("./help/help"), H = Oe("./help/HelpEvent"), z = Oe("./title/titleBar"), G = Oe("./title/TitleEvents"), W = Oe("./terms/terms"), j = Oe("./terms/TermsEvent"), Y = Oe("./title/tagToggle"), q = Oe("./tourInteraction"), X = Oe("./vr/vrModal"), Z = Oe("./vr/vrEvent"), K = Oe("./sharing/modal"), Q = Oe("./webvr/webVRgui"), J = Oe("./webvr/WebVrEvent"), ee = Oe("../controls/serializer"), te = Oe("../enum/Keys"), ie = Oe("../enum/Viewmode"), ne = (Oe("../enum/BlackoutStyle"),
  6107. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6108. Oe("../enum/PathDisplayMode"),
  6109. Oe("../enum/DirectorEvents"),
  6110. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6111. Oe("../enum/WarpStyle"),
  6112. Oe("../enum/AlignmentType"),
  6113. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6114. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6115. coBrand: {
  6116. visible: !0,
  6117. elements: [".co-brand", "#loaderCoBrand"]
  6118. },
  6119. help: {
  6120. visible: !0,
  6121. elements: [".nav-help", "#nav-help"]
  6122. },
  6123. tourControls: {
  6124. visible: !0,
  6125. elements: [".next", ".previous", "#play"]
  6126. },
  6127. highlight: {
  6128. visible: !0,
  6129. elements: ["#drawer", "#pullTab"]
  6130. },
  6131. share: {
  6132. visible: !0,
  6133. elements: [".socialButton", "#share"]
  6134. },
  6135. fullScreen: {
  6136. visible: !0,
  6137. elements: ["#gui-fullscreen"]
  6138. },
  6139. floors: {
  6140. visible: !0,
  6141. elements: [".gui-floor"]
  6142. }
  6143. }, Ie = (g = document.getElementById("drawer"),
  6144. function() {
  6145. $("#player").height() < 400 && g.classList.contains("open") && l()
  6146. }
  6147. ), Ee = (f = document.getElementById("meta-info"),
  6148. function() {
  6149. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6150. }
  6151. ), _e = (i = document.getElementById("meta-info"),
  6152. s = document.getElementById("interaction-modal"),
  6153. u = $("#drawer").eq(0),
  6154. d = $(".gui-floor").eq(0),
  6155. p = $(".vr-popup").eq(0),
  6156. function(e) {
  6157. switch (e) {
  6158. case "info":
  6159. we(),
  6160. Te(),
  6161. Ie(),
  6162. Me(),
  6163. Re(),
  6164. xe(),
  6165. Pe();
  6166. break;
  6167. case "terms":
  6168. be(),
  6169. Te(),
  6170. Se(),
  6171. Me(),
  6172. Re(),
  6173. xe(),
  6174. Pe();
  6175. break;
  6176. case "help":
  6177. be(),
  6178. we(),
  6179. Me(),
  6180. Re(),
  6181. xe(),
  6182. Pe();
  6183. break;
  6184. case "vr":
  6185. be(),
  6186. we(),
  6187. Me(),
  6188. Re(),
  6189. Te(),
  6190. Pe(),
  6191. t(p) && Se();
  6192. break;
  6193. case "highlights":
  6194. Ee(),
  6195. we(),
  6196. Me(),
  6197. Re();
  6198. break;
  6199. case "share":
  6200. be(),
  6201. we(),
  6202. Te(),
  6203. Re(),
  6204. xe(),
  6205. Pe();
  6206. break;
  6207. case "floor":
  6208. we(),
  6209. Me(),
  6210. xe();
  6211. break;
  6212. case "view":
  6213. Re(),
  6214. Me(),
  6215. we(),
  6216. xe();
  6217. break;
  6218. case "tour":
  6219. case "move":
  6220. we(),
  6221. Me(),
  6222. Re(),
  6223. xe();
  6224. break;
  6225. case "resize":
  6226. be(),
  6227. Ie(),
  6228. Re();
  6229. break;
  6230. case "tag":
  6231. we(),
  6232. Te(),
  6233. Me(),
  6234. Re(),
  6235. xe()
  6236. }
  6237. }
  6238. );
  6239. function be() {
  6240. i.classList.contains("expand") && z.toggleMeta(!0)
  6241. }
  6242. function we() {
  6243. W.hide()
  6244. }
  6245. function Te() {
  6246. U.close()
  6247. }
  6248. function xe() {
  6249. X.dismiss()
  6250. }
  6251. function Se() {
  6252. u.hasClass("open") && l()
  6253. }
  6254. function Me() {
  6255. K.hide()
  6256. }
  6257. function Re() {
  6258. d.hasClass("open") && d.removeClass("open")
  6259. }
  6260. function Pe() {
  6261. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6262. }
  6263. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6264. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6265. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6266. setTimeout(function() {
  6267. $(".icon:visible").hide().show(0)
  6268. }, 100)
  6269. }),
  6270. $("#gui-fullscreen").find("a").on("click", function(e) {
  6271. y(e),
  6272. S.requestFullscreen($("body")[0]),
  6273. R.track("showcase_gui", {
  6274. gui_action: "click_enter_fullscreen",
  6275. interaction_source: "gui"
  6276. })
  6277. }),
  6278. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6279. y(e),
  6280. S.exitFullscreen(),
  6281. R.track("showcase_gui", {
  6282. gui_action: "click_exit_fullscreen",
  6283. interaction_source: "gui"
  6284. })
  6285. }),
  6286. $(window).on("resize", function(e) {
  6287. var t = e.target.innerHeight
  6288. , i = e.target.innerWidth;
  6289. t === o && i === a || (Ce.highlight.visible && E(),
  6290. _e("resize"),
  6291. $(".pinTop.right").removeClass("hideUnderMeta"),
  6292. n(),
  6293. o = t,
  6294. a = i)
  6295. }).resize(),
  6296. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6297. $("#pullTab").on("click", function(e) {
  6298. y(e),
  6299. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6300. gui_action: "hide_highlight_reel"
  6301. }),
  6302. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6303. gui_action: "show_highlight_reel"
  6304. }),
  6305. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6306. l()
  6307. }),
  6308. window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
  6309. $("#hotList").on("click", function(e) {
  6310. y(e);
  6311. var t = $("#hotListWrap")[0];
  6312. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6313. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6314. this.classList.add("active"))
  6315. }),
  6316. $("#hotListContent ul").on("mouseover", function(e) {
  6317. y(e);
  6318. var t = e.target
  6319. , i = document.getElementById("hotListWrap");
  6320. if ("SPAN" === t.tagName) {
  6321. var n = t.parentElement.parentElement;
  6322. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6323. } else if ("LI" === t.tagName) {
  6324. n = t.parentElement;
  6325. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6326. } else
  6327. i.style.width = ""
  6328. }),
  6329. $("#hotListContent ul").on("click", function(e) {
  6330. y(e),
  6331. this.preElem && this.preElem.classList.remove("active"),
  6332. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6333. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
  6334. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6335. e.target.hot && e.target.hot.examine(window.player, !0),
  6336. this.preElem = e.target)
  6337. }),
  6338. $("#hotListClose").on("click", function(e) {
  6339. y(e),
  6340. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6341. $("#hotListContent ul .active").removeClass("active"),
  6342. $("#hotList")[0].classList.remove("active")
  6343. })),
  6344. "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
  6345. $("#more-menu-button").on("click", function(e) {
  6346. y(e),
  6347. $("#more-menu").toggleClass("open")
  6348. }),
  6349. Le.exports.init = function(s, l, c, e, t, i, n) {
  6350. var r;
  6351. x = n,
  6352. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6353. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6354. F.init(),
  6355. D.init(s, i),
  6356. ce.init(s, l, e),
  6357. $(".icon").on("mouseover", function() {
  6358. l.player && l.player.reticule.hide()
  6359. }),
  6360. function(e, t) {
  6361. var i = t.player;
  6362. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6363. y(e),
  6364. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6365. R.track("USER", {
  6366. event_type: "showcase_gui",
  6367. gui_action: "click_inside_mode_button"
  6368. }),
  6369. t.changeMode(ie.PANORAMA)
  6370. }),
  6371. $("#gui-modes-outside").find("a").on("click", function(e) {
  6372. y(e),
  6373. R.track("showcase_gui", {
  6374. gui_action: "click_outside_mode_button"
  6375. }),
  6376. t.changeMode(pe)
  6377. }),
  6378. $("#gui-modes-floorplan").on("click", function(e) {
  6379. y(e),
  6380. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6381. gui_action: "click_floorplan_mode_button"
  6382. }),
  6383. t.changeMode(ie.FLOORPLAN))
  6384. }),
  6385. $("#gui-modes-dollhouse").on("click", function(e) {
  6386. y(e),
  6387. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6388. gui_action: "click_dollhouse_mode_button"
  6389. }),
  6390. t.changeMode(ie.DOLLHOUSE))
  6391. })
  6392. }(0, l),
  6393. function(e, t) {
  6394. $("#play").on("mousedown touchstart", function(e) {
  6395. y(e),
  6396. _e("tour"),
  6397. q.play(),
  6398. R.trackAlways("showcase_gui", {
  6399. gui_action: "play_highlights"
  6400. })
  6401. }),
  6402. window.startAndPlay = function(e) {
  6403. _e("tour"),
  6404. q.play(),
  6405. R.trackAlways("showcase_gui", {
  6406. gui_action: "play_highlights"
  6407. })
  6408. }
  6409. ,
  6410. $("#pause").on("mousedown touchstart", function(e) {
  6411. y(e),
  6412. q.pause(),
  6413. R.trackAlways("showcase_gui", {
  6414. gui_action: "pause_highlights"
  6415. })
  6416. }),
  6417. $("#gui-zoomin").find("a").on("click", function(e) {
  6418. y(e),
  6419. t.player.zoomInIncrementally()
  6420. }),
  6421. $("#gui-zoomout").find("a").on("click", function(e) {
  6422. y(e),
  6423. t.player.zoomOutIncrementally()
  6424. })
  6425. }(0, l),
  6426. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(MP_PREFETCHED_MODELDATA.name/* s.data.name */),
  6427. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6428. function() {
  6429. _e("share"),
  6430. V.open(r)
  6431. }
  6432. )),
  6433. K.on(ae.CLOSED, V.reset)),
  6434. //1 < s.heroLocations.length ? function(e, i, t) {
  6435. 0 < s.heroLocations.length ? function(e, i, t) {
  6436. var n = 100 / (fe = e.heroLocations.length) + "%"
  6437. , r = $("#thumb-container")
  6438. , o = $("#progressBar");
  6439. $("#status").find(".totalSteps").text(fe);
  6440. for (var a = 0; a < fe; a++) {
  6441. var s = e.heroLocations[a]
  6442. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6443. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6444. if (l.attr("data-index", a),
  6445. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6446. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6447. s.name) {
  6448. var c = $('<div class="overlay"></div>').text(s.name);
  6449. l.prepend(c)
  6450. }
  6451. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6452. var h = e.panos.get(s.panoId)
  6453. , u = h && !h.isAligned() ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6454. l.prepend(u)
  6455. }
  6456. r.append(l),
  6457. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6458. }
  6459. T = 144 * fe,
  6460. 111 * fe,
  6461. $(".thumbImg").on("mouseover", function() {
  6462. !function(e) {
  6463. return e.describe().inTransition
  6464. }(i) && t.showPathToHeroLocation($(this).data("index"))
  6465. }),
  6466. $(".thumbImg").on("mouseout", function() {
  6467. i.clearPath()
  6468. }),
  6469. $(".thumbImg").on("click", function(e) {
  6470. y(e);
  6471. var t = $(this);
  6472. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6473. R.trackAlways("showcase_gui", {
  6474. gui_action: "click_highlight"
  6475. }),
  6476. i.goToHighlight(t.data("index"))
  6477. }),
  6478. $(".previous").find("a").on("click", function(e) {
  6479. y(e),
  6480. R.trackAlways("showcase_gui", {
  6481. gui_action: "prev_highlight"
  6482. }),
  6483. i.prevHighlight()
  6484. }),
  6485. $(".next").find("a").on("click", function(e) {
  6486. y(e),
  6487. R.trackAlways("showcase_gui", {
  6488. gui_action: "next_highlight"
  6489. }),
  6490. i.nextHighlight()
  6491. }),
  6492. $("#drawer").on("mouseleave", function(t) {
  6493. var i;
  6494. y(t);
  6495. try {
  6496. i = new MouseEvent("mouseup",{
  6497. clientX: t.clientX,
  6498. clientY: t.clientY,
  6499. screenX: t.screenX,
  6500. screenY: t.screenY
  6501. })
  6502. } catch (e) {
  6503. (i = document.createEvent("MouseEvents")).initMouseEvent("mouseup", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6504. }
  6505. document.dispatchEvent(i)
  6506. }),
  6507. (w = new Sly($("#scrollFrame"),{
  6508. horizontal: !0,
  6509. itemNav: "centered",
  6510. smart: !0,
  6511. scrollTrap: !0,
  6512. scrollBy: 1,
  6513. mouseDragging: !0,
  6514. touchDragging: !0,
  6515. speed: 300,
  6516. dragHandle: !0,
  6517. dynamicHandle: !0,
  6518. clickBar: !0,
  6519. scrollBar: $("#scroller"),
  6520. activateOn: null
  6521. }).init()).on("active", function(e, t) {
  6522. t,
  6523. _e("tour"),
  6524. $(".step").removeClass("active"),
  6525. $("#status").find(".curIdx").text(t + 1);
  6526. for (var i = 0; i <= t; i++)
  6527. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6528. }),
  6529. E()
  6530. }(s, l, c) : (Ce.highlight.visible = !1,
  6531. Ce.tourControls.visible = !1),
  6532. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6533. function() {
  6534. var n;
  6535. document.body.addEventListener("mousedown", function(e) {
  6536. n = 0 === e.button || 1 === e.which ? e.target : null
  6537. }, !0),
  6538. document.body.addEventListener("mouseup", function(t) {
  6539. n !== t.target && (n = b(n, t.target));
  6540. var e = document.getElementById("gui-parent");
  6541. if (b(e, n) !== e && (n = null),
  6542. n) {
  6543. var i;
  6544. try {
  6545. i = new MouseEvent("click",t)
  6546. } catch (e) {
  6547. (i = document.createEvent("MouseEvents")).initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6548. }
  6549. i.syntheticClick = !0,
  6550. n.dispatchEvent(i),
  6551. n = null
  6552. }
  6553. }, !0),
  6554. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6555. e.syntheticClick || (e.stopPropagation(),
  6556. "A" === e.target.nodeName && e.preventDefault())
  6557. }, !0)
  6558. }(),
  6559. A(c),
  6560. C(s, t),
  6561. s.on("floor.changed", I),
  6562. s.on("waiting", function(e) {
  6563. _(e)
  6564. }
  6565. .bind(this, s)),
  6566. s.on("waiting-done", function(e) {
  6567. _(e)
  6568. }
  6569. .bind(this, s)),
  6570. c.on(re.ModeChanged, function(e, t) {
  6571. A(c),
  6572. v(l, c),
  6573. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6574. U.updateMode(t)
  6575. }),
  6576. e.on(oe.Move, _e.bind(this, "move")),
  6577. c.on(re.Ready, function() {
  6578. O.init(e, c, c.tagManager, l),
  6579. c.on(re.ModeChanged, function(e, t) {
  6580. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6581. })
  6582. }),
  6583. c.on(re.PanoChosen, function(e, t) {
  6584. A(c, t),
  6585. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6586. }),
  6587. V.on(k.CLOSE, function(e) {
  6588. switch (e) {
  6589. case "vr-modal":
  6590. X.dismiss();
  6591. break;
  6592. case "share-modal":
  6593. K.hide();
  6594. break;
  6595. case "terms-modal":
  6596. W.hide()
  6597. }
  6598. });
  6599. var o, h = $("#play").eq(0), u = $("#pause").eq(0), d = $(".pinBottom").toArray(), p = $("#drawer").eq(0), f = $("#playHead").eq(0), a = $("#progressBar").eq(0), g = $("#thumb-container").eq(0).children(), m = a.children();
  6600. l.on("update.controls", function() {
  6601. var e, t, i, n = l.describe();
  6602. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6603. u.show()),
  6604. n.tourInProgress && (d.forEach(function(e) {
  6605. e.classList.add("playing")
  6606. }),
  6607. p.addClass("playing"),
  6608. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6609. u.hide()),
  6610. n.tourInProgress || (q.stopTour(),
  6611. d.forEach(function(e) {
  6612. e.classList.remove("playing")
  6613. }),
  6614. p.removeClass("playing"),
  6615. f.removeClass("playing"))),
  6616. null !== n.currentItem) {
  6617. var r, o;
  6618. $("#status").find(".curIdx").text(n.currentItem + 1),
  6619. n.onTheBus ? (r = "active",
  6620. o = "recent") : (o = "active",
  6621. r = "recent");
  6622. var a = null === n.destinationItem || n.currentItem === n.destinationItem;
  6623. for (e = 0; e < s.heroLocations.length; e += 1)
  6624. i = g.eq(e),
  6625. t = m.eq(e),
  6626. i.removeClass(o),
  6627. t.removeClass(o),
  6628. n.onTheBus && e === n.destinationItem ? (i.addClass(r),
  6629. t.addClass(r),
  6630. w.activate(e)) : n.onTheBus && a && e === n.currentItem ? (i.addClass(r),
  6631. t.addClass(r)) : (i.removeClass(r),
  6632. t.removeClass(r))
  6633. } else
  6634. for (e = 0; e < s.heroLocations.length; e += 1)
  6635. i = g.eq(e),
  6636. t = m.eq(e),
  6637. i.removeClass("active recent"),
  6638. t.removeClass("active recent");
  6639. v(l, c)
  6640. }),
  6641. document.addEventListener("keydown", function(e) {
  6642. switch (R.updateInteraction(oe.InteractionKey),
  6643. e.which) {
  6644. case te.ZERO:
  6645. M.debug && s.toggleAlpha();
  6646. break;
  6647. case te.NINE:
  6648. M.debug && B.toggle();
  6649. break;
  6650. case te.ONE:
  6651. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6652. break;
  6653. case te.TWO:
  6654. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6655. break;
  6656. case te.THREE:
  6657. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6658. break;
  6659. case te.FOUR:
  6660. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6661. break;
  6662. case te.SPACE:
  6663. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6664. break;
  6665. case te.RETURN:
  6666. M.debug && s.toggleExplodeUp();
  6667. break;
  6668. case te.P:
  6669. !function(e) {
  6670. me.gui || (me.gui = function(e) {
  6671. var t = new he.GUI;
  6672. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6673. e.setSweepVisibility(M.showSweeps)
  6674. }),
  6675. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6676. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6677. M.transition.flySpeed = 0,
  6678. t.__controllers.forEach(function(e) {
  6679. e.updateDisplay()
  6680. })
  6681. }),
  6682. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6683. $(t.__closeButton).hide(),
  6684. t
  6685. }(me.model)),
  6686. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6687. }(!me.visible);
  6688. break;
  6689. case te.U:
  6690. !function(e) {
  6691. ve.gui || (ve.gui = function(t, i) {
  6692. function e() {
  6693. var e = i.toJSON();
  6694. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6695. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6696. }
  6697. var n = {}
  6698. , r = new he.GUI({
  6699. autoPlace: !0,
  6700. width: "60%"
  6701. });
  6702. return e(),
  6703. i.on(re.ViewChanged, e),
  6704. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6705. r.domElement.id = "datLinks",
  6706. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6707. if (!S.detectSafari()) {
  6708. var t = document.createElement("button");
  6709. t.classList.add("btn-deep-link"),
  6710. t.innerText = se.MENU_COPY,
  6711. e.nextSibling.appendChild(t);
  6712. var n = function() {
  6713. alert(se.LINK_ALERT_COPY),
  6714. t.hide()
  6715. };
  6716. t.addEventListener("click", function(e) {
  6717. try {
  6718. var t = e.target.parentNode.childNodes[0];
  6719. t.select();
  6720. var i = document.execCommand("copy");
  6721. t.blur(),
  6722. i || n()
  6723. } catch (e) {
  6724. n()
  6725. }
  6726. })
  6727. }
  6728. }),
  6729. $(r.__closeButton).hide(),
  6730. r
  6731. }(ve.model, ve.player)),
  6732. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6733. }(!ve.visible);
  6734. break;
  6735. case te.X:
  6736. M.debug && s.toggleExplode();
  6737. break;
  6738. case te.PLUSEQUALS:
  6739. l.player.activatePersistentZooming(!0),
  6740. O.hideUi();
  6741. break;
  6742. case te.DASHUNDERSCORE:
  6743. l.player.activatePersistentZooming(!1),
  6744. O.hideUi();
  6745. break;
  6746. case te.SEVEN:
  6747. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6748. break;
  6749. case te.EIGHT:
  6750. l.player.decreaseZoomSpeed();
  6751. break;
  6752. case te.NINE:
  6753. l.player.increaseZoomSpeed()
  6754. }
  6755. return c && c.reticule.hide(),
  6756. !0
  6757. }
  6758. .bind(this)),
  6759. document.addEventListener("keyup", function(e) {
  6760. switch (e.which) {
  6761. case te.PLUSEQUALS:
  6762. l.player.deactivatePersistentZooming();
  6763. break;
  6764. case te.DASHUNDERSCORE:
  6765. l.player.deactivatePersistentZooming()
  6766. }
  6767. }
  6768. .bind(this)),
  6769. function(e) {
  6770. me = {
  6771. gui: null,
  6772. visible: !1,
  6773. model: e
  6774. }
  6775. }(s),
  6776. function(e, t) {
  6777. ve = {
  6778. gui: null,
  6779. visible: !1,
  6780. model: e,
  6781. player: t
  6782. }
  6783. }(s, l.player),
  6784. function(e) {
  6785. function t(e, i) {
  6786. $(e).find("a").each(function(e, t) {
  6787. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6788. t.style.pointerEvents = i ? "auto" : "none"
  6789. })
  6790. }
  6791. e.on(de.ZoomMax, function() {
  6792. t("#gui-zoomin", !1),
  6793. t("#gui-zoomout", !0)
  6794. }),
  6795. e.on(de.ZoomMin, function() {
  6796. t("#gui-zoomin", !0),
  6797. t("#gui-zoomout", !1)
  6798. }),
  6799. e.on(de.ZoomIn, function() {
  6800. t("#gui-zoomout", !0)
  6801. }),
  6802. e.on(de.ZoomOut, function() {
  6803. t("#gui-zoomin", !0)
  6804. }),
  6805. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6806. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6807. }(c),
  6808. P.setAutoPlay(s.heroCount()),
  6809. U.init(c, i.mode),
  6810. U.on(H.OPENED, _e.bind(this, "help")),
  6811. W.init(),
  6812. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6813. function() {
  6814. _e("terms"),
  6815. V.open(o)
  6816. }
  6817. )),
  6818. W.on(j.CLOSED, V.reset),
  6819. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6820. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6821. M.profiling.enabled && B.show(),
  6822. q.init(l)
  6823. }
  6824. ,
  6825. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6826. function a() {
  6827. o.setLoadingStartTime(),
  6828. function() {
  6829. function e(e) {
  6830. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  6831. }
  6832. $("body").css("touch-action", "none"),
  6833. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  6834. var t = document.getElementById("terms-text")
  6835. , i = document.getElementById("more-help-wrapper")
  6836. , n = (document.getElementById("navigation-help-wrapper"),
  6837. document.getElementById("help-dialog"),
  6838. document.getElementById("tag-billboards"));
  6839. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  6840. passive: !1
  6841. }),
  6842. document.body.addEventListener("DOMMouseScroll", e)),
  6843. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6844. e.stopPropagation()
  6845. })
  6846. }(),
  6847. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  6848. l()) : function(e) {
  6849. L.show(e),
  6850. c()
  6851. }(l)
  6852. }
  6853. var s = $.Deferred()
  6854. , l = s.resolve.bind(s);
  6855. ye = !0,
  6856. _(e);
  6857. e.data.player_options && function(e) {
  6858. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  6859. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  6860. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  6861. }(e.data.player_options),
  6862. 1 === M.specialEdition && $("body").addClass("specialEdition");
  6863. se.localizeGUI();
  6864. !function(i) {
  6865. function e(e, t) {
  6866. return !!i.player_options[e] && i[t || e]
  6867. }
  6868. $(".model-title").text(i.name);
  6869. var t = M.pageTitle;
  6870. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  6871. document.title = t,
  6872. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6873. delay: {
  6874. show: 50,
  6875. hide: 0
  6876. },
  6877. trigger: "hover",
  6878. html: !1,
  6879. viewport: {
  6880. selector: "body",
  6881. padding: 10
  6882. }
  6883. }),
  6884. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6885. z.populate({
  6886. name: e("model_name", "name"),
  6887. coBrand: e("presented_by"),
  6888. description: e("model_summary", "summary") || "暂无内容",
  6889. contactName: e("contact_name"),
  6890. address: e("address"),
  6891. phone: e("contact_phone"),
  6892. formattedPhone: i.formatted_contact_phone,
  6893. email: e("contact_email"),
  6894. url: e("external_url"),
  6895. socialSharing: i.enable_social_sharing && i.is_public
  6896. })
  6897. }(e.data);
  6898. r || $(".quick").addClass("hidden");
  6899. n ? (R.impression(),
  6900. a()) : (o.setWaitingStartTime(),
  6901. N.show(r, a))
  6902. return s
  6903. }
  6904. ,
  6905. Le.exports.endLoading = function(e, t, i) {
  6906. var n = t.player;
  6907. function r() {
  6908. i.dismissExaminedTag(),
  6909. i.disableHovering()
  6910. }
  6911. $("#gui-thumb").fadeOut(2500),
  6912. L.hide(function() {
  6913. ye = !1
  6914. }),
  6915. Y.init(e, i),
  6916. z.finishSetup(Object.keys(e.tags).length),
  6917. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  6918. X.on(Z.OPENED, r),
  6919. K.on(ae.OPENED, r),
  6920. U.on(H.OPENED, r),
  6921. W.on(j.OPENED, r);
  6922. var o = i.enableHovering.bind(i);
  6923. if (X.on(Z.CLOSED, o),
  6924. K.on(ae.CLOSED, o),
  6925. U.on(H.CLOSED, o),
  6926. W.on(j.CLOSED, o),
  6927. M.labels.enabled && Object.keys(e.labels).length,
  6928. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  6929. I(e.currentFloor, n.mode)),
  6930. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  6931. h(e, t)),
  6932. c(),
  6933. v(t, t.player),
  6934. $("#gui").fadeIn(1500),
  6935. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  6936. l(),
  6937. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  6938. }, 2e3),
  6939. !S.isMobile())
  6940. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  6941. $(a[s]).addClass("hasHover");
  6942. _(e),
  6943. z.setupToggling(),
  6944. window.editHotPanel && editHotPanel(),
  6945. function() {
  6946. var i = $("#pullTab")
  6947. , e = {
  6948. bottom: {
  6949. "border-bottom-left-radius": "10px",
  6950. "border-bottom-right-radius": "10px"
  6951. },
  6952. top: {
  6953. "border-top-left-radius": "10px",
  6954. "border-top-right-radius": "10px"
  6955. }
  6956. }
  6957. , t = {
  6958. bottom: {
  6959. "border-top-right-radius": "10px",
  6960. "border-bottom-right-radius": "10px"
  6961. },
  6962. top: {
  6963. "border-bottom-left-radius": "10px",
  6964. "border-top-left-radius": "10px"
  6965. }
  6966. };
  6967. function n(e, t) {
  6968. $("#gui-modes-map > div:visible:last").css(e),
  6969. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  6970. }
  6971. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  6972. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  6973. }(),
  6974. window.EditTools && (window.editTool = new EditTools(n.sceneRenderer))
  6975. }
  6976. ,
  6977. Le.exports.onProgress = function(e) {
  6978. L.progress(e)
  6979. }
  6980. }
  6981. ).call(this, "/js/gui/gui.js")
  6982. }
  6983. , {
  6984. "../analytics": 4,
  6985. "../controls/serializer": 14,
  6986. "../enum/AlignmentType": 17,
  6987. "../enum/BlackoutStyle": 18,
  6988. "../enum/ControlEvents": 21,
  6989. "../enum/DirectorEvents": 23,
  6990. "../enum/Keys": 30,
  6991. "../enum/PathDiscardMode": 38,
  6992. "../enum/PathDisplayMode": 39,
  6993. "../enum/PlayerEvents": 40,
  6994. "../enum/VROption": 47,
  6995. "../enum/Vectors": 50,
  6996. "../enum/Viewmode": 51,
  6997. "../enum/WarpStyle": 52,
  6998. "../enum/ZoomEvents": 53,
  6999. "../lib/dat.gui": 93,
  7000. "../localization/localize": 108,
  7001. "../tag/Media/MediaEvent": 131,
  7002. "../objects/Snapshot": 153,
  7003. "../settings": 166,
  7004. "../util/ajax": 181,
  7005. "../util/browser": 182,
  7006. "../util/camera": 183,
  7007. "../util/logger": 189,
  7008. "../util/showcase": 193,
  7009. "../util/transitions": 195,
  7010. "./closer/ModalCloserEvent": 61,
  7011. "./closer/modalCloser": 62,
  7012. "./help/HelpEvent": 66,
  7013. "./help/help": 67,
  7014. "./helpManager": 68,
  7015. "./immersiveMode": 69,
  7016. "./konami": 70,
  7017. "./landingScreen": 71,
  7018. "./loadingScreen": 72,
  7019. "./memoryUsage": 73,
  7020. "./playButton": 74,
  7021. "./populateModal": 75,
  7022. "./sharing/ShareEvents": 76,
  7023. "./sharing/modal": 77,
  7024. "./terms/TermsEvent": 78,
  7025. "./terms/terms": 79,
  7026. "./title/TitleEvents": 80,
  7027. "./title/tagToggle": 81,
  7028. "./title/titleBar": 82,
  7029. "./tourInteraction": 84,
  7030. "./vr/vrEvent": 85,
  7031. "./vr/vrModal": 87,
  7032. "./webvr/WebVrEvent": 88,
  7033. "./webvr/webVRgui": 89,
  7034. three: 217
  7035. }],
  7036. 66: [function(e, t, i) {
  7037. "use strict";
  7038. t.exports = Object.freeze({
  7039. OPENED: "help.opened",
  7040. CLOSED: "help.closed"
  7041. })
  7042. }
  7043. , {}],
  7044. 67: [function(e, t, i) {
  7045. "use strict";
  7046. function n() {
  7047. p.on("click", function(e) {
  7048. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7049. setTimeout(function() {
  7050. x = !1
  7051. }, h.help.modalStayDuration),
  7052. S.emit(l.OPENED),
  7053. f.addClass("open " + T),
  7054. p.addClass("open"),
  7055. o(),
  7056. r(),
  7057. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7058. v.classList.add("fadeIn")))
  7059. }),
  7060. E.on("click", function(e) {
  7061. S.close()
  7062. }),
  7063. C.on("click", function(e) {
  7064. T && T !== a.TRANSITIONING && (o(),
  7065. r())
  7066. }),
  7067. I.on("click", function(e) {
  7068. o(),
  7069. I.addClass("underline-tab"),
  7070. c.fill(b, s.MORE_HELP),
  7071. f.addClass("more-help")
  7072. })
  7073. }
  7074. function r() {
  7075. C.addClass("underline-tab"),
  7076. c.fill(_, s.NAVIGATION, T),
  7077. f.addClass(T)
  7078. }
  7079. function o() {
  7080. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7081. A.forEach(function(e) {
  7082. e.classList.remove("underline-tab")
  7083. })
  7084. }
  7085. var a = e("../../enum/Viewmode")
  7086. , s = e("../../enum/HelpModalType")
  7087. , l = e("./HelpEvent")
  7088. , c = (e("../helpManager"),
  7089. e("./../populateModal"))
  7090. , h = e("../../settings")
  7091. , u = e("../../util/common")
  7092. , d = e("events").EventEmitter
  7093. , p = $(".footer-help").eq(0)
  7094. , f = $("#help-dialog").eq(0)
  7095. , g = document.querySelector("#quick-logo")
  7096. , m = document.querySelector("#loaderCoBrand")
  7097. , v = document.querySelector("#help-dialog")
  7098. , y = document.querySelector(".footer")
  7099. , A = $(".help-tabs").children().toArray()
  7100. , C = $(".navigation-tab").eq(0)
  7101. , I = $(".more-help-tab").eq(0)
  7102. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7103. f.find(".close").eq(0))
  7104. , _ = f.find(".interactions").toArray()
  7105. , b = f.find(".ui-instructions").toArray()
  7106. , w = a.PANORAMA
  7107. , T = a.PANORAMA
  7108. , x = !1
  7109. , S = {
  7110. init: function(e, t) {
  7111. w = T = t,
  7112. [v, m, g, y].forEach(function(e) {
  7113. e.classList.add(c.deviceType)
  7114. }),
  7115. n()
  7116. },
  7117. close: function() {
  7118. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7119. p.removeClass("open"),
  7120. f.removeClass("open"),
  7121. v.classList.contains("fadeIn"))) {
  7122. v.classList.remove("fadeIn");
  7123. var e = T === a.TRANSITIONING ? w : T;
  7124. c.clear(_, s.NAVIGATION, e)
  7125. }
  7126. },
  7127. updateMode: function(e) {
  7128. w = T,
  7129. T = e
  7130. }
  7131. };
  7132. u.extendObject(S, d.prototype),
  7133. t.exports = S
  7134. }
  7135. , {
  7136. "../../enum/HelpModalType": 28,
  7137. "../../enum/Viewmode": 51,
  7138. "../../settings": 166,
  7139. "../../util/common": 185,
  7140. "../helpManager": 68,
  7141. "./../populateModal": 75,
  7142. "./HelpEvent": 66,
  7143. events: 202
  7144. }],
  7145. 68: [function(s, l, e) {
  7146. (function(e) {
  7147. "use strict";
  7148. var t = s("../util/browser")
  7149. , i = s("./../util/logger")
  7150. , n = s("./../settings")
  7151. , r = new i(e)
  7152. , o = function() {
  7153. var t;
  7154. try {
  7155. return t = window.localStorage.getItem("visitCount") || "0",
  7156. t = (parseFloat(t) + 1).toString(),
  7157. window.localStorage.setItem("visitCount", t),
  7158. r.debug("visitCount = " + t),
  7159. t
  7160. } catch (e) {
  7161. t = "1",
  7162. r.debug("couldn't set local storage")
  7163. }
  7164. }()
  7165. , a = !1;
  7166. l.exports = {
  7167. isHelpDisabled: function() {
  7168. return "0" === t.valueFromHash("help", null) || a
  7169. },
  7170. isLargeHelpEnabled: function() {
  7171. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7172. },
  7173. isSmallHelpEnabled: function() {
  7174. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7175. },
  7176. isHelpEnabled: function() {
  7177. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7178. },
  7179. setAutoPlay: function(e) {
  7180. a = 0 <= n.warp.auto && 1 < e
  7181. }
  7182. }
  7183. }
  7184. ).call(this, "/js/gui/helpManager.js")
  7185. }
  7186. , {
  7187. "../util/browser": 182,
  7188. "./../settings": 166,
  7189. "./../util/logger": 189
  7190. }],
  7191. 69: [function(e, t, i) {
  7192. "use strict";
  7193. function r(e) {
  7194. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7195. T = !0,
  7196. h.close(),
  7197. function(e) {
  7198. !n(e) && S ? v.forEach(function(e) {
  7199. e.classList.remove("drawerOpen"),
  7200. e.classList.add("duringTour")
  7201. }) : C.hasClass("open") ? v.forEach(function(e) {
  7202. e.classList.remove("duringTour"),
  7203. e.classList.add("drawerOpen")
  7204. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7205. e.classList.add("fadeOut")
  7206. })
  7207. }(e),
  7208. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7209. C.hasClass("playing") || (y.forEach(function(e) {
  7210. e.classList.add("detectHover")
  7211. }),
  7212. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7213. }
  7214. function o() {
  7215. C.hasClass("playing") || (clearTimeout(x),
  7216. x = setTimeout(a, c.immersive.timeToShowAgain))
  7217. }
  7218. function a() {
  7219. clearTimeout(x),
  7220. T = !1,
  7221. m.forEach(function(e) {
  7222. e.classList.remove("drawerOpen")
  7223. }),
  7224. S || v.forEach(function(e) {
  7225. e.classList.remove("duringTour")
  7226. }),
  7227. y.forEach(function(e) {
  7228. e.classList.remove("detectHover")
  7229. })
  7230. }
  7231. function s() {
  7232. T ? a() : r(),
  7233. M = !0,
  7234. setTimeout(function() {
  7235. M = !1
  7236. }, c.immersive.uiStayDuration)
  7237. }
  7238. function n(e) {
  7239. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7240. }
  7241. var l = e("../util/browser")
  7242. , c = e("../settings")
  7243. , h = e("./help/help")
  7244. , u = e("../enum/tagEvents")
  7245. , d = e("../enum/ControlEvents")
  7246. , p = e("../enum/PlayerEvents")
  7247. , f = e("../enum/DirectorEvents")
  7248. , g = (p = e("../enum/PlayerEvents"),
  7249. e("../enum/Viewmode"))
  7250. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7251. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7252. , y = $("#hover-bottom, #hover-top").toArray()
  7253. , A = ($("#pullTab").eq(0),
  7254. $("#playHead").eq(0),
  7255. $(".pinBottom-container").eq(0))
  7256. , C = $("#drawer").eq(0)
  7257. , I = $("#drawer-container").eq(0)
  7258. , E = $("#meta-info").eq(0)
  7259. , _ = $(".pinTop.left").eq(0)
  7260. , b = $("#player").eq(0)
  7261. , w = document.getElementById("pullTab")
  7262. , T = !1
  7263. , x = null
  7264. , S = !1
  7265. , M = !1
  7266. , R = null
  7267. , P = !1;
  7268. t.exports.init = function(e, t, i, n) {
  7269. (function(t, i, e, n) {
  7270. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7271. t.controls[e].on(d.Move, r),
  7272. t.controls[e].on(d.LongTap, s)
  7273. }),
  7274. b.on("mousewheel DOMMouseScroll", r),
  7275. e.on(u.TagActivated, r),
  7276. e.on(u.TagNavigation, r),
  7277. i.on(p.FlyingEnded, o),
  7278. i.on(p.ModeChanging, function(e, t) {
  7279. P = t !== g.PANORAMA && e !== g.PANORAMA
  7280. }),
  7281. i.on(p.ModeChanged, function(e, t) {
  7282. R = i.mode,
  7283. t !== g.TRANSITIONING ? a() : r("modeChange")
  7284. }),
  7285. n.on(f.TourStart, function() {
  7286. S = !0,
  7287. r()
  7288. }),
  7289. n.on(f.TourEnd, function() {
  7290. S = !1,
  7291. a()
  7292. }),
  7293. n.on(f.ActionInterrupted, function() {
  7294. S = !1
  7295. }),
  7296. w.addEventListener("touchend", function() {
  7297. $("#pullTab").hasClass("opened") && !S && a()
  7298. }, !0)
  7299. }
  7300. )(e, t, i, n),
  7301. l.isMobile() ? (y.forEach(function(e) {
  7302. e.classList.add("mobile")
  7303. }),
  7304. A.click(a)) : (y.forEach(function(e) {
  7305. e.addEventListener("mouseleave", function() {
  7306. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7307. }, !0)
  7308. }),
  7309. b.mouseleave(function() {
  7310. y[0].classList.contains("detectHover") && a()
  7311. })),
  7312. R = t.mode
  7313. }
  7314. ,
  7315. t.exports.hideUi = r,
  7316. t.exports.resetDrawer = function() {
  7317. I.hasClass("duringTour") || (S = !1,
  7318. r("gui"),
  7319. a())
  7320. }
  7321. }
  7322. , {
  7323. "../enum/ControlEvents": 21,
  7324. "../enum/DirectorEvents": 23,
  7325. "../enum/tagEvents": 32,
  7326. "../enum/PlayerEvents": 40,
  7327. "../enum/Viewmode": 51,
  7328. "../settings": 166,
  7329. "../util/browser": 182,
  7330. "./help/help": 67
  7331. }],
  7332. 70: [function(i, n, e) {
  7333. (function(e) {
  7334. "use strict";
  7335. var t = i("./../util/logger")
  7336. , o = i("./../settings")
  7337. , a = i("./debug")
  7338. , s = i("./../util/common")
  7339. , l = (i("./gui"),
  7340. new t(e));
  7341. o.console && $("body").append('<div id="debug-console"></div>'),
  7342. n.exports.init = function(i, n, r) {
  7343. l.debug("konami has the modelInstance");
  7344. var t = [];
  7345. $(window).on("keydown", function(e) {
  7346. t.push(e.which),
  7347. t.length > o.secretPanelWord.length && t.shift(),
  7348. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7349. o.debug = !0)
  7350. }),
  7351. $(window).on("keydown", function e(t) {
  7352. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7353. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7354. })
  7355. }
  7356. }
  7357. ).call(this, "/js/gui/konami.js")
  7358. }
  7359. , {
  7360. "./../settings": 166,
  7361. "./../util/common": 185,
  7362. "./../util/logger": 189,
  7363. "./debug": 63,
  7364. "./gui": 65
  7365. }],
  7366. 71: [function(e, t, i) {
  7367. "use strict";
  7368. function r() {
  7369. s.clear(m, l.LANDING[v]),
  7370. g.removeClass("fadeIn")
  7371. }
  7372. var o = e("../settings")
  7373. , a = (e("./help/help"),
  7374. e("./helpManager"))
  7375. , s = e("./populateModal")
  7376. , l = e("../enum/HelpModalType")
  7377. , n = e("../enum/Viewmode")
  7378. , c = e("../enum/DirectorEvents")
  7379. , h = e("../enum/PlayerEvents")
  7380. , u = $("#quick-blackout").eq(0)
  7381. , d = $("#quick-logo").eq(0)
  7382. , p = $(".quick-brand").toArray()
  7383. , f = $("#loaderCoBrand").eq(0)
  7384. , g = $("#interaction-modal").eq(0)
  7385. , m = g.find(".interaction").toArray()
  7386. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7387. "");
  7388. t.exports.delayLanding = function(e) {
  7389. var t = $.Deferred();
  7390. e || t.resolve();
  7391. var i = o.startupFlyinDelay;
  7392. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7393. setTimeout(t.resolve.bind(t), i),
  7394. t
  7395. }
  7396. ,
  7397. t.exports.showMessage = function(e, t, i) {
  7398. var n = 0;
  7399. o.quickstart.enabled && (function(e) {
  7400. e && (f.addClass("quick-brand"),
  7401. d.before(f),
  7402. p = $(".quick-brand").toArray()),
  7403. u.addClass("fadeOut"),
  7404. setTimeout(function() {
  7405. p.forEach(function(e) {
  7406. e.classList.add("fadeIn")
  7407. })
  7408. }, o.quickstart.showTextDelay),
  7409. setTimeout(function() {
  7410. p.forEach(function(e) {
  7411. e.classList.add("fadeOut")
  7412. })
  7413. }, o.quickstart.fadeOutDelay)
  7414. }(i),
  7415. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7416. function(e, t) {
  7417. setTimeout(function() {
  7418. if (a.isHelpEnabled()) {
  7419. if (t(),
  7420. s.init(),
  7421. g.addClass("fadeIn landing " + s.deviceType),
  7422. a.isSmallHelpEnabled())
  7423. return void g.addClass("small");
  7424. s.fill(m, l.LANDING[v]),
  7425. g.addClass(v)
  7426. }
  7427. }, e);
  7428. var i = {
  7429. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7430. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7431. }
  7432. , n = $(".nav-icon .icon");
  7433. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7434. function r(e) {
  7435. e.on("click", function() {
  7436. var e = null;
  7437. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7438. i.length < e || e < 1)
  7439. return !1;
  7440. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7441. "data-page": e,
  7442. src: i.mobile[e - 1]
  7443. }) : n.attr({
  7444. "data-page": e,
  7445. src: i.pc[e - 1]
  7446. })
  7447. })
  7448. }
  7449. r($(".next-button")),
  7450. r($(".prev-button"))
  7451. }(n, function() {
  7452. e.once(h.Move, r),
  7453. t.once(c.TourStart, r)
  7454. })
  7455. }
  7456. ,
  7457. t.exports.init = function(e, t) {
  7458. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7459. }
  7460. ,
  7461. t.exports.dismissModal = r
  7462. }
  7463. , {
  7464. "../enum/DirectorEvents": 23,
  7465. "../enum/HelpModalType": 28,
  7466. "../enum/PlayerEvents": 40,
  7467. "../enum/Viewmode": 51,
  7468. "../settings": 166,
  7469. "./help/help": 67,
  7470. "./helpManager": 68,
  7471. "./populateModal": 75
  7472. }],
  7473. 72: [function(e, t, i) {
  7474. "use strict";
  7475. var n = e("./circleLoader").circleLoader;
  7476. t.exports = {
  7477. element: $("#gui-loading"),
  7478. hide: function(e) {
  7479. n.done(),
  7480. this.element.fadeOut(1500, e)
  7481. },
  7482. show: function(e) {
  7483. this.element.fadeIn(500, function() {
  7484. this.element.css("display", "table"),
  7485. e && e()
  7486. }
  7487. .bind(this))
  7488. },
  7489. progress: function(e) {
  7490. n.set(e)
  7491. }
  7492. }
  7493. }
  7494. , {
  7495. "./circleLoader": 60
  7496. }],
  7497. 73: [function(e, t, i) {
  7498. "use strict";
  7499. var n = e("../settings")
  7500. , r = $("#memory-info")
  7501. , o = r.find("#memory-gpu")
  7502. , a = !1;
  7503. t.exports = {
  7504. show: function() {
  7505. n.profiling.enabled && (r.show(),
  7506. a = !0)
  7507. },
  7508. hide: function() {
  7509. r.hide(),
  7510. a = !1
  7511. },
  7512. toggle: function() {
  7513. a ? this.hide() : this.show()
  7514. },
  7515. update: function(e) {
  7516. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7517. }
  7518. }
  7519. }
  7520. , {
  7521. "../settings": 166
  7522. }],
  7523. 74: [function(e, t, i) {
  7524. "use strict";
  7525. e("../util/browser"),
  7526. e("../analytics");
  7527. e("../settings"),
  7528. t.exports = {
  7529. show: function(e, t) {
  7530. $("#gui-message").fadeOut(500, function() {
  7531. t()
  7532. })
  7533. }
  7534. }
  7535. }
  7536. , {
  7537. "../analytics": 4,
  7538. "../settings": 166,
  7539. "../util/browser": 182
  7540. }],
  7541. 75: [function(e, t, i) {
  7542. "use strict";
  7543. function n(e, t, i, n) {
  7544. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7545. }
  7546. var r = e("../util/browser")
  7547. , o = e("../localization/localize")
  7548. , a = e("../enum/HelpModalType")
  7549. , s = (e("../enum/HelpModalSize"),
  7550. e("../enum/Viewmode"));
  7551. t.exports = {
  7552. init: function() {
  7553. if (!this.hasInitialized) {
  7554. this.hasInitialized = !0,
  7555. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7556. this.assets = {},
  7557. this.assets[a.LANDING[s.PANORAMA]] = {
  7558. desktop: {
  7559. left: {
  7560. "top-info": o.ROTATE,
  7561. "big-image": "images/nav_help_mouse_drag_left.png",
  7562. keyboard: "images/nav_help_keyboard_left_right.png"
  7563. },
  7564. middle: {
  7565. "top-info": o.MOVE,
  7566. "big-image": "images/nav_help_mouse_click.png",
  7567. keyboard: "images/nav_help_keyboard_up_down.png"
  7568. },
  7569. right: {
  7570. "top-info": o.ZOOM,
  7571. "big-image": "images/nav_help_mouse_zoom.png",
  7572. keyboard: "images/nav_help_zoom_keys.png"
  7573. }
  7574. },
  7575. mobile: {
  7576. left: {
  7577. "top-info": o.ROTATE,
  7578. "big-image": "images/nav_help_gesture_drag.png"
  7579. },
  7580. middle: {
  7581. "top-info": o.MOVE,
  7582. "big-image": "images/nav_help_gesture_tap.png"
  7583. },
  7584. right: {
  7585. "top-info": o.ZOOM,
  7586. "big-image": "images/nav_help_gesture_pinch.png"
  7587. }
  7588. }
  7589. },
  7590. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7591. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7592. desktop: {
  7593. left: {
  7594. "top-info": o.ROTATE,
  7595. "big-image": "images/nav_help_mouse_drag_left.png",
  7596. keyboard: "images/nav_help_keyboard_left_right.png"
  7597. },
  7598. middle: {
  7599. "top-info": o.MOVE,
  7600. "big-image": "images/nav_help_mouse_position_right.png"
  7601. }
  7602. },
  7603. mobile: {
  7604. left: {
  7605. "top-info": o.ROTATE,
  7606. "big-image": "images/nav_help_gesture_drag.png"
  7607. },
  7608. middle: {
  7609. "top-info": o.MOVE,
  7610. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7611. }
  7612. }
  7613. },
  7614. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7615. desktop: {
  7616. left: {
  7617. "top-info": o.MOVE,
  7618. "big-image": "images/nav_help_mouse_position_left.png"
  7619. },
  7620. middle: {
  7621. "top-info": o.ROTATE,
  7622. "big-image": "images/nav_help_mouse_drag_right.png",
  7623. keyboard: "images/nav_help_keyboard_left_right.png"
  7624. }
  7625. },
  7626. mobile: {
  7627. left: {
  7628. "top-info": o.MOVE,
  7629. "big-image": "images/nav_help_gesture_position.png"
  7630. },
  7631. middle: {
  7632. "top-info": o.ROTATE,
  7633. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7634. }
  7635. }
  7636. };
  7637. var e = {
  7638. "top-info": o.INSIDE,
  7639. "big-image": "images/nav_help_click_inside.png",
  7640. keyboard: "images/nav_help_inside_key.png"
  7641. };
  7642. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7643. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7644. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7645. var t = {
  7646. "top-info": o.INSIDE,
  7647. "big-image": "images/nav_help_tap_inside.png"
  7648. };
  7649. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7650. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7651. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7652. this.assets[a.NAVIGATION] = {},
  7653. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7654. desktop: {
  7655. left: {
  7656. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7657. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7658. "big-image": "images/nav_help_mouse_drag_left.png",
  7659. keyboard: "images/nav_help_keyboard_left_right.png"
  7660. },
  7661. middle: {
  7662. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7663. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7664. "big-image": "images/nav_help_mouse_click.png",
  7665. keyboard: "images/nav_help_keyboard_up_down.png"
  7666. },
  7667. right: {
  7668. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7669. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7670. "big-image": "images/nav_help_mouse_zoom.png",
  7671. keyboard: "images/nav_help_zoom_keys.png"
  7672. }
  7673. },
  7674. mobile: {
  7675. left: {
  7676. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7677. "big-image": "images/nav_help_gesture_drag.png"
  7678. },
  7679. middle: {
  7680. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7681. "big-image": "images/nav_help_gesture_tap.png"
  7682. },
  7683. right: {
  7684. "top-info": o.HELP_MOBILE_3,
  7685. "big-image": "images/nav_help_gesture_pinch.png"
  7686. }
  7687. }
  7688. },
  7689. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7690. desktop: {
  7691. left: {
  7692. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7693. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7694. "big-image": "images/nav_help_mouse_drag_left.png",
  7695. keyboard: "images/nav_help_keyboard_all.png"
  7696. },
  7697. middle: {
  7698. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7699. "big-image": "images/nav_help_mouse_position_right.png"
  7700. },
  7701. right: {
  7702. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7703. "big-image": "images/nav_help_mouse_zoom.png"
  7704. }
  7705. },
  7706. mobile: {
  7707. left: {
  7708. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7709. "big-image": "images/nav_help_gesture_drag.png"
  7710. },
  7711. middle: {
  7712. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7713. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7714. },
  7715. right: {
  7716. "top-info": o.HELP_MOBILE_3,
  7717. "big-image": "images/nav_help_gesture_pinch.png"
  7718. }
  7719. }
  7720. },
  7721. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7722. desktop: {
  7723. left: {
  7724. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7725. "big-image": "images/nav_help_mouse_position_left.png"
  7726. },
  7727. middle: {
  7728. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7729. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7730. "big-image": "images/nav_help_mouse_drag_right.png",
  7731. keyboard: "images/nav_help_keyboard_left_right.png"
  7732. },
  7733. right: {
  7734. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7735. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7736. "big-image": "images/nav_help_mouse_zoom.png",
  7737. keyboard: "images/nav_help_keyboard_up_down.png"
  7738. }
  7739. },
  7740. mobile: {
  7741. left: {
  7742. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7743. "big-image": "images/nav_help_gesture_position.png"
  7744. },
  7745. middle: {
  7746. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7747. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7748. },
  7749. right: {
  7750. "top-info": o.HELP_MOBILE_3,
  7751. "big-image": "images/nav_help_gesture_pinch.png"
  7752. }
  7753. }
  7754. },
  7755. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7756. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7757. "top-info": o.HELP_DESKTOP_360_2A,
  7758. "bottom-info": o.HELP_DESKTOP_360_2B,
  7759. "big-image": "images/nav_help_click_inside.png",
  7760. keyboard: "images/nav_help_inside_key.png"
  7761. },
  7762. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7763. "top-info": o.HELP_MOBILE_360_2,
  7764. "big-image": "images/nav_help_tap_inside.png"
  7765. },
  7766. this.assets[a.MORE_HELP] = {
  7767. desktop: {
  7768. "more-help-hlr": {
  7769. "top-info": o.HELP_MORE_HLR_A,
  7770. "big-image": "images/nav_help_expand.svg",
  7771. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7772. },
  7773. "more-help-dollhouse": {
  7774. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7775. "big-image": "images/nav_help_dollhouse.svg",
  7776. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7777. },
  7778. "more-help-floors": {
  7779. "top-info": o.HELP_MORE_FLOORS_A,
  7780. "big-image": "images/nav_help_floor picker.svg",
  7781. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7782. },
  7783. "more-help-tag": {
  7784. "top-info": o.HELP_MORE_TAG_A,
  7785. "big-image": "images/nav_help_tag.svg",
  7786. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7787. },
  7788. "more-help-zoom": {
  7789. "top-info": o.HELP_MORE_ZOOM_A,
  7790. "big-image": "images/nav_help_zoom.svg",
  7791. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7792. },
  7793. "more-help-tour": {
  7794. "top-info": o.HELP_MORE_TOUR_A,
  7795. "big-image": "images/nav_help_play.png",
  7796. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7797. },
  7798. "more-help-inside": {
  7799. "top-info": o.HELP_MORE_INSIDE_A,
  7800. "big-image": "images/nav_help_inside.svg",
  7801. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7802. },
  7803. "more-help-vr": {
  7804. "top-info": o.HELP_MORE_VR_A,
  7805. "big-image": "images/nav_help_vr.svg",
  7806. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7807. },
  7808. "more-help-360": {
  7809. "top-info": o.HELP_MORE_360_A,
  7810. "big-image": "images/nav_help_360.svg",
  7811. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7812. },
  7813. "more-help-fullscreen": {
  7814. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7815. "big-image": "images/nav_help_fullscreen.svg",
  7816. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7817. }
  7818. },
  7819. mobile: {
  7820. "more-help-hlr": {
  7821. "top-info": o.HELP_MORE_HLR_A,
  7822. "big-image": "images/nav_help_expand.svg",
  7823. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7824. },
  7825. "more-help-dollhouse": {
  7826. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7827. "big-image": "images/nav_help_dollhouse.svg",
  7828. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7829. },
  7830. "more-help-floors": {
  7831. "top-info": o.HELP_MORE_FLOORS_A,
  7832. "big-image": "images/nav_help_floor picker.svg",
  7833. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7834. },
  7835. "more-help-tag": {
  7836. "top-info": o.HELP_MORE_TAG_A,
  7837. "big-image": "images/nav_help_tag.svg",
  7838. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7839. },
  7840. "more-help-tour": {
  7841. "top-info": o.HELP_MORE_TOUR_A,
  7842. "big-image": "images/nav_help_play.png",
  7843. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7844. },
  7845. "more-help-inside": {
  7846. "top-info": o.HELP_MORE_INSIDE_A,
  7847. "big-image": "images/nav_help_inside.svg",
  7848. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  7849. },
  7850. "more-help-vr": {
  7851. "top-info": o.HELP_MORE_VR_A,
  7852. "big-image": "images/webvr.svg",
  7853. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  7854. },
  7855. "more-help-360": {
  7856. "top-info": o.HELP_MORE_360_A,
  7857. "big-image": "images/nav_help_360.svg",
  7858. "bottom-info": o.HELP_MOBILE_MORE_360_B
  7859. }
  7860. }
  7861. },
  7862. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  7863. desktop: {
  7864. left: {
  7865. "top-info": o.ROTATE,
  7866. "big-image": "images/nav_help_mouse_drag_left.png",
  7867. keyboard: "images/nav_help_keyboard_left_right.png"
  7868. },
  7869. middle: {
  7870. "top-info": o.MOVE,
  7871. "big-image": "images/nav_help_mouse_click.png",
  7872. keyboard: "images/nav_help_keyboard_up_down.png"
  7873. },
  7874. right: {
  7875. "top-info": o.PLAY,
  7876. "big-image": "images/Desktop-help-play-button.svg",
  7877. keyboard: "images/Desktop-help-spacebar-2.svg"
  7878. }
  7879. },
  7880. mobile: {
  7881. left: {
  7882. "top-info": o.ROTATE,
  7883. "big-image": "images/nav_help_gesture_drag.png"
  7884. },
  7885. middle: {
  7886. "top-info": o.MOVE,
  7887. "big-image": "images/nav_help_gesture_tap.png"
  7888. },
  7889. right: {
  7890. "top-info": o.PLAY,
  7891. "big-image": "images/mobile-help-play-button.svg"
  7892. }
  7893. }
  7894. },
  7895. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  7896. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  7897. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  7898. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  7899. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  7900. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  7901. }
  7902. },
  7903. fill: function(e, t, i) {
  7904. n.call(this, e, t, i, !0)
  7905. },
  7906. clear: function(e, t, i) {
  7907. n.call(this, e, t, i, !1)
  7908. }
  7909. }
  7910. }
  7911. , {
  7912. "../enum/HelpModalSize": 27,
  7913. "../enum/HelpModalType": 28,
  7914. "../enum/Viewmode": 51,
  7915. "../localization/localize": 108,
  7916. "../util/browser": 182
  7917. }],
  7918. 76: [function(e, t, i) {
  7919. "use strict";
  7920. t.exports = Object.freeze({
  7921. OPENED: "share.open",
  7922. CLOSED: "share.closed",
  7923. LINK_CLICKED: "share.linked"
  7924. })
  7925. }
  7926. , {}],
  7927. 77: [function(e, t, i) {
  7928. "use strict";
  7929. function n(n) {
  7930. function e(e, t) {
  7931. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  7932. I.emit(l.LINK_CLICKED, {
  7933. channel: n
  7934. }),
  7935. window.open(C[n], "shareWindow", i)
  7936. }
  7937. switch (n) {
  7938. case A.FACEBOOK:
  7939. e(580, 420);
  7940. break;
  7941. case A.TWITTER:
  7942. e(550, 440);
  7943. break;
  7944. case A.MAIL:
  7945. I.emit(l.LINK_CLICKED, {
  7946. channel: "email"
  7947. }),
  7948. window.open(C[n], "_blank");
  7949. break;
  7950. case A.LINKEDIN:
  7951. }
  7952. }
  7953. function r(e) {
  7954. I.emit(l.LINK_CLICKED, {
  7955. channel: "copylink"
  7956. });
  7957. var t = document.createRange();
  7958. t.selectNodeContents(v);
  7959. var i = window.getSelection();
  7960. i.removeAllRanges(),
  7961. i.addRange(t),
  7962. document.execCommand("copy"),
  7963. y.classList.remove("hidden"),
  7964. v.classList.add("highlighted")
  7965. }
  7966. function o(e) {
  7967. e && (e.stopPropagation(),
  7968. e.target === v) || (window.getSelection().removeAllRanges(),
  7969. v.classList.remove("highlighted"),
  7970. y.classList.add("hidden"))
  7971. }
  7972. var a = e("../../util/browser")
  7973. , s = e("../../localization/localize")
  7974. , l = e("./ShareEvents")
  7975. , c = e("../../util/common")
  7976. , h = e("events").EventEmitter
  7977. , u = document.getElementById("sharing")
  7978. , d = document.getElementById("share-modal")
  7979. , p = document.getElementById("share-close")
  7980. , f = document.getElementById("facebook-share")
  7981. , g = document.getElementById("twitter-share")
  7982. , m = document.getElementById("mail-share")
  7983. , v = document.getElementById("share-url-text")
  7984. , y = document.getElementById("copy-success")
  7985. , A = Object.freeze({
  7986. FACEBOOK: "facebook",
  7987. TWITTER: "twitter",
  7988. MAIL: "mail",
  7989. LINKEDIN: "linkedin"
  7990. })
  7991. , C = {};
  7992. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  7993. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  7994. C[A.MAIL] = "mailto:?subject=";
  7995. var I = {
  7996. init: function(e) {
  7997. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  7998. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  7999. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8000. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8001. u.addEventListener("click", this.toggle.bind(this)),
  8002. p.addEventListener("click", this.hide.bind(this)),
  8003. v.addEventListener("click", r),
  8004. d.addEventListener("click", o),
  8005. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8006. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8007. m.addEventListener("click", n.bind(this, A.MAIL)),
  8008. v.textContent = window.location.href + "&utm_source=4",
  8009. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8010. u.classList.remove("hidden")
  8011. },
  8012. show: function() {
  8013. this.emit(l.OPENED),
  8014. d.classList.add("fadeIn")
  8015. },
  8016. hide: function() {
  8017. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8018. document.selection && document.selection.empty(),
  8019. window.getSelection().removeAllRanges(),
  8020. o(),
  8021. d.classList.remove("fadeIn"))
  8022. },
  8023. toggle: function() {
  8024. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8025. }
  8026. };
  8027. c.extendObject(I, h.prototype),
  8028. t.exports = I
  8029. }
  8030. , {
  8031. "../../localization/localize": 108,
  8032. "../../util/browser": 182,
  8033. "../../util/common": 185,
  8034. "./ShareEvents": 76,
  8035. events: 202
  8036. }],
  8037. 78: [function(e, t, i) {
  8038. "use strict";
  8039. t.exports = Object.freeze({
  8040. OPENED: "terms.opened",
  8041. CLOSED: "terms.closed"
  8042. })
  8043. }
  8044. , {}],
  8045. 79: [function(e, t, i) {
  8046. "use strict";
  8047. var n = e("./TermsEvent")
  8048. , r = e("../../localization/localize")
  8049. , o = e("../../analytics")
  8050. , a = e("../../util/ajax")
  8051. , s = e("../../util/common")
  8052. , l = e("events").EventEmitter
  8053. , c = document.getElementById("terms-modal")
  8054. , h = {
  8055. init: function() {
  8056. $(".footer-terms").on("click", function(e) {
  8057. e.preventDefault(),
  8058. this.show()
  8059. }
  8060. .bind(this)),
  8061. $("#terms-modal .close").on("click", this.hide.bind(this))
  8062. },
  8063. show: function() {
  8064. this.emit(n.OPENED),
  8065. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8066. var t = $("#terms-text").html(e);
  8067. o.track("showcase_gui", {
  8068. gui_action: "click_terms_button",
  8069. interaction_source: "gui"
  8070. }),
  8071. t.find("a").attr("target", "_blank")
  8072. }).fail(function() {
  8073. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8074. }),
  8075. c.classList.add("fadeIn")
  8076. },
  8077. hide: function(e) {
  8078. e && e.preventDefault(),
  8079. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8080. c.classList.remove("fadeIn")
  8081. }
  8082. };
  8083. s.extendObject(h, l.prototype),
  8084. t.exports = h
  8085. }
  8086. , {
  8087. "../../analytics": 4,
  8088. "../../localization/localize": 108,
  8089. "../../util/ajax": 181,
  8090. "../../util/common": 185,
  8091. "./TermsEvent": 78,
  8092. events: 202
  8093. }],
  8094. 80: [function(e, t, i) {
  8095. "use strict";
  8096. t.exports = Object.freeze({
  8097. OPEN_INFO: "title.open.info",
  8098. CLOSE_INFO: "title.close.info",
  8099. SHOW_INFO: "title.show.info",
  8100. HIDE_INFO: "title.hide.info",
  8101. LINK_CLICKED: "title.link.click",
  8102. CONTACT_LINK_CLICKED: "title.contact.click",
  8103. ORIGIN_LINK_CLICKED: "title.origin.click"
  8104. })
  8105. }
  8106. , {}],
  8107. 81: [function(e, t, i) {
  8108. "use strict";
  8109. var o = e("../../settings");
  8110. t.exports.init = function(e, t) {
  8111. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8112. function e(e) {
  8113. t.shouldShowtags = "show" === this.value,
  8114. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8115. }
  8116. document.getElementById("tag-toggles").classList.remove("hidden"),
  8117. document.getElementById("radio-tag-show").checked = !0;
  8118. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8119. n[r].addEventListener("change", e)
  8120. }(e, t)
  8121. }
  8122. }
  8123. , {
  8124. "../../settings": 166
  8125. }],
  8126. 82: [function(S, M, e) {
  8127. (function(e) {
  8128. "use strict";
  8129. function i(e) {
  8130. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8131. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8132. _.appendChild(function(e) {
  8133. var t = document.createElement("a");
  8134. return t.id = "url",
  8135. t.target = "_blank",
  8136. t.href = e,
  8137. t.innerText = e,
  8138. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8139. t
  8140. }(e)),
  8141. b.forEach(function(e) {
  8142. e.classList.add("share-link")
  8143. }),
  8144. 0))
  8145. }
  8146. function s(e, t) {
  8147. var i = e
  8148. , n = t;
  8149. return function(e, t) {
  8150. i.push(t || n, e)
  8151. }
  8152. }
  8153. var l = S("../../util/browser")
  8154. , t = S("../../util/common")
  8155. , n = S("../../util/logger")
  8156. , r = S("../../localization/localize")
  8157. , o = S("./titleBarSettings")
  8158. , c = S("../../settings")
  8159. , a = S("./TitleEvents")
  8160. , h = S("events").EventEmitter
  8161. , u = new n(e)
  8162. , d = document.querySelector(".pinTop.left")
  8163. , p = document.getElementsByClassName("title-container")[0]
  8164. , f = document.getElementById("title-toggle").querySelector("i")
  8165. , g = document.getElementById("meta-info-wrapper")
  8166. , m = document.getElementById("meta-info")
  8167. , v = document.getElementById("meta-description")
  8168. , y = document.getElementsByClassName("contact-info")[0]
  8169. , A = document.getElementById("contact-data")
  8170. , C = document.getElementById("addressTxt")
  8171. , I = document.getElementById("tag-toggles")
  8172. , E = document.getElementById("share-origin")
  8173. , _ = document.getElementById("share-link-wrapper")
  8174. , b = [m, g, p]
  8175. , w = !1
  8176. , T = !1
  8177. , x = {
  8178. populate: function(e) {
  8179. if (function(e, t) {
  8180. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8181. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8182. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8183. document.getElementById("gui-name").classList.add("noCoBrand"),
  8184. document.getElementById("cobrandTitle").classList.add("hidden")),
  8185. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8186. !1)
  8187. }(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  8188. if (function(e) {
  8189. e ? (w = !0,
  8190. v.innerHTML = e) : v.classList.add("hidden")
  8191. }(e.description),
  8192. function(e, t, i, n) {
  8193. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8194. w = !0;
  8195. var r = []
  8196. , o = s(r, "<br>");
  8197. if (e && o('<span id="contactName">' + e + "</span>"),
  8198. t) {
  8199. var a = n || t;
  8200. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8201. }
  8202. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8203. r[0] = "",
  8204. A.innerHTML = r.join("")
  8205. } else
  8206. y.classList.add("hidden")
  8207. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8208. function(e) {
  8209. if ("string" == typeof e)
  8210. try {
  8211. e = JSON.parse(e)
  8212. } catch (e) {
  8213. return u.warn("Unable to parse address data"),
  8214. C.parentElement.classList.add("hidden")
  8215. }
  8216. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8217. w = !0;
  8218. var t = []
  8219. , i = s(t, " ");
  8220. e.address_1 && i(e.address_1),
  8221. e.address_2 && i(e.address_2),
  8222. e.city && i(e.city, ", "),
  8223. e.state && i(e.state, ", "),
  8224. e.zip && i(e.zip, e.state ? " " : ", "),
  8225. t[0] = "",
  8226. C.innerText = t.join("")
  8227. } else
  8228. C.parentElement.classList.add("hidden")
  8229. }(e.address),
  8230. w) {
  8231. var t = document.createElement("br");
  8232. I.insertBefore(t, I.firstElementChild)
  8233. }
  8234. e.socialSharing && c.share.enabled && (T = i(e.url))
  8235. }
  8236. },
  8237. finishSetup: function(e) {
  8238. w = w || !!e,
  8239. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8240. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8241. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8242. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8243. }),
  8244. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8245. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8246. contact_type: e.getAttribute("id")
  8247. }))
  8248. }),
  8249. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8250. },
  8251. toggleMeta: function(e, t) {
  8252. var i = document.getElementById("model-title");
  8253. t && t.preventDefault();
  8254. var n = m.classList.contains("expand");
  8255. e && !n || (n ? (b.forEach(function(e) {
  8256. e.classList.remove("expand")
  8257. }),
  8258. this.emit(a.CLOSE_INFO),
  8259. i.classList.remove("expand")) : (b.forEach(function(e) {
  8260. e.classList.add("expand")
  8261. }),
  8262. i.classList.add("expand"),
  8263. this.emit(a.OPEN_INFO)))
  8264. },
  8265. setupToggling: function() {
  8266. g.style.height = m.offsetHeight + "px",
  8267. m.addEventListener("transitionend", function() {
  8268. g.style.height = m.offsetHeight + "px"
  8269. })
  8270. },
  8271. toggleTitle: function(e) {
  8272. e && e.preventDefault(),
  8273. d.classList.contains("closed") ? (d.classList.add("open"),
  8274. f.classList.remove("icon-dpad-right"),
  8275. f.classList.add("icon-dpad-left"),
  8276. this.emit(a.SHOW_INFO),
  8277. setTimeout(function() {
  8278. d.classList.remove("closed"),
  8279. d.classList.remove("open")
  8280. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8281. f.classList.remove("icon-dpad-left"),
  8282. f.classList.add("icon-dpad-right"),
  8283. this.emit(a.HIDE_INFO))
  8284. }
  8285. };
  8286. t.extendObject(x, h.prototype),
  8287. M.exports = x
  8288. }
  8289. ).call(this, "/js/gui/title/titleBar.js")
  8290. }
  8291. , {
  8292. "../../localization/localize": 108,
  8293. "../../settings": 166,
  8294. "../../util/browser": 182,
  8295. "../../util/common": 185,
  8296. "../../util/logger": 189,
  8297. "./TitleEvents": 80,
  8298. "./titleBarSettings": 83,
  8299. events: 202
  8300. }],
  8301. 83: [function(e, t, i) {
  8302. "use strict";
  8303. t.exports = Object.freeze({
  8304. minTooltipCharacters: 19,
  8305. removeAnimationClasses: 500
  8306. })
  8307. }
  8308. , {}],
  8309. 84: [function(e, t, i) {
  8310. "use strict";
  8311. function n() {
  8312. v.playTour(),
  8313. y && clearTimeout(y),
  8314. c(),
  8315. E.removeClass("fadeIn")
  8316. }
  8317. function r() {
  8318. A.classList.contains("playing") && (v.stopTour(),
  8319. E.addClass("fadeIn"),
  8320. setTimeout(function() {
  8321. E.removeClass("fadeIn")
  8322. }, h.tourInteraction.showPauseButton),
  8323. M || (clearTimeout(y),
  8324. y = setTimeout(s, h.tourInteraction.showModal)),
  8325. setTimeout(function() {
  8326. A.classList.remove("playing")
  8327. }, h.tourInteraction.allowNextClick))
  8328. }
  8329. function o() {
  8330. v.tourInProgress && (v.stopTour(),
  8331. v.endTourProgress(),
  8332. A.classList.remove("playing"))
  8333. }
  8334. function a() {
  8335. _.is(":visible") ? n() : r()
  8336. }
  8337. function s() {//去掉导览结束时的提示
  8338. /* if (!h.tourInteraction.disabled) {
  8339. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8340. T.addClass("fadeIn tour " + p.deviceType);
  8341. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8342. if (!h.tourInteraction.smallModal)
  8343. e = v.player.mode === d.PANORAMA && !v.player.currentPano.isAligned() || v.player.mode === d.DOLLHOUSE ? d.OUTDOOR : v.player.mode === d.FLOORPLAN ? d.FLOORPLAN : d.PANORAMA,
  8344. p.fill(x, g.TOUR_INTERACTION[e]),
  8345. T.addClass(e);
  8346. T.addClass(t)
  8347. } */
  8348. }
  8349. function l(e, t) {
  8350. if (t) {
  8351. var i = "keydown" === t.type
  8352. , n = t.which === u.SPACE || v.tourIsPlaying;
  8353. i && n || e || (M = !0),
  8354. v.atEndOfTour() && c(),
  8355. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8356. c(),
  8357. t.which !== u.SPACE && o()),
  8358. i && n && a()
  8359. }
  8360. }
  8361. function c() {
  8362. T.removeClass("fadeIn")
  8363. }
  8364. var h = (e("../util/browser"),
  8365. e("../settings"))
  8366. , u = e("../enum/Keys")
  8367. , d = e("../enum/Viewmode")
  8368. , p = (e("./helpManager"),
  8369. e("./populateModal"))
  8370. , f = e("../enum/DirectorEvents")
  8371. , g = e("../enum/HelpModalType")
  8372. , m = e("../enum/HelpModalSize")
  8373. , v = null
  8374. , y = null
  8375. , A = document.getElementById("pause-overlay")
  8376. , C = document.getElementById("player")
  8377. , I = document.getElementById("gui")
  8378. , E = $("#pause-icon").eq(0)
  8379. , _ = $("#play").eq(0)
  8380. , b = $("#playHead").eq(0)
  8381. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8382. , T = $("#interaction-modal").eq(0)
  8383. , x = $("#interaction-modal .interaction").toArray()
  8384. , S = ["touchstart", "mousedown", "pointerdown"]
  8385. , M = !1;
  8386. t.exports.init = function(e) {
  8387. v = e,
  8388. S.forEach(function(t) {
  8389. C.addEventListener(t, l.bind(this, !1), !0),
  8390. I.addEventListener(t, l.bind(this, !0), !0),
  8391. A.addEventListener(t, r, !0),
  8392. w.forEach(function(e) {
  8393. e.addEventListener(t, o, !0)
  8394. }),
  8395. $("#drawer img").on(t, o)
  8396. }),
  8397. document.addEventListener("keydown", l.bind(this, !1), !0),
  8398. v.on(f.TourStart, function() {
  8399. A.classList.add("playing")
  8400. })
  8401. }
  8402. ,
  8403. t.exports.play = n,
  8404. t.exports.pause = r,
  8405. t.exports.pauseWithoutCTA = o,
  8406. t.exports.togglePlay = a,
  8407. t.exports.stopTour = function() {
  8408. b.hasClass("playing") && (clearTimeout(y),
  8409. v.atEndOfTour() ? (A.classList.remove("playing"),
  8410. s()) : E.removeClass("fadeIn"))
  8411. }
  8412. ,
  8413. t.exports.dismissModal = c
  8414. }
  8415. , {
  8416. "../enum/DirectorEvents": 23,
  8417. "../enum/HelpModalSize": 27,
  8418. "../enum/HelpModalType": 28,
  8419. "../enum/Keys": 30,
  8420. "../enum/Viewmode": 51,
  8421. "../settings": 166,
  8422. "../util/browser": 182,
  8423. "./helpManager": 68,
  8424. "./populateModal": 75
  8425. }],
  8426. 85: [function(e, t, i) {
  8427. "use strict";
  8428. t.exports = Object.freeze({
  8429. OPENED: "vr.modal.opened",
  8430. LAUNCH: "vr.modal.launch",
  8431. CLOSED: "vr.modal.closed",
  8432. NEXT: "vr.modal.next",
  8433. PREV: "vr.modal.prev",
  8434. STORE: "vr.modal.store",
  8435. falseICECHOSEN: "vr.modal.device"
  8436. })
  8437. }
  8438. , {}],
  8439. 86: [function(e, t, i) {
  8440. "use strict";
  8441. var h = e("../../util/browser")
  8442. , u = e("../../enum/VRApps")
  8443. , n = e("../../enum/VRPlatforms")
  8444. , d = e("../../util/ajax")
  8445. , p = e("../../settings")
  8446. , r = {};
  8447. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8448. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8449. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8450. u) {
  8451. var a = u[o];
  8452. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8453. }
  8454. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8455. "https://" + s);
  8456. t.exports.init = function(e, t, o) {
  8457. function a(e, t, i, n) {
  8458. function r() {
  8459. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8460. }
  8461. return h.valueFromHash("vrcoll", !1) ? l + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(i) + "&ld=" + encodeURIComponent(n) + "&display=" + e + r() : c + "&m=" + t + "&display=" + e + r()
  8462. }
  8463. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8464. , l = g + "/vr/dlist/?ret=" + s
  8465. , c = g + "/vr/show/?ret=" + s;
  8466. switch (e) {
  8467. case n.IOS:
  8468. !function(t, e, i, n) {
  8469. var r = a(t, e, i, n)
  8470. , o = {
  8471. responseType: "json",
  8472. data: {
  8473. branch_key: p.appConfig.branch_key,
  8474. data: {
  8475. m: e,
  8476. full_url: r,
  8477. $desktop_url: "",
  8478. $og_app_id: "331853976762864119",
  8479. $og_title: i,
  8480. $og_description: n,
  8481. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8482. $canonical_url: window.location.href
  8483. }
  8484. }
  8485. };
  8486. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8487. f[t] = e.url
  8488. }).fail(function(e) {
  8489. f[t] = e
  8490. }
  8491. .bind(this, r))
  8492. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8493. break;
  8494. default:
  8495. !function(e, t, i) {
  8496. for (var n in u) {
  8497. var r = u[n]
  8498. , o = a(r, e, t, i);
  8499. f[r] = o
  8500. }
  8501. }(t.sid, t.name, t.summary)
  8502. }
  8503. }
  8504. ,
  8505. t.exports.launch = function(e) {
  8506. var t = f[e];
  8507. window.open(t, "_blank")
  8508. }
  8509. ,
  8510. t.exports.launchStore = function(e) {
  8511. var t = r[e];
  8512. window.open(t, "_blank")
  8513. }
  8514. }
  8515. , {
  8516. "../../enum/VRApps": 46,
  8517. "../../enum/VRPlatforms": 49,
  8518. "../../settings": 166,
  8519. "../../util/ajax": 181,
  8520. "../../util/browser": 182
  8521. }],
  8522. 87: [function(e, t, i) {
  8523. "use strict";
  8524. function c(e) {
  8525. var t;
  8526. switch (e) {
  8527. case y.IOS:
  8528. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8529. case y.Android:
  8530. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8531. }
  8532. return !1
  8533. }
  8534. function h(e) {
  8535. switch (e) {
  8536. case y.Android:
  8537. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8538. x.filter(".gearvr").off().on("click", q.gear),
  8539. n(k, U, "logo-button", "same-line");
  8540. break;
  8541. case y.UnsupportedAndroid:
  8542. n("", H, "", "");
  8543. break;
  8544. case y.IOS:
  8545. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8546. n(k, "", "logo-button", "");
  8547. break;
  8548. case y.Desktop:
  8549. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8550. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8551. n(k, U, "logo-button", "same-line"),
  8552. Q.cardboard()
  8553. }
  8554. }
  8555. function u(e) {
  8556. $(".p1, .p2, .p3").hide(),
  8557. l.insertAfter(T),
  8558. w.removeClass("front-page"),
  8559. w.removeClass("details-page"),
  8560. w.removeClass("lastPage"),
  8561. x.removeClass("logo-button"),
  8562. x.removeClass("same-line"),
  8563. T.removeClass("headsetOptions"),
  8564. S.attr("src", ""),
  8565. S.filter(".second").removeClass("gear"),
  8566. S.css("display", "inline-block"),
  8567. S.off(),
  8568. M.filter(".second").css("display", ""),
  8569. O.css("display", "none"),
  8570. $(".p" + (e + 1) + _).show(),
  8571. S.filter(".third").insertBefore(M.filter(".third"))
  8572. }
  8573. function n(e, t, i, n) {
  8574. w.addClass("front-page"),
  8575. S.filter(".first").attr("src", e),
  8576. S.filter(".second").attr("src", t),
  8577. x.filter(".first").addClass(i),
  8578. x.filter(".second").addClass(i),
  8579. x.addClass(n),
  8580. ".show-desktop" === _ && T.insertAfter(l)
  8581. }
  8582. function r(e, t, i) {
  8583. T.addClass("headsetOptions"),
  8584. x.off(),
  8585. S.filter(".second").attr("src", t),
  8586. O.css("display", "block"),
  8587. M.filter(".second").css("display", "none"),
  8588. O.on("click", function() {
  8589. u(b.Title),
  8590. h(y.Desktop)
  8591. }),
  8592. e && (X.emit(C.falseICECHOSEN, {
  8593. name: v.GearVR
  8594. }),
  8595. S.filter(".first").attr("src", e),
  8596. S.filter(".second").addClass("gear"),
  8597. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8598. Q.gearvr()),
  8599. i && (X.emit(C.falseICECHOSEN, {
  8600. name: v.Cardboard
  8601. }),
  8602. S.filter(".third").attr("src", i),
  8603. S.filter(".third").show(),
  8604. S.filter(".third").insertAfter(S.filter(".second")),
  8605. S.filter(".third").addClass("link"),
  8606. S.filter(".second").addClass("link"),
  8607. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8608. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8609. Q.cardboard())
  8610. }
  8611. function d(e, t) {
  8612. switch (t) {
  8613. case y.IOS:
  8614. j = W,
  8615. Y = G;
  8616. break;
  8617. case y.Desktop:
  8618. e === b.Cardboard ? (j = N,
  8619. Y = B,
  8620. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8621. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8622. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8623. Y = "");
  8624. break;
  8625. default:
  8626. Y = e === b.Cardboard ? (j = H,
  8627. G) : (j = V,
  8628. z)
  8629. }
  8630. }
  8631. function p(e, t, i) {
  8632. w.find(".inner").addClass("details-page"),
  8633. w.addClass("details-page"),
  8634. S.filter(".first").attr("src", e),
  8635. S.filter(".second").attr("src", t),
  8636. S.filter(".third").attr("src", i)
  8637. }
  8638. function f() {
  8639. var e = 1 < g.aspectRatio() && g.isMobile();
  8640. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8641. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8642. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8643. }
  8644. var g = e("../../util/browser")
  8645. , m = e("./vrLink")
  8646. , v = e("../../enum/VRApps")
  8647. , y = e("../../enum/VRPlatforms")
  8648. , A = e("../../enum/VRPages")
  8649. , C = e("./vrEvent")
  8650. , o = (e("../../settings"),
  8651. e("../../constants"))
  8652. , I = e("../../localization/localize")
  8653. , a = e("../../util/common")
  8654. , s = e("events").EventEmitter
  8655. , E = 0
  8656. , _ = null
  8657. , b = A.standard
  8658. , w = $(".vr-popup")
  8659. , l = w.find(".vr-popup-body")
  8660. , T = w.find(".vr-images")
  8661. , x = w.find(".img-container")
  8662. , S = w.find(".vr-sm-image")
  8663. , M = x.find(".vr-img-caption")
  8664. , R = $(".vr-buttons").find(".prev-button")
  8665. , P = $(".vr-buttons").find(".next-button")
  8666. , O = T.find(".front-close")
  8667. , L = $(".vr-page")
  8668. , D = w.find("img")
  8669. , N = "images/apple-store.png"
  8670. , F = "images/badge-oculus.png"
  8671. , B = "images/badge-cardboard.png"
  8672. , V = "images/logo-samsung.png"
  8673. , k = "images/headset-cardboard.png"
  8674. , U = "images/headset-gearvr.png"
  8675. , H = "images/ico-android-robot.png"
  8676. , z = "images/ico-gearvr.png"
  8677. , G = "images/ico-vr.png"
  8678. , W = "images/apple-logo-white.svg"
  8679. , j = null
  8680. , Y = null
  8681. , q = {}
  8682. , X = {
  8683. init: function(e, t) {
  8684. function i(e) {
  8685. X.emit(C.STORE, {
  8686. type: e
  8687. }),
  8688. m.launchStore(e)
  8689. }
  8690. function n(e) {
  8691. switch (e !== b.pageCount && (u(e),
  8692. L.text(e + 1 + " / " + b.pageCount)),
  8693. e) {
  8694. case b.Title:
  8695. R.css("display", "none"),
  8696. P.text(a[e]),
  8697. h(r);
  8698. break;
  8699. case b.Cardboard:
  8700. R.css("display", "block"),
  8701. P.text(a[e]),
  8702. x.filter(".cardboard").off(),
  8703. x.filter(".gearvr").off(),
  8704. d(e, r),
  8705. p(k, j, Y);
  8706. break;
  8707. case b.Gear:
  8708. P.text(a[e]),
  8709. d(e, r),
  8710. w.addClass("lastPage"),
  8711. p(U, j, Y);
  8712. break;
  8713. case b.pageCount:
  8714. w.removeClass("fadeIn"),
  8715. X.emit(C.CLOSED)
  8716. }
  8717. D.filter("[src='']").hide()
  8718. }
  8719. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8720. _ = ".show-supported",
  8721. y.Android) : (w.addClass("unsupported"),
  8722. _ = ".show-unsupported",
  8723. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8724. _ = ".show-ios",
  8725. b = A.ios,
  8726. y.IOS) : (w.addClass("desktop"),
  8727. _ = ".show-desktop",
  8728. y.Desktop);
  8729. function o(e) {
  8730. X.emit(C.LAUNCH, {
  8731. vr_platform: r,
  8732. vr_app: e
  8733. }),
  8734. m.launch(e)
  8735. }
  8736. m.init(r, e, t),
  8737. r !== y.Desktop && w.addClass("mobile"),
  8738. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8739. q.gear = o.bind(this, v.GearVR),
  8740. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8741. f(),
  8742. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8743. $(_).show();
  8744. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8745. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8746. r === y.IOS && (a.splice(1, 1),
  8747. s.splice(1, 1)),
  8748. $("#vr").on("click", function(e) {
  8749. e.preventDefault(),
  8750. window.vrEnabled || (window.vrEnabled = !0,
  8751. this.classList.add("active"),
  8752. $("#gui div").not("#vrOff").addClass("vrHide"),
  8753. $("#vrOffImg").css({
  8754. display: "inline-block"
  8755. }))
  8756. }),
  8757. $("#vrOff").on("click", function() {
  8758. window.vrEnabled = !1,
  8759. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8760. $("#vrOffImg").css({
  8761. display: "none"
  8762. }),
  8763. $("#player canvas").css({
  8764. width: "",
  8765. height: ""
  8766. }),
  8767. $("#vr").removeClass("active")
  8768. });
  8769. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8770. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8771. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8772. $("span.modelLink").text(l),
  8773. R.on("click", function(e) {
  8774. X.emit(C.PREV),
  8775. n(--E)
  8776. }),
  8777. P.on("click", function(e) {
  8778. P.text(),
  8779. X.emit(C.NEXT, {
  8780. nextAction: s[E]
  8781. }),
  8782. n(++E)
  8783. }),
  8784. w.find(".close").on("click", X.dismiss)
  8785. },
  8786. dismiss: function() {
  8787. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8788. X.emit(C.CLOSED))
  8789. },
  8790. isDeviceSupported: c
  8791. };
  8792. a.extendObject(X, s.prototype),
  8793. $(window).resize(f);
  8794. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8795. K = M.filter(".first").find(".gearvr"),
  8796. {
  8797. cardboard: function() {
  8798. K.addClass("hidden"),
  8799. Z.removeClass("hidden")
  8800. },
  8801. gearvr: function() {
  8802. Z.addClass("hidden"),
  8803. K.removeClass("hidden")
  8804. }
  8805. });
  8806. t.exports = X
  8807. }
  8808. , {
  8809. "../../constants": 8,
  8810. "../../enum/VRApps": 46,
  8811. "../../enum/VRPages": 48,
  8812. "../../enum/VRPlatforms": 49,
  8813. "../../localization/localize": 108,
  8814. "../../settings": 166,
  8815. "../../util/browser": 182,
  8816. "../../util/common": 185,
  8817. "./vrEvent": 85,
  8818. "./vrLink": 86,
  8819. events: 202
  8820. }],
  8821. 88: [function(e, t, i) {
  8822. "use strict";
  8823. t.exports = Object.freeze({
  8824. OPENED: "webvr.modal.opened",
  8825. SHOW_TERMS: "webvr.footer.show.terms"
  8826. })
  8827. }
  8828. , {}],
  8829. 89: [function(B, V, e) {
  8830. (function(e) {
  8831. "use strict";
  8832. function a() {
  8833. function t() {
  8834. p.isPresenting || (r.info("exiting webVR"),
  8835. c("webvr_exit_app"),
  8836. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  8837. window.removeEventListener("vrdisplaypresentchange", t))
  8838. }
  8839. r.info("Headset mounted"),
  8840. u.suspend();
  8841. var e = document.createElement("canvas");
  8842. for (e.getContext("webgl"),
  8843. e.className = "webvr-canvas",
  8844. document.bgColor = "#000",
  8845. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  8846. document.body.removeChild(document.body.firstChild);
  8847. document.body.appendChild(e),
  8848. c("webvr_enter_app"),
  8849. p.requestPresent([{
  8850. source: e,
  8851. predistorted: !0
  8852. }]).catch(function(e) {
  8853. r.error("Failed to present: " + e),
  8854. c("webvr_exit_calibrate"),
  8855. t()
  8856. }),
  8857. d.then(function() {
  8858. window.dispatchEvent(new Event("vrapp-start"))
  8859. }),
  8860. window.addEventListener("vrdisplaypresentchange", t)
  8861. }
  8862. function s() {
  8863. c("webvr_modal_close"),
  8864. _.find(".enter-button").off("click", a),
  8865. E.fadeOut(g.guiAnimationSpeed, function() {
  8866. _.toggleClass("hidden", !1),
  8867. b.toggleClass("hidden", !0),
  8868. f.exitFullscreen()
  8869. }),
  8870. I.fadeIn(g.guiAnimationSpeed)
  8871. }
  8872. function t() {
  8873. M.toggleClass("hidden", !0),
  8874. S.toggleClass("hidden", !1)
  8875. }
  8876. function l() {
  8877. _.toggleClass("hidden"),
  8878. b.toggleClass("hidden")
  8879. }
  8880. function c(e) {
  8881. var t = f.isLandscape() ? "landscape" : "portrait";
  8882. i.trackAlways("showcase_gui", {
  8883. gui_action: e,
  8884. orientation: t
  8885. })
  8886. }
  8887. function h() {
  8888. var e = f.isLandscape();
  8889. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  8890. }
  8891. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  8892. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  8893. B("../../localization/localize")), n = B("../../util/common"), r = new (B("../../util/logger"))(e), o = B("events").EventEmitter, I = $("#gui"), E = $(".webvr-popup"), _ = $(".webvr-popup .page.p1"), b = $(".webvr-popup .page.p2"), w = E.find(".image"), T = $(".webvr-popup .detail.headset"), x = $(".webvr-popup .detail.phone"), S = $(".webvr-popup .tab-content.webvr"), M = $(".webvr-popup .tab-content.native"), R = "images/headset-cardboard.png", P = "https://madeby.google.com/vr/", O = "webvr_daydream_link", L = P, D = O, N = {
  8894. init: function(e, t, i, n) {
  8895. function r(e) {
  8896. e.preventDefault(),
  8897. o(e.currentTarget.id)
  8898. }
  8899. function o(i) {
  8900. F[i](),
  8901. Object.keys(F).map(function(e, t) {
  8902. $("#" + e).toggleClass("tabs-underlined", e === i)
  8903. })
  8904. }
  8905. p = i,
  8906. u = t,
  8907. y.init(m.Android, e, n),
  8908. h(),
  8909. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  8910. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  8911. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  8912. w.filter(".device-headset-side").attr("src", R),
  8913. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  8914. $("#vr").on("click", function(e) {
  8915. e.preventDefault(),
  8916. c("click_webvr_button"),
  8917. E.is(":hidden") && (N.emit(A.OPENED),
  8918. I.fadeOut(g.guiAnimationSpeed),
  8919. E.fadeIn(g.guiAnimationSpeed),
  8920. function() {
  8921. if (!d) {
  8922. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  8923. d = new Promise(function(e, t) {
  8924. var i = document.createElement("script");
  8925. i.type = "text/javascript",
  8926. i.src = n,
  8927. i.onload = e,
  8928. document.head.appendChild(i)
  8929. }
  8930. )
  8931. }
  8932. _.find(".enter-button").on("click", a)
  8933. }())
  8934. }),
  8935. $(".webvr-popup .close").on("click", function(e) {
  8936. e.preventDefault(),
  8937. _.hasClass("hidden") ? (c("webvr_help_close"),
  8938. l()) : s()
  8939. }),
  8940. $("#tabcardboard").on("click", r),
  8941. $("#tabdaydream").on("click", r),
  8942. $("#tabnative").on("click", r),
  8943. $(".webvr-popup .open-with-app").on("click", function(e) {
  8944. e.preventDefault(),
  8945. c("webvr_learn_more"),
  8946. o("tabnative"),
  8947. l()
  8948. }),
  8949. $(".webvr-popup .help").on("click", function(e) {
  8950. e.preventDefault(),
  8951. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  8952. l()
  8953. }),
  8954. $(".webvr-popup .terms").on("click", function(e) {
  8955. e.preventDefault(),
  8956. c("webvr_click_terms"),
  8957. s(),
  8958. N.emit(A.SHOW_TERMS)
  8959. }),
  8960. T.on("click", function(e) {
  8961. e.preventDefault(),
  8962. c(D),
  8963. window.open(L, "_blank")
  8964. }),
  8965. x.on("click", function(e) {
  8966. e.preventDefault(),
  8967. c("webvr_phone_link"),
  8968. window.open("https://vr.google.com/daydream/phones/", "_blank")
  8969. }),
  8970. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  8971. e.preventDefault(),
  8972. c("webvr_cardboard_link"),
  8973. y.launch(v.CardboardAndroid)
  8974. }),
  8975. $(".webvr-popup .badge-oculus").on("click", function(e) {
  8976. e.preventDefault(),
  8977. c("webvr_oculus_link"),
  8978. y.launch(v.GearVR)
  8979. })
  8980. }
  8981. }, F = {
  8982. tabcardboard: function() {
  8983. w.filter(".device-headset").attr("src", R),
  8984. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  8985. L = "https://vr.google.com/cardboard/get-cardboard/",
  8986. D = "webvr_cardboard_link",
  8987. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  8988. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  8989. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  8990. t()
  8991. },
  8992. tabdaydream: function() {
  8993. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  8994. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  8995. L = P,
  8996. D = O,
  8997. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  8998. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  8999. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9000. t()
  9001. },
  9002. tabnative: function() {
  9003. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9004. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9005. M.toggleClass("hidden", !1),
  9006. S.toggleClass("hidden", !0)
  9007. }
  9008. };
  9009. n.extendObject(N, o.prototype),
  9010. $(window).resize(h),
  9011. V.exports = N
  9012. }
  9013. ).call(this, "/js/gui/webvr/webVRgui.js")
  9014. }
  9015. , {
  9016. "../../analytics": 4,
  9017. "../../constants": 8,
  9018. "../../enum/VRApps": 46,
  9019. "../../enum/VRPlatforms": 49,
  9020. "../../localization/localize": 108,
  9021. "../../settings": 166,
  9022. "../../util/browser": 182,
  9023. "../../util/common": 185,
  9024. "../../util/logger": 189,
  9025. "./../gui": 65,
  9026. "./../vr/vrLink": 86,
  9027. "./WebVrEvent": 88,
  9028. events: 202
  9029. }],
  9030. 90: [function(e, t, i) {
  9031. "use strict";
  9032. function n(e, t, i, n, r) {
  9033. this.floorId = n || 0 === n ? n : -1,
  9034. this.roomId = r || "",
  9035. this.labelId = e,
  9036. this.position = (new o.Vector3).copy(t),
  9037. this.text = i
  9038. }
  9039. var o = e("three")
  9040. , r = e("../util/browser");
  9041. n.prototype.build = function() {
  9042. var e = window.document.createElement("div");
  9043. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9044. var t = window.document.createElement("div");
  9045. t.setAttribute("class", "gui-floorplan-label-text");
  9046. var i = window.document.createTextNode(this.text);
  9047. t.appendChild(i),
  9048. e.appendChild(t),
  9049. window.document.body.appendChild(e),
  9050. this.labelGui = e,
  9051. this.textBlock = t,
  9052. $(this.labelGui).hide();
  9053. var n = window.getComputedStyle(this.labelGui);
  9054. this.initialTransform = n.transform || n.webkitTransform
  9055. }
  9056. ,
  9057. t.exports = n
  9058. }
  9059. , {
  9060. "../util/browser": 182,
  9061. three: 217
  9062. }],
  9063. 91: [function(e, t, i) {
  9064. "use strict";
  9065. function n() {
  9066. this.player = null,
  9067. this.modelManager = null,
  9068. this.container = null
  9069. }
  9070. var c, o, r = e("three"), a = (e("../util/common"),
  9071. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9072. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9073. e("../util/transitions"),
  9074. e("../util/lerp"),
  9075. e("../util/browser"));
  9076. n.prototype.init = function(e, t, i) {
  9077. this.player = e,
  9078. this.modelManager = t,
  9079. this.container = i,
  9080. this.updateModel(),
  9081. this.bindEvents()
  9082. }
  9083. ,
  9084. n.prototype.bindEvents = function() {
  9085. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9086. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9087. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9088. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9089. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9090. }
  9091. ,
  9092. n.prototype.updateModel = function() {
  9093. this.model = this.modelManager.getActiveModel()
  9094. }
  9095. ,
  9096. n.prototype.handlePlayerViewChanged = function() {
  9097. this.updateLabelVisibility(),
  9098. this.updateLabelDisplay()
  9099. }
  9100. ,
  9101. n.prototype.getLabelsForFloor = function(t, i) {
  9102. return (i = i || []).length = 0,
  9103. this.model.labels.forEach(function(e) {
  9104. this.labelVisibleForFloor(e, t) && i.push(e)
  9105. }
  9106. .bind(this)),
  9107. i
  9108. }
  9109. ,
  9110. n.prototype.getLabelsForCurrentFloor = function(e) {
  9111. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9112. }
  9113. ,
  9114. n.prototype.labelVisibleForFloor = function(e, t) {
  9115. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9116. if (!this.model.showingLabels || !e.labelGui || !i)
  9117. return !1;
  9118. var n = e.floorId === this.model.floors.size() - 1;
  9119. return this.model.allFloorsVisible ? n : e.floorId === t
  9120. }
  9121. ,
  9122. n.prototype.updateLabelVisibility = function(e) {
  9123. this.model.labels.forEach(function(e) {
  9124. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, l.labels.fadeInDelay, l.labels.fadeInDuration) : this.hideLabel(e, l.labels.fadeOutDelay, l.labels.fadeOutDuration)
  9125. }
  9126. .bind(this))
  9127. }
  9128. ,
  9129. n.prototype.showAllLabels = function(t, i) {
  9130. this.model.labels.forEach(function(e) {
  9131. this.showLabel(e, t, i)
  9132. }
  9133. .bind(this))
  9134. }
  9135. ,
  9136. n.prototype.hideAllLabels = function(t, i) {
  9137. this.model.labels.forEach(function(e) {
  9138. this.hideLabel(e, t, i)
  9139. }
  9140. .bind(this))
  9141. }
  9142. ,
  9143. n.prototype.showLabel = function(e, t, i) {
  9144. this.model.showingLabels && (e.visible || (e.visible = !0,
  9145. e.labelGui.style.display = "block",
  9146. e.labelGui.style.opacity = 0,
  9147. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9148. }
  9149. ,
  9150. n.prototype.hideLabel = function(e, t, i) {
  9151. e.visible && (e.visible = !1,
  9152. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9153. }
  9154. ,
  9155. n.prototype.supportedMode = function() {
  9156. return this.player.mode === h.FLOORPLAN
  9157. }
  9158. ,
  9159. n.prototype.updateLabelDisplay = (new r.Vector3,
  9160. new r.Vector3,
  9161. o = [],
  9162. function() {
  9163. var e = this.player.getLabelScaleFactor()
  9164. , t = 1.2 * (1 - e) + .6
  9165. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9166. this.getLabelsForCurrentFloor(o);
  9167. for (var n = 0; n < o.length; n++) {
  9168. var r = o[n];
  9169. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9170. i <= e && r.text.length >= l.labels.minLengthForTruncate ? r.textBlock.innerText = r.text.substring(0, l.labels.truncateLength) + l.labels.truncateSuffix : r.textBlock.innerText = r.text)
  9171. }
  9172. }
  9173. ),
  9174. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9175. new r.Vector3,
  9176. function(e, t, i, n, r) {
  9177. t.style.fontSize = 100 * r + "%";
  9178. var o = .5 * $("#player").width()
  9179. , a = .5 * $("#player").height();
  9180. c.copy(i),
  9181. c.project(this.player.camera);
  9182. var s = c.x * o + o
  9183. , l = -c.y * a + a;
  9184. s -= e.offsetWidth / 2,
  9185. l -= e.offsetHeight / 2,
  9186. e.style.left = s + "px",
  9187. e.style.top = l + "px"
  9188. }
  9189. ),
  9190. n.prototype.handleStartInside = function(e) {
  9191. this.updateLabelVisibility()
  9192. }
  9193. ,
  9194. n.prototype.handleStartOutside = function() {
  9195. this.updateLabelVisibility()
  9196. }
  9197. ,
  9198. t.exports = n
  9199. }
  9200. , {
  9201. "../enum/DirectorEvents": 23,
  9202. "../enum/ModelManagerEvents": 33,
  9203. "../enum/PlayerEvents": 40,
  9204. "../enum/Viewmode": 51,
  9205. "../enum/WarpStyle": 52,
  9206. "../settings": 166,
  9207. "../util/browser": 182,
  9208. "../util/common": 185,
  9209. "../util/lerp": 188,
  9210. "../util/transitions": 195,
  9211. three: 217
  9212. }],
  9213. 92: [function(e, t, i) {
  9214. "use strict";
  9215. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9216. if (null == this)
  9217. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9218. if ("function" != typeof e)
  9219. throw new TypeError("predicate must be a function");
  9220. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9221. if (t = i[o],
  9222. e.call(r, t, o, i))
  9223. return o;
  9224. return -1
  9225. }
  9226. ),
  9227. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9228. value: function(e) {
  9229. if (null == this)
  9230. throw new TypeError('"this" is null or not defined');
  9231. var t = Object(this)
  9232. , i = t.length >>> 0;
  9233. if ("function" != typeof e)
  9234. throw new TypeError("predicate must be a function");
  9235. for (var n = arguments[1], r = 0; r < i; ) {
  9236. var o = t[r];
  9237. if (e.call(n, o, r, t))
  9238. return o;
  9239. r++
  9240. }
  9241. }
  9242. })
  9243. }
  9244. , {}],
  9245. 93: [function(e, t, i) {
  9246. "use strict";
  9247. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, ee = ee || {};
  9248. function te() {
  9249. this.backgroundElement = document.createElement("div"),
  9250. r.extend(this.backgroundElement.style, {
  9251. backgroundColor: "rgba(0,0,0,0.8)",
  9252. top: 0,
  9253. left: 0,
  9254. display: "none",
  9255. zIndex: "1000",
  9256. opacity: 0,
  9257. WebkitTransition: "opacity 0.2s linear"
  9258. }),
  9259. n.makeFullscreen(this.backgroundElement),
  9260. this.backgroundElement.style.position = "fixed",
  9261. this.domElement = document.createElement("div"),
  9262. r.extend(this.domElement.style, {
  9263. position: "fixed",
  9264. display: "none",
  9265. zIndex: "1001",
  9266. opacity: 0,
  9267. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9268. }),
  9269. document.body.appendChild(this.backgroundElement),
  9270. document.body.appendChild(this.domElement);
  9271. var e = this;
  9272. n.bind(this.backgroundElement, "click", function() {
  9273. e.hide()
  9274. })
  9275. }
  9276. function ie(e, t, i) {
  9277. Object.defineProperty(e, t, {
  9278. get: function() {
  9279. return "RGB" === this.__state.space || re(this, t, i),
  9280. this.__state[t]
  9281. },
  9282. set: function(e) {
  9283. "RGB" !== this.__state.space && (re(this, t, i),
  9284. this.__state.space = "RGB"),
  9285. this.__state[t] = e
  9286. }
  9287. })
  9288. }
  9289. function ne(e, t) {
  9290. Object.defineProperty(e, t, {
  9291. get: function() {
  9292. return "HSV" === this.__state.space || oe(this),
  9293. this.__state[t]
  9294. },
  9295. set: function(e) {
  9296. "HSV" !== this.__state.space && (oe(this),
  9297. this.__state.space = "HSV"),
  9298. this.__state[t] = e
  9299. }
  9300. })
  9301. }
  9302. function re(e, t, i) {
  9303. if ("HEX" === e.__state.space)
  9304. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9305. else {
  9306. if ("HSV" !== e.__state.space)
  9307. throw "Corrupted color state";
  9308. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9309. }
  9310. }
  9311. function oe(e) {
  9312. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9313. l.extend(e.__state, {
  9314. s: t.s,
  9315. v: t.v
  9316. }),
  9317. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9318. }
  9319. function ae() {
  9320. if (this.__state = o.apply(this, arguments),
  9321. !1 === this.__state)
  9322. throw "Failed to interpret color arguments";
  9323. this.__state.a = this.__state.a || 1
  9324. }
  9325. function se(e) {
  9326. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9327. }
  9328. function le(e, t) {
  9329. this.initialValue = e[t],
  9330. this.domElement = document.createElement("div"),
  9331. this.object = e,
  9332. this.property = t,
  9333. this.__onChange = void 0,
  9334. this.__onFinishChange = void 0
  9335. }
  9336. (t.exports = ee).gui = ee.gui || {},
  9337. ee.utils = ee.utils || {},
  9338. ee.controllers = ee.controllers || {},
  9339. ee.dom = ee.dom || {},
  9340. ee.color = ee.color || {},
  9341. ee.utils.css = {
  9342. load: function(e, t) {
  9343. var i = (t = t || document).createElement("link");
  9344. i.type = "text/css",
  9345. i.rel = "stylesheet",
  9346. i.href = e,
  9347. t.getElementsByTagName("head")[0].appendChild(i)
  9348. },
  9349. inject: function(e, t) {
  9350. t = t || document;
  9351. var i = document.createElement("style");
  9352. i.type = "text/css",
  9353. i.innerHTML = e,
  9354. t.getElementsByTagName("head")[0].appendChild(i)
  9355. }
  9356. },
  9357. ee.utils.common = (Q = Array.prototype.forEach,
  9358. J = Array.prototype.slice,
  9359. {
  9360. BREAK: {},
  9361. extend: function(i) {
  9362. return this.each(J.call(arguments, 1), function(e) {
  9363. for (var t in e)
  9364. this.isUndefined(e[t]) || (i[t] = e[t])
  9365. }, this),
  9366. i
  9367. },
  9368. defaults: function(i) {
  9369. return this.each(J.call(arguments, 1), function(e) {
  9370. for (var t in e)
  9371. this.isUndefined(i[t]) && (i[t] = e[t])
  9372. }, this),
  9373. i
  9374. },
  9375. compose: function() {
  9376. var i = J.call(arguments);
  9377. return function() {
  9378. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9379. e = [i[t].apply(this, e)];
  9380. return e[0]
  9381. }
  9382. },
  9383. each: function(e, t, i) {
  9384. if (e)
  9385. if (Q && e.forEach && e.forEach === Q)
  9386. e.forEach(t, i);
  9387. else if (e.length === e.length + 0) {
  9388. for (var n = 0, r = e.length; n < r; n++)
  9389. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9390. return
  9391. } else
  9392. for (var n in e)
  9393. if (t.call(i, e[n], n) === this.BREAK)
  9394. return
  9395. },
  9396. defer: function(e) {
  9397. setTimeout(e, 0)
  9398. },
  9399. toArray: function(e) {
  9400. return e.toArray ? e.toArray() : J.call(e)
  9401. },
  9402. isUndefined: function(e) {
  9403. return void 0 === e
  9404. },
  9405. isNull: function(e) {
  9406. return null === e
  9407. },
  9408. isNaN: function(e) {
  9409. return e != e
  9410. },
  9411. isArray: Array.isArray || function(e) {
  9412. return e.constructor === Array
  9413. }
  9414. ,
  9415. isObject: function(e) {
  9416. return e === Object(e)
  9417. },
  9418. isNumber: function(e) {
  9419. return e === e + 0
  9420. },
  9421. isString: function(e) {
  9422. return e === e + ""
  9423. },
  9424. isBoolean: function(e) {
  9425. return !1 === e || !0 === e
  9426. },
  9427. isFunction: function(e) {
  9428. return "[object Function]" === Object.prototype.toString.call(e)
  9429. }
  9430. }),
  9431. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9432. onChange: function(e) {
  9433. return this.__onChange = e,
  9434. this
  9435. },
  9436. onFinishChange: function(e) {
  9437. return this.__onFinishChange = e,
  9438. this
  9439. },
  9440. setValue: function(e) {
  9441. return this.object[this.property] = e,
  9442. this.__onChange && this.__onChange.call(this, e),
  9443. this.updateDisplay(),
  9444. this
  9445. },
  9446. getValue: function() {
  9447. return this.object[this.property]
  9448. },
  9449. updateDisplay: function() {
  9450. return this
  9451. },
  9452. isModified: function() {
  9453. return this.initialValue !== this.getValue()
  9454. }
  9455. }),
  9456. le),
  9457. ee.dom.dom = function(c) {
  9458. function i(e) {
  9459. if ("0" === e || c.isUndefined(e))
  9460. return 0;
  9461. var t = e.match(n);
  9462. return c.isNull(t) ? 0 : parseFloat(t[1])
  9463. }
  9464. var h = {};
  9465. c.each({
  9466. HTMLEvents: ["change"],
  9467. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9468. KeyboardEvents: ["keydown"]
  9469. }, function(e, t) {
  9470. c.each(e, function(e) {
  9471. h[e] = t
  9472. })
  9473. });
  9474. var n = /(\d+(\.\d+)?)px/
  9475. , r = {
  9476. makeSelectable: function(e, t) {
  9477. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9478. return !1
  9479. }
  9480. : function() {}
  9481. ,
  9482. e.style.MozUserSelect = t ? "auto" : "none",
  9483. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9484. e.unselectable = t ? "on" : "off")
  9485. },
  9486. makeFullscreen: function(e, t, i) {
  9487. c.isUndefined(t) && (t = !0),
  9488. c.isUndefined(i) && (i = !0),
  9489. e.style.position = "absolute",
  9490. t && (e.style.left = 0,
  9491. e.style.right = 0),
  9492. i && (e.style.top = 0,
  9493. e.style.bottom = 0)
  9494. },
  9495. fakeEvent: function(e, t, i, n) {
  9496. i = i || {};
  9497. var r = h[t];
  9498. if (!r)
  9499. throw new Error("Event type " + t + " not supported.");
  9500. var o = document.createEvent(r);
  9501. switch (r) {
  9502. case "MouseEvents":
  9503. var a = i.x || i.clientX || 0
  9504. , s = i.y || i.clientY || 0;
  9505. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9506. break;
  9507. case "KeyboardEvents":
  9508. var l = o.initKeyboardEvent || o.initKeyEvent;
  9509. c.defaults(i, {
  9510. cancelable: !0,
  9511. ctrlKey: !1,
  9512. altKey: !1,
  9513. shiftKey: !1,
  9514. metaKey: !1,
  9515. keyCode: void 0,
  9516. charCode: void 0
  9517. }),
  9518. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9519. break;
  9520. default:
  9521. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9522. }
  9523. c.defaults(o, n),
  9524. e.dispatchEvent(o)
  9525. },
  9526. bind: function(e, t, i, n) {
  9527. return n = n || !1,
  9528. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9529. r
  9530. },
  9531. unbind: function(e, t, i, n) {
  9532. return n = n || !1,
  9533. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9534. r
  9535. },
  9536. addClass: function(e, t) {
  9537. if (void 0 === e.className)
  9538. e.className = t;
  9539. else if (e.className !== t) {
  9540. var i = e.className.split(/ +/);
  9541. -1 == i.indexOf(t) && (i.push(t),
  9542. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9543. }
  9544. return r
  9545. },
  9546. removeClass: function(e, t) {
  9547. if (t)
  9548. if (void 0 === e.className)
  9549. ;
  9550. else if (e.className === t)
  9551. e.removeAttribute("class");
  9552. else {
  9553. var i = e.className.split(/ +/)
  9554. , n = i.indexOf(t);
  9555. -1 != n && (i.splice(n, 1),
  9556. e.className = i.join(" "))
  9557. }
  9558. else
  9559. e.className = void 0;
  9560. return r
  9561. },
  9562. hasClass: function(e, t) {
  9563. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9564. },
  9565. getWidth: function(e) {
  9566. var t = getComputedStyle(e);
  9567. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9568. },
  9569. getHeight: function(e) {
  9570. var t = getComputedStyle(e);
  9571. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9572. },
  9573. getOffset: function(e) {
  9574. var t = {
  9575. left: 0,
  9576. top: 0
  9577. };
  9578. if (e.offsetParent)
  9579. for (; t.left += e.offsetLeft,
  9580. t.top += e.offsetTop,
  9581. e = e.offsetParent; )
  9582. ;
  9583. return t
  9584. },
  9585. isActive: function(e) {
  9586. return e === document.activeElement && (e.type || e.href)
  9587. }
  9588. };
  9589. return r
  9590. }(ee.utils.common),
  9591. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9592. X = ee.dom.dom,
  9593. Z = ee.utils.common,
  9594. (K = function(e, t, i) {
  9595. K.superclass.call(this, e, t);
  9596. var n = this;
  9597. if (this.__select = document.createElement("select"),
  9598. Z.isArray(i)) {
  9599. var r = {};
  9600. Z.each(i, function(e) {
  9601. r[e] = e
  9602. }),
  9603. i = r
  9604. }
  9605. Z.each(i, function(e, t) {
  9606. var i = document.createElement("option");
  9607. i.innerHTML = t,
  9608. i.setAttribute("value", e),
  9609. n.__select.appendChild(i)
  9610. }),
  9611. this.updateDisplay(),
  9612. X.bind(this.__select, "change", function() {
  9613. var e = this.options[this.selectedIndex].value;
  9614. n.setValue(e)
  9615. }),
  9616. this.domElement.appendChild(this.__select)
  9617. }
  9618. ).superclass = q,
  9619. Z.extend(K.prototype, q.prototype, {
  9620. setValue: function(e) {
  9621. var t = K.superclass.prototype.setValue.call(this, e);
  9622. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9623. t
  9624. },
  9625. updateDisplay: function() {
  9626. return this.__select.value = this.getValue(),
  9627. K.superclass.prototype.updateDisplay.call(this)
  9628. }
  9629. }),
  9630. K),
  9631. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9632. j = ee.utils.common,
  9633. (Y = function(e, t, i) {
  9634. Y.superclass.call(this, e, t),
  9635. i = i || {},
  9636. this.__min = i.min,
  9637. this.__max = i.max,
  9638. this.__step = i.step,
  9639. j.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  9640. this.__precision = se(this.__impliedStep)
  9641. }
  9642. ).superclass = W,
  9643. j.extend(Y.prototype, W.prototype, {
  9644. setValue: function(e) {
  9645. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9646. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9647. Y.superclass.prototype.setValue.call(this, e)
  9648. },
  9649. min: function(e) {
  9650. return this.__min = e,
  9651. this
  9652. },
  9653. max: function(e) {
  9654. return this.__max = e,
  9655. this
  9656. },
  9657. step: function(e) {
  9658. return this.__step = e,
  9659. this.__impliedStep = e,
  9660. this.__precision = se(e),
  9661. this
  9662. }
  9663. }),
  9664. Y),
  9665. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9666. H = ee.dom.dom,
  9667. z = ee.utils.common,
  9668. (G = function(e, t, i) {
  9669. function n() {
  9670. var e = parseFloat(s.__input.value);
  9671. z.isNaN(e) || s.setValue(e)
  9672. }
  9673. function r(e) {
  9674. var t = a - e.clientY;
  9675. s.setValue(s.getValue() + t * s.__impliedStep),
  9676. a = e.clientY
  9677. }
  9678. function o() {
  9679. H.unbind(window, "mousemove", r),
  9680. H.unbind(window, "mouseup", o)
  9681. }
  9682. this.__truncationSuspended = !1,
  9683. G.superclass.call(this, e, t, i);
  9684. var a, s = this;
  9685. this.__input = document.createElement("input"),
  9686. this.__input.setAttribute("type", "text"),
  9687. H.bind(this.__input, "change", n),
  9688. H.bind(this.__input, "blur", function() {
  9689. n(),
  9690. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9691. }),
  9692. H.bind(this.__input, "mousedown", function(e) {
  9693. H.bind(window, "mousemove", r),
  9694. H.bind(window, "mouseup", o),
  9695. a = e.clientY
  9696. }),
  9697. H.bind(this.__input, "keydown", function(e) {
  9698. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9699. this.blur(),
  9700. s.__truncationSuspended = !1)
  9701. }),
  9702. this.updateDisplay(),
  9703. this.domElement.appendChild(this.__input)
  9704. }
  9705. ).superclass = U,
  9706. z.extend(G.prototype, U.prototype, {
  9707. updateDisplay: function() {
  9708. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9709. var i = Math.pow(10, t);
  9710. return Math.round(e * i) / i
  9711. }(this.getValue(), this.__precision),
  9712. G.superclass.prototype.updateDisplay.call(this)
  9713. }
  9714. }),
  9715. G),
  9716. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9717. F = ee.dom.dom,
  9718. B = ee.utils.css,
  9719. V = ee.utils.common,
  9720. (k = function(e, t, i, n, r) {
  9721. function o(e) {
  9722. e.preventDefault();
  9723. var t = F.getOffset(s.__background)
  9724. , i = F.getWidth(s.__background);
  9725. return s.setValue(function(e, t, i, n, r) {
  9726. return n + (e - t) / (i - t) * (r - n)
  9727. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9728. !1
  9729. }
  9730. function a() {
  9731. F.unbind(window, "mousemove", o),
  9732. F.unbind(window, "mouseup", a),
  9733. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9734. }
  9735. k.superclass.call(this, e, t, {
  9736. min: i,
  9737. max: n,
  9738. step: r
  9739. });
  9740. var s = this;
  9741. this.__background = document.createElement("div"),
  9742. this.__foreground = document.createElement("div"),
  9743. F.bind(this.__background, "mousedown", function(e) {
  9744. F.bind(window, "mousemove", o),
  9745. F.bind(window, "mouseup", a),
  9746. o(e)
  9747. }),
  9748. F.addClass(this.__background, "slider"),
  9749. F.addClass(this.__foreground, "slider-fg"),
  9750. this.updateDisplay(),
  9751. this.__background.appendChild(this.__foreground),
  9752. this.domElement.appendChild(this.__background)
  9753. }
  9754. ).superclass = N,
  9755. k.useDefaultStyles = function() {
  9756. B.inject("/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}")
  9757. }
  9758. ,
  9759. V.extend(k.prototype, N.prototype, {
  9760. updateDisplay: function() {
  9761. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9762. return this.__foreground.style.width = 100 * e + "%",
  9763. k.superclass.prototype.updateDisplay.call(this)
  9764. }
  9765. }),
  9766. k),
  9767. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9768. O = ee.dom.dom,
  9769. L = ee.utils.common,
  9770. (D = function(e, t, i) {
  9771. D.superclass.call(this, e, t);
  9772. var n = this;
  9773. this.__button = document.createElement("div"),
  9774. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9775. O.bind(this.__button, "click", function(e) {
  9776. return e.preventDefault(),
  9777. n.fire(),
  9778. !1
  9779. }),
  9780. O.addClass(this.__button, "button"),
  9781. this.domElement.appendChild(this.__button)
  9782. }
  9783. ).superclass = P,
  9784. L.extend(D.prototype, P.prototype, {
  9785. fire: function() {
  9786. this.__onChange && this.__onChange.call(this),
  9787. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9788. this.getValue().call(this.object)
  9789. }
  9790. }),
  9791. D),
  9792. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9793. S = ee.dom.dom,
  9794. M = ee.utils.common,
  9795. (R = function(e, t) {
  9796. R.superclass.call(this, e, t);
  9797. var i = this;
  9798. this.__prev = this.getValue(),
  9799. this.__checkbox = document.createElement("input"),
  9800. this.__checkbox.setAttribute("type", "checkbox"),
  9801. S.bind(this.__checkbox, "change", function() {
  9802. i.setValue(!i.__prev)
  9803. }, !1),
  9804. this.domElement.appendChild(this.__checkbox),
  9805. this.updateDisplay()
  9806. }
  9807. ).superclass = x,
  9808. M.extend(R.prototype, x.prototype, {
  9809. setValue: function(e) {
  9810. var t = R.superclass.prototype.setValue.call(this, e);
  9811. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9812. this.__prev = this.getValue(),
  9813. t
  9814. },
  9815. updateDisplay: function() {
  9816. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9817. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9818. R.superclass.prototype.updateDisplay.call(this)
  9819. }
  9820. }),
  9821. R),
  9822. ee.color.toString = (T = ee.utils.common,
  9823. function(e) {
  9824. if (1 == e.a || T.isUndefined(e.a)) {
  9825. for (var t = e.hex.toString(16); t.length < 6; )
  9826. t = "0" + t;
  9827. return "#" + t
  9828. }
  9829. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  9830. }
  9831. ),
  9832. ee.color.interpret = (I = ee.color.toString,
  9833. E = ee.utils.common,
  9834. w = [{
  9835. litmus: E.isString,
  9836. conversions: {
  9837. THREE_CHAR_HEX: {
  9838. read: function(e) {
  9839. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  9840. return null !== t && {
  9841. space: "HEX",
  9842. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  9843. }
  9844. },
  9845. write: I
  9846. },
  9847. SIX_CHAR_HEX: {
  9848. read: function(e) {
  9849. var t = e.match(/^#([A-F0-9]{6})$/i);
  9850. return null !== t && {
  9851. space: "HEX",
  9852. hex: parseInt("0x" + t[1].toString())
  9853. }
  9854. },
  9855. write: I
  9856. },
  9857. CSS_RGB: {
  9858. read: function(e) {
  9859. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  9860. return null !== t && {
  9861. space: "RGB",
  9862. r: parseFloat(t[1]),
  9863. g: parseFloat(t[2]),
  9864. b: parseFloat(t[3])
  9865. }
  9866. },
  9867. write: I
  9868. },
  9869. CSS_RGBA: {
  9870. read: function(e) {
  9871. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  9872. return null !== t && {
  9873. space: "RGB",
  9874. r: parseFloat(t[1]),
  9875. g: parseFloat(t[2]),
  9876. b: parseFloat(t[3]),
  9877. a: parseFloat(t[4])
  9878. }
  9879. },
  9880. write: I
  9881. }
  9882. }
  9883. }, {
  9884. litmus: E.isNumber,
  9885. conversions: {
  9886. HEX: {
  9887. read: function(e) {
  9888. return {
  9889. space: "HEX",
  9890. hex: e,
  9891. conversionName: "HEX"
  9892. }
  9893. },
  9894. write: function(e) {
  9895. return e.hex
  9896. }
  9897. }
  9898. }
  9899. }, {
  9900. litmus: E.isArray,
  9901. conversions: {
  9902. RGB_ARRAY: {
  9903. read: function(e) {
  9904. return 3 == e.length && {
  9905. space: "RGB",
  9906. r: e[0],
  9907. g: e[1],
  9908. b: e[2]
  9909. }
  9910. },
  9911. write: function(e) {
  9912. return [e.r, e.g, e.b]
  9913. }
  9914. },
  9915. RGBA_ARRAY: {
  9916. read: function(e) {
  9917. return 4 == e.length && {
  9918. space: "RGB",
  9919. r: e[0],
  9920. g: e[1],
  9921. b: e[2],
  9922. a: e[3]
  9923. }
  9924. },
  9925. write: function(e) {
  9926. return [e.r, e.g, e.b, e.a]
  9927. }
  9928. }
  9929. }
  9930. }, {
  9931. litmus: E.isObject,
  9932. conversions: {
  9933. RGBA_OBJ: {
  9934. read: function(e) {
  9935. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  9936. space: "RGB",
  9937. r: e.r,
  9938. g: e.g,
  9939. b: e.b,
  9940. a: e.a
  9941. }
  9942. },
  9943. write: function(e) {
  9944. return {
  9945. r: e.r,
  9946. g: e.g,
  9947. b: e.b,
  9948. a: e.a
  9949. }
  9950. }
  9951. },
  9952. RGB_OBJ: {
  9953. read: function(e) {
  9954. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  9955. space: "RGB",
  9956. r: e.r,
  9957. g: e.g,
  9958. b: e.b
  9959. }
  9960. },
  9961. write: function(e) {
  9962. return {
  9963. r: e.r,
  9964. g: e.g,
  9965. b: e.b
  9966. }
  9967. }
  9968. },
  9969. HSVA_OBJ: {
  9970. read: function(e) {
  9971. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  9972. space: "HSV",
  9973. h: e.h,
  9974. s: e.s,
  9975. v: e.v,
  9976. a: e.a
  9977. }
  9978. },
  9979. write: function(e) {
  9980. return {
  9981. h: e.h,
  9982. s: e.s,
  9983. v: e.v,
  9984. a: e.a
  9985. }
  9986. }
  9987. },
  9988. HSV_OBJ: {
  9989. read: function(e) {
  9990. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  9991. space: "HSV",
  9992. h: e.h,
  9993. s: e.s,
  9994. v: e.v
  9995. }
  9996. },
  9997. write: function(e) {
  9998. return {
  9999. h: e.h,
  10000. s: e.s,
  10001. v: e.v
  10002. }
  10003. }
  10004. }
  10005. }
  10006. }],
  10007. function() {
  10008. b = !1;
  10009. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10010. return E.each(w, function(e) {
  10011. if (e.litmus(i))
  10012. return E.each(e.conversions, function(e, t) {
  10013. if (_ = e.read(i),
  10014. !1 === b && !1 !== _)
  10015. return (b = _).conversionName = t,
  10016. _.conversion = e,
  10017. E.BREAK
  10018. }),
  10019. E.BREAK
  10020. }),
  10021. b
  10022. }
  10023. ),
  10024. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10025. function y(e, t, i, n) {
  10026. if (void 0 === t[i])
  10027. throw new Error("Object " + t + ' has no property "' + i + '"');
  10028. var r;
  10029. if (n.color)
  10030. r = new g(t,i);
  10031. else {
  10032. var o = [t, i].concat(n.factoryArgs);
  10033. r = c.apply(e, o)
  10034. }
  10035. n.before instanceof h && (n.before = n.before.__li),
  10036. C(e, r),
  10037. m.addClass(r.domElement, "c");
  10038. var a = document.createElement("span");
  10039. m.addClass(a, "property-name"),
  10040. a.innerHTML = r.property;
  10041. var s = document.createElement("div");
  10042. s.appendChild(a),
  10043. s.appendChild(r.domElement);
  10044. var l = A(e, s, n.before);
  10045. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10046. m.addClass(l, typeof r.getValue()),
  10047. function(t, i, n) {
  10048. if (n.__li = i,
  10049. n.__gui = t,
  10050. v.extend(n, {
  10051. options: function(e) {
  10052. return 1 < arguments.length ? (n.remove(),
  10053. y(t, n.object, n.property, {
  10054. before: n.__li.nextElementSibling,
  10055. factoryArgs: [v.toArray(arguments)]
  10056. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10057. y(t, n.object, n.property, {
  10058. before: n.__li.nextElementSibling,
  10059. factoryArgs: [e]
  10060. })) : void 0
  10061. },
  10062. name: function(e) {
  10063. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10064. n
  10065. },
  10066. listen: function() {
  10067. return n.__gui.listen(n),
  10068. n
  10069. },
  10070. remove: function() {
  10071. return n.__gui.remove(n),
  10072. n
  10073. }
  10074. }),
  10075. n instanceof f) {
  10076. var r = new p(n.object,n.property,{
  10077. min: n.__min,
  10078. max: n.__max,
  10079. step: n.__step
  10080. });
  10081. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10082. var t = n[e]
  10083. , i = r[e];
  10084. n[e] = r[e] = function() {
  10085. var e = Array.prototype.slice.call(arguments);
  10086. return t.apply(n, e),
  10087. i.apply(r, e)
  10088. }
  10089. }),
  10090. m.addClass(i, "has-slider"),
  10091. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10092. } else if (n instanceof p) {
  10093. var e = function(e) {
  10094. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10095. y(t, n.object, n.property, {
  10096. before: n.__li.nextElementSibling,
  10097. factoryArgs: [n.__min, n.__max, n.__step]
  10098. })) : e
  10099. };
  10100. n.min = v.compose(e, n.min),
  10101. n.max = v.compose(e, n.max)
  10102. } else
  10103. n instanceof u ? (m.bind(i, "click", function() {
  10104. m.fakeEvent(n.__checkbox, "click")
  10105. }),
  10106. m.bind(n.__checkbox, "click", function(e) {
  10107. e.stopPropagation()
  10108. })) : n instanceof d ? (m.bind(i, "click", function() {
  10109. m.fakeEvent(n.__button, "click")
  10110. }),
  10111. m.bind(i, "mouseover", function() {
  10112. m.addClass(n.__button, "hover")
  10113. }),
  10114. m.bind(i, "mouseout", function() {
  10115. m.removeClass(n.__button, "hover")
  10116. })) : n instanceof g && (m.addClass(i, "color"),
  10117. n.updateDisplay = v.compose(function(e) {
  10118. return i.style.borderLeftColor = n.__color.toString(),
  10119. e
  10120. }, n.updateDisplay),
  10121. n.updateDisplay());
  10122. n.setValue = v.compose(function(e) {
  10123. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10124. e
  10125. }, n.setValue)
  10126. }(e, l, r),
  10127. e.__controllers.push(r),
  10128. r
  10129. }
  10130. function A(e, t, i) {
  10131. var n = document.createElement("li");
  10132. return t && n.appendChild(t),
  10133. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10134. e.onResize(),
  10135. n
  10136. }
  10137. function C(e, t) {
  10138. var i = e.getRoot()
  10139. , n = i.__rememberedObjects.indexOf(t.object);
  10140. if (-1 != n) {
  10141. var r = i.__rememberedObjectIndecesToControllers[n];
  10142. if (void 0 === r && (r = {},
  10143. i.__rememberedObjectIndecesToControllers[n] = r),
  10144. r[t.property] = t,
  10145. i.load && i.load.remembered) {
  10146. var o, a = i.load.remembered;
  10147. if (a[e.preset])
  10148. o = a[e.preset];
  10149. else {
  10150. if (!a[T])
  10151. return;
  10152. o = a[T]
  10153. }
  10154. if (o[n] && void 0 !== o[n][t.property]) {
  10155. var s = o[n][t.property];
  10156. t.initialValue = s,
  10157. t.setValue(s)
  10158. }
  10159. }
  10160. }
  10161. }
  10162. function I(e, t) {
  10163. return document.location.href + "." + t
  10164. }
  10165. function l(e, t) {
  10166. e.domElement.style.width = t + "px",
  10167. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10168. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10169. }
  10170. function a(r, o) {
  10171. var a = {};
  10172. return v.each(r.__rememberedObjects, function(e, t) {
  10173. var i = {}
  10174. , n = r.__rememberedObjectIndecesToControllers[t];
  10175. v.each(n, function(e, t) {
  10176. i[t] = o ? e.initialValue : e.getValue()
  10177. }),
  10178. a[t] = i
  10179. }),
  10180. a
  10181. }
  10182. function E(e, t, i) {
  10183. var n = document.createElement("option");
  10184. n.innerHTML = t,
  10185. n.value = t,
  10186. e.__preset_select.appendChild(n),
  10187. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10188. }
  10189. function _(e, t) {
  10190. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10191. i.innerHTML = t ? i.value + "*" : i.value
  10192. }
  10193. e.inject(".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n");
  10194. var b, w, T = "Default", x = function() {
  10195. try {
  10196. return "localStorage"in window && null !== window.localStorage
  10197. } catch (e) {
  10198. return !1
  10199. }
  10200. }(), S = !0, s = !1, M = [], R = function(t) {
  10201. var i = this;
  10202. this.domElement = document.createElement("div"),
  10203. this.__ul = document.createElement("ul"),
  10204. this.domElement.appendChild(this.__ul),
  10205. m.addClass(this.domElement, "dg"),
  10206. this.__folders = {},
  10207. this.__controllers = [],
  10208. this.__rememberedObjects = [],
  10209. this.__rememberedObjectIndecesToControllers = [],
  10210. this.__listening = [],
  10211. t = t || {},
  10212. t = v.defaults(t, {
  10213. autoPlace: !0,
  10214. width: R.DEFAULT_WIDTH
  10215. }),
  10216. t = v.defaults(t, {
  10217. resizable: t.autoPlace,
  10218. hideable: t.autoPlace
  10219. }),
  10220. v.isUndefined(t.load) ? t.load = {
  10221. preset: T
  10222. } : t.preset && (t.load.preset = t.preset),
  10223. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10224. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10225. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10226. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10227. if (Object.defineProperties(this, {
  10228. parent: {
  10229. get: function() {
  10230. return t.parent
  10231. }
  10232. },
  10233. scrollable: {
  10234. get: function() {
  10235. return t.scrollable
  10236. }
  10237. },
  10238. autoPlace: {
  10239. get: function() {
  10240. return t.autoPlace
  10241. }
  10242. },
  10243. preset: {
  10244. get: function() {
  10245. return i.parent ? i.getRoot().preset : t.load.preset
  10246. },
  10247. set: function(e) {
  10248. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10249. function(e) {
  10250. for (var t = 0; t < e.__preset_select.length; t++)
  10251. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10252. }(this),
  10253. i.revert()
  10254. }
  10255. },
  10256. width: {
  10257. get: function() {
  10258. return t.width
  10259. },
  10260. set: function(e) {
  10261. t.width = e,
  10262. l(i, e)
  10263. }
  10264. },
  10265. name: {
  10266. get: function() {
  10267. return t.name
  10268. },
  10269. set: function(e) {
  10270. t.name = e,
  10271. a && (a.innerHTML = t.name)
  10272. }
  10273. },
  10274. closed: {
  10275. get: function() {
  10276. return t.closed
  10277. },
  10278. set: function(e) {
  10279. t.closed = e,
  10280. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10281. this.onResize(),
  10282. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10283. }
  10284. },
  10285. load: {
  10286. get: function() {
  10287. return t.load
  10288. }
  10289. },
  10290. useLocalStorage: {
  10291. get: function() {
  10292. return r
  10293. },
  10294. set: function(e) {
  10295. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10296. localStorage.setItem(I(0, "isLocal"), e))
  10297. }
  10298. }
  10299. }),
  10300. v.isUndefined(t.parent)) {
  10301. if (t.closed = !1,
  10302. m.addClass(this.domElement, R.CLASS_MAIN),
  10303. m.makeSelectable(this.domElement, !1),
  10304. x && r) {
  10305. i.useLocalStorage = !0;
  10306. var o = localStorage.getItem(I(0, "gui"));
  10307. o && (t.load = JSON.parse(o))
  10308. }
  10309. this.__closeButton = document.createElement("div"),
  10310. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10311. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10312. this.domElement.appendChild(this.__closeButton),
  10313. m.bind(this.__closeButton, "click", function() {
  10314. i.closed = !i.closed
  10315. })
  10316. } else {
  10317. void 0 === t.closed && (t.closed = !0);
  10318. var a = document.createTextNode(t.name);
  10319. m.addClass(a, "controller-name");
  10320. var s = A(i, a);
  10321. m.addClass(this.__ul, R.CLASS_CLOSED),
  10322. m.addClass(s, "title"),
  10323. m.bind(s, "click", function(e) {
  10324. return e.preventDefault(),
  10325. i.closed = !i.closed,
  10326. !1
  10327. }),
  10328. t.closed || (this.closed = !1)
  10329. }
  10330. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10331. m.addClass(w, "dg"),
  10332. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10333. document.body.appendChild(w),
  10334. S = !1),
  10335. w.appendChild(this.domElement),
  10336. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10337. this.parent || l(i, t.width)),
  10338. m.bind(window, "resize", function() {
  10339. i.onResize()
  10340. }),
  10341. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10342. i.onResize()
  10343. }),
  10344. m.bind(this.__ul, "transitionend", function() {
  10345. i.onResize()
  10346. }),
  10347. m.bind(this.__ul, "oTransitionEnd", function() {
  10348. i.onResize()
  10349. }),
  10350. this.onResize(),
  10351. t.resizable && function(t) {
  10352. function e(e) {
  10353. return e.preventDefault(),
  10354. r = e.clientX,
  10355. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10356. m.bind(window, "mousemove", i),
  10357. m.bind(window, "mouseup", n),
  10358. !1
  10359. }
  10360. function i(e) {
  10361. return e.preventDefault(),
  10362. t.width += r - e.clientX,
  10363. t.onResize(),
  10364. r = e.clientX,
  10365. !1
  10366. }
  10367. function n() {
  10368. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10369. m.unbind(window, "mousemove", i),
  10370. m.unbind(window, "mouseup", n)
  10371. }
  10372. var r;
  10373. t.__resize_handle = document.createElement("div"),
  10374. v.extend(t.__resize_handle.style, {
  10375. width: "6px",
  10376. marginLeft: "-3px",
  10377. height: "200px",
  10378. cursor: "ew-resize",
  10379. position: "absolute"
  10380. }),
  10381. m.bind(t.__resize_handle, "mousedown", e),
  10382. m.bind(t.__closeButton, "mousedown", e),
  10383. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10384. }(this),
  10385. n = function() {
  10386. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10387. }
  10388. ,
  10389. this.saveToLocalStorageIfPossible = n,
  10390. i.getRoot(),
  10391. t.parent || ((e = i.getRoot()).width += 1,
  10392. v.defer(function() {
  10393. e.width -= 1
  10394. }))
  10395. };
  10396. return R.toggleHide = function() {
  10397. s = !s,
  10398. v.each(M, function(e) {
  10399. e.domElement.style.zIndex = s ? -999 : 999,
  10400. e.domElement.style.opacity = s ? 0 : 1
  10401. })
  10402. }
  10403. ,
  10404. R.CLASS_AUTO_PLACE = "a",
  10405. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10406. R.CLASS_MAIN = "main",
  10407. R.CLASS_CONTROLLER_ROW = "cr",
  10408. R.CLASS_TOO_TALL = "taller-than-window",
  10409. R.CLASS_CLOSED = "closed",
  10410. R.CLASS_CLOSE_BUTTON = "close-button",
  10411. R.CLASS_DRAG = "drag",
  10412. R.DEFAULT_WIDTH = 245,
  10413. R.TEXT_CLOSED = "Close Controls",
  10414. R.TEXT_OPEN = "Open Controls",
  10415. m.bind(window, "keydown", function(e) {
  10416. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10417. }, !1),
  10418. v.extend(R.prototype, {
  10419. add: function(e, t) {
  10420. return y(this, e, t, {
  10421. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10422. })
  10423. },
  10424. addColor: function(e, t) {
  10425. return y(this, e, t, {
  10426. color: !0
  10427. })
  10428. },
  10429. remove: function(e) {
  10430. this.__ul.removeChild(e.__li),
  10431. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10432. var t = this;
  10433. v.defer(function() {
  10434. t.onResize()
  10435. })
  10436. },
  10437. destroy: function() {
  10438. this.autoPlace && w.removeChild(this.domElement)
  10439. },
  10440. addFolder: function(e) {
  10441. if (void 0 !== this.__folders[e])
  10442. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10443. var t = {
  10444. name: e,
  10445. parent: this
  10446. };
  10447. t.autoPlace = this.autoPlace,
  10448. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10449. t.load = this.load.folders[e]);
  10450. var i = new R(t);
  10451. this.__folders[e] = i;
  10452. var n = A(this, i.domElement);
  10453. return m.addClass(n, "folder"),
  10454. i
  10455. },
  10456. open: function() {
  10457. this.closed = !1
  10458. },
  10459. close: function() {
  10460. this.closed = !0
  10461. },
  10462. onResize: function() {
  10463. var t = this.getRoot();
  10464. if (t.scrollable) {
  10465. var e = m.getOffset(t.__ul).top
  10466. , i = 0;
  10467. v.each(t.__ul.childNodes, function(e) {
  10468. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10469. }),
  10470. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10471. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10472. t.__ul.style.height = "auto")
  10473. }
  10474. t.__resize_handle && v.defer(function() {
  10475. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10476. }),
  10477. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10478. },
  10479. remember: function() {
  10480. if (v.isUndefined(b) && ((b = new o).domElement.innerHTML = '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>'),
  10481. this.parent)
  10482. throw new Error("You can only call remember on a top level GUI.");
  10483. var t = this;
  10484. v.each(Array.prototype.slice.call(arguments), function(e) {
  10485. 0 == t.__rememberedObjects.length && function(i) {
  10486. var e = i.__save_row = document.createElement("li");
  10487. m.addClass(i.domElement, "has-save"),
  10488. i.__ul.insertBefore(e, i.__ul.firstChild),
  10489. m.addClass(e, "save-row");
  10490. var t = document.createElement("span");
  10491. t.innerHTML = "&nbsp;",
  10492. m.addClass(t, "button gears");
  10493. var n = document.createElement("span");
  10494. n.innerHTML = "Save",
  10495. m.addClass(n, "button"),
  10496. m.addClass(n, "save");
  10497. var r = document.createElement("span");
  10498. r.innerHTML = "New",
  10499. m.addClass(r, "button"),
  10500. m.addClass(r, "save-as");
  10501. var o = document.createElement("span");
  10502. o.innerHTML = "Revert",
  10503. m.addClass(o, "button"),
  10504. m.addClass(o, "revert");
  10505. var a = i.__preset_select = document.createElement("select");
  10506. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10507. E(i, t, t == i.preset)
  10508. }) : E(i, T, !1),
  10509. m.bind(a, "change", function() {
  10510. for (var e = 0; e < i.__preset_select.length; e++)
  10511. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10512. i.preset = this.value
  10513. }),
  10514. e.appendChild(a),
  10515. e.appendChild(t),
  10516. e.appendChild(n),
  10517. e.appendChild(r),
  10518. e.appendChild(o),
  10519. x) {
  10520. var s = document.getElementById("dg-save-locally")
  10521. , l = document.getElementById("dg-local-explain");
  10522. s.style.display = "block";
  10523. var c = document.getElementById("dg-local-storage");
  10524. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10525. var h = function() {
  10526. l.style.display = i.useLocalStorage ? "block" : "none"
  10527. };
  10528. h(),
  10529. m.bind(c, "change", function() {
  10530. i.useLocalStorage = !i.useLocalStorage,
  10531. h()
  10532. })
  10533. }
  10534. var u = document.getElementById("dg-new-constructor");
  10535. m.bind(u, "keydown", function(e) {
  10536. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10537. }),
  10538. m.bind(t, "click", function() {
  10539. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10540. b.show(),
  10541. u.focus(),
  10542. u.select()
  10543. }),
  10544. m.bind(n, "click", function() {
  10545. i.save()
  10546. }),
  10547. m.bind(r, "click", function() {
  10548. var e = prompt("Enter a new preset name.");
  10549. e && i.saveAs(e)
  10550. }),
  10551. m.bind(o, "click", function() {
  10552. i.revert()
  10553. })
  10554. }(t),
  10555. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10556. }),
  10557. this.autoPlace && l(this, this.width)
  10558. },
  10559. getRoot: function() {
  10560. for (var e = this; e.parent; )
  10561. e = e.parent;
  10562. return e
  10563. },
  10564. getSaveObject: function() {
  10565. var i = this.load;
  10566. return i.closed = this.closed,
  10567. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10568. i.remembered || (i.remembered = {}),
  10569. i.remembered[this.preset] = a(this)),
  10570. i.folders = {},
  10571. v.each(this.__folders, function(e, t) {
  10572. i.folders[t] = e.getSaveObject()
  10573. }),
  10574. i
  10575. },
  10576. save: function() {
  10577. this.load.remembered || (this.load.remembered = {}),
  10578. this.load.remembered[this.preset] = a(this),
  10579. _(this, !1),
  10580. this.saveToLocalStorageIfPossible()
  10581. },
  10582. saveAs: function(e) {
  10583. this.load.remembered || (this.load.remembered = {},
  10584. this.load.remembered[T] = a(this, !0)),
  10585. this.load.remembered[e] = a(this),
  10586. this.preset = e,
  10587. E(this, e, !0),
  10588. this.saveToLocalStorageIfPossible()
  10589. },
  10590. revert: function(t) {
  10591. v.each(this.__controllers, function(e) {
  10592. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10593. }, this),
  10594. v.each(this.__folders, function(e) {
  10595. e.revert(e)
  10596. }),
  10597. t || _(this.getRoot(), !1)
  10598. },
  10599. listen: function(e) {
  10600. var t = 0 == this.__listening.length;
  10601. this.__listening.push(e),
  10602. t && function e(t) {
  10603. 0 != t.length && r(function() {
  10604. e(t)
  10605. }),
  10606. v.each(t, function(e) {
  10607. e.updateDisplay()
  10608. })
  10609. }(this.__listening)
  10610. }
  10611. }),
  10612. R
  10613. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10614. u = ee.controllers.NumberControllerBox,
  10615. d = ee.controllers.NumberControllerSlider,
  10616. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10617. y = ee.dom.dom,
  10618. A = ee.utils.common,
  10619. (C = function(e, t) {
  10620. function i() {
  10621. n.setValue(n.__input.value)
  10622. }
  10623. C.superclass.call(this, e, t);
  10624. var n = this;
  10625. this.__input = document.createElement("input"),
  10626. this.__input.setAttribute("type", "text"),
  10627. y.bind(this.__input, "keyup", i),
  10628. y.bind(this.__input, "change", i),
  10629. y.bind(this.__input, "blur", function() {
  10630. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10631. }),
  10632. y.bind(this.__input, "keydown", function(e) {
  10633. 13 === e.keyCode && this.blur()
  10634. }),
  10635. this.updateDisplay(),
  10636. this.domElement.appendChild(this.__input)
  10637. }
  10638. ).superclass = v,
  10639. A.extend(C.prototype, v.prototype, {
  10640. updateDisplay: function() {
  10641. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10642. C.superclass.prototype.updateDisplay.call(this)
  10643. }
  10644. }),
  10645. C),
  10646. f = ee.controllers.FunctionController,
  10647. g = ee.controllers.BooleanController,
  10648. m = ee.utils.common,
  10649. function(e, t) {
  10650. var i = e[t];
  10651. return m.isArray(arguments[2]) || m.isObject(arguments[2]) ? new h(e,t,arguments[2]) : m.isNumber(i) ? m.isNumber(arguments[2]) && m.isNumber(arguments[3]) ? new d(e,t,arguments[2],arguments[3]) : new u(e,t,{
  10652. min: arguments[2],
  10653. max: arguments[3]
  10654. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10655. }
  10656. ), ee.controllers.Controller, ee.controllers.BooleanController, ee.controllers.FunctionController, ee.controllers.NumberControllerBox, ee.controllers.NumberControllerSlider, ee.controllers.OptionController, ee.controllers.ColorController = function(e, h, u, d, p) {
  10657. function f(t, i, n, r) {
  10658. t.style.background = "",
  10659. p.each(o, function(e) {
  10660. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10661. })
  10662. }
  10663. var g = function(e, t) {
  10664. function i(e) {
  10665. a(e),
  10666. h.bind(window, "mousemove", a),
  10667. h.bind(window, "mouseup", n)
  10668. }
  10669. function n() {
  10670. h.unbind(window, "mousemove", a),
  10671. h.unbind(window, "mouseup", n)
  10672. }
  10673. function r() {
  10674. var e = d(this.value);
  10675. !1 !== e ? (l.__color.__state = e,
  10676. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10677. }
  10678. function o() {
  10679. h.unbind(window, "mousemove", s),
  10680. h.unbind(window, "mouseup", o)
  10681. }
  10682. function a(e) {
  10683. e.preventDefault();
  10684. var t = h.getWidth(l.__saturation_field)
  10685. , i = h.getOffset(l.__saturation_field)
  10686. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10687. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10688. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10689. 1 < n ? n = 1 : n < 0 && (n = 0),
  10690. l.__color.v = r,
  10691. l.__color.s = n,
  10692. l.setValue(l.__color.toOriginal()),
  10693. !1
  10694. }
  10695. function s(e) {
  10696. e.preventDefault();
  10697. var t = h.getHeight(l.__hue_field)
  10698. , i = h.getOffset(l.__hue_field)
  10699. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10700. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10701. l.__color.h = 360 * n,
  10702. l.setValue(l.__color.toOriginal()),
  10703. !1
  10704. }
  10705. g.superclass.call(this, e, t),
  10706. this.__color = new u(this.getValue()),
  10707. this.__temp = new u(0);
  10708. var l = this;
  10709. this.domElement = document.createElement("div"),
  10710. h.makeSelectable(this.domElement, !1),
  10711. this.__selector = document.createElement("div"),
  10712. this.__selector.className = "selector",
  10713. this.__saturation_field = document.createElement("div"),
  10714. this.__saturation_field.className = "saturation-field",
  10715. this.__field_knob = document.createElement("div"),
  10716. this.__field_knob.className = "field-knob",
  10717. this.__field_knob_border = "2px solid ",
  10718. this.__hue_knob = document.createElement("div"),
  10719. this.__hue_knob.className = "hue-knob",
  10720. this.__hue_field = document.createElement("div"),
  10721. this.__hue_field.className = "hue-field",
  10722. this.__input = document.createElement("input"),
  10723. this.__input.type = "text",
  10724. this.__input_textShadow = "0 1px 1px ",
  10725. h.bind(this.__input, "keydown", function(e) {
  10726. 13 === e.keyCode && r.call(this)
  10727. }),
  10728. h.bind(this.__input, "blur", r),
  10729. h.bind(this.__selector, "mousedown", function(e) {
  10730. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10731. h.removeClass(l.__selector, "drag")
  10732. })
  10733. });
  10734. var c = document.createElement("div");
  10735. p.extend(this.__selector.style, {
  10736. width: "122px",
  10737. height: "102px",
  10738. padding: "3px",
  10739. backgroundColor: "#222",
  10740. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10741. }),
  10742. p.extend(this.__field_knob.style, {
  10743. position: "absolute",
  10744. width: "12px",
  10745. height: "12px",
  10746. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10747. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10748. borderRadius: "12px",
  10749. zIndex: 1
  10750. }),
  10751. p.extend(this.__hue_knob.style, {
  10752. position: "absolute",
  10753. width: "15px",
  10754. height: "2px",
  10755. borderRight: "4px solid #fff",
  10756. zIndex: 1
  10757. }),
  10758. p.extend(this.__saturation_field.style, {
  10759. width: "100px",
  10760. height: "100px",
  10761. border: "1px solid #555",
  10762. marginRight: "3px",
  10763. display: "inline-block",
  10764. cursor: "pointer"
  10765. }),
  10766. p.extend(c.style, {
  10767. width: "100%",
  10768. height: "100%",
  10769. background: "none"
  10770. }),
  10771. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10772. p.extend(this.__hue_field.style, {
  10773. width: "15px",
  10774. height: "100px",
  10775. display: "inline-block",
  10776. border: "1px solid #555",
  10777. cursor: "ns-resize"
  10778. }),
  10779. function(e) {
  10780. e.style.background = "",
  10781. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10782. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10783. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10784. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10785. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10786. }(this.__hue_field),
  10787. p.extend(this.__input.style, {
  10788. outline: "none",
  10789. textAlign: "center",
  10790. color: "#fff",
  10791. border: 0,
  10792. fontWeight: "bold",
  10793. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10794. }),
  10795. h.bind(this.__saturation_field, "mousedown", i),
  10796. h.bind(this.__field_knob, "mousedown", i),
  10797. h.bind(this.__hue_field, "mousedown", function(e) {
  10798. s(e),
  10799. h.bind(window, "mousemove", s),
  10800. h.bind(window, "mouseup", o)
  10801. }),
  10802. this.__saturation_field.appendChild(c),
  10803. this.__selector.appendChild(this.__field_knob),
  10804. this.__selector.appendChild(this.__saturation_field),
  10805. this.__selector.appendChild(this.__hue_field),
  10806. this.__hue_field.appendChild(this.__hue_knob),
  10807. this.domElement.appendChild(this.__input),
  10808. this.domElement.appendChild(this.__selector),
  10809. this.updateDisplay()
  10810. };
  10811. g.superclass = e,
  10812. p.extend(g.prototype, e.prototype, {
  10813. updateDisplay: function() {
  10814. var t = d(this.getValue());
  10815. if (!1 !== t) {
  10816. var i = !1;
  10817. p.each(u.COMPONENTS, function(e) {
  10818. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10819. return i = !0,
  10820. {}
  10821. }, this),
  10822. i && p.extend(this.__color.__state, t)
  10823. }
  10824. p.extend(this.__temp.__state, this.__color.__state),
  10825. this.__temp.a = 1;
  10826. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  10827. , n = 255 - e;
  10828. p.extend(this.__field_knob.style, {
  10829. marginLeft: 100 * this.__color.s - 7 + "px",
  10830. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10831. backgroundColor: this.__temp.toString(),
  10832. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  10833. }),
  10834. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10835. this.__temp.s = 1,
  10836. this.__temp.v = 1,
  10837. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10838. p.extend(this.__input.style, {
  10839. backgroundColor: this.__input.value = this.__color.toString(),
  10840. color: "rgb(" + e + "," + e + "," + e + ")",
  10841. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  10842. })
  10843. }
  10844. });
  10845. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  10846. return g
  10847. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  10848. a = ee.color.math = {
  10849. hsv_to_rgb: function(e, t, i) {
  10850. var n = Math.floor(e / 60) % 6
  10851. , r = e / 60 - Math.floor(e / 60)
  10852. , o = i * (1 - t)
  10853. , a = i * (1 - r * t)
  10854. , s = i * (1 - (1 - r) * t)
  10855. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  10856. return {
  10857. r: 255 * l[0],
  10858. g: 255 * l[1],
  10859. b: 255 * l[2]
  10860. }
  10861. },
  10862. rgb_to_hsv: function(e, t, i) {
  10863. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  10864. return 0 == o ? {
  10865. h: NaN,
  10866. s: 0,
  10867. v: 0
  10868. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  10869. (n /= 6) < 0 && (n += 1),
  10870. {
  10871. h: 360 * n,
  10872. s: a / o,
  10873. v: o / 255
  10874. })
  10875. },
  10876. rgb_to_hex: function(e, t, i) {
  10877. var n = this.hex_with_component(0, 2, e);
  10878. return n = this.hex_with_component(n, 1, t),
  10879. this.hex_with_component(n, 0, i)
  10880. },
  10881. component_from_hex: function(e, t) {
  10882. return e >> 8 * t & 255
  10883. },
  10884. hex_with_component: function(e, t, i) {
  10885. return i << (c = 8 * t) | e & ~(255 << c)
  10886. }
  10887. },
  10888. s = ee.color.toString,
  10889. l = ee.utils.common,
  10890. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  10891. l.extend(ae.prototype, {
  10892. toString: function() {
  10893. return s(this)
  10894. },
  10895. toOriginal: function() {
  10896. return this.__state.conversion.write(this)
  10897. }
  10898. }),
  10899. ie(ae.prototype, "r", 2),
  10900. ie(ae.prototype, "g", 1),
  10901. ie(ae.prototype, "b", 0),
  10902. ne(ae.prototype, "h"),
  10903. ne(ae.prototype, "s"),
  10904. ne(ae.prototype, "v"),
  10905. Object.defineProperty(ae.prototype, "a", {
  10906. get: function() {
  10907. return this.__state.a
  10908. },
  10909. set: function(e) {
  10910. this.__state.a = e
  10911. }
  10912. }),
  10913. Object.defineProperty(ae.prototype, "hex", {
  10914. get: function() {
  10915. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  10916. this.__state.hex
  10917. },
  10918. set: function(e) {
  10919. this.__state.space = "HEX",
  10920. this.__state.hex = e
  10921. }
  10922. }),
  10923. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  10924. window.setTimeout(e, 1e3 / 60)
  10925. }
  10926. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  10927. r = ee.utils.common,
  10928. te.prototype.show = function() {
  10929. var e = this;
  10930. this.backgroundElement.style.display = "block",
  10931. this.domElement.style.display = "block",
  10932. this.domElement.style.opacity = 0,
  10933. this.domElement.style.webkitTransform = "scale(1.1)",
  10934. this.layout(),
  10935. r.defer(function() {
  10936. e.backgroundElement.style.opacity = 1,
  10937. e.domElement.style.opacity = 1,
  10938. e.domElement.style.webkitTransform = "scale(1)"
  10939. })
  10940. }
  10941. ,
  10942. te.prototype.hide = function() {
  10943. var e = this
  10944. , t = function() {
  10945. e.domElement.style.display = "none",
  10946. e.backgroundElement.style.display = "none",
  10947. n.unbind(e.domElement, "webkitTransitionEnd", t),
  10948. n.unbind(e.domElement, "transitionend", t),
  10949. n.unbind(e.domElement, "oTransitionEnd", t)
  10950. };
  10951. n.bind(this.domElement, "webkitTransitionEnd", t),
  10952. n.bind(this.domElement, "transitionend", t),
  10953. n.bind(this.domElement, "oTransitionEnd", t),
  10954. this.backgroundElement.style.opacity = 0,
  10955. this.domElement.style.opacity = 0,
  10956. this.domElement.style.webkitTransform = "scale(1.1)"
  10957. }
  10958. ,
  10959. te.prototype.layout = function() {
  10960. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  10961. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  10962. }
  10963. ,
  10964. te), ee.dom.dom, ee.utils.common)
  10965. }
  10966. , {}],
  10967. 94: [function(e, t, i) {
  10968. (function(J) {
  10969. "use strict";
  10970. function i(e) {
  10971. function t(e, t) {
  10972. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  10973. for (var a = 1; a <= e[o]; a++)
  10974. r[t[n]] = [],
  10975. r[t[n]][0] = i,
  10976. r[t[n]][1] = o,
  10977. n++,
  10978. i++;
  10979. i *= 2
  10980. }
  10981. return r
  10982. }
  10983. function _(e) {
  10984. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  10985. t & 1 << i && (B |= 1 << V),
  10986. i--,
  10987. --V < 0 && (255 == B ? (b(255),
  10988. b(0)) : b(B),
  10989. V = 7,
  10990. B = 0)
  10991. }
  10992. function b(e) {
  10993. F.push(e)
  10994. }
  10995. function w(e) {
  10996. b(e >> 8 & 255),
  10997. b(255 & e)
  10998. }
  10999. function T(e, t, i, n, r) {
  11000. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11001. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11002. for (h = 0; h < 8; ++h) {
  11003. i = e[d],
  11004. n = e[d + 1],
  11005. r = e[d + 2],
  11006. o = e[d + 3],
  11007. a = e[d + 4],
  11008. s = e[d + 5],
  11009. l = e[d + 6];
  11010. var p = i + (c = e[d + 7])
  11011. , f = i - c
  11012. , g = n + l
  11013. , m = n - l
  11014. , v = r + s
  11015. , y = r - s
  11016. , A = o + a
  11017. , C = o - a
  11018. , I = p + A
  11019. , E = p - A
  11020. , _ = g + v
  11021. , b = g - v;
  11022. e[d] = I + _,
  11023. e[d + 4] = I - _;
  11024. var w = .707106781 * (b + E);
  11025. e[d + 2] = E + w,
  11026. e[d + 6] = E - w;
  11027. var T = .382683433 * ((I = C + y) - (b = m + f))
  11028. , x = .5411961 * I + T
  11029. , S = 1.306562965 * b + T
  11030. , M = .707106781 * (_ = y + m)
  11031. , R = f + M
  11032. , P = f - M;
  11033. e[d + 5] = P + x,
  11034. e[d + 3] = P - x,
  11035. e[d + 1] = R + S,
  11036. e[d + 7] = R - S,
  11037. d += 8
  11038. }
  11039. for (h = d = 0; h < 8; ++h) {
  11040. i = e[d],
  11041. n = e[d + 8],
  11042. r = e[d + 16],
  11043. o = e[d + 24],
  11044. a = e[d + 32],
  11045. s = e[d + 40],
  11046. l = e[d + 48];
  11047. var O = i + (c = e[d + 56])
  11048. , L = i - c
  11049. , D = n + l
  11050. , N = n - l
  11051. , F = r + s
  11052. , B = r - s
  11053. , V = o + a
  11054. , k = o - a
  11055. , U = O + V
  11056. , H = O - V
  11057. , z = D + F
  11058. , G = D - F;
  11059. e[d] = U + z,
  11060. e[d + 32] = U - z;
  11061. var W = .707106781 * (G + H);
  11062. e[d + 16] = H + W,
  11063. e[d + 48] = H - W;
  11064. var j = .382683433 * ((U = k + B) - (G = N + L))
  11065. , Y = .5411961 * U + j
  11066. , q = 1.306562965 * G + j
  11067. , X = .707106781 * (z = B + N)
  11068. , Z = L + X
  11069. , K = L - X;
  11070. e[d + 40] = K + Y,
  11071. e[d + 24] = K - Y,
  11072. e[d + 8] = Z + q,
  11073. e[d + 56] = Z - q,
  11074. d++
  11075. }
  11076. for (h = 0; h < 64; ++h)
  11077. u = e[h] * t[h],
  11078. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11079. return Q
  11080. }(e, t), c = 0; c < 64; ++c)
  11081. A[C[c]] = l[c];
  11082. var h = A[0] - i;
  11083. i = A[0],
  11084. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11085. _(v[o]));
  11086. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11087. ;
  11088. if (0 == u)
  11089. return _(a),
  11090. i;
  11091. for (var d, p = 1; p <= u; ) {
  11092. for (var f = p; 0 == A[p] && p <= u; ++p)
  11093. ;
  11094. var g = p - f;
  11095. if (16 <= g) {
  11096. d = g >> 4;
  11097. for (var m = 1; m <= d; ++m)
  11098. _(s);
  11099. g &= 15
  11100. }
  11101. o = 32767 + A[p],
  11102. _(r[(g << 4) + y[o]]),
  11103. _(v[o]),
  11104. p++
  11105. }
  11106. return 63 != u && _(a),
  11107. i
  11108. }
  11109. function x(e) {
  11110. if (e <= 0 && (e = 1),
  11111. 100 < e && (e = 100),
  11112. i != e) {
  11113. (function(e) {
  11114. 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++) {
  11115. var n = u((t[i] * e + 50) / 100);
  11116. n < 1 ? n = 1 : 255 < n && (n = 255),
  11117. O[C[i]] = n
  11118. }
  11119. 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++) {
  11120. var a = u((r[o] * e + 50) / 100);
  11121. a < 1 ? a = 1 : 255 < a && (a = 255),
  11122. L[C[o]] = a
  11123. }
  11124. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11125. for (var h = 0; h < 8; h++)
  11126. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11127. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11128. l++
  11129. }
  11130. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11131. i = e
  11132. }
  11133. }
  11134. var S, M, R, P, i, u = (Math.round,
  11135. Math.floor), O = new Array(64), L = new Array(64), D = new Array(64), N = new Array(64), v = new Array(65535), y = new Array(65535), Q = new Array(64), A = new Array(64), F = [], B = 0, V = 7, k = new Array(64), U = new Array(64), H = new Array(64), n = new Array(256), z = new Array(2048), C = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], G = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], q = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], Z = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  11136. this.encode = function(e, t) {
  11137. var i = ((new Date).getTime(),
  11138. t.quality);
  11139. i && x(i),
  11140. F = new Array,
  11141. B = 0,
  11142. V = 7,
  11143. w(65496),
  11144. w(65504),
  11145. w(16),
  11146. b(74),
  11147. b(70),
  11148. b(73),
  11149. b(70),
  11150. b(0),
  11151. b(1),
  11152. b(1),
  11153. b(0),
  11154. w(1),
  11155. w(1),
  11156. b(0),
  11157. b(0),
  11158. function() {
  11159. w(65499),
  11160. w(132),
  11161. b(0);
  11162. for (var e = 0; e < 64; e++)
  11163. b(O[e]);
  11164. b(1);
  11165. for (var t = 0; t < 64; t++)
  11166. b(L[t])
  11167. }(),
  11168. function(e, t) {
  11169. w(65472),
  11170. w(17),
  11171. b(8),
  11172. w(t),
  11173. w(e),
  11174. b(3),
  11175. b(1),
  11176. b(17),
  11177. b(0),
  11178. b(2),
  11179. b(17),
  11180. b(1),
  11181. b(3),
  11182. b(17),
  11183. b(1)
  11184. }(e.width, e.height),
  11185. function() {
  11186. w(65476),
  11187. w(418),
  11188. b(0);
  11189. for (var e = 0; e < 16; e++)
  11190. b(G[e + 1]);
  11191. for (var t = 0; t <= 11; t++)
  11192. b(W[t]);
  11193. b(16);
  11194. for (var i = 0; i < 16; i++)
  11195. b(j[i + 1]);
  11196. for (var n = 0; n <= 161; n++)
  11197. b(Y[n]);
  11198. b(1);
  11199. for (var r = 0; r < 16; r++)
  11200. b(q[r + 1]);
  11201. for (var o = 0; o <= 11; o++)
  11202. b(X[o]);
  11203. b(17);
  11204. for (var a = 0; a < 16; a++)
  11205. b(Z[a + 1]);
  11206. for (var s = 0; s <= 161; s++)
  11207. b(K[s])
  11208. }(),
  11209. w(65498),
  11210. w(12),
  11211. b(3),
  11212. b(1),
  11213. b(0),
  11214. b(2),
  11215. b(17),
  11216. b(3),
  11217. b(17),
  11218. b(0),
  11219. b(63),
  11220. b(0);
  11221. var n = 0
  11222. , r = 0
  11223. , o = 0;
  11224. B = 0,
  11225. V = 7,
  11226. this.encode.displayName = "_encode_";
  11227. for (var a, s, l, c, h, u, d, p, f, g = e.data, m = e.width, v = e.height, y = t.flipY, A = 4 * m, C = y ? v : 0, I = y ? -8 : 8; y && 0 < C || !y && C < v; ) {
  11228. for (a = 0; a < A; ) {
  11229. for (u = h = A * C + a,
  11230. d = -1,
  11231. f = p = 0; f < 64; f++)
  11232. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11233. v <= C + p && (u -= A * (C + 1 + p - v)),
  11234. A <= a + d && (u -= a + d - A + 4),
  11235. s = g[u++],
  11236. l = g[u++],
  11237. c = g[u++],
  11238. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11239. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11240. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11241. n = T(k, D, n, S, R),
  11242. r = T(U, N, r, M, P),
  11243. o = T(H, N, o, M, P),
  11244. a += 32
  11245. }
  11246. C += I
  11247. }
  11248. if (0 <= V) {
  11249. var E = [];
  11250. E[1] = V + 1,
  11251. E[0] = (1 << V + 1) - 1,
  11252. _(E)
  11253. }
  11254. return w(65497),
  11255. new J(F)
  11256. }
  11257. ,
  11258. (new Date).getTime(),
  11259. e = e || 50,
  11260. function() {
  11261. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11262. n[t] = e(t)
  11263. }(),
  11264. S = t(G, W),
  11265. M = t(q, X),
  11266. R = t(j, Y),
  11267. P = t(Z, K),
  11268. function() {
  11269. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11270. for (var n = e; n < t; n++)
  11271. y[32767 + n] = i,
  11272. v[32767 + n] = [],
  11273. v[32767 + n][1] = i,
  11274. v[32767 + n][0] = n;
  11275. for (var r = -(t - 1); r <= -e; r++)
  11276. y[32767 + r] = i,
  11277. v[32767 + r] = [],
  11278. v[32767 + r][1] = i,
  11279. v[32767 + r][0] = t - 1 + r;
  11280. e <<= 1,
  11281. t <<= 1
  11282. }
  11283. }(),
  11284. function() {
  11285. for (var e = 0; e < 256; e++)
  11286. z[e] = 19595 * e,
  11287. z[e + 256 >> 0] = 38470 * e,
  11288. z[e + 512 >> 0] = 7471 * e + 32768,
  11289. z[e + 768 >> 0] = -11059 * e,
  11290. z[e + 1024 >> 0] = -21709 * e,
  11291. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11292. z[e + 1536 >> 0] = -27439 * e,
  11293. z[e + 1792 >> 0] = -5329 * e
  11294. }(),
  11295. x(e),
  11296. (new Date).getTime()
  11297. }
  11298. t.exports.encode = function(e, t) {
  11299. return (t = t || {}).quality = t.quality || 50,
  11300. {
  11301. data: new i(t.quality).encode(e, t),
  11302. width: e.width,
  11303. height: e.height
  11304. }
  11305. }
  11306. }
  11307. ).call(this, e("buffer").Buffer)
  11308. }
  11309. , {
  11310. buffer: 198
  11311. }],
  11312. 95: [function(e, t, i) {
  11313. "use strict";
  11314. !function() {
  11315. if ("performance"in window == 0 && (window.performance = {}),
  11316. Date.now = Date.now || function() {
  11317. return (new Date).getTime()
  11318. }
  11319. ,
  11320. "now"in window.performance == 0) {
  11321. var e = Date.now();
  11322. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11323. window.performance.now = function() {
  11324. return Date.now() - e
  11325. }
  11326. }
  11327. }()
  11328. }
  11329. , {}],
  11330. 96: [function(e, t, i) {
  11331. "use strict";
  11332. var a = e("three");
  11333. a.EffectComposer = function(e, t) {
  11334. if (this.renderer = e,
  11335. void 0 === t) {
  11336. var i = {
  11337. minFilter: a.LinearFilter,
  11338. magFilter: a.LinearFilter,
  11339. format: a.RGBAFormat,
  11340. stencilBuffer: !1
  11341. }
  11342. , n = e.getSize();
  11343. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11344. }
  11345. this.renderTarget1 = t,
  11346. this.renderTarget2 = t.clone(),
  11347. this.writeBuffer = this.renderTarget1,
  11348. this.readBuffer = this.renderTarget2,
  11349. this.passes = [],
  11350. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11351. this.copyPass = new a.ShaderPass(a.CopyShader)
  11352. }
  11353. ,
  11354. a.EffectComposer.prototype = {
  11355. swapBuffers: function() {
  11356. var e = this.readBuffer;
  11357. this.readBuffer = this.writeBuffer,
  11358. this.writeBuffer = e
  11359. },
  11360. addPass: function(e) {
  11361. this.passes.push(e)
  11362. },
  11363. insertPass: function(e, t) {
  11364. this.passes.splice(t, 0, e)
  11365. },
  11366. render: function(e) {
  11367. this.writeBuffer = this.renderTarget1,
  11368. this.readBuffer = this.renderTarget2;
  11369. var t, i, n = !1, r = this.passes.length;
  11370. for (i = 0; i < r; i++)
  11371. if ((t = this.passes[i]).enabled) {
  11372. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11373. t.needsSwap) {
  11374. if (n) {
  11375. var o = this.renderer.context;
  11376. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11377. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11378. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11379. }
  11380. this.swapBuffers()
  11381. }
  11382. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11383. }
  11384. },
  11385. reset: function(e) {
  11386. if (void 0 === e) {
  11387. var t = this.renderer.getSize();
  11388. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11389. }
  11390. this.renderTarget1.dispose(),
  11391. this.renderTarget2.dispose(),
  11392. this.renderTarget1 = e,
  11393. this.renderTarget2 = e.clone(),
  11394. this.writeBuffer = this.renderTarget1,
  11395. this.readBuffer = this.renderTarget2
  11396. },
  11397. setSize: function(e, t) {
  11398. this.renderTarget1.setSize(e, t),
  11399. this.renderTarget2.setSize(e, t)
  11400. }
  11401. }
  11402. }
  11403. , {
  11404. three: 217
  11405. }],
  11406. 97: [function(e, t, i) {
  11407. "use strict";
  11408. var n = e("three");
  11409. n.MaskPass = function(e, t) {
  11410. this.scene = e,
  11411. this.camera = t,
  11412. this.enabled = !0,
  11413. this.clear = !0,
  11414. this.needsSwap = !1,
  11415. this.inverse = !1
  11416. }
  11417. ,
  11418. n.MaskPass.prototype = {
  11419. render: function(e, t, i, n) {
  11420. var r, o, a = e.context;
  11421. a.colorMask(!1, !1, !1, !1),
  11422. a.depthMask(!1),
  11423. o = this.inverse ? (r = 0,
  11424. 1) : (r = 1,
  11425. 0),
  11426. a.enable(a.STENCIL_TEST),
  11427. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11428. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11429. a.clearStencil(o),
  11430. e.render(this.scene, this.camera, i, this.clear),
  11431. e.render(this.scene, this.camera, t, this.clear),
  11432. a.colorMask(!0, !0, !0, !0),
  11433. a.depthMask(!0),
  11434. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11435. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11436. }
  11437. },
  11438. n.ClearMaskPass = function() {
  11439. this.enabled = !0
  11440. }
  11441. ,
  11442. n.ClearMaskPass.prototype = {
  11443. render: function(e, t, i, n) {
  11444. var r = e.context;
  11445. r.disable(r.STENCIL_TEST)
  11446. }
  11447. }
  11448. }
  11449. , {
  11450. three: 217
  11451. }],
  11452. 98: [function(e, t, i) {
  11453. "use strict";
  11454. var o = e("three");
  11455. o.RenderPass = function(e, t, i, n, r) {
  11456. this.scene = e,
  11457. this.camera = t,
  11458. this.overrideMaterial = i,
  11459. this.clearColor = n,
  11460. this.clearAlpha = void 0 !== r ? r : 1,
  11461. this.oldClearColor = new o.Color,
  11462. this.oldClearAlpha = 1,
  11463. this.enabled = !0,
  11464. this.clear = !0,
  11465. this.needsSwap = !1
  11466. }
  11467. ,
  11468. o.RenderPass.prototype = {
  11469. render: function(e, t, i, n) {
  11470. this.scene.overrideMaterial = this.overrideMaterial,
  11471. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11472. this.oldClearAlpha = e.getClearAlpha(),
  11473. e.setClearColor(this.clearColor, this.clearAlpha)),
  11474. e.render(this.scene, this.camera, i, this.clear),
  11475. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11476. this.scene.overrideMaterial = null
  11477. }
  11478. }
  11479. }
  11480. , {
  11481. three: 217
  11482. }],
  11483. 99: [function(e, t, i) {
  11484. "use strict";
  11485. var n = e("three");
  11486. n.ShaderPass = function(e, t) {
  11487. this.textureID = void 0 !== t ? t : "tDiffuse",
  11488. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11489. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11490. this.material = new n.ShaderMaterial({
  11491. defines: e.defines || {},
  11492. uniforms: this.uniforms,
  11493. vertexShader: e.vertexShader,
  11494. fragmentShader: e.fragmentShader
  11495. })),
  11496. this.renderToScreen = !1,
  11497. this.enabled = !0,
  11498. this.needsSwap = !0,
  11499. this.clear = !1,
  11500. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11501. this.scene = new n.Scene,
  11502. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11503. this.scene.add(this.quad)
  11504. }
  11505. ,
  11506. n.ShaderPass.prototype = {
  11507. render: function(e, t, i, n) {
  11508. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11509. this.quad.material = this.material,
  11510. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11511. }
  11512. }
  11513. }
  11514. , {
  11515. three: 217
  11516. }],
  11517. 100: [function(e, t, i) {
  11518. "use strict";
  11519. e("three").CopyShader = {
  11520. uniforms: {
  11521. tDiffuse: {
  11522. type: "t",
  11523. value: null
  11524. },
  11525. opacity: {
  11526. type: "f",
  11527. value: 1
  11528. }
  11529. },
  11530. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11531. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11532. }
  11533. }
  11534. , {
  11535. three: 217
  11536. }],
  11537. 101: [function(e, t, i) {
  11538. "use strict";
  11539. e("three").HorizontalBlurShader = {
  11540. uniforms: {
  11541. tDiffuse: {
  11542. type: "t",
  11543. value: null
  11544. },
  11545. h: {
  11546. type: "f",
  11547. value: 1 / 512
  11548. }
  11549. },
  11550. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11551. 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")
  11552. }
  11553. }
  11554. , {
  11555. three: 217
  11556. }],
  11557. 102: [function(e, t, i) {
  11558. "use strict";
  11559. e("three").VerticalBlurShader = {
  11560. uniforms: {
  11561. tDiffuse: {
  11562. type: "t",
  11563. value: null
  11564. },
  11565. v: {
  11566. type: "f",
  11567. value: 1 / 512
  11568. }
  11569. },
  11570. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11571. 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")
  11572. }
  11573. }
  11574. , {
  11575. three: 217
  11576. }],
  11577. 103: [function(e, t, i) {
  11578. "use strict";
  11579. var z = e("three");
  11580. !function() {
  11581. if ("performance"in window == 0 && (window.performance = {}),
  11582. "now"in window.performance == 0) {
  11583. var e = Date.now();
  11584. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11585. window.performance.now = function() {
  11586. return Date.now() - e
  11587. }
  11588. }
  11589. }(),
  11590. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11591. var t, i = this.extensions, n = this.context;
  11592. if (e === z.RepeatWrapping)
  11593. return n.REPEAT;
  11594. if (e === z.ClampToEdgeWrapping)
  11595. return n.CLAMP_TO_EDGE;
  11596. if (e === z.MirroredRepeatWrapping)
  11597. return n.MIRRORED_REPEAT;
  11598. if (e === z.NearestFilter)
  11599. return n.NEAREST;
  11600. if (e === z.NearestMipMapNearestFilter)
  11601. return n.NEAREST_MIPMAP_NEAREST;
  11602. if (e === z.NearestMipMapLinearFilter)
  11603. return n.NEAREST_MIPMAP_LINEAR;
  11604. if (e === z.LinearFilter)
  11605. return n.LINEAR;
  11606. if (e === z.LinearMipMapNearestFilter)
  11607. return n.LINEAR_MIPMAP_NEAREST;
  11608. if (e === z.LinearMipMapLinearFilter)
  11609. return n.LINEAR_MIPMAP_LINEAR;
  11610. if (e === z.UnsignedByteType)
  11611. return n.UNSIGNED_BYTE;
  11612. if (e === z.UnsignedShort4444Type)
  11613. return n.UNSIGNED_SHORT_4_4_4_4;
  11614. if (e === z.UnsignedShort5551Type)
  11615. return n.UNSIGNED_SHORT_5_5_5_1;
  11616. if (e === z.UnsignedShort565Type)
  11617. return n.UNSIGNED_SHORT_5_6_5;
  11618. if (e === z.ByteType)
  11619. return n.BYTE;
  11620. if (e === z.ShortType)
  11621. return n.SHORT;
  11622. if (e === z.UnsignedShortType)
  11623. return n.UNSIGNED_SHORT;
  11624. if (e === z.IntType)
  11625. return n.INT;
  11626. if (e === z.UnsignedIntType)
  11627. return n.UNSIGNED_INT;
  11628. if (e === z.FloatType)
  11629. return n.FLOAT;
  11630. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11631. return t.HALF_FLOAT_OES;
  11632. if (e === z.AlphaFormat)
  11633. return n.ALPHA;
  11634. if (e === z.RGBFormat)
  11635. return n.RGB;
  11636. if (e === z.RGBAFormat)
  11637. return n.RGBA;
  11638. if (e === z.LuminanceFormat)
  11639. return n.LUMINANCE;
  11640. if (e === z.LuminanceAlphaFormat)
  11641. return n.LUMINANCE_ALPHA;
  11642. if (e === z.AddEquation)
  11643. return n.FUNC_ADD;
  11644. if (e === z.SubtractEquation)
  11645. return n.FUNC_SUBTRACT;
  11646. if (e === z.ReverseSubtractEquation)
  11647. return n.FUNC_REVERSE_SUBTRACT;
  11648. if (e === z.ZeroFactor)
  11649. return n.ZERO;
  11650. if (e === z.OneFactor)
  11651. return n.ONE;
  11652. if (e === z.SrcColorFactor)
  11653. return n.SRC_COLOR;
  11654. if (e === z.OneMinusSrcColorFactor)
  11655. return n.ONE_MINUS_SRC_COLOR;
  11656. if (e === z.SrcAlphaFactor)
  11657. return n.SRC_ALPHA;
  11658. if (e === z.OneMinusSrcAlphaFactor)
  11659. return n.ONE_MINUS_SRC_ALPHA;
  11660. if (e === z.DstAlphaFactor)
  11661. return n.DST_ALPHA;
  11662. if (e === z.OneMinusDstAlphaFactor)
  11663. return n.ONE_MINUS_DST_ALPHA;
  11664. if (e === z.DstColorFactor)
  11665. return n.DST_COLOR;
  11666. if (e === z.OneMinusDstColorFactor)
  11667. return n.ONE_MINUS_DST_COLOR;
  11668. if (e === z.SrcAlphaSaturateFactor)
  11669. return n.SRC_ALPHA_SATURATE;
  11670. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11671. if (e === z.RGB_S3TC_DXT1_Format)
  11672. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11673. if (e === z.RGBA_S3TC_DXT1_Format)
  11674. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11675. if (e === z.RGBA_S3TC_DXT3_Format)
  11676. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11677. if (e === z.RGBA_S3TC_DXT5_Format)
  11678. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11679. }
  11680. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11681. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11682. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11683. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11684. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11685. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11686. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11687. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11688. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11689. }
  11690. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11691. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11692. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11693. if (e === z.MinEquation)
  11694. return t.MIN_EXT;
  11695. if (e === z.MaxEquation)
  11696. return t.MAX_EXT
  11697. }
  11698. return 0
  11699. }
  11700. ,
  11701. z.WebGLState = function(l, i, c) {
  11702. var n = this
  11703. , r = new z.Vector4
  11704. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11705. , o = new Uint8Array(e)
  11706. , a = new Uint8Array(e)
  11707. , s = new Uint8Array(e)
  11708. , t = {}
  11709. , h = null
  11710. , u = null
  11711. , d = null
  11712. , p = null
  11713. , f = null
  11714. , g = null
  11715. , m = null
  11716. , v = null
  11717. , y = !1
  11718. , A = null
  11719. , C = null
  11720. , I = null
  11721. , E = null
  11722. , _ = null
  11723. , b = null
  11724. , w = null
  11725. , T = null
  11726. , x = null
  11727. , S = null
  11728. , M = null
  11729. , R = null
  11730. , P = null
  11731. , O = null
  11732. , L = null
  11733. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11734. , N = void 0
  11735. , F = {}
  11736. , B = new z.Vector4
  11737. , V = null
  11738. , k = null
  11739. , U = new z.Vector4
  11740. , H = new z.Vector4;
  11741. this.init = function() {
  11742. this.clearColor(0, 0, 0, 1),
  11743. this.clearDepth(1),
  11744. this.clearStencil(0),
  11745. this.enable(l.DEPTH_TEST),
  11746. l.depthFunc(l.LEQUAL),
  11747. l.frontFace(l.CCW),
  11748. l.cullFace(l.BACK),
  11749. this.enable(l.CULL_FACE),
  11750. this.enable(l.BLEND),
  11751. l.blendEquation(l.FUNC_ADD),
  11752. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11753. }
  11754. ,
  11755. this.initAttributes = function() {
  11756. for (var e = 0, t = o.length; e < t; e++)
  11757. o[e] = 0
  11758. }
  11759. ,
  11760. this.enableAttribute = function(e) {
  11761. o[e] = 1,
  11762. 0 === a[e] && (l.enableVertexAttribArray(e),
  11763. a[e] = 1),
  11764. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11765. s[e] = 0)
  11766. }
  11767. ,
  11768. this.enableAttributeAndDivisor = function(e, t, i) {
  11769. o[e] = 1,
  11770. 0 === a[e] && (l.enableVertexAttribArray(e),
  11771. a[e] = 1),
  11772. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11773. s[e] = t)
  11774. }
  11775. ,
  11776. this.disableUnusedAttributes = function() {
  11777. for (var e = 0, t = a.length; e < t; e++)
  11778. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11779. a[e] = 0)
  11780. }
  11781. ,
  11782. this.enable = function(e) {
  11783. !0 !== t[e] && (l.enable(e),
  11784. t[e] = !0)
  11785. }
  11786. ,
  11787. this.disable = function(e) {
  11788. !1 !== t[e] && (l.disable(e),
  11789. t[e] = !1)
  11790. }
  11791. ,
  11792. this.getCompressedTextureFormats = function() {
  11793. if (null === h && (h = [],
  11794. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11795. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11796. h.push(e[t]);
  11797. return h
  11798. }
  11799. ,
  11800. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11801. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11802. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11803. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11804. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11805. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11806. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11807. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11808. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11809. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11810. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11811. u = e,
  11812. y = s),
  11813. e === z.CustomBlending ? (r = r || t,
  11814. o = o || i,
  11815. a = a || n,
  11816. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11817. d = t,
  11818. g = r),
  11819. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11820. p = i,
  11821. f = n,
  11822. m = o,
  11823. v = a)) : v = m = g = f = p = d = null
  11824. }
  11825. ,
  11826. this.setDepthFunc = function(e) {
  11827. if (A !== e) {
  11828. if (e)
  11829. switch (e) {
  11830. case z.NeverDepth:
  11831. l.depthFunc(l.NEVER);
  11832. break;
  11833. case z.AlwaysDepth:
  11834. l.depthFunc(l.ALWAYS);
  11835. break;
  11836. case z.LessDepth:
  11837. l.depthFunc(l.LESS);
  11838. break;
  11839. case z.LessEqualDepth:
  11840. l.depthFunc(l.LEQUAL);
  11841. break;
  11842. case z.EqualDepth:
  11843. l.depthFunc(l.EQUAL);
  11844. break;
  11845. case z.GreaterEqualDepth:
  11846. l.depthFunc(l.GEQUAL);
  11847. break;
  11848. case z.GreaterDepth:
  11849. l.depthFunc(l.GREATER);
  11850. break;
  11851. case z.NotEqualDepth:
  11852. l.depthFunc(l.NOTEQUAL);
  11853. break;
  11854. default:
  11855. l.depthFunc(l.LEQUAL)
  11856. }
  11857. else
  11858. l.depthFunc(l.LEQUAL);
  11859. A = e
  11860. }
  11861. }
  11862. ,
  11863. this.setDepthTest = function(e) {
  11864. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  11865. }
  11866. ,
  11867. this.setDepthWrite = function(e) {
  11868. C !== e && (l.depthMask(e),
  11869. C = e)
  11870. }
  11871. ,
  11872. this.setColorWrite = function(e) {
  11873. I !== e && (l.colorMask(e, e, e, e),
  11874. I = e)
  11875. }
  11876. ,
  11877. this.setStencilFunc = function(e, t, i) {
  11878. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  11879. _ = e,
  11880. b = t,
  11881. w = i)
  11882. }
  11883. ,
  11884. this.setStencilOp = function(e, t, i) {
  11885. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  11886. T = e,
  11887. x = t,
  11888. S = i)
  11889. }
  11890. ,
  11891. this.setStencilTest = function(e) {
  11892. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  11893. }
  11894. ,
  11895. this.setStencilWrite = function(e) {
  11896. E !== e && (l.stencilMask(e),
  11897. E = e)
  11898. }
  11899. ,
  11900. this.setFlipSided = function(e) {
  11901. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  11902. M = e)
  11903. }
  11904. ,
  11905. this.setLineWidth = function(e) {
  11906. e !== R && (l.lineWidth(e),
  11907. R = e)
  11908. }
  11909. ,
  11910. this.setPolygonOffset = function(e, t, i) {
  11911. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  11912. !e || P === t && O === i || (l.polygonOffset(t, i),
  11913. P = t,
  11914. O = i)
  11915. }
  11916. ,
  11917. this.getScissorTest = function() {
  11918. return L
  11919. }
  11920. ,
  11921. this.setScissorTest = function(e) {
  11922. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  11923. }
  11924. ,
  11925. this.activeTexture = function(e) {
  11926. void 0 === e && (e = l.TEXTURE0 + D - 1),
  11927. N !== e && (l.activeTexture(e),
  11928. N = e)
  11929. }
  11930. ,
  11931. this.bindTexture = function(e, t) {
  11932. void 0 === N && n.activeTexture();
  11933. var i = F[N];
  11934. void 0 === i && (i = {
  11935. type: void 0,
  11936. texture: void 0
  11937. },
  11938. F[N] = i),
  11939. i.type === e && i.texture === t || (l.bindTexture(e, t),
  11940. i.type = e,
  11941. i.texture = t)
  11942. }
  11943. ,
  11944. this.compressedTexImage2D = function() {
  11945. try {
  11946. l.compressedTexImage2D.apply(l, arguments)
  11947. } catch (e) {
  11948. console.error(e)
  11949. }
  11950. }
  11951. ,
  11952. this.texImage2D = function() {
  11953. try {
  11954. l.texImage2D.apply(l, arguments)
  11955. } catch (e) {
  11956. console.error(e)
  11957. }
  11958. }
  11959. ,
  11960. this.clearColor = function(e, t, i, n) {
  11961. r.set(e, t, i, n),
  11962. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  11963. B.copy(r))
  11964. }
  11965. ,
  11966. this.clearDepth = function(e) {
  11967. V !== e && (l.clearDepth(e),
  11968. V = e)
  11969. }
  11970. ,
  11971. this.clearStencil = function(e) {
  11972. k !== e && (l.clearStencil(e),
  11973. k = e)
  11974. }
  11975. ,
  11976. this.scissor = function(e) {
  11977. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  11978. U.copy(e))
  11979. }
  11980. ,
  11981. this.viewport = function(e) {
  11982. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  11983. H.copy(e))
  11984. }
  11985. ,
  11986. this.reset = function() {
  11987. for (var e = 0; e < a.length; e++)
  11988. 1 === a[e] && (l.disableVertexAttribArray(e),
  11989. a[e] = 0);
  11990. t = {},
  11991. N = void 0,
  11992. F = {},
  11993. M = E = C = I = u = h = null
  11994. }
  11995. }
  11996. }
  11997. , {
  11998. three: 217
  11999. }],
  12000. 104: [function(a, h, e) {
  12001. (function(i, e) {
  12002. "use strict";
  12003. function t(e) {
  12004. this.urls = e;
  12005. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12006. this.builder = n.loadProto(t),
  12007. this.decoder = this.builder.build("binary_mesh")
  12008. }
  12009. var s = a("three")
  12010. , n = a("protobufjs")
  12011. , r = a("../util/logger")
  12012. , o = (a("../util/common"),
  12013. a("../util/ajax"))
  12014. , l = a("../objects/Chunk")
  12015. , c = new r(e);
  12016. t.prototype = {
  12017. constructor: t,
  12018. load: function(t, i, n, r) {
  12019. return c.time("download"),
  12020. o.get(t, {
  12021. responseType: "arraybuffer"
  12022. }).done(function(e) {
  12023. c.timeEnd("download"),
  12024. this.parse(e, t, i, n, r)
  12025. }
  12026. .bind(this)).fail(r)
  12027. },
  12028. parse: function(e, t, i, n, r) {
  12029. var o = this.readProtobuf(e);
  12030. if (!o)
  12031. return r();
  12032. try {
  12033. c.time("convert to webgl"),
  12034. this.convertProtobufToSceneObject(o, t, i, n, r),
  12035. c.timeEnd("convert to webgl")
  12036. } catch (e) {
  12037. return c.error("failed parsing .dam"),
  12038. c.error(e.message),
  12039. r()
  12040. }
  12041. },
  12042. readProtobuf: function(e) {
  12043. var t;
  12044. try {
  12045. c.time("parse proto"),
  12046. t = this.decoder.decode(e),
  12047. c.timeEnd("parse proto")
  12048. } catch (e) {
  12049. return c.error("failed parsing proto for .dam"),
  12050. c.error(e.message),
  12051. null
  12052. }
  12053. return t
  12054. },
  12055. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12056. if (0 === e.chunk.length)
  12057. return c.warn("No chunks in damfile..."),
  12058. t([]);
  12059. var o = new s.Matrix4;
  12060. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12061. var a = e.chunk.map(function(e) {
  12062. var t = new s.BufferGeometry;
  12063. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12064. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12065. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12066. t.applyMatrix(o),
  12067. t.computeBoundingBox(),
  12068. new l({
  12069. geometry: t,
  12070. textureName: e.material_name,
  12071. name: e.chunk_name,
  12072. meshUrl: i
  12073. })
  12074. });
  12075. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12076. r())
  12077. }
  12078. },
  12079. h.exports = t
  12080. }
  12081. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12082. }
  12083. , {
  12084. "../objects/Chunk": 144,
  12085. "../util/ajax": 181,
  12086. "../util/common": 185,
  12087. "../util/logger": 189,
  12088. buffer: 198,
  12089. protobufjs: 214,
  12090. three: 217
  12091. }],
  12092. 105: [function(n, r, e) {
  12093. (function(e) {
  12094. "use strict";
  12095. var t = (n("three"),
  12096. n("../settings"),
  12097. n("../util/browser"),
  12098. n("./DamLoader"))
  12099. , i = n("../util/logger")
  12100. , u = (n("../ab"),
  12101. new i(e));
  12102. r.exports = {
  12103. getLoaders: function() {
  12104. return [["_50k", ".dam", t], ["", ".dam", t]]
  12105. },
  12106. load: function(e, t, i, n, r, o) {
  12107. var a = this.getLoaders()[o = o || 0];
  12108. if (a) {
  12109. var s = a[0]
  12110. , l = a[1]
  12111. , c = new a[2](t)
  12112. , h = t.get(e + s + l);
  12113. h ? (u.debug("Trying " + s + l),
  12114. c.load(h, i, n, function() {
  12115. this.load(e, t, i, n, r, ++o)
  12116. }
  12117. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12118. this.load(e, t, i, n, r, ++o))
  12119. } else
  12120. r && r("No suitable model file found...")
  12121. }
  12122. }
  12123. }
  12124. ).call(this, "/js/loaders/ModelLoader.js")
  12125. }
  12126. , {
  12127. "../ab": 3,
  12128. "../settings": 166,
  12129. "../util/browser": 182,
  12130. "../util/logger": 189,
  12131. "./DamLoader": 104,
  12132. three: 217
  12133. }],
  12134. 106: [function(i, n, e) {
  12135. (function(e) {
  12136. "use strict";
  12137. var l = i("../util/common")
  12138. , c = i("../util/texture")
  12139. , h = i("../util/browser")
  12140. , t = i("../util/logger")
  12141. , u = i("../settings")
  12142. , d = new t(e);
  12143. n.exports = {
  12144. load: function(i, n) {
  12145. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12146. return $.when();
  12147. var r = l.countUnique(i.chunks.map(function(e) {
  12148. return e.textureName
  12149. }))
  12150. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12151. , t = "_50k" == e ? "high" : "low";
  12152. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12153. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12154. t = "low"));
  12155. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12156. , a = $.Deferred()
  12157. , s = 0;
  12158. return i.chunks.forEach(function(e) {
  12159. if (!e.material.map && e.textureName) {
  12160. var t = i.urls.get(o + e.textureName);
  12161. e.setTextureMap(c.load(t, function(e, t) {
  12162. e || (n.push(t),
  12163. s++,
  12164. a.notify(s, r),
  12165. s === r && a.resolve())
  12166. }
  12167. .bind(this, c.isLoaded(t))))
  12168. }
  12169. }),
  12170. a.promise()
  12171. }
  12172. }
  12173. }
  12174. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12175. }
  12176. , {
  12177. "../settings": 166,
  12178. "../util/browser": 182,
  12179. "../util/common": 185,
  12180. "../util/logger": 189,
  12181. "../util/texture": 194
  12182. }],
  12183. 107: [function(s, l, e) {
  12184. (function(n, e) {
  12185. "use strict";
  12186. function t(e) {
  12187. this.model = e,
  12188. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12189. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12190. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12191. , i = r.loadProto(t);
  12192. this.decoder = i.build("VisionModeldata")
  12193. }
  12194. var r = s("protobufjs")
  12195. , i = s("../util/ajax")
  12196. , o = (s("../util/common"),
  12197. s("../util/math"))
  12198. , a = new (s("../util/logger"))(e);
  12199. t.prototype.load = function() {
  12200. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12201. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12202. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12203. $.when([]))
  12204. }
  12205. ,
  12206. t.prototype.loadVisionModelData = function() {
  12207. return i.get(this.modelDataPath, {
  12208. responseType: "arraybuffer"
  12209. }).then(function(e) {
  12210. var t;
  12211. try {
  12212. t = this.decoder.decode(e)
  12213. } catch (e) {
  12214. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12215. this.loadSweepLocationsCSV()
  12216. }
  12217. var i = t.sweepLocations.map(function(e) {
  12218. return {
  12219. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12220. position: {
  12221. x: e.pose.translation.x,
  12222. y: e.pose.translation.y,
  12223. z: e.pose.translation.z
  12224. },
  12225. quaternion: {
  12226. x: e.pose.rotation.x,
  12227. y: e.pose.rotation.y,
  12228. z: e.pose.rotation.z,
  12229. w: e.pose.rotation.w
  12230. },
  12231. puck: {
  12232. x: e.puck.x,
  12233. y: e.puck.y,
  12234. z: e.puck.z
  12235. },
  12236. floor: e.group,
  12237. neighbours: e.visibles,
  12238. alignmentType: e.alignment_type
  12239. }
  12240. }).map(function(e) {
  12241. return e.position = o.convertVisionVector(e.position),
  12242. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12243. e.puck = o.convertVisionVector(e.puck),
  12244. e
  12245. });
  12246. return i.forEach(function(e) {
  12247. e.neighbours = e.neighbours.map(function(e) {
  12248. return i[e].uuid
  12249. })
  12250. }),
  12251. i
  12252. }
  12253. .bind(this), function() {
  12254. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12255. this.loadSweepLocationsCSV()
  12256. }
  12257. .bind(this))
  12258. }
  12259. ,
  12260. t.prototype.loadSweepLocationsCSV = function() {
  12261. return i.get(this.sweepLocationsPath).then(function(e) {
  12262. return e.split("\n").map(function(e) {
  12263. return e.split(", ")
  12264. }).filter(function(e) {
  12265. return 1 < e.length
  12266. }).map(function(e) {
  12267. return {
  12268. uuid: e[0],
  12269. position: {
  12270. x: parseFloat(e[1]),
  12271. y: parseFloat(e[2]),
  12272. z: parseFloat(e[3])
  12273. },
  12274. quaternion: {
  12275. x: parseFloat(e[4]),
  12276. y: parseFloat(e[5]),
  12277. z: parseFloat(e[6]),
  12278. w: parseFloat(e[7])
  12279. }
  12280. }
  12281. }).map(function(e) {
  12282. return e.position = o.convertVisionVector(e.position),
  12283. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12284. e
  12285. })
  12286. }).fail(function() {
  12287. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12288. })
  12289. }
  12290. ,
  12291. l.exports = t
  12292. }
  12293. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12294. }
  12295. , {
  12296. "../util/ajax": 181,
  12297. "../util/common": 185,
  12298. "../util/logger": 189,
  12299. "../util/math": 190,
  12300. buffer: 198,
  12301. protobufjs: 214
  12302. }],
  12303. 108: [function(s, l, e) {
  12304. (function(e) {
  12305. "use strict";
  12306. function t() {
  12307. this.locale = null
  12308. }
  12309. var i = s("../settings")
  12310. , n = s("../util/common")
  12311. , r = s("../util/logger")
  12312. , o = s("../enum/Locale")
  12313. , a = new r(e);
  12314. t.prototype.init = function() {
  12315. var e;
  12316. switch (i.languageTag) {
  12317. case null:
  12318. case "en":
  12319. case o.EN_US:
  12320. this.locale = o.EN_US,
  12321. e = s("./strings-en-US");
  12322. break;
  12323. case "es":
  12324. case o.ES_MX:
  12325. this.locale = o.ES_MX,
  12326. e = s("./strings-es-MX");
  12327. break;
  12328. case "fr":
  12329. case o.FR_FR:
  12330. this.locale = o.FR_FR,
  12331. e = s("./strings-fr-FR");
  12332. break;
  12333. case "de":
  12334. case o.DE_DE:
  12335. this.locale = o.DE_DE,
  12336. e = s("./strings-de-DE");
  12337. break;
  12338. case "ru":
  12339. case o.RU_RU:
  12340. this.locale = o.RU_RU,
  12341. e = s("./strings-ru-RU");
  12342. break;
  12343. case "cn":
  12344. case o.CN_CN:
  12345. this.locale = o.CN_CN,
  12346. e = s("./strings-cn-CN");
  12347. break;
  12348. case "jp":
  12349. case o.JP_JP:
  12350. this.locale = o.JP_JP,
  12351. e = s("./strings-jp-JP");
  12352. break;
  12353. default:
  12354. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12355. this.locale = o.EN_US,
  12356. e = s("./strings-en-US")
  12357. }
  12358. a.info("Using locale '" + this.locale + "'"),
  12359. n.extendObject(this, e)
  12360. }
  12361. ,
  12362. t.prototype.localizeGUI = function() {
  12363. var e = document.querySelector("#gui-parent");
  12364. this.localizeTree(e),
  12365. this.localizeLoadingText()
  12366. }
  12367. ,
  12368. t.prototype.localizeLoadingText = function() {
  12369. document.querySelector("#help-dialog").classList.add(this.locale),
  12370. document.querySelector("#interaction-modal").classList.add(this.locale),
  12371. document.querySelector("#gui").classList.add(this.locale)
  12372. }
  12373. ,
  12374. t.prototype.localizeTree = function(e) {
  12375. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12376. if (e.nodeType === Node.TEXT_NODE)
  12377. (t = e.data.match(n)) && (i = t[1],
  12378. e.data = this.localizeText(i) || i);
  12379. else if (e.nodeType === Node.ELEMENT_NODE) {
  12380. var r = e.getAttribute("title");
  12381. r && ((t = r.match(n)) && (i = t[1],
  12382. e.setAttribute("title", this.localizeText(i) || i)))
  12383. }
  12384. for (e = e.firstChild; e; )
  12385. this.localizeTree(e),
  12386. e = e.nextSibling
  12387. }
  12388. ,
  12389. t.prototype.localizeText = function(e) {
  12390. var t = this[e];
  12391. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12392. t = s("./strings-en-US")[e]),
  12393. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12394. t
  12395. }
  12396. ,
  12397. l.exports = new t
  12398. }
  12399. ).call(this, "/js/localization/localize.js")
  12400. }
  12401. , {
  12402. "../enum/Locale": 31,
  12403. "../settings": 166,
  12404. "../util/common": 185,
  12405. "../util/logger": 189,
  12406. "./strings-cn-CN": 109,
  12407. "./strings-de-DE": 110,
  12408. "./strings-en-US": 111,
  12409. "./strings-es-MX": 112,
  12410. "./strings-fr-FR": 113,
  12411. "./strings-jp-JP": 114,
  12412. "./strings-ru-RU": 115
  12413. }],
  12414. 109: [function(e, t, i) {
  12415. "use strict";
  12416. t.exports = {
  12417. PAGE_TITLE: "",
  12418. LOADING: "正在加载",
  12419. PRESENTED_BY_CAPS: "呈现者:",
  12420. POWERED_BY: "技术支持:",
  12421. POWERED_BY_CAPS: "技术支持:",
  12422. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12423. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12424. PRESENTED_BY: "呈现者:",
  12425. MORE: "更多 ",
  12426. LESS: "更少 ",
  12427. TAG_CONTENT: "tag™ 内容",
  12428. SHOW: "显示",
  12429. HIDE: "隐藏",
  12430. DOLLHOUSE: "场景屋",
  12431. FLOOR_PLAN: "楼层平面图",
  12432. OPEN_HIGHLIGHTS: "打开精彩片段",
  12433. CLOSE_HIGHLIGHTS: "关闭",
  12434. PREVIOUS: "上一个",
  12435. PLAY: "播放",
  12436. PAUSE: "暂停",
  12437. NEXT: "下一个",
  12438. EXPLORE_3D_SPACE: "探索 3D 空间",
  12439. VIEW_DOLLHOUSE: "观看场景屋",
  12440. SOCIAL_SHARING: "分享这个空间",
  12441. VIEW_IN_VR: "以 VR 观看",
  12442. VIEW_FULLSCREEN: "全屏观看",
  12443. EXIT_FULLSCREEN: " 退出全屏",
  12444. ZOOM_IN: "放大",
  12445. ZOOM_OUT: "缩小",
  12446. FLOOR_NAME: "楼层",
  12447. FLOOR_ALL: "ALL",
  12448. FLOOR_Lang: ["Floor", ""],
  12449. TERMS: "条款",
  12450. PORT_TERMS: "port 条款",
  12451. TERMS_OF_USE: "使用条款",
  12452. CLOSE_TERMS: "关闭",
  12453. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12454. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12455. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12456. WEBVR_ENTER_WEBVR: "进入 VR",
  12457. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12458. WEBVR_LEARN_MORE: "了解更多",
  12459. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12460. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12461. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12462. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12463. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12464. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12465. VR_LEARN_MORE_CAPS: "了解更多",
  12466. VR_PREVIOUS_CAPS: "上一个’,",
  12467. VR_NEXT_CAPS: "下一个",
  12468. VR_GOT_IT_CAPS: "明白了",
  12469. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12470. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12471. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12472. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12473. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12474. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12475. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12476. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12477. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12478. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12479. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12480. VR_APP: "port VR 应用程序",
  12481. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12482. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12483. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12484. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12485. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12486. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12487. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12488. VR_ANDROID_DVICES: "Android 设备",
  12489. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12490. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12491. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12492. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12493. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12494. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12495. VR_DOWNLOAD_HERE: "在此下载",
  12496. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12497. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12498. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12499. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12500. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12501. SHARE_TO: "分享到",
  12502. SHARE_LINK: "直接链接",
  12503. SHARE_EXPLORE: "探索",
  12504. SHARE_AT: "在",
  12505. SHARE_WITH: "使用",
  12506. SHARE_3D: "以 3D",
  12507. SHARE_COPIED: "已复制!",
  12508. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12509. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12510. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12511. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12512. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12513. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12514. ERROR_GENERIC_ACTIONS_3: " 或",
  12515. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12516. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12517. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12518. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12519. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12520. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12521. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12522. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12523. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12524. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12525. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12526. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12527. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12528. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12529. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12530. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12531. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12532. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12533. LINK_TO_LOCATION: "地点链接",
  12534. MENU_COPY: "复制",
  12535. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12536. ROTATE: "旋转",
  12537. MOVE: "移动",
  12538. INSIDE: "内部",
  12539. ZOOM: "缩放",
  12540. HELP: "小帮手",
  12541. HELP_NAVIGATION_TAB: "导航",
  12542. HELP_MORE_HELP_TAB: "更多帮助",
  12543. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12544. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12545. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12546. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12547. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12548. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12549. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12550. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12551. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12552. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12553. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12554. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12555. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12556. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12557. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12558. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12559. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12560. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12561. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12562. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12563. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12564. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12565. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12566. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12567. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12568. HELP_MORE_HLR_A: "精彩片段集锦",
  12569. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12570. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12571. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12572. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12573. HELP_MORE_FLOORS_A: "楼层选择器",
  12574. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12575. HELP_MORE_TAG_A: "tag™ 贴文",
  12576. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12577. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12578. HELP_MORE_ZOOM_A: "缩放控件",
  12579. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12580. HELP_MORE_TOUR_A: "导览控件",
  12581. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12582. HELP_MORE_INSIDE_A: "内部视图",
  12583. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12584. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12585. HELP_MORE_VR_A: "VR 模式",
  12586. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12587. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12588. HELP_MORE_360_A: "360° 视图",
  12589. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12590. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12591. HELP_MORE_FULLSCREEN_A: "全屏",
  12592. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12593. CLOSE: "关闭"
  12594. }
  12595. }
  12596. , {}],
  12597. 110: [function(e, t, i) {
  12598. "use strict";
  12599. t.exports = {
  12600. PAGE_TITLE: "",
  12601. LOADING: "Lädt",
  12602. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12603. POWERED_BY: "Angetrieben von",
  12604. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12605. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12606. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12607. PRESENTED_BY: "Präsentiert von ",
  12608. MORE: "Mehr ",
  12609. LESS: "Weniger ",
  12610. TAG_CONTENT: "tag™ Inhalt",
  12611. SHOW: "Anzeigen",
  12612. HIDE: "Verbergen",
  12613. DOLLHOUSE: "Puppenhaus",
  12614. FLOOR_PLAN: "Grundriss",
  12615. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12616. CLOSE_HIGHLIGHTS: "Schließen",
  12617. PREVIOUS: "Vorheriges",
  12618. PLAY: "Abspielen",
  12619. PAUSE: "Pausieren",
  12620. NEXT: "Nächstes",
  12621. EXPLORE_3D_SPACE: "Innenraum betreten",
  12622. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12623. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12624. VIEW_IN_VR: "In VR ansehen",
  12625. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12626. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12627. ZOOM_IN: "Vergrößern",
  12628. ZOOM_OUT: "Verkleinern",
  12629. FLOOR_NAME: "Etage ",
  12630. FLOOR_ALL: "Alle",
  12631. TERMS: "Bedingungen",
  12632. PORT_TERMS: "port Bedingungen",
  12633. TERMS_OF_USE: "Nutzungsbedingungen",
  12634. TERMS_TEXT_FILE: "terms-de-DE.html",
  12635. CLOSE_TERMS: "Schließen",
  12636. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12637. HELP: "Hilfe",
  12638. HELP_NAVIGATION_TAB: "Navigation",
  12639. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12640. CLOSE: "Schließen",
  12641. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12642. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12643. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12644. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12645. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12646. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12647. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12648. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12649. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12650. 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.",
  12651. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12652. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12653. 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.",
  12654. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12655. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12656. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12657. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12658. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12659. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12660. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12661. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12662. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12663. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12664. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12665. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12666. HELP_MORE_HLR_A: "Liste das Highlight",
  12667. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12668. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12669. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12670. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12671. HELP_MORE_FLOORS_A: "Etage auswählen",
  12672. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12673. HELP_MORE_TAG_A: "tag™ Posts",
  12674. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12675. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12676. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12677. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12678. HELP_MORE_TOUR_A: "Tour Steuerung",
  12679. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12680. HELP_MORE_INSIDE_A: "Innenansicht",
  12681. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12682. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12683. HELP_MORE_VR_A: "VR Modus",
  12684. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12685. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12686. HELP_MORE_360_A: "360° Views Ansicht ",
  12687. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12688. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12689. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12690. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12691. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12692. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12693. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12694. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12695. WEBVR_LEARN_MORE: "Mehr Infos",
  12696. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12697. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12698. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12699. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12700. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12701. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12702. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12703. VR_APP: "port VR App",
  12704. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12705. 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",
  12706. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12707. VR_APP_FOR_ANDROID: "port VR app für Android",
  12708. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12709. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12710. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12711. VR_PREVIOUS_CAPS: "ZURÜCK",
  12712. VR_NEXT_CAPS: "WEITER",
  12713. VR_GOT_IT_CAPS: "VERSTANDEN",
  12714. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12715. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12716. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12717. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12718. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12719. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12720. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12721. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12722. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12723. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12724. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12725. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12726. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12727. VR_ANDROID_DVICES: "Android Geräte",
  12728. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12729. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12730. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12731. VR_DOWNLOAD_HERE: "Hier runterladen",
  12732. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12733. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12734. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12735. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12736. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12737. SHARE_TO: "Teilen auf",
  12738. SHARE_LINK: "Direkter Link",
  12739. SHARE_EXPLORE: "Umsehen",
  12740. SHARE_AT: "auf",
  12741. SHARE_WITH: "mit",
  12742. SHARE_3D: "in 3D",
  12743. SHARE_COPIED: "Kopiert!",
  12744. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12745. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12746. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12747. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12748. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12749. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12750. ERROR_GENERIC_ACTIONS_3: " oder ",
  12751. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12752. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12753. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12754. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12755. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12756. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12757. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12758. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12759. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12760. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12761. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12762. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12763. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12764. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12765. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12766. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12767. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12768. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12769. LINK_TO_LOCATION: "Link zu",
  12770. MENU_COPY: "Kopieren",
  12771. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12772. ROTATE: "Drehen",
  12773. INSIDE: "Drinnen",
  12774. MOVE: "Bewegen",
  12775. ZOOM: "Vergrößern"
  12776. }
  12777. }
  12778. , {}],
  12779. 111: [function(e, t, i) {
  12780. "use strict";
  12781. t.exports = {
  12782. PAGE_TITLE: "",
  12783. LOADING: "Loading",
  12784. PRESENTED_BY_CAPS: "PRESENTED BY",
  12785. POWERED_BY: "powered by ",
  12786. POWERED_BY_CAPS: "POWERED BY",
  12787. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12788. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12789. PRESENTED_BY: "Presented by ",
  12790. MORE: "More ",
  12791. LESS: "Less ",
  12792. TAG_CONTENT: "tag™ Content",
  12793. SHOW: "Show",
  12794. HIDE: "Hide",
  12795. DOLLHOUSE: "Dollhouse",
  12796. FLOOR_PLAN: "Floor plan",
  12797. OPEN_HIGHLIGHTS: "Open Highlights",
  12798. CLOSE_HIGHLIGHTS: "Close",
  12799. PREVIOUS: "Previous",
  12800. PLAY: "Play",
  12801. PAUSE: "Pause",
  12802. NEXT: "Next",
  12803. EXPLORE_3D_SPACE: "Explore 3D Space",
  12804. VIEW_DOLLHOUSE: "View dollhouse",
  12805. SOCIAL_SHARING: "Share this Space",
  12806. VIEW_IN_VR: "View in VR",
  12807. VIEW_FULLSCREEN: "全屏",
  12808. EXIT_FULLSCREEN: "退出全屏",
  12809. ZOOM_IN: "Zoom in",
  12810. ZOOM_OUT: "Zoom out",
  12811. FLOOR_NAME: "Floor ",
  12812. FLOOR_ALL: "全部",
  12813. TERMS: "Terms",
  12814. PORT_TERMS: "port terms",
  12815. TERMS_OF_USE: "Terms of Use",
  12816. TERMS_TEXT_FILE: "terms-en-US.html",
  12817. CLOSE_TERMS: "Close",
  12818. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  12819. HELP: "Help",
  12820. HELP_NAVIGATION_TAB: "Navigation",
  12821. HELP_MORE_HELP_TAB: "More Help",
  12822. CLOSE: "Close",
  12823. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  12824. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  12825. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  12826. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  12827. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  12828. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  12829. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  12830. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  12831. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  12832. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  12833. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  12834. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  12835. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  12836. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  12837. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  12838. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  12839. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  12840. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  12841. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  12842. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  12843. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  12844. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  12845. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  12846. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  12847. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  12848. HELP_MORE_HLR_A: "Highlight Reel",
  12849. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  12850. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  12851. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  12852. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  12853. HELP_MORE_FLOORS_A: "Floor Selector",
  12854. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  12855. HELP_MORE_TAG_A: "tag™ Posts",
  12856. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  12857. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  12858. HELP_MORE_ZOOM_A: "Zoom Controls",
  12859. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  12860. HELP_MORE_TOUR_A: "Tour Controls",
  12861. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  12862. HELP_MORE_INSIDE_A: "Inside View",
  12863. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  12864. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  12865. HELP_MORE_VR_A: "VR Mode",
  12866. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  12867. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  12868. HELP_MORE_360_A: "360° Views",
  12869. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  12870. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  12871. HELP_MORE_FULLSCREEN_A: "Full screen",
  12872. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  12873. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  12874. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  12875. WEBVR_FOR_DAYDREAM: "For Daydream View",
  12876. WEBVR_ENTER_WEBVR: "ENTER VR",
  12877. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  12878. WEBVR_LEARN_MORE: "Learn more",
  12879. WEBVR_VIEW_SPACE: "View Space in VR",
  12880. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12881. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  12882. VR_VIEW_SPACE: "View Space in Virtual Reality",
  12883. VR_LEARN_MORE_CAPS: "LEARN MORE",
  12884. VR_PREVIOUS_CAPS: "PREVIOUS",
  12885. VR_NEXT_CAPS: "NEXT",
  12886. VR_GOT_IT_CAPS: "GOT IT",
  12887. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  12888. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  12889. VR_SHOW_IOS_1: "Tap to view the space in VR",
  12890. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  12891. VR_WHAT_YOU_NEED: "What You'll Need For...",
  12892. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  12893. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  12894. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  12895. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  12896. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12897. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12898. VR_APP: "port VR App",
  12899. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12900. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12901. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  12902. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  12903. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  12904. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12905. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12906. VR_ANDROID_DVICES: "Android Devices",
  12907. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  12908. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  12909. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  12910. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  12911. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  12912. VR_APP_OPEN: "Open with the port VR app instead",
  12913. VR_DOWNLOAD_HERE: "Download here",
  12914. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  12915. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  12916. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  12917. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  12918. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  12919. SHARE_TO: "Share to",
  12920. SHARE_LINK: "Direct Link",
  12921. SHARE_EXPLORE: "Explore ",
  12922. SHARE_AT: "at",
  12923. SHARE_WITH: "with",
  12924. SHARE_3D: " in 3D",
  12925. SHARE_COPIED: "Copied!",
  12926. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  12927. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  12928. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  12929. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  12930. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  12931. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  12932. ERROR_GENERIC_ACTIONS_3: " or ",
  12933. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  12934. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  12935. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  12936. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  12937. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  12938. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  12939. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  12940. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  12941. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  12942. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  12943. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  12944. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  12945. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  12946. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  12947. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  12948. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  12949. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  12950. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  12951. LINK_TO_LOCATION: "Link to location",
  12952. MENU_COPY: "Copy",
  12953. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  12954. ROTATE: "Rotate",
  12955. INSIDE: "Inside",
  12956. MOVE: "Move",
  12957. ZOOM: "Zoom"
  12958. }
  12959. }
  12960. , {}],
  12961. 112: [function(e, t, i) {
  12962. "use strict";
  12963. t.exports = {
  12964. PAGE_TITLE: "",
  12965. LOADING: "Cargando",
  12966. PRESENTED_BY_CAPS: "PRESENTADO POR",
  12967. POWERED_BY: "potenciando por ",
  12968. POWERED_BY_CAPS: "POTENCIADO POR ",
  12969. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  12970. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  12971. PRESENTED_BY: "Presentado por ",
  12972. MORE: "Más ",
  12973. LESS: "Menos ",
  12974. TAG_CONTENT: "Contenido de tag™",
  12975. SHOW: "Mostrar",
  12976. HIDE: "Ocultar",
  12977. DOLLHOUSE: "Dollhouse",
  12978. FLOOR_PLAN: "Planos",
  12979. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  12980. CLOSE_HIGHLIGHTS: "Cerrar",
  12981. PREVIOUS: "Anterior",
  12982. PLAY: "Play",
  12983. PAUSE: "Pausa",
  12984. NEXT: "Siguiente",
  12985. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  12986. VIEW_DOLLHOUSE: "Ver dollhouse",
  12987. SOCIAL_SHARING: "Compartir este espacio",
  12988. VIEW_IN_VR: "Ver en realidad virtual",
  12989. VIEW_FULLSCREEN: "Ver en pantalla completa",
  12990. EXIT_FULLSCREEN: "Salir de pantalla completa",
  12991. ZOOM_IN: "Acercar",
  12992. ZOOM_OUT: "Alejar",
  12993. FLOOR_NAME: "Piso ",
  12994. FLOOR_ALL: "Todas",
  12995. TERMS: "Condiciones",
  12996. PORT_TERMS: "port términos de uso",
  12997. TERMS_OF_USE: "Términos de uso",
  12998. TERMS_TEXT_FILE: "terms-es-MX.html",
  12999. CLOSE_TERMS: "Cerrar",
  13000. 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.",
  13001. HELP: "Ayuda",
  13002. HELP_NAVIGATION_TAB: "Navegación",
  13003. HELP_MORE_HELP_TAB: "Más Ayuda",
  13004. CLOSE: "Cerrar",
  13005. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13006. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13007. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13008. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13009. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13010. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13011. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13012. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13013. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13014. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13015. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13016. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13017. 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.",
  13018. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13019. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13020. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13021. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13022. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13023. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13024. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13025. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13026. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13027. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13028. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13029. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13030. HELP_MORE_HLR_A: "Galería destacada",
  13031. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13032. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13033. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13034. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13035. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13036. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13037. HELP_MORE_TAG_A: "tag™ Posts",
  13038. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13039. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13040. HELP_MORE_ZOOM_A: "Controles de zoom",
  13041. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13042. HELP_MORE_TOUR_A: "Controles de recorrido",
  13043. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13044. HELP_MORE_INSIDE_A: "Vista interior",
  13045. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13046. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13047. HELP_MORE_VR_A: "Modo de realidad virtual",
  13048. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13049. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13050. HELP_MORE_360_A: "360° Views",
  13051. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13052. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13053. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13054. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13055. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13056. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13057. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13058. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13059. WEBVR_LEARN_MORE: "Más información",
  13060. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13061. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13062. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13063. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13064. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13065. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13066. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13067. VR_APP: "port VR App",
  13068. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13069. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13070. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13071. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13072. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13073. VR_PREVIOUS_CAPS: "ANTERIOR",
  13074. VR_NEXT_CAPS: "SIGUIENTE",
  13075. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13076. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13077. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13078. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13079. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13080. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13081. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13082. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13083. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13084. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13085. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13086. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13087. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13088. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13089. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13090. VR_ANDROID_DVICES: "Dispositivos Android",
  13091. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13092. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13093. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13094. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13095. VR_DOWNLOAD_HERE: "Descargar aquí",
  13096. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13097. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13098. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13099. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13100. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13101. SHARE_TO: "Compartir en",
  13102. SHARE_LINK: "Enlace directo",
  13103. SHARE_EXPLORE: "Explorar ",
  13104. SHARE_AT: "en",
  13105. SHARE_WITH: "con",
  13106. SHARE_3D: " en 3D",
  13107. SHARE_COPIED: "¡Copiado!",
  13108. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13109. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13110. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13111. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13112. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13113. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13114. ERROR_GENERIC_ACTIONS_3: " o ",
  13115. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13116. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13117. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13118. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13119. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13120. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13121. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13122. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13123. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13124. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13125. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13126. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13127. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13128. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13129. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13130. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13131. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13132. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13133. LINK_TO_LOCATION: "Enlace a la ubicación",
  13134. MENU_COPY: "Copiar",
  13135. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13136. ROTATE: "Girar",
  13137. INSIDE: "Interior",
  13138. MOVE: "Moverse",
  13139. ZOOM: "Acercar o alejar"
  13140. }
  13141. }
  13142. , {}],
  13143. 113: [function(e, t, i) {
  13144. "use strict";
  13145. t.exports = {
  13146. PAGE_TITLE: "",
  13147. LOADING: "Chargement",
  13148. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13149. POWERED_BY: "alimenté par ",
  13150. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13151. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13152. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13153. PRESENTED_BY: "Présenté par ",
  13154. MORE: "Plus ",
  13155. LESS: "Moins ",
  13156. TAG_CONTENT: "Contenu tag™",
  13157. SHOW: "Montrer",
  13158. HIDE: "Cacher",
  13159. DOLLHOUSE: "Dollhouse",
  13160. FLOOR_PLAN: "Plan de sol",
  13161. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13162. CLOSE_HIGHLIGHTS: "Fermer",
  13163. PREVIOUS: "Précédent",
  13164. PLAY: "Lecture",
  13165. PAUSE: "Pause",
  13166. NEXT: "Suivant",
  13167. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13168. VIEW_DOLLHOUSE: "Voir dollhouse",
  13169. SOCIAL_SHARING: "Partager cet espace",
  13170. VIEW_IN_VR: "Voir en VR",
  13171. VIEW_FULLSCREEN: "Plein écran",
  13172. EXIT_FULLSCREEN: "Fermer plein écran",
  13173. ZOOM_IN: "Zoom avant",
  13174. ZOOM_OUT: "Zoom arrière",
  13175. FLOOR_NAME: "Étage ",
  13176. FLOOR_ALL: "Tous",
  13177. TERMS: "Mentions légales",
  13178. PORT_TERMS: "port mentions légales",
  13179. TERMS_OF_USE: "Conditions d'utilisation",
  13180. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13181. CLOSE_TERMS: "Fermer",
  13182. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13183. HELP: "Aide",
  13184. HELP_NAVIGATION_TAB: "Navigation",
  13185. HELP_MORE_HELP_TAB: "Aide",
  13186. CLOSE: "Fermer",
  13187. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13188. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13189. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13190. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13191. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13192. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13193. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13194. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13195. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13196. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13197. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13198. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13199. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13200. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13201. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13202. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13203. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13204. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13205. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13206. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13207. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13208. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13209. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13210. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13211. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13212. HELP_MORE_HLR_A: "Carrousel",
  13213. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13214. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13215. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13216. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13217. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13218. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13219. HELP_MORE_TAG_A: "tag™ Posts",
  13220. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13221. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13222. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13223. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13224. HELP_MORE_TOUR_A: "Commandes de la visite",
  13225. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13226. HELP_MORE_INSIDE_A: "Vue intérieure",
  13227. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13228. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13229. HELP_MORE_VR_A: "Mode RV",
  13230. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13231. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13232. HELP_MORE_360_A: "Vues 360°",
  13233. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13234. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13235. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13236. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13237. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13238. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13239. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13240. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13241. WEBVR_LEARN_MORE: "En savoir plus",
  13242. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13243. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13244. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13245. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13246. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13247. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13248. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13249. VR_NEXT_CAPS: "SUIVANT",
  13250. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13251. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13252. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13253. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13254. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13255. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13256. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13257. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13258. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13259. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13260. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13261. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13262. VR_APP: "port VR App",
  13263. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13264. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13265. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13266. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13267. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13268. 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",
  13269. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13270. VR_ANDROID_DVICES: "Appareils Android",
  13271. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13272. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13273. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13274. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13275. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13276. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13277. VR_DOWNLOAD_HERE: "Télécharger ici",
  13278. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13279. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13280. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13281. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13282. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13283. SHARE_TO: "Partager sur",
  13284. SHARE_LINK: "Lien direct",
  13285. SHARE_EXPLORE: "Explorer ",
  13286. SHARE_AT: "à",
  13287. SHARE_WITH: "avec",
  13288. SHARE_3D: " en 3D",
  13289. SHARE_COPIED: "Copié!",
  13290. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13291. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13292. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13293. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13294. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13295. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13296. ERROR_GENERIC_ACTIONS_3: " ou ",
  13297. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13298. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13299. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13300. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13301. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13302. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13303. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13304. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13305. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13306. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13307. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13308. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13309. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13310. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13311. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13312. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13313. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13314. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13315. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13316. MENU_COPY: "Copie",
  13317. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13318. ROTATE: "Faire pivoter",
  13319. INSIDE: "Intérieure",
  13320. MOVE: "Se déplacer",
  13321. ZOOM: "Zoom"
  13322. }
  13323. }
  13324. , {}],
  13325. 114: [function(e, t, i) {
  13326. "use strict";
  13327. t.exports = {
  13328. PAGE_TITLE: "",
  13329. LOADING: "読み込み中",
  13330. PRESENTED_BY_CAPS: "PRESENTED BY",
  13331. POWERED_BY: "powered by",
  13332. POWERED_BY_CAPS: "POWERED BY",
  13333. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13334. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13335. PRESENTED_BY: "Presented by ",
  13336. MORE: "全て表示 ",
  13337. LESS: "閉じる ",
  13338. TAG_CONTENT: "tag™コンテンツ ",
  13339. SHOW: "表示",
  13340. HIDE: "非表示",
  13341. DOLLHOUSE: "ドールハウス",
  13342. FLOOR_PLAN: "フロアプラン",
  13343. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13344. CLOSE_HIGHLIGHTS: "閉じる",
  13345. PREVIOUS: "前へ",
  13346. PLAY: "再生",
  13347. PAUSE: "一時停止",
  13348. NEXT: "次へ",
  13349. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13350. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13351. SOCIAL_SHARING: "このSpaceを共有する",
  13352. VIEW_IN_VR: "VRで表示",
  13353. VIEW_FULLSCREEN: "フルスクリーン表示",
  13354. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13355. ZOOM_IN: "ズームイン",
  13356. ZOOM_OUT: "ズームアウト",
  13357. FLOOR_NAME: "フロア ",
  13358. FLOOR_ALL: "すべて",
  13359. TERMS: "規約",
  13360. PORT_TERMS: "port規約",
  13361. TERMS_OF_USE: "利用規約",
  13362. CLOSE_TERMS: "閉じる",
  13363. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13364. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13365. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13366. WEBVR_ENTER_WEBVR: "VRに入る",
  13367. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13368. WEBVR_LEARN_MORE: "もっと詳しく",
  13369. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13370. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13371. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13372. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13373. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13374. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13375. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13376. VR_PREVIOUS_CAPS: "前へ",
  13377. VR_NEXT_CAPS: "次へ",
  13378. VR_GOT_IT_CAPS: "了解",
  13379. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13380. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13381. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13382. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13383. VR_WHAT_YOU_NEED: "必要なもの",
  13384. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13385. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13386. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13387. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13388. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13389. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13390. VR_APP: "port VRアプリ",
  13391. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13392. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13393. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13394. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13395. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13396. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13397. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13398. VR_ANDROID_DVICES: "Androidデバイス",
  13399. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13400. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13401. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13402. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13403. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13404. VR_APP_OPEN: "port VRアプリで開く",
  13405. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13406. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13407. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13408. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13409. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13410. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13411. SHARE_TO: "共有先",
  13412. SHARE_LINK: "ダイレクトリンク",
  13413. SHARE_EXPLORE: "探索",
  13414. SHARE_AT: "場所",
  13415. SHARE_WITH: "使用アプリ",
  13416. SHARE_3D: "3Dで",
  13417. SHARE_COPIED: "コピーされました!",
  13418. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13419. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13420. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13421. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13422. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13423. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13424. ERROR_GENERIC_ACTIONS_3: "または",
  13425. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13426. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13427. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13428. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13429. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13430. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13431. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13432. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13433. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13434. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13435. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13436. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13437. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13438. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13439. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13440. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13441. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13442. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13443. LINK_TO_LOCATION: "ロケーションへのリンク",
  13444. MENU_COPY: "コピー",
  13445. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13446. ROTATE: "回転",
  13447. MOVE: "移動",
  13448. INSIDE: "内側",
  13449. ZOOM: "ズーム",
  13450. HELP: "ヘルプ",
  13451. HELP_NAVIGATION_TAB: "ナビゲーション",
  13452. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13453. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13454. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13455. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13456. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13457. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13458. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13459. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13460. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13461. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13462. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13463. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13464. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13465. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13466. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13467. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13468. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13469. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13470. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13471. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13472. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13473. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13474. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13475. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13476. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13477. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13478. HELP_MORE_HLR_A: "ハイライト",
  13479. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13480. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13481. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13482. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13483. HELP_MORE_FLOORS_A: "フロアセレクター",
  13484. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13485. HELP_MORE_TAG_A: "tag™ Posts",
  13486. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13487. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13488. HELP_MORE_ZOOM_A: "ズームコントロール",
  13489. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13490. HELP_MORE_TOUR_A: "ツアーコントロール",
  13491. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13492. HELP_MORE_INSIDE_A: "内側ビュー",
  13493. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13494. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13495. HELP_MORE_VR_A: "VRモード",
  13496. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13497. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13498. HELP_MORE_360_A: "360° Views",
  13499. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13500. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13501. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13502. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13503. CLOSE: "閉じる"
  13504. }
  13505. }
  13506. , {}],
  13507. 115: [function(e, t, i) {
  13508. "use strict";
  13509. t.exports = {
  13510. PAGE_TITLE: "",
  13511. LOADING: "Загрузка",
  13512. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13513. POWERED_BY: "разработано на платформе ",
  13514. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13515. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13516. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13517. PRESENTED_BY: "Представлено ",
  13518. MORE: "Больше ",
  13519. LESS: "Меньше ",
  13520. TAG_CONTENT: "tag™ Контент",
  13521. SHOW: "Показать",
  13522. HIDE: "Скрыть",
  13523. DOLLHOUSE: "Dollhouse",
  13524. FLOOR_PLAN: "Планировка",
  13525. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13526. CLOSE_HIGHLIGHTS: "Закрыть",
  13527. PREVIOUS: "Предыдущий",
  13528. PLAY: "Воспроизвести",
  13529. PAUSE: "Пауза",
  13530. NEXT: "Следующий",
  13531. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13532. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13533. SOCIAL_SHARING: "Поделиться этой моделью",
  13534. VIEW_IN_VR: "Посмотреть в VR",
  13535. VIEW_FULLSCREEN: "Полный экран",
  13536. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13537. ZOOM_IN: "Увеличить",
  13538. ZOOM_OUT: "Уменьшить",
  13539. FLOOR_NAME: "Этаж ",
  13540. FLOOR_ALL: "Все",
  13541. TERMS: "Условия",
  13542. PORT_TERMS: "Правила пользования",
  13543. TERMS_OF_USE: "Условия использования",
  13544. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13545. CLOSE_TERMS: "Закрыть",
  13546. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13547. HELP: "Помощь",
  13548. HELP_NAVIGATION_TAB: "Навигация",
  13549. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13550. CLOSE: "Закрыть",
  13551. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13552. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13553. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13554. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13555. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13556. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13557. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13558. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13559. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13560. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13561. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13562. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13563. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13564. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13565. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13566. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13567. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13568. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13569. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13570. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13571. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13572. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13573. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13574. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13575. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13576. HELP_MORE_HLR_A: "Фотоколлаж",
  13577. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13578. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13579. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13580. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13581. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13582. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13583. HELP_MORE_TAG_A: "tag™ Posts",
  13584. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13585. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13586. HELP_MORE_ZOOM_A: "Масштаб",
  13587. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13588. HELP_MORE_TOUR_A: "Управление Туром",
  13589. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13590. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13591. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13592. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13593. HELP_MORE_VR_A: "Режим VR",
  13594. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13595. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13596. HELP_MORE_360_A: "360° Views",
  13597. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13598. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13599. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13600. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13601. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13602. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13603. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13604. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13605. WEBVR_LEARN_MORE: "Узнать больше",
  13606. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13607. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13608. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13609. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13610. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13611. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13612. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13613. VR_APP: "port VR App",
  13614. VR_APP_OPEN: "Или открыть через приложение port VR",
  13615. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13616. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13617. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13618. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13619. VR_VIEW_SPACE: "Запустить модель в VR",
  13620. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13621. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13622. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13623. VR_GOT_IT_CAPS: "ЯСНО",
  13624. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13625. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13626. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13627. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13628. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13629. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13630. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13631. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13632. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13633. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13634. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13635. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13636. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13637. VR_ANDROID_DVICES: "Android устройства",
  13638. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13639. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13640. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13641. VR_DOWNLOAD_HERE: "Скачать здесь",
  13642. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13643. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13644. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13645. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13646. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13647. SHARE_TO: "Поделиться",
  13648. SHARE_LINK: "Прямая ссылка",
  13649. SHARE_EXPLORE: "просмотреть",
  13650. SHARE_AT: "на",
  13651. SHARE_WITH: "с",
  13652. SHARE_3D: "в 3D",
  13653. SHARE_COPIED: "Скопировано!",
  13654. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13655. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13656. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13657. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13658. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13659. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13660. ERROR_GENERIC_ACTIONS_3: " или ",
  13661. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13662. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13663. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13664. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13665. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13666. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13667. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13668. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13669. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13670. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13671. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13672. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13673. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13674. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13675. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13676. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13677. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13678. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13679. LINK_TO_LOCATION: "Ссылка на местоположение",
  13680. MENU_COPY: "Копировать",
  13681. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13682. ROTATE: "Вращать",
  13683. MOVE: "Передвигаться",
  13684. INSIDE: "Вид изнутри",
  13685. ZOOM: "Масштаб"
  13686. }
  13687. }
  13688. , {}],
  13689. 116: [function(r, e, t) {
  13690. (function(i) {
  13691. "use strict";
  13692. function re(e) {
  13693. console.log("e1:" + e),
  13694. e = Math.round(.4 * e * 100),
  13695. console.log("e2:" + e);
  13696. var t = $(".progressbar");
  13697. t.find(".bar").css("width", e + "%"),
  13698. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13699. t.find(".perc").text(e + "%")
  13700. }
  13701. $("#gui-loading").fadeIn(200),
  13702. re(.1);
  13703. var e = g_version ? "modeldata.js" : "someData.json";
  13704. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13705. dataType: "json"
  13706. }).done(function(e) {
  13707. var t = matcher(e);
  13708. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13709. t.user = {
  13710. is_authenticated: !1,
  13711. flags: ["payment_show_past_due", "sc_imgopt_100", "mattertags", "labels", "fastly_v2_urls", "vr", "uhql", "sc_segment_100", "show_segment_metrics", "content_distribution", "workshop_webgl", "show360views", "showcase_vr", "ws_zooming", "model_settings", "ws_360snapshots", "img_multi_dl", "vrworkshop", "tag_links", "ws_img_multi_dl", "mattertag_links", "billing_tab_hidden", "static_cloud_ui", "metrics", "mattertag_media", "img_size_download", "show_360snapshots", "floorplan", "sc_tilegen_0", "showcase_webvr", "sc_mixpanel_0", "show_clickbait", "zooming", "showcase_tiling", "list_signed_urls_default_3", "fastly_image_opto"]
  13712. }
  13713. try{//处理一下导览数据,旧的曾有导览数据是错误的,将它删除
  13714. var newImages = [];
  13715. data.model.images.forEach((tourImg)=>{tourImg.thumbnail_signed_src && newImages.push(tourImg)})
  13716. data.model.images = newImages
  13717. }catch(e){console.log(e) }
  13718. window.MP_PREFETCHED_MODELDATA = t
  13719. t.model.summary = t.summary
  13720. t.model.name = t.name
  13721. for(let i in t){
  13722. t[i] == "false" && (t[i] = false)
  13723. }
  13724. re(.7),
  13725. function() {
  13726. function y(e) {
  13727. t.update(e)
  13728. }
  13729. function A(e, t) {
  13730. ne.error(t),
  13731. n.error(t),
  13732. N.report(e, "error-" + t)
  13733. }
  13734. function C(e, t, i) {
  13735. try {
  13736. e.start(t)
  13737. } catch (e) {
  13738. throw ne.warn(e.message),
  13739. function(e) {
  13740. var t = O.details();
  13741. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13742. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13743. N.report(e, "error-webgl-generic"))
  13744. }(i.sid),
  13745. e
  13746. }
  13747. }
  13748. function I(e) {
  13749. e.stopPropagation(),
  13750. e.preventDefault()
  13751. }
  13752. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  13753. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13754. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13755. });
  13756. window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic,
  13757. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  13758. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  13759. r("./lib/three75-shim"),
  13760. r("./lib/array-polyfill"),
  13761. r("./lib/performance-polyfill"),
  13762. r("./lib/shaders/CopyShader.js"),
  13763. r("./lib/shaders/HorizontalBlurShader.js"),
  13764. r("./lib/shaders/VerticalBlurShader.js"),
  13765. r("./lib/postprocessing/EffectComposer.js"),
  13766. r("./lib/postprocessing/RenderPass.js"),
  13767. r("./lib/postprocessing/MaskPass.js"),
  13768. r("./lib/postprocessing/ShaderPass.js"),
  13769. window.Promise || (window.Promise = r("promise-polyfill"));
  13770. var E = r("three")
  13771. , _ = r("three")
  13772. , b = (r("./util/sentry"),
  13773. r("./player"))
  13774. , w = r("./director")
  13775. , T = r("./controls/CameraControls")
  13776. , x = r("./model/ModelManager")
  13777. , S = r("./DisplayController")
  13778. , M = r("./label/LabelDisplayController")
  13779. , R = r("./enum/Viewmode")
  13780. , e = r("./util/logger")
  13781. , P = r("./showcase")
  13782. , O = r("./util/browser")
  13783. , L = r("./settings")
  13784. , D = r("./gui/gui")
  13785. , n = r("./gui/error")
  13786. , N = r("./analytics")
  13787. , F = r("./util/transitions")
  13788. , B = r("./effects")
  13789. , V = r("./objects/Skybox")
  13790. , k = (r("./util/common"),
  13791. r("./util/PanoramaCollection"),
  13792. r("./util/math"),
  13793. r("./util/showcase"))
  13794. , U = r("./util/camera")
  13795. , H = (r("./objects/Panorama"),
  13796. r("./cameras/PanoramaCamera"),
  13797. r("./preloaders"))
  13798. , z = r("events").EventEmitter
  13799. , G = r("./featureflags")
  13800. , W = (r("./util/lerp"),
  13801. r("./util/ajax"),
  13802. r("./ab"))
  13803. , j = r("./sdk/automation.js")
  13804. , Y = r("./scene/SceneRenderer")
  13805. , q = r("./scene/QuickstartManager")
  13806. , X = r("./tile/QualityManager.js")
  13807. , Z = r("./localization/localize")
  13808. , K = r("./tag/tagManager")
  13809. , Q = r("./tile/TileDownloader")
  13810. , J = r("./tile/PanoRenderer")
  13811. , ee = (r("./enum/PanoSizeClass"),
  13812. r("./enum/PanoramaEvents"),
  13813. r("./enum/SceneRendererEvents"))
  13814. , t = r("./gui/memoryUsage")
  13815. , te = r("./enum/RenderLayers")
  13816. , ie = r("./TimingData")
  13817. , ne = new e(i);
  13818. e.level = L.logLevel,
  13819. e.consoleEnabled = L.console,
  13820. function() {
  13821. var e = k.getModelIDFromQueryString();
  13822. if (!e)
  13823. return A(null, "loading-failed");
  13824. var t = k.parseSidUrl(e)
  13825. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  13826. , n = {
  13827. panoElementsToLoad: 6,
  13828. modelElementsToLoad: 0,
  13829. totalElementsLoaded: 0,
  13830. totalElementsToLoad: 0,
  13831. totalPercentageLoaded: 0,
  13832. progressCallback: null
  13833. }
  13834. , r = document.getElementById("player")
  13835. , o = L.quickstart.enabled
  13836. , a = null
  13837. , s = null
  13838. , l = null
  13839. , c = null
  13840. , h = null
  13841. , u = null
  13842. , d = null
  13843. , p = null
  13844. , f = null
  13845. , g = null
  13846. , m = null
  13847. , v = new ie;
  13848. !function(e) {
  13849. ne.info("Version", "2.25.6-0-gd87e5b1"),
  13850. z.defaultMaxListeners = 1e3,
  13851. function(e) {
  13852. e.addEventListener("dragenter", I, !1),
  13853. e.addEventListener("dragover", I, !1)
  13854. }(e),
  13855. O.valueFromHash("title", !0) || $(document).ready(function() {
  13856. $(".model-title").hide()
  13857. })
  13858. }(r),
  13859. function(e) {
  13860. return G.loadFeatureFlags(e).done(function(e) {
  13861. G.updateDependentSettings(e, L)
  13862. })
  13863. }({
  13864. urlBase: t.urlBase
  13865. }).then(function() {
  13866. return Z.init(),
  13867. function(e, t) {
  13868. var i = P.getModel({
  13869. url: t,
  13870. floors: O.valueFromHash("f", !0),
  13871. autoload: !1
  13872. });
  13873. return $.when(i, y).then(null, function(e) {
  13874. return this
  13875. })
  13876. }(0, e)
  13877. }).then(function(e) {
  13878. return re(.9),
  13879. function(e, t, i, n, r) {
  13880. ne.info("Model data loaded"),
  13881. ne.debug("UUID: " + e.data.job.uuid),
  13882. W.init(G.getFlags()),
  13883. i && N.initKeen({
  13884. token: i,
  13885. appId: n
  13886. }),
  13887. N.initSegment({
  13888. model: e.sid,
  13889. version: "2.25.6-0-gd87e5b1",
  13890. startSource: r.startSource,
  13891. token: t,
  13892. autoplay: r.autoplay,
  13893. quickstart: r.quickstart
  13894. })
  13895. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  13896. startSource: i,
  13897. autoplay: L.autoplay,
  13898. quickstart: o
  13899. }),
  13900. g.urls.init()
  13901. }).then(function() {
  13902. return g.loadPanos()
  13903. }).then(function() {
  13904. s = U.getStartCameraOptions(g, g.panos);
  13905. //初始画面
  13906. window.MP_PREFETCHED_MODELDATA.camera_start && window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg && function(e) {
  13907. $("<img/>").attr("src", e).on("load", function() {
  13908. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  13909. $(this).remove()
  13910. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  13911. })
  13912. }(window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg);
  13913. d = function(e) {
  13914. var t = new E.PerspectiveCamera;
  13915. t.layers.enable(te.PANOMARKERS),
  13916. t.layers.enable(te.RETICULE),
  13917. t.layers.enable(te.TAG);
  13918. var o = new E.Scene
  13919. , i = new E.AmbientLight(16777215);
  13920. return o.add(i),
  13921. o.skybox = new V,
  13922. o.add(o.skybox),
  13923. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  13924. side: E.DoubleSide
  13925. })),
  13926. o.plane.position.y = 0,
  13927. o.plane.rotateX(-Math.PI / 2),
  13928. o.plane.material.visible = !1,
  13929. o.add(o.plane),
  13930. o.updateMatrixWorld(),
  13931. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  13932. if (e.metadata && e.metadata.camera_position) {
  13933. var t = e.metadata.camera_position
  13934. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  13935. i.position = t.clone(),
  13936. o.add(i);
  13937. var n = e.metadata.camera_quaternion
  13938. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  13939. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  13940. }
  13941. }),
  13942. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  13943. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  13944. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  13945. new Y(o,t,B)
  13946. }(g),
  13947. m = function(e, t) {
  13948. var i = e ? 1 : 1e3
  13949. , n = W.tilegen || W.imgopt ? 6 : 2;
  13950. n = O.valueFromHash("tileconc", n);
  13951. var r = new X
  13952. , o = new Q({
  13953. concurrentDownloads: n
  13954. })
  13955. , a = new J
  13956. , s = new x
  13957. , l = new w
  13958. , c = new b(t)
  13959. , h = new T
  13960. , u = new S(i)
  13961. , d = new M
  13962. , p = new K;
  13963. return {
  13964. qualityManager: r,
  13965. panoRenderer: a,
  13966. tileDownloader: o,
  13967. player: c,
  13968. director: l,
  13969. modelManager: s,
  13970. tagManager: p,
  13971. displayController: u,
  13972. labelDisplayController: d,
  13973. controls: h
  13974. }
  13975. }(o, s.mode),
  13976. l = m.controls,
  13977. c = m.player,
  13978. h = m.director,
  13979. u = m.tagManager,
  13980. p = m.tileDownloader,
  13981. f = m.qualityManager,
  13982. m.panoRenderer,
  13983. function(e, t, i, n) {
  13984. var r = i.controls
  13985. , o = i.qualityManager
  13986. , a = i.panoRenderer
  13987. , s = i.tileDownloader
  13988. , l = i.modelManager;
  13989. r.init(n, l),
  13990. j.init(i.director, r, i.player, l, t),
  13991. o.init(l),
  13992. s.init(o),
  13993. a.init(t, s, o),
  13994. l.init(s, a, o),
  13995. l.addModel(e),
  13996. t.addComponent(F)
  13997. }(g, d, m, r),
  13998. c.director = h,
  13999. g.supportsTiles && p.start(),
  14000. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14001. o = !1);
  14002. var e = null;
  14003. if (o) {
  14004. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14005. var t = l.controls[R.PANORAMA];
  14006. a = new q(f,d.scene,d.camera,t,r),
  14007. C(d, r, g),
  14008. e = a.load(s).then(function() {
  14009. d.addComponent(a),
  14010. d.once(ee.AfterRender, function() {
  14011. ne.warn("First render after quickstart load finished.")
  14012. })
  14013. })
  14014. }
  14015. return window.flyToFirst = function() {
  14016. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14017. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14018. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14019. c.flyToPano({
  14020. pano: e,
  14021. lookAtPoint: i
  14022. })
  14023. }
  14024. ,
  14025. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14026. }).then(function() {
  14027. return function(e, t, i, n, r) {
  14028. return r.progressCallback = t,
  14029. N.sessionStart(),
  14030. e.load(n).progress(function(e, t) {
  14031. e.modelElementsToLoad = t[1],
  14032. function(e) {
  14033. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14034. }(e),
  14035. function(e) {
  14036. e.totalElementsLoaded++,
  14037. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14038. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14039. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14040. console.log("pro:" + e.totalPercentageLoaded),
  14041. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14042. }(e)
  14043. }
  14044. .bind(this, r))
  14045. }(g, D.onProgress, 0, !o, n)
  14046. }).then(function() {
  14047. s.quickstart = o,
  14048. function(e, t, i, n) {
  14049. var r = i.qualityManager
  14050. , o = i.panoRenderer
  14051. , a = i.tileDownloader
  14052. , s = i.modelManager
  14053. , l = i.player
  14054. , c = i.director
  14055. , h = i.tagManager
  14056. , u = i.displayController
  14057. , d = i.labelDisplayController
  14058. , p = i.controls;
  14059. t.scene.add(e),
  14060. t.qualityManager = r;
  14061. var f = {
  14062. camera: t.camera,
  14063. director: c,
  14064. modelManager: s,
  14065. tileDownloader: a,
  14066. panoRenderer: o,
  14067. qualityManager: r,
  14068. tagManager: h,
  14069. container: n,
  14070. controls: p
  14071. };
  14072. l.init(f),
  14073. l.setScene(t.scene),
  14074. h.init(s, l),
  14075. c.init(l, s),
  14076. u.init(c, l, s, h, n),
  14077. d.init(l, s, n),
  14078. B.bindEvents(l),
  14079. t.addComponent(h),
  14080. t.addComponent(l),
  14081. t.addComponent(o),
  14082. l.sceneRenderer = t
  14083. }(g, d, m, r),
  14084. d.started || C(d, r, g),
  14085. N.modelLoaded(g, c, l, L.autoplay),
  14086. function(e, t, i, n) {
  14087. return ne.info("Starting player in " + i.mode),
  14088. N.report(t.sid, "started-playing", n, i.quickstart),
  14089. e.start(i)
  14090. }(c, g, s, L.autoplay).done(function() {
  14091. h.autoTour()
  14092. }),
  14093. g.supportsTiles || new H(g,c).start();
  14094. o && (d.removeComponent(a),
  14095. a.destroy(),
  14096. s.pano.enter()),
  14097. D.init(g, h, c, l, d, s, N.getSessionId()),
  14098. D.endLoading(g, h, u),
  14099. d.once(ee.AfterRender, function() {
  14100. v.setAppReadyTime();
  14101. var e = v.calcFullLoadingTime();
  14102. ne.warn("Total load time: " + e / 1e3),
  14103. N.loadComplete(e),
  14104. ne.warn("First render after model load finished.")
  14105. }),
  14106. d.on(ee.MemoryUsageUpdated, y)
  14107. }).fail(A.bind(this, e))
  14108. }()
  14109. }()
  14110. })
  14111. }
  14112. ).call(this, "/js/main.js")
  14113. }
  14114. , {
  14115. "./DisplayController": 1,
  14116. "./TimingData": 2,
  14117. "./ab": 3,
  14118. "./analytics": 4,
  14119. "./cameras/PanoramaCamera": 7,
  14120. "./controls/CameraControls": 9,
  14121. "./director": 15,
  14122. "./effects": 16,
  14123. "./enum/PanoSizeClass": 36,
  14124. "./enum/PanoramaEvents": 37,
  14125. "./enum/RenderLayers": 41,
  14126. "./enum/SceneRendererEvents": 43,
  14127. "./enum/Viewmode": 51,
  14128. "./featureflags": 59,
  14129. "./gui/error": 64,
  14130. "./gui/gui": 65,
  14131. "./gui/memoryUsage": 73,
  14132. "./label/LabelDisplayController": 91,
  14133. "./lib/array-polyfill": 92,
  14134. "./lib/performance-polyfill": 95,
  14135. "./lib/postprocessing/EffectComposer.js": 96,
  14136. "./lib/postprocessing/MaskPass.js": 97,
  14137. "./lib/postprocessing/RenderPass.js": 98,
  14138. "./lib/postprocessing/ShaderPass.js": 99,
  14139. "./lib/shaders/CopyShader.js": 100,
  14140. "./lib/shaders/HorizontalBlurShader.js": 101,
  14141. "./lib/shaders/VerticalBlurShader.js": 102,
  14142. "./lib/three75-shim": 103,
  14143. "./localization/localize": 108,
  14144. "./tag/tagManager": 124,
  14145. "./model/ModelManager": 140,
  14146. "./objects/Panorama": 148,
  14147. "./objects/Skybox": 152,
  14148. "./player": 155,
  14149. "./preloaders": 156,
  14150. "./scene/QuickstartManager": 157,
  14151. "./scene/SceneRenderer": 158,
  14152. "./sdk/automation.js": 164,
  14153. "./settings": 166,
  14154. "./showcase": 168,
  14155. "./tile/PanoRenderer": 169,
  14156. "./tile/QualityManager.js": 170,
  14157. "./tile/TileDownloader": 171,
  14158. "./util/PanoramaCollection": 178,
  14159. "./util/ajax": 181,
  14160. "./util/browser": 182,
  14161. "./util/camera": 183,
  14162. "./util/common": 185,
  14163. "./util/lerp": 188,
  14164. "./util/logger": 189,
  14165. "./util/math": 190,
  14166. "./util/sentry": 192,
  14167. "./util/showcase": 193,
  14168. "./util/transitions": 195,
  14169. events: 202,
  14170. "promise-polyfill": 213,
  14171. three: 217
  14172. }],
  14173. 117: [function(e, t, i) {
  14174. "use strict";
  14175. function n(e) {
  14176. e = e || {},
  14177. r.RawShaderMaterial.call(this, a.extendObject({
  14178. fragmentShader: o.cube.fragmentShader,
  14179. vertexShader: o.cube.vertexShader,
  14180. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14181. name: "CubemapMaterial"
  14182. }, e))
  14183. }
  14184. var r = e("three")
  14185. , o = e("../shaders")
  14186. , a = e("../util/common");
  14187. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14188. t.exports = n
  14189. }
  14190. , {
  14191. "../shaders": 167,
  14192. "../util/common": 185,
  14193. three: 217
  14194. }],
  14195. 118: [function(e, t, i) {
  14196. "use strict";
  14197. function n(e) {
  14198. e = e || {},
  14199. r.RawShaderMaterial.call(this, a.extendObject({
  14200. fragmentShader: o.model.fragmentShader,
  14201. vertexShader: o.model.vertexShader,
  14202. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14203. name: "ModelTextureMaterial"
  14204. }, e))
  14205. }
  14206. var r = e("three")
  14207. , o = e("../shaders")
  14208. , a = e("../util/common");
  14209. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14210. i && (this.uniforms.progress.value = 0),
  14211. e.ensureSkyboxReadyForRender(),
  14212. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14213. this.uniforms.pano0Position.value.copy(e.position),
  14214. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14215. t.ensureSkyboxReadyForRender(),
  14216. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14217. this.uniforms.pano1Position.value.copy(t.position),
  14218. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14219. }
  14220. ,
  14221. t.exports = n
  14222. }
  14223. , {
  14224. "../shaders": 167,
  14225. "../util/common": 185,
  14226. three: 217
  14227. }],
  14228. 119: [function(m, v, e) {
  14229. (function(e) {
  14230. "use strict";
  14231. function t(e, t, i, n) {
  14232. this.div = null,
  14233. this.body = null,
  14234. this.label = e,
  14235. this.description = t,
  14236. this.parsedDescription = [],
  14237. this.media = i || {
  14238. type: null
  14239. },
  14240. this.loadingSpinner = null,
  14241. this.parser = new r({
  14242. supportLinks: !c.valueFromHash("mls"),
  14243. keepLinkLabels: !0
  14244. }),
  14245. this.state = g.CLOSED,
  14246. this.orientation = "",
  14247. this.initialTransform = "",
  14248. this.hovering = !1,
  14249. this.openTransition = null,
  14250. this.closeTransition = null,
  14251. this.openPromise = null,
  14252. this.closePromise = null,
  14253. this.animationTransition = null,
  14254. this.animationScale = 0
  14255. }
  14256. var r = m("../Parser/DescriptionParser")
  14257. , i = m("../Media/Link")
  14258. , n = m("../Media/Image")
  14259. , o = m("../Media/EmbedlyPlayer")
  14260. , a = m("../Media/EmbedlyEmbed")
  14261. , s = m("../../util/transitions")
  14262. , l = m("../../util/lerp")
  14263. , c = m("../../util/browser")
  14264. , b = m("./BillboardEvent")
  14265. , w = m("../Media/MediaEvent")
  14266. , h = m("../Parser/DescriptionChunkType")
  14267. , u = m("events").EventEmitter
  14268. , d = m("./billboardSettings")
  14269. , T = m("./overlaySettings")
  14270. , p = new (m("../../util/logger"))(e)
  14271. , f = document.getElementById("tag-billboards");
  14272. f.addEventListener("touchend", function(e) {
  14273. f.style.pointerEvents = "none"
  14274. }),
  14275. f.addEventListener("touchcancel", function(e) {
  14276. f.style.pointerEvents = "none"
  14277. });
  14278. var g = {
  14279. CLOSED: "closed",
  14280. OPENING: "opening",
  14281. OPEN: "open",
  14282. CLOSING: "closing",
  14283. ACTIVE: "active"
  14284. };
  14285. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14286. this.parsedDescription = this.parser.parse(this.description);
  14287. var t = document.createElement("div");
  14288. t.className = "tag-container has-hotzone",
  14289. this.div = t,
  14290. this.body = document.createElement("div"),
  14291. this.body.className = "tag-body";
  14292. var i = document.createElement("div");
  14293. i.classList.add("tag-content");
  14294. var n = document.createElement("div");
  14295. n.classList.add("tag-text-content");
  14296. var r = document.createElement("div");
  14297. r.className = "tag-label",
  14298. r.textContent = this.label,
  14299. n.appendChild(r);
  14300. var o = document.createElement("div");
  14301. o.className = "tag-desc",
  14302. n.appendChild(o),
  14303. i.appendChild(n),
  14304. this.body.appendChild(i),
  14305. this.appendDescriptionElements(this.parsedDescription, o),
  14306. this.appendMedia(),
  14307. t.appendChild(this.body),
  14308. f.appendChild(t),
  14309. this.bindEvents(t, this.body)
  14310. }
  14311. ,
  14312. t.prototype.bindEvents = function(i, e) {
  14313. function t(n) {
  14314. return function(e) {
  14315. if (!this.div.classList.contains("overlay")) {
  14316. var t, i = document.getElementById("player");
  14317. try {
  14318. t = new MouseEvent(n,e)
  14319. } catch (i) {
  14320. (t = document.createEvent("MouseEvents")).initMouseEvent(n, e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  14321. }
  14322. i.dispatchEvent(t)
  14323. }
  14324. }
  14325. }
  14326. e.addEventListener("mousedown", function(e) {
  14327. e.stopPropagation()
  14328. }),
  14329. e.addEventListener("mouseup", function(e) {
  14330. e.stopPropagation()
  14331. }),
  14332. i.addEventListener("touchstart", function(e) {
  14333. f.style.pointerEvents = "auto"
  14334. }),
  14335. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14336. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14337. e.addEventListener("mouseover", function(e) {
  14338. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14339. }
  14340. .bind(this)),
  14341. i.addEventListener("mouseenter", function(e) {
  14342. this.state !== g.CLOSING && (this.hovering = !0,
  14343. this.emit(b.ENTER))
  14344. }
  14345. .bind(this)),
  14346. i.addEventListener("mouseleave", function(e) {
  14347. this.hovering = !1,
  14348. this.emit(b.LEAVE)
  14349. }
  14350. .bind(this)),
  14351. i.addEventListener("gesturestart", function(e) {
  14352. e.preventDefault()
  14353. });
  14354. var n = i.querySelector(".tag-text-content")
  14355. , r = 0;
  14356. n.addEventListener("touchstart", function(e) {
  14357. r = e.changedTouches[0].clientY
  14358. }),
  14359. n.addEventListener("touchmove", function(t) {
  14360. function e(e) {
  14361. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14362. }
  14363. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14364. }),
  14365. i.addEventListener("touchmove", function(e) {
  14366. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14367. })
  14368. }
  14369. ,
  14370. t.prototype.appendDescriptionElements = function(e, i) {
  14371. 0 < e.length && this.div.classList.add("has-text"),
  14372. e.forEach(function(e, t) {
  14373. switch (e.type) {
  14374. case h.TEXT:
  14375. i.appendChild(this.createTextElement(e.text));
  14376. break;
  14377. case h.LINK:
  14378. i.appendChild(this.createLinkElement(e.link))
  14379. }
  14380. }
  14381. .bind(this))
  14382. }
  14383. ,
  14384. t.prototype.appendLoadingSpinner = function() {
  14385. this.loadingSpinner = document.createElement("div"),
  14386. this.loadingSpinner.classList.add("loading-spinner");
  14387. var e = document.createElement("div");
  14388. e.classList.add("gui-spinner-icon"),
  14389. this.loadingSpinner.appendChild(e),
  14390. this.body.appendChild(this.loadingSpinner)
  14391. }
  14392. ,
  14393. t.prototype.onMediaLoadFinished = function() {
  14394. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14395. this.applyOrientation(this.orientation),
  14396. this.loadingSpinner = null)
  14397. }
  14398. ,
  14399. t.prototype.appendMedia = function() {
  14400. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14401. this.appendLoadingSpinner();
  14402. var e = document.createElement("div");
  14403. e.classList.add("tag-media-content");
  14404. var t = document.createElement("i");
  14405. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14406. t.classList.add(e)
  14407. }),
  14408. this.body.appendChild(t),
  14409. this.body.appendChild(e),
  14410. this.media.type) {
  14411. case h.IMAGE:
  14412. e.appendChild(this.createImageElement(this.media, this.body));
  14413. break;
  14414. case h.VIDEO:
  14415. e.appendChild(this.createVideoElement(this.media, this.body));
  14416. break;
  14417. case h.RICH:
  14418. e.appendChild(this.createEmbedElement(this.media, this.body))
  14419. }
  14420. }
  14421. }
  14422. ,
  14423. t.prototype.createTextElement = function(e) {
  14424. var t = document.createElement("span");
  14425. return t.textContent = e,
  14426. t
  14427. }
  14428. ,
  14429. t.prototype.createLinkElement = function(e) {
  14430. var t = new i(e);
  14431. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14432. t.createDomElement()
  14433. }
  14434. ,
  14435. t.prototype.createImageElement = function(t, C) {
  14436. function e() {
  14437. function e() {
  14438. p || (E.classList.remove("view-image"),
  14439. a.classList.add("overlay"),
  14440. t(),
  14441. window.addEventListener("resize", A),
  14442. a.addEventListener("click", i),
  14443. c.addEventListener("click", r),
  14444. o.addEventListener("click", n),
  14445. p = !0,
  14446. _.emit(w.IMAGE_OPENED))
  14447. }
  14448. function t() {
  14449. C.classList.add("show-info"),
  14450. s.classList.remove("collapsible"),
  14451. s.style.height = "";
  14452. var e = parseFloat(getComputedStyle(v).lineHeight)
  14453. , t = g + e
  14454. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14455. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14456. , r = n
  14457. , o = r * I.aspect;
  14458. i < o && (r = (o = i) / I.aspect),
  14459. n < r && (o = (r = n) * I.aspect),
  14460. o += m,
  14461. r += m + t,
  14462. C.style.width = o + "px",
  14463. C.style.height = r + "px",
  14464. l.style.paddingTop = e + m + "px",
  14465. 0 < _.description.length && (s.classList.add("collapsible"),
  14466. s.style.height = s.clientHeight + 12 + "px",
  14467. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14468. }
  14469. function i(e) {
  14470. e.target === a && n()
  14471. }
  14472. function n() {
  14473. p && (p = !1,
  14474. E.classList.add("view-image"),
  14475. a.classList.remove("overlay"),
  14476. s.style.height = "",
  14477. l.style.paddingTop = "",
  14478. C.style.width = "",
  14479. C.style.height = "",
  14480. window.removeEventListener("resize", A),
  14481. a.removeEventListener("click", i),
  14482. c.removeEventListener("click", r),
  14483. o.removeEventListener("click", n),
  14484. _.emit(w.IMAGE_CLOSED),
  14485. _.close(!0))
  14486. }
  14487. function r(e) {
  14488. C.classList.toggle("show-info")
  14489. }
  14490. var a = _.div
  14491. , s = a.getElementsByClassName("tag-content")[0]
  14492. , l = a.getElementsByClassName("tag-media-content")[0]
  14493. , o = C.getElementsByClassName("close")[0]
  14494. , c = s.getElementsByClassName("tag-label")[0];
  14495. a.classList.add("has-image"),
  14496. E.classList.add("view-image"),
  14497. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14498. _.applyOrientation(_.orientation);
  14499. var h, u, d, p = !1, f = getComputedStyle(s), g = parseFloat(f.paddingTop) + parseFloat(f.paddingBottom), m = 2 * parseFloat(getComputedStyle(l).paddingLeft), v = s.querySelector(".tag-label"), y = s.querySelector(".tag-desc"), A = (d = 0,
  14500. function() {
  14501. clearInterval(h),
  14502. clearTimeout(u),
  14503. h = setInterval(function() {
  14504. var e = a.clientHeight;
  14505. d !== e && (t(),
  14506. d = e)
  14507. }, 100),
  14508. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14509. }
  14510. );
  14511. I.on(w.IMAGE_OPENING, e),
  14512. _.on(b.ACTIVATE, e),
  14513. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14514. _.on(b.CLOSING, n)
  14515. }
  14516. var I = new n
  14517. , E = I.createDomElement();
  14518. this.once(b.OPENED, function() {
  14519. I.load(t.src).then(e).catch(function(e) {
  14520. p.warn("Failed to load image:", t.src),
  14521. p.warn("with error:", e)
  14522. }).then(this.onMediaLoadFinished.bind(this))
  14523. });
  14524. var _ = this;
  14525. return E
  14526. }
  14527. ,
  14528. t.prototype.createVideoElement = function(t, e) {
  14529. var i = new o({
  14530. autoPlay: !0,
  14531. autoResume: !0,
  14532. startMuted: !1,
  14533. loop: !1
  14534. })
  14535. , n = i.createDomElement();
  14536. return this.once(b.OPENED, function() {
  14537. i.load(t.src).then(function() {
  14538. this.div.classList.add("has-video"),
  14539. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14540. i.play()),
  14541. this.on(b.OPENING, i.show.bind(i)),
  14542. this.on(b.OPENED, i.play.bind(i)),
  14543. this.on(b.CLOSING, i.pause.bind(i)),
  14544. this.on(b.CLOSED, i.hide.bind(i))
  14545. }
  14546. .bind(this)).catch(function(e) {
  14547. p.warn("Failed to embed video:", t.src),
  14548. p.warn("with error:", e)
  14549. }).then(this.onMediaLoadFinished.bind(this))
  14550. }
  14551. .bind(this)),
  14552. n
  14553. }
  14554. ,
  14555. t.prototype.createEmbedElement = function(t, e) {
  14556. var i = new a
  14557. , n = i.createDomElement();
  14558. return this.once(b.OPENED, function() {
  14559. i.load(t.src).then(function() {
  14560. this.div.classList.add("has-embed"),
  14561. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14562. this.applyOrientation(this.orientation),
  14563. this.on(b.OPENING, i.show.bind(i)),
  14564. this.on(b.CLOSED, i.hide.bind(i))
  14565. }
  14566. .bind(this)).catch(function(e) {
  14567. p.warn("Failed to embed:", t.src),
  14568. p.warn("with error:", e)
  14569. }).then(this.onMediaLoadFinished.bind(this))
  14570. }
  14571. .bind(this)),
  14572. n
  14573. }
  14574. ,
  14575. t.prototype.open = function(e) {
  14576. return this.openPromise = $.Deferred(),
  14577. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14578. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14579. this.state !== g.OPEN && (this.emit(b.OPENING),
  14580. e && this.emit(b.ACTIVATING),
  14581. this.state = g.OPENING,
  14582. this.animateOpen(function() {
  14583. e && this.setActiveState(),
  14584. this.openPromise.resolve()
  14585. }
  14586. .bind(this)))
  14587. }
  14588. .bind(this), d.animation.openDelay),
  14589. s.cancel(this.closeTransition),
  14590. this.closePromise && this.closePromise.reject(),
  14591. this.closeTransition = void 0,
  14592. this.openPromise.promise())
  14593. }
  14594. ,
  14595. t.prototype.close = function(e) {
  14596. return this.closePromise = $.Deferred(),
  14597. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14598. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14599. this.state = g.CLOSING,
  14600. this.animateClose())
  14601. }
  14602. .bind(this), d.animation.closeDelay)),
  14603. s.cancel(this.openTransition),
  14604. this.openPromise && this.openPromise.reject(),
  14605. this.openTransition = void 0,
  14606. this.closePromise.resolve(),
  14607. this.closePromise.promise())
  14608. }
  14609. ,
  14610. t.prototype.setActiveState = function() {
  14611. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14612. this.emit(b.ACTIVATE),
  14613. this.div.classList.remove("has-hotzone"))
  14614. }
  14615. ,
  14616. t.prototype.animateOpen = function(e) {
  14617. if (this.state === g.OPENING) {
  14618. if (s.cancel(this.animationTransition),
  14619. c.detectSamsungNative())
  14620. return this.boardOrientation = null,
  14621. this.div.style.visibility = "visible",
  14622. this.emit(b.OPENED),
  14623. this.state = g.OPEN,
  14624. void (e && e());
  14625. this.div.style.webkitTransform = "scale(0)",
  14626. this.div.style.transform = "scale(0)",
  14627. this.div.style.visibility = "visible",
  14628. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14629. this.emit(b.OPENED),
  14630. this.state = g.OPEN,
  14631. e && e()
  14632. }
  14633. .bind(this))
  14634. }
  14635. }
  14636. ,
  14637. t.prototype.animateClose = function(e) {
  14638. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14639. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14640. this.emit(b.CLOSED),
  14641. this.state = g.CLOSED,
  14642. this.div.style.visibility = "hidden",
  14643. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14644. e && e()
  14645. }
  14646. .bind(this)))
  14647. }
  14648. ,
  14649. t.prototype.needsUpdate = function() {
  14650. return this.state !== g.CLOSED
  14651. }
  14652. ,
  14653. t.prototype.update = function(e, t) {
  14654. if (this.needsUpdate()) {
  14655. var i = (this.updateOrientation(e),
  14656. this.calcScale(t))
  14657. , n = {
  14658. x: (e.x + 1) * $("#player").width() / 2,
  14659. y: (e.y + 1) * $("#player").height() / 2
  14660. };
  14661. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14662. this.div.style.webkitTransform = this.div.screenTransform,
  14663. this.div.style.transform = this.div.screenTransform
  14664. }
  14665. }
  14666. ,
  14667. t.prototype.getDimensions = function() {
  14668. return this.div.getBoundingClientRect()
  14669. }
  14670. ,
  14671. t.prototype.calcScale = function(e) {
  14672. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14673. }
  14674. ,
  14675. t.prototype.updateOrientation = function(e) {
  14676. if (this.state !== g.ACTIVE) {
  14677. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14678. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14679. , n = "";
  14680. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14681. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14682. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14683. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14684. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14685. }
  14686. }
  14687. ,
  14688. t.prototype.applyOrientation = function(e) {
  14689. this.div.style.transform = this.div.style.webkitTransform = "",
  14690. this.div.classList.remove("tag-container-" + this.orientation),
  14691. this.div.classList.add("tag-container-" + e);
  14692. var t = window.getComputedStyle(this.div);
  14693. this.initialTransform = t.transform || t.webkitTransform,
  14694. "none" === this.initialTransform && (this.initialTransform = "");
  14695. var i = t.transform.slice(7, -1).split(",")
  14696. , n = -i[4]
  14697. , r = -i[5];
  14698. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14699. this.div.style.transformOrigin = n + "px " + r + "px",
  14700. this.orientation = e
  14701. }
  14702. ,
  14703. v.exports = t
  14704. }
  14705. ).call(this, "/js/tag/Billboard/Billboard.js")
  14706. }
  14707. , {
  14708. "../../util/browser": 182,
  14709. "../../util/lerp": 188,
  14710. "../../util/logger": 189,
  14711. "../../util/transitions": 195,
  14712. "../Media/EmbedlyEmbed": 125,
  14713. "../Media/EmbedlyPlayer": 126,
  14714. "../Media/Image": 128,
  14715. "../Media/Link": 129,
  14716. "../Media/MediaEvent": 131,
  14717. "../Parser/DescriptionChunkType": 133,
  14718. "../Parser/DescriptionParser": 134,
  14719. "./BillboardEvent": 120,
  14720. "./billboardSettings": 121,
  14721. "./overlaySettings": 122,
  14722. events: 202
  14723. }],
  14724. 120: [function(e, t, i) {
  14725. "use strict";
  14726. t.exports = Object.freeze({
  14727. ENTER: "billboard.enter",
  14728. LEAVE: "billboard.leave",
  14729. OPENING: "billboard.opening",
  14730. OPENED: "billboard.open",
  14731. CLOSING: "billboard.closing",
  14732. CLOSED: "billboard.closed",
  14733. ACTIVATING: "billboard.activating",
  14734. ACTIVATE: "billboard.activate"
  14735. })
  14736. }
  14737. , {}],
  14738. 121: [function(e, t, i) {
  14739. "use strict";
  14740. t.exports = Object.freeze({
  14741. animation: Object.freeze({
  14742. hoverOnClosing: !1,
  14743. openDelay: 100,
  14744. closeDelay: 50,
  14745. openDuration: 200,
  14746. closeDuration: 100
  14747. }),
  14748. boardToDiscRatio: 1.2
  14749. })
  14750. }
  14751. , {}],
  14752. 122: [function(e, t, i) {
  14753. "use strict";
  14754. t.exports = Object.freeze({
  14755. boundaryWidth: 30,
  14756. boundaryHeight: 0
  14757. })
  14758. }
  14759. , {}],
  14760. hot: [function(e, t, i) {
  14761. "use strict";
  14762. function n(e, t, i) {
  14763. this.sid = e,
  14764. this.position = this.convertValue(t.position, g.Vector3)
  14765. if(t.quaternion){
  14766. this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
  14767. }else{
  14768. this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
  14769. }
  14770. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  14771. this.isSprite = t.isSprite
  14772. this.link = t.link,
  14773. this.model = i,
  14774. this.size = t.size;
  14775. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  14776. this.build()
  14777. t.infoAttribute && t.infoAttribute.title && this.createTitleElem(t.infoAttribute.title)
  14778. this.changeTex()
  14779. this.setVisiblePanos(t.visiblePanos);
  14780. }
  14781. var g = e("three")
  14782. , r = e("../shaders")
  14783. , m = e("../settings")
  14784. , v = e("../enum/Viewmode")
  14785. , d = e("../objects/Panorama")
  14786. , o = e("../util/texture")
  14787. , math = e("../util/math")
  14788. , p = new g.Raycaster
  14789. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  14790. var defaultTex1 = o.load(g_HotImage.point);
  14791. var defaultTex2 = o.load(g_HotImage.point2)
  14792. n.prototype.changeTex = function(){
  14793. var u = this.mesh.material.uniforms
  14794. if(this.styleTex.length){
  14795. u.texture1.value = o.load(this.styleTex[0].src);
  14796. u.texture2.value = o.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  14797. }else{
  14798. u.texture1.value = defaultTex1;
  14799. u.texture2.value = defaultTex2;
  14800. }
  14801. }
  14802. n.prototype.initStyleImg = function(t){
  14803. this.styleTex = []
  14804. t.styleImg = t.styleImg || [];
  14805. t.styleImg.forEach((src)=>{
  14806. this.styleTex.push({src:src})
  14807. })
  14808. this.changeTex()
  14809. }
  14810. n.prototype.update = function(camera) {
  14811. if(this.isSprite){
  14812. this.mesh.quaternion.copy(camera.quaternion)
  14813. }
  14814. }
  14815. n.prototype.setVisiblePanos = function(visibleData){
  14816. if(visibleData == "get"){
  14817. this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
  14818. }else if(visibleData){
  14819. this.visiblePanos = visibleData;
  14820. }
  14821. }
  14822. n.prototype.build = function() {
  14823. var t = g.UniformsUtils.clone(r.hot.uniforms);
  14824. var e = new g.Mesh(a, new g.ShaderMaterial({
  14825. uniforms: t,
  14826. vertexShader: r.hot.vertexShader,
  14827. fragmentShader: r.hot.fragmentShader,
  14828. transparent: !0
  14829. }))
  14830. , t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  14831. e.dynamic = !0,
  14832. e.position.copy(this.position);
  14833. e.quaternion.copy(this.quaternion)
  14834. t && e.scale.set(t, t, t),
  14835. e.name = this.sid,
  14836. e.type = "hotSprite",
  14837. (e.belongHot = this).link && (e.hotLink = this.link),
  14838. this.mesh = e,
  14839. this.model.add(e),
  14840. g_HotMeshes.push(e);
  14841. }
  14842. n.prototype.createTitleElem = function(title){
  14843. var root = $("#hot");
  14844. var elem = $(`<div> ${title}</div>`)
  14845. root.append(elem);
  14846. this.titleElem = elem;
  14847. }
  14848. n.prototype.showTitle = function(){
  14849. if(!this.titleElem)return;
  14850. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  14851. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  14852. this.titleElem.css("display","block");
  14853. }
  14854. n.prototype.hideTitle = function(){
  14855. if(!this.titleElem)return;
  14856. this.titleElem.css("display","none");
  14857. }
  14858. ,
  14859. n.prototype.closestPanoTowardTag = function(e, t) {
  14860. var i = []
  14861. , n = []
  14862. , r = this.mesh.position;
  14863. if (e === v.PANORAMA) {
  14864. var o = t.position.clone().sub(r).normalize();
  14865. n.push(d.scoreFunctions.direction(r, o))
  14866. }
  14867. var a = new g.Vector3;
  14868. i.push(function(e) {
  14869. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  14870. }, function(e) {
  14871. a.copy(r).sub(e.position);
  14872. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  14873. , i = m.tags.navigate.tiltTolerance;
  14874. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  14875. },
  14876. (pano)=>{ // add
  14877. player.checkHasNeighbor(pano)
  14878. }
  14879. ),
  14880. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  14881. var s = t.model.panos.sortByScore(i, n);
  14882. if (s && m.tags.navigate.lineOfSight) {
  14883. for (var l = 0; l < s.length; l++) {
  14884. var c = s[l].pano
  14885. , h = c.position.distanceTo(r);
  14886. p.set(c.position, r.clone().sub(c.position).normalize());
  14887. var u = p.intersectObjects(t.model.colliders);
  14888. if (0 === u.length || u[0].distance > h)
  14889. return console.log(l),
  14890. c
  14891. }
  14892. return null
  14893. }
  14894. return s && 0 < s.length && s[0].pano
  14895. }
  14896. ,
  14897. n.prototype.examine = function(e, options) {
  14898. var i = document.getElementById("popup");
  14899. options = options || {}
  14900. if (this.link && !options.dontOpen) {
  14901. g_currentHot = this,
  14902. i.style.display = "block",
  14903. i.classList.add("wait");
  14904. var n = document.createElement("iframe");
  14905. if(g_bgAudio && !g_bgAudio.paused){
  14906. manage.switchBgmState(false);
  14907. g_bgAudio.pauseByHot = true
  14908. }
  14909. if(g_tourAudio)g_tourAudio.pause()
  14910. var r = this.link.substring(this.link.indexOf("html") + 4)
  14911. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  14912. -1 == r.indexOf("?") ? n.src = this.link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : n.src = this.link + "&time=" + randomTime().getTime() + "&id=" + window.number + o,
  14913. n.id = "id1",
  14914. n.allowTransparency = "true";
  14915. var a = document.getElementById("id1");
  14916. if (void 0 === a || null == a) {
  14917. document.querySelector(".popup-content").appendChild(n);
  14918. var s = !1;
  14919. window.loaddingSuccess = function() {
  14920. s = !0
  14921. }
  14922. ,
  14923. setTimeout(function e() {
  14924. if (s) {
  14925. var t = document.querySelector("#id1").contentWindow.document;
  14926. t.querySelector("video") && (t.querySelector("video").play(),
  14927. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  14928. t.querySelector("audio") && t.querySelector("audio").play()
  14929. } else
  14930. setTimeout(e, 300)
  14931. }, 800)
  14932. }
  14933. }
  14934. var l = e.mode
  14935. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  14936. , h = this.mesh.position;
  14937. e.flyingToTag = !0;
  14938. var u = function() {
  14939. e.flyingToTag = !1;
  14940. options.dontOpen || this.link && i.classList.remove("wait")
  14941. }
  14942. .bind(this);
  14943. if (l === v.PANORAMA) {
  14944. var d = {
  14945. pano: c,
  14946. lookAtPoint: h,
  14947. duration: null,
  14948. maxDistanceOverride: null,
  14949. skipWarpingCheck: !1
  14950. };
  14951. e.flyToPano(d, u)
  14952. } else {
  14953. var p = {
  14954. pano: c
  14955. };
  14956. if (h) {
  14957. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  14958. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  14959. }
  14960. p.callback = u,
  14961. p.duration = 1500,
  14962. p.mode = v.PANORAMA,
  14963. e.flyToNewMode(p)
  14964. }
  14965. }
  14966. ,
  14967. /* n.prototype.conversionArray = function(e) {
  14968. if ("[object Array]" == Object.prototype.toString.call(e))
  14969. return e;
  14970. var t = [];
  14971. for (var i in e)
  14972. t.push(parseFloat(e[i]));
  14973. return t
  14974. } */
  14975. n.prototype.convertValue = function(v ,Type){
  14976. var value;
  14977. if(v instanceof Array){
  14978. v.forEach((v1)=>{v1 = parseFloat(v1)})
  14979. value = new Type().fromArray(v);
  14980. }else{
  14981. for(let i in v){v[i] = parseFloat(v[i])}
  14982. value = new Type().copy(v);
  14983. }
  14984. return value
  14985. }
  14986. ,
  14987. t.exports = n
  14988. }
  14989. , {
  14990. three: 217,
  14991. "../shaders": 167,
  14992. "../enum/Viewmode": 51,
  14993. "../objects/Panorama": 148,
  14994. "../util/texture": 194,
  14995. "../settings": 166,
  14996. "../util/math": 190,
  14997. }],
  14998. 123: [function(M, R, e) {
  14999. (function(e) {
  15000. "use strict";
  15001. function d(e, t, i) {
  15002. var n = i.version || "0";
  15003. "0" !== n && w.info("tag defined using version " + n),
  15004. this.model = e,
  15005. this.sid = t,
  15006. this.color = (new f.Color).set(i.color || o.tagDefault),
  15007. this.hoverColor = o._darken(this.color, .2),
  15008. this.floor = null,
  15009. this.floorIndex = i.floor,
  15010. this.mode = m.PANORAMA,
  15011. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15012. this.obj3d = null,
  15013. this.disc = null,
  15014. this.materials = {
  15015. disc: null,
  15016. pole: null
  15017. },
  15018. this.position = (new f.Vector3).copy(i.position),
  15019. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15020. this.discWorldPosition = null,
  15021. this.discScale = .05,
  15022. this.poleEnabled = i.stem.enabled,
  15023. this.billboard = new r(i.label,i.description,i.media,this),
  15024. this.visibleTransition = null,
  15025. this.hoveringDisc = !1
  15026. }
  15027. var i, l, c, h, u, p, n, f = M("three"), r = M("./Billboard/Billboard"), g = M("../settings"), m = M("../enum/Viewmode"), o = M("../enum/Colors"), a = M("../enum/RenderLayers"), s = M("../enum/RenderOrder"), v = (M("../util/common"),
  15028. M("../util/math")), t = M("../util/texture"), y = M("../objects/Panorama"), A = M("../shaders"), C = M("../util/transitions"), I = M("../util/lerp"), E = M("../util/easing"), _ = M("./Billboard/BillboardEvent"), b = M("events").EventEmitter, w = new (M("../util/logger"))(e), T = t.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg=="), x = t.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC"), S = new f.PlaneBufferGeometry(1,1);
  15029. d.prototype = Object.create(b.prototype),
  15030. d.raycaster = new f.Raycaster,
  15031. d.prototype.bindEvents = function() {
  15032. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15033. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15034. }
  15035. ,
  15036. d.prototype.build = function() {
  15037. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15038. this.floor && (this.billboard.build(this.model.sid),
  15039. this.obj3d = this.buildObject3D(),
  15040. this.floor.add(this.obj3d)),
  15041. this
  15042. }
  15043. ,
  15044. d.prototype.buildObject3D = function() {
  15045. var e = new f.Object3D;
  15046. e.position.copy(this.position);
  15047. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15048. t.bg.value = x,
  15049. t.mask.value = T,
  15050. t.color.value.copy(this.color),
  15051. this.materials.disc = new f.RawShaderMaterial({
  15052. transparent: !0,
  15053. vertexShader: A.tagDisc.vertexShader,
  15054. fragmentShader: A.tagDisc.fragmentShader,
  15055. uniforms: t
  15056. }),
  15057. this.disc = new f.Mesh(S,this.materials.disc),
  15058. this.disc.layers.set(a.TAG),
  15059. this.disc.position.copy(this.discPosition),
  15060. this.disc.renderOrder = s.tagDisc;
  15061. var i = (this.disc.tag = this).buildPole();
  15062. return i.layers.set(a.TAG),
  15063. i.renderOrder = s.tagStem,
  15064. e.add(i),
  15065. e.layers.set(a.TAG),
  15066. e.add(this.disc)
  15067. }
  15068. ,
  15069. d.prototype.buildPole = function() {
  15070. var e = new f.BufferGeometry
  15071. , t = new Float32Array(6);
  15072. return t[0] = t[1] = t[2] = 0,
  15073. t[3] = this.discPosition.x,
  15074. t[4] = this.discPosition.y,
  15075. t[5] = this.discPosition.z,
  15076. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15077. this.materials.pole = new f.LineBasicMaterial({
  15078. linewidth: g.tags.pole.width,
  15079. color: g.tags.pole.color,
  15080. opacity: 0,
  15081. visible: this.poleEnabled,
  15082. transparent: !0,
  15083. depthWrite: !1
  15084. }),
  15085. new f.Line(e,this.materials.pole)
  15086. }
  15087. ,
  15088. d.prototype.setFreeState = function(e) {
  15089. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15090. this.materials.disc.uniforms.color.value = this.color
  15091. }
  15092. .bind(this))
  15093. }
  15094. ,
  15095. d.prototype.setHoverState = function(e) {
  15096. this.billboard.open(e),
  15097. this.materials.disc.uniforms.color.value = this.hoverColor
  15098. }
  15099. ,
  15100. d.prototype.hide = function(e, t) {
  15101. var i = $.Deferred();
  15102. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15103. return i.resolve().promise();
  15104. e = e || 0,
  15105. t = t || 0,
  15106. C.cancel(this.visibleTransition);
  15107. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15108. return this.visibleTransition = C.start((n = this,
  15109. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15110. o = I.property(n.materials.pole, "opacity", 0),
  15111. function(e) {
  15112. r(e),
  15113. n.materials.pole && o(e)
  15114. }
  15115. ), s * a, function() {
  15116. i.resolve()
  15117. }, l, E[g.warp.blendEasing]),
  15118. i.promise()
  15119. }
  15120. ,
  15121. d.prototype.show = function(e, t) {
  15122. var i = $.Deferred();
  15123. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15124. return i.resolve().promise();
  15125. e = e || 0,
  15126. t = t || 0,
  15127. C.cancel(this.visibleTransition);
  15128. var n, r, o, a = (g.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / g.tags.disc.opacity, s = t + e, l = t / s;
  15129. return this.visibleTransition = C.start((n = this,
  15130. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15131. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15132. function(e) {
  15133. r(e),
  15134. n.materials.pole && o(e)
  15135. }
  15136. ), s * a, function() {
  15137. i.resolve()
  15138. }, l, E[g.warp.blendEasing]),
  15139. i.promise()
  15140. }
  15141. ,
  15142. d.prototype.closestPanoTowardTag = function(e, t) {
  15143. var i = []
  15144. , n = []
  15145. , r = this.disc.getWorldPosition();
  15146. if (e === m.PANORAMA) {
  15147. var o = t.position.clone().sub(r).normalize();
  15148. i.push(y.filters.isPanoAligned()),
  15149. i.push(y.filters.inPanoDirection(r, o, .5)),
  15150. i.push(y.filters.isNeighbourPanoTo(t)),
  15151. n.push(y.scoreFunctions.direction(r, o))
  15152. }
  15153. var a = new f.Vector3;
  15154. i.push(function(e) {
  15155. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15156. }, function(e) {
  15157. a.copy(r).sub(e.position);
  15158. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15159. , i = g.tags.navigate.tiltTolerance;
  15160. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15161. }),
  15162. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15163. var s = this.model.panos.sortByScore(i, n);
  15164. if (g.tags.navigate.lineOfSight) {
  15165. for (var l = 0; l < s.length; l++) {
  15166. var c = s[l].pano
  15167. , h = c.position.distanceTo(r);
  15168. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15169. return null;
  15170. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15171. var u = d.raycaster.intersectObjects(this.model.colliders);
  15172. if (0 === u.length || u[0].distance > h)
  15173. return c
  15174. }
  15175. return null
  15176. }
  15177. return 0 < s.length && s[0].pano
  15178. }
  15179. ,
  15180. d.prototype.examine = function(i) {
  15181. if(!player.currentPano)return;
  15182. var e = i.mode
  15183. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15184. , t = this.disc.getWorldPosition();
  15185. this.billboard.setActiveState();
  15186. var r = function() {
  15187. var e = this.billboard.getDimensions()
  15188. , t = new f.Vector3;
  15189. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15190. t.unproject(i.camera),
  15191. i.flyToPano({
  15192. pano: n,
  15193. lookAtPoint: t
  15194. })
  15195. }
  15196. .bind(this);
  15197. if (e === m.PANORAMA)
  15198. if (n !== i.currentPano) {
  15199. var o = {
  15200. pano: n,
  15201. lookAtPoint: t,
  15202. duration: null,
  15203. maxDistanceOverride: null,
  15204. skipWarpingCheck: !1
  15205. };
  15206. i.flyToPano(o, r)
  15207. } else
  15208. setTimeout(function() {
  15209. this.billboard.open().then(function() {
  15210. r()
  15211. })
  15212. }
  15213. .bind(this), 0);
  15214. else {
  15215. var a = {
  15216. pano: n
  15217. };
  15218. if (t) {
  15219. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15220. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15221. }
  15222. a.callback = r,
  15223. a.duration = 1500,
  15224. a.mode = m.PANORAMA,
  15225. i.flyToNewMode(a)
  15226. }
  15227. }
  15228. ,
  15229. d.prototype.update = (n = new f.Vector3,
  15230. function(e, t) {
  15231. this.discWorldPosition = this.disc.getWorldPosition(),
  15232. this.updateDisc(e, t),
  15233. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15234. n.z < 1 && (n.y *= -1,
  15235. this.billboard.update(n, this.getDiscRadius(n, t))))
  15236. }
  15237. ),
  15238. d.prototype.updateDisc = (l = new f.Vector3,
  15239. c = new f.Vector3,
  15240. h = new f.Vector3,
  15241. u = new f.Vector3,
  15242. p = new f.Vector3,
  15243. function(e, t) {
  15244. var i = g.tags.visibility
  15245. , n = g.tags.disc.scale
  15246. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15247. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (i.anyDistance || r <= i.visibleDistance || e === m.TRANSITIONING) && (!i.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!i.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!i.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15248. this.obj3d.visible) {
  15249. this.disc.quaternion.copy(t.quaternion);
  15250. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15251. l.copy(this.discWorldPosition).project(t),
  15252. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15253. h.set(o / 2, 0, 0).add(c),
  15254. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15255. p.copy(u).unproject(t);
  15256. var a = p.distanceTo(this.discWorldPosition)
  15257. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15258. this.discScale = a * s,
  15259. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15260. }
  15261. }
  15262. ),
  15263. d.prototype.getDiscRadius = (i = new f.Vector3,
  15264. function(e, t) {
  15265. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15266. Math.abs(e.x - i.x) * $("#player").width()
  15267. }
  15268. ),
  15269. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15270. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15271. }
  15272. ,
  15273. d.prototype.offScreen = function(e, t) {
  15274. var i = e.getWorldPosition().project(t);
  15275. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15276. }
  15277. ,
  15278. d.viewportScale = function() {
  15279. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15280. d.viewportHeight = $("#player").height(),
  15281. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15282. d.currentViewportScale
  15283. }
  15284. ,
  15285. R.exports = d
  15286. }
  15287. ).call(this, "/js/tag/tag.js")
  15288. }
  15289. , {
  15290. "../enum/Colors": 19,
  15291. "../enum/RenderLayers": 41,
  15292. "../enum/RenderOrder": 42,
  15293. "../enum/Viewmode": 51,
  15294. "../objects/Panorama": 148,
  15295. "../settings": 166,
  15296. "../shaders": 167,
  15297. "../util/common": 185,
  15298. "../util/easing": 186,
  15299. "../util/lerp": 188,
  15300. "../util/logger": 189,
  15301. "../util/math": 190,
  15302. "../util/texture": 194,
  15303. "../util/transitions": 195,
  15304. "./Billboard/Billboard": 119,
  15305. "./Billboard/BillboardEvent": 120,
  15306. events: 202,
  15307. three: 217
  15308. }],
  15309. 124: [function(M, R, e) {
  15310. (function(e) {
  15311. "use strict";
  15312. function t() {
  15313. this.tagState = T.IDLE,
  15314. this.intersectTag = null,
  15315. this.hoveredTag = null,
  15316. this.activeTag = null,
  15317. this.tagDiscs = [],
  15318. this.raycaster = new i.Raycaster,
  15319. this.modelManager = null,
  15320. this.player = null,
  15321. this.totaltags = 0,
  15322. this.navigatingViaTag = !1,
  15323. this.enabled = !1
  15324. }
  15325. var o, h, u, d, p, f, s, l, c, i = M("three"), n = M("../util/logger"), r = M("../util/common"), a = M("../controls/serializer"), g = M("../objects/Snapshot"), m = M("../settings"), v = M("./Billboard/BillboardEvent"), y = M("./Media/MediaEvent"), A = M("./Media/LinkType"), C = M("../enum/Viewmode"), I = M("../enum/WarpStyle"), E = M("../enum/BlackoutStyle"), _ = M("../enum/ModelManagerEvents"), b = M("../enum/tagEvents"), w = M("../enum/PlayerEvents"), T = (M("../util/lerp"),
  15326. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15327. r.extend(t, x),
  15328. t.prototype.init = function(e, t) {
  15329. this.modelManager = e,
  15330. this.player = t,
  15331. this.updateModel(),
  15332. this.bindEvents()
  15333. }
  15334. ,
  15335. t.prototype.update = function(e) {
  15336. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15337. }
  15338. ,
  15339. t.prototype.updateTags = function(e, t, i, n) {
  15340. for (var r in this.model.tags)
  15341. this.model.tags[r].update(e, t, i, n)
  15342. }
  15343. ,
  15344. t.prototype.updateModel = function() {
  15345. this.model = this.modelManager.getActiveModel(),
  15346. this.gettagsFromModel(),
  15347. this.totaltags = Object.keys(this.model.tags).length
  15348. }
  15349. ,
  15350. t.prototype.gettagsFromModel = function() {
  15351. for (var e in this.tagDiscs = [],
  15352. this.model.tags) {
  15353. var t = this.model.tags[e].disc;
  15354. t && this.tagDiscs.push(t)
  15355. }
  15356. }
  15357. ,
  15358. t.prototype.bindEvents = function() {
  15359. function e() {
  15360. Object.keys(this.model.tags).forEach(function(e) {
  15361. var t = this.model.tags[e];
  15362. t.bindEvents(),
  15363. t.billboard.on(y.LINK_CLICK, function(e) {
  15364. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15365. }
  15366. .bind(this)),
  15367. t.billboard.on(y.IMAGE_OPENED, function() {
  15368. this.tagState = T.EXAMINE,
  15369. this.emit(y.IMAGE_OPENED)
  15370. }
  15371. .bind(this)),
  15372. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15373. }
  15374. .bind(this))
  15375. }
  15376. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15377. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15378. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15379. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15380. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15381. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15382. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15383. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15384. e.call(this)
  15385. }
  15386. ,
  15387. t.prototype.navigateViaLink = function(e) {
  15388. var t = a.deserialize(e);
  15389. if (t)
  15390. if (t.mode === C.PANORAMA) {
  15391. try {
  15392. this.player.model.panos.get(t.panoId)
  15393. } catch (e) {
  15394. return void S.warn("Unable to find panorama location", t.panoId)
  15395. }
  15396. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15397. } else {
  15398. var i = {
  15399. cameraMode: t.mode,
  15400. position: t.position,
  15401. quaternion: t.quaternion,
  15402. scanId: t.panoId,
  15403. orthoZoom: t.zoom,
  15404. floorVisibility: t.floorVisibility,
  15405. thumbUrl: null,
  15406. name: null
  15407. };
  15408. this.player.flyToNewMode({
  15409. mode: t.mode,
  15410. duration: m.warp.outsideTime,
  15411. warpDest: new g(i),
  15412. force: !0
  15413. })
  15414. }
  15415. }
  15416. ,
  15417. t.prototype.handleWarpStart = function(e, t, i, n) {
  15418. this.dismissExaminedTag(),
  15419. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15420. e && (i = E.END),
  15421. this.hideShowTagsForBlackoutStyle(i, n))
  15422. }
  15423. ,
  15424. t.prototype.handleWarpInterruption = function(e, t, i) {
  15425. null != i || (i = m.warp.teleportTime),
  15426. this.hideShowTagsForBlackoutStyle(t, i)
  15427. }
  15428. ,
  15429. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15430. var i = 0
  15431. , n = 0
  15432. , r = t / 2;
  15433. switch (null != e || (e = E.MIDDLE),
  15434. e) {
  15435. case E.END:
  15436. this.hideAlltags(r);
  15437. break;
  15438. case E.BEGINNING:
  15439. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15440. break;
  15441. case E.NONE:
  15442. break;
  15443. case E.MIDDLE:
  15444. n = i = r,
  15445. this.hideAlltags(n),
  15446. setTimeout(function() {
  15447. this.showAlltags(i)
  15448. }
  15449. .bind(this), n);
  15450. break;
  15451. case E.FADEIN:
  15452. setTimeout(function() {
  15453. this.showAlltags(r)
  15454. }
  15455. .bind(this), r)
  15456. }
  15457. }
  15458. ,
  15459. t.prototype.onPlayerModeChanging = function(e, t) {
  15460. t !== C.PANORAMA && this.dismissExaminedTag(),
  15461. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15462. var i = t !== C.OUTDOOR;
  15463. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15464. }
  15465. ,
  15466. t.prototype.onPanoChange = function(e, t) {
  15467. var i = this.navigatingViaTag;
  15468. if (this.navigatingViaTag = !1,
  15469. !i) {
  15470. this.dismissExaminedTag();
  15471. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15472. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15473. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15474. }
  15475. }
  15476. ,
  15477. t.prototype.onPlayerReady = function(e, t, i) {
  15478. this.startAlltags(e, t ? i : null)
  15479. }
  15480. ,
  15481. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15482. this.updateClosestTags(e)
  15483. }
  15484. ,
  15485. t.prototype.dismissExaminedTag = function() {
  15486. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15487. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15488. this.hoveredTag = null)
  15489. }
  15490. ,
  15491. t.prototype.startAlltags = function(e, t) {
  15492. this.model.shouldShowtags = m.tags.enabled,
  15493. this.enabled = !0,
  15494. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15495. t && setTimeout(function() {
  15496. this.activateTag(this.model.getTagBySid(t))
  15497. }
  15498. .bind(this), m.tags.startup.fadeInDuration / 2))
  15499. }
  15500. ,
  15501. t.prototype.showAlltags = function(e, t, i) {
  15502. function n() {
  15503. ++o === this.totaltags && (this.model.tagsShown = !0,
  15504. r.resolve())
  15505. }
  15506. var r = $.Deferred();
  15507. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15508. return r.resolve().promise();
  15509. var o = 0;
  15510. for (var a in this.model.tags) {
  15511. this.model.tags[a].show(e, t).done(n.bind(this))
  15512. }
  15513. return r.promise()
  15514. }
  15515. ,
  15516. t.prototype.hideAlltags = function(e, t) {
  15517. function i() {
  15518. ++r === this.totaltags && (this.model.tagsShown = !1,
  15519. n.resolve())
  15520. }
  15521. var n = $.Deferred()
  15522. , r = 0;
  15523. for (var o in this.model.tags) {
  15524. var a = this.model.tags[o];
  15525. a.hide(e, t).done(i.bind(this)),
  15526. a === this.activeTag && this.dismissActiveTag()
  15527. }
  15528. return n.promise()
  15529. }
  15530. ,
  15531. t.prototype.enableHovering = function() {
  15532. this.enabled = !0
  15533. }
  15534. ,
  15535. t.prototype.disableHovering = function() {
  15536. this.enabled = !1
  15537. }
  15538. ,
  15539. t.prototype.activateTag = function(e, t) {
  15540. t = t || T.EXAMINE,
  15541. this.activeTag = e,
  15542. this.activeTag.hoveringDisc = !0,
  15543. this.activeTag.setHoverState(t === T.EXAMINE),
  15544. this.tagState = t,
  15545. this.emit(b.TagActivated, e)
  15546. }
  15547. ,
  15548. t.prototype.dismissActiveTag = function() {
  15549. this.activeTag.hoveringDisc = !1,
  15550. this.activeTag.setFreeState(!0);
  15551. var e = this.activeTag;
  15552. this.activeTag = null,
  15553. this.tagState = T.IDLE,
  15554. this.emit(b.TagDismissed, e)
  15555. }
  15556. ,
  15557. t.prototype.clickedOnTag = function(e) {
  15558. var t = function() {
  15559. this.navigatingViaTag = !0,
  15560. this.activeTag.examine(this.player),
  15561. this.emit(b.TagNavigation, this.activeTag)
  15562. }
  15563. .bind(this);
  15564. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15565. this.activeTag = this.intersectTag,
  15566. t(),
  15567. !0) : (this.dismissActiveTag(),
  15568. !1)
  15569. }
  15570. ,
  15571. t.prototype.intersecttag = (s = new i.Vector3,
  15572. l = new i.Vector3,
  15573. c = new i.Vector3,
  15574. function(e, t, i) {
  15575. if (!this.enabled)
  15576. return null;
  15577. var n = null
  15578. , r = this.tagDiscs.filter(function(e) {
  15579. return e.parent.visible
  15580. });
  15581. if (0 < r.length) {
  15582. var o = this.model.floors.reduce(function(e, t) {
  15583. return t.hidden ? e : e.concat(t.collider.children)
  15584. }, r);
  15585. s.set(e.x, e.y, -1).unproject(i),
  15586. l.set(e.x, e.y, 1).unproject(i),
  15587. c.copy(l).sub(s).normalize(),
  15588. this.raycaster.set(s, c);
  15589. var a = this.raycaster.intersectObjects(o);
  15590. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15591. }
  15592. return this.intersectTag = n,
  15593. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15594. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15595. this.hoveredTag = n
  15596. }
  15597. .bind(this)),
  15598. n.billboard.on(v.LEAVE, function() {
  15599. this.hoveredTag = null
  15600. }
  15601. .bind(this))),
  15602. this.activateTag(n, T.BROWSE))),
  15603. n
  15604. }
  15605. ),
  15606. t.prototype.rankedtagInDirection = (h = [],
  15607. u = [],
  15608. d = new i.Vector3,
  15609. p = new i.Vector3,
  15610. f = new i.Vector3,
  15611. function(e, t, i, n) {
  15612. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15613. var a = this.closesttags[o];
  15614. p.copy(a.position),
  15615. p.add(a.discPosition),
  15616. d.copy(t),
  15617. d.sub(p).negate(),
  15618. d.normalize();
  15619. var s = d.dot(n);
  15620. if (0 <= s && (f.copy(p),
  15621. f.project(i),
  15622. this.intersecttag(f, !1, i))) {
  15623. if (r >= h.length)
  15624. for (var l = 0; l < 64; l++)
  15625. h.push({
  15626. tag: a,
  15627. dot: s
  15628. });
  15629. var c = h[r];
  15630. c.tag = a,
  15631. c.dot = s,
  15632. c.position = math.projectPositionToCanvas(p, i),
  15633. u.push(c),
  15634. r++
  15635. }
  15636. }
  15637. return u.sort(function(e, t) {
  15638. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15639. }),
  15640. e < u.length ? u[e].tag : null
  15641. }
  15642. ),
  15643. t.prototype.updateClosestTags = (o = new i.Vector3,
  15644. function(e) {
  15645. this.closesttags || (this.closesttags = []),
  15646. this.closesttags.length = 0;
  15647. var t = this.model.tags;
  15648. if (t)
  15649. for (var i in t)
  15650. if (t.hasOwnProperty(i)) {
  15651. var n = t[i]
  15652. , r = n.position;
  15653. o.copy(e),
  15654. o.sub(r).negate(),
  15655. o.lengthSq() < 30 && this.closesttags.push(n)
  15656. }
  15657. }
  15658. ),
  15659. R.exports = t
  15660. }
  15661. ).call(this, "/js/tag/tagManager.js")
  15662. }
  15663. , {
  15664. "../controls/serializer": 14,
  15665. "../enum/BlackoutStyle": 18,
  15666. "../enum/tagEvents": 32,
  15667. "../enum/ModelManagerEvents": 33,
  15668. "../enum/PlayerEvents": 40,
  15669. "../enum/TagStates": 44,
  15670. "../enum/Viewmode": 51,
  15671. "../enum/WarpStyle": 52,
  15672. "../objects/Snapshot": 153,
  15673. "../settings": 166,
  15674. "../util/common": 185,
  15675. "../util/lerp": 188,
  15676. "../util/logger": 189,
  15677. "./Billboard/BillboardEvent": 120,
  15678. "./Media/LinkType": 130,
  15679. "./Media/MediaEvent": 131,
  15680. events: 202,
  15681. three: 217
  15682. }],
  15683. 125: [function(r, o, e) {
  15684. (function(e) {
  15685. "use strict";
  15686. function t() {
  15687. this.embedWrapper = null,
  15688. this.embedElement = null
  15689. }
  15690. var i = r("../../util/ajax")
  15691. , a = r("./mediaSettings")
  15692. , n = r("../../settings")
  15693. , s = new (r("../../util/logger"))(e);
  15694. t.prototype.createDomElement = function() {
  15695. return this.embedWrapper = document.createElement("div"),
  15696. this.embedWrapper.classList.add("tag-embed"),
  15697. this.embedWrapper.classList.add("hidden"),
  15698. this.embedWrapper
  15699. }
  15700. ,
  15701. t.prototype.load = function(e) {
  15702. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15703. return new Promise(function(r, o) {
  15704. i.get(t).then(function(e) {
  15705. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15706. this.embedWrapper.innerHTML = e.html;
  15707. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15708. if (this.embedWrapper.style.width = t + "px",
  15709. e.height) {
  15710. var i = e.height / e.width;
  15711. this.embedWrapper.style.height = t * i + "px"
  15712. }
  15713. this.embedElement = this.embedWrapper.firstChild;
  15714. var n = [];
  15715. try {
  15716. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15717. } catch (e) {
  15718. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15719. }
  15720. n.forEach(function(e) {
  15721. e.setAttribute("target", "_blank")
  15722. }),
  15723. this.embedElement.classList.add("hidden"),
  15724. this.embedWrapper.classList.remove("hidden"),
  15725. r()
  15726. } else
  15727. o("Not a valid embed")
  15728. }
  15729. .bind(this), function(e) {
  15730. o(e.response)
  15731. })
  15732. }
  15733. .bind(this))
  15734. }
  15735. ,
  15736. t.prototype.show = function() {
  15737. this.embedElement && this.embedElement.classList.remove("hidden")
  15738. }
  15739. ,
  15740. t.prototype.hide = function() {
  15741. this.embedElement && this.embedElement.classList.add("hidden")
  15742. }
  15743. ,
  15744. o.exports = t
  15745. }
  15746. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15747. }
  15748. , {
  15749. "../../settings": 166,
  15750. "../../util/ajax": 181,
  15751. "../../util/logger": 189,
  15752. "./mediaSettings": 132
  15753. }],
  15754. 126: [function(a, s, e) {
  15755. (function(e) {
  15756. "use strict";
  15757. function t(e) {
  15758. r.call(this),
  15759. this.options = e,
  15760. this.playerControls = null,
  15761. this.state = o.NOT_READY
  15762. }
  15763. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15764. Object.freeze({
  15765. NOT_READY: "player.not.ready",
  15766. CUED: "player.cued",
  15767. PLAYING: "player.playing",
  15768. PAUSED: "player.paused"
  15769. }));
  15770. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15771. return this.embedWrapper = document.createElement("div"),
  15772. this.embedWrapper.classList.add("tag-video"),
  15773. this.embedWrapper.classList.add("hidden"),
  15774. this.embedWrapper
  15775. }
  15776. ,
  15777. t.prototype.load = function(e) {
  15778. var t = function() {
  15779. function e(e) {
  15780. this.playerState = e
  15781. }
  15782. this.playerControls = new playerjs.Player(this.embedElement),
  15783. this.playerControls.on("ready", function(e) {
  15784. this.playerState = o.CUED,
  15785. this.options.startMuted && this.playerControls.mute()
  15786. }
  15787. .bind(this)),
  15788. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15789. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15790. this.playerControls.on("ended", function(e) {
  15791. this.playerControls.setCurrentTime(0),
  15792. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15793. }
  15794. .bind(this))
  15795. }
  15796. .bind(this);
  15797. return r.prototype.load.call(this, e).then(t.bind(this))
  15798. }
  15799. ,
  15800. t.prototype.play = (i = n.isMobile(),
  15801. function() {
  15802. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15803. }
  15804. ),
  15805. t.prototype.pause = function() {
  15806. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15807. }
  15808. ,
  15809. s.exports = t
  15810. }
  15811. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15812. }
  15813. , {
  15814. "../../util/browser": 182,
  15815. "../../util/logger": 189,
  15816. "./EmbedlyEmbed": 125
  15817. }],
  15818. 127: [function(t, i, e) {
  15819. (function(e) {
  15820. "use strict";
  15821. var r = t("../../util/ajax")
  15822. , o = new (t("./mediaSettings"),
  15823. t("../../util/logger"))(e)
  15824. , a = Promise.resolve();
  15825. i.exports.enqueue = function(i) {
  15826. function n() {}
  15827. return a = new Promise(function(e, t) {
  15828. a.catch(n).then(function() {
  15829. (o.debug("requesting file from embedly:", i.href),
  15830. r.get(i.href, {
  15831. responseType: i.responseType
  15832. }).then(function(e) {
  15833. return o.debug("requesting file finished:", i.href),
  15834. e
  15835. })).then(e, t)
  15836. })
  15837. }
  15838. )
  15839. }
  15840. }
  15841. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15842. }
  15843. , {
  15844. "../../util/ajax": 181,
  15845. "../../util/logger": 189,
  15846. "./mediaSettings": 132
  15847. }],
  15848. 128: [function(s, l, e) {
  15849. (function(e) {
  15850. "use strict";
  15851. function t() {
  15852. this.imageWrapper = null,
  15853. this.width = 0,
  15854. this.height = 0,
  15855. this.aspect = 1
  15856. }
  15857. var i = s("./MediaEvent")
  15858. , n = s("./EmbedlyQueue")
  15859. , r = s("events").EventEmitter
  15860. , o = s("../../util/logger")
  15861. , a = s("../../settings");
  15862. new o(e),
  15863. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15864. return this.imageWrapper = document.createElement("div"),
  15865. this.imageWrapper.classList.add("tag-image"),
  15866. this.imageWrapper.classList.add("hidden"),
  15867. this.imageWrapper.addEventListener("click", function(e) {
  15868. e.stopPropagation(),
  15869. this.emit(i.IMAGE_OPENING),
  15870. this.imageWrapper.style.pointerEvents = "none"
  15871. }
  15872. .bind(this)),
  15873. this.imageWrapper
  15874. }
  15875. ,
  15876. t.prototype.onClosed = function() {
  15877. this.imageWrapper.style.pointerEvents = "auto"
  15878. }
  15879. ,
  15880. t.prototype.load = function(e) {
  15881. var t = Math.max(window.screen.height, window.screen.width)
  15882. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15883. return new Promise(function(o, e) {
  15884. n.enqueue({
  15885. href: i,
  15886. responseType: "arraybuffer"
  15887. }).then(function(e) {
  15888. var t = new Uint8Array(e)
  15889. , i = new Blob([t])
  15890. , n = new window.Image;
  15891. n.addEventListener("load", function(e) {
  15892. var t = e.target;
  15893. this.width = t.naturalWidth,
  15894. this.height = t.naturalHeight,
  15895. this.aspect = this.width / this.height;
  15896. var i = e.target.src;
  15897. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15898. this.imageWrapper.style.width = this.width + "px",
  15899. this.imageWrapper.style.height = this.height + "px",
  15900. this.imageWrapper.classList.remove("hidden"),
  15901. o()
  15902. }
  15903. .bind(this));
  15904. var r = URL.createObjectURL(i);
  15905. n.src = r
  15906. }
  15907. .bind(this), e)
  15908. }
  15909. .bind(this))
  15910. }
  15911. ,
  15912. l.exports = t
  15913. }
  15914. ).call(this, "/js/tag/Media/Image.js")
  15915. }
  15916. , {
  15917. "../../settings": 166,
  15918. "../../util/logger": 189,
  15919. "./EmbedlyQueue": 127,
  15920. "./MediaEvent": 131,
  15921. events: 202
  15922. }],
  15923. 129: [function(e, t, i) {
  15924. "use strict";
  15925. function n(e) {
  15926. this.label = e.label,
  15927. this.href = e.url,
  15928. this.type = this.updateLinkForType(),
  15929. this.domElement = null,
  15930. this.id = c++
  15931. }
  15932. var r = e("./LinkType")
  15933. , o = e("./MediaEvent")
  15934. , a = e("../../util/browser")
  15935. , s = e("../../analytics")
  15936. , l = e("events").EventEmitter
  15937. , c = 0;
  15938. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  15939. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  15940. return -1 !== this.href.indexOf("port.com/show") || -1 !== this.href.indexOf(window.location.host + "/show") ? -1 !== this.href.indexOf(t) && -1 !== this.href.indexOf("start=") ? (this.href = (e = this.href,
  15941. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  15942. r.NAVIGATION) : (this.href = this.href + "&play=1",
  15943. r.MODEL) : r.EXT_LINK
  15944. }
  15945. ;
  15946. var h = {};
  15947. n.prototype.createDomElement = function() {
  15948. if (this.domElement = document.createElement("a"),
  15949. this.domElement.classList.add("tag-link"),
  15950. this.domElement.textContent = this.label,
  15951. this.type === r.EXT_LINK) {
  15952. this.domElement.textContent += " ";
  15953. var e = document.createElement("i");
  15954. e.classList.add("icon-ext-link"),
  15955. e.title = "Link to external web site",
  15956. this.domElement.appendChild(e)
  15957. }
  15958. return this.domElement.addEventListener("click", function(e) {
  15959. switch (e.stopPropagation(),
  15960. h[this.id] = !0,
  15961. s.trackAlways("click_tag_link", {
  15962. link_type: this.type,
  15963. link_count: c,
  15964. links_clicked: Object.keys(h).length
  15965. }),
  15966. this.type) {
  15967. case r.MODEL:
  15968. window.location.replace(this.href);
  15969. break;
  15970. case r.EXT_LINK:
  15971. window.open(this.href, "_blank")
  15972. }
  15973. this.emit(o.LINK_CLICK, {
  15974. type: this.type,
  15975. url: this.href
  15976. })
  15977. }
  15978. .bind(this)),
  15979. this.domElement
  15980. }
  15981. ,
  15982. t.exports = n
  15983. }
  15984. , {
  15985. "../../analytics": 4,
  15986. "../../util/browser": 182,
  15987. "./LinkType": 130,
  15988. "./MediaEvent": 131,
  15989. events: 202
  15990. }],
  15991. 130: [function(e, t, i) {
  15992. "use strict";
  15993. t.exports = {
  15994. NAVIGATION: "navigation",
  15995. MODEL: "model",
  15996. EXT_LINK: "ext-link"
  15997. }
  15998. }
  15999. , {}],
  16000. 131: [function(e, t, i) {
  16001. "use strict";
  16002. t.exports = Object.freeze({
  16003. LINK_CLICK: "mtmedia.link",
  16004. IMAGE_LOADED: "mtmedia.image.loaded",
  16005. IMAGE_OPENING: "mtmedia.image.opening",
  16006. IMAGE_OPENED: "mtmedia.image.opened",
  16007. IMAGE_CLOSING: "mtmedia.image.closing",
  16008. IMAGE_CLOSED: "mtmedia.image.closed",
  16009. VIDEO_START: "mtmedia.video.start",
  16010. VIDEO_PAUSE: "mtmedia.video.pause",
  16011. VIDEO_ENDED: "mtmedia.video.end"
  16012. })
  16013. }
  16014. , {}],
  16015. 132: [function(e, t, i) {
  16016. "use strict";
  16017. t.exports = Object.freeze({
  16018. maxEmbedWidth: 350,
  16019. defaultAspectRatio: .75
  16020. })
  16021. }
  16022. , {}],
  16023. 133: [function(e, t, i) {
  16024. "use strict";
  16025. t.exports = Object.freeze({
  16026. TEXT: "text",
  16027. LINK: "link",
  16028. IMAGE: "photo",
  16029. VIDEO: "video",
  16030. RICH: "rich"
  16031. })
  16032. }
  16033. , {}],
  16034. 134: [function(e, t, i) {
  16035. "use strict";
  16036. function n(e) {
  16037. this.capabilities = {
  16038. links: {
  16039. enable: e.supportLinks,
  16040. keepLabels: e.keepLinkLabels
  16041. }
  16042. }
  16043. }
  16044. var r = e("./DescriptionChunkType");
  16045. n.prototype.parse = function(e, i) {
  16046. var n = [];
  16047. return e.split("[").map(function(e, t) {
  16048. return 0 === t ? e : "[" + e
  16049. }).forEach(function(e) {
  16050. var t = this.findMarkdown(e);
  16051. if (t) {
  16052. if (-1 !== t.url.indexOf("javascript:"))
  16053. return;
  16054. this.addLinkChunk(n, t, i),
  16055. this.addTextChunk(n, e.slice(t.markdown.length))
  16056. } else
  16057. this.addTextChunk(n, e)
  16058. }
  16059. .bind(this)),
  16060. n
  16061. }
  16062. ,
  16063. n.prototype.findMarkdown = function(e) {
  16064. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16065. if (t) {
  16066. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16067. 0 !== n); )
  16068. r++;
  16069. var o = i.length - r;
  16070. return {
  16071. markdown: t[0].substring(0, t[0].length - o),
  16072. label: t[1],
  16073. url: t[2].substring(0, r)
  16074. }
  16075. }
  16076. }
  16077. ,
  16078. n.prototype.addTextChunk = function(e, t) {
  16079. 0 !== t.length && e.push({
  16080. type: r.TEXT,
  16081. text: t
  16082. })
  16083. }
  16084. ,
  16085. n.prototype.addLinkChunk = function(e, t) {
  16086. if (this.capabilities.links.enable) {
  16087. var i = {
  16088. label: t.label,
  16089. url: t.url
  16090. };
  16091. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16092. e.push({
  16093. type: r.LINK,
  16094. link: i
  16095. })
  16096. } else
  16097. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16098. }
  16099. ,
  16100. t.exports = n
  16101. }
  16102. , {
  16103. "./DescriptionChunkType": 133
  16104. }],
  16105. 135: [function(t, r, e) {
  16106. (function(e) {
  16107. "use strict";
  16108. var i = new (t("../util/logger"))(e)
  16109. , n = {
  16110. parseIdsFromChunkName: function(e, t) {
  16111. t.floorId = n.parseFloor(e),
  16112. t.roomId = n.parseRoom(e)
  16113. },
  16114. parseFloor: function(e) {
  16115. var t = e.match(/_group([0-9]+)/);
  16116. if (!t)
  16117. return 0;
  16118. try {
  16119. return parseInt(t[1], 10)
  16120. } catch (e) {
  16121. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16122. 0
  16123. }
  16124. },
  16125. parseRoom: function(e) {
  16126. var t = e.match(/_sub([0-9]+)/);
  16127. if (!t)
  16128. return -1;
  16129. try {
  16130. return parseInt(t[1], 10)
  16131. } catch (e) {
  16132. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16133. 0
  16134. }
  16135. }
  16136. };
  16137. r.exports = n
  16138. }
  16139. ).call(this, "/js/model/Chunks.js")
  16140. }
  16141. , {
  16142. "../util/logger": 189
  16143. }],
  16144. 136: [function(a, c, e) {
  16145. (function(e) {
  16146. "use strict";
  16147. function t(e) {
  16148. r.call(this),
  16149. this.model = e,
  16150. this.exploded = !1
  16151. }
  16152. var i = a("../objects/Floor")
  16153. , n = (a("../settings"),
  16154. a("../util/logger"))
  16155. , s = a("../util/transitions")
  16156. , r = a("../util/IndexedCollection")
  16157. , o = a("../util/common")
  16158. , l = a("../util/easing");
  16159. new n(e),
  16160. o.inherit(t, r),
  16161. t.prototype.add = function(e) {
  16162. r.prototype.add.call(this, e),
  16163. this.model.add(e)
  16164. }
  16165. ,
  16166. t.prototype.getIndex = function(e) {
  16167. return e.floorIndex
  16168. }
  16169. ,
  16170. t.prototype.build = function() {
  16171. this.list.forEach(function(e) {
  16172. e.build()
  16173. })
  16174. }
  16175. ,
  16176. t.prototype.size = function() {
  16177. return this.length
  16178. }
  16179. ,
  16180. t.prototype.sort = function() {
  16181. r.prototype.sort.call(this, function(e, t) {
  16182. return e.floorIndex - t.floorIndex
  16183. })
  16184. }
  16185. ,
  16186. t.prototype.nextFloor = function(e, t) {
  16187. return this.index[e.floorIndex + t] || null
  16188. }
  16189. ,
  16190. t.prototype.getFloorAtPoint = function(e) {
  16191. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16192. var r = this.list[n]
  16193. , o = r.distanceToPoint(e);
  16194. (!t || o < i) && (i = o,
  16195. t = r)
  16196. }
  16197. return t
  16198. }
  16199. ,
  16200. t.prototype.getOrMakeFloor = function(e) {
  16201. var t = this.index[e];
  16202. return t || (t = new i(this.model,e),
  16203. this.add(t)),
  16204. t
  16205. }
  16206. ,
  16207. t.prototype.hide = function() {
  16208. this.list.forEach(function(e) {
  16209. e.hide()
  16210. })
  16211. }
  16212. ,
  16213. t.prototype.show = function() {
  16214. this.list.forEach(function(e) {
  16215. e.show()
  16216. })
  16217. }
  16218. ,
  16219. t.prototype.names = function() {
  16220. return this.list.reduce(function(e, t) {
  16221. return e.concat(t.name)
  16222. }, [])
  16223. }
  16224. ,
  16225. t.prototype.toggleExplodeHorizontal = function() {
  16226. function i(e, t) {
  16227. a.copy(e.position),
  16228. e.position.x = r[e.floorIndex] * t,
  16229. e.position.y = 1 * e.floorIndex * t,
  16230. a.sub(e.position).multiplyScalar(-1),
  16231. e.panos.forEach(function(e) {
  16232. e.translate(a)
  16233. })
  16234. }
  16235. var n, r = [], o = 0;
  16236. this.list.forEach(function(e, t, i) {
  16237. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16238. o += n,
  16239. r[t] = o
  16240. }),
  16241. r = r.map(function(e) {
  16242. return e - o / 2
  16243. });
  16244. var a = this.list[0].position.clone();
  16245. this.exploded ? this.list.forEach(function(t) {
  16246. s.start(function(e) {
  16247. i(t, 1 - e)
  16248. }, 1500, null, 0, l.easeOutExpo)
  16249. }) : this.list.forEach(function(t) {
  16250. s.start(function(e) {
  16251. i(t, e)
  16252. }, 1500, null, 0, l.easeOutExpo)
  16253. }),
  16254. this.exploded = !this.exploded
  16255. }
  16256. ,
  16257. t.prototype.toggleExplodeVertical = function() {
  16258. function i(e, t) {
  16259. var i = i.copy(e.position);
  16260. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16261. i.sub(e.position).multiplyScalar(-1),
  16262. e.panos.forEach(function(e) {
  16263. e.translate(i)
  16264. })
  16265. }
  16266. var n = this.model.size;
  16267. this.list[0].position.clone(),
  16268. this.exploded ? this.list.forEach(function(t) {
  16269. s.start(function(e) {
  16270. i(t, 1 - e)
  16271. }, 1500, null, 0, l.easeOutExpo)
  16272. }) : this.list.forEach(function(t) {
  16273. s.start(function(e) {
  16274. i(t, e)
  16275. }, 1500, null, 0, l.easeOutExpo)
  16276. }),
  16277. this.exploded = !this.exploded
  16278. }
  16279. ,
  16280. c.exports = t
  16281. }
  16282. ).call(this, "/js/model/FloorCollection.js")
  16283. }
  16284. , {
  16285. "../objects/Floor": 146,
  16286. "../settings": 166,
  16287. "../util/IndexedCollection": 175,
  16288. "../util/common": 185,
  16289. "../util/easing": 186,
  16290. "../util/logger": 189,
  16291. "../util/transitions": 195
  16292. }],
  16293. 137: [function(r, o, e) {
  16294. (function(e) {
  16295. "use strict";
  16296. function h() {
  16297. n.call(this)
  16298. }
  16299. var u = r("../settings")
  16300. , t = r("../util/logger")
  16301. , d = r("../enum/Viewmode")
  16302. , p = r("../objects/Snapshot")
  16303. , i = (r("../util/math"),
  16304. r("../util/common"))
  16305. , n = r("../util/IndexedCollection")
  16306. , l = new t(e);
  16307. i.inherit(h, n),
  16308. h.prototype.getImage = function(e) {
  16309. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16310. }
  16311. ,
  16312. h.prototype.filterByModesAndReel = function(e, t) {
  16313. for (var i = [], n = 0; n < t.length; n += 1) {
  16314. var r = t[n]
  16315. , o = this.index[r.sid];
  16316. o && i.push(o)
  16317. }
  16318. var a = e[d.DOLLHOUSE]
  16319. , s = e[d.FLOORPLAN];
  16320. (i = i.filter(function(e) {
  16321. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16322. return !0;
  16323. var t;
  16324. try {
  16325. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16326. } catch (e) {
  16327. return l.debug(e.message),
  16328. !1
  16329. }
  16330. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16331. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16332. this.list = i,
  16333. this.reIndex()
  16334. }
  16335. ,
  16336. h.prototype.getHeroLocations = function(e) {
  16337. if (0 === this.list.length)
  16338. return [];
  16339. for (var t = [], i = 0; i < this.list.length; ++i) {
  16340. var n = this.list[i]
  16341. , r = n.thumbnail_signed_src
  16342. , o = n.name || "";
  16343. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16344. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16345. var a = e.get(n.metadata.scan_id);
  16346. if (a && !a.isAligned())
  16347. continue
  16348. }
  16349. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16350. if (s === d.MESH)
  16351. continue;
  16352. var l = {
  16353. cameraMode: s,
  16354. position: n.metadata.camera_position,
  16355. quaternion: n.metadata.camera_quaternion,
  16356. zoom: n.metadata.zoom,
  16357. panoId: n.metadata.scan_id,
  16358. orthoZoom: n.metadata.ortho_zoom,
  16359. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16360. thumbUrl: "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime(),
  16361. name: h.filterImageName(o),
  16362. sid: n.sid
  16363. }
  16364. , c = new p(l);
  16365. t.push(c)
  16366. }
  16367. }
  16368. return t
  16369. }
  16370. ,
  16371. h.prototype.getIndex = function(e) {
  16372. return e.sid
  16373. }
  16374. ,
  16375. h.filterImageName = function(e) {
  16376. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16377. }
  16378. ,
  16379. o.exports = h
  16380. }
  16381. ).call(this, "/js/model/ImageCollection.js")
  16382. }
  16383. , {
  16384. "../enum/Viewmode": 51,
  16385. "../objects/Snapshot": 153,
  16386. "../settings": 166,
  16387. "../util/IndexedCollection": 175,
  16388. "../util/common": 185,
  16389. "../util/logger": 189,
  16390. "../util/math": 190
  16391. }],
  16392. 138: [function(h, u, e) {
  16393. (function(e) {
  16394. "use strict";
  16395. function n() {
  16396. c.call(this)
  16397. }
  16398. var r = h("../label/Label")
  16399. , i = h("../settings")
  16400. , t = h("../util/logger")
  16401. , o = h("../util/math")
  16402. , a = h("../util/ajax")
  16403. , s = h("./RoomCollection")
  16404. , l = h("../util/common")
  16405. , c = h("../util/IndexedCollection");
  16406. new t(e),
  16407. l.inherit(n, c),
  16408. n.prototype.getIndex = function(e) {
  16409. return e.labelId
  16410. }
  16411. ,
  16412. n.prototype.associateWithRooms = function(e) {
  16413. this.forEach(function(t) {
  16414. e.forEach(function(e) {
  16415. e.roomId === t.roomId && (t.room = e)
  16416. })
  16417. })
  16418. }
  16419. ,
  16420. n.prototype.createFromLabelData = function(e) {
  16421. e.forEach(function(e) {
  16422. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16423. t = s.generateRoomId(e.floorId, t);
  16424. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16425. i.position = o.convertWorkshopVector(i.position),
  16426. this.add(i),
  16427. i.build()
  16428. }
  16429. .bind(this))
  16430. }
  16431. ,
  16432. n.prototype.load = function(e, t) {
  16433. return a.get(e, {
  16434. responseType: "json",
  16435. auth: t ? i.authorizationHeader : null
  16436. }).done(function(e) {
  16437. var t = [];
  16438. for (var i in e) {
  16439. var n = e[i];
  16440. t.push(n)
  16441. }
  16442. this.createFromLabelData(t)
  16443. }
  16444. .bind(this))
  16445. }
  16446. ,
  16447. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16448. var t = -1;
  16449. if (e) {
  16450. var i = e.split("_");
  16451. t = parseInt(i[0])
  16452. }
  16453. return t
  16454. }
  16455. ,
  16456. u.exports = n
  16457. }
  16458. ).call(this, "/js/model/LabelCollection.js")
  16459. }
  16460. , {
  16461. "../label/Label": 90,
  16462. "../settings": 166,
  16463. "../util/IndexedCollection": 175,
  16464. "../util/ajax": 181,
  16465. "../util/common": 185,
  16466. "../util/logger": 189,
  16467. "../util/math": 190,
  16468. "./RoomCollection": 141
  16469. }],
  16470. 139: [function(P, O, e) {
  16471. (function(e) {
  16472. "use strict";
  16473. function t(e, t) {
  16474. o.Object3D.call(this),
  16475. this.sid = window.number;//t.sid,
  16476. this.data = t,
  16477. this.options = e,
  16478. this.urls = new i(e.urlFiles),
  16479. this.isPublic = void 0 !== t.is_public && t.is_public,
  16480. this.images = new E(this),
  16481. this.images.extend(t.images),
  16482. this.heroImage = this.images.getImage(t.icon),
  16483. this.heroLocations = [],
  16484. this.outdoorPanoLocations = [],
  16485. this.floors = new c(this),
  16486. this.floorsEnabled = void 0 === e.floors || e.floors,
  16487. this.changingFloor = !1,
  16488. this.chunks = [],
  16489. this.panos = new g,
  16490. this.colliders = [],
  16491. this.loadPanosPromise = null,
  16492. this.loadMeshTexturesPromise = null,
  16493. this.auxDataPromise = null,
  16494. this.meshTexturesLoaded = !1,
  16495. this.meshTextures = [],
  16496. this.tags = {},
  16497. this.tagsShown = !1,
  16498. this.shouldShowtags = !1,
  16499. this.has360Views = !1,
  16500. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16501. this.supportedModes = {},
  16502. this.supportedModes[s.PANORAMA] = !0,
  16503. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16504. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16505. this.supportedModes[s.TRANSITIONING] = !0,
  16506. this.supportsTiles = this.configureTiling(),
  16507. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || !0,
  16508. this.mode = s.DOLLHOUSE,
  16509. this.size = null,
  16510. this.center = null,
  16511. this.boundingBox = new o.Box3,
  16512. this.currentFloor = null,
  16513. this.allFloorsVisible = !0,
  16514. this.projectedPano0 = null,
  16515. this.projectedPano1 = null,
  16516. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16517. this.addFloor(new r(this,t,e.trim()))
  16518. }
  16519. .bind(this)),
  16520. this.waitQueue = [],
  16521. this.on("load", function(e) {
  16522. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16523. return !e.isLoadedCallback()
  16524. }),
  16525. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16526. }
  16527. .bind(this)),
  16528. this.setupCustomProperties(),
  16529. this.hots = {}
  16530. }
  16531. var o = P("three")
  16532. , a = P("../util/ajax")
  16533. , i = P("../util/ModelUrls")
  16534. , n = P("../objects/BoundingTextureSkybox")
  16535. , s = P("../enum/Viewmode")
  16536. , l = P("../enum/RenderOrder")
  16537. , r = (P("../enum/AlignmentType"),
  16538. P("../objects/Floor"))
  16539. , c = P("./FloorCollection")
  16540. , h = P("../objects/Chunk")
  16541. , u = (P("../objects/Room"),
  16542. P("../objects/Snapshot"),
  16543. P("../label/Label"),
  16544. P("../util/math"),
  16545. P("../settings"))
  16546. , d = P("../shaders")
  16547. , p = P("../util/logger")
  16548. , f = (P("../tag/tag"),
  16549. P("../tag/tagManager"),
  16550. P("../objects/Panorama"))
  16551. , g = P("../util/PanoramaCollection")
  16552. , m = P("../loaders/ModelLoader")
  16553. , v = P("../loaders/ModelTextureLoader")
  16554. , y = P("../loaders/SweepDataLoader")
  16555. , A = P("../util/transitions")
  16556. , C = (P("../util/easing"),
  16557. P("../util/lerp"),
  16558. P("../util/common"))
  16559. , I = (P("../util/texture"),
  16560. P("./../util/browser"))
  16561. , E = P("./ImageCollection")
  16562. , _ = P("./RoomCollection")
  16563. , b = P("./LabelCollection")
  16564. , w = P("./Chunks")
  16565. , T = P("./../util/showcase")
  16566. , x = P("../exception/BasicException")
  16567. , S = (P("../constants"),
  16568. P("events").EventEmitter)
  16569. , M = P("hot")
  16570. , R = new p(e);
  16571. t.prototype = Object.create(o.Object3D.prototype),
  16572. C.extend(t, S),
  16573. t.prototype.setupCustomProperties = function() {
  16574. var t = u.modelAlpha;
  16575. Object.defineProperty(this, "alpha", {
  16576. get: function() {
  16577. return t
  16578. },
  16579. set: function(e) {
  16580. t = e,
  16581. this.chunks.forEach(function(e) {
  16582. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16583. })
  16584. }
  16585. })
  16586. }
  16587. ,
  16588. t.prototype.configureTiling = function() {
  16589. var e = function() {
  16590. try {
  16591. var e = document.createElement("canvas")
  16592. , t = e.getContext("webgl");
  16593. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16594. } catch (e) {
  16595. return 0
  16596. }
  16597. }();
  16598. if (e < 2048)
  16599. return !1;
  16600. R.warn("Max cube texture size: " + e);
  16601. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16602. var i = u.tiling.tilingFlagNames[t];
  16603. if ("1" === I.valueFromHash(i, null))
  16604. return !0;
  16605. if ("0" === I.valueFromHash(i, null))
  16606. return !1
  16607. }
  16608. return !!T.modelDataPromisesTiles(this.data)
  16609. }
  16610. ,
  16611. t.prototype.toggleAlpha = function() {
  16612. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16613. }
  16614. ,
  16615. t.prototype.load = function(e) {
  16616. var t = this.urls.init().then(function() {
  16617. return $.when(this.loadPanos(), this.loadMesh())
  16618. }
  16619. .bind(this));
  16620. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16621. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16622. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16623. }
  16624. ,
  16625. t.prototype.loadMesh = function() {
  16626. var n = $.Deferred()
  16627. , r = this;
  16628. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16629. if (0 === e.length) {
  16630. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16631. r.supportedModes[s.DOLLHOUSE] = !1,
  16632. r.supportedModes[s.FLOORPLAN] = !1;
  16633. var i = new h({
  16634. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16635. });
  16636. i.material.visible = !1,
  16637. i.rotateX(-Math.PI / 2),
  16638. i.geometry.computeBoundingBox(),
  16639. e = [i]
  16640. }
  16641. e.forEach(function(e) {
  16642. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16643. r.addChunk(t, e)
  16644. }),
  16645. r.floors.sort(),
  16646. n.resolve(r)
  16647. }, function(e, t) {
  16648. n.notify(e, t)
  16649. }, function(e) {
  16650. R.error(e),
  16651. n.reject("loading-failed")
  16652. }),
  16653. n.promise()
  16654. }
  16655. ,
  16656. t.prototype.loadMeshTextures = function() {
  16657. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16658. this.meshTexturesLoaded = !0
  16659. }
  16660. .bind(this))),
  16661. this.loadTexturesPromise
  16662. }
  16663. ,
  16664. t.prototype.shineHots = function() {
  16665. A.trigger({
  16666. func: function(e) {
  16667. var opa = e <= .5 ? 2 * e : -2 * e + 2
  16668. for(var i in this.hots){
  16669. this.hots[i].mesh.material.uniforms.opac.value = opa;
  16670. }
  16671. }
  16672. .bind(this),
  16673. cycling: !0,
  16674. duration: 3e3,
  16675. name: "hotShine"
  16676. })
  16677. }
  16678. ,
  16679. t.prototype.createHotItem = function(e, t) {
  16680. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  16681. var o = document.createElement("li")
  16682. , a = document.createElement("span");
  16683. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute.title || "热点",
  16684. o.hot = t[n[r]],
  16685. o.appendChild(a),
  16686. i.appendChild(o)
  16687. }
  16688. document.querySelector("#hotListContent ul").appendChild(i),
  16689. console.log(i)
  16690. }
  16691. ,
  16692. t.prototype.loadOverlays = function(overlays){
  16693. var overlays = window.data2 && window.data2.overlays /* ||
  16694. [
  16695. { depth: 0.02,
  16696. file: "https://super.4dage.com/data/TEST/overlay/b6fe7cb6bd2b6.mp4",
  16697. hasBox: 0,
  16698. height: 0.8165,
  16699. media: ["video"],
  16700. pos: [-4.3132, 0.6788, -13.5162],
  16701. qua: [0, 0.9396, 0, 0.3421],
  16702. sid: "1591079418827",
  16703. width: 0.6124
  16704. }] */
  16705. overlays && overlays.forEach((info)=>{
  16706. new Overlay(info)
  16707. })
  16708. }
  16709. ,
  16710. t.prototype.loadhots = function() {
  16711. var r = $.Deferred()
  16712. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16713. return a.get(e, {
  16714. responseType: "json",
  16715. auth: this.isPublic ? null : u.authorizationHeader
  16716. }).done(function(e) {
  16717. window.data2 = e;
  16718. if(!e){
  16719. console.error("data2 is null")
  16720. }else{
  16721. g_data2 = hotMatcher(e)
  16722. this.hotsCount = 0
  16723. for (var t in e.hots){
  16724. this.hotsCount++,
  16725. this.hots[t] = new M(t,e.hots[t],this);
  16726. e.hots[t].infoAttribute || (e.hots[t].infoAttribute = {})
  16727. this.hots[t].initStyleImg(e.hots[t].infoAttribute);
  16728. }
  16729. window.hotData = e.hots
  16730. e.hots && this.createHotItem(e.hots, this.hots);
  16731. g_index = I.valueFromHash("m"),
  16732. e.tourAudio && (g_tourAudio = new Audio,
  16733. g_tourAudio.loop = !1,
  16734. g_tourAudio.addEventListener("ended", function() {
  16735. var e = document.createEvent("MouseEvent");
  16736. e.initEvent("tourAudioEnded", !0, !0),
  16737. window.dispatchEvent(e)
  16738. }));
  16739. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16740. //window.wx && manage.weixinShare(),
  16741. }
  16742. /* var i = $.Deferred()
  16743. , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  16744. a.get(n, {
  16745. responseType: "json",
  16746. auth: this.isPublic ? null : u.authorizationHeader
  16747. }).done(function(e) {
  16748. window.hotData = e,
  16749. this.createHotItem(e, this.hots);
  16750. for(let i in this.hots){
  16751. e[i] && this.hots[i].initStyleImg(e[i]);
  16752. }
  16753. i.resolve()
  16754. }
  16755. .bind(this)).fail(function() {
  16756. console.log("Data.js is empty");
  16757. i.resolve()
  16758. }),
  16759. */
  16760. r.resolve()
  16761. }
  16762. .bind(this)).fail(function() {
  16763. console.log("没有热点"),
  16764. //window.wx && manage.weixinShare(),
  16765. r.resolve()
  16766. }),
  16767. r
  16768. }
  16769. ,
  16770. t.prototype.loadPanos = function() {
  16771. if (this.loadPanosPromise)
  16772. return this.loadPanosPromise;
  16773. var e = new y(this);
  16774. return this.loadPanosPromise = e.load().then(function(e) {
  16775. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16776. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16777. else console.log(e.uuid)
  16778. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16779. }
  16780. .bind(this))),
  16781. this.panos.extend(e.map(function(e) {
  16782. return new f(this,e.uuid,e,this.supportsTiles)
  16783. }
  16784. .bind(this))),
  16785. this.panos.forEach(function(i) {
  16786. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16787. var t = this.panos.get(e);
  16788. t && this.panos.setNeighbour(i, t, !0)
  16789. }
  16790. .bind(this)),
  16791. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16792. }
  16793. .bind(this)),
  16794. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16795. this.supportedModes[s.PANORAMA] = !1),
  16796. $.when(this)
  16797. }
  16798. .bind(this)),
  16799. this.loadPanosPromise
  16800. }
  16801. ,
  16802. t.prototype.loadHighlightReel = function() {
  16803. var t = $.Deferred()
  16804. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16805. return a.get(e, {
  16806. responseType: "json",
  16807. auth: this.isPublic ? null : u.authorizationHeader
  16808. }).done(function(e) {
  16809. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16810. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16811. t.resolve()
  16812. }
  16813. .bind(this)).fail(function() {
  16814. R.warn("Getting highlight reel failed, no highlights available"),
  16815. t.resolve()
  16816. }),
  16817. t
  16818. }
  16819. ,
  16820. t.prototype.waitForLoad = function(e, t) {
  16821. t() || (this.waitQueue.push({
  16822. object: e,
  16823. isLoadedCallback: t
  16824. }),
  16825. 1 === this.waitQueue.length && this.emit("waiting"))
  16826. }
  16827. ,
  16828. t.prototype.hide = function() {
  16829. this.floors.hide()
  16830. }
  16831. ,
  16832. t.prototype.show = function() {
  16833. this.floors.show()
  16834. }
  16835. ,
  16836. t.prototype.floorNames = function() {
  16837. return this.floors.names()
  16838. }
  16839. ,
  16840. t.prototype.warpDestFloors = function(e, t) {
  16841. if (e && this.floors.length === e.length) {
  16842. var i = e.findIndex(function(e) {
  16843. return e
  16844. }
  16845. .bind(this));
  16846. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16847. } else
  16848. this.toggleAllFloors(!0)
  16849. }
  16850. ,
  16851. t.prototype.setFloor = function(e, t, i) {
  16852. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16853. this.allFloorsVisible = !1,
  16854. this._setFloor(e, t, i)
  16855. }
  16856. ,
  16857. t.prototype.toggleAllFloors = function(e) {
  16858. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16859. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16860. this._setFloor(this.currentFloor)
  16861. }
  16862. ,
  16863. t.prototype._setFloor = function(e, t, i) {
  16864. var n;
  16865. if (t = t || this.mode,
  16866. this.emit("floor.changed", e, t, this.currentFloor),
  16867. this.currentFloor = e,
  16868. t === s.PANORAMA) {
  16869. if (this.show(),
  16870. this.shouldShowtags && this.tagsShown)
  16871. for (n in this.tags)
  16872. this.tags[n].show(u.showFloorDuration)
  16873. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16874. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16875. }
  16876. .bind(this)),
  16877. this.shouldShowtags && this.tagsShown))
  16878. for (n in this.tags) {
  16879. var r = this.tags[n];
  16880. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16881. }
  16882. var o = this
  16883. , a = e;
  16884. A.start(function() {}, u.showFloorDelay, function() {
  16885. o.floors.forEach(function(t) {
  16886. t.chunks.forEach(function(e) {
  16887. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16888. })
  16889. })
  16890. }
  16891. .bind(this))
  16892. }
  16893. ,
  16894. t.prototype.toggleExplode = function() {
  16895. this.floors.toggleExplodeHorizontal()
  16896. }
  16897. ,
  16898. t.prototype.toggleExplodeUp = function() {
  16899. this.floors.toggleExplodeVertical()
  16900. }
  16901. ,
  16902. t.prototype.nextFloor = function(e) {
  16903. return this.floors.nextFloor(this.currentFloor, e)
  16904. }
  16905. ,
  16906. t.prototype.addFloor = function(e) {
  16907. this.floors.add(e)
  16908. }
  16909. ,
  16910. t.prototype.getFloorAtPoint = function(e) {
  16911. return this.floors.getFloorAtPoint(e)
  16912. }
  16913. ,
  16914. t.prototype.getTagBySid = function(e) {
  16915. return this.tags[e]
  16916. }
  16917. ,
  16918. t.prototype.addChunk = function(e, t) {
  16919. this.floors.getOrMakeFloor(e).addChunk(t),
  16920. this.chunks.push(t)
  16921. }
  16922. ,
  16923. t.prototype.setMode = function(t) {
  16924. if (!this.supportedModes[t])
  16925. throw new x("Mode not supported for this model: " + t);
  16926. this.mode = t
  16927. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  16928. this.chunks.forEach(function(e) {
  16929. e.setMode(t)
  16930. })
  16931. }
  16932. ,
  16933. t.prototype.build = function() {
  16934. this.heroLocations = this.images.getHeroLocations(this.panos);
  16935. var e = function() {
  16936. 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()
  16937. }
  16938. .bind(this)();
  16939. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  16940. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  16941. }
  16942. .bind(this)) || e,
  16943. null === this.heroImage && R.warn("No hero image defined."),
  16944. this.currentFloor = this.floors.last(),
  16945. this.floors.build(),
  16946. this.colliders = this.floors.reduce(function(e, t) {
  16947. return e.concat(t.collider.children)
  16948. }, []),
  16949. this.panos.forEach(function(e) {
  16950. e.build1(),
  16951. e.on("enter", function() {
  16952. e.floor !== this.currentFloor && this.setFloor(e.floor)
  16953. }
  16954. .bind(this))
  16955. }
  16956. .bind(this)),
  16957. this.panos.forEach(function(e) {
  16958. e.build2()
  16959. }),
  16960. this.floors.forEach(function(e) {
  16961. this.boundingBox.union(e.boundingBox)
  16962. }
  16963. .bind(this)),
  16964. this.size = this.boundingBox.size(),
  16965. this.center = this.boundingBox.center(),
  16966. this.floors.forEach(function(e) {
  16967. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  16968. }
  16969. .bind(this)),
  16970. this.panos.populate_path_graph(),
  16971. this.skybox = new n(this.boundingBox),
  16972. this.skybox.matrixWorldNeedsUpdate = !0,
  16973. this.add(this.skybox),
  16974. setTimeout(function() {
  16975. this.hotsCount && this.shineHots()
  16976. }
  16977. .bind(this), 1300),
  16978. this.tags)
  16979. this.tags[t].build();
  16980. return R.debug("Done building model"),
  16981. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  16982. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  16983. this.buildRooms(),
  16984. this.labels.associateWithRooms(this.rooms),
  16985. $.when(this)
  16986. }
  16987. ,
  16988. t.prototype.loadLabels = function() {
  16989. this.labels = new b(this);
  16990. var e = $.Deferred();
  16991. /* if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0),
  16992. !this.showingLabels) */
  16993. return e.resolve();
  16994. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  16995. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  16996. R.warn("Getting labels failed, not displaying labels."),
  16997. e.resolve()
  16998. }),
  16999. e
  17000. }
  17001. ,
  17002. t.prototype.buildRooms = function() {
  17003. this.rooms = new _(this),
  17004. this.rooms.createFromChunks(this.chunks),
  17005. this.rooms.calcRoomBoundaries()
  17006. }
  17007. ,
  17008. t.prototype.updateProjectedPanos = function() {
  17009. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17010. }
  17011. ,
  17012. t.prototype.setProjectedPanos = function(t, i, n) {
  17013. null != n || (n = !0),
  17014. n = !!n,
  17015. this.projectedPano0 = t,
  17016. this.projectedPano1 = i,
  17017. this.skybox.material.setProjectedPanos(t, i, n),
  17018. this.chunks.forEach(function(e) {
  17019. e.materialInside.setProjectedPanos(t, i, n)
  17020. })
  17021. }
  17022. ,
  17023. t.prototype.setSide = function(t) {
  17024. this.floors.forEach(function(e) {
  17025. e.collider.material.side = t
  17026. })
  17027. }
  17028. ,
  17029. t.prototype.heroCount = function() {
  17030. return this.heroLocations ? this.heroLocations.length : 0
  17031. }
  17032. ,
  17033. t.prototype.getHeroDescriptorByIndex = function(e) {
  17034. if (e < 0)
  17035. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17036. null;
  17037. if (this.heroCount() < 1)
  17038. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17039. null;
  17040. var t = this.heroLocations[e];
  17041. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17042. null) : t
  17043. }
  17044. ,
  17045. t.prototype.findPanoramicHero = function() {
  17046. for (var e in this.heroLocations)
  17047. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17048. return this.heroLocations[e];
  17049. return null
  17050. }
  17051. ,
  17052. t.prototype.listImagePanos = function() {
  17053. var i = []
  17054. , n = this;
  17055. return this.images.forEach(function(e) {
  17056. if (e.metadata && e.metadata.scan_id) {
  17057. var t = n.panos.get(e.metadata.scan_id);
  17058. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17059. }
  17060. }),
  17061. i
  17062. }
  17063. ,
  17064. t.prototype.fadePanoMarkers = function(e, t) {
  17065. this.panos.fadeMarkerOpacity(e, t)
  17066. }
  17067. ,
  17068. t.prototype.setSweepVisibility = function(t) {
  17069. this.panos.forEach(function(e) {
  17070. e.marker && (e.marker.visible = t)
  17071. })
  17072. }
  17073. ,
  17074. t.prototype.outsideAllowed = function() {
  17075. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17076. }
  17077. ,
  17078. O.exports = t
  17079. }
  17080. ).call(this, "/js/model/Model.js")
  17081. }
  17082. , {
  17083. "../constants": 8,
  17084. "../enum/AlignmentType": 17,
  17085. "../enum/RenderOrder": 42,
  17086. "../enum/Viewmode": 51,
  17087. "../exception/BasicException": 55,
  17088. "../label/Label": 90,
  17089. "../loaders/ModelLoader": 105,
  17090. "../loaders/ModelTextureLoader": 106,
  17091. "../loaders/SweepDataLoader": 107,
  17092. "../tag/tag": 123,
  17093. "../tag/tagManager": 124,
  17094. "../objects/BoundingTextureSkybox": 143,
  17095. "../objects/Chunk": 144,
  17096. "../objects/Floor": 146,
  17097. "../objects/Panorama": 148,
  17098. "../objects/Room": 150,
  17099. "../objects/Snapshot": 153,
  17100. "../settings": 166,
  17101. "../shaders": 167,
  17102. "../util/ModelUrls": 177,
  17103. "../util/PanoramaCollection": 178,
  17104. "../util/ajax": 181,
  17105. "../util/common": 185,
  17106. "../util/easing": 186,
  17107. "../util/lerp": 188,
  17108. "../util/logger": 189,
  17109. "../util/math": 190,
  17110. "../util/texture": 194,
  17111. "../util/transitions": 195,
  17112. "./../util/browser": 182,
  17113. "./../util/showcase": 193,
  17114. "./Chunks": 135,
  17115. "./FloorCollection": 136,
  17116. "./ImageCollection": 137,
  17117. "./LabelCollection": 138,
  17118. "./RoomCollection": 141,
  17119. events: 202,
  17120. three: 217,
  17121. hot: "hot"
  17122. }],
  17123. 140: [function(e, t, i) {
  17124. "use strict";
  17125. function n() {
  17126. this.modelMap = {},
  17127. this.activeModel = null,
  17128. this.modelCount = 0,
  17129. this.tileDownloader = null,
  17130. this.panoRenderer = null
  17131. }
  17132. var r = (e("three"),
  17133. e("../util/common"))
  17134. , o = e("../exception/BasicException")
  17135. , a = e("../enum/ModelManagerEvents")
  17136. , s = e("../enum/PanoRendererEvents")
  17137. , l = e("events").EventEmitter;
  17138. n.prototype.init = function(e, t, i) {
  17139. this.tileDownloader = e,
  17140. this.panoRenderer = t,
  17141. this.qualityManager = i,
  17142. this.bindEvents()
  17143. }
  17144. ,
  17145. n.prototype.bindEvents = function() {
  17146. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17147. }
  17148. ,
  17149. n.prototype.onTileRendered = function(e, t, i, n) {}
  17150. ,
  17151. n.prototype.addModel = function(e) {
  17152. this.modelMap[e.sid] = e,
  17153. 0 === this.modelCount && this.activateModel(e.sid),
  17154. this.modelCount++,
  17155. this.emit(a.ModelAdded)
  17156. }
  17157. ,
  17158. n.prototype.getModel = function(e) {
  17159. return this.modelMap[e]
  17160. }
  17161. ,
  17162. n.prototype.activateModel = function(e) {
  17163. var t = this.modelMap[e];
  17164. if (!t)
  17165. throw new o("Tried to activate invalid model!");
  17166. var i = this.activeModel;
  17167. this.activeModel = t,
  17168. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17169. this.tileDownloader.setUrls(t.urls),
  17170. t.panos.forEach(function(e) {
  17171. e.attachToPanoRenderer(this.panoRenderer),
  17172. e.tileDownloader = this.tileDownloader,
  17173. e.qualityManager = this.qualityManager
  17174. }
  17175. .bind(this)),
  17176. this.emit(a.ActiveModelChanged, {
  17177. oldModel: i,
  17178. model: t
  17179. })
  17180. }
  17181. ,
  17182. n.prototype.getActiveModel = function() {
  17183. return this.activeModel
  17184. }
  17185. ,
  17186. r.extend(n, l),
  17187. t.exports = n
  17188. }
  17189. , {
  17190. "../enum/ModelManagerEvents": 33,
  17191. "../enum/PanoRendererEvents": 35,
  17192. "../exception/BasicException": 55,
  17193. "../util/common": 185,
  17194. events: 202,
  17195. three: 217
  17196. }],
  17197. 141: [function(r, l, e) {
  17198. (function(e) {
  17199. "use strict";
  17200. function o() {
  17201. n.call(this)
  17202. }
  17203. var a = r("../objects/Room")
  17204. , t = (r("../settings"),
  17205. r("../util/logger"))
  17206. , i = (r("../util/transitions"),
  17207. r("../util/easing"),
  17208. r("../util/common"))
  17209. , n = r("../util/IndexedCollection")
  17210. , s = r("./Chunks");
  17211. new t(e),
  17212. i.inherit(o, n),
  17213. o.prototype.getIndex = function(e) {
  17214. return e.roomId
  17215. }
  17216. ,
  17217. o.prototype.calcRoomBoundaries = function() {
  17218. this.forEach(function(e) {
  17219. e.calcBoundaries()
  17220. })
  17221. }
  17222. ,
  17223. o.prototype.createFromChunks = function(e) {
  17224. var n = {
  17225. floorId: -1,
  17226. roomId: -1
  17227. }
  17228. , r = {};
  17229. e.forEach(function(e) {
  17230. s.parseIdsFromChunkName(e.name, n);
  17231. var t = r[n.roomId];
  17232. if (!t) {
  17233. var i = o.generateRoomId(n.floorId, n.roomId);
  17234. t = new a(n.floorId,i),
  17235. this.add(t),
  17236. r[n.roomId] = t
  17237. }
  17238. t.addChunk(e)
  17239. }
  17240. .bind(this)),
  17241. this.calcRoomBoundaries()
  17242. }
  17243. ,
  17244. o.generateRoomId = function(e, t) {
  17245. return e + "_" + t
  17246. }
  17247. ,
  17248. l.exports = o
  17249. }
  17250. ).call(this, "/js/model/RoomCollection.js")
  17251. }
  17252. , {
  17253. "../objects/Room": 150,
  17254. "../settings": 166,
  17255. "../util/IndexedCollection": 175,
  17256. "../util/common": 185,
  17257. "../util/easing": 186,
  17258. "../util/logger": 189,
  17259. "../util/transitions": 195,
  17260. "./Chunks": 135
  17261. }],
  17262. 142: [function(e, t, i) {
  17263. "use strict";
  17264. function n(e, t, i) {
  17265. var n = (e = e.clone().expandByScalar(0.01)).size()
  17266. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17267. r.boundingBox = e,
  17268. o.Mesh.call(this, r, t),
  17269. this.position.copy(e.center()),
  17270. this.frustumCulled = !1,
  17271. i && this.add(new o.WireframeHelper(this))
  17272. }
  17273. var o = e("three");
  17274. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17275. t.exports = n
  17276. }
  17277. , {
  17278. three: 217
  17279. }],
  17280. 143: [function(l, c, e) {
  17281. (function(e) {
  17282. "use strict";
  17283. function t(e) {
  17284. s.time("Computing a nice bounding cubemap");
  17285. var t = new r({
  17286. side: i.BackSide,
  17287. transparent: !0
  17288. });
  17289. t.uniforms.modelAlpha.value = 0,
  17290. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17291. this.renderOrder = a.boundingSkybox,
  17292. n.call(this, e, t),
  17293. s.timeEnd("Computing a nice bounding cubemap")
  17294. }
  17295. var i = l("three")
  17296. , n = (l("../enum/Viewmode"),
  17297. l("../shaders"),
  17298. l("./BoundingMesh"))
  17299. , r = l("../materials/ModelTextureMaterial")
  17300. , o = l("../settings")
  17301. , a = l("../enum/RenderOrder")
  17302. , s = new (l("../util/logger"))(e);
  17303. (t.prototype = Object.create(n.prototype)).constructor = t,
  17304. c.exports = t
  17305. }
  17306. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17307. }
  17308. , {
  17309. "../enum/RenderOrder": 42,
  17310. "../enum/Viewmode": 51,
  17311. "../materials/ModelTextureMaterial": 118,
  17312. "../settings": 166,
  17313. "../shaders": 167,
  17314. "../util/logger": 189,
  17315. "./BoundingMesh": 142,
  17316. three: 217
  17317. }],
  17318. 144: [function(e, t, i) {
  17319. "use strict";
  17320. function n(e) {
  17321. this.materialInside = new s({
  17322. side: r.DoubleSide
  17323. });
  17324. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17325. this.materialOutside = new r.RawShaderMaterial({
  17326. fragmentShader: o.modelOutside.fragmentShader,
  17327. vertexShader: o.modelOutside.vertexShader,
  17328. uniforms: t,
  17329. side: r.FrontSide,
  17330. name: "chunkOut"
  17331. }),
  17332. r.Mesh.call(this, e.geometry, this.materialInside),
  17333. this.name = e.name || "",
  17334. this.textureName = e.textureName,
  17335. this.meshUrl = e.meshUrl
  17336. }
  17337. var r = e("three")
  17338. , o = e("../shaders")
  17339. , a = e("../enum/Viewmode")
  17340. , s = e("../materials/ModelTextureMaterial");
  17341. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17342. this.materialInside.uniforms.map.value = e,
  17343. this.materialOutside.uniforms.map.value = e
  17344. }
  17345. ,
  17346. n.prototype.setMode = function(e) {
  17347. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17348. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17349. t.transparent = this.material.transparent,
  17350. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17351. this.material = t
  17352. }
  17353. ,
  17354. t.exports = n
  17355. }
  17356. , {
  17357. "../enum/Viewmode": 51,
  17358. "../materials/ModelTextureMaterial": 118,
  17359. "../shaders": 167,
  17360. three: 217
  17361. }],
  17362. 145: [function(e, t, i) {
  17363. "use strict";
  17364. function n(e) {
  17365. this.chunksize = e || 10,
  17366. this.chunks = {},
  17367. this.boundingBoxes = {},
  17368. this.children = [],
  17369. this.offset = new m.Vector3(0,.5,0),
  17370. this.material = new m.MeshBasicMaterial({
  17371. color: 16777215 * Math.random(),
  17372. side: m.DoubleSide
  17373. })
  17374. }
  17375. var m = e("three");
  17376. e("../enum/Viewmode"),
  17377. n.prototype.add = function(e) {
  17378. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17379. u ? (t = u.position.array,
  17380. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17381. e.faces);
  17382. var d = new m.Vector3;
  17383. if (i)
  17384. for (n = 0,
  17385. r = i.length; n < r; n += 3) {
  17386. var p = 3 * i[n]
  17387. , f = 3 * i[n + 1]
  17388. , g = 3 * i[n + 2];
  17389. o = (t[p] + t[f] + t[g]) / 3,
  17390. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17391. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17392. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17393. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17394. this.boundingBoxes[l] = new m.Box3),
  17395. h.push(t[p], t[1 + p], t[2 + p], t[f], t[1 + f], t[2 + f], t[g], t[1 + g], t[2 + g]),
  17396. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17397. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17398. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17399. }
  17400. else
  17401. for (n = 0,
  17402. r = t.length; n < r; n += 9)
  17403. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17404. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17405. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17406. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17407. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17408. this.boundingBoxes[l] = new m.Box3),
  17409. h.push(t[n], t[n + 1], t[n + 2], t[n + 3], t[n + 4], t[n + 5], t[n + 6], t[n + 7], t[n + 8]),
  17410. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17411. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17412. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17413. }
  17414. ,
  17415. n.prototype.build = function() {
  17416. var e = new m.Object3D;
  17417. for (var t in e.material = this.material,
  17418. this.chunks) {
  17419. var i = this.chunks[t]
  17420. , n = new m.BufferGeometry;
  17421. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17422. n.boundingBox = this.boundingBoxes[t];
  17423. var r = new m.Mesh(n,this.material);
  17424. r.material.visible = !1,
  17425. e.add(r),
  17426. this.chunks[t] = []
  17427. }
  17428. return e
  17429. }
  17430. ,
  17431. t.exports = n
  17432. }
  17433. , {
  17434. "../enum/Viewmode": 51,
  17435. three: 217
  17436. }],
  17437. 146: [function(e, t, i) {
  17438. "use strict";
  17439. var n = e("three")
  17440. , r = e("../settings")
  17441. , o = e("../util/common")
  17442. , a = e("../util/lerp")
  17443. , s = e("./ChunkedCollider")
  17444. , l = e("../util/transitions")
  17445. , c = e("../util/easing")
  17446. , h = (e("../objects/Panorama"),
  17447. e("../enum/RenderOrder"));
  17448. e("../localization/localize");
  17449. function u(e, t, i) {
  17450. n.Object3D.call(this),
  17451. this.model = e,
  17452. this.floorIndex = t,
  17453. this.lang = r.languageTag,
  17454. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17455. this.panos = [],
  17456. this.chunks = [],
  17457. this.colliderBuilder = new s(3),
  17458. this.collider = null,
  17459. this.center = null,
  17460. this.boundingBox = new n.Box3,
  17461. this.size = null,
  17462. this.hidden = !1,
  17463. this.conservativeBoundingBox = new n.Box3,
  17464. this.debugColor = 16777215 * Math.random(),
  17465. this.transition = null
  17466. }
  17467. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17468. this.model.setFloor(this, e)
  17469. }
  17470. ,
  17471. u.prototype.hide = function(e) {
  17472. if (!this.hidden || this.transition) {
  17473. this.chunks.forEach(function(e) {
  17474. e.material.transparent = !0
  17475. }),
  17476. l.cancel(this.transition);
  17477. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17478. , i = e ? 0 : r.hideFloorDelay / t;
  17479. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17480. this.hidden = !0
  17481. }
  17482. .bind(this), i, c.easeInOutQuad)
  17483. }
  17484. }
  17485. ,
  17486. u.prototype.show = function(e) {
  17487. if (this.hidden || this.transition) {
  17488. this.hidden = !1,
  17489. l.cancel(this.transition);
  17490. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17491. , i = e ? 0 : r.showFloorDelay / t;
  17492. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17493. this.hidden || this.chunks.forEach(function(e) {
  17494. e.material.transparent = !1
  17495. })
  17496. }
  17497. .bind(this), i, c.easeInOutQuad)
  17498. }
  17499. }
  17500. ,
  17501. u.prototype.toggle = function(e, t) {
  17502. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17503. }
  17504. ,
  17505. u.prototype.containsPoint = function(t) {
  17506. return this.collider.children.some(function(e) {
  17507. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17508. e.geometry.boundingBox.containsPoint(t)
  17509. })
  17510. }
  17511. ,
  17512. u.prototype.distanceToPoint = function(i) {
  17513. var n = null
  17514. , r = 1 / 0;
  17515. return this.collider.children.forEach(function(e) {
  17516. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17517. var t = e.geometry.boundingBox.distanceToPoint(i);
  17518. (!n || t < r) && (r = t,
  17519. n = e)
  17520. }),
  17521. r
  17522. }
  17523. ,
  17524. u.prototype.addChunk = function(e) {
  17525. e.renderOrder = h.ghostFloor,
  17526. this.add(e),
  17527. this.chunks.push(e),
  17528. this.boundingBox.union(e.geometry.boundingBox),
  17529. this.size = this.boundingBox.size(),
  17530. this.colliderBuilder.add(e.geometry)
  17531. }
  17532. ,
  17533. u.prototype.addPano = function(e) {
  17534. this.panos.push(e),
  17535. this.add(e.skyboxMesh),
  17536. e.marker && this.add(e.marker);
  17537. var t = new n.Vector3(1,1,1)
  17538. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17539. this.boundingBox.union(i)
  17540. }
  17541. ,
  17542. u.prototype.build = function() {
  17543. this.collider = this.colliderBuilder.build(!0),
  17544. this.add(this.collider),
  17545. this.center = this.boundingBox.center(),
  17546. this.conservativeBoundingBox.copy(this.boundingBox),
  17547. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17548. return e.geometry.boundingBox.min.y
  17549. }), 5),
  17550. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17551. return e.geometry.boundingBox.max.y
  17552. }), 5),
  17553. this.colliderBuilder = null
  17554. }
  17555. ,
  17556. u.prototype.toShortString = function() {
  17557. return o.nth(this.floorIndex + 1)
  17558. }
  17559. ,
  17560. u.prototype.toString = function() {
  17561. return this.name
  17562. }
  17563. ,
  17564. t.exports = u
  17565. }
  17566. , {
  17567. "../enum/RenderOrder": 42,
  17568. "../localization/localize": 108,
  17569. "./strings-cn-CN": 109,
  17570. "../objects/Panorama": 148,
  17571. "../settings": 166,
  17572. "../util/common": 185,
  17573. "../util/easing": 186,
  17574. "../util/lerp": 188,
  17575. "../util/transitions": 195,
  17576. "./ChunkedCollider": 145,
  17577. three: 217
  17578. }],
  17579. 147: [function(e, t, i) {
  17580. "use strict";
  17581. function n(e) {
  17582. this.player = e,
  17583. this.obj3d = null,
  17584. this.UP = new u.Vector3(0,1,0)
  17585. }
  17586. var u = e("three")
  17587. , d = e("../settings");
  17588. n.prototype.prefs = {
  17589. linewidth: 3,
  17590. height: .07,
  17591. opacity: .45,
  17592. endScale: .05
  17593. },
  17594. n.prototype.discard = function() {
  17595. if (this.obj3d) {
  17596. var e = this.obj3d.parent;
  17597. e && e.remove(this.obj3d)
  17598. }
  17599. this.obj3d = null
  17600. }
  17601. ,
  17602. n.prototype.draw = function() {
  17603. if (this.discard(),
  17604. d.showNeighbors) {
  17605. var e = this.player.currentPano.floor;
  17606. this.obj3d = new u.Object3D;
  17607. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17608. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17609. i.y += this.prefs.height;
  17610. var n = .1525
  17611. , r = new u.Matrix4;
  17612. for (var o in t)
  17613. if (t[o]) {
  17614. var a = this.player.model.panos.get(o)
  17615. , s = (a.position.clone().sub(this.player.model.position),
  17616. a.position.clone().sub(a.floorPosition))
  17617. , l = a.floorPosition.clone().sub(this.player.model.position);
  17618. l.y += this.prefs.height;
  17619. var c = new u.Geometry;
  17620. c.vertices.push(new u.Vector3(0,-.0127,0), new u.Vector3(-.0127,0,0), new u.Vector3(0,.0127,0), new u.Vector3(.0127,0,0), new u.Vector3(0,-.0127,0)),
  17621. c.vertices.push(new u.Vector3(0,-.255,0), new u.Vector3(.255,-.255,0), new u.Vector3(.255,n,0), new u.Vector3(-n,n,0), new u.Vector3(-n,.127,0), new u.Vector3(-.19,.1,0), new u.Vector3(-.19,-.2032,0), new u.Vector3(-n,-.2286,0), new u.Vector3(-n,-.255,0), new u.Vector3(0,-.255,0)),
  17622. r.identity().setPosition(s),
  17623. c.applyMatrix(r),
  17624. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17625. c.vertices.push(new u.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new u.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  17626. r.lookAt(l, i, this.UP).setPosition(l),
  17627. c.applyMatrix(r),
  17628. c.vertices.push(l, i);
  17629. var h = new u.Line(c,new u.LineBasicMaterial({
  17630. color: a.debugColor.getHex(),
  17631. transparent: !0,
  17632. opacity: this.prefs.opacity,
  17633. depthWrite: !1,
  17634. name: "sLine" + o,
  17635. linewidth: this.prefs.linewidth
  17636. }));
  17637. this.obj3d.add(h)
  17638. }
  17639. e.add(this.obj3d)
  17640. }
  17641. }
  17642. ,
  17643. n.prototype.update = function() {
  17644. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17645. }
  17646. ,
  17647. t.exports = n
  17648. }
  17649. , {
  17650. "../settings": 166,
  17651. three: 217
  17652. }],
  17653. 148: [function(S, M, e) {
  17654. (function(e) {
  17655. "use strict";
  17656. function r(e, t, i, n) {
  17657. this.model = e,
  17658. this.id = t,
  17659. this.alignmentType = i.alignmentType || c.ALIGNED,
  17660. this.neighbourUUIDs = i.neighbours || null,
  17661. this.neighbourPanos = null,
  17662. this.floor = null,
  17663. this.floorIndex = i.floor,
  17664. this.failedLoadingAt = 0,
  17665. this.maxLoadRetries = 4,
  17666. this.origin = i.position.clone(),
  17667. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17668. this.quaternion = i.quaternion.clone(),
  17669. this.skyboxMesh = new s.Mesh(E),
  17670. this.skyboxMesh.position.copy(this.position),
  17671. this.skyboxMesh.quaternion.copy(this.quaternion),
  17672. this.skyboxMesh.name = "skybox",
  17673. this.skyboxMesh.visible = !1,
  17674. this.skyboxMesh.updateMatrix(),
  17675. this.skyboxMesh.updateMatrixWorld(),
  17676. this.marker = null,
  17677. this.showFloorMarker = this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
  17678. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17679. map: b,
  17680. side: s.DoubleSide,
  17681. opacity: 0,
  17682. transparent: !0,
  17683. depthWrite: !1
  17684. })),
  17685. this.marker.visible = this.showFloorMarker,
  17686. this.marker.renderOrder = l.panoMarker,
  17687. this.marker.name = "marker",
  17688. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17689. this.marker.updateMatrixWorld(),
  17690. a.colorMarkerOnLoad && this.on("load", function() {
  17691. this.marker.material.color.set(65280)
  17692. })),
  17693. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17694. this.floorPosition = i.puck ? i.puck.clone() : null,
  17695. this.tiled = n,
  17696. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17697. this.solidSkybox.flipY = !1,
  17698. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17699. this.solidSkybox.magFilter = s.LinearFilter,
  17700. this.solidSkybox.generateMipmaps = !1)),
  17701. this.zoomed = !1,
  17702. this.panoRenderer = null,
  17703. this.qualityManager = null,
  17704. this.tileDownloader = null,
  17705. this.tiledPanoRenderTarget = null,
  17706. this.minimumTiledPanoLoaded = !1,
  17707. this.highestPartialTileRenderOpCompleted = 0,
  17708. this.highestFullTileRenderOpCompleted = 0,
  17709. this.shouldRedrawOnBaseLoaded = !1,
  17710. this.lockUntilRenderingComplete = !1,
  17711. a.colorMarkerOnLoad && this.on("load", function() {
  17712. this.marker.material.color.set(65280)
  17713. }),
  17714. (e = new s.TextureLoader).setCrossOrigin(!0);
  17715. var r = e.load("images/texture.jpg");
  17716. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17717. color: 16777215,
  17718. transparent: !0,
  17719. opacity: .75,
  17720. map: r
  17721. })),
  17722. this.vrMarker.boluoType = "vr",
  17723. this.vrMarker.position.z = 1,
  17724. this.vrMarker.enabled = !0,
  17725. this.vrMarker.visible = !1,
  17726. window.vrMarkers = window.vrMarkers || [],
  17727. window.vrMarkers.push(this.vrMarker),
  17728. this.marker && this.marker.add(this.vrMarker),
  17729. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17730. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17731. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17732. this.adjustAngleEnable) {
  17733. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17734. this.skyboxMesh.quaternion.multiply(i);
  17735. var o = new s.Quaternion;
  17736. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17737. this.skyboxMesh.quaternion.multiply(o),
  17738. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17739. this.skyboxMesh.quaternion.multiply(n),
  17740. this.skyboxMesh.updateMatrix(),
  17741. this.skyboxMesh.updateMatrixWorld(),
  17742. this.model.updateProjectedPanos()
  17743. }
  17744. }
  17745. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17746. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17747. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17748. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17749. S("../enum/GLCubeFaces"),
  17750. S("../exception/BasicException")), A = S("../tile/TileUtils"), C = S("events").EventEmitter, I = new n(e), E = new s.SphereBufferGeometry(.1), _ = new s.PlaneBufferGeometry(.4,.4,1,1), b = d.load("images/marker-256x256.png");
  17751. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17752. function() {
  17753. this.setZoomed(!1),
  17754. this.emit("enter", {
  17755. oldPano: t,
  17756. newPano: this
  17757. }),
  17758. t = this
  17759. }
  17760. ),
  17761. r.prototype.exit = function() {
  17762. this.tiled ? (this.clearWaitDeferreds(),
  17763. this.minimumTiledPanoLoaded = !1,
  17764. this.tiledPanoRenderTarget = null,
  17765. this.setZoomed(!1),
  17766. this.panoRenderer.deactivateTiledPano(this),
  17767. this.highestPartialTileRenderOpCompleted = 0,
  17768. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17769. this.solidSkybox.loaded = !1,
  17770. this.solidSkybox.version = 0),
  17771. this.emit("exit")
  17772. }
  17773. ,
  17774. r.prototype.hoverOn = function(e) {
  17775. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17776. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17777. }
  17778. ,
  17779. r.prototype.hoverOff = function(e) {
  17780. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17781. }
  17782. ,
  17783. r.prototype.build1 = function() {
  17784. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  17785. this.floor.addPano(this),
  17786. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17787. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17788. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17789. }
  17790. ,
  17791. r.prototype.build2 = function() {
  17792. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17793. this.height = this.position.distanceTo(this.floorPosition),
  17794. this.placeMarker()
  17795. }
  17796. ,
  17797. r.prototype.interpolateFloorPosition = function() {
  17798. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17799. return !!e.floorPosition
  17800. }).sort(function(e, t) {
  17801. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17802. }
  17803. .bind(this))
  17804. , t = this.position.clone();
  17805. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17806. t
  17807. }
  17808. ,
  17809. r.prototype.raycastFloorPosition = function() {
  17810. I.warn("Performance warning: Raycasting to find floor position");
  17811. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17812. return e.length ? e[0].point : null
  17813. }
  17814. ,
  17815. r.prototype.raycastToFindFloor = (i = [new s.Vector3(0,-1,0), new s.Vector3(1,-1,0), new s.Vector3(0,-1,1), new s.Vector3(-1,-1,0), new s.Vector3(0,-1,-1), new s.Vector3(1,0,0), new s.Vector3(0,0,1), new s.Vector3(-1,0,0), new s.Vector3(0,0,-1)],
  17816. function() {
  17817. I.warn("Performance warning: Raycasting to find floor index");
  17818. for (var e = 0; e < i.length; e++) {
  17819. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17820. if (t.length)
  17821. return t[0].object.parent.parent
  17822. }
  17823. return null
  17824. }
  17825. ),
  17826. r.prototype.placeMarker = function() {
  17827. this.marker && (this.marker.position.copy(this.floorPosition),
  17828. this.marker.position.y += .05,
  17829. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17830. }
  17831. ,
  17832. r.prototype.translate = function(e) {
  17833. this.position.add(e),
  17834. this.floorPosition.add(e)
  17835. }
  17836. ,
  17837. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17838. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17839. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17840. }
  17841. ,
  17842. r.prototype.attachToPanoRenderer = function(e) {
  17843. this.panoRenderer = e,
  17844. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17845. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17846. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17847. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17848. }
  17849. ;
  17850. var w, T, x = {};
  17851. r.prototype.getWaitDeferred = function(e) {
  17852. var t = x[this.id];
  17853. t || (t = {},
  17854. x[this.id] = t);
  17855. var i = t[e];
  17856. return i || (i = {
  17857. deferred: $.Deferred(),
  17858. active: !1
  17859. },
  17860. t[e] = i),
  17861. i
  17862. }
  17863. ,
  17864. r.prototype.resetWaitDeferred = function(e) {
  17865. var t = this.getWaitDeferred(e);
  17866. t.active = !1,
  17867. t.deferred = $.Deferred()
  17868. }
  17869. ,
  17870. r.prototype.clearWaitDeferreds = function() {
  17871. var e = x[this.id];
  17872. for (var t in e || (e = {},
  17873. x[this.id] = e),
  17874. e)
  17875. if (e.hasOwnProperty(t)) {
  17876. var i = e[t];
  17877. i.active = !1,
  17878. i.deferred = $.Deferred()
  17879. }
  17880. }
  17881. ,
  17882. r.prototype.loadTiledPano = (new s.Vector3,
  17883. w = [],
  17884. T = [],
  17885. function(e, t, i, n, r, o) {
  17886. null != n || (n = !0),
  17887. null != r || (r = !0);
  17888. var a = this.getWaitDeferred(e)
  17889. , s = a.deferred
  17890. , l = null
  17891. , c = null;
  17892. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  17893. c = i.vFov)),
  17894. !this.isLoaded(e)) {
  17895. if (!a.active) {
  17896. if (a.active = !0,
  17897. i) {
  17898. var h = A.matchingTilesInDirection(this, e, t, l, c);
  17899. w[this.id + ":" + e] = {
  17900. tileCount: 0,
  17901. targetTileCount: h
  17902. },
  17903. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  17904. }
  17905. T[this.id] || (T[this.id] = !0,
  17906. this.on(f.LoadComplete, function(e, t) {
  17907. var i = this.getWaitDeferred(e).deferred;
  17908. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  17909. this.resetWaitDeferred(e))
  17910. }
  17911. .bind(this)),
  17912. this.on(f.LoadFailed, function(e) {
  17913. var t = this.getWaitDeferred(e).deferred;
  17914. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  17915. this.resetWaitDeferred(e))
  17916. }
  17917. .bind(this)),
  17918. this.on(f.TileLoaded, function(e, t, i) {
  17919. var n = this.getWaitDeferred(e).deferred;
  17920. if (n && "pending" === n.state()) {
  17921. n.notify(e, t, i);
  17922. var r = w[this.id + ":" + e];
  17923. r && (r.tileCount++,
  17924. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  17925. n.resolve(e, i),
  17926. this.resetWaitDeferred(e)))
  17927. }
  17928. }
  17929. .bind(this)))
  17930. }
  17931. this.tileDownloader.clearForceQueue(),
  17932. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  17933. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  17934. this.panoRenderer.renderPanoTiles(this.id, t, r)
  17935. }
  17936. return s.promise()
  17937. }
  17938. ),
  17939. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  17940. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  17941. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  17942. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  17943. }
  17944. ,
  17945. r.prototype.onTileRendered = function(e, t, i, n) {
  17946. e === this.id && this.emit(f.TileLoaded, t, i, n)
  17947. }
  17948. ,
  17949. r.prototype.onPanoRendered = function(e, t, i, n) {
  17950. e === this.id && (this.minimumTiledPanoLoaded = !0,
  17951. this.updateSkyboxForZoomLevel(),
  17952. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  17953. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  17954. this.emit("load", t),
  17955. this.model.emit("load", this),
  17956. this.emit(f.LoadComplete, t, i))
  17957. }
  17958. ,
  17959. r.prototype.setZoomed = function(e) {
  17960. this.zoomed = e,
  17961. this.updateSkyboxForZoomLevel()
  17962. }
  17963. ,
  17964. r.prototype.ensureSkyboxReadyForRender = function() {
  17965. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  17966. this.solidSkybox.loaded = !0)
  17967. }
  17968. ,
  17969. r.prototype.updateSkyboxForZoomLevel = function() {
  17970. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  17971. }
  17972. ,
  17973. r.prototype.getSkyboxTexture = function() {
  17974. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  17975. }
  17976. ,
  17977. r.prototype.onTileRenderFail = function(e, t, i) {
  17978. e === this.id && this.emit(f.LoadFailed, t)
  17979. }
  17980. ,
  17981. r.prototype.isLoaded = function(e) {
  17982. if (this.tiled) {
  17983. if (e && "string" == typeof e)
  17984. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  17985. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  17986. }
  17987. if (e && "number" == typeof e)
  17988. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  17989. return !!this.solidSkybox.high || e in this.solidSkybox
  17990. }
  17991. ,
  17992. r.prototype.loadCube = function(a) {
  17993. if (this.isLoaded(a))
  17994. return I.info("Skipping load of pano, already loaded"),
  17995. $.when();
  17996. this.emit("loading", a),
  17997. this.model.emit("loading", this);
  17998. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  17999. , e = n.filter(function(e) {
  18000. return !e
  18001. });
  18002. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18003. a = "high",
  18004. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18005. var t = 0
  18006. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18007. return u.getImage(n[t])
  18008. }
  18009. .bind(this));
  18010. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18011. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18012. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18013. this.solidSkybox.low = null),
  18014. this.solidSkybox.needsUpdate = !0,
  18015. this.emit("load", a),
  18016. this.model.emit("load", this),
  18017. this
  18018. }
  18019. .bind(this), function() {
  18020. I.error("Downloading cubemap for pano", this.id, "failed"),
  18021. this.failedLoadingAt = Date.now()
  18022. }
  18023. .bind(this), function() {
  18024. return $.when(++t, 6)
  18025. })
  18026. }
  18027. ,
  18028. r.raycastsSkipped = 0,
  18029. r.raycastsDone = 0,
  18030. r.prototype.findNeighourPanos = function() {
  18031. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18032. this.model.panos.forEach(function(e) {
  18033. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18034. var t = this.position.distanceTo(e.position);
  18035. if (t > a.panoramaNeighbourMaxDistance)
  18036. return this.model.panos.setNeighbour(this, e, !1),
  18037. void r.raycastsSkipped++;
  18038. var i = e.position.clone().sub(this.position).normalize()
  18039. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18040. r.raycastsDone++,
  18041. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18042. a.showNeighbourRaycasts && (n.length ? this.floor.model.add(new s.ArrowHelper(i,this.position,n[0].distance,16711680)) : this.floor.model.add(new s.ArrowHelper(i,this.position,t,16777215,0,0)))
  18043. }
  18044. }
  18045. .bind(this)),
  18046. this.model.panos.neighbourMap[this.id]
  18047. }
  18048. ,
  18049. r.prototype.worldPosition = function() {
  18050. return this.position
  18051. }
  18052. ,
  18053. r.prototype.addTextSprite = function(e, t) {
  18054. this.removeTextSprite();
  18055. var i = document.createElement("canvas")
  18056. , n = i.getContext("2d");
  18057. i.width = 256,
  18058. i.height = 256;
  18059. n.font = "bold 60px Arial",
  18060. n.fillStyle = "white";
  18061. var r = n.measureText(e).width;
  18062. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18063. var o = new s.Texture(i);
  18064. o.needsUpdate = !0;
  18065. var a = new s.SpriteMaterial({
  18066. map: o,
  18067. color: t || 16428055
  18068. });
  18069. this.text3d = new s.Sprite(a),
  18070. this.text3d.position.copy(this.skyboxMesh.position),
  18071. this.floor.add(this.text3d)
  18072. }
  18073. ,
  18074. r.prototype.removeTextSprite = function() {
  18075. this.text3d && (this.floor.remove(this.text3d),
  18076. this.text3d = null)
  18077. }
  18078. ,
  18079. r.prototype.isAligned = function() {
  18080. return this.alignmentType === c.ALIGNED
  18081. }
  18082. ,
  18083. r.filters = {
  18084. inDirection: function(t, i, n) {
  18085. return function(e) {
  18086. return e.position.clone().sub(t).normalize().dot(i) > n
  18087. }
  18088. },
  18089. inFloorDirection: function(t, i, n) {
  18090. return function(e) {
  18091. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18092. }
  18093. },
  18094. inPanoDirection: function(n, r, o) {
  18095. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18096. function(e) {
  18097. var t = e.floorPosition.clone().sub(n).normalize()
  18098. , i = e.position.clone().sub(n).normalize();
  18099. return t.dot(r) > o || i.dot(r) > o
  18100. }
  18101. },
  18102. atFloor: function(t) {
  18103. return function(e) {
  18104. return !t || e.floor === t
  18105. }
  18106. },
  18107. not: function(t) {
  18108. return function(e) {
  18109. return e !== t
  18110. }
  18111. },
  18112. notIn: function(t) {
  18113. return function(e) {
  18114. return -1 === t.indexOf(e)
  18115. }
  18116. },
  18117. isLoaded: function() {
  18118. return function(e) {
  18119. return e.isLoaded()
  18120. }
  18121. },
  18122. isNotLoaded: function() {
  18123. return function(e) {
  18124. return !e.isLoaded()
  18125. }
  18126. },
  18127. isCloseEnoughTo: function(t, i) {
  18128. return function(e) {
  18129. return t.distanceTo(e.floorPosition) < i
  18130. }
  18131. },
  18132. hasMinimumHeightDifferenceTo: function(t, i) {
  18133. return function(e) {
  18134. return Math.abs(e.position.y - t.y) > i
  18135. }
  18136. },
  18137. isNotBehindNormal: function(t, i) {
  18138. var n = new s.Vector3;
  18139. return i = i.clone(),
  18140. function(e) {
  18141. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18142. }
  18143. },
  18144. isNeighbourPanoTo: function(t) {
  18145. return function(e) {
  18146. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18147. }
  18148. },
  18149. isNeighbourOfNeighbourTo: function(n) {
  18150. return function(i) {
  18151. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18152. var t = n.model.panos.get(e);
  18153. return !!t && t.neighbourPanos[i.id]
  18154. })
  18155. }
  18156. },
  18157. isNotRecentlyFailed: function(t) {
  18158. return function(e) {
  18159. return Date.now() - e.failedLoadingAt > t
  18160. }
  18161. },
  18162. isOnVisibleFloor: function() {
  18163. return function(e) {
  18164. return !e.floor.hidden
  18165. }
  18166. },
  18167. isPanoAligned: function() {
  18168. return function(e) {
  18169. return e.isAligned()
  18170. }
  18171. }
  18172. },
  18173. r.sortFunctions = {
  18174. distanceToPoint: function(i) {
  18175. return function(e, t) {
  18176. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18177. }
  18178. },
  18179. floorDistanceToPoint: function(i) {
  18180. return function(e, t) {
  18181. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18182. }
  18183. },
  18184. choose: function(i) {
  18185. return function(e, t) {
  18186. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18187. }
  18188. }
  18189. },
  18190. r.scoreFunctions = {
  18191. distance: function(t, i) {
  18192. return i = i || a.navigation.distanceFactor,
  18193. function(e) {
  18194. return t ? t.position.distanceTo(e.position) * i : 0
  18195. }
  18196. },
  18197. distanceSquared: function(t, i) {
  18198. return i = i || a.navigation.distanceFactor,
  18199. function(e) {
  18200. return t ? t.position.distanceToSquared(e.position) * i : 0
  18201. }
  18202. },
  18203. direction: function(t, i) {
  18204. return function(e) {
  18205. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18206. }
  18207. },
  18208. angle: function(t, i) {
  18209. return function(e) {
  18210. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18211. }
  18212. },
  18213. inFieldOfView: function(t, i) {
  18214. return function(e) {
  18215. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18216. }
  18217. },
  18218. optionality: function(t) {
  18219. return function(e) {
  18220. return e.neighbourUUIDs.filter(function(e) {
  18221. return !(e in t.neighbourUUIDs) && e !== t.id
  18222. }).length * a.navigation.optionalityFactor
  18223. }
  18224. },
  18225. penalizeHeightDifferenceUnder: function(t, i) {
  18226. return function(e) {
  18227. return t.y - e.position.y < i ? -20 : 0
  18228. }
  18229. }
  18230. },
  18231. M.exports = r
  18232. }
  18233. ).call(this, "/js/objects/Panorama.js")
  18234. }
  18235. , {
  18236. "../enum/AlignmentType": 17,
  18237. "../enum/GLCubeFaces": 25,
  18238. "../enum/PanoRendererEvents": 35,
  18239. "../enum/PanoSizeClass": 36,
  18240. "../enum/PanoramaEvents": 37,
  18241. "../enum/RenderLayers": 41,
  18242. "../enum/RenderOrder": 42,
  18243. "../enum/TileDownloaderEvents": 45,
  18244. "../enum/Viewmode": 51,
  18245. "../exception/BasicException": 55,
  18246. "../scene/SceneRenderer": 158,
  18247. "../settings": 166,
  18248. "../tile/TileUtils": 174,
  18249. "../util/ajax": 181,
  18250. "../util/common": 185,
  18251. "../util/lerp": 188,
  18252. "../util/logger": 189,
  18253. "../util/panorama": 191,
  18254. "../util/texture": 194,
  18255. "../util/transitions": 195,
  18256. events: 202,
  18257. three: 217
  18258. }],
  18259. 149: [function(e, t, i) {
  18260. "use strict";
  18261. function n(e) {
  18262. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18263. t.map.value = d,
  18264. t.opacity.value = 0,
  18265. t.color.value.set(o.reticuleColor),
  18266. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  18267. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18268. side: r.DoubleSide,
  18269. depthWrite: !1,
  18270. depthTest: !1,
  18271. transparent: !0,
  18272. vertexShader: c.waypoint.vertexShader,
  18273. fragmentShader: c.waypoint.fragmentShader,
  18274. uniforms: t,
  18275. name: "waypoint",
  18276. opacity: 0,
  18277. visible: t.showMouseMarker
  18278. })),
  18279. this.layers.set(h.RETICULE),
  18280. this.renderOrder = u.reticule,
  18281. this.player = e,
  18282. this.direction = new r.Vector3,
  18283. this.hidden = !0,
  18284. this.mouseLastMoveTime = Date.now()
  18285. }
  18286. var r = e("three")
  18287. , o = e("../settings")
  18288. , a = e("../util/transitions")
  18289. , s = e("../util/texture")
  18290. , l = e("../util/lerp")
  18291. , c = e("../shaders")
  18292. , h = e("../enum/RenderLayers")
  18293. , u = e("../enum/RenderOrder")
  18294. , d = s.load("images/reticule-256x256.png");
  18295. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18296. this.hidden = i,
  18297. this.mouseLastMoveTime = Date.now()
  18298. }
  18299. ,
  18300. n.prototype.hide = function() {
  18301. this.hidden || (this.hidden = !0,
  18302. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18303. }
  18304. ,
  18305. n.prototype.show = function() {
  18306. this.hidden = !1,
  18307. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18308. }
  18309. ,
  18310. n.prototype.update = function() {
  18311. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18312. }
  18313. ,
  18314. n.prototype.updatePosition = function(e, t) {
  18315. if (!this.hidden) {
  18316. if (!t)
  18317. return this.hide();
  18318. var i = t.point
  18319. , n = e.distanceTo(i)
  18320. , r = 1 + .01 * n;
  18321. n < 1 && (r -= 1 - n),
  18322. this.show(),
  18323. this.scale.set(r, r, r),
  18324. this.direction = this.direction.multiplyScalar(.8),
  18325. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18326. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18327. this.lookAt(this.position.clone().add(this.direction))
  18328. }
  18329. }
  18330. ,
  18331. n.prototype.writeAstag = function() {
  18332. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18333. , t = new Date;
  18334. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18335. var i = {
  18336. enabled: !0,
  18337. version: "0",
  18338. created: t.toISOString(),
  18339. created_by: "APITest",
  18340. position: this.position.clone(),
  18341. stem: {
  18342. enabled: o.tags.pole.enabled,
  18343. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18344. },
  18345. label: "tag " + this.tagCount,
  18346. description: "Description " + e,
  18347. floor: function(e) {
  18348. if (e.currentFloor) {
  18349. var t = e.floors.indexOf(e.currentFloor);
  18350. return -1 < t ? t : void 0
  18351. }
  18352. }(this.player.model),
  18353. type: "info",
  18354. metadata: {
  18355. preferred_camera: {
  18356. mode: this.player.mode
  18357. }
  18358. }
  18359. };
  18360. console.log("--------------------------"),
  18361. console.log(JSON.stringify(i));
  18362. var n = this.player.model.addtag(e, i).build();
  18363. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18364. n.visible || n.show(o.tags.startup.fadeInDuration))
  18365. }
  18366. ,
  18367. t.exports = n
  18368. }
  18369. , {
  18370. "../enum/RenderLayers": 41,
  18371. "../enum/RenderOrder": 42,
  18372. "../settings": 166,
  18373. "../shaders": 167,
  18374. "../util/lerp": 188,
  18375. "../util/texture": 194,
  18376. "../util/transitions": 195,
  18377. three: 217
  18378. }],
  18379. 150: [function(e, t, i) {
  18380. "use strict";
  18381. function n(e, t) {
  18382. this.chunks = [],
  18383. this.floorId = e,
  18384. this.roomId = t,
  18385. this.position = new l.Vector3
  18386. }
  18387. var l = e("three");
  18388. n.prototype.addChunk = function(e) {
  18389. this.chunks.push(e)
  18390. }
  18391. ,
  18392. n.prototype.calcBoundaries = function() {
  18393. for (var e = new l.Vector3, t = new l.Vector3(0,0,0), i = new l.Vector3(0,0,0), n = new l.Vector3(0,0,0), r = 0, o = 0; o < this.chunks.length; o++) {
  18394. var a = this.chunks[o].geometry.attributes.position;
  18395. if (a)
  18396. for (var s = 0; s < a.array.length; s += 3)
  18397. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18398. t.add(e),
  18399. 0 === s ? (i.copy(e),
  18400. n.copy(e)) : (i.max(e),
  18401. n.min(e)),
  18402. r++
  18403. }
  18404. 0 < r ? (t.multiplyScalar(1 / r),
  18405. this.average = t) : this.average = null,
  18406. this.boundsMax = i,
  18407. this.boundsMin = n,
  18408. this.center = new l.Vector3,
  18409. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18410. }
  18411. ,
  18412. t.exports = n
  18413. }
  18414. , {
  18415. three: 217
  18416. }],
  18417. 151: [function(o, v, e) {
  18418. (function(e) {
  18419. "use strict";
  18420. function t(e, t, i) {
  18421. this.obj3d = null,
  18422. this.nodes = [],
  18423. this.colorHull = [],
  18424. this.shortPaths = {},
  18425. this.floorHull = null,
  18426. this.cameraHull = null,
  18427. this.floorPathDistance = 0,
  18428. this.floorCurvePoints = null,
  18429. this.floorCurveColors = null,
  18430. this.camCurvePoints = null,
  18431. this.warpDestHeroLoc = null,
  18432. this.warpDestPano = null,
  18433. this.warpPathPoints = null,
  18434. this.warpPathLengths = [0],
  18435. this.warpLength = 0,
  18436. this.closeWarpDistance = 4,
  18437. this.UP = U.UP.clone(),
  18438. this.longestStep = 0,
  18439. this.upcomingTransType = null,
  18440. this.burnsDir = 1,
  18441. this.prevNextDist = 0,
  18442. this.nextI = 0,
  18443. this.activeTransType = null,
  18444. this.lastTransType = null,
  18445. this.bunnyObj = null,
  18446. this.director = e,
  18447. this.player = t,
  18448. this.playerControls = i,
  18449. this.modelManager = t.modelManager,
  18450. this.updateModel(),
  18451. this.updateDefaultsFromModelData(),
  18452. this.bindEvents(),
  18453. this.warping = !1,
  18454. this.waitingToWarp = !1,
  18455. this.warpInterrupted = !1,
  18456. this.warpInterruptionBlackoutStyle = null,
  18457. this.warpInterruptionTravelTime = null
  18458. }
  18459. var c, h, u, d, p, f, a, s, P = o("three"), i = o("../util/logger"), O = o("../enum/Viewmode"), A = o("../enum/RenderOrder"), L = o("../enum/WarpStyle"), D = o("../settings"), N = o("../util/math"), F = o("../util/lerp"), B = o("../util/easing"), V = o("../util/transitions"), l = o("../objects/Snapshot"), k = o("../effects"), C = o("../shaders"), n = (o("../gui/gui"),
  18460. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18461. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18462. path: n.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"),
  18463. pathEnd: n.load("images/End.png"),
  18464. pathStart: n.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")
  18465. };
  18466. t.prototype.setScene = function(e) {
  18467. this.createCpm(e),
  18468. this.createBunnyObj(e)
  18469. }
  18470. ,
  18471. t.prototype.updateModel = function() {
  18472. this.model = this.modelManager.getActiveModel()
  18473. }
  18474. ,
  18475. t.prototype.bindEvents = function() {
  18476. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18477. }
  18478. ,
  18479. t.prototype.updateDefaultsFromModelData = function() {
  18480. this.model.data
  18481. }
  18482. ,
  18483. t.prototype.pointPathDistance = function(e) {
  18484. for (var t = 0, i = 1; i < e.length; i += 1)
  18485. t += e[i - 1].distanceTo(e[i]);
  18486. return t
  18487. }
  18488. ,
  18489. t.prototype.pointPathLengths = function(e) {
  18490. for (var t = [0], i = 1; i < e.length; i += 1)
  18491. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18492. return t
  18493. }
  18494. ,
  18495. t.prototype.interpAlongPath = function(e, t, i) {
  18496. var n, r = new P.Vector3, o = t[t.length - 1];
  18497. if (i < 1) {
  18498. n = i * o;
  18499. for (var a = 1; a < t.length; a += 1)
  18500. if (t[a] > n) {
  18501. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18502. return r.copy(e[a]),
  18503. r.sub(e[a - 1]),
  18504. r.multiplyScalar(s),
  18505. r.add(e[a - 1]),
  18506. r
  18507. }
  18508. } else
  18509. r.copy(e[e.length - 1]);
  18510. return r
  18511. }
  18512. ,
  18513. t.prototype.pathHeight = function() {
  18514. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18515. }
  18516. ,
  18517. t.prototype.createBunnyObj = function(e) {
  18518. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18519. this.bunnyObj.visible = D.warp.showBunny),
  18520. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18521. e.add(this.bunnyObj)
  18522. }
  18523. ,
  18524. t.prototype.createCpm = function(e) {
  18525. if (!this.currentPanoMarker) {
  18526. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18527. t.material.uniforms.opacity.value = 0,
  18528. this.currentPanoMarker = {
  18529. mesh: t,
  18530. placed: !1
  18531. }
  18532. }
  18533. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18534. this.placeCpm(),
  18535. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18536. }
  18537. ,
  18538. t.prototype.placeCpm = function() {
  18539. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18540. var e = this.player.currentPano.floor;
  18541. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18542. e.add(this.currentPanoMarker.mesh)),
  18543. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18544. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18545. this.currentPanoMarker.placed = !0
  18546. } else
  18547. this.popOutCpm()
  18548. }
  18549. ,
  18550. t.prototype.fadeInCpm = function(e) {
  18551. this.player.mode === O.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || D.path.mapGuides && this.currentPanoMarker.placed && V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  18552. }
  18553. ,
  18554. t.prototype.fadeOutCpm = function(e) {
  18555. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18556. }
  18557. ,
  18558. t.prototype.popInCpm = function() {
  18559. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18560. }
  18561. ,
  18562. t.prototype.popOutCpm = function() {
  18563. this.fadeOutCpm(2)
  18564. }
  18565. ,
  18566. t.prototype.brushPrefs = {
  18567. linewidth: 7,
  18568. strokeWidth: 15,
  18569. cvSegments: 48,
  18570. paveStep: .1,
  18571. paveWidth: .2,
  18572. lookBlendDist: 3,
  18573. maxTurn: P.Math.degToRad(2)
  18574. },
  18575. t.prototype.panoPathDistance = function(e) {
  18576. var t = this.model.panos;
  18577. if (!e || e.length < 2)
  18578. return 0;
  18579. for (var i = [], n = 0; n < e.length; n += 1)
  18580. i.push(t.get(e[n]).floorPosition);
  18581. return this.pointPathDistance(i)
  18582. }
  18583. ,
  18584. t.prototype.loadTileTexture = function(t) {
  18585. var e = n.load(t, function(e) {
  18586. e.wrapS = P.RepeatWrapping,
  18587. e.wrapT = P.RepeatWrapping,
  18588. e.needsUpdate = !0,
  18589. H.debug('path texture "' + t + '" is ready')
  18590. }, function() {
  18591. H.error('path texture "' + t + '" failed')
  18592. });
  18593. return e.mapping = P.UVMapping,
  18594. e
  18595. }
  18596. ,
  18597. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18598. return new l({
  18599. cameraMode: n,
  18600. position: e,
  18601. quaternion: t,
  18602. panoId: i,
  18603. orthoZoom: o,
  18604. floorVisibility: r,
  18605. thumbUrl: null,
  18606. name: null
  18607. })
  18608. }
  18609. ,
  18610. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18611. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18612. }
  18613. ,
  18614. t.prototype.setWarpDestination = function(e) {
  18615. this.warpDestHeroLoc = e
  18616. }
  18617. ,
  18618. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18619. var t = this.getHeroDescriptorByHeroIndex(e);
  18620. return null !== t && (this.setWarpDestination(t),
  18621. !0)
  18622. }
  18623. ,
  18624. t.prototype.setWarpDestinationByPano = function(e, t) {
  18625. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18626. }
  18627. ,
  18628. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18629. var i = this.model.panos.get(e);
  18630. if (i) {
  18631. t = t || new P.Quaternion;
  18632. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18633. return this.setWarpDestination(n),
  18634. !0
  18635. }
  18636. return !1
  18637. }
  18638. ,
  18639. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18640. var t = this.model.heroCount();
  18641. if (null !== this.warpDestHeroLoc && t < 2)
  18642. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18643. this.model.getHeroDescriptorByIndex(0);
  18644. var i = this.model.getHeroDescriptorByIndex(e);
  18645. if (i) {
  18646. var n = i.isPano() ? i.panoId : i.cameraMode;
  18647. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18648. }
  18649. return i
  18650. }
  18651. ,
  18652. t.prototype.getHeroDescriptorByPano = function(e) {
  18653. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18654. }
  18655. ,
  18656. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18657. var t = this.getHeroIndexFromPanoId(e);
  18658. return this.getHeroDescriptorByHeroIndex(t)
  18659. }
  18660. ,
  18661. t.prototype.getHeroIndexFromPanoId = function(e) {
  18662. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18663. var i = this.model.heroLocations[t]
  18664. , n = this.getHeroId(i);
  18665. if (n && n === e)
  18666. return t
  18667. }
  18668. return -1
  18669. }
  18670. ,
  18671. t.prototype.getHeroPano = function(e) {
  18672. if (null === e)
  18673. return H.warn("getHeroPano(): no destination"),
  18674. null;
  18675. var t = this.getHeroId(e)
  18676. , i = this.model.panos.get(t);
  18677. return void 0 === i && (i = null,
  18678. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18679. i
  18680. }
  18681. ,
  18682. t.prototype.getHeroId = function(e) {
  18683. return e.panoId
  18684. }
  18685. ,
  18686. t.prototype.setWarpDestPano = function() {
  18687. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18688. this.warpDestPano
  18689. }
  18690. ,
  18691. t.prototype.brushToWarpPano = function(e, t) {
  18692. if (this.discardPathObject(),
  18693. !this.setWarpDestPano())
  18694. return !1;
  18695. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18696. !this.warpDestPano)
  18697. return H.info("No brush"),
  18698. !1;
  18699. if (!this.player.currentPano)
  18700. return H.debug("No current pano, visibility undefined"),
  18701. !1;
  18702. if (!this.warpDestPano)
  18703. return H.info("No wPano, visibility undefined"),
  18704. !1;
  18705. if (!this.warpDestPano.isAligned())
  18706. return H.debug("Cannot brush to unaligned pano"),
  18707. !1;
  18708. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18709. , n = !0;
  18710. if (this.player.currentPano.id === this.warpDestPano.id)
  18711. H.debug("Already at destination pano");
  18712. else {
  18713. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18714. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18715. this.obj3d = new P.Object3D,
  18716. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18717. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18718. e = t) : (this.setPathHulls(this.nodes),
  18719. this.setFloorCurves(),
  18720. i && ("chevron" === D.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === D.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  18721. this.player.currentPano.floor.add(this.obj3d);
  18722. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18723. , o = e === L.STD;
  18724. if (!n && (i || o)) {
  18725. if (r) {
  18726. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18727. this.obj3d.add(a)
  18728. }
  18729. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18730. this.obj3d.add(s)
  18731. }
  18732. this.appearSlow()
  18733. }
  18734. return this.upcomingTransType = e,
  18735. !n
  18736. }
  18737. ,
  18738. t.prototype.findShortestPath = function(e, t) {
  18739. if (!e || !t)
  18740. return null;
  18741. var i = D.warp.walkExtraPanosDistance
  18742. , n = e.id + ":" + t.id + ":" + i;
  18743. if (this.shortPaths.hasOwnProperty(n))
  18744. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18745. var r = t.id + ":" + e.id + ":" + i;
  18746. if (this.shortPaths.hasOwnProperty(r))
  18747. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18748. var o = this.model.panos.aStarSearch(e, t);
  18749. return this.model.panos.includeNodesNearPath(o, i),
  18750. this.shortPaths[n] = o ? o.slice() : null,
  18751. o
  18752. }
  18753. ,
  18754. t.prototype.makePathHulls = function(e) {
  18755. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18756. r = (t = h.get(e[0])).floor.floorIndex;
  18757. for (var u = 0; u < e.length; u += 1)
  18758. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18759. s.push(i),
  18760. l.push(t.position.clone()),
  18761. n = t.floor.floorIndex,
  18762. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18763. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18764. return a > this.longestStep && (this.longestStep = a,
  18765. H.debug("path contains " + a + " meter segment")),
  18766. {
  18767. floor: s,
  18768. camera: l,
  18769. color: c
  18770. }
  18771. }
  18772. ,
  18773. t.prototype.makeFloorCurves = function(e, t, i) {
  18774. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18775. , r = this.pointPathDistance(e) - 2 * n
  18776. , o = e.slice(0)
  18777. , a = o[1].clone().sub(o[0]);
  18778. a.y = 0,
  18779. a.normalize().multiplyScalar(n),
  18780. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18781. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18782. a.normalize().multiplyScalar(n),
  18783. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18784. var s = new P.CatmullRomCurve3(o)
  18785. , l = Math.floor(r / i);
  18786. l = 4 * Math.floor(l / 4),
  18787. l = Math.max(4, l);
  18788. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18789. h = 0,
  18790. c = u[f].distanceTo(e[0]);
  18791. for (var g = 1; g < e.length; g += 1)
  18792. p.copy(u[f]).sub(e[g]),
  18793. p.y *= 4,
  18794. p.length() < c && (h = g);
  18795. d.push(t[h])
  18796. }
  18797. return {
  18798. distance: r,
  18799. points: u,
  18800. colors: d
  18801. }
  18802. }
  18803. ,
  18804. t.prototype.makeCameraCurvePoints = function(e, t) {
  18805. var i = this.pointPathDistance(e);
  18806. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18807. }
  18808. ,
  18809. t.prototype.makeCameraCurveTangents = function(e, t) {
  18810. var i = this.pointPathDistance(e)
  18811. , n = new P.CatmullRomCurve3(e)
  18812. , r = Math.max(2, Math.floor(i / t));
  18813. r = r || 5;
  18814. for (var o = [], a = 0; a <= r; a++)
  18815. o.push(n.getTangentAt(a / r));
  18816. return o
  18817. }
  18818. ,
  18819. t.prototype.setPathHulls = function(e) {
  18820. var t = this.makePathHulls(e);
  18821. this.floorHull = t.floor,
  18822. this.cameraHull = t.camera,
  18823. this.colorHull = t.color
  18824. }
  18825. ,
  18826. t.prototype.setFloorCurves = function() {
  18827. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18828. this.floorPathDistance = e.distance,
  18829. this.floorCurvePoints = e.points,
  18830. this.floorCurveColors = e.colors
  18831. }
  18832. ,
  18833. t.prototype.setCameraCurvePoints = function() {
  18834. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18835. }
  18836. ,
  18837. t.prototype.chooseWarpPath = function(e) {
  18838. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18839. if (this.player.currentPano === this.warpDestPano || !e)
  18840. return this.warpPathPoints = null,
  18841. this.warpLength = 0,
  18842. !1;
  18843. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18844. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18845. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18846. t.multiplyScalar(.15).add(r.position),
  18847. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18848. t.y = r.position.y,
  18849. i.y = this.warpDestPano.position.y,
  18850. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18851. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18852. this.setCameraCurvePoints(),
  18853. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18854. this.warpLength = 0,
  18855. this.warpPathLengths = [0];
  18856. for (var o = new P.Vector3, a = new P.Vector3, s = Math.cos(P.Math.degToRad(D.warp.minBrakeAngle)), l = Math.cos(P.Math.degToRad(D.warp.maxBrakeAngle)), c = 1; c < this.warpPathPoints.length; c += 1) {
  18857. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18858. var h = o.length();
  18859. o.y *= D.warp.climbEffort;
  18860. var u = o.length() / h;
  18861. if (1 < c) {
  18862. o.setY(0).normalize(),
  18863. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18864. var d = Math.min(1, o.dot(a))
  18865. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18866. u = Math.max(p, u)
  18867. }
  18868. this.warpLength += h * u,
  18869. this.warpPathLengths[c] = this.warpLength
  18870. }
  18871. return !0
  18872. }
  18873. ,
  18874. t.prototype.drawPathRibbon = function(e, t) {
  18875. this.bunnyObj.visible = D.warp.showBunny;
  18876. for (var i = .6 * D.path.ribbonWidth * .5, n = new P.Vector3, r = new P.Vector3(0,this.pathHeight(),0), o = new P.Geometry, a = new P.Vector3, s = 0; s < e.length; s += 1) {
  18877. a.copy(e[s]),
  18878. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  18879. a.normalize(),
  18880. n.crossVectors(a, U.UP),
  18881. n.multiplyScalar(i);
  18882. var l = (new P.Vector3).copy(e[s]).add(r);
  18883. l.sub(n),
  18884. o.vertices.push(l),
  18885. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  18886. o.vertices.push(l)
  18887. }
  18888. var c, h, u, d = 0;
  18889. for (s = 0; s < e.length - 1; s += 1) {
  18890. var p = 2 * s
  18891. , f = d
  18892. , g = d += e[s + 1].distanceTo(e[s])
  18893. , m = t[s]
  18894. , v = t[s + 1];
  18895. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  18896. o.faces.push(c),
  18897. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  18898. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  18899. o.faces.push(c),
  18900. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  18901. }
  18902. o.computeFaceNormals(),
  18903. o.computeVertexNormals(),
  18904. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  18905. u.opacity.value = 0,
  18906. u.color.value.set(D.path.color),
  18907. new P.RawShaderMaterial({
  18908. side: P.DoubleSide,
  18909. depthWrite: !1,
  18910. transparent: !0,
  18911. vertexShader: C.ribbon.vertexShader,
  18912. fragmentShader: C.ribbon.fragmentShader,
  18913. uniforms: u,
  18914. name: "ribbonT",
  18915. opacity: 0
  18916. })) : new P.MeshBasicMaterial({
  18917. color: 16777215,
  18918. side: P.DoubleSide,
  18919. name: "ribbonOut",
  18920. vertexColors: P.VertexColors
  18921. });
  18922. var y = new P.Mesh(o,h);
  18923. return y.name = "ribbon",
  18924. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  18925. y
  18926. }
  18927. ,
  18928. t.prototype.drawPathPavement = function(e) {
  18929. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  18930. r.copy(e[o]),
  18931. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  18932. r.normalize(),
  18933. i.crossVectors(r, U.UP),
  18934. i.multiplyScalar(this.brushPrefs.paveWidth),
  18935. (t = (new P.Vector3).copy(e[o])).sub(i),
  18936. n.vertices.push(t),
  18937. n.vertices.push((new P.Vector3).copy(e[o])),
  18938. (t = (new P.Vector3).copy(e[o])).add(i),
  18939. n.vertices.push(t);
  18940. var a, s, l;
  18941. for (o = 0; o < e.length - 1; o += 1)
  18942. a = 3 * o + 1,
  18943. l = .25 + (s = .25 * o),
  18944. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  18945. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  18946. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  18947. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  18948. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  18949. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  18950. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  18951. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  18952. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  18953. color: D.path.color,
  18954. side: P.DoubleSide,
  18955. transparent: !0,
  18956. depthWrite: !1,
  18957. opacity: 0,
  18958. name: "paveT",
  18959. map: I.path
  18960. }) : new P.MeshBasicMaterial({
  18961. color: D.path.color,
  18962. side: P.DoubleSide,
  18963. transparent: !0,
  18964. depthWrite: !1,
  18965. opacity: 1,
  18966. name: "paveO",
  18967. map: I.path
  18968. });
  18969. return new P.Mesh(n,c)
  18970. }
  18971. ,
  18972. t.prototype.hintPrefs = {
  18973. rad: .18,
  18974. width: .0125,
  18975. depth: .0625,
  18976. setBack: -.04,
  18977. markRad: .25,
  18978. markInnerRad: .16
  18979. },
  18980. t.prototype.makeWaypointObj = function(e, t) {
  18981. var i = new P.Geometry
  18982. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18983. , r = this.pathHeight();
  18984. i.vertices.push(new P.Vector3(-n,r,n), new P.Vector3(-n,r,-n), new P.Vector3(n,r,-n), new P.Vector3(n,r,n)),
  18985. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  18986. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  18987. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  18988. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  18989. o.map.value = e,
  18990. o.opacity.value = 0,
  18991. o.color.value.set(D.path.color);
  18992. var a = {
  18993. side: P.DoubleSide,
  18994. depthWrite: !1,
  18995. transparent: !0,
  18996. vertexShader: C.waypoint.vertexShader,
  18997. fragmentShader: C.waypoint.fragmentShader,
  18998. uniforms: o,
  18999. name: "waypoint",
  19000. opacity: 0
  19001. };
  19002. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19003. a.name = "wayPtOut");
  19004. var s = new P.RawShaderMaterial(a)
  19005. , l = new P.Mesh(i,s);
  19006. return l.name = t,
  19007. l
  19008. }
  19009. ,
  19010. t.prototype.makeStartMarker = function(e, t) {
  19011. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19012. i.y = 0,
  19013. i.normalize();
  19014. var n = Math.acos(i.x)
  19015. , r = this.makeWaypointObj(I.pathStart, "Start");
  19016. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19017. r.position.copy(e),
  19018. r
  19019. }
  19020. ,
  19021. t.prototype.makeEndMarker = function(e) {
  19022. var t = this.makeWaypointObj(I.pathEnd, "End")
  19023. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19024. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19025. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19026. t.position.copy(e),
  19027. t
  19028. }
  19029. ,
  19030. t.prototype.pathClean = function(e) {
  19031. if (e) {
  19032. for (var t in e.children)
  19033. this.pathClean(e.children[t]);
  19034. e.geometry && e.geometry.dispose(),
  19035. e.material && e.material.dispose()
  19036. }
  19037. }
  19038. ,
  19039. t.prototype.discardPathObject = function() {
  19040. if (this.obj3d) {
  19041. var e = this.obj3d.parent;
  19042. e && e.remove(this.obj3d),
  19043. this.pathClean(this.obj3d)
  19044. }
  19045. this.obj3d = null,
  19046. this.popInCpm()
  19047. }
  19048. ,
  19049. t.prototype.discardSlow = function() {
  19050. if (this.obj3d) {
  19051. if (this.player.mode !== O.PANORAMA)
  19052. return void this.discardPathObject();
  19053. for (var e, t = 0, i = function() {
  19054. this.discardPathObject()
  19055. }
  19056. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19057. void 0 !== (e = this.obj3d.children[n]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]),
  19058. t += 1,
  19059. i = null);
  19060. 0 === t && this.discardPathObject(),
  19061. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19062. }
  19063. }
  19064. ,
  19065. t.prototype.appearSlow = function() {
  19066. var e;
  19067. this.fadeOutCpm(D.path.fadeInTime);
  19068. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19069. void 0 !== (e = this.obj3d.children[i]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]))
  19070. }
  19071. ,
  19072. t.prototype.update = function() {
  19073. this.obj3d && this.obj3d.updateMatrixWorld()
  19074. }
  19075. ,
  19076. t.prototype.calcBurnsAmount = function(e) {
  19077. var n = P.Math.degToRad(D.warp.burnsAngle);
  19078. if (this.player.mode !== O.PANORAMA)
  19079. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19080. var t = this.burnsDir * n;
  19081. if (this.upcomingTransType === L.BLACK)
  19082. return t;
  19083. var i = e;
  19084. if (null === i)
  19085. return H.warn("Transition request for non-highlight"),
  19086. t;
  19087. var r = this.getHeroDescriptorByHeroIndex(i);
  19088. if (null === r)
  19089. return t;
  19090. if (!r.isPano())
  19091. return t;
  19092. function o(e) {
  19093. var t = Math.acos(Math.min(1, e.dot(l)))
  19094. , i = (new P.Vector3).crossVectors(l, e);
  19095. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19096. }
  19097. var a = this.getHeroPano(r)
  19098. , s = this.playerControls.cameras[O.PANORAMA]
  19099. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19100. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19101. if (a === this.player.currentPano)
  19102. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19103. var h = this.findShortestPath(this.player.currentPano, a);
  19104. if (null == h || h.length < 1)
  19105. return H.debug("Empty path ahead..."),
  19106. t;
  19107. var u = this.makePathHulls(h)
  19108. , d = new P.CatmullRomCurve3(u.camera)
  19109. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19110. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19111. }
  19112. ,
  19113. t.prototype.waitNextStep = function(e, t, i) {
  19114. var o = null == i ? D.warp.tourStepDelay : i;
  19115. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19116. var a = new P.Euler
  19117. , s = new P.Vector3;
  19118. H.debug("Starting wait: " + (void 0 !== t));
  19119. var l = this.calcBurnsAmount(e)
  19120. , c = function() {
  19121. this.endWarpState(),
  19122. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19123. t && t()
  19124. }
  19125. .bind(this)
  19126. , n = function(e, t) {
  19127. if (this.warpInterrupted)
  19128. return c(),
  19129. !0;
  19130. var i = t || 1e3 / 60;
  19131. if (D.warp.doBurns)
  19132. if (this.player.mode === O.PANORAMA) {
  19133. var n = this.playerControls.cameras[O.PANORAMA];
  19134. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19135. var r = i * l / o;
  19136. a.y += r,
  19137. s.set(0, 0, -1),
  19138. s.applyEuler(a),
  19139. s.add(n.position),
  19140. n.controls.lookAt(s),
  19141. n.controls.lookVector.copy(s),
  19142. n.lookAt(s)
  19143. } else
  19144. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19145. }
  19146. .bind(this);
  19147. this.startWarpState(),
  19148. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19149. /* var r = player.model.heroLocations[app.director.currentItem];
  19150. this.player.zoomEnabled = !0;
  19151. var h = function(e, t) {
  19152. //console.log(e),
  19153. this.player.zoomTo(e * r.zoom.toFixed(2), !0)
  19154. }
  19155. .bind(this);
  19156. V.start(h, 2e3, null, 0, B.easeOutQuad, "zoom") */
  19157. }
  19158. ,
  19159. t.prototype.warpToNonPano = function(e) {
  19160. if (this.discardPathObject(),
  19161. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19162. var t = function() {
  19163. e && e()
  19164. }
  19165. .bind(this);
  19166. this.player.flyToNewMode({
  19167. mode: this.warpDestHeroLoc.cameraMode,
  19168. duration: D.warp.outsideTime,
  19169. warpDest: this.warpDestHeroLoc,
  19170. callback: t,
  19171. force: !0
  19172. })
  19173. } else
  19174. H.warn("no warp destination!!!"),
  19175. e && e()
  19176. }
  19177. ,
  19178. t.prototype._resetWarpShaderParams = function(e) {
  19179. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19180. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19181. }
  19182. ,
  19183. t.prototype._clearWarpShading = function() {
  19184. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19185. this._resetWarpShaderParams(e[t]),
  19186. e[t].visible = !0;
  19187. this._resetWarpShaderParams(this.model.skybox)
  19188. }
  19189. ,
  19190. t.prototype._warpStopFlying = function() {
  19191. this.activeTransType = null,
  19192. this.placeCpm()
  19193. }
  19194. ,
  19195. t.prototype._wrapupTravelOnlyBits = function() {
  19196. this._warpStopFlying(),
  19197. this.warpPathPoints && (this.player.currentPano.exit(),
  19198. this.warpDestPano.enter(),
  19199. this.player.currentPano = this.warpDestPano),
  19200. this.player.spider.draw(),
  19201. this.placeCpm()
  19202. }
  19203. ,
  19204. t.prototype._wrapupTravel = function(e) {
  19205. this._wrapupTravelOnlyBits(),
  19206. this.warpCameraAim(e)
  19207. }
  19208. ,
  19209. t.prototype._wrapupWarpShading = function(e) {
  19210. this._clearWarpShading(),
  19211. this._wrapupTravel(e)
  19212. }
  19213. ,
  19214. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19215. t !== z.END && this._clearWarpShading(),
  19216. this._wrapupTravelOnlyBits(),
  19217. this.upcomingTransType = null,
  19218. e && e()
  19219. }
  19220. ,
  19221. t.prototype._warpCameraAim = function(e, t) {
  19222. var i = this.warpDestHeroLoc.quaternion
  19223. , n = this.playerControls.cameras[O.PANORAMA]
  19224. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19225. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19226. , a = P.Math.radToDeg(Math.acos(o))
  19227. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19228. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19229. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19230. c.y = N.constrainedTurn(c.y),
  19231. this.burnsDir = Math.sign(c.y);
  19232. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19233. , u = new P.Vector3
  19234. , d = function(e, t) {
  19235. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19236. h.y = l.y + e * c.y,
  19237. h.z = l.z + e * c.z,
  19238. u.set(0, 0, -1),
  19239. u.applyEuler(h),
  19240. u.add(n.position),
  19241. n.controls.lookAt(u),
  19242. n.controls.lookVector.copy(u),
  19243. void n.lookAt(u))
  19244. }
  19245. .bind(this);
  19246. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing]) : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19247. void (t && t()))
  19248. }
  19249. ,
  19250. t.prototype._warpBendAim = function(e, t, i, n) {
  19251. var r = n || 0
  19252. , o = this.playerControls.cameras[O.PANORAMA]
  19253. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19254. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19255. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19256. l.y = N.constrainedTurn(l.y);
  19257. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19258. l.x = c * Math.sign(l.x),
  19259. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19260. this.burnsDir = Math.sign(l.y),
  19261. c *= Math.sign(l.y),
  19262. l.y = c;
  19263. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19264. , u = new P.Vector3
  19265. , d = function(e, t) {
  19266. if (e < .5)
  19267. h.x = s.x + e * l.x,
  19268. h.y = s.y + e * l.y,
  19269. h.z = s.z + e * l.z;
  19270. else {
  19271. var i = (1 - e) * D.warp.softBendEnd;
  19272. h.x = a.x - i * l.x,
  19273. h.y = a.y - i * l.y,
  19274. h.z = a.z - i * l.z
  19275. }
  19276. u.set(0, 0, -1),
  19277. u.applyEuler(h),
  19278. u.add(o.position),
  19279. o.controls.lookAt(u),
  19280. o.controls.lookVector.copy(u),
  19281. o.lookAt(u)
  19282. }
  19283. .bind(this);
  19284. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19285. }
  19286. ,
  19287. t.prototype._warpStepCameraAim = function(e, t, i) {
  19288. var n = this.playerControls.cameras[O.PANORAMA]
  19289. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19290. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19291. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19292. a.y = N.constrainedTurn(a.y),
  19293. this.burnsDir = Math.sign(a.y);
  19294. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19295. , l = new P.Vector3
  19296. , c = function(e, t) {
  19297. e < .5 ? s.copy(o) : s.copy(r),
  19298. l.set(0, 0, -1),
  19299. l.applyEuler(s),
  19300. l.add(n.position),
  19301. n.controls.lookAt(l),
  19302. n.controls.lookVector.copy(l),
  19303. n.lookAt(l)
  19304. }
  19305. .bind(this);
  19306. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19307. }
  19308. ,
  19309. t.prototype.setBurnsDir = function() {
  19310. var e = this.playerControls.cameras[O.PANORAMA]
  19311. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19312. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19313. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19314. n.y = N.constrainedTurn(n.y),
  19315. this.burnsDir = Math.sign(n.y)
  19316. }
  19317. ,
  19318. t.prototype.stepWarpPath = function(e, t) {
  19319. var i = this.playerControls.cameras[O.PANORAMA];
  19320. if (!this.warpPathPoints)
  19321. return i.position.copy(this.warpDestPano.position),
  19322. !0;
  19323. var n = this.warpPathPoints[0]
  19324. , r = this.warpDestPano.position;
  19325. if (null !== this.nodes && 1 < this.cameraHull.length) {
  19326. var o = new P.Vector3;
  19327. e < .5 ? o.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(D.warp.softPushDist * e).add(n) : o.copy(this.cameraHull[this.cameraHull.length - 2]).sub(r).normalize().multiplyScalar(D.warp.softPushDist * D.warp.softPushEnd * (1 - e)).add(r),
  19328. i.position.copy(o)
  19329. } else
  19330. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19331. }
  19332. ,
  19333. t.prototype.interruptAndFastForward = function(e, t) {
  19334. this.warping && (this.warpInterrupted = !0,
  19335. this.warpInterruptionBlackoutStyle = e,
  19336. this.warpInterruptionTravelTime = t,
  19337. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19338. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19339. }
  19340. ,
  19341. t.prototype.warpCameraAim = function(e) {
  19342. var t = D.warp.minWarpTime;
  19343. if (this.upcomingTransType === L.BLACK)
  19344. t = D.warp.teleportTime;
  19345. else {
  19346. var i = this.playerControls.cameras[O.PANORAMA]
  19347. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19348. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19349. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19350. o.y = N.constrainedTurn(o.y);
  19351. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19352. t = Math.max(t, a)
  19353. }
  19354. var s = function() {
  19355. this._warpStopFlying(),
  19356. this.discardSlow(),
  19357. e && e()
  19358. }
  19359. .bind(this);
  19360. this._warpCameraAim(t, s)
  19361. }
  19362. ,
  19363. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19364. this.model.skybox.material.uniforms.blackout.value = n;
  19365. var r = F.uniform(this.model.skybox, "progress", 1)
  19366. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19367. , a = !1
  19368. , s = function() {
  19369. if (this.warpInterrupted)
  19370. return a = !0
  19371. }
  19372. .bind(this)
  19373. , l = function(e, t) {
  19374. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19375. }
  19376. .bind(this)
  19377. , c = function(e, t) {
  19378. return i && a ? (o(0),
  19379. !0) : void o(e, t)
  19380. }
  19381. .bind(this);
  19382. V.start(s, e, null, t, null, "safeHaltWatch"),
  19383. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19384. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19385. }
  19386. ,
  19387. t.prototype.warpTravel_STD = function(e) {
  19388. var l, c = Math.min(D.warp.lookAheadMax, D.warp.lookAheadDist / this.warpLength), h = this.playerControls.cameras[O.PANORAMA], i = (Math.min(.25, 3 / this.warpLength),
  19389. Math.min(.35, 7 / this.warpLength)), u = new P.Euler(0,0,0,D.warp.eOrder), d = new P.Vector3, p = (new P.Euler).setFromQuaternion(h.quaternion, D.warp.eOrder), f = (new P.Euler).copy(p), g = h.position.clone(), m = new P.Matrix4, v = new P.Euler, t = D.warp.minWarpTime;
  19390. t += this.warpLength * D.warp.timePerMeter,
  19391. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19392. function n(e) {
  19393. var t = i;
  19394. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19395. }
  19396. var y = !1
  19397. , r = this.warpDestHeroLoc.quaternion
  19398. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19399. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19400. , a = A.dot(o)
  19401. , C = P.Math.radToDeg(Math.acos(a))
  19402. , s = function() {
  19403. return m.lookAt(g, l, U.UP),
  19404. u.setFromRotationMatrix(m, D.warp.eOrder),
  19405. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19406. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19407. N.constrainedTurn(v.y)
  19408. }
  19409. .bind(this)
  19410. , I = function(e, t) {
  19411. if (this.warpInterrupted)
  19412. return y = !0
  19413. }
  19414. .bind(this)
  19415. , E = function(e, t) {
  19416. return y || !this.warpPathPoints ? (k.blur(0),
  19417. !0) : void k.blur(e)
  19418. }
  19419. .bind(this)
  19420. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19421. , b = function(e, t) {
  19422. return y || !this.warpPathPoints ? (_(0),
  19423. !0) : void _(e, t)
  19424. }
  19425. .bind(this)
  19426. , w = function(e, t) {
  19427. if (!this.warpPathPoints)
  19428. return h.position.copy(this.warpDestPano.position),
  19429. !0;
  19430. if (y)
  19431. return !0;
  19432. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19433. h.position.copy(i),
  19434. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19435. }
  19436. .bind(this)
  19437. , T = function(e, t) {
  19438. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19439. !0)
  19440. }
  19441. .bind(this)
  19442. , x = function(e, t) {
  19443. if (y)
  19444. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19445. !0;
  19446. if (!this.warpPathPoints)
  19447. return !0;
  19448. var i = this.warpLength * e
  19449. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19450. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19451. D.warp.matchCam && (n *= 1 - r),
  19452. m.lookAt(g, l, U.UP),
  19453. u.setFromRotationMatrix(m, D.warp.eOrder),
  19454. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19455. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19456. v.y = N.constrainedTurn(v.y),
  19457. u.x = p.x + n * v.x,
  19458. u.y = p.y + n * v.y,
  19459. u.z = p.z + n * v.z,
  19460. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19461. v.y = N.constrainedTurn(v.y);
  19462. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19463. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19464. f.x = f.x + v.x * D.warp.turnFriction,
  19465. f.y = f.y + v.y * D.warp.turnFriction,
  19466. f.z = f.z + v.z * D.warp.turnFriction,
  19467. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19468. var a = l.clone().sub(g).normalize();
  19469. if (C < D.warp.maxAimRotation && 0 < r) {
  19470. var s = 1 - r;
  19471. a.x = a.x * s + r * A.x,
  19472. a.y = a.y * s + r * A.y,
  19473. a.z = a.z * s + r * A.z,
  19474. a.normalize()
  19475. }
  19476. this.bunnyObj.position.copy(h.position).add(a),
  19477. d.set(0, 0, -1).applyEuler(f).normalize(),
  19478. d.multiplyScalar(8),
  19479. d.add(h.position),
  19480. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19481. h.controls.lookVector.copy(d),
  19482. h.lookAt(d))
  19483. }
  19484. .bind(this)
  19485. , S = function() {
  19486. y ? (this.discardSlow(),
  19487. this.upcomingTransType = L.BLACK,
  19488. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19489. }
  19490. .bind(this);
  19491. T(0);
  19492. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19493. , R = M / (t += M);
  19494. this.warpCommonParameters(t, R, !0, z.NONE),
  19495. V.start(I, t, null, 0, null, "_haltWatcher"),
  19496. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19497. V.start(E, t, null, R, n, "blurring")),
  19498. V.start(b, t, null, R, n, "modelAlpha"),
  19499. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19500. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19501. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19502. }
  19503. ,
  19504. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19505. var r = e || 0;
  19506. null != t || (t = D.warp.teleportTime),
  19507. this.warpCommonParameters(t, r, !1, i),
  19508. this.model.chunks.forEach(function(e) {
  19509. e.material.uniforms.blackout.value = i
  19510. }),
  19511. this._warpBendAim(null, t, null, r);
  19512. var o = function() {
  19513. this.wrapupWarpShadingOnly(n, i)
  19514. }
  19515. .bind(this);
  19516. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19517. }
  19518. ,
  19519. t.prototype.flightStepWalk = (a = new P.Vector3,
  19520. s = new P.Vector3,
  19521. function(e, t, i) {
  19522. if (this.warpInterrupted)
  19523. i && i();
  19524. else if (this.activeTransType !== L.WALK)
  19525. this._clearWarpShading(),
  19526. this._warpStopFlying(),
  19527. this.player.spider.draw(),
  19528. this.placeCpm(),
  19529. i && i();
  19530. else if (this.player.currentPano !== e) {
  19531. var n = {
  19532. pano: e,
  19533. lookAtPoint: t,
  19534. duration: null,
  19535. maxDistanceOverride: D.warp.walkMaxDist,
  19536. skipWarpingCheck: !1,
  19537. constantMoveSpeed: !0
  19538. };
  19539. n.duration = function(e, t) {
  19540. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19541. s.copy(U.FORWARD),
  19542. this.player.getDirection(s),
  19543. a.copy(t).sub(e.position).normalize();
  19544. var n = a.dot(s)
  19545. , r = Math.acos(n)
  19546. , o = r / i;
  19547. return .001 < o && (i *= o / .001,
  19548. r < 1 && (i *= 1.2)),
  19549. i
  19550. }
  19551. .call(this, e, t),
  19552. this.player.nonInterruptingFlyToPano(n, i)
  19553. } else
  19554. i && i()
  19555. }
  19556. ),
  19557. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19558. return this.flightStepWalk.bind(this, e, t, i)
  19559. }
  19560. ,
  19561. t.prototype.warpTravel_WALK = (f = [],
  19562. function(e) {
  19563. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19564. var o = this.nodes[r]
  19565. , a = t.get(o);
  19566. this.nodes.length,
  19567. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19568. i && n || (f.push(o),
  19569. i = a)
  19570. }
  19571. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19572. var s = f.length
  19573. , l = t.get(f[s - 1])
  19574. , c = new Array(s + 1);
  19575. c[c.length - 1] = function() {
  19576. e && e()
  19577. }
  19578. .bind(this);
  19579. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19580. var d = f[h];
  19581. l = t.get(d);
  19582. var p = new P.Vector3;
  19583. this.getLookAtForWalkingTourNode(f, h, p),
  19584. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19585. h--
  19586. }
  19587. c[0]()
  19588. }
  19589. ),
  19590. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19591. h = new P.Vector3,
  19592. u = new P.Vector3,
  19593. d = new P.Vector3,
  19594. p = new P.Vector3,
  19595. function(e, t, i) {
  19596. var n = e.length;
  19597. if (n <= t)
  19598. return !1;
  19599. var r = 1
  19600. , o = 1;
  19601. h.set(0, 0, 0),
  19602. p.set(0, 0, 0);
  19603. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19604. if (a = this.player.model.panos.get(e[s]),
  19605. this.getOrientationForWalkingTourNode(e, s, u),
  19606. s === t && c.copy(u),
  19607. d.copy(u),
  19608. t < s) {
  19609. var l = d.dot(c) < .65;
  19610. r *= l ? .2 : .75,
  19611. o *= l ? .2 : .4
  19612. }
  19613. u.multiplyScalar(r),
  19614. h.add(u),
  19615. p.lerp(a.position, o)
  19616. }
  19617. return h.normalize(),
  19618. i.copy(p),
  19619. i.add(h),
  19620. !0
  19621. }
  19622. ),
  19623. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19624. var n = e.length;
  19625. if (n <= t)
  19626. return !1;
  19627. if (t === n - 1)
  19628. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19629. else {
  19630. var r = this.player.model.panos.get(e[t])
  19631. , o = this.player.model.panos.get(e[t + 1]);
  19632. i.copy(o.position).sub(r.position)
  19633. }
  19634. return i.normalize(),
  19635. !0
  19636. }
  19637. ,
  19638. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19639. if (this.activeTransType = this.upcomingTransType,
  19640. this.lastTransType = this.activeTransType,
  19641. this.upcomingTransType = null,
  19642. e)
  19643. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19644. this._clearWarpShading(),
  19645. this._warpStopFlying(),
  19646. this.player.spider.draw(),
  19647. this.placeCpm(),
  19648. n && n()
  19649. }
  19650. .bind(this)) : this.warpTravel_STD(n);
  19651. else {
  19652. var r = function() {
  19653. this._wrapupTravel(n)
  19654. }
  19655. .bind(this)
  19656. , o = {
  19657. pano: this.warpDestPano,
  19658. lookAtPoint: null,
  19659. duration: null,
  19660. maxDistanceOverride: null,
  19661. skipWarpingCheck: !1
  19662. };
  19663. this.player.flyToPano(o, r)
  19664. }
  19665. }
  19666. ,
  19667. t.prototype.startWarpState = function() {
  19668. this.warping = !0,
  19669. this.warpInterrupted = !1,
  19670. this.warpInterruptionBlackoutStyle = null,
  19671. this.warpInterruptionTravelTime = null
  19672. }
  19673. ,
  19674. t.prototype.endWarpState = function() {
  19675. this.warping = !1
  19676. }
  19677. ,
  19678. t.prototype.warpToPano = function(e, t, i, n) {
  19679. if (this.warping)
  19680. H.warn("Cannot warp when already warping");
  19681. else {
  19682. if (this.upcomingTransType = e,
  19683. this.activeTransType = null,
  19684. !this.setWarpDestPano())
  19685. return this.upcomingTransType = null,
  19686. void this.warpToNonPano(n);
  19687. if (this.player.mode !== O.PANORAMA)
  19688. return this.upcomingTransType = null,
  19689. this.discardSlow(),
  19690. void this.player.flyToNewMode({
  19691. mode: O.PANORAMA,
  19692. pano: this.warpDestPano,
  19693. duration: D.warp.outsideTime,
  19694. warpDest: this.warpDestHeroLoc,
  19695. callback: n,
  19696. force: !0
  19697. });
  19698. if (!this.warpDestPano)
  19699. return H.warn("no warp destination, callback dropped"),
  19700. void (this.upcomingTransType = null);
  19701. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < D.warp.nearPanoDist)
  19702. , o = this.chooseWarpPath(r);
  19703. if (o && this.upcomingTransType !== L.WALK) {
  19704. var a = function() {
  19705. this.waitingToWarp = !1,
  19706. this.warpToPano(e, t, i, n)
  19707. }
  19708. .bind(this);
  19709. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19710. return void (this.waitingToWarp = !0)
  19711. }
  19712. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19713. this.player.currentPano = this.warpDestPano,
  19714. this.placeCpm(),
  19715. this.fadeOutCpm(D.path.fadeOutTime),
  19716. this.player.spider.draw()),
  19717. H.debug("Warping to pano ", this.warpDestPano.position),
  19718. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19719. this.startWarpState();
  19720. var s = function() {
  19721. this.endWarpState(),
  19722. n && n()
  19723. }
  19724. .bind(this);
  19725. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19726. }
  19727. }
  19728. ,
  19729. v.exports = t
  19730. }
  19731. ).call(this, "/js/objects/ShowPath.js")
  19732. }
  19733. , {
  19734. "../constants": 8,
  19735. "../effects": 16,
  19736. "../enum/BlackoutStyle": 18,
  19737. "../enum/ModelManagerEvents": 33,
  19738. "../enum/PlayerEvents": 40,
  19739. "../enum/RenderOrder": 42,
  19740. "../enum/Vectors": 50,
  19741. "../enum/Viewmode": 51,
  19742. "../enum/WarpStyle": 52,
  19743. "../gui/gui": 65,
  19744. "../model/ModelManager": 140,
  19745. "../objects/Snapshot": 153,
  19746. "../settings": 166,
  19747. "../shaders": 167,
  19748. "../util/easing": 186,
  19749. "../util/lerp": 188,
  19750. "../util/logger": 189,
  19751. "../util/math": 190,
  19752. "../util/texture": 194,
  19753. "../util/transitions": 195,
  19754. three: 217
  19755. }],
  19756. 152: [function(e, t, i) {
  19757. "use strict";
  19758. function n() {
  19759. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19760. , t = new r.RawShaderMaterial({
  19761. fragmentShader: o.skysphere.fragmentShader,
  19762. vertexShader: o.skysphere.vertexShader,
  19763. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19764. side: r.BackSide,
  19765. name: "skysphere"
  19766. });
  19767. t.uniforms.radius.value = e.parameters.radius,
  19768. r.Mesh.call(this, e, t)
  19769. }
  19770. var r = e("three")
  19771. , o = e("../shaders")
  19772. , a = e("../settings");
  19773. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19774. t.exports = n
  19775. }
  19776. , {
  19777. "../settings": 166,
  19778. "../shaders": 167,
  19779. three: 217
  19780. }],
  19781. 153: [function(r, o, e) {
  19782. (function(e) {
  19783. "use strict";
  19784. function t(e) {
  19785. n.call(this, e),
  19786. this.sid = e.sid,
  19787. this.panoId = e.panoId,
  19788. this.orthoZoom = e.orthoZoom,
  19789. this.floorVisibility = e.floorVisibility,
  19790. this.thumbUrl = e.thumbUrl,
  19791. this.name = e.name,
  19792. this.zoom = e.zoom
  19793. }
  19794. var i = (r("three"),
  19795. r("../util/logger"))
  19796. , n = (r("../settings"),
  19797. r("../enum/Viewmode"),
  19798. r("../util/common"),
  19799. r("../util/transitions"),
  19800. r("../util/lerp"),
  19801. r("../util/ajax"),
  19802. r("../util/texture"),
  19803. r("./View"));
  19804. r("events").EventEmitter,
  19805. new i(e),
  19806. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19807. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19808. }
  19809. ,
  19810. o.exports = t
  19811. }
  19812. ).call(this, "/js/objects/Snapshot.js")
  19813. }
  19814. , {
  19815. "../enum/Viewmode": 51,
  19816. "../settings": 166,
  19817. "../util/ajax": 181,
  19818. "../util/common": 185,
  19819. "../util/lerp": 188,
  19820. "../util/logger": 189,
  19821. "../util/texture": 194,
  19822. "../util/transitions": 195,
  19823. "./View": 154,
  19824. events: 202,
  19825. three: 217
  19826. }],
  19827. 154: [function(o, a, e) {
  19828. (function(e) {
  19829. "use strict";
  19830. function t(e) {
  19831. e = e || {},
  19832. this.position = new i.Vector3,
  19833. this.quaternion = new i.Quaternion,
  19834. this.update(e)
  19835. }
  19836. var i = o("three")
  19837. , n = o("../util/logger")
  19838. , r = (o("../settings"),
  19839. o("../enum/Viewmode"),
  19840. o("../util/common"),
  19841. o("../util/transitions"),
  19842. o("../util/lerp"),
  19843. o("../util/ajax"),
  19844. o("../util/texture"),
  19845. o("events").EventEmitter);
  19846. new n(e),
  19847. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19848. return !!this.cameraMode
  19849. }
  19850. ,
  19851. t.prototype.update = function(e) {
  19852. return this.cameraMode = e.cameraMode || this.cameraMode,
  19853. this.pano = e.pano || this.pano,
  19854. e.position && this.position.copy(e.position),
  19855. e.quaternion && this.quaternion.copy(e.quaternion),
  19856. this
  19857. }
  19858. ,
  19859. a.exports = t
  19860. }
  19861. ).call(this, "/js/objects/View.js")
  19862. }
  19863. , {
  19864. "../enum/Viewmode": 51,
  19865. "../settings": 166,
  19866. "../util/ajax": 181,
  19867. "../util/common": 185,
  19868. "../util/lerp": 188,
  19869. "../util/logger": 189,
  19870. "../util/texture": 194,
  19871. "../util/transitions": 195,
  19872. events: 202,
  19873. three: 217
  19874. }],
  19875. 155: [function(J, ee, e) {
  19876. (function(e) {
  19877. "use strict";
  19878. function t(e) {
  19879. this.currentPano = null,
  19880. this.nextPano = null,
  19881. this.camera = null,
  19882. this.paused = !1,
  19883. this.flying = !1,
  19884. this.sceneIntersectionPlane = null,
  19885. this.target = new B.Vector3,
  19886. this.mouse = new B.Vector3(1.1,1.1,.5),
  19887. this.mouseAtMouseDown = new B.Vector2,
  19888. this.mouseCouldBeClickToMove = !1,
  19889. this.mouseLastMoveTime = Date.now(),
  19890. this.mouseDown = !1,
  19891. this.mouseDownTimer = null,
  19892. this.couldBeLongTap = !1,
  19893. this.containsMouse = !0,
  19894. this.isTouchEvent = !1,
  19895. this.isPanoHover = !1,
  19896. this.reticule = new n(this),
  19897. this.panoMarkers = [],
  19898. this.spider = new s(this),
  19899. this.quaternion = new B.Quaternion,
  19900. this.position = new B.Vector3(15,10,15),
  19901. this.previousState = null,
  19902. this.lastInsideView = new o,
  19903. this.last360View = new o,
  19904. this.raycaster = new B.Raycaster,
  19905. this.intersect = null,
  19906. this.lastChangeTime = Date.now(),
  19907. this.history = new h,
  19908. this.cameraControls = null,
  19909. this.path = null,
  19910. this.model = null,
  19911. this.domElement = null,
  19912. this.cachedPanoCandidates = null,
  19913. this.basePanoSize = 0,
  19914. this.standardPanoSize = 0,
  19915. this.highPanoSize = 0,
  19916. this.ultraHighPanoSize = 0,
  19917. this.zoomLevel = 1,
  19918. this.zooming = 0,
  19919. this.zoomSpeed = .5,
  19920. this.scrollZoomSpeed = .06,
  19921. this.zoomSpeedAdjust = .05,
  19922. this.defaultZoomIncrement = .2,
  19923. this.baseFov = k.insideFOV,
  19924. this.zoomFov = this.baseFov,
  19925. this.zoomEnabled = !0,
  19926. this.preRenderingEnabled = !1,
  19927. this.setupCustomProperties(e),
  19928. this.zoomStats = new v,
  19929. this.modeTran = ''
  19930. this.currentCursor = '';
  19931. }
  19932. var B = J("three")
  19933. , i = J("./util/logger")
  19934. , n = J("./objects/Reticule")
  19935. , a = J("./objects/Panorama")
  19936. , r = J("./objects/ShowPath")
  19937. , o = J("./objects/View")
  19938. , s = (J("./objects/Snapshot"),
  19939. J("./objects/NSpider"))
  19940. , V = J("./enum/Viewmode")
  19941. , T = (J("./enum/TagStates"),
  19942. J("./enum/Vectors"))
  19943. , l = J("./enum/Keys")
  19944. , k = (J("./enum/AlignmentType"),
  19945. J("./settings"))
  19946. , x = J("./util/common")
  19947. , U = (J("./util/browser"),
  19948. J("./util/math"))
  19949. , H = J("./util/lerp")
  19950. , z = J("./util/easing")
  19951. , G = J("./util/transitions")
  19952. , c = J("events").EventEmitter
  19953. , h = (J("./shaders"),
  19954. J("./util/history"))
  19955. , S = (J("./util/camera"),
  19956. J("./model/ModelManager"),
  19957. J("./enum/PathDiscardMode"))
  19958. , M = J("./enum/PathDisplayMode")
  19959. , W = J("./enum/PlayerEvents")
  19960. , u = J("./enum/ControlEvents")
  19961. , d = J("./enum/ModelManagerEvents")
  19962. , R = J("./enum/WarpStyle")
  19963. , P = J("./enum/BlackoutStyle")
  19964. , p = J("./exception/BasicException")
  19965. , f = J("./enum/PanoSizeClass")
  19966. , g = (J("./tile/TileDownloader"),
  19967. J("./tile/TilePrioritizer"))
  19968. , m = (J("./enum/PanoramaEvents"),
  19969. J("./enum/ZoomEvents"))
  19970. , v = J("./util/ZoomStats")
  19971. , y = J("./constants")
  19972. , j = J("./util/common")
  19973. , A = J("./util/cameraLight")
  19974. , C = J("hot")
  19975. , Y = new i(e)
  19976. , q = Object.freeze({
  19977. FlyToPano: G.getUniqueId(),
  19978. FlyToNewMode: G.getUniqueId(),
  19979. FlyToSameMode: G.getUniqueId(),
  19980. FlyToViewFloor: G.getUniqueId(),
  19981. LookTransition: G.getUniqueId(),
  19982. ZoomTransition: G.getUniqueId()
  19983. });
  19984. function I(e) {
  19985. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  19986. o[r] = n.charCodeAt(r);
  19987. return new Blob([o],{
  19988. type: i
  19989. })
  19990. }
  19991. (t.prototype = Object.create(c.prototype)).init = function(e) {
  19992. (window.player = this).modelManager = e.modelManager,
  19993. this.tileDownloader = e.tileDownloader,
  19994. this.panoRenderer = e.panoRenderer,
  19995. this.qualityManager = e.qualityManager,
  19996. this.domElement = e.container,
  19997. this.camera = e.camera,
  19998. this.tagManager = e.tagManager,
  19999. this.cameraControls = e.controls,
  20000. this.path = new r(e.director,this,e.controls),
  20001. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20002. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20003. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20004. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20005. this.tileDownloader.processPriorityQueue = !1,
  20006. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20007. this.bindEvents(e.container),
  20008. this.updateModel()
  20009. }
  20010. ,
  20011. t.prototype.screenShot = function(i) {
  20012. if (!this.flying && !this.flyingToTag) {
  20013. var n = this.sceneRenderer;
  20014. for (var e in n.updateScreenSize(i),
  20015. this.model.panos.index)
  20016. this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
  20017. this.model.panos.index[e].marker.visible = !1);
  20018. for (var e in this.model.hots)
  20019. this.model.hots[e].mesh.visible = !1;
  20020. this.reticule.visible = !1,
  20021. this.reticule.forceUnvisible = !0,
  20022. this.path.currentPanoMarker.mesh.visible = !1,
  20023. setTimeout(function() {
  20024. n.renderer.clear(!0, !0, !0),
  20025. n.renderer.render(n.scene, n.camera);
  20026. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20027. for (var t in i.f && i.f(e),
  20028. n.updateScreenSize({
  20029. resize: !0
  20030. }),
  20031. this.reticule.visible = !0,
  20032. this.model.hots)
  20033. this.model.hots[t].mesh.visible = !0;
  20034. for (var t in this.model.panos.index)
  20035. this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  20036. this.path.currentPanoMarker.mesh.visible = !0,
  20037. n.renderer.render(n.scene, n.camera)
  20038. }
  20039. .bind(this), 30)
  20040. }
  20041. }
  20042. ;
  20043. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20044. t.prototype.getWrapShot = function() {
  20045. var i = this.getSnapAngleInfo()
  20046. , n = ",{\r\t" + i
  20047. , r = arguments[0];
  20048. this.screenShot({
  20049. width: g_snapShotWidth,
  20050. height: g_snapShotHeight,
  20051. type: "image/jpeg",
  20052. f: function(e) {
  20053. if (r && r.__callback)
  20054. return r.__callback(e, i);
  20055. var t = new Image;
  20056. t.src = e,
  20057. t.onload = function() {
  20058. var e = function(r, i) {
  20059. function n(e, t) {
  20060. var i = o || r
  20061. , n = document.createElement("canvas");
  20062. n.width = i.width,
  20063. n.height = i.height,
  20064. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20065. o = Q(e, n, t)
  20066. }
  20067. function e() {
  20068. var e = o || r
  20069. , t = I(e.src);
  20070. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20071. t = I(e.src)),
  20072. (o = o || new Image).base64Src = e.src,
  20073. o.src = window.URL.createObjectURL(t)
  20074. }
  20075. var o, t = Math.max(r.width, r.height);
  20076. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20077. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20078. e())),
  20079. o || r
  20080. }(this, {
  20081. maxSize: g_snapShotWidth,
  20082. oldType: "jpeg"
  20083. });
  20084. e.src.replace(function(e) {
  20085. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20086. }("image/jpeg"), "image/octet-stream");
  20087. var t = "snap" + (new Date).getTime();
  20088. !function(e, t) {
  20089. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20090. i.href = e,
  20091. i.download = t;
  20092. var n = document.createEvent("MouseEvents");
  20093. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20094. i.dispatchEvent(n)
  20095. }(e.src, t + ".jpg"),
  20096. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20097. n += '\r\t"sid":"' + t + '",',
  20098. n += '\r\t"name":"' + t + '"\r}',
  20099. logData(n)
  20100. }
  20101. }
  20102. })
  20103. }
  20104. /* ,
  20105. t.prototype.getSnapAngleInfo = function() {
  20106. var e = {}
  20107. , t = '"metadata":{'
  20108. , i = this.camera.quaternion.clone();
  20109. switch (this.mode) {
  20110. case "panorama":
  20111. e.scan_id = this.currentPano.id,
  20112. t += '"scan_id":"' + this.currentPano.id + '",';
  20113. break;
  20114. case "floorplan":
  20115. e.camera_mode = 1,
  20116. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20117. t += '"camera_mode":1,',
  20118. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20119. break;
  20120. case "dollhouse":
  20121. e.camera_mode = 2,
  20122. t += '"camera_mode":2,'
  20123. }
  20124. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20125. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20126. n.x *= -1,
  20127. n.w *= -1,
  20128. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20129. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20130. e.zoom = this.zoomLevel,
  20131. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20132. }
  20133. , */
  20134. t.prototype.getSnapAngleInfo = function(){
  20135. var info = {};
  20136. var str = '"metadata":{';
  20137. var q = this.camera.quaternion.clone();
  20138. switch (this.mode) {
  20139. case "panorama":
  20140. info.scan_id = this.currentPano.id;
  20141. str += ('"scan_id":"'+this.currentPano.id+'",');
  20142. break;
  20143. case "floorplan":
  20144. info.camera_mode = 1;
  20145. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20146. q.multiply(this.camera.quaternion);
  20147. str += ('"camera_mode":1,');
  20148. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20149. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20150. break;
  20151. case "dollhouse":
  20152. info.camera_mode = 2;
  20153. str += ('"camera_mode":2,');
  20154. break;
  20155. }
  20156. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20157. //console.log(info.camera_position)
  20158. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20159. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20160. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20161. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20162. out.x *= -1;
  20163. out.w *= -1;
  20164. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20165. }else{
  20166. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20167. } */
  20168. info.zoom = this.zoomLevel;
  20169. //console.log(info.camera_quaternion)
  20170. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20171. // fyz 扩展编辑页面, 加上导览点缩放值
  20172. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20173. console.log(str)
  20174. return str;
  20175. }
  20176. //------end
  20177. t.prototype.closePopup = function() {
  20178. if (g_currentHot) {
  20179. g_currentHot = null,
  20180. document.getElementById("popup").style.display = "none",
  20181. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20182. $("#popup iframe:last").remove();
  20183. document.getElementById("bgaudio");
  20184. if(g_bgAudio && g_bgAudio.pauseByHot){
  20185. manage.switchBgmState(true)
  20186. }
  20187. return false
  20188. }
  20189. }
  20190. ,
  20191. t.prototype.setupCustomProperties = function(e) {
  20192. var i = e || V.PANORAMA;
  20193. Object.defineProperty(this, "mode", {
  20194. get: function() {
  20195. return i
  20196. },
  20197. set: function(e) {
  20198. var t = i;
  20199. i = e,
  20200. this.onModeUpdated(t, i)
  20201. }
  20202. })
  20203. }
  20204. ,
  20205. t.prototype.isInMode = function() {
  20206. for (var e = 0; e < arguments.length; e++)
  20207. if (this.mode === arguments[e])
  20208. return !0;
  20209. return !1
  20210. }
  20211. ,
  20212. t.prototype.isOutsideMode = function(e) {
  20213. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20214. }
  20215. ,
  20216. t.prototype.is360View = function(e, t) {
  20217. return e === V.PANORAMA && t && !t.isAligned()
  20218. }
  20219. ,
  20220. t.prototype.setScene = function(e) {
  20221. this.sceneIntersectionPlane = e.plane,
  20222. this.path.setScene(e),
  20223. this.moveReticuleToScene(e)
  20224. }
  20225. ,
  20226. t.prototype.moveReticuleToScene = function(e) {
  20227. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20228. e.add(this.reticule)
  20229. }
  20230. ,
  20231. t.prototype.updateModel = function() {
  20232. function n(e) {
  20233. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20234. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20235. , n = t.position.y + (e - i.target.y)
  20236. , r = k.showFloorDuration + k.showFloorDelay;
  20237. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20238. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20239. }
  20240. this.model = this.modelManager.getActiveModel(),
  20241. this.model.on("floor.changed", function(e, t, i) {
  20242. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20243. }
  20244. .bind(this)),
  20245. this.model.on("allfloors.toggled", function(e, t) {
  20246. if (this.mode === V.DOLLHOUSE) {
  20247. var i = e ? this.model.center.y : i = t.center.y;
  20248. n.call(this, i)
  20249. }
  20250. }
  20251. .bind(this)),
  20252. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20253. var t = this;
  20254. this.model.panos.list.forEach(function(e) {
  20255. e.vrMarker.addEventListener("click", function() {
  20256. t.flyToPano({
  20257. pano: e
  20258. })
  20259. })
  20260. })
  20261. }
  20262. ,
  20263. t.prototype.updateModelDependentData = function() {
  20264. this.cameraControls.setModelForControls(this.model),
  20265. this.getPanoMarkersFromModel(this.model)
  20266. }
  20267. ,
  20268. t.prototype.onModelChanged = function() {
  20269. this.updateModel(),
  20270. this.updateModelDependentData()
  20271. }
  20272. ,
  20273. t.prototype.getPanoMarkersFromModel = function(e) {
  20274. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20275. return t.marker ? e.concat(t.marker) : e
  20276. }, [])
  20277. }
  20278. ,
  20279. t.prototype.handleControlMove = function(e) {
  20280. this.emit(W.Move, e)
  20281. }
  20282. ,
  20283. t.prototype.handleControlInputStart = function(e) {
  20284. this.emit(W.InputStart, e)
  20285. }
  20286. ,
  20287. t.prototype.onModeUpdated = function(e, t) {
  20288. this.cameraControls.activateControls(t),
  20289. this.emit(W.ModeChanged, e, t)
  20290. }
  20291. ,
  20292. t.prototype.isWarping = function() {
  20293. return this.path.warping
  20294. }
  20295. ,
  20296. t.prototype.isWaitingToWarp = function() {
  20297. return this.path.waitingToWarp
  20298. }
  20299. ,
  20300. t.prototype.getLabelScaleFactor = function() {
  20301. if (this.isOutsideMode()) {
  20302. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20303. }
  20304. return .5
  20305. }
  20306. ,
  20307. t.prototype.changeMusic = function() {
  20308. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20309. }
  20310. ,
  20311. t.prototype.bindEvents = function(e) {
  20312. e !== document && e.setAttribute("tabindex", -1),
  20313. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20314. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20315. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20316. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20317. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20318. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20319. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20320. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20321. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20322. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20323. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20324. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20325. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20326. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20327. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20328. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20329. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20330. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20331. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20332. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20333. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20334. window.getSeft && getSeft(this),
  20335. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20336. }
  20337. ,
  20338. t.prototype.onMouseDown = function(e) {
  20339. e.currentTarget !== document && e.currentTarget.focus(),
  20340. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20341. this.updateIntersect())
  20342. }
  20343. ,
  20344. t.prototype.onMouseMove = function(e) {
  20345. this.isTouchEvent = !1,
  20346. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20347. }
  20348. ,
  20349. t.prototype.onMouseOver = function(e) {
  20350. this.containsMouse = !0,
  20351. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20352. }
  20353. ,
  20354. t.prototype.onMouseOut = function(e) {
  20355. this.containsMouse = !1
  20356. }
  20357. ,
  20358. t.prototype.onMouseUp = function(e) {
  20359. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20360. }
  20361. ,
  20362. t.prototype.onTouchStart = function(e) {
  20363. if (e.currentTarget !== document && e.currentTarget.focus(),
  20364. !this.mouseDown) {
  20365. this.couldBeLongTap = !0;
  20366. var t = x.average(e.changedTouches, "clientX")
  20367. , i = x.average(e.changedTouches, "clientY");
  20368. this.handleInputStart.call(this, t, i, !0),
  20369. this.mouseDownTimer = setTimeout(function() {
  20370. this.updateIntersect(),
  20371. this.handleInputEnd.call(this, t, i, !0)
  20372. }
  20373. .bind(this), k.input.longTapThreshold)
  20374. }
  20375. }
  20376. ,
  20377. t.prototype.onTouchMove = function(e) {
  20378. var t = x.average(e.changedTouches, "clientX")
  20379. , i = x.average(e.changedTouches, "clientY");
  20380. this.handleInputMove.call(this, t, i, !0)
  20381. }
  20382. ,
  20383. t.prototype.onTouchEnd = function(e) {
  20384. if (clearTimeout(this.mouseDownTimer),
  20385. this.mouseDown) {
  20386. this.couldBeLongTap = !1,
  20387. this.updateIntersect();
  20388. var t = x.average(e.changedTouches, "clientX")
  20389. , i = x.average(e.changedTouches, "clientY");
  20390. this.handleInputEnd.call(this, t, i, !0)
  20391. }
  20392. }
  20393. ,
  20394. t.prototype.onPointerDown = function(e) {
  20395. return e.currentTarget !== document && e.currentTarget.focus(),
  20396. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20397. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20398. void (this.mouseDownTimer = setTimeout(function() {
  20399. this.updateIntersect(),
  20400. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20401. }
  20402. .bind(this), k.input.longTapThreshold)))
  20403. }
  20404. ,
  20405. t.prototype.onPointerMove = function(e) {
  20406. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20407. }
  20408. ,
  20409. t.prototype.onPointerUp = function(e) {
  20410. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20411. this.couldBeLongTap = !1,
  20412. this.updateIntersect(),
  20413. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20414. }
  20415. ,
  20416. t.prototype.onPointerOut = function(e) {
  20417. this.mouseDown = !1
  20418. }
  20419. ,
  20420. t.prototype.onPointerCancel = function(e) {
  20421. this.mouseDown = !1
  20422. }
  20423. ,
  20424. t.prototype.onKeyDown = function(e) {
  20425. var t = function() {
  20426. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20427. }
  20428. .bind(this)
  20429. , i = e.which;
  20430. switch (i) {
  20431. case l.F:
  20432. t(),
  20433. this.changeFloor(-1);
  20434. break;
  20435. case l.R:
  20436. t(),
  20437. this.changeFloor(1)
  20438. }
  20439. if (this.mode === V.PANORAMA)
  20440. switch (i) {
  20441. case l.UPARROW:
  20442. case l.W:
  20443. this.flyLocalDirection(T.FORWARD.clone());
  20444. break;
  20445. case l.DOWNARROW:
  20446. case l.S:
  20447. this.flyLocalDirection(T.BACK.clone());
  20448. break;
  20449. case l.A:
  20450. this.flyLocalDirection(T.LEFT.clone());
  20451. break;
  20452. case l.D:
  20453. this.flyLocalDirection(T.RIGHT.clone())
  20454. }
  20455. }
  20456. ,
  20457. t.prototype.handleScrollPinchZoom = function(e) {
  20458. var t = e
  20459. , i = this.zoomLevel;
  20460. this.zoomBy(t),
  20461. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20462. }
  20463. ,
  20464. t.prototype.handleControlPinch = function(e) {
  20465. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20466. }
  20467. ,
  20468. t.prototype.handleControlScroll = function(e) {
  20469. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20470. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20471. }
  20472. ,
  20473. t.prototype.handleInputStart = function(e, t, i) {
  20474. var n = this.handelPadding(e, t);
  20475. e = n.x,
  20476. t = n.y,
  20477. this.isTouchEvent = i,
  20478. U.convertScreenPositionToNDC(e, t, this.mouse),
  20479. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20480. this.mouseCouldBeClickToMove = !0,
  20481. this.mouseDown = !0,
  20482. this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20483. window.transformControls && transformControls.onPointerDown()
  20484. if(!this.overlayInitedPlay && this.overlayGroup.children.length){
  20485. try{
  20486. this.overlayGroup.children.forEach((overlay)=>{overlay.plane.material.map.image.play()})
  20487. }catch(e){}
  20488. this.overlayInitedPlay = true
  20489. }
  20490. }
  20491. ,
  20492. t.prototype.handelPadding = function(e, t) {
  20493. return this.pad || (this.pad = {
  20494. x: dom.getOffset("left", $("#player")[0]),
  20495. y: dom.getOffset("top", $("#player")[0])
  20496. }),
  20497. {
  20498. x: e - this.pad.x,
  20499. y: t - this.pad.y
  20500. }
  20501. }
  20502. ,
  20503. t.prototype.handleInputMove = function(e, t, i) {
  20504. var n = this.handelPadding(e, t);
  20505. e = n.x,
  20506. t = n.y,
  20507. this.isTouchEvent = i,
  20508. U.convertScreenPositionToNDC(e, t, this.mouse);
  20509. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20510. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20511. this.couldBeLongTap = !1,
  20512. clearTimeout(this.mouseDownTimer)),
  20513. this.mouseLastMoveTime = Date.now(),
  20514. this.reticule.move(e, t, i)
  20515. window.transformControls && transformControls.onPointerMove()
  20516. }
  20517. ,
  20518. t.prototype.handleInputEnd = function(e, t, i) {
  20519. if (this.isTouchEvent = i,
  20520. this.mouseDown = !1,
  20521. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20522. !i && this.couldBeLongTap)
  20523. return !0;
  20524. if (this.handleLongTap())
  20525. return !0;
  20526. window.transformControls && transformControls.onPointerUp()
  20527. if (this.mouseCouldBeClickToMove) {
  20528. if (this.flying)
  20529. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20530. !0;
  20531. //add----
  20532. if (this.checkHotClick())
  20533. return !0;
  20534. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20535. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20536. return;
  20537. }
  20538. if (window.VisiSet && VisiSet.setTagVisible ) {
  20539. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20540. return;
  20541. }
  20542. if(this.hoveringPlane){
  20543. this.clickOverlay(this.hoveringPlane)
  20544. return;
  20545. }
  20546. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20547. return EditOverlay.addPlane({intersect:this.intersect});
  20548. }
  20549. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20550. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20551. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20552. } */
  20553. //----------
  20554. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20555. this.history.invalidate(),
  20556. this.intersect)
  20557. return this.flyToPanoClosestToMouse();
  20558. if (this.mode === V.PANORAMA) {
  20559. var n = this.closestPanoInDirection(this.getMouseDirection());
  20560. return n ? this.flyToPano({
  20561. pano: n
  20562. }) : this.bump(this.getMouseDirection())
  20563. }
  20564. }
  20565. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20566. }
  20567. ,
  20568. t.prototype.handleLongTap = function() {
  20569. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20570. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20571. !0
  20572. }
  20573. ,
  20574. t.prototype.checktagClick = function() {
  20575. if (this.tagManager.intersectTag) {
  20576. var e = this.isTouchEvent
  20577. , t = this.tagManager.clickedOnTag(e, this);
  20578. return e || t || G.cancelById(q.LookTransition),
  20579. !0
  20580. }
  20581. if (this.tagManager.activeTag)
  20582. return this.tagManager.dismissActiveTag(),
  20583. !1
  20584. }
  20585. ,
  20586. t.prototype.rankedtagInDirection = function(e, t) {
  20587. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20588. }
  20589. ,
  20590. t.prototype.start = function(e) {
  20591. $(".toolLeft").removeClass("unable");
  20592. $(".toolTop").removeClass("unable");
  20593. //-------------------
  20594. window.initTransformCtl(B)
  20595. window.initOverlay(B)
  20596. this.model.loadOverlays()
  20597. window.EditOverlay && window.EditOverlay.init(B);
  20598. window.VisiSet && VisiSet.init()
  20599. //-------------------
  20600. var t = e.mode
  20601. , i = e.pano
  20602. , n = e.position
  20603. , r = e.quaternion
  20604. , o = e.tag
  20605. , a = e.quickstart
  20606. , s = $.Deferred();
  20607. this.updateModelDependentData(),
  20608. this.updateFromControls(),
  20609. this.findDefaultViews();
  20610. var l = this.is360View(t, i);
  20611. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20612. s.done(function(e) {
  20613. this.emit(W.Ready, l, e, o)
  20614. }
  20615. .bind(this)),
  20616. s.promise()
  20617. }
  20618. ,
  20619. t.prototype.startOutside = function(e, t) {
  20620. var i = e.mode
  20621. , n = e.pano
  20622. , r = e.position
  20623. , o = e.quaternion
  20624. , a = e.zoom
  20625. , s = e.floorVisibility
  20626. , l = e.tag;
  20627. this.emit(W.StartOutside, k[i].transitionTime),
  20628. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20629. G.cancelById(q.FlyToViewFloor),
  20630. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20631. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20632. }
  20633. ,
  20634. t.prototype.startInside = function(e, t, i, n, r) {
  20635. r = r || $.Deferred();
  20636. var o = (this.currentPano = e) && !e.isAligned();
  20637. if (t = o ? e.position : t || e.position,
  20638. i = i || e.quaternion,
  20639. e) {
  20640. var a = this.startInside.bind(this, e, t, i, n, r);
  20641. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20642. return
  20643. }
  20644. return this.mode = V.PANORAMA,
  20645. e.floor.enter(this.mode),
  20646. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20647. this.switchCameraMode(this.mode, i),
  20648. this.emit(W.StartInside, o),
  20649. r.resolve(!0),
  20650. r
  20651. }
  20652. ,
  20653. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20654. if (r = r || $.Deferred(),
  20655. this.dollhouseMode(),
  20656. !i)
  20657. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20658. r.resolve(!1),
  20659. r;
  20660. e = e || i.position;
  20661. var o = n || this.cameraControls.activeControl.camera.quaternion
  20662. , a = i.position;
  20663. return this.fitDollhouse(a, e, o),
  20664. setTimeout(function(e) {
  20665. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20666. var t = {
  20667. mode: V.PANORAMA,
  20668. pano: i,
  20669. quaternion: n,
  20670. callback: function() {
  20671. this.emit(W.FlyinFinished),
  20672. r.resolve(!0)
  20673. }
  20674. .bind(this)
  20675. };
  20676. this.flyToNewMode(t)
  20677. }
  20678. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20679. r
  20680. }
  20681. ,
  20682. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20683. K = {},
  20684. function(t, e, i, n, r, o, a, s, l, c) {
  20685. if (function() {
  20686. for (var e in Z)
  20687. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20688. return !0;
  20689. return !1
  20690. }())
  20691. return !0;
  20692. var h = function(e, t, i) {
  20693. j.delayOneFrame(function() {
  20694. Z[e] = !1,
  20695. r && r(t, i)
  20696. }
  20697. .bind(this))
  20698. }
  20699. .bind(this, t.id)
  20700. , u = function(e, t) {
  20701. j.delayOneFrame(function() {
  20702. Z[e] = !1,
  20703. o && o(t)
  20704. }
  20705. .bind(this))
  20706. }
  20707. .bind(this, t.id);
  20708. try {
  20709. return null != s || (s = !0),
  20710. this.model.supportsTiles ? Z[t.id] = this.checkAndWaitForTiledPanoLoad(t, n, h, u, a, s, l, c) : Z[t.id] = this.checkAndWaitForWholePanoLoad(t, e, i, h, s),
  20711. Z[t.id] && (K[t.id] = performance.now()),
  20712. Z[t.id]
  20713. } catch (e) {
  20714. throw Z[t.id] = !1,
  20715. K[t.id] = performance.now() - 5e3,
  20716. e
  20717. }
  20718. }
  20719. ),
  20720. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20721. if (!e)
  20722. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20723. return r && this.model.waitForLoad(e, function() {
  20724. return e.isLoaded(i)
  20725. }),
  20726. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20727. !0)
  20728. }
  20729. ,
  20730. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20731. function(e, t, i, n, r, o, a, s) {
  20732. if (!e)
  20733. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20734. return X.copy(T.FORWARD),
  20735. this.getDirection(X),
  20736. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20737. return e.isLoaded(t)
  20738. }),
  20739. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20740. i && i(e, t)
  20741. }
  20742. .bind(this)).fail(function(e) {
  20743. n && n(e)
  20744. }
  20745. .bind(this)).progress(function(e, t, i) {
  20746. r && r(e, t, i)
  20747. }
  20748. .bind(this)),
  20749. !0)
  20750. }
  20751. ),
  20752. t.prototype.switchCameraMode = function(e, t) {
  20753. var i = this.cameraControls.controls[e]
  20754. , n = i.camera;
  20755. switch (e) {
  20756. case V.PANORAMA:
  20757. n.position.copy(this.currentPano.position);
  20758. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20759. i.lookAt(r.add(n.position));
  20760. break;
  20761. case V.DOLLHOUSE:
  20762. var o = this.position.clone();
  20763. this.mode === V.PANORAMA ? o.add(new B.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : o.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  20764. n.position.copy(o),
  20765. i.target.copy(this.target.clone().setY(this.model.center.y));
  20766. break;
  20767. case V.FLOORPLAN:
  20768. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20769. i.target.copy(this.model.center).setY(0),
  20770. i.zoomToContain(this.model.size),
  20771. i.rotateToView(this.model.size, this.getDirection())
  20772. }
  20773. i.update(0)
  20774. }
  20775. ,
  20776. t.prototype.update = (new B.Vector3,
  20777. N = {},
  20778. F = [],
  20779. function(e) {
  20780. this.updatePersistentZooming(e),
  20781. this.updateFromControls(e),
  20782. this.getCurrentNodePanos(F)
  20783. if(this.hasChanged(N)){
  20784. this.lastChangeTime = Date.now(),
  20785. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20786. this.emit(W.ViewChanged)
  20787. //add:
  20788. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) VisiSet.updateFootIconSize();
  20789. this.intersectHot && this.intersectHot.showTitle()
  20790. for(var i in this.model.hots){
  20791. this.model.hots[i].update(this.camera)
  20792. }
  20793. }
  20794. this.model.supportsTiles && (this.updateTileDownloader(F),
  20795. this.updatePanoRenderer(F)),
  20796. this.updatePreRendering(F),
  20797. this.reticule.update(),
  20798. this.path.update(),
  20799. this.spider.update(),
  20800. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20801. this.updateControlLocks(),
  20802. this.model.supportsTiles && this.updateZoomPano()
  20803. }
  20804. ),
  20805. t.prototype.updatePersistentZooming = function(e) {
  20806. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20807. }
  20808. ,
  20809. t.prototype.updateControlLocks = function() {
  20810. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20811. }
  20812. ,
  20813. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20814. function(e) {
  20815. var t = this.nextPano || this.currentPano;
  20816. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20817. this.getDirection(D),
  20818. this.panoRenderer.updateDirection(D))
  20819. }
  20820. ),
  20821. t.prototype.cleanupInactivePanos = (O = [],
  20822. L = [],
  20823. function() {
  20824. O.length = 0,
  20825. O.push(this.currentPano),
  20826. this.nextPano && O.push(this.nextPano);
  20827. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20828. L.push(this.panoRenderer.activePanos[e]);
  20829. for (var t = 0; t < L.length; t++) {
  20830. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20831. i.id === O[r].id && (n = !1);
  20832. n && i.exit()
  20833. }
  20834. }
  20835. ),
  20836. t.prototype.updatePreRendering = (w = {},
  20837. function(e) {
  20838. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20839. var t = this.nextPano || this.currentPano;
  20840. if (t && e && 1 < e.length) {
  20841. var i = e.findIndex(function(e) {
  20842. if (e.id === t.id)
  20843. return !0
  20844. });
  20845. if (0 <= i && i + 1 < e.length) {
  20846. var n = e[i + 1];
  20847. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  20848. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20849. window.setTimeout(function(e) {
  20850. w[e.id] = !1
  20851. }
  20852. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  20853. }
  20854. .bind(this, n), k.tiling.panoPreRenderDelay),
  20855. w[n.id] = !0)
  20856. }
  20857. }
  20858. }
  20859. }
  20860. ),
  20861. t.prototype.enablePreRendering = function() {
  20862. this.preRenderingEnabled = !0
  20863. }
  20864. ,
  20865. t.prototype.disablePreRendering = function() {
  20866. this.preRenderingEnabled = !1,
  20867. this.cleanupInactivePanos()
  20868. }
  20869. ,
  20870. t.prototype.updateTileDownloader = (b = new B.Vector3,
  20871. function(e) {
  20872. var t = this.nextPano || this.currentPano;
  20873. t && (b.copy(T.FORWARD),
  20874. this.getDirection(b),
  20875. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  20876. this.tileDownloader.processPriorityQueue = !0)
  20877. }
  20878. ),
  20879. t.prototype.updateFromControls = function(e) {
  20880. null != e || (e = 0),
  20881. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  20882. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  20883. this.position.copy(this.cameraControls.activeControl.camera.position),
  20884. this.target.copy(this.cameraControls.activeControl.target),
  20885. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  20886. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  20887. this.camera.position.copy(this.position),
  20888. this.camera.quaternion.copy(this.quaternion),
  20889. this.camera.updateMatrix(),
  20890. this.camera.updateMatrixWorld()
  20891. }
  20892. ,
  20893. t.prototype.hasChanged = function(e) {
  20894. if (!this.previousState)
  20895. return this.previousState = {
  20896. allFloorsVisible: this.model.allFloorsVisible,
  20897. position: this.position.clone(),
  20898. quaternion: this.quaternion.clone(),
  20899. mouse: this.mouse.clone(),
  20900. labelScaleFactor: this.getLabelScaleFactor(),
  20901. currentFloor: this.model.currentFloor,
  20902. projectionMatrix: this.camera.projectionMatrix.clone(),
  20903. worldMatrix: this.camera.matrixWorld.clone(),
  20904. mode: this.mode,
  20905. modelPosition: this.model.position.clone(),
  20906. modelCenter: this.model.center.clone(),
  20907. zoomLevel: this.zoomLevel
  20908. },
  20909. !0;
  20910. 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;
  20911. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  20912. e.moved = !this.position.equals(this.previousState.position),
  20913. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  20914. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  20915. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  20916. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  20917. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  20918. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  20919. e.modeChanged = this.mode !== this.previousState.mode,
  20920. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  20921. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  20922. e.nextPanoActive = null !== this.nextPano,
  20923. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  20924. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  20925. this.previousState.position.copy(this.position),
  20926. this.previousState.quaternion.copy(this.quaternion),
  20927. this.previousState.mouse.copy(this.mouse),
  20928. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  20929. this.previousState.currentFloor = this.model.currentFloor,
  20930. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  20931. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  20932. this.previousState.mode = this.mode,
  20933. this.previousState.modelPosition.copy(this.model.position),
  20934. this.previousState.modelCenter.copy(this.model.center),
  20935. this.previousState.zoomLevel = this.zoomLevel,
  20936. !t
  20937. }
  20938. ,
  20939. t.prototype.updateIntersect = function() {
  20940. var e = this.flying || this.isWarping()
  20941. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  20942. , i = G.getById(q.LookTransition);
  20943. e || t || this.isTouchEvent || i.length && i[0].running;
  20944. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) {
  20945. this.intersect = this.getMouseIntersect(null, VisiSet.footIcons);
  20946. if (this.intersect && this.intersect.object.visible )
  20947. $("#player").css("cursor", "pointer");
  20948. else
  20949. $("#player").css("cursor", "")
  20950. return;
  20951. }
  20952. this.intersect = this.getMouseIntersect(),
  20953. this.intersect && this.updateClosestPano(this.intersect),
  20954. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  20955. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  20956. }
  20957. ,
  20958. t.prototype.checkHotClick = function() {
  20959. if (this.intersectHot){
  20960. if (window.VisiSet && VisiSet.setTagVisible ) {
  20961. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  20962. return;
  20963. }
  20964. return this.intersectHot.examine(this),
  20965. !0
  20966. }
  20967. }
  20968. ,
  20969. t.prototype.getMouseDirection = function(e) {
  20970. e = e || this.mouse;
  20971. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  20972. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  20973. }
  20974. ,
  20975. t.prototype.hoverOverlay = function(mesh){
  20976. if(!mesh){
  20977. this.hoveringPlane = null;
  20978. $("#player").css("cursor",this.currentCursor || "" );
  20979. }else{
  20980. var overlay = mesh.parent;
  20981. $("#player").css("cursor","pointer");
  20982. this.hoveringPlane = overlay;
  20983. return true;
  20984. }
  20985. },
  20986. t.prototype.clickOverlay = function(overlay){
  20987. if(this.openOverlay && !overlay)return;
  20988. var plane = overlay.plane;
  20989. if(overlay.overlayType == "video"){
  20990. if(plane.material.map.image.paused)plane.material.map.image.play()
  20991. else plane.material.map.image.pause();
  20992. }
  20993. if(window.EditOverlay &&EditOverlay.editing){
  20994. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  20995. $('#overlayProp').removeClass('atRight').removeClass('hide')
  20996. EditOverlay.endAddPlane();
  20997. EditOverlay.updateOverlayPanel(overlay)
  20998. transformControls.attach(overlay)
  20999. return;
  21000. }
  21001. },
  21002. t.prototype.getMouseIntersect = function(e, t) {
  21003. e = e || this.mouse.clone(),
  21004. t = t || this.model.floors.reduce(function(e, t) {
  21005. return t.hidden ? e : e.concat(t.collider.children)
  21006. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21007. t = t.slice(0)
  21008. for (var i in this.model.hots) t.push(this.model.hots[i].mesh);
  21009. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  21010. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21011. this.raycaster.set(i, this.getMouseDirection(e));
  21012. var n = this.raycaster.intersectObjects(t, true);//add true
  21013. if ("add" == g_HotStatus) {
  21014. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  21015. //console.log(r[0]),
  21016. 1 <= r.length ? ($("#player").css("cursor", "cell"),
  21017. window.hotIntersect = r[0]) : ($("#player").css("cursor", "not-allowed"),
  21018. window.hotIntersect = !1)
  21019. return;
  21020. }
  21021. this.intersectHot && this.intersectHot.hideTitle()
  21022. if (0 === n.length)
  21023. return this.intersectHot = null,
  21024. "add" != g_HotStatus && $("#player").css("cursor", ""),
  21025. null;
  21026. var o = n[0];
  21027. if ("hotSprite" == o.object.type){
  21028. return this.intersectHot = o.object.belongHot,
  21029. this.intersectHot.showTitle(),
  21030. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active"),
  21031. void $("#player").css("cursor", "pointer");
  21032. }
  21033. $(".toolRight .spotList ul li").removeClass("active")
  21034. this.intersectHot = null;
  21035. /* if(window.EditOverlay && n && n.length){
  21036. if(n[0].object.parent.parent == this.overlayGroup){
  21037. this.hoverOverlay(n[0].object);
  21038. }else()
  21039. } */
  21040. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  21041. intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
  21042. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21043. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21044. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21045. o.horizontal = .8 < o.normal.y);
  21046. return o
  21047. }
  21048. ,
  21049. t.prototype.updateClosestPano = function(e) {
  21050. var t = [a.filters.isPanoAligned()];
  21051. if (this.mode === V.PANORAMA) {
  21052. if (!this.currentPano)
  21053. return;
  21054. t.push(a.filters.not(this.currentPano)),
  21055. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21056. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21057. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21058. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21059. } else{
  21060. t.push((pano)=>{ // add
  21061. return this.checkHasNeighbor(pano)
  21062. })
  21063. t.push(a.filters.isOnVisibleFloor()),
  21064. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21065. }
  21066. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21067. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21068. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21069. this.closestPano = i) : this.isPanoHover = !1
  21070. }
  21071. ,
  21072. t.prototype.dollhouseMode = function(e, t) {
  21073. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21074. this.mode = V.DOLLHOUSE,
  21075. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21076. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21077. , n = new B.Vector3(15,10,15);
  21078. if (e && t) {
  21079. var r = T.FORWARD.clone().applyQuaternion(t)
  21080. , o = this.model.center.clone().sub(e).dot(r);
  21081. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21082. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21083. }
  21084. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21085. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21086. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21087. this.updateFromControls(),
  21088. this.model.alpha = 1,
  21089. this.model.skybox.material.uniforms.opacity.value = 0
  21090. }
  21091. ,
  21092. t.prototype.insideMode = function(e, t) {
  21093. var i = $.Deferred()
  21094. , n = t || null;
  21095. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21096. var r = [a.filters.isPanoAligned()];
  21097. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21098. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21099. this.flyToNewMode({
  21100. mode: V.PANORAMA,
  21101. pano: e,
  21102. callback: n
  21103. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21104. } else {
  21105. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21106. i.reject(o)
  21107. }
  21108. return i.promise()
  21109. }
  21110. ,
  21111. t.prototype.fitDollhouse = function(e, t, i) {
  21112. var n = T.FORWARD.clone().applyQuaternion(i);
  21113. i = n.clone().add(e);
  21114. this.cameraControls.activeControl.target.copy(i),
  21115. this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(e).add(n.multiplyScalar(-10))
  21116. }
  21117. ,
  21118. t.prototype.floorplanMode = function(e, t, i) {
  21119. this.mode = V.FLOORPLAN;
  21120. var n = this.cameraControls.controls[V.FLOORPLAN];
  21121. n.reset();
  21122. var r = e || this.model.center;
  21123. if (n.target.copy(r).setY(0),
  21124. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21125. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21126. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21127. t) {
  21128. var o = T.LEFT.clone().applyQuaternion(t);
  21129. n.rotateLeft(-Math.atan2(o.x, o.z))
  21130. } else
  21131. n.rotateToView(this.model.size, this.getDirection());
  21132. n.update(0)
  21133. }
  21134. ,
  21135. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21136. return e.skipWarpingCheck = !0,
  21137. this.flyToPano(e, t)
  21138. }
  21139. ,
  21140. t.prototype.updateMarkerVisi = function() {//加
  21141. if(this.mode != "panorama")return;
  21142. this.model.panos.list.forEach((pano)=>{
  21143. if(!pano.marker)return;
  21144. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21145. })
  21146. }
  21147. ,
  21148. t.prototype.updateHotVisible = function(pano){
  21149. var hots = this.model.hots;
  21150. pano = pano || this.currentPano;
  21151. for (var index in hots){
  21152. var visible;
  21153. if(this.mode != "panorama"){
  21154. visible = true;
  21155. }else{
  21156. //hots[index].mesh.material.depthTest = false;
  21157. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21158. }
  21159. hots[index].mesh.visible = visible;
  21160. }
  21161. },
  21162. t.prototype.flyToPano = function(e, t) {
  21163. var i, n = e.pano, r = e.lookAtPoint, o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride, l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null;
  21164. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21165. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21166. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21167. t && t(),
  21168. !1;
  21169. if (this.updateLastView(),
  21170. this.mode !== V.PANORAMA)
  21171. return r && (i = (new B.Quaternion).setFromUnitVectors(T.FORWARD, r.sub(n.position).normalize())),
  21172. void this.flyToNewMode({
  21173. mode: V.PANORAMA,
  21174. pano: n,
  21175. duration: o,
  21176. quaternion: i,
  21177. callback: t
  21178. });
  21179. if (!n || (h = x.deepExtend(e),
  21180. u = function() {
  21181. j.delayOneFrame(function() {
  21182. this.flyToPano(h, t)
  21183. }
  21184. .bind(this))
  21185. }
  21186. .bind(this),
  21187. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21188. var d = function(e) {
  21189. t && t(e)
  21190. }
  21191. .bind(this);
  21192. this.currentPano || (this.currentPano = n,
  21193. this.path.placeCpm(),
  21194. this.path.fadeOutCpm(k.path.fadeOutTime),
  21195. this.spider.draw());
  21196. var p = o;
  21197. if ("number" != typeof o) {
  21198. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21199. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21200. }
  21201. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21202. 1 !== this.zoomLevel)
  21203. switch (k.zoom.transitionStyle) {
  21204. case 1:
  21205. this.smoothZoomToDefault(p / 2);
  21206. break;
  21207. case 2:
  21208. return h = x.deepExtend(e),
  21209. u = this.flyToPano.bind(this, h, t),
  21210. void this.smoothZoomToDefault(k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21211. }
  21212. if (r) {
  21213. G.cancelById(q.LookTransition),
  21214. p *= k.transition.aimSlowFactor;
  21215. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21216. , m = (new B.Matrix4).lookAt(n.position, r, T.UP)
  21217. , v = (new B.Quaternion).setFromRotationMatrix(m)
  21218. , y = g.clone()
  21219. , A = new B.Vector3;
  21220. if (n === this.currentPano) {
  21221. var C = T.FORWARD.clone().applyQuaternion(g)
  21222. , I = T.FORWARD.clone().applyQuaternion(v)
  21223. , E = C.angleTo(I);
  21224. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21225. void G.start(function(e) {
  21226. y.copy(g),
  21227. H.quaternion(y, v)(e),
  21228. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21229. this.cameraControls.activeControl.lookAt(A)
  21230. }
  21231. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21232. }
  21233. }
  21234. if (n === this.currentPano || this.flying)
  21235. return void d();
  21236. this.flying = !0;
  21237. var _ = this.position.clone()
  21238. , b = this.currentPano;
  21239. Y.debug("Flying to pano ", n.position);
  21240. this.emit(W.PanoChosen, this.currentPano, n);
  21241. this.emit(W.FlyingStarted, n.position, _, n, b);
  21242. this.updateHotVisible(n); //更新热点显示
  21243. r && G.start(function(e) {
  21244. y.copy(g),
  21245. H.quaternion(y, v)(e),
  21246. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21247. this.cameraControls.activeControl.lookAt(A)
  21248. }
  21249. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21250. var w = c ? null : z[k.transition.movementEasing];
  21251. this.nextPano = n,
  21252. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21253. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21254. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21255. this.flying = !1,
  21256. this.currentPano !== n && this.currentPano.exit(),
  21257. n.enter(),
  21258. this.currentPano = n,
  21259. this.nextPano = null,
  21260. this.path.placeCpm(),
  21261. this.path.fadeOutCpm(k.path.fadeOutTime),
  21262. this.spider.draw(),
  21263. this.emit(W.FlyingEnded, n.position, _, n, b),
  21264. this.updateMarkerVisi();//add
  21265. d(e)
  21266. }
  21267. .bind(this), 0, w, "camFly", q.FlyToPano)
  21268. }
  21269. }
  21270. ,
  21271. t.prototype.fastForwardActivePanoFlight = function(e) {
  21272. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21273. G.adjustSpeed(q.FlyToPano, e),
  21274. G.adjustSpeed(q.LookTransition, e)
  21275. }
  21276. ,
  21277. t.prototype.flyToPanoClosestToMouse = function() {
  21278. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21279. this.intersect && this.updateClosestPano(this.intersect)),
  21280. this.closestPano)
  21281. return this.flyToPano({
  21282. pano: this.closestPano
  21283. });
  21284. var e = this.getMouseDirection();
  21285. this.flyDirection(e) || this.flyToPano({
  21286. pano: this.currentPano
  21287. })
  21288. }
  21289. ,
  21290. t.prototype.flyLocalDirection = function(e) {
  21291. var t = this.getDirection(e)
  21292. , i = 1 === e.z ? .4 : .75
  21293. , n = 1 === Math.abs(e.x);
  21294. return this.flyDirection(t, i, n)
  21295. }
  21296. ,
  21297. t.prototype.flyDirection = function(e, t, i) {
  21298. this.closePopup();
  21299. var n = $.Deferred();
  21300. this.history.invalidate();
  21301. var r = this.closestPanoInDirection(e, t, i);
  21302. return r ? this.flyToPano({
  21303. pano: r
  21304. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21305. n.resolve(!1)),
  21306. n.promise()
  21307. }
  21308. ,
  21309. t.prototype.closestPanoInDirection = function(e, t, i) {
  21310. return this.rankedPanoInDirection(0, e, t, i)
  21311. }
  21312. ,
  21313. t.prototype.rankedPanoInDirection = (_ = {
  21314. pano: null,
  21315. candidates: []
  21316. },
  21317. function(e, t, i, n) {
  21318. e = e || 0,
  21319. i = void 0 !== i ? i : .75;
  21320. var r = n ? "angle" : "direction";
  21321. return this.model.panos.findRankedByScore(e, [a.filters.isPanoAligned(), a.filters.inPanoDirection(this.position, t, i), a.filters.isNeighbourPanoTo(this.currentPano), a.filters.not(this.currentPano)], [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  21322. this.cachedPanoCandidates = _.candidates,
  21323. _.pano
  21324. }
  21325. ),
  21326. t.prototype.bump = function(e) {
  21327. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21328. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21329. if (.5 < Math.abs(a))
  21330. t = function() {
  21331. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21332. }
  21333. .bind(this),
  21334. i = function() {
  21335. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21336. }
  21337. .bind(this);
  21338. else {
  21339. var s = this.camera.position.clone()
  21340. , l = e.clone();
  21341. this.raycaster.set(s, l);
  21342. var c = this.model.floors.reduce(function(e, t) {
  21343. return e.concat(t.collider.children)
  21344. }, [])
  21345. , h = this.raycaster.intersectObjects(c)
  21346. , u = 0 < h.length ? h[0].distance / 25 : .04
  21347. , d = s.clone().add(l.multiplyScalar(u));
  21348. t = function() {
  21349. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21350. }
  21351. .bind(this),
  21352. i = function() {
  21353. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21354. }
  21355. .bind(this)
  21356. }
  21357. n = function() {
  21358. this.flying = !1
  21359. }
  21360. .bind(this),
  21361. this.flying = !0,
  21362. t()
  21363. }
  21364. }
  21365. ,
  21366. t.prototype.changeFloor = function(e) {
  21367. if (!this.is360View(this.mode, this.currentPano))
  21368. if (this.mode === V.PANORAMA) {
  21369. var t = this.history.reversePano(e);
  21370. t && t.isAligned() ? this.flyToPano({
  21371. pano: t
  21372. }) : this.changeFloorByScore(e)
  21373. } else
  21374. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21375. }
  21376. ,
  21377. t.prototype.changeFloorByScore = (E = {
  21378. pano: null,
  21379. candidates: []
  21380. },
  21381. function(e) {
  21382. var t = this.model.nextFloor(e);
  21383. return t ? (this.model.panos.lowestByScore([a.filters.atFloor(t), a.filters.isPanoAligned()], [a.scoreFunctions.distance(this.currentPano), a.scoreFunctions.direction(this.position, new B.Vector3(0,e,0)), a.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], E),
  21384. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21385. this.history.push(e, this.currentPano),
  21386. this.flyToPano({
  21387. pano: E.pano
  21388. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21389. }
  21390. ),
  21391. t.prototype.gotoFloor = function(e) {
  21392. var t = e - this.model.currentFloor.floorIndex;
  21393. this.changeFloor(t)
  21394. }
  21395. ,
  21396. t.prototype.getDirection = function(e) {
  21397. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21398. }
  21399. ,
  21400. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21401. if (r = r || $.Deferred(),
  21402. this.mode === V.TRANSITIONING)
  21403. return Y.warn("should not be transitioning here"),
  21404. n && n(!1),
  21405. r.reject().promise();
  21406. var o = i || !1
  21407. , a = i ? i.position : this.position
  21408. , s = this.position.clone()
  21409. , l = this.currentPano;
  21410. if (Y.debug("New pose in mode " + this.mode),
  21411. !e || (retryCallback = function() {
  21412. j.delayOneFrame(function() {
  21413. this.flyToSameMode(e, t, i, n, r)
  21414. }
  21415. .bind(this))
  21416. }
  21417. .bind(this),
  21418. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21419. var c = function() {
  21420. this.emit(W.FlyingEnded, a, s, e, l),
  21421. n && n(!0)
  21422. }
  21423. .bind(this)
  21424. , h = k[this.mode]
  21425. , u = void 0 !== t ? t : h.transitionTime
  21426. , d = new B.Vector3
  21427. , p = new B.Vector3;
  21428. if (this.emit(W.FlyingStarted, a, s, e, l),
  21429. this.mode === V.PANORAMA)
  21430. Y.warn("we should not be here for panorama views");
  21431. else if (this.mode === V.DOLLHOUSE)
  21432. if (o) {
  21433. var f = new B.Vector3(0,1,0);
  21434. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21435. this.model.warpDestFloors(i.floorVisibility),
  21436. p.copy(i.position);
  21437. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21438. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21439. , v = 3;
  21440. m.length ? (d.copy(m[0].point),
  21441. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21442. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21443. var y = (new B.Matrix4).lookAt(p, d, f)
  21444. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21445. , C = d.distanceTo(p)
  21446. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21447. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21448. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21449. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21450. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21451. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21452. this.path.burnsDir = Math.sign(b.y);
  21453. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21454. , T = new B.Vector3;
  21455. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21456. G.start(function(e, t) {
  21457. w.x = E.x + e * b.x,
  21458. w.y = E.y + e * b.y,
  21459. w.z = E.z + e * b.z;
  21460. var i = _ + e * (C - _);
  21461. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21462. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21463. }
  21464. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21465. G.start(function(e, t) {
  21466. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21467. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21468. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21469. }
  21470. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21471. } else
  21472. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21473. else if (this.path.placeCpm(),
  21474. this.path.fadeInCpm(k.path.fadeInTime),
  21475. i) {
  21476. this.model.warpDestFloors(i.floorVisibility);
  21477. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21478. , S = this.cameraControls.controls[V.FLOORPLAN]
  21479. , M = S.target.clone()
  21480. , R = i.position.clone().sub(M)
  21481. , P = x.position.clone().sub(S.target).length()
  21482. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21483. , L = Math.atan2(S.offset.x, S.offset.z)
  21484. , D = Math.atan2(O.x, O.z)
  21485. , N = S.absoluteScale
  21486. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21487. G.start(function(e, t) {
  21488. S.target.copy(R).multiplyScalar(e).add(M);
  21489. var i = L + (D - L) * e;
  21490. S.offset.x = P * Math.sin(i),
  21491. S.offset.z = P * Math.cos(i),
  21492. x.position.copy(S.target).add(S.offset),
  21493. S.absoluteScale = N + e * (F - N),
  21494. S.update(),
  21495. this.quaternion.copy(x.quaternion),
  21496. this.position.copy(x.position),
  21497. this.target.copy(S.target),
  21498. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21499. }
  21500. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21501. } else
  21502. Y.info("flyToSameMode() funny floorplan view? skipping");
  21503. return G.setTimeout(function(e) {
  21504. this.mode = e,
  21505. c(),
  21506. r.resolve(!0)
  21507. }
  21508. .bind(this, this.mode), u, q.FlyToSameMode),
  21509. this.mode = V.TRANSITIONING,
  21510. r.promise()
  21511. }
  21512. }
  21513. ,
  21514. t.prototype.flyToNewMode = function(e, t) {
  21515. var i = (e = e || {}).mode
  21516. , n = e.pano
  21517. , r = e.duration
  21518. , o = e.warpDest
  21519. , a = e.callback
  21520. , s = e.force
  21521. , l = e.quaternion;
  21522. if (t = t || $.Deferred(),
  21523. this.isWarping())
  21524. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21525. a && a(!1),
  21526. t.reject("Cannot change mode during tour transition").promise();
  21527. if (this.mode === V.TRANSITIONING)
  21528. return a && a(!1),
  21529. t.reject("Cannot change mode during mode transition").promise();
  21530. if (i === this.mode)
  21531. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21532. t.promise()) : (a && a(!1),
  21533. t.reject("Already in " + i + " mode").promise());
  21534. var c = o || !1;
  21535. Y.debug("Switching mode to " + i);
  21536. var h = function() {
  21537. j.delayOneFrame(function() {
  21538. this.flyToNewMode(e, t)
  21539. }
  21540. .bind(this))
  21541. }
  21542. .bind(this);
  21543. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21544. return t.promise();
  21545. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21546. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21547. this.model.waitForLoad(this.model, function() {
  21548. return this.model.meshTexturesLoaded
  21549. }
  21550. .bind(this)),
  21551. this.model.loadMeshTextures().done(h),
  21552. t.promise();
  21553. this.history.invalidate(),
  21554. this.updateLastView();
  21555. var u = this.mode
  21556. , d = this.cameraControls.cameras[i];
  21557. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21558. var p = void 0 !== r ? r : e.transitionTime;
  21559. this.emit(W.ModeChanging, u, i, n),
  21560. n && (this.currentPano = n),
  21561. this.switchCameraMode(i, l),
  21562. G.cancelById(q.LookTransition);
  21563. var f = (new B.Vector3).copy(this.position);
  21564. this.modeTran = this.mode + "-" + i;
  21565. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)){
  21566. VisiSet.finishSetPanoVisible()
  21567. VisiSet.finishSetTagVisible()
  21568. }
  21569. if(editTool.atPanel == "screen"){
  21570. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21571. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21572. }
  21573. if (i === V.PANORAMA)
  21574. this.emit(W.PanoChosen, n, n),
  21575. setTimeout(function() {
  21576. n.floor.enter(i)
  21577. }
  21578. .bind(this), p / 2),
  21579. this.path.fadeOutCpm(k.path.fadeOutTime);
  21580. else if (i === V.DOLLHOUSE) {
  21581. if (c && (this.model.stayPut = !0),
  21582. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21583. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21584. this.path.placeCpm(),
  21585. this.path.fadeInCpm(k.path.fadeInTime),
  21586. c) {
  21587. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21588. f.set(15, 10, 15);
  21589. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21590. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21591. v.length ? (g.copy(v[0].point),
  21592. f.copy(o.position),
  21593. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(.75 * f.distanceTo(g), !0)) : (Y.warn("Tried to restore dollhouse mode that did not intersect...", o.position, o.quaternion),
  21594. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21595. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21596. f.add(this.model.position),
  21597. d.position.copy(f),
  21598. this.cameraControls.controls[V.DOLLHOUSE].update()
  21599. }
  21600. } else if (this.path.placeCpm(),
  21601. this.path.fadeInCpm(k.path.fadeInTime),
  21602. o) {
  21603. this.model.warpDestFloors(o.floorVisibility);
  21604. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21605. , A = this.cameraControls.controls[V.FLOORPLAN]
  21606. , C = y.position.clone().sub(A.target)
  21607. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21608. , E = Math.atan2(I.x, I.z);
  21609. A.target.copy(o.position);
  21610. var _ = C.length();
  21611. A.offset.x = _ * Math.sin(E),
  21612. A.offset.y = 0,
  21613. A.offset.z = _ * Math.cos(E),
  21614. y.position.copy(A.target).add(A.offset),
  21615. A.target.clone().sub(d.position),
  21616. d.quaternion.copy(o.quaternion),
  21617. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21618. A.absoluteScale = A.currentScale,
  21619. A.update()
  21620. } else
  21621. this.model.currentFloor.enter(i);
  21622. var b = this.currentPano
  21623. , w = this.position.clone();
  21624. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21625. this.flying = !0,
  21626. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21627. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21628. d.controls.update()),
  21629. e.blackoutStyle = P.FADEIN,
  21630. p = k.show360Views.transitionTime,
  21631. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21632. this.mode = i,
  21633. this.path && this.path.popOutCpm(),
  21634. e.blackoutStyle = P.END,
  21635. p = k.show360Views.transitionTime,
  21636. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21637. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21638. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21639. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21640. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21641. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21642. G.setTimeout(function() {
  21643. this.flying = !1,
  21644. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21645. this.currentPano.enter(),
  21646. this.path.placeCpm(),
  21647. this.path.fadeOutCpm(k.path.fadeOutTime),
  21648. this.spider.draw()),
  21649. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21650. this.mode = i,
  21651. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21652. if (this.afterCModeFuc) {
  21653. //手动加的函数
  21654. var cf = this.afterCModeFuc;
  21655. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  21656. cf();
  21657. }
  21658. this.updateMarkerVisi();//add
  21659. (u === V.PANORAMA || i == V.PANORAMA) && this.updateHotVisible()//add
  21660. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21661. t.resolve())
  21662. }
  21663. .bind(this), p, q.FlyToNewMode),
  21664. this.mode = V.TRANSITIONING,
  21665. t.promise()
  21666. }
  21667. ,
  21668. t.prototype.fade360View = function(e, t, i) {
  21669. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21670. $(this.domElement).fadeOut(.5 * e, function() {
  21671. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21672. this.model.alpha = i.modelAlpha,
  21673. this.position.copy(t.position),
  21674. this.quaternion.copy(t.quaternion),
  21675. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21676. $(this.domElement).fadeIn(.5 * e)
  21677. }
  21678. .bind(this))
  21679. }
  21680. ,
  21681. t.prototype.findDefaultViews = function() {
  21682. this.findDefaultView(this.lastInsideView, !0),
  21683. this.findDefaultView(this.last360View, !1)
  21684. }
  21685. ,
  21686. t.prototype.findDefaultView = function(e, i) {
  21687. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21688. if (e.cameraMode !== V.PANORAMA)
  21689. return !1;
  21690. var t = r.get(e.panoId);
  21691. return t && t.isAligned() === i
  21692. });
  21693. 0 <= o ? (t = r.get(n[o].panoId),
  21694. e.update({
  21695. cameraMode: V.PANORAMA,
  21696. pano: t,
  21697. position: n[o].position,
  21698. quaternion: n[o].quaternion
  21699. })) : 0 <= (o = r.list.findIndex(function(e) {
  21700. return e.isAligned() === i
  21701. })) ? (t = r.list[o],
  21702. e.update({
  21703. cameraMode: V.PANORAMA,
  21704. pano: t,
  21705. position: t.position
  21706. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  21707. }
  21708. ,
  21709. t.prototype.updateLastView = function() {
  21710. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  21711. pano: this.currentPano,
  21712. position: this.position,
  21713. quaternion: this.quaternion
  21714. })
  21715. }
  21716. ,
  21717. t.prototype.goToLastView = function(e, t) {
  21718. var i = $.Deferred()
  21719. , n = i.resolve.bind(i)
  21720. , r = i.reject.bind(i)
  21721. , o = e ? this.lastInsideView : this.last360View;
  21722. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  21723. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  21724. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  21725. mode: o.cameraMode,
  21726. pano: o.pano,
  21727. quaternion: o.quaternion,
  21728. callback: t
  21729. }).done(n).fail(r),
  21730. i.promise()
  21731. }
  21732. ,
  21733. t.prototype.fadeToView = function(e, t, i, n) {
  21734. var r = $.Deferred()
  21735. , o = r.resolve.bind(r)
  21736. , a = r.reject.bind(r);
  21737. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  21738. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  21739. a("Cannot go to illegal view"),
  21740. r.promise();
  21741. var s = (k[t.cameraMode],
  21742. function() {
  21743. $(this.domElement).fadeIn(.5 * i),
  21744. n && n(),
  21745. o()
  21746. }
  21747. .bind(this))
  21748. , l = e ? P.FADEIN : P.END;
  21749. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  21750. $(this.domElement).fadeOut(.5 * i, function() {
  21751. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  21752. t.cameraMode === V.PANORAMA ? this.flyToPano({
  21753. pano: t.pano,
  21754. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  21755. duration: 0
  21756. }, s) : this.flyToNewMode({
  21757. mode: t.cameraMode,
  21758. quaternion: t.quaternion,
  21759. duration: 0,
  21760. callback: s
  21761. })
  21762. }
  21763. .bind(this)),
  21764. r.promise()
  21765. }
  21766. ,
  21767. t.prototype.startWarp = function(e, t, i, n, r, o) {
  21768. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  21769. this.flying)
  21770. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  21771. o && o(),
  21772. !1;
  21773. null != e || (e = M.Show),
  21774. this.history.invalidate(),
  21775. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  21776. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  21777. return this.emit(W.WarpStarted, a, i, n, r),
  21778. n = n || P.MIDDLE,
  21779. this.path.warpToPano(i, n, r, function() {
  21780. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  21781. this.emit(W.WarpEnded, i),
  21782. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  21783. o && o()
  21784. }
  21785. .bind(this)),
  21786. e === M.Hide && this.path.discardPathObject(),
  21787. !0
  21788. }
  21789. ,
  21790. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  21791. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  21792. s && s(),
  21793. !1)
  21794. }
  21795. ,
  21796. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  21797. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21798. a && a(),
  21799. !1)
  21800. }
  21801. ,
  21802. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  21803. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  21804. }
  21805. ,
  21806. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  21807. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  21808. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21809. t && t(),
  21810. !1)
  21811. }
  21812. ,
  21813. t.prototype.aimTourCamera = function(e, t, i, n) {
  21814. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  21815. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  21816. }
  21817. ,
  21818. t.prototype.showPathToHeroLocation = function(e) {
  21819. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  21820. }
  21821. ,
  21822. t.prototype.tourInterlude = function(e, t) {
  21823. this.history.invalidate(),
  21824. this.path.discardSlow();
  21825. var i = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid]
  21826. , n = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  21827. , r = i && i.music ? i.time - n : 2e3;
  21828. this.path.waitNextStep(e, function() {
  21829. t && t()
  21830. }
  21831. .bind(this), r)
  21832. }
  21833. ,
  21834. t.prototype.stopInterlude = function() {
  21835. this.interruptAndFastForward(null, 0)
  21836. }
  21837. ,
  21838. t.prototype.interruptAndFastForward = function(e, t) {
  21839. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  21840. this.flying && this.emit(W.FlyingInterrupted),
  21841. this.path.interruptAndFastForward(e, t)
  21842. }
  21843. ,
  21844. t.prototype.setSize = function(e, t) {
  21845. var i = e / t;
  21846. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  21847. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  21848. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  21849. this.cameraControls.cameras) {
  21850. var o = this.cameraControls.cameras[r];
  21851. o.fov = this.baseFov * (1 / this.zoomLevel),
  21852. o.updateAspect(i)
  21853. }
  21854. }
  21855. ,
  21856. t.prototype.toJSON = function() {
  21857. var e = {};
  21858. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  21859. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  21860. return e.hidden ? 0 : 1
  21861. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  21862. e
  21863. }
  21864. ,
  21865. t.prototype.getCurrentNodePanos = function(e) {
  21866. if (this.model.panos.map,
  21867. e.length = 0,
  21868. this.path.nodes)
  21869. for (var t = 0; t < this.path.nodes.length; t++) {
  21870. var i = this.path.nodes[t];
  21871. e.push(this.model.panos.get(i))
  21872. }
  21873. }
  21874. ,
  21875. t.prototype.zoomIncrementally = function(e) {
  21876. var t = this.zoomLevel;
  21877. this.zoomTo(this.zoomLevel + e),
  21878. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  21879. }
  21880. ,
  21881. t.prototype.zoomInIncrementally = function(e) {
  21882. e = e || this.defaultZoomIncrement,
  21883. this.zoomIncrementally(e)
  21884. }
  21885. ,
  21886. t.prototype.zoomOutIncrementally = function(e) {
  21887. e = e || -this.defaultZoomIncrement,
  21888. this.zoomIncrementally(e)
  21889. }
  21890. ,
  21891. t.prototype.zoomBy = function(e) {
  21892. this.zoomTo(this.zoomLevel * e)
  21893. }
  21894. ,
  21895. t.prototype.zoomIn = function() {
  21896. this.zoomBy(1 + this.zoomSpeed)
  21897. }
  21898. ,
  21899. t.prototype.zoomOut = function() {
  21900. this.zoomBy(1 - this.zoomSpeed)
  21901. }
  21902. ,
  21903. t.prototype.zoomTo = function(e, t) {
  21904. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  21905. e > k.zoom.max && (e = k.zoom.max),
  21906. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  21907. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  21908. e === k.zoom.min && this.emit(m.ZoomMin)),
  21909. this.cameraControls.activeControl)) {
  21910. var i = this.cameraControls.activeControl.camera;
  21911. this.zoomLevel = e,
  21912. i.fov = this.baseFov * (1 / this.zoomLevel),
  21913. i.updateProjectionMatrix(),
  21914. this.zoomFov = i.fov
  21915. }
  21916. }
  21917. ,
  21918. t.prototype.increaseZoomSpeed = function() {
  21919. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  21920. }
  21921. ,
  21922. t.prototype.decreaseZoomSpeed = function() {
  21923. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  21924. }
  21925. ,
  21926. t.prototype.clampZoomSpeed = function(e) {
  21927. return e < 0 ? 0 : e
  21928. }
  21929. ,
  21930. t.prototype.activatePersistentZooming = function(e) {
  21931. this.zooming = e ? 1 : -1
  21932. }
  21933. ,
  21934. t.prototype.deactivatePersistentZooming = function() {
  21935. this.zooming = 0
  21936. }
  21937. ,
  21938. t.prototype.zoomDefault = function() {
  21939. this.zoomTo(1, !0)
  21940. }
  21941. ,
  21942. t.prototype.smoothZoomToDefault = function(e, t) {
  21943. var i, n = this.zoomLevel, r = function(e) {
  21944. 1 < e && (e = 1),
  21945. i = n * (1 - e) + e,
  21946. this.zoomTo(i, !0)
  21947. }
  21948. .bind(this), o = function() {
  21949. this.zoomDefault(),
  21950. t && window.setTimeout(t, 50)
  21951. }
  21952. .bind(this);
  21953. G.start(r, e, o, null, 0, z[k.transition.blendEasing])
  21954. }
  21955. ,
  21956. t.prototype.updateZoomPano = function() {
  21957. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  21958. var e = this.currentPano;
  21959. if (e) {
  21960. var t = this.zoomLevel > k.zoom.activationThreshold
  21961. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  21962. t);
  21963. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  21964. this.panoRenderer.setZoomingActive(i, e, !0);
  21965. var n = function(e, t) {
  21966. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  21967. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  21968. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  21969. e.setZoomed(t)
  21970. }
  21971. .bind(this);
  21972. i && !e.zoomed ? (n(e, !0),
  21973. this.panoRenderer.enableUltraHighQualityMode(function() {
  21974. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  21975. i && n(e, !0)
  21976. }
  21977. .bind(this))) : !t && e.zoomed && n(e, !1)
  21978. }
  21979. }
  21980. },
  21981. //--------
  21982. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  21983. var f2;
  21984. if (this.mode == mode) {
  21985. f1 && f1()
  21986. } else {
  21987. f2 = f1;
  21988. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  21989. this.afterCModeFuc = function() {
  21990. this.afterCModeFuc = f2
  21991. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  21992. }.bind(this)
  21993. } else {
  21994. this.afterCModeFuc = f2;//飞入后执行
  21995. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  21996. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  21997. }catch(e){}
  21998. }
  21999. }
  22000. }
  22001. ,
  22002. t.prototype.checkHasNeighbor = function(pano){//add
  22003. for(var i in pano.neighbourPanos ){
  22004. if(i == pano.id)continue;
  22005. if(pano.neighbourPanos[i]){
  22006. return true;
  22007. }
  22008. }
  22009. }
  22010. ,
  22011. ee.exports = t
  22012. }
  22013. ).call(this, "/js/player.js")
  22014. }
  22015. , {
  22016. "./constants": 8,
  22017. "./enum/AlignmentType": 17,
  22018. "./enum/BlackoutStyle": 18,
  22019. "./enum/ControlEvents": 21,
  22020. "./enum/Keys": 30,
  22021. "./enum/ModelManagerEvents": 33,
  22022. "./enum/PanoSizeClass": 36,
  22023. "./enum/PanoramaEvents": 37,
  22024. "./enum/PathDiscardMode": 38,
  22025. "./enum/PathDisplayMode": 39,
  22026. "./enum/PlayerEvents": 40,
  22027. "./enum/TagStates": 44,
  22028. "./enum/Vectors": 50,
  22029. "./enum/Viewmode": 51,
  22030. "./enum/WarpStyle": 52,
  22031. "./enum/ZoomEvents": 53,
  22032. "./exception/BasicException": 55,
  22033. "./model/ModelManager": 140,
  22034. "./objects/NSpider": 147,
  22035. "./objects/Panorama": 148,
  22036. "./objects/Reticule": 149,
  22037. "./objects/ShowPath": 151,
  22038. "./objects/Snapshot": 153,
  22039. "./objects/View": 154,
  22040. "./settings": 166,
  22041. "./shaders": 167,
  22042. "./tile/TileDownloader": 171,
  22043. "./tile/TilePrioritizer": 172,
  22044. "./util/ZoomStats": 179,
  22045. "./util/browser": 182,
  22046. "./util/camera": 183,
  22047. "./util/cameraLight": 184,
  22048. "./util/common": 185,
  22049. "./util/easing": 186,
  22050. "./util/history": 187,
  22051. "./util/lerp": 188,
  22052. "./util/logger": 189,
  22053. "./util/math": 190,
  22054. "./util/transitions": 195,
  22055. hot: "hot",
  22056. scaleImg: "scaleImg",
  22057. events: 202,
  22058. three: 217
  22059. }],
  22060. scaleImg: [function(e, t) {
  22061. var i = t;
  22062. (function() {
  22063. function e(e, t, i, n) {
  22064. function r() {
  22065. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22066. U.height = p,
  22067. H = U.getContext("2d")
  22068. }
  22069. function o(e) {
  22070. if (e) {
  22071. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22072. for (t = 0; t < ie; t += 4)
  22073. n[t] = e[t] * ne | 0,
  22074. n[t + 1] = e[t + 1] * ne | 0,
  22075. n[t + 2] = e[t + 2] * ne | 0,
  22076. n[t + 3] = e[t + 3] * ne | 0;
  22077. return delete e,
  22078. i
  22079. }
  22080. return H.getImageData(0, 0, d, p)
  22081. }
  22082. function a(e, t, i, n, r) {
  22083. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22084. }
  22085. var s, l;
  22086. if (t || (t = e.input,
  22087. i = e.output,
  22088. n = e.inputRemovable,
  22089. e.scale && (e = e.scale)),
  22090. t.src)
  22091. if (s = document.createElement("canvas"),
  22092. null != t.naturalWidth)
  22093. s.width = t.naturalWidth,
  22094. s.height = t.naturalHeight;
  22095. else if (null != t.runtimeStyle) {
  22096. var c = t.runtimeStyle
  22097. , h = c.width
  22098. , u = c.height;
  22099. c.width = "auto",
  22100. c.height = "auto",
  22101. s.width = t.width,
  22102. s.height = t.height,
  22103. c.width = h,
  22104. c.height = u
  22105. } else {
  22106. h = t.width,
  22107. u = t.height;
  22108. t.removeAttribute && (t.removeAttribute("width"),
  22109. t.removeAttribute("height")),
  22110. s.width = t.width,
  22111. s.height = t.height,
  22112. t.width = h,
  22113. t.height = u
  22114. }
  22115. else
  22116. s = t;
  22117. l = s.getContext("2d"),
  22118. t.src && l.drawImage(t, 0, 0);
  22119. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22120. if (!f || !g)
  22121. return !1;
  22122. (t.src || n) && s.clearRect(0, 0, f, g),
  22123. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22124. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22125. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22126. e * g + .5 | 0);
  22127. var v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J = d << 2, $ = f << 2, ee = 0, te = 0, ie = J * p, ne = 255.99 / 255, re = d / f, oe = p / g, ae = re * oe;
  22128. if (1 < re || 1 < oe)
  22129. for (r(),
  22130. G = (z = o()).data,
  22131. C = 0; C < p; C++)
  22132. for (V = (y = C / oe) - (w = 0 | y),
  22133. j = w * $,
  22134. W = w < 1 ? j : j - $,
  22135. w < g - 2 ? (Y = j + $,
  22136. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22137. A = 0; A < d; A++,
  22138. te += 4)
  22139. Z = (b = 0 | (v = A / re)) << 2,
  22140. b < f - 2 ? (K = Z + 4,
  22141. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22142. D = a(V, a(k = v - b, m[W + (X = b < 1 ? Z : Z - 4)], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22143. ++Z,
  22144. ++K,
  22145. ++Q,
  22146. F = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22147. ++Z,
  22148. ++K,
  22149. ++Q,
  22150. B = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22151. ++Z,
  22152. ++K,
  22153. ++Q,
  22154. N = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22155. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22156. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22157. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22158. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22159. else {
  22160. if (le.Float32Array)
  22161. L = new Float32Array(ie);
  22162. else
  22163. for (L = [],
  22164. te = 0; te < ie; ++te)
  22165. L[te] = 0;
  22166. for (y = 0; y < g; y++)
  22167. for (I = (_ = 0 | (C = y * oe)) * J,
  22168. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22169. R = C + oe - _ - 1),
  22170. v = 0; v < f; v++,
  22171. ee += 4)
  22172. switch (A = v * re,
  22173. E = 0 | A,
  22174. te = I + (E << 2),
  22175. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22176. P && (x = 1 + E - A,
  22177. S = A + re - E - 1),
  22178. D = m[ee],
  22179. F = m[ee + 1],
  22180. B = m[ee + 2],
  22181. N = m[ee + 3],
  22182. P + O) {
  22183. case 0:
  22184. L[te] += D * ae,
  22185. L[te + 1] += F * ae,
  22186. L[te + 2] += B * ae,
  22187. L[te + 3] += N * ae;
  22188. break;
  22189. case 1:
  22190. T = x * oe,
  22191. L[te] += D * T,
  22192. L[te + 1] += F * T,
  22193. L[te + 2] += B * T,
  22194. L[te + 3] += N * T,
  22195. T = S * oe,
  22196. L[te + 4] += D * T,
  22197. L[te + 5] += F * T,
  22198. L[te + 6] += B * T,
  22199. L[te + 7] += N * T;
  22200. break;
  22201. case 2:
  22202. T = re * M,
  22203. L[te] += D * T,
  22204. L[te + 1] += F * T,
  22205. L[te + 2] += B * T,
  22206. L[te + 3] += N * T,
  22207. T = re * R,
  22208. L[te += J] += D * T,
  22209. L[te + 1] += F * T,
  22210. L[te + 2] += B * T,
  22211. L[te + 3] += N * T;
  22212. break;
  22213. default:
  22214. T = x * M,
  22215. L[te] += D * T,
  22216. L[te + 1] += F * T,
  22217. L[te + 2] += B * T,
  22218. L[te + 3] += N * T,
  22219. T = S * M,
  22220. L[te + 4] += D * T,
  22221. L[te + 5] += F * T,
  22222. L[te + 6] += B * T,
  22223. L[te + 7] += N * T,
  22224. T = x * R,
  22225. L[te += J] += D * T,
  22226. L[te + 1] += F * T,
  22227. L[te + 2] += B * T,
  22228. L[te + 3] += N * T,
  22229. T = S * R,
  22230. L[te + 4] += D * T,
  22231. L[te + 5] += F * T,
  22232. L[te + 6] += B * T,
  22233. L[te + 7] += N * T
  22234. }
  22235. delete m,
  22236. r(),
  22237. z = o(L)
  22238. }
  22239. if (H.putImageData(z, 0, 0),
  22240. "string" == typeof i) {
  22241. var se;
  22242. if ("png" === i || "jpeg" === i)
  22243. return (se = n && t.src ? t : new Image).width = d,
  22244. se.height = p,
  22245. se.src = U.toDataURL("image/" + i, .85),
  22246. se;
  22247. if ("png-src" === i || "jpeg-src" === i)
  22248. return U.toDataURL("image/" + i.split("-")[0], .85)
  22249. }
  22250. return U
  22251. }
  22252. var le = this;
  22253. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22254. exports.scale = e) : c = e
  22255. }
  22256. ).call(this),
  22257. i.exports = c
  22258. }
  22259. , {}],
  22260. 156: [function(i, n, e) {
  22261. (function(e) {
  22262. "use strict";
  22263. function t(e, t) {
  22264. this.model = e,
  22265. this.panos = e.panos,
  22266. this.player = t,
  22267. this.imagePanos = this.listImagePanos(),
  22268. this.retryMinimumTime = 1e4
  22269. }
  22270. var r = (i("three"),
  22271. i("./enum/Viewmode"))
  22272. , o = (i("./settings"),
  22273. i("./objects/Panorama"))
  22274. , a = new (i("./util/logger"))(e);
  22275. t.prototype.start = function() {
  22276. this.loadNextPano(function(e) {
  22277. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22278. setTimeout(function() {
  22279. this.start()
  22280. }
  22281. .bind(this), 1e3))
  22282. }
  22283. .bind(this))
  22284. }
  22285. ,
  22286. t.prototype.validLoadTarget = function(e) {
  22287. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22288. }
  22289. ,
  22290. t.prototype.listImagePanos = function() {
  22291. var i = []
  22292. , n = this;
  22293. return this.model.images.forEach(function(e) {
  22294. if (e.metadata && e.metadata.scan_id) {
  22295. var t = n.model.panos.get(e.metadata.scan_id);
  22296. t && !t.isLoaded("high") && i.push(t)
  22297. }
  22298. }),
  22299. i
  22300. }
  22301. ,
  22302. t.prototype.nextNotLoadedImage = function() {
  22303. for (; 0 < this.imagePanos.length; ) {
  22304. var e = this.imagePanos[0];
  22305. if (!e.isLoaded("high"))
  22306. return e;
  22307. this.imagePanos.shift()
  22308. }
  22309. return null
  22310. }
  22311. ,
  22312. t.prototype.loadNextPano = function(e) {
  22313. var t, i, n = this.model.waitQueue.filter(function(e) {
  22314. return e.object instanceof o
  22315. });
  22316. 0 < n.length ? (t = n[0].object,
  22317. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22318. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22319. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22320. t = this.imagePanos[0],
  22321. a.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode !== r.PANORAMA || (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())])) && a.debug("Normal pano selection: neighbor " + t.id),
  22322. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22323. a.debug("Preloading " + i + "-res pano " + t.id),
  22324. t.loadCube(i).done(e).fail(function() {
  22325. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22326. e()
  22327. })) : e && e(null)
  22328. }
  22329. ,
  22330. n.exports = t
  22331. }
  22332. ).call(this, "/js/preloaders.js")
  22333. }
  22334. , {
  22335. "./enum/Viewmode": 51,
  22336. "./objects/Panorama": 148,
  22337. "./settings": 166,
  22338. "./util/logger": 189,
  22339. three: 217
  22340. }],
  22341. 157: [function(a, s, e) {
  22342. (function(e) {
  22343. "use strict";
  22344. function t(e, t, i, n, r) {
  22345. this.qualityManager = e,
  22346. this.scene = t,
  22347. this.camera = i,
  22348. this.container = r,
  22349. this.controls = n,
  22350. this.controls.enabled = !0,
  22351. this.controls.locked = !0,
  22352. this.quickstartCamera = n.camera,
  22353. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22354. this.skybox = null
  22355. }
  22356. var i = a("three")
  22357. , n = a("../util/logger")
  22358. , o = a("../constants")
  22359. , h = (a("../util/transitions"),
  22360. a("../util/lerp"),
  22361. a("../util/easing"),
  22362. a("../enum/Vectors"))
  22363. , u = a("../enum/PanoSizeClass")
  22364. , r = (a("../materials/ModelTextureMaterial"),
  22365. a("../materials/CubemapMaterial"))
  22366. , d = (a("../cameras/PanoramaCamera"),
  22367. a("../controls/PanoramaControls"),
  22368. a("../tile/TileUtils"),
  22369. a("../util/camera"),
  22370. a("../util/cameraLight"))
  22371. , p = (a("../util/browser"),
  22372. a("../settings"),
  22373. a("../gui/helpManager"),
  22374. new n(e));
  22375. t.prototype.load = function(e) {
  22376. e.pano.shouldRedrawOnBaseLoaded = !0;
  22377. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22378. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22379. var a = this.qualityManager.getPanoSize(u.BASE)
  22380. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22381. if (e.pano.tiled) {
  22382. p.warn("Loading startPano, TILED", e.pano.id);
  22383. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22384. , c = this.quickstartCamera.fov;
  22385. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22386. t = e.pano.loadTiledPano(s, r, {
  22387. hFov: l,
  22388. vFov: c
  22389. }, !1, !1, !0),
  22390. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22391. } else
  22392. p.warn("Loading startPano", e.pano.id),
  22393. t = e.pano.loadCube("high");
  22394. return $.when(t).then(function() {
  22395. n.init(e.pano, e.quaternion),
  22396. e.pano.tiled ? i.done(function() {
  22397. e.pano.lockUntilRenderingComplete = !1,
  22398. this.controls.locked = !1
  22399. }
  22400. .bind(this)) : this.controls.locked = !1
  22401. }
  22402. .bind(this))
  22403. }
  22404. ,
  22405. t.prototype.init = function(e, t) {
  22406. p.info("Quickstart done loading, adding scene objects"),
  22407. e.lockUntilRenderingComplete = !0,
  22408. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22409. side: i.BackSide
  22410. })),
  22411. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22412. this.skybox.quaternion.copy(e.quaternion),
  22413. this.scene.add(this.skybox),
  22414. $(this.container).show()
  22415. }
  22416. ,
  22417. t.prototype.update = function(e) {
  22418. this.controls.update(e),
  22419. this.camera.copy(this.quickstartCamera)
  22420. }
  22421. ,
  22422. t.prototype.setSize = function(e, t) {
  22423. this.quickstartCamera.updateAspect(e / t)
  22424. }
  22425. ,
  22426. t.prototype.destroy = function() {
  22427. this.scene.remove(this.skybox)
  22428. }
  22429. ,
  22430. s.exports = t
  22431. }
  22432. ).call(this, "/js/scene/QuickstartManager.js")
  22433. }
  22434. , {
  22435. "../cameras/PanoramaCamera": 7,
  22436. "../constants": 8,
  22437. "../controls/PanoramaControls": 13,
  22438. "../enum/PanoSizeClass": 36,
  22439. "../enum/Vectors": 50,
  22440. "../gui/helpManager": 68,
  22441. "../materials/CubemapMaterial": 117,
  22442. "../materials/ModelTextureMaterial": 118,
  22443. "../settings": 166,
  22444. "../tile/TileUtils": 174,
  22445. "../util/browser": 182,
  22446. "../util/camera": 183,
  22447. "../util/cameraLight": 184,
  22448. "../util/easing": 186,
  22449. "../util/lerp": 188,
  22450. "../util/logger": 189,
  22451. "../util/transitions": 195,
  22452. three: 217
  22453. }],
  22454. 158: [function(e, t, i) {
  22455. "use strict";
  22456. function h(e, t, i) {
  22457. this.scene = e,
  22458. this.camera = t,
  22459. this.renderer = null,
  22460. this.effects = i,
  22461. this.animateCallback = null,
  22462. this.composer = null,
  22463. this.qualityManager = null,
  22464. e.renderWidth = 0,
  22465. e.renderHeight = 0,
  22466. this.updateClock = new M.Clock,
  22467. this.components = [],
  22468. this.updateListeners = [],
  22469. this.resizeListeners = [],
  22470. this.forceUpdateSize = !1,
  22471. this.started = !1,
  22472. this.textures = {},
  22473. this.suspendedObjects = []
  22474. }
  22475. var o, a, n, M = e("three"), R = e("../shaders"), r = e("../enum/SceneRendererEvents"), f = e("../enum/GLTextureType"), s = e("../enum/GLCubeFaces"), l = e("../exception/BasicException"), c = e("../exception/RendererCreationException"), u = e("../util/browser"), d = e("../settings"), p = e("events").EventEmitter;
  22476. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22477. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22478. this.components.push(e),
  22479. e.update && this.updateListeners.push(e),
  22480. e.setSize && (this.resizeListeners.push(e),
  22481. this.forceUpdateSize = !0)
  22482. }
  22483. ,
  22484. h.prototype.removeComponent = function(t) {
  22485. function e(e) {
  22486. return e !== t
  22487. }
  22488. this.components = this.components.filter(e),
  22489. this.updateListeners = this.updateListeners.filter(e),
  22490. this.resizeListeners = this.resizeListeners.filter(e)
  22491. }
  22492. ,
  22493. h.prototype.start = function(e) {
  22494. if (this.started)
  22495. throw new l("Can't start SceneRenderer, already started");
  22496. this.createContext(e),
  22497. this.boluoVrInit(),
  22498. this.initComposer(),
  22499. this.started = !0,
  22500. (b = b.bind(this))()
  22501. }
  22502. ,
  22503. h.prototype.createContext = function(e) {
  22504. try {
  22505. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22506. this.renderer.autoClear = !0,
  22507. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22508. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22509. this.emit(r.ContextCreated)
  22510. } catch (e) {
  22511. throw new c("Unable to create a WebGL rendering context")
  22512. }
  22513. d.profiling.enabled && this.overrideTextures(),
  22514. e.appendChild(this.renderer.domElement)
  22515. }
  22516. ,
  22517. h.prototype.overrideTextures = function() {
  22518. var d = this.renderer.context
  22519. , t = 0
  22520. , i = d.createTexture;
  22521. d.createTexture = function() {
  22522. var e = i.call(d);
  22523. return e.id = t++,
  22524. this.textures[e.id] = e
  22525. }
  22526. .bind(this);
  22527. var p = d.texImage2D;
  22528. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22529. var c, h = this.getTextureTypeFromTarget(d, e);
  22530. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22531. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22532. s = r,
  22533. n = (l = o).naturalWidth,
  22534. r = l.naturalHeight,
  22535. p.call(d, e, t, i, a, s, l));
  22536. var u = this.textures[c.id];
  22537. u.width = h === f.TextureCube ? 6 * n : n,
  22538. u.height = r
  22539. }
  22540. .bind(this);
  22541. var n = d.deleteTexture;
  22542. d.deleteTexture = function(e) {
  22543. delete this.textures[e.id],
  22544. n.call(d, e)
  22545. }
  22546. .bind(this)
  22547. }
  22548. ,
  22549. h.prototype.updateTextureMemory = (n = null,
  22550. function() {
  22551. var e = 0;
  22552. for (var t in this.textures) {
  22553. var i = this.textures[t];
  22554. i.width && i.height && (e += i.width * i.height * 4)
  22555. }
  22556. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22557. n = e
  22558. }
  22559. ),
  22560. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22561. switch (t) {
  22562. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22563. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22564. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22565. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22566. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22567. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22568. return f.TextureCube;
  22569. case e.TEXTURE_2D:
  22570. return f.Texture2D;
  22571. default:
  22572. return null
  22573. }
  22574. }
  22575. ,
  22576. h.prototype.initComposer = function() {
  22577. this.composer = new M.EffectComposer(this.renderer),
  22578. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22579. this.composer.addPass(this.effects.hblurPass),
  22580. this.composer.addPass(this.effects.vblurPass)
  22581. }
  22582. ,
  22583. h.prototype.setSize = function(e, t, i) {
  22584. this.renderWidth = e,
  22585. this.renderHeight = t,
  22586. this.effects.aspect = e / t,
  22587. this.renderer.setSize(e, t, !1, i),
  22588. this.composer.setSize(e, t);
  22589. for (var n = 0; n < this.resizeListeners.length; n++)
  22590. this.resizeListeners[n].setSize(e, t)
  22591. }
  22592. ,
  22593. h.prototype.render = function() {
  22594. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22595. }
  22596. ,
  22597. h.prototype.boluoVrInit = function() {
  22598. console.log("boluoVrInit"),
  22599. this.isHuawei5X = u.detectHUAWEI5X(),
  22600. this.oldRenderer = this.renderer,
  22601. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22602. window.panoCamera = this.camera;
  22603. var i = this;
  22604. window._vrEnabled = !1,
  22605. Object.defineProperty(window, "vrEnabled", {
  22606. get: function() {
  22607. return window._vrEnabled
  22608. },
  22609. set: function(e) {
  22610. (e = !!e) ? (i.renderer = i.newRenderer,
  22611. window.vrMarkers.forEach(function(e) {
  22612. e.visible = !0
  22613. })) : (i.renderer = i.oldRenderer,
  22614. window.vrMarkers.forEach(function(e) {
  22615. e.visible = !1
  22616. })),
  22617. i.cursor.visible = e,
  22618. i.setSize(window.innerWidth, window.innerHeight),
  22619. window._vrEnabled = e,
  22620. setTimeout(function() {
  22621. console.log(player.cameraControls.activeControl.camera.fov)
  22622. }, 500)
  22623. }
  22624. }),
  22625. this.createCursor(.5, !1, 1, 16777215, 0);
  22626. var e = {
  22627. setSize: function(e, t) {
  22628. i.camera.aspect = e / t
  22629. }
  22630. };
  22631. this.resizeListeners.push(e),
  22632. this.vrLoadingInit()
  22633. }
  22634. ,
  22635. h.prototype.vrLoadingInit = function() {
  22636. var e = new (e = function() {
  22637. var t = this
  22638. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22639. , i = new M.MeshBasicMaterial({
  22640. color: 4967932,
  22641. side: M.DoubleSide
  22642. })
  22643. , n = new M.Mesh(e,i);
  22644. (this.mesh = n).position.z = -2,
  22645. n.scale.set(.08, .08, .08),
  22646. n.visible = !1,
  22647. window.player.camera.add(n),
  22648. t.enabled = !1,
  22649. this.update = function(e) {
  22650. 1 == t.enabled && (n.rotation.z += 15 * e)
  22651. }
  22652. }
  22653. )(this.camera);
  22654. window.Loading = e,
  22655. this.updateListeners.push(e)
  22656. }
  22657. ,
  22658. h.prototype.createCursor = function(e, t, i, n, r) {
  22659. var o, a = new M.SpriteMaterial({
  22660. opacity: i,
  22661. color: n,
  22662. transparent: t,
  22663. map: this.boluoGetTexture("images/cursor.png"),
  22664. needsUpdate: !0,
  22665. side: M.DoubleSide
  22666. });
  22667. a.map.offset = new M.Vector2(1 / 17 * r,0),
  22668. a.map.repeat = new M.Vector2(1 / 17,1),
  22669. a.depthTest = !1,
  22670. a.blending = M.AdditiveBlending,
  22671. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  22672. o.position.z = -2,
  22673. o.visible = !1,
  22674. o.name = "cursor",
  22675. this.camera.add(o),
  22676. this.scene.add(this.camera),
  22677. this.cursor = o;
  22678. var s = new this.CursorAnimation(this.scene,o,this.camera);
  22679. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  22680. this.updateListeners.push(s)
  22681. }
  22682. ,
  22683. h.prototype.CursorAnimation = function(e, t, o) {
  22684. this.cursor = t,
  22685. this.raycaster = new M.Raycaster,
  22686. this.targetEventObj = {},
  22687. this.type = 1,
  22688. this.tweenFlag = !0;
  22689. var s = this;
  22690. this.target = o,
  22691. console.log(o.uuid),
  22692. this.euler = new M.Euler,
  22693. this.q0 = new M.Quaternion,
  22694. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  22695. this.zee = new M.Vector3(0,0,1),
  22696. this.alpha = -1e3,
  22697. this.beta = -1e3,
  22698. this.gamma = -1e3,
  22699. this.orient = M.Math.degToRad(window.orientation || 0),
  22700. window.addEventListener("orientationchange", function() {
  22701. s.orient = M.Math.degToRad(window.orientation || 0)
  22702. }),
  22703. window.addEventListener("deviceorientation", function(e) {
  22704. var t = M.Math.degToRad(e.alpha)
  22705. , i = M.Math.degToRad(e.beta)
  22706. , n = M.Math.degToRad(e.gamma);
  22707. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  22708. -1e3 === s.beta && (s.beta = i),
  22709. -1e3 === s.gamma && (s.gamma = n),
  22710. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  22711. .006 < Math.abs(i - s.beta) && (s.beta = i),
  22712. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  22713. s.beta = i,
  22714. s.gamma = n),
  22715. h.vrDebug) {
  22716. $("#info-device-orientation").css("display", "block");
  22717. var r = "";
  22718. r += "alpha=(" + s.alpha + ")<BR/>",
  22719. r += "beta=(" + s.beta + ")<BR/>",
  22720. r += "gamma=" + s.gamma + "<BR/>",
  22721. document.getElementById("info-device-orientation").innerHTML = r
  22722. }
  22723. }),
  22724. this.setObjectQuaternion = function(e, t, i, n, r) {
  22725. s.euler.set(i, t, -n, "YXZ"),
  22726. e.setFromEuler(s.euler),
  22727. e.multiply(s.q1),
  22728. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  22729. o.updateMatrixWorld()
  22730. }
  22731. ,
  22732. parent !== window && window.addEventListener("message", function(e) {
  22733. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  22734. o && o.alpha && o.beta && o.gamma && (t = a,
  22735. i = M.Math.degToRad(o.alpha),
  22736. n = M.Math.degToRad(o.beta),
  22737. r = M.Math.degToRad(o.gamma),
  22738. t ? (-1e3 === s.alpha && (s.alpha = i),
  22739. -1e3 === s.beta && (s.beta = n),
  22740. -1e3 === s.gamma && (s.gamma = r),
  22741. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  22742. .006 < Math.abs(n - s.beta) && (s.beta = n),
  22743. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  22744. s.beta = n,
  22745. s.gamma = r))
  22746. }),
  22747. this.update = function(e) {
  22748. TWEEN.update(),
  22749. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  22750. this.triggerTargetEvent())
  22751. }
  22752. ,
  22753. this.triggerTargetEvent = function() {
  22754. var e = this.choseObj()
  22755. , t = e ? e.object : void 0;
  22756. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  22757. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  22758. t && t.enabled && this.startAnimate(function() {
  22759. this.clickCallback(t)
  22760. }
  22761. .bind(this))) : this.type,
  22762. this.targetEventObj.lastObj = t)
  22763. }
  22764. ,
  22765. this.choseObj = function() {
  22766. this.raycaster.setFromCamera({
  22767. x: 0,
  22768. y: 0
  22769. }, o);
  22770. var e = (this.raycaster.ray,
  22771. window.vrMarkers)
  22772. , t = this.raycaster.intersectObjects(e);
  22773. if (0 < t.length)
  22774. return t[0]
  22775. }
  22776. ,
  22777. this.clickCallback = function(e) {
  22778. this.runTHREEAction(e, "onclick")
  22779. }
  22780. ,
  22781. this.runTHREEAction = function(e, t) {
  22782. switch (t) {
  22783. case "onclick":
  22784. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  22785. e()
  22786. });
  22787. break;
  22788. case "onhover":
  22789. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  22790. e()
  22791. });
  22792. break;
  22793. case "onout":
  22794. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  22795. e()
  22796. })
  22797. }
  22798. }
  22799. ,
  22800. this.startAnimate = function(e) {
  22801. this.tweenFlag && this.initAnimation(e)
  22802. }
  22803. ,
  22804. this.initAnimation = function(e) {
  22805. var t = this
  22806. , i = this.cursor.material.map.offset;
  22807. t.tweenFlag = !1,
  22808. this.cursorAnimate = new TWEEN.Tween(i).to({
  22809. x: 1
  22810. }, 1e3).onStart(function() {
  22811. t.tweenFlag = !1
  22812. }).onStop(function() {
  22813. t.tweenFlag = !0,
  22814. this.x = 0,
  22815. i.x = 0
  22816. }).onUpdate(function() {}).onComplete(function() {
  22817. e(),
  22818. i.x = 0,
  22819. setTimeout(function() {
  22820. t.tweenFlag = !0
  22821. }, 1500)
  22822. }),
  22823. this.cursorAnimate.easing(function(e) {
  22824. return Math.floor(17 * e) / 17
  22825. }),
  22826. this.cursorAnimate.start()
  22827. }
  22828. ,
  22829. this.autoCursorPosition = function(e) {
  22830. this.cursor.scale.set(.3, .3, .3)
  22831. }
  22832. }
  22833. ,
  22834. h.prototype.vrRenderer = function(a, i, e) {
  22835. var s = new i.vrCamera(e);
  22836. s.bananaAspect = .8,
  22837. this.width,
  22838. this.height;
  22839. i = this;
  22840. this.setSize = function(e, t) {
  22841. a.setSize.call(this, e, t),
  22842. i.width = e,
  22843. i.height = t
  22844. }
  22845. ,
  22846. this.render = function(e, t, i, n) {
  22847. var r, o;
  22848. if (window.cameraQua = t.quaternion.clone(),
  22849. t.__RESS__SKIP__STEREO__)
  22850. return a.render(e, t, i, n);
  22851. if ("PerspectiveCamera" === t.type)
  22852. r = s.cameraL,
  22853. o = s.cameraR,
  22854. e.updateMatrixWorld(),
  22855. null === t.parent && t.updateMatrixWorld(),
  22856. s.vrCameraUpdate(t);
  22857. else {
  22858. if ("OrthographicCamera" !== t.type)
  22859. return DEBUG && console.error("Unsupported renderer: ", t.type);
  22860. r = o = t
  22861. }
  22862. a.setScissorTest(!0),
  22863. a.setScissor(0, 0, this.width / 2, this.height),
  22864. a.setViewport(0, 0, this.width / 2, this.height),
  22865. a.render.call(this, e, r, i, n),
  22866. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  22867. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  22868. a.render.call(this, e, o, i, n),
  22869. a.setScissorTest(!1)
  22870. }
  22871. ,
  22872. this.__proto__ = {
  22873. __proto__: a
  22874. }
  22875. }
  22876. ,
  22877. h.prototype.vrCamera = function(e) {
  22878. this.type = "StereoCamera",
  22879. this._aspect = 1,
  22880. this._overlap = .064,
  22881. this.cameraL = new M.PerspectiveCamera,
  22882. this.cameraL.layers.enable(1),
  22883. this.cameraL.matrixAutoUpdate = !1,
  22884. this.cameraR = new M.PerspectiveCamera,
  22885. this.cameraR.layers.enable(2),
  22886. this.cameraR.matrixAutoUpdate = !1,
  22887. this.eyeRight = new M.Matrix4,
  22888. this.eyeLeft = new M.Matrix4,
  22889. this.vrCameraNeedsUpdate = !0,
  22890. window.vrCameraL = this.cameraL,
  22891. Object.defineProperty(this, "bananaAspect", {
  22892. get: function() {
  22893. return this._aspect
  22894. },
  22895. set: function(e) {
  22896. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  22897. this._aspect = e
  22898. }
  22899. }),
  22900. Object.defineProperty(this, "overlap", {
  22901. get: function() {
  22902. return this._overlap
  22903. },
  22904. set: function(e) {
  22905. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  22906. this._overlap = e
  22907. }
  22908. }),
  22909. this.vrCameraUpdate = function(e) {
  22910. if (this.vrCameraNeedsUpdate = !0,
  22911. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  22912. this.vrCameraNeedsUpdate) {
  22913. this.vrCameraNeedsUpdate = !1,
  22914. console.debug("vrCameraUpdate"),
  22915. this.bananaFocus = e.focus,
  22916. this.bananaFov = e.fov,
  22917. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  22918. this.bananaNear = e.near,
  22919. this.bananaFar = e.far,
  22920. console.debug(e.aspect),
  22921. this.bananaFocus = 10;
  22922. var t, i, n = e.projectionMatrix.clone(), r = this.overlap / 2, o = r * this.bananaNear / this.bananaFocus, a = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  22923. this.eyeLeft.elements[12] = -r,
  22924. this.eyeRight.elements[12] = r,
  22925. t = -a * this.bananaReal_aspect + o,
  22926. i = a * this.bananaReal_aspect + o,
  22927. n.elements[0] = 2 * this.bananaNear / (i - t),
  22928. n.elements[8] = (i + t) / (i - t),
  22929. this.cameraL.projectionMatrix.copy(n),
  22930. t = -a * this.bananaReal_aspect - o,
  22931. i = a * this.bananaReal_aspect - o,
  22932. n.elements[0] = 2 * this.bananaNear / (i - t),
  22933. n.elements[8] = (i + t) / (i - t),
  22934. this.cameraR.projectionMatrix.copy(n)
  22935. }
  22936. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  22937. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  22938. }
  22939. }
  22940. ,
  22941. h.prototype.boluoGetTexture = function(e) {
  22942. var t = new M.TextureLoader;
  22943. return t.crossOrigin = "anonymous",
  22944. t.load(e)
  22945. }
  22946. ,
  22947. h.prototype.updateScreenSize = function(e) {
  22948. var t, i, n, r = !1;
  22949. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  22950. n = e.height,
  22951. r = !0,
  22952. t = 1) : (i = $("#player").width(),
  22953. n = $("#player").height(),
  22954. e && e.resize && (o = this.renderWidth,
  22955. a = this.renderHeight),
  22956. i === o && n === a && !this.forceUpdateSize || (o = i,
  22957. a = n,
  22958. r = !0,
  22959. t = window.devicePixelRatio)),
  22960. r && (this.setSize(i, n, t),
  22961. this.forceUpdateSize = !1)
  22962. }
  22963. ,
  22964. h.prototype.updateComponents = function() {
  22965. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  22966. this.updateListeners[t].update(e)
  22967. }
  22968. ,
  22969. h.prototype.suspend = function() {
  22970. this.started = !1,
  22971. this.suspendedObjects = this.scene.children.map(function(e) {
  22972. return this.scene.remove(e),
  22973. e
  22974. }
  22975. .bind(this)),
  22976. this.render()
  22977. }
  22978. ,
  22979. h.prototype.resume = function() {
  22980. this.suspendedObjects.forEach(function(e) {
  22981. this.scene.add(e)
  22982. }
  22983. .bind(this)),
  22984. this.suspendedObjects = [],
  22985. this.started = !0,
  22986. b()
  22987. }
  22988. ;
  22989. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  22990. this.started && (window.requestAnimationFrame(b),
  22991. this.updateScreenSize(),
  22992. this.updateComponents(),
  22993. this.updateTextureMemory(),
  22994. this.render(),
  22995. this.emit(r.AfterRender))
  22996. };
  22997. h.prototype.getImageData = (E = document.createElement("canvas"),
  22998. _ = E.getContext("2d"),
  22999. function(e, t, i) {
  23000. return E.width === t && E.height === i || (E.width = t,
  23001. E.height = i),
  23002. _.drawImage(e, 0, 0, t, i),
  23003. _.getImageData(0, 0, t, i)
  23004. }
  23005. ),
  23006. h.prototype.initSizedTexture2D = function(e, t, i) {
  23007. var n = this.renderer
  23008. , r = n.context
  23009. , o = n.state
  23010. , a = new M.Texture(null);
  23011. !(a.flipY = !1) !== i && (i = !1),
  23012. a.generateMipmaps = i;
  23013. var s = n.paramThreeToGL(a.format)
  23014. , l = n.paramThreeToGL(a.type)
  23015. , c = n.properties.get(a)
  23016. , h = r.createTexture();
  23017. o.bindTexture(r.TEXTURE_2D, h),
  23018. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23019. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23020. a.wrapS = t,
  23021. a.wrapT = t;
  23022. var u = n.paramThreeToGL(t);
  23023. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23024. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23025. i ? (a.magFilter = M.LinearFilter,
  23026. a.minFilter = M.LinearMipMapLinearFilter,
  23027. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23028. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23029. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23030. a.minFilter = M.LinearFilter,
  23031. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23032. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23033. o.bindTexture(r.TEXTURE_2D, null),
  23034. c.__webglTexture = h,
  23035. a
  23036. }
  23037. ,
  23038. h.prototype.initSizedCubeMap = function(e, t) {
  23039. var i = this.renderer
  23040. , n = i.context
  23041. , r = i.state
  23042. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23043. o.flipY = !1,
  23044. o.generateMipmaps = t;
  23045. var a = i.paramThreeToGL(o.format)
  23046. , s = i.paramThreeToGL(o.type)
  23047. , l = i.properties.get(o)
  23048. , c = n.createTexture();
  23049. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23050. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23051. for (var h = 0; h < 6; h++)
  23052. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23053. return t ? (o.magFilter = M.LinearFilter,
  23054. o.minFilter = M.LinearMipMapLinearFilter,
  23055. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23056. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23057. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23058. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23059. o.minFilter = M.LinearFilter,
  23060. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23061. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23062. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23063. l.__image__webglTextureCube = c,
  23064. o
  23065. }
  23066. ,
  23067. h.prototype.deallocateCubeTexture = function(e) {
  23068. var t = this.renderer
  23069. , i = t.context
  23070. , n = t.properties.get(e);
  23071. i.deleteTexture(n.__image__webglTextureCube)
  23072. }
  23073. ,
  23074. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23075. var a = this.renderer
  23076. , s = a.context
  23077. , l = a.state
  23078. , c = a.properties.get(t);
  23079. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23080. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23081. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23082. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23083. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23084. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23085. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23086. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23087. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23088. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23089. l.bindTexture(s.TEXTURE_2D, null)
  23090. }
  23091. ,
  23092. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23093. var s = this.renderer
  23094. , l = s.context
  23095. , c = s.state
  23096. , h = s.properties.get(t);
  23097. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23098. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23099. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23100. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23101. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23102. }
  23103. ,
  23104. h.prototype.rebuildMipMaps2D = function(e) {
  23105. var t = this.renderer
  23106. , i = t.context
  23107. , n = t.state;
  23108. t.properties.get(e),
  23109. i.generateMipmap(i.TEXTURE_2D),
  23110. n.bindTexture(i.TEXTURE_2D, null)
  23111. }
  23112. ,
  23113. h.prototype.rebuildMipMaps3D = function(e) {
  23114. var t = this.renderer
  23115. , i = t.context
  23116. , n = t.state
  23117. , r = t.properties.get(e);
  23118. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23119. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23120. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23121. }
  23122. ,
  23123. h.prototype.renderToCubeMap = (P = !1,
  23124. F = N = D = L = O = null,
  23125. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23126. this.renderer.context,
  23127. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23128. (O = new M.Scene).add(L),
  23129. D = new M.ShaderMaterial({
  23130. uniforms: {
  23131. tDiffuse: {
  23132. type: "t",
  23133. value: null
  23134. },
  23135. alpha: {
  23136. type: "f",
  23137. value: 1
  23138. }
  23139. },
  23140. vertexShader: R.basicTextured.vertexShader,
  23141. fragmentShader: R.basicTextured.fragmentShader,
  23142. depthWrite: !1,
  23143. depthTest: !1,
  23144. side: M.DoubleSide
  23145. }),
  23146. N = new M.PlaneBufferGeometry(1,1),
  23147. (F = new M.Mesh(N,D)).position.z = 0,
  23148. O.add(F),
  23149. P = !0);
  23150. var m = N.getAttribute("uv");
  23151. m.setDynamic(!0),
  23152. m.needsUpdate = !0;
  23153. var v = m.array
  23154. , y = r / i
  23155. , A = o / n
  23156. , C = a / i
  23157. , I = s / n;
  23158. v[0] = y,
  23159. v[1] = A + I,
  23160. v[2] = y + C,
  23161. v[3] = A + I,
  23162. v[4] = y,
  23163. v[5] = A,
  23164. v[6] = y + C,
  23165. v[7] = A;
  23166. var E = N.getAttribute("position");
  23167. E.setDynamic(!0),
  23168. E.needsUpdate = !0;
  23169. var _ = E.array
  23170. , b = l / t.width - .5
  23171. , w = c / t.height - .5
  23172. , T = h / t.width
  23173. , x = u / t.height;
  23174. _[0] = b,
  23175. _[1] = w + x,
  23176. _[3] = b + T,
  23177. _[4] = w + x,
  23178. _[6] = b,
  23179. _[7] = w,
  23180. _[9] = b + T,
  23181. _[10] = w,
  23182. this.renderer.properties.get(e),
  23183. D.uniforms.tDiffuse.value = e,
  23184. D.blending = p || M.NoBlending,
  23185. D.transparent = !!f,
  23186. null != g || (g = 1),
  23187. D.uniforms.alpha.value = g,
  23188. D.needUpdate = !0,
  23189. t.activeCubeFace = d,
  23190. t.viewport.set(0, 0, t.width, t.height);
  23191. var S = this.renderer.autoClear;
  23192. this.renderer.autoClear = !1,
  23193. this.renderer.render(O, L, t, !1),
  23194. this.renderer.autoClear = S
  23195. }
  23196. ),
  23197. h.prototype.copyCubeMap = (g = !1,
  23198. C = A = y = v = m = null,
  23199. I = new M.Euler,
  23200. new M.Vector3,
  23201. function(e, t, i, n, r, o, a, s, l) {
  23202. this.renderer,
  23203. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23204. (m = new M.Scene).add(v),
  23205. y = new M.ShaderMaterial({
  23206. uniforms: {
  23207. tDiffuse: {
  23208. type: "t",
  23209. value: null
  23210. },
  23211. alpha: {
  23212. type: "f",
  23213. value: 1
  23214. }
  23215. },
  23216. vertexShader: R.copyCubeMap.vertexShader,
  23217. fragmentShader: R.copyCubeMap.fragmentShader,
  23218. depthWrite: !1,
  23219. depthTest: !1,
  23220. side: M.DoubleSide
  23221. }),
  23222. A = new M.BoxGeometry(2,2,2),
  23223. C = new M.Mesh(A,y),
  23224. m.add(C),
  23225. g = !0);
  23226. for (var c = 0; c < 6; c++)
  23227. h.getCubeOrientationForCubeFace(c, I),
  23228. C.rotation.copy(I),
  23229. C.matrixWorldNeedsUpdate = !0,
  23230. C.updateMatrixWorld(),
  23231. y.uniforms.tDiffuse.value = e,
  23232. y.blending = a || M.NoBlending,
  23233. y.transparent = !!s,
  23234. null != l || (l = 1),
  23235. y.uniforms.alpha.value = l,
  23236. y.needUpdate = !0,
  23237. t.activeCubeFace = c,
  23238. t.viewport.set(0, 0, r, o),
  23239. this.renderer.render(m, v, t, !1)
  23240. }
  23241. ),
  23242. h.getLookAtForCubeFace = function(e, t) {
  23243. switch (e) {
  23244. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23245. t.set(1, 0, 0);
  23246. break;
  23247. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23248. t.set(-1, 0, 0);
  23249. break;
  23250. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23251. t.set(0, 1, 0);
  23252. break;
  23253. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23254. t.set(0, -1, 0);
  23255. break;
  23256. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23257. t.set(0, 0, 1);
  23258. break;
  23259. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23260. t.set(0, 0, -1)
  23261. }
  23262. }
  23263. ,
  23264. h.getCubeOrientationForCubeFace = function(e, t) {
  23265. switch (e) {
  23266. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23267. t.set(0, -Math.PI / 2, 0);
  23268. break;
  23269. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23270. t.set(0, Math.PI / 2, 0);
  23271. break;
  23272. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23273. t.set(Math.PI / 2, Math.PI, 0);
  23274. break;
  23275. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23276. t.set(-Math.PI / 2, Math.PI, 0);
  23277. break;
  23278. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23279. t.set(0, -Math.PI, 0);
  23280. break;
  23281. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23282. t.set(0, 0, 0)
  23283. }
  23284. }
  23285. ,
  23286. t.exports = h
  23287. }
  23288. , {
  23289. "../enum/GLCubeFaces": 25,
  23290. "../enum/GLTextureType": 26,
  23291. "../enum/SceneRendererEvents": 43,
  23292. "../exception/BasicException": 55,
  23293. "../exception/RendererCreationException": 57,
  23294. "../settings": 166,
  23295. "../shaders": 167,
  23296. "../util/browser": 182,
  23297. events: 202,
  23298. three: 217
  23299. }],
  23300. 159: [function(e, t, i) {
  23301. "use strict";
  23302. function n(e) {
  23303. this.messenger = new a(e),
  23304. this.clientKey = null
  23305. }
  23306. var o = e("../util/ajax")
  23307. , r = e("./PostMessageType")
  23308. , a = e("./postmessage")
  23309. , s = e("./VersionInfo")
  23310. , l = e("events").EventEmitter
  23311. , c = window.location.origin + "/api/v1/user/";
  23312. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23313. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23314. }
  23315. ,
  23316. n.prototype.waitForConnection = function() {
  23317. return new Promise(function(t, i) {
  23318. this.messenger.on(r.CONNECT, function(e) {
  23319. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23320. }
  23321. .bind(this))
  23322. }
  23323. .bind(this))
  23324. }
  23325. ,
  23326. n.prototype.onConnectionReceived = function(i) {
  23327. return this.messenger.setTarget(i.source, i.origin),
  23328. this.verifyConnection(i).then(function(e, t) {
  23329. this.messenger.send({
  23330. type: r.ACCEPT,
  23331. toId: i.fromId,
  23332. warning: t
  23333. }),
  23334. this.clientKey = e,
  23335. this.messenger.removeAllListeners(r.CONNECT),
  23336. this.bindEvents()
  23337. }
  23338. .bind(this), function(e) {
  23339. this.messenger.send({
  23340. type: r.REJECT,
  23341. toId: i.fromId,
  23342. reason: e
  23343. }),
  23344. this.messenger.setTarget()
  23345. }
  23346. .bind(this))
  23347. }
  23348. ,
  23349. n.prototype.verifyConnection = function(r) {
  23350. return new Promise(function(e, t) {
  23351. var i;
  23352. if (s.isDeprecated(r.sdkVersion))
  23353. i = "这个版本正在被弃用";
  23354. else if (!s.isSupported(r.sdkVersion))
  23355. return t("不支持此版本的SDK");
  23356. var n = {
  23357. cache: !1,
  23358. headers: {
  23359. "X-port-Application-Key": r.applicationKey,
  23360. "X-port-Referrer": r.origin
  23361. }
  23362. };
  23363. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23364. }
  23365. )
  23366. }
  23367. ,
  23368. n.prototype.onMessageReceived = function(t) {
  23369. if (this.validateClientApplicationKey(t.applicationKey)) {
  23370. var i = this;
  23371. t.onDone = function(e) {
  23372. e.toId = t.fromId,
  23373. e.uid = t.uid,
  23374. e.type = r.RESPONSE,
  23375. i.messenger.send(e)
  23376. }
  23377. ,
  23378. this.emit(r.ACTION, t)
  23379. }
  23380. }
  23381. ,
  23382. n.prototype.validateClientApplicationKey = function(e) {
  23383. return this.clientKey === e
  23384. }
  23385. ,
  23386. n.prototype.sendEvent = function(e, t) {
  23387. this.messenger.send({
  23388. type: r.EVENT,
  23389. eventType: e,
  23390. eventData: t
  23391. })
  23392. }
  23393. ,
  23394. t.exports = n
  23395. }
  23396. , {
  23397. "../util/ajax": 181,
  23398. "./PostMessageType": 160,
  23399. "./VersionInfo": 163,
  23400. "./postmessage": 165,
  23401. events: 202
  23402. }],
  23403. 160: [function(e, t, i) {
  23404. "use strict";
  23405. t.exports = Object.freeze({
  23406. CONNECT: "postmessage.connect",
  23407. ACCEPT: "postmessage.accept",
  23408. REJECT: "postmessage.reject",
  23409. ACTION: "postmessage.action",
  23410. RESPONSE: "postmessage.response",
  23411. EVENT: "postmessage.event"
  23412. })
  23413. }
  23414. , {}],
  23415. 161: [function(e, t, i) {
  23416. "use strict";
  23417. t.exports = Object.freeze({
  23418. MOVE: "sdk.move",
  23419. ENTER_PANO: "sdk.enterpano",
  23420. MODEL_LOADED: "sdk.modelloaded"
  23421. })
  23422. }
  23423. , {}],
  23424. 162: [function(e, t, i) {
  23425. "use strict";
  23426. t.exports = Object.freeze({
  23427. FLY: "transition.fly",
  23428. FADEOUT: "transition.fade",
  23429. INSTANT: "transition.instant"
  23430. })
  23431. }
  23432. , {}],
  23433. 163: [function(e, t, i) {
  23434. "use strict";
  23435. t.exports = {
  23436. current: "1.0",
  23437. supported: ["1.0"],
  23438. deprecated: [],
  23439. isSupported: function(e) {
  23440. return -1 !== this.supported.indexOf(e)
  23441. },
  23442. isDeprecated: function(e) {
  23443. return -1 !== this.deprecated.indexOf(e)
  23444. },
  23445. isValid: function(e) {
  23446. return this.isSupported(e) || this.isDeprecated(e)
  23447. }
  23448. }
  23449. }
  23450. , {}],
  23451. 164: [function(q, X, e) {
  23452. (function(e) {
  23453. "use strict";
  23454. function r(e, t, i) {
  23455. e = e && e.toLowerCase().trim();
  23456. var n = new C.UP.clone
  23457. , r = Math.PI / 3
  23458. , o = Math.PI / 2;
  23459. switch (e) {
  23460. case "left":
  23461. i.copy(t),
  23462. i.applyAxisAngle(n, o);
  23463. break;
  23464. case "right":
  23465. i.copy(t),
  23466. i.applyAxisAngle(n, -o);
  23467. break;
  23468. case "forwardleft":
  23469. i.copy(t),
  23470. i.applyAxisAngle(n, r);
  23471. break;
  23472. case "forwardright":
  23473. i.copy(t),
  23474. i.applyAxisAngle(n, -r);
  23475. break;
  23476. case "forward":
  23477. default:
  23478. i.copy(t)
  23479. }
  23480. return i
  23481. }
  23482. function o(e, t) {
  23483. if (e) {
  23484. var i = {
  23485. pano: e,
  23486. lookAtPoint: null,
  23487. duration: null,
  23488. maxDistanceOverride: null,
  23489. skipWarpingCheck: !1
  23490. };
  23491. this.player.flyToPano(i, function() {
  23492. t && t({
  23493. success: !0,
  23494. message: "Transition complete."
  23495. })
  23496. })
  23497. } else
  23498. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23499. t && t({
  23500. success: !1,
  23501. error: "Unable to find pano."
  23502. })
  23503. }
  23504. function a(e, t) {
  23505. t.copy(C.FORWARD),
  23506. e.getDirection(t)
  23507. }
  23508. function c(i) {
  23509. return {
  23510. panos: i.panos.list.map(function(e) {
  23511. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23512. return {
  23513. uuid: e.id,
  23514. aligned: e.alignmentType === g.ALIGNED,
  23515. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23516. position: function(e) {
  23517. return e.alignmentType !== g.ALIGNED ? null : {
  23518. x: e.position.x,
  23519. y: e.position.y,
  23520. z: e.position.z
  23521. }
  23522. }(e),
  23523. rotation: function(e) {
  23524. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23525. return {
  23526. x: h.Math.radToDeg(t._x),
  23527. y: h.Math.radToDeg(t._y),
  23528. z: h.Math.radToDeg(t._z)
  23529. }
  23530. }(e),
  23531. thumbnail: t
  23532. }
  23533. })
  23534. }
  23535. }
  23536. var t, l, i, h = q("three"), u = q("./ApiHost"), n = q("../util/logger"), d = q("../util/common"), s = q("../util/math"), p = q("../enum/ModelManagerEvents"), f = q("./PostMessageType"), g = q("../enum/AlignmentType"), m = q("../enum/Direction"), v = q("./TransitionStyles"), y = q("../util/panorama"), A = q("../enum/GLCubeFaces"), C = q("../enum/Vectors"), I = q("../enum/Viewmode"), E = q("../enum/WarpStyle"), _ = (q("../enum/Keys"),
  23537. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23538. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23539. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23540. N.angle = 0,
  23541. N.angleTravelled = 0,
  23542. N.playerDirection = new h.Vector3,
  23543. N.lastFacingDirection = new h.Vector3,
  23544. N.onDone = null,
  23545. N.player = null,
  23546. N.start = function(e, t, i, n) {
  23547. N.active = !0,
  23548. e && t && (t = 0),
  23549. N.angle = e || t,
  23550. N.xAngle = e,
  23551. N.yAngle = t,
  23552. N.angleTravelled = 0,
  23553. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23554. i.getDirection(N.playerDirection),
  23555. N.lastFacingDirection.copy(N.playerDirection),
  23556. N.projectVectors(),
  23557. N.onDone = n,
  23558. N.player = i,
  23559. N()
  23560. }
  23561. ,
  23562. N.projectVectors = function() {
  23563. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23564. N.lastFacingDirection.projectOnPlane(C.UP))
  23565. }
  23566. ,
  23567. N), P = (i = new h.Vector3,
  23568. function(e) {
  23569. e ? (i.copy(e.position),
  23570. i.add(e.discPosition),
  23571. s.projectPositionToCanvas(i, this.player.camera, i),
  23572. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23573. }
  23574. ), O = (l = new h.Vector3,
  23575. function(e) {
  23576. var t = this.player.getDirection();
  23577. l.copy(t);
  23578. var i = l.y;
  23579. l.y = 0,
  23580. l.normalize();
  23581. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23582. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23583. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23584. 0;
  23585. this.player.mode === I.DOLLHOUSE && (n = -n);
  23586. var r = function() {
  23587. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23588. }
  23589. .call(this) - .1
  23590. , o = function() {
  23591. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23592. }
  23593. .call(this) + .1
  23594. , a = n + e;
  23595. r < a ? a = r : a < o && (a = o);
  23596. var s = a - n;
  23597. return 0 < e && s < .01 && (s = 0),
  23598. e < 0 && -.01 < s && (s = 0),
  23599. s
  23600. }
  23601. ), L = (t = new h.Euler,
  23602. function(e) {
  23603. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23604. {
  23605. position: {
  23606. x: e.position.x,
  23607. y: e.position.y,
  23608. z: e.position.z
  23609. },
  23610. rotation: {
  23611. x: h.Math.radToDeg(t.x),
  23612. y: h.Math.radToDeg(t.y),
  23613. z: 0
  23614. },
  23615. pano: e.currentPano ? e.currentPano.id : null,
  23616. mode: e.mode
  23617. }
  23618. }
  23619. ), D = null;
  23620. function N() {
  23621. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23622. N.player.getDirection(N.playerDirection),
  23623. N.projectVectors();
  23624. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23625. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23626. N.onDone && (0,
  23627. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23628. window.setTimeout(N, 4))
  23629. }
  23630. X.exports = {
  23631. init: function(e, t, i, n, r) {
  23632. Y.init(e, t, i, r),
  23633. D = new Promise(function(e, t) {
  23634. i.on(_.Ready, function() {
  23635. e()
  23636. })
  23637. }
  23638. .bind(this));
  23639. var o = new u(window)
  23640. , a = o.waitForConnection();
  23641. a.then(function(e) {
  23642. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  23643. });
  23644. var s, l = (s = Date.now(),
  23645. function() {
  23646. if (!(Date.now() - s < 100)) {
  23647. var e = L(i);
  23648. o.sendEvent(b.MOVE, {
  23649. state: e
  23650. }),
  23651. s = Date.now()
  23652. }
  23653. }
  23654. );
  23655. i.on(_.Move, l),
  23656. i.on(_.ViewChanged, l),
  23657. n.on(p.ActiveModelChanged, function(e) {
  23658. function t(e) {
  23659. var t, i = e.newPano.id;
  23660. e.oldPano && (t = e.oldPano.id),
  23661. i !== t && o.sendEvent(b.ENTER_PANO, {
  23662. oldPano: t,
  23663. newPano: i
  23664. })
  23665. }
  23666. var i = e.model
  23667. , n = e.oldModel;
  23668. Y.model = i,
  23669. a.then(function() {
  23670. o.sendEvent(b.MODEL_LOADED, {
  23671. metadata: c(i)
  23672. })
  23673. }),
  23674. n && n.panos.forEach(function(e) {
  23675. e.removeEventListener("enter", t)
  23676. }),
  23677. i.panos.forEach(function(e) {
  23678. e.on("enter", t)
  23679. })
  23680. })
  23681. }
  23682. };
  23683. var F, B, V, k, U, H, z, G, W, j, Y = {
  23684. director: null,
  23685. player: null,
  23686. controls: null,
  23687. sceneRenderer: null,
  23688. model: null,
  23689. init: function(e, t, i, n) {
  23690. this.director = e,
  23691. this.player = i,
  23692. this.controls = t,
  23693. this.sceneRenderer = n
  23694. },
  23695. handleToObject: {},
  23696. objectToHandle: {},
  23697. handleCount: 0,
  23698. onMessageReceive: function(e) {
  23699. if (e) {
  23700. var t = e.targetFunction
  23701. , i = e.params
  23702. , n = e.onDone;
  23703. t && this[t] && this[t](i, n)
  23704. }
  23705. },
  23706. waitForInit: function(e, t) {
  23707. D.then(t.bind({
  23708. success: !0,
  23709. message: "Init complete."
  23710. }))
  23711. },
  23712. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  23713. j = new h.Quaternion,
  23714. function(e, t) {
  23715. var i = e.pano
  23716. , n = e.rotation
  23717. , r = e.transition;
  23718. if (!this.model)
  23719. return t({
  23720. success: !1,
  23721. error: "The model has not been loaded yet"
  23722. });
  23723. var o = this.model.panos.get(i);
  23724. if (!o)
  23725. return t({
  23726. success: !1,
  23727. error: i + " does not exist in this model"
  23728. });
  23729. if (!n)
  23730. return t({
  23731. sucess: !1,
  23732. erorr: n + " is not a valid rotation"
  23733. });
  23734. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  23735. console.log(n.z);
  23736. var a = {
  23737. success: !0,
  23738. message: i
  23739. };
  23740. if (r === v.FADEOUT)
  23741. j.setFromEuler(W),
  23742. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  23743. else {
  23744. var s, l;
  23745. r === v.INSTANT && (l = s = 0);
  23746. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  23747. this.player.flyToPano({
  23748. pano: o,
  23749. lookAtPoint: c,
  23750. duration: s,
  23751. aimDuration: l
  23752. }, t.bind(this, a))
  23753. }
  23754. }
  23755. ),
  23756. moveInDirection: function(e, t) {
  23757. var i = e.direction;
  23758. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23759. void (t && t({
  23760. success: !1,
  23761. error: "Invalid direction."
  23762. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  23763. t(e ? {
  23764. success: !0,
  23765. message: "moved " + i
  23766. } : {
  23767. success: !1,
  23768. error: "Cannot move in direction: " + i
  23769. })
  23770. })
  23771. },
  23772. getPose: function(e, t) {
  23773. return this.player.camera.position,
  23774. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  23775. t({
  23776. success: !0,
  23777. message: L(this.player)
  23778. })
  23779. },
  23780. takeScreenShot: (z = new h.PerspectiveCamera,
  23781. G = new h.WebGLRenderTarget,
  23782. function(e, t) {
  23783. if (!e.resolution)
  23784. return t({
  23785. success: !1,
  23786. error: "An invalid resolution was specified"
  23787. });
  23788. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  23789. var i = this.sceneRenderer.renderer.getSize();
  23790. e.resolution.width = i.width,
  23791. e.resolution.height = i.height
  23792. }
  23793. z.layers.set(T.DEFAULT),
  23794. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  23795. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  23796. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  23797. var n = e.resolution.width
  23798. , r = e.resolution.height
  23799. , o = n / r;
  23800. z.position.copy(this.sceneRenderer.camera.position),
  23801. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  23802. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  23803. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  23804. G.setSize(n, r),
  23805. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  23806. var a = new Uint8Array(n * r * 4);
  23807. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  23808. var s = S.encode({
  23809. data: a,
  23810. width: n,
  23811. height: r,
  23812. heading: 180,
  23813. pitch: 0
  23814. }, {
  23815. quality: 75,
  23816. flipY: !0
  23817. });
  23818. t({
  23819. success: !0,
  23820. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  23821. })
  23822. }
  23823. ),
  23824. findRankedPano: (U = new h.Vector3,
  23825. H = new h.Vector3,
  23826. function(e, t) {
  23827. a(this.player, H),
  23828. r(t, H, U);
  23829. var i = this.player.rankedPanoInDirection(e, U);
  23830. if (i) {
  23831. var n = this.objectToHandle[i.id];
  23832. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  23833. this.handleToObject[n] = i),
  23834. n
  23835. }
  23836. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  23837. -1
  23838. }
  23839. ),
  23840. findRankedtag: (V = new h.Vector3,
  23841. k = new h.Vector3,
  23842. function(e, t) {
  23843. a(this.player, k),
  23844. r(t, k, V);
  23845. var i = this.player.rankedtagInDirection(e, V);
  23846. if (i) {
  23847. var n = this.objectToHandle[i.sid];
  23848. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  23849. this.handleToObject[n] = i),
  23850. n
  23851. }
  23852. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  23853. -1
  23854. }
  23855. ),
  23856. clickNearesttag: function(e) {
  23857. this.clickRankedtag(0, e)
  23858. },
  23859. clickRankedtag: function(e, t) {
  23860. var i = function(e, t) {
  23861. var i = this.findRankedtag(e, t);
  23862. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  23863. null)
  23864. }
  23865. .call(this, e, t);
  23866. i && P.call(this, i)
  23867. },
  23868. clickNearestPano: function(e, t) {
  23869. this.clickRankedPano(0, e, t)
  23870. },
  23871. clickRankedPano: function(e, t, i) {
  23872. var n = function(e, t) {
  23873. var i = this.findRankedPano(e, t);
  23874. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  23875. null)
  23876. }
  23877. .call(this, e, t);
  23878. n ? o.call(this, n, i) : i(null)
  23879. },
  23880. clickPano: function(e, t) {
  23881. var i = this.handleTable[e];
  23882. i ? o.call(this, i, t) : t(null)
  23883. },
  23884. rotateDirection: function(e, t) {
  23885. var i = e.direction
  23886. , n = e.angle;
  23887. if (!R.active) {
  23888. var r = 0
  23889. , o = 0
  23890. , a = 0
  23891. , s = 0;
  23892. if (!n || isNaN(n))
  23893. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  23894. void (t && t({
  23895. success: !1,
  23896. error: "Invalid rotation angle."
  23897. }));
  23898. if (this.player.mode === I.TRANSITIONING)
  23899. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  23900. void (t && t({
  23901. success: !1,
  23902. error: "Cannot rotate while transitioning"
  23903. }));
  23904. if (i === m.RIGHT || i === m.LEFT)
  23905. i === m.RIGHT && (n = -n),
  23906. r = 0 < n ? -1 : 1,
  23907. a = n;
  23908. else {
  23909. if (i !== m.UP && i !== m.DOWN)
  23910. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  23911. void (t && t({
  23912. success: !1,
  23913. error: "Invalid direction for rotation."
  23914. }));
  23915. if (this.player.mode === I.FLOORPLAN)
  23916. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  23917. void (t && t({
  23918. success: !1,
  23919. error: "Cannot rotate " + i + " in floorplan mode"
  23920. }));
  23921. if (i === m.DOWN && (n = -n),
  23922. 0 === (n = O.call(this, n)))
  23923. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  23924. void (t && t({
  23925. success: !1,
  23926. error: "Already at maximum rotation in direction: " + i
  23927. }));
  23928. o = 0 < n ? 1 : -1,
  23929. s = n
  23930. }
  23931. var l = n;
  23932. n = h.Math.degToRad(n),
  23933. a = h.Math.degToRad(a),
  23934. s = h.Math.degToRad(s);
  23935. var c = this.controls.activeControl;
  23936. c.startRotating(r, o),
  23937. R.start(a, s, this.player, function() {
  23938. c.stopRotating(!0),
  23939. t && t({
  23940. success: !0,
  23941. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  23942. })
  23943. })
  23944. }
  23945. },
  23946. rotate: (F = new h.Vector3,
  23947. B = new h.Vector3,
  23948. function(e, t) {
  23949. var i = e.xAngle
  23950. , n = e.yAngle;
  23951. if (!R.active) {
  23952. if (i = i || 0,
  23953. n = n || 0,
  23954. isNaN(i) || isNaN(n))
  23955. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  23956. void (t && t({
  23957. success: !1,
  23958. error: "Invalid rotation angle."
  23959. }));
  23960. if (this.player.mode === I.TRANSITIONING)
  23961. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  23962. void (t && t({
  23963. success: !1,
  23964. error: "Cannot rotate while transitioning"
  23965. }));
  23966. Math.abs(i) < .01 && (i = 0),
  23967. Math.abs(n) < .01 && (n = 0);
  23968. var r = n;
  23969. n = O.call(this, n);
  23970. var o = 0 < r ? "UP" : "DOWN";
  23971. if (!(i = -i) && r && !n)
  23972. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  23973. void (t && t({
  23974. success: !1,
  23975. error: "Already at maximum rotation in direction: " + o
  23976. }));
  23977. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  23978. var a = n;
  23979. n = h.Math.degToRad(n),
  23980. i = h.Math.degToRad(i),
  23981. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23982. this.player.getDirection(F),
  23983. B.copy(F).applyAxisAngle(C.UP, i),
  23984. B.applyAxisAngle(C.RIGHT, n);
  23985. var s = (F.angleTo(B),
  23986. 0 < i ? -1 : i < 0 ? 1 : 0)
  23987. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  23988. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  23989. var c = this.controls.activeControl;
  23990. c.startRotating(s, l),
  23991. R.start(i, n, this.player, function() {
  23992. c.stopRotating(!0),
  23993. t && t({
  23994. success: !0,
  23995. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  23996. })
  23997. })
  23998. }
  23999. }
  24000. ),
  24001. panCamera: function(e, i) {
  24002. function t(e) {
  24003. switch (r.removeAllListeners(w.AutoPanComplete),
  24004. r.removeAllListeners(w.AutoPanInterrupt),
  24005. r.removeAllListeners(w.AutoPanClamped),
  24006. e) {
  24007. case w.AutoPanInterrupt:
  24008. i({
  24009. success: !0,
  24010. message: "Camera panning interrupted."
  24011. });
  24012. break;
  24013. case w.AutoPanClamped:
  24014. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24015. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24016. return void i({
  24017. success: !1,
  24018. error: "Already at edge of current model bounds."
  24019. });
  24020. var t = "The view point is outside the bounds for the current model. ";
  24021. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24022. console.warn(t)
  24023. }
  24024. case w.AutoPanComplete:
  24025. i({
  24026. success: !0,
  24027. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24028. })
  24029. }
  24030. }
  24031. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24032. return i({
  24033. success: !1,
  24034. error: "Camera panning is not available in the current mode: " + this.player.mode
  24035. });
  24036. var n = e.position
  24037. , r = this.player.control;
  24038. r.setAutoPanPosition(n.x, n.z),
  24039. r.autoPan = !0;
  24040. var o = function(e, t) {
  24041. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24042. };
  24043. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24044. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24045. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24046. },
  24047. click: function(e, t) {
  24048. var i = e.x
  24049. , n = e.y;
  24050. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24051. n = n / 100 * $("#player").height()),
  24052. this.player.handleInputStart(i, n),
  24053. this.player.updateIntersect(),
  24054. this.player.handleInputEnd(i, n)
  24055. },
  24056. mouseOver: function(e, t) {
  24057. var i = e.x
  24058. , n = e.y;
  24059. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24060. n = n / 100 * $("#player").height()),
  24061. this.player.handleInputMove(i, n),
  24062. this.player.updateIntersect()
  24063. },
  24064. moveToMode: function(e, t) {
  24065. function i(e) {
  24066. t(e ? {
  24067. success: !1,
  24068. error: "Failed to load new mode: " + e
  24069. } : {
  24070. success: !0,
  24071. message: "Moved to new mode: " + n
  24072. })
  24073. }
  24074. var n = e.mode;
  24075. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24076. i()
  24077. }, function(e) {
  24078. i(e)
  24079. }) : t({
  24080. success: !1,
  24081. error: "Invalid mode selection"
  24082. })
  24083. }
  24084. }
  24085. }
  24086. ).call(this, "/js/sdk/automation.js")
  24087. }
  24088. , {
  24089. "../constants": 8,
  24090. "../enum/AlignmentType": 17,
  24091. "../enum/ControlEvents": 21,
  24092. "../enum/Direction": 22,
  24093. "../enum/GLCubeFaces": 25,
  24094. "../enum/Keys": 30,
  24095. "../enum/ModelManagerEvents": 33,
  24096. "../enum/PlayerEvents": 40,
  24097. "../enum/RenderLayers": 41,
  24098. "../enum/Vectors": 50,
  24099. "../enum/Viewmode": 51,
  24100. "../enum/WarpStyle": 52,
  24101. "../lib/jpeg_encoder": 94,
  24102. "../sdk/SdkEvents": 161,
  24103. "../settings": 166,
  24104. "../util/common": 185,
  24105. "../util/logger": 189,
  24106. "../util/math": 190,
  24107. "../util/panorama": 191,
  24108. "./ApiHost": 159,
  24109. "./PostMessageType": 160,
  24110. "./TransitionStyles": 162,
  24111. three: 217
  24112. }],
  24113. 165: [function(e, t, i) {
  24114. "use strict";
  24115. function n(e) {
  24116. this.sourceWindow = e,
  24117. this.targetWindow = null,
  24118. this.targetOrigin = null,
  24119. this.id = Math.floor(1e5 * Math.random()),
  24120. this.bindEvents()
  24121. }
  24122. var r = e("./PostMessageType")
  24123. , o = e("events").EventEmitter;
  24124. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24125. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24126. }
  24127. ,
  24128. n.prototype.setTarget = function(e, t) {
  24129. this.targetWindow = e,
  24130. this.targetOrigin = t
  24131. }
  24132. ,
  24133. n.prototype.onPostmessageReceived = function(e) {
  24134. var t = e.origin || e.originalEvent.origin
  24135. , i = e.source;
  24136. switch (e.data.type) {
  24137. case r.CONNECT:
  24138. break;
  24139. case r.RESPONSE:
  24140. if (this.id !== e.data.toId)
  24141. return;
  24142. default:
  24143. if (!this.validateMessageOrigin(t))
  24144. return
  24145. }
  24146. var n = e.data;
  24147. n.source = i,
  24148. n.origin = t,
  24149. n.timestamp = Date.now(),
  24150. this.emit(e.data.type, n)
  24151. }
  24152. ,
  24153. n.prototype.validateMessageOrigin = function(e) {
  24154. return "*" === this.targetOrigin || e === this.targetOrigin
  24155. }
  24156. ,
  24157. n.prototype.send = function(e) {
  24158. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24159. this.targetWindow.postMessage(e, this.targetOrigin))
  24160. }
  24161. ,
  24162. t.exports = n
  24163. }
  24164. , {
  24165. "./PostMessageType": 160,
  24166. events: 202
  24167. }],
  24168. 166: [function(e, t, i) {
  24169. "use strict";
  24170. var n = e("three")
  24171. , r = e("./util/browser")
  24172. , o = e("./enum/Viewmode")
  24173. , a = e("./enum/VROption")
  24174. , s = e("./enum/Colors")
  24175. , l = e("./enum/WarpStyle")
  24176. , c = e("./util/easing")
  24177. , h = e("./util/common")
  24178. , u = e("./util/showcase")
  24179. , d = e("./constants")
  24180. , p = {
  24181. debug: !1,
  24182. version: "2.25.6-0-gd87e5b1",
  24183. languageTag: r.valueFromHash("lang", null),
  24184. pageTitle: "四维虚拟漫游",
  24185. authorizationHeader: u.getAuthorizationHeader(),
  24186. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24187. logLevel: r.valueFromHash("log", 2),
  24188. skyboxRadius: 2500,
  24189. modelBoundsPadding: 5,
  24190. showNeighbors: !1,
  24191. brand: r.valueFromHash("brand", !0),
  24192. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24193. startHighlights: r.valueFromHash("hl", -1),
  24194. specialEdition: r.valueFromHash("bn", 0),
  24195. useWheel: r.valueFromHash("wh", !0),
  24196. crossOrigin: "anonymous",
  24197. fancierTransition: !1,
  24198. wireframe: !1,
  24199. skyboxWireframe: !1,
  24200. modelAlpha: 1,
  24201. highlightPanoSelection: !1,
  24202. showSweeps: !0,
  24203. showSkyboxes: !1,
  24204. showMesh: !0,
  24205. showFloors: !1,
  24206. showFloorDuration: 300,
  24207. showFloorDelay: 300,
  24208. hideFloorDuration: 300,
  24209. hideFloorDelay: 0,
  24210. reticuleOpacityTransitionTime: 250,
  24211. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  24212. markerOpacityTransitionTime: 500,
  24213. guiAnimationSpeed: 250,
  24214. highlightAnimationDuration: 500,
  24215. modelComponentLoadSpinnerDelay: 150,
  24216. captureErrors: !1,
  24217. maxMobileTextures: 6,
  24218. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24219. startupFlyinDelay: 3e3,
  24220. dollhouseDefault: {
  24221. minDistance: 1,//15, //编辑页面给近一些
  24222. maxDistance: 50,
  24223. minPolarAngle: n.Math.degToRad(10),
  24224. maxPolarAngle: n.Math.degToRad(90)
  24225. },
  24226. hideReticuleTimeout: 1e3,
  24227. analytics: {
  24228. inactivityThreshold: 30,
  24229. sessionTrackingRate: .15,
  24230. maxTrackedErrors: 20,
  24231. sessionDurationPingFrequency: 10,
  24232. sessionDurationTimeout: 15
  24233. },
  24234. flydown: {
  24235. movementEasing: "easeInOutQuad",
  24236. movementDelay: .001,
  24237. rotationEasing: "easeInOutQuad",
  24238. rotationDelay: .5,
  24239. modelTextureDelay: .75,
  24240. skyboxDelay: .75
  24241. },
  24242. transition: {
  24243. flySpeed: .001,
  24244. flyTime: 750,
  24245. flytimeMaxDistanceThreshold: 5,
  24246. flytimeDistanceMultiplier: 150,
  24247. aimTime: 1500,
  24248. aimSlowFactor: 1.5,
  24249. blur: .8,
  24250. movementEasing: "easeInOutQuad",
  24251. blendEasing: "easeInOutQuad",
  24252. fastForwardFactor: 3
  24253. },
  24254. show360Views: {
  24255. enabled: !0,
  24256. transitionTime: 1e3
  24257. },
  24258. quickstart: {
  24259. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24260. animation: 1400,
  24261. showTextDelay: 500,
  24262. fadeOutDelay: 3e3,
  24263. fovChange: 10
  24264. },
  24265. appConfig: {
  24266. webvr_version: null,
  24267. segment_key: null,
  24268. embedly_key: null,
  24269. branch_key: null,
  24270. keen_write_key: null,
  24271. keen_project_id: null
  24272. },
  24273. vr: {
  24274. enabled: !0,
  24275. allowWebVR: !1,
  24276. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24277. },
  24278. share: {
  24279. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24280. },
  24281. input: {
  24282. longTapThreshold: 200,
  24283. moveToleranceNDC: .08,
  24284. touchMoveThreshold: 25
  24285. },
  24286. help: {
  24287. modalStayDuration: 600
  24288. },
  24289. immersive: {
  24290. timeToShowAgain: 1250,
  24291. uiStayDuration: 600
  24292. },
  24293. tourInteraction: {
  24294. disabled: "0" === r.valueFromHash("tourcta", null),
  24295. showPauseButton: 1e3,
  24296. showModal: 1500,
  24297. allowNextClick: 200,
  24298. largeModal: "1" === r.valueFromHash("tourcta", null),
  24299. smallModal: "2" === r.valueFromHash("tourcta", null)
  24300. },
  24301. labels: {
  24302. enabled: !1,
  24303. hideUntilStart: !0,
  24304. fadeInDuration: 250,
  24305. fadeInDelay: 250,
  24306. fadeOutDuration: 250,
  24307. fadeOutDelay: 0,
  24308. zoomHideThreshhold: {
  24309. mobile: r.isSmallScreen() ? .45 : .6,
  24310. desktop: 2
  24311. },
  24312. zoomTruncateThreshhold: {
  24313. mobile: r.isSmallScreen() ? .35 : .45,
  24314. desktop: .85
  24315. },
  24316. minLengthForTruncate: 16,
  24317. truncateLength: 12,
  24318. truncateSuffix: "..."
  24319. },
  24320. tags: {
  24321. enabled: r.valueFromHash("mt", 1),
  24322. startup: {
  24323. hideUntilStart: !0,
  24324. fadeInDuration: 500,
  24325. fadeInDelay: 100
  24326. },
  24327. visibility: {
  24328. anyDistance: !0,
  24329. visibleDistance: 8,
  24330. cameraClearance: .1,
  24331. alphaTestLevel: .05,
  24332. hideViaFloor: !0,
  24333. hideOffScreenDisc: !1,
  24334. hideOffScreenObject: !1
  24335. },
  24336. disc: {
  24337. opacity: 1,
  24338. disabledOpacity: .5,
  24339. scale: {
  24340. nearBound: 1.5,
  24341. farBound: 4.8,
  24342. linkFarBound: !1,
  24343. linkPercent: 40,
  24344. maxSize: 80,
  24345. minSize: 40,
  24346. baseViewportSize: 800,
  24347. responsiveness: 100
  24348. }
  24349. },
  24350. pole: {
  24351. enabled: !0,
  24352. height: .5,
  24353. width: 2,
  24354. opacity: .5,
  24355. color: "white"
  24356. },
  24357. navigate: {
  24358. nearestPano: !0,
  24359. lineOfSight: !0,
  24360. reactivate: !0,
  24361. aimAt: "disc",
  24362. tiltTolerance: 25,
  24363. rotateSpeedFactor: .6
  24364. }
  24365. },
  24366. path: {
  24367. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  24368. colorUp: s._desat(s.newBlue, .5),
  24369. colorDown: s._darken(s.newBlue, .35),
  24370. opacity: .5,
  24371. style: "ribbon",
  24372. height: .025,
  24373. ribbonWidth: .24,
  24374. outsideHeight: .5,
  24375. waypointRadius: .5,
  24376. waypointIndoorRadius: .24,
  24377. waypointPulse: 1e3,
  24378. typ: l.BLACK,
  24379. meshFree: r.valueFromHash("mf", 1),
  24380. mapGuides: r.valueFromHash("guides", !0),
  24381. fadeInTime: 400,
  24382. fadeOutTime: 300
  24383. },
  24384. warp: {
  24385. nearPanoDist: .1,
  24386. matchCam: !1,
  24387. blur: .33,
  24388. fastTime: 1500,
  24389. teleportTime: 1500,
  24390. outsideTime: 2e3,
  24391. lookAheadMax: .3,
  24392. lookAheadDist: 2.5,
  24393. softPushDist: .37,
  24394. softPushEnd: .3,
  24395. softBendAngle: 8,
  24396. softBendTilt: 4,
  24397. softBendEnd: .3,
  24398. doBurns: !0,
  24399. burnsAngle: 8,
  24400. minBurnsAngle: 35,
  24401. minDownAngle: -35,
  24402. maxTurnPerSec: 280,
  24403. maxAimPerSec: 35,
  24404. minRotation: 12,
  24405. maxAimRotation: 33.2,
  24406. turnFriction: .2,
  24407. flySpeed: .01,
  24408. minWarpTime: 1200,
  24409. warpInterruptionRedirectTime: 500,
  24410. tourStepDelay: r.valueFromHash("st", 0),
  24411. walkDelay: 0,
  24412. walkMaxDist: 50,
  24413. walkMinDist: .8,
  24414. walkSlideShowThreshhold: 3e3,
  24415. walkExtraPanosDistance: .4,
  24416. timePerMeter: 1200,
  24417. motionLeadTime: 5e3,
  24418. movementEasing: "easeInOutQuad",
  24419. blendEasing: "easeInOutQuad",
  24420. showBunny: !1,
  24421. loop: r.valueFromHash("lp", !1),
  24422. auto: r.valueFromHash("ts", -1),
  24423. eOrder: "YXZ",
  24424. stepFactor: .25,
  24425. brakeStrength: 2,
  24426. minBrakeAngle: .1,
  24427. maxBrakeAngle: 1.8,
  24428. climbEffort: 4
  24429. },
  24430. rotationFriction: .05,
  24431. rotationAccelerationInside: 4.5,
  24432. rotationAccelerationOutside: .15,
  24433. rotationAfterMoveMultiplier: 40,
  24434. rotationAfterMoveHistoryCount: 5,
  24435. panFriction: .09,
  24436. panAccelerationOutside: 60,
  24437. onload: r.valueFromHash("onload", o.PANORAMA),
  24438. zoomNearLimit: .1,
  24439. zoomFarLimit: 10,
  24440. navigation: {
  24441. panoScores: !1,
  24442. mouseDirection: !0,
  24443. filterStrictness: .75,
  24444. angleFactor: -30,
  24445. directionFactor: 10,
  24446. distanceFactor: -1,
  24447. optionalityFactor: 3
  24448. },
  24449. sdkInit: !1,
  24450. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24451. console: r.valueFromHash("console", !1),
  24452. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24453. panoramaNeighbourMaxDistance: 5,
  24454. panoFloorClickRadius: .35,
  24455. showScreenshotLocations: !1,
  24456. showAxis: !1,
  24457. showNeighbourRaycasts: !1,
  24458. colorMarkerOnLoad: !1,
  24459. colorMarkerByFloor: !1,
  24460. tiling: {
  24461. panoPreRenderRepeatDelay: 2500,
  24462. panoPreRenderDelay: 500,
  24463. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24464. tilingFlagNames: ["usetiles", "tiles"],
  24465. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24466. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24467. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24468. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24469. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24470. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24471. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24472. customCompression: r.valueFromHash("tilecustcomp", 0),
  24473. mobileHighQualityOverride: 1,
  24474. allowUltraHighResolution: !0
  24475. },
  24476. zoom: {
  24477. enabled: !0,
  24478. forceOff: r.valueFromHash("nozoom", 0),
  24479. overridemax: r.valueFromHash("maxzoom", null),
  24480. overridemin: r.valueFromHash("minzoom", null),
  24481. max: d.highQualityMaxZoom,
  24482. min: 1,
  24483. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24484. activationThreshold: 1.1,
  24485. restoreTime: 500
  24486. },
  24487. profiling: {
  24488. enabled: r.valueFromHash("mem", !1)
  24489. }
  24490. };
  24491. (p = h.deepExtend(p, d, {
  24492. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24493. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24494. panorama: {
  24495. transitionTime: 1e3,
  24496. modelAlpha: 0,
  24497. modelAlphaDelay: p.flydown.modelTextureDelay,
  24498. modelAlphaLength: 1,
  24499. skyboxOpacity: 1,
  24500. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24501. skyboxOpacityLength: .9,
  24502. fovLength: 1,
  24503. fovDelay: 0,
  24504. cameraMatrixDuration: .8,
  24505. cameraMatrixDelay: 0,
  24506. cameraMatrixEase: c.easeInCubic,
  24507. reticuleOpacity: 1,
  24508. markerOpacity: .3,
  24509. markerOpacityOnHover: 1
  24510. },
  24511. dollhouse: {
  24512. transitionTime: 1e3,
  24513. modelAlpha: 1,
  24514. modelAlphaDelay: 0,
  24515. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24516. skyboxOpacity: 0,
  24517. skyboxOpacityDelay: 0,
  24518. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24519. fovLength: 1,
  24520. fovDelay: 0,
  24521. cameraMatrixDuration: .8,
  24522. cameraMatrixDelay: .3,
  24523. cameraMatrixEase: c.easeInCubic,
  24524. reticuleOpacity: 1,
  24525. markerOpacity: 0,
  24526. markerOpacityOnHover: 0
  24527. },
  24528. floorplan: {
  24529. transitionTime: 1e3,
  24530. modelAlpha: 1,
  24531. modelAlphaDelay: 0,
  24532. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24533. skyboxOpacity: 0,
  24534. skyboxOpacityDelay: 0,
  24535. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24536. fovLength: 1,
  24537. fovDelay: 0,
  24538. cameraMatrixDuration: .5,
  24539. cameraMatrixDelay: 0,
  24540. cameraMatrixEase: c.easeOutCubic,
  24541. reticuleOpacity: 1,
  24542. markerOpacity: 0,
  24543. markerOpacityOnHover: 0,
  24544. cameraHeight: 50
  24545. },
  24546. transitioning: {
  24547. reticuleOpacity: 0,
  24548. markerOpacity: .3,
  24549. markerOpacityOnHover: 1
  24550. },
  24551. "floorplan-dollhouse": {
  24552. rotationDelay: 0,
  24553. rotationDuration: 1
  24554. },
  24555. "floorplan-panorama": {
  24556. rotationDelay: .5,
  24557. rotationDuration: 1
  24558. },
  24559. "dollhouse-panorama": {
  24560. rotationDelay: .5,
  24561. rotationDuration: 1
  24562. },
  24563. "dollhouse-floorplan": {
  24564. rotationDelay: 0,
  24565. rotationDuration: 1,
  24566. cameraMatrixDuration: 1.05,
  24567. cameraMatrixDelay: .5
  24568. },
  24569. "panorama-dollhouse": {
  24570. rotationDelay: 0,
  24571. rotationDuration: .5
  24572. },
  24573. "panorama-floorplan": {
  24574. transitionTime: 1500,
  24575. rotationDelay: 0,
  24576. rotationDuration: .5
  24577. }
  24578. })).path.meshFree && (p.path.typ = l.WALK),
  24579. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24580. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24581. t.exports = p
  24582. }
  24583. , {
  24584. "./constants": 8,
  24585. "./enum/Colors": 19,
  24586. "./enum/VROption": 47,
  24587. "./enum/Viewmode": 51,
  24588. "./enum/WarpStyle": 52,
  24589. "./util/browser": 182,
  24590. "./util/common": 185,
  24591. "./util/easing": 186,
  24592. "./util/showcase": 193,
  24593. three: 217
  24594. }],
  24595. 167: [function(e, t, i) {
  24596. "use strict";
  24597. var n = e("three")
  24598. , r = e("./settings")
  24599. , 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"
  24600. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24601. t.exports = {
  24602. basicTextured: {
  24603. uniforms: {
  24604. tDiffuse: {
  24605. type: "t",
  24606. value: null
  24607. },
  24608. alpha: {
  24609. type: "f",
  24610. value: 1
  24611. }
  24612. },
  24613. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24614. 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}"
  24615. },
  24616. copyCubeMap: {
  24617. uniforms: {
  24618. tDiffuse: {
  24619. type: "t",
  24620. value: null
  24621. },
  24622. alpha: {
  24623. type: "f",
  24624. value: 1
  24625. }
  24626. },
  24627. 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}",
  24628. 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}"
  24629. },
  24630. cube: {
  24631. uniforms: {
  24632. map: {
  24633. type: "t",
  24634. value: null
  24635. },
  24636. opacity: {
  24637. type: "f",
  24638. value: 1
  24639. }
  24640. },
  24641. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24642. 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"
  24643. },
  24644. model: {
  24645. uniforms: {
  24646. map: {
  24647. type: "t",
  24648. value: null
  24649. },
  24650. modelAlpha: {
  24651. type: "f",
  24652. value: r.modelAlpha
  24653. },
  24654. opacity: {
  24655. type: "f",
  24656. value: 1
  24657. },
  24658. progress: {
  24659. type: "f",
  24660. value: 0
  24661. },
  24662. blackout: {
  24663. type: "i",
  24664. value: 0
  24665. },
  24666. pano0Map: {
  24667. type: "t",
  24668. value: null
  24669. },
  24670. pano0Position: {
  24671. type: "v3",
  24672. value: new n.Vector3
  24673. },
  24674. pano0Matrix: {
  24675. type: "m4",
  24676. value: new n.Matrix4
  24677. },
  24678. pano1Map: {
  24679. type: "t",
  24680. value: null
  24681. },
  24682. pano1Position: {
  24683. type: "v3",
  24684. value: new n.Vector3
  24685. },
  24686. pano1Matrix: {
  24687. type: "m4",
  24688. value: new n.Matrix4
  24689. }
  24690. },
  24691. 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",
  24692. 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"
  24693. },
  24694. hot: {
  24695. uniforms: {
  24696. color: {
  24697. type: "c",
  24698. value: new n.Color(16720384)
  24699. },
  24700. opac: {
  24701. type: "f",
  24702. value: 0
  24703. },
  24704. texture1: {
  24705. type: "t",
  24706. value: null
  24707. },
  24708. texture2: {
  24709. type: "t",
  24710. value: null
  24711. }
  24712. },
  24713. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24714. fragmentShader: "varying vec3 vNormal;\n\nvarying vec2 vUv;\n\nuniform float opac;\n\nuniform vec3 color;\n\nuniform sampler2D texture1;\n\nuniform sampler2D texture2;\n\nvoid main() {\n\nvec4 tcolor1 = texture2D( texture1, vUv );\n\nvec4 tcolor2 = texture2D( texture2, vUv );\n\ngl_FragColor = mix(tcolor1,tcolor2 ,opac) + tcolor2*0.2; }\n"
  24715. },
  24716. modelOutside: {
  24717. uniforms: {
  24718. map: {
  24719. type: "t",
  24720. value: null
  24721. },
  24722. opacity: {
  24723. type: "f",
  24724. value: 1
  24725. }
  24726. },
  24727. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24728. 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"
  24729. },
  24730. ribbon: {
  24731. uniforms: {
  24732. map: {
  24733. type: "t",
  24734. value: null
  24735. },
  24736. opacity: {
  24737. type: "f",
  24738. value: 1
  24739. },
  24740. color: {
  24741. type: "c",
  24742. value: new n.Color(r.path.color)
  24743. }
  24744. },
  24745. 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",
  24746. 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"
  24747. },
  24748. waypoint: {
  24749. uniforms: {
  24750. map: {
  24751. type: "t",
  24752. value: null
  24753. },
  24754. opacity: {
  24755. type: "f",
  24756. value: 1
  24757. },
  24758. pulse: {
  24759. type: "f",
  24760. value: 1
  24761. },
  24762. nearFade: {
  24763. type: "v2",
  24764. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24765. },
  24766. color: {
  24767. type: "c",
  24768. value: new n.Color(r.reticuleColor)
  24769. }
  24770. },
  24771. 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",
  24772. 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"
  24773. },
  24774. modelDebug: {
  24775. uniforms: {
  24776. map: {
  24777. type: "t",
  24778. value: null
  24779. },
  24780. modelAlpha: {
  24781. type: "f",
  24782. value: r.modelAlpha
  24783. },
  24784. depthmapRatio: {
  24785. type: "f",
  24786. value: 0
  24787. },
  24788. opacity: {
  24789. type: "f",
  24790. value: 1
  24791. },
  24792. progress: {
  24793. type: "f",
  24794. value: 0
  24795. },
  24796. considerOcclusion: {
  24797. type: "i",
  24798. value: r.fancierTransition
  24799. },
  24800. highlightPanoSelection: {
  24801. type: "i",
  24802. value: 0
  24803. },
  24804. useThirdPano: {
  24805. type: "i",
  24806. value: r.useThirdPano
  24807. },
  24808. pano0Map: {
  24809. type: "t",
  24810. value: null
  24811. },
  24812. pano0Depth: {
  24813. type: "t",
  24814. value: null
  24815. },
  24816. pano0Position: {
  24817. type: "v3",
  24818. value: new n.Vector3
  24819. },
  24820. pano0Matrix: {
  24821. type: "m4",
  24822. value: new n.Matrix4
  24823. },
  24824. pano0Weight: {
  24825. type: "f",
  24826. value: r.transition.pano0Weight
  24827. },
  24828. pano1Map: {
  24829. type: "t",
  24830. value: null
  24831. },
  24832. pano1Depth: {
  24833. type: "t",
  24834. value: null
  24835. },
  24836. pano1Position: {
  24837. type: "v3",
  24838. value: new n.Vector3
  24839. },
  24840. pano1Matrix: {
  24841. type: "m4",
  24842. value: new n.Matrix4
  24843. },
  24844. pano1Weight: {
  24845. type: "f",
  24846. value: r.transition.pano1Weight
  24847. },
  24848. pano2Map: {
  24849. type: "t",
  24850. value: null
  24851. },
  24852. pano2Depth: {
  24853. type: "t",
  24854. value: null
  24855. },
  24856. pano2Position: {
  24857. type: "v3",
  24858. value: new n.Vector3
  24859. },
  24860. pano2Matrix: {
  24861. type: "m4",
  24862. value: new n.Matrix4
  24863. },
  24864. pano2Weight: {
  24865. type: "f",
  24866. value: r.transition.pano2Weight
  24867. }
  24868. },
  24869. 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",
  24870. 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"
  24871. },
  24872. customDepth: {
  24873. uniforms: {
  24874. panoPosition: {
  24875. type: "v3",
  24876. value: new n.Vector3
  24877. }
  24878. },
  24879. 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",
  24880. 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"
  24881. },
  24882. skysphere: {
  24883. uniforms: {
  24884. radius: {
  24885. type: "f",
  24886. value: 0
  24887. }
  24888. },
  24889. 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",
  24890. 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"
  24891. },
  24892. tagDisc: {
  24893. uniforms: {
  24894. opacity: {
  24895. type: "f",
  24896. value: 0
  24897. },
  24898. color: {
  24899. type: "c",
  24900. value: new n.Color
  24901. },
  24902. bg: {
  24903. type: "t",
  24904. value: null
  24905. },
  24906. mask: {
  24907. type: "t",
  24908. value: null
  24909. }
  24910. },
  24911. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24912. 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"
  24913. }
  24914. }
  24915. window.shaders = t.exports;
  24916. }
  24917. , {
  24918. "./settings": 166,
  24919. three: 217
  24920. }],
  24921. 168: [function(E, _, e) {
  24922. (function(e) {
  24923. "use strict";
  24924. var t = E("three")
  24925. , i = (E("url"),
  24926. E("./util/ajax"))
  24927. , n = E("./settings")
  24928. , r = E("./util/logger")
  24929. , o = E("./util/math")
  24930. , a = E("./util/showcase")
  24931. , s = E("./objects/Panorama")
  24932. , l = new r(e)
  24933. , c = E("./model/Model")
  24934. , h = E("./shaders")
  24935. , u = E("./util/transitions")
  24936. , d = E("./objects/Chunk")
  24937. , p = E("./objects/Reticule")
  24938. , f = E("./objects/Skybox")
  24939. , g = E("./objects/Floor")
  24940. , m = E("./cameras/DollhouseCamera")
  24941. , v = E("./cameras/FloorplanCamera")
  24942. , y = E("./cameras/PanoramaCamera")
  24943. , A = E("./controls/DollhouseControls")
  24944. , C = E("./controls/FloorplanControls")
  24945. , I = E("./controls/PanoramaControls");
  24946. t.ImageUtils.crossOrigin = n.crossOrigin,
  24947. _.exports = {
  24948. shaders: h,
  24949. transitions: u,
  24950. Model: c,
  24951. Chunk: d,
  24952. Floor: g,
  24953. Skybox: f,
  24954. Reticule: p,
  24955. Panorama: s,
  24956. DollhouseCamera: m,
  24957. FloorplanCamera: v,
  24958. PanoramaCamera: y,
  24959. DollhouseControls: A,
  24960. FloorplanControls: C,
  24961. PanoramaControls: I,
  24962. getModel: function(e) {
  24963. if (!e.url)
  24964. throw 'getModel(): missing parameter "url"';
  24965. e.autoload = void 0 === e.autoload || e.autoload;
  24966. var t = a.parseSidUrl(e.url);
  24967. e.urlBase = t.urlBase,
  24968. e.urlModel = t.urlModel,
  24969. e.urlFiles = t.urlFiles;
  24970. var i = this._getPlatformError();
  24971. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  24972. this._loadModel().then(this._buildModel.bind(this)))
  24973. },
  24974. _getPlatformError: function() {
  24975. 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"
  24976. },
  24977. _loadModel: function() {
  24978. return i.get(this.options.urlModel, {
  24979. responseType: "json",
  24980. prefetchFrom: "model",
  24981. auth: a.getAuthorizationHeader()
  24982. }).then(null, function() {
  24983. return l.warn("Model loading failed at initial metadata load"),
  24984. "loading-failed"
  24985. })
  24986. },
  24987. _buildModel: function(e) {
  24988. e = a.normalizeModeldata(e, o);
  24989. var t = new c(this.options,e);
  24990. return this.options.autoload ? t.load(!0) : $.when(t)
  24991. }
  24992. }
  24993. }
  24994. ).call(this, "/js/showcase.js")
  24995. }
  24996. , {
  24997. "./cameras/DollhouseCamera": 5,
  24998. "./cameras/FloorplanCamera": 6,
  24999. "./cameras/PanoramaCamera": 7,
  25000. "./controls/DollhouseControls": 10,
  25001. "./controls/FloorplanControls": 11,
  25002. "./controls/PanoramaControls": 13,
  25003. "./model/Model": 139,
  25004. "./objects/Chunk": 144,
  25005. "./objects/Floor": 146,
  25006. "./objects/Panorama": 148,
  25007. "./objects/Reticule": 149,
  25008. "./objects/Skybox": 152,
  25009. "./settings": 166,
  25010. "./shaders": 167,
  25011. "./util/ajax": 181,
  25012. "./util/logger": 189,
  25013. "./util/math": 190,
  25014. "./util/showcase": 193,
  25015. "./util/transitions": 195,
  25016. three: 217,
  25017. url: 208
  25018. }],
  25019. 169: [function(e, t, i) {
  25020. "use strict";
  25021. function l(e) {
  25022. var t = {
  25023. renderTarget: null,
  25024. inUse: !1,
  25025. size: -1,
  25026. pano: null
  25027. };
  25028. return t.inUse = !0,
  25029. t.size = e,
  25030. function(e) {
  25031. O.push(e)
  25032. }(t),
  25033. t
  25034. }
  25035. function c(e) {
  25036. for (var t = 0; t < O.length; t++) {
  25037. var i = O[t];
  25038. if (i.renderTarget === e)
  25039. return !(i.inUse = !1)
  25040. }
  25041. return !1
  25042. }
  25043. function n() {
  25044. this.tileDirectory = {},
  25045. this.activeRenderTargetDescriptors = {},
  25046. this.activePanos = [],
  25047. this.panoLODDescriptors = {},
  25048. this.panoDescriptors = {},
  25049. this.tileTrees = {},
  25050. this.sceneRenderer = null,
  25051. this.tileDownloader = null,
  25052. this.forceQueue = [],
  25053. this.uploadQueues = {},
  25054. this.uploadInterval = null,
  25055. this.uploadIntervalCancelled = !1,
  25056. this.usingTileOverlay = !1,
  25057. this.overlayTilesLoaded = !1,
  25058. this.overlayTileBase = null,
  25059. this.overlayTilesBasic = {},
  25060. this.overlayTilesEnhanced = {},
  25061. this.zoomRenderTarget = null,
  25062. this.zoomPano = null,
  25063. this.zoomingActive = !1,
  25064. this.zoomPanoId = null,
  25065. this.zoomPanoRenderingDisabled = !1,
  25066. this.direction = new _.Vector3,
  25067. this.initTime = -1,
  25068. this.maxBaseUploadsPerFrame = R,
  25069. this.maxNonBaseUploadsPerFrame = M
  25070. }
  25071. var I, E, r, o, a, h, s, _ = e("three"), u = e("../exception/BasicException"), d = e("../settings"), p = e("../enum/PanoSizeClass"), b = (e("../objects/Panorama"),
  25072. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25073. e("../objects/Panorama"),
  25074. e("./TileTree")), y = (e("./TileDownloader"),
  25075. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25076. e("../util/browser"),
  25077. e("../util/panorama")), w = e("events").EventEmitter, T = !1, x = d.tiling.uploadIntervalDelay, S = d.tiling.initialIntervalDelay, M = d.tiling.maxNonBaseUploadsPerFrame, R = d.tiling.maxBaseUploadsPerFrame, P = {
  25078. Base: 0,
  25079. Remaining: 1
  25080. }, O = [];
  25081. function L(e) {
  25082. var t = e.shift();
  25083. return t.uploadQueued = !1,
  25084. t
  25085. }
  25086. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25087. this.sceneRenderer = e,
  25088. this.tileDownloader = t,
  25089. this.qualityManager = i,
  25090. this.bindEvents(),
  25091. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25092. this.initTime = performance.now()
  25093. }
  25094. ,
  25095. n.prototype.getActivePanoTextures = function(e) {
  25096. e = e || [];
  25097. for (var t = 0; t < O.length; t++) {
  25098. var i = O[t];
  25099. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25100. }
  25101. }
  25102. ,
  25103. n.prototype.hasQueuedTiles = function() {
  25104. var e = this.peekNextFromUploadQueue();
  25105. return null != e
  25106. }
  25107. ,
  25108. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25109. return this.activeRenderTargetDescriptors[e]
  25110. }
  25111. ,
  25112. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25113. this.activeRenderTargetDescriptors[e] = t
  25114. }
  25115. ,
  25116. n.prototype.loadOverlayTiles = function() {
  25117. if (0 !== d.tiling.overlayStyle) {
  25118. var n = 0
  25119. , e = function(e, t, i) {
  25120. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25121. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25122. ++n === r.length && (this.overlayTilesLoaded = !0)
  25123. }
  25124. .bind(this)
  25125. , r = [["images/outlineBase.png", e.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", e.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", e.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", e.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", e.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", e.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", e.bind(this, this.overlayTilesEnhanced, 4096)]];
  25126. r.forEach(function(e) {
  25127. this.tileDownloader.loadImage(e[0], 0, e[1])
  25128. }
  25129. .bind(this)),
  25130. this.usingTileOverlay = !0
  25131. } else
  25132. this.usingTileOverlay = !1
  25133. }
  25134. ,
  25135. n.prototype.bindEvents = function() {
  25136. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25137. }
  25138. ,
  25139. n.prototype.setupZoomRenderTarget = function() {
  25140. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25141. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25142. return;
  25143. var e = this.zoomRenderTarget;
  25144. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25145. e) {
  25146. var t = e.width
  25147. , i = this.zoomRenderTarget.width;
  25148. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25149. e.texture.dispose(),
  25150. e.texture.loaded = !1,
  25151. e.texture.version = 0,
  25152. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25153. e.texture = null
  25154. }
  25155. this.zoomPanoRenderingDisabled = !1
  25156. } else
  25157. this.zoomPanoRenderingDisabled = !0
  25158. }
  25159. ,
  25160. n.prototype.enableUltraHighQualityMode = function(t) {
  25161. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25162. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25163. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25164. e && (this.qualityManager.enableUltraHighQualityMode(),
  25165. this.setupZoomRenderTarget(),
  25166. t())
  25167. }
  25168. .bind(this))
  25169. }
  25170. }
  25171. ,
  25172. n.prototype.activateTiledPano = function(e, t, i) {
  25173. i && this.clearAllQueuedUploads();
  25174. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25175. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25176. this.linkAllTilesAndNodes(e);
  25177. var r = this.getActiveRenderTargetDescriptor(e.id)
  25178. , o = t;
  25179. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25180. !r || o !== r.size) {
  25181. if (r && c(r.renderTarget),
  25182. !(r = function(e) {
  25183. for (var t = 0; t < O.length; t++) {
  25184. var i = O[t];
  25185. if (!i.inUse && i.size === e)
  25186. return i.inUse = !0,
  25187. i
  25188. }
  25189. return null
  25190. }(o))) {
  25191. var a = this.initTiledPano(o, !1);
  25192. (r = l(a.width)).renderTarget = a
  25193. }
  25194. r.pano = e,
  25195. this.resetPanoDescriptor(e.id),
  25196. this.resetPanoLODDescriptors(e.id),
  25197. this.resetRenderStatus(e.id, !0, !0)
  25198. }
  25199. this.setActiveRenderTargetDescriptor(e.id, r);
  25200. var s = i ? 0 : 1;
  25201. return this.updateActivePanos(e, s),
  25202. r.renderTarget
  25203. }
  25204. ,
  25205. n.prototype.deactivateTiledPano = function(e) {
  25206. var t = this.getActiveRenderTargetDescriptor(e.id);
  25207. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25208. this.setActiveRenderTargetDescriptor(e.id, null);
  25209. var i = this.getUploadQueueForPano(e.id);
  25210. this.clearUploadQueue(i),
  25211. this.updateActivePanos()
  25212. }
  25213. ,
  25214. n.prototype.updateActivePanos = (s = [],
  25215. function(e, t) {
  25216. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25217. e && s.length === t && s.push(e);
  25218. var n = this.activePanos[i]
  25219. , r = this.getActiveRenderTargetDescriptor(n.id);
  25220. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25221. }
  25222. e && t >= s.length && s.push(e),
  25223. this.activePanos.length = 0,
  25224. this.activePanos.push.apply(this.activePanos, s)
  25225. }
  25226. ),
  25227. n.prototype.getActivePanoCount = function() {
  25228. return this.activePanos.length
  25229. }
  25230. ,
  25231. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25232. var i = null;
  25233. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25234. for (var n = function(e, t, i, n) {
  25235. o && (t.tile.zoomUploaded = !1),
  25236. r && (t.tile.uploaded = !1)
  25237. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25238. this.getTileTree(e, a).breadthFirst({
  25239. callback: n.bind(this, a),
  25240. minLevel: i
  25241. })
  25242. }
  25243. }
  25244. ,
  25245. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25246. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25247. t.tile.zoomUploaded = t.tile.uploaded,
  25248. t.zoomCovered = t.covered
  25249. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25250. this.getTileTree(e, n).breadthFirst({
  25251. callback: i.bind(this, n),
  25252. maxLevel: t
  25253. })
  25254. }
  25255. }
  25256. ,
  25257. n.prototype.renderPanoTiles = (h = [],
  25258. function(e, t, i, n) {
  25259. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25260. t = t || this.direction || m.FORWARD;
  25261. var r = this.getActiveRenderTargetDescriptor(e);
  25262. if (!this.isRenderTargetDescriptorValid(r))
  25263. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25264. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25265. var a = this.getTileTree(e, o);
  25266. h.length = 0,
  25267. a.breadthFirst({
  25268. saveVisited: h
  25269. });
  25270. for (var s = 0; s < h.length; s++) {
  25271. var l = h[s];
  25272. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25273. }
  25274. }
  25275. this.updateDirection(t)
  25276. }
  25277. ),
  25278. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25279. return e && e.renderTarget
  25280. }
  25281. ,
  25282. n.prototype.isPanoActive = function(e) {
  25283. var t = this.getActiveRenderTargetDescriptor(e);
  25284. return this.isRenderTargetDescriptorValid(t)
  25285. }
  25286. ,
  25287. n.prototype.isPanoZoomed = function(e) {
  25288. return this.zoomingActive && this.zoomPanoId === e
  25289. }
  25290. ,
  25291. n.prototype.initTileTree = function(e, t, i) {
  25292. var n = this.tileTrees[e];
  25293. n || (n = [],
  25294. this.tileTrees[e] = n);
  25295. var r = n[t];
  25296. if (!r) {
  25297. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25298. r = new v(A.TILE_SIZE,o),
  25299. n[t] = r
  25300. }
  25301. }
  25302. ,
  25303. n.prototype.getTileTree = function(e, t) {
  25304. var i = this.tileTrees[e];
  25305. if (!i)
  25306. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25307. var n = i[t];
  25308. if (!n)
  25309. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25310. return n
  25311. }
  25312. ,
  25313. n.prototype.initTiledPano = function(e, t) {
  25314. var i = this.sceneRenderer.renderer
  25315. , n = (i.context,
  25316. new _.WebGLRenderTargetCube(e,e,{
  25317. stencilBuffer: !1
  25318. }))
  25319. , r = new _.CubeTexture([]);
  25320. (n.texture = r).image = [null, null, null, null, null, null],
  25321. r.flipY = !0,
  25322. t ? (r.generateMipmaps = !0,
  25323. r.magFilter = _.LinearFilter,
  25324. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25325. r.magFilter = _.LinearFilter,
  25326. r.minFilter = _.LinearFilter),
  25327. r.format = _.RGBAFormat,
  25328. i.setRenderTarget(n),
  25329. i.setRenderTarget(null);
  25330. var o = i.properties.get(r);
  25331. return o.__image__webglTextureCube = o.__webglTexture,
  25332. n
  25333. }
  25334. ,
  25335. n.prototype.getUploadQueueForPano = function(e) {
  25336. var t = this.uploadQueues[e];
  25337. return t || (t = [],
  25338. this.uploadQueues[e] = t),
  25339. t
  25340. }
  25341. ,
  25342. n.prototype.isTileUploaded = function(e) {
  25343. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25344. }
  25345. ,
  25346. n.prototype.setUploaded = function(e, t) {
  25347. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25348. }
  25349. ,
  25350. n.prototype.queueTileUpload = function(e, t, i) {
  25351. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25352. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25353. var r = this.getUploadQueueForPano(e.panoId);
  25354. 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),
  25355. e.uploadQueued = !0,
  25356. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25357. }
  25358. }
  25359. ,
  25360. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25361. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25362. }
  25363. ,
  25364. n.prototype.getTopUploadQueue = function() {
  25365. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25366. for (var n = 0; n < this.activePanos.length; n++)
  25367. if (e = this.activePanos[n],
  25368. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25369. switch (i) {
  25370. case P.Base:
  25371. if (0 === t[0].level)
  25372. return t;
  25373. break;
  25374. case P.Remaining:
  25375. return t
  25376. }
  25377. return null
  25378. }
  25379. ,
  25380. n.prototype.getNextFromUploadQueue = function() {
  25381. if (0 < this.forceQueue.length)
  25382. return L(this.forceQueue);
  25383. var e = this.getTopUploadQueue();
  25384. return e && 0 < e.length ? L(e) : null
  25385. }
  25386. ,
  25387. n.prototype.peekNextFromUploadQueue = function() {
  25388. if (0 < this.forceQueue.length)
  25389. return this.forceQueue[0];
  25390. var e = this.getTopUploadQueue();
  25391. return e && 0 < e.length ? e[0] : null
  25392. }
  25393. ,
  25394. n.prototype.clearAllQueuedUploads = function() {
  25395. this.clearAllUploadQueues(null, 0)
  25396. }
  25397. ,
  25398. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25399. this.clearAllUploadQueues(e, 0)
  25400. }
  25401. ,
  25402. n.prototype.clearAllUploadQueues = function(e, t) {
  25403. if (e)
  25404. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25405. this.clearUploadQueue(this.forceQueue, t, e);
  25406. else {
  25407. for (var i = 0; i < this.activePanos.length; i++) {
  25408. var n = this.activePanos[i];
  25409. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25410. }
  25411. this.clearUploadQueue(this.forceQueue, t)
  25412. }
  25413. }
  25414. ,
  25415. n.prototype.clearUploadQueue = function(e, t, i) {
  25416. null != t || (t = 0);
  25417. for (var n = 0; n < e.length; ) {
  25418. var r = e[n];
  25419. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25420. e.splice(n, 1)) : n++
  25421. }
  25422. }
  25423. ,
  25424. n.prototype.refreshUploadInterval = (a = null,
  25425. function(e) {
  25426. this.uploadIntervalCancelled || (a = a || function() {
  25427. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25428. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25429. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25430. }
  25431. .bind(this),
  25432. null != e || (e = x),
  25433. T || (e = S),
  25434. this.uploadInterval = window.setTimeout(a, e),
  25435. this.uploadIntervalDelay = e)
  25436. }
  25437. ),
  25438. n.prototype.update = (r = performance.now(),
  25439. o = 0,
  25440. function() {
  25441. this.uploadIntervalCancelled = !0,
  25442. window.clearTimeout(this.uploadInterval),
  25443. this.uploadInterval = null;
  25444. var e = performance.now() - r;
  25445. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25446. r = performance.now()),
  25447. o++
  25448. }
  25449. ),
  25450. n.prototype.updateUploadQueue = function(e, t) {
  25451. e = e || 1;
  25452. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25453. var r = this.getNextFromUploadQueue();
  25454. if (!r)
  25455. break;
  25456. if (0 !== r.level ? i++ : n++,
  25457. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25458. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25459. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25460. }
  25461. }
  25462. }
  25463. ,
  25464. n.prototype.updateDirection = function(e) {
  25465. if (e = e || this.direction) {
  25466. this.direction = e;
  25467. for (var t = 0; t < this.activePanos.length; t++) {
  25468. var i = this.activePanos[t]
  25469. , n = this.getUploadQueueForPano(i.id);
  25470. y.sortPanoTiles(n, i, this.direction)
  25471. }
  25472. }
  25473. }
  25474. ,
  25475. n.prototype.uploadTile = (I = {},
  25476. new _.Vector4,
  25477. E = d.tiling.overlayStyle,
  25478. function(e, t) {
  25479. var i = e.panoId
  25480. , n = e.image
  25481. , r = e.tileSize
  25482. , o = e.panoSize
  25483. , a = e.tileIndex
  25484. , s = (e.faceTileIndex,
  25485. e.totalTiles)
  25486. , l = (e.face,
  25487. e.tileX)
  25488. , c = e.tileY
  25489. , h = !0
  25490. , u = !1
  25491. , d = (this.getPanoDescriptor(i),
  25492. this.getPanoLODDescriptor(i, o))
  25493. , p = this.getActiveRenderTargetDescriptor(i)
  25494. , f = p.renderTarget
  25495. , g = p.size;
  25496. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25497. g = this.qualityManager.getMaxZoomPanoSize()),
  25498. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25499. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25500. this.isTileUploaded(e) && (u = h = !1)),
  25501. h) {
  25502. var m = r / o * g
  25503. , v = l * r / o * g
  25504. , y = c * r / o * g;
  25505. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25506. var A = I[r];
  25507. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25508. 1 === E || 2 === E) {
  25509. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25510. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25511. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25512. } else
  25513. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25514. d.uploadCount++,
  25515. this.emit(b.TileRenderSuccess, i, o, a, s),
  25516. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25517. this.setUploaded(e, !0),
  25518. this.addCoverageForNode(e.node)
  25519. } else
  25520. this.setUploaded(e, !1);
  25521. return e.uploadAttempted || (d.uploadAttempts++,
  25522. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25523. e.uploadAttempted = !0,
  25524. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25525. u
  25526. }
  25527. ),
  25528. n.prototype.linkTileAndNode = function(e, t) {
  25529. (t.tile = e).node = t
  25530. }
  25531. ,
  25532. n.prototype.linkAllTilesAndNodes = function(a) {
  25533. for (var e = function(e, t, i, n, r) {
  25534. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25535. this.linkTileAndNode(o, i)
  25536. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25537. var i = this.getTileTree(a.id, t);
  25538. i.breadthFirst({
  25539. callback: e.bind(this, i, t)
  25540. })
  25541. }
  25542. }
  25543. ,
  25544. n.prototype.anyUploaded = function(e) {
  25545. if (!e)
  25546. return !1;
  25547. if (e.tile && this.isTileUploaded(e.tile))
  25548. return !0;
  25549. if (e.children)
  25550. for (var t = 0; t < e.children.length; t++) {
  25551. var i = e.children[t];
  25552. if (this.anyUploaded(i))
  25553. return !0
  25554. }
  25555. return !1
  25556. }
  25557. ,
  25558. n.prototype.setNodeCovered = function(e, t) {
  25559. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25560. }
  25561. ,
  25562. n.prototype.isNodeCovered = function(e) {
  25563. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25564. }
  25565. ,
  25566. n.prototype.addCoverageForNode = function(e) {
  25567. if (this.setNodeCovered(e, !0),
  25568. e.parent && e.covered) {
  25569. var t = e.parent;
  25570. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25571. }
  25572. }
  25573. ,
  25574. n.prototype.calcFullCoverage = function(e) {
  25575. var t = !1;
  25576. if (e.children)
  25577. for (var i = 0; i < e.children.length; i++) {
  25578. var n = e.children[i];
  25579. t = t || this.calcFullCoverage(n)
  25580. }
  25581. e.covered = e.tile.uploaded || t
  25582. }
  25583. ,
  25584. n.prototype.nodeSubcovered = function(e) {
  25585. if (!e.children)
  25586. return !1;
  25587. for (var t = 0; t < e.children.length; t++)
  25588. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25589. return !1;
  25590. return !0
  25591. }
  25592. ,
  25593. n.prototype.resetPanoDescriptor = function(e) {
  25594. this.getPanoDescriptor(e)
  25595. }
  25596. ,
  25597. n.prototype.getPanoDescriptor = function(e) {
  25598. var t = this.panoDescriptors[e];
  25599. return t || (t = {},
  25600. this.panoDescriptors[e] = t),
  25601. t
  25602. }
  25603. ,
  25604. n.prototype.resetPanoLODDescriptors = function(e) {
  25605. var t = this.getPanoLODDescriptors(e);
  25606. for (var i in t)
  25607. if (t.hasOwnProperty(i)) {
  25608. var n = t[i];
  25609. n.uploadCount = 0,
  25610. n.uploadAttempts = 0
  25611. }
  25612. }
  25613. ,
  25614. n.prototype.getPanoLODDescriptor = function(e, t) {
  25615. var i = this.getPanoLODDescriptors(e)
  25616. , n = i[t];
  25617. return n || (n = {
  25618. uploadCount: 0,
  25619. uploadAttempts: 0
  25620. },
  25621. i[t] = n),
  25622. n
  25623. }
  25624. ,
  25625. n.prototype.getPanoLODDescriptors = function(e) {
  25626. var t = this.panoLODDescriptors[e];
  25627. return t || (t = {},
  25628. this.panoLODDescriptors[e] = t),
  25629. t
  25630. }
  25631. ,
  25632. n.prototype.onTileDownloaded = function(e) {
  25633. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25634. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25635. if (i.downloaded = !0,
  25636. i.image = e.image,
  25637. i.panoSize = e.panoSize,
  25638. i.tileX = e.tileX,
  25639. i.tileY = e.tileY,
  25640. i.totalTiles = e.totalTiles,
  25641. i.tileIndex = e.tileIndex,
  25642. i.faceTileIndex = e.faceTileIndex,
  25643. i.face = e.face,
  25644. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  25645. i.panoId = e.panoId,
  25646. i.tileSize = e.tileSize,
  25647. i.direction = (new _.Vector3).copy(e.direction),
  25648. i.node = null,
  25649. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  25650. this.isPanoActive(i.panoId)) {
  25651. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  25652. this.linkTileAndNode(i, n),
  25653. this.queueTileUpload(i, !0)
  25654. }
  25655. }
  25656. ,
  25657. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25658. var r = this.tileDirectory[e];
  25659. r || (r = {},
  25660. this.tileDirectory[e] = r);
  25661. var o = 16384 * t + 1024 * i + n
  25662. , a = r[o];
  25663. return a || (a = {
  25664. downloaded: !1,
  25665. uploaded: !1,
  25666. zoomUploaded: !1
  25667. },
  25668. r[o] = a),
  25669. a._key = e + ":" + t + ":" + i + ":" + n,
  25670. a._tileKey = o,
  25671. a
  25672. }
  25673. ,
  25674. n.prototype.setZoomingActive = function(e, t, i) {
  25675. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25676. this.zoomPanoId = t.id,
  25677. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25678. }
  25679. ,
  25680. n.prototype.updateZoomedPanoFromBase = function(e) {
  25681. if (!this.zoomPanoRenderingDisabled) {
  25682. var t = this.getActiveRenderTargetDescriptor(e.id);
  25683. if (t && t.renderTarget) {
  25684. var i = this.qualityManager.getMaxZoomPanoSize()
  25685. , n = t.renderTarget
  25686. , r = t.size;
  25687. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25688. this.copyBaseRenderStatusToZoomed(e.id)
  25689. }
  25690. }
  25691. }
  25692. ,
  25693. t.exports = n
  25694. }
  25695. , {
  25696. "../enum/GLCubeFaces": 25,
  25697. "../enum/PanoRendererEvents": 35,
  25698. "../enum/PanoSizeClass": 36,
  25699. "../enum/SceneRendererEvents": 43,
  25700. "../enum/TileDownloaderEvents": 45,
  25701. "../enum/Vectors": 50,
  25702. "../exception/BasicException": 55,
  25703. "../objects/Panorama": 148,
  25704. "../settings": 166,
  25705. "../util/browser": 182,
  25706. "../util/panorama": 191,
  25707. "./TileDownloader": 171,
  25708. "./TilePrioritizer": 172,
  25709. "./TileTree": 173,
  25710. "./TileUtils": 174,
  25711. events: 202,
  25712. three: 217
  25713. }],
  25714. 170: [function(e, t, i) {
  25715. "use strict";
  25716. function n(e, t, i) {
  25717. this.maxNavPanoSize = -1,
  25718. this.maxZoomPanoSize = -1,
  25719. this.devicePixelDensity = e,
  25720. this.deviceScreenSize = t,
  25721. this.clientBandwidth = i,
  25722. this.panoSizeClassMap = {},
  25723. this.useHighResolutionPanos = !0,
  25724. this.useUltraHighResolutionPanos = !1,
  25725. this.modelHasUltraHighPanos = !1
  25726. }
  25727. var r = e("../enum/PanoSizeClass")
  25728. , o = e("../settings")
  25729. , a = e("../util/browser")
  25730. , s = e("../constants")
  25731. , l = e("../util/showcase")
  25732. , c = e("../enum/ModelManagerEvents");
  25733. n.prototype.init = function(e) {
  25734. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25735. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25736. this.highSize = this.getPanoSize(r.HIGH),
  25737. this.standardSize = this.getPanoSize(r.STANDARD),
  25738. this.baseSize = this.getPanoSize(r.BASE),
  25739. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25740. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25741. this.updateMaximums(),
  25742. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25743. }
  25744. ,
  25745. n.prototype.updateFromModel = function(e) {
  25746. this.updateHighResolutionSettings(e),
  25747. this.updateUltraHighResolutionSettings(e)
  25748. }
  25749. ,
  25750. n.prototype.updateHighResolutionSettings = function(e) {
  25751. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25752. this.updateMaximums()
  25753. }
  25754. ,
  25755. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25756. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25757. this.updateMaximums()
  25758. }
  25759. ,
  25760. n.prototype.enableUltraHighQualityMode = function() {
  25761. this.modelHasUltraHighPanos = !0,
  25762. this.updateUltraHighResolutionSettings(null)
  25763. }
  25764. ,
  25765. n.prototype.ultraHighQualityModeEnabled = function() {
  25766. return this.modelHasUltraHighPanos
  25767. }
  25768. ,
  25769. n.prototype.onModelChanged = function(e) {
  25770. this.updateFromModel(e.model),
  25771. this.updateMaximums()
  25772. }
  25773. ,
  25774. n.prototype.updateMaximums = function() {
  25775. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25776. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25777. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25778. }
  25779. ,
  25780. n.prototype.buildPanoSizeClassMap = function() {
  25781. this.panoSizeClassMap[r.BASE] = 512,
  25782. this.panoSizeClassMap[r.STANDARD] = 1024,
  25783. this.panoSizeClassMap[r.HIGH] = 2048,
  25784. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25785. }
  25786. ,
  25787. n.prototype.getPanoSize = function(e) {
  25788. return this.panoSizeClassMap[e]
  25789. }
  25790. ,
  25791. n.prototype.getMaxPossiblePanoSize = function() {
  25792. return this.getPanoSize(r.ULTRAHIGH)
  25793. }
  25794. ,
  25795. n.prototype.getMaxPanoSize = function() {
  25796. return this.maxZoomPanoSize
  25797. }
  25798. ,
  25799. n.prototype.getMaxNavPanoSize = function() {
  25800. return this.maxNavPanoSize
  25801. }
  25802. ,
  25803. n.prototype.getMaxZoomPanoSize = function() {
  25804. return this.maxZoomPanoSize
  25805. }
  25806. ,
  25807. n.prototype.detectMaxNavPanoSizeClass = function() {
  25808. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  25809. }
  25810. ,
  25811. n.prototype.detectMaxNavPanoSize = function() {
  25812. var e = this.detectMaxNavPanoSizeClass();
  25813. return this.getPanoSize(e)
  25814. }
  25815. ,
  25816. n.prototype.detectMaxZoomPanoSize = function() {
  25817. 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)
  25818. }
  25819. ,
  25820. t.exports = n
  25821. }
  25822. , {
  25823. "../constants": 8,
  25824. "../enum/ModelManagerEvents": 33,
  25825. "../enum/PanoSizeClass": 36,
  25826. "../settings": 166,
  25827. "../util/browser": 182,
  25828. "../util/showcase": 193
  25829. }],
  25830. 171: [function(A, C, e) {
  25831. (function(e) {
  25832. "use strict";
  25833. function i(e) {
  25834. this.panos = null,
  25835. this.retryMinimumTime = 1e4,
  25836. this.urls = null,
  25837. this.panoLoadCallbacks = {},
  25838. this.downloadDescriptors = {},
  25839. this.priorityQueue = [],
  25840. this.forceQueue = [],
  25841. this.activeDownloads = [],
  25842. this.qualityManager = null,
  25843. this.tilePrioritizer = null,
  25844. this.refreshInterval = null,
  25845. this.processPriorityQueue = !1,
  25846. this.concurrentDownloads = e.concurrentDownloads || 1,
  25847. this.downloadTestResults = {}
  25848. }
  25849. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  25850. A("../settings")), r = (A("../objects/Panorama"),
  25851. A("../util/logger")), o = (A("../enum/Vectors"),
  25852. A("../enum/PanoSizeClass"),
  25853. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  25854. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  25855. Object.freeze({
  25856. Testing: 1,
  25857. Success: 2,
  25858. Fail: 3
  25859. }));
  25860. i.prototype = Object.create(l.prototype),
  25861. i.IDLE_REFRESH_DELAY = 500,
  25862. i.ACTIVE_REFRESH_DELAY = 16,
  25863. i.DOWNLOAD_RETRIES = 4,
  25864. i.prototype.init = function(e) {
  25865. this.qualityManager = e
  25866. }
  25867. ,
  25868. i.prototype.setUrls = function(e) {
  25869. this.urls = e
  25870. }
  25871. ,
  25872. i.prototype.setPanoData = function(e, t, i) {
  25873. this.panos = e,
  25874. this.imagePanos = t,
  25875. this.panoGroupId = i
  25876. }
  25877. ,
  25878. i.prototype.start = function() {
  25879. this.refreshUpdateInterval(0)
  25880. }
  25881. ,
  25882. i.prototype.stop = function() {
  25883. window.cancel(this.refreshInterval)
  25884. }
  25885. ,
  25886. i.prototype.refreshUpdateInterval = function(e) {
  25887. e = e || 0,
  25888. this.refreshInterval = window.setTimeout(function() {
  25889. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  25890. }
  25891. .bind(this), e)
  25892. }
  25893. ,
  25894. i.prototype.update = function() {
  25895. var e = 0 < this.forceQueue.length;
  25896. return this.processQueueForDownloading(this.forceQueue),
  25897. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  25898. 0 < this.priorityQueue.length && (e = !0),
  25899. this.processQueueForDownloading(this.priorityQueue)),
  25900. e
  25901. }
  25902. ,
  25903. i.prototype.forceQueueTilesForPano = (p = [],
  25904. f = [],
  25905. function(e, t, i, n, r, o) {
  25906. p.length = 0;
  25907. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  25908. var l = a[s];
  25909. l.status !== v.None && l.status !== v.Queued || p.push(l)
  25910. }
  25911. if (i && 0 < p.length) {
  25912. g.sortPanoTiles(p, e, i),
  25913. f.length = 0,
  25914. m.matchingTilesInDirection(e, t, i, n, r, f);
  25915. for (var c = 0, h = function(e) {
  25916. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  25917. }; c < p.length; ) {
  25918. var u = p[c];
  25919. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  25920. }
  25921. }
  25922. for (var d = 0; d < p.length; d++)
  25923. this.forceQueue.push(p[d]);
  25924. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  25925. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  25926. o && this.processQueueForDownloading(this.forceQueue, !0)
  25927. }
  25928. ),
  25929. i.prototype.clearForceQueue = function() {
  25930. this.clearQueue(this.forceQueue)
  25931. }
  25932. ,
  25933. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  25934. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  25935. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  25936. this.clearFromQueue(this.priorityQueue, v.None, !0),
  25937. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  25938. }
  25939. ,
  25940. i.prototype.clearQueue = function(e) {
  25941. this.setStatusForAllDescriptors(e, v.None),
  25942. e.length = 0
  25943. }
  25944. ,
  25945. i.prototype.clearFromQueue = function(e, t, i) {
  25946. for (var n = 0; n < e.length; n++) {
  25947. var r = e[n];
  25948. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  25949. }
  25950. }
  25951. ,
  25952. i.prototype.setStatusForAllDescriptors = function(e, t) {
  25953. for (var i = 0; i < e.length; i++) {
  25954. var n = e[i];
  25955. n && (n.status = t)
  25956. }
  25957. }
  25958. ,
  25959. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  25960. for (var i = 0; i < e.length; i++) {
  25961. var n = e[i];
  25962. n && (n.status !== t ? n.status = t : e[i] = null)
  25963. }
  25964. }
  25965. ,
  25966. i.prototype.getTileDownloadDescriptors = function(e, t) {
  25967. var i = this.getAllTileDownloadDescriptorsForPano(e)
  25968. , n = i[t];
  25969. return n || (n = this.buildDownloadDescriptorArray(t),
  25970. i[t] = n,
  25971. this.initTileDownloadDescriptors(n, e, t)),
  25972. n
  25973. }
  25974. ,
  25975. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  25976. var t = this.downloadDescriptors[e.id];
  25977. return t || (t = {},
  25978. this.downloadDescriptors[e.id] = t),
  25979. t
  25980. }
  25981. ,
  25982. i.prototype.processQueueForDownloading = function(e, t) {
  25983. if (this.cleanupActiveDownloads(),
  25984. this.activeDownloads.length < this.concurrentDownloads || t)
  25985. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  25986. var r = e.shift();
  25987. r && (this.startDownload(r),
  25988. n++)
  25989. }
  25990. }
  25991. ,
  25992. i.prototype.testDownload = function(t, e, i) {
  25993. var n = this.downloadTestResults[t];
  25994. if (n)
  25995. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  25996. else {
  25997. this.downloadTestResults[t] = y.Testing;
  25998. var r = this.panos.list[0]
  25999. , o = this.getTileUrl(r.id, t, e, 0)
  26000. , a = function(e) {
  26001. this.downloadTestResults[t] = y.Success,
  26002. i(!0)
  26003. }
  26004. .bind(this)
  26005. , s = function() {
  26006. this.downloadTestResults[t] = y.Fail,
  26007. i(!1)
  26008. }
  26009. .bind(this);
  26010. this.loadImage(o, 0, a, s)
  26011. }
  26012. }
  26013. ,
  26014. i.prototype.startDownload = function(e) {
  26015. e.status = v.Downloading;
  26016. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26017. this.activeDownloads.push(e),
  26018. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26019. }
  26020. ,
  26021. i.prototype.downloadFailed = function(e, t) {}
  26022. ,
  26023. i.prototype.downloadComplete = function(e, t) {
  26024. if (e.panoGroupId === this.panoGroupId) {
  26025. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26026. e.status = v.Downloaded,
  26027. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26028. var n = {
  26029. panoId: e.pano.id,
  26030. image: t,
  26031. tileSize: e.tileSize,
  26032. panoSize: e.panoSize,
  26033. tileIndex: e.tileIndex,
  26034. faceTileIndex: e.faceTileIndex,
  26035. totalTiles: e.totalTiles,
  26036. face: e.face,
  26037. tileX: e.tileX,
  26038. tileY: e.tileY,
  26039. direction: e.direction
  26040. };
  26041. e.image = t,
  26042. this.emit(o.TileDownloadSuccess, n),
  26043. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26044. panoId: e.pano.id,
  26045. tileSize: e.tileSize,
  26046. panoSize: e.panoSize
  26047. },
  26048. this.emit(o.PanoDownloadComplete, n),
  26049. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26050. }
  26051. }
  26052. ,
  26053. i.prototype.cleanupActiveDownloads = (n = [],
  26054. function() {
  26055. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26056. var t = this.activeDownloads[e];
  26057. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26058. }
  26059. this.activeDownloads.length = 0,
  26060. this.activeDownloads.push.apply(this.activeDownloads, n)
  26061. }
  26062. ),
  26063. i.prototype.isPanoDownloaded = function(e, t) {
  26064. var i = this.getTileDownloadDescriptors(e, t);
  26065. if (i.length <= 0)
  26066. return !1;
  26067. for (var n = 0; n < i.length; n++) {
  26068. if (i[n].status !== v.Downloaded)
  26069. return !1
  26070. }
  26071. return !0
  26072. }
  26073. ,
  26074. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26075. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26076. this.panoLoadCallbacks[o] = {
  26077. onLoad: i,
  26078. onFail: n,
  26079. onProgress: r
  26080. }
  26081. }
  26082. ,
  26083. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26084. var i = e.id + ":" + t;
  26085. return this.panoLoadCallbacks[i]
  26086. }
  26087. ,
  26088. i.prototype.buildDownloadDescriptorArray = function(e) {
  26089. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26090. var r = this.buildDownloadDescriptor();
  26091. i.push(r)
  26092. }
  26093. return i
  26094. }
  26095. ,
  26096. i.prototype.buildDownloadDescriptor = function() {
  26097. return {
  26098. panoGroupId: null,
  26099. pano: null,
  26100. panoSize: -1,
  26101. tileSize: -1,
  26102. tileIndex: -1,
  26103. totalTiles: -1,
  26104. faceTileIndex: -1,
  26105. status: v.None,
  26106. url: null,
  26107. image: null,
  26108. direction: new t.Vector3,
  26109. face: -1,
  26110. cubeFace: -1,
  26111. tileX: -1,
  26112. tileY: -1
  26113. }
  26114. }
  26115. ,
  26116. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26117. for (var n = 0; n < e.length; n++) {
  26118. var r = e[n];
  26119. this.initTileDownloadDescriptor(r, t, i, n)
  26120. }
  26121. }
  26122. ,
  26123. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26124. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26125. e.face = m.getFaceForTile(i, n),
  26126. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26127. e.panoGroupId = this.panoGroupId,
  26128. e.pano = t,
  26129. e.panoSize = i,
  26130. e.tileSize = r,
  26131. e.tileIndex = n,
  26132. e.totalTiles = m.getTileCountForSize(i),
  26133. e.status = v.None,
  26134. e.image = null,
  26135. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26136. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26137. }
  26138. ,
  26139. i.prototype.getTileUrl = (c = {
  26140. 256: "256",
  26141. 512: "512",
  26142. 1024: "1k",
  26143. 2048: "2k",
  26144. 4096: "4k"
  26145. },
  26146. h = {
  26147. face: -1,
  26148. faceTileIndex: -1,
  26149. tileX: -1,
  26150. tileY: -1
  26151. },
  26152. function(e, t, i, n) {
  26153. m.getTileLocation(t, n, h);
  26154. var r = Math.floor(t / i)
  26155. , o = r * r
  26156. , a = Math.floor(n / o)
  26157. , s = "";
  26158. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26159. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26160. return d.changeIfTileGenerating(l)
  26161. }
  26162. ),
  26163. i.prototype.loadImage = function(e, t, i, n) {
  26164. s.getImage(e, t).then(function(e) {
  26165. i(e)
  26166. }).fail(n)
  26167. }
  26168. ,
  26169. C.exports = i
  26170. }
  26171. ).call(this, "/js/tile/TileDownloader.js")
  26172. }
  26173. , {
  26174. "../ab": 3,
  26175. "../enum/DownloadStatus": 24,
  26176. "../enum/GLCubeFaces": 25,
  26177. "../enum/PanoSizeClass": 36,
  26178. "../enum/TileDownloaderEvents": 45,
  26179. "../enum/Vectors": 50,
  26180. "../enum/Viewmode": 51,
  26181. "../objects/Panorama": 148,
  26182. "../settings": 166,
  26183. "../util/ajax": 181,
  26184. "../util/logger": 189,
  26185. "../util/panorama": 191,
  26186. "./TilePrioritizer": 172,
  26187. "./TileUtils": 174,
  26188. events: 202,
  26189. three: 217
  26190. }],
  26191. 172: [function(n, C, e) {
  26192. (function(e) {
  26193. "use strict";
  26194. function h(e, t, i, n, r) {
  26195. this.qualityManager = e,
  26196. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26197. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26198. this.baseSize = t,
  26199. this.standardSize = i,
  26200. this.highSize = n,
  26201. this.ultraHighSize = r,
  26202. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26203. }
  26204. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26205. n("../settings"),
  26206. n("../settings"),
  26207. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26208. n("../enum/PanoSizeClass"),
  26209. n("../enum/ModelManagerEvents"),
  26210. n("../enum/GLCubeFaces"),
  26211. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26212. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26213. new t(e),
  26214. Object.freeze({
  26215. None: 0,
  26216. DirectionalFOV: 1
  26217. }));
  26218. h.PriorityCriteria = function(e, t, i, n, r) {
  26219. this.pano = e,
  26220. this.cameraPosition = (new o.Vector3).copy(t),
  26221. this.cameraDir = (new o.Vector3).copy(i),
  26222. this.panoSpaceDir = (new o.Vector3).copy(n),
  26223. this.upcomingPanos = r,
  26224. this.copy = function(e) {
  26225. this.pano = e.pano,
  26226. this.cameraPosition.copy(e.cameraPosition),
  26227. this.cameraDir.copy(e.cameraDir),
  26228. this.panoSpaceDir.copy(e.panoSpaceDir),
  26229. this.upcomingPanos = r
  26230. }
  26231. ,
  26232. this.zoomingActive = !1
  26233. }
  26234. ,
  26235. h.DIRECTIONAL_FOV = 180,
  26236. h.DIRECTIONAL_FOV_NARROW = 120,
  26237. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26238. h.MAX_SCORED_PANOS_TOADD = 2,
  26239. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26240. h.DIRECTION_SCORE_STRICTNESS = .75,
  26241. h.appendQueue = function(e, t) {
  26242. if (e && t)
  26243. for (var i = 0; i < t.length; i++)
  26244. e.push(t[i])
  26245. }
  26246. ,
  26247. h.prototype.updateCriteria = function(e, t, i, n) {
  26248. this.priorityCriteria.pano = e,
  26249. this.priorityCriteria.cameraPosition.copy(t),
  26250. this.priorityCriteria.cameraDir.copy(i),
  26251. this.priorityCriteria.upcomingPanos = n,
  26252. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26253. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26254. }
  26255. ,
  26256. h.prototype.filterAndPrioritize = (u = [],
  26257. p = [],
  26258. f = [],
  26259. function(e, t, i) {
  26260. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26261. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26262. var n = this.baseSize
  26263. , r = this.standardSize
  26264. , o = this.highSize
  26265. , a = this.ultraHighSize;
  26266. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26267. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26268. f.length = 0,
  26269. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26270. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26271. h.appendQueue(e, f),
  26272. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26273. f.length = 0,
  26274. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26275. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26276. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26277. h.appendQueue(e, f),
  26278. f.length = 0,
  26279. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26280. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26281. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26282. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26283. h.appendQueue(e, f),
  26284. this.queueTilesForPanos(e, u, i, n)
  26285. }
  26286. ),
  26287. h.prototype.canDownloadSize = function(e) {
  26288. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26289. }
  26290. ,
  26291. h.prototype.populateNeighborPanos = function(e, t, i) {
  26292. (i = i || []).length = 0;
  26293. var n = t.getNeighbours(e);
  26294. for (var r in n)
  26295. if (n.hasOwnProperty(r)) {
  26296. var o = t.get(r);
  26297. i.push(o)
  26298. }
  26299. return i
  26300. }
  26301. ,
  26302. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26303. (i = i || []).length = 0;
  26304. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26305. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26306. , s = t.sortByScore(o, a);
  26307. if (s)
  26308. for (var l = 0; l < s.length && l < r; l++) {
  26309. var c = s[l].pano;
  26310. i.push(c)
  26311. }
  26312. return i
  26313. }
  26314. ,
  26315. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26316. for (var o = 0, a = 0; a < t.length; a++) {
  26317. var s = t[a];
  26318. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26319. r && r <= o)
  26320. break
  26321. }
  26322. return o
  26323. }
  26324. ,
  26325. h.prototype.queueTilesForPano = (r = {
  26326. filter: a.None
  26327. },
  26328. function(e, t, i, n) {
  26329. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26330. }
  26331. ),
  26332. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26333. function(e, t, i, n, r, o, a, s) {
  26334. for (var l = 0, c = 0; c < i.length; c++) {
  26335. var h = i[c];
  26336. d.copy(h.position),
  26337. d.sub(r),
  26338. d.normalize();
  26339. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26340. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26341. s && s <= l))
  26342. break
  26343. }
  26344. return l
  26345. }
  26346. ),
  26347. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26348. for (var l = 0, c = 0; c < i.length; c++) {
  26349. var h = i[c];
  26350. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26351. s && s <= l)
  26352. break
  26353. }
  26354. return l
  26355. }
  26356. ,
  26357. h.prototype.queueTilesInDirectionForPano = (s = {
  26358. filter: a.DirectionalFOV,
  26359. direction: new o.Vector3,
  26360. fov: 60
  26361. },
  26362. l = new o.Vector3,
  26363. function(e, t, i, n, r, o, a) {
  26364. return l.copy(o),
  26365. m.getRelativeDirection(i.quaternion, l),
  26366. s.direction.copy(l),
  26367. s.fov = a,
  26368. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26369. }
  26370. ),
  26371. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26372. function(e, t, i, n, r) {
  26373. var o = t.getTileDownloadDescriptors(i, n);
  26374. c.length = 0,
  26375. this.filterTileDownloadDescriptors(i, o, c, r);
  26376. for (var a = 0, s = 0; s < c.length; s++) {
  26377. var l = c[s];
  26378. l && (e.push(l),
  26379. a++)
  26380. }
  26381. return a
  26382. }
  26383. ),
  26384. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26385. function(e, t, i, n) {
  26386. var r, o;
  26387. switch (n.filter) {
  26388. case a.DirectionalFOV:
  26389. for (r = 0; r < t.length; r++)
  26390. o = t[r],
  26391. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26392. break;
  26393. default:
  26394. for (r = 0; r < t.length; r++)
  26395. o = t[r],
  26396. i.push(o)
  26397. }
  26398. for (r = 0; r < i.length; r++)
  26399. o = i[r],
  26400. this.canIncludeDescriptor(o) || (i[r] = null)
  26401. }
  26402. ),
  26403. h.prototype.canIncludeDescriptor = function(e) {
  26404. return e.status !== i.Downloading && e.status !== i.Downloaded
  26405. }
  26406. ,
  26407. h.prototype.canIncludePano = function(e, t) {
  26408. return !e.isLoaded(t)
  26409. }
  26410. ,
  26411. h.getFOVDotThreshold = function(e) {
  26412. return Math.cos(o.Math.degToRad(e / 2))
  26413. }
  26414. ;
  26415. var y = (A._panoSpaceDir = new o.Vector3,
  26416. A._fovThreshold = -1,
  26417. A._fovThresholdNarrow = -1,
  26418. A);
  26419. function A(e, t) {
  26420. var i = A._panoSpaceDir
  26421. , n = A._fovThreshold
  26422. , r = A._fovThresholdNarrow
  26423. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26424. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26425. return e._dot = o,
  26426. t._dot = a,
  26427. n <= o && a < n ? -1 : o < n && n <= a ? 1 : r <= o && a < r ? -1 : o < r && r <= a ? 1 : e.panoSize > t.panoSize ? 1 : t.panoSize > e.panoSize ? -1 : -(o - a)
  26428. }
  26429. h.sortPanoTiles = function(e, t, i) {
  26430. y._panoSpaceDir.copy(i),
  26431. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26432. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26433. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26434. e.sort(y)
  26435. }
  26436. ,
  26437. h.insertSortedPanoTile = function(e, t, i, n) {
  26438. y._panoSpaceDir.copy(n),
  26439. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26440. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26441. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26442. for (var r = -1, o = 0; o < e.length; o++) {
  26443. if (y(t, e[o]) <= 0) {
  26444. r = o;
  26445. break
  26446. }
  26447. }
  26448. if (-1 === r)
  26449. e[e.length] = t;
  26450. else {
  26451. for (var a = e.length; r < a; a--)
  26452. e[a] = e[a - 1];
  26453. e[r] = t
  26454. }
  26455. }
  26456. ,
  26457. h.prototype.setZoomingActive = function(e) {
  26458. e !== this.zoomingActive && (this.zoomingActive = e)
  26459. }
  26460. ,
  26461. C.exports = h
  26462. }
  26463. ).call(this, "/js/tile/TilePrioritizer.js")
  26464. }
  26465. , {
  26466. "../enum/DownloadStatus": 24,
  26467. "../enum/GLCubeFaces": 25,
  26468. "../enum/ModelManagerEvents": 33,
  26469. "../enum/PanoSizeClass": 36,
  26470. "../enum/Vectors": 50,
  26471. "../enum/Viewmode": 51,
  26472. "../objects/Panorama": 148,
  26473. "../settings": 166,
  26474. "../util/browser": 182,
  26475. "../util/logger": 189,
  26476. "../util/math": 190,
  26477. "./TileUtils": 174,
  26478. events: 202,
  26479. three: 217
  26480. }],
  26481. 173: [function(e, t, i) {
  26482. "use strict";
  26483. function f(e, t) {
  26484. this.levels = t,
  26485. this.tileSize = e,
  26486. this.root = null,
  26487. this.allNodes = [],
  26488. function(e) {
  26489. e.root = function e(t, i, n) {
  26490. if (n > t.levels)
  26491. return null;
  26492. var r = new a(t,i);
  26493. t.allNodes.push(r);
  26494. for (var o = 0; o < s; o++)
  26495. r.children[o] = e(t, r, n + 1);
  26496. return r
  26497. }(e, null, 0)
  26498. }(this)
  26499. }
  26500. function a(e, t) {
  26501. this.tree = e,
  26502. this.parent = t,
  26503. this.children = [],
  26504. this.id = ++n
  26505. }
  26506. var g = (e("three"),
  26507. e("./TileUtils"),
  26508. e("../objects/Panorama"),
  26509. e("../util/panorama"),
  26510. e("events").EventEmitter,
  26511. 2)
  26512. , s = g * g;
  26513. f.TraversalType = Object.freeze({
  26514. PreOrder: 0,
  26515. PostOrder: 1
  26516. });
  26517. var n = 0;
  26518. f.getLevelCountForSize = function(e, t) {
  26519. var i = 0;
  26520. for (t < e && (t = e); !((t /= g) < e); )
  26521. i++;
  26522. return i
  26523. }
  26524. ,
  26525. f.getSizeForLevel = function(e, t) {
  26526. return Math.pow(g, t) * e
  26527. }
  26528. ,
  26529. f.prototype.getSubNode = function(e, t, i) {
  26530. (!t || e < this.tileSize) && (t = 0),
  26531. (!i || e < this.tileSize) && (i = 0),
  26532. e < this.tileSize && (e = this.tileSize);
  26533. var n = f.getLevelCountForSize(this.tileSize, e);
  26534. return function e(t, i, n, r, o) {
  26535. if (!t)
  26536. return null;
  26537. if (0 === n)
  26538. return t;
  26539. if (!t.children || 0 === t.children.length)
  26540. return null;
  26541. var a = Math.pow(g, n) / g
  26542. , s = r % a
  26543. , l = o % a
  26544. , c = Math.floor(o / a)
  26545. , h = Math.floor(r / a)
  26546. , u = c * g + h;
  26547. return e(t.children[u], i + 1, n - 1, s, l)
  26548. }(this.root, 0, n, t, i)
  26549. }
  26550. ,
  26551. f.prototype.breadthFirst = function(e) {
  26552. var t = !!(e = e || {}).nullLevelEnd
  26553. , i = e.maxLevel
  26554. , n = e.minLevel
  26555. , r = e.callback
  26556. , o = e.saveVisited
  26557. , a = []
  26558. , s = {}
  26559. , l = 0;
  26560. for (a.push(this.root),
  26561. a.push(s); 0 < a.length && !(i && i < l); ) {
  26562. var c = a.shift();
  26563. if (c === s)
  26564. (!n || n <= l) && (r && t && r(null),
  26565. o && t && o.push(null)),
  26566. 0 < a.length && a.push(s),
  26567. l++,
  26568. 0;
  26569. else {
  26570. if (c.children)
  26571. for (var h = 0; h < c.children.length; h++) {
  26572. c.children[h] && a.push(c.children[h])
  26573. }
  26574. var u = this.getFaceIndexFromNode(c);
  26575. (!n || n <= l) && (r && r(c, l, u),
  26576. o && o.push(c)),
  26577. 0
  26578. }
  26579. }
  26580. }
  26581. ,
  26582. f.prototype.getFaceIndexFromNode = function(e) {
  26583. if (!e)
  26584. return -1;
  26585. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26586. var o = i.parent;
  26587. if (!o)
  26588. break;
  26589. for (var a = -1, s = 0; s < o.children.length; s++)
  26590. o.children[s] === i && (a = s);
  26591. n = a % g * t + n,
  26592. r = Math.floor(a / g) * t + r,
  26593. t *= g,
  26594. i = o
  26595. }
  26596. return r * t + n
  26597. }
  26598. ,
  26599. f.prototype.depthFirst = function(e, t, i) {
  26600. !function e(t, i, n, r, o, a, s, l) {
  26601. if (t) {
  26602. s = s || f.TraversalType.PreOrder;
  26603. var c = r * g + n;
  26604. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26605. a && a.push(t)),
  26606. t.children && 0 !== t.children.length) {
  26607. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26608. for (var p = 0; p < g; p++)
  26609. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26610. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26611. a && a.push(t))
  26612. }
  26613. }
  26614. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26615. }
  26616. ,
  26617. t.exports = f
  26618. }
  26619. , {
  26620. "../objects/Panorama": 148,
  26621. "../util/panorama": 191,
  26622. "./TileUtils": 174,
  26623. events: 202,
  26624. three: 217
  26625. }],
  26626. 174: [function(e, t, i) {
  26627. "use strict";
  26628. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26629. b.TILE_SIZE = 512,
  26630. b.FACES_PER_PANO = 6,
  26631. b.LocationOnTile = {
  26632. Center: 0,
  26633. UpperLeft: 1,
  26634. UpperRight: 2,
  26635. LowerRight: 3,
  26636. LowerLeft: 4
  26637. },
  26638. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  26639. var l = e / t
  26640. , c = t / e * 2
  26641. , h = c / 2
  26642. , u = n / l * 2 - 1 + h
  26643. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  26644. switch (o = o || b.LocationOnTile.Center) {
  26645. case b.LocationOnTile.UpperLeft:
  26646. u -= h,
  26647. d += h,
  26648. u += a * c;
  26649. break;
  26650. case b.LocationOnTile.UpperRight:
  26651. u += h,
  26652. d += h,
  26653. d -= a * c;
  26654. break;
  26655. case b.LocationOnTile.LowerRight:
  26656. u += h,
  26657. d -= h,
  26658. u -= a * c;
  26659. break;
  26660. case b.LocationOnTile.LowerLeft:
  26661. u -= h,
  26662. d -= h,
  26663. d += a * c;
  26664. break;
  26665. case b.LocationOnTile.Center:
  26666. }
  26667. switch (i) {
  26668. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26669. _.setVector(s, -1, d, -u);
  26670. break;
  26671. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26672. _.setVector(s, 1, d, u);
  26673. break;
  26674. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26675. _.setVector(s, -u, 1, -d);
  26676. break;
  26677. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26678. _.setVector(s, -u, -1, d);
  26679. break;
  26680. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26681. _.setVector(s, -u, d, 1);
  26682. break;
  26683. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26684. _.setVector(s, u, d, -1)
  26685. }
  26686. _.normalize(s)
  26687. }
  26688. ,
  26689. b.getFaceForTile = function(e, t) {
  26690. var i = b.TILE_SIZE;
  26691. e < b.TILE_SIZE && (i = e);
  26692. var n = Math.floor(e / i)
  26693. , r = n * n;
  26694. return Math.floor(t / r)
  26695. }
  26696. ,
  26697. b.getTileLocation = function(e, t, i) {
  26698. var n = b.TILE_SIZE;
  26699. e < b.TILE_SIZE && (n = e);
  26700. var r = b.getFaceForTile(e, t)
  26701. , o = Math.floor(e / n)
  26702. , a = t - r * (o * o);
  26703. i.tileX = a % o,
  26704. i.tileY = Math.floor(a / o),
  26705. i.face = r,
  26706. i.faceTileIndex = a
  26707. }
  26708. ,
  26709. b.getTileCountForSize = function(e) {
  26710. if (e <= b.TILE_SIZE)
  26711. return b.FACES_PER_PANO;
  26712. var t = Math.floor(e / b.TILE_SIZE);
  26713. return t * t * b.FACES_PER_PANO
  26714. }
  26715. ,
  26716. b.getRelativeDirection = (r = new _.Matrix4,
  26717. o = new _.Quaternion,
  26718. function(e, t) {
  26719. o.copy(e),
  26720. o.inverse(),
  26721. r.makeRotationFromQuaternion(o),
  26722. r.applyToVector3(t),
  26723. _.normalize(t)
  26724. }
  26725. ),
  26726. b.matchingTilesInDirection = (c = new _.Vector3,
  26727. h = new _.Vector3(0,0,-1),
  26728. u = new _.Quaternion,
  26729. l = {
  26730. face: -1,
  26731. faceTileIndex: -1,
  26732. tileX: -1,
  26733. tileY: -1
  26734. },
  26735. d = function(e, t, i) {
  26736. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  26737. b.getTileLocation(e, o, l),
  26738. t && !t(l) || (r++,
  26739. i && (a = l,
  26740. i.push({
  26741. face: a.face,
  26742. faceTileIndex: a.faceTileIndex,
  26743. tileX: a.tileX,
  26744. tileY: a.tileY
  26745. })));
  26746. var a;
  26747. return r
  26748. }
  26749. ,
  26750. function(e, t, i, n, r, o) {
  26751. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  26752. if (b.getTileCountForSize(t),
  26753. !n && !r)
  26754. return d(t, null, o);
  26755. var s = !!r;
  26756. return r = r || n,
  26757. r = Math.max(0, Math.min(r, 360)),
  26758. n = Math.max(0, Math.min(n, 360)),
  26759. _.copyVector(i, c),
  26760. b.getRelativeDirection(e.quaternion, c),
  26761. s ? (u.setFromUnitVectors(c, h),
  26762. d(t, function(e) {
  26763. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  26764. }, o)) : d(t, function(e) {
  26765. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  26766. }, o)
  26767. }
  26768. ),
  26769. b.isTileWithinFrustum = (E = new _.Vector3,
  26770. function(e, t, i, n, r, o, a, s) {
  26771. for (var l = Math.tan(.5 * s * _.RADIANS_PER_DEGREE), c = -l, h = Math.tan(.5 * a * _.RADIANS_PER_DEGREE), u = -h, d = b.mapFaceToCubemapFace(i), p = 0, f = 0, g = 0, m = 0, v = 0, y = b.LocationOnTile.Center; y <= b.LocationOnTile.LowerLeft; y++)
  26772. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  26773. _.applyQuaternionToVector(o, E),
  26774. -1e-5 <= E.z)
  26775. ;
  26776. else {
  26777. var A = -1 / E.z
  26778. , C = E.x * A
  26779. , I = E.y * A;
  26780. l < I ? p++ : I < c && f++,
  26781. h < C ? g++ : C < u && m++,
  26782. v++
  26783. }
  26784. return f !== v && p !== v && g !== v && m !== v
  26785. }
  26786. ),
  26787. b.isTileWithinFOV = (p = new _.Vector3,
  26788. f = new _.Vector3(0,1,0),
  26789. g = new _.Vector3(1,0,0),
  26790. function(e, t, i, n, r, o, a) {
  26791. var s = b.mapFaceToCubemapFace(i);
  26792. if (_.cross(o, f, g),
  26793. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  26794. b.isWithinFOV(p, o, a, null))
  26795. return !0;
  26796. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  26797. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  26798. if (b.getTileVector(e, t, s, n, r, d, h, p),
  26799. b.isWithinFOV(p, o, a, null))
  26800. return !0;
  26801. h += l
  26802. }
  26803. return !1
  26804. }
  26805. ),
  26806. b.isWithinFOV = (a = new _.Vector3,
  26807. s = new _.Vector3,
  26808. function(e, t, i, n) {
  26809. if (_.copyVector(e, s),
  26810. n) {
  26811. _.copyVector(n, a),
  26812. _.normalize(a);
  26813. var r = _.dot(a, e);
  26814. a.x *= r,
  26815. a.y *= r,
  26816. a.z *= r,
  26817. _.subVector(s, a)
  26818. }
  26819. var o = i / 2 * _.RADIANS_PER_DEGREE;
  26820. return Math.cos(o) <= _.dot(s, t)
  26821. }
  26822. ),
  26823. b.mapFaceToCubemapFace = (n = {
  26824. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  26825. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  26826. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  26827. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  26828. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  26829. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  26830. },
  26831. function(e) {
  26832. return n[e]
  26833. }
  26834. ),
  26835. t.exports = b
  26836. }
  26837. , {
  26838. "../enum/GLCubeFaces": 25,
  26839. "../util/MathLight": 176
  26840. }],
  26841. 175: [function(i, n, e) {
  26842. (function(e) {
  26843. "use strict";
  26844. function t() {
  26845. this.list = [],
  26846. this.index = {},
  26847. Object.defineProperty(this, "length", {
  26848. get: function() {
  26849. return this.list.length
  26850. }
  26851. })
  26852. }
  26853. new (i("./common"),
  26854. i("./logger"))(e),
  26855. t.prototype.forEach = function(e) {
  26856. this.list.forEach(e)
  26857. }
  26858. ,
  26859. t.prototype.add = function(e) {
  26860. this.list.push(e),
  26861. this.index[this.getIndex(e)] = e
  26862. }
  26863. ,
  26864. t.prototype.getIndex = function(e) {
  26865. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  26866. }
  26867. ,
  26868. t.prototype.extend = function(e) {
  26869. for (var t = 0; t < e.length; t++)
  26870. this.add(e[t])
  26871. }
  26872. ,
  26873. t.prototype.get = function(e) {
  26874. return this.index[e]
  26875. }
  26876. ,
  26877. t.prototype.first = function() {
  26878. return this.list[0]
  26879. }
  26880. ,
  26881. t.prototype.last = function() {
  26882. return this.list[this.list.length - 1]
  26883. }
  26884. ,
  26885. t.prototype.reIndex = function() {
  26886. this.index = {};
  26887. var t = this;
  26888. this.forEach(function(e) {
  26889. t.index[t.getIndex(e)] = e
  26890. })
  26891. }
  26892. ,
  26893. t.prototype.filter = function(e) {
  26894. var t = this.list.filter(e);
  26895. return this.reIndex(),
  26896. t
  26897. }
  26898. ,
  26899. t.prototype.reduce = function(e, t) {
  26900. return this.list.reduce(e, t)
  26901. }
  26902. ,
  26903. t.prototype.sort = function(e) {
  26904. return this.list.sort(e)
  26905. }
  26906. ,
  26907. t.prototype.indexOf = function(e) {
  26908. for (var t = 0; t < this.list.length; ++t)
  26909. if (this.list[t] === e)
  26910. return t;
  26911. return -1
  26912. }
  26913. ,
  26914. n.exports = t
  26915. }
  26916. ).call(this, "/js/util/IndexedCollection.js")
  26917. }
  26918. , {
  26919. "./common": 185,
  26920. "./logger": 189
  26921. }],
  26922. 176: [function(e, t, i) {
  26923. "use strict";
  26924. e("../constants");
  26925. var n, r, o = {};
  26926. o.RADIANS_PER_DEGREE = Math.PI / 180,
  26927. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  26928. o.Vector3 = function(e, t, i) {
  26929. this.x = e || 0,
  26930. this.y = t || 0,
  26931. this.z = i || 0
  26932. }
  26933. ,
  26934. o.Matrix4 = function() {
  26935. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  26936. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  26937. }
  26938. ,
  26939. o.Matrix4.prototype = {
  26940. identity: function() {
  26941. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  26942. this
  26943. },
  26944. copy: function(e) {
  26945. return this.elements.set(e.elements),
  26946. this
  26947. },
  26948. applyToVector3: function(e) {
  26949. var t = e.x
  26950. , i = e.y
  26951. , n = e.z
  26952. , r = this.elements;
  26953. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  26954. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  26955. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  26956. this
  26957. },
  26958. getInverse: function(e, t) {
  26959. var i = this.elements
  26960. , n = e.elements
  26961. , r = n[0]
  26962. , o = n[1]
  26963. , a = n[2]
  26964. , s = n[3]
  26965. , l = n[4]
  26966. , c = n[5]
  26967. , h = n[6]
  26968. , u = n[7]
  26969. , d = n[8]
  26970. , p = n[9]
  26971. , f = n[10]
  26972. , g = n[11]
  26973. , m = n[12]
  26974. , v = n[13]
  26975. , y = n[14]
  26976. , A = n[15]
  26977. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  26978. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  26979. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  26980. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  26981. , b = r * C + o * I + a * E + s * _;
  26982. if (0 == b) {
  26983. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  26984. if (t)
  26985. throw new Error(w);
  26986. return console.warn(w),
  26987. this.identity()
  26988. }
  26989. var T = 1 / b;
  26990. return i[0] = C * T,
  26991. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  26992. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  26993. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  26994. i[4] = I * T,
  26995. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  26996. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  26997. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  26998. i[8] = E * T,
  26999. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27000. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27001. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27002. i[12] = _ * T,
  27003. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27004. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27005. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27006. this
  27007. },
  27008. makeRotationFromQuaternion: function(e) {
  27009. var t = this.elements
  27010. , i = e.x
  27011. , n = e.y
  27012. , r = e.z
  27013. , o = e.w
  27014. , a = i + i
  27015. , s = n + n
  27016. , l = r + r
  27017. , c = i * a
  27018. , h = i * s
  27019. , u = i * l
  27020. , d = n * s
  27021. , p = n * l
  27022. , f = r * l
  27023. , g = o * a
  27024. , m = o * s
  27025. , v = o * l;
  27026. return t[0] = 1 - (d + f),
  27027. t[4] = h - v,
  27028. t[8] = u + m,
  27029. t[1] = h + v,
  27030. t[5] = 1 - (c + f),
  27031. t[9] = p - g,
  27032. t[2] = u - m,
  27033. t[6] = p + g,
  27034. t[10] = 1 - (c + d),
  27035. t[3] = 0,
  27036. t[7] = 0,
  27037. t[11] = 0,
  27038. t[12] = 0,
  27039. t[13] = 0,
  27040. t[14] = 0,
  27041. t[15] = 1,
  27042. this
  27043. }
  27044. },
  27045. o.Quaternion = function(e, t, i, n) {
  27046. this._x = e || 0,
  27047. this._y = t || 0,
  27048. this._z = i || 0,
  27049. this._w = void 0 !== n ? n : 1
  27050. }
  27051. ,
  27052. o.Quaternion.prototype = {
  27053. get x() {
  27054. return this._x
  27055. },
  27056. set x(e) {
  27057. this._x = e
  27058. },
  27059. get y() {
  27060. return this._y
  27061. },
  27062. set y(e) {
  27063. this._y = e
  27064. },
  27065. get z() {
  27066. return this._z
  27067. },
  27068. set z(e) {
  27069. this._z = e
  27070. },
  27071. get w() {
  27072. return this._w
  27073. },
  27074. set w(e) {
  27075. this._w = e
  27076. },
  27077. copy: function(e) {
  27078. this._x = e.x,
  27079. this._y = e.y,
  27080. this._z = e.z,
  27081. this._w = e.w
  27082. },
  27083. inverse: function() {
  27084. return this.conjugate().normalize()
  27085. },
  27086. conjugate: function() {
  27087. return this._x *= -1,
  27088. this._y *= -1,
  27089. this._z *= -1,
  27090. this
  27091. },
  27092. length: function() {
  27093. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27094. },
  27095. normalize: function() {
  27096. var e = this.length();
  27097. return 0 === e ? (this._x = 0,
  27098. this._y = 0,
  27099. this._z = 0,
  27100. this._w = 1) : (e = 1 / e,
  27101. this._x = this._x * e,
  27102. this._y = this._y * e,
  27103. this._z = this._z * e,
  27104. this._w = this._w * e),
  27105. this
  27106. },
  27107. setFromAxisAngle: function(e, t) {
  27108. var i = t / 2
  27109. , n = Math.sin(i);
  27110. return this._x = e.x * n,
  27111. this._y = e.y * n,
  27112. this._z = e.z * n,
  27113. this._w = Math.cos(i),
  27114. this
  27115. },
  27116. setFromUnitVectors: function(e, t) {
  27117. return void 0 === n && (n = new o.Vector3),
  27118. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27119. Math.abs(e.x) > Math.abs(e.z) ? o.setVector(n, -e.y, e.x, 0) : o.setVector(n, 0, -e.z, e.y)) : o.cross(e, t, n),
  27120. this._x = n.x,
  27121. this._y = n.y,
  27122. this._z = n.z,
  27123. this._w = r,
  27124. this.normalize()
  27125. },
  27126. multiply: function(e) {
  27127. return this.multiplyQuaternions(this, e)
  27128. },
  27129. premultiply: function(e) {
  27130. return this.multiplyQuaternions(e, this)
  27131. },
  27132. multiplyQuaternions: function(e, t) {
  27133. var i = e._x
  27134. , n = e._y
  27135. , r = e._z
  27136. , o = e._w
  27137. , a = t._x
  27138. , s = t._y
  27139. , l = t._z
  27140. , c = t._w;
  27141. return this._x = i * c + o * a + n * l - r * s,
  27142. this._y = n * c + o * s + r * a - i * l,
  27143. this._z = r * c + o * l + i * s - n * a,
  27144. this._w = o * c - i * a - n * s - r * l,
  27145. this
  27146. }
  27147. },
  27148. o.convertWorkshopVector = function(e) {
  27149. return new o.Vector3(-e.x,e.y,e.z)
  27150. }
  27151. ,
  27152. o.convertWorkshopQuaternion = function(e) {
  27153. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  27154. }
  27155. ,
  27156. o.convertWorkshopOrthoZoom = function(e) {
  27157. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27158. }
  27159. ,
  27160. o.convertWorkshopPanoramaQuaternion = function(e) {
  27161. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), 270 * o.RADIANS_PER_DEGREE))
  27162. }
  27163. ,
  27164. o.normalize = function(e) {
  27165. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27166. , i = Math.sqrt(t);
  27167. e.x /= i,
  27168. e.y /= i,
  27169. e.z /= i
  27170. }
  27171. ,
  27172. o.dot = function(e, t) {
  27173. return e.x * t.x + e.y * t.y + e.z * t.z
  27174. }
  27175. ,
  27176. o.cross = function(e, t, i) {
  27177. var n = e.x
  27178. , r = e.y
  27179. , o = e.z;
  27180. i.x = r * t.z - o * t.y,
  27181. i.y = o * t.x - n * t.z,
  27182. i.z = n * t.y - r * t.x
  27183. }
  27184. ,
  27185. o.setVector = function(e, t, i, n) {
  27186. e.x = t,
  27187. e.y = i,
  27188. e.z = n
  27189. }
  27190. ,
  27191. o.copyVector = function(e, t) {
  27192. t.x = e.x,
  27193. t.y = e.y,
  27194. t.z = e.z
  27195. }
  27196. ,
  27197. o.addVector = function(e, t) {
  27198. e.x += t.x,
  27199. e.y += t.y,
  27200. e.z += t.z
  27201. }
  27202. ,
  27203. o.subVector = function(e, t) {
  27204. e.x -= t.x,
  27205. e.y -= t.y,
  27206. e.z -= t.z
  27207. }
  27208. ,
  27209. o.applyQuaternionToVector = function(e, t) {
  27210. var i = t.x
  27211. , n = t.y
  27212. , r = t.z
  27213. , o = e.x
  27214. , a = e.y
  27215. , s = e.z
  27216. , l = e.w
  27217. , c = l * i + a * r - s * n
  27218. , h = l * n + s * i - o * r
  27219. , u = l * r + o * n - a * i
  27220. , d = -o * i - a * n - s * r;
  27221. t.x = c * l + d * -o + h * -s - u * -a,
  27222. t.y = h * l + d * -a + u * -o - c * -s,
  27223. t.z = u * l + d * -s + c * -a - h * -o
  27224. }
  27225. ,
  27226. o.angleBetweenVectors = function(e, t) {
  27227. return Math.acos(o.dot(e, t))
  27228. }
  27229. ,
  27230. t.exports = o
  27231. }
  27232. , {
  27233. "../constants": 8
  27234. }],
  27235. 177: [function(c, h, e) {
  27236. (function(e) {
  27237. "use strict";
  27238. function t(e) {
  27239. this.cache = null,
  27240. this.expires = 0
  27241. }
  27242. function i() {
  27243. this.baseUrl = null,
  27244. this.cache = null,
  27245. this.expires = 0
  27246. }
  27247. function n() {
  27248. this.baseUrl = null,
  27249. this.expires = 0
  27250. }
  27251. function r(e) {
  27252. this.initialLoadingPromise = null,
  27253. this.endpoint = e + "?type=3",
  27254. this.urlContainer = null,
  27255. this.authorizationHeader = s.getAuthorizationHeader(),
  27256. this.containerClasses = [n, i, t]
  27257. }
  27258. c("./ajax");
  27259. var o = c("./logger")
  27260. , a = c("../constants")
  27261. , s = c("./showcase")
  27262. , l = (c("../ab"),
  27263. new o(e));
  27264. t.prototype = {
  27265. version: 1,
  27266. validate: function(e) {
  27267. return "catalog.json"in e && 0 < Object.keys(e).length
  27268. },
  27269. update: function(e) {
  27270. return this.cache = e,
  27271. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27272. $.when()
  27273. },
  27274. get: function(e) {
  27275. return this.cache[e]
  27276. }
  27277. },
  27278. i.prototype = {
  27279. version: 2,
  27280. validate: function(e) {
  27281. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27282. },
  27283. update: function(e) {
  27284. return this.baseUrl = e["base.url"],
  27285. this.cache = e,
  27286. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27287. $.when()
  27288. },
  27289. get: function(e) {
  27290. var t = this.cache[e];
  27291. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27292. }
  27293. },
  27294. n.prototype = {
  27295. version: 3,
  27296. validate: function(e) {
  27297. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27298. },
  27299. update: function(e) {
  27300. return this.baseUrl = e.templates[0],
  27301. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27302. $.when()
  27303. },
  27304. get: function(e) {
  27305. return this.baseUrl.replace("{{filename}}", e)
  27306. }
  27307. },
  27308. r.prototype = {
  27309. init: function() {
  27310. return this.initialLoadingPromise || (setInterval(function() {
  27311. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27312. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27313. this.refresh().done(function() {
  27314. l.debug("Refreshed")
  27315. }).fail(function() {
  27316. l.error("Failed url refresh, urls might go stale soon")
  27317. }))
  27318. }
  27319. .bind(this), a.signedUrlCheckInterval),
  27320. this.initialLoadingPromise = this.refresh()),
  27321. this.initialLoadingPromise
  27322. },
  27323. refresh: function(e) {
  27324. return {},
  27325. $.Deferred().resolve()
  27326. },
  27327. get: function(e) {
  27328. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27329. }
  27330. },
  27331. h.exports = r
  27332. }
  27333. ).call(this, "/js/util/ModelUrls.js")
  27334. }
  27335. , {
  27336. "../ab": 3,
  27337. "../constants": 8,
  27338. "./ajax": 181,
  27339. "./logger": 189,
  27340. "./showcase": 193
  27341. }],
  27342. 178: [function(l, c, e) {
  27343. (function(e) {
  27344. "use strict";
  27345. function t() {
  27346. i.call(this),
  27347. this.neighbourMap = {},
  27348. this.map = null
  27349. }
  27350. var f, g, m, v, y, A, C, I, E, _, b, w = l("three"), n = l("./common"), a = l("../settings"), r = l("../objects/Panorama"), o = (a = l("../settings"),
  27351. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27352. n.inherit(t, i),
  27353. t.prototype.getIndex = function(e) {
  27354. return e.id
  27355. }
  27356. ,
  27357. t.prototype.find = function(e, t) {
  27358. var i = n.filterAll(this.list, e);
  27359. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27360. i = n.stableSort(i, e)
  27361. }),
  27362. i[0])
  27363. }
  27364. ,
  27365. t.prototype.sortByScore = function(e, t) {
  27366. var i = n.filterAll(this.list, e);
  27367. return 0 === i.length ? null : i = i.map(function(i) {
  27368. return {
  27369. pano: i,
  27370. score: t.reduce(function(e, t) {
  27371. return e + t(i)
  27372. }, 0)
  27373. }
  27374. }).sort(function(e, t) {
  27375. return t.score - e.score
  27376. })
  27377. }
  27378. ,
  27379. t.prototype.lowestByScore = function(e, t, i) {
  27380. return this.findRankedByScore(0, e, t, i)
  27381. }
  27382. ,
  27383. t.prototype.findRankedByScore = function(e, t, i, n) {
  27384. n && (n.candidates = null,
  27385. n.pano = null),
  27386. e = e || 0;
  27387. var r = this.sortByScore(t, i);
  27388. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27389. n.pano = r[e].pano),
  27390. r[e].pano)
  27391. }
  27392. ,
  27393. t.prototype.showPanoScores = function(e) {
  27394. this.list.forEach(function(e) {
  27395. e.removeTextSprite()
  27396. });
  27397. var t = 6344768;
  27398. e.forEach(function(e) {
  27399. e.pano.addTextSprite(e.score.toFixed(2), t),
  27400. t = 16428055
  27401. })
  27402. }
  27403. ,
  27404. t.prototype.isNeighbour = function(e, t) {
  27405. return this.neighbourMap[e.id][t.id]
  27406. }
  27407. ,
  27408. t.prototype.getNeighbours = function(e) {
  27409. return this.neighbourMap[e.id]
  27410. }
  27411. ,
  27412. t.prototype.setNeighbour = function(e, t, i) {
  27413. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27414. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27415. this.neighbourMap[e.id][e.id] = !0,
  27416. this.neighbourMap[t.id][t.id] = !0,
  27417. this.neighbourMap[e.id][t.id] = i,
  27418. this.neighbourMap[t.id][e.id] = i,
  27419. this.neighbourMap[e.id]
  27420. }
  27421. ,
  27422. t.prototype.findClosest = function(e, t) {
  27423. var i = [r.filters.isPanoAligned()];
  27424. return t && i.push(r.filters.inDirection(e, t, .75)),
  27425. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27426. }
  27427. ,
  27428. t.prototype.dualNeighbors = function(e, t) {
  27429. var i, n = [];
  27430. for (i in this.neighbourMap[e.id])
  27431. this.neighbourMap[t.id][i] && n.push(i);
  27432. return n
  27433. }
  27434. ,
  27435. t.prototype.populate_path_graph = function() {
  27436. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27437. for (e = 0; e < this.list.length; e += 1) {
  27438. for (t in s = !(a = {}),
  27439. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27440. if (i[t]) {
  27441. o = this.index[t],
  27442. u.copy(r.floorPosition),
  27443. u.sub(o.floorPosition);
  27444. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27445. , p = (Math.abs(u.y),
  27446. Math.max(d, .01),
  27447. Math.max(0, Math.abs(u.y) - .2));
  27448. n = 0 < p ? (1,
  27449. p = Math.pow(4 * p, 2),
  27450. d = Math.pow(d, 2),
  27451. Math.sqrt(p * p + d * d)) : (1,
  27452. u.length()),
  27453. a[o.id] = n,
  27454. s = !0
  27455. }
  27456. s ? c[r.id] = a : h += 1
  27457. }
  27458. this.map = c,
  27459. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27460. }
  27461. ,
  27462. t.prototype.aStarSearch = function(e, t) {
  27463. var i = Date.now()
  27464. , n = new o({
  27465. start: e,
  27466. isEnd: function(e) {
  27467. return e === t
  27468. },
  27469. neighbor: function(e) {
  27470. var t = e.neighbourPanos || e.findNeighourPanos()
  27471. , i = [];
  27472. for (var n in t)
  27473. i.push(this.index[n]);
  27474. return i
  27475. }
  27476. .bind(this),
  27477. distance: function(e, t) {
  27478. return this.map[e.id][t.id]
  27479. }
  27480. .bind(this),
  27481. heuristic: function(e, t) {
  27482. return 1
  27483. }
  27484. .bind(this),
  27485. hash: function(e) {
  27486. return e.id
  27487. },
  27488. timeout: 5e3
  27489. });
  27490. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27491. "success" !== n.status)
  27492. return T.debug("Did not find A* path from " + e + " to " + t),
  27493. null;
  27494. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27495. var r = [];
  27496. return n.path.forEach(function(e) {
  27497. r.push(e.id)
  27498. }),
  27499. r
  27500. }
  27501. ,
  27502. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27503. g = new w.Vector3,
  27504. m = new w.Vector3,
  27505. v = new w.Vector3,
  27506. y = new w.Vector3,
  27507. A = new w.Vector3,
  27508. C = new w.Vector3,
  27509. I = new w.Vector3,
  27510. E = [],
  27511. _ = new w.Vector3,
  27512. b = new w.Vector3,
  27513. function(e, t) {
  27514. if (e)
  27515. for (var i = function(e, t, i) {
  27516. return y.copy(t).sub(e),
  27517. y.dot(i)
  27518. }, n = function(e, t) {
  27519. return i(_, e.position, m) - i(_, t.position, m)
  27520. }, r = 0; r < e.length - 1; ) {
  27521. var o = e[r]
  27522. , a = e[r + 1]
  27523. , s = this.index[o]
  27524. , l = this.index[a];
  27525. _.copy(s.position),
  27526. b.copy(l.position),
  27527. E.length = 0,
  27528. f.copy(b).sub(_),
  27529. m.copy(f).normalize();
  27530. for (var c = 0; c < this.list.length; c++) {
  27531. var h = this.list[c];
  27532. y.copy(h.position).sub(_);
  27533. var u = y.dot(m);
  27534. 0 < u && (C.copy(m),
  27535. C.multiplyScalar(u),
  27536. A.copy(y),
  27537. A.sub(C),
  27538. A.length() < t && (g.copy(f).negate(),
  27539. v.copy(g).normalize(),
  27540. I.copy(h.position).sub(b),
  27541. 0 < I.dot(v) && E.push(h)))
  27542. }
  27543. if (0 < E.length) {
  27544. E.sort(n);
  27545. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27546. e[d] = e[d - E.length];
  27547. for (var p = 0; p < E.length; p++)
  27548. e[p + r + 1] = E[p].id
  27549. }
  27550. r += E.length + 1
  27551. }
  27552. }
  27553. ),
  27554. t.prototype.fadeMarkerOpacity = function(e, t) {
  27555. var i = void 0 === e ? a.panorama.markerOpacity : e
  27556. , n = this.list.findIndex(function(e) {
  27557. return e.marker
  27558. });
  27559. if (!(n < 0)) {
  27560. var r = this.list[n].marker.material.opacity;
  27561. if (r !== e) {
  27562. var o = i - r;
  27563. s.trigger({
  27564. func: function(e, t) {
  27565. var i = r + e * o;
  27566. this.forEach(function(e) {
  27567. e.marker && (e.marker.material.opacity = i)
  27568. })
  27569. }
  27570. .bind(this),
  27571. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27572. name: "_fpm"
  27573. })
  27574. }
  27575. }
  27576. }
  27577. ,
  27578. c.exports = t
  27579. }
  27580. ).call(this, "/js/util/PanoramaCollection.js")
  27581. }
  27582. , {
  27583. "../objects/Panorama": 148,
  27584. "../settings": 166,
  27585. "./IndexedCollection": 175,
  27586. "./aStar": 180,
  27587. "./common": 185,
  27588. "./logger": 189,
  27589. "./transitions": 195,
  27590. three: 217
  27591. }],
  27592. 179: [function(e, t, i) {
  27593. "use strict";
  27594. function n() {
  27595. this.actionSequence = [],
  27596. this.actionSequenceInProgress = !1
  27597. }
  27598. function r(e, t, i, n) {
  27599. c.trackAlways("zoom_" + e, {
  27600. from: t,
  27601. to: i,
  27602. pano: n
  27603. })
  27604. }
  27605. var o, a, s, l, c = e("../analytics");
  27606. n.prototype.reset = function(e) {
  27607. this.actionSequenceInProgress = !1,
  27608. this.actionSequence.length = 0
  27609. }
  27610. ,
  27611. n.prototype.addZoomAction = (a = o = null,
  27612. s = !1,
  27613. l = function() {
  27614. if (o = null,
  27615. 0 < this.actionSequence.length) {
  27616. var e = this.actionSequence[0].start
  27617. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27618. 1 === e ? function(e, t) {
  27619. r("initial", 1, e, t)
  27620. }(t, a) : function(e, t, i) {
  27621. r("followup", e, t, i)
  27622. }(e, t, a)
  27623. }
  27624. this.reset()
  27625. }
  27626. ,
  27627. function(e, t, i) {
  27628. if (e !== t) {
  27629. s || (l = l.bind(this),
  27630. s = !0),
  27631. o && (window.clearTimeout(o),
  27632. o = null),
  27633. i === a && this.actionSequenceInProgress || (this.reset(),
  27634. a = i),
  27635. this.actionSequenceInProgress = !0;
  27636. var n = {
  27637. start: e,
  27638. end: t
  27639. };
  27640. this.actionSequence.push(n),
  27641. o = window.setTimeout(l, 150)
  27642. }
  27643. }
  27644. ),
  27645. t.exports = n
  27646. }
  27647. , {
  27648. "../analytics": 4
  27649. }],
  27650. 180: [function(e, t, i) {
  27651. "use strict";
  27652. function g(e) {
  27653. if (void 0 === e.parent)
  27654. return [e.data];
  27655. var t = g(e.parent);
  27656. return t.push(e.data),
  27657. t
  27658. }
  27659. function m(e) {
  27660. return e.toString()
  27661. }
  27662. function v(e, t) {
  27663. return e.f - t.f
  27664. }
  27665. var y = e("Set")
  27666. , A = e("heap")
  27667. , C = e("dict");
  27668. t.exports = function(e) {
  27669. void 0 === e.timeout && (e.timeout = 1 / 0);
  27670. var t = e.hash || m
  27671. , i = {
  27672. data: e.start,
  27673. g: 0,
  27674. h: e.heuristic(e.start)
  27675. }
  27676. , n = i;
  27677. i.f = i.h;
  27678. var r = new y
  27679. , o = new A(v)
  27680. , a = C();
  27681. o.push(i),
  27682. a.set(t(i.data), i);
  27683. for (var s = new Date; o.size(); ) {
  27684. if (new Date - s > e.timeout)
  27685. return {
  27686. status: "timeout",
  27687. cost: n.g,
  27688. path: g(n)
  27689. };
  27690. var l = o.pop();
  27691. if (a.delete(t(l.data)),
  27692. e.isEnd(l.data))
  27693. return {
  27694. status: "success",
  27695. cost: l.g,
  27696. path: g(l)
  27697. };
  27698. r.add(t(l.data));
  27699. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  27700. var u = c[h];
  27701. if (!r.contains(t(u))) {
  27702. var d = l.g + e.distance(l.data, u)
  27703. , p = a.get(t(u))
  27704. , f = !1;
  27705. if (void 0 === p)
  27706. p = {
  27707. data: u
  27708. },
  27709. a.set(t(u), p);
  27710. else {
  27711. if (p.g < d)
  27712. continue;
  27713. f = !0
  27714. }
  27715. p.parent = l,
  27716. p.g = d,
  27717. p.h = e.heuristic(u),
  27718. p.f = d + p.h,
  27719. p.h < n.h && (n = p),
  27720. f ? o.heapify() : o.push(p)
  27721. }
  27722. }
  27723. }
  27724. return {
  27725. status: "noPath",
  27726. cost: n.g,
  27727. path: g(n)
  27728. }
  27729. }
  27730. }
  27731. , {
  27732. Set: 196,
  27733. dict: 210,
  27734. heap: 211
  27735. }],
  27736. 181: [function(i, n, e) {
  27737. (function(e) {
  27738. "use strict";
  27739. function s(e, t, i) {
  27740. function n() {
  27741. l.warn("Retrying ", t),
  27742. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  27743. }
  27744. var r = function(e, t, i) {
  27745. var n = new XMLHttpRequest;
  27746. if (i && "withCredentials"in n)
  27747. n.open(e, t, i);
  27748. else if ("undefined" != typeof XDomainRequest)
  27749. (n = new XDomainRequest).open(e, t);
  27750. else {
  27751. if (i)
  27752. throw "Browser does not support CORS!";
  27753. n.open(e, t)
  27754. }
  27755. return n
  27756. }(e, t, !1);
  27757. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  27758. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27759. i.responseType)
  27760. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  27761. r.responseType = i.responseType;
  27762. else {
  27763. if ("image/jpeg" !== i.responseType)
  27764. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27765. r.responseType = "arraybuffer"
  27766. }
  27767. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  27768. i.auth && r.setRequestHeader("Authorization", i.auth),
  27769. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27770. r.setRequestHeader("Content-Type", "application/json")),
  27771. "object" == typeof i.headers)
  27772. for (var o in i.headers)
  27773. r.setRequestHeader(o, i.headers[o]);
  27774. var a = $.Deferred();
  27775. return r.onreadystatechange = function(e) {
  27776. if (4 === this.readyState)
  27777. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  27778. i.retries++,
  27779. setTimeout(n, 1e3);
  27780. else if (200 === this.status) {
  27781. var t = function(e, t) {
  27782. var i = e.response;
  27783. if ("json" === t && "object" != typeof i)
  27784. try {
  27785. i = JSON.parse(e.responseText)
  27786. } catch (e) {
  27787. return void a.reject({
  27788. error: "Failed parsing JSON"
  27789. })
  27790. }
  27791. else if ("image/jpeg" === t) {
  27792. var n = new Uint8Array(e.response)
  27793. , r = new Blob([n],{
  27794. type: "image/jpeg"
  27795. })
  27796. , o = URL.createObjectURL(r);
  27797. (i = new Image).src = o,
  27798. i.crossOrigin = "Anonymous",
  27799. i.onload = function() {
  27800. URL.revokeObjectURL(o)
  27801. }
  27802. }
  27803. return i
  27804. }(this, i.responseType);
  27805. a.resolve(t)
  27806. } else
  27807. a.reject(this)
  27808. }
  27809. ,
  27810. r.onprogress = function(e) {
  27811. a.notify(e)
  27812. }
  27813. ,
  27814. r.send(i.data),
  27815. a.promise()
  27816. }
  27817. function o(e, t) {
  27818. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  27819. return t.headers && function(t) {
  27820. return Object.keys(t).sort().map(function(e) {
  27821. return {
  27822. key: e,
  27823. value: t[e]
  27824. }
  27825. })
  27826. }(t.headers).forEach(function(e) {
  27827. i += "__" + e.key + ":" + e.value
  27828. }),
  27829. i
  27830. }
  27831. var t = i("./logger")
  27832. , a = i("../ab")
  27833. , l = new t(e);
  27834. window.URL = window.URL || window.webkitURL,
  27835. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  27836. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
  27837. n.exports = {
  27838. get: function(e, t) {
  27839. var i, n = void 0 === (t = t || {}).cache || t.cache;
  27840. if (n) {
  27841. var r = function(e, t) {
  27842. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  27843. }(e, t);
  27844. if (r)
  27845. return r
  27846. }
  27847. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
  27848. n && function(e, t, i) {
  27849. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  27850. }(e, t, i),
  27851. i
  27852. },
  27853. post: function(e, t) {
  27854. return s("POST", e, t)
  27855. },
  27856. patch: function(e, t) {
  27857. return s("PATCH", e, t)
  27858. },
  27859. getImage: function(e, t) {
  27860. function i() {
  27861. l.warn("Retrying ", e),
  27862. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  27863. }
  27864. var n = $.Deferred()
  27865. , r = new Image
  27866. , o = this;
  27867. return e = a.changeIfImageOptimzing(e),
  27868. null != t || (t = 3),
  27869. r.onerror = function() {
  27870. 0 < t ? setTimeout(i, 1e3) : n.reject()
  27871. }
  27872. ,
  27873. r.onload = function() {
  27874. n.resolve(r)
  27875. }
  27876. ,
  27877. r.crossOrigin = "anonymous",
  27878. r.src = e,
  27879. n
  27880. }
  27881. }
  27882. }
  27883. ).call(this, "/js/util/ajax.js")
  27884. }
  27885. , {
  27886. "../ab": 3,
  27887. "./logger": 189
  27888. }],
  27889. 182: [function(e, t, i) {
  27890. "use strict";
  27891. function n(e, t) {
  27892. var i = window.navigator.userAgent.match(e);
  27893. return i = i ? i[1].split(t) : [],
  27894. {
  27895. major: parseInt(i[0]) || 0,
  27896. minor: parseInt(i[1]) || 0,
  27897. patch: parseInt(i[2]) || 0
  27898. }
  27899. }
  27900. var r = e("../exception/DeviceMismatchException");
  27901. t.exports = {
  27902. isFullscreen: function() {
  27903. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  27904. },
  27905. supportsFullscreen: function() {
  27906. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  27907. },
  27908. isPointerLocked: function() {
  27909. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  27910. },
  27911. requestFullscreen: function(e, t) {
  27912. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  27913. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  27914. },
  27915. requestPointerLock: function() {
  27916. var e;
  27917. if (document.fullscreenElement)
  27918. e = document.fullscreenElement();
  27919. else if (document.mozFullscreenElement)
  27920. e = document.mozFullscreenElement();
  27921. else if (document.mozFullScreenElement)
  27922. e = document.mozFullScreenElement();
  27923. else {
  27924. if (!document.webkitFullscreenElement)
  27925. return;
  27926. e = document.webkitFullscreenElement()
  27927. }
  27928. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  27929. e.requestPointerLock(),
  27930. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  27931. },
  27932. exitPointerLock: function() {
  27933. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  27934. document.exitPointerLock()
  27935. },
  27936. exitFullscreen: function() {
  27937. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  27938. },
  27939. details: function() {
  27940. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  27941. return e ? {
  27942. name: e[1],
  27943. version: parseInt(e[2]),
  27944. platform: navigator.platform
  27945. } : {}
  27946. },
  27947. is: function(e) {
  27948. return this.details() && this.details().name === e
  27949. },
  27950. inIframe: function() {
  27951. return window.parent !== window
  27952. },
  27953. aspectRatio: function() {
  27954. var e = $("#player").width() / $("#player").height();
  27955. return isFinite(e) ? e : 0
  27956. },
  27957. userAgent: function() {
  27958. return window.navigator.userAgent
  27959. },
  27960. isMobile: function() {
  27961. var e = navigator.userAgent || navigator.vendor || window.opera;
  27962. 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))
  27963. },
  27964. isLandscape: function() {
  27965. return this.isMobile && 1 < this.aspectRatio()
  27966. },
  27967. isSmallScreen: function() {
  27968. return screen.width / window.devicePixelRatio < 240
  27969. },
  27970. detectIE: function() {
  27971. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  27972. },
  27973. detectSafari: function() {
  27974. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  27975. },
  27976. detectFirefox: function() {
  27977. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  27978. },
  27979. detectChrome: function() {
  27980. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  27981. },
  27982. detectOpera: function() {
  27983. return -1 !== window.navigator.userAgent.indexOf("OPR")
  27984. },
  27985. detectIOS: function() {
  27986. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  27987. },
  27988. detectIPad: function() {
  27989. var e = window.navigator.userAgent;
  27990. return /iPad/.test(e)
  27991. },
  27992. detectIPod: function() {
  27993. var e = window.navigator.userAgent;
  27994. return /iPod/.test(e)
  27995. },
  27996. detectIPhone: function() {
  27997. var e = window.navigator.userAgent;
  27998. return /iPhone/.test(e)
  27999. },
  28000. detectAndroid: function() {
  28001. return -1 !== window.navigator.userAgent.indexOf("Android")
  28002. },
  28003. detectAndroidMobile: function() {
  28004. var e = window.navigator.userAgent;
  28005. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28006. },
  28007. detectSamsungNative: function() {
  28008. var e = window.navigator.userAgent;
  28009. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28010. },
  28011. detectSamsungS6: function() {
  28012. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28013. },
  28014. detectHUAWEI5X: function() {
  28015. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28016. },
  28017. detectWebVR: function() {
  28018. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28019. },
  28020. getVRDisplay: function() {
  28021. var t = $.Deferred();
  28022. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28023. 1 <= e.length && t.resolve(e[0]),
  28024. t.reject(null)
  28025. }),
  28026. t) : t.reject(null)
  28027. },
  28028. iosVersion: function() {
  28029. if (!this.detectIOS())
  28030. throw new r("Did not detect an iDevice");
  28031. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28032. },
  28033. androidVersion: function() {
  28034. if (!this.detectAndroid())
  28035. throw new r("Did not detect an Android based device");
  28036. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28037. },
  28038. valueFromCookie: function(e, t) {
  28039. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28040. if (!i)
  28041. return t;
  28042. var n = i[1];
  28043. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28044. },
  28045. valueFromHash: function(e, t) {
  28046. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28047. if (!i)
  28048. return t;
  28049. var n = i[1];
  28050. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28051. }
  28052. }
  28053. }
  28054. , {
  28055. "../exception/DeviceMismatchException": 56
  28056. }],
  28057. 183: [function(i, n, e) {
  28058. (function(e) {
  28059. "use strict";
  28060. var o = i("../controls/serializer")
  28061. , a = i("../util/math")
  28062. , s = i("./browser")
  28063. , l = i("../enum/Viewmode")
  28064. , t = i("../util/logger")
  28065. , c = i("three")
  28066. , h = new t(e);
  28067. n.exports = {
  28068. getStartCameraOptions: function(e, t) {
  28069. var i = function(e) {
  28070. var t = s.valueFromHash("start", "")
  28071. , i = {};
  28072. if ("" !== t) {
  28073. h.debug("Start override found in parameters, trying to parse..."),
  28074. i = function(e) {
  28075. return o.deserialize(e)
  28076. }(t) || {};
  28077. var n = s.valueFromHash("tag", null);
  28078. n && (i.tag = n),
  28079. i.panoId && (i.pano = e.get(i.panoId))
  28080. }
  28081. return i
  28082. }(t);
  28083. if (0 < Object.keys(i).length)
  28084. return i;
  28085. if (e.heroImage)
  28086. i = function(e, t) {
  28087. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28088. return {};
  28089. var i = {}
  28090. , n = e.heroImage.metadata;
  28091. h.debug("Using start position from thumbnail image"),
  28092. i.position = n.camera_position,
  28093. i.quaternion = n.camera_quaternion;
  28094. try {
  28095. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28096. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28097. } catch (e) {
  28098. h.debug(e.message)
  28099. }
  28100. return i
  28101. }(e, t);
  28102. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  28103. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  28104. try {
  28105. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28106. i.position = (new c.Vector3).fromArray(n.camera.position),
  28107. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28108. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28109. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28110. h.debug("Using camera_start"),
  28111. h.debug("Modeldata pano: ", i.pano.quaternion),
  28112. h.debug("Camera start pano: ", n.pano.quaternion)),
  28113. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28114. } catch (e) {
  28115. h.warn(e.message)
  28116. if(i.mode == "panorama" && !i.pano){
  28117. i.pano = t.list[0]
  28118. }
  28119. }
  28120. }
  28121. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28122. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28123. i.pano = t.findClosest(i.position) ,
  28124. i.quaternion = i.pano.quaternion),
  28125. 0 === Object.keys(i).length) {
  28126. var r = t.list[0];
  28127. r && (i.mode = l.PANORAMA,
  28128. i.pano = r,
  28129. i.position = r.position,
  28130. i.quaternion = r.quaternion,
  28131. h.info("Starting at 1st pano " + r.id))
  28132. }
  28133. return i.mode = i.mode || l.DOLLHOUSE,
  28134. i
  28135. }
  28136. }
  28137. }
  28138. ).call(this, "/js/util/camera.js")
  28139. }
  28140. , {
  28141. "../controls/serializer": 14,
  28142. "../enum/Viewmode": 51,
  28143. "../util/logger": 189,
  28144. "../util/math": 190,
  28145. "./browser": 182,
  28146. three: 217
  28147. }],
  28148. 184: [function(e, t, i) {
  28149. "use strict";
  28150. function r(e, t, i) {
  28151. var n = t
  28152. , r = i;
  28153. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28154. }
  28155. function o(e, t, i) {
  28156. var n = t
  28157. , r = i;
  28158. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28159. }
  28160. var a = e("./MathLight");
  28161. t.exports = {
  28162. clampVFOV: function(e, t, i, n) {
  28163. return t < r(e, i, n) ? o(t, i, n) : e
  28164. },
  28165. getHFOVForCamera: function(e, t, i) {
  28166. return r(e.fov, t, i)
  28167. },
  28168. getHFOVFromVFOV: r,
  28169. getVFOVFromHFOV: o
  28170. }
  28171. }
  28172. , {
  28173. "./MathLight": 176
  28174. }],
  28175. 185: [function(e, t, i) {
  28176. "use strict";
  28177. var a = e("three");
  28178. t.exports = {
  28179. delayOneFrame: function(e) {
  28180. window.setTimeout(e, 1)
  28181. },
  28182. normalizeUrl: function(e) {
  28183. return e.replace("https://", "http://")
  28184. },
  28185. domainFromUrl: function(e) {
  28186. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28187. return t ? t[3] : e
  28188. },
  28189. average: function(e, t) {
  28190. if (0 === e.length)
  28191. return null;
  28192. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28193. i += t ? e[r][t] : e[r],
  28194. n++
  28195. }
  28196. return i / n
  28197. },
  28198. countUnique: function(e) {
  28199. for (var t = {}, i = 0; i < e.length; i++)
  28200. t[e[i]] = 1 + (t[e[i]] || 0);
  28201. return Object.keys(t).length
  28202. },
  28203. averageVectors: function(e, t) {
  28204. var i = new a.Vector3;
  28205. if (0 === e.length)
  28206. return i;
  28207. for (var n = 0, r = 0; r < e.length; r++) {
  28208. var o = t ? e[r][t] : e[r];
  28209. i.add(o),
  28210. n++
  28211. }
  28212. return i.divideScalar(n)
  28213. },
  28214. equalLists: function(e, t) {
  28215. if (e.length !== t.length)
  28216. return !1;
  28217. for (var i = 0; i < e.length; i++)
  28218. if (e[i] !== t[i])
  28219. return !1;
  28220. return !0
  28221. },
  28222. lowerMedian: function(e, t) {
  28223. return 0 === e.length ? null : (t = t || 2,
  28224. e.sort(function(e, t) {
  28225. return e - t
  28226. }),
  28227. e[Math.floor(e.length / t)])
  28228. },
  28229. stableSort: function(e, n) {
  28230. return e.map(function(e, t) {
  28231. return {
  28232. value: e,
  28233. index: t
  28234. }
  28235. }).sort(function(e, t) {
  28236. var i = n(e.value, t.value);
  28237. return 0 !== i ? i : e.index - t.index
  28238. }).map(function(e) {
  28239. return e.value
  28240. })
  28241. },
  28242. filterAll: function(e, i) {
  28243. return e.filter(function(t) {
  28244. return i.every(function(e) {
  28245. return e(t)
  28246. })
  28247. })
  28248. },
  28249. formatDate: function(e) {
  28250. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28251. },
  28252. formatDatetime: function(e) {
  28253. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28254. },
  28255. randomString: function(e) {
  28256. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28257. t += i.charAt(Math.floor(Math.random() * i.length));
  28258. return t
  28259. },
  28260. uint8ToBase64: function(e, t) {
  28261. t && "number" == typeof t || (t = 8192);
  28262. for (var i = [], n = 0; n < e.length; n += t)
  28263. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28264. return btoa(i.join(""))
  28265. },
  28266. uuid4: function e(t) {
  28267. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28268. },
  28269. nth: function(e) {
  28270. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28271. },
  28272. extendObject: function(t, i) {
  28273. return Object.keys(i).forEach(function(e) {
  28274. t[e] = i[e]
  28275. }),
  28276. t
  28277. },
  28278. deepExtend: function e(t) {
  28279. t = t || {};
  28280. for (var i = 1; i < arguments.length; i++) {
  28281. var n = arguments[i];
  28282. if (n)
  28283. for (var r in n)
  28284. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28285. }
  28286. return t
  28287. },
  28288. inherit: function(e, t) {
  28289. e.prototype = Object.create(t.prototype),
  28290. e.prototype.constructor = e
  28291. },
  28292. extend: function(e, t) {
  28293. for (var i in t.prototype)
  28294. e.prototype[i] = t.prototype[i]
  28295. }
  28296. },
  28297. Math.sign = function(e) {
  28298. return e < 0 ? -1 : 1
  28299. }
  28300. }
  28301. , {
  28302. three: 217
  28303. }],
  28304. 186: [function(e, t, i) {
  28305. "use strict";
  28306. var r = {
  28307. linearTween: function(e, t, i, n) {
  28308. return i * e / n + t
  28309. },
  28310. easeInQuad: function(e, t, i, n) {
  28311. return i * (e /= n) * e + t
  28312. },
  28313. easeOutQuad: function(e, t, i, n) {
  28314. return -i * (e /= n) * (e - 2) + t
  28315. },
  28316. easeInOutQuad: function(e, t, i, n) {
  28317. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28318. },
  28319. easeInCubic: function(e, t, i, n) {
  28320. return i * (e /= n) * e * e + t
  28321. },
  28322. easeOutCubic: function(e, t, i, n) {
  28323. return e /= n,
  28324. i * (--e * e * e + 1) + t
  28325. },
  28326. easeInOutCubic: function(e, t, i, n) {
  28327. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28328. },
  28329. easeInQuart: function(e, t, i, n) {
  28330. return i * (e /= n) * e * e * e + t
  28331. },
  28332. easeOutQuart: function(e, t, i, n) {
  28333. return e /= n,
  28334. -i * (--e * e * e * e - 1) + t
  28335. },
  28336. easeInOutQuart: function(e, t, i, n) {
  28337. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28338. },
  28339. easeInQuint: function(e, t, i, n) {
  28340. return i * (e /= n) * e * e * e * e + t
  28341. },
  28342. easeOutQuint: function(e, t, i, n) {
  28343. return e /= n,
  28344. i * (--e * e * e * e * e + 1) + t
  28345. },
  28346. easeInOutQuint: function(e, t, i, n) {
  28347. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28348. },
  28349. easeInSine: function(e, t, i, n) {
  28350. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28351. },
  28352. easeOutSine: function(e, t, i, n) {
  28353. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28354. },
  28355. easeInOutSine: function(e, t, i, n) {
  28356. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28357. },
  28358. easeInExpo: function(e, t, i, n) {
  28359. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28360. },
  28361. easeOutExpo: function(e, t, i, n) {
  28362. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28363. },
  28364. easeInOutExpo: function(e, t, i, n) {
  28365. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28366. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28367. },
  28368. easeInCirc: function(e, t, i, n) {
  28369. return e /= n,
  28370. -i * (Math.sqrt(1 - e * e) - 1) + t
  28371. },
  28372. easeOutCirc: function(e, t, i, n) {
  28373. return e /= n,
  28374. e--,
  28375. i * Math.sqrt(1 - e * e) + t
  28376. },
  28377. easeInOutCirc: function(e, t, i, n) {
  28378. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28379. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28380. },
  28381. easeInElastic: function(e, t, i, n) {
  28382. var r = 1.70158
  28383. , o = 0
  28384. , a = i;
  28385. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28386. r = a < Math.abs(i) ? (a = i,
  28387. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28388. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28389. },
  28390. easeOutElastic: function(e, t, i, n) {
  28391. var r = 1.70158
  28392. , o = 0
  28393. , a = i;
  28394. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28395. r = a < Math.abs(i) ? (a = i,
  28396. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28397. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28398. },
  28399. easeInOutElastic: function(e, t, i, n) {
  28400. var r = 1.70158
  28401. , o = 0
  28402. , a = i;
  28403. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28404. r = a < Math.abs(i) ? (a = i,
  28405. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28406. e < 1 ? a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * -.5 + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  28407. },
  28408. easeInBack: function(e, t, i, n, r) {
  28409. return void 0 === r && (r = 1.70158),
  28410. i * (e /= n) * e * ((r + 1) * e - r) + t
  28411. },
  28412. easeOutBack: function(e, t, i, n, r) {
  28413. return void 0 === r && (r = 1.70158),
  28414. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28415. },
  28416. easeInOutBack: function(e, t, i, n, r) {
  28417. return void 0 === r && (r = 1.70158),
  28418. (e /= n / 2) < 1 ? i / 2 * (e * e * ((1 + (r *= 1.525)) * e - r)) + t : i / 2 * ((e -= 2) * e * ((1 + (r *= 1.525)) * e + r) + 2) + t
  28419. },
  28420. easeOutBounce: function(e, t, i, n) {
  28421. 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
  28422. },
  28423. easeInBounce: function(e, t, i, n) {
  28424. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28425. },
  28426. easeInOutBounce: function(e, t, i, n) {
  28427. return e < n / 2 ? .5 * r.easeInBounce(2 * e, 0, i, n) + t : .5 * r.easeOutBounce(x, 2 * e - n, 0, i, n) + .5 * i + t
  28428. }
  28429. };
  28430. t.exports = r
  28431. }
  28432. , {}],
  28433. 187: [function(e, t, i) {
  28434. "use strict";
  28435. function n() {
  28436. this.events = [],
  28437. this.valid = !1
  28438. }
  28439. var r = e("../enum/Joystick");
  28440. n.prototype.push = function(e, t) {
  28441. this.events.push({
  28442. direction: e,
  28443. pano: t
  28444. }),
  28445. this.valid = !0
  28446. }
  28447. ,
  28448. n.prototype.pop = function(e) {
  28449. var t = this.events.pop();
  28450. return this.events.length < 1 && (this.valid = !1),
  28451. t
  28452. }
  28453. ,
  28454. n.prototype.peek = function() {
  28455. return this.events.length ? this.events[this.events.length - 1] : {
  28456. direction: null,
  28457. pano: null
  28458. }
  28459. }
  28460. ,
  28461. n.prototype.invalidate = function() {
  28462. this.events = [],
  28463. this.valid = !1
  28464. }
  28465. ,
  28466. n.prototype.reversePano = function(e) {
  28467. if (!this.valid)
  28468. return null;
  28469. var t = this.peek();
  28470. return r.opposite(e) === t.direction ? (this.pop(),
  28471. t.pano) : null
  28472. }
  28473. ,
  28474. t.exports = n
  28475. }
  28476. , {
  28477. "../enum/Joystick": 29
  28478. }],
  28479. 188: [function(e, t, i) {
  28480. "use strict";
  28481. t.exports = {
  28482. vector: function(t, i) {
  28483. var n = t.clone();
  28484. return i = i.clone(),
  28485. function(e) {
  28486. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28487. }
  28488. },
  28489. quaternion: function(t, i) {
  28490. var n = t.clone();
  28491. return function(e) {
  28492. t.copy(n).slerp(i, e)
  28493. }
  28494. },
  28495. property: function(t, i, n, r) {
  28496. var o = t[i];
  28497. return function(e) {
  28498. t[i] = o * (1 - e) + n * e,
  28499. r && r(t[i])
  28500. }
  28501. },
  28502. uniform: function(t, i, n) {
  28503. var r = t.material.uniforms[i].value;
  28504. return function(e) {
  28505. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28506. }
  28507. },
  28508. matrix4: function(o, a) {
  28509. var s = o.clone();
  28510. return function(e) {
  28511. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28512. t[r] = i[r] * (1 - e) + n[r] * e
  28513. }
  28514. },
  28515. allUniforms: function(e, t, i) {
  28516. var n = e.map(function(e) {
  28517. return this.uniform(e, t, i)
  28518. }
  28519. .bind(this));
  28520. return function(t) {
  28521. n.forEach(function(e) {
  28522. e(t)
  28523. })
  28524. }
  28525. }
  28526. }
  28527. }
  28528. , {}],
  28529. 189: [function(e, t, i) {
  28530. "use strict";
  28531. function h(n) {
  28532. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28533. if (h.consoleEnabled) {
  28534. var l = function(e) {
  28535. $("#debug-console").append("<p>" + e + "</p>"),
  28536. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28537. };
  28538. e = function(e) {
  28539. l(Array.prototype.slice.call(arguments).join(" "))
  28540. }
  28541. ,
  28542. t = function(e) {
  28543. l(Array.prototype.slice.call(arguments).join(" "))
  28544. }
  28545. ,
  28546. i = function(e) {
  28547. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28548. }
  28549. ,
  28550. r = function(e) {
  28551. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28552. }
  28553. } else
  28554. console.log ? (e = console.log,
  28555. t = console.info ? console.info : console.log,
  28556. i = console.warn ? console.warn : console.log,
  28557. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28558. ;
  28559. function c(e) {
  28560. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28561. }
  28562. return {
  28563. debug: function() {
  28564. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28565. },
  28566. info: function() {
  28567. h.level >= h.levels.info && t.apply(console, c(arguments))
  28568. },
  28569. warn: function() {
  28570. (function(e, t) {
  28571. if (u) {
  28572. var i = Array.prototype.slice.call(e).join(" ");
  28573. u.captureMessage(i, {
  28574. level: t,
  28575. path: n,
  28576. timestamp: h.timestamp()
  28577. })
  28578. }
  28579. }
  28580. )(arguments, "warn"),
  28581. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28582. },
  28583. error: function() {
  28584. (function(e, t) {
  28585. if (u) {
  28586. var i = Array.prototype.slice.call(e).join(" ");
  28587. u.captureException(new Error(i), {
  28588. level: t,
  28589. path: n,
  28590. timestamp: h.timestamp()
  28591. })
  28592. }
  28593. }
  28594. )(arguments, "error"),
  28595. h.level >= h.levels.error && r.apply(console, c(arguments))
  28596. },
  28597. v3str: function(e, t) {
  28598. var i = void 0 === t ? 2 : t;
  28599. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28600. },
  28601. eulstr: function(e, t) {
  28602. var i = void 0 === t ? 2 : t;
  28603. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28604. },
  28605. time: function(e) {
  28606. h.level >= h.levels.debug && (s[e] = Date.now())
  28607. },
  28608. timeEnd: function(e) {
  28609. if (h.level >= h.levels.debug) {
  28610. var t = s[e];
  28611. if (!t)
  28612. return;
  28613. var i = (Date.now() - t) / 1e3;
  28614. this.debug(e, i + "s")
  28615. }
  28616. }
  28617. }
  28618. }
  28619. var u = window.Raven;
  28620. h.timestamp = function() {
  28621. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28622. }
  28623. ,
  28624. h.level = (h.levels = {
  28625. debug: 3,
  28626. info: 2,
  28627. warn: 1,
  28628. error: 0
  28629. }).info,
  28630. t.exports = h
  28631. }
  28632. , {}],
  28633. 190: [function(e, t, i) {
  28634. "use strict";
  28635. var o = e("three")
  28636. , r = e("../enum/GLCubeFaces");
  28637. e("../constants");
  28638. t.exports = {
  28639. convertVisionVector: function(e) {
  28640. return new o.Vector3(e.x,e.z,-e.y)
  28641. },
  28642. convertVisionQuaternion: function(e) {
  28643. return new o.Quaternion(e.x,e.z,-e.y,e.w).multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(90)))
  28644. },
  28645. convertWorkshopVector: function(e) {
  28646. return new o.Vector3(-e.x,e.y,e.z)
  28647. },
  28648. convertWorkshopQuaternion: function(e) {
  28649. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  28650. },
  28651. convertWorkshopPanoramaQuaternion: function(e) {
  28652. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(270)))
  28653. },
  28654. convertWorkshopOrthoZoom: function(e) {
  28655. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  28656. },
  28657. toPrecision: function(e, t) {
  28658. function i(e, t) {
  28659. var i = Math.pow(10, t);
  28660. return Math.round(e * i) / i
  28661. }
  28662. if (e instanceof Array) {
  28663. for (var n = 0; n < e.length; n++)
  28664. e[n] = i(e[n], t);
  28665. return e
  28666. }
  28667. return i(e, t)
  28668. },
  28669. isEmptyQuaternion: function(e) {
  28670. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28671. },
  28672. projectPositionToCanvas: function(e, t, i) {
  28673. (i = i || new o.Vector3).copy(e);
  28674. var n = .5 * $("#player").width()
  28675. , r = .5 * $("#player").height();
  28676. return i.project(t),
  28677. i.x = i.x * n + n,
  28678. i.y = -i.y * r + r,
  28679. i
  28680. },
  28681. convertScreenPositionToNDC: function(e, t, i) {
  28682. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  28683. i.y = -t / $("#player").height() * 2 + 1,
  28684. i
  28685. },
  28686. constrainedTurn: function(e) {
  28687. var t = e % (2 * Math.PI);
  28688. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28689. },
  28690. getFOVDotThreshold: function(e) {
  28691. return Math.cos(o.Math.degToRad(e / 2))
  28692. },
  28693. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28694. switch (e) {
  28695. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28696. i.set(1, t.y, t.x);
  28697. break;
  28698. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28699. i.set(-1, t.y, -t.x);
  28700. break;
  28701. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28702. i.set(-t.x, 1, -t.y);
  28703. break;
  28704. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28705. i.set(-t.x, -1, t.y);
  28706. break;
  28707. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28708. i.set(-t.x, t.y, 1);
  28709. break;
  28710. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28711. i.set(t.x, t.y, -1)
  28712. }
  28713. n && i.normalize()
  28714. },
  28715. //add:
  28716. getPos2d : function(point, camera, dom){
  28717. var camera = camera ;
  28718. var dom = dom;
  28719. var pos = point.clone().project(camera) //比之前hotspot的计算方式写得简单 project用于3转2(求法同shader); unproject用于2转3 :new r.Vector3(e.x, e.y, -1).unproject(this.camera);
  28720. var x,y;
  28721. x = (pos.x + 1) / 2 * dom.clientWidth;
  28722. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  28723. var inSight = x <= dom.clientWidth && x >= 0
  28724. && y <= dom.clientHeight && y >= 0
  28725. return {
  28726. pos: new THREE.Vector2(x,y),
  28727. vector: pos,
  28728. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  28729. inSight : inSight //在屏幕范围内可见
  28730. };
  28731. },
  28732. }
  28733. }
  28734. , {
  28735. "../constants": 8,
  28736. "../enum/GLCubeFaces": 25,
  28737. three: 217
  28738. }],
  28739. 191: [function(e, t, i) {
  28740. "use strict";
  28741. function o(e) {
  28742. return r[e]
  28743. }
  28744. var n = e("../enum/GLCubeFaces")
  28745. , a = [0, 1, 2, 3, 4, 5]
  28746. , r = {
  28747. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28748. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28749. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28750. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28751. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28752. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28753. };
  28754. t.exports = {
  28755. mapFaceToCubemapFace: o,
  28756. getCubemapUrls: function(i, n, r) {
  28757. return a.map(function(e, t) {
  28758. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  28759. }
  28760. .bind(this))
  28761. }
  28762. }
  28763. }
  28764. , {
  28765. "../enum/GLCubeFaces": 25
  28766. }],
  28767. 192: [function(e, t, i) {
  28768. "use strict";
  28769. t.exports = {
  28770. captureErrors: function(e, t, i) {
  28771. if ("Raven"in window) {
  28772. Raven.config(e, t).install(),
  28773. i && Raven.setTagsContext(i);
  28774. var n = console.warn
  28775. , r = console.error;
  28776. console.warn = function() {
  28777. var e = Array.prototype.slice.call(arguments);
  28778. Raven.captureMessage(e.join(" "), {
  28779. level: "warning"
  28780. }),
  28781. n.apply(console, e)
  28782. }
  28783. ,
  28784. console.error = function() {
  28785. var e = Array.prototype.slice.call(arguments);
  28786. Raven.captureException(new Error(e.join(" ")), {
  28787. level: "error"
  28788. }),
  28789. r.apply(console, e)
  28790. }
  28791. } else
  28792. console.error("Raven not found, not capturing errors.")
  28793. }
  28794. }
  28795. }
  28796. , {}],
  28797. 193: [function(c, h, e) {
  28798. (function(e) {
  28799. "use strict";
  28800. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  28801. getAuthorizationHeader: function() {
  28802. var e = n.valueFromHash("auth");
  28803. if (e)
  28804. return e.replace(",", " ");
  28805. var t = n.valueFromCookie("token");
  28806. return t ? "Token " + t : null
  28807. },
  28808. parseSidUrl: function(e) {
  28809. var t, i;
  28810. if (t = g_Prefix,
  28811. (e = e || "").match(/^https?/)) {
  28812. o.parse(e);
  28813. t = g_Prefix,
  28814. i = e
  28815. } else
  28816. i = (t = g_Prefix) + "data/" + e;
  28817. return {
  28818. urlBase: t,
  28819. urlModel: i,
  28820. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  28821. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  28822. }
  28823. },
  28824. getModelIDFromQueryString: function() {
  28825. return n.valueFromHash("model") || n.valueFromHash("m")
  28826. },
  28827. /* normalizeModeldata: function(e, i) {
  28828. e = JSON.parse(JSON.stringify(e));
  28829. var n = null;
  28830. if (e.images.forEach(function(t) {
  28831. if (t.metadata) {
  28832. if ("string" == typeof t.metadata)
  28833. try {
  28834. t.metadata = JSON.parse(t.metadata)
  28835. } catch (e) {
  28836. s.warn("Unable to parse image metadata"),
  28837. t.metadata = null
  28838. }
  28839. else
  28840. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  28841. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  28842. t.metadata.camera_quaternion = (new a.Quaternion).fromArray(t.metadata.camera_quaternion)) : (t.metadata.camera_quaternion && (t.metadata.camera_quaternion = i.convertWorkshopQuaternion(t.metadata.camera_quaternion)),
  28843. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  28844. t.metadata.zoom = t.metadata.zoom || 1),
  28845. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  28846. }
  28847. }),
  28848. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  28849. var t = {};
  28850. t.pano = {
  28851. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  28852. position: i.convertWorkshopVector(n.scan_position),
  28853. uuid: n.scan_id
  28854. },
  28855. t.camera = {
  28856. quaternion: n.camera_quaternion,
  28857. position: n.camera_position
  28858. },
  28859. e.startPano = t
  28860. }
  28861. return e
  28862. }, */
  28863. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  28864. e = JSON.parse(JSON.stringify(e));
  28865. var i = null;
  28866. if (e.images.forEach(function(n) {
  28867. if(!n.metadata) return;
  28868. if ("string" == typeof n.metadata)
  28869. try {
  28870. n.metadata = JSON.parse(n.metadata)
  28871. } catch (e) {
  28872. s.warn("Unable to parse image metadata"),
  28873. n.metadata = null
  28874. }
  28875. else{
  28876. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  28877. }
  28878. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  28879. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  28880. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  28881. }else{
  28882. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  28883. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  28884. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  28885. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  28886. }
  28887. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  28888. }),
  28889. //icon初始视角的:
  28890. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  28891. var n = {};
  28892. n.pano = {
  28893. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  28894. position: t.convertWorkshopVector(i.scan_position),
  28895. uuid: i.scan_id
  28896. },
  28897. n.camera = {
  28898. quaternion: i.camera_quaternion,
  28899. position: i.camera_position
  28900. },
  28901. e.startPano = n
  28902. }
  28903. return e
  28904. },
  28905. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  28906. function(e) {
  28907. if (!e)
  28908. throw new Error("Vision version is required");
  28909. var t = i.exec(e);
  28910. if (null === t)
  28911. throw new Error("String is not a vision version: " + e);
  28912. return parseInt(t[1])
  28913. }
  28914. ),
  28915. modelDataPromisesTiles: function(e) {
  28916. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  28917. if (t)
  28918. try {
  28919. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  28920. } catch (e) {
  28921. s.warn("Invalid vision version: " + t)
  28922. }
  28923. return !1
  28924. }
  28925. };
  28926. h.exports = l
  28927. }
  28928. ).call(this, "/js/util/showcase.js")
  28929. }
  28930. , {
  28931. "../constants": 8,
  28932. "./browser": 182,
  28933. "./logger": 189,
  28934. three: 217,
  28935. url: 208
  28936. }],
  28937. 194: [function(e, t, i) {
  28938. "use strict";
  28939. var r = e("../util/ajax")
  28940. , o = e("three")
  28941. , a = e("../settings")
  28942. , s = {};
  28943. t.exports = {
  28944. load: function(e, t, i) {
  28945. var n = s[e];
  28946. return n ? t && setTimeout(function() {
  28947. t(n)
  28948. }, 1) : (n = new o.Texture,
  28949. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  28950. n.magFilter = o.LinearFilter,
  28951. n.generateMipmaps = !1),
  28952. n.sourceFile = e,
  28953. s[e] = n,
  28954. r.getImage(e).then(function(e) {
  28955. n.image = e,
  28956. n.needsUpdate = !0,
  28957. t && t(n)
  28958. }).fail(i)),
  28959. n
  28960. },
  28961. loadBase64: function(e, t) {
  28962. t = t || "png";
  28963. var i = new o.Texture;
  28964. return i.image = document.createElement("img"),
  28965. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  28966. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  28967. i.magFilter = o.LinearFilter,
  28968. i.generateMipmaps = !1),
  28969. i.needsUpdate = !0,
  28970. i
  28971. },
  28972. isLoaded: function(e) {
  28973. return !!s[e]
  28974. }
  28975. }
  28976. window.Texture = t.exports
  28977. }
  28978. , {
  28979. "../settings": 166,
  28980. "../util/ajax": 181,
  28981. three: 217
  28982. }],
  28983. 195: [function(e, t, i) {
  28984. "use strict";
  28985. var l = e("./easing");
  28986. t.exports = {
  28987. globalDone: null,
  28988. funcs: [],
  28989. counter: 0,
  28990. uniqueID: 0,
  28991. start: function(e, t, i, n, r, o, a) {
  28992. return n = n || 0,
  28993. this.funcs.push({
  28994. func: e,
  28995. current: -n * Math.abs(t),
  28996. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  28997. done: i,
  28998. easing: r || l.linearTween,
  28999. cycling: t < 0,
  29000. running: !0,
  29001. debug: n < 0,
  29002. name: o || "T" + this.counter,
  29003. id: void 0 === a ? this.counter : a,
  29004. paused: !1
  29005. }),
  29006. e(0, 16),
  29007. this.counter += 1,
  29008. e
  29009. },
  29010. trigger: function(e) {
  29011. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29012. , i = e.func || function() {}
  29013. , n = void 0 === e.duration ? 0 : e.duration;
  29014. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29015. var r = e.done || null
  29016. , o = e.easing || l.linearTween
  29017. , a = e.name || "R" + this.counter
  29018. , s = void 0 === e.id ? this.counter : e.id;
  29019. return this.start(i, n, r, t, o, a, s)
  29020. },
  29021. setTimeout: function(e, t, i) {
  29022. var n = void 0 === i ? this.counter : i;
  29023. return this.trigger({
  29024. done: e,
  29025. duration: void 0 === t ? 0 : t,
  29026. name: "O" + this.counter,
  29027. id: n
  29028. })
  29029. },
  29030. pause: function() {
  29031. this.paused = !0
  29032. },
  29033. resume: function() {
  29034. this.paused = !1
  29035. },
  29036. update: function(n) {
  29037. this.funcs.forEach(function(e) {
  29038. if (!(e.paused || (e.current += 1e3 * n,
  29039. e.current < 0)))
  29040. if (e.current >= e.duration && !e.cycling) {
  29041. var t = e.easing(1, 0, 1, 1);
  29042. e.func(t, 1e3 * n),
  29043. e.done && e.done(),
  29044. e.running = !1
  29045. } else {
  29046. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29047. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29048. e.running = !1)
  29049. }
  29050. });
  29051. var e = this.funcs.length;
  29052. this.funcs = this.funcs.filter(function(e) {
  29053. return e.running
  29054. });
  29055. var t = this.funcs.length;
  29056. if (0 < e && 0 === t && this.globalDone) {
  29057. var i = this.globalDone;
  29058. this.globalDone = null,
  29059. i()
  29060. }
  29061. },
  29062. adjustSpeed: function(e, t) {
  29063. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29064. var r = i[n];
  29065. r.duration /= t,
  29066. r.current /= t
  29067. }
  29068. },
  29069. getById: function(t) {
  29070. return this.funcs.filter(function(e) {
  29071. return t === e.id
  29072. })
  29073. },
  29074. get: function(e) {
  29075. for (var t = 0; t < this.funcs.length; t += 1)
  29076. if (this.funcs[t].func === e)
  29077. return this.funcs[t];
  29078. return null
  29079. },
  29080. isRunning: function(e) {
  29081. var t = this.get(e);
  29082. return null !== t && t.running
  29083. },
  29084. countActive: function() {
  29085. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29086. e += this.funcs[t].running;
  29087. return e
  29088. },
  29089. listActive: function() {
  29090. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29091. this.funcs[t].running && e.push(this.funcs[t].name);
  29092. return e
  29093. },
  29094. done: function(e) {
  29095. this.globalDone = e
  29096. },
  29097. cancelById: function(e) {
  29098. var t = void 0 === e ? 0 : e;
  29099. this.funcs = this.funcs.filter(function(e) {
  29100. return e.id !== t
  29101. })
  29102. },
  29103. cancel: function(t) {
  29104. this.funcs = this.funcs.filter(function(e) {
  29105. return e.func !== t
  29106. })
  29107. },
  29108. getUniqueId: function() {
  29109. return this.uniqueID -= 1,
  29110. this.uniqueID
  29111. }
  29112. }
  29113. }
  29114. , {
  29115. "./easing": 186
  29116. }],
  29117. 196: [function(e, t, i) {
  29118. function n(e) {
  29119. if (this.set = {},
  29120. this.infContains = function() {
  29121. return !0
  29122. }
  29123. ,
  29124. "object" == typeof e)
  29125. if (e instanceof Array)
  29126. for (var t = 0; t < e.length; t++)
  29127. this.set[e[t]] = !0;
  29128. else
  29129. this.set = e;
  29130. else if ("function" == typeof e)
  29131. this.infContains = e;
  29132. else if (void 0 !== e)
  29133. throw new Error("set must be either an array or an object.")
  29134. }
  29135. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29136. return !!this.set[e]
  29137. }
  29138. ,
  29139. n.prototype.add = function(e) {
  29140. if (1 == arguments.length)
  29141. this.set[e] = !0;
  29142. else
  29143. for (var t = 0; t < arguments.length; t++)
  29144. this.set[arguments[t]] = !0
  29145. }
  29146. ,
  29147. n.prototype.addAll = function(e) {
  29148. if ("object" != typeof e && !(e instanceof Array))
  29149. throw new Error("arr must be an array.");
  29150. for (var t = 0; t < e.length; t++)
  29151. this.add(e[t])
  29152. }
  29153. ,
  29154. n.prototype.delete = n.prototype.remove = function(e) {
  29155. if (1 == arguments.length)
  29156. delete this.set[e];
  29157. else
  29158. for (var t = 0; t < arguments.length; t++)
  29159. delete this.set[arguments[t]]
  29160. }
  29161. ,
  29162. n.prototype.clear = function() {
  29163. this.set = {}
  29164. }
  29165. ,
  29166. n.prototype.size = function() {
  29167. return Object.keys(this.set).length
  29168. }
  29169. ,
  29170. n.prototype.toString = function() {
  29171. return "{" + Object.keys(this.set).toString() + "}"
  29172. }
  29173. ,
  29174. n.prototype["*values"] = n.prototype.toArray = function() {
  29175. return void 0 === this.set ? [] : Object.keys(this.set)
  29176. }
  29177. }
  29178. , {}],
  29179. 197: [function(e, t, i) {}
  29180. , {}],
  29181. 198: [function(N, e, F) {
  29182. (function(e) {
  29183. "use strict";
  29184. function i() {
  29185. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29186. }
  29187. function o(e, t) {
  29188. if (i() < t)
  29189. throw new RangeError("Invalid typed array length");
  29190. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29191. e.length = t),
  29192. e
  29193. }
  29194. function u(e, t, i) {
  29195. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29196. return new u(e,t,i);
  29197. if ("number" != typeof e)
  29198. return n(this, e, t, i);
  29199. if ("string" == typeof t)
  29200. throw new Error("If encoding is specified then the first argument must be a string");
  29201. return a(this, e)
  29202. }
  29203. function n(e, t, i, n) {
  29204. if ("number" == typeof t)
  29205. throw new TypeError('"value" argument must not be a number');
  29206. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29207. if (t.byteLength,
  29208. i < 0 || t.byteLength < i)
  29209. throw new RangeError("'offset' is out of bounds");
  29210. if (t.byteLength < i + (n || 0))
  29211. throw new RangeError("'length' is out of bounds");
  29212. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29213. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29214. e
  29215. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29216. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29217. !u.isEncoding(i))
  29218. throw new TypeError('"encoding" must be a valid string encoding');
  29219. var n = 0 | c(t, i)
  29220. , r = (e = o(e, n)).write(t, i);
  29221. return r !== n && (e = e.slice(0, r)),
  29222. e
  29223. }(e, t, i) : function(e, t) {
  29224. if (u.isBuffer(t)) {
  29225. var i = 0 | l(t.length);
  29226. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29227. e
  29228. }
  29229. if (t) {
  29230. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29231. return "number" != typeof t.length || function(e) {
  29232. return e != e
  29233. }(t.length) ? o(e, 0) : s(e, t);
  29234. if ("Buffer" === t.type && L(t.data))
  29235. return s(e, t.data)
  29236. }
  29237. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29238. }(e, t)
  29239. }
  29240. function r(e) {
  29241. if ("number" != typeof e)
  29242. throw new TypeError('"size" argument must be a number');
  29243. if (e < 0)
  29244. throw new RangeError('"size" argument must not be negative')
  29245. }
  29246. function a(e, t) {
  29247. if (r(t),
  29248. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29249. !u.TYPED_ARRAY_SUPPORT)
  29250. for (var i = 0; i < t; ++i)
  29251. e[i] = 0;
  29252. return e
  29253. }
  29254. function s(e, t) {
  29255. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29256. e = o(e, i);
  29257. for (var n = 0; n < i; n += 1)
  29258. e[n] = 255 & t[n];
  29259. return e
  29260. }
  29261. function l(e) {
  29262. if (e >= i())
  29263. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29264. return 0 | e
  29265. }
  29266. function c(e, t) {
  29267. if (u.isBuffer(e))
  29268. return e.length;
  29269. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29270. return e.byteLength;
  29271. "string" != typeof e && (e = "" + e);
  29272. var i = e.length;
  29273. if (0 === i)
  29274. return 0;
  29275. for (var n = !1; ; )
  29276. switch (t) {
  29277. case "ascii":
  29278. case "latin1":
  29279. case "binary":
  29280. return i;
  29281. case "utf8":
  29282. case "utf-8":
  29283. case void 0:
  29284. return S(e).length;
  29285. case "ucs2":
  29286. case "ucs-2":
  29287. case "utf16le":
  29288. case "utf-16le":
  29289. return 2 * i;
  29290. case "hex":
  29291. return i >>> 1;
  29292. case "base64":
  29293. return M(e).length;
  29294. default:
  29295. if (n)
  29296. return S(e).length;
  29297. t = ("" + t).toLowerCase(),
  29298. n = !0
  29299. }
  29300. }
  29301. function h(e, t, i) {
  29302. var n = e[t];
  29303. e[t] = e[i],
  29304. e[i] = n
  29305. }
  29306. function d(e, t, i, n, r) {
  29307. if (0 === e.length)
  29308. return -1;
  29309. if ("string" == typeof i ? (n = i,
  29310. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29311. i = +i,
  29312. isNaN(i) && (i = r ? 0 : e.length - 1),
  29313. i < 0 && (i = e.length + i),
  29314. i >= e.length) {
  29315. if (r)
  29316. return -1;
  29317. i = e.length - 1
  29318. } else if (i < 0) {
  29319. if (!r)
  29320. return -1;
  29321. i = 0
  29322. }
  29323. if ("string" == typeof t && (t = u.from(t, n)),
  29324. u.isBuffer(t))
  29325. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29326. if ("number" == typeof t)
  29327. return t &= 255,
  29328. u.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : p(e, [t], i, n, r);
  29329. throw new TypeError("val must be string, number or Buffer")
  29330. }
  29331. function p(e, t, i, n, r) {
  29332. function o(e, t) {
  29333. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29334. }
  29335. var a, s = 1, l = e.length, c = t.length;
  29336. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29337. if (e.length < 2 || t.length < 2)
  29338. return -1;
  29339. l /= s = 2,
  29340. c /= 2,
  29341. i /= 2
  29342. }
  29343. if (r) {
  29344. var h = -1;
  29345. for (a = i; a < l; a++)
  29346. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29347. if (-1 === h && (h = a),
  29348. a - h + 1 === c)
  29349. return h * s
  29350. } else
  29351. -1 !== h && (a -= a - h),
  29352. h = -1
  29353. } else
  29354. for (l < i + c && (i = l - c),
  29355. a = i; 0 <= a; a--) {
  29356. for (var u = !0, d = 0; d < c; d++)
  29357. if (o(e, a + d) !== o(t, d)) {
  29358. u = !1;
  29359. break
  29360. }
  29361. if (u)
  29362. return a
  29363. }
  29364. return -1
  29365. }
  29366. function g(e, t, i, n) {
  29367. i = Number(i) || 0;
  29368. var r = e.length - i;
  29369. n ? r < (n = Number(n)) && (n = r) : n = r;
  29370. var o = t.length;
  29371. if (o % 2 != 0)
  29372. throw new TypeError("Invalid hex string");
  29373. o / 2 < n && (n = o / 2);
  29374. for (var a = 0; a < n; ++a) {
  29375. var s = parseInt(t.substr(2 * a, 2), 16);
  29376. if (isNaN(s))
  29377. return a;
  29378. e[i + a] = s
  29379. }
  29380. return a
  29381. }
  29382. function m(e, t, i, n) {
  29383. return R(function(e) {
  29384. for (var t = [], i = 0; i < e.length; ++i)
  29385. t.push(255 & e.charCodeAt(i));
  29386. return t
  29387. }(t), e, i, n)
  29388. }
  29389. function f(e, t, i) {
  29390. i = Math.min(e.length, i);
  29391. for (var n = [], r = t; r < i; ) {
  29392. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29393. if (r + u <= i)
  29394. switch (u) {
  29395. case 1:
  29396. c < 128 && (h = c);
  29397. break;
  29398. case 2:
  29399. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29400. break;
  29401. case 3:
  29402. o = e[r + 1],
  29403. a = e[r + 2],
  29404. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29405. break;
  29406. case 4:
  29407. o = e[r + 1],
  29408. a = e[r + 2],
  29409. s = e[r + 3],
  29410. 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && (65535 < (l = (15 & c) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) && l < 1114112 && (h = l))
  29411. }
  29412. null === h ? (h = 65533,
  29413. u = 1) : 65535 < h && (h -= 65536,
  29414. n.push(h >>> 10 & 1023 | 55296),
  29415. h = 56320 | 1023 & h),
  29416. n.push(h),
  29417. r += u
  29418. }
  29419. return function(e) {
  29420. var t = e.length;
  29421. if (t <= D)
  29422. return String.fromCharCode.apply(String, e);
  29423. for (var i = "", n = 0; n < t; )
  29424. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29425. return i
  29426. }(n)
  29427. }
  29428. function v(e, t, i) {
  29429. var n = "";
  29430. i = Math.min(e.length, i);
  29431. for (var r = t; r < i; ++r)
  29432. n += String.fromCharCode(127 & e[r]);
  29433. return n
  29434. }
  29435. function y(e, t, i) {
  29436. var n = "";
  29437. i = Math.min(e.length, i);
  29438. for (var r = t; r < i; ++r)
  29439. n += String.fromCharCode(e[r]);
  29440. return n
  29441. }
  29442. function A(e, t, i) {
  29443. var n, r = e.length;
  29444. (!t || t < 0) && (t = 0),
  29445. (!i || i < 0 || r < i) && (i = r);
  29446. for (var o = "", a = t; a < i; ++a)
  29447. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29448. return o
  29449. }
  29450. function C(e, t, i) {
  29451. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29452. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29453. return r
  29454. }
  29455. function I(e, t, i) {
  29456. if (e % 1 != 0 || e < 0)
  29457. throw new RangeError("offset is not uint");
  29458. if (i < e + t)
  29459. throw new RangeError("Trying to access beyond buffer length")
  29460. }
  29461. function E(e, t, i, n, r, o) {
  29462. if (!u.isBuffer(e))
  29463. throw new TypeError('"buffer" argument must be a Buffer instance');
  29464. if (r < t || t < o)
  29465. throw new RangeError('"value" argument is out of bounds');
  29466. if (i + n > e.length)
  29467. throw new RangeError("Index out of range")
  29468. }
  29469. function _(e, t, i, n) {
  29470. t < 0 && (t = 65535 + t + 1);
  29471. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29472. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29473. }
  29474. function b(e, t, i, n) {
  29475. t < 0 && (t = 4294967295 + t + 1);
  29476. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29477. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29478. }
  29479. function w(e, t, i, n) {
  29480. if (i + n > e.length)
  29481. throw new RangeError("Index out of range");
  29482. if (i < 0)
  29483. throw new RangeError("Index out of range")
  29484. }
  29485. function T(e, t, i, n, r) {
  29486. return r || w(e, 0, i, 4),
  29487. O.write(e, t, i, n, 23, 4),
  29488. i + 4
  29489. }
  29490. function x(e, t, i, n, r) {
  29491. return r || w(e, 0, i, 8),
  29492. O.write(e, t, i, n, 52, 8),
  29493. i + 8
  29494. }
  29495. function S(e, t) {
  29496. t = t || 1 / 0;
  29497. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29498. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29499. if (!r) {
  29500. if (56319 < i) {
  29501. -1 < (t -= 3) && o.push(239, 191, 189);
  29502. continue
  29503. }
  29504. if (a + 1 === n) {
  29505. -1 < (t -= 3) && o.push(239, 191, 189);
  29506. continue
  29507. }
  29508. r = i;
  29509. continue
  29510. }
  29511. if (i < 56320) {
  29512. -1 < (t -= 3) && o.push(239, 191, 189),
  29513. r = i;
  29514. continue
  29515. }
  29516. i = 65536 + (r - 55296 << 10 | i - 56320)
  29517. } else
  29518. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29519. if (r = null,
  29520. i < 128) {
  29521. if ((t -= 1) < 0)
  29522. break;
  29523. o.push(i)
  29524. } else if (i < 2048) {
  29525. if ((t -= 2) < 0)
  29526. break;
  29527. o.push(i >> 6 | 192, 63 & i | 128)
  29528. } else if (i < 65536) {
  29529. if ((t -= 3) < 0)
  29530. break;
  29531. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29532. } else {
  29533. if (!(i < 1114112))
  29534. throw new Error("Invalid code point");
  29535. if ((t -= 4) < 0)
  29536. break;
  29537. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29538. }
  29539. }
  29540. return o
  29541. }
  29542. function M(e) {
  29543. return P.toByteArray(function(e) {
  29544. if ((e = function(e) {
  29545. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29546. }(e).replace(t, "")).length < 2)
  29547. return "";
  29548. for (; e.length % 4 != 0; )
  29549. e += "=";
  29550. return e
  29551. }(e))
  29552. }
  29553. function R(e, t, i, n) {
  29554. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29555. t[r + i] = e[r];
  29556. return r
  29557. }
  29558. var P = N("base64-js")
  29559. , O = N("ieee754")
  29560. , L = N("isarray");
  29561. F.Buffer = u,
  29562. F.SlowBuffer = function(e) {
  29563. return +e != e && (e = 0),
  29564. u.alloc(+e)
  29565. }
  29566. ,
  29567. F.INSPECT_MAX_BYTES = 50,
  29568. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29569. try {
  29570. var e = new Uint8Array(1);
  29571. return e.__proto__ = {
  29572. __proto__: Uint8Array.prototype,
  29573. foo: function() {
  29574. return 42
  29575. }
  29576. },
  29577. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29578. } catch (e) {
  29579. return !1
  29580. }
  29581. }(),
  29582. F.kMaxLength = i(),
  29583. u.poolSize = 8192,
  29584. u._augment = function(e) {
  29585. return e.__proto__ = u.prototype,
  29586. e
  29587. }
  29588. ,
  29589. u.from = function(e, t, i) {
  29590. return n(null, e, t, i)
  29591. }
  29592. ,
  29593. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  29594. u.__proto__ = Uint8Array,
  29595. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  29596. value: null,
  29597. configurable: !0
  29598. })),
  29599. u.alloc = function(e, t, i) {
  29600. return function(e, t, i, n) {
  29601. return r(t),
  29602. 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)
  29603. }(null, e, t, i)
  29604. }
  29605. ,
  29606. u.allocUnsafe = function(e) {
  29607. return a(null, e)
  29608. }
  29609. ,
  29610. u.allocUnsafeSlow = function(e) {
  29611. return a(null, e)
  29612. }
  29613. ,
  29614. u.isBuffer = function(e) {
  29615. return !(null == e || !e._isBuffer)
  29616. }
  29617. ,
  29618. u.compare = function(e, t) {
  29619. if (!u.isBuffer(e) || !u.isBuffer(t))
  29620. throw new TypeError("Arguments must be Buffers");
  29621. if (e === t)
  29622. return 0;
  29623. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29624. if (e[r] !== t[r]) {
  29625. i = e[r],
  29626. n = t[r];
  29627. break
  29628. }
  29629. return i < n ? -1 : n < i ? 1 : 0
  29630. }
  29631. ,
  29632. u.isEncoding = function(e) {
  29633. switch (String(e).toLowerCase()) {
  29634. case "hex":
  29635. case "utf8":
  29636. case "utf-8":
  29637. case "ascii":
  29638. case "latin1":
  29639. case "binary":
  29640. case "base64":
  29641. case "ucs2":
  29642. case "ucs-2":
  29643. case "utf16le":
  29644. case "utf-16le":
  29645. return !0;
  29646. default:
  29647. return !1
  29648. }
  29649. }
  29650. ,
  29651. u.concat = function(e, t) {
  29652. if (!L(e))
  29653. throw new TypeError('"list" argument must be an Array of Buffers');
  29654. if (0 === e.length)
  29655. return u.alloc(0);
  29656. var i;
  29657. if (void 0 === t)
  29658. for (i = t = 0; i < e.length; ++i)
  29659. t += e[i].length;
  29660. var n = u.allocUnsafe(t)
  29661. , r = 0;
  29662. for (i = 0; i < e.length; ++i) {
  29663. var o = e[i];
  29664. if (!u.isBuffer(o))
  29665. throw new TypeError('"list" argument must be an Array of Buffers');
  29666. o.copy(n, r),
  29667. r += o.length
  29668. }
  29669. return n
  29670. }
  29671. ,
  29672. u.byteLength = c,
  29673. u.prototype._isBuffer = !0,
  29674. u.prototype.swap16 = function() {
  29675. var e = this.length;
  29676. if (e % 2 != 0)
  29677. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29678. for (var t = 0; t < e; t += 2)
  29679. h(this, t, t + 1);
  29680. return this
  29681. }
  29682. ,
  29683. u.prototype.swap32 = function() {
  29684. var e = this.length;
  29685. if (e % 4 != 0)
  29686. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29687. for (var t = 0; t < e; t += 4)
  29688. h(this, t, t + 3),
  29689. h(this, t + 1, t + 2);
  29690. return this
  29691. }
  29692. ,
  29693. u.prototype.swap64 = function() {
  29694. var e = this.length;
  29695. if (e % 8 != 0)
  29696. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29697. for (var t = 0; t < e; t += 8)
  29698. h(this, t, t + 7),
  29699. h(this, t + 1, t + 6),
  29700. h(this, t + 2, t + 5),
  29701. h(this, t + 3, t + 4);
  29702. return this
  29703. }
  29704. ,
  29705. u.prototype.toString = function() {
  29706. var e = 0 | this.length;
  29707. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  29708. var n, r, o, a = !1;
  29709. if ((void 0 === t || t < 0) && (t = 0),
  29710. t > this.length)
  29711. return "";
  29712. if ((void 0 === i || i > this.length) && (i = this.length),
  29713. i <= 0)
  29714. return "";
  29715. if ((i >>>= 0) <= (t >>>= 0))
  29716. return "";
  29717. for (e = e || "utf8"; ; )
  29718. switch (e) {
  29719. case "hex":
  29720. return A(this, t, i);
  29721. case "utf8":
  29722. case "utf-8":
  29723. return f(this, t, i);
  29724. case "ascii":
  29725. return v(this, t, i);
  29726. case "latin1":
  29727. case "binary":
  29728. return y(this, t, i);
  29729. case "base64":
  29730. return n = this,
  29731. o = i,
  29732. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  29733. case "ucs2":
  29734. case "ucs-2":
  29735. case "utf16le":
  29736. case "utf-16le":
  29737. return C(this, t, i);
  29738. default:
  29739. if (a)
  29740. throw new TypeError("Unknown encoding: " + e);
  29741. e = (e + "").toLowerCase(),
  29742. a = !0
  29743. }
  29744. }
  29745. .apply(this, arguments)
  29746. }
  29747. ,
  29748. u.prototype.equals = function(e) {
  29749. if (!u.isBuffer(e))
  29750. throw new TypeError("Argument must be a Buffer");
  29751. return this === e || 0 === u.compare(this, e)
  29752. }
  29753. ,
  29754. u.prototype.inspect = function() {
  29755. var e = ""
  29756. , t = F.INSPECT_MAX_BYTES;
  29757. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29758. this.length > t && (e += " ... ")),
  29759. "<Buffer " + e + ">"
  29760. }
  29761. ,
  29762. u.prototype.compare = function(e, t, i, n, r) {
  29763. if (!u.isBuffer(e))
  29764. throw new TypeError("Argument must be a Buffer");
  29765. if (void 0 === t && (t = 0),
  29766. void 0 === i && (i = e ? e.length : 0),
  29767. void 0 === n && (n = 0),
  29768. void 0 === r && (r = this.length),
  29769. t < 0 || i > e.length || n < 0 || r > this.length)
  29770. throw new RangeError("out of range index");
  29771. if (r <= n && i <= t)
  29772. return 0;
  29773. if (r <= n)
  29774. return -1;
  29775. if (i <= t)
  29776. return 1;
  29777. if (this === e)
  29778. return 0;
  29779. for (var o = (r >>>= 0) - (n >>>= 0), a = (i >>>= 0) - (t >>>= 0), s = Math.min(o, a), l = this.slice(n, r), c = e.slice(t, i), h = 0; h < s; ++h)
  29780. if (l[h] !== c[h]) {
  29781. o = l[h],
  29782. a = c[h];
  29783. break
  29784. }
  29785. return o < a ? -1 : a < o ? 1 : 0
  29786. }
  29787. ,
  29788. u.prototype.includes = function(e, t, i) {
  29789. return -1 !== this.indexOf(e, t, i)
  29790. }
  29791. ,
  29792. u.prototype.indexOf = function(e, t, i) {
  29793. return d(this, e, t, i, !0)
  29794. }
  29795. ,
  29796. u.prototype.lastIndexOf = function(e, t, i) {
  29797. return d(this, e, t, i, !1)
  29798. }
  29799. ,
  29800. u.prototype.write = function(e, t, i, n) {
  29801. if (void 0 === t)
  29802. n = "utf8",
  29803. i = this.length,
  29804. t = 0;
  29805. else if (void 0 === i && "string" == typeof t)
  29806. n = t,
  29807. i = this.length,
  29808. t = 0;
  29809. else {
  29810. if (!isFinite(t))
  29811. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  29812. t |= 0,
  29813. isFinite(i) ? (i |= 0,
  29814. void 0 === n && (n = "utf8")) : (n = i,
  29815. i = void 0)
  29816. }
  29817. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  29818. if ((void 0 === i || p < i) && (i = p),
  29819. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  29820. throw new RangeError("Attempt to write outside buffer bounds");
  29821. n = n || "utf8";
  29822. for (var f = !1; ; )
  29823. switch (n) {
  29824. case "hex":
  29825. return g(this, e, t, i);
  29826. case "utf8":
  29827. case "utf-8":
  29828. return u = t,
  29829. d = i,
  29830. R(S(e, (h = this).length - u), h, u, d);
  29831. case "ascii":
  29832. return m(this, e, t, i);
  29833. case "latin1":
  29834. case "binary":
  29835. return m(this, e, t, i);
  29836. case "base64":
  29837. return s = this,
  29838. l = t,
  29839. c = i,
  29840. R(M(e), s, l, c);
  29841. case "ucs2":
  29842. case "ucs-2":
  29843. case "utf16le":
  29844. case "utf-16le":
  29845. return o = t,
  29846. a = i,
  29847. R(function(e, t) {
  29848. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  29849. i = e.charCodeAt(a),
  29850. n = i >> 8,
  29851. r = i % 256,
  29852. o.push(r),
  29853. o.push(n);
  29854. return o
  29855. }(e, (r = this).length - o), r, o, a);
  29856. default:
  29857. if (f)
  29858. throw new TypeError("Unknown encoding: " + n);
  29859. n = ("" + n).toLowerCase(),
  29860. f = !0
  29861. }
  29862. }
  29863. ,
  29864. u.prototype.toJSON = function() {
  29865. return {
  29866. type: "Buffer",
  29867. data: Array.prototype.slice.call(this._arr || this, 0)
  29868. }
  29869. }
  29870. ;
  29871. var D = 4096;
  29872. u.prototype.slice = function(e, t) {
  29873. var i, n = this.length;
  29874. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  29875. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  29876. t < e && (t = e),
  29877. u.TYPED_ARRAY_SUPPORT)
  29878. (i = this.subarray(e, t)).__proto__ = u.prototype;
  29879. else {
  29880. var r = t - e;
  29881. i = new u(r,void 0);
  29882. for (var o = 0; o < r; ++o)
  29883. i[o] = this[o + e]
  29884. }
  29885. return i
  29886. }
  29887. ,
  29888. u.prototype.readUIntLE = function(e, t, i) {
  29889. e |= 0,
  29890. t |= 0,
  29891. i || I(e, t, this.length);
  29892. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  29893. n += this[e + o] * r;
  29894. return n
  29895. }
  29896. ,
  29897. u.prototype.readUIntBE = function(e, t, i) {
  29898. e |= 0,
  29899. t |= 0,
  29900. i || I(e, t, this.length);
  29901. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  29902. n += this[e + --t] * r;
  29903. return n
  29904. }
  29905. ,
  29906. u.prototype.readUInt8 = function(e, t) {
  29907. return t || I(e, 1, this.length),
  29908. this[e]
  29909. }
  29910. ,
  29911. u.prototype.readUInt16LE = function(e, t) {
  29912. return t || I(e, 2, this.length),
  29913. this[e] | this[e + 1] << 8
  29914. }
  29915. ,
  29916. u.prototype.readUInt16BE = function(e, t) {
  29917. return t || I(e, 2, this.length),
  29918. this[e] << 8 | this[e + 1]
  29919. }
  29920. ,
  29921. u.prototype.readUInt32LE = function(e, t) {
  29922. return t || I(e, 4, this.length),
  29923. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  29924. }
  29925. ,
  29926. u.prototype.readUInt32BE = function(e, t) {
  29927. return t || I(e, 4, this.length),
  29928. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  29929. }
  29930. ,
  29931. u.prototype.readIntLE = function(e, t, i) {
  29932. e |= 0,
  29933. t |= 0,
  29934. i || I(e, t, this.length);
  29935. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  29936. n += this[e + o] * r;
  29937. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  29938. n
  29939. }
  29940. ,
  29941. u.prototype.readIntBE = function(e, t, i) {
  29942. e |= 0,
  29943. t |= 0,
  29944. i || I(e, t, this.length);
  29945. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  29946. o += this[e + --n] * r;
  29947. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  29948. o
  29949. }
  29950. ,
  29951. u.prototype.readInt8 = function(e, t) {
  29952. return t || I(e, 1, this.length),
  29953. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  29954. }
  29955. ,
  29956. u.prototype.readInt16LE = function(e, t) {
  29957. t || I(e, 2, this.length);
  29958. var i = this[e] | this[e + 1] << 8;
  29959. return 32768 & i ? 4294901760 | i : i
  29960. }
  29961. ,
  29962. u.prototype.readInt16BE = function(e, t) {
  29963. t || I(e, 2, this.length);
  29964. var i = this[e + 1] | this[e] << 8;
  29965. return 32768 & i ? 4294901760 | i : i
  29966. }
  29967. ,
  29968. u.prototype.readInt32LE = function(e, t) {
  29969. return t || I(e, 4, this.length),
  29970. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  29971. }
  29972. ,
  29973. u.prototype.readInt32BE = function(e, t) {
  29974. return t || I(e, 4, this.length),
  29975. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  29976. }
  29977. ,
  29978. u.prototype.readFloatLE = function(e, t) {
  29979. return t || I(e, 4, this.length),
  29980. O.read(this, e, !0, 23, 4)
  29981. }
  29982. ,
  29983. u.prototype.readFloatBE = function(e, t) {
  29984. return t || I(e, 4, this.length),
  29985. O.read(this, e, !1, 23, 4)
  29986. }
  29987. ,
  29988. u.prototype.readDoubleLE = function(e, t) {
  29989. return t || I(e, 8, this.length),
  29990. O.read(this, e, !0, 52, 8)
  29991. }
  29992. ,
  29993. u.prototype.readDoubleBE = function(e, t) {
  29994. return t || I(e, 8, this.length),
  29995. O.read(this, e, !1, 52, 8)
  29996. }
  29997. ,
  29998. u.prototype.writeUIntLE = function(e, t, i, n) {
  29999. e = +e,
  30000. t |= 0,
  30001. i |= 0,
  30002. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30003. var r = 1
  30004. , o = 0;
  30005. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30006. this[t + o] = e / r & 255;
  30007. return t + i
  30008. }
  30009. ,
  30010. u.prototype.writeUIntBE = function(e, t, i, n) {
  30011. e = +e,
  30012. t |= 0,
  30013. i |= 0,
  30014. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30015. var r = i - 1
  30016. , o = 1;
  30017. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30018. this[t + r] = e / o & 255;
  30019. return t + i
  30020. }
  30021. ,
  30022. u.prototype.writeUInt8 = function(e, t, i) {
  30023. return e = +e,
  30024. t |= 0,
  30025. i || E(this, e, t, 1, 255, 0),
  30026. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30027. this[t] = 255 & e,
  30028. t + 1
  30029. }
  30030. ,
  30031. u.prototype.writeUInt16LE = function(e, t, i) {
  30032. return e = +e,
  30033. t |= 0,
  30034. i || E(this, e, t, 2, 65535, 0),
  30035. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30036. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30037. t + 2
  30038. }
  30039. ,
  30040. u.prototype.writeUInt16BE = function(e, t, i) {
  30041. return e = +e,
  30042. t |= 0,
  30043. i || E(this, e, t, 2, 65535, 0),
  30044. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30045. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30046. t + 2
  30047. }
  30048. ,
  30049. u.prototype.writeUInt32LE = function(e, t, i) {
  30050. return e = +e,
  30051. t |= 0,
  30052. i || E(this, e, t, 4, 4294967295, 0),
  30053. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30054. this[t + 2] = e >>> 16,
  30055. this[t + 1] = e >>> 8,
  30056. this[t] = 255 & e) : b(this, e, t, !0),
  30057. t + 4
  30058. }
  30059. ,
  30060. u.prototype.writeUInt32BE = function(e, t, i) {
  30061. return e = +e,
  30062. t |= 0,
  30063. i || E(this, e, t, 4, 4294967295, 0),
  30064. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30065. this[t + 1] = e >>> 16,
  30066. this[t + 2] = e >>> 8,
  30067. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30068. t + 4
  30069. }
  30070. ,
  30071. u.prototype.writeIntLE = function(e, t, i, n) {
  30072. if (e = +e,
  30073. t |= 0,
  30074. !n) {
  30075. var r = Math.pow(2, 8 * i - 1);
  30076. E(this, e, t, i, r - 1, -r)
  30077. }
  30078. var o = 0
  30079. , a = 1
  30080. , s = 0;
  30081. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30082. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30083. this[t + o] = (e / a >> 0) - s & 255;
  30084. return t + i
  30085. }
  30086. ,
  30087. u.prototype.writeIntBE = function(e, t, i, n) {
  30088. if (e = +e,
  30089. t |= 0,
  30090. !n) {
  30091. var r = Math.pow(2, 8 * i - 1);
  30092. E(this, e, t, i, r - 1, -r)
  30093. }
  30094. var o = i - 1
  30095. , a = 1
  30096. , s = 0;
  30097. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30098. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30099. this[t + o] = (e / a >> 0) - s & 255;
  30100. return t + i
  30101. }
  30102. ,
  30103. u.prototype.writeInt8 = function(e, t, i) {
  30104. return e = +e,
  30105. t |= 0,
  30106. i || E(this, e, t, 1, 127, -128),
  30107. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30108. e < 0 && (e = 255 + e + 1),
  30109. this[t] = 255 & e,
  30110. t + 1
  30111. }
  30112. ,
  30113. u.prototype.writeInt16LE = function(e, t, i) {
  30114. return e = +e,
  30115. t |= 0,
  30116. i || E(this, e, t, 2, 32767, -32768),
  30117. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30118. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30119. t + 2
  30120. }
  30121. ,
  30122. u.prototype.writeInt16BE = function(e, t, i) {
  30123. return e = +e,
  30124. t |= 0,
  30125. i || E(this, e, t, 2, 32767, -32768),
  30126. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30127. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30128. t + 2
  30129. }
  30130. ,
  30131. u.prototype.writeInt32LE = function(e, t, i) {
  30132. return e = +e,
  30133. t |= 0,
  30134. i || E(this, e, t, 4, 2147483647, -2147483648),
  30135. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30136. this[t + 1] = e >>> 8,
  30137. this[t + 2] = e >>> 16,
  30138. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30139. t + 4
  30140. }
  30141. ,
  30142. u.prototype.writeInt32BE = function(e, t, i) {
  30143. return e = +e,
  30144. t |= 0,
  30145. i || E(this, e, t, 4, 2147483647, -2147483648),
  30146. e < 0 && (e = 4294967295 + e + 1),
  30147. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30148. this[t + 1] = e >>> 16,
  30149. this[t + 2] = e >>> 8,
  30150. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30151. t + 4
  30152. }
  30153. ,
  30154. u.prototype.writeFloatLE = function(e, t, i) {
  30155. return T(this, e, t, !0, i)
  30156. }
  30157. ,
  30158. u.prototype.writeFloatBE = function(e, t, i) {
  30159. return T(this, e, t, !1, i)
  30160. }
  30161. ,
  30162. u.prototype.writeDoubleLE = function(e, t, i) {
  30163. return x(this, e, t, !0, i)
  30164. }
  30165. ,
  30166. u.prototype.writeDoubleBE = function(e, t, i) {
  30167. return x(this, e, t, !1, i)
  30168. }
  30169. ,
  30170. u.prototype.copy = function(e, t, i, n) {
  30171. if (i = i || 0,
  30172. n || 0 === n || (n = this.length),
  30173. t >= e.length && (t = e.length),
  30174. t = t || 0,
  30175. 0 < n && n < i && (n = i),
  30176. n === i)
  30177. return 0;
  30178. if (0 === e.length || 0 === this.length)
  30179. return 0;
  30180. if (t < 0)
  30181. throw new RangeError("targetStart out of bounds");
  30182. if (i < 0 || i >= this.length)
  30183. throw new RangeError("sourceStart out of bounds");
  30184. if (n < 0)
  30185. throw new RangeError("sourceEnd out of bounds");
  30186. n > this.length && (n = this.length),
  30187. e.length - t < n - i && (n = e.length - t + i);
  30188. var r, o = n - i;
  30189. if (this === e && i < t && t < n)
  30190. for (r = o - 1; 0 <= r; --r)
  30191. e[r + t] = this[r + i];
  30192. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30193. for (r = 0; r < o; ++r)
  30194. e[r + t] = this[r + i];
  30195. else
  30196. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30197. return o
  30198. }
  30199. ,
  30200. u.prototype.fill = function(e, t, i, n) {
  30201. if ("string" == typeof e) {
  30202. if ("string" == typeof t ? (n = t,
  30203. t = 0,
  30204. i = this.length) : "string" == typeof i && (n = i,
  30205. i = this.length),
  30206. 1 === e.length) {
  30207. var r = e.charCodeAt(0);
  30208. r < 256 && (e = r)
  30209. }
  30210. if (void 0 !== n && "string" != typeof n)
  30211. throw new TypeError("encoding must be a string");
  30212. if ("string" == typeof n && !u.isEncoding(n))
  30213. throw new TypeError("Unknown encoding: " + n)
  30214. } else
  30215. "number" == typeof e && (e &= 255);
  30216. if (t < 0 || this.length < t || this.length < i)
  30217. throw new RangeError("Out of range index");
  30218. if (i <= t)
  30219. return this;
  30220. var o;
  30221. if (t >>>= 0,
  30222. i = void 0 === i ? this.length : i >>> 0,
  30223. "number" == typeof (e = e || 0))
  30224. for (o = t; o < i; ++o)
  30225. this[o] = e;
  30226. else {
  30227. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30228. , s = a.length;
  30229. for (o = 0; o < i - t; ++o)
  30230. this[o + t] = a[o % s]
  30231. }
  30232. return this
  30233. }
  30234. ;
  30235. var t = /[^+\/0-9A-Za-z-_]/g
  30236. }
  30237. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30238. }
  30239. , {
  30240. "base64-js": 199,
  30241. ieee754: 200,
  30242. isarray: 201
  30243. }],
  30244. 199: [function(e, t, i) {
  30245. "use strict";
  30246. function l(e) {
  30247. var t = e.length;
  30248. if (0 < t % 4)
  30249. throw new Error("Invalid string. Length must be a multiple of 4");
  30250. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30251. }
  30252. function c(e, t, i) {
  30253. for (var n, r = [], o = t; o < i; o += 3)
  30254. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30255. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30256. var a;
  30257. return r.join("")
  30258. }
  30259. i.byteLength = function(e) {
  30260. return 3 * e.length / 4 - l(e)
  30261. }
  30262. ,
  30263. i.toByteArray = function(e) {
  30264. var t, i, n, r, o, a = e.length;
  30265. r = l(e),
  30266. o = new d(3 * a / 4 - r),
  30267. i = 0 < r ? a - 4 : a;
  30268. var s = 0;
  30269. for (t = 0; t < i; t += 4,
  30270. 3)
  30271. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30272. o[s++] = n >> 16 & 255,
  30273. o[s++] = n >> 8 & 255,
  30274. o[s++] = 255 & n;
  30275. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30276. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30277. o[s++] = n >> 8 & 255,
  30278. o[s++] = 255 & n),
  30279. o
  30280. }
  30281. ,
  30282. i.fromByteArray = function(e) {
  30283. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30284. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30285. return 1 == n ? (t = e[i - 1],
  30286. r += h[t >> 2],
  30287. r += h[t << 4 & 63],
  30288. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30289. r += h[t >> 10],
  30290. r += h[t >> 4 & 63],
  30291. r += h[t << 2 & 63],
  30292. r += "="),
  30293. o.push(r),
  30294. o.join("")
  30295. }
  30296. ;
  30297. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30298. h[r] = n[r],
  30299. u[n.charCodeAt(r)] = r;
  30300. u["-".charCodeAt(0)] = 62,
  30301. u["_".charCodeAt(0)] = 63
  30302. }
  30303. , {}],
  30304. 200: [function(e, t, i) {
  30305. i.read = function(e, t, i, n, r) {
  30306. 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];
  30307. for (u += d,
  30308. o = p & (1 << -h) - 1,
  30309. p >>= -h,
  30310. h += s; 0 < h; o = 256 * o + e[t + u],
  30311. u += d,
  30312. h -= 8)
  30313. ;
  30314. for (a = o & (1 << -h) - 1,
  30315. o >>= -h,
  30316. h += n; 0 < h; a = 256 * a + e[t + u],
  30317. u += d,
  30318. h -= 8)
  30319. ;
  30320. if (0 === o)
  30321. o = 1 - c;
  30322. else {
  30323. if (o === l)
  30324. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30325. a += Math.pow(2, n),
  30326. o -= c
  30327. }
  30328. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30329. }
  30330. ,
  30331. i.write = function(e, t, i, n, r, o) {
  30332. 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;
  30333. for (t = Math.abs(t),
  30334. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30335. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30336. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30337. l *= 2),
  30338. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30339. l /= 2),
  30340. h <= a + u ? (s = 0,
  30341. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30342. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30343. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30344. p += f,
  30345. s /= 256,
  30346. r -= 8)
  30347. ;
  30348. for (a = a << r | s,
  30349. c += r; 0 < c; e[i + p] = 255 & a,
  30350. p += f,
  30351. a /= 256,
  30352. c -= 8)
  30353. ;
  30354. e[i + p - f] |= 128 * g
  30355. }
  30356. }
  30357. , {}],
  30358. 201: [function(e, t, i) {
  30359. var n = {}.toString;
  30360. t.exports = Array.isArray || function(e) {
  30361. return "[object Array]" == n.call(e)
  30362. }
  30363. }
  30364. , {}],
  30365. 202: [function(e, t, i) {
  30366. function n() {
  30367. this._events = this._events || {},
  30368. this._maxListeners = this._maxListeners || void 0
  30369. }
  30370. function l(e) {
  30371. return "function" == typeof e
  30372. }
  30373. function c(e) {
  30374. return "object" == typeof e && null !== e
  30375. }
  30376. function h(e) {
  30377. return void 0 === e
  30378. }
  30379. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30380. n.prototype._maxListeners = void 0,
  30381. n.defaultMaxListeners = 10,
  30382. n.prototype.setMaxListeners = function(e) {
  30383. if (!function(e) {
  30384. return "number" == typeof e
  30385. }(e) || e < 0 || isNaN(e))
  30386. throw TypeError("n must be a positive number");
  30387. return this._maxListeners = e,
  30388. this
  30389. }
  30390. ,
  30391. n.prototype.emit = function(e) {
  30392. var t, i, n, r, o, a;
  30393. if (this._events || (this._events = {}),
  30394. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30395. if ((t = arguments[1])instanceof Error)
  30396. throw t;
  30397. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30398. throw s.context = t,
  30399. s
  30400. }
  30401. if (h(i = this._events[e]))
  30402. return !1;
  30403. if (l(i))
  30404. switch (arguments.length) {
  30405. case 1:
  30406. i.call(this);
  30407. break;
  30408. case 2:
  30409. i.call(this, arguments[1]);
  30410. break;
  30411. case 3:
  30412. i.call(this, arguments[1], arguments[2]);
  30413. break;
  30414. default:
  30415. r = Array.prototype.slice.call(arguments, 1),
  30416. i.apply(this, r)
  30417. }
  30418. else if (c(i))
  30419. for (r = Array.prototype.slice.call(arguments, 1),
  30420. n = (a = i.slice()).length,
  30421. o = 0; o < n; o++)
  30422. a[o].apply(this, r);
  30423. return !0
  30424. }
  30425. ,
  30426. n.prototype.on = n.prototype.addListener = function(e, t) {
  30427. var i;
  30428. if (!l(t))
  30429. throw TypeError("listener must be a function");
  30430. return this._events || (this._events = {}),
  30431. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30432. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30433. c(this._events[e]) && !this._events[e].warned && ((i = h(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners) && 0 < i && this._events[e].length > i && (this._events[e].warned = !0,
  30434. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30435. "function" == typeof console.trace && console.trace())),
  30436. this
  30437. }
  30438. ,
  30439. n.prototype.once = function(e, t) {
  30440. function i() {
  30441. this.removeListener(e, i),
  30442. n || (n = !0,
  30443. t.apply(this, arguments))
  30444. }
  30445. if (!l(t))
  30446. throw TypeError("listener must be a function");
  30447. var n = !1;
  30448. return i.listener = t,
  30449. this.on(e, i),
  30450. this
  30451. }
  30452. ,
  30453. n.prototype.removeListener = function(e, t) {
  30454. var i, n, r, o;
  30455. if (!l(t))
  30456. throw TypeError("listener must be a function");
  30457. if (!this._events || !this._events[e])
  30458. return this;
  30459. if (r = (i = this._events[e]).length,
  30460. n = -1,
  30461. i === t || l(i.listener) && i.listener === t)
  30462. delete this._events[e],
  30463. this._events.removeListener && this.emit("removeListener", e, t);
  30464. else if (c(i)) {
  30465. for (o = r; 0 < o--; )
  30466. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30467. n = o;
  30468. break
  30469. }
  30470. if (n < 0)
  30471. return this;
  30472. 1 === i.length ? (i.length = 0,
  30473. delete this._events[e]) : i.splice(n, 1),
  30474. this._events.removeListener && this.emit("removeListener", e, t)
  30475. }
  30476. return this
  30477. }
  30478. ,
  30479. n.prototype.removeAllListeners = function(e) {
  30480. var t, i;
  30481. if (!this._events)
  30482. return this;
  30483. if (!this._events.removeListener)
  30484. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30485. this;
  30486. if (0 === arguments.length) {
  30487. for (t in this._events)
  30488. "removeListener" !== t && this.removeAllListeners(t);
  30489. return this.removeAllListeners("removeListener"),
  30490. this._events = {},
  30491. this
  30492. }
  30493. if (l(i = this._events[e]))
  30494. this.removeListener(e, i);
  30495. else if (i)
  30496. for (; i.length; )
  30497. this.removeListener(e, i[i.length - 1]);
  30498. return delete this._events[e],
  30499. this
  30500. }
  30501. ,
  30502. n.prototype.listeners = function(e) {
  30503. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30504. }
  30505. ,
  30506. n.prototype.listenerCount = function(e) {
  30507. if (this._events) {
  30508. var t = this._events[e];
  30509. if (l(t))
  30510. return 1;
  30511. if (t)
  30512. return t.length
  30513. }
  30514. return 0
  30515. }
  30516. ,
  30517. n.listenerCount = function(e, t) {
  30518. return e.listenerCount(t)
  30519. }
  30520. }
  30521. , {}],
  30522. 203: [function(e, t, i) {
  30523. function n() {
  30524. throw new Error("setTimeout has not been defined")
  30525. }
  30526. function r() {
  30527. throw new Error("clearTimeout has not been defined")
  30528. }
  30529. function o(t) {
  30530. if (h === setTimeout)
  30531. return setTimeout(t, 0);
  30532. if ((h === n || !h) && setTimeout)
  30533. return h = setTimeout,
  30534. setTimeout(t, 0);
  30535. try {
  30536. return h(t, 0)
  30537. } catch (e) {
  30538. try {
  30539. return h.call(null, t, 0)
  30540. } catch (e) {
  30541. return h.call(this, t, 0)
  30542. }
  30543. }
  30544. }
  30545. function a() {
  30546. g && p && (g = !1,
  30547. p.length ? f = p.concat(f) : m = -1,
  30548. f.length && s())
  30549. }
  30550. function s() {
  30551. if (!g) {
  30552. var e = o(a);
  30553. g = !0;
  30554. for (var t = f.length; t; ) {
  30555. for (p = f,
  30556. f = []; ++m < t; )
  30557. p && p[m].run();
  30558. m = -1,
  30559. t = f.length
  30560. }
  30561. p = null,
  30562. g = !1,
  30563. function(t) {
  30564. if (u === clearTimeout)
  30565. return clearTimeout(t);
  30566. if ((u === r || !u) && clearTimeout)
  30567. return u = clearTimeout,
  30568. clearTimeout(t);
  30569. try {
  30570. u(t)
  30571. } catch (e) {
  30572. try {
  30573. return u.call(null, t)
  30574. } catch (e) {
  30575. return u.call(this, t)
  30576. }
  30577. }
  30578. }(e)
  30579. }
  30580. }
  30581. function l(e, t) {
  30582. this.fun = e,
  30583. this.array = t
  30584. }
  30585. function c() {}
  30586. var h, u, d = t.exports = {};
  30587. !function() {
  30588. try {
  30589. h = "function" == typeof setTimeout ? setTimeout : n
  30590. } catch (e) {
  30591. h = n
  30592. }
  30593. try {
  30594. u = "function" == typeof clearTimeout ? clearTimeout : r
  30595. } catch (e) {
  30596. u = r
  30597. }
  30598. }();
  30599. var p, f = [], g = !1, m = -1;
  30600. d.nextTick = function(e) {
  30601. var t = new Array(arguments.length - 1);
  30602. if (1 < arguments.length)
  30603. for (var i = 1; i < arguments.length; i++)
  30604. t[i - 1] = arguments[i];
  30605. f.push(new l(e,t)),
  30606. 1 !== f.length || g || o(s)
  30607. }
  30608. ,
  30609. l.prototype.run = function() {
  30610. this.fun.apply(null, this.array)
  30611. }
  30612. ,
  30613. d.title = "browser",
  30614. d.browser = !0,
  30615. d.env = {},
  30616. d.argv = [],
  30617. d.version = "",
  30618. d.versions = {},
  30619. d.on = c,
  30620. d.addListener = c,
  30621. d.once = c,
  30622. d.off = c,
  30623. d.removeListener = c,
  30624. d.removeAllListeners = c,
  30625. d.emit = c,
  30626. d.binding = function(e) {
  30627. throw new Error("process.binding is not supported")
  30628. }
  30629. ,
  30630. d.cwd = function() {
  30631. return "/"
  30632. }
  30633. ,
  30634. d.chdir = function(e) {
  30635. throw new Error("process.chdir is not supported")
  30636. }
  30637. ,
  30638. d.umask = function() {
  30639. return 0
  30640. }
  30641. }
  30642. , {}],
  30643. 204: [function(e, O, L) {
  30644. (function(P) {
  30645. !function(e) {
  30646. function v(e) {
  30647. throw new RangeError(g[e])
  30648. }
  30649. function r(e, t) {
  30650. for (var i = e.length, n = []; i--; )
  30651. n[i] = t(e[i]);
  30652. return n
  30653. }
  30654. function t(e, t) {
  30655. var i = e.split("@")
  30656. , n = "";
  30657. return 1 < i.length && (n = i[0] + "@",
  30658. e = i[1]),
  30659. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  30660. }
  30661. function y(e) {
  30662. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30663. 55296 <= (t = e.charCodeAt(r++)) && t <= 56319 && r < o ? 56320 == (64512 & (i = e.charCodeAt(r++))) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  30664. r--) : n.push(t);
  30665. return n
  30666. }
  30667. function A(e) {
  30668. return r(e, function(e) {
  30669. var t = "";
  30670. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  30671. e = 56320 | 1023 & e),
  30672. t + R(e)
  30673. }).join("")
  30674. }
  30675. function C(e, t) {
  30676. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30677. }
  30678. function I(e, t, i) {
  30679. var n = 0;
  30680. for (e = i ? M(e / u) : e >> 1,
  30681. e += M(e / t); m * w >> 1 < e; n += _)
  30682. e = M(e / m);
  30683. return M(n + (m + 1) * e / (e + h))
  30684. }
  30685. function i(e) {
  30686. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  30687. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  30688. n = 0; n < i; ++n)
  30689. 128 <= e.charCodeAt(n) && v("not-basic"),
  30690. d.push(e.charCodeAt(n));
  30691. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  30692. for (o = f,
  30693. a = 1,
  30694. s = _; p <= r && v("invalid-input"),
  30695. u = e.charCodeAt(r++),
  30696. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  30697. f += l * a,
  30698. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  30699. a > M(E / (h = _ - c)) && v("overflow"),
  30700. a *= h;
  30701. m = I(f - o, t = d.length + 1, 0 == o),
  30702. M(f / t) > E - g && v("overflow"),
  30703. g += M(f / t),
  30704. f %= t,
  30705. d.splice(f++, 0, g)
  30706. }
  30707. return A(d)
  30708. }
  30709. function n(e) {
  30710. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  30711. for (d = (e = y(e)).length,
  30712. t = x,
  30713. o = T,
  30714. a = i = 0; a < d; ++a)
  30715. (u = e[a]) < 128 && m.push(R(u));
  30716. for (n = r = m.length,
  30717. r && m.push(S); n < d; ) {
  30718. for (s = E,
  30719. a = 0; a < d; ++a)
  30720. t <= (u = e[a]) && u < s && (s = u);
  30721. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  30722. i += (s - t) * p,
  30723. t = s,
  30724. a = 0; a < d; ++a)
  30725. if ((u = e[a]) < t && ++i > E && v("overflow"),
  30726. u == t) {
  30727. for (l = i,
  30728. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  30729. g = l - h,
  30730. f = _ - h,
  30731. m.push(R(C(h + g % f, 0))),
  30732. l = M(g / f);
  30733. m.push(R(C(l, 0))),
  30734. o = I(i, p, n == r),
  30735. i = 0,
  30736. ++n
  30737. }
  30738. ++i,
  30739. ++t
  30740. }
  30741. return m.join("")
  30742. }
  30743. var o = "object" == typeof L && L && !L.nodeType && L
  30744. , a = "object" == typeof O && O && !O.nodeType && O
  30745. , s = "object" == typeof P && P;
  30746. s.global !== s && s.window !== s && s.self !== s || (e = s);
  30747. var l, c, E = 2147483647, _ = 36, b = 1, w = 26, h = 38, u = 700, T = 72, x = 128, S = "-", d = /^xn--/, p = /[^\x20-\x7E]/, f = /[\x2E\u3002\uFF0E\uFF61]/g, g = {
  30748. overflow: "Overflow: input needs wider integers to process",
  30749. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30750. "invalid-input": "Invalid input"
  30751. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  30752. if (l = {
  30753. version: "1.4.1",
  30754. ucs2: {
  30755. decode: y,
  30756. encode: A
  30757. },
  30758. decode: i,
  30759. encode: n,
  30760. toASCII: function(e) {
  30761. return t(e, function(e) {
  30762. return p.test(e) ? "xn--" + n(e) : e
  30763. })
  30764. },
  30765. toUnicode: function(e) {
  30766. return t(e, function(e) {
  30767. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  30768. })
  30769. }
  30770. },
  30771. "function" == typeof define && "object" == typeof define.amd && define.amd)
  30772. define("punycode", function() {
  30773. return l
  30774. });
  30775. else if (o && a)
  30776. if (O.exports == o)
  30777. a.exports = l;
  30778. else
  30779. for (c in l)
  30780. l.hasOwnProperty(c) && (o[c] = l[c]);
  30781. else
  30782. e.punycode = l
  30783. }(this)
  30784. }
  30785. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30786. }
  30787. , {}],
  30788. 205: [function(e, t, i) {
  30789. "use strict";
  30790. t.exports = function(e, t, i, n) {
  30791. t = t || "&",
  30792. i = i || "=";
  30793. var r = {};
  30794. if ("string" != typeof e || 0 === e.length)
  30795. return r;
  30796. var o = /\+/g;
  30797. e = e.split(t);
  30798. var a = 1e3;
  30799. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  30800. var s, l, c = e.length;
  30801. 0 < a && a < c && (c = a);
  30802. for (var h = 0; h < c; ++h) {
  30803. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  30804. d = 0 <= m ? (u = g.substr(0, m),
  30805. g.substr(m + 1)) : (u = g,
  30806. ""),
  30807. p = decodeURIComponent(u),
  30808. f = decodeURIComponent(d),
  30809. s = r,
  30810. l = p,
  30811. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  30812. }
  30813. return r
  30814. }
  30815. ;
  30816. var v = Array.isArray || function(e) {
  30817. return "[object Array]" === Object.prototype.toString.call(e)
  30818. }
  30819. }
  30820. , {}],
  30821. 206: [function(e, t, i) {
  30822. "use strict";
  30823. function o(e, t) {
  30824. if (e.map)
  30825. return e.map(t);
  30826. for (var i = [], n = 0; n < e.length; n++)
  30827. i.push(t(e[n], n));
  30828. return i
  30829. }
  30830. function a(e) {
  30831. switch (typeof e) {
  30832. case "string":
  30833. return e;
  30834. case "boolean":
  30835. return e ? "true" : "false";
  30836. case "number":
  30837. return isFinite(e) ? e : "";
  30838. default:
  30839. return ""
  30840. }
  30841. }
  30842. t.exports = function(i, n, r, e) {
  30843. return n = n || "&",
  30844. r = r || "=",
  30845. null === i && (i = void 0),
  30846. "object" == typeof i ? o(l(i), function(e) {
  30847. var t = encodeURIComponent(a(e)) + r;
  30848. return s(i[e]) ? o(i[e], function(e) {
  30849. return t + encodeURIComponent(a(e))
  30850. }).join(n) : t + encodeURIComponent(a(i[e]))
  30851. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  30852. }
  30853. ;
  30854. var s = Array.isArray || function(e) {
  30855. return "[object Array]" === Object.prototype.toString.call(e)
  30856. }
  30857. , l = Object.keys || function(e) {
  30858. var t = [];
  30859. for (var i in e)
  30860. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  30861. return t
  30862. }
  30863. }
  30864. , {}],
  30865. 207: [function(e, t, i) {
  30866. "use strict";
  30867. i.decode = i.parse = e("./decode"),
  30868. i.encode = i.stringify = e("./encode")
  30869. }
  30870. , {
  30871. "./decode": 205,
  30872. "./encode": 206
  30873. }],
  30874. 208: [function(e, t, i) {
  30875. "use strict";
  30876. function x() {
  30877. this.protocol = null,
  30878. this.slashes = null,
  30879. this.auth = null,
  30880. this.host = null,
  30881. this.port = null,
  30882. this.hostname = null,
  30883. this.hash = null,
  30884. this.search = null,
  30885. this.query = null,
  30886. this.pathname = null,
  30887. this.path = null,
  30888. this.href = null
  30889. }
  30890. function n(e, t, i) {
  30891. if (e && D.isObject(e) && e instanceof x)
  30892. return e;
  30893. var n = new x;
  30894. return n.parse(e, t, i),
  30895. n
  30896. }
  30897. var L = e("punycode")
  30898. , D = e("./util");
  30899. i.parse = n,
  30900. i.resolve = function(e, t) {
  30901. return n(e, !1, !0).resolve(t)
  30902. }
  30903. ,
  30904. i.resolveObject = function(e, t) {
  30905. return e ? n(e, !1, !0).resolveObject(t) : t
  30906. }
  30907. ,
  30908. i.format = function(e) {
  30909. return D.isString(e) && (e = n(e)),
  30910. e instanceof x ? e.format() : x.prototype.format.call(e)
  30911. }
  30912. ,
  30913. i.Url = x;
  30914. var N = /^([a-z0-9.+-]+:)/i
  30915. , r = /:[0-9]*$/
  30916. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  30917. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  30918. , B = ["'"].concat(o)
  30919. , V = ["%", "/", "?", ";", "#"].concat(B)
  30920. , k = ["/", "?", "#"]
  30921. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  30922. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  30923. , z = {
  30924. javascript: !0,
  30925. "javascript:": !0
  30926. }
  30927. , G = {
  30928. javascript: !0,
  30929. "javascript:": !0
  30930. }
  30931. , W = {
  30932. http: !0,
  30933. https: !0,
  30934. ftp: !0,
  30935. gopher: !0,
  30936. file: !0,
  30937. "http:": !0,
  30938. "https:": !0,
  30939. "ftp:": !0,
  30940. "gopher:": !0,
  30941. "file:": !0
  30942. }
  30943. , j = e("querystring");
  30944. x.prototype.parse = function(e, t, i) {
  30945. if (!D.isString(e))
  30946. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  30947. var n = e.indexOf("?")
  30948. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  30949. , o = e.split(r);
  30950. o[0] = o[0].replace(/\\/g, "/");
  30951. var a = e = o.join(r);
  30952. if (a = a.trim(),
  30953. !i && 1 === e.split("#").length) {
  30954. var s = F.exec(a);
  30955. if (s)
  30956. return this.path = a,
  30957. this.href = a,
  30958. this.pathname = s[1],
  30959. s[2] ? (this.search = s[2],
  30960. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  30961. this.query = {}),
  30962. this
  30963. }
  30964. var l = N.exec(a);
  30965. if (l) {
  30966. var c = (l = l[0]).toLowerCase();
  30967. this.protocol = c,
  30968. a = a.substr(l.length)
  30969. }
  30970. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  30971. var h = "//" === a.substr(0, 2);
  30972. !h || l && G[l] || (a = a.substr(2),
  30973. this.slashes = !0)
  30974. }
  30975. if (!G[l] && (h || l && !W[l])) {
  30976. for (var u = -1, d = 0; d < k.length; d++) {
  30977. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  30978. }
  30979. var p, f;
  30980. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  30981. a = a.slice(f + 1),
  30982. this.auth = decodeURIComponent(p)),
  30983. u = -1;
  30984. for (d = 0; d < V.length; d++) {
  30985. var g;
  30986. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  30987. }
  30988. -1 === u && (u = a.length),
  30989. this.host = a.slice(0, u),
  30990. a = a.slice(u),
  30991. this.parseHost(),
  30992. this.hostname = this.hostname || "";
  30993. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  30994. if (!m)
  30995. for (var v = this.hostname.split(/\./), y = (d = 0,
  30996. v.length); d < y; d++) {
  30997. var A = v[d];
  30998. if (A && !A.match(U)) {
  30999. for (var C = "", I = 0, E = A.length; I < E; I++)
  31000. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31001. if (!C.match(U)) {
  31002. var _ = v.slice(0, d)
  31003. , b = v.slice(d + 1)
  31004. , w = A.match(H);
  31005. w && (_.push(w[1]),
  31006. b.unshift(w[2])),
  31007. b.length && (a = "/" + b.join(".") + a),
  31008. this.hostname = _.join(".");
  31009. break
  31010. }
  31011. }
  31012. }
  31013. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31014. m || (this.hostname = L.toASCII(this.hostname));
  31015. var T = this.port ? ":" + this.port : ""
  31016. , x = this.hostname || "";
  31017. this.host = x + T,
  31018. this.href += this.host,
  31019. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31020. "/" !== a[0] && (a = "/" + a))
  31021. }
  31022. if (!z[c])
  31023. for (d = 0,
  31024. y = B.length; d < y; d++) {
  31025. var S = B[d];
  31026. if (-1 !== a.indexOf(S)) {
  31027. var M = encodeURIComponent(S);
  31028. M === S && (M = escape(S)),
  31029. a = a.split(S).join(M)
  31030. }
  31031. }
  31032. var R = a.indexOf("#");
  31033. -1 !== R && (this.hash = a.substr(R),
  31034. a = a.slice(0, R));
  31035. var P = a.indexOf("?");
  31036. if (-1 !== P ? (this.search = a.substr(P),
  31037. this.query = a.substr(P + 1),
  31038. t && (this.query = j.parse(this.query)),
  31039. a = a.slice(0, P)) : t && (this.search = "",
  31040. this.query = {}),
  31041. a && (this.pathname = a),
  31042. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31043. this.pathname || this.search) {
  31044. T = this.pathname || "";
  31045. var O = this.search || "";
  31046. this.path = T + O
  31047. }
  31048. return this.href = this.format(),
  31049. this
  31050. }
  31051. ,
  31052. x.prototype.format = function() {
  31053. var e = this.auth || "";
  31054. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31055. e += "@");
  31056. var t = this.protocol || ""
  31057. , i = this.pathname || ""
  31058. , n = this.hash || ""
  31059. , r = !1
  31060. , o = "";
  31061. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31062. this.port && (r += ":" + this.port)),
  31063. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31064. var a = this.search || o && "?" + o || "";
  31065. return t && ":" !== t.substr(-1) && (t += ":"),
  31066. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31067. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31068. n && "#" !== n.charAt(0) && (n = "#" + n),
  31069. a && "?" !== a.charAt(0) && (a = "?" + a),
  31070. t + r + (i = i.replace(/[?#]/g, function(e) {
  31071. return encodeURIComponent(e)
  31072. })) + (a = a.replace("#", "%23")) + n
  31073. }
  31074. ,
  31075. x.prototype.resolve = function(e) {
  31076. return this.resolveObject(n(e, !1, !0)).format()
  31077. }
  31078. ,
  31079. x.prototype.resolveObject = function(e) {
  31080. if (D.isString(e)) {
  31081. var t = new x;
  31082. t.parse(e, !1, !0),
  31083. e = t
  31084. }
  31085. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31086. var o = n[r];
  31087. i[o] = this[o]
  31088. }
  31089. if (i.hash = e.hash,
  31090. "" === e.href)
  31091. return i.href = i.format(),
  31092. i;
  31093. if (e.slashes && !e.protocol) {
  31094. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31095. var l = a[s];
  31096. "protocol" !== l && (i[l] = e[l])
  31097. }
  31098. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31099. i.href = i.format(),
  31100. i
  31101. }
  31102. if (e.protocol && e.protocol !== i.protocol) {
  31103. if (!W[e.protocol]) {
  31104. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31105. var u = c[h];
  31106. i[u] = e[u]
  31107. }
  31108. return i.href = i.format(),
  31109. i
  31110. }
  31111. if (i.protocol = e.protocol,
  31112. e.host || G[e.protocol])
  31113. i.pathname = e.pathname;
  31114. else {
  31115. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31116. ;
  31117. e.host || (e.host = ""),
  31118. e.hostname || (e.hostname = ""),
  31119. "" !== d[0] && d.unshift(""),
  31120. d.length < 2 && d.unshift(""),
  31121. i.pathname = d.join("/")
  31122. }
  31123. if (i.search = e.search,
  31124. i.query = e.query,
  31125. i.host = e.host || "",
  31126. i.auth = e.auth,
  31127. i.hostname = e.hostname || e.host,
  31128. i.port = e.port,
  31129. i.pathname || i.search) {
  31130. var p = i.pathname || ""
  31131. , f = i.search || "";
  31132. i.path = p + f
  31133. }
  31134. return i.slashes = i.slashes || e.slashes,
  31135. i.href = i.format(),
  31136. i
  31137. }
  31138. var g = i.pathname && "/" === i.pathname.charAt(0)
  31139. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31140. , v = m || g || i.host && e.pathname
  31141. , y = v
  31142. , A = i.pathname && i.pathname.split("/") || []
  31143. , C = (d = e.pathname && e.pathname.split("/") || [],
  31144. i.protocol && !W[i.protocol]);
  31145. if (C && (i.hostname = "",
  31146. i.port = null,
  31147. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31148. i.host = "",
  31149. e.protocol && (e.hostname = null,
  31150. e.port = null,
  31151. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31152. e.host = null),
  31153. v = v && ("" === d[0] || "" === A[0])),
  31154. m)
  31155. i.host = e.host || "" === e.host ? e.host : i.host,
  31156. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31157. i.search = e.search,
  31158. i.query = e.query,
  31159. A = d;
  31160. else if (d.length)
  31161. (A = A || []).pop(),
  31162. A = A.concat(d),
  31163. i.search = e.search,
  31164. i.query = e.query;
  31165. else if (!D.isNullOrUndefined(e.search)) {
  31166. if (C)
  31167. i.hostname = i.host = A.shift(),
  31168. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31169. i.host = i.hostname = w.shift());
  31170. return i.search = e.search,
  31171. i.query = e.query,
  31172. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31173. i.href = i.format(),
  31174. i
  31175. }
  31176. if (!A.length)
  31177. return i.pathname = null,
  31178. i.search ? i.path = "/" + i.search : i.path = null,
  31179. i.href = i.format(),
  31180. i;
  31181. for (var I = A.slice(-1)[0], E = (i.host || e.host || 1 < A.length) && ("." === I || ".." === I) || "" === I, _ = 0, b = A.length; 0 <= b; b--)
  31182. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31183. _++) : _ && (A.splice(b, 1),
  31184. _--);
  31185. if (!v && !y)
  31186. for (; _--; )
  31187. A.unshift("..");
  31188. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31189. E && "/" !== A.join("/").substr(-1) && A.push("");
  31190. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31191. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31192. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31193. i.host = i.hostname = w.shift()));
  31194. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31195. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31196. i.path = null),
  31197. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31198. i.auth = e.auth || i.auth,
  31199. i.slashes = i.slashes || e.slashes,
  31200. i.href = i.format(),
  31201. i
  31202. }
  31203. ,
  31204. x.prototype.parseHost = function() {
  31205. var e = this.host
  31206. , t = r.exec(e);
  31207. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31208. e = e.substr(0, e.length - t.length)),
  31209. e && (this.hostname = e)
  31210. }
  31211. }
  31212. , {
  31213. "./util": 209,
  31214. punycode: 204,
  31215. querystring: 207
  31216. }],
  31217. 209: [function(e, t, i) {
  31218. "use strict";
  31219. t.exports = {
  31220. isString: function(e) {
  31221. return "string" == typeof e
  31222. },
  31223. isObject: function(e) {
  31224. return "object" == typeof e && null !== e
  31225. },
  31226. isNull: function(e) {
  31227. return null === e
  31228. },
  31229. isNullOrUndefined: function(e) {
  31230. return null == e
  31231. }
  31232. }
  31233. }
  31234. , {}],
  31235. 210: [function(e, t, i) {
  31236. "use strict";
  31237. function r(e) {
  31238. return c + e
  31239. }
  31240. function s(e) {
  31241. if ("string" != typeof e)
  31242. throw new TypeError("key must be a string.")
  31243. }
  31244. var l = Object.prototype.hasOwnProperty
  31245. , c = "~";
  31246. t.exports = function(t) {
  31247. var o = Object.create(null)
  31248. , n = 0
  31249. , a = {};
  31250. return function(e, t) {
  31251. for (var i in t)
  31252. Object.defineProperty(e, i, {
  31253. value: t[i],
  31254. configurable: !0,
  31255. writable: !0
  31256. })
  31257. }(a, {
  31258. get: function(e, t) {
  31259. s(e);
  31260. var i = r(e);
  31261. return i in o ? o[i] : t
  31262. },
  31263. set: function(e, t) {
  31264. s(e);
  31265. var i = r(e);
  31266. return i in o || ++n,
  31267. o[i] = t
  31268. },
  31269. has: function(e) {
  31270. return s(e),
  31271. r(e)in o
  31272. },
  31273. delete: function(e) {
  31274. s(e);
  31275. var t = r(e);
  31276. return t in o && (--n,
  31277. delete o[t],
  31278. !0)
  31279. },
  31280. clear: function() {
  31281. o = Object.create(null),
  31282. n = 0
  31283. },
  31284. forEach: function(e, t) {
  31285. if ("function" != typeof e)
  31286. throw new TypeError("`callback` must be a function");
  31287. for (var i in o)
  31288. if (l.call(o, i)) {
  31289. var n = i.substring(c.length)
  31290. , r = o[i];
  31291. e.call(t, r, n, a)
  31292. }
  31293. }
  31294. }),
  31295. Object.defineProperty(a, "size", {
  31296. get: function() {
  31297. return n
  31298. },
  31299. configurable: !0
  31300. }),
  31301. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31302. a.set(e, t[e])
  31303. }),
  31304. a
  31305. }
  31306. }
  31307. , {}],
  31308. 211: [function(e, t, i) {
  31309. t.exports = e("./lib/heap")
  31310. }
  31311. , {
  31312. "./lib/heap": 212
  31313. }],
  31314. 212: [function(e, y, A) {
  31315. (function() {
  31316. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31317. function v(e) {
  31318. this.cmp = null != e ? e : d,
  31319. this.nodes = []
  31320. }
  31321. l = Math.floor,
  31322. m = Math.min,
  31323. d = function(e, t) {
  31324. return e < t ? -1 : t < e ? 1 : 0
  31325. }
  31326. ,
  31327. g = function(e, t, i, n, r) {
  31328. var o;
  31329. if (null == i && (i = 0),
  31330. null == r && (r = d),
  31331. i < 0)
  31332. throw new Error("lo must be non-negative");
  31333. for (null == n && (n = e.length); i < n; )
  31334. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31335. return [].splice.apply(e, [i, i - i].concat(t)),
  31336. t
  31337. }
  31338. ,
  31339. t = function(e, t, i) {
  31340. return null == i && (i = d),
  31341. e.push(t),
  31342. h(e, 0, e.length - 1, i)
  31343. }
  31344. ,
  31345. f = function(e, t) {
  31346. var i, n;
  31347. return null == t && (t = d),
  31348. i = e.pop(),
  31349. e.length ? (n = e[0],
  31350. e[0] = i,
  31351. u(e, 0, t)) : n = i,
  31352. n
  31353. }
  31354. ,
  31355. i = function(e, t, i) {
  31356. var n;
  31357. return null == i && (i = d),
  31358. n = e[0],
  31359. e[0] = t,
  31360. u(e, 0, i),
  31361. n
  31362. }
  31363. ,
  31364. c = function(e, t, i) {
  31365. var n;
  31366. return null == i && (i = d),
  31367. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31368. e[0] = n[1],
  31369. u(e, 0, i)),
  31370. t
  31371. }
  31372. ,
  31373. p = function(i, e) {
  31374. var t, n, r, o, a, s;
  31375. for (null == e && (e = d),
  31376. a = [],
  31377. n = 0,
  31378. r = (o = function() {
  31379. s = [];
  31380. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31381. s.push(e);
  31382. return s
  31383. }
  31384. .apply(this).reverse()).length; n < r; n++)
  31385. t = o[n],
  31386. a.push(u(i, t, e));
  31387. return a
  31388. }
  31389. ,
  31390. o = function(e, t, i) {
  31391. var n;
  31392. if (null == i && (i = d),
  31393. -1 !== (n = e.indexOf(t)))
  31394. return h(e, 0, n, i),
  31395. u(e, n, i)
  31396. }
  31397. ,
  31398. n = function(e, t, i) {
  31399. var n, r, o, a, s;
  31400. if (null == i && (i = d),
  31401. !(r = e.slice(0, t)).length)
  31402. return r;
  31403. for (p(r, i),
  31404. o = 0,
  31405. a = (s = e.slice(t)).length; o < a; o++)
  31406. n = s[o],
  31407. c(r, n, i);
  31408. return r.sort(i).reverse()
  31409. }
  31410. ,
  31411. r = function(e, t, i) {
  31412. var n, r, o, a, s, l, c, h, u;
  31413. if (null == i && (i = d),
  31414. 10 * t <= e.length) {
  31415. if (!(o = e.slice(0, t).sort(i)).length)
  31416. return o;
  31417. for (r = o[o.length - 1],
  31418. a = 0,
  31419. l = (c = e.slice(t)).length; a < l; a++)
  31420. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31421. o.pop(),
  31422. r = o[o.length - 1]);
  31423. return o
  31424. }
  31425. for (p(e, i),
  31426. u = [],
  31427. s = 0,
  31428. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31429. u.push(f(e, i));
  31430. return u
  31431. }
  31432. ,
  31433. h = function(e, t, i, n) {
  31434. var r, o, a;
  31435. for (null == n && (n = d),
  31436. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31437. e[i] = o,
  31438. i = a;
  31439. return e[i] = r
  31440. }
  31441. ,
  31442. u = function(e, t, i) {
  31443. var n, r, o, a, s;
  31444. for (null == i && (i = d),
  31445. r = e.length,
  31446. o = e[s = t],
  31447. n = 2 * t + 1; n < r; )
  31448. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31449. e[t] = e[n],
  31450. n = 2 * (t = n) + 1;
  31451. return e[t] = o,
  31452. h(e, s, t, i)
  31453. }
  31454. ,
  31455. v.push = t,
  31456. v.pop = f,
  31457. v.replace = i,
  31458. v.pushpop = c,
  31459. v.heapify = p,
  31460. v.updateItem = o,
  31461. v.nlargest = n,
  31462. v.nsmallest = r,
  31463. v.prototype.push = function(e) {
  31464. return t(this.nodes, e, this.cmp)
  31465. }
  31466. ,
  31467. v.prototype.pop = function() {
  31468. return f(this.nodes, this.cmp)
  31469. }
  31470. ,
  31471. v.prototype.peek = function() {
  31472. return this.nodes[0]
  31473. }
  31474. ,
  31475. v.prototype.contains = function(e) {
  31476. return -1 !== this.nodes.indexOf(e)
  31477. }
  31478. ,
  31479. v.prototype.replace = function(e) {
  31480. return i(this.nodes, e, this.cmp)
  31481. }
  31482. ,
  31483. v.prototype.pushpop = function(e) {
  31484. return c(this.nodes, e, this.cmp)
  31485. }
  31486. ,
  31487. v.prototype.heapify = function() {
  31488. return p(this.nodes, this.cmp)
  31489. }
  31490. ,
  31491. v.prototype.updateItem = function(e) {
  31492. return o(this.nodes, e, this.cmp)
  31493. }
  31494. ,
  31495. v.prototype.clear = function() {
  31496. return this.nodes = []
  31497. }
  31498. ,
  31499. v.prototype.empty = function() {
  31500. return 0 === this.nodes.length
  31501. }
  31502. ,
  31503. v.prototype.size = function() {
  31504. return this.nodes.length
  31505. }
  31506. ,
  31507. v.prototype.clone = function() {
  31508. var e;
  31509. return (e = new v).nodes = this.nodes.slice(0),
  31510. e
  31511. }
  31512. ,
  31513. v.prototype.toArray = function() {
  31514. return this.nodes.slice(0)
  31515. }
  31516. ,
  31517. v.prototype.insert = v.prototype.push,
  31518. v.prototype.top = v.prototype.peek,
  31519. v.prototype.front = v.prototype.peek,
  31520. v.prototype.has = v.prototype.contains,
  31521. v.prototype.copy = v.prototype.clone,
  31522. e = v,
  31523. a = this,
  31524. s = function() {
  31525. return e
  31526. }
  31527. ,
  31528. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31529. }
  31530. ).call(this)
  31531. }
  31532. , {}],
  31533. 213: [function(e, t, i) {
  31534. function n() {}
  31535. function o(e) {
  31536. if ("object" != typeof this)
  31537. throw new TypeError("Promises must be constructed via new");
  31538. if ("function" != typeof e)
  31539. throw new TypeError("not a function");
  31540. this._state = 0,
  31541. this._handled = !1,
  31542. this._value = void 0,
  31543. this._deferreds = [],
  31544. h(e, this)
  31545. }
  31546. function r(i, n) {
  31547. for (; 3 === i._state; )
  31548. i = i._value;
  31549. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31550. void o._immediateFn(function() {
  31551. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31552. if (null !== e) {
  31553. var t;
  31554. try {
  31555. t = e(i._value)
  31556. } catch (e) {
  31557. return void s(n.promise, e)
  31558. }
  31559. a(n.promise, t)
  31560. } else
  31561. (1 === i._state ? a : s)(n.promise, i._value)
  31562. }))
  31563. }
  31564. function a(e, t) {
  31565. try {
  31566. if (t === e)
  31567. throw new TypeError("A promise cannot be resolved with itself.");
  31568. if (t && ("object" == typeof t || "function" == typeof t)) {
  31569. var i = t.then;
  31570. if (t instanceof o)
  31571. return e._state = 3,
  31572. e._value = t,
  31573. void l(e);
  31574. if ("function" == typeof i)
  31575. return void h(function(e, t) {
  31576. return function() {
  31577. e.apply(t, arguments)
  31578. }
  31579. }(i, t), e)
  31580. }
  31581. e._state = 1,
  31582. e._value = t,
  31583. l(e)
  31584. } catch (t) {
  31585. s(e, t)
  31586. }
  31587. }
  31588. function s(e, t) {
  31589. e._state = 2,
  31590. e._value = t,
  31591. l(e)
  31592. }
  31593. function l(e) {
  31594. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  31595. e._handled || o._unhandledRejectionFn(e._value)
  31596. });
  31597. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31598. r(e, e._deferreds[t]);
  31599. e._deferreds = null
  31600. }
  31601. function c(e, t, i) {
  31602. this.onFulfilled = "function" == typeof e ? e : null,
  31603. this.onRejected = "function" == typeof t ? t : null,
  31604. this.promise = i
  31605. }
  31606. function h(e, t) {
  31607. var i = !1;
  31608. try {
  31609. e(function(e) {
  31610. i || (i = !0,
  31611. a(t, e))
  31612. }, function(e) {
  31613. i || (i = !0,
  31614. s(t, e))
  31615. })
  31616. } catch (e) {
  31617. if (i)
  31618. return;
  31619. i = !0,
  31620. s(t, e)
  31621. }
  31622. }
  31623. var u, d;
  31624. u = this,
  31625. d = setTimeout,
  31626. o.prototype.catch = function(e) {
  31627. return this.then(null, e)
  31628. }
  31629. ,
  31630. o.prototype.then = function(e, t) {
  31631. var i = new this.constructor(n);
  31632. return r(this, new c(e,t,i)),
  31633. i
  31634. }
  31635. ,
  31636. o.all = function(e) {
  31637. var s = Array.prototype.slice.call(e);
  31638. return new o(function(n, r) {
  31639. function o(t, e) {
  31640. try {
  31641. if (e && ("object" == typeof e || "function" == typeof e)) {
  31642. var i = e.then;
  31643. if ("function" == typeof i)
  31644. return void i.call(e, function(e) {
  31645. o(t, e)
  31646. }, r)
  31647. }
  31648. s[t] = e,
  31649. 0 == --a && n(s)
  31650. } catch (e) {
  31651. r(e)
  31652. }
  31653. }
  31654. if (0 === s.length)
  31655. return n([]);
  31656. for (var a = s.length, e = 0; e < s.length; e++)
  31657. o(e, s[e])
  31658. }
  31659. )
  31660. }
  31661. ,
  31662. o.resolve = function(t) {
  31663. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  31664. e(t)
  31665. }
  31666. )
  31667. }
  31668. ,
  31669. o.reject = function(i) {
  31670. return new o(function(e, t) {
  31671. t(i)
  31672. }
  31673. )
  31674. }
  31675. ,
  31676. o.race = function(r) {
  31677. return new o(function(e, t) {
  31678. for (var i = 0, n = r.length; i < n; i++)
  31679. r[i].then(e, t)
  31680. }
  31681. )
  31682. }
  31683. ,
  31684. o._immediateFn = "function" == typeof setImmediate && function(e) {
  31685. setImmediate(e)
  31686. }
  31687. || function(e) {
  31688. d(e, 0)
  31689. }
  31690. ,
  31691. o._unhandledRejectionFn = function(e) {
  31692. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31693. }
  31694. ,
  31695. o._setImmediateFn = function(e) {
  31696. o._immediateFn = e
  31697. }
  31698. ,
  31699. o._setUnhandledRejectionFn = function(e) {
  31700. o._unhandledRejectionFn = e
  31701. }
  31702. ,
  31703. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  31704. }
  31705. , {}],
  31706. 214: [function(p, i, e) {
  31707. (function(d) {
  31708. var e, t;
  31709. e = this,
  31710. t = function(I, e) {
  31711. "use strict";
  31712. var a, t, u, i, s, n, r, o = {};
  31713. return o.ByteBuffer = I,
  31714. o.Long = I.Long || null,
  31715. o.VERSION = "5.0.1",
  31716. o.WIRE_TYPES = {},
  31717. o.WIRE_TYPES.VARINT = 0,
  31718. o.WIRE_TYPES.BITS64 = 1,
  31719. o.WIRE_TYPES.LDELIM = 2,
  31720. o.WIRE_TYPES.STARTGROUP = 3,
  31721. o.WIRE_TYPES.ENDGROUP = 4,
  31722. o.WIRE_TYPES.BITS32 = 5,
  31723. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  31724. o.TYPES = {
  31725. int32: {
  31726. name: "int32",
  31727. wireType: o.WIRE_TYPES.VARINT,
  31728. defaultValue: 0
  31729. },
  31730. uint32: {
  31731. name: "uint32",
  31732. wireType: o.WIRE_TYPES.VARINT,
  31733. defaultValue: 0
  31734. },
  31735. sint32: {
  31736. name: "sint32",
  31737. wireType: o.WIRE_TYPES.VARINT,
  31738. defaultValue: 0
  31739. },
  31740. int64: {
  31741. name: "int64",
  31742. wireType: o.WIRE_TYPES.VARINT,
  31743. defaultValue: o.Long ? o.Long.ZERO : void 0
  31744. },
  31745. uint64: {
  31746. name: "uint64",
  31747. wireType: o.WIRE_TYPES.VARINT,
  31748. defaultValue: o.Long ? o.Long.UZERO : void 0
  31749. },
  31750. sint64: {
  31751. name: "sint64",
  31752. wireType: o.WIRE_TYPES.VARINT,
  31753. defaultValue: o.Long ? o.Long.ZERO : void 0
  31754. },
  31755. bool: {
  31756. name: "bool",
  31757. wireType: o.WIRE_TYPES.VARINT,
  31758. defaultValue: !1
  31759. },
  31760. double: {
  31761. name: "double",
  31762. wireType: o.WIRE_TYPES.BITS64,
  31763. defaultValue: 0
  31764. },
  31765. string: {
  31766. name: "string",
  31767. wireType: o.WIRE_TYPES.LDELIM,
  31768. defaultValue: ""
  31769. },
  31770. bytes: {
  31771. name: "bytes",
  31772. wireType: o.WIRE_TYPES.LDELIM,
  31773. defaultValue: null
  31774. },
  31775. fixed32: {
  31776. name: "fixed32",
  31777. wireType: o.WIRE_TYPES.BITS32,
  31778. defaultValue: 0
  31779. },
  31780. sfixed32: {
  31781. name: "sfixed32",
  31782. wireType: o.WIRE_TYPES.BITS32,
  31783. defaultValue: 0
  31784. },
  31785. fixed64: {
  31786. name: "fixed64",
  31787. wireType: o.WIRE_TYPES.BITS64,
  31788. defaultValue: o.Long ? o.Long.UZERO : void 0
  31789. },
  31790. sfixed64: {
  31791. name: "sfixed64",
  31792. wireType: o.WIRE_TYPES.BITS64,
  31793. defaultValue: o.Long ? o.Long.ZERO : void 0
  31794. },
  31795. float: {
  31796. name: "float",
  31797. wireType: o.WIRE_TYPES.BITS32,
  31798. defaultValue: 0
  31799. },
  31800. enum: {
  31801. name: "enum",
  31802. wireType: o.WIRE_TYPES.VARINT,
  31803. defaultValue: 0
  31804. },
  31805. message: {
  31806. name: "message",
  31807. wireType: o.WIRE_TYPES.LDELIM,
  31808. defaultValue: null
  31809. },
  31810. group: {
  31811. name: "group",
  31812. wireType: o.WIRE_TYPES.STARTGROUP,
  31813. defaultValue: null
  31814. }
  31815. },
  31816. o.MAP_KEY_TYPES = [o.TYPES.int32, o.TYPES.sint32, o.TYPES.sfixed32, o.TYPES.uint32, o.TYPES.fixed32, o.TYPES.int64, o.TYPES.sint64, o.TYPES.sfixed64, o.TYPES.uint64, o.TYPES.fixed64, o.TYPES.bool, o.TYPES.string, o.TYPES.bytes],
  31817. o.ID_MIN = 1,
  31818. o.ID_MAX = 536870911,
  31819. o.convertFieldsToCamelCase = !1,
  31820. o.populateAccessors = !0,
  31821. o.populateDefaults = !0,
  31822. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  31823. r.XHR = function() {
  31824. for (var e = [function() {
  31825. return new XMLHttpRequest
  31826. }
  31827. , function() {
  31828. return new ActiveXObject("Msxml2.XMLHTTP")
  31829. }
  31830. , function() {
  31831. return new ActiveXObject("Msxml3.XMLHTTP")
  31832. }
  31833. , function() {
  31834. return new ActiveXObject("Microsoft.XMLHTTP")
  31835. }
  31836. ], t = null, i = 0; i < e.length; i++) {
  31837. try {
  31838. t = e[i]()
  31839. } catch (e) {
  31840. continue
  31841. }
  31842. break
  31843. }
  31844. if (!t)
  31845. throw Error("XMLHttpRequest is not supported");
  31846. return t
  31847. }
  31848. ,
  31849. r.fetch = function(e, i) {
  31850. if (i && "function" != typeof i && (i = null),
  31851. r.IS_NODE) {
  31852. var t = p("fs");
  31853. if (i)
  31854. t.readFile(e, function(e, t) {
  31855. i(e ? null : "" + t)
  31856. });
  31857. else
  31858. try {
  31859. return t.readFileSync(e)
  31860. } catch (e) {
  31861. return null
  31862. }
  31863. } else {
  31864. var n = r.XHR();
  31865. if (n.open("GET", e, !!i),
  31866. n.setRequestHeader("Accept", "text/plain"),
  31867. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  31868. !i)
  31869. return n.send(null),
  31870. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  31871. if (n.onreadystatechange = function() {
  31872. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  31873. }
  31874. ,
  31875. 4 == n.readyState)
  31876. return;
  31877. n.send(null)
  31878. }
  31879. }
  31880. ,
  31881. r.toCamelCase = function(e) {
  31882. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  31883. return t.toUpperCase()
  31884. })
  31885. }
  31886. ,
  31887. r),
  31888. o.Lang = {
  31889. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  31890. RULE: /^(?:required|optional|repeated|map)$/,
  31891. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  31892. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  31893. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  31894. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  31895. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  31896. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  31897. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  31898. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  31899. NUMBER_OCT: /^0[0-7]+$/,
  31900. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  31901. BOOL: /^(?:true|false)$/i,
  31902. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  31903. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  31904. WHITESPACE: /\s/,
  31905. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  31906. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  31907. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  31908. },
  31909. o.DotProto = function(r, a) {
  31910. function s(e, t) {
  31911. var i = -1
  31912. , n = 1;
  31913. if ("-" == e.charAt(0) && (n = -1,
  31914. e = e.substring(1)),
  31915. a.NUMBER_DEC.test(e))
  31916. i = parseInt(e);
  31917. else if (a.NUMBER_HEX.test(e))
  31918. i = parseInt(e.substring(2), 16);
  31919. else {
  31920. if (!a.NUMBER_OCT.test(e))
  31921. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  31922. i = parseInt(e.substring(1), 8)
  31923. }
  31924. if (i = n * i | 0,
  31925. !t && i < 0)
  31926. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  31927. return i
  31928. }
  31929. function o(e) {
  31930. var t = 1;
  31931. if ("-" == e.charAt(0) && (t = -1,
  31932. e = e.substring(1)),
  31933. a.NUMBER_DEC.test(e))
  31934. return t * parseInt(e, 10);
  31935. if (a.NUMBER_HEX.test(e))
  31936. return t * parseInt(e.substring(2), 16);
  31937. if (a.NUMBER_OCT.test(e))
  31938. return t * parseInt(e.substring(1), 8);
  31939. if ("inf" === e)
  31940. return t * (1 / 0);
  31941. if ("nan" === e)
  31942. return NaN;
  31943. if (a.NUMBER_FLT.test(e))
  31944. return t * parseFloat(e);
  31945. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  31946. }
  31947. function n(e, t, i) {
  31948. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  31949. e[t].push(i))
  31950. }
  31951. function t(e) {
  31952. this.source = e + "",
  31953. this.index = 0,
  31954. this.line = 1,
  31955. this.stack = [],
  31956. this._stringOpen = null
  31957. }
  31958. var e = {}
  31959. , i = t.prototype;
  31960. i._readString = function() {
  31961. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  31962. e.lastIndex = this.index - 1;
  31963. var t = e.exec(this.source);
  31964. if (!t)
  31965. throw Error("unterminated string");
  31966. return this.index = e.lastIndex,
  31967. this.stack.push(this._stringOpen),
  31968. this._stringOpen = null,
  31969. t[1]
  31970. }
  31971. ,
  31972. i.next = function() {
  31973. if (0 < this.stack.length)
  31974. return this.stack.shift();
  31975. if (this.index >= this.source.length)
  31976. return null;
  31977. if (null !== this._stringOpen)
  31978. return this._readString();
  31979. var e, t, i;
  31980. do {
  31981. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  31982. if ("\n" === i && ++this.line,
  31983. ++this.index === this.source.length)
  31984. return null;
  31985. if ("/" === this.source.charAt(this.index))
  31986. if (++this.index,
  31987. "/" === this.source.charAt(this.index)) {
  31988. for (; "\n" !== this.source.charAt(++this.index); )
  31989. if (this.index == this.source.length)
  31990. return null;
  31991. ++this.index,
  31992. ++this.line,
  31993. e = !0
  31994. } else {
  31995. if ("*" !== (i = this.source.charAt(this.index)))
  31996. return "/";
  31997. do {
  31998. if ("\n" === i && ++this.line,
  31999. ++this.index === this.source.length)
  32000. return null;
  32001. t = i,
  32002. i = this.source.charAt(this.index)
  32003. } while ("*" !== t || "/" !== i);++this.index,
  32004. e = !0
  32005. }
  32006. } while (e);if (this.index === this.source.length)
  32007. return null;
  32008. var n = this.index;
  32009. if (a.DELIM.lastIndex = 0,
  32010. !a.DELIM.test(this.source.charAt(n++)))
  32011. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32012. ++n;
  32013. var r = this.source.substring(this.index, this.index = n);
  32014. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32015. r
  32016. }
  32017. ,
  32018. i.peek = function() {
  32019. if (0 === this.stack.length) {
  32020. var e = this.next();
  32021. if (null === e)
  32022. return null;
  32023. this.stack.push(e)
  32024. }
  32025. return this.stack[0]
  32026. }
  32027. ,
  32028. i.skip = function(e) {
  32029. var t = this.next();
  32030. if (t !== e)
  32031. throw Error("illegal '" + t + "', '" + e + "' expected")
  32032. }
  32033. ,
  32034. i.omit = function(e) {
  32035. return this.peek() === e && (this.next(),
  32036. !0)
  32037. }
  32038. ,
  32039. i.toString = function() {
  32040. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32041. }
  32042. ,
  32043. e.Tokenizer = t;
  32044. function l(e) {
  32045. this.tn = new t(e),
  32046. this.proto3 = !1
  32047. }
  32048. var c = l.prototype;
  32049. return c.parse = function() {
  32050. var e, t, i = {
  32051. name: "[ROOT]",
  32052. package: null,
  32053. messages: [],
  32054. enums: [],
  32055. imports: [],
  32056. options: {},
  32057. services: []
  32058. }, n = !0;
  32059. try {
  32060. for (; e = this.tn.next(); )
  32061. switch (e) {
  32062. case "package":
  32063. if (!n || null !== i.package)
  32064. throw Error("unexpected 'package'");
  32065. if (e = this.tn.next(),
  32066. !a.TYPEREF.test(e))
  32067. throw Error("illegal package name: " + e);
  32068. this.tn.skip(";"),
  32069. i.package = e;
  32070. break;
  32071. case "import":
  32072. if (!n)
  32073. throw Error("unexpected 'import'");
  32074. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32075. e = this._readString(),
  32076. this.tn.skip(";"),
  32077. t || i.imports.push(e);
  32078. break;
  32079. case "syntax":
  32080. if (!n)
  32081. throw Error("unexpected 'syntax'");
  32082. this.tn.skip("="),
  32083. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32084. this.tn.skip(";");
  32085. break;
  32086. case "message":
  32087. this._parseMessage(i, null),
  32088. n = !1;
  32089. break;
  32090. case "enum":
  32091. this._parseEnum(i),
  32092. n = !1;
  32093. break;
  32094. case "option":
  32095. this._parseOption(i);
  32096. break;
  32097. case "service":
  32098. this._parseService(i);
  32099. break;
  32100. case "extend":
  32101. this._parseExtend(i);
  32102. break;
  32103. default:
  32104. throw Error("unexpected '" + e + "'")
  32105. }
  32106. } catch (e) {
  32107. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32108. e
  32109. }
  32110. return delete i.name,
  32111. i
  32112. }
  32113. ,
  32114. l.parse = function(e) {
  32115. return new l(e).parse()
  32116. }
  32117. ,
  32118. c._readString = function() {
  32119. var e, t, i = "";
  32120. do {
  32121. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32122. throw Error("illegal string delimiter: " + t);
  32123. i += this.tn.next(),
  32124. this.tn.skip(t),
  32125. e = this.tn.peek()
  32126. } while ('"' === e || '"' === e);return i
  32127. }
  32128. ,
  32129. c._readValue = function(e) {
  32130. var t = this.tn.peek();
  32131. if ('"' === t || "'" === t)
  32132. return this._readString();
  32133. if (this.tn.next(),
  32134. a.NUMBER.test(t))
  32135. return o(t);
  32136. if (a.BOOL.test(t))
  32137. return "true" === t.toLowerCase();
  32138. if (e && a.TYPEREF.test(t))
  32139. return t;
  32140. throw Error("illegal value: " + t)
  32141. }
  32142. ,
  32143. c._parseOption = function(e, t) {
  32144. var i = this.tn.next()
  32145. , n = !1;
  32146. if ("(" === i && (n = !0,
  32147. i = this.tn.next()),
  32148. !a.TYPEREF.test(i))
  32149. throw Error("illegal option name: " + i);
  32150. var r = i;
  32151. n && (this.tn.skip(")"),
  32152. r = "(" + r + ")",
  32153. i = this.tn.peek(),
  32154. a.FQTYPEREF.test(i) && (r += i,
  32155. this.tn.next())),
  32156. this.tn.skip("="),
  32157. this._parseOptionValue(e, r),
  32158. t || this.tn.skip(";")
  32159. }
  32160. ,
  32161. c._parseOptionValue = function(e, t) {
  32162. var i = this.tn.peek();
  32163. if ("{" !== i)
  32164. n(e.options, t, this._readValue(!0));
  32165. else
  32166. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32167. if (!a.NAME.test(i))
  32168. throw Error("illegal option name: " + t + "." + i);
  32169. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32170. }
  32171. }
  32172. ,
  32173. c._parseService = function(e) {
  32174. var t = this.tn.next();
  32175. if (!a.NAME.test(t))
  32176. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32177. var i = {
  32178. name: t,
  32179. rpc: {},
  32180. options: {}
  32181. };
  32182. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32183. if ("option" === t)
  32184. this._parseOption(i);
  32185. else {
  32186. if ("rpc" !== t)
  32187. throw Error("illegal service token: " + t);
  32188. this._parseServiceRPC(i)
  32189. }
  32190. this.tn.omit(";"),
  32191. e.services.push(i)
  32192. }
  32193. ,
  32194. c._parseServiceRPC = function(e) {
  32195. var t = this.tn.next();
  32196. if (!a.NAME.test(t))
  32197. throw Error("illegal rpc service method name: " + t);
  32198. var i = t
  32199. , n = {
  32200. request: null,
  32201. response: null,
  32202. request_stream: !1,
  32203. response_stream: !1,
  32204. options: {}
  32205. };
  32206. if (this.tn.skip("("),
  32207. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32208. t = this.tn.next()),
  32209. !a.TYPEREF.test(t))
  32210. throw Error("illegal rpc service request type: " + t);
  32211. if (n.request = t,
  32212. this.tn.skip(")"),
  32213. "returns" !== (t = this.tn.next()).toLowerCase())
  32214. throw Error("illegal rpc service request type delimiter: " + t);
  32215. if (this.tn.skip("("),
  32216. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32217. t = this.tn.next()),
  32218. n.response = t,
  32219. this.tn.skip(")"),
  32220. "{" === (t = this.tn.peek())) {
  32221. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32222. if ("option" !== t)
  32223. throw Error("illegal rpc service token: " + t);
  32224. this._parseOption(n)
  32225. }
  32226. this.tn.omit(";")
  32227. } else
  32228. this.tn.skip(";");
  32229. void 0 === e.rpc && (e.rpc = {}),
  32230. e.rpc[i] = n
  32231. }
  32232. ,
  32233. c._parseMessage = function(e, t) {
  32234. var i = !!t
  32235. , n = this.tn.next()
  32236. , r = {
  32237. name: "",
  32238. fields: [],
  32239. enums: [],
  32240. messages: [],
  32241. options: {},
  32242. services: [],
  32243. oneofs: {}
  32244. };
  32245. if (!a.NAME.test(n))
  32246. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32247. for (r.name = n,
  32248. i && (this.tn.skip("="),
  32249. t.id = s(this.tn.next()),
  32250. r.isGroup = !0),
  32251. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32252. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32253. if (a.RULE.test(n))
  32254. this._parseMessageField(r, n);
  32255. else if ("oneof" === n)
  32256. this._parseMessageOneOf(r);
  32257. else if ("enum" === n)
  32258. this._parseEnum(r);
  32259. else if ("message" === n)
  32260. this._parseMessage(r);
  32261. else if ("option" === n)
  32262. this._parseOption(r);
  32263. else if ("service" === n)
  32264. this._parseService(r);
  32265. else if ("extensions" === n)
  32266. r.extensions = this._parseExtensionRanges();
  32267. else if ("reserved" === n)
  32268. this._parseIgnored();
  32269. else if ("extend" === n)
  32270. this._parseExtend(r);
  32271. else {
  32272. if (!a.TYPEREF.test(n))
  32273. throw Error("illegal message token: " + n);
  32274. if (!this.proto3)
  32275. throw Error("illegal field rule: " + n);
  32276. this._parseMessageField(r, "optional", n)
  32277. }
  32278. return this.tn.omit(";"),
  32279. e.messages.push(r),
  32280. r
  32281. }
  32282. ,
  32283. c._parseIgnored = function() {
  32284. for (; ";" !== this.tn.peek(); )
  32285. this.tn.next();
  32286. this.tn.skip(";")
  32287. }
  32288. ,
  32289. c._parseMessageField = function(e, t, i) {
  32290. if (!a.RULE.test(t))
  32291. throw Error("illegal message field rule: " + t);
  32292. var n, r = {
  32293. rule: t,
  32294. type: "",
  32295. name: "",
  32296. options: {},
  32297. id: 0
  32298. };
  32299. if ("map" === t) {
  32300. if (i)
  32301. throw Error("illegal type: " + i);
  32302. if (this.tn.skip("<"),
  32303. n = this.tn.next(),
  32304. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32305. throw Error("illegal message field type: " + n);
  32306. if (r.keytype = n,
  32307. this.tn.skip(","),
  32308. n = this.tn.next(),
  32309. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32310. throw Error("illegal message field: " + n);
  32311. if (r.type = n,
  32312. this.tn.skip(">"),
  32313. n = this.tn.next(),
  32314. !a.NAME.test(n))
  32315. throw Error("illegal message field name: " + n);
  32316. r.name = n,
  32317. this.tn.skip("="),
  32318. r.id = s(this.tn.next()),
  32319. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32320. this.tn.skip(";")
  32321. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32322. var o = this._parseMessage(e, r);
  32323. if (!/^[A-Z]/.test(o.name))
  32324. throw Error("illegal group name: " + o.name);
  32325. r.type = o.name,
  32326. r.name = o.name.toLowerCase(),
  32327. this.tn.omit(";")
  32328. } else {
  32329. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32330. throw Error("illegal message field type: " + i);
  32331. if (r.type = i,
  32332. n = this.tn.next(),
  32333. !a.NAME.test(n))
  32334. throw Error("illegal message field name: " + n);
  32335. r.name = n,
  32336. this.tn.skip("="),
  32337. r.id = s(this.tn.next()),
  32338. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32339. this.tn.skip(";")
  32340. }
  32341. return e.fields.push(r),
  32342. r
  32343. }
  32344. ,
  32345. c._parseMessageOneOf = function(e) {
  32346. var t = this.tn.next();
  32347. if (!a.NAME.test(t))
  32348. throw Error("illegal oneof name: " + t);
  32349. var i, n = t, r = [];
  32350. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32351. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32352. r.push(i.id);
  32353. this.tn.omit(";"),
  32354. e.oneofs[n] = r
  32355. }
  32356. ,
  32357. c._parseFieldOptions = function(e) {
  32358. this.tn.skip("[");
  32359. for (var t = !0; "]" !== this.tn.peek(); )
  32360. t || this.tn.skip(","),
  32361. this._parseOption(e, !0),
  32362. t = !1;
  32363. this.tn.next()
  32364. }
  32365. ,
  32366. c._parseEnum = function(e) {
  32367. var t = {
  32368. name: "",
  32369. values: [],
  32370. options: {}
  32371. }
  32372. , i = this.tn.next();
  32373. if (!a.NAME.test(i))
  32374. throw Error("illegal name: " + i);
  32375. for (t.name = i,
  32376. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32377. if ("option" === i)
  32378. this._parseOption(t);
  32379. else {
  32380. if (!a.NAME.test(i))
  32381. throw Error("illegal name: " + i);
  32382. this.tn.skip("=");
  32383. var n = {
  32384. name: i,
  32385. id: s(this.tn.next(), !0)
  32386. };
  32387. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32388. options: {}
  32389. }),
  32390. this.tn.skip(";"),
  32391. t.values.push(n)
  32392. }
  32393. this.tn.omit(";"),
  32394. e.enums.push(t)
  32395. }
  32396. ,
  32397. c._parseExtensionRanges = function() {
  32398. var e, t, i, n = [];
  32399. do {
  32400. for (t = []; ; ) {
  32401. switch (e = this.tn.next()) {
  32402. case "min":
  32403. i = r.ID_MIN;
  32404. break;
  32405. case "max":
  32406. i = r.ID_MAX;
  32407. break;
  32408. default:
  32409. i = o(e)
  32410. }
  32411. if (t.push(i),
  32412. 2 === t.length)
  32413. break;
  32414. if ("to" !== this.tn.peek()) {
  32415. t.push(i);
  32416. break
  32417. }
  32418. this.tn.next()
  32419. }
  32420. n.push(t)
  32421. } while (this.tn.omit(","));return this.tn.skip(";"),
  32422. n
  32423. }
  32424. ,
  32425. c._parseExtend = function(e) {
  32426. var t = this.tn.next();
  32427. if (!a.TYPEREF.test(t))
  32428. throw Error("illegal extend reference: " + t);
  32429. var i = {
  32430. ref: t,
  32431. fields: []
  32432. };
  32433. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32434. if (a.RULE.test(t))
  32435. this._parseMessageField(i, t);
  32436. else {
  32437. if (!a.TYPEREF.test(t))
  32438. throw Error("illegal extend token: " + t);
  32439. if (!this.proto3)
  32440. throw Error("illegal field rule: " + t);
  32441. this._parseMessageField(i, "optional", t)
  32442. }
  32443. return this.tn.omit(";"),
  32444. e.messages.push(i),
  32445. i
  32446. }
  32447. ,
  32448. c.toString = function() {
  32449. return "Parser at line " + this.tn.line
  32450. }
  32451. ,
  32452. e.Parser = l,
  32453. e
  32454. }(o, o.Lang),
  32455. o.Reflect = function(g) {
  32456. function a(e, t) {
  32457. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32458. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32459. if ("string" == typeof e)
  32460. return g.Long.fromString(e, t || !1, 10);
  32461. if ("number" == typeof e)
  32462. return g.Long.fromNumber(e, t || !1);
  32463. throw Error("not convertible to Long")
  32464. }
  32465. function m(e, t) {
  32466. var i = t.readVarint32()
  32467. , n = 7 & i
  32468. , r = i >>> 3;
  32469. switch (n) {
  32470. case g.WIRE_TYPES.VARINT:
  32471. for (; 128 == (128 & (i = t.readUint8())); )
  32472. ;
  32473. break;
  32474. case g.WIRE_TYPES.BITS64:
  32475. t.offset += 8;
  32476. break;
  32477. case g.WIRE_TYPES.LDELIM:
  32478. i = t.readVarint32(),
  32479. t.offset += i;
  32480. break;
  32481. case g.WIRE_TYPES.STARTGROUP:
  32482. m(r, t);
  32483. break;
  32484. case g.WIRE_TYPES.ENDGROUP:
  32485. if (r === e)
  32486. return !1;
  32487. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32488. case g.WIRE_TYPES.BITS32:
  32489. t.offset += 4;
  32490. break;
  32491. default:
  32492. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32493. }
  32494. return !0
  32495. }
  32496. function h(e, t, i) {
  32497. this.builder = e,
  32498. this.parent = t,
  32499. this.name = i,
  32500. this.className
  32501. }
  32502. var s = {}
  32503. , e = h.prototype;
  32504. e.fqn = function() {
  32505. for (var e = this.name, t = this; null != (t = t.parent); )
  32506. e = t.name + "." + e;
  32507. return e
  32508. }
  32509. ,
  32510. e.toString = function(e) {
  32511. return (e ? this.className + " " : "") + this.fqn()
  32512. }
  32513. ,
  32514. e.build = function() {
  32515. throw Error(this.toString(!0) + " cannot be built directly")
  32516. }
  32517. ,
  32518. s.T = h;
  32519. function l(e, t, i, n, r) {
  32520. h.call(this, e, t, i),
  32521. this.className = "Namespace",
  32522. this.children = [],
  32523. this.options = n || {},
  32524. this.syntax = r || "proto2"
  32525. }
  32526. var t = l.prototype = Object.create(h.prototype);
  32527. t.getChildren = function(e) {
  32528. if (null == (e = e || null))
  32529. return this.children.slice();
  32530. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32531. this.children[i]instanceof e && t.push(this.children[i]);
  32532. return t
  32533. }
  32534. ,
  32535. t.addChild = function(e) {
  32536. var t;
  32537. if (t = this.getChild(e.name))
  32538. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32539. t.name = t.originalName;
  32540. else {
  32541. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32542. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32543. e.name = e.originalName
  32544. }
  32545. this.children.push(e)
  32546. }
  32547. ,
  32548. t.getChild = function(e) {
  32549. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32550. if (this.children[i][t] === e)
  32551. return this.children[i];
  32552. return null
  32553. }
  32554. ,
  32555. t.resolve = function(e, t) {
  32556. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32557. if ("" === n[o]) {
  32558. for (; null !== r.parent; )
  32559. r = r.parent;
  32560. o++
  32561. }
  32562. do {
  32563. do {
  32564. if (!(r instanceof s.Namespace)) {
  32565. r = null;
  32566. break
  32567. }
  32568. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32569. r = null;
  32570. break
  32571. }
  32572. r = i,
  32573. o++
  32574. } while (o < n.length);if (null != r)
  32575. break;
  32576. if (null !== this.parent)
  32577. return this.parent.resolve(e, t)
  32578. } while (null != r);return r
  32579. }
  32580. ,
  32581. t.qn = function(e) {
  32582. for (var t = [], i = e; t.unshift(i.name),
  32583. null !== (i = i.parent); )
  32584. ;
  32585. for (var n = 1; n <= t.length; n++) {
  32586. var r = t.slice(t.length - n);
  32587. if (e === this.resolve(r, e instanceof s.Namespace))
  32588. return r.join(".")
  32589. }
  32590. return e.fqn()
  32591. }
  32592. ,
  32593. t.build = function() {
  32594. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32595. (e = i[n])instanceof l && (t[e.name] = e.build());
  32596. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32597. value: this.buildOpt()
  32598. }),
  32599. t
  32600. }
  32601. ,
  32602. t.buildOpt = function() {
  32603. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32604. var r = t[i]
  32605. , o = this.options[t[i]];
  32606. e[r] = o
  32607. }
  32608. return e
  32609. }
  32610. ,
  32611. t.getOption = function(e) {
  32612. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32613. }
  32614. ,
  32615. s.Namespace = l;
  32616. function u(e, t, i, n) {
  32617. if (this.type = e,
  32618. this.resolvedType = t,
  32619. this.isMapKey = i,
  32620. this.syntax = n,
  32621. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  32622. throw Error("Invalid map key type: " + e.name)
  32623. }
  32624. var i = u.prototype;
  32625. u.defaultFieldValue = function(e) {
  32626. if ("string" == typeof e && (e = g.TYPES[e]),
  32627. void 0 === e.defaultValue)
  32628. throw Error("default value for type " + e.name + " is not supported");
  32629. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  32630. }
  32631. ,
  32632. i.verifyValue = function(t) {
  32633. function i(e, t) {
  32634. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  32635. }
  32636. var n = this;
  32637. switch (this.type) {
  32638. case g.TYPES.int32:
  32639. case g.TYPES.sint32:
  32640. case g.TYPES.sfixed32:
  32641. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32642. 4294967295 < t ? 0 | t : t;
  32643. case g.TYPES.uint32:
  32644. case g.TYPES.fixed32:
  32645. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32646. t < 0 ? t >>> 0 : t;
  32647. case g.TYPES.int64:
  32648. case g.TYPES.sint64:
  32649. case g.TYPES.sfixed64:
  32650. if (g.Long)
  32651. try {
  32652. return a(t, !1)
  32653. } catch (e) {
  32654. i(typeof t, e.message)
  32655. }
  32656. else
  32657. i(typeof t, "requires Long.js");
  32658. case g.TYPES.uint64:
  32659. case g.TYPES.fixed64:
  32660. if (g.Long)
  32661. try {
  32662. return a(t, !0)
  32663. } catch (e) {
  32664. i(typeof t, e.message)
  32665. }
  32666. else
  32667. i(typeof t, "requires Long.js");
  32668. case g.TYPES.bool:
  32669. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  32670. t;
  32671. case g.TYPES.float:
  32672. case g.TYPES.double:
  32673. return "number" != typeof t && i(typeof t, "not a number"),
  32674. t;
  32675. case g.TYPES.string:
  32676. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  32677. "" + t;
  32678. case g.TYPES.bytes:
  32679. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  32680. case g.TYPES.enum:
  32681. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  32682. for (o = 0; o < e.length; o++) {
  32683. if (e[o].name == t)
  32684. return e[o].id;
  32685. if (e[o].id == t)
  32686. return e[o].id
  32687. }
  32688. if ("proto3" === this.syntax)
  32689. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32690. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  32691. t;
  32692. i(t, "not a valid enum value");
  32693. case g.TYPES.group:
  32694. case g.TYPES.message:
  32695. if (t && "object" == typeof t || i(typeof t, "object expected"),
  32696. t instanceof this.resolvedType.clazz)
  32697. return t;
  32698. if (t instanceof g.Builder.Message) {
  32699. var r = {};
  32700. for (var o in t)
  32701. t.hasOwnProperty(o) && (r[o] = t[o]);
  32702. t = r
  32703. }
  32704. return new this.resolvedType.clazz(t)
  32705. }
  32706. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  32707. }
  32708. ,
  32709. i.calculateLength = function(e, t) {
  32710. if (null === t)
  32711. return 0;
  32712. var i;
  32713. switch (this.type) {
  32714. case g.TYPES.int32:
  32715. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  32716. case g.TYPES.uint32:
  32717. return I.calculateVarint32(t);
  32718. case g.TYPES.sint32:
  32719. return I.calculateVarint32(I.zigZagEncode32(t));
  32720. case g.TYPES.fixed32:
  32721. case g.TYPES.sfixed32:
  32722. case g.TYPES.float:
  32723. return 4;
  32724. case g.TYPES.int64:
  32725. case g.TYPES.uint64:
  32726. return I.calculateVarint64(t);
  32727. case g.TYPES.sint64:
  32728. return I.calculateVarint64(I.zigZagEncode64(t));
  32729. case g.TYPES.fixed64:
  32730. case g.TYPES.sfixed64:
  32731. return 8;
  32732. case g.TYPES.bool:
  32733. return 1;
  32734. case g.TYPES.enum:
  32735. return I.calculateVarint32(t);
  32736. case g.TYPES.double:
  32737. return 8;
  32738. case g.TYPES.string:
  32739. return i = I.calculateUTF8Bytes(t),
  32740. I.calculateVarint32(i) + i;
  32741. case g.TYPES.bytes:
  32742. if (t.remaining() < 0)
  32743. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32744. return I.calculateVarint32(t.remaining()) + t.remaining();
  32745. case g.TYPES.message:
  32746. return i = this.resolvedType.calculate(t),
  32747. I.calculateVarint32(i) + i;
  32748. case g.TYPES.group:
  32749. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  32750. }
  32751. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32752. }
  32753. ,
  32754. i.encodeValue = function(e, t, i) {
  32755. if (null === t)
  32756. return i;
  32757. switch (this.type) {
  32758. case g.TYPES.int32:
  32759. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  32760. break;
  32761. case g.TYPES.uint32:
  32762. i.writeVarint32(t);
  32763. break;
  32764. case g.TYPES.sint32:
  32765. i.writeVarint32ZigZag(t);
  32766. break;
  32767. case g.TYPES.fixed32:
  32768. i.writeUint32(t);
  32769. break;
  32770. case g.TYPES.sfixed32:
  32771. i.writeInt32(t);
  32772. break;
  32773. case g.TYPES.int64:
  32774. case g.TYPES.uint64:
  32775. i.writeVarint64(t);
  32776. break;
  32777. case g.TYPES.sint64:
  32778. i.writeVarint64ZigZag(t);
  32779. break;
  32780. case g.TYPES.fixed64:
  32781. i.writeUint64(t);
  32782. break;
  32783. case g.TYPES.sfixed64:
  32784. i.writeInt64(t);
  32785. break;
  32786. case g.TYPES.bool:
  32787. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  32788. break;
  32789. case g.TYPES.enum:
  32790. i.writeVarint32(t);
  32791. break;
  32792. case g.TYPES.float:
  32793. i.writeFloat32(t);
  32794. break;
  32795. case g.TYPES.double:
  32796. i.writeFloat64(t);
  32797. break;
  32798. case g.TYPES.string:
  32799. i.writeVString(t);
  32800. break;
  32801. case g.TYPES.bytes:
  32802. if (t.remaining() < 0)
  32803. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32804. var n = t.offset;
  32805. i.writeVarint32(t.remaining()),
  32806. i.append(t),
  32807. t.offset = n;
  32808. break;
  32809. case g.TYPES.message:
  32810. var r = (new I).LE();
  32811. this.resolvedType.encode(t, r),
  32812. i.writeVarint32(r.offset),
  32813. i.append(r.flip());
  32814. break;
  32815. case g.TYPES.group:
  32816. this.resolvedType.encode(t, i),
  32817. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  32818. break;
  32819. default:
  32820. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32821. }
  32822. return i
  32823. }
  32824. ,
  32825. i.decode = function(e, t, i) {
  32826. if (t != this.type.wireType)
  32827. throw Error("Unexpected wire type for element");
  32828. var n, r;
  32829. switch (this.type) {
  32830. case g.TYPES.int32:
  32831. return 0 | e.readVarint32();
  32832. case g.TYPES.uint32:
  32833. return e.readVarint32() >>> 0;
  32834. case g.TYPES.sint32:
  32835. return 0 | e.readVarint32ZigZag();
  32836. case g.TYPES.fixed32:
  32837. return e.readUint32() >>> 0;
  32838. case g.TYPES.sfixed32:
  32839. return 0 | e.readInt32();
  32840. case g.TYPES.int64:
  32841. return e.readVarint64();
  32842. case g.TYPES.uint64:
  32843. return e.readVarint64().toUnsigned();
  32844. case g.TYPES.sint64:
  32845. return e.readVarint64ZigZag();
  32846. case g.TYPES.fixed64:
  32847. return e.readUint64();
  32848. case g.TYPES.sfixed64:
  32849. return e.readInt64();
  32850. case g.TYPES.bool:
  32851. return !!e.readVarint32();
  32852. case g.TYPES.enum:
  32853. return e.readVarint32();
  32854. case g.TYPES.float:
  32855. return e.readFloat();
  32856. case g.TYPES.double:
  32857. return e.readDouble();
  32858. case g.TYPES.string:
  32859. return e.readVString();
  32860. case g.TYPES.bytes:
  32861. if (r = e.readVarint32(),
  32862. e.remaining() < r)
  32863. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  32864. return (n = e.clone()).limit = n.offset + r,
  32865. e.offset += r,
  32866. n;
  32867. case g.TYPES.message:
  32868. return r = e.readVarint32(),
  32869. this.resolvedType.decode(e, r);
  32870. case g.TYPES.group:
  32871. return this.resolvedType.decode(e, -1, i)
  32872. }
  32873. throw Error("[INTERNAL] Illegal decode type")
  32874. }
  32875. ,
  32876. i.valueFromString = function(e) {
  32877. if (!this.isMapKey)
  32878. throw Error("valueFromString() called on non-map-key element");
  32879. switch (this.type) {
  32880. case g.TYPES.int32:
  32881. case g.TYPES.sint32:
  32882. case g.TYPES.sfixed32:
  32883. case g.TYPES.uint32:
  32884. case g.TYPES.fixed32:
  32885. return this.verifyValue(parseInt(e));
  32886. case g.TYPES.int64:
  32887. case g.TYPES.sint64:
  32888. case g.TYPES.sfixed64:
  32889. case g.TYPES.uint64:
  32890. case g.TYPES.fixed64:
  32891. return this.verifyValue(e);
  32892. case g.TYPES.bool:
  32893. return "true" === e;
  32894. case g.TYPES.string:
  32895. return this.verifyValue(e);
  32896. case g.TYPES.bytes:
  32897. return I.fromBinary(e)
  32898. }
  32899. }
  32900. ,
  32901. i.valueToString = function(e) {
  32902. if (!this.isMapKey)
  32903. throw Error("valueToString() called on non-map-key element");
  32904. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  32905. }
  32906. ,
  32907. s.Element = u;
  32908. var d = function(e, t, i, n, r, o) {
  32909. l.call(this, e, t, i, n, o),
  32910. this.className = "Message",
  32911. this.extensions = void 0,
  32912. this.clazz = null,
  32913. this.isGroup = !!r,
  32914. this._fields = null,
  32915. this._fieldsById = null,
  32916. this._fieldsByName = null
  32917. }
  32918. , n = d.prototype = Object.create(l.prototype);
  32919. n.build = function(e) {
  32920. if (this.clazz && !e)
  32921. return this.clazz;
  32922. var t = function(u, a) {
  32923. function d(e, i, n, r) {
  32924. if (null === e || "object" != typeof e) {
  32925. if (r && r instanceof u.Reflect.Enum) {
  32926. var t = u.Reflect.Enum.getName(r.object, e);
  32927. if (null !== t)
  32928. return t
  32929. }
  32930. return e
  32931. }
  32932. if (I.isByteBuffer(e))
  32933. return i ? e.toBase64() : e.toBuffer();
  32934. if (u.Long.isLong(e))
  32935. return n ? e.toString() : u.Long.fromValue(e);
  32936. var o;
  32937. if (Array.isArray(e))
  32938. return o = [],
  32939. e.forEach(function(e, t) {
  32940. o[t] = d(e, i, n, r)
  32941. }),
  32942. o;
  32943. if (o = {},
  32944. e instanceof u.Map) {
  32945. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  32946. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  32947. return o
  32948. }
  32949. var l = e.$type
  32950. , c = void 0;
  32951. for (var h in e)
  32952. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  32953. return o
  32954. }
  32955. var s = a.getChildren(u.Reflect.Message.Field)
  32956. , l = a.getChildren(u.Reflect.Message.OneOf)
  32957. , c = function(e, t) {
  32958. u.Builder.Message.call(this);
  32959. for (var i = 0, n = l.length; i < n; ++i)
  32960. this[l[i].name] = null;
  32961. for (i = 0,
  32962. n = s.length; i < n; ++i) {
  32963. var r = s[i];
  32964. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  32965. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  32966. }
  32967. var o;
  32968. if (0 < arguments.length)
  32969. if (1 !== arguments.length || null === e || "object" != typeof e || !("function" != typeof e.encode || e instanceof c) || Array.isArray(e) || e instanceof u.Map || I.isByteBuffer(e) || e instanceof ArrayBuffer || u.Long && e instanceof u.Long)
  32970. for (i = 0,
  32971. n = arguments.length; i < n; ++i)
  32972. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  32973. else
  32974. this.$set(e)
  32975. }
  32976. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  32977. o.add = function(e, t, i) {
  32978. var n = a._fieldsByName[e];
  32979. if (!i) {
  32980. if (!n)
  32981. throw Error(this + "#" + e + " is undefined");
  32982. if (!(n instanceof u.Reflect.Message.Field))
  32983. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  32984. if (!n.repeated)
  32985. throw Error(this + "#" + e + " is not a repeated field");
  32986. t = n.verifyValue(t, !0)
  32987. }
  32988. return null === this[e] && (this[e] = []),
  32989. this[e].push(t),
  32990. this
  32991. }
  32992. ,
  32993. o.$add = o.add,
  32994. o.set = function(e, t, i) {
  32995. if (e && "object" == typeof e) {
  32996. for (var n in i = t,
  32997. e)
  32998. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  32999. return this
  33000. }
  33001. var r = a._fieldsByName[e];
  33002. if (i)
  33003. this[e] = t;
  33004. else {
  33005. if (!r)
  33006. throw Error(this + "#" + e + " is not a field: undefined");
  33007. if (!(r instanceof u.Reflect.Message.Field))
  33008. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33009. this[r.name] = t = r.verifyValue(t)
  33010. }
  33011. if (r && r.oneof) {
  33012. var o = this[r.oneof.name];
  33013. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33014. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33015. }
  33016. return this
  33017. }
  33018. ,
  33019. o.$set = o.set,
  33020. o.get = function(e, t) {
  33021. if (t)
  33022. return this[e];
  33023. var i = a._fieldsByName[e];
  33024. if (!(i && i instanceof u.Reflect.Message.Field))
  33025. throw Error(this + "#" + e + " is not a field: undefined");
  33026. if (!(i instanceof u.Reflect.Message.Field))
  33027. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33028. return this[i.name]
  33029. }
  33030. ,
  33031. o.$get = o.get;
  33032. for (var e = 0; e < s.length; e++) {
  33033. var t = s[e];
  33034. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33035. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33036. return e.toUpperCase().replace("_", "")
  33037. });
  33038. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33039. function t(e, t) {
  33040. return this[i.name] = t ? e : i.verifyValue(e),
  33041. this
  33042. }
  33043. function n() {
  33044. return this[i.name]
  33045. }
  33046. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33047. return "_" + e
  33048. });
  33049. null === a.getChild("set" + e) && (o["set" + e] = t),
  33050. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33051. null === a.getChild("get" + e) && (o["get" + e] = n),
  33052. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33053. }(t)
  33054. }
  33055. return o.encode = function(t, e) {
  33056. "boolean" == typeof t && (e = t,
  33057. t = void 0);
  33058. var i = !1;
  33059. t || (t = new I,
  33060. i = !0);
  33061. var n = t.littleEndian;
  33062. try {
  33063. return a.encode(this, t.LE(), e),
  33064. (i ? t.flip() : t).LE(n)
  33065. } catch (e) {
  33066. throw t.LE(n),
  33067. e
  33068. }
  33069. }
  33070. ,
  33071. c.encode = function(e, t, i) {
  33072. return new c(e).encode(t, i)
  33073. }
  33074. ,
  33075. o.calculate = function() {
  33076. return a.calculate(this)
  33077. }
  33078. ,
  33079. o.encodeDelimited = function(e, t) {
  33080. var i = !1;
  33081. e || (e = new I,
  33082. i = !0);
  33083. var n = (new I).LE();
  33084. return a.encode(this, n, t).flip(),
  33085. e.writeVarint32(n.remaining()),
  33086. e.append(n),
  33087. i ? e.flip() : e
  33088. }
  33089. ,
  33090. o.encodeAB = function() {
  33091. try {
  33092. return this.encode().toArrayBuffer()
  33093. } catch (e) {
  33094. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33095. e
  33096. }
  33097. }
  33098. ,
  33099. o.toArrayBuffer = o.encodeAB,
  33100. o.encodeNB = function() {
  33101. try {
  33102. return this.encode().toBuffer()
  33103. } catch (e) {
  33104. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33105. e
  33106. }
  33107. }
  33108. ,
  33109. o.toBuffer = o.encodeNB,
  33110. o.encode64 = function() {
  33111. try {
  33112. return this.encode().toBase64()
  33113. } catch (e) {
  33114. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33115. e
  33116. }
  33117. }
  33118. ,
  33119. o.toBase64 = o.encode64,
  33120. o.encodeHex = function() {
  33121. try {
  33122. return this.encode().toHex()
  33123. } catch (e) {
  33124. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33125. e
  33126. }
  33127. }
  33128. ,
  33129. o.toHex = o.encodeHex,
  33130. o.toRaw = function(e, t) {
  33131. return d(this, !!e, !!t, this.$type)
  33132. }
  33133. ,
  33134. o.encodeJSON = function() {
  33135. return JSON.stringify(d(this, !0, !0, this.$type))
  33136. }
  33137. ,
  33138. c.decode = function(t, e, i) {
  33139. "string" == typeof e && (i = e,
  33140. e = -1),
  33141. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33142. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33143. try {
  33144. var r = a.decode(t.LE());
  33145. return t.LE(n),
  33146. r
  33147. } catch (e) {
  33148. throw t.LE(n),
  33149. e
  33150. }
  33151. }
  33152. ,
  33153. c.decodeDelimited = function(t, e) {
  33154. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33155. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33156. return null;
  33157. var i = t.offset
  33158. , n = t.readVarint32();
  33159. if (t.remaining() < n)
  33160. return t.offset = i,
  33161. null;
  33162. try {
  33163. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33164. return t.offset += n,
  33165. r
  33166. } catch (e) {
  33167. throw t.offset += n,
  33168. e
  33169. }
  33170. }
  33171. ,
  33172. c.decode64 = function(e) {
  33173. return c.decode(e, "base64")
  33174. }
  33175. ,
  33176. c.decodeHex = function(e) {
  33177. return c.decode(e, "hex")
  33178. }
  33179. ,
  33180. c.decodeJSON = function(e) {
  33181. return new c(JSON.parse(e))
  33182. }
  33183. ,
  33184. o.toString = function() {
  33185. return a.toString()
  33186. }
  33187. ,
  33188. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33189. value: a.buildOpt()
  33190. }),
  33191. Object.defineProperty(o, "$options", {
  33192. value: c.$options
  33193. }),
  33194. Object.defineProperty(c, "$type", {
  33195. value: a
  33196. }),
  33197. Object.defineProperty(o, "$type", {
  33198. value: a
  33199. })),
  33200. c
  33201. }(g, this);
  33202. this._fields = [],
  33203. this._fieldsById = {},
  33204. this._fieldsByName = {};
  33205. for (var i, n = 0, r = this.children.length; n < r; n++)
  33206. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33207. if (t.hasOwnProperty(i.name))
  33208. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33209. t[i.name] = i.build()
  33210. } else if (i instanceof d.Field)
  33211. i.build(),
  33212. this._fields.push(i),
  33213. this._fieldsById[i.id] = i,
  33214. this._fieldsByName[i.name] = i;
  33215. else if (!(i instanceof d.OneOf || i instanceof v))
  33216. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33217. return this.clazz = t
  33218. }
  33219. ,
  33220. n.encode = function(e, t, i) {
  33221. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33222. r = e[(n = this._fields[a]).name],
  33223. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33224. if (null === o)
  33225. return t;
  33226. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33227. throw l.encoded = t,
  33228. l
  33229. }
  33230. ,
  33231. n.calculate = function(e) {
  33232. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33233. if (i = e[(t = this._fields[r]).name],
  33234. t.required && null === i)
  33235. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33236. n += t.calculate(i, e)
  33237. }
  33238. return n
  33239. }
  33240. ,
  33241. n.decode = function(e, t, i) {
  33242. t = "number" == typeof t ? t : -1;
  33243. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33244. if (o = (n = e.readVarint32()) >>> 3,
  33245. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33246. if (o !== i)
  33247. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33248. break
  33249. }
  33250. if (a = this._fieldsById[o]) {
  33251. if (a.repeated && !a.options.packed)
  33252. l[a.name].push(a.decode(r, e));
  33253. else if (a.map) {
  33254. var c = a.decode(r, e);
  33255. l[a.name].set(c[0], c[1])
  33256. } else if (l[a.name] = a.decode(r, e),
  33257. a.oneof) {
  33258. var h = l[a.oneof.name];
  33259. null !== h && h !== a.name && (l[h] = null),
  33260. l[a.oneof.name] = a.name
  33261. }
  33262. } else
  33263. switch (r) {
  33264. case g.WIRE_TYPES.VARINT:
  33265. e.readVarint32();
  33266. break;
  33267. case g.WIRE_TYPES.BITS32:
  33268. e.offset += 4;
  33269. break;
  33270. case g.WIRE_TYPES.BITS64:
  33271. e.offset += 8;
  33272. break;
  33273. case g.WIRE_TYPES.LDELIM:
  33274. var u = e.readVarint32();
  33275. e.offset += u;
  33276. break;
  33277. case g.WIRE_TYPES.STARTGROUP:
  33278. for (; m(o, e); )
  33279. ;
  33280. break;
  33281. default:
  33282. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33283. }
  33284. }
  33285. for (var d = 0, p = this._fields.length; d < p; ++d)
  33286. if (null === l[(a = this._fields[d]).name])
  33287. if ("proto3" === this.syntax)
  33288. l[a.name] = a.defaultValue;
  33289. else {
  33290. if (a.required) {
  33291. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33292. throw f.decoded = l,
  33293. f
  33294. }
  33295. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33296. }
  33297. return l
  33298. }
  33299. ,
  33300. s.Message = d;
  33301. function c(e, t, i, n, r, o, a, s, l, c) {
  33302. h.call(this, e, t, o),
  33303. this.className = "Message.Field",
  33304. this.required = "required" === i,
  33305. this.repeated = "repeated" === i,
  33306. this.map = "map" === i,
  33307. this.keyType = n || null,
  33308. this.type = r,
  33309. this.resolvedType = null,
  33310. this.id = a,
  33311. this.options = s || {},
  33312. this.defaultValue = null,
  33313. this.oneof = l || null,
  33314. this.syntax = c || "proto2",
  33315. this.originalName = this.name,
  33316. this.element = null,
  33317. this.keyElement = null,
  33318. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33319. }
  33320. var r = c.prototype = Object.create(h.prototype);
  33321. r.build = function() {
  33322. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33323. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33324. "proto3" !== this.syntax || this.repeated || this.map ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = u.defaultFieldValue(this.type)
  33325. }
  33326. ,
  33327. r.verifyValue = function(e, t) {
  33328. function i(e, t) {
  33329. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33330. }
  33331. t = t || !1;
  33332. var n, r = this;
  33333. if (null === e)
  33334. return this.required && i(typeof e, "required"),
  33335. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33336. null;
  33337. if (!this.repeated || t)
  33338. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33339. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33340. this.element.verifyValue(e));
  33341. Array.isArray(e) || (e = [e]);
  33342. var o = [];
  33343. for (n = 0; n < e.length; n++)
  33344. o.push(this.element.verifyValue(e[n]));
  33345. return o
  33346. }
  33347. ,
  33348. r.hasWirePresence = function(e, t) {
  33349. if ("proto3" !== this.syntax)
  33350. return null !== e;
  33351. if (this.oneof && t[this.oneof.name] === this.name)
  33352. return !0;
  33353. switch (this.type) {
  33354. case g.TYPES.int32:
  33355. case g.TYPES.sint32:
  33356. case g.TYPES.sfixed32:
  33357. case g.TYPES.uint32:
  33358. case g.TYPES.fixed32:
  33359. return 0 !== e;
  33360. case g.TYPES.int64:
  33361. case g.TYPES.sint64:
  33362. case g.TYPES.sfixed64:
  33363. case g.TYPES.uint64:
  33364. case g.TYPES.fixed64:
  33365. return 0 !== e.low || 0 !== e.high;
  33366. case g.TYPES.bool:
  33367. return e;
  33368. case g.TYPES.float:
  33369. case g.TYPES.double:
  33370. return 0 !== e;
  33371. case g.TYPES.string:
  33372. return 0 < e.length;
  33373. case g.TYPES.bytes:
  33374. return 0 < e.remaining();
  33375. case g.TYPES.enum:
  33376. return 0 !== e;
  33377. case g.TYPES.message:
  33378. return null !== e;
  33379. default:
  33380. return !0
  33381. }
  33382. }
  33383. ,
  33384. r.encode = function(t, r, e) {
  33385. if (null === this.type || "object" != typeof this.type)
  33386. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33387. if (null === t || this.repeated && 0 == t.length)
  33388. return r;
  33389. try {
  33390. var i;
  33391. if (this.repeated)
  33392. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33393. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33394. r.ensureCapacity(r.offset += 1);
  33395. var n = r.offset;
  33396. for (i = 0; i < t.length; i++)
  33397. this.element.encodeValue(this.id, t[i], r);
  33398. var o = r.offset - n
  33399. , a = I.calculateVarint32(o);
  33400. if (1 < a) {
  33401. var s = r.slice(n, r.offset);
  33402. n += a - 1,
  33403. r.offset = n,
  33404. r.append(s)
  33405. }
  33406. r.writeVarint32(o, n - a)
  33407. } else
  33408. for (i = 0; i < t.length; i++)
  33409. r.writeVarint32(this.id << 3 | this.type.wireType),
  33410. this.element.encodeValue(this.id, t[i], r);
  33411. else
  33412. this.map ? t.forEach(function(e, t, i) {
  33413. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33414. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33415. r.writeVarint32(n),
  33416. r.writeVarint32(8 | this.keyType.wireType),
  33417. this.keyElement.encodeValue(1, t, r),
  33418. r.writeVarint32(16 | this.type.wireType),
  33419. this.element.encodeValue(2, e, r)
  33420. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33421. this.element.encodeValue(this.id, t, r))
  33422. } catch (e) {
  33423. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33424. }
  33425. return r
  33426. }
  33427. ,
  33428. r.calculate = function(t, e) {
  33429. if (t = this.verifyValue(t),
  33430. null === this.type || "object" != typeof this.type)
  33431. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33432. if (null === t || this.repeated && 0 == t.length)
  33433. return 0;
  33434. var r = 0;
  33435. try {
  33436. var i, n;
  33437. if (this.repeated)
  33438. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33439. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33440. i = n = 0; i < t.length; i++)
  33441. n += this.element.calculateLength(this.id, t[i]);
  33442. r += I.calculateVarint32(n),
  33443. r += n
  33444. } else
  33445. for (i = 0; i < t.length; i++)
  33446. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33447. r += this.element.calculateLength(this.id, t[i]);
  33448. else
  33449. this.map ? t.forEach(function(e, t, i) {
  33450. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33451. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33452. r += I.calculateVarint32(n),
  33453. r += n
  33454. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33455. r += this.element.calculateLength(this.id, t))
  33456. } catch (e) {
  33457. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33458. }
  33459. return r
  33460. }
  33461. ,
  33462. r.decode = function(e, t, i) {
  33463. var n, r;
  33464. if (!(!this.map && e == this.type.wireType || !i && this.repeated && this.options.packed && e == g.WIRE_TYPES.LDELIM || this.map && e == g.WIRE_TYPES.LDELIM))
  33465. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33466. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33467. r = t.readVarint32(),
  33468. r = t.offset + r;
  33469. for (var o = []; t.offset < r; )
  33470. o.push(this.decode(this.type.wireType, t, !0));
  33471. return o
  33472. }
  33473. if (this.map) {
  33474. var a = u.defaultFieldValue(this.keyType);
  33475. if (n = u.defaultFieldValue(this.type),
  33476. r = t.readVarint32(),
  33477. t.remaining() < r)
  33478. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33479. var s = t.clone();
  33480. for (s.limit = s.offset + r,
  33481. t.offset += r; 0 < s.remaining(); ) {
  33482. var l = s.readVarint32();
  33483. e = 7 & l;
  33484. var c = l >>> 3;
  33485. if (1 == c)
  33486. a = this.keyElement.decode(s, e, c);
  33487. else {
  33488. if (2 != c)
  33489. throw Error("Unexpected tag in map field key/value submessage");
  33490. n = this.element.decode(s, e, c)
  33491. }
  33492. }
  33493. return [a, n]
  33494. }
  33495. return this.element.decode(t, e, this.id)
  33496. }
  33497. ,
  33498. s.Message.Field = c;
  33499. function o(e, t, i, n, r, o, a) {
  33500. c.call(this, e, t, i, null, n, r, o, a),
  33501. this.extension
  33502. }
  33503. o.prototype = Object.create(c.prototype),
  33504. s.Message.ExtensionField = o;
  33505. s.Message.OneOf = function(e, t, i) {
  33506. h.call(this, e, t, i),
  33507. this.fields = []
  33508. }
  33509. ;
  33510. var p = function(e, t, i, n, r) {
  33511. l.call(this, e, t, i, n, r),
  33512. this.className = "Enum",
  33513. this.object = null
  33514. };
  33515. p.getName = function(e, t) {
  33516. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33517. if (e[i = n[r]] === t)
  33518. return i;
  33519. return null
  33520. }
  33521. ,
  33522. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33523. if (this.object && !e)
  33524. return this.object;
  33525. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33526. t[i[n].name] = i[n].id;
  33527. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33528. value: this.buildOpt(),
  33529. enumerable: !1
  33530. }),
  33531. this.object = t
  33532. }
  33533. ,
  33534. s.Enum = p;
  33535. function f(e, t, i, n) {
  33536. h.call(this, e, t, i),
  33537. this.className = "Enum.Value",
  33538. this.id = n
  33539. }
  33540. f.prototype = Object.create(h.prototype),
  33541. s.Enum.Value = f;
  33542. var v = function(e, t, i, n) {
  33543. h.call(this, e, t, i),
  33544. this.field = n
  33545. };
  33546. v.prototype = Object.create(h.prototype),
  33547. s.Extension = v;
  33548. var y = function(e, t, i, n) {
  33549. l.call(this, e, t, i, n),
  33550. this.className = "Service",
  33551. this.clazz = null
  33552. };
  33553. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33554. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33555. for (var o = function(e) {
  33556. t.Builder.Service.call(this),
  33557. this.rpcImpl = e || function(e, t, i) {
  33558. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33559. }
  33560. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33561. !function(n) {
  33562. e[n.name] = function(e, i) {
  33563. try {
  33564. try {
  33565. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33566. } catch (e) {
  33567. if (!(e instanceof TypeError))
  33568. throw e
  33569. }
  33570. if (null === e || "object" != typeof e)
  33571. throw Error("Illegal arguments");
  33572. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33573. this.rpcImpl(n.fqn(), e, function(e, t) {
  33574. if (!e) {
  33575. null === t && (t = "");
  33576. try {
  33577. t = n.resolvedResponseType.clazz.decode(t)
  33578. } catch (e) {}
  33579. return t && t instanceof n.resolvedResponseType.clazz ? void i(null, t) : void i(Error("Illegal response type received in service method " + r.name + "#" + n.name))
  33580. }
  33581. i(e)
  33582. })
  33583. } catch (e) {
  33584. setTimeout(i.bind(this, e), 0)
  33585. }
  33586. }
  33587. ,
  33588. o[n.name] = function(e, t, i) {
  33589. new o(e)[n.name](t, i)
  33590. }
  33591. ,
  33592. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  33593. value: n.buildOpt()
  33594. }),
  33595. Object.defineProperty(e[n.name], "$options", {
  33596. value: o[n.name].$options
  33597. }))
  33598. }(i[n]);
  33599. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  33600. value: r.buildOpt()
  33601. }),
  33602. Object.defineProperty(e, "$options", {
  33603. value: o.$options
  33604. }),
  33605. Object.defineProperty(o, "$type", {
  33606. value: r
  33607. }),
  33608. Object.defineProperty(e, "$type", {
  33609. value: r
  33610. })),
  33611. o
  33612. }(g, this)
  33613. }
  33614. ,
  33615. s.Service = y;
  33616. function A(e, t, i, n) {
  33617. h.call(this, e, t, i),
  33618. this.className = "Service.Method",
  33619. this.options = n || {}
  33620. }
  33621. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  33622. s.Service.Method = A;
  33623. function C(e, t, i, n, r, o, a, s) {
  33624. A.call(this, e, t, i, s),
  33625. this.className = "Service.RPCMethod",
  33626. this.requestName = n,
  33627. this.responseName = r,
  33628. this.requestStream = o,
  33629. this.responseStream = a,
  33630. this.resolvedRequestType = null,
  33631. this.resolvedResponseType = null
  33632. }
  33633. return C.prototype = Object.create(A.prototype),
  33634. s.Service.RPCMethod = C,
  33635. s
  33636. }(o),
  33637. o.Builder = (i = (u = o).Lang,
  33638. s = o.Reflect,
  33639. n = h.prototype,
  33640. h.isMessage = function(e) {
  33641. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  33642. }
  33643. ,
  33644. h.isMessageField = function(e) {
  33645. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  33646. }
  33647. ,
  33648. h.isEnum = function(e) {
  33649. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33650. }
  33651. ,
  33652. h.isService = function(e) {
  33653. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33654. }
  33655. ,
  33656. h.isExtend = function(e) {
  33657. return "string" == typeof e.ref
  33658. }
  33659. ,
  33660. n.reset = function() {
  33661. return this.ptr = this.ns,
  33662. this
  33663. }
  33664. ,
  33665. n.define = function(e) {
  33666. if ("string" != typeof e || !i.TYPEREF.test(e))
  33667. throw Error("illegal namespace: " + e);
  33668. return e.split(".").forEach(function(e) {
  33669. var t = this.ptr.getChild(e);
  33670. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  33671. this.ptr = t
  33672. }, this),
  33673. this
  33674. }
  33675. ,
  33676. n.create = function(e) {
  33677. if (!e)
  33678. return this;
  33679. if (Array.isArray(e)) {
  33680. if (0 === e.length)
  33681. return this;
  33682. e = e.slice()
  33683. } else
  33684. e = [e];
  33685. for (var t = [e]; 0 < t.length; ) {
  33686. if (e = t.pop(),
  33687. !Array.isArray(e))
  33688. throw Error("not a valid namespace: " + JSON.stringify(e));
  33689. for (; 0 < e.length; ) {
  33690. var i = e.shift();
  33691. if (h.isMessage(i)) {
  33692. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  33693. , n = {};
  33694. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  33695. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  33696. }, this),
  33697. i.fields && i.fields.forEach(function(e) {
  33698. if (null !== o.getChild(0 | e.id))
  33699. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  33700. if (e.options && "object" != typeof e.options)
  33701. throw Error("illegal field options in " + o.name + "#" + e.name);
  33702. var t = null;
  33703. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  33704. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  33705. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  33706. t && t.fields.push(e),
  33707. o.addChild(e)
  33708. }, this);
  33709. var r = [];
  33710. if (i.enums && i.enums.forEach(function(e) {
  33711. r.push(e)
  33712. }),
  33713. i.messages && i.messages.forEach(function(e) {
  33714. r.push(e)
  33715. }),
  33716. i.services && i.services.forEach(function(e) {
  33717. r.push(e)
  33718. }),
  33719. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  33720. this.ptr.addChild(o),
  33721. 0 < r.length) {
  33722. t.push(e),
  33723. e = r,
  33724. r = null,
  33725. this.ptr = o,
  33726. o = null;
  33727. continue
  33728. }
  33729. r = null
  33730. } else if (h.isEnum(i))
  33731. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  33732. i.values.forEach(function(e) {
  33733. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  33734. }, this),
  33735. this.ptr.addChild(o);
  33736. else if (h.isService(i))
  33737. o = new s.Service(this,this.ptr,i.name,i.options),
  33738. Object.keys(i.rpc).forEach(function(e) {
  33739. var t = i.rpc[e];
  33740. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  33741. }, this),
  33742. this.ptr.addChild(o);
  33743. else {
  33744. if (!h.isExtend(i))
  33745. throw Error("not a valid definition: " + JSON.stringify(i));
  33746. if (o = this.ptr.resolve(i.ref, !0))
  33747. i.fields.forEach(function(t) {
  33748. if (null !== o.getChild(0 | t.id))
  33749. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  33750. if (o.extensions) {
  33751. var i = !1;
  33752. if (o.extensions.forEach(function(e) {
  33753. t.id >= e[0] && t.id <= e[1] && (i = !0)
  33754. }),
  33755. !i)
  33756. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  33757. }
  33758. var e = t.name;
  33759. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  33760. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  33761. , r = new s.Extension(this,this.ptr,t.name,n);
  33762. n.extension = r,
  33763. this.ptr.addChild(r),
  33764. o.addChild(n)
  33765. }, this);
  33766. else if (!/\.?google\.protobuf\./.test(i.ref))
  33767. throw Error("extended message " + i.ref + " is not defined")
  33768. }
  33769. o = i = null
  33770. }
  33771. e = null,
  33772. this.ptr = this.ptr.parent
  33773. }
  33774. return this.resolved = !1,
  33775. this.result = null,
  33776. this
  33777. }
  33778. ,
  33779. n.import = function(t, e) {
  33780. var i = "/";
  33781. if ("string" == typeof e) {
  33782. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  33783. !0 === this.files[e])
  33784. return this.reset();
  33785. this.files[e] = !0
  33786. } else if ("object" == typeof e) {
  33787. var n = e.root;
  33788. u.Util.IS_NODE && (n = p("path").resolve(n)),
  33789. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  33790. var r = n + i + e.file;
  33791. if (!0 === this.files[r])
  33792. return this.reset();
  33793. this.files[r] = !0
  33794. }
  33795. if (t.imports && 0 < t.imports.length) {
  33796. var o, a = !1;
  33797. "object" == typeof e ? (this.importRoot = e.root,
  33798. a = !0,
  33799. o = this.importRoot,
  33800. e = e.file,
  33801. (0 <= o.indexOf("\\") || 0 <= e.indexOf("\\")) && (i = "\\")) : "string" == typeof e ? this.importRoot ? o = this.importRoot : 0 <= e.indexOf("/") ? "" === (o = e.replace(/\/[^\/]*$/, "")) && (o = "/") : 0 <= e.indexOf("\\") ? (o = e.replace(/\\[^\\]*$/, ""),
  33802. i = "\\") : o = "." : o = null;
  33803. for (var s = 0; s < t.imports.length; s++)
  33804. if ("string" == typeof t.imports[s]) {
  33805. if (!o)
  33806. throw Error("cannot determine import root");
  33807. var l = t.imports[s];
  33808. if ("google/protobuf/descriptor.proto" === l)
  33809. continue;
  33810. if (l = o + i + l,
  33811. !0 === this.files[l])
  33812. continue;
  33813. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  33814. var c = u.Util.fetch(l);
  33815. if (null === c)
  33816. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  33817. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  33818. } else
  33819. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  33820. return t + "_import" + s + "." + i
  33821. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  33822. a && (this.importRoot = null)
  33823. }
  33824. t.package && this.define(t.package),
  33825. t.syntax && function t(i) {
  33826. i.messages && i.messages.forEach(function(e) {
  33827. e.syntax = i.syntax,
  33828. t(e)
  33829. }),
  33830. i.enums && i.enums.forEach(function(e) {
  33831. e.syntax = i.syntax
  33832. })
  33833. }(t);
  33834. var h = this.ptr;
  33835. return t.options && Object.keys(t.options).forEach(function(e) {
  33836. h.options[e] = t.options[e]
  33837. }),
  33838. t.messages && (this.create(t.messages),
  33839. this.ptr = h),
  33840. t.enums && (this.create(t.enums),
  33841. this.ptr = h),
  33842. t.services && (this.create(t.services),
  33843. this.ptr = h),
  33844. t.extends && this.create(t.extends),
  33845. this.reset()
  33846. }
  33847. ,
  33848. n.resolveAll = function() {
  33849. var e;
  33850. if (null == this.ptr || "object" == typeof this.ptr.type)
  33851. return this;
  33852. if (this.ptr instanceof s.Namespace)
  33853. this.ptr.children.forEach(function(e) {
  33854. this.ptr = e,
  33855. this.resolveAll()
  33856. }, this);
  33857. else if (this.ptr instanceof s.Message.Field) {
  33858. if (i.TYPE.test(this.ptr.type))
  33859. this.ptr.type = u.TYPES[this.ptr.type];
  33860. else {
  33861. if (!i.TYPEREF.test(this.ptr.type))
  33862. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33863. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  33864. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33865. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  33866. if (this.ptr.type = u.TYPES.enum,
  33867. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  33868. throw Error("proto3 message cannot reference proto2 enum")
  33869. } else {
  33870. if (!(e instanceof s.Message))
  33871. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33872. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  33873. }
  33874. }
  33875. if (this.ptr.map) {
  33876. if (!i.TYPE.test(this.ptr.keyType))
  33877. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  33878. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  33879. }
  33880. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  33881. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  33882. throw Error("illegal service type in " + this.ptr.toString(!0));
  33883. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  33884. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  33885. if (this.ptr.resolvedRequestType = e,
  33886. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  33887. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  33888. this.ptr.resolvedResponseType = e
  33889. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  33890. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  33891. return this.reset()
  33892. }
  33893. ,
  33894. n.build = function(e) {
  33895. if (this.reset(),
  33896. this.resolved || (this.resolveAll(),
  33897. this.resolved = !0,
  33898. this.result = null),
  33899. null === this.result && (this.result = this.ns.build()),
  33900. !e)
  33901. return this.result;
  33902. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  33903. if (!i[t[n]]) {
  33904. i = null;
  33905. break
  33906. }
  33907. i = i[t[n]]
  33908. }
  33909. return i
  33910. }
  33911. ,
  33912. n.lookup = function(e, t) {
  33913. return e ? this.ns.resolve(e, t) : this.ns
  33914. }
  33915. ,
  33916. n.toString = function() {
  33917. return "Builder"
  33918. }
  33919. ,
  33920. h.Message = function() {}
  33921. ,
  33922. h.Enum = function() {}
  33923. ,
  33924. h.Service = function() {}
  33925. ,
  33926. h),
  33927. o.Map = (a = o.Reflect,
  33928. (t = c.prototype).clear = function() {
  33929. this.map = {}
  33930. }
  33931. ,
  33932. t.delete = function(e) {
  33933. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  33934. , i = t in this.map;
  33935. return delete this.map[t],
  33936. i
  33937. }
  33938. ,
  33939. t.entries = function() {
  33940. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  33941. t.push([(e = this.map[i[n]]).key, e.value]);
  33942. return l(t)
  33943. }
  33944. ,
  33945. t.keys = function() {
  33946. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  33947. e.push(this.map[t[i]].key);
  33948. return l(e)
  33949. }
  33950. ,
  33951. t.values = function() {
  33952. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  33953. e.push(this.map[t[i]].value);
  33954. return l(e)
  33955. }
  33956. ,
  33957. t.forEach = function(e, t) {
  33958. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  33959. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  33960. }
  33961. ,
  33962. t.set = function(e, t) {
  33963. var i = this.keyElem.verifyValue(e)
  33964. , n = this.valueElem.verifyValue(t);
  33965. return this.map[this.keyElem.valueToString(i)] = {
  33966. key: i,
  33967. value: n
  33968. },
  33969. this
  33970. }
  33971. ,
  33972. t.get = function(e) {
  33973. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  33974. if (t in this.map)
  33975. return this.map[t].value
  33976. }
  33977. ,
  33978. t.has = function(e) {
  33979. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  33980. }
  33981. ,
  33982. c),
  33983. o.loadProto = function(e, t, i) {
  33984. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  33985. t = void 0),
  33986. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  33987. }
  33988. ,
  33989. o.protoFromString = o.loadProto,
  33990. o.loadProtoFile = function(t, i, n) {
  33991. if (i && "object" == typeof i ? (n = i,
  33992. i = null) : i && "function" == typeof i || (i = null),
  33993. i)
  33994. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  33995. if (null !== e)
  33996. try {
  33997. i(null, o.loadProto(e, n, t))
  33998. } catch (e) {
  33999. i(e)
  34000. }
  34001. else
  34002. i(Error("Failed to fetch file"))
  34003. });
  34004. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34005. return null === e ? null : o.loadProto(e, n, t)
  34006. }
  34007. ,
  34008. o.protoFromFile = o.loadProtoFile,
  34009. o.newBuilder = function(e) {
  34010. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34011. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34012. new o.Builder(e)
  34013. }
  34014. ,
  34015. o.loadJson = function(e, t, i) {
  34016. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34017. t = null),
  34018. t && "object" == typeof t || (t = o.newBuilder()),
  34019. "string" == typeof e && (e = JSON.parse(e)),
  34020. t.import(e, i),
  34021. t.resolveAll(),
  34022. t
  34023. }
  34024. ,
  34025. o.loadJsonFile = function(t, i, n) {
  34026. if (i && "object" == typeof i ? (n = i,
  34027. i = null) : i && "function" == typeof i || (i = null),
  34028. i)
  34029. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34030. if (null !== e)
  34031. try {
  34032. i(null, o.loadJson(JSON.parse(e), n, t))
  34033. } catch (e) {
  34034. i(e)
  34035. }
  34036. else
  34037. i(Error("Failed to fetch file"))
  34038. });
  34039. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34040. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34041. }
  34042. ,
  34043. o;
  34044. function l(e) {
  34045. var t = 0;
  34046. return {
  34047. next: function() {
  34048. return t < e.length ? {
  34049. done: !1,
  34050. value: e[t++]
  34051. } : {
  34052. done: !0
  34053. }
  34054. }
  34055. }
  34056. }
  34057. function c(e, t) {
  34058. if (!e.map)
  34059. throw Error("field is not a map");
  34060. if (this.field = e,
  34061. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34062. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34063. this.map = {},
  34064. Object.defineProperty(this, "size", {
  34065. get: function() {
  34066. return Object.keys(this.map).length
  34067. }
  34068. }),
  34069. t)
  34070. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34071. var r = this.keyElem.valueFromString(i[n])
  34072. , o = this.valueElem.verifyValue(t[i[n]]);
  34073. this.map[this.keyElem.valueToString(r)] = {
  34074. key: r,
  34075. value: o
  34076. }
  34077. }
  34078. }
  34079. function h(e) {
  34080. this.ns = new s.Namespace(this,null,""),
  34081. this.ptr = this.ns,
  34082. this.resolved = !1,
  34083. this.result = null,
  34084. this.files = {},
  34085. this.importRoot = null,
  34086. this.options = e || {}
  34087. }
  34088. }
  34089. ,
  34090. "function" == typeof define && define.amd ? define(["bytebuffer"], t) : "function" == typeof p && "object" == typeof i && i && i.exports ? i.exports = t(p("bytebuffer")) : (e.dcodeIO = e.dcodeIO || {}).ProtoBuf = t(e.dcodeIO.ByteBuffer)
  34091. }
  34092. ).call(this, p("_process"))
  34093. }
  34094. , {
  34095. _process: 203,
  34096. bytebuffer: 215,
  34097. fs: 197,
  34098. path: 197
  34099. }],
  34100. 215: [function(t, e, i) {
  34101. var n, r;
  34102. n = this,
  34103. r = function(l) {
  34104. "use strict";
  34105. function s(e) {
  34106. var t = 0;
  34107. return function() {
  34108. return t < e.length ? e.charCodeAt(t++) : null
  34109. }
  34110. }
  34111. function c() {
  34112. var e = []
  34113. , t = [];
  34114. return function() {
  34115. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34116. e.length = 0),
  34117. void Array.prototype.push.apply(e, arguments))
  34118. }
  34119. }
  34120. function n(e, t, i, n, r) {
  34121. 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];
  34122. for (u += d,
  34123. o = p & (1 << -h) - 1,
  34124. p >>= -h,
  34125. h += s; 0 < h; o = 256 * o + e[t + u],
  34126. u += d,
  34127. h -= 8)
  34128. ;
  34129. for (a = o & (1 << -h) - 1,
  34130. o >>= -h,
  34131. h += n; 0 < h; a = 256 * a + e[t + u],
  34132. u += d,
  34133. h -= 8)
  34134. ;
  34135. if (0 === o)
  34136. o = 1 - c;
  34137. else {
  34138. if (o === l)
  34139. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34140. a += Math.pow(2, n),
  34141. o -= c
  34142. }
  34143. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34144. }
  34145. function r(e, t, i, n, r, o) {
  34146. 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;
  34147. for (t = Math.abs(t),
  34148. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34149. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34150. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34151. l *= 2),
  34152. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34153. l /= 2),
  34154. h <= a + u ? (s = 0,
  34155. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34156. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34157. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34158. p += f,
  34159. s /= 256,
  34160. r -= 8)
  34161. ;
  34162. for (a = a << r | s,
  34163. c += r; 0 < c; e[i + p] = 255 & a,
  34164. p += f,
  34165. a /= 256,
  34166. c -= 8)
  34167. ;
  34168. e[i + p - f] |= 128 * g
  34169. }
  34170. var f = function(e, t, i) {
  34171. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34172. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34173. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34174. !i) {
  34175. if ((e |= 0) < 0)
  34176. throw RangeError("Illegal capacity");
  34177. t = !!t,
  34178. i = !!i
  34179. }
  34180. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34181. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34182. this.offset = 0,
  34183. this.markedOffset = -1,
  34184. this.limit = e,
  34185. this.littleEndian = t,
  34186. this.noAssert = i
  34187. };
  34188. f.VERSION = "5.0.1",
  34189. f.LITTLE_ENDIAN = !0,
  34190. f.BIG_ENDIAN = !1,
  34191. f.DEFAULT_CAPACITY = 16,
  34192. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34193. f.DEFAULT_NOASSERT = !1,
  34194. f.Long = l || null;
  34195. var a = f.prototype;
  34196. a.__isByteBuffer__,
  34197. Object.defineProperty(a, "__isByteBuffer__", {
  34198. value: !0,
  34199. enumerable: !1,
  34200. configurable: !1
  34201. });
  34202. var o = new ArrayBuffer(0)
  34203. , i = String.fromCharCode;
  34204. f.accessor = function() {
  34205. return Uint8Array
  34206. }
  34207. ,
  34208. f.allocate = function(e, t, i) {
  34209. return new f(e,t,i)
  34210. }
  34211. ,
  34212. f.concat = function(e, t, i, n) {
  34213. "boolean" != typeof t && "string" == typeof t || (n = i,
  34214. i = t,
  34215. t = void 0);
  34216. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34217. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34218. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34219. if (0 === o)
  34220. return new f(0,i,n);
  34221. var l, c = new f(o,i,n);
  34222. for (a = 0; a < s; )
  34223. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34224. c.offset += r);
  34225. return c.limit = c.offset,
  34226. c.offset = 0,
  34227. c
  34228. }
  34229. ,
  34230. f.isByteBuffer = function(e) {
  34231. return !0 === (e && e.__isByteBuffer__)
  34232. }
  34233. ,
  34234. f.type = function() {
  34235. return ArrayBuffer
  34236. }
  34237. ,
  34238. f.wrap = function(e, t, i, n) {
  34239. if ("string" != typeof t && (n = i,
  34240. i = t,
  34241. t = void 0),
  34242. "string" == typeof e)
  34243. switch (void 0 === t && (t = "utf8"),
  34244. t) {
  34245. case "base64":
  34246. return f.fromBase64(e, i);
  34247. case "hex":
  34248. return f.fromHex(e, i);
  34249. case "binary":
  34250. return f.fromBinary(e, i);
  34251. case "utf8":
  34252. return f.fromUTF8(e, i);
  34253. case "debug":
  34254. return f.fromDebug(e, i);
  34255. default:
  34256. throw Error("Unsupported encoding: " + t)
  34257. }
  34258. if (null === e || "object" != typeof e)
  34259. throw TypeError("Illegal buffer");
  34260. var r;
  34261. if (f.isByteBuffer(e))
  34262. return (r = a.clone.call(e)).markedOffset = -1,
  34263. r;
  34264. if (e instanceof Uint8Array)
  34265. r = new f(0,i,n),
  34266. 0 < e.length && (r.buffer = e.buffer,
  34267. r.offset = e.byteOffset,
  34268. r.limit = e.byteOffset + e.byteLength,
  34269. r.view = new Uint8Array(e.buffer));
  34270. else if (e instanceof ArrayBuffer)
  34271. r = new f(0,i,n),
  34272. 0 < e.byteLength && (r.buffer = e,
  34273. r.offset = 0,
  34274. r.limit = e.byteLength,
  34275. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34276. else {
  34277. if ("[object Array]" !== Object.prototype.toString.call(e))
  34278. throw TypeError("Illegal buffer");
  34279. (r = new f(e.length,i,n)).limit = e.length;
  34280. for (var o = 0; o < e.length; ++o)
  34281. r.view[o] = e[o]
  34282. }
  34283. return r
  34284. }
  34285. ,
  34286. a.writeBitSet = function(e, t) {
  34287. var i = void 0 === t;
  34288. if (i && (t = this.offset),
  34289. !this.noAssert) {
  34290. if (!(e instanceof Array))
  34291. throw TypeError("Illegal BitSet: Not an array");
  34292. if ("number" != typeof t || t % 1 != 0)
  34293. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34294. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34295. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34296. }
  34297. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34298. for (t += this.writeVarint32(o, t); a--; )
  34299. 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,
  34300. this.writeByte(n, t++);
  34301. if (s < o) {
  34302. var l = 0;
  34303. for (n = 0; s < o; )
  34304. n |= (1 & !!e[s++]) << l++;
  34305. this.writeByte(n, t++)
  34306. }
  34307. return i ? (this.offset = t,
  34308. this) : t - r
  34309. }
  34310. ,
  34311. a.readBitSet = function(e) {
  34312. var t = void 0 === e;
  34313. t && (e = this.offset);
  34314. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34315. for (e += n.length; o--; )
  34316. i = this.readByte(e++),
  34317. s[a++] = !!(1 & i),
  34318. s[a++] = !!(2 & i),
  34319. s[a++] = !!(4 & i),
  34320. s[a++] = !!(8 & i),
  34321. s[a++] = !!(16 & i),
  34322. s[a++] = !!(32 & i),
  34323. s[a++] = !!(64 & i),
  34324. s[a++] = !!(128 & i);
  34325. if (a < r) {
  34326. var l = 0;
  34327. for (i = this.readByte(e++); a < r; )
  34328. s[a++] = !!(i >> l++ & 1)
  34329. }
  34330. return t && (this.offset = e),
  34331. s
  34332. }
  34333. ,
  34334. a.readBytes = function(e, t) {
  34335. var i = void 0 === t;
  34336. if (i && (t = this.offset),
  34337. !this.noAssert) {
  34338. if ("number" != typeof t || t % 1 != 0)
  34339. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34340. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34341. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34342. }
  34343. var n = this.slice(t, t + e);
  34344. return i && (this.offset += e),
  34345. n
  34346. }
  34347. ,
  34348. a.writeBytes = a.append,
  34349. a.writeInt8 = function(e, t) {
  34350. var i = void 0 === t;
  34351. if (i && (t = this.offset),
  34352. !this.noAssert) {
  34353. if ("number" != typeof e || e % 1 != 0)
  34354. throw TypeError("Illegal value: " + e + " (not an integer)");
  34355. if (e |= 0,
  34356. "number" != typeof t || t % 1 != 0)
  34357. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34358. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34359. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34360. }
  34361. t += 1;
  34362. var n = this.buffer.byteLength;
  34363. return n < t && this.resize((n *= 2) > t ? n : t),
  34364. t -= 1,
  34365. this.view[t] = e,
  34366. i && (this.offset += 1),
  34367. this
  34368. }
  34369. ,
  34370. a.writeByte = a.writeInt8,
  34371. a.readInt8 = function(e) {
  34372. var t = void 0 === e;
  34373. if (t && (e = this.offset),
  34374. !this.noAssert) {
  34375. if ("number" != typeof e || e % 1 != 0)
  34376. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34377. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34378. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34379. }
  34380. var i = this.view[e];
  34381. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34382. t && (this.offset += 1),
  34383. i
  34384. }
  34385. ,
  34386. a.readByte = a.readInt8,
  34387. a.writeUint8 = function(e, t) {
  34388. var i = void 0 === t;
  34389. if (i && (t = this.offset),
  34390. !this.noAssert) {
  34391. if ("number" != typeof e || e % 1 != 0)
  34392. throw TypeError("Illegal value: " + e + " (not an integer)");
  34393. if (e >>>= 0,
  34394. "number" != typeof t || t % 1 != 0)
  34395. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34396. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34397. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34398. }
  34399. t += 1;
  34400. var n = this.buffer.byteLength;
  34401. return n < t && this.resize((n *= 2) > t ? n : t),
  34402. t -= 1,
  34403. this.view[t] = e,
  34404. i && (this.offset += 1),
  34405. this
  34406. }
  34407. ,
  34408. a.writeUInt8 = a.writeUint8,
  34409. a.readUint8 = function(e) {
  34410. var t = void 0 === e;
  34411. if (t && (e = this.offset),
  34412. !this.noAssert) {
  34413. if ("number" != typeof e || e % 1 != 0)
  34414. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34415. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34416. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34417. }
  34418. var i = this.view[e];
  34419. return t && (this.offset += 1),
  34420. i
  34421. }
  34422. ,
  34423. a.readUInt8 = a.readUint8,
  34424. a.writeInt16 = function(e, t) {
  34425. var i = void 0 === t;
  34426. if (i && (t = this.offset),
  34427. !this.noAssert) {
  34428. if ("number" != typeof e || e % 1 != 0)
  34429. throw TypeError("Illegal value: " + e + " (not an integer)");
  34430. if (e |= 0,
  34431. "number" != typeof t || t % 1 != 0)
  34432. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34433. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34434. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34435. }
  34436. t += 2;
  34437. var n = this.buffer.byteLength;
  34438. return n < t && this.resize((n *= 2) > t ? n : t),
  34439. t -= 2,
  34440. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34441. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34442. this.view[t + 1] = 255 & e),
  34443. i && (this.offset += 2),
  34444. this
  34445. }
  34446. ,
  34447. a.writeShort = a.writeInt16,
  34448. a.readInt16 = function(e) {
  34449. var t = void 0 === e;
  34450. if (t && (e = this.offset),
  34451. !this.noAssert) {
  34452. if ("number" != typeof e || e % 1 != 0)
  34453. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34454. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34455. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34456. }
  34457. var i = 0;
  34458. return this.littleEndian ? (i = this.view[e],
  34459. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34460. i |= this.view[e + 1]),
  34461. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34462. t && (this.offset += 2),
  34463. i
  34464. }
  34465. ,
  34466. a.readShort = a.readInt16,
  34467. a.writeUint16 = function(e, t) {
  34468. var i = void 0 === t;
  34469. if (i && (t = this.offset),
  34470. !this.noAssert) {
  34471. if ("number" != typeof e || e % 1 != 0)
  34472. throw TypeError("Illegal value: " + e + " (not an integer)");
  34473. if (e >>>= 0,
  34474. "number" != typeof t || t % 1 != 0)
  34475. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34476. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34477. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34478. }
  34479. t += 2;
  34480. var n = this.buffer.byteLength;
  34481. return n < t && this.resize((n *= 2) > t ? n : t),
  34482. t -= 2,
  34483. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34484. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34485. this.view[t + 1] = 255 & e),
  34486. i && (this.offset += 2),
  34487. this
  34488. }
  34489. ,
  34490. a.writeUInt16 = a.writeUint16,
  34491. a.readUint16 = function(e) {
  34492. var t = void 0 === e;
  34493. if (t && (e = this.offset),
  34494. !this.noAssert) {
  34495. if ("number" != typeof e || e % 1 != 0)
  34496. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34497. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34498. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34499. }
  34500. var i = 0;
  34501. return this.littleEndian ? (i = this.view[e],
  34502. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34503. i |= this.view[e + 1]),
  34504. t && (this.offset += 2),
  34505. i
  34506. }
  34507. ,
  34508. a.readUInt16 = a.readUint16,
  34509. a.writeInt32 = function(e, t) {
  34510. var i = void 0 === t;
  34511. if (i && (t = this.offset),
  34512. !this.noAssert) {
  34513. if ("number" != typeof e || e % 1 != 0)
  34514. throw TypeError("Illegal value: " + e + " (not an integer)");
  34515. if (e |= 0,
  34516. "number" != typeof t || t % 1 != 0)
  34517. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34518. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34519. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34520. }
  34521. t += 4;
  34522. var n = this.buffer.byteLength;
  34523. return n < t && this.resize((n *= 2) > t ? n : t),
  34524. t -= 4,
  34525. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34526. this.view[t + 2] = e >>> 16 & 255,
  34527. this.view[t + 1] = e >>> 8 & 255,
  34528. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34529. this.view[t + 1] = e >>> 16 & 255,
  34530. this.view[t + 2] = e >>> 8 & 255,
  34531. this.view[t + 3] = 255 & e),
  34532. i && (this.offset += 4),
  34533. this
  34534. }
  34535. ,
  34536. a.writeInt = a.writeInt32,
  34537. a.readInt32 = function(e) {
  34538. var t = void 0 === e;
  34539. if (t && (e = this.offset),
  34540. !this.noAssert) {
  34541. if ("number" != typeof e || e % 1 != 0)
  34542. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34543. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34544. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34545. }
  34546. var i = 0;
  34547. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34548. i |= this.view[e + 1] << 8,
  34549. i |= this.view[e],
  34550. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34551. i |= this.view[e + 2] << 8,
  34552. i |= this.view[e + 3],
  34553. i += this.view[e] << 24 >>> 0),
  34554. i |= 0,
  34555. t && (this.offset += 4),
  34556. i
  34557. }
  34558. ,
  34559. a.readInt = a.readInt32,
  34560. a.writeUint32 = function(e, t) {
  34561. var i = void 0 === t;
  34562. if (i && (t = this.offset),
  34563. !this.noAssert) {
  34564. if ("number" != typeof e || e % 1 != 0)
  34565. throw TypeError("Illegal value: " + e + " (not an integer)");
  34566. if (e >>>= 0,
  34567. "number" != typeof t || t % 1 != 0)
  34568. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34569. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34570. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34571. }
  34572. t += 4;
  34573. var n = this.buffer.byteLength;
  34574. return n < t && this.resize((n *= 2) > t ? n : t),
  34575. t -= 4,
  34576. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34577. this.view[t + 2] = e >>> 16 & 255,
  34578. this.view[t + 1] = e >>> 8 & 255,
  34579. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34580. this.view[t + 1] = e >>> 16 & 255,
  34581. this.view[t + 2] = e >>> 8 & 255,
  34582. this.view[t + 3] = 255 & e),
  34583. i && (this.offset += 4),
  34584. this
  34585. }
  34586. ,
  34587. a.writeUInt32 = a.writeUint32,
  34588. a.readUint32 = function(e) {
  34589. var t = void 0 === e;
  34590. if (t && (e = this.offset),
  34591. !this.noAssert) {
  34592. if ("number" != typeof e || e % 1 != 0)
  34593. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34594. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34595. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34596. }
  34597. var i = 0;
  34598. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34599. i |= this.view[e + 1] << 8,
  34600. i |= this.view[e],
  34601. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34602. i |= this.view[e + 2] << 8,
  34603. i |= this.view[e + 3],
  34604. i += this.view[e] << 24 >>> 0),
  34605. t && (this.offset += 4),
  34606. i
  34607. }
  34608. ,
  34609. a.readUInt32 = a.readUint32,
  34610. l && (a.writeInt64 = function(e, t) {
  34611. var i = void 0 === t;
  34612. if (i && (t = this.offset),
  34613. !this.noAssert) {
  34614. if ("number" == typeof e)
  34615. e = l.fromNumber(e);
  34616. else if ("string" == typeof e)
  34617. e = l.fromString(e);
  34618. else if (!(e && e instanceof l))
  34619. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34620. if ("number" != typeof t || t % 1 != 0)
  34621. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34622. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34623. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34624. }
  34625. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34626. t += 8;
  34627. var n = this.buffer.byteLength;
  34628. n < t && this.resize((n *= 2) > t ? n : t),
  34629. t -= 8;
  34630. var r = e.low
  34631. , o = e.high;
  34632. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34633. this.view[t + 2] = r >>> 16 & 255,
  34634. this.view[t + 1] = r >>> 8 & 255,
  34635. this.view[t] = 255 & r,
  34636. t += 4,
  34637. this.view[t + 3] = o >>> 24 & 255,
  34638. this.view[t + 2] = o >>> 16 & 255,
  34639. this.view[t + 1] = o >>> 8 & 255,
  34640. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34641. this.view[t + 1] = o >>> 16 & 255,
  34642. this.view[t + 2] = o >>> 8 & 255,
  34643. this.view[t + 3] = 255 & o,
  34644. t += 4,
  34645. this.view[t] = r >>> 24 & 255,
  34646. this.view[t + 1] = r >>> 16 & 255,
  34647. this.view[t + 2] = r >>> 8 & 255,
  34648. this.view[t + 3] = 255 & r),
  34649. i && (this.offset += 8),
  34650. this
  34651. }
  34652. ,
  34653. a.writeLong = a.writeInt64,
  34654. a.readInt64 = function(e) {
  34655. var t = void 0 === e;
  34656. if (t && (e = this.offset),
  34657. !this.noAssert) {
  34658. if ("number" != typeof e || e % 1 != 0)
  34659. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34660. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34661. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34662. }
  34663. var i = 0
  34664. , n = 0;
  34665. this.littleEndian ? (i = this.view[e + 2] << 16,
  34666. i |= this.view[e + 1] << 8,
  34667. i |= this.view[e],
  34668. i += this.view[e + 3] << 24 >>> 0,
  34669. e += 4,
  34670. n = this.view[e + 2] << 16,
  34671. n |= this.view[e + 1] << 8,
  34672. n |= this.view[e],
  34673. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34674. n |= this.view[e + 2] << 8,
  34675. n |= this.view[e + 3],
  34676. n += this.view[e] << 24 >>> 0,
  34677. e += 4,
  34678. i = this.view[e + 1] << 16,
  34679. i |= this.view[e + 2] << 8,
  34680. i |= this.view[e + 3],
  34681. i += this.view[e] << 24 >>> 0);
  34682. var r = new l(i,n,!1);
  34683. return t && (this.offset += 8),
  34684. r
  34685. }
  34686. ,
  34687. a.readLong = a.readInt64,
  34688. a.writeUint64 = function(e, t) {
  34689. var i = void 0 === t;
  34690. if (i && (t = this.offset),
  34691. !this.noAssert) {
  34692. if ("number" == typeof e)
  34693. e = l.fromNumber(e);
  34694. else if ("string" == typeof e)
  34695. e = l.fromString(e);
  34696. else if (!(e && e instanceof l))
  34697. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34698. if ("number" != typeof t || t % 1 != 0)
  34699. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34700. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34701. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34702. }
  34703. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34704. t += 8;
  34705. var n = this.buffer.byteLength;
  34706. n < t && this.resize((n *= 2) > t ? n : t),
  34707. t -= 8;
  34708. var r = e.low
  34709. , o = e.high;
  34710. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34711. this.view[t + 2] = r >>> 16 & 255,
  34712. this.view[t + 1] = r >>> 8 & 255,
  34713. this.view[t] = 255 & r,
  34714. t += 4,
  34715. this.view[t + 3] = o >>> 24 & 255,
  34716. this.view[t + 2] = o >>> 16 & 255,
  34717. this.view[t + 1] = o >>> 8 & 255,
  34718. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34719. this.view[t + 1] = o >>> 16 & 255,
  34720. this.view[t + 2] = o >>> 8 & 255,
  34721. this.view[t + 3] = 255 & o,
  34722. t += 4,
  34723. this.view[t] = r >>> 24 & 255,
  34724. this.view[t + 1] = r >>> 16 & 255,
  34725. this.view[t + 2] = r >>> 8 & 255,
  34726. this.view[t + 3] = 255 & r),
  34727. i && (this.offset += 8),
  34728. this
  34729. }
  34730. ,
  34731. a.writeUInt64 = a.writeUint64,
  34732. a.readUint64 = function(e) {
  34733. var t = void 0 === e;
  34734. if (t && (e = this.offset),
  34735. !this.noAssert) {
  34736. if ("number" != typeof e || e % 1 != 0)
  34737. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34738. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34739. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34740. }
  34741. var i = 0
  34742. , n = 0;
  34743. this.littleEndian ? (i = this.view[e + 2] << 16,
  34744. i |= this.view[e + 1] << 8,
  34745. i |= this.view[e],
  34746. i += this.view[e + 3] << 24 >>> 0,
  34747. e += 4,
  34748. n = this.view[e + 2] << 16,
  34749. n |= this.view[e + 1] << 8,
  34750. n |= this.view[e],
  34751. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34752. n |= this.view[e + 2] << 8,
  34753. n |= this.view[e + 3],
  34754. n += this.view[e] << 24 >>> 0,
  34755. e += 4,
  34756. i = this.view[e + 1] << 16,
  34757. i |= this.view[e + 2] << 8,
  34758. i |= this.view[e + 3],
  34759. i += this.view[e] << 24 >>> 0);
  34760. var r = new l(i,n,!0);
  34761. return t && (this.offset += 8),
  34762. r
  34763. }
  34764. ,
  34765. a.readUInt64 = a.readUint64),
  34766. a.writeFloat32 = function(e, t) {
  34767. var i = void 0 === t;
  34768. if (i && (t = this.offset),
  34769. !this.noAssert) {
  34770. if ("number" != typeof e)
  34771. throw TypeError("Illegal value: " + e + " (not a number)");
  34772. if ("number" != typeof t || t % 1 != 0)
  34773. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34774. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34775. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34776. }
  34777. t += 4;
  34778. var n = this.buffer.byteLength;
  34779. return n < t && this.resize((n *= 2) > t ? n : t),
  34780. t -= 4,
  34781. r(this.view, e, t, this.littleEndian, 23, 4),
  34782. i && (this.offset += 4),
  34783. this
  34784. }
  34785. ,
  34786. a.writeFloat = a.writeFloat32,
  34787. a.readFloat32 = function(e) {
  34788. var t = void 0 === e;
  34789. if (t && (e = this.offset),
  34790. !this.noAssert) {
  34791. if ("number" != typeof e || e % 1 != 0)
  34792. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34793. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34794. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34795. }
  34796. var i = n(this.view, e, this.littleEndian, 23, 4);
  34797. return t && (this.offset += 4),
  34798. i
  34799. }
  34800. ,
  34801. a.readFloat = a.readFloat32,
  34802. a.writeFloat64 = function(e, t) {
  34803. var i = void 0 === t;
  34804. if (i && (t = this.offset),
  34805. !this.noAssert) {
  34806. if ("number" != typeof e)
  34807. throw TypeError("Illegal value: " + e + " (not a number)");
  34808. if ("number" != typeof t || t % 1 != 0)
  34809. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34810. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34811. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34812. }
  34813. t += 8;
  34814. var n = this.buffer.byteLength;
  34815. return n < t && this.resize((n *= 2) > t ? n : t),
  34816. t -= 8,
  34817. r(this.view, e, t, this.littleEndian, 52, 8),
  34818. i && (this.offset += 8),
  34819. this
  34820. }
  34821. ,
  34822. a.writeDouble = a.writeFloat64,
  34823. a.readFloat64 = function(e) {
  34824. var t = void 0 === e;
  34825. if (t && (e = this.offset),
  34826. !this.noAssert) {
  34827. if ("number" != typeof e || e % 1 != 0)
  34828. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34829. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34830. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34831. }
  34832. var i = n(this.view, e, this.littleEndian, 52, 8);
  34833. return t && (this.offset += 8),
  34834. i
  34835. }
  34836. ,
  34837. a.readDouble = a.readFloat64,
  34838. f.MAX_VARINT32_BYTES = 5,
  34839. f.calculateVarint32 = function(e) {
  34840. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  34841. }
  34842. ,
  34843. f.zigZagEncode32 = function(e) {
  34844. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  34845. }
  34846. ,
  34847. f.zigZagDecode32 = function(e) {
  34848. return e >>> 1 ^ -(1 & e) | 0
  34849. }
  34850. ,
  34851. a.writeVarint32 = function(e, t) {
  34852. var i = void 0 === t;
  34853. if (i && (t = this.offset),
  34854. !this.noAssert) {
  34855. if ("number" != typeof e || e % 1 != 0)
  34856. throw TypeError("Illegal value: " + e + " (not an integer)");
  34857. if (e |= 0,
  34858. "number" != typeof t || t % 1 != 0)
  34859. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34860. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34861. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34862. }
  34863. var n, r = f.calculateVarint32(e);
  34864. t += r;
  34865. var o = this.buffer.byteLength;
  34866. for (o < t && this.resize((o *= 2) > t ? o : t),
  34867. t -= r,
  34868. e >>>= 0; 128 <= e; )
  34869. n = 127 & e | 128,
  34870. this.view[t++] = n,
  34871. e >>>= 7;
  34872. return this.view[t++] = e,
  34873. i ? (this.offset = t,
  34874. this) : r
  34875. }
  34876. ,
  34877. a.writeVarint32ZigZag = function(e, t) {
  34878. return this.writeVarint32(f.zigZagEncode32(e), t)
  34879. }
  34880. ,
  34881. a.readVarint32 = function(e) {
  34882. var t = void 0 === e;
  34883. if (t && (e = this.offset),
  34884. !this.noAssert) {
  34885. if ("number" != typeof e || e % 1 != 0)
  34886. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34887. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34888. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34889. }
  34890. var i, n = 0, r = 0;
  34891. do {
  34892. if (!this.noAssert && e > this.limit) {
  34893. var o = Error("Truncated");
  34894. throw o.truncated = !0,
  34895. o
  34896. }
  34897. i = this.view[e++],
  34898. n < 5 && (r |= (127 & i) << 7 * n),
  34899. ++n
  34900. } while (0 != (128 & i));return r |= 0,
  34901. t ? (this.offset = e,
  34902. r) : {
  34903. value: r,
  34904. length: n
  34905. }
  34906. }
  34907. ,
  34908. a.readVarint32ZigZag = function(e) {
  34909. var t = this.readVarint32(e);
  34910. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  34911. t
  34912. }
  34913. ,
  34914. l && (f.MAX_VARINT64_BYTES = 10,
  34915. f.calculateVarint64 = function(e) {
  34916. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  34917. var t = e.toInt() >>> 0
  34918. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  34919. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  34920. return 0 == n ? 0 == i ? t < 16384 ? t < 128 ? 1 : 2 : t < 1 << 21 ? 3 : 4 : i < 16384 ? i < 128 ? 5 : 6 : i < 1 << 21 ? 7 : 8 : n < 128 ? 9 : 10
  34921. }
  34922. ,
  34923. f.zigZagEncode64 = function(e) {
  34924. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  34925. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  34926. }
  34927. ,
  34928. f.zigZagDecode64 = function(e) {
  34929. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  34930. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  34931. }
  34932. ,
  34933. a.writeVarint64 = function(e, t) {
  34934. var i = void 0 === t;
  34935. if (i && (t = this.offset),
  34936. !this.noAssert) {
  34937. if ("number" == typeof e)
  34938. e = l.fromNumber(e);
  34939. else if ("string" == typeof e)
  34940. e = l.fromString(e);
  34941. else if (!(e && e instanceof l))
  34942. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34943. if ("number" != typeof t || t % 1 != 0)
  34944. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34945. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34946. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34947. }
  34948. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  34949. var n = f.calculateVarint64(e)
  34950. , r = e.toInt() >>> 0
  34951. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  34952. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  34953. t += n;
  34954. var s = this.buffer.byteLength;
  34955. switch (s < t && this.resize((s *= 2) > t ? s : t),
  34956. t -= n,
  34957. n) {
  34958. case 10:
  34959. this.view[t + 9] = a >>> 7 & 1;
  34960. case 9:
  34961. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  34962. case 8:
  34963. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  34964. case 7:
  34965. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  34966. case 6:
  34967. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  34968. case 5:
  34969. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  34970. case 4:
  34971. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  34972. case 3:
  34973. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  34974. case 2:
  34975. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  34976. case 1:
  34977. this.view[t] = 1 !== n ? 128 | r : 127 & r
  34978. }
  34979. return i ? (this.offset += n,
  34980. this) : n
  34981. }
  34982. ,
  34983. a.writeVarint64ZigZag = function(e, t) {
  34984. return this.writeVarint64(f.zigZagEncode64(e), t)
  34985. }
  34986. ,
  34987. a.readVarint64 = function(e) {
  34988. var t = void 0 === e;
  34989. if (t && (e = this.offset),
  34990. !this.noAssert) {
  34991. if ("number" != typeof e || e % 1 != 0)
  34992. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34993. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34994. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34995. }
  34996. var i = e
  34997. , n = 0
  34998. , r = 0
  34999. , o = 0
  35000. , a = 0;
  35001. if (n = 127 & (a = this.view[e++]),
  35002. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35003. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35004. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35005. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35006. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35007. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35008. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35009. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35010. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35011. 128 & a || this.noAssert && void 0 === a))))))))))
  35012. throw Error("Buffer overrun");
  35013. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35014. return t ? (this.offset = e,
  35015. s) : {
  35016. value: s,
  35017. length: e - i
  35018. }
  35019. }
  35020. ,
  35021. a.readVarint64ZigZag = function(e) {
  35022. var t = this.readVarint64(e);
  35023. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35024. t
  35025. }
  35026. ),
  35027. a.writeCString = function(e, t) {
  35028. var i = void 0 === t;
  35029. i && (t = this.offset);
  35030. var n, r = e.length;
  35031. if (!this.noAssert) {
  35032. if ("string" != typeof e)
  35033. throw TypeError("Illegal str: Not a string");
  35034. for (n = 0; n < r; ++n)
  35035. if (0 === e.charCodeAt(n))
  35036. throw RangeError("Illegal str: Contains NULL-characters");
  35037. if ("number" != typeof t || t % 1 != 0)
  35038. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35039. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35040. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35041. }
  35042. r = d.calculateUTF16asUTF8(s(e))[1],
  35043. t += r + 1;
  35044. var o = this.buffer.byteLength;
  35045. return o < t && this.resize((o *= 2) > t ? o : t),
  35046. t -= r + 1,
  35047. d.encodeUTF16toUTF8(s(e), function(e) {
  35048. this.view[t++] = e
  35049. }
  35050. .bind(this)),
  35051. this.view[t++] = 0,
  35052. i ? (this.offset = t,
  35053. this) : r
  35054. }
  35055. ,
  35056. a.readCString = function(e) {
  35057. var t = void 0 === e;
  35058. if (t && (e = this.offset),
  35059. !this.noAssert) {
  35060. if ("number" != typeof e || e % 1 != 0)
  35061. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35062. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35063. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35064. }
  35065. var i, n = e, r = -1;
  35066. return d.decodeUTF8toUTF16(function() {
  35067. if (0 === r)
  35068. return null;
  35069. if (e >= this.limit)
  35070. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35071. return 0 === (r = this.view[e++]) ? null : r
  35072. }
  35073. .bind(this), i = c(), !0),
  35074. t ? (this.offset = e,
  35075. i()) : {
  35076. string: i(),
  35077. length: e - n
  35078. }
  35079. }
  35080. ,
  35081. a.writeIString = function(e, t) {
  35082. var i = void 0 === t;
  35083. if (i && (t = this.offset),
  35084. !this.noAssert) {
  35085. if ("string" != typeof e)
  35086. throw TypeError("Illegal str: Not a string");
  35087. if ("number" != typeof t || t % 1 != 0)
  35088. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35089. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35090. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35091. }
  35092. var n, r = t;
  35093. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35094. t += 4 + n;
  35095. var o = this.buffer.byteLength;
  35096. if (o < t && this.resize((o *= 2) > t ? o : t),
  35097. t -= 4 + n,
  35098. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35099. this.view[t + 2] = n >>> 16 & 255,
  35100. this.view[t + 1] = n >>> 8 & 255,
  35101. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35102. this.view[t + 1] = n >>> 16 & 255,
  35103. this.view[t + 2] = n >>> 8 & 255,
  35104. this.view[t + 3] = 255 & n),
  35105. t += 4,
  35106. d.encodeUTF16toUTF8(s(e), function(e) {
  35107. this.view[t++] = e
  35108. }
  35109. .bind(this)),
  35110. t !== r + 4 + n)
  35111. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35112. return i ? (this.offset = t,
  35113. this) : t - r
  35114. }
  35115. ,
  35116. a.readIString = function(e) {
  35117. var t = void 0 === e;
  35118. if (t && (e = this.offset),
  35119. !this.noAssert) {
  35120. if ("number" != typeof e || e % 1 != 0)
  35121. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35122. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35123. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35124. }
  35125. var i = e
  35126. , n = this.readUint32(e)
  35127. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35128. return e += r.length,
  35129. t ? (this.offset = e,
  35130. r.string) : {
  35131. string: r.string,
  35132. length: e - i
  35133. }
  35134. }
  35135. ,
  35136. f.METRICS_CHARS = "c",
  35137. f.METRICS_BYTES = "b",
  35138. a.writeUTF8String = function(e, t) {
  35139. var i = void 0 === t;
  35140. if (i && (t = this.offset),
  35141. !this.noAssert) {
  35142. if ("number" != typeof t || t % 1 != 0)
  35143. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35144. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35145. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35146. }
  35147. var n, r = t;
  35148. n = d.calculateUTF16asUTF8(s(e))[1],
  35149. t += n;
  35150. var o = this.buffer.byteLength;
  35151. return o < t && this.resize((o *= 2) > t ? o : t),
  35152. t -= n,
  35153. d.encodeUTF16toUTF8(s(e), function(e) {
  35154. this.view[t++] = e
  35155. }
  35156. .bind(this)),
  35157. i ? (this.offset = t,
  35158. this) : t - r
  35159. }
  35160. ,
  35161. a.writeString = a.writeUTF8String,
  35162. f.calculateUTF8Chars = function(e) {
  35163. return d.calculateUTF16asUTF8(s(e))[0]
  35164. }
  35165. ,
  35166. f.calculateUTF8Bytes = function(e) {
  35167. return d.calculateUTF16asUTF8(s(e))[1]
  35168. }
  35169. ,
  35170. f.calculateString = f.calculateUTF8Bytes,
  35171. a.readUTF8String = function(e, t, i) {
  35172. "number" == typeof t && (i = t,
  35173. t = void 0);
  35174. var n = void 0 === i;
  35175. if (n && (i = this.offset),
  35176. void 0 === t && (t = f.METRICS_CHARS),
  35177. !this.noAssert) {
  35178. if ("number" != typeof e || e % 1 != 0)
  35179. throw TypeError("Illegal length: " + e + " (not an integer)");
  35180. if (e |= 0,
  35181. "number" != typeof i || i % 1 != 0)
  35182. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35183. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35184. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35185. }
  35186. var r, o = 0, a = i;
  35187. if (t === f.METRICS_CHARS) {
  35188. if (r = c(),
  35189. d.decodeUTF8(function() {
  35190. return o < e && i < this.limit ? this.view[i++] : null
  35191. }
  35192. .bind(this), function(e) {
  35193. ++o,
  35194. d.UTF8toUTF16(e, r)
  35195. }),
  35196. o !== e)
  35197. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35198. return n ? (this.offset = i,
  35199. r()) : {
  35200. string: r(),
  35201. length: i - a
  35202. }
  35203. }
  35204. if (t !== f.METRICS_BYTES)
  35205. throw TypeError("Unsupported metrics: " + t);
  35206. if (!this.noAssert) {
  35207. if ("number" != typeof i || i % 1 != 0)
  35208. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35209. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35210. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35211. }
  35212. var s = i + e;
  35213. if (d.decodeUTF8toUTF16(function() {
  35214. return i < s ? this.view[i++] : null
  35215. }
  35216. .bind(this), r = c(), this.noAssert),
  35217. i !== s)
  35218. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35219. return n ? (this.offset = i,
  35220. r()) : {
  35221. string: r(),
  35222. length: i - a
  35223. }
  35224. }
  35225. ,
  35226. a.readString = a.readUTF8String,
  35227. a.writeVString = function(e, t) {
  35228. var i = void 0 === t;
  35229. if (i && (t = this.offset),
  35230. !this.noAssert) {
  35231. if ("string" != typeof e)
  35232. throw TypeError("Illegal str: Not a string");
  35233. if ("number" != typeof t || t % 1 != 0)
  35234. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35235. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35236. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35237. }
  35238. var n, r, o = t;
  35239. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35240. r = f.calculateVarint32(n),
  35241. t += r + n;
  35242. var a = this.buffer.byteLength;
  35243. if (a < t && this.resize((a *= 2) > t ? a : t),
  35244. t -= r + n,
  35245. t += this.writeVarint32(n, t),
  35246. d.encodeUTF16toUTF8(s(e), function(e) {
  35247. this.view[t++] = e
  35248. }
  35249. .bind(this)),
  35250. t !== o + n + r)
  35251. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35252. return i ? (this.offset = t,
  35253. this) : t - o
  35254. }
  35255. ,
  35256. a.readVString = function(e) {
  35257. var t = void 0 === e;
  35258. if (t && (e = this.offset),
  35259. !this.noAssert) {
  35260. if ("number" != typeof e || e % 1 != 0)
  35261. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35262. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35263. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35264. }
  35265. var i = e
  35266. , n = this.readVarint32(e)
  35267. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35268. return e += r.length,
  35269. t ? (this.offset = e,
  35270. r.string) : {
  35271. string: r.string,
  35272. length: e - i
  35273. }
  35274. }
  35275. ,
  35276. a.append = function(e, t, i) {
  35277. "number" != typeof t && "string" == typeof t || (i = t,
  35278. t = void 0);
  35279. var n = void 0 === i;
  35280. if (n && (i = this.offset),
  35281. !this.noAssert) {
  35282. if ("number" != typeof i || i % 1 != 0)
  35283. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35284. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35285. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35286. }
  35287. e instanceof f || (e = f.wrap(e, t));
  35288. var r = e.limit - e.offset;
  35289. if (r <= 0)
  35290. return this;
  35291. i += r;
  35292. var o = this.buffer.byteLength;
  35293. return o < i && this.resize((o *= 2) > i ? o : i),
  35294. i -= r,
  35295. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35296. e.offset += r,
  35297. n && (this.offset += r),
  35298. this
  35299. }
  35300. ,
  35301. a.appendTo = function(e, t) {
  35302. return e.append(this, t),
  35303. this
  35304. }
  35305. ,
  35306. a.assert = function(e) {
  35307. return this.noAssert = !e,
  35308. this
  35309. }
  35310. ,
  35311. a.capacity = function() {
  35312. return this.buffer.byteLength
  35313. }
  35314. ,
  35315. a.clear = function() {
  35316. return this.offset = 0,
  35317. this.limit = this.buffer.byteLength,
  35318. this.markedOffset = -1,
  35319. this
  35320. }
  35321. ,
  35322. a.clone = function(e) {
  35323. var t = new f(0,this.littleEndian,this.noAssert);
  35324. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35325. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35326. t.view = this.view),
  35327. t.offset = this.offset,
  35328. t.markedOffset = this.markedOffset,
  35329. t.limit = this.limit,
  35330. t
  35331. }
  35332. ,
  35333. a.compact = function(e, t) {
  35334. if (void 0 === e && (e = this.offset),
  35335. void 0 === t && (t = this.limit),
  35336. !this.noAssert) {
  35337. if ("number" != typeof e || e % 1 != 0)
  35338. throw TypeError("Illegal begin: Not an integer");
  35339. if (e >>>= 0,
  35340. "number" != typeof t || t % 1 != 0)
  35341. throw TypeError("Illegal end: Not an integer");
  35342. if (t >>>= 0,
  35343. e < 0 || t < e || t > this.buffer.byteLength)
  35344. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35345. }
  35346. if (0 === e && t === this.buffer.byteLength)
  35347. return this;
  35348. var i = t - e;
  35349. if (0 == i)
  35350. return this.buffer = o,
  35351. this.view = null,
  35352. 0 <= this.markedOffset && (this.markedOffset -= e),
  35353. this.offset = 0,
  35354. this.limit = 0,
  35355. this;
  35356. var n = new ArrayBuffer(i)
  35357. , r = new Uint8Array(n);
  35358. return r.set(this.view.subarray(e, t)),
  35359. this.buffer = n,
  35360. this.view = r,
  35361. 0 <= this.markedOffset && (this.markedOffset -= e),
  35362. this.offset = 0,
  35363. this.limit = i,
  35364. this
  35365. }
  35366. ,
  35367. a.copy = function(e, t) {
  35368. if (void 0 === e && (e = this.offset),
  35369. void 0 === t && (t = this.limit),
  35370. !this.noAssert) {
  35371. if ("number" != typeof e || e % 1 != 0)
  35372. throw TypeError("Illegal begin: Not an integer");
  35373. if (e >>>= 0,
  35374. "number" != typeof t || t % 1 != 0)
  35375. throw TypeError("Illegal end: Not an integer");
  35376. if (t >>>= 0,
  35377. e < 0 || t < e || t > this.buffer.byteLength)
  35378. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35379. }
  35380. if (e === t)
  35381. return new f(0,this.littleEndian,this.noAssert);
  35382. var i = t - e
  35383. , n = new f(i,this.littleEndian,this.noAssert);
  35384. return n.offset = 0,
  35385. n.limit = i,
  35386. 0 <= n.markedOffset && (n.markedOffset -= e),
  35387. this.copyTo(n, 0, e, t),
  35388. n
  35389. }
  35390. ,
  35391. a.copyTo = function(e, t, i, n) {
  35392. var r, o;
  35393. if (!this.noAssert && !f.isByteBuffer(e))
  35394. throw TypeError("Illegal target: Not a ByteBuffer");
  35395. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35396. i = (r = void 0 === i) ? this.offset : 0 | i,
  35397. n = void 0 === n ? this.limit : 0 | n,
  35398. t < 0 || t > e.buffer.byteLength)
  35399. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35400. if (i < 0 || n > this.buffer.byteLength)
  35401. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35402. var a = n - i;
  35403. return 0 == a ? e : (e.ensureCapacity(t + a),
  35404. e.view.set(this.view.subarray(i, n), t),
  35405. r && (this.offset += a),
  35406. o && (e.offset += a),
  35407. this)
  35408. }
  35409. ,
  35410. a.ensureCapacity = function(e) {
  35411. var t = this.buffer.byteLength;
  35412. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35413. }
  35414. ,
  35415. a.fill = function(e, t, i) {
  35416. var n = void 0 === t;
  35417. if (n && (t = this.offset),
  35418. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35419. void 0 === t && (t = this.offset),
  35420. void 0 === i && (i = this.limit),
  35421. !this.noAssert) {
  35422. if ("number" != typeof e || e % 1 != 0)
  35423. throw TypeError("Illegal value: " + e + " (not an integer)");
  35424. if (e |= 0,
  35425. "number" != typeof t || t % 1 != 0)
  35426. throw TypeError("Illegal begin: Not an integer");
  35427. if (t >>>= 0,
  35428. "number" != typeof i || i % 1 != 0)
  35429. throw TypeError("Illegal end: Not an integer");
  35430. if (i >>>= 0,
  35431. t < 0 || i < t || i > this.buffer.byteLength)
  35432. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35433. }
  35434. if (i <= t)
  35435. return this;
  35436. for (; t < i; )
  35437. this.view[t++] = e;
  35438. return n && (this.offset = t),
  35439. this
  35440. }
  35441. ,
  35442. a.flip = function() {
  35443. return this.limit = this.offset,
  35444. this.offset = 0,
  35445. this
  35446. }
  35447. ,
  35448. a.mark = function(e) {
  35449. if (e = void 0 === e ? this.offset : e,
  35450. !this.noAssert) {
  35451. if ("number" != typeof e || e % 1 != 0)
  35452. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35453. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35454. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35455. }
  35456. return this.markedOffset = e,
  35457. this
  35458. }
  35459. ,
  35460. a.order = function(e) {
  35461. if (!this.noAssert && "boolean" != typeof e)
  35462. throw TypeError("Illegal littleEndian: Not a boolean");
  35463. return this.littleEndian = !!e,
  35464. this
  35465. }
  35466. ,
  35467. a.LE = function(e) {
  35468. return this.littleEndian = void 0 === e || !!e,
  35469. this
  35470. }
  35471. ,
  35472. a.BE = function(e) {
  35473. return this.littleEndian = void 0 !== e && !e,
  35474. this
  35475. }
  35476. ,
  35477. a.prepend = function(e, t, i) {
  35478. "number" != typeof t && "string" == typeof t || (i = t,
  35479. t = void 0);
  35480. var n = void 0 === i;
  35481. if (n && (i = this.offset),
  35482. !this.noAssert) {
  35483. if ("number" != typeof i || i % 1 != 0)
  35484. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35485. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35486. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35487. }
  35488. e instanceof f || (e = f.wrap(e, t));
  35489. var r = e.limit - e.offset;
  35490. if (r <= 0)
  35491. return this;
  35492. var o = r - i;
  35493. if (0 < o) {
  35494. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35495. , s = new Uint8Array(a);
  35496. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35497. this.buffer = a,
  35498. this.view = s,
  35499. this.offset += o,
  35500. 0 <= this.markedOffset && (this.markedOffset += o),
  35501. this.limit += o,
  35502. i += o
  35503. } else
  35504. new Uint8Array(this.buffer);
  35505. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35506. e.offset = e.limit,
  35507. n && (this.offset -= r),
  35508. this
  35509. }
  35510. ,
  35511. a.prependTo = function(e, t) {
  35512. return e.prepend(this, t),
  35513. this
  35514. }
  35515. ,
  35516. a.printDebug = function(e) {
  35517. "function" != typeof e && (e = console.log.bind(console)),
  35518. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35519. }
  35520. ,
  35521. a.remaining = function() {
  35522. return this.limit - this.offset
  35523. }
  35524. ,
  35525. a.reset = function() {
  35526. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35527. this.markedOffset = -1) : this.offset = 0,
  35528. this
  35529. }
  35530. ,
  35531. a.resize = function(e) {
  35532. if (!this.noAssert) {
  35533. if ("number" != typeof e || e % 1 != 0)
  35534. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35535. if ((e |= 0) < 0)
  35536. throw RangeError("Illegal capacity: 0 <= " + e)
  35537. }
  35538. if (this.buffer.byteLength < e) {
  35539. var t = new ArrayBuffer(e)
  35540. , i = new Uint8Array(t);
  35541. i.set(this.view),
  35542. this.buffer = t,
  35543. this.view = i
  35544. }
  35545. return this
  35546. }
  35547. ,
  35548. a.reverse = function(e, t) {
  35549. if (void 0 === e && (e = this.offset),
  35550. void 0 === t && (t = this.limit),
  35551. !this.noAssert) {
  35552. if ("number" != typeof e || e % 1 != 0)
  35553. throw TypeError("Illegal begin: Not an integer");
  35554. if (e >>>= 0,
  35555. "number" != typeof t || t % 1 != 0)
  35556. throw TypeError("Illegal end: Not an integer");
  35557. if (t >>>= 0,
  35558. e < 0 || t < e || t > this.buffer.byteLength)
  35559. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35560. }
  35561. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35562. this
  35563. }
  35564. ,
  35565. a.skip = function(e) {
  35566. if (!this.noAssert) {
  35567. if ("number" != typeof e || e % 1 != 0)
  35568. throw TypeError("Illegal length: " + e + " (not an integer)");
  35569. e |= 0
  35570. }
  35571. var t = this.offset + e;
  35572. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35573. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35574. return this.offset = t,
  35575. this
  35576. }
  35577. ,
  35578. a.slice = function(e, t) {
  35579. if (void 0 === e && (e = this.offset),
  35580. void 0 === t && (t = this.limit),
  35581. !this.noAssert) {
  35582. if ("number" != typeof e || e % 1 != 0)
  35583. throw TypeError("Illegal begin: Not an integer");
  35584. if (e >>>= 0,
  35585. "number" != typeof t || t % 1 != 0)
  35586. throw TypeError("Illegal end: Not an integer");
  35587. if (t >>>= 0,
  35588. e < 0 || t < e || t > this.buffer.byteLength)
  35589. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35590. }
  35591. var i = this.clone();
  35592. return i.offset = e,
  35593. i.limit = t,
  35594. i
  35595. }
  35596. ,
  35597. a.toBuffer = function(e) {
  35598. var t = this.offset
  35599. , i = this.limit;
  35600. if (!this.noAssert) {
  35601. if ("number" != typeof t || t % 1 != 0)
  35602. throw TypeError("Illegal offset: Not an integer");
  35603. if (t >>>= 0,
  35604. "number" != typeof i || i % 1 != 0)
  35605. throw TypeError("Illegal limit: Not an integer");
  35606. if (i >>>= 0,
  35607. t < 0 || i < t || i > this.buffer.byteLength)
  35608. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35609. }
  35610. if (!e && 0 === t && i === this.buffer.byteLength)
  35611. return this.buffer;
  35612. if (t === i)
  35613. return o;
  35614. var n = new ArrayBuffer(i - t);
  35615. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35616. n
  35617. }
  35618. ,
  35619. a.toArrayBuffer = a.toBuffer,
  35620. a.toString = function(e, t, i) {
  35621. if (void 0 === e)
  35622. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35623. switch ("number" == typeof e && (i = t = e = "utf8"),
  35624. e) {
  35625. case "utf8":
  35626. return this.toUTF8(t, i);
  35627. case "base64":
  35628. return this.toBase64(t, i);
  35629. case "hex":
  35630. return this.toHex(t, i);
  35631. case "binary":
  35632. return this.toBinary(t, i);
  35633. case "debug":
  35634. return this.toDebug();
  35635. case "columns":
  35636. return this.toColumns();
  35637. default:
  35638. throw Error("Unsupported encoding: " + e)
  35639. }
  35640. }
  35641. ;
  35642. var h = function() {
  35643. for (var e = {}, r = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], a = [], t = 0, i = r.length; t < i; ++t)
  35644. a[r[t]] = t;
  35645. return e.encode = function(e, t) {
  35646. for (var i, n; null !== (i = e()); )
  35647. t(r[i >> 2 & 63]),
  35648. n = (3 & i) << 4,
  35649. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  35650. n = (15 & i) << 2,
  35651. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  35652. t(r[63 & i])) : (t(r[63 & n]),
  35653. t(61))) : (t(r[63 & n]),
  35654. t(61),
  35655. t(61))
  35656. }
  35657. ,
  35658. e.decode = function(e, t) {
  35659. function i(e) {
  35660. throw Error("Illegal character code: " + e)
  35661. }
  35662. for (var n, r, o; null !== (n = e()); )
  35663. if (void 0 === (r = a[n]) && i(n),
  35664. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  35665. t(r << 2 >>> 0 | (48 & o) >> 4),
  35666. null !== (n = e()))) {
  35667. if (void 0 === (r = a[n])) {
  35668. if (61 === n)
  35669. break;
  35670. i(n)
  35671. }
  35672. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  35673. null !== (n = e())) {
  35674. if (void 0 === (o = a[n])) {
  35675. if (61 === n)
  35676. break;
  35677. i(n)
  35678. }
  35679. t((3 & r) << 6 >>> 0 | o)
  35680. }
  35681. }
  35682. }
  35683. ,
  35684. e.test = function(e) {
  35685. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  35686. }
  35687. ,
  35688. e
  35689. }();
  35690. a.toBase64 = function(e, t) {
  35691. if (void 0 === e && (e = this.offset),
  35692. void 0 === t && (t = this.limit),
  35693. t |= 0,
  35694. (e |= 0) < 0 || t > this.capacity || t < e)
  35695. throw RangeError("begin, end");
  35696. var i;
  35697. return h.encode(function() {
  35698. return e < t ? this.view[e++] : null
  35699. }
  35700. .bind(this), i = c()),
  35701. i()
  35702. }
  35703. ,
  35704. f.fromBase64 = function(e, t) {
  35705. if ("string" != typeof e)
  35706. throw TypeError("str");
  35707. var i = new f(e.length / 4 * 3,t)
  35708. , n = 0;
  35709. return h.decode(s(e), function(e) {
  35710. i.view[n++] = e
  35711. }),
  35712. i.limit = n,
  35713. i
  35714. }
  35715. ,
  35716. f.btoa = function(e) {
  35717. return f.fromBinary(e).toBase64()
  35718. }
  35719. ,
  35720. f.atob = function(e) {
  35721. return f.fromBase64(e).toBinary()
  35722. }
  35723. ,
  35724. a.toBinary = function(e, t) {
  35725. if (void 0 === e && (e = this.offset),
  35726. void 0 === t && (t = this.limit),
  35727. t |= 0,
  35728. (e |= 0) < 0 || t > this.capacity() || t < e)
  35729. throw RangeError("begin, end");
  35730. if (e === t)
  35731. return "";
  35732. for (var i = [], n = []; e < t; )
  35733. i.push(this.view[e++]),
  35734. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  35735. i = []);
  35736. return n.join("") + String.fromCharCode.apply(String, i)
  35737. }
  35738. ,
  35739. f.fromBinary = function(e, t) {
  35740. if ("string" != typeof e)
  35741. throw TypeError("str");
  35742. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  35743. if (255 < (i = e.charCodeAt(n)))
  35744. throw RangeError("illegal char code: " + i);
  35745. o.view[n++] = i
  35746. }
  35747. return o.limit = r,
  35748. o
  35749. }
  35750. ,
  35751. a.toDebug = function(e) {
  35752. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  35753. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  35754. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  35755. ++i,
  35756. e && 0 < i && i % 16 == 0 && i !== n) {
  35757. for (; r.length < 51; )
  35758. r += " ";
  35759. a += r + o + "\n",
  35760. r = o = ""
  35761. }
  35762. 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 ? " " : ""
  35763. }
  35764. if (e && " " !== r) {
  35765. for (; r.length < 51; )
  35766. r += " ";
  35767. a += r + o + "\n"
  35768. }
  35769. return e ? a : r
  35770. }
  35771. ,
  35772. f.fromDebug = function(e, t, i) {
  35773. for (var n, r, o = e.length, a = new f((o + 1) / 3 | 0,t,i), s = 0, l = 0, c = !1, h = !1, u = !1, d = !1, p = !1; s < o; ) {
  35774. switch (n = e.charAt(s++)) {
  35775. case "!":
  35776. if (!i) {
  35777. if (h || u || d) {
  35778. p = !0;
  35779. break
  35780. }
  35781. h = u = d = !0
  35782. }
  35783. a.offset = a.markedOffset = a.limit = l,
  35784. c = !1;
  35785. break;
  35786. case "|":
  35787. if (!i) {
  35788. if (h || d) {
  35789. p = !0;
  35790. break
  35791. }
  35792. h = d = !0
  35793. }
  35794. a.offset = a.limit = l,
  35795. c = !1;
  35796. break;
  35797. case "[":
  35798. if (!i) {
  35799. if (h || u) {
  35800. p = !0;
  35801. break
  35802. }
  35803. h = u = !0
  35804. }
  35805. a.offset = a.markedOffset = l,
  35806. c = !1;
  35807. break;
  35808. case "<":
  35809. if (!i) {
  35810. if (h) {
  35811. p = !0;
  35812. break
  35813. }
  35814. h = !0
  35815. }
  35816. a.offset = l,
  35817. c = !1;
  35818. break;
  35819. case "]":
  35820. if (!i) {
  35821. if (d || u) {
  35822. p = !0;
  35823. break
  35824. }
  35825. d = u = !0
  35826. }
  35827. a.limit = a.markedOffset = l,
  35828. c = !1;
  35829. break;
  35830. case ">":
  35831. if (!i) {
  35832. if (d) {
  35833. p = !0;
  35834. break
  35835. }
  35836. d = !0
  35837. }
  35838. a.limit = l,
  35839. c = !1;
  35840. break;
  35841. case "'":
  35842. if (!i) {
  35843. if (u) {
  35844. p = !0;
  35845. break
  35846. }
  35847. u = !0
  35848. }
  35849. a.markedOffset = l,
  35850. c = !1;
  35851. break;
  35852. case " ":
  35853. c = !1;
  35854. break;
  35855. default:
  35856. if (!i && c) {
  35857. p = !0;
  35858. break
  35859. }
  35860. if (r = parseInt(n + e.charAt(s++), 16),
  35861. !i && (isNaN(r) || r < 0 || 255 < r))
  35862. throw TypeError("Illegal str: Not a debug encoded string");
  35863. a.view[l++] = r,
  35864. c = !0
  35865. }
  35866. if (p)
  35867. throw TypeError("Illegal str: Invalid symbol at " + s)
  35868. }
  35869. if (!i) {
  35870. if (!h || !d)
  35871. throw TypeError("Illegal str: Missing offset or limit");
  35872. if (l < a.buffer.byteLength)
  35873. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  35874. }
  35875. return a
  35876. }
  35877. ,
  35878. a.toHex = function(e, t) {
  35879. if (e = void 0 === e ? this.offset : e,
  35880. t = void 0 === t ? this.limit : t,
  35881. !this.noAssert) {
  35882. if ("number" != typeof e || e % 1 != 0)
  35883. throw TypeError("Illegal begin: Not an integer");
  35884. if (e >>>= 0,
  35885. "number" != typeof t || t % 1 != 0)
  35886. throw TypeError("Illegal end: Not an integer");
  35887. if (t >>>= 0,
  35888. e < 0 || t < e || t > this.buffer.byteLength)
  35889. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35890. }
  35891. for (var i, n = new Array(t - e); e < t; )
  35892. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  35893. return n.join("")
  35894. }
  35895. ,
  35896. f.fromHex = function(e, t, i) {
  35897. if (!i) {
  35898. if ("string" != typeof e)
  35899. throw TypeError("Illegal str: Not a string");
  35900. if (e.length % 2 != 0)
  35901. throw TypeError("Illegal str: Length not a multiple of 2")
  35902. }
  35903. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  35904. if (n = parseInt(e.substring(a, a + 2), 16),
  35905. !i && (!isFinite(n) || n < 0 || 255 < n))
  35906. throw TypeError("Illegal str: Contains non-hex characters");
  35907. o.view[s++] = n
  35908. }
  35909. return o.limit = s,
  35910. o
  35911. }
  35912. ;
  35913. var u, d = u = {
  35914. MAX_CODEPOINT: 1114111,
  35915. encodeUTF8: function(e, t) {
  35916. var i = null;
  35917. for ("number" == typeof e && (i = e,
  35918. e = function() {
  35919. return null
  35920. }
  35921. ); null !== i || null !== (i = e()); )
  35922. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  35923. t(i >> 12 & 63 | 128)),
  35924. t(i >> 6 & 63 | 128)),
  35925. t(63 & i | 128)),
  35926. i = null
  35927. },
  35928. decodeUTF8: function(e, t) {
  35929. for (var i, n, r, o, a = function(e) {
  35930. e = e.slice(0, e.indexOf(null));
  35931. var t = Error(e.toString());
  35932. throw t.name = "TruncatedError",
  35933. t.bytes = e,
  35934. t
  35935. }; null !== (i = e()); )
  35936. if (0 == (128 & i))
  35937. t(i);
  35938. else if (192 == (224 & i))
  35939. null === (n = e()) && a([i, n]),
  35940. t((31 & i) << 6 | 63 & n);
  35941. else if (224 == (240 & i))
  35942. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  35943. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  35944. else {
  35945. if (240 != (248 & i))
  35946. throw RangeError("Illegal starting byte: " + i);
  35947. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  35948. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  35949. }
  35950. },
  35951. UTF16toUTF8: function(e, t) {
  35952. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  35953. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  35954. n = null) : t(i);
  35955. null !== n && t(n)
  35956. },
  35957. UTF8toUTF16: function(e, t) {
  35958. var i = null;
  35959. for ("number" == typeof e && (i = e,
  35960. e = function() {
  35961. return null
  35962. }
  35963. ); null !== i || null !== (i = e()); )
  35964. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  35965. t(i % 1024 + 56320)),
  35966. i = null
  35967. },
  35968. encodeUTF16toUTF8: function(e, t) {
  35969. u.UTF16toUTF8(e, function(e) {
  35970. u.encodeUTF8(e, t)
  35971. })
  35972. },
  35973. decodeUTF8toUTF16: function(e, t) {
  35974. u.decodeUTF8(e, function(e) {
  35975. u.UTF8toUTF16(e, t)
  35976. })
  35977. },
  35978. calculateCodePoint: function(e) {
  35979. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  35980. },
  35981. calculateUTF8: function(e) {
  35982. for (var t, i = 0; null !== (t = e()); )
  35983. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  35984. return i
  35985. },
  35986. calculateUTF16asUTF8: function(e) {
  35987. var t = 0
  35988. , i = 0;
  35989. return u.UTF16toUTF8(e, function(e) {
  35990. ++t,
  35991. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  35992. }),
  35993. [t, i]
  35994. }
  35995. };
  35996. return a.toUTF8 = function(t, i) {
  35997. if (void 0 === t && (t = this.offset),
  35998. void 0 === i && (i = this.limit),
  35999. !this.noAssert) {
  36000. if ("number" != typeof t || t % 1 != 0)
  36001. throw TypeError("Illegal begin: Not an integer");
  36002. if (t >>>= 0,
  36003. "number" != typeof i || i % 1 != 0)
  36004. throw TypeError("Illegal end: Not an integer");
  36005. if (i >>>= 0,
  36006. t < 0 || i < t || i > this.buffer.byteLength)
  36007. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36008. }
  36009. var e;
  36010. try {
  36011. d.decodeUTF8toUTF16(function() {
  36012. return t < i ? this.view[t++] : null
  36013. }
  36014. .bind(this), e = c())
  36015. } catch (e) {
  36016. if (t !== i)
  36017. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36018. }
  36019. return e()
  36020. }
  36021. ,
  36022. f.fromUTF8 = function(e, t, i) {
  36023. if (!i && "string" != typeof e)
  36024. throw TypeError("Illegal str: Not a string");
  36025. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36026. , r = 0;
  36027. return d.encodeUTF16toUTF8(s(e), function(e) {
  36028. n.view[r++] = e
  36029. }),
  36030. n.limit = r,
  36031. n
  36032. }
  36033. ,
  36034. f
  36035. }
  36036. ,
  36037. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36038. var e;
  36039. try {
  36040. e = t("long")
  36041. } catch (e) {}
  36042. return r(e)
  36043. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36044. }
  36045. , {
  36046. long: 216
  36047. }],
  36048. 216: [function(e, t, i) {
  36049. var n, r;
  36050. n = this,
  36051. r = function() {
  36052. "use strict";
  36053. function n(e, t, i) {
  36054. this.low = 0 | e,
  36055. this.high = 0 | t,
  36056. this.unsigned = !!i
  36057. }
  36058. function p(e) {
  36059. return !0 === (e && e.__isLong__)
  36060. }
  36061. function e(e, t) {
  36062. var i, n, r;
  36063. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36064. r && (a[e] = i),
  36065. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36066. r && (o[e] = i),
  36067. i)
  36068. }
  36069. function f(e, t) {
  36070. if (isNaN(e) || !isFinite(e))
  36071. return t ? l : y;
  36072. if (t) {
  36073. if (e < 0)
  36074. return l;
  36075. if (r <= e)
  36076. return I
  36077. } else {
  36078. if (e <= -s)
  36079. return E;
  36080. if (s <= e + 1)
  36081. return C
  36082. }
  36083. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36084. }
  36085. function g(e, t, i) {
  36086. return new n(e,t,i)
  36087. }
  36088. function h(e, t, i) {
  36089. if (0 === e.length)
  36090. throw Error("empty string");
  36091. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36092. return y;
  36093. if (t = "number" == typeof t ? (i = t,
  36094. !1) : !!t,
  36095. (i = i || 10) < 2 || 36 < i)
  36096. throw RangeError("radix");
  36097. var n;
  36098. if (0 < (n = e.indexOf("-")))
  36099. throw Error("interior hyphen");
  36100. if (0 === n)
  36101. return h(e.substring(1), t, i).neg();
  36102. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36103. var s = Math.min(8, e.length - a)
  36104. , l = parseInt(e.substring(a, a + s), i);
  36105. if (s < 8) {
  36106. var c = f(u(i, s));
  36107. o = o.mul(c).add(f(l))
  36108. } else
  36109. o = (o = o.mul(r)).add(f(l))
  36110. }
  36111. return o.unsigned = t,
  36112. o
  36113. }
  36114. function m(e) {
  36115. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36116. }
  36117. Object.defineProperty(n.prototype, "__isLong__", {
  36118. value: !0,
  36119. enumerable: !1,
  36120. configurable: !1
  36121. }),
  36122. n.isLong = p;
  36123. var o = {}
  36124. , a = {};
  36125. n.fromInt = e,
  36126. n.fromNumber = f,
  36127. n.fromBits = g;
  36128. var u = Math.pow;
  36129. n.fromString = h,
  36130. n.fromValue = m;
  36131. var i = 4294967296
  36132. , r = 0x10000000000000000
  36133. , s = r / 2
  36134. , v = e(1 << 24)
  36135. , y = e(0);
  36136. n.ZERO = y;
  36137. var l = e(0, !0);
  36138. n.UZERO = l;
  36139. var c = e(1);
  36140. n.ONE = c;
  36141. var d = e(1, !0);
  36142. n.UONE = d;
  36143. var A = e(-1);
  36144. n.NEG_ONE = A;
  36145. var C = g(-1, 2147483647, !1);
  36146. n.MAX_VALUE = C;
  36147. var I = g(-1, -1, !0);
  36148. n.MAX_UNSIGNED_VALUE = I;
  36149. var E = g(0, -2147483648, !1);
  36150. n.MIN_VALUE = E;
  36151. var t = n.prototype;
  36152. return t.toInt = function() {
  36153. return this.unsigned ? this.low >>> 0 : this.low
  36154. }
  36155. ,
  36156. t.toNumber = function() {
  36157. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36158. }
  36159. ,
  36160. t.toString = function(e) {
  36161. if ((e = e || 10) < 2 || 36 < e)
  36162. throw RangeError("radix");
  36163. if (this.isZero())
  36164. return "0";
  36165. if (this.isNegative()) {
  36166. if (this.eq(E)) {
  36167. var t = f(e)
  36168. , i = this.div(t)
  36169. , n = i.mul(t).sub(this);
  36170. return i.toString(e) + n.toInt().toString(e)
  36171. }
  36172. return "-" + this.neg().toString(e)
  36173. }
  36174. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36175. var s = o.div(r)
  36176. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36177. if ((o = s).isZero())
  36178. return l + a;
  36179. for (; l.length < 6; )
  36180. l = "0" + l;
  36181. a = "" + l + a
  36182. }
  36183. }
  36184. ,
  36185. t.getHighBits = function() {
  36186. return this.high
  36187. }
  36188. ,
  36189. t.getHighBitsUnsigned = function() {
  36190. return this.high >>> 0
  36191. }
  36192. ,
  36193. t.getLowBits = function() {
  36194. return this.low
  36195. }
  36196. ,
  36197. t.getLowBitsUnsigned = function() {
  36198. return this.low >>> 0
  36199. }
  36200. ,
  36201. t.getNumBitsAbs = function() {
  36202. if (this.isNegative())
  36203. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36204. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36205. ;
  36206. return 0 != this.high ? t + 33 : t + 1
  36207. }
  36208. ,
  36209. t.isZero = function() {
  36210. return 0 === this.high && 0 === this.low
  36211. }
  36212. ,
  36213. t.isNegative = function() {
  36214. return !this.unsigned && this.high < 0
  36215. }
  36216. ,
  36217. t.isPositive = function() {
  36218. return this.unsigned || 0 <= this.high
  36219. }
  36220. ,
  36221. t.isOdd = function() {
  36222. return 1 == (1 & this.low)
  36223. }
  36224. ,
  36225. t.isEven = function() {
  36226. return 0 == (1 & this.low)
  36227. }
  36228. ,
  36229. t.equals = function(e) {
  36230. return p(e) || (e = m(e)),
  36231. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36232. }
  36233. ,
  36234. t.eq = t.equals,
  36235. t.notEquals = function(e) {
  36236. return !this.eq(e)
  36237. }
  36238. ,
  36239. t.neq = t.notEquals,
  36240. t.lessThan = function(e) {
  36241. return this.comp(e) < 0
  36242. }
  36243. ,
  36244. t.lt = t.lessThan,
  36245. t.lessThanOrEqual = function(e) {
  36246. return this.comp(e) <= 0
  36247. }
  36248. ,
  36249. t.lte = t.lessThanOrEqual,
  36250. t.greaterThan = function(e) {
  36251. return 0 < this.comp(e)
  36252. }
  36253. ,
  36254. t.gt = t.greaterThan,
  36255. t.greaterThanOrEqual = function(e) {
  36256. return 0 <= this.comp(e)
  36257. }
  36258. ,
  36259. t.gte = t.greaterThanOrEqual,
  36260. t.compare = function(e) {
  36261. if (p(e) || (e = m(e)),
  36262. this.eq(e))
  36263. return 0;
  36264. var t = this.isNegative()
  36265. , i = e.isNegative();
  36266. return t && !i ? -1 : !t && i ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  36267. }
  36268. ,
  36269. t.comp = t.compare,
  36270. t.negate = function() {
  36271. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36272. }
  36273. ,
  36274. t.neg = t.negate,
  36275. t.add = function(e) {
  36276. p(e) || (e = m(e));
  36277. var t = this.high >>> 16
  36278. , i = 65535 & this.high
  36279. , n = this.low >>> 16
  36280. , r = 65535 & this.low
  36281. , o = e.high >>> 16
  36282. , a = 65535 & e.high
  36283. , s = e.low >>> 16
  36284. , l = 0
  36285. , c = 0
  36286. , h = 0
  36287. , u = 0;
  36288. return h += (u += r + (65535 & e.low)) >>> 16,
  36289. c += (h += n + s) >>> 16,
  36290. l += (c += i + a) >>> 16,
  36291. l += t + o,
  36292. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36293. }
  36294. ,
  36295. t.subtract = function(e) {
  36296. return p(e) || (e = m(e)),
  36297. this.add(e.neg())
  36298. }
  36299. ,
  36300. t.sub = t.subtract,
  36301. t.multiply = function(e) {
  36302. if (this.isZero())
  36303. return y;
  36304. if (p(e) || (e = m(e)),
  36305. e.isZero())
  36306. return y;
  36307. if (this.eq(E))
  36308. return e.isOdd() ? E : y;
  36309. if (e.eq(E))
  36310. return this.isOdd() ? E : y;
  36311. if (this.isNegative())
  36312. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36313. if (e.isNegative())
  36314. return this.mul(e.neg()).neg();
  36315. if (this.lt(v) && e.lt(v))
  36316. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36317. var t = this.high >>> 16
  36318. , i = 65535 & this.high
  36319. , n = this.low >>> 16
  36320. , r = 65535 & this.low
  36321. , o = e.high >>> 16
  36322. , a = 65535 & e.high
  36323. , s = e.low >>> 16
  36324. , l = 65535 & e.low
  36325. , c = 0
  36326. , h = 0
  36327. , u = 0
  36328. , d = 0;
  36329. return u += (d += r * l) >>> 16,
  36330. h += (u += n * l) >>> 16,
  36331. u &= 65535,
  36332. h += (u += r * s) >>> 16,
  36333. c += (h += i * l) >>> 16,
  36334. h &= 65535,
  36335. c += (h += n * s) >>> 16,
  36336. h &= 65535,
  36337. c += (h += r * a) >>> 16,
  36338. c += t * l + i * s + n * a + r * o,
  36339. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36340. }
  36341. ,
  36342. t.mul = t.multiply,
  36343. t.divide = function(e) {
  36344. if (p(e) || (e = m(e)),
  36345. e.isZero())
  36346. throw Error("division by zero");
  36347. if (this.isZero())
  36348. return this.unsigned ? l : y;
  36349. var t, i, n;
  36350. if (this.unsigned) {
  36351. if (e.unsigned || (e = e.toUnsigned()),
  36352. e.gt(this))
  36353. return l;
  36354. if (e.gt(this.shru(1)))
  36355. return d;
  36356. n = l
  36357. } else {
  36358. if (this.eq(E))
  36359. return e.eq(c) || e.eq(A) ? E : e.eq(E) ? c : (t = this.shr(1).div(e).shl(1)).eq(y) ? e.isNegative() ? c : A : (i = this.sub(e.mul(t)),
  36360. n = t.add(i.div(e)));
  36361. if (e.eq(E))
  36362. return this.unsigned ? l : y;
  36363. if (this.isNegative())
  36364. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36365. if (e.isNegative())
  36366. return this.div(e.neg()).neg();
  36367. n = y
  36368. }
  36369. for (i = this; i.gte(e); ) {
  36370. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36371. for (var r = Math.ceil(Math.log(t) / Math.LN2), o = r <= 48 ? 1 : u(2, r - 48), a = f(t), s = a.mul(e); s.isNegative() || s.gt(i); )
  36372. s = (a = f(t -= o, this.unsigned)).mul(e);
  36373. a.isZero() && (a = c),
  36374. n = n.add(a),
  36375. i = i.sub(s)
  36376. }
  36377. return n
  36378. }
  36379. ,
  36380. t.div = t.divide,
  36381. t.modulo = function(e) {
  36382. return p(e) || (e = m(e)),
  36383. this.sub(this.div(e).mul(e))
  36384. }
  36385. ,
  36386. t.mod = t.modulo,
  36387. t.not = function() {
  36388. return g(~this.low, ~this.high, this.unsigned)
  36389. }
  36390. ,
  36391. t.and = function(e) {
  36392. return p(e) || (e = m(e)),
  36393. g(this.low & e.low, this.high & e.high, this.unsigned)
  36394. }
  36395. ,
  36396. t.or = function(e) {
  36397. return p(e) || (e = m(e)),
  36398. g(this.low | e.low, this.high | e.high, this.unsigned)
  36399. }
  36400. ,
  36401. t.xor = function(e) {
  36402. return p(e) || (e = m(e)),
  36403. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36404. }
  36405. ,
  36406. t.shiftLeft = function(e) {
  36407. return p(e) && (e = e.toInt()),
  36408. 0 == (e &= 63) ? this : e < 32 ? g(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : g(0, this.low << e - 32, this.unsigned)
  36409. }
  36410. ,
  36411. t.shl = t.shiftLeft,
  36412. t.shiftRight = function(e) {
  36413. return p(e) && (e = e.toInt()),
  36414. 0 == (e &= 63) ? this : e < 32 ? g(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : g(this.high >> e - 32, 0 <= this.high ? 0 : -1, this.unsigned)
  36415. }
  36416. ,
  36417. t.shr = t.shiftRight,
  36418. t.shiftRightUnsigned = function(e) {
  36419. if (p(e) && (e = e.toInt()),
  36420. 0 === (e &= 63))
  36421. return this;
  36422. var t = this.high;
  36423. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36424. }
  36425. ,
  36426. t.shru = t.shiftRightUnsigned,
  36427. t.toSigned = function() {
  36428. return this.unsigned ? g(this.low, this.high, !1) : this
  36429. }
  36430. ,
  36431. t.toUnsigned = function() {
  36432. return this.unsigned ? this : g(this.low, this.high, !0)
  36433. }
  36434. ,
  36435. t.toBytes = function(e) {
  36436. return e ? this.toBytesLE() : this.toBytesBE()
  36437. }
  36438. ,
  36439. t.toBytesLE = function() {
  36440. var e = this.high
  36441. , t = this.low;
  36442. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36443. }
  36444. ,
  36445. t.toBytesBE = function() {
  36446. var e = this.high
  36447. , t = this.low;
  36448. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36449. }
  36450. ,
  36451. n
  36452. }
  36453. ,
  36454. "function" == typeof define && define.amd ? define([], r) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = r() : (n.dcodeIO = n.dcodeIO || {}).Long = r()
  36455. }
  36456. , {}],
  36457. 217: [function(e, t, i) {
  36458. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, $, ee, te, ie, ne, re, oe, ae, se, le, ce, he, ue, de, pe, fe, ge, me, ve, ye, Ae, Ce, Ie, Ee, _e, be, we, Te, xe, Se, Me, Re, Pe, Oe, Le, De, Ne, Fe, Be, Ve, ke, Ue, He, ze, Ge, We, je, Ye, qe, Xe, Ze, Ke, Qe, Je, $e, et, tt, it, nt, rt, ot, at, st, lt, ct, ht, ut, dt, pt, ft, gt, mt, vt, yt, At, Ct, It, Et, _t, bt, wt, Tt, xt, St, Mt, Rt, Pt, Ot, Lt, Dt, Nt, Ft, Bt, Vt, kt, Ut, Ht, zt, Gt, Wt, jt, Yt, qt, Xt, Zt, Kt, Qt, Jt, $t, ei, ti, ii, ni, ri, oi, ai, si, li, ci, hi, ui, di, pi, fi, gi, mi, vi, yi, Ai, Ci = {
  36459. REVISION: "75"
  36460. };
  36461. function Ii(e, t) {
  36462. return e.distance - t.distance
  36463. }
  36464. function Ei(e, t, i, n) {
  36465. if (!1 !== e.visible && (e.raycast(t, i),
  36466. !0 === n))
  36467. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36468. Ei(r[o], t, i, !0)
  36469. }
  36470. function _i(e, t, i) {
  36471. return i < 0 && (i += 1),
  36472. 1 < i && (i -= 1),
  36473. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36474. }
  36475. function bi(e, t, i, n, r, o, a) {
  36476. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36477. r.multiplyScalar(Vt.x),
  36478. o.multiplyScalar(Vt.y),
  36479. a.multiplyScalar(Vt.z),
  36480. r.add(o).add(a),
  36481. r.clone()
  36482. }
  36483. function wi(e, t, i, n, r, o, a) {
  36484. var s = e.material;
  36485. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36486. return null;
  36487. Ut.copy(a),
  36488. Ut.applyMatrix4(e.matrixWorld);
  36489. var l = t.ray.origin.distanceTo(Ut);
  36490. return l < t.near || l > t.far ? null : {
  36491. distance: l,
  36492. point: Ut.clone(),
  36493. object: e
  36494. }
  36495. }
  36496. function Ti(e, t, i, n, r, o, a, s) {
  36497. Mt.fromArray(n, 3 * o),
  36498. Rt.fromArray(n, 3 * a),
  36499. Pt.fromArray(n, 3 * s);
  36500. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36501. return l && (r && (Nt.fromArray(r, 2 * o),
  36502. Ft.fromArray(r, 2 * a),
  36503. Bt.fromArray(r, 2 * s),
  36504. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36505. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36506. l.faceIndex = o),
  36507. l
  36508. }
  36509. function xi() {}
  36510. function Si(e, t, i, n, r, o) {
  36511. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36512. if (s = e[o[t]].x,
  36513. l = e[o[t]].y,
  36514. c = e[o[i]].x,
  36515. h = e[o[i]].y,
  36516. u = e[o[n]].x,
  36517. d = e[o[n]].y,
  36518. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36519. return !1;
  36520. for (g = u - c,
  36521. m = d - h,
  36522. v = s - u,
  36523. y = l - d,
  36524. A = c - s,
  36525. C = h - l,
  36526. a = 0; a < r; a++)
  36527. if (p = e[o[a]].x,
  36528. f = e[o[a]].y,
  36529. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36530. E = v * (f - d) - y * (p - u),
  36531. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36532. return !1;
  36533. return !0
  36534. }
  36535. function Mi(e) {
  36536. switch (e) {
  36537. case Ci.LinearEncoding:
  36538. return ["Linear", "( value )"];
  36539. case Ci.sRGBEncoding:
  36540. return ["sRGB", "( value )"];
  36541. case Ci.RGBEEncoding:
  36542. return ["RGBE", "( value )"];
  36543. case Ci.RGBM7Encoding:
  36544. return ["RGBM", "( value, 7.0 )"];
  36545. case Ci.RGBM16Encoding:
  36546. return ["RGBM", "( value, 16.0 )"];
  36547. case Ci.RGBDEncoding:
  36548. return ["RGBD", "( value, 256.0 )"];
  36549. case Ci.GammaEncoding:
  36550. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36551. default:
  36552. throw new Error("unsupported encoding: " + e)
  36553. }
  36554. }
  36555. function Ri(e, t) {
  36556. var i = Mi(t);
  36557. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36558. }
  36559. function Pi(e) {
  36560. return "" !== e
  36561. }
  36562. function Oi(e, t) {
  36563. 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)
  36564. }
  36565. function Li(e) {
  36566. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36567. var i = Ci.ShaderChunk[t];
  36568. if (void 0 === i)
  36569. throw new Error("Can not resolve #include <" + t + ">");
  36570. return Li(i)
  36571. })
  36572. }
  36573. function Di(e) {
  36574. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36575. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36576. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  36577. return r
  36578. })
  36579. }
  36580. function Ni(e, t, i, n) {
  36581. gi.set(t, i, n).unproject(mi);
  36582. var r = fi[e];
  36583. if (void 0 !== r)
  36584. for (var o = 0, a = r.length; o < a; o++)
  36585. pi.vertices[r[o]].copy(gi)
  36586. }
  36587. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36588. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36589. void 0 === Math.sign && (Math.sign = function(e) {
  36590. return e < 0 ? -1 : 0 < e ? 1 : +e
  36591. }
  36592. ),
  36593. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36594. get: function() {
  36595. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36596. }
  36597. }),
  36598. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36599. writable: !0,
  36600. configurable: !0,
  36601. value: function(e) {
  36602. "use strict";
  36603. if (null == e)
  36604. throw new TypeError("Cannot convert first argument to object");
  36605. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36606. var r = arguments[i];
  36607. if (null != r) {
  36608. r = Object(r);
  36609. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36610. var l = o[a]
  36611. , c = Object.getOwnPropertyDescriptor(r, l);
  36612. void 0 !== c && c.enumerable && (t[l] = r[l])
  36613. }
  36614. }
  36615. }
  36616. return t
  36617. }
  36618. }),
  36619. Ci.MOUSE = {
  36620. LEFT: 0,
  36621. MIDDLE: 1,
  36622. RIGHT: 2
  36623. },
  36624. Ci.CullFaceNone = 0,
  36625. Ci.CullFaceBack = 1,
  36626. Ci.CullFaceFront = 2,
  36627. Ci.CullFaceFrontBack = 3,
  36628. Ci.FrontFaceDirectionCW = 0,
  36629. Ci.FrontFaceDirectionCCW = 1,
  36630. Ci.BasicShadowMap = 0,
  36631. Ci.PCFShadowMap = 1,
  36632. Ci.PCFSoftShadowMap = 2,
  36633. Ci.FrontSide = 0,
  36634. Ci.BackSide = 1,
  36635. Ci.DoubleSide = 2,
  36636. Ci.FlatShading = 1,
  36637. Ci.SmoothShading = 2,
  36638. Ci.NoColors = 0,
  36639. Ci.FaceColors = 1,
  36640. Ci.VertexColors = 2,
  36641. Ci.NoBlending = 0,
  36642. Ci.NormalBlending = 1,
  36643. Ci.AdditiveBlending = 2,
  36644. Ci.SubtractiveBlending = 3,
  36645. Ci.MultiplyBlending = 4,
  36646. Ci.CustomBlending = 5,
  36647. Ci.AddEquation = 100,
  36648. Ci.SubtractEquation = 101,
  36649. Ci.ReverseSubtractEquation = 102,
  36650. Ci.MinEquation = 103,
  36651. Ci.MaxEquation = 104,
  36652. Ci.ZeroFactor = 200,
  36653. Ci.OneFactor = 201,
  36654. Ci.SrcColorFactor = 202,
  36655. Ci.OneMinusSrcColorFactor = 203,
  36656. Ci.SrcAlphaFactor = 204,
  36657. Ci.OneMinusSrcAlphaFactor = 205,
  36658. Ci.DstAlphaFactor = 206,
  36659. Ci.OneMinusDstAlphaFactor = 207,
  36660. Ci.DstColorFactor = 208,
  36661. Ci.OneMinusDstColorFactor = 209,
  36662. Ci.SrcAlphaSaturateFactor = 210,
  36663. Ci.NeverDepth = 0,
  36664. Ci.AlwaysDepth = 1,
  36665. Ci.LessDepth = 2,
  36666. Ci.LessEqualDepth = 3,
  36667. Ci.EqualDepth = 4,
  36668. Ci.GreaterEqualDepth = 5,
  36669. Ci.GreaterDepth = 6,
  36670. Ci.NotEqualDepth = 7,
  36671. Ci.MultiplyOperation = 0,
  36672. Ci.MixOperation = 1,
  36673. Ci.AddOperation = 2,
  36674. Ci.NoToneMapping = 0,
  36675. Ci.LinearToneMapping = 1,
  36676. Ci.ReinhardToneMapping = 2,
  36677. Ci.Uncharted2ToneMapping = 3,
  36678. Ci.CineonToneMapping = 4,
  36679. Ci.UVMapping = 300,
  36680. Ci.CubeReflectionMapping = 301,
  36681. Ci.CubeRefractionMapping = 302,
  36682. Ci.EquirectangularReflectionMapping = 303,
  36683. Ci.EquirectangularRefractionMapping = 304,
  36684. Ci.SphericalReflectionMapping = 305,
  36685. Ci.CubeUVReflectionMapping = 306,
  36686. Ci.CubeUVRefractionMapping = 307,
  36687. Ci.RepeatWrapping = 1e3,
  36688. Ci.ClampToEdgeWrapping = 1001,
  36689. Ci.MirroredRepeatWrapping = 1002,
  36690. Ci.NearestFilter = 1003,
  36691. Ci.NearestMipMapNearestFilter = 1004,
  36692. Ci.NearestMipMapLinearFilter = 1005,
  36693. Ci.LinearFilter = 1006,
  36694. Ci.LinearMipMapNearestFilter = 1007,
  36695. Ci.LinearMipMapLinearFilter = 1008,
  36696. Ci.UnsignedByteType = 1009,
  36697. Ci.ByteType = 1010,
  36698. Ci.ShortType = 1011,
  36699. Ci.UnsignedShortType = 1012,
  36700. Ci.IntType = 1013,
  36701. Ci.UnsignedIntType = 1014,
  36702. Ci.FloatType = 1015,
  36703. Ci.HalfFloatType = 1025,
  36704. Ci.UnsignedShort4444Type = 1016,
  36705. Ci.UnsignedShort5551Type = 1017,
  36706. Ci.UnsignedShort565Type = 1018,
  36707. Ci.AlphaFormat = 1019,
  36708. Ci.RGBFormat = 1020,
  36709. Ci.RGBAFormat = 1021,
  36710. Ci.LuminanceFormat = 1022,
  36711. Ci.LuminanceAlphaFormat = 1023,
  36712. Ci.RGBEFormat = Ci.RGBAFormat,
  36713. Ci.RGB_S3TC_DXT1_Format = 2001,
  36714. Ci.RGBA_S3TC_DXT1_Format = 2002,
  36715. Ci.RGBA_S3TC_DXT3_Format = 2003,
  36716. Ci.RGBA_S3TC_DXT5_Format = 2004,
  36717. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  36718. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  36719. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  36720. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  36721. Ci.RGB_ETC1_Format = 2151,
  36722. Ci.LoopOnce = 2200,
  36723. Ci.LoopRepeat = 2201,
  36724. Ci.LoopPingPong = 2202,
  36725. Ci.InterpolateDiscrete = 2300,
  36726. Ci.InterpolateLinear = 2301,
  36727. Ci.InterpolateSmooth = 2302,
  36728. Ci.ZeroCurvatureEnding = 2400,
  36729. Ci.ZeroSlopeEnding = 2401,
  36730. Ci.WrapAroundEnding = 2402,
  36731. Ci.TrianglesDrawMode = 0,
  36732. Ci.TriangleStripDrawMode = 1,
  36733. Ci.TriangleFanDrawMode = 2,
  36734. Ci.LinearEncoding = 3e3,
  36735. Ci.sRGBEncoding = 3001,
  36736. Ci.GammaEncoding = 3007,
  36737. Ci.RGBEEncoding = 3002,
  36738. Ci.LogLuvEncoding = 3003,
  36739. Ci.RGBM7Encoding = 3004,
  36740. Ci.RGBM16Encoding = 3005,
  36741. Ci.RGBDEncoding = 3006,
  36742. Ci.Color = function(e) {
  36743. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36744. }
  36745. ,
  36746. Ci.Color.prototype = {
  36747. constructor: Ci.Color,
  36748. r: 1,
  36749. g: 1,
  36750. b: 1,
  36751. set: function(e) {
  36752. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  36753. this
  36754. },
  36755. setScalar: function(e) {
  36756. this.r = e,
  36757. this.g = e,
  36758. this.b = e
  36759. },
  36760. setHex: function(e) {
  36761. return e = Math.floor(e),
  36762. this.r = (e >> 16 & 255) / 255,
  36763. this.g = (e >> 8 & 255) / 255,
  36764. this.b = (255 & e) / 255,
  36765. this
  36766. },
  36767. setRGB: function(e, t, i) {
  36768. return this.r = e,
  36769. this.g = t,
  36770. this.b = i,
  36771. this
  36772. },
  36773. setHSL: function(e, t, i) {
  36774. if (e = Ci.Math.euclideanModulo(e, 1),
  36775. t = Ci.Math.clamp(t, 0, 1),
  36776. i = Ci.Math.clamp(i, 0, 1),
  36777. 0 === t)
  36778. this.r = this.g = this.b = i;
  36779. else {
  36780. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  36781. , r = 2 * i - n;
  36782. this.r = _i(r, n, e + 1 / 3),
  36783. this.g = _i(r, n, e),
  36784. this.b = _i(r, n, e - 1 / 3)
  36785. }
  36786. return this
  36787. },
  36788. setStyle: function(t) {
  36789. function e(e) {
  36790. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  36791. }
  36792. var i;
  36793. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  36794. var n, r = i[1], o = i[2];
  36795. switch (r) {
  36796. case "rgb":
  36797. case "rgba":
  36798. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  36799. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  36800. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  36801. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  36802. e(n[5]),
  36803. this;
  36804. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  36805. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  36806. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  36807. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  36808. e(n[5]),
  36809. this;
  36810. break;
  36811. case "hsl":
  36812. case "hsla":
  36813. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  36814. var a = parseFloat(n[1]) / 360
  36815. , s = parseInt(n[2], 10) / 100
  36816. , l = parseInt(n[3], 10) / 100;
  36817. return e(n[5]),
  36818. this.setHSL(a, s, l)
  36819. }
  36820. }
  36821. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  36822. var c, h = (c = i[1]).length;
  36823. if (3 === h)
  36824. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  36825. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  36826. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  36827. this;
  36828. if (6 === h)
  36829. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  36830. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  36831. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  36832. this
  36833. }
  36834. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  36835. return this
  36836. },
  36837. clone: function() {
  36838. return new this.constructor(this.r,this.g,this.b)
  36839. },
  36840. copy: function(e) {
  36841. return this.r = e.r,
  36842. this.g = e.g,
  36843. this.b = e.b,
  36844. this
  36845. },
  36846. copyGammaToLinear: function(e, t) {
  36847. return void 0 === t && (t = 2),
  36848. this.r = Math.pow(e.r, t),
  36849. this.g = Math.pow(e.g, t),
  36850. this.b = Math.pow(e.b, t),
  36851. this
  36852. },
  36853. copyLinearToGamma: function(e, t) {
  36854. void 0 === t && (t = 2);
  36855. var i = 0 < t ? 1 / t : 1;
  36856. return this.r = Math.pow(e.r, i),
  36857. this.g = Math.pow(e.g, i),
  36858. this.b = Math.pow(e.b, i),
  36859. this
  36860. },
  36861. convertGammaToLinear: function() {
  36862. var e = this.r
  36863. , t = this.g
  36864. , i = this.b;
  36865. return this.r = e * e,
  36866. this.g = t * t,
  36867. this.b = i * i,
  36868. this
  36869. },
  36870. convertLinearToGamma: function() {
  36871. return this.r = Math.sqrt(this.r),
  36872. this.g = Math.sqrt(this.g),
  36873. this.b = Math.sqrt(this.b),
  36874. this
  36875. },
  36876. getHex: function() {
  36877. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  36878. },
  36879. getHexString: function() {
  36880. return ("000000" + this.getHex().toString(16)).slice(-6)
  36881. },
  36882. getHSL: function(e) {
  36883. var t, i, n = e || {
  36884. h: 0,
  36885. s: 0,
  36886. l: 0
  36887. }, 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;
  36888. if (l === s)
  36889. i = t = 0;
  36890. else {
  36891. var h = s - l;
  36892. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  36893. s) {
  36894. case r:
  36895. t = (o - a) / h + (o < a ? 6 : 0);
  36896. break;
  36897. case o:
  36898. t = (a - r) / h + 2;
  36899. break;
  36900. case a:
  36901. t = (r - o) / h + 4
  36902. }
  36903. t /= 6
  36904. }
  36905. return n.h = t,
  36906. n.s = i,
  36907. n.l = c,
  36908. n
  36909. },
  36910. getStyle: function() {
  36911. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  36912. },
  36913. offsetHSL: function(e, t, i) {
  36914. var n = this.getHSL();
  36915. return n.h += e,
  36916. n.s += t,
  36917. n.l += i,
  36918. this.setHSL(n.h, n.s, n.l),
  36919. this
  36920. },
  36921. add: function(e) {
  36922. return this.r += e.r,
  36923. this.g += e.g,
  36924. this.b += e.b,
  36925. this
  36926. },
  36927. addColors: function(e, t) {
  36928. return this.r = e.r + t.r,
  36929. this.g = e.g + t.g,
  36930. this.b = e.b + t.b,
  36931. this
  36932. },
  36933. addScalar: function(e) {
  36934. return this.r += e,
  36935. this.g += e,
  36936. this.b += e,
  36937. this
  36938. },
  36939. multiply: function(e) {
  36940. return this.r *= e.r,
  36941. this.g *= e.g,
  36942. this.b *= e.b,
  36943. this
  36944. },
  36945. multiplyScalar: function(e) {
  36946. return this.r *= e,
  36947. this.g *= e,
  36948. this.b *= e,
  36949. this
  36950. },
  36951. lerp: function(e, t) {
  36952. return this.r += (e.r - this.r) * t,
  36953. this.g += (e.g - this.g) * t,
  36954. this.b += (e.b - this.b) * t,
  36955. this
  36956. },
  36957. equals: function(e) {
  36958. return e.r === this.r && e.g === this.g && e.b === this.b
  36959. },
  36960. fromArray: function(e, t) {
  36961. return void 0 === t && (t = 0),
  36962. this.r = e[t],
  36963. this.g = e[t + 1],
  36964. this.b = e[t + 2],
  36965. this
  36966. },
  36967. toArray: function(e, t) {
  36968. return void 0 === e && (e = []),
  36969. void 0 === t && (t = 0),
  36970. e[t] = this.r,
  36971. e[t + 1] = this.g,
  36972. e[t + 2] = this.b,
  36973. e
  36974. }
  36975. },
  36976. Ci.ColorKeywords = {
  36977. aliceblue: 15792383,
  36978. antiquewhite: 16444375,
  36979. aqua: 65535,
  36980. aquamarine: 8388564,
  36981. azure: 15794175,
  36982. beige: 16119260,
  36983. bisque: 16770244,
  36984. black: 0,
  36985. blanchedalmond: 16772045,
  36986. blue: 255,
  36987. blueviolet: 9055202,
  36988. brown: 10824234,
  36989. burlywood: 14596231,
  36990. cadetblue: 6266528,
  36991. chartreuse: 8388352,
  36992. chocolate: 13789470,
  36993. coral: 16744272,
  36994. cornflowerblue: 6591981,
  36995. cornsilk: 16775388,
  36996. crimson: 14423100,
  36997. cyan: 65535,
  36998. darkblue: 139,
  36999. darkcyan: 35723,
  37000. darkgoldenrod: 12092939,
  37001. darkgray: 11119017,
  37002. darkgreen: 25600,
  37003. darkgrey: 11119017,
  37004. darkkhaki: 12433259,
  37005. darkmagenta: 9109643,
  37006. darkolivegreen: 5597999,
  37007. darkorange: 16747520,
  37008. darkorchid: 10040012,
  37009. darkred: 9109504,
  37010. darksalmon: 15308410,
  37011. darkseagreen: 9419919,
  37012. darkslateblue: 4734347,
  37013. darkslategray: 3100495,
  37014. darkslategrey: 3100495,
  37015. darkturquoise: 52945,
  37016. darkviolet: 9699539,
  37017. deeppink: 16716947,
  37018. deepskyblue: 49151,
  37019. dimgray: 6908265,
  37020. dimgrey: 6908265,
  37021. dodgerblue: 2003199,
  37022. firebrick: 11674146,
  37023. floralwhite: 16775920,
  37024. forestgreen: 2263842,
  37025. fuchsia: 16711935,
  37026. gainsboro: 14474460,
  37027. ghostwhite: 16316671,
  37028. gold: 16766720,
  37029. goldenrod: 14329120,
  37030. gray: 8421504,
  37031. green: 32768,
  37032. greenyellow: 11403055,
  37033. grey: 8421504,
  37034. honeydew: 15794160,
  37035. hotpink: 16738740,
  37036. indianred: 13458524,
  37037. indigo: 4915330,
  37038. ivory: 16777200,
  37039. khaki: 15787660,
  37040. lavender: 15132410,
  37041. lavenderblush: 16773365,
  37042. lawngreen: 8190976,
  37043. lemonchiffon: 16775885,
  37044. lightblue: 11393254,
  37045. lightcoral: 15761536,
  37046. lightcyan: 14745599,
  37047. lightgoldenrodyellow: 16448210,
  37048. lightgray: 13882323,
  37049. lightgreen: 9498256,
  37050. lightgrey: 13882323,
  37051. lightpink: 16758465,
  37052. lightsalmon: 16752762,
  37053. lightseagreen: 2142890,
  37054. lightskyblue: 8900346,
  37055. lightslategray: 7833753,
  37056. lightslategrey: 7833753,
  37057. lightsteelblue: 11584734,
  37058. lightyellow: 16777184,
  37059. lime: 65280,
  37060. limegreen: 3329330,
  37061. linen: 16445670,
  37062. magenta: 16711935,
  37063. maroon: 8388608,
  37064. mediumaquamarine: 6737322,
  37065. mediumblue: 205,
  37066. mediumorchid: 12211667,
  37067. mediumpurple: 9662683,
  37068. mediumseagreen: 3978097,
  37069. mediumslateblue: 8087790,
  37070. mediumspringgreen: 64154,
  37071. mediumturquoise: 4772300,
  37072. mediumvioletred: 13047173,
  37073. midnightblue: 1644912,
  37074. mintcream: 16121850,
  37075. mistyrose: 16770273,
  37076. moccasin: 16770229,
  37077. navajowhite: 16768685,
  37078. navy: 128,
  37079. oldlace: 16643558,
  37080. olive: 8421376,
  37081. olivedrab: 7048739,
  37082. orange: 16753920,
  37083. orangered: 16729344,
  37084. orchid: 14315734,
  37085. palegoldenrod: 15657130,
  37086. palegreen: 10025880,
  37087. paleturquoise: 11529966,
  37088. palevioletred: 14381203,
  37089. papayawhip: 16773077,
  37090. peachpuff: 16767673,
  37091. peru: 13468991,
  37092. pink: 16761035,
  37093. plum: 14524637,
  37094. powderblue: 11591910,
  37095. purple: 8388736,
  37096. red: 16711680,
  37097. rosybrown: 12357519,
  37098. royalblue: 4286945,
  37099. saddlebrown: 9127187,
  37100. salmon: 16416882,
  37101. sandybrown: 16032864,
  37102. seagreen: 3050327,
  37103. seashell: 16774638,
  37104. sienna: 10506797,
  37105. silver: 12632256,
  37106. skyblue: 8900331,
  37107. slateblue: 6970061,
  37108. slategray: 7372944,
  37109. slategrey: 7372944,
  37110. snow: 16775930,
  37111. springgreen: 65407,
  37112. steelblue: 4620980,
  37113. tan: 13808780,
  37114. teal: 32896,
  37115. thistle: 14204888,
  37116. tomato: 16737095,
  37117. turquoise: 4251856,
  37118. violet: 15631086,
  37119. wheat: 16113331,
  37120. white: 16777215,
  37121. whitesmoke: 16119285,
  37122. yellow: 16776960,
  37123. yellowgreen: 10145074
  37124. },
  37125. Ci.Quaternion = function(e, t, i, n) {
  37126. this._x = e || 0,
  37127. this._y = t || 0,
  37128. this._z = i || 0,
  37129. this._w = void 0 !== n ? n : 1
  37130. }
  37131. ,
  37132. Ci.Quaternion.prototype = {
  37133. constructor: Ci.Quaternion,
  37134. get x() {
  37135. return this._x
  37136. },
  37137. set x(e) {
  37138. this._x = e,
  37139. this.onChangeCallback()
  37140. },
  37141. get y() {
  37142. return this._y
  37143. },
  37144. set y(e) {
  37145. this._y = e,
  37146. this.onChangeCallback()
  37147. },
  37148. get z() {
  37149. return this._z
  37150. },
  37151. set z(e) {
  37152. this._z = e,
  37153. this.onChangeCallback()
  37154. },
  37155. get w() {
  37156. return this._w
  37157. },
  37158. set w(e) {
  37159. this._w = e,
  37160. this.onChangeCallback()
  37161. },
  37162. set: function(e, t, i, n) {
  37163. return this._x = e,
  37164. this._y = t,
  37165. this._z = i,
  37166. this._w = n,
  37167. this.onChangeCallback(),
  37168. this
  37169. },
  37170. clone: function() {
  37171. return new this.constructor(this._x,this._y,this._z,this._w)
  37172. },
  37173. toObject:function(){//add
  37174. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37175. },
  37176. copy: function(e) {
  37177. return this._x = e.x,
  37178. this._y = e.y,
  37179. this._z = e.z,
  37180. this._w = e.w,
  37181. this.onChangeCallback(),
  37182. this
  37183. },
  37184. setFromEuler: function(e, t) {
  37185. if (e instanceof Ci.Euler == 0)
  37186. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37187. var i = Math.cos(e._x / 2)
  37188. , n = Math.cos(e._y / 2)
  37189. , r = Math.cos(e._z / 2)
  37190. , o = Math.sin(e._x / 2)
  37191. , a = Math.sin(e._y / 2)
  37192. , s = Math.sin(e._z / 2)
  37193. , l = e.order;
  37194. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37195. this._y = i * a * r - o * n * s,
  37196. this._z = i * n * s + o * a * r,
  37197. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37198. this._y = i * a * r - o * n * s,
  37199. this._z = i * n * s - o * a * r,
  37200. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37201. this._y = i * a * r + o * n * s,
  37202. this._z = i * n * s + o * a * r,
  37203. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37204. this._y = i * a * r + o * n * s,
  37205. this._z = i * n * s - o * a * r,
  37206. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37207. this._y = i * a * r + o * n * s,
  37208. this._z = i * n * s - o * a * r,
  37209. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37210. this._y = i * a * r - o * n * s,
  37211. this._z = i * n * s + o * a * r,
  37212. this._w = i * n * r + o * a * s),
  37213. !1 !== t && this.onChangeCallback(),
  37214. this
  37215. },
  37216. setFromAxisAngle: function(e, t) {
  37217. var i = t / 2
  37218. , n = Math.sin(i);
  37219. return this._x = e.x * n,
  37220. this._y = e.y * n,
  37221. this._z = e.z * n,
  37222. this._w = Math.cos(i),
  37223. this.onChangeCallback(),
  37224. this
  37225. },
  37226. setFromRotationMatrix: function(e) {
  37227. 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;
  37228. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37229. this._w = .25 / t,
  37230. this._x = (h - l) * t,
  37231. this._y = (o - c) * t,
  37232. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37233. this._w = (h - l) / t,
  37234. this._x = .25 * t,
  37235. this._y = (r + a) / t,
  37236. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37237. this._w = (o - c) / t,
  37238. this._x = (r + a) / t,
  37239. this._y = .25 * t,
  37240. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37241. this._w = (a - r) / t,
  37242. this._x = (o + c) / t,
  37243. this._y = (l + h) / t,
  37244. this._z = .25 * t),
  37245. this.onChangeCallback(),
  37246. this
  37247. },
  37248. setFromUnitVectors: function(e, t) {
  37249. return void 0 === Be && (Be = new Ci.Vector3),
  37250. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37251. Math.abs(e.x) > Math.abs(e.z) ? Be.set(-e.y, e.x, 0) : Be.set(0, -e.z, e.y)) : Be.crossVectors(e, t),
  37252. this._x = Be.x,
  37253. this._y = Be.y,
  37254. this._z = Be.z,
  37255. this._w = Ve,
  37256. this.normalize(),
  37257. this
  37258. },
  37259. inverse: function() {
  37260. return this.conjugate().normalize(),
  37261. this
  37262. },
  37263. conjugate: function() {
  37264. return this._x *= -1,
  37265. this._y *= -1,
  37266. this._z *= -1,
  37267. this.onChangeCallback(),
  37268. this
  37269. },
  37270. dot: function(e) {
  37271. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37272. },
  37273. lengthSq: function() {
  37274. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37275. },
  37276. length: function() {
  37277. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37278. },
  37279. normalize: function() {
  37280. var e = this.length();
  37281. return 0 === e ? (this._x = 0,
  37282. this._y = 0,
  37283. this._z = 0,
  37284. this._w = 1) : (e = 1 / e,
  37285. this._x = this._x * e,
  37286. this._y = this._y * e,
  37287. this._z = this._z * e,
  37288. this._w = this._w * e),
  37289. this.onChangeCallback(),
  37290. this
  37291. },
  37292. multiply: function(e, t) {
  37293. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37294. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37295. },
  37296. multiplyQuaternions: function(e, t) {
  37297. var i = e._x
  37298. , n = e._y
  37299. , r = e._z
  37300. , o = e._w
  37301. , a = t._x
  37302. , s = t._y
  37303. , l = t._z
  37304. , c = t._w;
  37305. return this._x = i * c + o * a + n * l - r * s,
  37306. this._y = n * c + o * s + r * a - i * l,
  37307. this._z = r * c + o * l + i * s - n * a,
  37308. this._w = o * c - i * a - n * s - r * l,
  37309. this.onChangeCallback(),
  37310. this
  37311. },
  37312. slerp: function(e, t) {
  37313. if (0 === t)
  37314. return this;
  37315. if (1 === t)
  37316. return this.copy(e);
  37317. var i = this._x
  37318. , n = this._y
  37319. , r = this._z
  37320. , o = this._w
  37321. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37322. if (a < 0 ? (this._w = -e._w,
  37323. this._x = -e._x,
  37324. this._y = -e._y,
  37325. this._z = -e._z,
  37326. a = -a) : this.copy(e),
  37327. 1 <= a)
  37328. return this._w = o,
  37329. this._x = i,
  37330. this._y = n,
  37331. this._z = r,
  37332. this;
  37333. var s = Math.sqrt(1 - a * a);
  37334. if (Math.abs(s) < .001)
  37335. return this._w = .5 * (o + this._w),
  37336. this._x = .5 * (i + this._x),
  37337. this._y = .5 * (n + this._y),
  37338. this._z = .5 * (r + this._z),
  37339. this;
  37340. var l = Math.atan2(s, a)
  37341. , c = Math.sin((1 - t) * l) / s
  37342. , h = Math.sin(t * l) / s;
  37343. return this._w = o * c + this._w * h,
  37344. this._x = i * c + this._x * h,
  37345. this._y = n * c + this._y * h,
  37346. this._z = r * c + this._z * h,
  37347. this.onChangeCallback(),
  37348. this
  37349. },
  37350. equals: function(e) {
  37351. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37352. },
  37353. fromArray: function(e, t) {
  37354. return void 0 === t && (t = 0),
  37355. this._x = e[t],
  37356. this._y = e[t + 1],
  37357. this._z = e[t + 2],
  37358. this._w = e[t + 3],
  37359. this.onChangeCallback(),
  37360. this
  37361. },
  37362. toArray: function(e, t) {
  37363. return void 0 === e && (e = []),
  37364. void 0 === t && (t = 0),
  37365. e[t] = this._x,
  37366. e[t + 1] = this._y,
  37367. e[t + 2] = this._z,
  37368. e[t + 3] = this._w,
  37369. e
  37370. },
  37371. onChange: function(e) {
  37372. return this.onChangeCallback = e,
  37373. this
  37374. },
  37375. onChangeCallback: function() {}
  37376. },
  37377. Object.assign(Ci.Quaternion, {
  37378. slerp: function(e, t, i, n) {
  37379. return i.copy(e).slerp(t, n)
  37380. },
  37381. slerpFlat: function(e, t, i, n, r, o, a) {
  37382. var s = i[n + 0]
  37383. , l = i[n + 1]
  37384. , c = i[n + 2]
  37385. , h = i[n + 3]
  37386. , u = r[o + 0]
  37387. , d = r[o + 1]
  37388. , p = r[o + 2]
  37389. , f = r[o + 3];
  37390. if (h !== f || s !== u || l !== d || c !== p) {
  37391. var g = 1 - a
  37392. , m = s * u + l * d + c * p + h * f
  37393. , v = 0 <= m ? 1 : -1
  37394. , y = 1 - m * m;
  37395. if (y > Number.EPSILON) {
  37396. var A = Math.sqrt(y)
  37397. , C = Math.atan2(A, m * v);
  37398. g = Math.sin(g * C) / A,
  37399. a = Math.sin(a * C) / A
  37400. }
  37401. var I = a * v;
  37402. if (s = s * g + u * I,
  37403. l = l * g + d * I,
  37404. c = c * g + p * I,
  37405. h = h * g + f * I,
  37406. g === 1 - a) {
  37407. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37408. s *= E,
  37409. l *= E,
  37410. c *= E,
  37411. h *= E
  37412. }
  37413. }
  37414. e[t] = s,
  37415. e[t + 1] = l,
  37416. e[t + 2] = c,
  37417. e[t + 3] = h
  37418. }
  37419. }),
  37420. Ci.Vector2 = function(e, t) {
  37421. this.x = e || 0,
  37422. this.y = t || 0
  37423. }
  37424. ,
  37425. Ci.Vector2.prototype = {
  37426. constructor: Ci.Vector2,
  37427. get width() {
  37428. return this.x
  37429. },
  37430. set width(e) {
  37431. this.x = e
  37432. },
  37433. get height() {
  37434. return this.y
  37435. },
  37436. set height(e) {
  37437. this.y = e
  37438. },
  37439. set: function(e, t) {
  37440. return this.x = e,
  37441. this.y = t,
  37442. this
  37443. },
  37444. setScalar: function(e) {
  37445. return this.x = e,
  37446. this.y = e,
  37447. this
  37448. },
  37449. setX: function(e) {
  37450. return this.x = e,
  37451. this
  37452. },
  37453. setY: function(e) {
  37454. return this.y = e,
  37455. this
  37456. },
  37457. setComponent: function(e, t) {
  37458. switch (e) {
  37459. case 0:
  37460. this.x = t;
  37461. break;
  37462. case 1:
  37463. this.y = t;
  37464. break;
  37465. default:
  37466. throw new Error("index is out of range: " + e)
  37467. }
  37468. },
  37469. getComponent: function(e) {
  37470. switch (e) {
  37471. case 0:
  37472. return this.x;
  37473. case 1:
  37474. return this.y;
  37475. default:
  37476. throw new Error("index is out of range: " + e)
  37477. }
  37478. },
  37479. clone: function() {
  37480. return new this.constructor(this.x,this.y)
  37481. },
  37482. copy: function(e) {
  37483. return this.x = e.x,
  37484. this.y = e.y,
  37485. this
  37486. },
  37487. add: function(e, t) {
  37488. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37489. this.addVectors(e, t)) : (this.x += e.x,
  37490. this.y += e.y,
  37491. this)
  37492. },
  37493. addScalar: function(e) {
  37494. return this.x += e,
  37495. this.y += e,
  37496. this
  37497. },
  37498. addVectors: function(e, t) {
  37499. return this.x = e.x + t.x,
  37500. this.y = e.y + t.y,
  37501. this
  37502. },
  37503. addScaledVector: function(e, t) {
  37504. return this.x += e.x * t,
  37505. this.y += e.y * t,
  37506. this
  37507. },
  37508. sub: function(e, t) {
  37509. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37510. this.subVectors(e, t)) : (this.x -= e.x,
  37511. this.y -= e.y,
  37512. this)
  37513. },
  37514. subScalar: function(e) {
  37515. return this.x -= e,
  37516. this.y -= e,
  37517. this
  37518. },
  37519. subVectors: function(e, t) {
  37520. return this.x = e.x - t.x,
  37521. this.y = e.y - t.y,
  37522. this
  37523. },
  37524. multiply: function(e) {
  37525. return this.x *= e.x,
  37526. this.y *= e.y,
  37527. this
  37528. },
  37529. multiplyScalar: function(e) {
  37530. return isFinite(e) ? (this.x *= e,
  37531. this.y *= e) : (this.x = 0,
  37532. this.y = 0),
  37533. this
  37534. },
  37535. divide: function(e) {
  37536. return this.x /= e.x,
  37537. this.y /= e.y,
  37538. this
  37539. },
  37540. divideScalar: function(e) {
  37541. return this.multiplyScalar(1 / e)
  37542. },
  37543. min: function(e) {
  37544. return this.x = Math.min(this.x, e.x),
  37545. this.y = Math.min(this.y, e.y),
  37546. this
  37547. },
  37548. max: function(e) {
  37549. return this.x = Math.max(this.x, e.x),
  37550. this.y = Math.max(this.y, e.y),
  37551. this
  37552. },
  37553. clamp: function(e, t) {
  37554. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37555. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37556. this
  37557. },
  37558. clampScalar: function(e, t) {
  37559. return void 0 === Ne && (Ne = new Ci.Vector2,
  37560. Fe = new Ci.Vector2),
  37561. Ne.set(e, e),
  37562. Fe.set(t, t),
  37563. this.clamp(Ne, Fe)
  37564. },
  37565. clampLength: function(e, t) {
  37566. var i = this.length();
  37567. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37568. this
  37569. },
  37570. floor: function() {
  37571. return this.x = Math.floor(this.x),
  37572. this.y = Math.floor(this.y),
  37573. this
  37574. },
  37575. ceil: function() {
  37576. return this.x = Math.ceil(this.x),
  37577. this.y = Math.ceil(this.y),
  37578. this
  37579. },
  37580. round: function() {
  37581. return this.x = Math.round(this.x),
  37582. this.y = Math.round(this.y),
  37583. this
  37584. },
  37585. roundToZero: function() {
  37586. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37587. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37588. this
  37589. },
  37590. negate: function() {
  37591. return this.x = -this.x,
  37592. this.y = -this.y,
  37593. this
  37594. },
  37595. dot: function(e) {
  37596. return this.x * e.x + this.y * e.y
  37597. },
  37598. lengthSq: function() {
  37599. return this.x * this.x + this.y * this.y
  37600. },
  37601. length: function() {
  37602. return Math.sqrt(this.x * this.x + this.y * this.y)
  37603. },
  37604. lengthManhattan: function() {
  37605. return Math.abs(this.x) + Math.abs(this.y)
  37606. },
  37607. normalize: function() {
  37608. return this.divideScalar(this.length())
  37609. },
  37610. angle: function() {
  37611. var e = Math.atan2(this.y, this.x);
  37612. return e < 0 && (e += 2 * Math.PI),
  37613. e
  37614. },
  37615. distanceTo: function(e) {
  37616. return Math.sqrt(this.distanceToSquared(e))
  37617. },
  37618. distanceToSquared: function(e) {
  37619. var t = this.x - e.x
  37620. , i = this.y - e.y;
  37621. return t * t + i * i
  37622. },
  37623. setLength: function(e) {
  37624. return this.multiplyScalar(e / this.length())
  37625. },
  37626. lerp: function(e, t) {
  37627. return this.x += (e.x - this.x) * t,
  37628. this.y += (e.y - this.y) * t,
  37629. this
  37630. },
  37631. lerpVectors: function(e, t, i) {
  37632. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37633. this
  37634. },
  37635. equals: function(e) {
  37636. return e.x === this.x && e.y === this.y
  37637. },
  37638. fromArray: function(e, t) {
  37639. return void 0 === t && (t = 0),
  37640. this.x = e[t],
  37641. this.y = e[t + 1],
  37642. this
  37643. },
  37644. toArray: function(e, t) {
  37645. return void 0 === e && (e = []),
  37646. void 0 === t && (t = 0),
  37647. e[t] = this.x,
  37648. e[t + 1] = this.y,
  37649. e
  37650. },
  37651. fromAttribute: function(e, t, i) {
  37652. return void 0 === i && (i = 0),
  37653. t = t * e.itemSize + i,
  37654. this.x = e.array[t],
  37655. this.y = e.array[t + 1],
  37656. this
  37657. },
  37658. rotateAround: function(e, t) {
  37659. var i = Math.cos(t)
  37660. , n = Math.sin(t)
  37661. , r = this.x - e.x
  37662. , o = this.y - e.y;
  37663. return this.x = r * i - o * n + e.x,
  37664. this.y = r * n + o * i + e.y,
  37665. this
  37666. }
  37667. },
  37668. Ci.Vector3 = function(e, t, i) {
  37669. this.x = e || 0,
  37670. this.y = t || 0,
  37671. this.z = i || 0
  37672. }
  37673. ,
  37674. Ci.Vector3.prototype = {
  37675. constructor: Ci.Vector3,
  37676. set: function(e, t, i) {
  37677. return this.x = e,
  37678. this.y = t,
  37679. this.z = i,
  37680. this
  37681. },
  37682. setScalar: function(e) {
  37683. return this.x = e,
  37684. this.y = e,
  37685. this.z = e,
  37686. this
  37687. },
  37688. setX: function(e) {
  37689. return this.x = e,
  37690. this
  37691. },
  37692. setY: function(e) {
  37693. return this.y = e,
  37694. this
  37695. },
  37696. setZ: function(e) {
  37697. return this.z = e,
  37698. this
  37699. },
  37700. setComponent: function(e, t) {
  37701. switch (e) {
  37702. case 0:
  37703. this.x = t;
  37704. break;
  37705. case 1:
  37706. this.y = t;
  37707. break;
  37708. case 2:
  37709. this.z = t;
  37710. break;
  37711. default:
  37712. throw new Error("index is out of range: " + e)
  37713. }
  37714. },
  37715. getComponent: function(e) {
  37716. switch (e) {
  37717. case 0:
  37718. return this.x;
  37719. case 1:
  37720. return this.y;
  37721. case 2:
  37722. return this.z;
  37723. default:
  37724. throw new Error("index is out of range: " + e)
  37725. }
  37726. },
  37727. clone: function() {
  37728. return new this.constructor(this.x,this.y,this.z)
  37729. },
  37730. copy: function(e) {
  37731. return this.x = e.x,
  37732. this.y = e.y,
  37733. this.z = e.z,
  37734. this
  37735. },
  37736. add: function(e, t) {
  37737. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37738. this.addVectors(e, t)) : (this.x += e.x,
  37739. this.y += e.y,
  37740. this.z += e.z,
  37741. this)
  37742. },
  37743. addScalar: function(e) {
  37744. return this.x += e,
  37745. this.y += e,
  37746. this.z += e,
  37747. this
  37748. },
  37749. addVectors: function(e, t) {
  37750. return this.x = e.x + t.x,
  37751. this.y = e.y + t.y,
  37752. this.z = e.z + t.z,
  37753. this
  37754. },
  37755. addScaledVector: function(e, t) {
  37756. return this.x += e.x * t,
  37757. this.y += e.y * t,
  37758. this.z += e.z * t,
  37759. this
  37760. },
  37761. sub: function(e, t) {
  37762. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37763. this.subVectors(e, t)) : (this.x -= e.x,
  37764. this.y -= e.y,
  37765. this.z -= e.z,
  37766. this)
  37767. },
  37768. subScalar: function(e) {
  37769. return this.x -= e,
  37770. this.y -= e,
  37771. this.z -= e,
  37772. this
  37773. },
  37774. subVectors: function(e, t) {
  37775. return this.x = e.x - t.x,
  37776. this.y = e.y - t.y,
  37777. this.z = e.z - t.z,
  37778. this
  37779. },
  37780. multiply: function(e, t) {
  37781. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  37782. this.multiplyVectors(e, t)) : (this.x *= e.x,
  37783. this.y *= e.y,
  37784. this.z *= e.z,
  37785. this)
  37786. },
  37787. multiplyScalar: function(e) {
  37788. return isFinite(e) ? (this.x *= e,
  37789. this.y *= e,
  37790. this.z *= e) : (this.x = 0,
  37791. this.y = 0,
  37792. this.z = 0),
  37793. this
  37794. },
  37795. multiplyVectors: function(e, t) {
  37796. return this.x = e.x * t.x,
  37797. this.y = e.y * t.y,
  37798. this.z = e.z * t.z,
  37799. this
  37800. },
  37801. applyEuler: function(e) {
  37802. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  37803. void 0 === De && (De = new Ci.Quaternion),
  37804. this.applyQuaternion(De.setFromEuler(e)),
  37805. this
  37806. },
  37807. applyAxisAngle: function(e, t) {
  37808. return void 0 === Le && (Le = new Ci.Quaternion),
  37809. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  37810. this
  37811. },
  37812. applyMatrix3: function(e) {
  37813. var t = this.x
  37814. , i = this.y
  37815. , n = this.z
  37816. , r = e.elements;
  37817. return this.x = r[0] * t + r[3] * i + r[6] * n,
  37818. this.y = r[1] * t + r[4] * i + r[7] * n,
  37819. this.z = r[2] * t + r[5] * i + r[8] * n,
  37820. this
  37821. },
  37822. applyMatrix4: function(e) {
  37823. var t = this.x
  37824. , i = this.y
  37825. , n = this.z
  37826. , r = e.elements;
  37827. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  37828. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  37829. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  37830. this
  37831. },
  37832. applyProjection: function(e) {
  37833. var t = this.x
  37834. , i = this.y
  37835. , n = this.z
  37836. , r = e.elements
  37837. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  37838. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  37839. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  37840. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  37841. this
  37842. },
  37843. applyQuaternion: function(e) {
  37844. var t = this.x
  37845. , i = this.y
  37846. , n = this.z
  37847. , r = e.x
  37848. , o = e.y
  37849. , a = e.z
  37850. , s = e.w
  37851. , l = s * t + o * n - a * i
  37852. , c = s * i + a * t - r * n
  37853. , h = s * n + r * i - o * t
  37854. , u = -r * t - o * i - a * n;
  37855. return this.x = l * s + u * -r + c * -a - h * -o,
  37856. this.y = c * s + u * -o + h * -r - l * -a,
  37857. this.z = h * s + u * -a + l * -o - c * -r,
  37858. this
  37859. },
  37860. project: function(e) {
  37861. return void 0 === Oe && (Oe = new Ci.Matrix4),
  37862. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  37863. this.applyProjection(Oe)
  37864. },
  37865. unproject: function(e) {
  37866. return void 0 === Pe && (Pe = new Ci.Matrix4),
  37867. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  37868. this.applyProjection(Pe)
  37869. },
  37870. transformDirection: function(e) {
  37871. var t = this.x
  37872. , i = this.y
  37873. , n = this.z
  37874. , r = e.elements;
  37875. return this.x = r[0] * t + r[4] * i + r[8] * n,
  37876. this.y = r[1] * t + r[5] * i + r[9] * n,
  37877. this.z = r[2] * t + r[6] * i + r[10] * n,
  37878. this.normalize(),
  37879. this
  37880. },
  37881. divide: function(e) {
  37882. return this.x /= e.x,
  37883. this.y /= e.y,
  37884. this.z /= e.z,
  37885. this
  37886. },
  37887. divideScalar: function(e) {
  37888. return this.multiplyScalar(1 / e)
  37889. },
  37890. min: function(e) {
  37891. return this.x = Math.min(this.x, e.x),
  37892. this.y = Math.min(this.y, e.y),
  37893. this.z = Math.min(this.z, e.z),
  37894. this
  37895. },
  37896. max: function(e) {
  37897. return this.x = Math.max(this.x, e.x),
  37898. this.y = Math.max(this.y, e.y),
  37899. this.z = Math.max(this.z, e.z),
  37900. this
  37901. },
  37902. clamp: function(e, t) {
  37903. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37904. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37905. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  37906. this
  37907. },
  37908. clampScalar: function(e, t) {
  37909. return void 0 === Me && (Me = new Ci.Vector3,
  37910. Re = new Ci.Vector3),
  37911. Me.set(e, e, e),
  37912. Re.set(t, t, t),
  37913. this.clamp(Me, Re)
  37914. },
  37915. clampLength: function(e, t) {
  37916. var i = this.length();
  37917. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37918. this
  37919. },
  37920. floor: function() {
  37921. return this.x = Math.floor(this.x),
  37922. this.y = Math.floor(this.y),
  37923. this.z = Math.floor(this.z),
  37924. this
  37925. },
  37926. ceil: function() {
  37927. return this.x = Math.ceil(this.x),
  37928. this.y = Math.ceil(this.y),
  37929. this.z = Math.ceil(this.z),
  37930. this
  37931. },
  37932. round: function() {
  37933. return this.x = Math.round(this.x),
  37934. this.y = Math.round(this.y),
  37935. this.z = Math.round(this.z),
  37936. this
  37937. },
  37938. roundToZero: function() {
  37939. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37940. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37941. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  37942. this
  37943. },
  37944. negate: function() {
  37945. return this.x = -this.x,
  37946. this.y = -this.y,
  37947. this.z = -this.z,
  37948. this
  37949. },
  37950. dot: function(e) {
  37951. return this.x * e.x + this.y * e.y + this.z * e.z
  37952. },
  37953. lengthSq: function() {
  37954. return this.x * this.x + this.y * this.y + this.z * this.z
  37955. },
  37956. length: function() {
  37957. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  37958. },
  37959. lengthManhattan: function() {
  37960. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  37961. },
  37962. normalize: function() {
  37963. return this.divideScalar(this.length())
  37964. },
  37965. setLength: function(e) {
  37966. return this.multiplyScalar(e / this.length())
  37967. },
  37968. lerp: function(e, t) {
  37969. return this.x += (e.x - this.x) * t,
  37970. this.y += (e.y - this.y) * t,
  37971. this.z += (e.z - this.z) * t,
  37972. this
  37973. },
  37974. lerpVectors: function(e, t, i) {
  37975. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37976. this
  37977. },
  37978. cross: function(e, t) {
  37979. if (void 0 !== t)
  37980. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  37981. this.crossVectors(e, t);
  37982. var i = this.x
  37983. , n = this.y
  37984. , r = this.z;
  37985. return this.x = n * e.z - r * e.y,
  37986. this.y = r * e.x - i * e.z,
  37987. this.z = i * e.y - n * e.x,
  37988. this
  37989. },
  37990. crossVectors: function(e, t) {
  37991. var i = e.x
  37992. , n = e.y
  37993. , r = e.z
  37994. , o = t.x
  37995. , a = t.y
  37996. , s = t.z;
  37997. return this.x = n * s - r * a,
  37998. this.y = r * o - i * s,
  37999. this.z = i * a - n * o,
  38000. this
  38001. },
  38002. projectOnVector: function(e) {
  38003. return void 0 === xe && (xe = new Ci.Vector3),
  38004. xe.copy(e).normalize(),
  38005. Se = this.dot(xe),
  38006. this.copy(xe).multiplyScalar(Se)
  38007. },
  38008. projectOnPlane: function(e) {
  38009. return void 0 === Te && (Te = new Ci.Vector3),
  38010. Te.copy(this).projectOnVector(e),
  38011. this.sub(Te)
  38012. },
  38013. reflect: function(e) {
  38014. return void 0 === we && (we = new Ci.Vector3),
  38015. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38016. },
  38017. angleTo: function(e) {
  38018. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38019. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38020. },
  38021. distanceTo: function(e) {
  38022. return Math.sqrt(this.distanceToSquared(e))
  38023. },
  38024. distanceToSquared: function(e) {
  38025. var t = this.x - e.x
  38026. , i = this.y - e.y
  38027. , n = this.z - e.z;
  38028. return t * t + i * i + n * n
  38029. },
  38030. setFromSpherical: function(e) {
  38031. var t = Math.sin(e.phi) * e.radius;
  38032. return this.x = t * Math.sin(e.theta),
  38033. this.y = Math.cos(e.phi) * e.radius,
  38034. this.z = t * Math.cos(e.theta),
  38035. this
  38036. },
  38037. setFromMatrixPosition: function(e) {
  38038. return this.setFromMatrixColumn(e, 3)
  38039. },
  38040. setFromMatrixScale: function(e) {
  38041. var t = this.setFromMatrixColumn(e, 0).length()
  38042. , i = this.setFromMatrixColumn(e, 1).length()
  38043. , n = this.setFromMatrixColumn(e, 2).length();
  38044. return this.x = t,
  38045. this.y = i,
  38046. this.z = n,
  38047. this
  38048. },
  38049. setFromMatrixColumn: function(e, t) {
  38050. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38051. t = e = t),
  38052. this.fromArray(e.elements, 4 * t)
  38053. },
  38054. equals: function(e) {
  38055. return e.x === this.x && e.y === this.y && e.z === this.z
  38056. },
  38057. fromArray: function(e, t) {
  38058. return void 0 === t && (t = 0),
  38059. this.x = e[t],
  38060. this.y = e[t + 1],
  38061. this.z = e[t + 2],
  38062. this
  38063. },
  38064. toArray: function(e, t) {
  38065. return void 0 === e && (e = []),
  38066. void 0 === t && (t = 0),
  38067. e[t] = this.x,
  38068. e[t + 1] = this.y,
  38069. e[t + 2] = this.z,
  38070. e
  38071. },
  38072. fromAttribute: function(e, t, i) {
  38073. return void 0 === i && (i = 0),
  38074. t = t * e.itemSize + i,
  38075. this.x = e.array[t],
  38076. this.y = e.array[t + 1],
  38077. this.z = e.array[t + 2],
  38078. this
  38079. }
  38080. },
  38081. Ci.Vector4 = function(e, t, i, n) {
  38082. this.x = e || 0,
  38083. this.y = t || 0,
  38084. this.z = i || 0,
  38085. this.w = void 0 !== n ? n : 1
  38086. }
  38087. ,
  38088. Ci.Vector4.prototype = {
  38089. constructor: Ci.Vector4,
  38090. set: function(e, t, i, n) {
  38091. return this.x = e,
  38092. this.y = t,
  38093. this.z = i,
  38094. this.w = n,
  38095. this
  38096. },
  38097. setScalar: function(e) {
  38098. return this.x = e,
  38099. this.y = e,
  38100. this.z = e,
  38101. this.w = e,
  38102. this
  38103. },
  38104. setX: function(e) {
  38105. return this.x = e,
  38106. this
  38107. },
  38108. setY: function(e) {
  38109. return this.y = e,
  38110. this
  38111. },
  38112. setZ: function(e) {
  38113. return this.z = e,
  38114. this
  38115. },
  38116. setW: function(e) {
  38117. return this.w = e,
  38118. this
  38119. },
  38120. setComponent: function(e, t) {
  38121. switch (e) {
  38122. case 0:
  38123. this.x = t;
  38124. break;
  38125. case 1:
  38126. this.y = t;
  38127. break;
  38128. case 2:
  38129. this.z = t;
  38130. break;
  38131. case 3:
  38132. this.w = t;
  38133. break;
  38134. default:
  38135. throw new Error("index is out of range: " + e)
  38136. }
  38137. },
  38138. getComponent: function(e) {
  38139. switch (e) {
  38140. case 0:
  38141. return this.x;
  38142. case 1:
  38143. return this.y;
  38144. case 2:
  38145. return this.z;
  38146. case 3:
  38147. return this.w;
  38148. default:
  38149. throw new Error("index is out of range: " + e)
  38150. }
  38151. },
  38152. clone: function() {
  38153. return new this.constructor(this.x,this.y,this.z,this.w)
  38154. },
  38155. copy: function(e) {
  38156. return this.x = e.x,
  38157. this.y = e.y,
  38158. this.z = e.z,
  38159. this.w = void 0 !== e.w ? e.w : 1,
  38160. this
  38161. },
  38162. add: function(e, t) {
  38163. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38164. this.addVectors(e, t)) : (this.x += e.x,
  38165. this.y += e.y,
  38166. this.z += e.z,
  38167. this.w += e.w,
  38168. this)
  38169. },
  38170. addScalar: function(e) {
  38171. return this.x += e,
  38172. this.y += e,
  38173. this.z += e,
  38174. this.w += e,
  38175. this
  38176. },
  38177. addVectors: function(e, t) {
  38178. return this.x = e.x + t.x,
  38179. this.y = e.y + t.y,
  38180. this.z = e.z + t.z,
  38181. this.w = e.w + t.w,
  38182. this
  38183. },
  38184. addScaledVector: function(e, t) {
  38185. return this.x += e.x * t,
  38186. this.y += e.y * t,
  38187. this.z += e.z * t,
  38188. this.w += e.w * t,
  38189. this
  38190. },
  38191. sub: function(e, t) {
  38192. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38193. this.subVectors(e, t)) : (this.x -= e.x,
  38194. this.y -= e.y,
  38195. this.z -= e.z,
  38196. this.w -= e.w,
  38197. this)
  38198. },
  38199. subScalar: function(e) {
  38200. return this.x -= e,
  38201. this.y -= e,
  38202. this.z -= e,
  38203. this.w -= e,
  38204. this
  38205. },
  38206. subVectors: function(e, t) {
  38207. return this.x = e.x - t.x,
  38208. this.y = e.y - t.y,
  38209. this.z = e.z - t.z,
  38210. this.w = e.w - t.w,
  38211. this
  38212. },
  38213. multiplyScalar: function(e) {
  38214. return isFinite(e) ? (this.x *= e,
  38215. this.y *= e,
  38216. this.z *= e,
  38217. this.w *= e) : (this.x = 0,
  38218. this.y = 0,
  38219. this.z = 0,
  38220. this.w = 0),
  38221. this
  38222. },
  38223. applyMatrix4: function(e) {
  38224. var t = this.x
  38225. , i = this.y
  38226. , n = this.z
  38227. , r = this.w
  38228. , o = e.elements;
  38229. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38230. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38231. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38232. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38233. this
  38234. },
  38235. divideScalar: function(e) {
  38236. return this.multiplyScalar(1 / e)
  38237. },
  38238. setAxisAngleFromQuaternion: function(e) {
  38239. this.w = 2 * Math.acos(e.w);
  38240. var t = Math.sqrt(1 - e.w * e.w);
  38241. return t < 1e-4 ? (this.x = 1,
  38242. this.y = 0,
  38243. this.z = 0) : (this.x = e.x / t,
  38244. this.y = e.y / t,
  38245. this.z = e.z / t),
  38246. this
  38247. },
  38248. setAxisAngleFromRotationMatrix: function(e) {
  38249. var t, i, n, r, o = e.elements, a = o[0], s = o[4], l = o[8], c = o[1], h = o[5], u = o[9], d = o[2], p = o[6], f = o[10];
  38250. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38251. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38252. return this.set(1, 0, 0, 0),
  38253. this;
  38254. t = Math.PI;
  38255. var g = (a + 1) / 2
  38256. , m = (h + 1) / 2
  38257. , v = (f + 1) / 2
  38258. , y = (s + c) / 4
  38259. , A = (l + d) / 4
  38260. , C = (u + p) / 4;
  38261. return m < g && v < g ? r = g < .01 ? (i = 0,
  38262. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38263. A / i) : v < m ? r = m < .01 ? (n = 0,
  38264. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38265. C / n) : v < .01 ? (n = i = .707106781,
  38266. r = 0) : (i = A / (r = Math.sqrt(v)),
  38267. n = C / r),
  38268. this.set(i, n, r, t),
  38269. this
  38270. }
  38271. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38272. return Math.abs(I) < .001 && (I = 1),
  38273. this.x = (p - u) / I,
  38274. this.y = (l - d) / I,
  38275. this.z = (c - s) / I,
  38276. this.w = Math.acos((a + h + f - 1) / 2),
  38277. this
  38278. },
  38279. min: function(e) {
  38280. return this.x = Math.min(this.x, e.x),
  38281. this.y = Math.min(this.y, e.y),
  38282. this.z = Math.min(this.z, e.z),
  38283. this.w = Math.min(this.w, e.w),
  38284. this
  38285. },
  38286. max: function(e) {
  38287. return this.x = Math.max(this.x, e.x),
  38288. this.y = Math.max(this.y, e.y),
  38289. this.z = Math.max(this.z, e.z),
  38290. this.w = Math.max(this.w, e.w),
  38291. this
  38292. },
  38293. clamp: function(e, t) {
  38294. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38295. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38296. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38297. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38298. this
  38299. },
  38300. clampScalar: function(e, t) {
  38301. return void 0 === _e && (_e = new Ci.Vector4,
  38302. be = new Ci.Vector4),
  38303. _e.set(e, e, e, e),
  38304. be.set(t, t, t, t),
  38305. this.clamp(_e, be)
  38306. },
  38307. floor: function() {
  38308. return this.x = Math.floor(this.x),
  38309. this.y = Math.floor(this.y),
  38310. this.z = Math.floor(this.z),
  38311. this.w = Math.floor(this.w),
  38312. this
  38313. },
  38314. ceil: function() {
  38315. return this.x = Math.ceil(this.x),
  38316. this.y = Math.ceil(this.y),
  38317. this.z = Math.ceil(this.z),
  38318. this.w = Math.ceil(this.w),
  38319. this
  38320. },
  38321. round: function() {
  38322. return this.x = Math.round(this.x),
  38323. this.y = Math.round(this.y),
  38324. this.z = Math.round(this.z),
  38325. this.w = Math.round(this.w),
  38326. this
  38327. },
  38328. roundToZero: function() {
  38329. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38330. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38331. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38332. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38333. this
  38334. },
  38335. negate: function() {
  38336. return this.x = -this.x,
  38337. this.y = -this.y,
  38338. this.z = -this.z,
  38339. this.w = -this.w,
  38340. this
  38341. },
  38342. dot: function(e) {
  38343. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38344. },
  38345. lengthSq: function() {
  38346. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38347. },
  38348. length: function() {
  38349. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38350. },
  38351. lengthManhattan: function() {
  38352. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38353. },
  38354. normalize: function() {
  38355. return this.divideScalar(this.length())
  38356. },
  38357. setLength: function(e) {
  38358. return this.multiplyScalar(e / this.length())
  38359. },
  38360. lerp: function(e, t) {
  38361. return this.x += (e.x - this.x) * t,
  38362. this.y += (e.y - this.y) * t,
  38363. this.z += (e.z - this.z) * t,
  38364. this.w += (e.w - this.w) * t,
  38365. this
  38366. },
  38367. lerpVectors: function(e, t, i) {
  38368. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38369. this
  38370. },
  38371. equals: function(e) {
  38372. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38373. },
  38374. fromArray: function(e, t) {
  38375. return void 0 === t && (t = 0),
  38376. this.x = e[t],
  38377. this.y = e[t + 1],
  38378. this.z = e[t + 2],
  38379. this.w = e[t + 3],
  38380. this
  38381. },
  38382. toArray: function(e, t) {
  38383. return void 0 === e && (e = []),
  38384. void 0 === t && (t = 0),
  38385. e[t] = this.x,
  38386. e[t + 1] = this.y,
  38387. e[t + 2] = this.z,
  38388. e[t + 3] = this.w,
  38389. e
  38390. },
  38391. fromAttribute: function(e, t, i) {
  38392. return void 0 === i && (i = 0),
  38393. t = t * e.itemSize + i,
  38394. this.x = e.array[t],
  38395. this.y = e.array[t + 1],
  38396. this.z = e.array[t + 2],
  38397. this.w = e.array[t + 3],
  38398. this
  38399. }
  38400. },
  38401. Ci.Euler = function(e, t, i, n) {
  38402. this._x = e || 0,
  38403. this._y = t || 0,
  38404. this._z = i || 0,
  38405. this._order = n || Ci.Euler.DefaultOrder
  38406. }
  38407. ,
  38408. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38409. Ci.Euler.DefaultOrder = "XYZ",
  38410. Ci.Euler.prototype = {
  38411. constructor: Ci.Euler,
  38412. get x() {
  38413. return this._x
  38414. },
  38415. set x(e) {
  38416. this._x = e,
  38417. this.onChangeCallback()
  38418. },
  38419. get y() {
  38420. return this._y
  38421. },
  38422. set y(e) {
  38423. this._y = e,
  38424. this.onChangeCallback()
  38425. },
  38426. get z() {
  38427. return this._z
  38428. },
  38429. set z(e) {
  38430. this._z = e,
  38431. this.onChangeCallback()
  38432. },
  38433. get order() {
  38434. return this._order
  38435. },
  38436. set order(e) {
  38437. this._order = e,
  38438. this.onChangeCallback()
  38439. },
  38440. set: function(e, t, i, n) {
  38441. return this._x = e,
  38442. this._y = t,
  38443. this._z = i,
  38444. this._order = n || this._order,
  38445. this.onChangeCallback(),
  38446. this
  38447. },
  38448. clone: function() {
  38449. return new this.constructor(this._x,this._y,this._z,this._order)
  38450. },
  38451. copy: function(e) {
  38452. return this._x = e._x,
  38453. this._y = e._y,
  38454. this._z = e._z,
  38455. this._order = e._order,
  38456. this.onChangeCallback(),
  38457. this
  38458. },
  38459. setFromRotationMatrix: function(e, t, i) {
  38460. var n = Ci.Math.clamp
  38461. , r = e.elements
  38462. , o = r[0]
  38463. , a = r[4]
  38464. , s = r[8]
  38465. , l = r[1]
  38466. , c = r[5]
  38467. , h = r[9]
  38468. , u = r[2]
  38469. , d = r[6]
  38470. , p = r[10];
  38471. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38472. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38473. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38474. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38475. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38476. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38477. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38478. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38479. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38480. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38481. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38482. this._z = Math.atan2(l, o)) : (this._x = 0,
  38483. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38484. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38485. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38486. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38487. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38488. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38489. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38490. this._order = t,
  38491. !1 !== i && this.onChangeCallback(),
  38492. this
  38493. },
  38494. setFromQuaternion: function(e, t, i) {
  38495. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38496. Ee.makeRotationFromQuaternion(e),
  38497. this.setFromRotationMatrix(Ee, t, i),
  38498. this
  38499. },
  38500. setFromVector3: function(e, t) {
  38501. return this.set(e.x, e.y, e.z, t || this._order)
  38502. },
  38503. reorder: (Ie = new Ci.Quaternion,
  38504. function(e) {
  38505. Ie.setFromEuler(this),
  38506. this.setFromQuaternion(Ie, e)
  38507. }
  38508. ),
  38509. equals: function(e) {
  38510. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38511. },
  38512. fromArray: function(e) {
  38513. return this._x = e[0],
  38514. this._y = e[1],
  38515. this._z = e[2],
  38516. void 0 !== e[3] && (this._order = e[3]),
  38517. this.onChangeCallback(),
  38518. this
  38519. },
  38520. toArray: function(e, t) {
  38521. return void 0 === e && (e = []),
  38522. void 0 === t && (t = 0),
  38523. e[t] = this._x,
  38524. e[t + 1] = this._y,
  38525. e[t + 2] = this._z,
  38526. e[t + 3] = this._order,
  38527. e
  38528. },
  38529. toVector3: function(e) {
  38530. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38531. },
  38532. onChange: function(e) {
  38533. return this.onChangeCallback = e,
  38534. this
  38535. },
  38536. onChangeCallback: function() {}
  38537. },
  38538. Ci.Line3 = function(e, t) {
  38539. this.start = void 0 !== e ? e : new Ci.Vector3,
  38540. this.end = void 0 !== t ? t : new Ci.Vector3
  38541. }
  38542. ,
  38543. Ci.Line3.prototype = {
  38544. constructor: Ci.Line3,
  38545. set: function(e, t) {
  38546. return this.start.copy(e),
  38547. this.end.copy(t),
  38548. this
  38549. },
  38550. clone: function() {
  38551. return (new this.constructor).copy(this)
  38552. },
  38553. copy: function(e) {
  38554. return this.start.copy(e.start),
  38555. this.end.copy(e.end),
  38556. this
  38557. },
  38558. center: function(e) {
  38559. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38560. },
  38561. delta: function(e) {
  38562. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38563. },
  38564. distanceSq: function() {
  38565. return this.start.distanceToSquared(this.end)
  38566. },
  38567. distance: function() {
  38568. return this.start.distanceTo(this.end)
  38569. },
  38570. at: function(e, t) {
  38571. var i = t || new Ci.Vector3;
  38572. return this.delta(i).multiplyScalar(e).add(this.start)
  38573. },
  38574. closestPointToPointParameter: (Ae = new Ci.Vector3,
  38575. Ce = new Ci.Vector3,
  38576. function(e, t) {
  38577. Ae.subVectors(e, this.start),
  38578. Ce.subVectors(this.end, this.start);
  38579. var i = Ce.dot(Ce)
  38580. , n = Ce.dot(Ae) / i;
  38581. return t && (n = Ci.Math.clamp(n, 0, 1)),
  38582. n
  38583. }
  38584. ),
  38585. closestPointToPoint: function(e, t, i) {
  38586. var n = this.closestPointToPointParameter(e, t)
  38587. , r = i || new Ci.Vector3;
  38588. return this.delta(r).multiplyScalar(n).add(this.start)
  38589. },
  38590. applyMatrix4: function(e) {
  38591. return this.start.applyMatrix4(e),
  38592. this.end.applyMatrix4(e),
  38593. this
  38594. },
  38595. equals: function(e) {
  38596. return e.start.equals(this.start) && e.end.equals(this.end)
  38597. }
  38598. },
  38599. Ci.Box2 = function(e, t) {
  38600. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  38601. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  38602. }
  38603. ,
  38604. Ci.Box2.prototype = {
  38605. constructor: Ci.Box2,
  38606. set: function(e, t) {
  38607. return this.min.copy(e),
  38608. this.max.copy(t),
  38609. this
  38610. },
  38611. setFromPoints: function(e) {
  38612. this.makeEmpty();
  38613. for (var t = 0, i = e.length; t < i; t++)
  38614. this.expandByPoint(e[t]);
  38615. return this
  38616. },
  38617. setFromCenterAndSize: (ye = new Ci.Vector2,
  38618. function(e, t) {
  38619. var i = ye.copy(t).multiplyScalar(.5);
  38620. return this.min.copy(e).sub(i),
  38621. this.max.copy(e).add(i),
  38622. this
  38623. }
  38624. ),
  38625. clone: function() {
  38626. return (new this.constructor).copy(this)
  38627. },
  38628. copy: function(e) {
  38629. return this.min.copy(e.min),
  38630. this.max.copy(e.max),
  38631. this
  38632. },
  38633. makeEmpty: function() {
  38634. return this.min.x = this.min.y = 1 / 0,
  38635. this.max.x = this.max.y = -1 / 0,
  38636. this
  38637. },
  38638. isEmpty: function() {
  38639. return this.max.x < this.min.x || this.max.y < this.min.y
  38640. },
  38641. center: function(e) {
  38642. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  38643. },
  38644. size: function(e) {
  38645. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  38646. },
  38647. expandByPoint: function(e) {
  38648. return this.min.min(e),
  38649. this.max.max(e),
  38650. this
  38651. },
  38652. expandByVector: function(e) {
  38653. return this.min.sub(e),
  38654. this.max.add(e),
  38655. this
  38656. },
  38657. expandByScalar: function(e) {
  38658. return this.min.addScalar(-e),
  38659. this.max.addScalar(e),
  38660. this
  38661. },
  38662. containsPoint: function(e) {
  38663. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  38664. },
  38665. containsBox: function(e) {
  38666. 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
  38667. },
  38668. getParameter: function(e, t) {
  38669. return (t || new Ci.Vector2).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  38670. },
  38671. intersectsBox: function(e) {
  38672. 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)
  38673. },
  38674. clampPoint: function(e, t) {
  38675. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  38676. },
  38677. distanceToPoint: (ve = new Ci.Vector2,
  38678. function(e) {
  38679. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  38680. }
  38681. ),
  38682. intersect: function(e) {
  38683. return this.min.max(e.min),
  38684. this.max.min(e.max),
  38685. this
  38686. },
  38687. union: function(e) {
  38688. return this.min.min(e.min),
  38689. this.max.max(e.max),
  38690. this
  38691. },
  38692. translate: function(e) {
  38693. return this.min.add(e),
  38694. this.max.add(e),
  38695. this
  38696. },
  38697. equals: function(e) {
  38698. return e.min.equals(this.min) && e.max.equals(this.max)
  38699. }
  38700. },
  38701. Ci.Box3 = function(e, t) {
  38702. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  38703. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  38704. }
  38705. ,
  38706. Ci.Box3.prototype = {
  38707. constructor: Ci.Box3,
  38708. set: function(e, t) {
  38709. return this.min.copy(e),
  38710. this.max.copy(t),
  38711. this
  38712. },
  38713. setFromArray: function(e) {
  38714. this.makeEmpty();
  38715. 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) {
  38716. var c = e[s]
  38717. , h = e[s + 1]
  38718. , u = e[s + 2];
  38719. c < t && (t = c),
  38720. h < i && (i = h),
  38721. u < n && (n = u),
  38722. r < c && (r = c),
  38723. o < h && (o = h),
  38724. a < u && (a = u)
  38725. }
  38726. this.min.set(t, i, n),
  38727. this.max.set(r, o, a)
  38728. },
  38729. setFromPoints: function(e) {
  38730. this.makeEmpty();
  38731. for (var t = 0, i = e.length; t < i; t++)
  38732. this.expandByPoint(e[t]);
  38733. return this
  38734. },
  38735. setFromCenterAndSize: (me = new Ci.Vector3,
  38736. function(e, t) {
  38737. var i = me.copy(t).multiplyScalar(.5);
  38738. return this.min.copy(e).sub(i),
  38739. this.max.copy(e).add(i),
  38740. this
  38741. }
  38742. ),
  38743. setFromObject: function(e) {
  38744. void 0 === ge && (ge = new Ci.Box3);
  38745. var i = this;
  38746. return this.makeEmpty(),
  38747. e.updateMatrixWorld(!0),
  38748. e.traverse(function(e) {
  38749. var t = e.geometry;
  38750. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  38751. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  38752. ge.applyMatrix4(e.matrixWorld),
  38753. i.union(ge)))
  38754. }),
  38755. this
  38756. },
  38757. clone: function() {
  38758. return (new this.constructor).copy(this)
  38759. },
  38760. copy: function(e) {
  38761. return this.min.copy(e.min),
  38762. this.max.copy(e.max),
  38763. this
  38764. },
  38765. makeEmpty: function() {
  38766. return this.min.x = this.min.y = this.min.z = 1 / 0,
  38767. this.max.x = this.max.y = this.max.z = -1 / 0,
  38768. this
  38769. },
  38770. isEmpty: function() {
  38771. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  38772. },
  38773. center: function(e) {
  38774. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  38775. },
  38776. size: function(e) {
  38777. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  38778. },
  38779. expandByPoint: function(e) {
  38780. return this.min.min(e),
  38781. this.max.max(e),
  38782. this
  38783. },
  38784. expandByVector: function(e) {
  38785. return this.min.sub(e),
  38786. this.max.add(e),
  38787. this
  38788. },
  38789. expandByScalar: function(e) {
  38790. return this.min.addScalar(-e),
  38791. this.max.addScalar(e),
  38792. this
  38793. },
  38794. containsPoint: function(e) {
  38795. 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)
  38796. },
  38797. containsBox: function(e) {
  38798. 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
  38799. },
  38800. getParameter: function(e, t) {
  38801. return (t || new Ci.Vector3).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  38802. },
  38803. intersectsBox: function(e) {
  38804. 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)
  38805. },
  38806. intersectsSphere: function(e) {
  38807. return void 0 === fe && (fe = new Ci.Vector3),
  38808. this.clampPoint(e.center, fe),
  38809. fe.distanceToSquared(e.center) <= e.radius * e.radius
  38810. },
  38811. intersectsPlane: function(e) {
  38812. var t, i;
  38813. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  38814. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  38815. e.normal.x * this.min.x),
  38816. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  38817. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  38818. i += e.normal.y * this.min.y),
  38819. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  38820. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  38821. i += e.normal.z * this.min.z),
  38822. t <= e.constant && i >= e.constant
  38823. },
  38824. clampPoint: function(e, t) {
  38825. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  38826. },
  38827. distanceToPoint: (pe = new Ci.Vector3,
  38828. function(e) {
  38829. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  38830. }
  38831. ),
  38832. getBoundingSphere: (de = new Ci.Vector3,
  38833. function(e) {
  38834. var t = e || new Ci.Sphere;
  38835. return t.center = this.center(),
  38836. t.radius = .5 * this.size(de).length(),
  38837. t
  38838. }
  38839. ),
  38840. intersect: function(e) {
  38841. return this.min.max(e.min),
  38842. this.max.min(e.max),
  38843. this
  38844. },
  38845. union: function(e) {
  38846. return this.min.min(e.min),
  38847. this.max.max(e.max),
  38848. this
  38849. },
  38850. applyMatrix4: (ue = [new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3],
  38851. function(e) {
  38852. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  38853. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  38854. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  38855. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  38856. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  38857. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  38858. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  38859. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  38860. this.makeEmpty(),
  38861. this.setFromPoints(ue),
  38862. this
  38863. }
  38864. ),
  38865. translate: function(e) {
  38866. return this.min.add(e),
  38867. this.max.add(e),
  38868. this
  38869. },
  38870. equals: function(e) {
  38871. return e.min.equals(this.min) && e.max.equals(this.max)
  38872. }
  38873. },
  38874. Ci.Matrix3 = function() {
  38875. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  38876. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  38877. }
  38878. ,
  38879. Ci.Matrix3.prototype = {
  38880. constructor: Ci.Matrix3,
  38881. set: function(e, t, i, n, r, o, a, s, l) {
  38882. var c = this.elements;
  38883. return c[0] = e,
  38884. c[1] = n,
  38885. c[2] = a,
  38886. c[3] = t,
  38887. c[4] = r,
  38888. c[5] = s,
  38889. c[6] = i,
  38890. c[7] = o,
  38891. c[8] = l,
  38892. this
  38893. },
  38894. identity: function() {
  38895. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  38896. this
  38897. },
  38898. clone: function() {
  38899. return (new this.constructor).fromArray(this.elements)
  38900. },
  38901. copy: function(e) {
  38902. var t = e.elements;
  38903. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  38904. this
  38905. },
  38906. setFromMatrix4: function(e) {
  38907. var t = e.elements;
  38908. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  38909. this
  38910. },
  38911. applyToVector3Array: function(e, t, i) {
  38912. void 0 === he && (he = new Ci.Vector3),
  38913. void 0 === t && (t = 0),
  38914. void 0 === i && (i = e.length);
  38915. for (var n = 0, r = t; n < i; n += 3,
  38916. r += 3)
  38917. he.fromArray(e, r),
  38918. he.applyMatrix3(this),
  38919. he.toArray(e, r);
  38920. return e
  38921. },
  38922. applyToBuffer: function(e, t, i) {
  38923. void 0 === ce && (ce = new Ci.Vector3),
  38924. void 0 === t && (t = 0),
  38925. void 0 === i && (i = e.length / e.itemSize);
  38926. for (var n = 0, r = t; n < i; n++,
  38927. r++)
  38928. ce.x = e.getX(r),
  38929. ce.y = e.getY(r),
  38930. ce.z = e.getZ(r),
  38931. ce.applyMatrix3(this),
  38932. e.setXYZ(ce.x, ce.y, ce.z);
  38933. return e
  38934. },
  38935. multiplyScalar: function(e) {
  38936. var t = this.elements;
  38937. return t[0] *= e,
  38938. t[3] *= e,
  38939. t[6] *= e,
  38940. t[1] *= e,
  38941. t[4] *= e,
  38942. t[7] *= e,
  38943. t[2] *= e,
  38944. t[5] *= e,
  38945. t[8] *= e,
  38946. this
  38947. },
  38948. determinant: function() {
  38949. var e = this.elements
  38950. , t = e[0]
  38951. , i = e[1]
  38952. , n = e[2]
  38953. , r = e[3]
  38954. , o = e[4]
  38955. , a = e[5]
  38956. , s = e[6]
  38957. , l = e[7]
  38958. , c = e[8];
  38959. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  38960. },
  38961. getInverse: function(e, t) {
  38962. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  38963. var i = e.elements
  38964. , n = this.elements
  38965. , r = i[0]
  38966. , o = i[1]
  38967. , a = i[2]
  38968. , s = i[3]
  38969. , l = i[4]
  38970. , c = i[5]
  38971. , h = i[6]
  38972. , u = i[7]
  38973. , d = i[8]
  38974. , p = d * l - c * u
  38975. , f = c * h - d * s
  38976. , g = u * s - l * h
  38977. , m = r * p + o * f + a * g;
  38978. if (0 != m)
  38979. return n[0] = p,
  38980. n[1] = a * u - d * o,
  38981. n[2] = c * o - a * l,
  38982. n[3] = f,
  38983. n[4] = d * r - a * h,
  38984. n[5] = a * s - c * r,
  38985. n[6] = g,
  38986. n[7] = o * h - u * r,
  38987. n[8] = l * r - o * s,
  38988. this.multiplyScalar(1 / m);
  38989. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  38990. if (t)
  38991. throw new Error(v);
  38992. return console.warn(v),
  38993. this.identity()
  38994. },
  38995. transpose: function() {
  38996. var e, t = this.elements;
  38997. return e = t[1],
  38998. t[1] = t[3],
  38999. t[3] = e,
  39000. e = t[2],
  39001. t[2] = t[6],
  39002. t[6] = e,
  39003. e = t[5],
  39004. t[5] = t[7],
  39005. t[7] = e,
  39006. this
  39007. },
  39008. flattenToArrayOffset: function(e, t) {
  39009. var i = this.elements;
  39010. return e[t] = i[0],
  39011. e[t + 1] = i[1],
  39012. e[t + 2] = i[2],
  39013. e[t + 3] = i[3],
  39014. e[t + 4] = i[4],
  39015. e[t + 5] = i[5],
  39016. e[t + 6] = i[6],
  39017. e[t + 7] = i[7],
  39018. e[t + 8] = i[8],
  39019. e
  39020. },
  39021. getNormalMatrix: function(e) {
  39022. return this.setFromMatrix4(e).getInverse(this).transpose()
  39023. },
  39024. transposeIntoArray: function(e) {
  39025. var t = this.elements;
  39026. return e[0] = t[0],
  39027. e[1] = t[3],
  39028. e[2] = t[6],
  39029. e[3] = t[1],
  39030. e[4] = t[4],
  39031. e[5] = t[7],
  39032. e[6] = t[2],
  39033. e[7] = t[5],
  39034. e[8] = t[8],
  39035. this
  39036. },
  39037. fromArray: function(e) {
  39038. return this.elements.set(e),
  39039. this
  39040. },
  39041. toArray: function() {
  39042. var e = this.elements;
  39043. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39044. }
  39045. },
  39046. Ci.Matrix4 = function() {
  39047. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39048. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39049. }
  39050. ,
  39051. Ci.Matrix4.prototype = {
  39052. constructor: Ci.Matrix4,
  39053. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39054. var m = this.elements;
  39055. return m[0] = e,
  39056. m[4] = t,
  39057. m[8] = i,
  39058. m[12] = n,
  39059. m[1] = r,
  39060. m[5] = o,
  39061. m[9] = a,
  39062. m[13] = s,
  39063. m[2] = l,
  39064. m[6] = c,
  39065. m[10] = h,
  39066. m[14] = u,
  39067. m[3] = d,
  39068. m[7] = p,
  39069. m[11] = f,
  39070. m[15] = g,
  39071. this
  39072. },
  39073. identity: function() {
  39074. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39075. this
  39076. },
  39077. clone: function() {
  39078. return (new Ci.Matrix4).fromArray(this.elements)
  39079. },
  39080. copy: function(e) {
  39081. return this.elements.set(e.elements),
  39082. this
  39083. },
  39084. copyPosition: function(e) {
  39085. var t = this.elements
  39086. , i = e.elements;
  39087. return t[12] = i[12],
  39088. t[13] = i[13],
  39089. t[14] = i[14],
  39090. this
  39091. },
  39092. extractBasis: function(e, t, i) {
  39093. return e.setFromMatrixColumn(this, 0),
  39094. t.setFromMatrixColumn(this, 1),
  39095. i.setFromMatrixColumn(this, 2),
  39096. this
  39097. },
  39098. makeBasis: function(e, t, i) {
  39099. 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),
  39100. this
  39101. },
  39102. extractRotation: function(e) {
  39103. void 0 === le && (le = new Ci.Vector3);
  39104. var t = this.elements
  39105. , i = e.elements
  39106. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39107. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39108. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39109. return t[0] = i[0] * n,
  39110. t[1] = i[1] * n,
  39111. t[2] = i[2] * n,
  39112. t[4] = i[4] * r,
  39113. t[5] = i[5] * r,
  39114. t[6] = i[6] * r,
  39115. t[8] = i[8] * o,
  39116. t[9] = i[9] * o,
  39117. t[10] = i[10] * o,
  39118. this
  39119. },
  39120. makeRotationFromEuler: function(e) {
  39121. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39122. var t = this.elements
  39123. , i = e.x
  39124. , n = e.y
  39125. , r = e.z
  39126. , o = Math.cos(i)
  39127. , a = Math.sin(i)
  39128. , s = Math.cos(n)
  39129. , l = Math.sin(n)
  39130. , c = Math.cos(r)
  39131. , h = Math.sin(r);
  39132. if ("XYZ" === e.order) {
  39133. var u = o * c
  39134. , d = o * h
  39135. , p = a * c
  39136. , f = a * h;
  39137. t[0] = s * c,
  39138. t[4] = -s * h,
  39139. t[8] = l,
  39140. t[1] = d + p * l,
  39141. t[5] = u - f * l,
  39142. t[9] = -a * s,
  39143. t[2] = f - u * l,
  39144. t[6] = p + d * l,
  39145. t[10] = o * s
  39146. } else if ("YXZ" === e.order) {
  39147. var g = s * c
  39148. , m = s * h
  39149. , v = l * c
  39150. , y = l * h;
  39151. t[0] = g + y * a,
  39152. t[4] = v * a - m,
  39153. t[8] = o * l,
  39154. t[1] = o * h,
  39155. t[5] = o * c,
  39156. t[9] = -a,
  39157. t[2] = m * a - v,
  39158. t[6] = y + g * a,
  39159. t[10] = o * s
  39160. } else if ("ZXY" === e.order) {
  39161. g = s * c,
  39162. m = s * h,
  39163. v = l * c,
  39164. y = l * h;
  39165. t[0] = g - y * a,
  39166. t[4] = -o * h,
  39167. t[8] = v + m * a,
  39168. t[1] = m + v * a,
  39169. t[5] = o * c,
  39170. t[9] = y - g * a,
  39171. t[2] = -o * l,
  39172. t[6] = a,
  39173. t[10] = o * s
  39174. } else if ("ZYX" === e.order) {
  39175. u = o * c,
  39176. d = o * h,
  39177. p = a * c,
  39178. f = a * h;
  39179. t[0] = s * c,
  39180. t[4] = p * l - d,
  39181. t[8] = u * l + f,
  39182. t[1] = s * h,
  39183. t[5] = f * l + u,
  39184. t[9] = d * l - p,
  39185. t[2] = -l,
  39186. t[6] = a * s,
  39187. t[10] = o * s
  39188. } else if ("YZX" === e.order) {
  39189. var A = o * s
  39190. , C = o * l
  39191. , I = a * s
  39192. , E = a * l;
  39193. t[0] = s * c,
  39194. t[4] = E - A * h,
  39195. t[8] = I * h + C,
  39196. t[1] = h,
  39197. t[5] = o * c,
  39198. t[9] = -a * c,
  39199. t[2] = -l * c,
  39200. t[6] = C * h + I,
  39201. t[10] = A - E * h
  39202. } else if ("XZY" === e.order) {
  39203. A = o * s,
  39204. C = o * l,
  39205. I = a * s,
  39206. E = a * l;
  39207. t[0] = s * c,
  39208. t[4] = -h,
  39209. t[8] = l * c,
  39210. t[1] = A * h + E,
  39211. t[5] = o * c,
  39212. t[9] = C * h - I,
  39213. t[2] = I * h - C,
  39214. t[6] = a * c,
  39215. t[10] = E * h + A
  39216. }
  39217. return t[3] = 0,
  39218. t[7] = 0,
  39219. t[11] = 0,
  39220. t[12] = 0,
  39221. t[13] = 0,
  39222. t[14] = 0,
  39223. t[15] = 1,
  39224. this
  39225. },
  39226. makeRotationFromQuaternion: function(e) {
  39227. var t = this.elements
  39228. , i = e.x
  39229. , n = e.y
  39230. , r = e.z
  39231. , o = e.w
  39232. , a = i + i
  39233. , s = n + n
  39234. , l = r + r
  39235. , c = i * a
  39236. , h = i * s
  39237. , u = i * l
  39238. , d = n * s
  39239. , p = n * l
  39240. , f = r * l
  39241. , g = o * a
  39242. , m = o * s
  39243. , v = o * l;
  39244. return t[0] = 1 - (d + f),
  39245. t[4] = h - v,
  39246. t[8] = u + m,
  39247. t[1] = h + v,
  39248. t[5] = 1 - (c + f),
  39249. t[9] = p - g,
  39250. t[2] = u - m,
  39251. t[6] = p + g,
  39252. t[10] = 1 - (c + d),
  39253. t[3] = 0,
  39254. t[7] = 0,
  39255. t[11] = 0,
  39256. t[12] = 0,
  39257. t[13] = 0,
  39258. t[14] = 0,
  39259. t[15] = 1,
  39260. this
  39261. },
  39262. lookAt: function(e, t, i) {
  39263. void 0 === oe && (oe = new Ci.Vector3),
  39264. void 0 === ae && (ae = new Ci.Vector3),
  39265. void 0 === se && (se = new Ci.Vector3);
  39266. var n = this.elements;
  39267. return se.subVectors(e, t).normalize(),
  39268. 0 === se.lengthSq() && (se.z = 1),
  39269. oe.crossVectors(i, se).normalize(),
  39270. 0 === oe.lengthSq() && (se.x += 1e-4,
  39271. oe.crossVectors(i, se).normalize()),
  39272. ae.crossVectors(se, oe),
  39273. n[0] = oe.x,
  39274. n[4] = ae.x,
  39275. n[8] = se.x,
  39276. n[1] = oe.y,
  39277. n[5] = ae.y,
  39278. n[9] = se.y,
  39279. n[2] = oe.z,
  39280. n[6] = ae.z,
  39281. n[10] = se.z,
  39282. this
  39283. },
  39284. multiply: function(e, t) {
  39285. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39286. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39287. },
  39288. multiplyMatrices: function(e, t) {
  39289. var i = e.elements
  39290. , n = t.elements
  39291. , r = this.elements
  39292. , o = i[0]
  39293. , a = i[4]
  39294. , s = i[8]
  39295. , l = i[12]
  39296. , c = i[1]
  39297. , h = i[5]
  39298. , u = i[9]
  39299. , d = i[13]
  39300. , p = i[2]
  39301. , f = i[6]
  39302. , g = i[10]
  39303. , m = i[14]
  39304. , v = i[3]
  39305. , y = i[7]
  39306. , A = i[11]
  39307. , C = i[15]
  39308. , I = n[0]
  39309. , E = n[4]
  39310. , _ = n[8]
  39311. , b = n[12]
  39312. , w = n[1]
  39313. , T = n[5]
  39314. , x = n[9]
  39315. , S = n[13]
  39316. , M = n[2]
  39317. , R = n[6]
  39318. , P = n[10]
  39319. , O = n[14]
  39320. , L = n[3]
  39321. , D = n[7]
  39322. , N = n[11]
  39323. , F = n[15];
  39324. return r[0] = o * I + a * w + s * M + l * L,
  39325. r[4] = o * E + a * T + s * R + l * D,
  39326. r[8] = o * _ + a * x + s * P + l * N,
  39327. r[12] = o * b + a * S + s * O + l * F,
  39328. r[1] = c * I + h * w + u * M + d * L,
  39329. r[5] = c * E + h * T + u * R + d * D,
  39330. r[9] = c * _ + h * x + u * P + d * N,
  39331. r[13] = c * b + h * S + u * O + d * F,
  39332. r[2] = p * I + f * w + g * M + m * L,
  39333. r[6] = p * E + f * T + g * R + m * D,
  39334. r[10] = p * _ + f * x + g * P + m * N,
  39335. r[14] = p * b + f * S + g * O + m * F,
  39336. r[3] = v * I + y * w + A * M + C * L,
  39337. r[7] = v * E + y * T + A * R + C * D,
  39338. r[11] = v * _ + y * x + A * P + C * N,
  39339. r[15] = v * b + y * S + A * O + C * F,
  39340. this
  39341. },
  39342. multiplyToArray: function(e, t, i) {
  39343. var n = this.elements;
  39344. return this.multiplyMatrices(e, t),
  39345. i[0] = n[0],
  39346. i[1] = n[1],
  39347. i[2] = n[2],
  39348. i[3] = n[3],
  39349. i[4] = n[4],
  39350. i[5] = n[5],
  39351. i[6] = n[6],
  39352. i[7] = n[7],
  39353. i[8] = n[8],
  39354. i[9] = n[9],
  39355. i[10] = n[10],
  39356. i[11] = n[11],
  39357. i[12] = n[12],
  39358. i[13] = n[13],
  39359. i[14] = n[14],
  39360. i[15] = n[15],
  39361. this
  39362. },
  39363. multiplyScalar: function(e) {
  39364. var t = this.elements;
  39365. return t[0] *= e,
  39366. t[4] *= e,
  39367. t[8] *= e,
  39368. t[12] *= e,
  39369. t[1] *= e,
  39370. t[5] *= e,
  39371. t[9] *= e,
  39372. t[13] *= e,
  39373. t[2] *= e,
  39374. t[6] *= e,
  39375. t[10] *= e,
  39376. t[14] *= e,
  39377. t[3] *= e,
  39378. t[7] *= e,
  39379. t[11] *= e,
  39380. t[15] *= e,
  39381. this
  39382. },
  39383. applyToVector3Array: function(e, t, i) {
  39384. void 0 === re && (re = new Ci.Vector3),
  39385. void 0 === t && (t = 0),
  39386. void 0 === i && (i = e.length);
  39387. for (var n = 0, r = t; n < i; n += 3,
  39388. r += 3)
  39389. re.fromArray(e, r),
  39390. re.applyMatrix4(this),
  39391. re.toArray(e, r);
  39392. return e
  39393. },
  39394. applyToBuffer: function(e, t, i) {
  39395. void 0 === ne && (ne = new Ci.Vector3),
  39396. void 0 === t && (t = 0),
  39397. void 0 === i && (i = e.length / e.itemSize);
  39398. for (var n = 0, r = t; n < i; n++,
  39399. r++)
  39400. ne.x = e.getX(r),
  39401. ne.y = e.getY(r),
  39402. ne.z = e.getZ(r),
  39403. ne.applyMatrix4(this),
  39404. e.setXYZ(ne.x, ne.y, ne.z);
  39405. return e
  39406. },
  39407. determinant: function() {
  39408. var e = this.elements
  39409. , t = e[0]
  39410. , i = e[4]
  39411. , n = e[8]
  39412. , r = e[12]
  39413. , o = e[1]
  39414. , a = e[5]
  39415. , s = e[9]
  39416. , l = e[13]
  39417. , c = e[2]
  39418. , h = e[6]
  39419. , u = e[10]
  39420. , d = e[14];
  39421. return e[3] * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + e[7] * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + e[11] * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + e[15] * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  39422. },
  39423. transpose: function() {
  39424. var e, t = this.elements;
  39425. return e = t[1],
  39426. t[1] = t[4],
  39427. t[4] = e,
  39428. e = t[2],
  39429. t[2] = t[8],
  39430. t[8] = e,
  39431. e = t[6],
  39432. t[6] = t[9],
  39433. t[9] = e,
  39434. e = t[3],
  39435. t[3] = t[12],
  39436. t[12] = e,
  39437. e = t[7],
  39438. t[7] = t[13],
  39439. t[13] = e,
  39440. e = t[11],
  39441. t[11] = t[14],
  39442. t[14] = e,
  39443. this
  39444. },
  39445. flattenToArrayOffset: function(e, t) {
  39446. var i = this.elements;
  39447. return e[t] = i[0],
  39448. e[t + 1] = i[1],
  39449. e[t + 2] = i[2],
  39450. e[t + 3] = i[3],
  39451. e[t + 4] = i[4],
  39452. e[t + 5] = i[5],
  39453. e[t + 6] = i[6],
  39454. e[t + 7] = i[7],
  39455. e[t + 8] = i[8],
  39456. e[t + 9] = i[9],
  39457. e[t + 10] = i[10],
  39458. e[t + 11] = i[11],
  39459. e[t + 12] = i[12],
  39460. e[t + 13] = i[13],
  39461. e[t + 14] = i[14],
  39462. e[t + 15] = i[15],
  39463. e
  39464. },
  39465. getPosition: function() {
  39466. return void 0 === ie && (ie = new Ci.Vector3),
  39467. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39468. ie.setFromMatrixColumn(this, 3)
  39469. },
  39470. setPosition: function(e) {
  39471. var t = this.elements;
  39472. return t[12] = e.x,
  39473. t[13] = e.y,
  39474. t[14] = e.z,
  39475. this
  39476. },
  39477. getInverse: function(e, t) {
  39478. var i = this.elements
  39479. , n = e.elements
  39480. , r = n[0]
  39481. , o = n[1]
  39482. , a = n[2]
  39483. , s = n[3]
  39484. , l = n[4]
  39485. , c = n[5]
  39486. , h = n[6]
  39487. , u = n[7]
  39488. , d = n[8]
  39489. , p = n[9]
  39490. , f = n[10]
  39491. , g = n[11]
  39492. , m = n[12]
  39493. , v = n[13]
  39494. , y = n[14]
  39495. , A = n[15]
  39496. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39497. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39498. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39499. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39500. , b = r * C + o * I + a * E + s * _;
  39501. if (0 != b)
  39502. return i[0] = C,
  39503. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39504. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39505. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39506. i[4] = I,
  39507. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39508. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39509. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39510. i[8] = E,
  39511. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39512. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39513. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39514. i[12] = _,
  39515. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39516. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39517. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39518. this.multiplyScalar(1 / b);
  39519. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39520. if (t)
  39521. throw new Error(w);
  39522. return console.warn(w),
  39523. this.identity()
  39524. },
  39525. scale: function(e) {
  39526. var t = this.elements
  39527. , i = e.x
  39528. , n = e.y
  39529. , r = e.z;
  39530. return t[0] *= i,
  39531. t[4] *= n,
  39532. t[8] *= r,
  39533. t[1] *= i,
  39534. t[5] *= n,
  39535. t[9] *= r,
  39536. t[2] *= i,
  39537. t[6] *= n,
  39538. t[10] *= r,
  39539. t[3] *= i,
  39540. t[7] *= n,
  39541. t[11] *= r,
  39542. this
  39543. },
  39544. getMaxScaleOnAxis: function() {
  39545. var e = this.elements
  39546. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39547. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39548. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39549. return Math.sqrt(Math.max(t, i, n))
  39550. },
  39551. makeTranslation: function(e, t, i) {
  39552. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39553. this
  39554. },
  39555. makeRotationX: function(e) {
  39556. var t = Math.cos(e)
  39557. , i = Math.sin(e);
  39558. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39559. this
  39560. },
  39561. makeRotationY: function(e) {
  39562. var t = Math.cos(e)
  39563. , i = Math.sin(e);
  39564. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39565. this
  39566. },
  39567. makeRotationZ: function(e) {
  39568. var t = Math.cos(e)
  39569. , i = Math.sin(e);
  39570. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39571. this
  39572. },
  39573. makeRotationAxis: function(e, t) {
  39574. var i = Math.cos(t)
  39575. , n = Math.sin(t)
  39576. , r = 1 - i
  39577. , o = e.x
  39578. , a = e.y
  39579. , s = e.z
  39580. , l = r * o
  39581. , c = r * a;
  39582. 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),
  39583. this
  39584. },
  39585. makeScale: function(e, t, i) {
  39586. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39587. this
  39588. },
  39589. compose: function(e, t, i) {
  39590. return this.makeRotationFromQuaternion(t),
  39591. this.scale(i),
  39592. this.setPosition(e),
  39593. this
  39594. },
  39595. decompose: function(e, t, i) {
  39596. void 0 === ee && (ee = new Ci.Vector3),
  39597. void 0 === te && (te = new Ci.Matrix4);
  39598. var n = this.elements
  39599. , r = ee.set(n[0], n[1], n[2]).length()
  39600. , o = ee.set(n[4], n[5], n[6]).length()
  39601. , a = ee.set(n[8], n[9], n[10]).length();
  39602. this.determinant() < 0 && (r = -r),
  39603. e.x = n[12],
  39604. e.y = n[13],
  39605. e.z = n[14],
  39606. te.elements.set(this.elements);
  39607. var s = 1 / r
  39608. , l = 1 / o
  39609. , c = 1 / a;
  39610. return te.elements[0] *= s,
  39611. te.elements[1] *= s,
  39612. te.elements[2] *= s,
  39613. te.elements[4] *= l,
  39614. te.elements[5] *= l,
  39615. te.elements[6] *= l,
  39616. te.elements[8] *= c,
  39617. te.elements[9] *= c,
  39618. te.elements[10] *= c,
  39619. t.setFromRotationMatrix(te),
  39620. i.x = r,
  39621. i.y = o,
  39622. i.z = a,
  39623. this
  39624. },
  39625. makeFrustum: function(e, t, i, n, r, o) {
  39626. var a = this.elements
  39627. , s = 2 * r / (t - e)
  39628. , l = 2 * r / (n - i)
  39629. , c = (t + e) / (t - e)
  39630. , h = (n + i) / (n - i)
  39631. , u = -(o + r) / (o - r)
  39632. , d = -2 * o * r / (o - r);
  39633. return a[0] = s,
  39634. a[4] = 0,
  39635. a[8] = c,
  39636. a[12] = 0,
  39637. a[1] = 0,
  39638. a[5] = l,
  39639. a[9] = h,
  39640. a[13] = 0,
  39641. a[2] = 0,
  39642. a[6] = 0,
  39643. a[10] = u,
  39644. a[14] = d,
  39645. a[3] = 0,
  39646. a[7] = 0,
  39647. a[11] = -1,
  39648. a[15] = 0,
  39649. this
  39650. },
  39651. makePerspective: function(e, t, i, n) {
  39652. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  39653. , o = -r
  39654. , a = o * t
  39655. , s = r * t;
  39656. return this.makeFrustum(a, s, o, r, i, n)
  39657. },
  39658. makeOrthographic: function(e, t, i, n, r, o) {
  39659. var a = this.elements
  39660. , s = 1 / (t - e)
  39661. , l = 1 / (i - n)
  39662. , c = 1 / (o - r)
  39663. , h = (t + e) * s
  39664. , u = (i + n) * l
  39665. , d = (o + r) * c;
  39666. return a[0] = 2 * s,
  39667. a[4] = 0,
  39668. a[8] = 0,
  39669. a[12] = -h,
  39670. a[1] = 0,
  39671. a[5] = 2 * l,
  39672. a[9] = 0,
  39673. a[13] = -u,
  39674. a[2] = 0,
  39675. a[6] = 0,
  39676. a[10] = -2 * c,
  39677. a[14] = -d,
  39678. a[3] = 0,
  39679. a[7] = 0,
  39680. a[11] = 0,
  39681. a[15] = 1,
  39682. this
  39683. },
  39684. equals: function(e) {
  39685. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  39686. if (t[n] !== i[n])
  39687. return !1;
  39688. return !0
  39689. },
  39690. fromArray: function(e) {
  39691. return this.elements.set(e),
  39692. this
  39693. },
  39694. toArray: function() {
  39695. var e = this.elements;
  39696. 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]]
  39697. }
  39698. },
  39699. Ci.Ray = function(e, t) {
  39700. this.origin = void 0 !== e ? e : new Ci.Vector3,
  39701. this.direction = void 0 !== t ? t : new Ci.Vector3
  39702. }
  39703. ,
  39704. Ci.Ray.prototype = {
  39705. constructor: Ci.Ray,
  39706. set: function(e, t) {
  39707. return this.origin.copy(e),
  39708. this.direction.copy(t),
  39709. this
  39710. },
  39711. clone: function() {
  39712. return (new this.constructor).copy(this)
  39713. },
  39714. copy: function(e) {
  39715. return this.origin.copy(e.origin),
  39716. this.direction.copy(e.direction),
  39717. this
  39718. },
  39719. at: function(e, t) {
  39720. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  39721. },
  39722. lookAt: function(e) {
  39723. this.direction.copy(e).sub(this.origin).normalize()
  39724. },
  39725. recast: ($ = new Ci.Vector3,
  39726. function(e) {
  39727. return this.origin.copy(this.at(e, $)),
  39728. this
  39729. }
  39730. ),
  39731. closestPointToPoint: function(e, t) {
  39732. var i = t || new Ci.Vector3;
  39733. i.subVectors(e, this.origin);
  39734. var n = i.dot(this.direction);
  39735. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  39736. },
  39737. distanceToPoint: function(e) {
  39738. return Math.sqrt(this.distanceSqToPoint(e))
  39739. },
  39740. distanceSqToPoint: (J = new Ci.Vector3,
  39741. function(e) {
  39742. var t = J.subVectors(e, this.origin).dot(this.direction);
  39743. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  39744. J.distanceToSquared(e))
  39745. }
  39746. ),
  39747. distanceSqToSegment: (Z = new Ci.Vector3,
  39748. K = new Ci.Vector3,
  39749. Q = new Ci.Vector3,
  39750. function(e, t, i, n) {
  39751. Z.copy(e).add(t).multiplyScalar(.5),
  39752. K.copy(t).sub(e).normalize(),
  39753. Q.copy(this.origin).sub(Z);
  39754. var r, o, a, s, l = .5 * e.distanceTo(t), c = -this.direction.dot(K), h = Q.dot(this.direction), u = -Q.dot(K), d = Q.lengthSq(), p = Math.abs(1 - c * c);
  39755. if (0 < p)
  39756. if (o = c * h - u,
  39757. s = l * p,
  39758. 0 <= (r = c * u - h))
  39759. if (-s <= o)
  39760. if (o <= s) {
  39761. var f = 1 / p;
  39762. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  39763. } else
  39764. o = l,
  39765. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39766. else
  39767. o = -l,
  39768. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39769. else
  39770. a = o <= -s ? -(r = Math.max(0, -(-c * l + h))) * r + (o = 0 < r ? -l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d : o <= s ? (r = 0,
  39771. (o = Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d) : -(r = Math.max(0, -(c * l + h))) * r + (o = 0 < r ? l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d;
  39772. else
  39773. o = 0 < c ? -l : l,
  39774. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39775. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  39776. n && n.copy(K).multiplyScalar(o).add(Z),
  39777. a
  39778. }
  39779. ),
  39780. intersectSphere: (X = new Ci.Vector3,
  39781. function(e, t) {
  39782. X.subVectors(e.center, this.origin);
  39783. var i = X.dot(this.direction)
  39784. , n = X.dot(X) - i * i
  39785. , r = e.radius * e.radius;
  39786. if (r < n)
  39787. return null;
  39788. var o = Math.sqrt(r - n)
  39789. , a = i - o
  39790. , s = i + o;
  39791. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  39792. }
  39793. ),
  39794. intersectsSphere: function(e) {
  39795. return this.distanceToPoint(e.center) <= e.radius
  39796. },
  39797. distanceToPlane: function(e) {
  39798. var t = e.normal.dot(this.direction);
  39799. if (0 === t)
  39800. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  39801. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  39802. return 0 <= i ? i : null
  39803. },
  39804. intersectPlane: function(e, t) {
  39805. var i = this.distanceToPlane(e);
  39806. return null === i ? null : this.at(i, t)
  39807. },
  39808. intersectsPlane: function(e) {
  39809. var t = e.distanceToPoint(this.origin);
  39810. return 0 === t || e.normal.dot(this.direction) * t < 0
  39811. },
  39812. intersectBox: function(e, t) {
  39813. 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;
  39814. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  39815. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  39816. (e.min.x - u.x) * l),
  39817. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  39818. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  39819. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  39820. (o < n || n != n) && (n = o),
  39821. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  39822. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  39823. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  39824. (s < n || n != n) && (n = s),
  39825. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  39826. },
  39827. intersectsBox: (q = new Ci.Vector3,
  39828. function(e) {
  39829. return null !== this.intersectBox(e, q)
  39830. }
  39831. ),
  39832. intersectTriangle: (G = new Ci.Vector3,
  39833. W = new Ci.Vector3,
  39834. j = new Ci.Vector3,
  39835. Y = new Ci.Vector3,
  39836. function(e, t, i, n, r) {
  39837. W.subVectors(t, e),
  39838. j.subVectors(i, e),
  39839. Y.crossVectors(W, j);
  39840. var o, a = this.direction.dot(Y);
  39841. if (0 < a) {
  39842. if (n)
  39843. return null;
  39844. o = 1
  39845. } else {
  39846. if (!(a < 0))
  39847. return null;
  39848. o = -1,
  39849. a = -a
  39850. }
  39851. G.subVectors(this.origin, e);
  39852. var s = o * this.direction.dot(j.crossVectors(G, j));
  39853. if (s < 0)
  39854. return null;
  39855. var l = o * this.direction.dot(W.cross(G));
  39856. if (l < 0)
  39857. return null;
  39858. if (a < s + l)
  39859. return null;
  39860. var c = -o * G.dot(Y);
  39861. return c < 0 ? null : this.at(c / a, r)
  39862. }
  39863. ),
  39864. applyMatrix4: function(e) {
  39865. return this.direction.add(this.origin).applyMatrix4(e),
  39866. this.origin.applyMatrix4(e),
  39867. this.direction.sub(this.origin),
  39868. this.direction.normalize(),
  39869. this
  39870. },
  39871. equals: function(e) {
  39872. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  39873. }
  39874. },
  39875. Ci.Sphere = function(e, t) {
  39876. this.center = void 0 !== e ? e : new Ci.Vector3,
  39877. this.radius = void 0 !== t ? t : 0
  39878. }
  39879. ,
  39880. Ci.Sphere.prototype = {
  39881. constructor: Ci.Sphere,
  39882. set: function(e, t) {
  39883. return this.center.copy(e),
  39884. this.radius = t,
  39885. this
  39886. },
  39887. setFromPoints: (z = new Ci.Box3,
  39888. function(e, t) {
  39889. var i = this.center;
  39890. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  39891. for (var n = 0, r = 0, o = e.length; r < o; r++)
  39892. n = Math.max(n, i.distanceToSquared(e[r]));
  39893. return this.radius = Math.sqrt(n),
  39894. this
  39895. }
  39896. ),
  39897. clone: function() {
  39898. return (new this.constructor).copy(this)
  39899. },
  39900. copy: function(e) {
  39901. return this.center.copy(e.center),
  39902. this.radius = e.radius,
  39903. this
  39904. },
  39905. empty: function() {
  39906. return this.radius <= 0
  39907. },
  39908. containsPoint: function(e) {
  39909. return e.distanceToSquared(this.center) <= this.radius * this.radius
  39910. },
  39911. distanceToPoint: function(e) {
  39912. return e.distanceTo(this.center) - this.radius
  39913. },
  39914. intersectsSphere: function(e) {
  39915. var t = this.radius + e.radius;
  39916. return e.center.distanceToSquared(this.center) <= t * t
  39917. },
  39918. intersectsBox: function(e) {
  39919. return e.intersectsSphere(this)
  39920. },
  39921. intersectsPlane: function(e) {
  39922. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  39923. },
  39924. clampPoint: function(e, t) {
  39925. var i = this.center.distanceToSquared(e)
  39926. , n = t || new Ci.Vector3;
  39927. return n.copy(e),
  39928. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  39929. n.multiplyScalar(this.radius).add(this.center)),
  39930. n
  39931. },
  39932. getBoundingBox: function(e) {
  39933. var t = e || new Ci.Box3;
  39934. return t.set(this.center, this.center),
  39935. t.expandByScalar(this.radius),
  39936. t
  39937. },
  39938. applyMatrix4: function(e) {
  39939. return this.center.applyMatrix4(e),
  39940. this.radius = this.radius * e.getMaxScaleOnAxis(),
  39941. this
  39942. },
  39943. translate: function(e) {
  39944. return this.center.add(e),
  39945. this
  39946. },
  39947. equals: function(e) {
  39948. return e.center.equals(this.center) && e.radius === this.radius
  39949. }
  39950. },
  39951. Ci.Frustum = function(e, t, i, n, r, o) {
  39952. this.planes = [void 0 !== e ? e : new Ci.Plane, void 0 !== t ? t : new Ci.Plane, void 0 !== i ? i : new Ci.Plane, void 0 !== n ? n : new Ci.Plane, void 0 !== r ? r : new Ci.Plane, void 0 !== o ? o : new Ci.Plane]
  39953. }
  39954. ,
  39955. Ci.Frustum.prototype = {
  39956. constructor: Ci.Frustum,
  39957. set: function(e, t, i, n, r, o) {
  39958. var a = this.planes;
  39959. return a[0].copy(e),
  39960. a[1].copy(t),
  39961. a[2].copy(i),
  39962. a[3].copy(n),
  39963. a[4].copy(r),
  39964. a[5].copy(o),
  39965. this
  39966. },
  39967. clone: function() {
  39968. return (new this.constructor).copy(this)
  39969. },
  39970. copy: function(e) {
  39971. for (var t = this.planes, i = 0; i < 6; i++)
  39972. t[i].copy(e.planes[i]);
  39973. return this
  39974. },
  39975. setFromMatrix: function(e) {
  39976. var t = this.planes
  39977. , i = e.elements
  39978. , n = i[0]
  39979. , r = i[1]
  39980. , o = i[2]
  39981. , a = i[3]
  39982. , s = i[4]
  39983. , l = i[5]
  39984. , c = i[6]
  39985. , h = i[7]
  39986. , u = i[8]
  39987. , d = i[9]
  39988. , p = i[10]
  39989. , f = i[11]
  39990. , g = i[12]
  39991. , m = i[13]
  39992. , v = i[14]
  39993. , y = i[15];
  39994. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  39995. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  39996. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  39997. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  39998. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  39999. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40000. this
  40001. },
  40002. intersectsObject: (H = new Ci.Sphere,
  40003. function(e) {
  40004. var t = e.geometry;
  40005. return null === t.boundingSphere && t.computeBoundingSphere(),
  40006. H.copy(t.boundingSphere),
  40007. H.applyMatrix4(e.matrixWorld),
  40008. this.intersectsSphere(H)
  40009. }
  40010. ),
  40011. intersectsSphere: function(e) {
  40012. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40013. if (t[r].distanceToPoint(i) < n)
  40014. return !1
  40015. }
  40016. return !0
  40017. },
  40018. intersectsBox: (k = new Ci.Vector3,
  40019. U = new Ci.Vector3,
  40020. function(e) {
  40021. for (var t = this.planes, i = 0; i < 6; i++) {
  40022. var n = t[i];
  40023. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40024. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40025. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40026. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40027. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40028. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40029. var r = n.distanceToPoint(k)
  40030. , o = n.distanceToPoint(U);
  40031. if (r < 0 && o < 0)
  40032. return !1
  40033. }
  40034. return !0
  40035. }
  40036. ),
  40037. containsPoint: function(e) {
  40038. for (var t = this.planes, i = 0; i < 6; i++)
  40039. if (t[i].distanceToPoint(e) < 0)
  40040. return !1;
  40041. return !0
  40042. }
  40043. },
  40044. Ci.Plane = function(e, t) {
  40045. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40046. this.constant = void 0 !== t ? t : 0
  40047. }
  40048. ,
  40049. Ci.Plane.prototype = {
  40050. constructor: Ci.Plane,
  40051. set: function(e, t) {
  40052. return this.normal.copy(e),
  40053. this.constant = t,
  40054. this
  40055. },
  40056. setComponents: function(e, t, i, n) {
  40057. return this.normal.set(e, t, i),
  40058. this.constant = n,
  40059. this
  40060. },
  40061. setFromNormalAndCoplanarPoint: function(e, t) {
  40062. return this.normal.copy(e),
  40063. this.constant = -t.dot(this.normal),
  40064. this
  40065. },
  40066. setFromCoplanarPoints: (B = new Ci.Vector3,
  40067. V = new Ci.Vector3,
  40068. function(e, t, i) {
  40069. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40070. return this.setFromNormalAndCoplanarPoint(n, e),
  40071. this
  40072. }
  40073. ),
  40074. clone: function() {
  40075. return (new this.constructor).copy(this)
  40076. },
  40077. copy: function(e) {
  40078. return this.normal.copy(e.normal),
  40079. this.constant = e.constant,
  40080. this
  40081. },
  40082. normalize: function() {
  40083. var e = 1 / this.normal.length();
  40084. return this.normal.multiplyScalar(e),
  40085. this.constant *= e,
  40086. this
  40087. },
  40088. negate: function() {
  40089. return this.constant *= -1,
  40090. this.normal.negate(),
  40091. this
  40092. },
  40093. distanceToPoint: function(e) {
  40094. return this.normal.dot(e) + this.constant
  40095. },
  40096. distanceToSphere: function(e) {
  40097. return this.distanceToPoint(e.center) - e.radius
  40098. },
  40099. projectPoint: function(e, t) {
  40100. return this.orthoPoint(e, t).sub(e).negate()
  40101. },
  40102. orthoPoint: function(e, t) {
  40103. var i = this.distanceToPoint(e);
  40104. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40105. },
  40106. intersectLine: (F = new Ci.Vector3,
  40107. function(e, t) {
  40108. var i = t || new Ci.Vector3
  40109. , n = e.delta(F)
  40110. , r = this.normal.dot(n);
  40111. if (0 !== r) {
  40112. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40113. if (!(o < 0 || 1 < o))
  40114. return i.copy(n).multiplyScalar(o).add(e.start)
  40115. } else if (0 === this.distanceToPoint(e.start))
  40116. return i.copy(e.start)
  40117. }
  40118. ),
  40119. intersectsLine: function(e) {
  40120. var t = this.distanceToPoint(e.start)
  40121. , i = this.distanceToPoint(e.end);
  40122. return t < 0 && 0 < i || i < 0 && 0 < t
  40123. },
  40124. intersectsBox: function(e) {
  40125. return e.intersectsPlane(this)
  40126. },
  40127. intersectsSphere: function(e) {
  40128. return e.intersectsPlane(this)
  40129. },
  40130. coplanarPoint: function(e) {
  40131. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40132. },
  40133. applyMatrix4: (L = new Ci.Vector3,
  40134. D = new Ci.Vector3,
  40135. N = new Ci.Matrix3,
  40136. function(e, t) {
  40137. var i = t || N.getNormalMatrix(e)
  40138. , n = L.copy(this.normal).applyMatrix3(i)
  40139. , r = this.coplanarPoint(D);
  40140. return r.applyMatrix4(e),
  40141. this.setFromNormalAndCoplanarPoint(n, r),
  40142. this
  40143. }
  40144. ),
  40145. translate: function(e) {
  40146. return this.constant = this.constant - e.dot(this.normal),
  40147. this
  40148. },
  40149. equals: function(e) {
  40150. return e.normal.equals(this.normal) && e.constant === this.constant
  40151. }
  40152. },
  40153. Ci.Spherical = function(e, t, i) {
  40154. return this.radius = void 0 !== e ? e : 1,
  40155. this.phi = void 0 !== t ? t : 0,
  40156. this.theta = void 0 !== i ? i : 0,
  40157. this
  40158. }
  40159. ,
  40160. Ci.Spherical.prototype = {
  40161. constructor: Ci.Spherical,
  40162. set: function(e, t, i) {
  40163. this.radius = e,
  40164. this.phi = t,
  40165. this.theta = i
  40166. },
  40167. clone: function() {
  40168. return (new this.constructor).copy(this)
  40169. },
  40170. copy: function(e) {
  40171. return this.radius.copy(e.radius),
  40172. this.phi.copy(e.phi),
  40173. this.theta.copy(e.theta),
  40174. this
  40175. },
  40176. makeSafe: function() {
  40177. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40178. },
  40179. setFromVector3: function(e) {
  40180. return this.radius = e.length(),
  40181. 0 === this.radius ? (this.theta = 0,
  40182. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40183. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40184. this
  40185. }
  40186. },
  40187. Ci.Math = {
  40188. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40189. P = new Array(36),
  40190. O = 0,
  40191. function() {
  40192. for (var e = 0; e < 36; e++)
  40193. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40194. M = 15 & O,
  40195. O >>= 4,
  40196. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40197. return P.join("")
  40198. }
  40199. ),
  40200. clamp: function(e, t, i) {
  40201. return Math.max(t, Math.min(i, e))
  40202. },
  40203. euclideanModulo: function(e, t) {
  40204. return (e % t + t) % t
  40205. },
  40206. mapLinear: function(e, t, i, n, r) {
  40207. return n + (e - t) * (r - n) / (i - t)
  40208. },
  40209. smoothstep: function(e, t, i) {
  40210. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40211. },
  40212. smootherstep: function(e, t, i) {
  40213. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40214. },
  40215. random16: function() {
  40216. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40217. Math.random()
  40218. },
  40219. randInt: function(e, t) {
  40220. return e + Math.floor(Math.random() * (t - e + 1))
  40221. },
  40222. randFloat: function(e, t) {
  40223. return e + Math.random() * (t - e)
  40224. },
  40225. randFloatSpread: function(e) {
  40226. return e * (.5 - Math.random())
  40227. },
  40228. degToRad: (S = Math.PI / 180,
  40229. function(e) {
  40230. return e * S
  40231. }
  40232. ),
  40233. radToDeg: (x = 180 / Math.PI,
  40234. function(e) {
  40235. return e * x
  40236. }
  40237. ),
  40238. isPowerOfTwo: function(e) {
  40239. return 0 == (e & e - 1) && 0 !== e
  40240. },
  40241. nearestPowerOfTwo: function(e) {
  40242. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40243. },
  40244. nextPowerOfTwo: function(e) {
  40245. return e--,
  40246. e |= e >> 1,
  40247. e |= e >> 2,
  40248. e |= e >> 4,
  40249. e |= e >> 8,
  40250. e |= e >> 16,
  40251. ++e
  40252. }
  40253. },
  40254. Ci.Spline = function(e) {
  40255. function t(e, t, i, n, r, o, a) {
  40256. var s = .5 * (i - e)
  40257. , l = .5 * (n - t);
  40258. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40259. }
  40260. this.points = e;
  40261. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40262. x: 0,
  40263. y: 0,
  40264. z: 0
  40265. };
  40266. this.initFromArray = function(e) {
  40267. this.points = [];
  40268. for (var t = 0; t < e.length; t++)
  40269. this.points[t] = {
  40270. x: e[t][0],
  40271. y: e[t][1],
  40272. z: e[t][2]
  40273. }
  40274. }
  40275. ,
  40276. this.getPoint = function(e) {
  40277. return i = (this.points.length - 1) * e,
  40278. n = Math.floor(i),
  40279. r = i - n,
  40280. u[0] = 0 === n ? n : n - 1,
  40281. u[1] = n,
  40282. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40283. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40284. s = this.points[u[0]],
  40285. l = this.points[u[1]],
  40286. c = this.points[u[2]],
  40287. h = this.points[u[3]],
  40288. a = r * (o = r * r),
  40289. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40290. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40291. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40292. d
  40293. }
  40294. ,
  40295. this.getControlPointsArray = function() {
  40296. var e, t, i = this.points.length, n = [];
  40297. for (e = 0; e < i; e++)
  40298. t = this.points[e],
  40299. n[e] = [t.x, t.y, t.z];
  40300. return n
  40301. }
  40302. ,
  40303. this.getLength = function(e) {
  40304. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40305. for (h[0] = 0,
  40306. e = e || 100,
  40307. n = this.points.length * e,
  40308. l.copy(this.points[0]),
  40309. t = 1; t < n; t++)
  40310. i = t / n,
  40311. r = this.getPoint(i),
  40312. c.copy(r),
  40313. u += c.distanceTo(l),
  40314. l.copy(r),
  40315. o = (this.points.length - 1) * i,
  40316. (a = Math.floor(o)) !== s && (h[a] = u,
  40317. s = a);
  40318. return h[h.length] = u,
  40319. {
  40320. chunks: h,
  40321. total: u
  40322. }
  40323. }
  40324. ,
  40325. this.reparametrizeByArcLength = function(e) {
  40326. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40327. for (c.push(h.copy(this.points[0]).clone()),
  40328. t = 1; t < this.points.length; t++) {
  40329. for (a = u.chunks[t] - u.chunks[t - 1],
  40330. s = Math.ceil(e * a / u.total),
  40331. r = (t - 1) / (this.points.length - 1),
  40332. o = t / (this.points.length - 1),
  40333. i = 1; i < s - 1; i++)
  40334. n = r + i * (1 / s) * (o - r),
  40335. l = this.getPoint(n),
  40336. c.push(h.copy(l).clone());
  40337. c.push(h.copy(this.points[t]).clone())
  40338. }
  40339. this.points = c
  40340. }
  40341. }
  40342. ,
  40343. Ci.Triangle = function(e, t, i) {
  40344. this.a = void 0 !== e ? e : new Ci.Vector3,
  40345. this.b = void 0 !== t ? t : new Ci.Vector3,
  40346. this.c = void 0 !== i ? i : new Ci.Vector3
  40347. }
  40348. ,
  40349. Ci.Triangle.normal = (T = new Ci.Vector3,
  40350. function(e, t, i, n) {
  40351. var r = n || new Ci.Vector3;
  40352. r.subVectors(i, t),
  40353. T.subVectors(e, t),
  40354. r.cross(T);
  40355. var o = r.lengthSq();
  40356. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40357. }
  40358. ),
  40359. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40360. b = new Ci.Vector3,
  40361. w = new Ci.Vector3,
  40362. function(e, t, i, n, r) {
  40363. _.subVectors(n, t),
  40364. b.subVectors(i, t),
  40365. w.subVectors(e, t);
  40366. var o = _.dot(_)
  40367. , a = _.dot(b)
  40368. , s = _.dot(w)
  40369. , l = b.dot(b)
  40370. , c = b.dot(w)
  40371. , h = o * l - a * a
  40372. , u = r || new Ci.Vector3;
  40373. if (0 == h)
  40374. return u.set(-2, -1, -1);
  40375. var d = 1 / h
  40376. , p = (l * s - a * c) * d
  40377. , f = (o * c - a * s) * d;
  40378. return u.set(1 - p - f, f, p)
  40379. }
  40380. ),
  40381. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40382. function(e, t, i, n) {
  40383. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40384. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40385. }
  40386. ),
  40387. Ci.Triangle.prototype = {
  40388. constructor: Ci.Triangle,
  40389. set: function(e, t, i) {
  40390. return this.a.copy(e),
  40391. this.b.copy(t),
  40392. this.c.copy(i),
  40393. this
  40394. },
  40395. setFromPointsAndIndices: function(e, t, i, n) {
  40396. return this.a.copy(e[t]),
  40397. this.b.copy(e[i]),
  40398. this.c.copy(e[n]),
  40399. this
  40400. },
  40401. clone: function() {
  40402. return (new this.constructor).copy(this)
  40403. },
  40404. copy: function(e) {
  40405. return this.a.copy(e.a),
  40406. this.b.copy(e.b),
  40407. this.c.copy(e.c),
  40408. this
  40409. },
  40410. area: (C = new Ci.Vector3,
  40411. I = new Ci.Vector3,
  40412. function() {
  40413. return C.subVectors(this.c, this.b),
  40414. I.subVectors(this.a, this.b),
  40415. .5 * C.cross(I).length()
  40416. }
  40417. ),
  40418. midpoint: function(e) {
  40419. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40420. },
  40421. normal: function(e) {
  40422. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40423. },
  40424. plane: function(e) {
  40425. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40426. },
  40427. barycoordFromPoint: function(e, t) {
  40428. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40429. },
  40430. containsPoint: function(e) {
  40431. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40432. },
  40433. equals: function(e) {
  40434. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40435. }
  40436. },
  40437. Ci.Interpolant = function(e, t, i, n) {
  40438. this.parameterPositions = e,
  40439. this._cachedIndex = 0,
  40440. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40441. this.sampleValues = t,
  40442. this.valueSize = i
  40443. }
  40444. ,
  40445. Ci.Interpolant.prototype = {
  40446. constructor: Ci.Interpolant,
  40447. evaluate: function(e) {
  40448. var t = this.parameterPositions
  40449. , i = this._cachedIndex
  40450. , n = t[i]
  40451. , r = t[i - 1];
  40452. e: {
  40453. t: {
  40454. var o;
  40455. i: {
  40456. n: if (!(e < n)) {
  40457. for (var a = i + 2; ; ) {
  40458. if (void 0 === n) {
  40459. if (e < r)
  40460. break n;
  40461. return i = t.length,
  40462. this._cachedIndex = i,
  40463. this.afterEnd_(i - 1, e, r)
  40464. }
  40465. if (i === a)
  40466. break;
  40467. if (r = n,
  40468. e < (n = t[++i]))
  40469. break t
  40470. }
  40471. o = t.length;
  40472. break i
  40473. }
  40474. if (r <= e)
  40475. break e;
  40476. var s = t[1];
  40477. e < s && (i = 2,
  40478. r = s);
  40479. for (a = i - 2; ; ) {
  40480. if (void 0 === r)
  40481. return this._cachedIndex = 0,
  40482. this.beforeStart_(0, e, n);
  40483. if (i === a)
  40484. break;
  40485. if (n = r,
  40486. (r = t[--i - 1]) <= e)
  40487. break t
  40488. }
  40489. o = i,
  40490. i = 0
  40491. }
  40492. for (; i < o; ) {
  40493. var l = i + o >>> 1;
  40494. e < t[l] ? o = l : i = 1 + l
  40495. }
  40496. if (n = t[i],
  40497. void 0 === (r = t[i - 1]))
  40498. return this._cachedIndex = 0,
  40499. this.beforeStart_(0, e, n);
  40500. if (void 0 === n)
  40501. return i = t.length,
  40502. this._cachedIndex = i,
  40503. this.afterEnd_(i - 1, r, e)
  40504. }
  40505. this._cachedIndex = i,
  40506. this.intervalChanged_(i, r, n)
  40507. }
  40508. return this.interpolate_(i, r, e, n)
  40509. },
  40510. settings: null,
  40511. DefaultSettings_: {},
  40512. getSettings_: function() {
  40513. return this.settings || this.DefaultSettings_
  40514. },
  40515. copySampleValue_: function(e) {
  40516. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40517. t[o] = i[r + o];
  40518. return t
  40519. },
  40520. interpolate_: function(e, t, i, n) {
  40521. throw new Error("call to abstract method")
  40522. },
  40523. intervalChanged_: function(e, t, i) {}
  40524. },
  40525. Object.assign(Ci.Interpolant.prototype, {
  40526. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40527. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40528. }),
  40529. Ci.CubicInterpolant = function(e, t, i, n) {
  40530. Ci.Interpolant.call(this, e, t, i, n),
  40531. this._weightPrev = -0,
  40532. this._offsetPrev = -0,
  40533. this._weightNext = -0,
  40534. this._offsetNext = -0
  40535. }
  40536. ,
  40537. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40538. constructor: Ci.CubicInterpolant,
  40539. DefaultSettings_: {
  40540. endingStart: Ci.ZeroCurvatureEnding,
  40541. endingEnd: Ci.ZeroCurvatureEnding
  40542. },
  40543. intervalChanged_: function(e, t, i) {
  40544. var n = this.parameterPositions
  40545. , r = e - 2
  40546. , o = e + 1
  40547. , a = n[r]
  40548. , s = n[o];
  40549. if (void 0 === a)
  40550. switch (this.getSettings_().endingStart) {
  40551. case Ci.ZeroSlopeEnding:
  40552. r = e,
  40553. a = 2 * t - i;
  40554. break;
  40555. case Ci.WrapAroundEnding:
  40556. a = t + n[r = n.length - 2] - n[r + 1];
  40557. break;
  40558. default:
  40559. r = e,
  40560. a = i
  40561. }
  40562. if (void 0 === s)
  40563. switch (this.getSettings_().endingEnd) {
  40564. case Ci.ZeroSlopeEnding:
  40565. o = e,
  40566. s = 2 * i - t;
  40567. break;
  40568. case Ci.WrapAroundEnding:
  40569. s = i + n[o = 1] - n[0];
  40570. break;
  40571. default:
  40572. o = e - 1,
  40573. s = t
  40574. }
  40575. var l = .5 * (i - t)
  40576. , c = this.valueSize;
  40577. this._weightPrev = l / (t - a),
  40578. this._weightNext = l / (s - i),
  40579. this._offsetPrev = r * c,
  40580. this._offsetNext = o * c
  40581. },
  40582. interpolate_: function(e, t, i, n) {
  40583. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, y = (-1 - d) * g + (1.5 + d) * f + .5 * p, A = d * g - d * f, C = 0; C !== a; ++C)
  40584. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  40585. return r
  40586. }
  40587. }),
  40588. Ci.DiscreteInterpolant = function(e, t, i, n) {
  40589. Ci.Interpolant.call(this, e, t, i, n)
  40590. }
  40591. ,
  40592. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40593. constructor: Ci.DiscreteInterpolant,
  40594. interpolate_: function(e, t, i, n) {
  40595. return this.copySampleValue_(e - 1)
  40596. }
  40597. }),
  40598. Ci.LinearInterpolant = function(e, t, i, n) {
  40599. Ci.Interpolant.call(this, e, t, i, n)
  40600. }
  40601. ,
  40602. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40603. constructor: Ci.LinearInterpolant,
  40604. interpolate_: function(e, t, i, n) {
  40605. 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)
  40606. r[u] = o[l + u] * h + o[s + u] * c;
  40607. return r
  40608. }
  40609. }),
  40610. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  40611. Ci.Interpolant.call(this, e, t, i, n)
  40612. }
  40613. ,
  40614. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40615. constructor: Ci.QuaternionLinearInterpolant,
  40616. interpolate_: function(e, t, i, n) {
  40617. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = (i - t) / (n - t), c = s + a; s !== c; s += 4)
  40618. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  40619. return r
  40620. }
  40621. }),
  40622. Ci.Clock = function(e) {
  40623. this.autoStart = void 0 === e || e,
  40624. this.startTime = 0,
  40625. this.oldTime = 0,
  40626. this.elapsedTime = 0,
  40627. this.running = !1
  40628. }
  40629. ,
  40630. Ci.Clock.prototype = {
  40631. constructor: Ci.Clock,
  40632. start: function() {
  40633. this.startTime = performance.now(),
  40634. this.oldTime = this.startTime,
  40635. this.running = !0
  40636. },
  40637. stop: function() {
  40638. this.getElapsedTime(),
  40639. this.running = !1
  40640. },
  40641. getElapsedTime: function() {
  40642. return this.getDelta(),
  40643. this.elapsedTime
  40644. },
  40645. getDelta: function() {
  40646. var e = 0;
  40647. if (this.autoStart && !this.running && this.start(),
  40648. this.running) {
  40649. var t = performance.now();
  40650. e = .001 * (t - this.oldTime),
  40651. this.oldTime = t,
  40652. this.elapsedTime += e
  40653. }
  40654. return e
  40655. }
  40656. },
  40657. Ci.EventDispatcher = function() {}
  40658. ,
  40659. Ci.EventDispatcher.prototype = {
  40660. constructor: Ci.EventDispatcher,
  40661. apply: function(e) {
  40662. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  40663. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  40664. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  40665. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  40666. },
  40667. addEventListener: function(e, t) {
  40668. void 0 === this._listeners && (this._listeners = {});
  40669. var i = this._listeners;
  40670. void 0 === i[e] && (i[e] = []),
  40671. -1 === i[e].indexOf(t) && i[e].push(t)
  40672. },
  40673. hasEventListener: function(e, t) {
  40674. if (void 0 === this._listeners)
  40675. return !1;
  40676. var i = this._listeners;
  40677. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  40678. },
  40679. removeEventListener: function(e, t) {
  40680. if (void 0 !== this._listeners) {
  40681. var i = this._listeners[e];
  40682. if (void 0 !== i) {
  40683. var n = i.indexOf(t);
  40684. -1 !== n && i.splice(n, 1)
  40685. }
  40686. }
  40687. },
  40688. dispatchEvent: function(e) {
  40689. if (void 0 !== this._listeners) {
  40690. var t = this._listeners[e.type];
  40691. if (void 0 !== t) {
  40692. e.target = this;
  40693. for (var i = [], n = t.length, r = 0; r < n; r++)
  40694. i[r] = t[r];
  40695. for (r = 0; r < n; r++)
  40696. i[r].call(this, e)
  40697. }
  40698. }
  40699. }
  40700. },
  40701. Ci.Layers = function() {
  40702. this.mask = 1
  40703. }
  40704. ,
  40705. Ci.Layers.prototype = {
  40706. constructor: Ci.Layers,
  40707. set: function(e) {
  40708. this.mask = 1 << e
  40709. },
  40710. enable: function(e) {
  40711. this.mask |= 1 << e
  40712. },
  40713. toggle: function(e) {
  40714. this.mask ^= 1 << e
  40715. },
  40716. disable: function(e) {
  40717. this.mask &= ~(1 << e)
  40718. },
  40719. test: function(e) {
  40720. return 0 != (this.mask & e.mask)
  40721. }
  40722. },
  40723. (A = Ci).Raycaster = function(e, t, i, n) {
  40724. this.ray = new A.Ray(e,t),
  40725. this.near = i || 0,
  40726. this.far = n || 1 / 0,
  40727. this.params = {
  40728. Mesh: {},
  40729. Line: {},
  40730. LOD: {},
  40731. Points: {
  40732. threshold: 1
  40733. },
  40734. Sprite: {}
  40735. },
  40736. Object.defineProperties(this.params, {
  40737. PointCloud: {
  40738. get: function() {
  40739. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  40740. this.Points
  40741. }
  40742. }
  40743. })
  40744. }
  40745. ,
  40746. A.Raycaster.prototype = {
  40747. constructor: A.Raycaster,
  40748. linePrecision: 1,
  40749. set: function(e, t) {
  40750. this.ray.set(e, t)
  40751. },
  40752. setFromCamera: function(e, t) {
  40753. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  40754. this.ray.direction.set(e.x, e.y, .5).unproject(t).sub(this.ray.origin).normalize()) : t instanceof A.OrthographicCamera ? (this.ray.origin.set(e.x, e.y, -1).unproject(t),
  40755. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  40756. },
  40757. intersectObject: function(e, t) {
  40758. var i = [];
  40759. return Ei(e, this, i, t),
  40760. i.sort(Ii),
  40761. i
  40762. },
  40763. intersectObjects: function(e, t) {
  40764. var i = [];
  40765. if (!1 === Array.isArray(e))
  40766. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  40767. i;
  40768. for (var n = 0, r = e.length; n < r; n++)
  40769. Ei(e[n], this, i, t);
  40770. return i.sort(Ii),
  40771. i
  40772. }
  40773. },
  40774. Ci.Object3D = function() {
  40775. Object.defineProperty(this, "id", {
  40776. value: Ci.Object3DIdCount++
  40777. }),
  40778. this.uuid = Ci.Math.generateUUID(),
  40779. this.name = "",
  40780. this.type = "Object3D",
  40781. this.parent = null,
  40782. this.children = [],
  40783. this.up = Ci.Object3D.DefaultUp.clone();
  40784. var e = new Ci.Vector3
  40785. , t = new Ci.Euler
  40786. , i = new Ci.Quaternion
  40787. , n = new Ci.Vector3(1,1,1);
  40788. t.onChange(function() {
  40789. i.setFromEuler(t, !1)
  40790. }),
  40791. i.onChange(function() {
  40792. t.setFromQuaternion(i, void 0, !1)
  40793. }),
  40794. Object.defineProperties(this, {
  40795. position: {
  40796. enumerable: !0,
  40797. value: e
  40798. },
  40799. rotation: {
  40800. enumerable: !0,
  40801. value: t
  40802. },
  40803. quaternion: {
  40804. enumerable: !0,
  40805. value: i
  40806. },
  40807. scale: {
  40808. enumerable: !0,
  40809. value: n
  40810. },
  40811. modelViewMatrix: {
  40812. value: new Ci.Matrix4
  40813. },
  40814. normalMatrix: {
  40815. value: new Ci.Matrix3
  40816. }
  40817. }),
  40818. this.rotationAutoUpdate = !0,
  40819. this.matrix = new Ci.Matrix4,
  40820. this.matrixWorld = new Ci.Matrix4,
  40821. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  40822. this.matrixWorldNeedsUpdate = !1,
  40823. this.layers = new Ci.Layers,
  40824. this.visible = !0,
  40825. this.castShadow = !1,
  40826. this.receiveShadow = !1,
  40827. this.frustumCulled = !0,
  40828. this.renderOrder = 0,
  40829. this.userData = {}
  40830. }
  40831. ,
  40832. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  40833. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  40834. Ci.Object3D.prototype = {
  40835. constructor: Ci.Object3D,
  40836. applyMatrix: function(e) {
  40837. this.matrix.multiplyMatrices(e, this.matrix),
  40838. this.matrix.decompose(this.position, this.quaternion, this.scale)
  40839. },
  40840. setRotationFromAxisAngle: function(e, t) {
  40841. this.quaternion.setFromAxisAngle(e, t)
  40842. },
  40843. setRotationFromEuler: function(e) {
  40844. this.quaternion.setFromEuler(e, !0)
  40845. },
  40846. setRotationFromMatrix: function(e) {
  40847. this.quaternion.setFromRotationMatrix(e)
  40848. },
  40849. setRotationFromQuaternion: function(e) {
  40850. this.quaternion.copy(e)
  40851. },
  40852. rotateOnAxis: (y = new Ci.Quaternion,
  40853. function(e, t) {
  40854. return y.setFromAxisAngle(e, t),
  40855. this.quaternion.multiply(y),
  40856. this
  40857. }
  40858. ),
  40859. rotateX: (v = new Ci.Vector3(1,0,0),
  40860. function(e) {
  40861. return this.rotateOnAxis(v, e)
  40862. }
  40863. ),
  40864. rotateY: (m = new Ci.Vector3(0,1,0),
  40865. function(e) {
  40866. return this.rotateOnAxis(m, e)
  40867. }
  40868. ),
  40869. rotateZ: (g = new Ci.Vector3(0,0,1),
  40870. function(e) {
  40871. return this.rotateOnAxis(g, e)
  40872. }
  40873. ),
  40874. translateOnAxis: (f = new Ci.Vector3,
  40875. function(e, t) {
  40876. return f.copy(e).applyQuaternion(this.quaternion),
  40877. this.position.add(f.multiplyScalar(t)),
  40878. this
  40879. }
  40880. ),
  40881. translateX: (p = new Ci.Vector3(1,0,0),
  40882. function(e) {
  40883. return this.translateOnAxis(p, e)
  40884. }
  40885. ),
  40886. translateY: (d = new Ci.Vector3(0,1,0),
  40887. function(e) {
  40888. return this.translateOnAxis(d, e)
  40889. }
  40890. ),
  40891. translateZ: (u = new Ci.Vector3(0,0,1),
  40892. function(e) {
  40893. return this.translateOnAxis(u, e)
  40894. }
  40895. ),
  40896. localToWorld: function(e) {
  40897. return e.applyMatrix4(this.matrixWorld)
  40898. },
  40899. worldToLocal: (h = new Ci.Matrix4,
  40900. function(e) {
  40901. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  40902. }
  40903. ),
  40904. lookAt: (c = new Ci.Matrix4,
  40905. function(e) {
  40906. c.lookAt(e, this.position, this.up),
  40907. this.quaternion.setFromRotationMatrix(c)
  40908. }
  40909. ),
  40910. add: function(e) {
  40911. if (1 < arguments.length) {
  40912. for (var t = 0; t < arguments.length; t++)
  40913. this.add(arguments[t]);
  40914. return this
  40915. }
  40916. return e === this ? console.error("THREE.Object3D.add: object can't be added as a child of itself.", e) : e instanceof Ci.Object3D ? (null !== e.parent && e.parent.remove(e),
  40917. e.parent = this,
  40918. e.dispatchEvent({
  40919. type: "added"
  40920. }),
  40921. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  40922. this
  40923. },
  40924. remove: function(e) {
  40925. if (1 < arguments.length)
  40926. for (var t = 0; t < arguments.length; t++)
  40927. this.remove(arguments[t]);
  40928. var i = this.children.indexOf(e);
  40929. -1 !== i && (e.parent = null,
  40930. e.dispatchEvent({
  40931. type: "removed"
  40932. }),
  40933. this.children.splice(i, 1))
  40934. },
  40935. getObjectById: function(e) {
  40936. return this.getObjectByProperty("id", e)
  40937. },
  40938. getObjectByName: function(e) {
  40939. return this.getObjectByProperty("name", e)
  40940. },
  40941. getObjectByProperty: function(e, t) {
  40942. if (this[e] === t)
  40943. return this;
  40944. for (var i = 0, n = this.children.length; i < n; i++) {
  40945. var r = this.children[i].getObjectByProperty(e, t);
  40946. if (void 0 !== r)
  40947. return r
  40948. }
  40949. },
  40950. getWorldPosition: function(e) {
  40951. var t = e || new Ci.Vector3;
  40952. return this.updateMatrixWorld(!0),
  40953. t.setFromMatrixPosition(this.matrixWorld)
  40954. },
  40955. getWorldQuaternion: (s = new Ci.Vector3,
  40956. l = new Ci.Vector3,
  40957. function(e) {
  40958. var t = e || new Ci.Quaternion;
  40959. return this.updateMatrixWorld(!0),
  40960. this.matrixWorld.decompose(s, t, l),
  40961. t
  40962. }
  40963. ),
  40964. getWorldRotation: (a = new Ci.Quaternion,
  40965. function(e) {
  40966. var t = e || new Ci.Euler;
  40967. return this.getWorldQuaternion(a),
  40968. t.setFromQuaternion(a, this.rotation.order, !1)
  40969. }
  40970. ),
  40971. getWorldScale: (r = new Ci.Vector3,
  40972. o = new Ci.Quaternion,
  40973. function(e) {
  40974. var t = e || new Ci.Vector3;
  40975. return this.updateMatrixWorld(!0),
  40976. this.matrixWorld.decompose(r, o, t),
  40977. t
  40978. }
  40979. ),
  40980. getWorldDirection: (n = new Ci.Quaternion,
  40981. function(e) {
  40982. var t = e || new Ci.Vector3;
  40983. return this.getWorldQuaternion(n),
  40984. t.set(0, 0, 1).applyQuaternion(n)
  40985. }
  40986. ),
  40987. raycast: function() {},
  40988. traverse: function(e) {
  40989. e(this);
  40990. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  40991. t[i].traverse(e)
  40992. },
  40993. traverseVisible: function(e) {
  40994. if (!1 !== this.visible) {
  40995. e(this);
  40996. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  40997. t[i].traverseVisible(e)
  40998. }
  40999. },
  41000. traverseAncestors: function(e) {
  41001. var t = this.parent;
  41002. null !== t && (e(t),
  41003. t.traverseAncestors(e))
  41004. },
  41005. updateMatrix: function() {
  41006. this.matrix.compose(this.position, this.quaternion, this.scale),
  41007. this.matrixWorldNeedsUpdate = !0
  41008. },
  41009. updateMatrixWorld: function(e) {
  41010. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41011. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41012. e = !(this.matrixWorldNeedsUpdate = !1));
  41013. for (var t = 0, i = this.children.length; t < i; t++)
  41014. this.children[t].updateMatrixWorld(e)
  41015. },
  41016. toJSON: function(e) {
  41017. function t(e) {
  41018. var t = [];
  41019. for (var i in e) {
  41020. var n = e[i];
  41021. delete n.metadata,
  41022. t.push(n)
  41023. }
  41024. return t
  41025. }
  41026. var i = void 0 === e
  41027. , n = {};
  41028. i && (e = {
  41029. geometries: {},
  41030. materials: {},
  41031. textures: {},
  41032. images: {}
  41033. },
  41034. n.metadata = {
  41035. version: 4.4,
  41036. type: "Object",
  41037. generator: "Object3D.toJSON"
  41038. });
  41039. var r = {};
  41040. if (r.uuid = this.uuid,
  41041. r.type = this.type,
  41042. "" !== this.name && (r.name = this.name),
  41043. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41044. !0 === this.castShadow && (r.castShadow = !0),
  41045. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41046. !1 === this.visible && (r.visible = !1),
  41047. r.matrix = this.matrix.toArray(),
  41048. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41049. r.geometry = this.geometry.uuid),
  41050. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41051. r.material = this.material.uuid),
  41052. 0 < this.children.length) {
  41053. r.children = [];
  41054. for (var o = 0; o < this.children.length; o++)
  41055. r.children.push(this.children[o].toJSON(e).object)
  41056. }
  41057. if (i) {
  41058. var a = t(e.geometries)
  41059. , s = t(e.materials)
  41060. , l = t(e.textures)
  41061. , c = t(e.images);
  41062. 0 < a.length && (n.geometries = a),
  41063. 0 < s.length && (n.materials = s),
  41064. 0 < l.length && (n.textures = l),
  41065. 0 < c.length && (n.images = c)
  41066. }
  41067. return n.object = r,
  41068. n
  41069. },
  41070. clone: function(e) {
  41071. return (new this.constructor).copy(this, e)
  41072. },
  41073. copy: function(e, t) {
  41074. if (void 0 === t && (t = !0),
  41075. this.name = e.name,
  41076. this.up.copy(e.up),
  41077. this.position.copy(e.position),
  41078. this.quaternion.copy(e.quaternion),
  41079. this.scale.copy(e.scale),
  41080. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41081. this.matrix.copy(e.matrix),
  41082. this.matrixWorld.copy(e.matrixWorld),
  41083. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41084. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41085. this.visible = e.visible,
  41086. this.castShadow = e.castShadow,
  41087. this.receiveShadow = e.receiveShadow,
  41088. this.frustumCulled = e.frustumCulled,
  41089. this.renderOrder = e.renderOrder,
  41090. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41091. !0 === t)
  41092. for (var i = 0; i < e.children.length; i++) {
  41093. var n = e.children[i];
  41094. this.add(n.clone())
  41095. }
  41096. return this
  41097. }
  41098. },
  41099. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41100. Ci.Object3DIdCount = 0,
  41101. Ci.Face3 = function(e, t, i, n, r, o) {
  41102. this.a = e,
  41103. this.b = t,
  41104. this.c = i,
  41105. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41106. this.vertexNormals = Array.isArray(n) ? n : [],
  41107. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41108. this.vertexColors = Array.isArray(r) ? r : [],
  41109. this.materialIndex = void 0 !== o ? o : 0
  41110. }
  41111. ,
  41112. Ci.Face3.prototype = {
  41113. constructor: Ci.Face3,
  41114. clone: function() {
  41115. return (new this.constructor).copy(this)
  41116. },
  41117. copy: function(e) {
  41118. this.a = e.a,
  41119. this.b = e.b,
  41120. this.c = e.c,
  41121. this.normal.copy(e.normal),
  41122. this.color.copy(e.color),
  41123. this.materialIndex = e.materialIndex;
  41124. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41125. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41126. for (t = 0,
  41127. i = e.vertexColors.length; t < i; t++)
  41128. this.vertexColors[t] = e.vertexColors[t].clone();
  41129. return this
  41130. }
  41131. },
  41132. Ci.BufferAttribute = function(e, t) {
  41133. this.uuid = Ci.Math.generateUUID(),
  41134. this.array = e,
  41135. this.itemSize = t,
  41136. this.dynamic = !1,
  41137. this.updateRange = {
  41138. offset: 0,
  41139. count: -1
  41140. },
  41141. this.version = 0
  41142. }
  41143. ,
  41144. Ci.BufferAttribute.prototype = {
  41145. constructor: Ci.BufferAttribute,
  41146. get count() {
  41147. return this.array.length / this.itemSize
  41148. },
  41149. set needsUpdate(e) {
  41150. !0 === e && this.version++
  41151. },
  41152. setDynamic: function(e) {
  41153. return this.dynamic = e,
  41154. this
  41155. },
  41156. copy: function(e) {
  41157. return this.array = new e.array.constructor(e.array),
  41158. this.itemSize = e.itemSize,
  41159. this.dynamic = e.dynamic,
  41160. this
  41161. },
  41162. copyAt: function(e, t, i) {
  41163. e *= this.itemSize,
  41164. i *= t.itemSize;
  41165. for (var n = 0, r = this.itemSize; n < r; n++)
  41166. this.array[e + n] = t.array[i + n];
  41167. return this
  41168. },
  41169. copyArray: function(e) {
  41170. return this.array.set(e),
  41171. this
  41172. },
  41173. copyColorsArray: function(e) {
  41174. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41175. var o = e[n];
  41176. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41177. o = new Ci.Color),
  41178. t[i++] = o.r,
  41179. t[i++] = o.g,
  41180. t[i++] = o.b
  41181. }
  41182. return this
  41183. },
  41184. copyIndicesArray: function(e) {
  41185. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41186. var o = e[n];
  41187. t[i++] = o.a,
  41188. t[i++] = o.b,
  41189. t[i++] = o.c
  41190. }
  41191. return this
  41192. },
  41193. copyVector2sArray: function(e) {
  41194. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41195. var o = e[n];
  41196. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41197. o = new Ci.Vector2),
  41198. t[i++] = o.x,
  41199. t[i++] = o.y
  41200. }
  41201. return this
  41202. },
  41203. copyVector3sArray: function(e) {
  41204. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41205. var o = e[n];
  41206. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41207. o = new Ci.Vector3),
  41208. t[i++] = o.x,
  41209. t[i++] = o.y,
  41210. t[i++] = o.z
  41211. }
  41212. return this
  41213. },
  41214. copyVector4sArray: function(e) {
  41215. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41216. var o = e[n];
  41217. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41218. o = new Ci.Vector4),
  41219. t[i++] = o.x,
  41220. t[i++] = o.y,
  41221. t[i++] = o.z,
  41222. t[i++] = o.w
  41223. }
  41224. return this
  41225. },
  41226. set: function(e, t) {
  41227. return void 0 === t && (t = 0),
  41228. this.array.set(e, t),
  41229. this
  41230. },
  41231. getX: function(e) {
  41232. return this.array[e * this.itemSize]
  41233. },
  41234. setX: function(e, t) {
  41235. return this.array[e * this.itemSize] = t,
  41236. this
  41237. },
  41238. getY: function(e) {
  41239. return this.array[e * this.itemSize + 1]
  41240. },
  41241. setY: function(e, t) {
  41242. return this.array[e * this.itemSize + 1] = t,
  41243. this
  41244. },
  41245. getZ: function(e) {
  41246. return this.array[e * this.itemSize + 2]
  41247. },
  41248. setZ: function(e, t) {
  41249. return this.array[e * this.itemSize + 2] = t,
  41250. this
  41251. },
  41252. getW: function(e) {
  41253. return this.array[e * this.itemSize + 3]
  41254. },
  41255. setW: function(e, t) {
  41256. return this.array[e * this.itemSize + 3] = t,
  41257. this
  41258. },
  41259. setXY: function(e, t, i) {
  41260. return e *= this.itemSize,
  41261. this.array[e + 0] = t,
  41262. this.array[e + 1] = i,
  41263. this
  41264. },
  41265. setXYZ: function(e, t, i, n) {
  41266. return e *= this.itemSize,
  41267. this.array[e + 0] = t,
  41268. this.array[e + 1] = i,
  41269. this.array[e + 2] = n,
  41270. this
  41271. },
  41272. setXYZW: function(e, t, i, n, r) {
  41273. return e *= this.itemSize,
  41274. this.array[e + 0] = t,
  41275. this.array[e + 1] = i,
  41276. this.array[e + 2] = n,
  41277. this.array[e + 3] = r,
  41278. this
  41279. },
  41280. clone: function() {
  41281. return (new this.constructor).copy(this)
  41282. }
  41283. },
  41284. Ci.Int8Attribute = function(e, t) {
  41285. return new Ci.BufferAttribute(new Int8Array(e),t)
  41286. }
  41287. ,
  41288. Ci.Uint8Attribute = function(e, t) {
  41289. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41290. }
  41291. ,
  41292. Ci.Uint8ClampedAttribute = function(e, t) {
  41293. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41294. }
  41295. ,
  41296. Ci.Int16Attribute = function(e, t) {
  41297. return new Ci.BufferAttribute(new Int16Array(e),t)
  41298. }
  41299. ,
  41300. Ci.Uint16Attribute = function(e, t) {
  41301. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41302. }
  41303. ,
  41304. Ci.Int32Attribute = function(e, t) {
  41305. return new Ci.BufferAttribute(new Int32Array(e),t)
  41306. }
  41307. ,
  41308. Ci.Uint32Attribute = function(e, t) {
  41309. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41310. }
  41311. ,
  41312. Ci.Float32Attribute = function(e, t) {
  41313. return new Ci.BufferAttribute(new Float32Array(e),t)
  41314. }
  41315. ,
  41316. Ci.Float64Attribute = function(e, t) {
  41317. return new Ci.BufferAttribute(new Float64Array(e),t)
  41318. }
  41319. ,
  41320. Ci.DynamicBufferAttribute = function(e, t) {
  41321. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41322. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41323. }
  41324. ,
  41325. Ci.InstancedBufferAttribute = function(e, t, i) {
  41326. Ci.BufferAttribute.call(this, e, t),
  41327. this.meshPerAttribute = i || 1
  41328. }
  41329. ,
  41330. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41331. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41332. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41333. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41334. this.meshPerAttribute = e.meshPerAttribute,
  41335. this
  41336. }
  41337. ,
  41338. Ci.InterleavedBuffer = function(e, t) {
  41339. this.uuid = Ci.Math.generateUUID(),
  41340. this.array = e,
  41341. this.stride = t,
  41342. this.dynamic = !1,
  41343. this.updateRange = {
  41344. offset: 0,
  41345. count: -1
  41346. },
  41347. this.version = 0
  41348. }
  41349. ,
  41350. Ci.InterleavedBuffer.prototype = {
  41351. constructor: Ci.InterleavedBuffer,
  41352. get length() {
  41353. return this.array.length
  41354. },
  41355. get count() {
  41356. return this.array.length / this.stride
  41357. },
  41358. set needsUpdate(e) {
  41359. !0 === e && this.version++
  41360. },
  41361. setDynamic: function(e) {
  41362. return this.dynamic = e,
  41363. this
  41364. },
  41365. copy: function(e) {
  41366. return this.array = new e.array.constructor(e.array),
  41367. this.stride = e.stride,
  41368. this.dynamic = e.dynamic,
  41369. this
  41370. },
  41371. copyAt: function(e, t, i) {
  41372. e *= this.stride,
  41373. i *= t.stride;
  41374. for (var n = 0, r = this.stride; n < r; n++)
  41375. this.array[e + n] = t.array[i + n];
  41376. return this
  41377. },
  41378. set: function(e, t) {
  41379. return void 0 === t && (t = 0),
  41380. this.array.set(e, t),
  41381. this
  41382. },
  41383. clone: function() {
  41384. return (new this.constructor).copy(this)
  41385. }
  41386. },
  41387. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41388. Ci.InterleavedBuffer.call(this, e, t),
  41389. this.meshPerAttribute = i || 1
  41390. }
  41391. ,
  41392. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41393. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41394. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41395. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41396. this.meshPerAttribute = e.meshPerAttribute,
  41397. this
  41398. }
  41399. ,
  41400. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41401. this.uuid = Ci.Math.generateUUID(),
  41402. this.data = e,
  41403. this.itemSize = t,
  41404. this.offset = i
  41405. }
  41406. ,
  41407. Ci.InterleavedBufferAttribute.prototype = {
  41408. constructor: Ci.InterleavedBufferAttribute,
  41409. get length() {
  41410. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41411. this.array.length
  41412. },
  41413. get count() {
  41414. return this.data.count
  41415. },
  41416. setX: function(e, t) {
  41417. return this.data.array[e * this.data.stride + this.offset] = t,
  41418. this
  41419. },
  41420. setY: function(e, t) {
  41421. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41422. this
  41423. },
  41424. setZ: function(e, t) {
  41425. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41426. this
  41427. },
  41428. setW: function(e, t) {
  41429. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41430. this
  41431. },
  41432. getX: function(e) {
  41433. return this.data.array[e * this.data.stride + this.offset]
  41434. },
  41435. getY: function(e) {
  41436. return this.data.array[e * this.data.stride + this.offset + 1]
  41437. },
  41438. getZ: function(e) {
  41439. return this.data.array[e * this.data.stride + this.offset + 2]
  41440. },
  41441. getW: function(e) {
  41442. return this.data.array[e * this.data.stride + this.offset + 3]
  41443. },
  41444. setXY: function(e, t, i) {
  41445. return e = e * this.data.stride + this.offset,
  41446. this.data.array[e + 0] = t,
  41447. this.data.array[e + 1] = i,
  41448. this
  41449. },
  41450. setXYZ: function(e, t, i, n) {
  41451. return e = e * this.data.stride + this.offset,
  41452. this.data.array[e + 0] = t,
  41453. this.data.array[e + 1] = i,
  41454. this.data.array[e + 2] = n,
  41455. this
  41456. },
  41457. setXYZW: function(e, t, i, n, r) {
  41458. return e = e * this.data.stride + this.offset,
  41459. this.data.array[e + 0] = t,
  41460. this.data.array[e + 1] = i,
  41461. this.data.array[e + 2] = n,
  41462. this.data.array[e + 3] = r,
  41463. this
  41464. }
  41465. },
  41466. Ci.Geometry = function() {
  41467. Object.defineProperty(this, "id", {
  41468. value: Ci.GeometryIdCount++
  41469. }),
  41470. this.uuid = Ci.Math.generateUUID(),
  41471. this.name = "",
  41472. this.type = "Geometry",
  41473. this.vertices = [],
  41474. this.colors = [],
  41475. this.faces = [],
  41476. this.faceVertexUvs = [[]],
  41477. this.morphTargets = [],
  41478. this.morphNormals = [],
  41479. this.skinWeights = [],
  41480. this.skinIndices = [],
  41481. this.lineDistances = [],
  41482. this.boundingBox = null,
  41483. this.boundingSphere = null,
  41484. this.verticesNeedUpdate = !1,
  41485. this.elementsNeedUpdate = !1,
  41486. this.uvsNeedUpdate = !1,
  41487. this.normalsNeedUpdate = !1,
  41488. this.colorsNeedUpdate = !1,
  41489. this.lineDistancesNeedUpdate = !1,
  41490. this.groupsNeedUpdate = !1
  41491. }
  41492. ,
  41493. Ci.Geometry.prototype = {
  41494. constructor: Ci.Geometry,
  41495. applyMatrix: function(e) {
  41496. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41497. this.vertices[i].applyMatrix4(e)
  41498. }
  41499. for (i = 0,
  41500. n = this.faces.length; i < n; i++) {
  41501. var r = this.faces[i];
  41502. r.normal.applyMatrix3(t).normalize();
  41503. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41504. r.vertexNormals[o].applyMatrix3(t).normalize()
  41505. }
  41506. return null !== this.boundingBox && this.computeBoundingBox(),
  41507. null !== this.boundingSphere && this.computeBoundingSphere(),
  41508. this.verticesNeedUpdate = !0,
  41509. this.normalsNeedUpdate = !0,
  41510. this
  41511. },
  41512. rotateX: function(e) {
  41513. return void 0 === mt && (mt = new Ci.Matrix4),
  41514. mt.makeRotationX(e),
  41515. this.applyMatrix(mt),
  41516. this
  41517. },
  41518. rotateY: function(e) {
  41519. return void 0 === gt && (gt = new Ci.Matrix4),
  41520. gt.makeRotationY(e),
  41521. this.applyMatrix(gt),
  41522. this
  41523. },
  41524. rotateZ: function(e) {
  41525. return void 0 === ft && (ft = new Ci.Matrix4),
  41526. ft.makeRotationZ(e),
  41527. this.applyMatrix(ft),
  41528. this
  41529. },
  41530. translate: function(e, t, i) {
  41531. return void 0 === pt && (pt = new Ci.Matrix4),
  41532. pt.makeTranslation(e, t, i),
  41533. this.applyMatrix(pt),
  41534. this
  41535. },
  41536. scale: function(e, t, i) {
  41537. return void 0 === dt && (dt = new Ci.Matrix4),
  41538. dt.makeScale(e, t, i),
  41539. this.applyMatrix(dt),
  41540. this
  41541. },
  41542. lookAt: function(e) {
  41543. void 0 === ut && (ut = new Ci.Object3D),
  41544. ut.lookAt(e),
  41545. ut.updateMatrix(),
  41546. this.applyMatrix(ut.matrix)
  41547. },
  41548. fromBufferGeometry: function(e) {
  41549. function t(e, t, i, n) {
  41550. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41551. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41552. , a = new Ci.Face3(e,t,i,r,o,n);
  41553. s.faces.push(a),
  41554. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41555. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41556. }
  41557. var s = this
  41558. , i = null !== e.index ? e.index.array : void 0
  41559. , n = e.attributes
  41560. , r = n.position.array
  41561. , l = void 0 !== n.normal ? n.normal.array : void 0
  41562. , c = void 0 !== n.color ? n.color.array : void 0
  41563. , h = void 0 !== n.uv ? n.uv.array : void 0
  41564. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41565. void 0 !== u && (this.faceVertexUvs[1] = []);
  41566. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41567. a += 2)
  41568. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41569. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41570. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41571. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41572. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41573. if (void 0 !== i) {
  41574. var g = e.groups;
  41575. if (0 < g.length)
  41576. for (o = 0; o < g.length; o++)
  41577. for (var m = g[o], v = m.start, y = (a = v,
  41578. v + m.count); a < y; a += 3)
  41579. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  41580. else
  41581. for (o = 0; o < i.length; o += 3)
  41582. t(i[o], i[o + 1], i[o + 2])
  41583. } else
  41584. for (o = 0; o < r.length / 3; o += 3)
  41585. t(o, o + 1, o + 2);
  41586. return this.computeFaceNormals(),
  41587. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41588. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41589. this
  41590. },
  41591. center: function() {
  41592. this.computeBoundingBox();
  41593. var e = this.boundingBox.center().negate();
  41594. return this.translate(e.x, e.y, e.z),
  41595. e
  41596. },
  41597. normalize: function() {
  41598. this.computeBoundingSphere();
  41599. var e = this.boundingSphere.center
  41600. , t = this.boundingSphere.radius
  41601. , i = 0 === t ? 1 : 1 / t
  41602. , n = new Ci.Matrix4;
  41603. return n.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  41604. this.applyMatrix(n),
  41605. this
  41606. },
  41607. computeFaceNormals: function() {
  41608. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  41609. var r = this.faces[i]
  41610. , o = this.vertices[r.a]
  41611. , a = this.vertices[r.b]
  41612. , s = this.vertices[r.c];
  41613. e.subVectors(s, a),
  41614. t.subVectors(o, a),
  41615. e.cross(t),
  41616. e.normalize(),
  41617. r.normal.copy(e)
  41618. }
  41619. },
  41620. computeVertexNormals: function(e) {
  41621. var t, i, n, r, o, a;
  41622. for (void 0 === e && (e = !0),
  41623. a = new Array(this.vertices.length),
  41624. t = 0,
  41625. i = this.vertices.length; t < i; t++)
  41626. a[t] = new Ci.Vector3;
  41627. if (e) {
  41628. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  41629. for (n = 0,
  41630. r = this.faces.length; n < r; n++)
  41631. o = this.faces[n],
  41632. s = this.vertices[o.a],
  41633. l = this.vertices[o.b],
  41634. c = this.vertices[o.c],
  41635. h.subVectors(c, l),
  41636. u.subVectors(s, l),
  41637. h.cross(u),
  41638. a[o.a].add(h),
  41639. a[o.b].add(h),
  41640. a[o.c].add(h)
  41641. } else
  41642. for (n = 0,
  41643. r = this.faces.length; n < r; n++)
  41644. a[(o = this.faces[n]).a].add(o.normal),
  41645. a[o.b].add(o.normal),
  41646. a[o.c].add(o.normal);
  41647. for (t = 0,
  41648. i = this.vertices.length; t < i; t++)
  41649. a[t].normalize();
  41650. for (n = 0,
  41651. r = this.faces.length; n < r; n++) {
  41652. var d = (o = this.faces[n]).vertexNormals;
  41653. 3 === d.length ? (d[0].copy(a[o.a]),
  41654. d[1].copy(a[o.b]),
  41655. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  41656. d[1] = a[o.b].clone(),
  41657. d[2] = a[o.c].clone())
  41658. }
  41659. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  41660. },
  41661. computeMorphNormals: function() {
  41662. var e, t, i, n, r;
  41663. for (i = 0,
  41664. n = this.faces.length; i < n; i++)
  41665. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  41666. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  41667. e = 0,
  41668. t = r.vertexNormals.length; e < t; e++)
  41669. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  41670. var o = new Ci.Geometry;
  41671. for (o.faces = this.faces,
  41672. e = 0,
  41673. t = this.morphTargets.length; e < t; e++) {
  41674. if (!this.morphNormals[e]) {
  41675. this.morphNormals[e] = {},
  41676. this.morphNormals[e].faceNormals = [],
  41677. this.morphNormals[e].vertexNormals = [];
  41678. var a = this.morphNormals[e].faceNormals
  41679. , s = this.morphNormals[e].vertexNormals;
  41680. for (i = 0,
  41681. n = this.faces.length; i < n; i++)
  41682. l = new Ci.Vector3,
  41683. c = {
  41684. a: new Ci.Vector3,
  41685. b: new Ci.Vector3,
  41686. c: new Ci.Vector3
  41687. },
  41688. a.push(l),
  41689. s.push(c)
  41690. }
  41691. var l, c, h = this.morphNormals[e];
  41692. for (o.vertices = this.morphTargets[e].vertices,
  41693. o.computeFaceNormals(),
  41694. o.computeVertexNormals(),
  41695. i = 0,
  41696. n = this.faces.length; i < n; i++)
  41697. r = this.faces[i],
  41698. l = h.faceNormals[i],
  41699. c = h.vertexNormals[i],
  41700. l.copy(r.normal),
  41701. c.a.copy(r.vertexNormals[0]),
  41702. c.b.copy(r.vertexNormals[1]),
  41703. c.c.copy(r.vertexNormals[2])
  41704. }
  41705. for (i = 0,
  41706. n = this.faces.length; i < n; i++)
  41707. (r = this.faces[i]).normal = r.__originalFaceNormal,
  41708. r.vertexNormals = r.__originalVertexNormals
  41709. },
  41710. computeTangents: function() {
  41711. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  41712. },
  41713. computeLineDistances: function() {
  41714. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  41715. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  41716. this.lineDistances[i] = e
  41717. },
  41718. computeBoundingBox: function() {
  41719. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  41720. this.boundingBox.setFromPoints(this.vertices)
  41721. },
  41722. computeBoundingSphere: function() {
  41723. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  41724. this.boundingSphere.setFromPoints(this.vertices)
  41725. },
  41726. merge: function(e, t, i) {
  41727. if (e instanceof Ci.Geometry != 0) {
  41728. var n, r = this.vertices.length, o = this.vertices, a = e.vertices, s = this.faces, l = e.faces, c = this.faceVertexUvs[0], h = e.faceVertexUvs[0];
  41729. void 0 === i && (i = 0),
  41730. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  41731. for (var u = 0, d = a.length; u < d; u++) {
  41732. var p = a[u].clone();
  41733. void 0 !== t && p.applyMatrix4(t),
  41734. o.push(p)
  41735. }
  41736. for (u = 0,
  41737. d = l.length; u < d; u++) {
  41738. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  41739. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  41740. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  41741. for (var C = 0, I = y.length; C < I; C++)
  41742. g = y[C].clone(),
  41743. void 0 !== n && g.applyMatrix3(n).normalize(),
  41744. f.vertexNormals.push(g);
  41745. f.color.copy(v.color);
  41746. for (C = 0,
  41747. I = A.length; C < I; C++)
  41748. m = A[C],
  41749. f.vertexColors.push(m.clone());
  41750. f.materialIndex = v.materialIndex + i,
  41751. s.push(f)
  41752. }
  41753. for (u = 0,
  41754. d = h.length; u < d; u++) {
  41755. var E = h[u]
  41756. , _ = [];
  41757. if (void 0 !== E) {
  41758. for (C = 0,
  41759. I = E.length; C < I; C++)
  41760. _.push(E[C].clone());
  41761. c.push(_)
  41762. }
  41763. }
  41764. } else
  41765. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  41766. },
  41767. mergeMesh: function(e) {
  41768. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  41769. void this.merge(e.geometry, e.matrix))
  41770. },
  41771. mergeVertices: function() {
  41772. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  41773. for (i = 0,
  41774. n = this.vertices.length; i < n; i++)
  41775. e = this.vertices[i],
  41776. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  41777. c.push(this.vertices[i]),
  41778. h[i] = c.length - 1) : h[i] = h[l[t]];
  41779. var d = [];
  41780. for (i = 0,
  41781. n = this.faces.length; i < n; i++) {
  41782. (r = this.faces[i]).a = h[r.a],
  41783. r.b = h[r.b],
  41784. r.c = h[r.c],
  41785. o = [r.a, r.b, r.c];
  41786. for (var p = 0; p < 3; p++)
  41787. if (o[p] === o[(p + 1) % 3]) {
  41788. p,
  41789. d.push(i);
  41790. break
  41791. }
  41792. }
  41793. for (i = d.length - 1; 0 <= i; i--) {
  41794. var f = d[i];
  41795. for (this.faces.splice(f, 1),
  41796. a = 0,
  41797. s = this.faceVertexUvs.length; a < s; a++)
  41798. this.faceVertexUvs[a].splice(f, 1)
  41799. }
  41800. var g = this.vertices.length - c.length;
  41801. return this.vertices = c,
  41802. g
  41803. },
  41804. sortFacesByMaterialIndex: function() {
  41805. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  41806. e[i]._id = i;
  41807. e.sort(function(e, t) {
  41808. return e.materialIndex - t.materialIndex
  41809. });
  41810. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  41811. o && o.length === t && (n = []),
  41812. a && a.length === t && (r = []);
  41813. for (i = 0; i < t; i++) {
  41814. var s = e[i]._id;
  41815. n && n.push(o[s]),
  41816. r && r.push(a[s])
  41817. }
  41818. n && (this.faceVertexUvs[0] = n),
  41819. r && (this.faceVertexUvs[1] = r)
  41820. },
  41821. toJSON: function() {
  41822. function e(e, t, i) {
  41823. return i ? e | 1 << t : e & ~(1 << t)
  41824. }
  41825. function t(e) {
  41826. var t = e.x.toString() + e.y.toString() + e.z.toString();
  41827. return void 0 !== d[t] || (d[t] = u.length / 3,
  41828. u.push(e.x, e.y, e.z)),
  41829. d[t]
  41830. }
  41831. function i(e) {
  41832. var t = e.r.toString() + e.g.toString() + e.b.toString();
  41833. return void 0 !== f[t] || (f[t] = p.length,
  41834. p.push(e.getHex())),
  41835. f[t]
  41836. }
  41837. function n(e) {
  41838. var t = e.x.toString() + e.y.toString();
  41839. return void 0 !== m[t] || (m[t] = g.length / 2,
  41840. g.push(e.x, e.y)),
  41841. m[t]
  41842. }
  41843. var r = {
  41844. metadata: {
  41845. version: 4.4,
  41846. type: "Geometry",
  41847. generator: "Geometry.toJSON"
  41848. }
  41849. };
  41850. if (r.uuid = this.uuid,
  41851. r.type = this.type,
  41852. "" !== this.name && (r.name = this.name),
  41853. void 0 !== this.parameters) {
  41854. var o = this.parameters;
  41855. for (var a in o)
  41856. void 0 !== o[a] && (r[a] = o[a]);
  41857. return r
  41858. }
  41859. for (var s = [], l = 0; l < this.vertices.length; l++) {
  41860. var c = this.vertices[l];
  41861. s.push(c.x, c.y, c.z)
  41862. }
  41863. var h = []
  41864. , u = []
  41865. , d = {}
  41866. , p = []
  41867. , f = {}
  41868. , g = []
  41869. , m = {};
  41870. for (l = 0; l < this.faces.length; l++) {
  41871. var v = this.faces[l]
  41872. , y = void 0 !== this.faceVertexUvs[0][l]
  41873. , A = 0 < v.normal.length()
  41874. , C = 0 < v.vertexNormals.length
  41875. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  41876. , E = 0 < v.vertexColors.length
  41877. , _ = 0;
  41878. if (_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_, 0, 0), 1, !0), 2, !1), 3, y), 4, A), 5, C), 6, I), 7, E),
  41879. h.push(_),
  41880. h.push(v.a, v.b, v.c),
  41881. h.push(v.materialIndex),
  41882. y) {
  41883. var b = this.faceVertexUvs[0][l];
  41884. h.push(n(b[0]), n(b[1]), n(b[2]))
  41885. }
  41886. if (A && h.push(t(v.normal)),
  41887. C) {
  41888. var w = v.vertexNormals;
  41889. h.push(t(w[0]), t(w[1]), t(w[2]))
  41890. }
  41891. if (I && h.push(i(v.color)),
  41892. E) {
  41893. var T = v.vertexColors;
  41894. h.push(i(T[0]), i(T[1]), i(T[2]))
  41895. }
  41896. }
  41897. return r.data = {},
  41898. r.data.vertices = s,
  41899. r.data.normals = u,
  41900. 0 < p.length && (r.data.colors = p),
  41901. 0 < g.length && (r.data.uvs = [g]),
  41902. r.data.faces = h,
  41903. r
  41904. },
  41905. clone: function() {
  41906. return (new Ci.Geometry).copy(this)
  41907. },
  41908. copy: function(e) {
  41909. this.vertices = [],
  41910. this.faces = [],
  41911. this.faceVertexUvs = [[]];
  41912. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  41913. this.vertices.push(t[i].clone());
  41914. var r = e.faces;
  41915. for (i = 0,
  41916. n = r.length; i < n; i++)
  41917. this.faces.push(r[i].clone());
  41918. for (i = 0,
  41919. n = e.faceVertexUvs.length; i < n; i++) {
  41920. var o = e.faceVertexUvs[i];
  41921. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  41922. for (var a = 0, s = o.length; a < s; a++) {
  41923. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  41924. var d = l[h];
  41925. c.push(d.clone())
  41926. }
  41927. this.faceVertexUvs[i].push(c)
  41928. }
  41929. }
  41930. return this
  41931. },
  41932. dispose: function() {
  41933. this.dispatchEvent({
  41934. type: "dispose"
  41935. })
  41936. }
  41937. },
  41938. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  41939. Ci.GeometryIdCount = 0,
  41940. Ci.DirectGeometry = function() {
  41941. Object.defineProperty(this, "id", {
  41942. value: Ci.GeometryIdCount++
  41943. }),
  41944. this.uuid = Ci.Math.generateUUID(),
  41945. this.name = "",
  41946. this.type = "DirectGeometry",
  41947. this.indices = [],
  41948. this.vertices = [],
  41949. this.normals = [],
  41950. this.colors = [],
  41951. this.uvs = [],
  41952. this.uvs2 = [],
  41953. this.groups = [],
  41954. this.morphTargets = {},
  41955. this.skinWeights = [],
  41956. this.skinIndices = [],
  41957. this.boundingBox = null,
  41958. this.boundingSphere = null,
  41959. this.verticesNeedUpdate = !1,
  41960. this.normalsNeedUpdate = !1,
  41961. this.colorsNeedUpdate = !1,
  41962. this.uvsNeedUpdate = !1,
  41963. this.groupsNeedUpdate = !1
  41964. }
  41965. ,
  41966. Ci.DirectGeometry.prototype = {
  41967. constructor: Ci.DirectGeometry,
  41968. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  41969. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  41970. computeFaceNormals: function() {
  41971. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  41972. },
  41973. computeVertexNormals: function() {
  41974. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  41975. },
  41976. computeGroups: function(e) {
  41977. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  41978. var a = r[o];
  41979. a.materialIndex !== i && (i = a.materialIndex,
  41980. void 0 !== t && (t.count = 3 * o - t.start,
  41981. n.push(t)),
  41982. t = {
  41983. start: 3 * o,
  41984. materialIndex: i
  41985. })
  41986. }
  41987. void 0 !== t && (t.count = 3 * o - t.start,
  41988. n.push(t)),
  41989. this.groups = n
  41990. },
  41991. fromGeometry: function(e) {
  41992. var t, i = e.faces, n = e.vertices, r = e.faceVertexUvs, o = r[0] && 0 < r[0].length, a = r[1] && 0 < r[1].length, s = e.morphTargets, l = s.length;
  41993. if (0 < l) {
  41994. t = [];
  41995. for (var c = 0; c < l; c++)
  41996. t[c] = [];
  41997. this.morphTargets.position = t
  41998. }
  41999. var h, u = e.morphNormals, d = u.length;
  42000. if (0 < d) {
  42001. h = [];
  42002. for (c = 0; c < d; c++)
  42003. h[c] = [];
  42004. this.morphTargets.normal = h
  42005. }
  42006. var p = e.skinIndices
  42007. , f = e.skinWeights
  42008. , g = p.length === n.length
  42009. , m = f.length === n.length;
  42010. for (c = 0; c < i.length; c++) {
  42011. var v = i[c];
  42012. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42013. var y = v.vertexNormals;
  42014. if (3 === y.length)
  42015. this.normals.push(y[0], y[1], y[2]);
  42016. else {
  42017. var A = v.normal;
  42018. this.normals.push(A, A, A)
  42019. }
  42020. var C, I = v.vertexColors;
  42021. if (3 === I.length)
  42022. this.colors.push(I[0], I[1], I[2]);
  42023. else {
  42024. var E = v.color;
  42025. this.colors.push(E, E, E)
  42026. }
  42027. if (!0 === o)
  42028. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42029. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42030. if (!0 === a)
  42031. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42032. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42033. for (var _ = 0; _ < l; _++) {
  42034. var b = s[_].vertices;
  42035. t[_].push(b[v.a], b[v.b], b[v.c])
  42036. }
  42037. for (_ = 0; _ < d; _++) {
  42038. var w = u[_].vertexNormals[c];
  42039. h[_].push(w.a, w.b, w.c)
  42040. }
  42041. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42042. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42043. }
  42044. return this.computeGroups(e),
  42045. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42046. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42047. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42048. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42049. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42050. this
  42051. },
  42052. dispose: function() {
  42053. this.dispatchEvent({
  42054. type: "dispose"
  42055. })
  42056. }
  42057. },
  42058. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42059. Ci.BufferGeometry = function() {
  42060. Object.defineProperty(this, "id", {
  42061. value: Ci.GeometryIdCount++
  42062. }),
  42063. this.uuid = Ci.Math.generateUUID(),
  42064. this.name = "",
  42065. this.type = "BufferGeometry",
  42066. this.index = null,
  42067. this.attributes = {},
  42068. this.morphAttributes = {},
  42069. this.groups = [],
  42070. this.boundingBox = null,
  42071. this.boundingSphere = null,
  42072. this.drawRange = {
  42073. start: 0,
  42074. count: 1 / 0
  42075. }
  42076. }
  42077. ,
  42078. Ci.BufferGeometry.prototype = {
  42079. constructor: Ci.BufferGeometry,
  42080. getIndex: function() {
  42081. return this.index
  42082. },
  42083. setIndex: function(e) {
  42084. this.index = e
  42085. },
  42086. addAttribute: function(e, t) {
  42087. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42088. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42089. void this.setIndex(t)) : (this.attributes[e] = t,
  42090. this)
  42091. },
  42092. getAttribute: function(e) {
  42093. return this.attributes[e]
  42094. },
  42095. removeAttribute: function(e) {
  42096. return delete this.attributes[e],
  42097. this
  42098. },
  42099. addGroup: function(e, t, i) {
  42100. this.groups.push({
  42101. start: e,
  42102. count: t,
  42103. materialIndex: void 0 !== i ? i : 0
  42104. })
  42105. },
  42106. clearGroups: function() {
  42107. this.groups = []
  42108. },
  42109. setDrawRange: function(e, t) {
  42110. this.drawRange.start = e,
  42111. this.drawRange.count = t
  42112. },
  42113. applyMatrix: function(e) {
  42114. var t = this.attributes.position;
  42115. void 0 !== t && (e.applyToVector3Array(t.array),
  42116. t.needsUpdate = !0);
  42117. var i = this.attributes.normal;
  42118. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42119. i.needsUpdate = !0);
  42120. return null !== this.boundingBox && this.computeBoundingBox(),
  42121. null !== this.boundingSphere && this.computeBoundingSphere(),
  42122. this
  42123. },
  42124. rotateX: function(e) {
  42125. return void 0 === ht && (ht = new Ci.Matrix4),
  42126. ht.makeRotationX(e),
  42127. this.applyMatrix(ht),
  42128. this
  42129. },
  42130. rotateY: function(e) {
  42131. return void 0 === ct && (ct = new Ci.Matrix4),
  42132. ct.makeRotationY(e),
  42133. this.applyMatrix(ct),
  42134. this
  42135. },
  42136. rotateZ: function(e) {
  42137. return void 0 === lt && (lt = new Ci.Matrix4),
  42138. lt.makeRotationZ(e),
  42139. this.applyMatrix(lt),
  42140. this
  42141. },
  42142. translate: function(e, t, i) {
  42143. return void 0 === st && (st = new Ci.Matrix4),
  42144. st.makeTranslation(e, t, i),
  42145. this.applyMatrix(st),
  42146. this
  42147. },
  42148. scale: function(e, t, i) {
  42149. return void 0 === at && (at = new Ci.Matrix4),
  42150. at.makeScale(e, t, i),
  42151. this.applyMatrix(at),
  42152. this
  42153. },
  42154. lookAt: function(e) {
  42155. void 0 === ot && (ot = new Ci.Object3D),
  42156. ot.lookAt(e),
  42157. ot.updateMatrix(),
  42158. this.applyMatrix(ot.matrix)
  42159. },
  42160. center: function() {
  42161. this.computeBoundingBox();
  42162. var e = this.boundingBox.center().negate();
  42163. return this.translate(e.x, e.y, e.z),
  42164. e
  42165. },
  42166. setFromObject: function(e) {
  42167. var t = e.geometry;
  42168. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42169. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42170. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42171. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42172. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42173. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42174. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42175. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42176. }
  42177. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42178. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42179. } else
  42180. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42181. return this
  42182. },
  42183. updateFromObject: function(e) {
  42184. var t, i = e.geometry;
  42185. if (e instanceof Ci.Mesh) {
  42186. var n = i.__directGeometry;
  42187. if (void 0 === n)
  42188. return this.fromGeometry(i);
  42189. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42190. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42191. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42192. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42193. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42194. i.verticesNeedUpdate = !1,
  42195. i.normalsNeedUpdate = !1,
  42196. i.colorsNeedUpdate = !1,
  42197. i.uvsNeedUpdate = !1,
  42198. i.groupsNeedUpdate = !1,
  42199. i = n
  42200. }
  42201. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42202. t.needsUpdate = !0),
  42203. i.verticesNeedUpdate = !1);
  42204. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42205. t.needsUpdate = !0),
  42206. i.normalsNeedUpdate = !1);
  42207. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42208. t.needsUpdate = !0),
  42209. i.colorsNeedUpdate = !1);
  42210. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42211. t.needsUpdate = !0),
  42212. i.uvsNeedUpdate = !1);
  42213. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42214. t.needsUpdate = !0),
  42215. i.lineDistancesNeedUpdate = !1);
  42216. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42217. this.groups = i.groups,
  42218. i.groupsNeedUpdate = !1),
  42219. this
  42220. },
  42221. fromGeometry: function(e) {
  42222. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42223. this.fromDirectGeometry(e.__directGeometry)
  42224. },
  42225. fromDirectGeometry: function(e) {
  42226. var t = new Float32Array(3 * e.vertices.length);
  42227. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42228. 0 < e.normals.length) {
  42229. var i = new Float32Array(3 * e.normals.length);
  42230. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42231. }
  42232. if (0 < e.colors.length) {
  42233. var n = new Float32Array(3 * e.colors.length);
  42234. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42235. }
  42236. if (0 < e.uvs.length) {
  42237. var r = new Float32Array(2 * e.uvs.length);
  42238. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42239. }
  42240. if (0 < e.uvs2.length) {
  42241. var o = new Float32Array(2 * e.uvs2.length);
  42242. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42243. }
  42244. if (0 < e.indices.length) {
  42245. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42246. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42247. }
  42248. for (var s in this.groups = e.groups,
  42249. e.morphTargets) {
  42250. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42251. var d = c[h]
  42252. , p = new Ci.Float32Attribute(3 * d.length,3);
  42253. l.push(p.copyVector3sArray(d))
  42254. }
  42255. this.morphAttributes[s] = l
  42256. }
  42257. if (0 < e.skinIndices.length) {
  42258. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42259. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42260. }
  42261. if (0 < e.skinWeights.length) {
  42262. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42263. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42264. }
  42265. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42266. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42267. this
  42268. },
  42269. computeBoundingBox: (new Ci.Vector3,
  42270. function() {
  42271. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42272. var e = this.attributes.position.array;
  42273. e && this.boundingBox.setFromArray(e),
  42274. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42275. this.boundingBox.max.set(0, 0, 0)),
  42276. (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)
  42277. }
  42278. ),
  42279. computeBoundingSphere: (nt = new Ci.Box3,
  42280. rt = new Ci.Vector3,
  42281. function() {
  42282. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42283. var e = this.attributes.position.array;
  42284. if (e) {
  42285. var t = this.boundingSphere.center;
  42286. nt.setFromArray(e),
  42287. nt.center(t);
  42288. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42289. rt.fromArray(e, n),
  42290. i = Math.max(i, t.distanceToSquared(rt));
  42291. this.boundingSphere.radius = Math.sqrt(i),
  42292. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42293. }
  42294. }
  42295. ),
  42296. computeFaceNormals: function() {},
  42297. computeVertexNormals: function() {
  42298. var e = this.index
  42299. , t = this.attributes
  42300. , i = this.groups;
  42301. if (t.position) {
  42302. var n = t.position.array;
  42303. if (void 0 === t.normal)
  42304. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42305. else
  42306. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42307. r[o] = 0;
  42308. var s, l, c, h = t.normal.array, u = new Ci.Vector3, d = new Ci.Vector3, p = new Ci.Vector3, f = new Ci.Vector3, g = new Ci.Vector3;
  42309. if (e) {
  42310. var m = e.array;
  42311. 0 === i.length && this.addGroup(0, m.length);
  42312. for (var v = 0, y = i.length; v < y; ++v) {
  42313. var A = i[v]
  42314. , C = A.start;
  42315. for (o = C,
  42316. a = C + A.count; o < a; o += 3)
  42317. s = 3 * m[o + 0],
  42318. l = 3 * m[o + 1],
  42319. c = 3 * m[o + 2],
  42320. u.fromArray(n, s),
  42321. d.fromArray(n, l),
  42322. p.fromArray(n, c),
  42323. f.subVectors(p, d),
  42324. g.subVectors(u, d),
  42325. f.cross(g),
  42326. h[s] += f.x,
  42327. h[1 + s] += f.y,
  42328. h[2 + s] += f.z,
  42329. h[l] += f.x,
  42330. h[1 + l] += f.y,
  42331. h[2 + l] += f.z,
  42332. h[c] += f.x,
  42333. h[1 + c] += f.y,
  42334. h[2 + c] += f.z
  42335. }
  42336. } else
  42337. for (o = 0,
  42338. a = n.length; o < a; o += 9)
  42339. u.fromArray(n, o),
  42340. d.fromArray(n, o + 3),
  42341. p.fromArray(n, o + 6),
  42342. f.subVectors(p, d),
  42343. g.subVectors(u, d),
  42344. f.cross(g),
  42345. h[o] = f.x,
  42346. h[o + 1] = f.y,
  42347. h[o + 2] = f.z,
  42348. h[o + 3] = f.x,
  42349. h[o + 4] = f.y,
  42350. h[o + 5] = f.z,
  42351. h[o + 6] = f.x,
  42352. h[o + 7] = f.y,
  42353. h[o + 8] = f.z;
  42354. this.normalizeNormals(),
  42355. t.normal.needsUpdate = !0
  42356. }
  42357. },
  42358. merge: function(e, t) {
  42359. if (e instanceof Ci.BufferGeometry != 0) {
  42360. void 0 === t && (t = 0);
  42361. var i = this.attributes;
  42362. for (var n in i)
  42363. if (void 0 !== e.attributes[n])
  42364. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42365. l++)
  42366. r[l] = a[s];
  42367. return this
  42368. }
  42369. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42370. },
  42371. normalizeNormals: function() {
  42372. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42373. e = r[o],
  42374. t = r[o + 1],
  42375. i = r[o + 2],
  42376. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42377. r[o] *= n,
  42378. r[o + 1] *= n,
  42379. r[o + 2] *= n
  42380. },
  42381. toNonIndexed: function() {
  42382. if (null === this.index)
  42383. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42384. this;
  42385. var e = new Ci.BufferGeometry
  42386. , t = this.index.array
  42387. , i = this.attributes;
  42388. for (var n in i) {
  42389. for (var r = i[n], o = r.array, a = r.itemSize, s = new o.constructor(t.length * a), l = 0, c = 0, h = 0, u = t.length; h < u; h++) {
  42390. l = t[h] * a;
  42391. for (var d = 0; d < a; d++)
  42392. s[c++] = o[l++]
  42393. }
  42394. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42395. }
  42396. return e
  42397. },
  42398. toJSON: function() {
  42399. var e = {
  42400. metadata: {
  42401. version: 4.4,
  42402. type: "BufferGeometry",
  42403. generator: "BufferGeometry.toJSON"
  42404. }
  42405. };
  42406. if (e.uuid = this.uuid,
  42407. e.type = this.type,
  42408. "" !== this.name && (e.name = this.name),
  42409. void 0 !== this.parameters) {
  42410. var t = this.parameters;
  42411. for (var i in t)
  42412. void 0 !== t[i] && (e[i] = t[i]);
  42413. return e
  42414. }
  42415. e.data = {
  42416. attributes: {}
  42417. };
  42418. var n = this.index;
  42419. if (null !== n) {
  42420. var r = Array.prototype.slice.call(n.array);
  42421. e.data.index = {
  42422. type: n.array.constructor.name,
  42423. array: r
  42424. }
  42425. }
  42426. var o = this.attributes;
  42427. for (var i in o) {
  42428. var a = o[i];
  42429. r = Array.prototype.slice.call(a.array);
  42430. e.data.attributes[i] = {
  42431. itemSize: a.itemSize,
  42432. type: a.array.constructor.name,
  42433. array: r
  42434. }
  42435. }
  42436. var s = this.groups;
  42437. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42438. var l = this.boundingSphere;
  42439. return null !== l && (e.data.boundingSphere = {
  42440. center: l.center.toArray(),
  42441. radius: l.radius
  42442. }),
  42443. e
  42444. },
  42445. clone: function() {
  42446. return (new Ci.BufferGeometry).copy(this)
  42447. },
  42448. copy: function(e) {
  42449. var t = e.index;
  42450. null !== t && this.setIndex(t.clone());
  42451. var i = e.attributes;
  42452. for (var n in i) {
  42453. var r = i[n];
  42454. this.addAttribute(n, r.clone())
  42455. }
  42456. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42457. var l = o[a];
  42458. this.addGroup(l.start, l.count)
  42459. }
  42460. return this
  42461. },
  42462. dispose: function() {
  42463. this.dispatchEvent({
  42464. type: "dispose"
  42465. })
  42466. }
  42467. },
  42468. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42469. Ci.BufferGeometry.MaxIndex = 65535,
  42470. Ci.InstancedBufferGeometry = function() {
  42471. Ci.BufferGeometry.call(this),
  42472. this.type = "InstancedBufferGeometry",
  42473. this.maxInstancedCount = void 0
  42474. }
  42475. ,
  42476. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42477. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42478. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42479. this.groups.push({
  42480. start: e,
  42481. count: t,
  42482. instances: i
  42483. })
  42484. }
  42485. ,
  42486. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42487. var t = e.index;
  42488. null !== t && this.setIndex(t.clone());
  42489. var i = e.attributes;
  42490. for (var n in i) {
  42491. var r = i[n];
  42492. this.addAttribute(n, r.clone())
  42493. }
  42494. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42495. var l = o[a];
  42496. this.addGroup(l.start, l.count, l.instances)
  42497. }
  42498. return this
  42499. }
  42500. ,
  42501. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42502. Ci.Uniform = function(e, t) {
  42503. this.type = e,
  42504. this.value = t,
  42505. this.dynamic = !1
  42506. }
  42507. ,
  42508. Ci.Uniform.prototype = {
  42509. constructor: Ci.Uniform,
  42510. onUpdate: function(e) {
  42511. return this.dynamic = !0,
  42512. this.onUpdateCallback = e,
  42513. this
  42514. }
  42515. },
  42516. Ci.AnimationClip = function(e, t, i) {
  42517. this.name = e || Ci.Math.generateUUID(),
  42518. this.tracks = i,
  42519. this.duration = void 0 !== t ? t : -1,
  42520. this.duration < 0 && this.resetDuration(),
  42521. this.trim(),
  42522. this.optimize()
  42523. }
  42524. ,
  42525. Ci.AnimationClip.prototype = {
  42526. constructor: Ci.AnimationClip,
  42527. resetDuration: function() {
  42528. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42529. var n = this.tracks[t];
  42530. e = Math.max(e, n.times[n.times.length - 1])
  42531. }
  42532. this.duration = e
  42533. },
  42534. trim: function() {
  42535. for (var e = 0; e < this.tracks.length; e++)
  42536. this.tracks[e].trim(0, this.duration);
  42537. return this
  42538. },
  42539. optimize: function() {
  42540. for (var e = 0; e < this.tracks.length; e++)
  42541. this.tracks[e].optimize();
  42542. return this
  42543. }
  42544. },
  42545. Object.assign(Ci.AnimationClip, {
  42546. parse: function(e) {
  42547. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42548. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42549. return new Ci.AnimationClip(e.name,e.duration,t)
  42550. },
  42551. toJSON: function(e) {
  42552. for (var t = [], i = e.tracks, n = {
  42553. name: e.name,
  42554. duration: e.duration,
  42555. tracks: t
  42556. }, r = 0, o = i.length; r !== o; ++r)
  42557. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42558. return n
  42559. },
  42560. CreateFromMorphTargetSequence: function(e, t, i) {
  42561. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42562. var a = []
  42563. , s = [];
  42564. a.push((o + n - 1) % n, o, (o + 1) % n),
  42565. s.push(0, 1, 0);
  42566. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42567. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42568. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42569. 0 === a[0] && (a.push(n),
  42570. s.push(s[0])),
  42571. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42572. }
  42573. return new Ci.AnimationClip(e,-1,r)
  42574. },
  42575. findByName: function(e, t) {
  42576. for (var i = 0; i < e.length; i++)
  42577. if (e[i].name === t)
  42578. return e[i];
  42579. return null
  42580. },
  42581. CreateClipsFromMorphTargetSequences: function(e, t) {
  42582. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  42583. var a = e[r]
  42584. , s = a.name.match(n);
  42585. if (s && 1 < s.length) {
  42586. var l = i[h = s[1]];
  42587. l || (i[h] = l = []),
  42588. l.push(a)
  42589. }
  42590. }
  42591. var c = [];
  42592. for (var h in i)
  42593. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  42594. return c
  42595. },
  42596. parseAnimation: function(e, t, i) {
  42597. if (!e)
  42598. return console.error(" no animation in JSONLoader data"),
  42599. null;
  42600. function n(e, t, i, n, r) {
  42601. if (0 !== i.length) {
  42602. var o = []
  42603. , a = [];
  42604. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  42605. 0 !== o.length && r.push(new e(t,o,a))
  42606. }
  42607. }
  42608. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  42609. var h = l[c].keys;
  42610. if (h && 0 != h.length)
  42611. if (h[0].morphTargets) {
  42612. for (var u = {}, d = 0; d < h.length; d++)
  42613. if (h[d].morphTargets)
  42614. for (var p = 0; p < h[d].morphTargets.length; p++)
  42615. u[h[d].morphTargets[p]] = -1;
  42616. for (var f in u) {
  42617. var g = []
  42618. , m = [];
  42619. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  42620. var v = h[d];
  42621. g.push(v.time),
  42622. m.push(v.morphTarget === f ? 1 : 0)
  42623. }
  42624. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  42625. }
  42626. a = u.length * (s || 1)
  42627. } else {
  42628. var y = ".bones[" + t[c].name + "]";
  42629. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  42630. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  42631. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  42632. }
  42633. }
  42634. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  42635. }
  42636. }),
  42637. Ci.AnimationMixer = function(e) {
  42638. this._root = e,
  42639. this._initMemoryManager(),
  42640. this._accuIndex = 0,
  42641. this.time = 0,
  42642. this.timeScale = 1
  42643. }
  42644. ,
  42645. Ci.AnimationMixer.prototype = {
  42646. constructor: Ci.AnimationMixer,
  42647. clipAction: function(e, t) {
  42648. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  42649. if (void 0 !== a) {
  42650. var s = a.actionByRoot[n];
  42651. if (void 0 !== s)
  42652. return s;
  42653. if (o = (i = a.knownActions[0])._clip,
  42654. e !== r && e !== o)
  42655. throw new Error("Different clips with the same name detected!")
  42656. }
  42657. if (null === o)
  42658. return null;
  42659. var l = new Ci.AnimationMixer._Action(this,o,t);
  42660. return this._bindAction(l, i),
  42661. this._addInactiveAction(l, r, n),
  42662. l
  42663. },
  42664. existingAction: function(e, t) {
  42665. var i = (t || this._root).uuid
  42666. , n = "string" == typeof e ? e : e.name
  42667. , r = this._actionsByClip[n];
  42668. return void 0 !== r && r.actionByRoot[i] || null
  42669. },
  42670. stopAllAction: function() {
  42671. var e = this._actions
  42672. , t = this._nActiveActions
  42673. , i = this._bindings
  42674. , n = this._nActiveBindings;
  42675. this._nActiveActions = 0;
  42676. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  42677. e[r].reset();
  42678. for (r = 0; r !== n; ++r)
  42679. i[r].useCount = 0;
  42680. return this
  42681. },
  42682. update: function(e) {
  42683. e *= this.timeScale;
  42684. 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) {
  42685. var s = t[a];
  42686. s.enabled && s._update(n, e, r, o)
  42687. }
  42688. var l = this._bindings
  42689. , c = this._nActiveBindings;
  42690. for (a = 0; a !== c; ++a)
  42691. l[a].apply(o);
  42692. return this
  42693. },
  42694. getRoot: function() {
  42695. return this._root
  42696. },
  42697. uncacheClip: function(e) {
  42698. var t = this._actions
  42699. , i = e.name
  42700. , n = this._actionsByClip
  42701. , r = n[i];
  42702. if (void 0 !== r) {
  42703. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  42704. var l = o[a];
  42705. this._deactivateAction(l);
  42706. var c = l._cacheIndex
  42707. , h = t[t.length - 1];
  42708. l._cacheIndex = null,
  42709. l._byClipCacheIndex = null,
  42710. t[h._cacheIndex = c] = h,
  42711. t.pop(),
  42712. this._removeInactiveBindingsForAction(l)
  42713. }
  42714. delete n[i]
  42715. }
  42716. },
  42717. uncacheRoot: function(e) {
  42718. var t = e.uuid
  42719. , i = this._actionsByClip;
  42720. for (var n in i) {
  42721. var r = i[n].actionByRoot[t];
  42722. void 0 !== r && (this._deactivateAction(r),
  42723. this._removeInactiveAction(r))
  42724. }
  42725. var o = this._bindingsByRootAndName[t];
  42726. if (void 0 !== o)
  42727. for (var a in o) {
  42728. var s = o[a];
  42729. s.restoreOriginalState(),
  42730. this._removeInactiveBinding(s)
  42731. }
  42732. },
  42733. uncacheAction: function(e, t) {
  42734. var i = this.existingAction(e, t);
  42735. null !== i && (this._deactivateAction(i),
  42736. this._removeInactiveAction(i))
  42737. }
  42738. },
  42739. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  42740. Ci.AnimationMixer._Action = function(e, t, i) {
  42741. this._mixer = e,
  42742. this._clip = t,
  42743. this._localRoot = i || null;
  42744. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  42745. endingStart: Ci.ZeroCurvatureEnding,
  42746. endingEnd: Ci.ZeroCurvatureEnding
  42747. }, s = 0; s !== r; ++s) {
  42748. var l = n[s].createInterpolant(null);
  42749. (o[s] = l).settings = a
  42750. }
  42751. this._interpolantSettings = a,
  42752. this._interpolants = o,
  42753. this._propertyBindings = new Array(r),
  42754. this._cacheIndex = null,
  42755. this._byClipCacheIndex = null,
  42756. this._timeScaleInterpolant = null,
  42757. this._weightInterpolant = null,
  42758. this.loop = Ci.LoopRepeat,
  42759. this._loopCount = -1,
  42760. this._startTime = null,
  42761. this.time = 0,
  42762. this.timeScale = 1,
  42763. this._effectiveTimeScale = 1,
  42764. this.weight = 1,
  42765. this._effectiveWeight = 1,
  42766. this.repetitions = 1 / 0,
  42767. this.paused = !1,
  42768. this.enabled = !0,
  42769. this.clampWhenFinished = !1,
  42770. this.zeroSlopeAtStart = !0,
  42771. this.zeroSlopeAtEnd = !0
  42772. }
  42773. ,
  42774. Ci.AnimationMixer._Action.prototype = {
  42775. constructor: Ci.AnimationMixer._Action,
  42776. play: function() {
  42777. return this._mixer._activateAction(this),
  42778. this
  42779. },
  42780. stop: function() {
  42781. return this._mixer._deactivateAction(this),
  42782. this.reset()
  42783. },
  42784. reset: function() {
  42785. return this.paused = !1,
  42786. this.enabled = !0,
  42787. this.time = 0,
  42788. this._loopCount = -1,
  42789. this._startTime = null,
  42790. this.stopFading().stopWarping()
  42791. },
  42792. isRunning: function() {
  42793. return this._startTime,
  42794. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  42795. },
  42796. isScheduled: function() {
  42797. return this._mixer._isActiveAction(this)
  42798. },
  42799. startAt: function(e) {
  42800. return this._startTime = e,
  42801. this
  42802. },
  42803. setLoop: function(e, t) {
  42804. return this.loop = e,
  42805. this.repetitions = t,
  42806. this
  42807. },
  42808. setEffectiveWeight: function(e) {
  42809. return this.weight = e,
  42810. this._effectiveWeight = this.enabled ? e : 0,
  42811. this.stopFading()
  42812. },
  42813. getEffectiveWeight: function() {
  42814. return this._effectiveWeight
  42815. },
  42816. fadeIn: function(e) {
  42817. return this._scheduleFading(e, 0, 1)
  42818. },
  42819. fadeOut: function(e) {
  42820. return this._scheduleFading(e, 1, 0)
  42821. },
  42822. crossFadeFrom: function(e, t, i) {
  42823. if (this._mixer,
  42824. e.fadeOut(t),
  42825. this.fadeIn(t),
  42826. i) {
  42827. var n = this._clip.duration
  42828. , r = e._clip.duration
  42829. , o = r / n
  42830. , a = n / r;
  42831. e.warp(1, o, t),
  42832. this.warp(a, 1, t)
  42833. }
  42834. return this
  42835. },
  42836. crossFadeTo: function(e, t, i) {
  42837. return e.crossFadeFrom(this, t, i)
  42838. },
  42839. stopFading: function() {
  42840. var e = this._weightInterpolant;
  42841. return null !== e && (this._weightInterpolant = null,
  42842. this._mixer._takeBackControlInterpolant(e)),
  42843. this
  42844. },
  42845. setEffectiveTimeScale: function(e) {
  42846. return this.timeScale = e,
  42847. this._effectiveTimeScale = this.paused ? 0 : e,
  42848. this.stopWarping()
  42849. },
  42850. getEffectiveTimeScale: function() {
  42851. return this._effectiveTimeScale
  42852. },
  42853. setDuration: function(e) {
  42854. return this.timeScale = this._clip.duration / e,
  42855. this.stopWarping()
  42856. },
  42857. syncWith: function(e) {
  42858. return this.time = e.time,
  42859. this.timeScale = e.timeScale,
  42860. this.stopWarping()
  42861. },
  42862. halt: function(e) {
  42863. return this.warp(this._currentTimeScale, 0, e)
  42864. },
  42865. warp: function(e, t, i) {
  42866. var n = this._mixer
  42867. , r = n.time
  42868. , o = this._timeScaleInterpolant
  42869. , a = this.timeScale;
  42870. null === o && (o = n._lendControlInterpolant(),
  42871. this._timeScaleInterpolant = o);
  42872. var s = o.parameterPositions
  42873. , l = o.sampleValues;
  42874. return s[0] = r,
  42875. s[1] = r + i,
  42876. l[0] = e / a,
  42877. l[1] = t / a,
  42878. this
  42879. },
  42880. stopWarping: function() {
  42881. var e = this._timeScaleInterpolant;
  42882. return null !== e && (this._timeScaleInterpolant = null,
  42883. this._mixer._takeBackControlInterpolant(e)),
  42884. this
  42885. },
  42886. getMixer: function() {
  42887. return this._mixer
  42888. },
  42889. getClip: function() {
  42890. return this._clip
  42891. },
  42892. getRoot: function() {
  42893. return this._localRoot || this._mixer._root
  42894. },
  42895. _update: function(e, t, i, n) {
  42896. var r = this._startTime;
  42897. if (null !== r) {
  42898. var o = (e - r) * i;
  42899. if (o < 0 || 0 === i)
  42900. return;
  42901. this._startTime = null,
  42902. t = i * o
  42903. }
  42904. t *= this._updateTimeScale(e);
  42905. var a = this._updateTime(t)
  42906. , s = this._updateWeight(e);
  42907. if (0 < s)
  42908. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  42909. l[h].evaluate(a),
  42910. c[h].accumulate(n, s)
  42911. },
  42912. _updateWeight: function(e) {
  42913. var t = 0;
  42914. if (this.enabled) {
  42915. t = this.weight;
  42916. var i = this._weightInterpolant;
  42917. if (null !== i) {
  42918. var n = i.evaluate(e)[0];
  42919. t *= n,
  42920. e > i.parameterPositions[1] && (this.stopFading(),
  42921. 0 === n && (this.enabled = !1))
  42922. }
  42923. }
  42924. return this._effectiveWeight = t
  42925. },
  42926. _updateTimeScale: function(e) {
  42927. var t = 0;
  42928. if (!this.paused) {
  42929. t = this.timeScale;
  42930. var i = this._timeScaleInterpolant;
  42931. if (null !== i)
  42932. t *= i.evaluate(e)[0],
  42933. e > i.parameterPositions[1] && (this.stopWarping(),
  42934. 0 === t ? this.pause = !0 : this.timeScale = t)
  42935. }
  42936. return this._effectiveTimeScale = t
  42937. },
  42938. _updateTime: function(e) {
  42939. var t = this.time + e;
  42940. if (0 === e)
  42941. return t;
  42942. var i = this._clip.duration
  42943. , n = this.loop
  42944. , r = this._loopCount
  42945. , o = !1;
  42946. switch (n) {
  42947. case Ci.LoopOnce:
  42948. if (-1 === r && (this.loopCount = 0,
  42949. this._setEndings(!0, !0, !1)),
  42950. i <= t)
  42951. t = i;
  42952. else {
  42953. if (!(t < 0))
  42954. break;
  42955. t = 0
  42956. }
  42957. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  42958. this._mixer.dispatchEvent({
  42959. type: "finished",
  42960. action: this,
  42961. direction: e < 0 ? -1 : 1
  42962. });
  42963. break;
  42964. case Ci.LoopPingPong:
  42965. o = !0;
  42966. case Ci.LoopRepeat:
  42967. if (-1 === r && (0 < e ? (r = 0,
  42968. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  42969. i <= t || t < 0) {
  42970. var a = Math.floor(t / i);
  42971. t -= i * a,
  42972. r += Math.abs(a);
  42973. var s = this.repetitions - r;
  42974. if (s < 0) {
  42975. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  42976. t = 0 < e ? i : 0,
  42977. this._mixer.dispatchEvent({
  42978. type: "finished",
  42979. action: this,
  42980. direction: 0 < e ? 1 : -1
  42981. });
  42982. break
  42983. }
  42984. if (0 == s) {
  42985. var l = e < 0;
  42986. this._setEndings(l, !l, o)
  42987. } else
  42988. this._setEndings(!1, !1, o);
  42989. this._loopCount = r,
  42990. this._mixer.dispatchEvent({
  42991. type: "loop",
  42992. action: this,
  42993. loopDelta: a
  42994. })
  42995. }
  42996. if (n === Ci.LoopPingPong && 1 == (1 & r))
  42997. return i - (this.time = t)
  42998. }
  42999. return this.time = t
  43000. },
  43001. _setEndings: function(e, t, i) {
  43002. var n = this._interpolantSettings;
  43003. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43004. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43005. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43006. },
  43007. _scheduleFading: function(e, t, i) {
  43008. var n = this._mixer
  43009. , r = n.time
  43010. , o = this._weightInterpolant;
  43011. null === o && (o = n._lendControlInterpolant(),
  43012. this._weightInterpolant = o);
  43013. var a = o.parameterPositions
  43014. , s = o.sampleValues;
  43015. return a[0] = r,
  43016. s[0] = t,
  43017. a[1] = r + e,
  43018. s[1] = i,
  43019. this
  43020. }
  43021. },
  43022. Object.assign(Ci.AnimationMixer.prototype, {
  43023. _bindAction: function(e, t) {
  43024. var i = e._localRoot || this._root
  43025. , n = e._clip.tracks
  43026. , r = n.length
  43027. , o = e._propertyBindings
  43028. , a = e._interpolants
  43029. , s = i.uuid
  43030. , l = this._bindingsByRootAndName
  43031. , c = l[s];
  43032. void 0 === c && (c = {},
  43033. l[s] = c);
  43034. for (var h = 0; h !== r; ++h) {
  43035. var u = n[h]
  43036. , d = u.name
  43037. , p = c[d];
  43038. if (void 0 !== p)
  43039. o[h] = p;
  43040. else {
  43041. if (void 0 !== (p = o[h])) {
  43042. null === p._cacheIndex && (++p.referenceCount,
  43043. this._addInactiveBinding(p, s, d));
  43044. continue
  43045. }
  43046. var f = t && t._propertyBindings[h].binding.parsedPath;
  43047. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43048. this._addInactiveBinding(p, s, d),
  43049. o[h] = p
  43050. }
  43051. a[h].resultBuffer = p.buffer
  43052. }
  43053. },
  43054. _activateAction: function(e) {
  43055. if (!this._isActiveAction(e)) {
  43056. if (null === e._cacheIndex) {
  43057. var t = (e._localRoot || this._root).uuid
  43058. , i = e._clip.name
  43059. , n = this._actionsByClip[i];
  43060. this._bindAction(e, n && n.knownActions[0]),
  43061. this._addInactiveAction(e, i, t)
  43062. }
  43063. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43064. var s = r[o];
  43065. 0 == s.useCount++ && (this._lendBinding(s),
  43066. s.saveOriginalState())
  43067. }
  43068. this._lendAction(e)
  43069. }
  43070. },
  43071. _deactivateAction: function(e) {
  43072. if (this._isActiveAction(e)) {
  43073. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43074. var r = t[i];
  43075. 0 == --r.useCount && (r.restoreOriginalState(),
  43076. this._takeBackBinding(r))
  43077. }
  43078. this._takeBackAction(e)
  43079. }
  43080. },
  43081. _initMemoryManager: function() {
  43082. this._actions = [],
  43083. this._nActiveActions = 0,
  43084. this._actionsByClip = {},
  43085. this._bindings = [],
  43086. this._nActiveBindings = 0,
  43087. this._bindingsByRootAndName = {},
  43088. this._controlInterpolants = [],
  43089. this._nActiveControlInterpolants = 0;
  43090. var e = this;
  43091. this.stats = {
  43092. actions: {
  43093. get total() {
  43094. return e._actions.length
  43095. },
  43096. get inUse() {
  43097. return e._nActiveActions
  43098. }
  43099. },
  43100. bindings: {
  43101. get total() {
  43102. return e._bindings.length
  43103. },
  43104. get inUse() {
  43105. return e._nActiveBindings
  43106. }
  43107. },
  43108. controlInterpolants: {
  43109. get total() {
  43110. return e._controlInterpolants.length
  43111. },
  43112. get inUse() {
  43113. return e._nActiveControlInterpolants
  43114. }
  43115. }
  43116. }
  43117. },
  43118. _isActiveAction: function(e) {
  43119. var t = e._cacheIndex;
  43120. return null !== t && t < this._nActiveActions
  43121. },
  43122. _addInactiveAction: function(e, t, i) {
  43123. var n = this._actions
  43124. , r = this._actionsByClip
  43125. , o = r[t];
  43126. if (void 0 === o)
  43127. o = {
  43128. knownActions: [e],
  43129. actionByRoot: {}
  43130. },
  43131. e._byClipCacheIndex = 0,
  43132. r[t] = o;
  43133. else {
  43134. var a = o.knownActions;
  43135. e._byClipCacheIndex = a.length,
  43136. a.push(e)
  43137. }
  43138. e._cacheIndex = n.length,
  43139. n.push(e),
  43140. o.actionByRoot[i] = e
  43141. },
  43142. _removeInactiveAction: function(e) {
  43143. var t = this._actions
  43144. , i = t[t.length - 1]
  43145. , n = e._cacheIndex;
  43146. t[i._cacheIndex = n] = i,
  43147. t.pop(),
  43148. e._cacheIndex = null;
  43149. var r = e._clip.name
  43150. , o = this._actionsByClip
  43151. , a = o[r]
  43152. , s = a.knownActions
  43153. , l = s[s.length - 1]
  43154. , c = e._byClipCacheIndex;
  43155. s[l._byClipCacheIndex = c] = l,
  43156. s.pop(),
  43157. e._byClipCacheIndex = null,
  43158. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43159. 0 === s.length && delete o[r],
  43160. this._removeInactiveBindingsForAction(e)
  43161. },
  43162. _removeInactiveBindingsForAction: function(e) {
  43163. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43164. var r = t[i];
  43165. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43166. }
  43167. },
  43168. _lendAction: function(e) {
  43169. var t = this._actions
  43170. , i = e._cacheIndex
  43171. , n = this._nActiveActions++
  43172. , r = t[n];
  43173. t[e._cacheIndex = n] = e,
  43174. t[r._cacheIndex = i] = r
  43175. },
  43176. _takeBackAction: function(e) {
  43177. var t = this._actions
  43178. , i = e._cacheIndex
  43179. , n = --this._nActiveActions
  43180. , r = t[n];
  43181. t[e._cacheIndex = n] = e,
  43182. t[r._cacheIndex = i] = r
  43183. },
  43184. _addInactiveBinding: function(e, t, i) {
  43185. var n = this._bindingsByRootAndName
  43186. , r = n[t]
  43187. , o = this._bindings;
  43188. void 0 === r && (r = {},
  43189. n[t] = r),
  43190. (r[i] = e)._cacheIndex = o.length,
  43191. o.push(e)
  43192. },
  43193. _removeInactiveBinding: function(e) {
  43194. var t = this._bindings
  43195. , i = e.binding
  43196. , n = i.rootNode.uuid
  43197. , r = i.path
  43198. , o = this._bindingsByRootAndName
  43199. , a = o[n]
  43200. , s = t[t.length - 1]
  43201. , l = e._cacheIndex;
  43202. t[s._cacheIndex = l] = s,
  43203. t.pop(),
  43204. delete a[r];
  43205. e: {
  43206. for (var c in a)
  43207. break e;
  43208. delete o[n]
  43209. }
  43210. },
  43211. _lendBinding: function(e) {
  43212. var t = this._bindings
  43213. , i = e._cacheIndex
  43214. , n = this._nActiveBindings++
  43215. , r = t[n];
  43216. t[e._cacheIndex = n] = e,
  43217. t[r._cacheIndex = i] = r
  43218. },
  43219. _takeBackBinding: function(e) {
  43220. var t = this._bindings
  43221. , i = e._cacheIndex
  43222. , n = --this._nActiveBindings
  43223. , r = t[n];
  43224. t[e._cacheIndex = n] = e,
  43225. t[r._cacheIndex = i] = r
  43226. },
  43227. _lendControlInterpolant: function() {
  43228. var e = this._controlInterpolants
  43229. , t = this._nActiveControlInterpolants++
  43230. , i = e[t];
  43231. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43232. i
  43233. },
  43234. _takeBackControlInterpolant: function(e) {
  43235. var t = this._controlInterpolants
  43236. , i = e.__cacheIndex
  43237. , n = --this._nActiveControlInterpolants
  43238. , r = t[n];
  43239. t[e.__cacheIndex = n] = e,
  43240. t[r.__cacheIndex = i] = r
  43241. },
  43242. _controlInterpolantsResultBuffer: new Float32Array(1)
  43243. }),
  43244. Ci.AnimationObjectGroup = function(e) {
  43245. this.uuid = Ci.Math.generateUUID(),
  43246. this._objects = Array.prototype.slice.call(arguments),
  43247. this.nCachedObjects_ = 0;
  43248. var t = {};
  43249. this._indicesByUUID = t;
  43250. for (var i = 0, n = arguments.length; i !== n; ++i)
  43251. t[arguments[i].uuid] = i;
  43252. this._paths = [],
  43253. this._parsedPaths = [],
  43254. this._bindings = [],
  43255. this._bindingsIndicesByPath = {};
  43256. var r = this;
  43257. this.stats = {
  43258. objects: {
  43259. get total() {
  43260. return r._objects.length
  43261. },
  43262. get inUse() {
  43263. return this.total - r.nCachedObjects_
  43264. }
  43265. },
  43266. get bindingsPerObject() {
  43267. return r._bindings.length
  43268. }
  43269. }
  43270. }
  43271. ,
  43272. Ci.AnimationObjectGroup.prototype = {
  43273. constructor: Ci.AnimationObjectGroup,
  43274. add: function(e) {
  43275. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._paths, a = this._parsedPaths, s = this._bindings, l = s.length, c = 0, h = arguments.length; c !== h; ++c) {
  43276. var u = arguments[c]
  43277. , d = u.uuid
  43278. , p = r[d];
  43279. if (void 0 === p) {
  43280. p = i++,
  43281. r[d] = p,
  43282. t.push(u);
  43283. for (var f = 0, g = l; f !== g; ++f)
  43284. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43285. } else if (p < n) {
  43286. var m = t[p]
  43287. , v = --n
  43288. , y = t[v];
  43289. t[r[y.uuid] = p] = y,
  43290. t[r[d] = v] = u;
  43291. for (f = 0,
  43292. g = l; f !== g; ++f) {
  43293. var A = s[f]
  43294. , C = A[v]
  43295. , I = A[p];
  43296. A[p] = C,
  43297. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43298. A[v] = I
  43299. }
  43300. } else
  43301. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43302. }
  43303. this.nCachedObjects_ = n
  43304. },
  43305. remove: function(e) {
  43306. for (var t = this._objects, i = (t.length,
  43307. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43308. var l = arguments[a]
  43309. , c = l.uuid
  43310. , h = n[c];
  43311. if (void 0 !== h && i <= h) {
  43312. var u = i++
  43313. , d = t[u];
  43314. t[n[d.uuid] = h] = d,
  43315. t[n[c] = u] = l;
  43316. for (var p = 0, f = o; p !== f; ++p) {
  43317. var g = r[p]
  43318. , m = g[u]
  43319. , v = g[h];
  43320. g[h] = m,
  43321. g[u] = v
  43322. }
  43323. }
  43324. }
  43325. this.nCachedObjects_ = i
  43326. },
  43327. uncache: function(e) {
  43328. 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) {
  43329. var c = arguments[s].uuid
  43330. , h = r[c];
  43331. if (void 0 !== h)
  43332. if (delete r[c],
  43333. h < n) {
  43334. var u = --n
  43335. , d = t[u]
  43336. , p = t[y = --i];
  43337. t[r[d.uuid] = h] = d,
  43338. t[r[p.uuid] = u] = p,
  43339. t.pop();
  43340. for (var f = 0, g = a; f !== g; ++f) {
  43341. var m = (A = o[f])[u]
  43342. , v = A[y];
  43343. A[h] = m,
  43344. A[u] = v,
  43345. A.pop()
  43346. }
  43347. } else {
  43348. var y;
  43349. t[r[(p = t[y = --i]).uuid] = h] = p,
  43350. t.pop();
  43351. for (f = 0,
  43352. g = a; f !== g; ++f) {
  43353. var A;
  43354. (A = o[f])[h] = A[y],
  43355. A.pop()
  43356. }
  43357. }
  43358. }
  43359. this.nCachedObjects_ = n
  43360. },
  43361. subscribe_: function(e, t) {
  43362. var i = this._bindingsIndicesByPath
  43363. , n = i[e]
  43364. , r = this._bindings;
  43365. if (void 0 !== n)
  43366. return r[n];
  43367. var o = this._paths
  43368. , a = this._parsedPaths
  43369. , s = this._objects
  43370. , l = s.length
  43371. , c = this.nCachedObjects_
  43372. , h = new Array(l);
  43373. n = r.length,
  43374. i[e] = n,
  43375. o.push(e),
  43376. a.push(t),
  43377. r.push(h);
  43378. for (var u = c, d = s.length; u !== d; ++u) {
  43379. var p = s[u];
  43380. h[u] = new Ci.PropertyBinding(p,e,t)
  43381. }
  43382. return h
  43383. },
  43384. unsubscribe_: function(e) {
  43385. var t = this._bindingsIndicesByPath
  43386. , i = t[e];
  43387. if (void 0 !== i) {
  43388. var n = this._paths
  43389. , r = this._parsedPaths
  43390. , o = this._bindings
  43391. , a = o.length - 1
  43392. , s = o[a];
  43393. o[t[e[a]] = i] = s,
  43394. o.pop(),
  43395. r[i] = r[a],
  43396. r.pop(),
  43397. n[i] = n[a],
  43398. n.pop()
  43399. }
  43400. }
  43401. },
  43402. Ci.AnimationUtils = {
  43403. arraySlice: function(e, t, i) {
  43404. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43405. },
  43406. convertArray: function(e, t, i) {
  43407. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43408. },
  43409. isTypedArray: function(e) {
  43410. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43411. },
  43412. getKeyframeOrder: function(i) {
  43413. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43414. t[n] = n;
  43415. return t.sort(function(e, t) {
  43416. return i[e] - i[t]
  43417. }),
  43418. t
  43419. },
  43420. sortedArray: function(e, t, i) {
  43421. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43422. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43423. r[a++] = e[s + l];
  43424. return r
  43425. },
  43426. flattenJSON: function(e, t, i, n) {
  43427. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43428. o = e[r++];
  43429. if (void 0 !== o) {
  43430. var a = o[n];
  43431. if (void 0 !== a)
  43432. if (Array.isArray(a))
  43433. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43434. i.push.apply(i, a)),
  43435. void 0 !== (o = e[r++]); )
  43436. ;
  43437. else if (void 0 !== a.toArray)
  43438. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43439. a.toArray(i, i.length)),
  43440. void 0 !== (o = e[r++]); )
  43441. ;
  43442. else
  43443. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43444. i.push(a)),
  43445. void 0 !== (o = e[r++]); )
  43446. ;
  43447. }
  43448. }
  43449. },
  43450. Ci.KeyframeTrack = function(e, t, i, n) {
  43451. if (void 0 === e)
  43452. throw new Error("track name is undefined");
  43453. if (void 0 === t || 0 === t.length)
  43454. throw new Error("no keyframes in track named " + e);
  43455. this.name = e,
  43456. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43457. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43458. this.setInterpolation(n || this.DefaultInterpolation),
  43459. this.validate(),
  43460. this.optimize()
  43461. }
  43462. ,
  43463. Ci.KeyframeTrack.prototype = {
  43464. constructor: Ci.KeyframeTrack,
  43465. TimeBufferType: Float32Array,
  43466. ValueBufferType: Float32Array,
  43467. DefaultInterpolation: Ci.InterpolateLinear,
  43468. InterpolantFactoryMethodDiscrete: function(e) {
  43469. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43470. },
  43471. InterpolantFactoryMethodLinear: function(e) {
  43472. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43473. },
  43474. InterpolantFactoryMethodSmooth: function(e) {
  43475. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43476. },
  43477. setInterpolation: function(e) {
  43478. var t = void 0;
  43479. switch (e) {
  43480. case Ci.InterpolateDiscrete:
  43481. t = this.InterpolantFactoryMethodDiscrete;
  43482. break;
  43483. case Ci.InterpolateLinear:
  43484. t = this.InterpolantFactoryMethodLinear;
  43485. break;
  43486. case Ci.InterpolateSmooth:
  43487. t = this.InterpolantFactoryMethodSmooth
  43488. }
  43489. if (void 0 !== t)
  43490. this.createInterpolant = t;
  43491. else {
  43492. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43493. if (void 0 === this.createInterpolant) {
  43494. if (e === this.DefaultInterpolation)
  43495. throw new Error(i);
  43496. this.setInterpolation(this.DefaultInterpolation)
  43497. }
  43498. console.warn(i)
  43499. }
  43500. },
  43501. getInterpolation: function() {
  43502. switch (this.createInterpolant) {
  43503. case this.InterpolantFactoryMethodDiscrete:
  43504. return Ci.InterpolateDiscrete;
  43505. case this.InterpolantFactoryMethodLinear:
  43506. return Ci.InterpolateLinear;
  43507. case this.InterpolantFactoryMethodSmooth:
  43508. return Ci.InterpolateSmooth
  43509. }
  43510. },
  43511. getValueSize: function() {
  43512. return this.values.length / this.times.length
  43513. },
  43514. shift: function(e) {
  43515. if (0 !== e)
  43516. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43517. t[i] += e;
  43518. return this
  43519. },
  43520. scale: function(e) {
  43521. if (1 !== e)
  43522. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43523. t[i] *= e;
  43524. return this
  43525. },
  43526. trim: function(e, t) {
  43527. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43528. ++r;
  43529. for (; -1 !== o && i[o] > t; )
  43530. --o;
  43531. if (++o,
  43532. 0 !== r || o !== n) {
  43533. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43534. var a = this.getValueSize();
  43535. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43536. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43537. }
  43538. return this
  43539. },
  43540. validate: function() {
  43541. var e = !0
  43542. , t = this.getValueSize();
  43543. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43544. e = !1);
  43545. var i = this.times
  43546. , n = this.values
  43547. , r = i.length;
  43548. 0 === r && (console.error("track is empty", this),
  43549. e = !1);
  43550. for (var o = null, a = 0; a !== r; a++) {
  43551. var s = i[a];
  43552. if ("number" == typeof s && isNaN(s)) {
  43553. console.error("time is not a valid number", this, a, s),
  43554. e = !1;
  43555. break
  43556. }
  43557. if (null !== o && s < o) {
  43558. console.error("out of order keys", this, a, s, o),
  43559. e = !1;
  43560. break
  43561. }
  43562. o = s
  43563. }
  43564. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43565. a = 0;
  43566. for (var l = n.length; a !== l; ++a) {
  43567. var c = n[a];
  43568. if (isNaN(c)) {
  43569. console.error("value is not a valid number", this, a, c),
  43570. e = !1;
  43571. break
  43572. }
  43573. }
  43574. }
  43575. return e
  43576. },
  43577. optimize: function() {
  43578. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  43579. var a = !1
  43580. , s = e[r];
  43581. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  43582. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  43583. var d = t[l + u];
  43584. if (d !== t[c + u] || d !== t[h + u]) {
  43585. a = !0;
  43586. break
  43587. }
  43588. }
  43589. if (a) {
  43590. if (r !== n) {
  43591. e[n] = e[r];
  43592. var p = r * i
  43593. , f = n * i;
  43594. for (u = 0; u !== i; ++u)
  43595. t[f + u] = t[p + u]
  43596. }
  43597. ++n
  43598. }
  43599. }
  43600. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  43601. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  43602. this
  43603. }
  43604. },
  43605. Object.assign(Ci.KeyframeTrack, {
  43606. parse: function(e) {
  43607. if (void 0 === e.type)
  43608. throw new Error("track type undefined, can not parse");
  43609. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  43610. if (void 0 === e.times) {
  43611. console.warn("legacy JSON format detected, converting");
  43612. var i = []
  43613. , n = [];
  43614. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  43615. e.times = i,
  43616. e.values = n
  43617. }
  43618. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  43619. },
  43620. toJSON: function(e) {
  43621. var t, i = e.constructor;
  43622. if (void 0 !== i.toJSON)
  43623. t = i.toJSON(e);
  43624. else {
  43625. t = {
  43626. name: e.name,
  43627. times: Ci.AnimationUtils.convertArray(e.times, Array),
  43628. values: Ci.AnimationUtils.convertArray(e.values, Array)
  43629. };
  43630. var n = e.getInterpolation();
  43631. n !== e.DefaultInterpolation && (t.interpolation = n)
  43632. }
  43633. return t.type = e.ValueTypeName,
  43634. t
  43635. },
  43636. _getTrackTypeForValueTypeName: function(e) {
  43637. switch (e.toLowerCase()) {
  43638. case "scalar":
  43639. case "double":
  43640. case "float":
  43641. case "number":
  43642. case "integer":
  43643. return Ci.NumberKeyframeTrack;
  43644. case "vector":
  43645. case "vector2":
  43646. case "vector3":
  43647. case "vector4":
  43648. return Ci.VectorKeyframeTrack;
  43649. case "color":
  43650. return Ci.ColorKeyframeTrack;
  43651. case "quaternion":
  43652. return Ci.QuaternionKeyframeTrack;
  43653. case "bool":
  43654. case "boolean":
  43655. return Ci.BooleanKeyframeTrack;
  43656. case "string":
  43657. return Ci.StringKeyframeTrack
  43658. }
  43659. throw new Error("Unsupported typeName: " + e)
  43660. }
  43661. }),
  43662. Ci.PropertyBinding = function(e, t, i) {
  43663. this.path = t,
  43664. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  43665. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  43666. this.rootNode = e
  43667. }
  43668. ,
  43669. Ci.PropertyBinding.prototype = {
  43670. constructor: Ci.PropertyBinding,
  43671. getValue: function(e, t) {
  43672. this.bind(),
  43673. this.getValue(e, t)
  43674. },
  43675. setValue: function(e, t) {
  43676. this.bind(),
  43677. this.setValue(e, t)
  43678. },
  43679. bind: function() {
  43680. var e = this.node
  43681. , t = this.parsedPath
  43682. , i = t.objectName
  43683. , n = t.propertyName
  43684. , r = t.propertyIndex;
  43685. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  43686. this.node = e),
  43687. this.getValue = this._getValue_unavailable,
  43688. this.setValue = this._setValue_unavailable,
  43689. e) {
  43690. if (i) {
  43691. var o = t.objectIndex;
  43692. switch (i) {
  43693. case "materials":
  43694. if (!e.material)
  43695. return void console.error(" can not bind to material as node does not have a material", this);
  43696. if (!e.material.materials)
  43697. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  43698. e = e.material.materials;
  43699. break;
  43700. case "bones":
  43701. if (!e.skeleton)
  43702. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  43703. e = e.skeleton.bones;
  43704. for (var a = 0; a < e.length; a++)
  43705. if (e[a].name === o) {
  43706. o = a;
  43707. break
  43708. }
  43709. break;
  43710. default:
  43711. if (void 0 === e[i])
  43712. return void console.error(" can not bind to objectName of node, undefined", this);
  43713. e = e[i]
  43714. }
  43715. if (void 0 !== o) {
  43716. if (void 0 === e[o])
  43717. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  43718. e = e[o]
  43719. }
  43720. }
  43721. var s = e[n];
  43722. if (s) {
  43723. var l = this.Versioning.None;
  43724. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  43725. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  43726. this.targetObject = e);
  43727. var c = this.BindingType.Direct;
  43728. if (void 0 !== r) {
  43729. if ("morphTargetInfluences" === n) {
  43730. if (!e.geometry)
  43731. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  43732. if (!e.geometry.morphTargets)
  43733. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  43734. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  43735. if (e.geometry.morphTargets[a].name === r) {
  43736. r = a;
  43737. break
  43738. }
  43739. }
  43740. c = this.BindingType.ArrayElement,
  43741. this.resolvedProperty = s,
  43742. this.propertyIndex = r
  43743. } else
  43744. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  43745. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  43746. this.resolvedProperty = s) : this.propertyName = n;
  43747. this.getValue = this.GetterByBindingType[c],
  43748. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  43749. } else {
  43750. var h = t.nodeName;
  43751. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  43752. }
  43753. } else
  43754. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  43755. },
  43756. unbind: function() {
  43757. this.node = null,
  43758. this.getValue = this._getValue_unbound,
  43759. this.setValue = this._setValue_unbound
  43760. }
  43761. },
  43762. Object.assign(Ci.PropertyBinding.prototype, {
  43763. _getValue_unavailable: function() {},
  43764. _setValue_unavailable: function() {},
  43765. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  43766. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  43767. BindingType: {
  43768. Direct: 0,
  43769. EntireArray: 1,
  43770. ArrayElement: 2,
  43771. HasFromToArray: 3
  43772. },
  43773. Versioning: {
  43774. None: 0,
  43775. NeedsUpdate: 1,
  43776. MatrixWorldNeedsUpdate: 2
  43777. },
  43778. GetterByBindingType: [function(e, t) {
  43779. e[t] = this.node[this.propertyName]
  43780. }
  43781. , function(e, t) {
  43782. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43783. e[t++] = i[n]
  43784. }
  43785. , function(e, t) {
  43786. e[t] = this.resolvedProperty[this.propertyIndex]
  43787. }
  43788. , function(e, t) {
  43789. this.resolvedProperty.toArray(e, t)
  43790. }
  43791. ],
  43792. SetterByBindingTypeAndVersioning: [[function(e, t) {
  43793. this.node[this.propertyName] = e[t]
  43794. }
  43795. , function(e, t) {
  43796. this.node[this.propertyName] = e[t],
  43797. this.targetObject.needsUpdate = !0
  43798. }
  43799. , function(e, t) {
  43800. this.node[this.propertyName] = e[t],
  43801. this.targetObject.matrixWorldNeedsUpdate = !0
  43802. }
  43803. ], [function(e, t) {
  43804. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43805. i[n] = e[t++]
  43806. }
  43807. , function(e, t) {
  43808. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43809. i[n] = e[t++];
  43810. this.targetObject.needsUpdate = !0
  43811. }
  43812. , function(e, t) {
  43813. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43814. i[n] = e[t++];
  43815. this.targetObject.matrixWorldNeedsUpdate = !0
  43816. }
  43817. ], [function(e, t) {
  43818. this.resolvedProperty[this.propertyIndex] = e[t]
  43819. }
  43820. , function(e, t) {
  43821. this.resolvedProperty[this.propertyIndex] = e[t],
  43822. this.targetObject.needsUpdate = !0
  43823. }
  43824. , function(e, t) {
  43825. this.resolvedProperty[this.propertyIndex] = e[t],
  43826. this.targetObject.matrixWorldNeedsUpdate = !0
  43827. }
  43828. ], [function(e, t) {
  43829. this.resolvedProperty.fromArray(e, t)
  43830. }
  43831. , function(e, t) {
  43832. this.resolvedProperty.fromArray(e, t),
  43833. this.targetObject.needsUpdate = !0
  43834. }
  43835. , function(e, t) {
  43836. this.resolvedProperty.fromArray(e, t),
  43837. this.targetObject.matrixWorldNeedsUpdate = !0
  43838. }
  43839. ]]
  43840. }),
  43841. Ci.PropertyBinding.Composite = function(e, t, i) {
  43842. var n = i || Ci.PropertyBinding.parseTrackName(t);
  43843. this._targetGroup = e,
  43844. this._bindings = e.subscribe_(t, n)
  43845. }
  43846. ,
  43847. Ci.PropertyBinding.Composite.prototype = {
  43848. constructor: Ci.PropertyBinding.Composite,
  43849. getValue: function(e, t) {
  43850. this.bind();
  43851. var i = this._targetGroup.nCachedObjects_
  43852. , n = this._bindings[i];
  43853. void 0 !== n && n.getValue(e, t)
  43854. },
  43855. setValue: function(e, t) {
  43856. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  43857. i[n].setValue(e, t)
  43858. },
  43859. bind: function() {
  43860. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  43861. e[t].bind()
  43862. },
  43863. unbind: function() {
  43864. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  43865. e[t].unbind()
  43866. }
  43867. },
  43868. Ci.PropertyBinding.create = function(e, t, i) {
  43869. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  43870. }
  43871. ,
  43872. Ci.PropertyBinding.parseTrackName = function(e) {
  43873. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  43874. , i = t.exec(e);
  43875. if (!i)
  43876. throw new Error("cannot parse trackName at all: " + e);
  43877. i.index === t.lastIndex && t.lastIndex++;
  43878. var n = {
  43879. nodeName: i[3],
  43880. objectName: i[5],
  43881. objectIndex: i[7],
  43882. propertyName: i[9],
  43883. propertyIndex: i[11]
  43884. };
  43885. if (null === n.propertyName || 0 === n.propertyName.length)
  43886. throw new Error("can not parse propertyName from trackName: " + e);
  43887. return n
  43888. }
  43889. ,
  43890. Ci.PropertyBinding.findNode = function(e, r) {
  43891. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  43892. return e;
  43893. if (e.skeleton) {
  43894. var t = function(e) {
  43895. for (var t = 0; t < e.bones.length; t++) {
  43896. var i = e.bones[t];
  43897. if (i.name === r)
  43898. return i
  43899. }
  43900. return null
  43901. }(e.skeleton);
  43902. if (t)
  43903. return t
  43904. }
  43905. if (e.children) {
  43906. var o = function(e) {
  43907. for (var t = 0; t < e.length; t++) {
  43908. var i = e[t];
  43909. if (i.name === r || i.uuid === r)
  43910. return i;
  43911. var n = o(i.children);
  43912. if (n)
  43913. return n
  43914. }
  43915. return null
  43916. }
  43917. , i = o(e.children);
  43918. if (i)
  43919. return i
  43920. }
  43921. return null
  43922. }
  43923. ,
  43924. Ci.PropertyMixer = function(e, t, i) {
  43925. this.binding = e,
  43926. this.valueSize = i;
  43927. var n, r = Float64Array;
  43928. switch (t) {
  43929. case "quaternion":
  43930. n = this._slerp;
  43931. break;
  43932. case "string":
  43933. case "bool":
  43934. r = Array,
  43935. n = this._select;
  43936. break;
  43937. default:
  43938. n = this._lerp
  43939. }
  43940. this.buffer = new r(4 * i),
  43941. this._mixBufferRegion = n,
  43942. this.cumulativeWeight = 0,
  43943. this.useCount = 0,
  43944. this.referenceCount = 0
  43945. }
  43946. ,
  43947. Ci.PropertyMixer.prototype = {
  43948. constructor: Ci.PropertyMixer,
  43949. accumulate: function(e, t) {
  43950. var i = this.buffer
  43951. , n = this.valueSize
  43952. , r = e * n + n
  43953. , o = this.cumulativeWeight;
  43954. if (0 === o) {
  43955. for (var a = 0; a !== n; ++a)
  43956. i[r + a] = i[a];
  43957. o = t
  43958. } else {
  43959. var s = t / (o += t);
  43960. this._mixBufferRegion(i, r, 0, s, n)
  43961. }
  43962. this.cumulativeWeight = o
  43963. },
  43964. apply: function(e) {
  43965. var t = this.valueSize
  43966. , i = this.buffer
  43967. , n = e * t + t
  43968. , r = this.cumulativeWeight
  43969. , o = this.binding;
  43970. if (this.cumulativeWeight = 0,
  43971. r < 1) {
  43972. var a = 3 * t;
  43973. this._mixBufferRegion(i, n, a, 1 - r, t)
  43974. }
  43975. for (var s = t, l = t + t; s !== l; ++s)
  43976. if (i[s] !== i[s + t]) {
  43977. o.setValue(i, n);
  43978. break
  43979. }
  43980. },
  43981. saveOriginalState: function() {
  43982. var e = this.binding
  43983. , t = this.buffer
  43984. , i = this.valueSize
  43985. , n = 3 * i;
  43986. e.getValue(t, n);
  43987. for (var r = i, o = n; r !== o; ++r)
  43988. t[r] = t[n + r % i];
  43989. this.cumulativeWeight = 0
  43990. },
  43991. restoreOriginalState: function() {
  43992. var e = 3 * this.valueSize;
  43993. this.binding.setValue(this.buffer, e)
  43994. },
  43995. _select: function(e, t, i, n, r) {
  43996. if (.5 <= n)
  43997. for (var o = 0; o !== r; ++o)
  43998. e[t + o] = e[i + o]
  43999. },
  44000. _slerp: function(e, t, i, n, r) {
  44001. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44002. },
  44003. _lerp: function(e, t, i, n, r) {
  44004. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44005. var s = t + a;
  44006. e[s] = e[s] * o + e[i + a] * n
  44007. }
  44008. }
  44009. },
  44010. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44011. Ci.KeyframeTrack.call(this, e, t, i)
  44012. }
  44013. ,
  44014. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44015. constructor: Ci.BooleanKeyframeTrack,
  44016. ValueTypeName: "bool",
  44017. ValueBufferType: Array,
  44018. DefaultInterpolation: Ci.IntepolateDiscrete,
  44019. InterpolantFactoryMethodLinear: void 0,
  44020. InterpolantFactoryMethodSmooth: void 0
  44021. }),
  44022. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44023. Ci.KeyframeTrack.call(this, e, t, i, n)
  44024. }
  44025. ,
  44026. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44027. constructor: Ci.NumberKeyframeTrack,
  44028. ValueTypeName: "number"
  44029. }),
  44030. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44031. Ci.KeyframeTrack.call(this, e, t, i, n)
  44032. }
  44033. ,
  44034. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44035. constructor: Ci.QuaternionKeyframeTrack,
  44036. ValueTypeName: "quaternion",
  44037. DefaultInterpolation: Ci.InterpolateLinear,
  44038. InterpolantFactoryMethodLinear: function(e) {
  44039. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44040. },
  44041. InterpolantFactoryMethodSmooth: void 0
  44042. }),
  44043. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44044. Ci.KeyframeTrack.call(this, e, t, i, n)
  44045. }
  44046. ,
  44047. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44048. constructor: Ci.StringKeyframeTrack,
  44049. ValueTypeName: "string",
  44050. ValueBufferType: Array,
  44051. DefaultInterpolation: Ci.IntepolateDiscrete,
  44052. InterpolantFactoryMethodLinear: void 0,
  44053. InterpolantFactoryMethodSmooth: void 0
  44054. }),
  44055. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44056. Ci.KeyframeTrack.call(this, e, t, i, n)
  44057. }
  44058. ,
  44059. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44060. constructor: Ci.VectorKeyframeTrack,
  44061. ValueTypeName: "vector"
  44062. }),
  44063. Ci.Audio = function(e) {
  44064. Ci.Object3D.call(this),
  44065. this.type = "Audio",
  44066. this.context = e.context,
  44067. this.source = this.context.createBufferSource(),
  44068. this.source.onended = this.onEnded.bind(this),
  44069. this.gain = this.context.createGain(),
  44070. this.gain.connect(e.getInput()),
  44071. this.autoplay = !1,
  44072. this.startTime = 0,
  44073. this.playbackRate = 1,
  44074. this.isPlaying = !1,
  44075. this.hasPlaybackControl = !0,
  44076. this.sourceType = "empty",
  44077. this.filter = null
  44078. }
  44079. ,
  44080. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44081. Ci.Audio.prototype.constructor = Ci.Audio,
  44082. Ci.Audio.prototype.getOutput = function() {
  44083. return this.gain
  44084. }
  44085. ,
  44086. Ci.Audio.prototype.load = function(e) {
  44087. var t = new Ci.AudioBuffer(this.context);
  44088. return t.load(e),
  44089. this.setBuffer(t),
  44090. this
  44091. }
  44092. ,
  44093. Ci.Audio.prototype.setNodeSource = function(e) {
  44094. return this.hasPlaybackControl = !1,
  44095. this.sourceType = "audioNode",
  44096. this.source = e,
  44097. this.connect(),
  44098. this
  44099. }
  44100. ,
  44101. Ci.Audio.prototype.setBuffer = function(e) {
  44102. var t = this;
  44103. return e.onReady(function(e) {
  44104. t.source.buffer = e,
  44105. t.sourceType = "buffer",
  44106. t.autoplay && t.play()
  44107. }),
  44108. this
  44109. }
  44110. ,
  44111. Ci.Audio.prototype.play = function() {
  44112. if (!0 !== this.isPlaying)
  44113. if (!1 !== this.hasPlaybackControl) {
  44114. var e = this.context.createBufferSource();
  44115. e.buffer = this.source.buffer,
  44116. e.loop = this.source.loop,
  44117. e.onended = this.source.onended,
  44118. e.start(0, this.startTime),
  44119. e.playbackRate.value = this.playbackRate,
  44120. this.isPlaying = !0,
  44121. this.source = e,
  44122. this.connect()
  44123. } else
  44124. console.warn("THREE.Audio: this Audio has no playback control.");
  44125. else
  44126. console.warn("THREE.Audio: Audio is already playing.")
  44127. }
  44128. ,
  44129. Ci.Audio.prototype.pause = function() {
  44130. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44131. void (this.startTime = this.context.currentTime))
  44132. }
  44133. ,
  44134. Ci.Audio.prototype.stop = function() {
  44135. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44136. void (this.startTime = 0))
  44137. }
  44138. ,
  44139. Ci.Audio.prototype.connect = function() {
  44140. null !== this.filter ? (this.source.connect(this.filter),
  44141. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44142. }
  44143. ,
  44144. Ci.Audio.prototype.disconnect = function() {
  44145. null !== this.filter ? (this.source.disconnect(this.filter),
  44146. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44147. }
  44148. ,
  44149. Ci.Audio.prototype.getFilter = function() {
  44150. return this.filter
  44151. }
  44152. ,
  44153. Ci.Audio.prototype.setFilter = function(e) {
  44154. void 0 === e && (e = null),
  44155. !0 === this.isPlaying ? (this.disconnect(),
  44156. this.filter = e,
  44157. this.connect()) : this.filter = e
  44158. }
  44159. ,
  44160. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44161. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44162. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44163. }
  44164. ,
  44165. Ci.Audio.prototype.getPlaybackRate = function() {
  44166. return this.playbackRate
  44167. }
  44168. ,
  44169. Ci.Audio.prototype.onEnded = function() {
  44170. this.isPlaying = !1
  44171. }
  44172. ,
  44173. Ci.Audio.prototype.setLoop = function(e) {
  44174. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44175. }
  44176. ,
  44177. Ci.Audio.prototype.getLoop = function() {
  44178. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44179. !1) : this.source.loop
  44180. }
  44181. ,
  44182. Ci.Audio.prototype.setVolume = function(e) {
  44183. this.gain.gain.value = e
  44184. }
  44185. ,
  44186. Ci.Audio.prototype.getVolume = function() {
  44187. return this.gain.gain.value
  44188. }
  44189. ,
  44190. Ci.AudioAnalyser = function(e, t) {
  44191. this.analyser = e.context.createAnalyser(),
  44192. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44193. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44194. e.getOutput().connect(this.analyser)
  44195. }
  44196. ,
  44197. Ci.AudioAnalyser.prototype = {
  44198. constructor: Ci.AudioAnalyser,
  44199. getData: function() {
  44200. return this.analyser.getByteFrequencyData(this.data),
  44201. this.data
  44202. }
  44203. },
  44204. Ci.AudioBuffer = function(e) {
  44205. this.context = e,
  44206. this.ready = !1,
  44207. this.readyCallbacks = []
  44208. }
  44209. ,
  44210. Ci.AudioBuffer.prototype.load = function(e) {
  44211. var i = this
  44212. , t = new XMLHttpRequest;
  44213. return t.open("GET", e, !0),
  44214. t.responseType = "arraybuffer",
  44215. t.onload = function(e) {
  44216. i.context.decodeAudioData(this.response, function(e) {
  44217. i.buffer = e,
  44218. i.ready = !0;
  44219. for (var t = 0; t < i.readyCallbacks.length; t++)
  44220. i.readyCallbacks[t](i.buffer);
  44221. i.readyCallbacks = []
  44222. })
  44223. }
  44224. ,
  44225. t.send(),
  44226. this
  44227. }
  44228. ,
  44229. Ci.AudioBuffer.prototype.onReady = function(e) {
  44230. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44231. }
  44232. ,
  44233. Ci.PositionalAudio = function(e) {
  44234. Ci.Audio.call(this, e),
  44235. this.panner = this.context.createPanner(),
  44236. this.panner.connect(this.gain)
  44237. }
  44238. ,
  44239. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44240. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44241. Ci.PositionalAudio.prototype.getOutput = function() {
  44242. return this.panner
  44243. }
  44244. ,
  44245. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44246. this.panner.refDistance = e
  44247. }
  44248. ,
  44249. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44250. return this.panner.refDistance
  44251. }
  44252. ,
  44253. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44254. this.panner.rolloffFactor = e
  44255. }
  44256. ,
  44257. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44258. return this.panner.rolloffFactor
  44259. }
  44260. ,
  44261. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44262. this.panner.distanceModel = e
  44263. }
  44264. ,
  44265. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44266. return this.panner.distanceModel
  44267. }
  44268. ,
  44269. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44270. this.panner.maxDistance = e
  44271. }
  44272. ,
  44273. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44274. return this.panner.maxDistance
  44275. }
  44276. ,
  44277. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44278. function(e) {
  44279. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44280. it.setFromMatrixPosition(this.matrixWorld),
  44281. this.panner.setPosition(it.x, it.y, it.z)
  44282. }
  44283. ),
  44284. Ci.AudioListener = function() {
  44285. Ci.Object3D.call(this),
  44286. this.type = "AudioListener",
  44287. this.context = new (window.AudioContext || window.webkitAudioContext),
  44288. this.gain = this.context.createGain(),
  44289. this.gain.connect(this.context.destination),
  44290. this.filter = null
  44291. }
  44292. ,
  44293. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44294. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44295. Ci.AudioListener.prototype.getInput = function() {
  44296. return this.gain
  44297. }
  44298. ,
  44299. Ci.AudioListener.prototype.removeFilter = function() {
  44300. null !== this.filter && (this.gain.disconnect(this.filter),
  44301. this.filter.disconnect(this.context.destination),
  44302. this.gain.connect(this.context.destination),
  44303. this.filter = null)
  44304. }
  44305. ,
  44306. Ci.AudioListener.prototype.setFilter = function(e) {
  44307. null !== this.filter ? (this.gain.disconnect(this.filter),
  44308. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44309. this.filter = e,
  44310. this.gain.connect(this.filter),
  44311. this.filter.connect(this.context.destination)
  44312. }
  44313. ,
  44314. Ci.AudioListener.prototype.getFilter = function() {
  44315. return this.filter
  44316. }
  44317. ,
  44318. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44319. this.gain.gain.value = e
  44320. }
  44321. ,
  44322. Ci.AudioListener.prototype.getMasterVolume = function() {
  44323. return this.gain.gain.value
  44324. }
  44325. ,
  44326. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44327. $e = new Ci.Quaternion,
  44328. et = new Ci.Vector3,
  44329. tt = new Ci.Vector3,
  44330. function(e) {
  44331. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44332. var t = this.context.listener
  44333. , i = this.up;
  44334. this.matrixWorld.decompose(Je, $e, et),
  44335. tt.set(0, 0, -1).applyQuaternion($e),
  44336. t.setPosition(Je.x, Je.y, Je.z),
  44337. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44338. }
  44339. ),
  44340. Ci.Camera = function() {
  44341. Ci.Object3D.call(this),
  44342. this.type = "Camera",
  44343. this.matrixWorldInverse = new Ci.Matrix4,
  44344. this.projectionMatrix = new Ci.Matrix4
  44345. }
  44346. ,
  44347. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44348. Ci.Camera.prototype.constructor = Ci.Camera,
  44349. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44350. function(e) {
  44351. var t = e || new Ci.Vector3;
  44352. return this.getWorldQuaternion(Qe),
  44353. t.set(0, 0, -1).applyQuaternion(Qe)
  44354. }
  44355. ),
  44356. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44357. function(e) {
  44358. Ke.lookAt(this.position, e, this.up),
  44359. this.quaternion.setFromRotationMatrix(Ke)
  44360. }
  44361. ),
  44362. Ci.Camera.prototype.clone = function() {
  44363. return (new this.constructor).copy(this)
  44364. }
  44365. ,
  44366. Ci.Camera.prototype.copy = function(e) {
  44367. return Ci.Object3D.prototype.copy.call(this, e),
  44368. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44369. this.projectionMatrix.copy(e.projectionMatrix),
  44370. this
  44371. }
  44372. ,
  44373. Ci.CubeCamera = function(e, t, i) {
  44374. Ci.Object3D.call(this),
  44375. this.type = "CubeCamera";
  44376. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44377. r.up.set(0, -1, 0),
  44378. r.lookAt(new Ci.Vector3(1,0,0)),
  44379. this.add(r);
  44380. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44381. o.up.set(0, -1, 0),
  44382. o.lookAt(new Ci.Vector3(-1,0,0)),
  44383. this.add(o);
  44384. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44385. a.up.set(0, 0, 1),
  44386. a.lookAt(new Ci.Vector3(0,1,0)),
  44387. this.add(a);
  44388. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44389. s.up.set(0, 0, -1),
  44390. s.lookAt(new Ci.Vector3(0,-1,0)),
  44391. this.add(s);
  44392. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44393. l.up.set(0, -1, 0),
  44394. l.lookAt(new Ci.Vector3(0,0,1)),
  44395. this.add(l);
  44396. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44397. c.up.set(0, -1, 0),
  44398. c.lookAt(new Ci.Vector3(0,0,-1)),
  44399. this.add(c);
  44400. var n = {
  44401. format: Ci.RGBFormat,
  44402. magFilter: Ci.LinearFilter,
  44403. minFilter: Ci.LinearFilter
  44404. };
  44405. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44406. this.updateCubeMap = function(e, t) {
  44407. null === this.parent && this.updateMatrixWorld();
  44408. var i = this.renderTarget
  44409. , n = i.texture.generateMipmaps;
  44410. i.texture.generateMipmaps = !1,
  44411. i.activeCubeFace = 0,
  44412. e.render(t, r, i),
  44413. i.activeCubeFace = 1,
  44414. e.render(t, o, i),
  44415. i.activeCubeFace = 2,
  44416. e.render(t, a, i),
  44417. i.activeCubeFace = 3,
  44418. e.render(t, s, i),
  44419. i.activeCubeFace = 4,
  44420. e.render(t, l, i),
  44421. i.texture.generateMipmaps = n,
  44422. i.activeCubeFace = 5,
  44423. e.render(t, c, i),
  44424. e.setRenderTarget(null)
  44425. }
  44426. }
  44427. ,
  44428. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44429. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44430. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44431. Ci.Camera.call(this),
  44432. this.type = "OrthographicCamera",
  44433. this.zoom = 1,
  44434. this.left = e,
  44435. this.right = t,
  44436. this.top = i,
  44437. this.bottom = n,
  44438. this.near = void 0 !== r ? r : .1,
  44439. this.far = void 0 !== o ? o : 2e3,
  44440. this.updateProjectionMatrix()
  44441. }
  44442. ,
  44443. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44444. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44445. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44446. var e = (this.right - this.left) / (2 * this.zoom)
  44447. , t = (this.top - this.bottom) / (2 * this.zoom)
  44448. , i = (this.right + this.left) / 2
  44449. , n = (this.top + this.bottom) / 2;
  44450. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44451. }
  44452. ,
  44453. Ci.OrthographicCamera.prototype.copy = function(e) {
  44454. return Ci.Camera.prototype.copy.call(this, e),
  44455. this.left = e.left,
  44456. this.right = e.right,
  44457. this.top = e.top,
  44458. this.bottom = e.bottom,
  44459. this.near = e.near,
  44460. this.far = e.far,
  44461. this.zoom = e.zoom,
  44462. this
  44463. }
  44464. ,
  44465. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44466. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44467. return t.object.zoom = this.zoom,
  44468. t.object.left = this.left,
  44469. t.object.right = this.right,
  44470. t.object.top = this.top,
  44471. t.object.bottom = this.bottom,
  44472. t.object.near = this.near,
  44473. t.object.far = this.far,
  44474. t
  44475. }
  44476. ,
  44477. Ci.PerspectiveCamera = function(e, t, i, n) {
  44478. Ci.Camera.call(this),
  44479. this.type = "PerspectiveCamera",
  44480. this.focalLength = 10,
  44481. this.zoom = 1,
  44482. this.fov = void 0 !== e ? e : 50,
  44483. this.aspect = void 0 !== t ? t : 1,
  44484. this.near = void 0 !== i ? i : .1,
  44485. this.far = void 0 !== n ? n : 2e3,
  44486. this.updateProjectionMatrix()
  44487. }
  44488. ,
  44489. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44490. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44491. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44492. void 0 === t && (t = 24),
  44493. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44494. this.updateProjectionMatrix()
  44495. }
  44496. ,
  44497. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44498. this.fullWidth = e,
  44499. this.fullHeight = t,
  44500. this.x = i,
  44501. this.y = n,
  44502. this.width = r,
  44503. this.height = o,
  44504. this.updateProjectionMatrix()
  44505. }
  44506. ,
  44507. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44508. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44509. if (this.fullWidth) {
  44510. var t = this.fullWidth / this.fullHeight
  44511. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44512. , n = -i
  44513. , r = t * n
  44514. , o = t * i
  44515. , a = Math.abs(o - r)
  44516. , s = Math.abs(i - n);
  44517. this.projectionMatrix.makeFrustum(r + this.x * a / this.fullWidth, r + (this.x + this.width) * a / this.fullWidth, i - (this.y + this.height) * s / this.fullHeight, i - this.y * s / this.fullHeight, this.near, this.far)
  44518. } else
  44519. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44520. }
  44521. ,
  44522. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44523. return Ci.Camera.prototype.copy.call(this, e),
  44524. this.focalLength = e.focalLength,
  44525. this.zoom = e.zoom,
  44526. this.fov = e.fov,
  44527. this.aspect = e.aspect,
  44528. this.near = e.near,
  44529. this.far = e.far,
  44530. this
  44531. }
  44532. ,
  44533. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44534. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44535. return t.object.focalLength = this.focalLength,
  44536. t.object.zoom = this.zoom,
  44537. t.object.fov = this.fov,
  44538. t.object.aspect = this.aspect,
  44539. t.object.near = this.near,
  44540. t.object.far = this.far,
  44541. t
  44542. }
  44543. ,
  44544. Ci.StereoCamera = function() {
  44545. this.type = "StereoCamera",
  44546. this.aspect = 1,
  44547. this.cameraL = new Ci.PerspectiveCamera,
  44548. this.cameraL.layers.enable(1),
  44549. this.cameraL.matrixAutoUpdate = !1,
  44550. this.cameraR = new Ci.PerspectiveCamera,
  44551. this.cameraR.layers.enable(2),
  44552. this.cameraR.matrixAutoUpdate = !1
  44553. }
  44554. ,
  44555. Ci.StereoCamera.prototype = {
  44556. constructor: Ci.StereoCamera,
  44557. update: (Xe = new Ci.Matrix4,
  44558. Ze = new Ci.Matrix4,
  44559. function(e) {
  44560. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44561. Ge = e.focalLength,
  44562. We = e.fov,
  44563. je = e.aspect * this.aspect,
  44564. Ye = e.near,
  44565. qe = e.far;
  44566. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44567. Ze.elements[12] = -.032,
  44568. Xe.elements[12] = .032,
  44569. t = -o * je + r,
  44570. i = o * je + r,
  44571. n.elements[0] = 2 * Ye / (i - t),
  44572. n.elements[8] = (i + t) / (i - t),
  44573. this.cameraL.projectionMatrix.copy(n),
  44574. t = -o * je - r,
  44575. i = o * je - r,
  44576. n.elements[0] = 2 * Ye / (i - t),
  44577. n.elements[8] = (i + t) / (i - t),
  44578. this.cameraR.projectionMatrix.copy(n)
  44579. }
  44580. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  44581. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  44582. }
  44583. )
  44584. },
  44585. Ci.Light = function(e, t) {
  44586. Ci.Object3D.call(this),
  44587. this.type = "Light",
  44588. this.color = new Ci.Color(e),
  44589. this.intensity = void 0 !== t ? t : 1,
  44590. this.receiveShadow = void 0
  44591. }
  44592. ,
  44593. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  44594. Ci.Light.prototype.constructor = Ci.Light,
  44595. Ci.Light.prototype.copy = function(e) {
  44596. return Ci.Object3D.prototype.copy.call(this, e),
  44597. this.color.copy(e.color),
  44598. this.intensity = e.intensity,
  44599. this
  44600. }
  44601. ,
  44602. Ci.Light.prototype.toJSON = function(e) {
  44603. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44604. return t.object.color = this.color.getHex(),
  44605. t.object.intensity = this.intensity,
  44606. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44607. void 0 !== this.distance && (t.object.distance = this.distance),
  44608. void 0 !== this.angle && (t.object.angle = this.angle),
  44609. void 0 !== this.decay && (t.object.decay = this.decay),
  44610. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44611. t
  44612. }
  44613. ,
  44614. Ci.LightShadow = function(e) {
  44615. this.camera = e,
  44616. this.bias = 0,
  44617. this.radius = 1,
  44618. this.mapSize = new Ci.Vector2(512,512),
  44619. this.map = null,
  44620. this.matrix = new Ci.Matrix4
  44621. }
  44622. ,
  44623. Ci.LightShadow.prototype = {
  44624. constructor: Ci.LightShadow,
  44625. copy: function(e) {
  44626. return this.camera = e.camera.clone(),
  44627. this.bias = e.bias,
  44628. this.radius = e.radius,
  44629. this.mapSize.copy(e.mapSize),
  44630. this
  44631. },
  44632. clone: function() {
  44633. return (new this.constructor).copy(this)
  44634. }
  44635. },
  44636. Ci.AmbientLight = function(e, t) {
  44637. Ci.Light.call(this, e, t),
  44638. this.type = "AmbientLight",
  44639. this.castShadow = void 0
  44640. }
  44641. ,
  44642. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  44643. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  44644. Ci.DirectionalLight = function(e, t) {
  44645. Ci.Light.call(this, e, t),
  44646. this.type = "DirectionalLight",
  44647. this.position.set(0, 1, 0),
  44648. this.updateMatrix(),
  44649. this.target = new Ci.Object3D,
  44650. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  44651. }
  44652. ,
  44653. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  44654. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  44655. Ci.DirectionalLight.prototype.copy = function(e) {
  44656. return Ci.Light.prototype.copy.call(this, e),
  44657. this.target = e.target.clone(),
  44658. this.shadow = e.shadow.clone(),
  44659. this
  44660. }
  44661. ,
  44662. Ci.HemisphereLight = function(e, t, i) {
  44663. Ci.Light.call(this, e, i),
  44664. this.type = "HemisphereLight",
  44665. this.castShadow = void 0,
  44666. this.position.set(0, 1, 0),
  44667. this.updateMatrix(),
  44668. this.groundColor = new Ci.Color(t)
  44669. }
  44670. ,
  44671. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  44672. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  44673. Ci.HemisphereLight.prototype.copy = function(e) {
  44674. return Ci.Light.prototype.copy.call(this, e),
  44675. this.groundColor.copy(e.groundColor),
  44676. this
  44677. }
  44678. ,
  44679. Ci.PointLight = function(e, t, i, n) {
  44680. Ci.Light.call(this, e, t),
  44681. this.type = "PointLight",
  44682. this.distance = void 0 !== i ? i : 0,
  44683. this.decay = void 0 !== n ? n : 1,
  44684. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  44685. }
  44686. ,
  44687. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  44688. Ci.PointLight.prototype.constructor = Ci.PointLight,
  44689. Object.defineProperty(Ci.PointLight.prototype, "power", {
  44690. get: function() {
  44691. return 4 * this.intensity * Math.PI
  44692. },
  44693. set: function(e) {
  44694. this.intensity = e / (4 * Math.PI)
  44695. }
  44696. }),
  44697. Ci.PointLight.prototype.copy = function(e) {
  44698. return Ci.Light.prototype.copy.call(this, e),
  44699. this.distance = e.distance,
  44700. this.decay = e.decay,
  44701. this.shadow = e.shadow.clone(),
  44702. this
  44703. }
  44704. ,
  44705. Ci.SpotLight = function(e, t, i, n, r, o) {
  44706. Ci.Light.call(this, e, t),
  44707. this.type = "SpotLight",
  44708. this.position.set(0, 1, 0),
  44709. this.updateMatrix(),
  44710. this.target = new Ci.Object3D,
  44711. this.distance = void 0 !== i ? i : 0,
  44712. this.angle = void 0 !== n ? n : Math.PI / 3,
  44713. this.penumbra = void 0 !== r ? r : 0,
  44714. this.decay = void 0 !== o ? o : 1,
  44715. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  44716. }
  44717. ,
  44718. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  44719. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  44720. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  44721. get: function() {
  44722. return this.intensity * Math.PI
  44723. },
  44724. set: function(e) {
  44725. this.intensity = e / Math.PI
  44726. }
  44727. }),
  44728. Ci.SpotLight.prototype.copy = function(e) {
  44729. return Ci.Light.prototype.copy.call(this, e),
  44730. this.distance = e.distance,
  44731. this.angle = e.angle,
  44732. this.penumbra = e.penumbra,
  44733. this.decay = e.decay,
  44734. this.target = e.target.clone(),
  44735. this.shadow = e.shadow.clone(),
  44736. this
  44737. }
  44738. ,
  44739. Ci.Cache = {
  44740. enabled: !1,
  44741. files: {},
  44742. add: function(e, t) {
  44743. !1 !== this.enabled && (this.files[e] = t)
  44744. },
  44745. get: function(e) {
  44746. if (!1 !== this.enabled)
  44747. return this.files[e]
  44748. },
  44749. remove: function(e) {
  44750. delete this.files[e]
  44751. },
  44752. clear: function() {
  44753. this.files = {}
  44754. }
  44755. },
  44756. Ci.Loader = function() {
  44757. this.onLoadStart = function() {}
  44758. ,
  44759. this.onLoadProgress = function() {}
  44760. ,
  44761. this.onLoadComplete = function() {}
  44762. }
  44763. ,
  44764. Ci.Loader.prototype = {
  44765. constructor: Ci.Loader,
  44766. crossOrigin: void 0,
  44767. extractUrlBase: function(e) {
  44768. var t = e.split("/");
  44769. return 1 === t.length ? "./" : (t.pop(),
  44770. t.join("/") + "/")
  44771. },
  44772. initMaterials: function(e, t, i) {
  44773. for (var n = [], r = 0; r < e.length; ++r)
  44774. n[r] = this.createMaterial(e[r], t, i);
  44775. return n
  44776. },
  44777. createMaterial: function(e, c, h) {
  44778. function t(e, t, i, n, r) {
  44779. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  44780. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  44781. He.load(a)),
  44782. void 0 !== t && (o.repeat.fromArray(t),
  44783. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  44784. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  44785. void 0 !== i && o.offset.fromArray(i),
  44786. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  44787. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  44788. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  44789. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  44790. void 0 !== r && (o.anisotropy = r);
  44791. var l = Ci.Math.generateUUID();
  44792. return u[l] = o,
  44793. l
  44794. }
  44795. void 0 === Ue && (Ue = new Ci.Color),
  44796. void 0 === He && (He = new Ci.TextureLoader),
  44797. void 0 === ze && (ze = new Ci.MaterialLoader);
  44798. var u = {}
  44799. , i = {
  44800. uuid: Ci.Math.generateUUID(),
  44801. type: "MeshLambertMaterial"
  44802. };
  44803. for (var n in e) {
  44804. var r = e[n];
  44805. switch (n) {
  44806. case "DbgColor":
  44807. case "DbgIndex":
  44808. case "opticalDensity":
  44809. case "illumination":
  44810. break;
  44811. case "DbgName":
  44812. i.name = r;
  44813. break;
  44814. case "blending":
  44815. i.blending = Ci[r];
  44816. break;
  44817. case "colorAmbient":
  44818. case "mapAmbient":
  44819. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  44820. break;
  44821. case "colorDiffuse":
  44822. i.color = Ue.fromArray(r).getHex();
  44823. break;
  44824. case "colorSpecular":
  44825. i.specular = Ue.fromArray(r).getHex();
  44826. break;
  44827. case "colorEmissive":
  44828. i.emissive = Ue.fromArray(r).getHex();
  44829. break;
  44830. case "specularCoef":
  44831. i.shininess = r;
  44832. break;
  44833. case "shading":
  44834. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  44835. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  44836. break;
  44837. case "mapDiffuse":
  44838. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  44839. break;
  44840. case "mapDiffuseRepeat":
  44841. case "mapDiffuseOffset":
  44842. case "mapDiffuseWrap":
  44843. case "mapDiffuseAnisotropy":
  44844. break;
  44845. case "mapLight":
  44846. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  44847. break;
  44848. case "mapLightRepeat":
  44849. case "mapLightOffset":
  44850. case "mapLightWrap":
  44851. case "mapLightAnisotropy":
  44852. break;
  44853. case "mapAO":
  44854. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  44855. break;
  44856. case "mapAORepeat":
  44857. case "mapAOOffset":
  44858. case "mapAOWrap":
  44859. case "mapAOAnisotropy":
  44860. break;
  44861. case "mapBump":
  44862. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  44863. break;
  44864. case "mapBumpScale":
  44865. i.bumpScale = r;
  44866. break;
  44867. case "mapBumpRepeat":
  44868. case "mapBumpOffset":
  44869. case "mapBumpWrap":
  44870. case "mapBumpAnisotropy":
  44871. break;
  44872. case "mapNormal":
  44873. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  44874. break;
  44875. case "mapNormalFactor":
  44876. i.normalScale = [r, r];
  44877. break;
  44878. case "mapNormalRepeat":
  44879. case "mapNormalOffset":
  44880. case "mapNormalWrap":
  44881. case "mapNormalAnisotropy":
  44882. break;
  44883. case "mapSpecular":
  44884. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  44885. break;
  44886. case "mapSpecularRepeat":
  44887. case "mapSpecularOffset":
  44888. case "mapSpecularWrap":
  44889. case "mapSpecularAnisotropy":
  44890. break;
  44891. case "mapAlpha":
  44892. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  44893. break;
  44894. case "mapAlphaRepeat":
  44895. case "mapAlphaOffset":
  44896. case "mapAlphaWrap":
  44897. case "mapAlphaAnisotropy":
  44898. break;
  44899. case "flipSided":
  44900. i.side = Ci.BackSide;
  44901. break;
  44902. case "doubleSided":
  44903. i.side = Ci.DoubleSide;
  44904. break;
  44905. case "transparency":
  44906. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  44907. i.opacity = r;
  44908. break;
  44909. case "depthTest":
  44910. case "depthWrite":
  44911. case "colorWrite":
  44912. case "opacity":
  44913. case "reflectivity":
  44914. case "transparent":
  44915. case "visible":
  44916. case "wireframe":
  44917. i[n] = r;
  44918. break;
  44919. case "vertexColors":
  44920. !0 === r && (i.vertexColors = Ci.VertexColors),
  44921. "face" === r && (i.vertexColors = Ci.FaceColors);
  44922. break;
  44923. default:
  44924. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  44925. }
  44926. }
  44927. return "MeshBasicMaterial" === i.type && delete i.emissive,
  44928. "MeshPhongMaterial" !== i.type && delete i.specular,
  44929. i.opacity < 1 && (i.transparent = !0),
  44930. ze.setTextures(u),
  44931. ze.parse(i)
  44932. }
  44933. },
  44934. Ci.Loader.Handlers = {
  44935. handlers: [],
  44936. add: function(e, t) {
  44937. this.handlers.push(e, t)
  44938. },
  44939. get: function(e) {
  44940. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  44941. var r = t[i]
  44942. , o = t[i + 1];
  44943. if (r.test(e))
  44944. return o
  44945. }
  44946. return null
  44947. }
  44948. },
  44949. Ci.XHRLoader = function(e) {
  44950. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  44951. }
  44952. ,
  44953. Ci.XHRLoader.prototype = {
  44954. constructor: Ci.XHRLoader,
  44955. load: function(i, n, t, r) {
  44956. void 0 !== this.path && (i = this.path + i);
  44957. var o = this
  44958. , e = Ci.Cache.get(i);
  44959. if (void 0 !== e)
  44960. return n && setTimeout(function() {
  44961. n(e)
  44962. }, 0),
  44963. e;
  44964. var a = new XMLHttpRequest;
  44965. return a.overrideMimeType("text/plain"),
  44966. a.open("GET", i, !0),
  44967. a.addEventListener("load", function(e) {
  44968. var t = e.target.response;
  44969. Ci.Cache.add(i, t),
  44970. 200 === this.status ? (n && n(t),
  44971. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  44972. n && n(t),
  44973. o.manager.itemEnd(i)) : (r && r(e),
  44974. o.manager.itemError(i))
  44975. }, !1),
  44976. void 0 !== t && a.addEventListener("progress", function(e) {
  44977. t(e)
  44978. }, !1),
  44979. a.addEventListener("error", function(e) {
  44980. r && r(e),
  44981. o.manager.itemError(i)
  44982. }, !1),
  44983. void 0 !== this.responseType && (a.responseType = this.responseType),
  44984. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  44985. a.send(null),
  44986. o.manager.itemStart(i),
  44987. a
  44988. },
  44989. setPath: function(e) {
  44990. this.path = e
  44991. },
  44992. setResponseType: function(e) {
  44993. this.responseType = e
  44994. },
  44995. setWithCredentials: function(e) {
  44996. this.withCredentials = e
  44997. }
  44998. },
  44999. Ci.FontLoader = function(e) {
  45000. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45001. }
  45002. ,
  45003. Ci.FontLoader.prototype = {
  45004. constructor: Ci.FontLoader,
  45005. load: function(e, t, i, n) {
  45006. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45007. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45008. }, i, n)
  45009. }
  45010. },
  45011. Ci.ImageLoader = function(e) {
  45012. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45013. }
  45014. ,
  45015. Ci.ImageLoader.prototype = {
  45016. constructor: Ci.ImageLoader,
  45017. load: function(t, i, n, r) {
  45018. void 0 !== this.path && (t = this.path + t);
  45019. var o = this
  45020. , e = Ci.Cache.get(t);
  45021. if (void 0 !== e)
  45022. return o.manager.itemStart(t),
  45023. i ? setTimeout(function() {
  45024. i(e),
  45025. o.manager.itemEnd(t)
  45026. }, 0) : o.manager.itemEnd(t),
  45027. e;
  45028. var a = document.createElement("img");
  45029. return a.addEventListener("load", function(e) {
  45030. Ci.Cache.add(t, this),
  45031. i && i(this),
  45032. o.manager.itemEnd(t)
  45033. }, !1),
  45034. void 0 !== n && a.addEventListener("progress", function(e) {
  45035. n(e)
  45036. }, !1),
  45037. a.addEventListener("error", function(e) {
  45038. r && r(e),
  45039. o.manager.itemError(t)
  45040. }, !1),
  45041. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45042. o.manager.itemStart(t),
  45043. a.src = t,
  45044. a
  45045. },
  45046. setCrossOrigin: function(e) {
  45047. this.crossOrigin = e
  45048. },
  45049. setPath: function(e) {
  45050. this.path = e
  45051. }
  45052. },
  45053. Ci.JSONLoader = function(e) {
  45054. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45055. e = void 0),
  45056. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45057. this.withCredentials = !1
  45058. }
  45059. ,
  45060. Ci.JSONLoader.prototype = {
  45061. constructor: Ci.JSONLoader,
  45062. get statusDomElement() {
  45063. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45064. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45065. this._statusDomElement
  45066. },
  45067. load: function(o, a, e, t) {
  45068. var s = this
  45069. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45070. , i = new Ci.XHRLoader(this.manager);
  45071. i.setWithCredentials(this.withCredentials),
  45072. i.load(o, function(e) {
  45073. var t = JSON.parse(e)
  45074. , i = t.metadata;
  45075. if (void 0 !== i) {
  45076. var n = i.type;
  45077. if (void 0 !== n) {
  45078. if ("object" === n.toLowerCase())
  45079. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45080. if ("scene" === n.toLowerCase())
  45081. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45082. }
  45083. }
  45084. var r = s.parse(t, l);
  45085. a(r.geometry, r.materials)
  45086. }, e, t)
  45087. },
  45088. setTexturePath: function(e) {
  45089. this.texturePath = e
  45090. },
  45091. parse: function(D, e) {
  45092. var N = new Ci.Geometry
  45093. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45094. if (function(e) {
  45095. function t(e, t) {
  45096. return e & 1 << t
  45097. }
  45098. var i, n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = D.faces, R = D.vertices, P = D.normals, O = D.colors, L = 0;
  45099. if (void 0 !== D.uvs) {
  45100. for (i = 0; i < D.uvs.length; i++)
  45101. D.uvs[i].length && L++;
  45102. for (i = 0; i < L; i++)
  45103. N.faceVertexUvs[i] = []
  45104. }
  45105. for (o = 0,
  45106. a = R.length; o < a; )
  45107. (A = new Ci.Vector3).x = R[o++] * e,
  45108. A.y = R[o++] * e,
  45109. A.z = R[o++] * e,
  45110. N.vertices.push(A);
  45111. for (o = 0,
  45112. a = M.length; o < a; )
  45113. if (d = t(u = M[o++], 0),
  45114. p = t(u, 1),
  45115. f = t(u, 3),
  45116. g = t(u, 4),
  45117. m = t(u, 5),
  45118. v = t(u, 6),
  45119. y = t(u, 7),
  45120. d) {
  45121. if ((I = new Ci.Face3).a = M[o],
  45122. I.b = M[o + 1],
  45123. I.c = M[o + 3],
  45124. (E = new Ci.Face3).a = M[o + 1],
  45125. E.b = M[o + 2],
  45126. E.c = M[o + 3],
  45127. o += 4,
  45128. p && (h = M[o++],
  45129. I.materialIndex = h,
  45130. E.materialIndex = h),
  45131. r = N.faces.length,
  45132. f)
  45133. for (i = 0; i < L; i++)
  45134. for (w = D.uvs[i],
  45135. N.faceVertexUvs[i][r] = [],
  45136. N.faceVertexUvs[i][r + 1] = [],
  45137. n = 0; n < 4; n++)
  45138. x = w[2 * (c = M[o++])],
  45139. S = w[2 * c + 1],
  45140. T = new Ci.Vector2(x,S),
  45141. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45142. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45143. if (g && (l = 3 * M[o++],
  45144. I.normal.set(P[l++], P[l++], P[l]),
  45145. E.normal.copy(I.normal)),
  45146. m)
  45147. for (i = 0; i < 4; i++)
  45148. l = 3 * M[o++],
  45149. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45150. 2 !== i && I.vertexNormals.push(b),
  45151. 0 !== i && E.vertexNormals.push(b);
  45152. if (v && (_ = O[s = M[o++]],
  45153. I.color.setHex(_),
  45154. E.color.setHex(_)),
  45155. y)
  45156. for (i = 0; i < 4; i++)
  45157. _ = O[s = M[o++]],
  45158. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45159. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45160. N.faces.push(I),
  45161. N.faces.push(E)
  45162. } else {
  45163. if ((C = new Ci.Face3).a = M[o++],
  45164. C.b = M[o++],
  45165. C.c = M[o++],
  45166. p && (h = M[o++],
  45167. C.materialIndex = h),
  45168. r = N.faces.length,
  45169. f)
  45170. for (i = 0; i < L; i++)
  45171. for (w = D.uvs[i],
  45172. N.faceVertexUvs[i][r] = [],
  45173. n = 0; n < 3; n++)
  45174. x = w[2 * (c = M[o++])],
  45175. S = w[2 * c + 1],
  45176. T = new Ci.Vector2(x,S),
  45177. N.faceVertexUvs[i][r].push(T);
  45178. if (g && (l = 3 * M[o++],
  45179. C.normal.set(P[l++], P[l++], P[l])),
  45180. m)
  45181. for (i = 0; i < 3; i++)
  45182. l = 3 * M[o++],
  45183. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45184. C.vertexNormals.push(b);
  45185. if (v && (s = M[o++],
  45186. C.color.setHex(O[s])),
  45187. y)
  45188. for (i = 0; i < 3; i++)
  45189. s = M[o++],
  45190. C.vertexColors.push(new Ci.Color(O[s]));
  45191. N.faces.push(C)
  45192. }
  45193. }(t),
  45194. function() {
  45195. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45196. if (D.skinWeights)
  45197. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45198. var n = D.skinWeights[t]
  45199. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45200. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45201. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45202. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45203. }
  45204. if (D.skinIndices)
  45205. for (t = 0,
  45206. i = D.skinIndices.length; t < i; t += e) {
  45207. var s = D.skinIndices[t]
  45208. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45209. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45210. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45211. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45212. }
  45213. N.bones = D.bones,
  45214. N.bones && 0 < N.bones.length && (N.skinWeights.length !== N.skinIndices.length || N.skinIndices.length !== N.vertices.length) && console.warn("When skinning, number of vertices (" + N.vertices.length + "), skinIndices (" + N.skinIndices.length + "), and skinWeights (" + N.skinWeights.length + ") should match.")
  45215. }(),
  45216. function(e) {
  45217. if (void 0 !== D.morphTargets)
  45218. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45219. N.morphTargets[t] = {},
  45220. N.morphTargets[t].name = D.morphTargets[t].name,
  45221. N.morphTargets[t].vertices = [];
  45222. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45223. var s = new Ci.Vector3;
  45224. s.x = r[o] * e,
  45225. s.y = r[o + 1] * e,
  45226. s.z = r[o + 2] * e,
  45227. n.push(s)
  45228. }
  45229. }
  45230. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45231. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45232. var l = N.faces
  45233. , c = D.morphColors[0].colors;
  45234. for (t = 0,
  45235. i = l.length; t < i; t++)
  45236. l[t].color.fromArray(c, 3 * t)
  45237. }
  45238. }(t),
  45239. function() {
  45240. var e = []
  45241. , t = [];
  45242. void 0 !== D.animation && t.push(D.animation),
  45243. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45244. for (var i = 0; i < t.length; i++) {
  45245. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45246. n && e.push(n)
  45247. }
  45248. if (N.morphTargets) {
  45249. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45250. e = e.concat(r)
  45251. }
  45252. 0 < e.length && (N.animations = e)
  45253. }(),
  45254. N.computeFaceNormals(),
  45255. N.computeBoundingSphere(),
  45256. void 0 === D.materials || 0 === D.materials.length)
  45257. return {
  45258. geometry: N
  45259. };
  45260. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45261. return {
  45262. geometry: N,
  45263. materials: i
  45264. }
  45265. }
  45266. },
  45267. Ci.LoadingManager = function(e, t, i) {
  45268. var n = this
  45269. , r = !1
  45270. , o = 0
  45271. , a = 0;
  45272. this.onStart = void 0,
  45273. this.onLoad = e,
  45274. this.onProgress = t,
  45275. this.onError = i,
  45276. this.itemStart = function(e) {
  45277. a++,
  45278. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45279. r = !0
  45280. }
  45281. ,
  45282. this.itemEnd = function(e) {
  45283. o++,
  45284. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45285. o === a && (r = !1,
  45286. void 0 !== n.onLoad && n.onLoad())
  45287. }
  45288. ,
  45289. this.itemError = function(e) {
  45290. void 0 !== n.onError && n.onError(e)
  45291. }
  45292. }
  45293. ,
  45294. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45295. Ci.BufferGeometryLoader = function(e) {
  45296. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45297. }
  45298. ,
  45299. Ci.BufferGeometryLoader.prototype = {
  45300. constructor: Ci.BufferGeometryLoader,
  45301. load: function(e, t, i, n) {
  45302. var r = this;
  45303. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45304. t(r.parse(JSON.parse(e)))
  45305. }, i, n)
  45306. },
  45307. parse: function(e) {
  45308. var t = new Ci.BufferGeometry
  45309. , i = e.data.index
  45310. , n = {
  45311. Int8Array: Int8Array,
  45312. Uint8Array: Uint8Array,
  45313. Uint8ClampedArray: Uint8ClampedArray,
  45314. Int16Array: Int16Array,
  45315. Uint16Array: Uint16Array,
  45316. Int32Array: Int32Array,
  45317. Uint32Array: Uint32Array,
  45318. Float32Array: Float32Array,
  45319. Float64Array: Float64Array
  45320. };
  45321. if (void 0 !== i) {
  45322. var r = new n[i.type](i.array);
  45323. t.setIndex(new Ci.BufferAttribute(r,1))
  45324. }
  45325. var o = e.data.attributes;
  45326. for (var a in o) {
  45327. var s = o[a];
  45328. r = new n[s.type](s.array);
  45329. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45330. }
  45331. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45332. if (void 0 !== l)
  45333. for (var c = 0, h = l.length; c !== h; ++c) {
  45334. var u = l[c];
  45335. t.addGroup(u.start, u.count, u.materialIndex)
  45336. }
  45337. var d = e.data.boundingSphere;
  45338. if (void 0 !== d) {
  45339. var p = new Ci.Vector3;
  45340. void 0 !== d.center && p.fromArray(d.center),
  45341. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45342. }
  45343. return t
  45344. }
  45345. },
  45346. Ci.MaterialLoader = function(e) {
  45347. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45348. this.textures = {}
  45349. }
  45350. ,
  45351. Ci.MaterialLoader.prototype = {
  45352. constructor: Ci.MaterialLoader,
  45353. load: function(e, t, i, n) {
  45354. var r = this;
  45355. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45356. t(r.parse(JSON.parse(e)))
  45357. }, i, n)
  45358. },
  45359. setTextures: function(e) {
  45360. this.textures = e
  45361. },
  45362. getTexture: function(e) {
  45363. var t = this.textures;
  45364. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45365. t[e]
  45366. },
  45367. parse: function(e) {
  45368. var t = new Ci[e.type];
  45369. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45370. void 0 !== e.name && (t.name = e.name),
  45371. void 0 !== e.color && t.color.setHex(e.color),
  45372. void 0 !== e.roughness && (t.roughness = e.roughness),
  45373. void 0 !== e.metalness && (t.metalness = e.metalness),
  45374. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45375. void 0 !== e.specular && t.specular.setHex(e.specular),
  45376. void 0 !== e.shininess && (t.shininess = e.shininess),
  45377. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45378. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45379. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45380. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45381. void 0 !== e.shading && (t.shading = e.shading),
  45382. void 0 !== e.blending && (t.blending = e.blending),
  45383. void 0 !== e.side && (t.side = e.side),
  45384. void 0 !== e.opacity && (t.opacity = e.opacity),
  45385. void 0 !== e.transparent && (t.transparent = e.transparent),
  45386. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45387. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45388. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45389. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45390. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45391. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45392. void 0 !== e.size && (t.size = e.size),
  45393. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45394. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45395. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45396. t.transparent = !0),
  45397. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45398. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45399. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45400. void 0 !== e.normalScale) {
  45401. var i = e.normalScale;
  45402. !1 === Array.isArray(i) && (i = [i, i]),
  45403. t.normalScale = (new Ci.Vector2).fromArray(i)
  45404. }
  45405. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45406. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45407. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45408. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45409. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45410. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45411. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45412. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45413. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45414. t.combine = Ci.MultiplyOperation),
  45415. e.reflectivity && (t.reflectivity = e.reflectivity),
  45416. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45417. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45418. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45419. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45420. void 0 !== e.materials)
  45421. for (var n = 0, r = e.materials.length; n < r; n++)
  45422. t.materials.push(this.parse(e.materials[n]));
  45423. return t
  45424. }
  45425. },
  45426. Ci.ObjectLoader = function(e) {
  45427. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45428. this.texturePath = ""
  45429. }
  45430. ,
  45431. Ci.ObjectLoader.prototype = {
  45432. constructor: Ci.ObjectLoader,
  45433. load: function(e, t, i, n) {
  45434. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45435. var r = this;
  45436. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45437. r.parse(JSON.parse(e), t)
  45438. }, i, n)
  45439. },
  45440. setTexturePath: function(e) {
  45441. this.texturePath = e
  45442. },
  45443. setCrossOrigin: function(e) {
  45444. this.crossOrigin = e
  45445. },
  45446. parse: function(e, t) {
  45447. var i = this.parseGeometries(e.geometries)
  45448. , n = this.parseImages(e.images, function() {
  45449. void 0 !== t && t(a)
  45450. })
  45451. , r = this.parseTextures(e.textures, n)
  45452. , o = this.parseMaterials(e.materials, r)
  45453. , a = this.parseObject(e.object, i, o);
  45454. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45455. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45456. a
  45457. },
  45458. parseGeometries: function(e) {
  45459. var t = {};
  45460. if (void 0 !== e)
  45461. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45462. var a, s = e[r];
  45463. switch (s.type) {
  45464. case "PlaneGeometry":
  45465. case "PlaneBufferGeometry":
  45466. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45467. break;
  45468. case "BoxGeometry":
  45469. case "BoxBufferGeometry":
  45470. case "CubeGeometry":
  45471. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45472. break;
  45473. case "CircleGeometry":
  45474. case "CircleBufferGeometry":
  45475. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45476. break;
  45477. case "CylinderGeometry":
  45478. case "CylinderBufferGeometry":
  45479. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45480. break;
  45481. case "SphereGeometry":
  45482. case "SphereBufferGeometry":
  45483. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45484. break;
  45485. case "DodecahedronGeometry":
  45486. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45487. break;
  45488. case "IcosahedronGeometry":
  45489. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45490. break;
  45491. case "OctahedronGeometry":
  45492. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45493. break;
  45494. case "TetrahedronGeometry":
  45495. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45496. break;
  45497. case "RingGeometry":
  45498. case "RingBufferGeometry":
  45499. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45500. break;
  45501. case "TorusGeometry":
  45502. case "TorusBufferGeometry":
  45503. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45504. break;
  45505. case "TorusKnotGeometry":
  45506. case "TorusKnotBufferGeometry":
  45507. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45508. break;
  45509. case "LatheGeometry":
  45510. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45511. break;
  45512. case "BufferGeometry":
  45513. a = n.parse(s);
  45514. break;
  45515. case "Geometry":
  45516. a = i.parse(s.data, this.texturePath).geometry;
  45517. break;
  45518. default:
  45519. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45520. continue
  45521. }
  45522. a.uuid = s.uuid,
  45523. void 0 !== s.name && (a.name = s.name),
  45524. t[s.uuid] = a
  45525. }
  45526. return t
  45527. },
  45528. parseMaterials: function(e, t) {
  45529. var i = {};
  45530. if (void 0 !== e) {
  45531. var n = new Ci.MaterialLoader;
  45532. n.setTextures(t);
  45533. for (var r = 0, o = e.length; r < o; r++) {
  45534. var a = n.parse(e[r]);
  45535. i[a.uuid] = a
  45536. }
  45537. }
  45538. return i
  45539. },
  45540. parseAnimations: function(e) {
  45541. for (var t = [], i = 0; i < e.length; i++) {
  45542. var n = Ci.AnimationClip.parse(e[i]);
  45543. t.push(n)
  45544. }
  45545. return t
  45546. },
  45547. parseImages: function(e, t) {
  45548. function i(e) {
  45549. return n.manager.itemStart(e),
  45550. a.load(e, function() {
  45551. n.manager.itemEnd(e)
  45552. })
  45553. }
  45554. var n = this
  45555. , r = {};
  45556. if (void 0 !== e && 0 < e.length) {
  45557. var o = new Ci.LoadingManager(t)
  45558. , a = new Ci.ImageLoader(o);
  45559. a.setCrossOrigin(this.crossOrigin);
  45560. for (var s = 0, l = e.length; s < l; s++) {
  45561. var c = e[s]
  45562. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45563. r[c.uuid] = i(h)
  45564. }
  45565. }
  45566. return r
  45567. },
  45568. parseTextures: function(e, t) {
  45569. function i(e) {
  45570. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45571. Ci[e])
  45572. }
  45573. var n = {};
  45574. if (void 0 !== e)
  45575. for (var r = 0, o = e.length; r < o; r++) {
  45576. var a = e[r];
  45577. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  45578. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  45579. var s = new Ci.Texture(t[a.image]);
  45580. s.needsUpdate = !0,
  45581. s.uuid = a.uuid,
  45582. void 0 !== a.name && (s.name = a.name),
  45583. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  45584. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  45585. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  45586. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  45587. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  45588. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  45589. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  45590. s.wrapT = i(a.wrap[1])),
  45591. n[a.uuid] = s
  45592. }
  45593. return n
  45594. },
  45595. parseObject: (ke = new Ci.Matrix4,
  45596. function(e, t, i) {
  45597. function n(e) {
  45598. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  45599. t[e]
  45600. }
  45601. function r(e) {
  45602. if (void 0 !== e)
  45603. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  45604. i[e]
  45605. }
  45606. var o;
  45607. switch (e.type) {
  45608. case "Scene":
  45609. o = new Ci.Scene;
  45610. break;
  45611. case "PerspectiveCamera":
  45612. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  45613. break;
  45614. case "OrthographicCamera":
  45615. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  45616. break;
  45617. case "AmbientLight":
  45618. o = new Ci.AmbientLight(e.color,e.intensity);
  45619. break;
  45620. case "DirectionalLight":
  45621. o = new Ci.DirectionalLight(e.color,e.intensity);
  45622. break;
  45623. case "PointLight":
  45624. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  45625. break;
  45626. case "SpotLight":
  45627. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  45628. break;
  45629. case "HemisphereLight":
  45630. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  45631. break;
  45632. case "Mesh":
  45633. var a = n(e.geometry)
  45634. , s = r(e.material);
  45635. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  45636. break;
  45637. case "LOD":
  45638. o = new Ci.LOD;
  45639. break;
  45640. case "Line":
  45641. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  45642. break;
  45643. case "PointCloud":
  45644. case "Points":
  45645. o = new Ci.Points(n(e.geometry),r(e.material));
  45646. break;
  45647. case "Sprite":
  45648. o = new Ci.Sprite(r(e.material));
  45649. break;
  45650. case "Group":
  45651. o = new Ci.Group;
  45652. break;
  45653. default:
  45654. o = new Ci.Object3D
  45655. }
  45656. if (o.uuid = e.uuid,
  45657. void 0 !== e.name && (o.name = e.name),
  45658. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  45659. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  45660. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  45661. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  45662. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  45663. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  45664. void 0 !== e.visible && (o.visible = e.visible),
  45665. void 0 !== e.userData && (o.userData = e.userData),
  45666. void 0 !== e.children)
  45667. for (var l in e.children)
  45668. o.add(this.parseObject(e.children[l], t, i));
  45669. if ("LOD" === e.type)
  45670. for (var c = e.levels, h = 0; h < c.length; h++) {
  45671. var u = c[h];
  45672. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  45673. }
  45674. return o
  45675. }
  45676. )
  45677. },
  45678. Ci.TextureLoader = function(e) {
  45679. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45680. }
  45681. ,
  45682. Ci.TextureLoader.prototype = {
  45683. constructor: Ci.TextureLoader,
  45684. load: function(e, t, i, n) {
  45685. var r = new Ci.Texture
  45686. , o = new Ci.ImageLoader(this.manager);
  45687. return o.setCrossOrigin(this.crossOrigin),
  45688. o.setPath(this.path),
  45689. o.load(e, function(e) {
  45690. r.image = e,
  45691. r.needsUpdate = !0,
  45692. void 0 !== t && t(r)
  45693. }, i, n),
  45694. r
  45695. },
  45696. setCrossOrigin: function(e) {
  45697. this.crossOrigin = e
  45698. },
  45699. setPath: function(e) {
  45700. this.path = e
  45701. }
  45702. },
  45703. Ci.CubeTextureLoader = function(e) {
  45704. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45705. }
  45706. ,
  45707. Ci.CubeTextureLoader.prototype = {
  45708. constructor: Ci.CubeTextureLoader,
  45709. load: function(e, i, t, n) {
  45710. function r(t) {
  45711. a.load(e[t], function(e) {
  45712. o.images[t] = e,
  45713. 6 === ++s && (o.needsUpdate = !0,
  45714. i && i(o))
  45715. }, void 0, n)
  45716. }
  45717. var o = new Ci.CubeTexture
  45718. , a = new Ci.ImageLoader(this.manager);
  45719. a.setCrossOrigin(this.crossOrigin),
  45720. a.setPath(this.path);
  45721. for (var s = 0, l = 0; l < e.length; ++l)
  45722. r(l);
  45723. return o
  45724. },
  45725. setCrossOrigin: function(e) {
  45726. this.crossOrigin = e
  45727. },
  45728. setPath: function(e) {
  45729. this.path = e
  45730. }
  45731. },
  45732. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  45733. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45734. this._parser = null
  45735. }
  45736. ,
  45737. Ci.BinaryTextureLoader.prototype = {
  45738. constructor: Ci.BinaryTextureLoader,
  45739. load: function(e, i, t, n) {
  45740. var r = this
  45741. , o = new Ci.DataTexture
  45742. , a = new Ci.XHRLoader(this.manager);
  45743. return a.setResponseType("arraybuffer"),
  45744. a.load(e, function(e) {
  45745. var t = r._parser(e);
  45746. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  45747. o.image.height = t.height,
  45748. o.image.data = t.data),
  45749. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  45750. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  45751. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  45752. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  45753. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  45754. void 0 !== t.format && (o.format = t.format),
  45755. void 0 !== t.type && (o.type = t.type),
  45756. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  45757. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  45758. o.needsUpdate = !0,
  45759. i && i(o, t))
  45760. }, t, n),
  45761. o
  45762. }
  45763. },
  45764. Ci.CompressedTextureLoader = function(e) {
  45765. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45766. this._parser = null
  45767. }
  45768. ,
  45769. Ci.CompressedTextureLoader.prototype = {
  45770. constructor: Ci.CompressedTextureLoader,
  45771. load: function(e, o, t, n) {
  45772. function i(i) {
  45773. r.load(e[i], function(e) {
  45774. var t = a._parser(e, !0);
  45775. s[i] = {
  45776. width: t.width,
  45777. height: t.height,
  45778. format: t.format,
  45779. mipmaps: t.mipmaps
  45780. },
  45781. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45782. l.format = t.format,
  45783. l.needsUpdate = !0,
  45784. o && o(l))
  45785. }, t, n)
  45786. }
  45787. var a = this
  45788. , s = []
  45789. , l = new Ci.CompressedTexture;
  45790. l.image = s;
  45791. var r = new Ci.XHRLoader(this.manager);
  45792. if (r.setPath(this.path),
  45793. r.setResponseType("arraybuffer"),
  45794. Array.isArray(e))
  45795. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  45796. i(h);
  45797. else
  45798. r.load(e, function(e) {
  45799. var t = a._parser(e, !0);
  45800. if (t.isCubemap)
  45801. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  45802. s[n] = {
  45803. mipmaps: []
  45804. };
  45805. for (var r = 0; r < t.mipmapCount; r++)
  45806. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  45807. s[n].format = t.format,
  45808. s[n].width = t.width,
  45809. s[n].height = t.height
  45810. }
  45811. else
  45812. l.image.width = t.width,
  45813. l.image.height = t.height,
  45814. l.mipmaps = t.mipmaps;
  45815. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45816. l.format = t.format,
  45817. l.needsUpdate = !0,
  45818. o && o(l)
  45819. }, t, n);
  45820. return l
  45821. },
  45822. setPath: function(e) {
  45823. this.path = e
  45824. }
  45825. },
  45826. Ci.Material = function() {
  45827. Object.defineProperty(this, "id", {
  45828. value: Ci.MaterialIdCount++
  45829. }),
  45830. this.uuid = Ci.Math.generateUUID(),
  45831. this.name = "",
  45832. this.type = "Material",
  45833. this.side = Ci.FrontSide,
  45834. this.opacity = 1,
  45835. this.transparent = !1,
  45836. this.blending = Ci.NormalBlending,
  45837. this.blendSrc = Ci.SrcAlphaFactor,
  45838. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  45839. this.blendEquation = Ci.AddEquation,
  45840. this.blendSrcAlpha = null,
  45841. this.blendDstAlpha = null,
  45842. this.blendEquationAlpha = null,
  45843. this.depthFunc = Ci.LessEqualDepth,
  45844. this.depthTest = !0,
  45845. this.depthWrite = !0,
  45846. this.colorWrite = !0,
  45847. this.precision = null,
  45848. this.polygonOffset = !1,
  45849. this.polygonOffsetFactor = 0,
  45850. this.polygonOffsetUnits = 0,
  45851. this.alphaTest = 0,
  45852. this.premultipliedAlpha = !1,
  45853. this.overdraw = 0,
  45854. this.visible = !0,
  45855. this._needsUpdate = !0
  45856. }
  45857. ,
  45858. Ci.Material.prototype = {
  45859. constructor: Ci.Material,
  45860. get needsUpdate() {
  45861. return this._needsUpdate
  45862. },
  45863. set needsUpdate(e) {
  45864. !0 === e && this.update(),
  45865. this._needsUpdate = e
  45866. },
  45867. setValues: function(e) {
  45868. if (void 0 !== e)
  45869. for (var t in e) {
  45870. var i = e[t];
  45871. if (void 0 !== i) {
  45872. var n = this[t];
  45873. void 0 !== n ? n instanceof Ci.Color ? n.set(i) : n instanceof Ci.Vector3 && i instanceof Ci.Vector3 ? n.copy(i) : this[t] = "overdraw" === t ? Number(i) : i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  45874. } else
  45875. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  45876. }
  45877. },
  45878. toJSON: function(e) {
  45879. function t(e) {
  45880. var t = [];
  45881. for (var i in e) {
  45882. var n = e[i];
  45883. delete n.metadata,
  45884. t.push(n)
  45885. }
  45886. return t
  45887. }
  45888. var i = void 0 === e;
  45889. i && (e = {
  45890. textures: {},
  45891. images: {}
  45892. });
  45893. var n = {
  45894. metadata: {
  45895. version: 4.4,
  45896. type: "Material",
  45897. generator: "Material.toJSON"
  45898. }
  45899. };
  45900. if (n.uuid = this.uuid,
  45901. n.type = this.type,
  45902. "" !== this.name && (n.name = this.name),
  45903. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  45904. .5 !== this.roughness && (n.roughness = this.roughness),
  45905. .5 !== this.metalness && (n.metalness = this.metalness),
  45906. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  45907. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  45908. void 0 !== this.shininess && (n.shininess = this.shininess),
  45909. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  45910. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  45911. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  45912. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  45913. n.bumpScale = this.bumpScale),
  45914. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  45915. n.normalScale = this.normalScale.toArray()),
  45916. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  45917. n.displacementScale = this.displacementScale,
  45918. n.displacementBias = this.displacementBias),
  45919. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  45920. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  45921. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  45922. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  45923. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  45924. n.reflectivity = this.reflectivity),
  45925. void 0 !== this.size && (n.size = this.size),
  45926. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  45927. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  45928. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  45929. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  45930. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  45931. this.opacity < 1 && (n.opacity = this.opacity),
  45932. !0 === this.transparent && (n.transparent = this.transparent),
  45933. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  45934. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  45935. !0 === this.wireframe && (n.wireframe = this.wireframe),
  45936. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  45937. i) {
  45938. var r = t(e.textures)
  45939. , o = t(e.images);
  45940. 0 < r.length && (n.textures = r),
  45941. 0 < o.length && (n.images = o)
  45942. }
  45943. return n
  45944. },
  45945. clone: function() {
  45946. return (new this.constructor).copy(this)
  45947. },
  45948. copy: function(e) {
  45949. return this.name = e.name,
  45950. this.side = e.side,
  45951. this.opacity = e.opacity,
  45952. this.transparent = e.transparent,
  45953. this.blending = e.blending,
  45954. this.blendSrc = e.blendSrc,
  45955. this.blendDst = e.blendDst,
  45956. this.blendEquation = e.blendEquation,
  45957. this.blendSrcAlpha = e.blendSrcAlpha,
  45958. this.blendDstAlpha = e.blendDstAlpha,
  45959. this.blendEquationAlpha = e.blendEquationAlpha,
  45960. this.depthFunc = e.depthFunc,
  45961. this.depthTest = e.depthTest,
  45962. this.depthWrite = e.depthWrite,
  45963. this.colorWrite = e.colorWrite,
  45964. this.precision = e.precision,
  45965. this.polygonOffset = e.polygonOffset,
  45966. this.polygonOffsetFactor = e.polygonOffsetFactor,
  45967. this.polygonOffsetUnits = e.polygonOffsetUnits,
  45968. this.alphaTest = e.alphaTest,
  45969. this.premultipliedAlpha = e.premultipliedAlpha,
  45970. this.overdraw = e.overdraw,
  45971. this.visible = e.visible,
  45972. this
  45973. },
  45974. update: function() {
  45975. this.dispatchEvent({
  45976. type: "update"
  45977. })
  45978. },
  45979. dispose: function() {
  45980. this.dispatchEvent({
  45981. type: "dispose"
  45982. })
  45983. }
  45984. },
  45985. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  45986. Ci.MaterialIdCount = 0,
  45987. Ci.LineBasicMaterial = function(e) {
  45988. Ci.Material.call(this),
  45989. this.type = "LineBasicMaterial",
  45990. this.color = new Ci.Color(16777215),
  45991. this.linewidth = 1,
  45992. this.linecap = "round",
  45993. this.linejoin = "round",
  45994. this.blending = Ci.NormalBlending,
  45995. this.vertexColors = Ci.NoColors,
  45996. this.fog = !0,
  45997. this.setValues(e)
  45998. }
  45999. ,
  46000. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46001. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46002. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46003. return Ci.Material.prototype.copy.call(this, e),
  46004. this.color.copy(e.color),
  46005. this.linewidth = e.linewidth,
  46006. this.linecap = e.linecap,
  46007. this.linejoin = e.linejoin,
  46008. this.vertexColors = e.vertexColors,
  46009. this.fog = e.fog,
  46010. this
  46011. }
  46012. ,
  46013. Ci.LineDashedMaterial = function(e) {
  46014. Ci.Material.call(this),
  46015. this.type = "LineDashedMaterial",
  46016. this.color = new Ci.Color(16777215),
  46017. this.linewidth = 1,
  46018. this.scale = 1,
  46019. this.dashSize = 3,
  46020. this.gapSize = 1,
  46021. this.blending = Ci.NormalBlending,
  46022. this.vertexColors = Ci.NoColors,
  46023. this.fog = !0,
  46024. this.setValues(e)
  46025. }
  46026. ,
  46027. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46028. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46029. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46030. return Ci.Material.prototype.copy.call(this, e),
  46031. this.color.copy(e.color),
  46032. this.linewidth = e.linewidth,
  46033. this.scale = e.scale,
  46034. this.dashSize = e.dashSize,
  46035. this.gapSize = e.gapSize,
  46036. this.vertexColors = e.vertexColors,
  46037. this.fog = e.fog,
  46038. this
  46039. }
  46040. ,
  46041. Ci.MeshBasicMaterial = function(e) {
  46042. Ci.Material.call(this),
  46043. this.type = "MeshBasicMaterial",
  46044. this.color = new Ci.Color(16777215),
  46045. this.map = null,
  46046. this.aoMap = null,
  46047. this.aoMapIntensity = 1,
  46048. this.specularMap = null,
  46049. this.alphaMap = null,
  46050. this.envMap = null,
  46051. this.combine = Ci.MultiplyOperation,
  46052. this.reflectivity = 1,
  46053. this.refractionRatio = .98,
  46054. this.fog = !0,
  46055. this.shading = Ci.SmoothShading,
  46056. this.blending = Ci.NormalBlending,
  46057. this.wireframe = !1,
  46058. this.wireframeLinewidth = 1,
  46059. this.wireframeLinecap = "round",
  46060. this.wireframeLinejoin = "round",
  46061. this.vertexColors = Ci.NoColors,
  46062. this.skinning = !1,
  46063. this.morphTargets = !1,
  46064. this.setValues(e)
  46065. }
  46066. ,
  46067. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46068. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46069. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46070. return Ci.Material.prototype.copy.call(this, e),
  46071. this.color.copy(e.color),
  46072. this.map = e.map,
  46073. this.aoMap = e.aoMap,
  46074. this.aoMapIntensity = e.aoMapIntensity,
  46075. this.specularMap = e.specularMap,
  46076. this.alphaMap = e.alphaMap,
  46077. this.envMap = e.envMap,
  46078. this.combine = e.combine,
  46079. this.reflectivity = e.reflectivity,
  46080. this.refractionRatio = e.refractionRatio,
  46081. this.fog = e.fog,
  46082. this.shading = e.shading,
  46083. this.wireframe = e.wireframe,
  46084. this.wireframeLinewidth = e.wireframeLinewidth,
  46085. this.wireframeLinecap = e.wireframeLinecap,
  46086. this.wireframeLinejoin = e.wireframeLinejoin,
  46087. this.vertexColors = e.vertexColors,
  46088. this.skinning = e.skinning,
  46089. this.morphTargets = e.morphTargets,
  46090. this
  46091. }
  46092. ,
  46093. Ci.MeshLambertMaterial = function(e) {
  46094. Ci.Material.call(this),
  46095. this.type = "MeshLambertMaterial",
  46096. this.color = new Ci.Color(16777215),
  46097. this.map = null,
  46098. this.lightMap = null,
  46099. this.lightMapIntensity = 1,
  46100. this.aoMap = null,
  46101. this.aoMapIntensity = 1,
  46102. this.emissive = new Ci.Color(0),
  46103. this.emissiveIntensity = 1,
  46104. this.emissiveMap = null,
  46105. this.specularMap = null,
  46106. this.alphaMap = null,
  46107. this.envMap = null,
  46108. this.combine = Ci.MultiplyOperation,
  46109. this.reflectivity = 1,
  46110. this.refractionRatio = .98,
  46111. this.fog = !0,
  46112. this.blending = Ci.NormalBlending,
  46113. this.wireframe = !1,
  46114. this.wireframeLinewidth = 1,
  46115. this.wireframeLinecap = "round",
  46116. this.wireframeLinejoin = "round",
  46117. this.vertexColors = Ci.NoColors,
  46118. this.skinning = !1,
  46119. this.morphTargets = !1,
  46120. this.morphNormals = !1,
  46121. this.setValues(e)
  46122. }
  46123. ,
  46124. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46125. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46126. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46127. return Ci.Material.prototype.copy.call(this, e),
  46128. this.color.copy(e.color),
  46129. this.map = e.map,
  46130. this.lightMap = e.lightMap,
  46131. this.lightMapIntensity = e.lightMapIntensity,
  46132. this.aoMap = e.aoMap,
  46133. this.aoMapIntensity = e.aoMapIntensity,
  46134. this.emissive.copy(e.emissive),
  46135. this.emissiveMap = e.emissiveMap,
  46136. this.emissiveIntensity = e.emissiveIntensity,
  46137. this.specularMap = e.specularMap,
  46138. this.alphaMap = e.alphaMap,
  46139. this.envMap = e.envMap,
  46140. this.combine = e.combine,
  46141. this.reflectivity = e.reflectivity,
  46142. this.refractionRatio = e.refractionRatio,
  46143. this.fog = e.fog,
  46144. this.wireframe = e.wireframe,
  46145. this.wireframeLinewidth = e.wireframeLinewidth,
  46146. this.wireframeLinecap = e.wireframeLinecap,
  46147. this.wireframeLinejoin = e.wireframeLinejoin,
  46148. this.vertexColors = e.vertexColors,
  46149. this.skinning = e.skinning,
  46150. this.morphTargets = e.morphTargets,
  46151. this.morphNormals = e.morphNormals,
  46152. this
  46153. }
  46154. ,
  46155. Ci.MeshPhongMaterial = function(e) {
  46156. Ci.Material.call(this),
  46157. this.type = "MeshPhongMaterial",
  46158. this.color = new Ci.Color(16777215),
  46159. this.specular = new Ci.Color(1118481),
  46160. this.shininess = 30,
  46161. this.map = null,
  46162. this.lightMap = null,
  46163. this.lightMapIntensity = 1,
  46164. this.aoMap = null,
  46165. this.aoMapIntensity = 1,
  46166. this.emissive = new Ci.Color(0),
  46167. this.emissiveIntensity = 1,
  46168. this.emissiveMap = null,
  46169. this.bumpMap = null,
  46170. this.bumpScale = 1,
  46171. this.normalMap = null,
  46172. this.normalScale = new Ci.Vector2(1,1),
  46173. this.displacementMap = null,
  46174. this.displacementScale = 1,
  46175. this.displacementBias = 0,
  46176. this.specularMap = null,
  46177. this.alphaMap = null,
  46178. this.envMap = null,
  46179. this.combine = Ci.MultiplyOperation,
  46180. this.reflectivity = 1,
  46181. this.refractionRatio = .98,
  46182. this.fog = !0,
  46183. this.shading = Ci.SmoothShading,
  46184. this.blending = Ci.NormalBlending,
  46185. this.wireframe = !1,
  46186. this.wireframeLinewidth = 1,
  46187. this.wireframeLinecap = "round",
  46188. this.wireframeLinejoin = "round",
  46189. this.vertexColors = Ci.NoColors,
  46190. this.skinning = !1,
  46191. this.morphTargets = !1,
  46192. this.morphNormals = !1,
  46193. this.setValues(e)
  46194. }
  46195. ,
  46196. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46197. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46198. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46199. return Ci.Material.prototype.copy.call(this, e),
  46200. this.color.copy(e.color),
  46201. this.specular.copy(e.specular),
  46202. this.shininess = e.shininess,
  46203. this.map = e.map,
  46204. this.lightMap = e.lightMap,
  46205. this.lightMapIntensity = e.lightMapIntensity,
  46206. this.aoMap = e.aoMap,
  46207. this.aoMapIntensity = e.aoMapIntensity,
  46208. this.emissive.copy(e.emissive),
  46209. this.emissiveMap = e.emissiveMap,
  46210. this.emissiveIntensity = e.emissiveIntensity,
  46211. this.bumpMap = e.bumpMap,
  46212. this.bumpScale = e.bumpScale,
  46213. this.normalMap = e.normalMap,
  46214. this.normalScale.copy(e.normalScale),
  46215. this.displacementMap = e.displacementMap,
  46216. this.displacementScale = e.displacementScale,
  46217. this.displacementBias = e.displacementBias,
  46218. this.specularMap = e.specularMap,
  46219. this.alphaMap = e.alphaMap,
  46220. this.envMap = e.envMap,
  46221. this.combine = e.combine,
  46222. this.reflectivity = e.reflectivity,
  46223. this.refractionRatio = e.refractionRatio,
  46224. this.fog = e.fog,
  46225. this.shading = e.shading,
  46226. this.wireframe = e.wireframe,
  46227. this.wireframeLinewidth = e.wireframeLinewidth,
  46228. this.wireframeLinecap = e.wireframeLinecap,
  46229. this.wireframeLinejoin = e.wireframeLinejoin,
  46230. this.vertexColors = e.vertexColors,
  46231. this.skinning = e.skinning,
  46232. this.morphTargets = e.morphTargets,
  46233. this.morphNormals = e.morphNormals,
  46234. this
  46235. }
  46236. ,
  46237. Ci.MeshStandardMaterial = function(e) {
  46238. Ci.Material.call(this),
  46239. this.type = "MeshStandardMaterial",
  46240. this.color = new Ci.Color(16777215),
  46241. this.roughness = .5,
  46242. this.metalness = .5,
  46243. this.map = null,
  46244. this.lightMap = null,
  46245. this.lightMapIntensity = 1,
  46246. this.aoMap = null,
  46247. this.aoMapIntensity = 1,
  46248. this.emissive = new Ci.Color(0),
  46249. this.emissiveIntensity = 1,
  46250. this.emissiveMap = null,
  46251. this.bumpMap = null,
  46252. this.bumpScale = 1,
  46253. this.normalMap = null,
  46254. this.normalScale = new Ci.Vector2(1,1),
  46255. this.displacementMap = null,
  46256. this.displacementScale = 1,
  46257. this.displacementBias = 0,
  46258. this.roughnessMap = null,
  46259. this.metalnessMap = null,
  46260. this.alphaMap = null,
  46261. this.envMap = null,
  46262. this.envMapIntensity = 1,
  46263. this.refractionRatio = .98,
  46264. this.fog = !0,
  46265. this.shading = Ci.SmoothShading,
  46266. this.blending = Ci.NormalBlending,
  46267. this.wireframe = !1,
  46268. this.wireframeLinewidth = 1,
  46269. this.wireframeLinecap = "round",
  46270. this.wireframeLinejoin = "round",
  46271. this.vertexColors = Ci.NoColors,
  46272. this.skinning = !1,
  46273. this.morphTargets = !1,
  46274. this.morphNormals = !1,
  46275. this.setValues(e)
  46276. }
  46277. ,
  46278. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46279. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46280. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46281. return Ci.Material.prototype.copy.call(this, e),
  46282. this.color.copy(e.color),
  46283. this.roughness = e.roughness,
  46284. this.metalness = e.metalness,
  46285. this.map = e.map,
  46286. this.lightMap = e.lightMap,
  46287. this.lightMapIntensity = e.lightMapIntensity,
  46288. this.aoMap = e.aoMap,
  46289. this.aoMapIntensity = e.aoMapIntensity,
  46290. this.emissive.copy(e.emissive),
  46291. this.emissiveMap = e.emissiveMap,
  46292. this.emissiveIntensity = e.emissiveIntensity,
  46293. this.bumpMap = e.bumpMap,
  46294. this.bumpScale = e.bumpScale,
  46295. this.normalMap = e.normalMap,
  46296. this.normalScale.copy(e.normalScale),
  46297. this.displacementMap = e.displacementMap,
  46298. this.displacementScale = e.displacementScale,
  46299. this.displacementBias = e.displacementBias,
  46300. this.roughnessMap = e.roughnessMap,
  46301. this.metalnessMap = e.metalnessMap,
  46302. this.alphaMap = e.alphaMap,
  46303. this.envMap = e.envMap,
  46304. this.envMapIntensity = e.envMapIntensity,
  46305. this.refractionRatio = e.refractionRatio,
  46306. this.fog = e.fog,
  46307. this.shading = e.shading,
  46308. this.wireframe = e.wireframe,
  46309. this.wireframeLinewidth = e.wireframeLinewidth,
  46310. this.wireframeLinecap = e.wireframeLinecap,
  46311. this.wireframeLinejoin = e.wireframeLinejoin,
  46312. this.vertexColors = e.vertexColors,
  46313. this.skinning = e.skinning,
  46314. this.morphTargets = e.morphTargets,
  46315. this.morphNormals = e.morphNormals,
  46316. this
  46317. }
  46318. ,
  46319. Ci.MeshDepthMaterial = function(e) {
  46320. Ci.Material.call(this),
  46321. this.type = "MeshDepthMaterial",
  46322. this.morphTargets = !1,
  46323. this.wireframe = !1,
  46324. this.wireframeLinewidth = 1,
  46325. this.setValues(e)
  46326. }
  46327. ,
  46328. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46329. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46330. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46331. return Ci.Material.prototype.copy.call(this, e),
  46332. this.wireframe = e.wireframe,
  46333. this.wireframeLinewidth = e.wireframeLinewidth,
  46334. this
  46335. }
  46336. ,
  46337. Ci.MeshNormalMaterial = function(e) {
  46338. Ci.Material.call(this, e),
  46339. this.type = "MeshNormalMaterial",
  46340. this.wireframe = !1,
  46341. this.wireframeLinewidth = 1,
  46342. this.morphTargets = !1,
  46343. this.setValues(e)
  46344. }
  46345. ,
  46346. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46347. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46348. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46349. return Ci.Material.prototype.copy.call(this, e),
  46350. this.wireframe = e.wireframe,
  46351. this.wireframeLinewidth = e.wireframeLinewidth,
  46352. this
  46353. }
  46354. ,
  46355. Ci.MultiMaterial = function(e) {
  46356. this.uuid = Ci.Math.generateUUID(),
  46357. this.type = "MultiMaterial",
  46358. this.materials = e instanceof Array ? e : [],
  46359. this.visible = !0
  46360. }
  46361. ,
  46362. Ci.MultiMaterial.prototype = {
  46363. constructor: Ci.MultiMaterial,
  46364. toJSON: function(e) {
  46365. for (var t = {
  46366. metadata: {
  46367. version: 4.2,
  46368. type: "material",
  46369. generator: "MaterialExporter"
  46370. },
  46371. uuid: this.uuid,
  46372. type: this.type,
  46373. materials: []
  46374. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46375. var o = i[n].toJSON(e);
  46376. delete o.metadata,
  46377. t.materials.push(o)
  46378. }
  46379. return t.visible = this.visible,
  46380. t
  46381. },
  46382. clone: function() {
  46383. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46384. e.materials.push(this.materials[t].clone());
  46385. return e.visible = this.visible,
  46386. e
  46387. }
  46388. },
  46389. Ci.PointsMaterial = function(e) {
  46390. Ci.Material.call(this),
  46391. this.type = "PointsMaterial",
  46392. this.color = new Ci.Color(16777215),
  46393. this.map = null,
  46394. this.size = 1,
  46395. this.sizeAttenuation = !0,
  46396. this.blending = Ci.NormalBlending,
  46397. this.vertexColors = Ci.NoColors,
  46398. this.fog = !0,
  46399. this.setValues(e)
  46400. }
  46401. ,
  46402. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46403. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46404. Ci.PointsMaterial.prototype.copy = function(e) {
  46405. return Ci.Material.prototype.copy.call(this, e),
  46406. this.color.copy(e.color),
  46407. this.map = e.map,
  46408. this.size = e.size,
  46409. this.sizeAttenuation = e.sizeAttenuation,
  46410. this.vertexColors = e.vertexColors,
  46411. this.fog = e.fog,
  46412. this
  46413. }
  46414. ,
  46415. Ci.ShaderMaterial = function(e) {
  46416. Ci.Material.call(this),
  46417. this.type = "ShaderMaterial",
  46418. this.defines = {},
  46419. this.uniforms = {},
  46420. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46421. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46422. this.shading = Ci.SmoothShading,
  46423. this.linewidth = 1,
  46424. this.wireframe = !1,
  46425. this.wireframeLinewidth = 1,
  46426. this.fog = !1,
  46427. this.lights = !1,
  46428. this.vertexColors = Ci.NoColors,
  46429. this.skinning = !1,
  46430. this.morphTargets = !1,
  46431. this.morphNormals = !1,
  46432. this.extensions = {
  46433. derivatives: !1,
  46434. fragDepth: !1,
  46435. drawBuffers: !1,
  46436. shaderTextureLOD: !1
  46437. },
  46438. this.defaultAttributeValues = {
  46439. color: [1, 1, 1],
  46440. uv: [0, 0],
  46441. uv2: [0, 0]
  46442. },
  46443. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46444. this.setValues(e))
  46445. }
  46446. ,
  46447. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46448. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46449. Ci.ShaderMaterial.prototype.copy = function(e) {
  46450. return Ci.Material.prototype.copy.call(this, e),
  46451. this.fragmentShader = e.fragmentShader,
  46452. this.vertexShader = e.vertexShader,
  46453. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46454. this.defines = e.defines,
  46455. this.shading = e.shading,
  46456. this.wireframe = e.wireframe,
  46457. this.wireframeLinewidth = e.wireframeLinewidth,
  46458. this.fog = e.fog,
  46459. this.lights = e.lights,
  46460. this.vertexColors = e.vertexColors,
  46461. this.skinning = e.skinning,
  46462. this.morphTargets = e.morphTargets,
  46463. this.morphNormals = e.morphNormals,
  46464. this.extensions = e.extensions,
  46465. this
  46466. }
  46467. ,
  46468. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46469. var t = Ci.Material.prototype.toJSON.call(this, e);
  46470. return t.uniforms = this.uniforms,
  46471. t.vertexShader = this.vertexShader,
  46472. t.fragmentShader = this.fragmentShader,
  46473. t
  46474. }
  46475. ,
  46476. Ci.RawShaderMaterial = function(e) {
  46477. Ci.ShaderMaterial.call(this, e),
  46478. this.type = "RawShaderMaterial"
  46479. }
  46480. ,
  46481. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46482. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46483. Ci.SpriteMaterial = function(e) {
  46484. Ci.Material.call(this),
  46485. this.type = "SpriteMaterial",
  46486. this.color = new Ci.Color(16777215),
  46487. this.map = null,
  46488. this.rotation = 0,
  46489. this.fog = !1,
  46490. this.setValues(e)
  46491. }
  46492. ,
  46493. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46494. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46495. Ci.SpriteMaterial.prototype.copy = function(e) {
  46496. return Ci.Material.prototype.copy.call(this, e),
  46497. this.color.copy(e.color),
  46498. this.map = e.map,
  46499. this.rotation = e.rotation,
  46500. this.fog = e.fog,
  46501. this
  46502. }
  46503. ,
  46504. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46505. Object.defineProperty(this, "id", {
  46506. value: Ci.TextureIdCount++
  46507. }),
  46508. this.uuid = Ci.Math.generateUUID(),
  46509. this.name = "",
  46510. this.sourceFile = "",
  46511. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46512. this.mipmaps = [],
  46513. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46514. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46515. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46516. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46517. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46518. this.anisotropy = void 0 !== l ? l : 1,
  46519. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46520. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46521. this.offset = new Ci.Vector2(0,0),
  46522. this.repeat = new Ci.Vector2(1,1),
  46523. this.generateMipmaps = !0,
  46524. this.premultiplyAlpha = !1,
  46525. this.flipY = !0,
  46526. this.unpackAlignment = 4,
  46527. this.encoding = Ci.LinearEncoding,
  46528. this.version = 0,
  46529. this.onUpdate = null
  46530. }
  46531. ,
  46532. Ci.Texture.DEFAULT_IMAGE = void 0,
  46533. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46534. Ci.Texture.prototype = {
  46535. constructor: Ci.Texture,
  46536. set needsUpdate(e) {
  46537. !0 === e && this.version++
  46538. },
  46539. clone: function() {
  46540. return (new this.constructor).copy(this)
  46541. },
  46542. copy: function(e) {
  46543. return this.image = e.image,
  46544. this.mipmaps = e.mipmaps.slice(0),
  46545. this.mapping = e.mapping,
  46546. this.wrapS = e.wrapS,
  46547. this.wrapT = e.wrapT,
  46548. this.magFilter = e.magFilter,
  46549. this.minFilter = e.minFilter,
  46550. this.anisotropy = e.anisotropy,
  46551. this.format = e.format,
  46552. this.type = e.type,
  46553. this.offset.copy(e.offset),
  46554. this.repeat.copy(e.repeat),
  46555. this.generateMipmaps = e.generateMipmaps,
  46556. this.premultiplyAlpha = e.premultiplyAlpha,
  46557. this.flipY = e.flipY,
  46558. this.unpackAlignment = e.unpackAlignment,
  46559. this.encoding = e.encoding,
  46560. this
  46561. },
  46562. toJSON: function(e) {
  46563. if (void 0 !== e.textures[this.uuid])
  46564. return e.textures[this.uuid];
  46565. var t, i, n = {
  46566. metadata: {
  46567. version: 4.4,
  46568. type: "Texture",
  46569. generator: "Texture.toJSON"
  46570. },
  46571. uuid: this.uuid,
  46572. name: this.name,
  46573. mapping: this.mapping,
  46574. repeat: [this.repeat.x, this.repeat.y],
  46575. offset: [this.offset.x, this.offset.y],
  46576. wrap: [this.wrapS, this.wrapT],
  46577. minFilter: this.minFilter,
  46578. magFilter: this.magFilter,
  46579. anisotropy: this.anisotropy
  46580. };
  46581. if (void 0 !== this.image) {
  46582. var r = this.image;
  46583. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  46584. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46585. uuid: r.uuid,
  46586. url: (t = r,
  46587. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  46588. i.height = t.height,
  46589. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  46590. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  46591. }),
  46592. n.image = r.uuid
  46593. }
  46594. return e.textures[this.uuid] = n
  46595. },
  46596. dispose: function() {
  46597. this.dispatchEvent({
  46598. type: "dispose"
  46599. })
  46600. },
  46601. transformUv: function(e) {
  46602. if (this.mapping === Ci.UVMapping) {
  46603. if (e.multiply(this.repeat),
  46604. e.add(this.offset),
  46605. e.x < 0 || 1 < e.x)
  46606. switch (this.wrapS) {
  46607. case Ci.RepeatWrapping:
  46608. e.x = e.x - Math.floor(e.x);
  46609. break;
  46610. case Ci.ClampToEdgeWrapping:
  46611. e.x = e.x < 0 ? 0 : 1;
  46612. break;
  46613. case Ci.MirroredRepeatWrapping:
  46614. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  46615. }
  46616. if (e.y < 0 || 1 < e.y)
  46617. switch (this.wrapT) {
  46618. case Ci.RepeatWrapping:
  46619. e.y = e.y - Math.floor(e.y);
  46620. break;
  46621. case Ci.ClampToEdgeWrapping:
  46622. e.y = e.y < 0 ? 0 : 1;
  46623. break;
  46624. case Ci.MirroredRepeatWrapping:
  46625. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  46626. }
  46627. this.flipY && (e.y = 1 - e.y)
  46628. }
  46629. }
  46630. },
  46631. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  46632. Ci.TextureIdCount = 0,
  46633. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  46634. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46635. this.needsUpdate = !0
  46636. }
  46637. ,
  46638. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  46639. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  46640. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  46641. e = void 0 !== e ? e : [],
  46642. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  46643. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46644. this.flipY = !1
  46645. }
  46646. ,
  46647. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  46648. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  46649. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  46650. get: function() {
  46651. return this.image
  46652. },
  46653. set: function(e) {
  46654. this.image = e
  46655. }
  46656. }),
  46657. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46658. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46659. this.image = {
  46660. width: t,
  46661. height: i
  46662. },
  46663. this.mipmaps = e,
  46664. this.flipY = !1,
  46665. this.generateMipmaps = !1
  46666. }
  46667. ,
  46668. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  46669. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  46670. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46671. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46672. this.image = {
  46673. data: e,
  46674. width: t,
  46675. height: i
  46676. },
  46677. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  46678. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  46679. this.flipY = !1,
  46680. this.generateMipmaps = !1
  46681. }
  46682. ,
  46683. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  46684. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  46685. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  46686. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  46687. this.generateMipmaps = !1;
  46688. var c = this;
  46689. !function e() {
  46690. requestAnimationFrame(e),
  46691. t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  46692. }()
  46693. }
  46694. ,
  46695. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  46696. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  46697. Ci.Group = function() {
  46698. Ci.Object3D.call(this),
  46699. this.type = "Group"
  46700. }
  46701. ,
  46702. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  46703. Ci.Group.prototype.constructor = Ci.Group,
  46704. Ci.Points = function(e, t) {
  46705. Ci.Object3D.call(this),
  46706. this.type = "Points",
  46707. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46708. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  46709. color: 16777215 * Math.random()
  46710. })
  46711. }
  46712. ,
  46713. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  46714. Ci.Points.prototype.constructor = Ci.Points,
  46715. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  46716. jt = new Ci.Ray,
  46717. Yt = new Ci.Sphere,
  46718. function(o, a) {
  46719. function e(e, t) {
  46720. var i = jt.distanceSqToPoint(e);
  46721. if (i < c) {
  46722. var n = jt.closestPointToPoint(e);
  46723. n.applyMatrix4(l);
  46724. var r = o.ray.origin.distanceTo(n);
  46725. if (r < o.near || r > o.far)
  46726. return;
  46727. a.push({
  46728. distance: r,
  46729. distanceToRay: Math.sqrt(i),
  46730. point: n.clone(),
  46731. index: t,
  46732. face: null,
  46733. object: s
  46734. })
  46735. }
  46736. }
  46737. var s = this
  46738. , t = this.geometry
  46739. , l = this.matrixWorld
  46740. , i = o.params.Points.threshold;
  46741. if (null === t.boundingSphere && t.computeBoundingSphere(),
  46742. Yt.copy(t.boundingSphere),
  46743. Yt.applyMatrix4(l),
  46744. !1 !== o.ray.intersectsSphere(Yt)) {
  46745. Wt.getInverse(l),
  46746. jt.copy(o.ray).applyMatrix4(Wt);
  46747. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  46748. , c = n * n
  46749. , r = new Ci.Vector3;
  46750. if (t instanceof Ci.BufferGeometry) {
  46751. var h = t.index
  46752. , u = t.attributes.position.array;
  46753. if (null !== h)
  46754. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  46755. var g = d[p];
  46756. r.fromArray(u, 3 * g),
  46757. e(r, g)
  46758. }
  46759. else {
  46760. p = 0;
  46761. for (var m = u.length / 3; p < m; p++)
  46762. r.fromArray(u, 3 * p),
  46763. e(r, p)
  46764. }
  46765. } else {
  46766. var v = t.vertices;
  46767. for (p = 0,
  46768. m = v.length; p < m; p++)
  46769. e(v[p], p)
  46770. }
  46771. }
  46772. }
  46773. ),
  46774. Ci.Points.prototype.clone = function() {
  46775. return new this.constructor(this.geometry,this.material).copy(this)
  46776. }
  46777. ,
  46778. Ci.Line = function(e, t, i) {
  46779. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  46780. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  46781. this.type = "Line",
  46782. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46783. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  46784. color: 16777215 * Math.random()
  46785. })))
  46786. }
  46787. ,
  46788. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  46789. Ci.Line.prototype.constructor = Ci.Line,
  46790. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  46791. zt = new Ci.Ray,
  46792. Gt = new Ci.Sphere,
  46793. function(e, t) {
  46794. var i = e.linePrecision
  46795. , n = i * i
  46796. , r = this.geometry
  46797. , o = this.matrixWorld;
  46798. if (null === r.boundingSphere && r.computeBoundingSphere(),
  46799. Gt.copy(r.boundingSphere),
  46800. Gt.applyMatrix4(o),
  46801. !1 !== e.ray.intersectsSphere(Gt)) {
  46802. Ht.getInverse(o),
  46803. zt.copy(e.ray).applyMatrix4(Ht);
  46804. var a = new Ci.Vector3
  46805. , s = new Ci.Vector3
  46806. , l = new Ci.Vector3
  46807. , c = new Ci.Vector3
  46808. , h = this instanceof Ci.LineSegments ? 2 : 1;
  46809. if (r instanceof Ci.BufferGeometry) {
  46810. var u = r.index
  46811. , d = r.attributes.position.array;
  46812. if (null !== u)
  46813. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  46814. var m = p[f]
  46815. , v = p[f + 1];
  46816. a.fromArray(d, 3 * m),
  46817. s.fromArray(d, 3 * v),
  46818. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  46819. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46820. distance: C,
  46821. point: l.clone().applyMatrix4(this.matrixWorld),
  46822. index: f,
  46823. face: null,
  46824. faceIndex: null,
  46825. object: this
  46826. }))
  46827. }
  46828. else
  46829. for (f = 0,
  46830. g = d.length / 3 - 1; f < g; f += h)
  46831. a.fromArray(d, 3 * f),
  46832. s.fromArray(d, 3 * f + 3),
  46833. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  46834. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46835. distance: C,
  46836. point: l.clone().applyMatrix4(this.matrixWorld),
  46837. index: f,
  46838. face: null,
  46839. faceIndex: null,
  46840. object: this
  46841. }))
  46842. } else if (r instanceof Ci.Geometry) {
  46843. var y = r.vertices
  46844. , A = y.length;
  46845. for (f = 0; f < A - 1; f += h) {
  46846. var C;
  46847. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  46848. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46849. distance: C,
  46850. point: l.clone().applyMatrix4(this.matrixWorld),
  46851. index: f,
  46852. face: null,
  46853. faceIndex: null,
  46854. object: this
  46855. }))
  46856. }
  46857. }
  46858. }
  46859. }
  46860. ),
  46861. Ci.Line.prototype.clone = function() {
  46862. return new this.constructor(this.geometry,this.material).copy(this)
  46863. }
  46864. ,
  46865. Ci.LineStrip = 0,
  46866. Ci.LinePieces = 1,
  46867. Ci.LineSegments = function(e, t) {
  46868. Ci.Line.call(this, e, t),
  46869. this.type = "LineSegments"
  46870. }
  46871. ,
  46872. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  46873. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  46874. Ci.Mesh = function(e, t) {
  46875. Ci.Object3D.call(this),
  46876. this.type = "Mesh",
  46877. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46878. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  46879. color: 16777215 * Math.random()
  46880. }),
  46881. this.drawMode = Ci.TrianglesDrawMode,
  46882. this.updateMorphTargets()
  46883. }
  46884. ,
  46885. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  46886. Ci.Mesh.prototype.constructor = Ci.Mesh,
  46887. Ci.Mesh.prototype.setDrawMode = function(e) {
  46888. this.drawMode = e
  46889. }
  46890. ,
  46891. Ci.Mesh.prototype.updateMorphTargets = function() {
  46892. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  46893. this.morphTargetBase = -1,
  46894. this.morphTargetInfluences = [],
  46895. this.morphTargetDictionary = {};
  46896. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  46897. this.morphTargetInfluences.push(0),
  46898. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  46899. }
  46900. }
  46901. ,
  46902. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  46903. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  46904. 0)
  46905. }
  46906. ,
  46907. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  46908. xt = new Ci.Ray,
  46909. St = new Ci.Sphere,
  46910. Mt = new Ci.Vector3,
  46911. Rt = new Ci.Vector3,
  46912. Pt = new Ci.Vector3,
  46913. Ot = new Ci.Vector3,
  46914. Lt = new Ci.Vector3,
  46915. Dt = new Ci.Vector3,
  46916. Nt = new Ci.Vector2,
  46917. Ft = new Ci.Vector2,
  46918. Bt = new Ci.Vector2,
  46919. Vt = new Ci.Vector3,
  46920. kt = new Ci.Vector3,
  46921. Ut = new Ci.Vector3,
  46922. function(e, t) {
  46923. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  46924. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  46925. St.copy(r.boundingSphere),
  46926. St.applyMatrix4(a),
  46927. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  46928. xt.copy(e.ray).applyMatrix4(Tt),
  46929. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  46930. if (r instanceof Ci.BufferGeometry) {
  46931. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  46932. if (void 0 !== u.uv && (i = u.uv.array),
  46933. null !== h)
  46934. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  46935. s = p[f],
  46936. l = p[f + 1],
  46937. c = p[f + 2],
  46938. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  46939. t.push(n));
  46940. else
  46941. for (f = 0,
  46942. g = d.length; f < g; f += 9)
  46943. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  46944. t.push(n))
  46945. } else if (r instanceof Ci.Geometry) {
  46946. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  46947. 0 < _.length && (i = _);
  46948. for (var b = 0, w = E.length; b < w; b++) {
  46949. var T = E[b]
  46950. , x = 1 == A ? C[T.materialIndex] : o;
  46951. if (void 0 !== x) {
  46952. if (m = I[T.a],
  46953. v = I[T.b],
  46954. y = I[T.c],
  46955. !0 === x.morphTargets) {
  46956. var S = r.morphTargets
  46957. , M = this.morphTargetInfluences;
  46958. Mt.set(0, 0, 0),
  46959. Rt.set(0, 0, 0),
  46960. Pt.set(0, 0, 0);
  46961. for (var R = 0, P = S.length; R < P; R++) {
  46962. var O = M[R];
  46963. if (0 !== O) {
  46964. var L = S[R].vertices;
  46965. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  46966. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  46967. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  46968. }
  46969. }
  46970. Mt.add(m),
  46971. Rt.add(v),
  46972. Pt.add(y),
  46973. m = Mt,
  46974. v = Rt,
  46975. y = Pt
  46976. }
  46977. if (n = wi(this, e, xt, m, v, y, kt)) {
  46978. if (i) {
  46979. var D = i[b];
  46980. Nt.copy(D[0]),
  46981. Ft.copy(D[1]),
  46982. Bt.copy(D[2]),
  46983. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  46984. }
  46985. n.face = T,
  46986. n.faceIndex = b,
  46987. t.push(n)
  46988. }
  46989. }
  46990. }
  46991. }
  46992. }
  46993. ),
  46994. Ci.Mesh.prototype.clone = function() {
  46995. return new this.constructor(this.geometry,this.material).copy(this)
  46996. }
  46997. ,
  46998. Ci.Bone = function(e) {
  46999. Ci.Object3D.call(this),
  47000. this.type = "Bone",
  47001. this.skin = e
  47002. }
  47003. ,
  47004. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47005. Ci.Bone.prototype.constructor = Ci.Bone,
  47006. Ci.Bone.prototype.copy = function(e) {
  47007. return Ci.Object3D.prototype.copy.call(this, e),
  47008. this.skin = e.skin,
  47009. this
  47010. }
  47011. ,
  47012. Ci.Skeleton = function(e, t, i) {
  47013. if (this.useVertexTexture = void 0 === i || i,
  47014. this.identityMatrix = new Ci.Matrix4,
  47015. e = e || [],
  47016. this.bones = e.slice(0),
  47017. this.useVertexTexture) {
  47018. var n = Math.sqrt(4 * this.bones.length);
  47019. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47020. n = Math.max(n, 4),
  47021. this.boneTextureWidth = n,
  47022. this.boneTextureHeight = n,
  47023. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47024. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47025. } else
  47026. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47027. if (void 0 === t)
  47028. this.calculateInverses();
  47029. else if (this.bones.length === t.length)
  47030. this.boneInverses = t.slice(0);
  47031. else {
  47032. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47033. this.boneInverses = [];
  47034. for (var r = 0, o = this.bones.length; r < o; r++)
  47035. this.boneInverses.push(new Ci.Matrix4)
  47036. }
  47037. }
  47038. ,
  47039. Ci.Skeleton.prototype.calculateInverses = function() {
  47040. this.boneInverses = [];
  47041. for (var e = 0, t = this.bones.length; e < t; e++) {
  47042. var i = new Ci.Matrix4;
  47043. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47044. this.boneInverses.push(i)
  47045. }
  47046. }
  47047. ,
  47048. Ci.Skeleton.prototype.pose = function() {
  47049. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47050. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47051. for (t = 0,
  47052. i = this.bones.length; t < i; t++)
  47053. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47054. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47055. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47056. }
  47057. ,
  47058. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47059. function() {
  47060. for (var e = 0, t = this.bones.length; e < t; e++) {
  47061. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47062. wt.multiplyMatrices(i, this.boneInverses[e]),
  47063. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47064. }
  47065. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47066. }
  47067. ),
  47068. Ci.Skeleton.prototype.clone = function() {
  47069. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47070. }
  47071. ,
  47072. Ci.SkinnedMesh = function(e, t, i) {
  47073. Ci.Mesh.call(this, e, t),
  47074. this.type = "SkinnedMesh",
  47075. this.bindMode = "attached",
  47076. this.bindMatrix = new Ci.Matrix4,
  47077. this.bindMatrixInverse = new Ci.Matrix4;
  47078. var n = [];
  47079. if (this.geometry && void 0 !== this.geometry.bones) {
  47080. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47081. o = this.geometry.bones[a],
  47082. r = new Ci.Bone(this),
  47083. n.push(r),
  47084. r.name = o.name,
  47085. r.position.fromArray(o.pos),
  47086. r.quaternion.fromArray(o.rotq),
  47087. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47088. for (a = 0,
  47089. s = this.geometry.bones.length; a < s; ++a)
  47090. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47091. }
  47092. this.normalizeSkinWeights(),
  47093. this.updateMatrixWorld(!0),
  47094. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47095. }
  47096. ,
  47097. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47098. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47099. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47100. this.skeleton = e,
  47101. void 0 === t && (this.updateMatrixWorld(!0),
  47102. this.skeleton.calculateInverses(),
  47103. t = this.matrixWorld),
  47104. this.bindMatrix.copy(t),
  47105. this.bindMatrixInverse.getInverse(t)
  47106. }
  47107. ,
  47108. Ci.SkinnedMesh.prototype.pose = function() {
  47109. this.skeleton.pose()
  47110. }
  47111. ,
  47112. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47113. if (this.geometry instanceof Ci.Geometry)
  47114. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47115. var t = this.geometry.skinWeights[e];
  47116. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47117. }
  47118. else if (this.geometry instanceof Ci.BufferGeometry) {
  47119. var i = new Ci.Vector4
  47120. , n = this.geometry.attributes.skinWeight;
  47121. for (e = 0; e < n.count; e++) {
  47122. var r;
  47123. i.x = n.getX(e),
  47124. i.y = n.getY(e),
  47125. i.z = n.getZ(e),
  47126. i.w = n.getW(e),
  47127. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47128. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47129. }
  47130. }
  47131. }
  47132. ,
  47133. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47134. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47135. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47136. }
  47137. ,
  47138. Ci.SkinnedMesh.prototype.clone = function() {
  47139. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47140. }
  47141. ,
  47142. Ci.LOD = function() {
  47143. Ci.Object3D.call(this),
  47144. this.type = "LOD",
  47145. Object.defineProperties(this, {
  47146. levels: {
  47147. enumerable: !0,
  47148. value: []
  47149. },
  47150. objects: {
  47151. get: function() {
  47152. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47153. this.levels
  47154. }
  47155. }
  47156. })
  47157. }
  47158. ,
  47159. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47160. Ci.LOD.prototype.constructor = Ci.LOD,
  47161. Ci.LOD.prototype.addLevel = function(e, t) {
  47162. void 0 === t && (t = 0),
  47163. t = Math.abs(t);
  47164. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47165. ;
  47166. i.splice(n, 0, {
  47167. distance: t,
  47168. object: e
  47169. }),
  47170. this.add(e)
  47171. }
  47172. ,
  47173. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47174. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47175. ;
  47176. return t[i - 1].object
  47177. }
  47178. ,
  47179. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47180. function(e, t) {
  47181. bt.setFromMatrixPosition(this.matrixWorld);
  47182. var i = e.ray.origin.distanceTo(bt);
  47183. this.getObjectForDistance(i).raycast(e, t)
  47184. }
  47185. ),
  47186. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47187. _t = new Ci.Vector3,
  47188. function(e) {
  47189. var t = this.levels;
  47190. if (1 < t.length) {
  47191. Et.setFromMatrixPosition(e.matrixWorld),
  47192. _t.setFromMatrixPosition(this.matrixWorld);
  47193. var i = Et.distanceTo(_t);
  47194. t[0].object.visible = !0;
  47195. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47196. t[n - 1].object.visible = !1,
  47197. t[n].object.visible = !0;
  47198. for (; n < r; n++)
  47199. t[n].object.visible = !1
  47200. }
  47201. }
  47202. ),
  47203. Ci.LOD.prototype.copy = function(e) {
  47204. Ci.Object3D.prototype.copy.call(this, e, !1);
  47205. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47206. var r = t[i];
  47207. this.addLevel(r.object.clone(), r.distance)
  47208. }
  47209. return this
  47210. }
  47211. ,
  47212. Ci.LOD.prototype.toJSON = function(e) {
  47213. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47214. t.object.levels = [];
  47215. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47216. var o = i[n];
  47217. t.object.levels.push({
  47218. object: o.object.uuid,
  47219. distance: o.distance
  47220. })
  47221. }
  47222. return t
  47223. }
  47224. ,
  47225. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47226. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47227. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47228. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47229. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47230. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47231. function(e) {
  47232. Ci.Object3D.call(this),
  47233. this.type = "Sprite",
  47234. this.geometry = It,
  47235. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47236. }
  47237. ),
  47238. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47239. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47240. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47241. function(e, t) {
  47242. vt.setFromMatrixPosition(this.matrixWorld);
  47243. var i = e.ray.distanceSqToPoint(vt);
  47244. this.scale.x * this.scale.y < i || t.push({
  47245. distance: Math.sqrt(i),
  47246. point: this.position,
  47247. face: null,
  47248. object: this
  47249. })
  47250. }
  47251. ),
  47252. Ci.Sprite.prototype.clone = function() {
  47253. return new this.constructor(this.material).copy(this)
  47254. }
  47255. ,
  47256. Ci.Particle = Ci.Sprite,
  47257. Ci.LensFlare = function(e, t, i, n, r) {
  47258. Ci.Object3D.call(this),
  47259. this.lensFlares = [],
  47260. this.positionScreen = new Ci.Vector3,
  47261. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47262. }
  47263. ,
  47264. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47265. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47266. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47267. void 0 === t && (t = -1),
  47268. void 0 === i && (i = 0),
  47269. void 0 === o && (o = 1),
  47270. void 0 === r && (r = new Ci.Color(16777215)),
  47271. void 0 === n && (n = Ci.NormalBlending),
  47272. i = Math.min(i, Math.max(0, i)),
  47273. this.lensFlares.push({
  47274. texture: e,
  47275. size: t,
  47276. distance: i,
  47277. x: 0,
  47278. y: 0,
  47279. z: 0,
  47280. scale: 1,
  47281. rotation: 0,
  47282. opacity: o,
  47283. color: r,
  47284. blending: n
  47285. })
  47286. }
  47287. ,
  47288. Ci.LensFlare.prototype.updateLensFlares = function() {
  47289. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47290. for (e = 0; e < i; e++)
  47291. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47292. t.y = this.positionScreen.y + r * t.distance,
  47293. t.wantedRotation = t.x * Math.PI * .25,
  47294. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47295. }
  47296. ,
  47297. Ci.LensFlare.prototype.copy = function(e) {
  47298. Ci.Object3D.prototype.copy.call(this, e),
  47299. this.positionScreen.copy(e.positionScreen),
  47300. this.customUpdateCallback = e.customUpdateCallback;
  47301. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47302. this.lensFlares.push(e.lensFlares[t]);
  47303. return this
  47304. }
  47305. ,
  47306. Ci.Scene = function() {
  47307. Ci.Object3D.call(this),
  47308. this.type = "Scene",
  47309. this.fog = null,
  47310. this.overrideMaterial = null,
  47311. this.autoUpdate = !0
  47312. }
  47313. ,
  47314. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47315. Ci.Scene.prototype.constructor = Ci.Scene,
  47316. Ci.Scene.prototype.copy = function(e, t) {
  47317. return Ci.Object3D.prototype.copy.call(this, e, t),
  47318. null !== e.fog && (this.fog = e.fog.clone()),
  47319. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47320. this.autoUpdate = e.autoUpdate,
  47321. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47322. this
  47323. }
  47324. ,
  47325. Ci.Fog = function(e, t, i) {
  47326. this.name = "",
  47327. this.color = new Ci.Color(e),
  47328. this.near = void 0 !== t ? t : 1,
  47329. this.far = void 0 !== i ? i : 1e3
  47330. }
  47331. ,
  47332. Ci.Fog.prototype.clone = function() {
  47333. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47334. }
  47335. ,
  47336. Ci.FogExp2 = function(e, t) {
  47337. this.name = "",
  47338. this.color = new Ci.Color(e),
  47339. this.density = void 0 !== t ? t : 25e-5
  47340. }
  47341. ,
  47342. Ci.FogExp2.prototype.clone = function() {
  47343. return new Ci.FogExp2(this.color.getHex(),this.density)
  47344. }
  47345. ,
  47346. Ci.ShaderChunk = {},
  47347. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47348. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47349. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47350. Ci.ShaderChunk.aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",
  47351. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47352. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47353. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47354. Ci.ShaderChunk.bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",
  47355. Ci.ShaderChunk.bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",
  47356. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47357. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47358. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47359. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47360. Ci.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",
  47361. Ci.ShaderChunk.cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n",
  47362. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47363. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47364. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47365. Ci.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  47366. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47367. Ci.ShaderChunk.encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",
  47368. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47369. Ci.ShaderChunk.envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",
  47370. Ci.ShaderChunk.envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",
  47371. Ci.ShaderChunk.envmap_pars_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",
  47372. Ci.ShaderChunk.envmap_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",
  47373. Ci.ShaderChunk.fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",
  47374. Ci.ShaderChunk.fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",
  47375. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47376. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47377. Ci.ShaderChunk.lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
  47378. Ci.ShaderChunk.lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",
  47379. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47380. Ci.ShaderChunk.lights_phong_pars_fragment = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",
  47381. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47382. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47383. Ci.ShaderChunk.lights_standard_fragment = "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",
  47384. Ci.ShaderChunk.lights_standard_pars_fragment = "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",
  47385. Ci.ShaderChunk.lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",
  47386. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47387. Ci.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
  47388. Ci.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",
  47389. Ci.ShaderChunk.logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",
  47390. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47391. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47392. Ci.ShaderChunk.map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",
  47393. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47394. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47395. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47396. Ci.ShaderChunk.morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",
  47397. Ci.ShaderChunk.morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",
  47398. Ci.ShaderChunk.morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",
  47399. Ci.ShaderChunk.normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",
  47400. Ci.ShaderChunk.normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",
  47401. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47402. Ci.ShaderChunk.project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",
  47403. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47404. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47405. Ci.ShaderChunk.shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",
  47406. Ci.ShaderChunk.shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
  47407. Ci.ShaderChunk.shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",
  47408. Ci.ShaderChunk.shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",
  47409. Ci.ShaderChunk.skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",
  47410. Ci.ShaderChunk.skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",
  47411. Ci.ShaderChunk.skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",
  47412. Ci.ShaderChunk.skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",
  47413. Ci.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  47414. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47415. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47416. Ci.ShaderChunk.tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",
  47417. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47418. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47419. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47420. Ci.ShaderChunk.uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",
  47421. Ci.ShaderChunk.uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",
  47422. Ci.ShaderChunk.uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",
  47423. Ci.ShaderChunk.worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",
  47424. Ci.UniformsUtils = {
  47425. merge: function(e) {
  47426. for (var t = {}, i = 0; i < e.length; i++) {
  47427. var n = this.clone(e[i]);
  47428. for (var r in n)
  47429. t[r] = n[r]
  47430. }
  47431. return t
  47432. },
  47433. clone: function(e) {
  47434. var t = {};
  47435. for (var i in e)
  47436. for (var n in t[i] = {},
  47437. e[i]) {
  47438. var r = e[i][n];
  47439. r instanceof Ci.Color || r instanceof Ci.Vector2 || r instanceof Ci.Vector3 || r instanceof Ci.Vector4 || r instanceof Ci.Matrix3 || r instanceof Ci.Matrix4 || r instanceof Ci.Texture ? t[i][n] = r.clone() : Array.isArray(r) ? t[i][n] = r.slice() : t[i][n] = r
  47440. }
  47441. return t
  47442. }
  47443. },
  47444. Ci.UniformsLib = {
  47445. common: {
  47446. diffuse: {
  47447. type: "c",
  47448. value: new Ci.Color(15658734)
  47449. },
  47450. opacity: {
  47451. type: "f",
  47452. value: 1
  47453. },
  47454. map: {
  47455. type: "t",
  47456. value: null
  47457. },
  47458. offsetRepeat: {
  47459. type: "v4",
  47460. value: new Ci.Vector4(0,0,1,1)
  47461. },
  47462. specularMap: {
  47463. type: "t",
  47464. value: null
  47465. },
  47466. alphaMap: {
  47467. type: "t",
  47468. value: null
  47469. },
  47470. envMap: {
  47471. type: "t",
  47472. value: null
  47473. },
  47474. flipEnvMap: {
  47475. type: "f",
  47476. value: -1
  47477. },
  47478. reflectivity: {
  47479. type: "f",
  47480. value: 1
  47481. },
  47482. refractionRatio: {
  47483. type: "f",
  47484. value: .98
  47485. }
  47486. },
  47487. aomap: {
  47488. aoMap: {
  47489. type: "t",
  47490. value: null
  47491. },
  47492. aoMapIntensity: {
  47493. type: "f",
  47494. value: 1
  47495. }
  47496. },
  47497. lightmap: {
  47498. lightMap: {
  47499. type: "t",
  47500. value: null
  47501. },
  47502. lightMapIntensity: {
  47503. type: "f",
  47504. value: 1
  47505. }
  47506. },
  47507. emissivemap: {
  47508. emissiveMap: {
  47509. type: "t",
  47510. value: null
  47511. }
  47512. },
  47513. bumpmap: {
  47514. bumpMap: {
  47515. type: "t",
  47516. value: null
  47517. },
  47518. bumpScale: {
  47519. type: "f",
  47520. value: 1
  47521. }
  47522. },
  47523. normalmap: {
  47524. normalMap: {
  47525. type: "t",
  47526. value: null
  47527. },
  47528. normalScale: {
  47529. type: "v2",
  47530. value: new Ci.Vector2(1,1)
  47531. }
  47532. },
  47533. displacementmap: {
  47534. displacementMap: {
  47535. type: "t",
  47536. value: null
  47537. },
  47538. displacementScale: {
  47539. type: "f",
  47540. value: 1
  47541. },
  47542. displacementBias: {
  47543. type: "f",
  47544. value: 0
  47545. }
  47546. },
  47547. roughnessmap: {
  47548. roughnessMap: {
  47549. type: "t",
  47550. value: null
  47551. }
  47552. },
  47553. metalnessmap: {
  47554. metalnessMap: {
  47555. type: "t",
  47556. value: null
  47557. }
  47558. },
  47559. fog: {
  47560. fogDensity: {
  47561. type: "f",
  47562. value: 25e-5
  47563. },
  47564. fogNear: {
  47565. type: "f",
  47566. value: 1
  47567. },
  47568. fogFar: {
  47569. type: "f",
  47570. value: 2e3
  47571. },
  47572. fogColor: {
  47573. type: "c",
  47574. value: new Ci.Color(16777215)
  47575. }
  47576. },
  47577. lights: {
  47578. ambientLightColor: {
  47579. type: "fv",
  47580. value: []
  47581. },
  47582. directionalLights: {
  47583. type: "sa",
  47584. value: [],
  47585. properties: {
  47586. direction: {
  47587. type: "v3"
  47588. },
  47589. color: {
  47590. type: "c"
  47591. },
  47592. shadow: {
  47593. type: "i"
  47594. },
  47595. shadowBias: {
  47596. type: "f"
  47597. },
  47598. shadowRadius: {
  47599. type: "f"
  47600. },
  47601. shadowMapSize: {
  47602. type: "v2"
  47603. }
  47604. }
  47605. },
  47606. directionalShadowMap: {
  47607. type: "tv",
  47608. value: []
  47609. },
  47610. directionalShadowMatrix: {
  47611. type: "m4v",
  47612. value: []
  47613. },
  47614. spotLights: {
  47615. type: "sa",
  47616. value: [],
  47617. properties: {
  47618. color: {
  47619. type: "c"
  47620. },
  47621. position: {
  47622. type: "v3"
  47623. },
  47624. direction: {
  47625. type: "v3"
  47626. },
  47627. distance: {
  47628. type: "f"
  47629. },
  47630. coneCos: {
  47631. type: "f"
  47632. },
  47633. penumbraCos: {
  47634. type: "f"
  47635. },
  47636. decay: {
  47637. type: "f"
  47638. },
  47639. shadow: {
  47640. type: "i"
  47641. },
  47642. shadowBias: {
  47643. type: "f"
  47644. },
  47645. shadowRadius: {
  47646. type: "f"
  47647. },
  47648. shadowMapSize: {
  47649. type: "v2"
  47650. }
  47651. }
  47652. },
  47653. spotShadowMap: {
  47654. type: "tv",
  47655. value: []
  47656. },
  47657. spotShadowMatrix: {
  47658. type: "m4v",
  47659. value: []
  47660. },
  47661. pointLights: {
  47662. type: "sa",
  47663. value: [],
  47664. properties: {
  47665. color: {
  47666. type: "c"
  47667. },
  47668. position: {
  47669. type: "v3"
  47670. },
  47671. decay: {
  47672. type: "f"
  47673. },
  47674. distance: {
  47675. type: "f"
  47676. },
  47677. shadow: {
  47678. type: "i"
  47679. },
  47680. shadowBias: {
  47681. type: "f"
  47682. },
  47683. shadowRadius: {
  47684. type: "f"
  47685. },
  47686. shadowMapSize: {
  47687. type: "v2"
  47688. }
  47689. }
  47690. },
  47691. pointShadowMap: {
  47692. type: "tv",
  47693. value: []
  47694. },
  47695. pointShadowMatrix: {
  47696. type: "m4v",
  47697. value: []
  47698. },
  47699. hemisphereLights: {
  47700. type: "sa",
  47701. value: [],
  47702. properties: {
  47703. direction: {
  47704. type: "v3"
  47705. },
  47706. skyColor: {
  47707. type: "c"
  47708. },
  47709. groundColor: {
  47710. type: "c"
  47711. }
  47712. }
  47713. }
  47714. },
  47715. points: {
  47716. diffuse: {
  47717. type: "c",
  47718. value: new Ci.Color(15658734)
  47719. },
  47720. opacity: {
  47721. type: "f",
  47722. value: 1
  47723. },
  47724. size: {
  47725. type: "f",
  47726. value: 1
  47727. },
  47728. scale: {
  47729. type: "f",
  47730. value: 1
  47731. },
  47732. map: {
  47733. type: "t",
  47734. value: null
  47735. },
  47736. offsetRepeat: {
  47737. type: "v4",
  47738. value: new Ci.Vector4(0,0,1,1)
  47739. }
  47740. }
  47741. },
  47742. Ci.ShaderChunk.cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n",
  47743. Ci.ShaderChunk.cube_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  47744. Ci.ShaderChunk.depth_frag = "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n",
  47745. Ci.ShaderChunk.depth_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  47746. Ci.ShaderChunk.depthRGBA_frag = "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n",
  47747. Ci.ShaderChunk.depthRGBA_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  47748. Ci.ShaderChunk.distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n",
  47749. Ci.ShaderChunk.distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n",
  47750. Ci.ShaderChunk.equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n",
  47751. Ci.ShaderChunk.equirect_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  47752. Ci.ShaderChunk.linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47753. Ci.ShaderChunk.linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n",
  47754. Ci.ShaderChunk.meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47755. Ci.ShaderChunk.meshbasic_vert = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n",
  47756. Ci.ShaderChunk.meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47757. Ci.ShaderChunk.meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  47758. Ci.ShaderChunk.meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47759. Ci.ShaderChunk.meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  47760. Ci.ShaderChunk.meshstandard_frag = "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47761. Ci.ShaderChunk.meshstandard_vert = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  47762. Ci.ShaderChunk.normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n",
  47763. Ci.ShaderChunk.normal_vert = "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  47764. Ci.ShaderChunk.points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47765. Ci.ShaderChunk.points_vert = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  47766. Ci.ShaderLib = {
  47767. basic: {
  47768. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  47769. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  47770. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  47771. },
  47772. lambert: {
  47773. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47774. emissive: {
  47775. type: "c",
  47776. value: new Ci.Color(0)
  47777. }
  47778. }]),
  47779. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  47780. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  47781. },
  47782. phong: {
  47783. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47784. emissive: {
  47785. type: "c",
  47786. value: new Ci.Color(0)
  47787. },
  47788. specular: {
  47789. type: "c",
  47790. value: new Ci.Color(1118481)
  47791. },
  47792. shininess: {
  47793. type: "f",
  47794. value: 30
  47795. }
  47796. }]),
  47797. vertexShader: Ci.ShaderChunk.meshphong_vert,
  47798. fragmentShader: Ci.ShaderChunk.meshphong_frag
  47799. },
  47800. standard: {
  47801. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.roughnessmap, Ci.UniformsLib.metalnessmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47802. emissive: {
  47803. type: "c",
  47804. value: new Ci.Color(0)
  47805. },
  47806. roughness: {
  47807. type: "f",
  47808. value: .5
  47809. },
  47810. metalness: {
  47811. type: "f",
  47812. value: 0
  47813. },
  47814. envMapIntensity: {
  47815. type: "f",
  47816. value: 1
  47817. }
  47818. }]),
  47819. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  47820. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  47821. },
  47822. points: {
  47823. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  47824. vertexShader: Ci.ShaderChunk.points_vert,
  47825. fragmentShader: Ci.ShaderChunk.points_frag
  47826. },
  47827. dashed: {
  47828. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  47829. scale: {
  47830. type: "f",
  47831. value: 1
  47832. },
  47833. dashSize: {
  47834. type: "f",
  47835. value: 1
  47836. },
  47837. totalSize: {
  47838. type: "f",
  47839. value: 2
  47840. }
  47841. }]),
  47842. vertexShader: Ci.ShaderChunk.linedashed_vert,
  47843. fragmentShader: Ci.ShaderChunk.linedashed_frag
  47844. },
  47845. depth: {
  47846. uniforms: {
  47847. mNear: {
  47848. type: "f",
  47849. value: 1
  47850. },
  47851. mFar: {
  47852. type: "f",
  47853. value: 2e3
  47854. },
  47855. opacity: {
  47856. type: "f",
  47857. value: 1
  47858. }
  47859. },
  47860. vertexShader: Ci.ShaderChunk.depth_vert,
  47861. fragmentShader: Ci.ShaderChunk.depth_frag
  47862. },
  47863. normal: {
  47864. uniforms: {
  47865. opacity: {
  47866. type: "f",
  47867. value: 1
  47868. }
  47869. },
  47870. vertexShader: Ci.ShaderChunk.normal_vert,
  47871. fragmentShader: Ci.ShaderChunk.normal_frag
  47872. },
  47873. cube: {
  47874. uniforms: {
  47875. tCube: {
  47876. type: "t",
  47877. value: null
  47878. },
  47879. tFlip: {
  47880. type: "f",
  47881. value: -1
  47882. }
  47883. },
  47884. vertexShader: Ci.ShaderChunk.cube_vert,
  47885. fragmentShader: Ci.ShaderChunk.cube_frag
  47886. },
  47887. equirect: {
  47888. uniforms: {
  47889. tEquirect: {
  47890. type: "t",
  47891. value: null
  47892. },
  47893. tFlip: {
  47894. type: "f",
  47895. value: -1
  47896. }
  47897. },
  47898. vertexShader: Ci.ShaderChunk.equirect_vert,
  47899. fragmentShader: Ci.ShaderChunk.equirect_frag
  47900. },
  47901. depthRGBA: {
  47902. uniforms: {},
  47903. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  47904. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  47905. },
  47906. distanceRGBA: {
  47907. uniforms: {
  47908. lightPos: {
  47909. type: "v3",
  47910. value: new Ci.Vector3(0,0,0)
  47911. }
  47912. },
  47913. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  47914. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  47915. }
  47916. },
  47917. Ci.WebGLRenderer = function(e) {
  47918. function S() {
  47919. return null === Q ? he : 1
  47920. }
  47921. function i(e, t, i, n) {
  47922. !0 === V && (e *= n,
  47923. t *= n,
  47924. i *= n),
  47925. _e.clearColor(e, t, i, n)
  47926. }
  47927. function t() {
  47928. _e.init(),
  47929. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  47930. _e.viewport(re.copy(pe).multiplyScalar(he)),
  47931. i(ae.r, ae.g, ae.b, se)
  47932. }
  47933. function n() {
  47934. te = K = null,
  47935. ee = "",
  47936. $ = -1,
  47937. _e.reset()
  47938. }
  47939. function r(e) {
  47940. e.preventDefault(),
  47941. n(),
  47942. t(),
  47943. be.clear()
  47944. }
  47945. function f(e) {
  47946. var t = e.target;
  47947. t.removeEventListener("dispose", f),
  47948. function(e) {
  47949. var t = be.get(e);
  47950. if (e.image && t.__image__webglTextureCube)
  47951. X.deleteTexture(t.__image__webglTextureCube);
  47952. else {
  47953. if (void 0 === t.__webglInit)
  47954. return;
  47955. X.deleteTexture(t.__webglTexture)
  47956. }
  47957. be.delete(e)
  47958. }(t),
  47959. ye.textures--
  47960. }
  47961. function a(e) {
  47962. var t = e.target;
  47963. t.removeEventListener("dispose", a),
  47964. function(e) {
  47965. var t = be.get(e)
  47966. , i = be.get(e.texture);
  47967. if (e && void 0 !== i.__webglTexture) {
  47968. if (X.deleteTexture(i.__webglTexture),
  47969. e instanceof Ci.WebGLRenderTargetCube)
  47970. for (var n = 0; n < 6; n++)
  47971. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  47972. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  47973. else
  47974. X.deleteFramebuffer(t.__webglFramebuffer),
  47975. X.deleteRenderbuffer(t.__webglDepthbuffer);
  47976. be.delete(e.texture),
  47977. be.delete(e)
  47978. }
  47979. }(t),
  47980. ye.textures--
  47981. }
  47982. function v(e) {
  47983. var t = e.target;
  47984. t.removeEventListener("dispose", v),
  47985. function(e) {
  47986. y(e),
  47987. be.delete(e)
  47988. }(t)
  47989. }
  47990. function y(e) {
  47991. var t = be.get(e).program;
  47992. (e.program = void 0) !== t && Te.releaseProgram(t)
  47993. }
  47994. function M(e, t) {
  47995. return Math.abs(t[0]) - Math.abs(e[0])
  47996. }
  47997. function s(e, t) {
  47998. 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
  47999. }
  48000. function l(e, t) {
  48001. 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
  48002. }
  48003. function d(e, t, i, n, r) {
  48004. var o, a;
  48005. a = i.transparent ? (o = G,
  48006. ++W) : (o = H,
  48007. ++z);
  48008. var s = o[a];
  48009. void 0 !== s ? (s.id = e.id,
  48010. s.object = e,
  48011. s.geometry = t,
  48012. s.material = i,
  48013. s.z = me.z,
  48014. s.group = r) : (s = {
  48015. id: e.id,
  48016. object: e,
  48017. geometry: t,
  48018. material: i,
  48019. z: me.z,
  48020. group: r
  48021. },
  48022. o.push(s))
  48023. }
  48024. function c(e, t, i, n) {
  48025. for (var r = 0, o = e.length; r < o; r++) {
  48026. var a = e[r]
  48027. , s = a.object
  48028. , l = a.geometry
  48029. , c = void 0 === n ? a.material : n
  48030. , h = a.group;
  48031. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48032. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48033. s instanceof Ci.ImmediateRenderObject) {
  48034. R(c);
  48035. var u = P(t, i, c, s);
  48036. ee = "",
  48037. s.render(function(e) {
  48038. Z.renderBufferImmediate(e, u, c)
  48039. })
  48040. } else
  48041. Z.renderBufferDirect(t, i, l, c, s, h)
  48042. }
  48043. }
  48044. function R(e) {
  48045. (function(e) {
  48046. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48047. _e.setFlipSided(e.side === Ci.BackSide)
  48048. }
  48049. )(e),
  48050. !0 === e.transparent ? _e.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : _e.setBlending(Ci.NoBlending),
  48051. _e.setDepthFunc(e.depthFunc),
  48052. _e.setDepthTest(e.depthTest),
  48053. _e.setDepthWrite(e.depthWrite),
  48054. _e.setColorWrite(e.colorWrite),
  48055. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48056. }
  48057. function P(e, t, i, n) {
  48058. oe = 0;
  48059. var r = be.get(i);
  48060. void 0 === r.program && (i.needsUpdate = !0),
  48061. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48062. i.needsUpdate && (function(e, t, i) {
  48063. var n = be.get(e)
  48064. , r = Te.getParameters(e, ve, t, i)
  48065. , o = Te.getProgramCode(e, r)
  48066. , a = n.program
  48067. , s = !0;
  48068. if (void 0 === a)
  48069. e.addEventListener("dispose", v);
  48070. else if (a.code !== o)
  48071. y(e);
  48072. else {
  48073. if (void 0 !== r.shaderID)
  48074. return;
  48075. s = !1
  48076. }
  48077. if (s) {
  48078. if (r.shaderID) {
  48079. var l = Ci.ShaderLib[r.shaderID];
  48080. n.__webglShader = {
  48081. name: e.type,
  48082. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48083. vertexShader: l.vertexShader,
  48084. fragmentShader: l.fragmentShader
  48085. }
  48086. } else
  48087. n.__webglShader = {
  48088. name: e.type,
  48089. uniforms: e.uniforms,
  48090. vertexShader: e.vertexShader,
  48091. fragmentShader: e.fragmentShader
  48092. };
  48093. e.__webglShader = n.__webglShader,
  48094. a = Te.acquireProgram(e, r, o),
  48095. n.program = a,
  48096. e.program = a
  48097. }
  48098. var c = a.getAttributes();
  48099. if (e.morphTargets)
  48100. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48101. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48102. if (e.morphNormals)
  48103. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48104. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48105. n.uniformsList = [];
  48106. var u = n.__webglShader.uniforms
  48107. , d = n.program.getUniforms();
  48108. for (var p in u) {
  48109. var f = d[p];
  48110. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48111. }
  48112. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48113. u.ambientLightColor.value = ve.ambient,
  48114. u.directionalLights.value = ve.directional,
  48115. u.spotLights.value = ve.spot,
  48116. u.pointLights.value = ve.point,
  48117. u.hemisphereLights.value = ve.hemi,
  48118. u.directionalShadowMap.value = ve.directionalShadowMap,
  48119. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48120. u.spotShadowMap.value = ve.spotShadowMap,
  48121. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48122. u.pointShadowMap.value = ve.pointShadowMap,
  48123. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48124. n.hasDynamicUniforms = !1;
  48125. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48126. if (!0 === n.uniformsList[g][0].dynamic) {
  48127. n.hasDynamicUniforms = !0;
  48128. break
  48129. }
  48130. }
  48131. }(i, t, n),
  48132. i.needsUpdate = !1);
  48133. var o = !1
  48134. , a = !1
  48135. , s = !1
  48136. , l = r.program
  48137. , c = l.getUniforms()
  48138. , h = r.__webglShader.uniforms;
  48139. if (l.id !== K && (X.useProgram(l.program),
  48140. K = l.id,
  48141. s = a = o = !0),
  48142. i.id !== $ && ($ = i.id,
  48143. a = !0),
  48144. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48145. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48146. e !== te && (te = e,
  48147. s = a = !0),
  48148. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48149. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48150. (i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshStandardMaterial || i instanceof Ci.ShaderMaterial || i.skinning) && void 0 !== c.viewMatrix && X.uniformMatrix4fv(c.viewMatrix, !1, e.matrixWorldInverse.elements),
  48151. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48152. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48153. i.skinning)
  48154. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48155. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48156. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48157. if (void 0 !== c.boneTexture) {
  48158. var u = A();
  48159. X.uniform1i(c.boneTexture, u),
  48160. Z.setTexture(n.skeleton.boneTexture, u)
  48161. }
  48162. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48163. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48164. } else
  48165. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48166. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48167. e.ambientLightColor.needsUpdate = t,
  48168. e.directionalLights.needsUpdate = t,
  48169. e.pointLights.needsUpdate = t,
  48170. e.spotLights.needsUpdate = t,
  48171. e.hemisphereLights.needsUpdate = t
  48172. }(h, s),
  48173. t && i.fog && function(e, t) {
  48174. e.fogColor.value = t.color,
  48175. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48176. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48177. }(h, t),
  48178. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48179. var i;
  48180. if (e.opacity.value = t.opacity,
  48181. e.diffuse.value = t.color,
  48182. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48183. e.map.value = t.map,
  48184. e.specularMap.value = t.specularMap,
  48185. e.alphaMap.value = t.alphaMap,
  48186. t.aoMap && (e.aoMap.value = t.aoMap,
  48187. e.aoMapIntensity.value = t.aoMapIntensity),
  48188. 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),
  48189. void 0 !== i) {
  48190. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48191. var n = i.offset
  48192. , r = i.repeat;
  48193. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48194. }
  48195. e.envMap.value = t.envMap,
  48196. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48197. e.reflectivity.value = t.reflectivity,
  48198. e.refractionRatio.value = t.refractionRatio
  48199. }(h, i),
  48200. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48201. function(e, t) {
  48202. e.dashSize.value = t.dashSize,
  48203. e.totalSize.value = t.dashSize + t.gapSize,
  48204. e.scale.value = t.scale
  48205. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48206. if (e.diffuse.value = t.color,
  48207. e.opacity.value = t.opacity,
  48208. e.size.value = t.size * he,
  48209. e.scale.value = O.clientHeight / 2,
  48210. e.map.value = t.map,
  48211. null !== t.map) {
  48212. var i = t.map.offset
  48213. , n = t.map.repeat;
  48214. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48215. }
  48216. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48217. t.lightMap && (e.lightMap.value = t.lightMap,
  48218. e.lightMapIntensity.value = t.lightMapIntensity),
  48219. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48220. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48221. e.specular.value = t.specular,
  48222. e.shininess.value = Math.max(t.shininess, 1e-4),
  48223. t.lightMap && (e.lightMap.value = t.lightMap,
  48224. e.lightMapIntensity.value = t.lightMapIntensity),
  48225. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48226. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48227. e.bumpScale.value = t.bumpScale),
  48228. t.normalMap && (e.normalMap.value = t.normalMap,
  48229. e.normalScale.value.copy(t.normalScale)),
  48230. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48231. e.displacementScale.value = t.displacementScale,
  48232. e.displacementBias.value = t.displacementBias)
  48233. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48234. e.roughness.value = t.roughness,
  48235. e.metalness.value = t.metalness,
  48236. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48237. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48238. t.lightMap && (e.lightMap.value = t.lightMap,
  48239. e.lightMapIntensity.value = t.lightMapIntensity),
  48240. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48241. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48242. e.bumpScale.value = t.bumpScale),
  48243. t.normalMap && (e.normalMap.value = t.normalMap,
  48244. e.normalScale.value.copy(t.normalScale)),
  48245. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48246. e.displacementScale.value = t.displacementScale,
  48247. e.displacementBias.value = t.displacementBias),
  48248. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48249. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48250. h.mFar.value = e.far,
  48251. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48252. g(r.uniformsList)),
  48253. function(e, t) {
  48254. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48255. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48256. }(c, n),
  48257. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48258. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48259. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48260. var a = e[r][0]
  48261. , s = a.onUpdateCallback;
  48262. void 0 !== s && (s.bind(a)(t, i),
  48263. n.push(e[r]))
  48264. }
  48265. g(n)
  48266. }(r.uniformsList, n, e),
  48267. l
  48268. }
  48269. function p(e, t) {
  48270. e.diffuse.value = t.color,
  48271. e.opacity.value = t.opacity
  48272. }
  48273. function A() {
  48274. var e = oe;
  48275. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48276. oe += 1,
  48277. e
  48278. }
  48279. function C(e, t, i, n) {
  48280. var r, o;
  48281. if ("1i" === t)
  48282. X.uniform1i(i, n);
  48283. else if ("1f" === t)
  48284. X.uniform1f(i, n);
  48285. else if ("2f" === t)
  48286. X.uniform2f(i, n[0], n[1]);
  48287. else if ("3f" === t)
  48288. X.uniform3f(i, n[0], n[1], n[2]);
  48289. else if ("4f" === t)
  48290. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48291. else if ("1iv" === t)
  48292. X.uniform1iv(i, n);
  48293. else if ("3iv" === t)
  48294. X.uniform3iv(i, n);
  48295. else if ("1fv" === t)
  48296. X.uniform1fv(i, n);
  48297. else if ("2fv" === t)
  48298. X.uniform2fv(i, n);
  48299. else if ("3fv" === t)
  48300. X.uniform3fv(i, n);
  48301. else if ("4fv" === t)
  48302. X.uniform4fv(i, n);
  48303. else if ("Matrix2fv" === t)
  48304. X.uniformMatrix2fv(i, !1, n);
  48305. else if ("Matrix3fv" === t)
  48306. X.uniformMatrix3fv(i, !1, n);
  48307. else if ("Matrix4fv" === t)
  48308. X.uniformMatrix4fv(i, !1, n);
  48309. else if ("i" === t)
  48310. X.uniform1i(i, n);
  48311. else if ("f" === t)
  48312. X.uniform1f(i, n);
  48313. else if ("v2" === t)
  48314. X.uniform2f(i, n.x, n.y);
  48315. else if ("v3" === t)
  48316. X.uniform3f(i, n.x, n.y, n.z);
  48317. else if ("v4" === t)
  48318. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48319. else if ("c" === t)
  48320. X.uniform3f(i, n.r, n.g, n.b);
  48321. else if ("s" === t) {
  48322. var a = e.properties;
  48323. for (var s in a) {
  48324. var l = a[s]
  48325. , c = i[s]
  48326. , h = n[s];
  48327. C(l, l.type, c, h)
  48328. }
  48329. } else if ("sa" === t) {
  48330. a = e.properties;
  48331. for (var u = 0, d = n.length; u < d; u++)
  48332. for (var s in a) {
  48333. l = a[s],
  48334. c = i[u][s],
  48335. h = n[u][s];
  48336. C(l, l.type, c, h)
  48337. }
  48338. } else if ("iv1" === t)
  48339. X.uniform1iv(i, n);
  48340. else if ("iv" === t)
  48341. X.uniform3iv(i, n);
  48342. else if ("fv1" === t)
  48343. X.uniform1fv(i, n);
  48344. else if ("fv" === t)
  48345. X.uniform3fv(i, n);
  48346. else if ("v2v" === t) {
  48347. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48348. u = 0;
  48349. for (var p = 0, f = n.length; u < f; u++,
  48350. p += 2)
  48351. e._array[p + 0] = n[u].x,
  48352. e._array[p + 1] = n[u].y;
  48353. X.uniform2fv(i, e._array)
  48354. } else if ("v3v" === t) {
  48355. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48356. u = 0;
  48357. var g = 0;
  48358. for (f = n.length; u < f; u++,
  48359. g += 3)
  48360. e._array[g + 0] = n[u].x,
  48361. e._array[g + 1] = n[u].y,
  48362. e._array[g + 2] = n[u].z;
  48363. X.uniform3fv(i, e._array)
  48364. } else if ("v4v" === t) {
  48365. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48366. u = 0;
  48367. var m = 0;
  48368. for (f = n.length; u < f; u++,
  48369. m += 4)
  48370. e._array[m + 0] = n[u].x,
  48371. e._array[m + 1] = n[u].y,
  48372. e._array[m + 2] = n[u].z,
  48373. e._array[m + 3] = n[u].w;
  48374. X.uniform4fv(i, e._array)
  48375. } else if ("m2" === t)
  48376. X.uniformMatrix2fv(i, !1, n.elements);
  48377. else if ("m3" === t)
  48378. X.uniformMatrix3fv(i, !1, n.elements);
  48379. else if ("m3v" === t) {
  48380. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48381. for (u = 0,
  48382. f = n.length; u < f; u++)
  48383. n[u].flattenToArrayOffset(e._array, 9 * u);
  48384. X.uniformMatrix3fv(i, !1, e._array)
  48385. } else if ("m4" === t)
  48386. X.uniformMatrix4fv(i, !1, n.elements);
  48387. else if ("m4v" === t) {
  48388. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48389. for (u = 0,
  48390. f = n.length; u < f; u++)
  48391. n[u].flattenToArrayOffset(e._array, 16 * u);
  48392. X.uniformMatrix4fv(i, !1, e._array)
  48393. } else if ("t" === t) {
  48394. if (r = n,
  48395. o = A(),
  48396. X.uniform1i(i, o),
  48397. !r)
  48398. return;
  48399. r instanceof Ci.CubeTexture || Array.isArray(r.image) && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : Z.setTexture(r, o)
  48400. } else if ("tv" === t) {
  48401. void 0 === e._array && (e._array = []);
  48402. for (u = 0,
  48403. f = e.value.length; u < f; u++)
  48404. e._array[u] = A();
  48405. X.uniform1iv(i, e._array);
  48406. for (u = 0,
  48407. f = e.value.length; u < f; u++)
  48408. r = e.value[u],
  48409. o = e._array[u],
  48410. r && (r instanceof Ci.CubeTexture || r.image instanceof Array && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : Z.setTexture(r, o))
  48411. } else
  48412. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48413. }
  48414. function g(e) {
  48415. for (var t = 0, i = e.length; t < i; t++) {
  48416. var n = e[t][0];
  48417. if (!1 !== n.needsUpdate)
  48418. C(n, n.type, e[t][1], n.value)
  48419. }
  48420. }
  48421. function m(e, t, i) {
  48422. var n;
  48423. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48424. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48425. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48426. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48427. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48428. t.wrapS === Ci.ClampToEdgeWrapping && t.wrapT === Ci.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  48429. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48430. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48431. t.minFilter !== Ci.NearestFilter && t.minFilter !== Ci.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  48432. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48433. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48434. return;
  48435. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48436. return;
  48437. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48438. be.get(t).__currentAnisotropy = t.anisotropy)
  48439. }
  48440. }
  48441. function o(e, t, i) {
  48442. void 0 === e.__webglInit && (e.__webglInit = !0,
  48443. t.addEventListener("dispose", f),
  48444. e.__webglTexture = X.createTexture(),
  48445. ye.textures++),
  48446. _e.activeTexture(X.TEXTURE0 + i),
  48447. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48448. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48449. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48450. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48451. var n = I(t.image, Ee.maxTextureSize);
  48452. !function(e) {
  48453. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48454. }(t) || !1 !== E(n) || (n = function(e) {
  48455. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48456. var t = document.createElement("canvas");
  48457. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48458. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48459. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48460. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48461. t
  48462. }
  48463. return e
  48464. }(n));
  48465. var r = E(n)
  48466. , o = x(t.format)
  48467. , a = x(t.type);
  48468. m(X.TEXTURE_2D, t, r);
  48469. var s, l = t.mipmaps;
  48470. if (t instanceof Ci.DataTexture)
  48471. if (0 < l.length && r) {
  48472. for (var c = 0, h = l.length; c < h; c++)
  48473. s = l[c],
  48474. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48475. t.generateMipmaps = !1
  48476. } else
  48477. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48478. else if (t instanceof Ci.CompressedTexture)
  48479. for (c = 0,
  48480. h = l.length; c < h; c++)
  48481. s = l[c],
  48482. t.format !== Ci.RGBAFormat && t.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(o) ? _e.compressedTexImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, s.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48483. else if (0 < l.length && r) {
  48484. for (c = 0,
  48485. h = l.length; c < h; c++)
  48486. s = l[c],
  48487. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48488. t.generateMipmaps = !1
  48489. } else
  48490. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48491. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48492. e.__version = t.version,
  48493. t.onUpdate && t.onUpdate(t)
  48494. }
  48495. function I(e, t) {
  48496. if (e.width > t || e.height > t) {
  48497. var i = t / Math.max(e.width, e.height)
  48498. , n = document.createElement("canvas");
  48499. return n.width = Math.floor(e.width * i),
  48500. n.height = Math.floor(e.height * i),
  48501. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48502. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48503. n
  48504. }
  48505. return e
  48506. }
  48507. function E(e) {
  48508. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48509. }
  48510. function _(e, t) {
  48511. var i = be.get(e);
  48512. if (6 === e.image.length)
  48513. if (0 < e.version && i.__version !== e.version) {
  48514. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48515. i.__image__webglTextureCube = X.createTexture(),
  48516. ye.textures++),
  48517. _e.activeTexture(X.TEXTURE0 + t),
  48518. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48519. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48520. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48521. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48522. var s = E(o[0])
  48523. , l = x(e.format)
  48524. , c = x(e.type);
  48525. m(X.TEXTURE_CUBE_MAP, e, s);
  48526. for (a = 0; a < 6; a++)
  48527. if (n)
  48528. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48529. h = u[d],
  48530. e.format !== Ci.RGBAFormat && e.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(l) ? _e.compressedTexImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, h.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, l, c, h.data);
  48531. else
  48532. r ? _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, o[a].width, o[a].height, 0, l, c, o[a].data) : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, l, c, o[a]);
  48533. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48534. i.__version = e.version,
  48535. e.onUpdate && e.onUpdate(e)
  48536. } else
  48537. _e.activeTexture(X.TEXTURE0 + t),
  48538. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48539. }
  48540. function b(e, t) {
  48541. _e.activeTexture(X.TEXTURE0 + t),
  48542. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48543. }
  48544. function h(e, t, i, n) {
  48545. var r = x(t.texture.format)
  48546. , o = x(t.texture.type);
  48547. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48548. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48549. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48550. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48551. }
  48552. function u(e, t) {
  48553. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48554. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48555. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_ATTACHMENT, X.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_STENCIL, t.width, t.height),
  48556. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48557. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48558. }
  48559. function w(e) {
  48560. var t = be.get(e)
  48561. , i = be.get(e.texture);
  48562. e.addEventListener("dispose", a),
  48563. i.__webglTexture = X.createTexture(),
  48564. ye.textures++;
  48565. var n = e instanceof Ci.WebGLRenderTargetCube
  48566. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48567. if (n) {
  48568. t.__webglFramebuffer = [];
  48569. for (var o = 0; o < 6; o++)
  48570. t.__webglFramebuffer[o] = X.createFramebuffer()
  48571. } else
  48572. t.__webglFramebuffer = X.createFramebuffer();
  48573. if (n) {
  48574. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  48575. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  48576. for (o = 0; o < 6; o++)
  48577. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  48578. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48579. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  48580. } else
  48581. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  48582. m(X.TEXTURE_2D, e.texture, r),
  48583. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  48584. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48585. _e.bindTexture(X.TEXTURE_2D, null);
  48586. e.depthBuffer && function(e) {
  48587. var t = be.get(e);
  48588. if (e instanceof Ci.WebGLRenderTargetCube) {
  48589. t.__webglDepthbuffer = [];
  48590. for (var i = 0; i < 6; i++)
  48591. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  48592. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  48593. u(t.__webglDepthbuffer[i], e)
  48594. } else
  48595. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  48596. t.__webglDepthbuffer = X.createRenderbuffer(),
  48597. u(t.__webglDepthbuffer, e);
  48598. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48599. }(e)
  48600. }
  48601. function T(e) {
  48602. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  48603. }
  48604. function x(e) {
  48605. var t;
  48606. if (e === Ci.RepeatWrapping)
  48607. return X.REPEAT;
  48608. if (e === Ci.ClampToEdgeWrapping)
  48609. return X.CLAMP_TO_EDGE;
  48610. if (e === Ci.MirroredRepeatWrapping)
  48611. return X.MIRRORED_REPEAT;
  48612. if (e === Ci.NearestFilter)
  48613. return X.NEAREST;
  48614. if (e === Ci.NearestMipMapNearestFilter)
  48615. return X.NEAREST_MIPMAP_NEAREST;
  48616. if (e === Ci.NearestMipMapLinearFilter)
  48617. return X.NEAREST_MIPMAP_LINEAR;
  48618. if (e === Ci.LinearFilter)
  48619. return X.LINEAR;
  48620. if (e === Ci.LinearMipMapNearestFilter)
  48621. return X.LINEAR_MIPMAP_NEAREST;
  48622. if (e === Ci.LinearMipMapLinearFilter)
  48623. return X.LINEAR_MIPMAP_LINEAR;
  48624. if (e === Ci.UnsignedByteType)
  48625. return X.UNSIGNED_BYTE;
  48626. if (e === Ci.UnsignedShort4444Type)
  48627. return X.UNSIGNED_SHORT_4_4_4_4;
  48628. if (e === Ci.UnsignedShort5551Type)
  48629. return X.UNSIGNED_SHORT_5_5_5_1;
  48630. if (e === Ci.UnsignedShort565Type)
  48631. return X.UNSIGNED_SHORT_5_6_5;
  48632. if (e === Ci.ByteType)
  48633. return X.BYTE;
  48634. if (e === Ci.ShortType)
  48635. return X.SHORT;
  48636. if (e === Ci.UnsignedShortType)
  48637. return X.UNSIGNED_SHORT;
  48638. if (e === Ci.IntType)
  48639. return X.INT;
  48640. if (e === Ci.UnsignedIntType)
  48641. return X.UNSIGNED_INT;
  48642. if (e === Ci.FloatType)
  48643. return X.FLOAT;
  48644. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  48645. return t.HALF_FLOAT_OES;
  48646. if (e === Ci.AlphaFormat)
  48647. return X.ALPHA;
  48648. if (e === Ci.RGBFormat)
  48649. return X.RGB;
  48650. if (e === Ci.RGBAFormat)
  48651. return X.RGBA;
  48652. if (e === Ci.LuminanceFormat)
  48653. return X.LUMINANCE;
  48654. if (e === Ci.LuminanceAlphaFormat)
  48655. return X.LUMINANCE_ALPHA;
  48656. if (e === Ci.AddEquation)
  48657. return X.FUNC_ADD;
  48658. if (e === Ci.SubtractEquation)
  48659. return X.FUNC_SUBTRACT;
  48660. if (e === Ci.ReverseSubtractEquation)
  48661. return X.FUNC_REVERSE_SUBTRACT;
  48662. if (e === Ci.ZeroFactor)
  48663. return X.ZERO;
  48664. if (e === Ci.OneFactor)
  48665. return X.ONE;
  48666. if (e === Ci.SrcColorFactor)
  48667. return X.SRC_COLOR;
  48668. if (e === Ci.OneMinusSrcColorFactor)
  48669. return X.ONE_MINUS_SRC_COLOR;
  48670. if (e === Ci.SrcAlphaFactor)
  48671. return X.SRC_ALPHA;
  48672. if (e === Ci.OneMinusSrcAlphaFactor)
  48673. return X.ONE_MINUS_SRC_ALPHA;
  48674. if (e === Ci.DstAlphaFactor)
  48675. return X.DST_ALPHA;
  48676. if (e === Ci.OneMinusDstAlphaFactor)
  48677. return X.ONE_MINUS_DST_ALPHA;
  48678. if (e === Ci.DstColorFactor)
  48679. return X.DST_COLOR;
  48680. if (e === Ci.OneMinusDstColorFactor)
  48681. return X.ONE_MINUS_DST_COLOR;
  48682. if (e === Ci.SrcAlphaSaturateFactor)
  48683. return X.SRC_ALPHA_SATURATE;
  48684. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  48685. if (e === Ci.RGB_S3TC_DXT1_Format)
  48686. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  48687. if (e === Ci.RGBA_S3TC_DXT1_Format)
  48688. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  48689. if (e === Ci.RGBA_S3TC_DXT3_Format)
  48690. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  48691. if (e === Ci.RGBA_S3TC_DXT5_Format)
  48692. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  48693. }
  48694. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  48695. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  48696. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  48697. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  48698. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  48699. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  48700. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  48701. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  48702. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  48703. }
  48704. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  48705. return t.COMPRESSED_RGB_ETC1_WEBGL;
  48706. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  48707. if (e === Ci.MinEquation)
  48708. return t.MIN_EXT;
  48709. if (e === Ci.MaxEquation)
  48710. return t.MAX_EXT
  48711. }
  48712. return 0
  48713. }
  48714. console.log("THREE.WebGLRenderer", Ci.REVISION);
  48715. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  48716. , L = void 0 !== e.context ? e.context : null
  48717. , D = void 0 !== e.alpha && e.alpha
  48718. , N = void 0 === e.depth || e.depth
  48719. , F = void 0 === e.stencil || e.stencil
  48720. , B = void 0 !== e.antialias && e.antialias
  48721. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  48722. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  48723. , U = []
  48724. , H = []
  48725. , z = -1
  48726. , G = []
  48727. , W = -1
  48728. , j = new Float32Array(8)
  48729. , Y = []
  48730. , q = [];
  48731. this.domElement = O,
  48732. this.context = null,
  48733. this.autoClear = !0,
  48734. this.autoClearColor = !0,
  48735. this.autoClearDepth = !0,
  48736. this.autoClearStencil = !0,
  48737. this.sortObjects = !0,
  48738. this.gammaFactor = 2,
  48739. this.gammaInput = !1,
  48740. this.gammaOutput = !1,
  48741. this.physicallyCorrectLights = !1,
  48742. this.toneMapping = Ci.LinearToneMapping,
  48743. this.toneMappingExposure = 1,
  48744. this.toneMappingWhitePoint = 1,
  48745. this.maxMorphTargets = 8,
  48746. this.maxMorphNormals = 4,
  48747. this.autoScaleCubemaps = !0;
  48748. var X, Z = this, K = null, Q = null, J = null, $ = -1, ee = "", te = null, ie = new Ci.Vector4, ne = null, re = new Ci.Vector4, oe = 0, ae = new Ci.Color(0), se = 0, le = O.width, ce = O.height, he = 1, ue = new Ci.Vector4(0,0,le,ce), de = !1, pe = new Ci.Vector4(0,0,le,ce), fe = new Ci.Frustum, ge = new Ci.Matrix4, me = new Ci.Vector3, ve = {
  48749. hash: "",
  48750. ambient: [0, 0, 0],
  48751. directional: [],
  48752. directionalShadowMap: [],
  48753. directionalShadowMatrix: [],
  48754. spot: [],
  48755. spotShadowMap: [],
  48756. spotShadowMatrix: [],
  48757. point: [],
  48758. pointShadowMap: [],
  48759. pointShadowMatrix: [],
  48760. hemi: [],
  48761. shadows: [],
  48762. shadowsPointLight: 0
  48763. }, ye = {
  48764. geometries: 0,
  48765. textures: 0
  48766. }, Ae = {
  48767. calls: 0,
  48768. vertices: 0,
  48769. faces: 0,
  48770. points: 0
  48771. };
  48772. this.info = {
  48773. render: Ae,
  48774. memory: ye,
  48775. programs: null
  48776. };
  48777. try {
  48778. var Ce = {
  48779. alpha: D,
  48780. depth: N,
  48781. stencil: F,
  48782. antialias: B,
  48783. premultipliedAlpha: V,
  48784. preserveDrawingBuffer: k
  48785. };
  48786. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  48787. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  48788. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  48789. return {
  48790. rangeMin: 1,
  48791. rangeMax: 1,
  48792. precision: 1
  48793. }
  48794. }
  48795. ),
  48796. O.addEventListener("webglcontextlost", r, !1)
  48797. } catch (e) {
  48798. console.error("THREE.WebGLRenderer: " + e)
  48799. }
  48800. var Ie = new Ci.WebGLExtensions(X);
  48801. Ie.get("OES_texture_float"),
  48802. Ie.get("OES_texture_float_linear"),
  48803. Ie.get("OES_texture_half_float"),
  48804. Ie.get("OES_texture_half_float_linear"),
  48805. Ie.get("OES_standard_derivatives"),
  48806. Ie.get("ANGLE_instanced_arrays"),
  48807. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  48808. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  48809. , _e = new Ci.WebGLState(X,Ie,x)
  48810. , be = new Ci.WebGLProperties
  48811. , we = new Ci.WebGLObjects(X,be,this.info)
  48812. , Te = new Ci.WebGLPrograms(this,Ee)
  48813. , xe = new Ci.WebGLLights;
  48814. this.info.programs = Te.programs;
  48815. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  48816. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  48817. t(),
  48818. this.context = X,
  48819. this.capabilities = Ee,
  48820. this.extensions = Ie,
  48821. this.properties = be,
  48822. this.state = _e;
  48823. var Re = new Ci.WebGLShadowMap(this,ve,we);
  48824. this.shadowMap = Re;
  48825. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  48826. this.getContext = function() {
  48827. return X
  48828. }
  48829. ,
  48830. this.getContextAttributes = function() {
  48831. return X.getContextAttributes()
  48832. }
  48833. ,
  48834. this.forceContextLoss = function() {
  48835. Ie.get("WEBGL_lose_context").loseContext()
  48836. }
  48837. ,
  48838. this.getMaxAnisotropy = function() {
  48839. if (void 0 !== Pe)
  48840. return Pe;
  48841. var e = Ie.get("EXT_texture_filter_anisotropic");
  48842. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  48843. }
  48844. ,
  48845. this.getPrecision = function() {
  48846. return Ee.precision
  48847. }
  48848. ,
  48849. this.getPixelRatio = function() {
  48850. return he
  48851. }
  48852. ,
  48853. this.setPixelRatio = function(e) {
  48854. void 0 !== e && (he = e,
  48855. this.setSize(pe.z, pe.w, !1))
  48856. }
  48857. ,
  48858. this.getSize = function() {
  48859. return {
  48860. width: le,
  48861. height: ce
  48862. }
  48863. }
  48864. ,
  48865. this.setSize = function(e, t, i, n) {
  48866. null != n && (he = n),
  48867. le = e,
  48868. ce = t,
  48869. O.width = e * he,
  48870. O.height = t * he,
  48871. !1 !== i && (O.style.width = e + "px",
  48872. O.style.height = t + "px"),
  48873. this.setViewport(0, 0, e, t)
  48874. }
  48875. ,
  48876. this.setViewport = function(e, t, i, n) {
  48877. _e.viewport(pe.set(e, t, i, n))
  48878. }
  48879. ,
  48880. this.setScissor = function(e, t, i, n) {
  48881. _e.scissor(ue.set(e, t, i, n))
  48882. }
  48883. ,
  48884. this.setScissorTest = function(e) {
  48885. _e.setScissorTest(de = e)
  48886. }
  48887. ,
  48888. this.getClearColor = function() {
  48889. return ae
  48890. }
  48891. ,
  48892. this.setClearColor = function(e, t) {
  48893. ae.set(e),
  48894. se = void 0 !== t ? t : 1,
  48895. i(ae.r, ae.g, ae.b, se)
  48896. }
  48897. ,
  48898. this.getClearAlpha = function() {
  48899. return se
  48900. }
  48901. ,
  48902. this.setClearAlpha = function(e) {
  48903. se = e,
  48904. i(ae.r, ae.g, ae.b, se)
  48905. }
  48906. ,
  48907. this.clear = function(e, t, i) {
  48908. var n = 0;
  48909. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  48910. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  48911. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  48912. X.clear(n)
  48913. }
  48914. ,
  48915. this.clearColor = function() {
  48916. this.clear(!0, !1, !1)
  48917. }
  48918. ,
  48919. this.clearDepth = function() {
  48920. this.clear(!1, !0, !1)
  48921. }
  48922. ,
  48923. this.clearStencil = function() {
  48924. this.clear(!1, !1, !0)
  48925. }
  48926. ,
  48927. this.clearTarget = function(e, t, i, n) {
  48928. this.setRenderTarget(e),
  48929. this.clear(t, i, n)
  48930. }
  48931. ,
  48932. this.resetGLState = n,
  48933. this.dispose = function() {
  48934. O.removeEventListener("webglcontextlost", r, !1)
  48935. }
  48936. ,
  48937. this.renderBufferImmediate = function(e, t, i) {
  48938. _e.initAttributes();
  48939. var n = be.get(e);
  48940. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  48941. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  48942. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  48943. e.hasColors && !n.color && (n.color = X.createBuffer());
  48944. var r = t.getAttributes();
  48945. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  48946. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  48947. _e.enableAttribute(r.position),
  48948. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  48949. e.hasNormals) {
  48950. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  48951. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  48952. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  48953. var s = e.normalArray
  48954. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  48955. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  48956. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  48957. s[o + 0] = l,
  48958. s[o + 1] = c,
  48959. s[o + 2] = h,
  48960. s[o + 3] = l,
  48961. s[o + 4] = c,
  48962. s[o + 5] = h,
  48963. s[o + 6] = l,
  48964. s[o + 7] = c,
  48965. s[o + 8] = h
  48966. }
  48967. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  48968. _e.enableAttribute(r.normal),
  48969. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  48970. }
  48971. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  48972. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  48973. _e.enableAttribute(r.uv),
  48974. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  48975. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  48976. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  48977. _e.enableAttribute(r.color),
  48978. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  48979. _e.disableUnusedAttributes(),
  48980. X.drawArrays(X.TRIANGLES, 0, e.count),
  48981. e.count = 0
  48982. }
  48983. ,
  48984. this.renderBufferDirect = function(e, t, i, n, r, o) {
  48985. R(n);
  48986. var a = P(e, t, n, r)
  48987. , s = !1
  48988. , l = i.id + "_" + a.id + "_" + n.wireframe;
  48989. l !== ee && (ee = l,
  48990. s = !0);
  48991. var c = r.morphTargetInfluences;
  48992. if (void 0 !== c) {
  48993. for (var h = [], u = 0, d = c.length; u < d; u++) {
  48994. var p = c[u];
  48995. h.push([p, u])
  48996. }
  48997. h.sort(M),
  48998. 8 < h.length && (h.length = 8);
  48999. var f = i.morphAttributes;
  49000. for (u = 0,
  49001. d = h.length; u < d; u++) {
  49002. p = h[u];
  49003. if (j[u] = p[0],
  49004. 0 !== p[0]) {
  49005. var g = p[1];
  49006. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49007. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49008. } else
  49009. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49010. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49011. }
  49012. var m = a.getUniforms();
  49013. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49014. s = !0
  49015. }
  49016. g = i.index;
  49017. var v, y = i.attributes.position;
  49018. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49019. null !== g ? (v = Me).setIndex(g) : v = Se,
  49020. s && (function(e, t, i, n) {
  49021. var r;
  49022. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49023. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49024. else {
  49025. void 0 === n && (n = 0),
  49026. _e.initAttributes();
  49027. var o = i.attributes
  49028. , a = t.getAttributes()
  49029. , s = e.defaultAttributeValues;
  49030. for (var l in a) {
  49031. var c = a[l];
  49032. if (0 <= c) {
  49033. var h = o[l];
  49034. if (void 0 !== h) {
  49035. var u = h.itemSize
  49036. , d = we.getAttributeBuffer(h);
  49037. if (h instanceof Ci.InterleavedBufferAttribute) {
  49038. var p = h.data
  49039. , f = p.stride
  49040. , g = h.offset;
  49041. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49042. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49043. X.bindBuffer(X.ARRAY_BUFFER, d),
  49044. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49045. } else
  49046. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49047. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49048. X.bindBuffer(X.ARRAY_BUFFER, d),
  49049. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49050. } else if (void 0 !== s) {
  49051. var m = s[l];
  49052. if (void 0 !== m)
  49053. switch (m.length) {
  49054. case 2:
  49055. X.vertexAttrib2fv(c, m);
  49056. break;
  49057. case 3:
  49058. X.vertexAttrib3fv(c, m);
  49059. break;
  49060. case 4:
  49061. X.vertexAttrib4fv(c, m);
  49062. break;
  49063. default:
  49064. X.vertexAttrib1fv(c, m)
  49065. }
  49066. }
  49067. }
  49068. }
  49069. _e.disableUnusedAttributes()
  49070. }
  49071. }(n, a, i),
  49072. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49073. var A = 1 / 0;
  49074. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49075. var C = i.drawRange.start
  49076. , I = i.drawRange.count
  49077. , E = null !== o ? o.start : 0
  49078. , _ = null !== o ? o.count : 1 / 0
  49079. , b = Math.max(0, C, E)
  49080. , w = Math.min(0 + A, C + I, E + _) - 1
  49081. , T = Math.max(0, w - b + 1);
  49082. if (r instanceof Ci.Mesh)
  49083. if (!0 === n.wireframe)
  49084. _e.setLineWidth(n.wireframeLinewidth * S()),
  49085. v.setMode(X.LINES);
  49086. else
  49087. switch (r.drawMode) {
  49088. case Ci.TrianglesDrawMode:
  49089. v.setMode(X.TRIANGLES);
  49090. break;
  49091. case Ci.TriangleStripDrawMode:
  49092. v.setMode(X.TRIANGLE_STRIP);
  49093. break;
  49094. case Ci.TriangleFanDrawMode:
  49095. v.setMode(X.TRIANGLE_FAN)
  49096. }
  49097. else if (r instanceof Ci.Line) {
  49098. var x = n.linewidth;
  49099. void 0 === x && (x = 1),
  49100. _e.setLineWidth(x * S()),
  49101. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49102. } else
  49103. r instanceof Ci.Points && v.setMode(X.POINTS);
  49104. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49105. }
  49106. ,
  49107. this.render = function(e, t, i, n) {
  49108. if (t instanceof Ci.Camera != 0) {
  49109. var r = e.fog;
  49110. if (ee = "",
  49111. $ = -1,
  49112. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49113. null === t.parent && t.updateMatrixWorld(),
  49114. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49115. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49116. fe.setFromMatrix(ge),
  49117. U.length = 0,
  49118. W = z = -1,
  49119. Y.length = 0,
  49120. q.length = 0,
  49121. function e(t, i) {
  49122. if (!1 !== t.visible) {
  49123. if (t.layers.test(i.layers))
  49124. if (t instanceof Ci.Light)
  49125. U.push(t);
  49126. else if (t instanceof Ci.Sprite)
  49127. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49128. else if (t instanceof Ci.LensFlare)
  49129. q.push(t);
  49130. else if (t instanceof Ci.ImmediateRenderObject)
  49131. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49132. me.applyProjection(ge)),
  49133. d(t, null, t.material, me.z, null);
  49134. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49135. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49136. var n = t.material;
  49137. if (!0 === n.visible) {
  49138. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49139. me.applyProjection(ge));
  49140. var r = we.update(t);
  49141. if (n instanceof Ci.MultiMaterial)
  49142. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49143. var c = o[s]
  49144. , h = a[c.materialIndex];
  49145. !0 === h.visible && d(t, r, h, me.z, c)
  49146. }
  49147. else
  49148. d(t, r, n, me.z, null)
  49149. }
  49150. }
  49151. var u = t.children;
  49152. for (s = 0,
  49153. l = u.length; s < l; s++)
  49154. e(u[s], i)
  49155. }
  49156. }(e, t),
  49157. H.length = z + 1,
  49158. G.length = W + 1,
  49159. !0 === Z.sortObjects && (H.sort(s),
  49160. G.sort(l)),
  49161. function(e, t) {
  49162. var i, n, r, o, a, s, l = 0, c = 0, h = 0, u = t.matrixWorldInverse, d = 0, p = 0, f = 0, g = 0, m = 0;
  49163. for (i = ve.shadowsPointLight = 0,
  49164. n = e.length; i < n; i++)
  49165. if (o = (r = e[i]).color,
  49166. a = r.intensity,
  49167. s = r.distance,
  49168. r instanceof Ci.AmbientLight)
  49169. l += o.r * a,
  49170. c += o.g * a,
  49171. h += o.b * a;
  49172. else if (r instanceof Ci.DirectionalLight) {
  49173. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49174. v.direction.setFromMatrixPosition(r.matrixWorld),
  49175. me.setFromMatrixPosition(r.target.matrixWorld),
  49176. v.direction.sub(me),
  49177. v.direction.transformDirection(u),
  49178. v.shadow = r.castShadow,
  49179. r.castShadow && (v.shadowBias = r.shadow.bias,
  49180. v.shadowRadius = r.shadow.radius,
  49181. v.shadowMapSize = r.shadow.mapSize,
  49182. ve.shadows[m++] = r),
  49183. ve.directionalShadowMap[d] = r.shadow.map,
  49184. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49185. ve.directional[d++] = v
  49186. } else if (r instanceof Ci.SpotLight) {
  49187. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49188. v.position.applyMatrix4(u),
  49189. v.color.copy(o).multiplyScalar(a),
  49190. v.distance = s,
  49191. v.direction.setFromMatrixPosition(r.matrixWorld),
  49192. me.setFromMatrixPosition(r.target.matrixWorld),
  49193. v.direction.sub(me),
  49194. v.direction.transformDirection(u),
  49195. v.coneCos = Math.cos(r.angle),
  49196. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49197. v.decay = 0 === r.distance ? 0 : r.decay,
  49198. v.shadow = r.castShadow,
  49199. r.castShadow && (v.shadowBias = r.shadow.bias,
  49200. v.shadowRadius = r.shadow.radius,
  49201. v.shadowMapSize = r.shadow.mapSize,
  49202. ve.shadows[m++] = r),
  49203. ve.spotShadowMap[f] = r.shadow.map,
  49204. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49205. ve.spot[f++] = v
  49206. } else if (r instanceof Ci.PointLight) {
  49207. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49208. v.position.applyMatrix4(u),
  49209. v.color.copy(r.color).multiplyScalar(r.intensity),
  49210. v.distance = r.distance,
  49211. v.decay = 0 === r.distance ? 0 : r.decay,
  49212. v.shadow = r.castShadow,
  49213. r.castShadow && (v.shadowBias = r.shadow.bias,
  49214. v.shadowRadius = r.shadow.radius,
  49215. v.shadowMapSize = r.shadow.mapSize,
  49216. ve.shadows[m++] = r),
  49217. ve.pointShadowMap[p] = r.shadow.map,
  49218. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49219. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49220. ve.pointShadowMatrix[p].identity().setPosition(me),
  49221. ve.point[p++] = v
  49222. } else if (r instanceof Ci.HemisphereLight) {
  49223. var v;
  49224. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49225. v.direction.transformDirection(u),
  49226. v.direction.normalize(),
  49227. v.skyColor.copy(r.color).multiplyScalar(a),
  49228. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49229. ve.hemi[g++] = v
  49230. }
  49231. ve.ambient[0] = l,
  49232. ve.ambient[1] = c,
  49233. ve.ambient[2] = h,
  49234. ve.directional.length = d,
  49235. ve.spot.length = f,
  49236. ve.point.length = p,
  49237. ve.hemi.length = g,
  49238. ve.shadows.length = m,
  49239. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49240. }(U, t),
  49241. Re.render(e, t),
  49242. Ae.calls = 0,
  49243. Ae.vertices = 0,
  49244. Ae.faces = 0,
  49245. void (Ae.points = 0) === i && (i = null),
  49246. this.setRenderTarget(i),
  49247. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49248. e.overrideMaterial) {
  49249. var o = e.overrideMaterial;
  49250. c(H, t, r, o),
  49251. c(G, t, r, o)
  49252. } else
  49253. _e.setBlending(Ci.NoBlending),
  49254. c(H, t, r),
  49255. c(G, t, r);
  49256. if (Oe.render(e, t),
  49257. Le.render(e, t, re),
  49258. i) {
  49259. var a = i.texture;
  49260. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49261. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49262. , i = be.get(e.texture).__webglTexture;
  49263. _e.bindTexture(t, i),
  49264. X.generateMipmap(t),
  49265. _e.bindTexture(t, null)
  49266. }(i)
  49267. }
  49268. _e.setDepthTest(!0),
  49269. _e.setDepthWrite(!0),
  49270. _e.setColorWrite(!0)
  49271. } else
  49272. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49273. }
  49274. ,
  49275. this.setFaceCulling = function(e, t) {
  49276. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49277. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49278. _e.enable(X.CULL_FACE))
  49279. }
  49280. ,
  49281. this.setTexture = function(e, t) {
  49282. var i = be.get(e);
  49283. if (0 < e.version && i.__version !== e.version) {
  49284. var n = e.image;
  49285. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : !1 === n.complete ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void o(i, e, t)
  49286. }
  49287. _e.activeTexture(X.TEXTURE0 + t),
  49288. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49289. }
  49290. ,
  49291. this.getCurrentRenderTarget = function() {
  49292. return Q
  49293. }
  49294. ,
  49295. this.setRenderTarget = function(e) {
  49296. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49297. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49298. if (e) {
  49299. var n = be.get(e);
  49300. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49301. ie.copy(e.scissor),
  49302. ne = e.scissorTest,
  49303. re.copy(e.viewport)
  49304. } else
  49305. t = null,
  49306. ie.copy(ue).multiplyScalar(he),
  49307. ne = de,
  49308. re.copy(pe).multiplyScalar(he);
  49309. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49310. J = t),
  49311. _e.scissor(ie),
  49312. _e.setScissorTest(ne),
  49313. _e.viewport(re),
  49314. i) {
  49315. var r = be.get(e.texture);
  49316. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49317. }
  49318. }
  49319. ,
  49320. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49321. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49322. var a = be.get(e).__webglFramebuffer;
  49323. if (a) {
  49324. var s = !1;
  49325. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49326. s = !0);
  49327. try {
  49328. var l = e.texture;
  49329. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49330. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49331. if (!(l.type === Ci.UnsignedByteType || x(l.type) === X.getParameter(X.IMPLEMENTATION_COLOR_READ_TYPE) || l.type === Ci.FloatType && Ie.get("WEBGL_color_buffer_float") || l.type === Ci.HalfFloatType && Ie.get("EXT_color_buffer_half_float")))
  49332. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49333. X.checkFramebufferStatus(X.FRAMEBUFFER) === X.FRAMEBUFFER_COMPLETE ? X.readPixels(t, i, n, r, x(l.format), x(l.type), o) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  49334. } finally {
  49335. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49336. }
  49337. }
  49338. } else
  49339. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49340. }
  49341. }
  49342. ,
  49343. Ci.WebGLRenderTarget = function(e, t, i) {
  49344. this.uuid = Ci.Math.generateUUID(),
  49345. this.width = e,
  49346. this.height = t,
  49347. this.scissor = new Ci.Vector4(0,0,e,t),
  49348. this.scissorTest = !1,
  49349. this.viewport = new Ci.Vector4(0,0,e,t),
  49350. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49351. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49352. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49353. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49354. }
  49355. ,
  49356. Ci.WebGLRenderTarget.prototype = {
  49357. constructor: Ci.WebGLRenderTarget,
  49358. setSize: function(e, t) {
  49359. this.width === e && this.height === t || (this.width = e,
  49360. this.height = t,
  49361. this.dispose()),
  49362. this.viewport.set(0, 0, e, t),
  49363. this.scissor.set(0, 0, e, t)
  49364. },
  49365. clone: function() {
  49366. return (new this.constructor).copy(this)
  49367. },
  49368. copy: function(e) {
  49369. return this.width = e.width,
  49370. this.height = e.height,
  49371. this.viewport.copy(e.viewport),
  49372. this.texture = e.texture.clone(),
  49373. this.depthBuffer = e.depthBuffer,
  49374. this.stencilBuffer = e.stencilBuffer,
  49375. this
  49376. },
  49377. dispose: function() {
  49378. this.dispatchEvent({
  49379. type: "dispose"
  49380. })
  49381. }
  49382. },
  49383. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49384. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49385. Ci.WebGLRenderTarget.call(this, e, t, i),
  49386. this.activeCubeFace = 0,
  49387. this.activeMipMapLevel = 0
  49388. }
  49389. ,
  49390. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49391. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49392. Ci.WebGLBufferRenderer = function(r, o, a) {
  49393. var s;
  49394. this.setMode = function(e) {
  49395. s = e
  49396. }
  49397. ,
  49398. this.render = function(e, t) {
  49399. r.drawArrays(s, e, t),
  49400. a.calls++,
  49401. a.vertices += t,
  49402. s === r.TRIANGLES && (a.faces += t / 3)
  49403. }
  49404. ,
  49405. this.renderInstances = function(e) {
  49406. var t = o.get("ANGLE_instanced_arrays");
  49407. if (null !== t) {
  49408. var i = e.attributes.position
  49409. , n = 0;
  49410. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49411. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49412. a.calls++,
  49413. a.vertices += n * e.maxInstancedCount,
  49414. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49415. } else
  49416. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49417. }
  49418. }
  49419. ,
  49420. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49421. var s, l, c;
  49422. this.setMode = function(e) {
  49423. s = e
  49424. }
  49425. ,
  49426. this.setIndex = function(e) {
  49427. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49428. 4) : (l = r.UNSIGNED_SHORT,
  49429. 2)
  49430. }
  49431. ,
  49432. this.render = function(e, t) {
  49433. r.drawElements(s, t, l, e * c),
  49434. a.calls++,
  49435. a.vertices += t,
  49436. s === r.TRIANGLES && (a.faces += t / 3)
  49437. }
  49438. ,
  49439. this.renderInstances = function(e, t, i) {
  49440. var n = o.get("ANGLE_instanced_arrays");
  49441. return null === n ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (n.drawElementsInstancedANGLE(s, i, l, t * c, e.maxInstancedCount),
  49442. a.calls++,
  49443. a.vertices += i * e.maxInstancedCount,
  49444. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49445. }
  49446. }
  49447. ,
  49448. Ci.WebGLExtensions = function(i) {
  49449. var n = {};
  49450. this.get = function(e) {
  49451. if (void 0 !== n[e])
  49452. return n[e];
  49453. var t;
  49454. switch (e) {
  49455. case "EXT_texture_filter_anisotropic":
  49456. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49457. break;
  49458. case "WEBGL_compressed_texture_s3tc":
  49459. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49460. break;
  49461. case "WEBGL_compressed_texture_pvrtc":
  49462. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49463. break;
  49464. case "WEBGL_compressed_texture_etc1":
  49465. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49466. break;
  49467. default:
  49468. t = i.getExtension(e)
  49469. }
  49470. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49471. n[e] = t
  49472. }
  49473. }
  49474. ,
  49475. Ci.WebGLCapabilities = function(t, e, i) {
  49476. function n(e) {
  49477. if ("highp" === e) {
  49478. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49479. return "highp";
  49480. e = "mediump"
  49481. }
  49482. return "mediump" === e && 0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.MEDIUM_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.MEDIUM_FLOAT).precision ? "mediump" : "lowp"
  49483. }
  49484. this.getMaxPrecision = n,
  49485. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49486. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49487. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49488. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49489. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49490. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49491. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49492. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49493. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49494. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49495. this.vertexTextures = 0 < this.maxVertexTextures,
  49496. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49497. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49498. var r = n(this.precision);
  49499. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49500. this.precision = r),
  49501. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49502. }
  49503. ,
  49504. Ci.WebGLGeometries = function(i, o, a) {
  49505. function s(e) {
  49506. var t = e.target
  49507. , i = c[t.id];
  49508. null !== i.index && l(i.index),
  49509. function(e) {
  49510. for (var t in e)
  49511. l(e[t])
  49512. }(i.attributes),
  49513. t.removeEventListener("dispose", s),
  49514. delete c[t.id];
  49515. var n = o.get(t);
  49516. n.wireframe && l(n.wireframe),
  49517. o.delete(t);
  49518. var r = o.get(i);
  49519. r.wireframe && l(r.wireframe),
  49520. o.delete(i),
  49521. a.memory.geometries--
  49522. }
  49523. function l(e) {
  49524. var t = function(e) {
  49525. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49526. }(e);
  49527. void 0 !== t && (i.deleteBuffer(t),
  49528. function(e) {
  49529. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49530. }(e))
  49531. }
  49532. var c = {};
  49533. this.get = function(e) {
  49534. var t, i = e.geometry;
  49535. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49536. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49537. t = i._bufferGeometry),
  49538. c[i.id] = t,
  49539. a.memory.geometries++,
  49540. t)
  49541. }
  49542. }
  49543. ,
  49544. Ci.WebGLLights = function() {
  49545. var i = {};
  49546. this.get = function(e) {
  49547. if (void 0 !== i[e.id])
  49548. return i[e.id];
  49549. var t;
  49550. switch (e.type) {
  49551. case "DirectionalLight":
  49552. t = {
  49553. direction: new Ci.Vector3,
  49554. color: new Ci.Color,
  49555. shadow: !1,
  49556. shadowBias: 0,
  49557. shadowRadius: 1,
  49558. shadowMapSize: new Ci.Vector2
  49559. };
  49560. break;
  49561. case "SpotLight":
  49562. t = {
  49563. position: new Ci.Vector3,
  49564. direction: new Ci.Vector3,
  49565. color: new Ci.Color,
  49566. distance: 0,
  49567. coneCos: 0,
  49568. penumbraCos: 0,
  49569. decay: 0,
  49570. shadow: !1,
  49571. shadowBias: 0,
  49572. shadowRadius: 1,
  49573. shadowMapSize: new Ci.Vector2
  49574. };
  49575. break;
  49576. case "PointLight":
  49577. t = {
  49578. position: new Ci.Vector3,
  49579. color: new Ci.Color,
  49580. distance: 0,
  49581. decay: 0,
  49582. shadow: !1,
  49583. shadowBias: 0,
  49584. shadowRadius: 1,
  49585. shadowMapSize: new Ci.Vector2
  49586. };
  49587. break;
  49588. case "HemisphereLight":
  49589. t = {
  49590. direction: new Ci.Vector3,
  49591. skyColor: new Ci.Color,
  49592. groundColor: new Ci.Color
  49593. }
  49594. }
  49595. return i[e.id] = t
  49596. }
  49597. }
  49598. ,
  49599. Ci.WebGLObjects = function(g, m, e) {
  49600. function v(e, t) {
  49601. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  49602. , n = m.get(i);
  49603. void 0 === n.__webglBuffer ? function(e, t, i) {
  49604. e.__webglBuffer = g.createBuffer(),
  49605. g.bindBuffer(i, e.__webglBuffer);
  49606. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  49607. g.bufferData(i, t.array, n),
  49608. e.version = t.version
  49609. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  49610. g.bindBuffer(i, e.__webglBuffer),
  49611. !1 === t.dynamic || -1 === t.updateRange.count ? g.bufferSubData(i, 0, t.array) : 0 === t.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (g.bufferSubData(i, t.updateRange.offset * t.array.BYTES_PER_ELEMENT, t.array.subarray(t.updateRange.offset, t.updateRange.offset + t.updateRange.count)),
  49612. t.updateRange.count = 0),
  49613. e.version = t.version
  49614. }(n, i, t)
  49615. }
  49616. function y(e, t, i) {
  49617. if (i < t) {
  49618. var n = t;
  49619. t = i,
  49620. i = n
  49621. }
  49622. var r = e[t];
  49623. return void 0 === r ? (e[t] = [i],
  49624. !0) : -1 === r.indexOf(i) && (r.push(i),
  49625. !0)
  49626. }
  49627. var c = new Ci.WebGLGeometries(g,m,e);
  49628. this.getAttributeBuffer = function(e) {
  49629. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  49630. }
  49631. ,
  49632. this.getWireframeAttribute = function(e) {
  49633. var t = m.get(e);
  49634. if (void 0 !== t.wireframe)
  49635. return t.wireframe;
  49636. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  49637. if (null !== r)
  49638. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  49639. var h = i[l + 0]
  49640. , u = i[l + 1]
  49641. , d = i[l + 2];
  49642. y(s, h, u) && n.push(h, u),
  49643. y(s, u, d) && n.push(u, d),
  49644. y(s, d, h) && n.push(d, h)
  49645. }
  49646. else
  49647. for (l = 0,
  49648. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  49649. h = l + 0,
  49650. u = l + 1,
  49651. d = l + 2;
  49652. n.push(h, u, u, d, d, h)
  49653. }
  49654. var p = 65535 < a.count ? Uint32Array : Uint16Array
  49655. , f = new Ci.BufferAttribute(new p(n),1);
  49656. return v(f, g.ELEMENT_ARRAY_BUFFER),
  49657. t.wireframe = f
  49658. }
  49659. ,
  49660. this.update = function(e) {
  49661. var t = c.get(e);
  49662. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  49663. var i = t.index
  49664. , n = t.attributes;
  49665. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  49666. n)
  49667. v(n[r], g.ARRAY_BUFFER);
  49668. var o = t.morphAttributes;
  49669. for (var r in o)
  49670. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  49671. v(a[s], g.ARRAY_BUFFER);
  49672. return t
  49673. }
  49674. }
  49675. ,
  49676. Ci.WebGLProgram = (Qt = 0,
  49677. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  49678. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  49679. ei = /^([\w\d_]+)\[0\]$/,
  49680. function(e, t, i, n) {
  49681. var r = e.context
  49682. , o = i.extensions
  49683. , a = i.defines
  49684. , s = i.__webglShader.vertexShader
  49685. , l = i.__webglShader.fragmentShader
  49686. , c = "SHADOWMAP_TYPE_BASIC";
  49687. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  49688. var h = "ENVMAP_TYPE_CUBE"
  49689. , u = "ENVMAP_MODE_REFLECTION"
  49690. , d = "ENVMAP_BLENDING_MULTIPLY";
  49691. if (n.envMap) {
  49692. switch (i.envMap.mapping) {
  49693. case Ci.CubeReflectionMapping:
  49694. case Ci.CubeRefractionMapping:
  49695. h = "ENVMAP_TYPE_CUBE";
  49696. break;
  49697. case Ci.CubeUVReflectionMapping:
  49698. case Ci.CubeUVRefractionMapping:
  49699. h = "ENVMAP_TYPE_CUBE_UV";
  49700. break;
  49701. case Ci.EquirectangularReflectionMapping:
  49702. case Ci.EquirectangularRefractionMapping:
  49703. h = "ENVMAP_TYPE_EQUIREC";
  49704. break;
  49705. case Ci.SphericalReflectionMapping:
  49706. h = "ENVMAP_TYPE_SPHERE"
  49707. }
  49708. switch (i.envMap.mapping) {
  49709. case Ci.CubeRefractionMapping:
  49710. case Ci.EquirectangularRefractionMapping:
  49711. u = "ENVMAP_MODE_REFRACTION"
  49712. }
  49713. switch (i.combine) {
  49714. case Ci.MultiplyOperation:
  49715. d = "ENVMAP_BLENDING_MULTIPLY";
  49716. break;
  49717. case Ci.MixOperation:
  49718. d = "ENVMAP_BLENDING_MIX";
  49719. break;
  49720. case Ci.AddOperation:
  49721. d = "ENVMAP_BLENDING_ADD"
  49722. }
  49723. }
  49724. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  49725. return [(e = e || {}).derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""].filter(Pi).join("\n")
  49726. }(o, n, e.extensions), v = function(e) {
  49727. var t = [];
  49728. for (var i in e) {
  49729. var n = e[i];
  49730. !1 !== n && t.push("#define " + i + " " + n)
  49731. }
  49732. return t.join("\n")
  49733. }(a), y = r.createProgram();
  49734. f = i instanceof Ci.RawShaderMaterial ? p = "" : (p = ["precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + g, "#define MAX_BONES " + n.maxBones, n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + u : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.displacementMap && n.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.skinning ? "#define USE_SKINNING" : "", n.useVertexTexture ? "#define BONE_TEXTURE" : "", n.morphTargets ? "#define USE_MORPHTARGETS" : "", n.morphNormals && !1 === n.flatShading ? "#define USE_MORPHNORMALS" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(Pi).join("\n"),
  49735. [m, "precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.alphaTest ? "#define ALPHATEST " + n.alphaTest : "", "#define GAMMA_FACTOR " + g, n.useFog && n.fog ? "#define USE_FOG" : "", n.useFog && n.fogExp ? "#define FOG_EXP2" : "", n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + h : "", n.envMap ? "#define " + u : "", n.envMap ? "#define " + d : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", n.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", n.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", n.toneMapping !== Ci.NoToneMapping ? "#define TONE_MAPPING" : "", n.toneMapping !== Ci.NoToneMapping ? Ci.ShaderChunk.tonemapping_pars_fragment : "", n.toneMapping !== Ci.NoToneMapping ? function(e, t) {
  49736. var i;
  49737. switch (t) {
  49738. case Ci.LinearToneMapping:
  49739. i = "Linear";
  49740. break;
  49741. case Ci.ReinhardToneMapping:
  49742. i = "Reinhard";
  49743. break;
  49744. case Ci.Uncharted2ToneMapping:
  49745. i = "Uncharted2";
  49746. break;
  49747. case Ci.CineonToneMapping:
  49748. i = "OptimizedCineon";
  49749. break;
  49750. default:
  49751. throw new Error("unsupported toneMapping: " + t)
  49752. }
  49753. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  49754. }("toneMapping", n.toneMapping) : "", n.outputEncoding || n.mapEncoding || n.envMapEncoding || n.emissiveMapEncoding ? Ci.ShaderChunk.encodings_pars_fragment : "", n.mapEncoding ? Ri("mapTexelToLinear", n.mapEncoding) : "", n.envMapEncoding ? Ri("envMapTexelToLinear", n.envMapEncoding) : "", n.emissiveMapEncoding ? Ri("emissiveMapTexelToLinear", n.emissiveMapEncoding) : "", n.outputEncoding ? function(e, t) {
  49755. var i = Mi(t);
  49756. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  49757. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  49758. s = Oi(s = Li(s), n),
  49759. l = Oi(l = Li(l), n),
  49760. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  49761. l = Di(l));
  49762. var A = p + s
  49763. , C = f + l
  49764. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  49765. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  49766. r.attachShader(y, I),
  49767. r.attachShader(y, E),
  49768. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  49769. r.linkProgram(y);
  49770. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  49771. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  49772. console.error("THREE.WebGLProgram: shader error: ", r.getError(), "gl.VALIDATE_STATUS", r.getProgramParameter(y, r.VALIDATE_STATUS), "gl.getProgramInfoLog", w, T, x)) : "" !== w ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", w) : "" !== T && "" !== x || (M = !1),
  49773. M && (this.diagnostics = {
  49774. runnable: S,
  49775. material: i,
  49776. programLog: w,
  49777. vertexShader: {
  49778. log: T,
  49779. prefix: p
  49780. },
  49781. fragmentShader: {
  49782. log: x,
  49783. prefix: f
  49784. }
  49785. }),
  49786. r.deleteShader(I),
  49787. r.deleteShader(E),
  49788. this.getUniforms = function() {
  49789. return void 0 === _ && (_ = function(e, t) {
  49790. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  49791. var o = e.getActiveUniform(t, r).name
  49792. , a = e.getUniformLocation(t, o)
  49793. , s = Jt.exec(o);
  49794. if (s) {
  49795. var l = s[1]
  49796. , c = s[2]
  49797. , h = i[l];
  49798. (h = h || (i[l] = {}))[c] = a
  49799. } else if (s = $t.exec(o)) {
  49800. var u = s[1]
  49801. , d = s[2]
  49802. , p = s[3]
  49803. , f = i[u]
  49804. , g = (f = f || (i[u] = []))[d];
  49805. (g = g || (f[d] = {}))[p] = a
  49806. } else
  49807. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  49808. }
  49809. return i
  49810. }(r, y)),
  49811. _
  49812. }
  49813. ,
  49814. this.getAttributes = function() {
  49815. return void 0 === b && (b = function(e, t) {
  49816. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  49817. var o = e.getActiveAttrib(t, r).name;
  49818. i[o] = e.getAttribLocation(t, o)
  49819. }
  49820. return i
  49821. }(r, y)),
  49822. b
  49823. }
  49824. ,
  49825. this.destroy = function() {
  49826. r.deleteProgram(y),
  49827. this.program = void 0
  49828. }
  49829. ,
  49830. Object.defineProperties(this, {
  49831. uniforms: {
  49832. get: function() {
  49833. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  49834. this.getUniforms()
  49835. }
  49836. },
  49837. attributes: {
  49838. get: function() {
  49839. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  49840. this.getAttributes()
  49841. }
  49842. }
  49843. }),
  49844. this.id = Qt++,
  49845. this.code = t,
  49846. this.usedTimes = 1,
  49847. this.program = y,
  49848. this.vertexShader = I,
  49849. this.fragmentShader = E,
  49850. this
  49851. }
  49852. ),
  49853. Ci.WebGLPrograms = function(s, l) {
  49854. function c(e, t) {
  49855. var i;
  49856. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  49857. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  49858. i
  49859. }
  49860. var h = []
  49861. , u = {
  49862. MeshDepthMaterial: "depth",
  49863. MeshNormalMaterial: "normal",
  49864. MeshBasicMaterial: "basic",
  49865. MeshLambertMaterial: "lambert",
  49866. MeshPhongMaterial: "phong",
  49867. MeshStandardMaterial: "standard",
  49868. LineBasicMaterial: "basic",
  49869. LineDashedMaterial: "dashed",
  49870. PointsMaterial: "points"
  49871. }
  49872. , a = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  49873. this.getParameters = function(e, t, i, n) {
  49874. var r = u[e.type]
  49875. , o = function(e) {
  49876. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  49877. return 1024;
  49878. var t = l.maxVertexUniforms
  49879. , i = Math.floor((t - 20) / 4);
  49880. return void 0 !== e && e instanceof Ci.SkinnedMesh && ((i = Math.min(e.skeleton.bones.length, i)) < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + i + " (try OpenGL instead of ANGLE)")),
  49881. i
  49882. }(n)
  49883. , a = s.getPrecision();
  49884. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  49885. {
  49886. shaderID: r,
  49887. precision: a,
  49888. supportsVertexTextures: l.vertexTextures,
  49889. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  49890. map: !!e.map,
  49891. mapEncoding: c(e.map, s.gammaInput),
  49892. envMap: !!e.envMap,
  49893. envMapMode: e.envMap && e.envMap.mapping,
  49894. envMapEncoding: c(e.envMap, s.gammaInput),
  49895. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  49896. lightMap: !!e.lightMap,
  49897. aoMap: !!e.aoMap,
  49898. emissiveMap: !!e.emissiveMap,
  49899. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  49900. bumpMap: !!e.bumpMap,
  49901. normalMap: !!e.normalMap,
  49902. displacementMap: !!e.displacementMap,
  49903. roughnessMap: !!e.roughnessMap,
  49904. metalnessMap: !!e.metalnessMap,
  49905. specularMap: !!e.specularMap,
  49906. alphaMap: !!e.alphaMap,
  49907. combine: e.combine,
  49908. vertexColors: e.vertexColors,
  49909. fog: i,
  49910. useFog: e.fog,
  49911. fogExp: i instanceof Ci.FogExp2,
  49912. flatShading: e.shading === Ci.FlatShading,
  49913. sizeAttenuation: e.sizeAttenuation,
  49914. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  49915. skinning: e.skinning,
  49916. maxBones: o,
  49917. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  49918. morphTargets: e.morphTargets,
  49919. morphNormals: e.morphNormals,
  49920. maxMorphTargets: s.maxMorphTargets,
  49921. maxMorphNormals: s.maxMorphNormals,
  49922. numDirLights: t.directional.length,
  49923. numPointLights: t.point.length,
  49924. numSpotLights: t.spot.length,
  49925. numHemiLights: t.hemi.length,
  49926. pointLightShadows: t.shadowsPointLight,
  49927. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  49928. shadowMapType: s.shadowMap.type,
  49929. toneMapping: s.toneMapping,
  49930. physicallyCorrectLights: s.physicallyCorrectLights,
  49931. premultipliedAlpha: e.premultipliedAlpha,
  49932. alphaTest: e.alphaTest,
  49933. doubleSided: e.side === Ci.DoubleSide,
  49934. flipSided: e.side === Ci.BackSide
  49935. }
  49936. }
  49937. ,
  49938. this.getProgramCode = function(e, t) {
  49939. var i = [];
  49940. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  49941. i.push(e.vertexShader)),
  49942. void 0 !== e.defines)
  49943. for (var n in e.defines)
  49944. i.push(n),
  49945. i.push(e.defines[n]);
  49946. for (var r = 0; r < a.length; r++) {
  49947. var o = a[r];
  49948. i.push(o),
  49949. i.push(t[o])
  49950. }
  49951. return i.join()
  49952. }
  49953. ,
  49954. this.acquireProgram = function(e, t, i) {
  49955. for (var n, r = 0, o = h.length; r < o; r++) {
  49956. var a = h[r];
  49957. if (a.code === i) {
  49958. ++(n = a).usedTimes;
  49959. break
  49960. }
  49961. }
  49962. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  49963. h.push(n)),
  49964. n
  49965. }
  49966. ,
  49967. this.releaseProgram = function(e) {
  49968. if (0 == --e.usedTimes) {
  49969. var t = h.indexOf(e);
  49970. h[t] = h[h.length - 1],
  49971. h.pop(),
  49972. e.destroy()
  49973. }
  49974. }
  49975. ,
  49976. this.programs = h
  49977. }
  49978. ,
  49979. Ci.WebGLProperties = function() {
  49980. var n = {};
  49981. this.get = function(e) {
  49982. var t = e.uuid
  49983. , i = n[t];
  49984. return void 0 === i && (i = {},
  49985. n[t] = i),
  49986. i
  49987. }
  49988. ,
  49989. this.delete = function(e) {
  49990. delete n[e.uuid]
  49991. }
  49992. ,
  49993. this.clear = function() {
  49994. n = {}
  49995. }
  49996. }
  49997. ,
  49998. Ci.WebGLShader = function(e, t, i) {
  49999. var n = e.createShader(t);
  50000. return e.shaderSource(n, i),
  50001. e.compileShader(n),
  50002. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50003. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50004. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50005. t[i] = i + 1 + ": " + t[i];
  50006. return t.join("\n")
  50007. }(i)),
  50008. n
  50009. }
  50010. ,
  50011. Ci.WebGLShadowMap = function(P, O, L) {
  50012. function D(e, t, i, n) {
  50013. var r = e.geometry
  50014. , o = null
  50015. , a = p
  50016. , s = e.customDepthMaterial;
  50017. if (i && (a = f,
  50018. s = e.customDistanceMaterial),
  50019. s)
  50020. o = s;
  50021. else {
  50022. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50023. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50024. , h = 0;
  50025. l && (h |= u),
  50026. c && (h |= d),
  50027. o = a[h]
  50028. }
  50029. return o.visible = t.visible,
  50030. o.wireframe = t.wireframe,
  50031. o.wireframeLinewidth = t.wireframeLinewidth,
  50032. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50033. o
  50034. }
  50035. function N(e, t, i) {
  50036. if (!1 !== e.visible) {
  50037. if (e.layers.test(t.layers) && (e instanceof Ci.Mesh || e instanceof Ci.Line || e instanceof Ci.Points) && e.castShadow && (!1 === e.frustumCulled || !0 === V.intersectsObject(e)))
  50038. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50039. G.push(e));
  50040. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50041. N(n[r], t, i)
  50042. }
  50043. }
  50044. for (var F = P.context, B = P.state, V = new Ci.Frustum, k = new Ci.Matrix4, U = new Ci.Vector2, H = new Ci.Vector3, z = new Ci.Vector3, G = [], u = 1, d = 2, e = 1 + (u | d), p = new Array(e), f = new Array(e), W = [new Ci.Vector3(1,0,0), new Ci.Vector3(-1,0,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1), new Ci.Vector3(0,1,0), new Ci.Vector3(0,-1,0)], j = [new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1)], Y = [new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4], t = Ci.ShaderLib.depthRGBA, i = Ci.UniformsUtils.clone(t.uniforms), n = Ci.ShaderLib.distanceRGBA, r = Ci.UniformsUtils.clone(n.uniforms), o = 0; o !== e; ++o) {
  50045. var a = 0 != (o & u)
  50046. , s = 0 != (o & d)
  50047. , l = new Ci.ShaderMaterial({
  50048. uniforms: i,
  50049. vertexShader: t.vertexShader,
  50050. fragmentShader: t.fragmentShader,
  50051. morphTargets: a,
  50052. skinning: s
  50053. });
  50054. p[o] = l;
  50055. var c = new Ci.ShaderMaterial({
  50056. defines: {
  50057. USE_SHADOWMAP: ""
  50058. },
  50059. uniforms: r,
  50060. vertexShader: n.vertexShader,
  50061. fragmentShader: n.fragmentShader,
  50062. morphTargets: a,
  50063. skinning: s
  50064. });
  50065. f[o] = c
  50066. }
  50067. var q = this;
  50068. this.enabled = !1,
  50069. this.autoUpdate = !0,
  50070. this.needsUpdate = !1,
  50071. this.type = Ci.PCFShadowMap,
  50072. this.cullFace = Ci.CullFaceFront,
  50073. this.render = function(e, t) {
  50074. var i, n, r = O.shadows;
  50075. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50076. B.clearColor(1, 1, 1, 1),
  50077. B.disable(F.BLEND),
  50078. B.enable(F.CULL_FACE),
  50079. F.frontFace(F.CCW),
  50080. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50081. B.setDepthTest(!0),
  50082. B.setScissorTest(!1);
  50083. for (var o = 0, a = r.length; o < a; o++) {
  50084. var s = r[o]
  50085. , l = s.shadow
  50086. , c = l.camera;
  50087. if (U.copy(l.mapSize),
  50088. s instanceof Ci.PointLight) {
  50089. i = 6,
  50090. n = !0;
  50091. var h = U.x
  50092. , u = U.y;
  50093. Y[0].set(2 * h, u, h, u),
  50094. Y[1].set(0, u, h, u),
  50095. Y[2].set(3 * h, u, h, u),
  50096. Y[3].set(h, u, h, u),
  50097. Y[4].set(3 * h, 0, h, u),
  50098. Y[5].set(h, 0, h, u),
  50099. U.x *= 4,
  50100. U.y *= 2
  50101. } else
  50102. n = !(i = 1);
  50103. if (null === l.map) {
  50104. var d = {
  50105. minFilter: Ci.NearestFilter,
  50106. magFilter: Ci.NearestFilter,
  50107. format: Ci.RGBAFormat
  50108. };
  50109. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50110. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50111. c.updateProjectionMatrix()
  50112. }
  50113. var p = l.map
  50114. , f = l.matrix;
  50115. z.setFromMatrixPosition(s.matrixWorld),
  50116. c.position.copy(z),
  50117. P.setRenderTarget(p),
  50118. P.clear();
  50119. for (var g = 0; g < i; g++) {
  50120. if (n) {
  50121. H.copy(c.position),
  50122. H.add(W[g]),
  50123. c.up.copy(j[g]),
  50124. c.lookAt(H);
  50125. var m = Y[g];
  50126. B.viewport(m)
  50127. } else
  50128. H.setFromMatrixPosition(s.target.matrixWorld),
  50129. c.lookAt(H);
  50130. c.updateMatrixWorld(),
  50131. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50132. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50133. f.multiply(c.projectionMatrix),
  50134. f.multiply(c.matrixWorldInverse),
  50135. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50136. V.setFromMatrix(k),
  50137. G.length = 0,
  50138. N(e, t, c);
  50139. for (var v = 0, y = G.length; v < y; v++) {
  50140. var A = G[v]
  50141. , C = L.update(A)
  50142. , I = A.material;
  50143. if (I instanceof Ci.MultiMaterial)
  50144. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50145. var T = E[b]
  50146. , x = _[T.materialIndex];
  50147. if (!0 === x.visible) {
  50148. var S = D(A, x, n, z);
  50149. P.renderBufferDirect(c, null, C, S, A, T)
  50150. }
  50151. }
  50152. else {
  50153. S = D(A, I, n, z);
  50154. P.renderBufferDirect(c, null, C, S, A, null)
  50155. }
  50156. }
  50157. }
  50158. }
  50159. var M = P.getClearColor()
  50160. , R = P.getClearAlpha();
  50161. P.setClearColor(M, R),
  50162. B.enable(F.BLEND),
  50163. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50164. q.needsUpdate = !1
  50165. }
  50166. }
  50167. }
  50168. ,
  50169. Ci.WebGLState = function(l, i, c) {
  50170. var n = this
  50171. , r = new Ci.Vector4
  50172. , o = new Uint8Array(16)
  50173. , a = new Uint8Array(16)
  50174. , s = new Uint8Array(16)
  50175. , t = {}
  50176. , h = null
  50177. , u = null
  50178. , d = null
  50179. , p = null
  50180. , f = null
  50181. , g = null
  50182. , m = null
  50183. , v = null
  50184. , y = !1
  50185. , A = null
  50186. , C = null
  50187. , I = null
  50188. , E = null
  50189. , _ = null
  50190. , b = null
  50191. , w = null
  50192. , T = null
  50193. , x = null
  50194. , S = null
  50195. , M = null
  50196. , R = null
  50197. , P = null
  50198. , O = null
  50199. , L = null
  50200. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50201. , N = void 0
  50202. , F = {}
  50203. , B = new Ci.Vector4
  50204. , V = null
  50205. , k = null
  50206. , U = new Ci.Vector4
  50207. , H = new Ci.Vector4
  50208. , z = l.createTexture();
  50209. l.bindTexture(l.TEXTURE_2D, z),
  50210. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50211. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50212. this.init = function() {
  50213. this.clearColor(0, 0, 0, 1),
  50214. this.clearDepth(1),
  50215. this.clearStencil(0),
  50216. this.enable(l.DEPTH_TEST),
  50217. l.depthFunc(l.LEQUAL),
  50218. l.frontFace(l.CCW),
  50219. l.cullFace(l.BACK),
  50220. this.enable(l.CULL_FACE),
  50221. this.enable(l.BLEND),
  50222. l.blendEquation(l.FUNC_ADD),
  50223. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50224. }
  50225. ,
  50226. this.initAttributes = function() {
  50227. for (var e = 0, t = o.length; e < t; e++)
  50228. o[e] = 0
  50229. }
  50230. ,
  50231. this.enableAttribute = function(e) {
  50232. o[e] = 1,
  50233. 0 === a[e] && (l.enableVertexAttribArray(e),
  50234. a[e] = 1),
  50235. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50236. s[e] = 0)
  50237. }
  50238. ,
  50239. this.enableAttributeAndDivisor = function(e, t, i) {
  50240. o[e] = 1,
  50241. 0 === a[e] && (l.enableVertexAttribArray(e),
  50242. a[e] = 1),
  50243. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50244. s[e] = t)
  50245. }
  50246. ,
  50247. this.disableUnusedAttributes = function() {
  50248. for (var e = 0, t = a.length; e < t; e++)
  50249. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50250. a[e] = 0)
  50251. }
  50252. ,
  50253. this.enable = function(e) {
  50254. !0 !== t[e] && (l.enable(e),
  50255. t[e] = !0)
  50256. }
  50257. ,
  50258. this.disable = function(e) {
  50259. !1 !== t[e] && (l.disable(e),
  50260. t[e] = !1)
  50261. }
  50262. ,
  50263. this.getCompressedTextureFormats = function() {
  50264. if (null === h && (h = [],
  50265. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50266. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50267. h.push(e[t]);
  50268. return h
  50269. }
  50270. ,
  50271. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50272. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50273. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50274. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50275. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50276. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50277. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50278. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50279. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50280. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50281. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50282. u = e,
  50283. y = s),
  50284. e === Ci.CustomBlending ? (r = r || t,
  50285. o = o || i,
  50286. a = a || n,
  50287. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50288. d = t,
  50289. g = r),
  50290. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50291. p = i,
  50292. f = n,
  50293. m = o,
  50294. v = a)) : v = m = g = f = p = d = null
  50295. }
  50296. ,
  50297. this.setDepthFunc = function(e) {
  50298. if (A !== e) {
  50299. if (e)
  50300. switch (e) {
  50301. case Ci.NeverDepth:
  50302. l.depthFunc(l.NEVER);
  50303. break;
  50304. case Ci.AlwaysDepth:
  50305. l.depthFunc(l.ALWAYS);
  50306. break;
  50307. case Ci.LessDepth:
  50308. l.depthFunc(l.LESS);
  50309. break;
  50310. case Ci.LessEqualDepth:
  50311. l.depthFunc(l.LEQUAL);
  50312. break;
  50313. case Ci.EqualDepth:
  50314. l.depthFunc(l.EQUAL);
  50315. break;
  50316. case Ci.GreaterEqualDepth:
  50317. l.depthFunc(l.GEQUAL);
  50318. break;
  50319. case Ci.GreaterDepth:
  50320. l.depthFunc(l.GREATER);
  50321. break;
  50322. case Ci.NotEqualDepth:
  50323. l.depthFunc(l.NOTEQUAL);
  50324. break;
  50325. default:
  50326. l.depthFunc(l.LEQUAL)
  50327. }
  50328. else
  50329. l.depthFunc(l.LEQUAL);
  50330. A = e
  50331. }
  50332. }
  50333. ,
  50334. this.setDepthTest = function(e) {
  50335. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50336. }
  50337. ,
  50338. this.setDepthWrite = function(e) {
  50339. C !== e && (l.depthMask(e),
  50340. C = e)
  50341. }
  50342. ,
  50343. this.setColorWrite = function(e) {
  50344. I !== e && (l.colorMask(e, e, e, e),
  50345. I = e)
  50346. }
  50347. ,
  50348. this.setStencilFunc = function(e, t, i) {
  50349. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50350. _ = e,
  50351. b = t,
  50352. w = i)
  50353. }
  50354. ,
  50355. this.setStencilOp = function(e, t, i) {
  50356. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50357. T = e,
  50358. x = t,
  50359. S = i)
  50360. }
  50361. ,
  50362. this.setStencilTest = function(e) {
  50363. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50364. }
  50365. ,
  50366. this.setStencilWrite = function(e) {
  50367. E !== e && (l.stencilMask(e),
  50368. E = e)
  50369. }
  50370. ,
  50371. this.setFlipSided = function(e) {
  50372. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50373. M = e)
  50374. }
  50375. ,
  50376. this.setLineWidth = function(e) {
  50377. e !== R && (l.lineWidth(e),
  50378. R = e)
  50379. }
  50380. ,
  50381. this.setPolygonOffset = function(e, t, i) {
  50382. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50383. !e || P === t && O === i || (l.polygonOffset(t, i),
  50384. P = t,
  50385. O = i)
  50386. }
  50387. ,
  50388. this.getScissorTest = function() {
  50389. return L
  50390. }
  50391. ,
  50392. this.setScissorTest = function(e) {
  50393. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50394. }
  50395. ,
  50396. this.activeTexture = function(e) {
  50397. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50398. N !== e && (l.activeTexture(e),
  50399. N = e)
  50400. }
  50401. ,
  50402. this.bindTexture = function(e, t) {
  50403. void 0 === N && n.activeTexture();
  50404. var i = F[N];
  50405. void 0 === i && (i = {
  50406. type: void 0,
  50407. texture: void 0
  50408. },
  50409. F[N] = i),
  50410. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50411. i.type = e,
  50412. i.texture = t)
  50413. }
  50414. ,
  50415. this.compressedTexImage2D = function() {
  50416. try {
  50417. l.compressedTexImage2D.apply(l, arguments)
  50418. } catch (e) {
  50419. console.error(e)
  50420. }
  50421. }
  50422. ,
  50423. this.texImage2D = function() {
  50424. try {
  50425. l.texImage2D.apply(l, arguments)
  50426. } catch (e) {
  50427. console.error(e)
  50428. }
  50429. }
  50430. ,
  50431. this.clearColor = function(e, t, i, n) {
  50432. r.set(e, t, i, n),
  50433. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50434. B.copy(r))
  50435. }
  50436. ,
  50437. this.clearDepth = function(e) {
  50438. V !== e && (l.clearDepth(e),
  50439. V = e)
  50440. }
  50441. ,
  50442. this.clearStencil = function(e) {
  50443. k !== e && (l.clearStencil(e),
  50444. k = e)
  50445. }
  50446. ,
  50447. this.scissor = function(e) {
  50448. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50449. U.copy(e))
  50450. }
  50451. ,
  50452. this.viewport = function(e) {
  50453. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50454. H.copy(e))
  50455. }
  50456. ,
  50457. this.reset = function() {
  50458. for (var e = 0; e < a.length; e++)
  50459. 1 === a[e] && (l.disableVertexAttribArray(e),
  50460. a[e] = 0);
  50461. t = {},
  50462. N = void 0,
  50463. F = {},
  50464. M = E = C = I = u = h = null
  50465. }
  50466. }
  50467. ,
  50468. Ci.LensFlarePlugin = function(v, y) {
  50469. function A() {
  50470. var e, t = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]), i = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50471. C = S.createBuffer(),
  50472. I = S.createBuffer(),
  50473. S.bindBuffer(S.ARRAY_BUFFER, C),
  50474. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50475. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50476. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50477. T = S.createTexture(),
  50478. x = S.createTexture(),
  50479. M.bindTexture(S.TEXTURE_2D, T),
  50480. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50481. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50482. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50483. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50484. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50485. M.bindTexture(S.TEXTURE_2D, x),
  50486. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50487. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50488. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50489. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50490. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50491. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50492. 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"),
  50493. 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")
  50494. } : {
  50495. 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"),
  50496. 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")
  50497. },
  50498. E = function(e) {
  50499. var t = S.createProgram()
  50500. , i = S.createShader(S.FRAGMENT_SHADER)
  50501. , n = S.createShader(S.VERTEX_SHADER)
  50502. , r = "precision " + v.getPrecision() + " float;\n";
  50503. return S.shaderSource(i, r + e.fragmentShader),
  50504. S.shaderSource(n, r + e.vertexShader),
  50505. S.compileShader(i),
  50506. S.compileShader(n),
  50507. S.attachShader(t, i),
  50508. S.attachShader(t, n),
  50509. S.linkProgram(t),
  50510. t
  50511. }(e),
  50512. _ = {
  50513. vertex: S.getAttribLocation(E, "position"),
  50514. uv: S.getAttribLocation(E, "uv")
  50515. },
  50516. b = {
  50517. renderType: S.getUniformLocation(E, "renderType"),
  50518. map: S.getUniformLocation(E, "map"),
  50519. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50520. opacity: S.getUniformLocation(E, "opacity"),
  50521. color: S.getUniformLocation(E, "color"),
  50522. scale: S.getUniformLocation(E, "scale"),
  50523. rotation: S.getUniformLocation(E, "rotation"),
  50524. screenPosition: S.getUniformLocation(E, "screenPosition")
  50525. }
  50526. }
  50527. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50528. this.render = function(e, t, i) {
  50529. if (0 !== y.length) {
  50530. var n = new Ci.Vector3
  50531. , r = i.w / i.z
  50532. , o = .5 * i.z
  50533. , a = .5 * i.w
  50534. , s = 16 / i.w
  50535. , l = new Ci.Vector2(s * r,s)
  50536. , c = new Ci.Vector3(1,1,0)
  50537. , h = new Ci.Vector2(1,1);
  50538. void 0 === E && A(),
  50539. S.useProgram(E),
  50540. M.initAttributes(),
  50541. M.enableAttribute(_.vertex),
  50542. M.enableAttribute(_.uv),
  50543. M.disableUnusedAttributes(),
  50544. S.uniform1i(b.occlusionMap, 0),
  50545. S.uniform1i(b.map, 1),
  50546. S.bindBuffer(S.ARRAY_BUFFER, C),
  50547. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50548. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50549. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50550. M.disable(S.CULL_FACE),
  50551. M.setDepthWrite(!1);
  50552. for (var u = 0, d = y.length; u < d; u++) {
  50553. s = 16 / i.w,
  50554. l.set(s * r, s);
  50555. var p = y[u];
  50556. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50557. n.applyMatrix4(t.matrixWorldInverse),
  50558. n.applyProjection(t.projectionMatrix),
  50559. c.copy(n),
  50560. h.x = c.x * o + o,
  50561. h.y = c.y * a + a,
  50562. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50563. M.activeTexture(S.TEXTURE0),
  50564. M.bindTexture(S.TEXTURE_2D, null),
  50565. M.activeTexture(S.TEXTURE1),
  50566. M.bindTexture(S.TEXTURE_2D, T),
  50567. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50568. S.uniform1i(b.renderType, 0),
  50569. S.uniform2f(b.scale, l.x, l.y),
  50570. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50571. M.disable(S.BLEND),
  50572. M.enable(S.DEPTH_TEST),
  50573. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50574. M.activeTexture(S.TEXTURE0),
  50575. M.bindTexture(S.TEXTURE_2D, x),
  50576. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50577. S.uniform1i(b.renderType, 1),
  50578. M.disable(S.DEPTH_TEST),
  50579. M.activeTexture(S.TEXTURE1),
  50580. M.bindTexture(S.TEXTURE_2D, T),
  50581. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50582. p.positionScreen.copy(c),
  50583. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  50584. S.uniform1i(b.renderType, 2),
  50585. M.enable(S.BLEND);
  50586. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  50587. var m = p.lensFlares[f];
  50588. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  50589. c.y = m.y,
  50590. c.z = m.z,
  50591. s = m.size * m.scale / i.w,
  50592. l.x = s * r,
  50593. l.y = s,
  50594. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50595. S.uniform2f(b.scale, l.x, l.y),
  50596. S.uniform1f(b.rotation, m.rotation),
  50597. S.uniform1f(b.opacity, m.opacity),
  50598. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  50599. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  50600. v.setTexture(m.texture, 1),
  50601. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  50602. }
  50603. }
  50604. }
  50605. M.enable(S.CULL_FACE),
  50606. M.enable(S.DEPTH_TEST),
  50607. M.setDepthWrite(!0),
  50608. v.resetGLState()
  50609. }
  50610. }
  50611. }
  50612. ,
  50613. Ci.SpritePlugin = function(u, d) {
  50614. function p() {
  50615. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  50616. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50617. g = I.createBuffer(),
  50618. m = I.createBuffer(),
  50619. I.bindBuffer(I.ARRAY_BUFFER, g),
  50620. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  50621. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50622. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  50623. v = function() {
  50624. var e = I.createProgram()
  50625. , t = I.createShader(I.VERTEX_SHADER)
  50626. , i = I.createShader(I.FRAGMENT_SHADER);
  50627. return I.shaderSource(t, ["precision " + u.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")),
  50628. I.shaderSource(i, ["precision " + u.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")),
  50629. I.compileShader(t),
  50630. I.compileShader(i),
  50631. I.attachShader(e, t),
  50632. I.attachShader(e, i),
  50633. I.linkProgram(e),
  50634. e
  50635. }(),
  50636. y = {
  50637. position: I.getAttribLocation(v, "position"),
  50638. uv: I.getAttribLocation(v, "uv")
  50639. },
  50640. A = {
  50641. uvOffset: I.getUniformLocation(v, "uvOffset"),
  50642. uvScale: I.getUniformLocation(v, "uvScale"),
  50643. rotation: I.getUniformLocation(v, "rotation"),
  50644. scale: I.getUniformLocation(v, "scale"),
  50645. color: I.getUniformLocation(v, "color"),
  50646. map: I.getUniformLocation(v, "map"),
  50647. opacity: I.getUniformLocation(v, "opacity"),
  50648. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  50649. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  50650. fogType: I.getUniformLocation(v, "fogType"),
  50651. fogDensity: I.getUniformLocation(v, "fogDensity"),
  50652. fogNear: I.getUniformLocation(v, "fogNear"),
  50653. fogFar: I.getUniformLocation(v, "fogFar"),
  50654. fogColor: I.getUniformLocation(v, "fogColor"),
  50655. alphaTest: I.getUniformLocation(v, "alphaTest")
  50656. };
  50657. var i = document.createElement("canvas");
  50658. i.width = 8,
  50659. i.height = 8;
  50660. var n = i.getContext("2d");
  50661. n.fillStyle = "white",
  50662. n.fillRect(0, 0, 8, 8),
  50663. (C = new Ci.Texture(i)).needsUpdate = !0
  50664. }
  50665. function f(e, t) {
  50666. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  50667. }
  50668. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  50669. this.render = function(e, t) {
  50670. if (0 !== d.length) {
  50671. void 0 === v && p(),
  50672. I.useProgram(v),
  50673. E.initAttributes(),
  50674. E.enableAttribute(y.position),
  50675. E.enableAttribute(y.uv),
  50676. E.disableUnusedAttributes(),
  50677. E.disable(I.CULL_FACE),
  50678. E.enable(I.BLEND),
  50679. I.bindBuffer(I.ARRAY_BUFFER, g),
  50680. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  50681. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  50682. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50683. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  50684. E.activeTexture(I.TEXTURE0),
  50685. I.uniform1i(A.map, 0);
  50686. var i = 0
  50687. , n = 0
  50688. , r = e.fog;
  50689. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  50690. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  50691. I.uniform1f(A.fogFar, r.far),
  50692. I.uniform1i(A.fogType, 1),
  50693. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  50694. I.uniform1i(A.fogType, 2),
  50695. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  50696. n = i = 0);
  50697. for (var o = 0, a = d.length; o < a; o++) {
  50698. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50699. l.z = -l.modelViewMatrix.elements[14]
  50700. }
  50701. d.sort(f);
  50702. var s = [];
  50703. for (o = 0,
  50704. a = d.length; o < a; o++) {
  50705. var l, c = (l = d[o]).material;
  50706. I.uniform1f(A.alphaTest, c.alphaTest),
  50707. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  50708. l.matrixWorld.decompose(_, b, w),
  50709. s[0] = w.x,
  50710. s[1] = w.y;
  50711. var h = 0;
  50712. e.fog && c.fog && (h = n),
  50713. i !== h && (I.uniform1i(A.fogType, h),
  50714. i = h),
  50715. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  50716. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  50717. I.uniform2f(A.uvScale, 1, 1)),
  50718. I.uniform1f(A.opacity, c.opacity),
  50719. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  50720. I.uniform1f(A.rotation, c.rotation),
  50721. I.uniform2fv(A.scale, s),
  50722. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  50723. E.setDepthTest(c.depthTest),
  50724. E.setDepthWrite(c.depthWrite),
  50725. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  50726. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  50727. }
  50728. E.enable(I.CULL_FACE),
  50729. u.resetGLState()
  50730. }
  50731. }
  50732. }
  50733. ,
  50734. Object.defineProperties(Ci.Box2.prototype, {
  50735. empty: {
  50736. value: function() {
  50737. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  50738. this.isEmpty()
  50739. }
  50740. },
  50741. isIntersectionBox: {
  50742. value: function(e) {
  50743. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50744. this.intersectsBox(e)
  50745. }
  50746. }
  50747. }),
  50748. Object.defineProperties(Ci.Box3.prototype, {
  50749. empty: {
  50750. value: function() {
  50751. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  50752. this.isEmpty()
  50753. }
  50754. },
  50755. isIntersectionBox: {
  50756. value: function(e) {
  50757. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50758. this.intersectsBox(e)
  50759. }
  50760. },
  50761. isIntersectionSphere: {
  50762. value: function(e) {
  50763. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50764. this.intersectsSphere(e)
  50765. }
  50766. }
  50767. }),
  50768. Object.defineProperties(Ci.Matrix3.prototype, {
  50769. multiplyVector3: {
  50770. value: function(e) {
  50771. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  50772. e.applyMatrix3(this)
  50773. }
  50774. },
  50775. multiplyVector3Array: {
  50776. value: function(e) {
  50777. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50778. this.applyToVector3Array(e)
  50779. }
  50780. }
  50781. }),
  50782. Object.defineProperties(Ci.Matrix4.prototype, {
  50783. extractPosition: {
  50784. value: function(e) {
  50785. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  50786. this.copyPosition(e)
  50787. }
  50788. },
  50789. setRotationFromQuaternion: {
  50790. value: function(e) {
  50791. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  50792. this.makeRotationFromQuaternion(e)
  50793. }
  50794. },
  50795. multiplyVector3: {
  50796. value: function(e) {
  50797. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  50798. e.applyProjection(this)
  50799. }
  50800. },
  50801. multiplyVector4: {
  50802. value: function(e) {
  50803. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  50804. e.applyMatrix4(this)
  50805. }
  50806. },
  50807. multiplyVector3Array: {
  50808. value: function(e) {
  50809. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50810. this.applyToVector3Array(e)
  50811. }
  50812. },
  50813. rotateAxis: {
  50814. value: function(e) {
  50815. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  50816. e.transformDirection(this)
  50817. }
  50818. },
  50819. crossVector: {
  50820. value: function(e) {
  50821. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  50822. e.applyMatrix4(this)
  50823. }
  50824. },
  50825. translate: {
  50826. value: function(e) {
  50827. console.error("THREE.Matrix4: .translate() has been removed.")
  50828. }
  50829. },
  50830. rotateX: {
  50831. value: function(e) {
  50832. console.error("THREE.Matrix4: .rotateX() has been removed.")
  50833. }
  50834. },
  50835. rotateY: {
  50836. value: function(e) {
  50837. console.error("THREE.Matrix4: .rotateY() has been removed.")
  50838. }
  50839. },
  50840. rotateZ: {
  50841. value: function(e) {
  50842. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  50843. }
  50844. },
  50845. rotateByAxis: {
  50846. value: function(e, t) {
  50847. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  50848. }
  50849. }
  50850. }),
  50851. Object.defineProperties(Ci.Plane.prototype, {
  50852. isIntersectionLine: {
  50853. value: function(e) {
  50854. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  50855. this.intersectsLine(e)
  50856. }
  50857. }
  50858. }),
  50859. Object.defineProperties(Ci.Quaternion.prototype, {
  50860. multiplyVector3: {
  50861. value: function(e) {
  50862. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  50863. e.applyQuaternion(this)
  50864. }
  50865. }
  50866. }),
  50867. Object.defineProperties(Ci.Ray.prototype, {
  50868. isIntersectionBox: {
  50869. value: function(e) {
  50870. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50871. this.intersectsBox(e)
  50872. }
  50873. },
  50874. isIntersectionPlane: {
  50875. value: function(e) {
  50876. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  50877. this.intersectsPlane(e)
  50878. }
  50879. },
  50880. isIntersectionSphere: {
  50881. value: function(e) {
  50882. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50883. this.intersectsSphere(e)
  50884. }
  50885. }
  50886. }),
  50887. Object.defineProperties(Ci.Vector3.prototype, {
  50888. setEulerFromRotationMatrix: {
  50889. value: function() {
  50890. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  50891. }
  50892. },
  50893. setEulerFromQuaternion: {
  50894. value: function() {
  50895. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  50896. }
  50897. },
  50898. getPositionFromMatrix: {
  50899. value: function(e) {
  50900. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  50901. this.setFromMatrixPosition(e)
  50902. }
  50903. },
  50904. getScaleFromMatrix: {
  50905. value: function(e) {
  50906. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  50907. this.setFromMatrixScale(e)
  50908. }
  50909. },
  50910. getColumnFromMatrix: {
  50911. value: function(e, t) {
  50912. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  50913. this.setFromMatrixColumn(e, t)
  50914. }
  50915. }
  50916. }),
  50917. Ci.Face4 = function(e, t, i, n, r, o, a) {
  50918. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  50919. new Ci.Face3(e,t,i,r,o,a)
  50920. }
  50921. ,
  50922. Ci.Vertex = function(e, t, i) {
  50923. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  50924. new Ci.Vector3(e,t,i)
  50925. }
  50926. ,
  50927. Object.defineProperties(Ci.Object3D.prototype, {
  50928. eulerOrder: {
  50929. get: function() {
  50930. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  50931. this.rotation.order
  50932. },
  50933. set: function(e) {
  50934. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  50935. this.rotation.order = e
  50936. }
  50937. },
  50938. getChildByName: {
  50939. value: function(e) {
  50940. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  50941. this.getObjectByName(e)
  50942. }
  50943. },
  50944. renderDepth: {
  50945. set: function(e) {
  50946. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  50947. }
  50948. },
  50949. translate: {
  50950. value: function(e, t) {
  50951. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  50952. this.translateOnAxis(t, e)
  50953. }
  50954. },
  50955. useQuaternion: {
  50956. get: function() {
  50957. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  50958. },
  50959. set: function(e) {
  50960. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  50961. }
  50962. }
  50963. }),
  50964. Object.defineProperties(Ci, {
  50965. PointCloud: {
  50966. value: function(e, t) {
  50967. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  50968. new Ci.Points(e,t)
  50969. }
  50970. },
  50971. ParticleSystem: {
  50972. value: function(e, t) {
  50973. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  50974. new Ci.Points(e,t)
  50975. }
  50976. }
  50977. }),
  50978. Object.defineProperties(Ci.Light.prototype, {
  50979. onlyShadow: {
  50980. set: function(e) {
  50981. console.warn("THREE.Light: .onlyShadow has been removed.")
  50982. }
  50983. },
  50984. shadowCameraFov: {
  50985. set: function(e) {
  50986. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  50987. this.shadow.camera.fov = e
  50988. }
  50989. },
  50990. shadowCameraLeft: {
  50991. set: function(e) {
  50992. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  50993. this.shadow.camera.left = e
  50994. }
  50995. },
  50996. shadowCameraRight: {
  50997. set: function(e) {
  50998. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  50999. this.shadow.camera.right = e
  51000. }
  51001. },
  51002. shadowCameraTop: {
  51003. set: function(e) {
  51004. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51005. this.shadow.camera.top = e
  51006. }
  51007. },
  51008. shadowCameraBottom: {
  51009. set: function(e) {
  51010. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51011. this.shadow.camera.bottom = e
  51012. }
  51013. },
  51014. shadowCameraNear: {
  51015. set: function(e) {
  51016. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51017. this.shadow.camera.near = e
  51018. }
  51019. },
  51020. shadowCameraFar: {
  51021. set: function(e) {
  51022. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51023. this.shadow.camera.far = e
  51024. }
  51025. },
  51026. shadowCameraVisible: {
  51027. set: function(e) {
  51028. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51029. }
  51030. },
  51031. shadowBias: {
  51032. set: function(e) {
  51033. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51034. this.shadow.bias = e
  51035. }
  51036. },
  51037. shadowDarkness: {
  51038. set: function(e) {
  51039. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51040. }
  51041. },
  51042. shadowMapWidth: {
  51043. set: function(e) {
  51044. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51045. this.shadow.mapSize.width = e
  51046. }
  51047. },
  51048. shadowMapHeight: {
  51049. set: function(e) {
  51050. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51051. this.shadow.mapSize.height = e
  51052. }
  51053. }
  51054. }),
  51055. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51056. length: {
  51057. get: function() {
  51058. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51059. this.array.length
  51060. }
  51061. }
  51062. }),
  51063. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51064. drawcalls: {
  51065. get: function() {
  51066. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51067. this.groups
  51068. }
  51069. },
  51070. offsets: {
  51071. get: function() {
  51072. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51073. this.groups
  51074. }
  51075. },
  51076. addIndex: {
  51077. value: function(e) {
  51078. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51079. this.setIndex(e)
  51080. }
  51081. },
  51082. addDrawCall: {
  51083. value: function(e, t, i) {
  51084. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51085. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51086. this.addGroup(e, t)
  51087. }
  51088. },
  51089. clearDrawCalls: {
  51090. value: function() {
  51091. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51092. this.clearGroups()
  51093. }
  51094. },
  51095. computeTangents: {
  51096. value: function() {
  51097. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51098. }
  51099. },
  51100. computeOffsets: {
  51101. value: function() {
  51102. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51103. }
  51104. }
  51105. }),
  51106. Object.defineProperties(Ci.Material.prototype, {
  51107. wrapAround: {
  51108. get: function() {
  51109. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51110. },
  51111. set: function(e) {
  51112. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51113. }
  51114. },
  51115. wrapRGB: {
  51116. get: function() {
  51117. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51118. new Ci.Color
  51119. }
  51120. }
  51121. }),
  51122. Object.defineProperties(Ci, {
  51123. PointCloudMaterial: {
  51124. value: function(e) {
  51125. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51126. new Ci.PointsMaterial(e)
  51127. }
  51128. },
  51129. ParticleBasicMaterial: {
  51130. value: function(e) {
  51131. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51132. new Ci.PointsMaterial(e)
  51133. }
  51134. },
  51135. ParticleSystemMaterial: {
  51136. value: function(e) {
  51137. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51138. new Ci.PointsMaterial(e)
  51139. }
  51140. }
  51141. }),
  51142. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51143. metal: {
  51144. get: function() {
  51145. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51146. !1
  51147. },
  51148. set: function(e) {
  51149. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51150. }
  51151. }
  51152. }),
  51153. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51154. derivatives: {
  51155. get: function() {
  51156. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51157. this.extensions.derivatives
  51158. },
  51159. set: function(e) {
  51160. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51161. this.extensions.derivatives = e
  51162. }
  51163. }
  51164. }),
  51165. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51166. supportsFloatTextures: {
  51167. value: function() {
  51168. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51169. this.extensions.get("OES_texture_float")
  51170. }
  51171. },
  51172. supportsHalfFloatTextures: {
  51173. value: function() {
  51174. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51175. this.extensions.get("OES_texture_half_float")
  51176. }
  51177. },
  51178. supportsStandardDerivatives: {
  51179. value: function() {
  51180. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51181. this.extensions.get("OES_standard_derivatives")
  51182. }
  51183. },
  51184. supportsCompressedTextureS3TC: {
  51185. value: function() {
  51186. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51187. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51188. }
  51189. },
  51190. supportsCompressedTexturePVRTC: {
  51191. value: function() {
  51192. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51193. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51194. }
  51195. },
  51196. supportsBlendMinMax: {
  51197. value: function() {
  51198. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51199. this.extensions.get("EXT_blend_minmax")
  51200. }
  51201. },
  51202. supportsVertexTextures: {
  51203. value: function() {
  51204. return this.capabilities.vertexTextures
  51205. }
  51206. },
  51207. supportsInstancedArrays: {
  51208. value: function() {
  51209. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51210. this.extensions.get("ANGLE_instanced_arrays")
  51211. }
  51212. },
  51213. enableScissorTest: {
  51214. value: function(e) {
  51215. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51216. this.setScissorTest(e)
  51217. }
  51218. },
  51219. initMaterial: {
  51220. value: function() {
  51221. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51222. }
  51223. },
  51224. addPrePlugin: {
  51225. value: function() {
  51226. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51227. }
  51228. },
  51229. addPostPlugin: {
  51230. value: function() {
  51231. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51232. }
  51233. },
  51234. updateShadowMap: {
  51235. value: function() {
  51236. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51237. }
  51238. },
  51239. shadowMapEnabled: {
  51240. get: function() {
  51241. return this.shadowMap.enabled
  51242. },
  51243. set: function(e) {
  51244. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51245. this.shadowMap.enabled = e
  51246. }
  51247. },
  51248. shadowMapType: {
  51249. get: function() {
  51250. return this.shadowMap.type
  51251. },
  51252. set: function(e) {
  51253. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51254. this.shadowMap.type = e
  51255. }
  51256. },
  51257. shadowMapCullFace: {
  51258. get: function() {
  51259. return this.shadowMap.cullFace
  51260. },
  51261. set: function(e) {
  51262. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51263. this.shadowMap.cullFace = e
  51264. }
  51265. }
  51266. }),
  51267. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51268. wrapS: {
  51269. get: function() {
  51270. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51271. this.texture.wrapS
  51272. },
  51273. set: function(e) {
  51274. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51275. this.texture.wrapS = e
  51276. }
  51277. },
  51278. wrapT: {
  51279. get: function() {
  51280. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51281. this.texture.wrapT
  51282. },
  51283. set: function(e) {
  51284. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51285. this.texture.wrapT = e
  51286. }
  51287. },
  51288. magFilter: {
  51289. get: function() {
  51290. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51291. this.texture.magFilter
  51292. },
  51293. set: function(e) {
  51294. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51295. this.texture.magFilter = e
  51296. }
  51297. },
  51298. minFilter: {
  51299. get: function() {
  51300. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51301. this.texture.minFilter
  51302. },
  51303. set: function(e) {
  51304. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51305. this.texture.minFilter = e
  51306. }
  51307. },
  51308. anisotropy: {
  51309. get: function() {
  51310. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51311. this.texture.anisotropy
  51312. },
  51313. set: function(e) {
  51314. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51315. this.texture.anisotropy = e
  51316. }
  51317. },
  51318. offset: {
  51319. get: function() {
  51320. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51321. this.texture.offset
  51322. },
  51323. set: function(e) {
  51324. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51325. this.texture.offset = e
  51326. }
  51327. },
  51328. repeat: {
  51329. get: function() {
  51330. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51331. this.texture.repeat
  51332. },
  51333. set: function(e) {
  51334. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51335. this.texture.repeat = e
  51336. }
  51337. },
  51338. format: {
  51339. get: function() {
  51340. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51341. this.texture.format
  51342. },
  51343. set: function(e) {
  51344. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51345. this.texture.format = e
  51346. }
  51347. },
  51348. type: {
  51349. get: function() {
  51350. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51351. this.texture.type
  51352. },
  51353. set: function(e) {
  51354. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51355. this.texture.type = e
  51356. }
  51357. },
  51358. generateMipmaps: {
  51359. get: function() {
  51360. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51361. this.texture.generateMipmaps
  51362. },
  51363. set: function(e) {
  51364. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51365. this.texture.generateMipmaps = e
  51366. }
  51367. }
  51368. }),
  51369. Ci.GeometryUtils = {
  51370. merge: function(e, t, i) {
  51371. var n;
  51372. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51373. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51374. n = t.matrix,
  51375. t = t.geometry),
  51376. e.merge(t, n, i)
  51377. },
  51378. center: function(e) {
  51379. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51380. e.center()
  51381. }
  51382. },
  51383. Ci.ImageUtils = {
  51384. crossOrigin: void 0,
  51385. loadTexture: function(e, t, i, n) {
  51386. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51387. var r = new Ci.TextureLoader;
  51388. r.setCrossOrigin(this.crossOrigin);
  51389. var o = r.load(e, i, void 0, n);
  51390. return t && (o.mapping = t),
  51391. o
  51392. },
  51393. loadTextureCube: function(e, t, i, n) {
  51394. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51395. var r = new Ci.CubeTextureLoader;
  51396. r.setCrossOrigin(this.crossOrigin);
  51397. var o = r.load(e, i, void 0, n);
  51398. return t && (o.mapping = t),
  51399. o
  51400. },
  51401. loadCompressedTexture: function() {
  51402. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51403. },
  51404. loadCompressedTextureCube: function() {
  51405. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51406. }
  51407. },
  51408. Ci.Projector = function() {
  51409. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51410. this.projectVector = function(e, t) {
  51411. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51412. e.project(t)
  51413. }
  51414. ,
  51415. this.unprojectVector = function(e, t) {
  51416. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51417. e.unproject(t)
  51418. }
  51419. ,
  51420. this.pickingRay = function(e, t) {
  51421. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51422. }
  51423. }
  51424. ,
  51425. Ci.CanvasRenderer = function() {
  51426. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51427. this.domElement = document.createElement("canvas"),
  51428. this.clear = function() {}
  51429. ,
  51430. this.render = function() {}
  51431. ,
  51432. this.setClearColor = function() {}
  51433. ,
  51434. this.setSize = function() {}
  51435. }
  51436. ,
  51437. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51438. Ci.CurveUtils = {
  51439. tangentQuadraticBezier: function(e, t, i, n) {
  51440. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51441. },
  51442. tangentCubicBezier: function(e, t, i, n, r) {
  51443. 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
  51444. },
  51445. tangentSpline: function(e, t, i, n, r) {
  51446. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51447. },
  51448. interpolate: function(e, t, i, n, r) {
  51449. var o = .5 * (i - e)
  51450. , a = .5 * (n - t)
  51451. , s = r * r;
  51452. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51453. }
  51454. },
  51455. Ci.SceneUtils = {
  51456. createMultiMaterialObject: function(e, t) {
  51457. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51458. i.add(new Ci.Mesh(e,t[n]));
  51459. return i
  51460. },
  51461. detach: function(e, t, i) {
  51462. e.applyMatrix(t.matrixWorld),
  51463. t.remove(e),
  51464. i.add(e)
  51465. },
  51466. attach: function(e, t, i) {
  51467. var n = new Ci.Matrix4;
  51468. n.getInverse(i.matrixWorld),
  51469. e.applyMatrix(n),
  51470. t.remove(e),
  51471. i.add(e)
  51472. }
  51473. },
  51474. Ci.ShapeUtils = {
  51475. area: function(e) {
  51476. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51477. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51478. return .5 * i
  51479. },
  51480. triangulate: function(e, t) {
  51481. var i = e.length;
  51482. if (i < 3)
  51483. return null;
  51484. var n, r, o, a = [], s = [], l = [];
  51485. if (0 < Ci.ShapeUtils.area(e))
  51486. for (r = 0; r < i; r++)
  51487. s[r] = r;
  51488. else
  51489. for (r = 0; r < i; r++)
  51490. s[r] = i - 1 - r;
  51491. var c = i
  51492. , h = 2 * c;
  51493. for (r = c - 1; 2 < c; ) {
  51494. if (h-- <= 0)
  51495. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51496. t ? l : a;
  51497. if (c <= (n = r) && (n = 0),
  51498. c <= (r = n + 1) && (r = 0),
  51499. c <= (o = r + 1) && (o = 0),
  51500. Si(e, n, r, o, c, s)) {
  51501. var u, d, p, f, g;
  51502. for (u = s[n],
  51503. d = s[r],
  51504. p = s[o],
  51505. a.push([e[u], e[d], e[p]]),
  51506. l.push([s[n], s[r], s[o]]),
  51507. g = (f = r) + 1; g < c; f++,
  51508. g++)
  51509. s[f] = s[g];
  51510. h = 2 * --c
  51511. }
  51512. }
  51513. return t ? l : a
  51514. },
  51515. triangulateShape: function(e, t) {
  51516. function w(e, t, i) {
  51517. 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
  51518. }
  51519. function b(e, t, i, n, r) {
  51520. var o = t.x - e.x
  51521. , a = t.y - e.y
  51522. , s = n.x - i.x
  51523. , l = n.y - i.y
  51524. , c = e.x - i.x
  51525. , h = e.y - i.y
  51526. , u = a * s - o * l
  51527. , d = a * c - o * h;
  51528. if (Math.abs(u) > Number.EPSILON) {
  51529. var p;
  51530. if (0 < u) {
  51531. if (d < 0 || u < d)
  51532. return [];
  51533. if ((p = l * c - s * h) < 0 || u < p)
  51534. return []
  51535. } else {
  51536. if (0 < d || d < u)
  51537. return [];
  51538. if (0 < (p = l * c - s * h) || p < u)
  51539. return []
  51540. }
  51541. if (0 === p)
  51542. return !r || 0 != d && d != u ? [e] : [];
  51543. if (p === u)
  51544. return !r || 0 != d && d != u ? [t] : [];
  51545. if (0 == d)
  51546. return [i];
  51547. if (d == u)
  51548. return [n];
  51549. var f = p / u;
  51550. return [{
  51551. x: e.x + f * o,
  51552. y: e.y + f * a
  51553. }]
  51554. }
  51555. if (0 != d || l * c != s * h)
  51556. return [];
  51557. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51558. return _ && b ? e.x !== i.x || e.y !== i.y ? [] : [e] : _ ? w(i, n, e) ? [e] : [] : b ? w(e, t, i) ? [i] : [] : (E = 0 != o ? (y = e.x < t.x ? (v = (g = e).x,
  51559. (m = t).x) : (v = (g = t).x,
  51560. (m = e).x),
  51561. i.x < n.x ? (I = (A = i).x,
  51562. (C = n).x) : (I = (A = n).x,
  51563. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51564. (m = t).y) : (v = (g = t).y,
  51565. (m = e).y),
  51566. i.y < n.y ? (I = (A = i).y,
  51567. (C = n).y) : (I = (A = n).y,
  51568. (C = i).y)),
  51569. v <= I ? y < I ? [] : y === I ? r ? [] : [A] : y <= E ? [A, m] : [A, C] : E < v ? [] : v === E ? r ? [] : [g] : y <= E ? [g, m] : [g, C])
  51570. }
  51571. function T(e, t, i, n) {
  51572. var r = t.x - e.x
  51573. , o = t.y - e.y
  51574. , a = i.x - e.x
  51575. , s = i.y - e.y
  51576. , l = n.x - e.x
  51577. , c = n.y - e.y
  51578. , h = r * s - o * a
  51579. , u = r * c - o * l;
  51580. if (Math.abs(h) > Number.EPSILON) {
  51581. var d = l * s - c * a;
  51582. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  51583. }
  51584. return 0 < u
  51585. }
  51586. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  51587. Array.prototype.push.apply(c, t[h]);
  51588. for (i = 0,
  51589. n = c.length; i < n; i++)
  51590. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  51591. l[a] = i;
  51592. var d = function(e, a) {
  51593. function t(e, t) {
  51594. var i = m.length - 1
  51595. , n = e - 1;
  51596. n < 0 && (n = i);
  51597. var r = e + 1;
  51598. i < r && (r = 0);
  51599. var o = T(m[e], m[n], m[r], c[t]);
  51600. if (!o)
  51601. return !1;
  51602. var a = c.length - 1
  51603. , s = t - 1;
  51604. s < 0 && (s = a);
  51605. var l = t + 1;
  51606. return a < l && (l = 0),
  51607. !!(o = T(c[t], c[s], c[l], m[e]))
  51608. }
  51609. function i(e, t) {
  51610. var i, n;
  51611. for (i = 0; i < m.length; i++)
  51612. if (n = i + 1,
  51613. n %= m.length,
  51614. 0 < b(e, t, m[i], m[n], !0).length)
  51615. return !0;
  51616. return !1
  51617. }
  51618. function n(e, t) {
  51619. var i, n, r, o;
  51620. for (i = 0; i < v.length; i++)
  51621. for (n = a[v[i]],
  51622. r = 0; r < n.length; r++)
  51623. if (o = r + 1,
  51624. o %= n.length,
  51625. 0 < b(e, t, n[r], n[o], !0).length)
  51626. return !0;
  51627. return !1
  51628. }
  51629. for (var c, r, o, s, l, h, u, d, p, f, g, m = e.concat(), v = [], y = [], A = 0, C = a.length; A < C; A++)
  51630. v.push(A);
  51631. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  51632. if (--E < 0) {
  51633. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  51634. break
  51635. }
  51636. for (o = I; o < m.length; o++) {
  51637. s = m[o],
  51638. r = -1;
  51639. for (A = 0; A < v.length; A++)
  51640. if (h = v[A],
  51641. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  51642. c = a[h];
  51643. for (var _ = 0; _ < c.length; _++)
  51644. if (l = c[_],
  51645. t(o, _) && !i(s, l) && !n(s, l)) {
  51646. r = _,
  51647. v.splice(A, 1),
  51648. d = m.slice(0, o + 1),
  51649. p = m.slice(o),
  51650. f = c.slice(r),
  51651. g = c.slice(0, r + 1),
  51652. m = d.concat(f).concat(g).concat(p),
  51653. I = o;
  51654. break
  51655. }
  51656. if (0 <= r)
  51657. break;
  51658. y[u] = !0
  51659. }
  51660. if (0 <= r)
  51661. break
  51662. }
  51663. }
  51664. return m
  51665. }(e, t)
  51666. , p = Ci.ShapeUtils.triangulate(d, !1);
  51667. for (i = 0,
  51668. n = p.length; i < n; i++)
  51669. for (o = p[i],
  51670. r = 0; r < 3; r++)
  51671. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  51672. return p.concat()
  51673. },
  51674. isClockWise: function(e) {
  51675. return Ci.ShapeUtils.area(e) < 0
  51676. },
  51677. b2: function(e, t, i, n) {
  51678. return function(e, t) {
  51679. var i = 1 - e;
  51680. return i * i * t
  51681. }(e, t) + function(e, t) {
  51682. return 2 * (1 - e) * e * t
  51683. }(e, i) + function(e, t) {
  51684. return e * e * t
  51685. }(e, n)
  51686. },
  51687. b3: function(e, t, i, n, r) {
  51688. return function(e, t) {
  51689. var i = 1 - e;
  51690. return i * i * i * t
  51691. }(e, t) + function(e, t) {
  51692. var i = 1 - e;
  51693. return 3 * i * i * e * t
  51694. }(e, i) + function(e, t) {
  51695. return 3 * (1 - e) * e * e * t
  51696. }(e, n) + function(e, t) {
  51697. return e * e * e * t
  51698. }(e, r)
  51699. }
  51700. },
  51701. Ci.Curve = function() {}
  51702. ,
  51703. Ci.Curve.prototype = {
  51704. constructor: Ci.Curve,
  51705. getPoint: function(e) {
  51706. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  51707. null
  51708. },
  51709. getPointAt: function(e) {
  51710. var t = this.getUtoTmapping(e);
  51711. return this.getPoint(t)
  51712. },
  51713. getPoints: function(e) {
  51714. e = e || 5;
  51715. var t, i = [];
  51716. for (t = 0; t <= e; t++)
  51717. i.push(this.getPoint(t / e));
  51718. return i
  51719. },
  51720. getSpacedPoints: function(e) {
  51721. e = e || 5;
  51722. var t, i = [];
  51723. for (t = 0; t <= e; t++)
  51724. i.push(this.getPointAt(t / e));
  51725. return i
  51726. },
  51727. getLength: function() {
  51728. var e = this.getLengths();
  51729. return e[e.length - 1]
  51730. },
  51731. getLengths: function(e) {
  51732. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  51733. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  51734. return this.cacheArcLengths;
  51735. this.needsUpdate = !1;
  51736. var t, i, n = [], r = this.getPoint(0), o = 0;
  51737. for (n.push(0),
  51738. i = 1; i <= e; i++)
  51739. o += (t = this.getPoint(i / e)).distanceTo(r),
  51740. n.push(o),
  51741. r = t;
  51742. return this.cacheArcLengths = n
  51743. },
  51744. updateArcLengths: function() {
  51745. this.needsUpdate = !0,
  51746. this.getLengths()
  51747. },
  51748. getUtoTmapping: function(e, t) {
  51749. var i, n = this.getLengths(), r = 0, o = n.length;
  51750. i = t || e * n[o - 1];
  51751. for (var a, s = 0, l = o - 1; s <= l; )
  51752. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  51753. s = r + 1;
  51754. else {
  51755. if (!(0 < a)) {
  51756. l = r;
  51757. break
  51758. }
  51759. l = r - 1
  51760. }
  51761. if (n[r = l] === i)
  51762. return r / (o - 1);
  51763. var c = n[r];
  51764. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  51765. },
  51766. getTangent: function(e) {
  51767. var t = e - 1e-4
  51768. , i = e + 1e-4;
  51769. t < 0 && (t = 0),
  51770. 1 < i && (i = 1);
  51771. var n = this.getPoint(t);
  51772. return this.getPoint(i).clone().sub(n).normalize()
  51773. },
  51774. getTangentAt: function(e) {
  51775. var t = this.getUtoTmapping(e);
  51776. return this.getTangent(t)
  51777. }
  51778. },
  51779. Ci.Curve.create = function(e, t) {
  51780. return e.prototype = Object.create(Ci.Curve.prototype),
  51781. (e.prototype.constructor = e).prototype.getPoint = t,
  51782. e
  51783. }
  51784. ,
  51785. Ci.CurvePath = function() {
  51786. this.curves = [],
  51787. this.autoClose = !1
  51788. }
  51789. ,
  51790. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  51791. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  51792. Ci.CurvePath.prototype.add = function(e) {
  51793. this.curves.push(e)
  51794. }
  51795. ,
  51796. Ci.CurvePath.prototype.closePath = function() {
  51797. var e = this.curves[0].getPoint(0)
  51798. , t = this.curves[this.curves.length - 1].getPoint(1);
  51799. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  51800. }
  51801. ,
  51802. Ci.CurvePath.prototype.getPoint = function(e) {
  51803. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  51804. if (i[n] >= t) {
  51805. var r = i[n] - t
  51806. , o = this.curves[n]
  51807. , a = 1 - r / o.getLength();
  51808. return o.getPointAt(a)
  51809. }
  51810. n++
  51811. }
  51812. return null
  51813. }
  51814. ,
  51815. Ci.CurvePath.prototype.getLength = function() {
  51816. var e = this.getCurveLengths();
  51817. return e[e.length - 1]
  51818. }
  51819. ,
  51820. Ci.CurvePath.prototype.getCurveLengths = function() {
  51821. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  51822. return this.cacheLengths;
  51823. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  51824. t += this.curves[i].getLength(),
  51825. e.push(t);
  51826. return this.cacheLengths = e
  51827. }
  51828. ,
  51829. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  51830. var t = this.getPoints(e);
  51831. return this.createGeometry(t)
  51832. }
  51833. ,
  51834. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  51835. var t = this.getSpacedPoints(e);
  51836. return this.createGeometry(t)
  51837. }
  51838. ,
  51839. Ci.CurvePath.prototype.createGeometry = function(e) {
  51840. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  51841. var r = e[i];
  51842. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  51843. }
  51844. return t
  51845. }
  51846. ,
  51847. Ci.Font = function(e) {
  51848. this.data = e
  51849. }
  51850. ,
  51851. Ci.Font.prototype = {
  51852. constructor: Ci.Font,
  51853. generateShapes: function(e, s, b) {
  51854. function l(e, t, i) {
  51855. var n = w.glyphs[e] || w.glyphs["?"];
  51856. if (n) {
  51857. var r, o, a, s, l, c, h, u, d, p, f, g = new Ci.Path, m = [], v = Ci.ShapeUtils.b2, y = Ci.ShapeUtils.b3;
  51858. if (n.o)
  51859. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  51860. switch (A[C++]) {
  51861. case "m":
  51862. r = A[C++] * t + i,
  51863. o = A[C++] * t,
  51864. g.moveTo(r, o);
  51865. break;
  51866. case "l":
  51867. r = A[C++] * t + i,
  51868. o = A[C++] * t,
  51869. g.lineTo(r, o);
  51870. break;
  51871. case "q":
  51872. if (a = A[C++] * t + i,
  51873. s = A[C++] * t,
  51874. h = A[C++] * t + i,
  51875. u = A[C++] * t,
  51876. g.quadraticCurveTo(h, u, a, s),
  51877. f = m[m.length - 1]) {
  51878. l = f.x,
  51879. c = f.y;
  51880. for (var E = 1; E <= b; E++) {
  51881. v(_ = E / b, l, h, a),
  51882. v(_, c, u, s)
  51883. }
  51884. }
  51885. break;
  51886. case "b":
  51887. if (a = A[C++] * t + i,
  51888. s = A[C++] * t,
  51889. h = A[C++] * t + i,
  51890. u = A[C++] * t,
  51891. d = A[C++] * t + i,
  51892. p = A[C++] * t,
  51893. g.bezierCurveTo(h, u, d, p, a, s),
  51894. f = m[m.length - 1]) {
  51895. l = f.x,
  51896. c = f.y;
  51897. for (E = 1; E <= b; E++) {
  51898. var _;
  51899. y(_ = E / b, l, h, d, a),
  51900. y(_, c, u, p, s)
  51901. }
  51902. }
  51903. }
  51904. }
  51905. return {
  51906. offset: n.ha * t,
  51907. path: g
  51908. }
  51909. }
  51910. }
  51911. void 0 === s && (s = 100),
  51912. void 0 === b && (b = 4);
  51913. for (var w = this.data, t = function(e) {
  51914. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  51915. var a = l(t[o], i, n);
  51916. n += a.offset,
  51917. r.push(a.path)
  51918. }
  51919. return r
  51920. }(e), i = [], n = 0, r = t.length; n < r; n++)
  51921. Array.prototype.push.apply(i, t[n].toShapes());
  51922. return i
  51923. }
  51924. },
  51925. Ci.Path = function(e) {
  51926. Ci.CurvePath.call(this),
  51927. this.actions = [],
  51928. e && this.fromPoints(e)
  51929. }
  51930. ,
  51931. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  51932. Ci.Path.prototype.constructor = Ci.Path,
  51933. Ci.Path.prototype.fromPoints = function(e) {
  51934. this.moveTo(e[0].x, e[0].y);
  51935. for (var t = 1, i = e.length; t < i; t++)
  51936. this.lineTo(e[t].x, e[t].y)
  51937. }
  51938. ,
  51939. Ci.Path.prototype.moveTo = function(e, t) {
  51940. this.actions.push({
  51941. action: "moveTo",
  51942. args: [e, t]
  51943. })
  51944. }
  51945. ,
  51946. Ci.Path.prototype.lineTo = function(e, t) {
  51947. var i = this.actions[this.actions.length - 1].args
  51948. , n = i[i.length - 2]
  51949. , r = i[i.length - 1]
  51950. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  51951. this.curves.push(o),
  51952. this.actions.push({
  51953. action: "lineTo",
  51954. args: [e, t]
  51955. })
  51956. }
  51957. ,
  51958. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  51959. var r = this.actions[this.actions.length - 1].args
  51960. , o = r[r.length - 2]
  51961. , a = r[r.length - 1]
  51962. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  51963. this.curves.push(s),
  51964. this.actions.push({
  51965. action: "quadraticCurveTo",
  51966. args: [e, t, i, n]
  51967. })
  51968. }
  51969. ,
  51970. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  51971. var a = this.actions[this.actions.length - 1].args
  51972. , s = a[a.length - 2]
  51973. , l = a[a.length - 1]
  51974. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  51975. this.curves.push(c),
  51976. this.actions.push({
  51977. action: "bezierCurveTo",
  51978. args: [e, t, i, n, r, o]
  51979. })
  51980. }
  51981. ,
  51982. Ci.Path.prototype.splineThru = function(e) {
  51983. var t = Array.prototype.slice.call(arguments)
  51984. , i = this.actions[this.actions.length - 1].args
  51985. , n = i[i.length - 2]
  51986. , r = i[i.length - 1]
  51987. , o = [new Ci.Vector2(n,r)];
  51988. Array.prototype.push.apply(o, e);
  51989. var a = new Ci.SplineCurve(o);
  51990. this.curves.push(a),
  51991. this.actions.push({
  51992. action: "splineThru",
  51993. args: t
  51994. })
  51995. }
  51996. ,
  51997. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  51998. var a = this.actions[this.actions.length - 1].args
  51999. , s = a[a.length - 2]
  52000. , l = a[a.length - 1];
  52001. this.absarc(e + s, t + l, i, n, r, o)
  52002. }
  52003. ,
  52004. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52005. this.absellipse(e, t, i, i, n, r, o)
  52006. }
  52007. ,
  52008. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52009. var l = this.actions[this.actions.length - 1].args
  52010. , c = l[l.length - 2]
  52011. , h = l[l.length - 1];
  52012. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52013. }
  52014. ,
  52015. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52016. var l = [e, t, i, n, r, o, a, s || 0]
  52017. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52018. this.curves.push(c);
  52019. var h = c.getPoint(1);
  52020. l.push(h.x),
  52021. l.push(h.y),
  52022. this.actions.push({
  52023. action: "ellipse",
  52024. args: l
  52025. })
  52026. }
  52027. ,
  52028. Ci.Path.prototype.getSpacedPoints = function(e) {
  52029. e = e || 40;
  52030. for (var t = [], i = 0; i < e; i++)
  52031. t.push(this.getPoint(i / e));
  52032. return this.autoClose && t.push(t[0]),
  52033. t
  52034. }
  52035. ,
  52036. Ci.Path.prototype.getPoints = function(e) {
  52037. e = e || 12;
  52038. for (var t, i, n, r, o, a, s, l, c, h, u, d = Ci.ShapeUtils.b2, p = Ci.ShapeUtils.b3, f = [], g = 0, m = this.actions.length; g < m; g++) {
  52039. var v = this.actions[g]
  52040. , y = v.action
  52041. , A = v.args;
  52042. switch (y) {
  52043. case "moveTo":
  52044. case "lineTo":
  52045. f.push(new Ci.Vector2(A[0],A[1]));
  52046. break;
  52047. case "quadraticCurveTo":
  52048. t = A[2],
  52049. i = A[3],
  52050. o = A[0],
  52051. a = A[1],
  52052. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52053. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52054. c[c.length - 1]);
  52055. for (var C = 1; C <= e; C++) {
  52056. h = d(O = C / e, s, o, t),
  52057. u = d(O, l, a, i),
  52058. f.push(new Ci.Vector2(h,u))
  52059. }
  52060. break;
  52061. case "bezierCurveTo":
  52062. t = A[4],
  52063. i = A[5],
  52064. o = A[0],
  52065. a = A[1],
  52066. n = A[2],
  52067. r = A[3],
  52068. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52069. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52070. c[c.length - 1]);
  52071. for (C = 1; C <= e; C++) {
  52072. h = p(O = C / e, s, o, n, t),
  52073. u = p(O, l, a, r, i),
  52074. f.push(new Ci.Vector2(h,u))
  52075. }
  52076. break;
  52077. case "splineThru":
  52078. c = this.actions[g - 1].args;
  52079. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52080. , E = e * A[0].length;
  52081. I = I.concat(A[0]);
  52082. var _ = new Ci.SplineCurve(I);
  52083. for (C = 1; C <= E; C++)
  52084. f.push(_.getPointAt(C / E));
  52085. break;
  52086. case "arc":
  52087. var b = A[0]
  52088. , w = A[1]
  52089. , T = A[2]
  52090. , x = A[3]
  52091. , S = A[4]
  52092. , M = !!A[5]
  52093. , R = S - x
  52094. , P = 2 * e;
  52095. for (C = 1; C <= P; C++) {
  52096. var O = C / P;
  52097. M || (O = 1 - O),
  52098. L = x + O * R,
  52099. h = b + T * Math.cos(L),
  52100. u = w + T * Math.sin(L),
  52101. f.push(new Ci.Vector2(h,u))
  52102. }
  52103. break;
  52104. case "ellipse":
  52105. b = A[0],
  52106. w = A[1];
  52107. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52108. S = A[5],
  52109. M = !!A[6],
  52110. A[7]);
  52111. R = S - x,
  52112. P = 2 * e;
  52113. 0 !== V && (D = Math.cos(V),
  52114. N = Math.sin(V));
  52115. for (C = 1; C <= P; C++) {
  52116. O = C / P;
  52117. if (M || (O = 1 - O),
  52118. L = x + O * R,
  52119. h = b + F * Math.cos(L),
  52120. u = w + B * Math.sin(L),
  52121. 0 !== V) {
  52122. var k = h;
  52123. h = (k - b) * D - (u - w) * N + b,
  52124. u = (k - b) * N + (u - w) * D + w
  52125. }
  52126. f.push(new Ci.Vector2(h,u))
  52127. }
  52128. }
  52129. }
  52130. var U = f[f.length - 1];
  52131. return Math.abs(U.x - f[0].x) < Number.EPSILON && Math.abs(U.y - f[0].y) < Number.EPSILON && f.splice(f.length - 1, 1),
  52132. this.autoClose && f.push(f[0]),
  52133. f
  52134. }
  52135. ,
  52136. Ci.Path.prototype.toShapes = function(e, t) {
  52137. function i(e) {
  52138. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52139. var r = e[i]
  52140. , o = new Ci.Shape;
  52141. o.actions = r.actions,
  52142. o.curves = r.curves,
  52143. t.push(o)
  52144. }
  52145. return t
  52146. }
  52147. function n(e, t) {
  52148. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52149. var a = t[r]
  52150. , s = t[o]
  52151. , l = s.x - a.x
  52152. , c = s.y - a.y;
  52153. if (Math.abs(c) > Number.EPSILON) {
  52154. if (c < 0 && (a = t[o],
  52155. l = -l,
  52156. s = t[r],
  52157. c = -c),
  52158. e.y < a.y || e.y > s.y)
  52159. continue;
  52160. if (e.y === a.y) {
  52161. if (e.x === a.x)
  52162. return !0
  52163. } else {
  52164. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52165. if (0 == h)
  52166. return !0;
  52167. if (h < 0)
  52168. continue;
  52169. n = !n
  52170. }
  52171. } else {
  52172. if (e.y !== a.y)
  52173. continue;
  52174. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52175. return !0
  52176. }
  52177. }
  52178. return n
  52179. }
  52180. var r = Ci.ShapeUtils.isClockWise
  52181. , o = function(e) {
  52182. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52183. var o = e[n]
  52184. , a = o.args
  52185. , s = o.action;
  52186. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52187. i = new Ci.Path),
  52188. i[s].apply(i, a)
  52189. }
  52190. return 0 !== i.actions.length && t.push(i),
  52191. t
  52192. }(this.actions);
  52193. if (0 === o.length)
  52194. return [];
  52195. if (!0 === t)
  52196. return i(o);
  52197. var a, s, l, c = [];
  52198. if (1 === o.length)
  52199. return s = o[0],
  52200. (l = new Ci.Shape).actions = s.actions,
  52201. l.curves = s.curves,
  52202. c.push(l),
  52203. c;
  52204. var h = !r(o[0].getPoints());
  52205. h = e ? !h : h;
  52206. var u, d = [], p = [], f = [], g = 0;
  52207. p[g] = void 0,
  52208. f[g] = [];
  52209. for (var m = 0, v = o.length; m < v; m++)
  52210. a = r(u = (s = o[m]).getPoints()),
  52211. (a = e ? !a : a) ? (!h && p[g] && g++,
  52212. p[g] = {
  52213. s: new Ci.Shape,
  52214. p: u
  52215. },
  52216. p[g].s.actions = s.actions,
  52217. p[g].s.curves = s.curves,
  52218. h && g++,
  52219. f[g] = []) : f[g].push({
  52220. h: s,
  52221. p: u[0]
  52222. });
  52223. if (!p[0])
  52224. return i(o);
  52225. if (1 < p.length) {
  52226. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52227. d[C] = [];
  52228. for (C = 0,
  52229. I = p.length; C < I; C++)
  52230. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52231. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52232. n(b.p, p[T].p) && (C !== T && A.push({
  52233. froms: C,
  52234. tos: T,
  52235. hole: _
  52236. }),
  52237. w ? (w = !1,
  52238. d[T].push(b)) : y = !0);
  52239. w && d[C].push(b)
  52240. }
  52241. 0 < A.length && (y || (f = d))
  52242. }
  52243. m = 0;
  52244. for (var x, S = p.length; m < S; m++) {
  52245. l = p[m].s,
  52246. c.push(l);
  52247. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52248. l.holes.push(x[M].h)
  52249. }
  52250. return c
  52251. }
  52252. ,
  52253. Ci.Shape = function() {
  52254. Ci.Path.apply(this, arguments),
  52255. this.holes = []
  52256. }
  52257. ,
  52258. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52259. Ci.Shape.prototype.constructor = Ci.Shape,
  52260. Ci.Shape.prototype.extrude = function(e) {
  52261. return new Ci.ExtrudeGeometry(this,e)
  52262. }
  52263. ,
  52264. Ci.Shape.prototype.makeGeometry = function(e) {
  52265. return new Ci.ShapeGeometry(this,e)
  52266. }
  52267. ,
  52268. Ci.Shape.prototype.getPointsHoles = function(e) {
  52269. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52270. t[i] = this.holes[i].getPoints(e);
  52271. return t
  52272. }
  52273. ,
  52274. Ci.Shape.prototype.extractAllPoints = function(e) {
  52275. return {
  52276. shape: this.getPoints(e),
  52277. holes: this.getPointsHoles(e)
  52278. }
  52279. }
  52280. ,
  52281. Ci.Shape.prototype.extractPoints = function(e) {
  52282. return this.extractAllPoints(e)
  52283. }
  52284. ,
  52285. Ci.LineCurve = function(e, t) {
  52286. this.v1 = e,
  52287. this.v2 = t
  52288. }
  52289. ,
  52290. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52291. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52292. Ci.LineCurve.prototype.getPoint = function(e) {
  52293. var t = this.v2.clone().sub(this.v1);
  52294. return t.multiplyScalar(e).add(this.v1),
  52295. t
  52296. }
  52297. ,
  52298. Ci.LineCurve.prototype.getPointAt = function(e) {
  52299. return this.getPoint(e)
  52300. }
  52301. ,
  52302. Ci.LineCurve.prototype.getTangent = function(e) {
  52303. return this.v2.clone().sub(this.v1).normalize()
  52304. }
  52305. ,
  52306. Ci.QuadraticBezierCurve = function(e, t, i) {
  52307. this.v0 = e,
  52308. this.v1 = t,
  52309. this.v2 = i
  52310. }
  52311. ,
  52312. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52313. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52314. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52315. var t = Ci.ShapeUtils.b2;
  52316. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  52317. }
  52318. ,
  52319. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52320. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52321. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  52322. }
  52323. ,
  52324. Ci.CubicBezierCurve = function(e, t, i, n) {
  52325. this.v0 = e,
  52326. this.v1 = t,
  52327. this.v2 = i,
  52328. this.v3 = n
  52329. }
  52330. ,
  52331. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52332. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52333. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52334. var t = Ci.ShapeUtils.b3;
  52335. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  52336. }
  52337. ,
  52338. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52339. var t = Ci.CurveUtils.tangentCubicBezier;
  52340. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  52341. }
  52342. ,
  52343. Ci.SplineCurve = function(e) {
  52344. this.points = null == e ? [] : e
  52345. }
  52346. ,
  52347. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52348. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52349. Ci.SplineCurve.prototype.getPoint = function(e) {
  52350. var t = this.points
  52351. , i = (t.length - 1) * e
  52352. , n = Math.floor(i)
  52353. , r = i - n
  52354. , o = t[0 === n ? n : n - 1]
  52355. , a = t[n]
  52356. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52357. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52358. , c = Ci.CurveUtils.interpolate;
  52359. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52360. }
  52361. ,
  52362. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52363. this.aX = e,
  52364. this.aY = t,
  52365. this.xRadius = i,
  52366. this.yRadius = n,
  52367. this.aStartAngle = r,
  52368. this.aEndAngle = o,
  52369. this.aClockwise = a,
  52370. this.aRotation = s || 0
  52371. }
  52372. ,
  52373. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52374. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52375. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52376. var t, i = this.aEndAngle - this.aStartAngle;
  52377. i < 0 && (i += 2 * Math.PI),
  52378. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52379. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52380. var n = this.aX + this.xRadius * Math.cos(t)
  52381. , r = this.aY + this.yRadius * Math.sin(t);
  52382. if (0 !== this.aRotation) {
  52383. var o = Math.cos(this.aRotation)
  52384. , a = Math.sin(this.aRotation)
  52385. , s = n
  52386. , l = r;
  52387. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52388. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52389. }
  52390. return new Ci.Vector2(n,r)
  52391. }
  52392. ,
  52393. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52394. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52395. }
  52396. ,
  52397. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52398. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52399. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52400. this.v1 = e,
  52401. this.v2 = t
  52402. }, function(e) {
  52403. var t = new Ci.Vector3;
  52404. return t.subVectors(this.v2, this.v1),
  52405. t.multiplyScalar(e),
  52406. t.add(this.v1),
  52407. t
  52408. }),
  52409. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52410. this.v0 = e,
  52411. this.v1 = t,
  52412. this.v2 = i
  52413. }, function(e) {
  52414. var t = Ci.ShapeUtils.b2;
  52415. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y),t(e, this.v0.z, this.v1.z, this.v2.z))
  52416. }),
  52417. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52418. this.v0 = e,
  52419. this.v1 = t,
  52420. this.v2 = i,
  52421. this.v3 = n
  52422. }, function(e) {
  52423. var t = Ci.ShapeUtils.b3;
  52424. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  52425. }),
  52426. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52427. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52428. this.points = null == e ? [] : e
  52429. }, function(e) {
  52430. var t = this.points
  52431. , i = (t.length - 1) * e
  52432. , n = Math.floor(i)
  52433. , r = i - n
  52434. , o = t[0 == n ? n : n - 1]
  52435. , a = t[n]
  52436. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52437. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52438. , c = Ci.CurveUtils.interpolate;
  52439. return new Ci.Vector3(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r),c(o.z, a.z, s.z, l.z, r))
  52440. }),
  52441. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52442. Xt = new xi,
  52443. Zt = new xi,
  52444. Kt = new xi,
  52445. xi.prototype.init = function(e, t, i, n) {
  52446. this.c0 = e,
  52447. this.c1 = i,
  52448. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52449. this.c3 = 2 * e - 2 * t + i + n
  52450. }
  52451. ,
  52452. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52453. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52454. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52455. s *= o,
  52456. l *= o,
  52457. this.init(t, i, s, l)
  52458. }
  52459. ,
  52460. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52461. this.init(t, i, r * (i - e), r * (n - t))
  52462. }
  52463. ,
  52464. xi.prototype.calc = function(e) {
  52465. var t = e * e
  52466. , i = t * e;
  52467. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52468. }
  52469. ,
  52470. Ci.Curve.create(function(e) {
  52471. this.points = e || [],
  52472. this.closed = !1
  52473. }, function(e) {
  52474. var t, i, n, r, o, a, s, l, c = this.points;
  52475. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52476. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52477. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52478. n = 1),
  52479. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52480. qt),
  52481. a = c[i % r],
  52482. s = c[(i + 1) % r],
  52483. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52484. qt),
  52485. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52486. var h = "chordal" === this.type ? .5 : .25
  52487. , u = Math.pow(o.distanceToSquared(a), h)
  52488. , d = Math.pow(a.distanceToSquared(s), h)
  52489. , p = Math.pow(s.distanceToSquared(l), h);
  52490. d < 1e-4 && (d = 1),
  52491. u < 1e-4 && (u = d),
  52492. p < 1e-4 && (p = d),
  52493. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52494. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52495. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52496. } else if ("catmullrom" === this.type) {
  52497. var f = void 0 !== this.tension ? this.tension : .5;
  52498. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52499. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52500. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52501. }
  52502. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52503. })),
  52504. Ci.ClosedSplineCurve3 = function(e) {
  52505. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52506. Ci.CatmullRomCurve3.call(this, e),
  52507. this.type = "catmullrom",
  52508. this.closed = !0
  52509. }
  52510. ,
  52511. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52512. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52513. Ci.Geometry.call(this),
  52514. this.type = "BoxGeometry",
  52515. this.parameters = {
  52516. width: e,
  52517. height: t,
  52518. depth: i,
  52519. widthSegments: n,
  52520. heightSegments: r,
  52521. depthSegments: o
  52522. },
  52523. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52524. this.mergeVertices()
  52525. }
  52526. ,
  52527. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52528. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52529. Ci.CubeGeometry = Ci.BoxGeometry,
  52530. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52531. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52532. for (var u = o / l, d = a / c, p = o / 2, f = a / 2, g = s / 2, m = l + 1, v = c + 1, y = 0, A = 0, C = new Ci.Vector3, I = 0; I < v; I++)
  52533. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52534. var b = _ * u - p;
  52535. C[e] = b * n,
  52536. C[t] = E * r,
  52537. C[i] = g,
  52538. P[D] = C.x,
  52539. P[D + 1] = C.y,
  52540. P[D + 2] = C.z,
  52541. C[e] = 0,
  52542. C[t] = 0,
  52543. C[i] = 0 < s ? 1 : -1,
  52544. O[D] = C.x,
  52545. O[D + 1] = C.y,
  52546. O[D + 2] = C.z,
  52547. L[N] = _ / l,
  52548. L[N + 1] = 1 - I / c,
  52549. D += 3,
  52550. N += 2,
  52551. y += 1
  52552. }
  52553. for (I = 0; I < c; I++)
  52554. for (_ = 0; _ < l; _++) {
  52555. var w = B + _ + m * I
  52556. , T = B + _ + m * (I + 1)
  52557. , x = B + (_ + 1) + m * (I + 1)
  52558. , S = B + (_ + 1) + m * I;
  52559. R[F] = w,
  52560. R[F + 1] = T,
  52561. R[F + 2] = S,
  52562. R[F + 3] = T,
  52563. R[F + 4] = x,
  52564. R[F + 5] = S,
  52565. F += 6,
  52566. A += 6
  52567. }
  52568. M.addGroup(V, A, h),
  52569. V += A,
  52570. B += y
  52571. }
  52572. Ci.BufferGeometry.call(this),
  52573. this.type = "BoxBufferGeometry",
  52574. this.parameters = {
  52575. width: e,
  52576. height: t,
  52577. depth: i,
  52578. widthSegments: n,
  52579. heightSegments: r,
  52580. depthSegments: o
  52581. };
  52582. var M = this;
  52583. n = Math.floor(n) || 1,
  52584. r = Math.floor(r) || 1,
  52585. o = Math.floor(o) || 1;
  52586. var s, l, c, h, u = (h = 0,
  52587. h += (s = n) * (l = r) * 2,
  52588. h += s * (c = o) * 2,
  52589. 4 * (h += c * l * 2)), d = u / 4 * 6, R = new (65535 < d ? Uint32Array : Uint16Array)(d), P = new Float32Array(3 * u), O = new Float32Array(3 * u), L = new Float32Array(2 * u), D = 0, N = 0, F = 0, B = 0, V = 0;
  52590. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  52591. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  52592. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  52593. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  52594. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  52595. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  52596. this.setIndex(new Ci.BufferAttribute(R,1)),
  52597. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  52598. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  52599. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  52600. }
  52601. ,
  52602. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52603. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  52604. Ci.CircleGeometry = function(e, t, i, n) {
  52605. Ci.Geometry.call(this),
  52606. this.type = "CircleGeometry",
  52607. this.parameters = {
  52608. radius: e,
  52609. segments: t,
  52610. thetaStart: i,
  52611. thetaLength: n
  52612. },
  52613. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  52614. }
  52615. ,
  52616. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52617. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  52618. Ci.CircleBufferGeometry = function(e, t, i, n) {
  52619. Ci.BufferGeometry.call(this),
  52620. this.type = "CircleBufferGeometry",
  52621. this.parameters = {
  52622. radius: e,
  52623. segments: t,
  52624. thetaStart: i,
  52625. thetaLength: n
  52626. },
  52627. e = e || 50,
  52628. t = void 0 !== t ? Math.max(3, t) : 8,
  52629. i = void 0 !== i ? i : 0,
  52630. n = void 0 !== n ? n : 2 * Math.PI;
  52631. var r = t + 2
  52632. , o = new Float32Array(3 * r)
  52633. , a = new Float32Array(3 * r)
  52634. , s = new Float32Array(2 * r);
  52635. a[2] = 1,
  52636. s[0] = .5,
  52637. s[1] = .5;
  52638. for (var l = 0, c = 3, h = 2; l <= t; l++,
  52639. c += 3,
  52640. h += 2) {
  52641. var u = i + l / t * n;
  52642. o[c] = e * Math.cos(u),
  52643. o[c + 1] = e * Math.sin(u),
  52644. a[c + 2] = 1,
  52645. s[h] = (o[c] / e + 1) / 2,
  52646. s[h + 1] = (o[c + 1] / e + 1) / 2
  52647. }
  52648. var d = [];
  52649. for (c = 1; c <= t; c++)
  52650. d.push(c, c + 1, 0);
  52651. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  52652. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  52653. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  52654. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  52655. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  52656. }
  52657. ,
  52658. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52659. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  52660. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  52661. function t(e) {
  52662. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  52663. for (i = b,
  52664. t = 1; t <= m; t++)
  52665. I.setXYZ(b, 0, x * s, 0),
  52666. E.setXYZ(b, 0, s, 0),
  52667. !0 === e ? (r.x = t / m,
  52668. r.y = 0) : (r.x = (t - 1) / m,
  52669. r.y = 1),
  52670. _.setXY(b, r.x, r.y),
  52671. b++;
  52672. for (n = b,
  52673. t = 0; t <= m; t++) {
  52674. var l = t / m;
  52675. o.x = a * Math.sin(l * A + y),
  52676. o.y = x * s,
  52677. o.z = a * Math.cos(l * A + y),
  52678. I.setXYZ(b, o.x, o.y, o.z),
  52679. E.setXYZ(b, 0, s, 0),
  52680. _.setXY(b, l, !0 === e ? 1 : 0),
  52681. b++
  52682. }
  52683. for (t = 0; t < m; t++) {
  52684. var c = i + t
  52685. , h = n + t;
  52686. !0 === e ? (C.setX(w, h),
  52687. w++,
  52688. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  52689. w++,
  52690. C.setX(w, h)),
  52691. w++,
  52692. C.setX(w, c),
  52693. w++
  52694. }
  52695. }
  52696. Ci.BufferGeometry.call(this),
  52697. this.type = "CylinderBufferGeometry",
  52698. this.parameters = {
  52699. radiusTop: p,
  52700. radiusBottom: f,
  52701. height: g,
  52702. radialSegments: m,
  52703. heightSegments: v,
  52704. openEnded: e,
  52705. thetaStart: y,
  52706. thetaLength: A
  52707. },
  52708. p = void 0 !== p ? p : 20,
  52709. f = void 0 !== f ? f : 20,
  52710. g = void 0 !== g ? g : 100,
  52711. m = Math.floor(m) || 8,
  52712. v = Math.floor(v) || 1,
  52713. e = void 0 !== e && e,
  52714. y = void 0 !== y ? y : 0,
  52715. A = void 0 !== A ? A : 2 * Math.PI;
  52716. var i, n, r = (n = (m + 1) * (v + 1),
  52717. !1 === e && (n += 2 * (m + 1) + 2 * m),
  52718. n), o = (i = m * v * 2 * 3,
  52719. !1 === e && (i += 2 * m * 3),
  52720. i), C = new Ci.BufferAttribute(new (65535 < o ? Uint32Array : Uint16Array)(o),1), I = new Ci.BufferAttribute(new Float32Array(3 * r),3), E = new Ci.BufferAttribute(new Float32Array(3 * r),3), _ = new Ci.BufferAttribute(new Float32Array(2 * r),2), b = 0, w = 0, T = [], x = g / 2;
  52721. (function() {
  52722. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  52723. for (t = 0; t <= v; t++) {
  52724. var o = []
  52725. , a = t / v
  52726. , s = a * (f - p) + p;
  52727. for (e = 0; e <= m; e++) {
  52728. var l = e / m;
  52729. n.x = s * Math.sin(l * A + y),
  52730. n.y = -a * g + x,
  52731. n.z = s * Math.cos(l * A + y),
  52732. I.setXYZ(b, n.x, n.y, n.z),
  52733. i.copy(n),
  52734. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  52735. i.z = Math.cos(l * A + y)),
  52736. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  52737. E.setXYZ(b, i.x, i.y, i.z),
  52738. _.setXY(b, l, 1 - a),
  52739. o.push(b),
  52740. b++
  52741. }
  52742. T.push(o)
  52743. }
  52744. for (e = 0; e < m; e++)
  52745. for (t = 0; t < v; t++) {
  52746. var c = T[t][e]
  52747. , h = T[t + 1][e]
  52748. , u = T[t + 1][e + 1]
  52749. , d = T[t][e + 1];
  52750. C.setX(w, c),
  52751. w++,
  52752. C.setX(w, h),
  52753. w++,
  52754. C.setX(w, d),
  52755. w++,
  52756. C.setX(w, h),
  52757. w++,
  52758. C.setX(w, u),
  52759. w++,
  52760. C.setX(w, d),
  52761. w++
  52762. }
  52763. }
  52764. )(),
  52765. !1 === e && (0 < p && t(!0),
  52766. 0 < f && t(!1)),
  52767. this.setIndex(C),
  52768. this.addAttribute("position", I),
  52769. this.addAttribute("normal", E),
  52770. this.addAttribute("uv", _)
  52771. }
  52772. ,
  52773. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52774. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  52775. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  52776. Ci.Geometry.call(this),
  52777. this.type = "CylinderGeometry",
  52778. this.parameters = {
  52779. radiusTop: e,
  52780. radiusBottom: t,
  52781. height: i,
  52782. radialSegments: n,
  52783. heightSegments: r,
  52784. openEnded: o,
  52785. thetaStart: a,
  52786. thetaLength: s
  52787. },
  52788. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  52789. this.mergeVertices()
  52790. }
  52791. ,
  52792. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52793. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  52794. Ci.EdgesGeometry = function(e, t) {
  52795. function i(e, t) {
  52796. return e - t
  52797. }
  52798. Ci.BufferGeometry.call(this),
  52799. t = void 0 !== t ? t : 1;
  52800. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  52801. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  52802. n.mergeVertices(),
  52803. n.computeFaceNormals();
  52804. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  52805. for (var d = c[h], p = 0; p < 3; p++) {
  52806. o[0] = d[s[p]],
  52807. o[1] = d[s[(p + 1) % 3]],
  52808. o.sort(i),
  52809. void 0 === a[g = o.toString()] ? a[g] = {
  52810. vert1: o[0],
  52811. vert2: o[1],
  52812. face1: h,
  52813. face2: void 0
  52814. } : a[g].face2 = h
  52815. }
  52816. var f = [];
  52817. for (var g in a) {
  52818. var m = a[g];
  52819. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  52820. var v = l[m.vert1];
  52821. f.push(v.x),
  52822. f.push(v.y),
  52823. f.push(v.z),
  52824. v = l[m.vert2],
  52825. f.push(v.x),
  52826. f.push(v.y),
  52827. f.push(v.z)
  52828. }
  52829. }
  52830. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  52831. }
  52832. ,
  52833. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52834. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  52835. Ci.ExtrudeGeometry = function(e, t) {
  52836. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  52837. this.type = "ExtrudeGeometry",
  52838. e = Array.isArray(e) ? e : [e],
  52839. this.addShapeList(e, t),
  52840. void this.computeFaceNormals())
  52841. }
  52842. ;
  52843. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52844. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  52845. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  52846. for (var i = e.length, n = 0; n < i; n++) {
  52847. var r = e[n];
  52848. this.addShape(r, t)
  52849. }
  52850. }
  52851. ,
  52852. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  52853. function i(e, t, i) {
  52854. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  52855. t.clone().multiplyScalar(i).add(e)
  52856. }
  52857. function n(e, t, i) {
  52858. var n, r, o = 1, a = e.x - t.x, s = e.y - t.y, l = i.x - e.x, c = i.y - e.y, h = a * a + s * s, u = a * c - s * l;
  52859. if (Math.abs(u) > Number.EPSILON) {
  52860. var d = Math.sqrt(h)
  52861. , p = Math.sqrt(l * l + c * c)
  52862. , f = t.x - s / d
  52863. , g = t.y + a / d
  52864. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  52865. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  52866. if (v <= 2)
  52867. return new Ci.Vector2(n,r);
  52868. o = Math.sqrt(v / 2)
  52869. } else {
  52870. var y = !1;
  52871. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  52872. o = y ? (n = -s,
  52873. r = a,
  52874. Math.sqrt(h)) : (n = a,
  52875. r = s,
  52876. Math.sqrt(h / 2))
  52877. }
  52878. return new Ci.Vector2(n / o,r / o)
  52879. }
  52880. function r(e, t) {
  52881. var i, n;
  52882. for (G = e.length; 0 <= --G; ) {
  52883. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  52884. var r = 0
  52885. , o = A + 2 * m;
  52886. for (r = 0; r < o; r++) {
  52887. var a = U * r
  52888. , s = U * (r + 1);
  52889. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  52890. }
  52891. }
  52892. }
  52893. function o(e, t, i) {
  52894. T.vertices.push(new Ci.Vector3(e,t,i))
  52895. }
  52896. function a(e, t, i) {
  52897. e += x,
  52898. t += x,
  52899. i += x,
  52900. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  52901. var n = E.generateTopUV(T, e, t, i);
  52902. T.faceVertexUvs[0].push(n)
  52903. }
  52904. function l(e, t, i, n) {
  52905. e += x,
  52906. t += x,
  52907. i += x,
  52908. n += x,
  52909. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  52910. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  52911. var r = E.generateSideWallUV(T, e, t, i, n);
  52912. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  52913. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  52914. }
  52915. var s, c, h, u, d, p = void 0 !== t.amount ? t.amount : 100, f = void 0 !== t.bevelThickness ? t.bevelThickness : 6, g = void 0 !== t.bevelSize ? t.bevelSize : f - 2, m = void 0 !== t.bevelSegments ? t.bevelSegments : 3, v = void 0 === t.bevelEnabled || t.bevelEnabled, y = void 0 !== t.curveSegments ? t.curveSegments : 12, A = void 0 !== t.steps ? t.steps : 1, C = t.extrudePath, I = !1, E = void 0 !== t.UVGenerator ? t.UVGenerator : Ci.ExtrudeGeometry.WorldUVGenerator;
  52916. C && (s = C.getSpacedPoints(A),
  52917. v = !(I = !0),
  52918. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  52919. h = new Ci.Vector3,
  52920. u = new Ci.Vector3,
  52921. d = new Ci.Vector3),
  52922. v || (g = f = m = 0);
  52923. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  52924. if (P) {
  52925. for (M = M.reverse(),
  52926. b = 0,
  52927. w = R.length; b < w; b++)
  52928. _ = R[b],
  52929. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  52930. P = !1
  52931. }
  52932. var O = Ci.ShapeUtils.triangulateShape(M, R)
  52933. , L = M;
  52934. for (b = 0,
  52935. w = R.length; b < w; b++)
  52936. _ = R[b],
  52937. M = M.concat(_);
  52938. for (var D, N, F, B, V, k, U = M.length, H = O.length, z = [], G = 0, W = L.length, j = W - 1, Y = G + 1; G < W; G++,
  52939. j++,
  52940. Y++)
  52941. j === W && (j = 0),
  52942. Y === W && (Y = 0),
  52943. z[G] = n(L[G], L[j], L[Y]);
  52944. var q, X, Z = [], K = z.concat();
  52945. for (b = 0,
  52946. w = R.length; b < w; b++) {
  52947. for (_ = R[b],
  52948. q = [],
  52949. G = 0,
  52950. j = (W = _.length) - 1,
  52951. Y = G + 1; G < W; G++,
  52952. j++,
  52953. Y++)
  52954. j === W && (j = 0),
  52955. Y === W && (Y = 0),
  52956. q[G] = n(_[G], _[j], _[Y]);
  52957. Z.push(q),
  52958. K = K.concat(q)
  52959. }
  52960. for (D = 0; D < m; D++) {
  52961. for (B = f * (1 - (F = D / m)),
  52962. N = g * Math.sin(F * Math.PI / 2),
  52963. G = 0,
  52964. W = L.length; G < W; G++)
  52965. o((V = i(L[G], z[G], N)).x, V.y, -B);
  52966. for (b = 0,
  52967. w = R.length; b < w; b++)
  52968. for (_ = R[b],
  52969. q = Z[b],
  52970. G = 0,
  52971. W = _.length; G < W; G++)
  52972. o((V = i(_[G], q[G], N)).x, V.y, -B)
  52973. }
  52974. for (N = g,
  52975. G = 0; G < U; G++)
  52976. V = v ? i(M[G], K[G], N) : M[G],
  52977. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  52978. h.copy(c.binormals[0]).multiplyScalar(V.y),
  52979. d.copy(s[0]).add(u).add(h),
  52980. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  52981. for (X = 1; X <= A; X++)
  52982. for (G = 0; G < U; G++)
  52983. V = v ? i(M[G], K[G], N) : M[G],
  52984. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  52985. h.copy(c.binormals[X]).multiplyScalar(V.y),
  52986. d.copy(s[X]).add(u).add(h),
  52987. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  52988. for (D = m - 1; 0 <= D; D--) {
  52989. for (B = f * (1 - (F = D / m)),
  52990. N = g * Math.sin(F * Math.PI / 2),
  52991. G = 0,
  52992. W = L.length; G < W; G++)
  52993. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  52994. for (b = 0,
  52995. w = R.length; b < w; b++)
  52996. for (_ = R[b],
  52997. q = Z[b],
  52998. G = 0,
  52999. W = _.length; G < W; G++)
  53000. V = i(_[G], q[G], N),
  53001. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53002. }
  53003. (function() {
  53004. if (v) {
  53005. var e = 0
  53006. , t = U * e;
  53007. for (G = 0; G < H; G++)
  53008. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53009. for (t = U * (e = A + 2 * m),
  53010. G = 0; G < H; G++)
  53011. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53012. } else {
  53013. for (G = 0; G < H; G++)
  53014. a((k = O[G])[2], k[1], k[0]);
  53015. for (G = 0; G < H; G++)
  53016. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53017. }
  53018. }
  53019. )(),
  53020. function() {
  53021. var e = 0;
  53022. for (r(L, e),
  53023. e += L.length,
  53024. b = 0,
  53025. w = R.length; b < w; b++)
  53026. r(_ = R[b], e),
  53027. e += _.length
  53028. }()
  53029. }
  53030. ,
  53031. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53032. generateTopUV: function(e, t, i, n) {
  53033. var r = e.vertices
  53034. , o = r[t]
  53035. , a = r[i]
  53036. , s = r[n];
  53037. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53038. },
  53039. generateSideWallUV: function(e, t, i, n, r) {
  53040. var o = e.vertices
  53041. , a = o[t]
  53042. , s = o[i]
  53043. , l = o[n]
  53044. , c = o[r];
  53045. return Math.abs(a.y - s.y) < .01 ? [new Ci.Vector2(a.x,1 - a.z), new Ci.Vector2(s.x,1 - s.z), new Ci.Vector2(l.x,1 - l.z), new Ci.Vector2(c.x,1 - c.z)] : [new Ci.Vector2(a.y,1 - a.z), new Ci.Vector2(s.y,1 - s.z), new Ci.Vector2(l.y,1 - l.z), new Ci.Vector2(c.y,1 - c.z)]
  53046. }
  53047. },
  53048. Ci.ShapeGeometry = function(e, t) {
  53049. Ci.Geometry.call(this),
  53050. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53051. this.addShapeList(e, t),
  53052. this.computeFaceNormals()
  53053. }
  53054. ,
  53055. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53056. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53057. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53058. for (var i = 0, n = e.length; i < n; i++)
  53059. this.addShape(e[i], t);
  53060. return this
  53061. }
  53062. ,
  53063. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53064. void 0 === t && (t = {});
  53065. var i, n, r, o = void 0 !== t.curveSegments ? t.curveSegments : 12, a = t.material, s = void 0 === t.UVGenerator ? Ci.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, l = this.vertices.length, c = e.extractPoints(o), h = c.shape, u = c.holes, d = !Ci.ShapeUtils.isClockWise(h);
  53066. if (d) {
  53067. for (h = h.reverse(),
  53068. i = 0,
  53069. n = u.length; i < n; i++)
  53070. r = u[i],
  53071. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53072. d = !1
  53073. }
  53074. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53075. for (i = 0,
  53076. n = u.length; i < n; i++)
  53077. r = u[i],
  53078. h = h.concat(r);
  53079. var f, g, m = h.length, v = p.length;
  53080. for (i = 0; i < m; i++)
  53081. f = h[i],
  53082. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53083. for (i = 0; i < v; i++) {
  53084. var y = (g = p[i])[0] + l
  53085. , A = g[1] + l
  53086. , C = g[2] + l;
  53087. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53088. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53089. }
  53090. }
  53091. ,
  53092. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53093. Ci.BufferGeometry.call(this),
  53094. this.type = "LatheBufferGeometry",
  53095. this.parameters = {
  53096. points: e,
  53097. segments: t,
  53098. phiStart: i,
  53099. phiLength: n
  53100. },
  53101. t = Math.floor(t) || 12,
  53102. i = i || 0,
  53103. n = n || 2 * Math.PI,
  53104. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53105. var r, o, a, s = (t + 1) * e.length, l = t * e.length * 2 * 3, c = new Ci.BufferAttribute(new (65535 < l ? Uint32Array : Uint16Array)(l),1), h = new Ci.BufferAttribute(new Float32Array(3 * s),3), u = new Ci.BufferAttribute(new Float32Array(2 * s),2), d = 0, p = 0, f = (e.length,
  53106. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53107. for (o = 0; o <= t; o++) {
  53108. var v = i + o * f * n
  53109. , y = Math.sin(v)
  53110. , A = Math.cos(v);
  53111. for (a = 0; a <= e.length - 1; a++)
  53112. g.x = e[a].x * y,
  53113. g.y = e[a].y,
  53114. g.z = e[a].x * A,
  53115. h.setXYZ(d, g.x, g.y, g.z),
  53116. m.x = o / t,
  53117. m.y = a / (e.length - 1),
  53118. u.setXY(d, m.x, m.y),
  53119. d++
  53120. }
  53121. for (o = 0; o < t; o++)
  53122. for (a = 0; a < e.length - 1; a++) {
  53123. var C = r = a + o * e.length
  53124. , I = r + e.length
  53125. , E = r + e.length + 1
  53126. , _ = r + 1;
  53127. c.setX(p, C),
  53128. p++,
  53129. c.setX(p, I),
  53130. p++,
  53131. c.setX(p, _),
  53132. p++,
  53133. c.setX(p, I),
  53134. p++,
  53135. c.setX(p, E),
  53136. p++,
  53137. c.setX(p, _),
  53138. p++
  53139. }
  53140. if (this.setIndex(c),
  53141. this.addAttribute("position", h),
  53142. this.addAttribute("uv", u),
  53143. this.computeVertexNormals(),
  53144. n === 2 * Math.PI) {
  53145. var b = this.attributes.normal.array
  53146. , w = new Ci.Vector3
  53147. , T = new Ci.Vector3
  53148. , x = new Ci.Vector3;
  53149. for (r = t * e.length * 3,
  53150. a = o = 0; o < e.length; o++,
  53151. a += 3)
  53152. w.x = b[a + 0],
  53153. w.y = b[a + 1],
  53154. w.z = b[a + 2],
  53155. T.x = b[r + a + 0],
  53156. T.y = b[r + a + 1],
  53157. T.z = b[r + a + 2],
  53158. x.addVectors(w, T).normalize(),
  53159. b[a + 0] = b[r + a + 0] = x.x,
  53160. b[a + 1] = b[r + a + 1] = x.y,
  53161. b[a + 2] = b[r + a + 2] = x.z
  53162. }
  53163. }
  53164. ,
  53165. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53166. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53167. Ci.LatheGeometry = function(e, t, i, n) {
  53168. Ci.Geometry.call(this),
  53169. this.type = "LatheGeometry",
  53170. this.parameters = {
  53171. points: e,
  53172. segments: t,
  53173. phiStart: i,
  53174. phiLength: n
  53175. },
  53176. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53177. this.mergeVertices()
  53178. }
  53179. ,
  53180. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53181. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53182. Ci.PlaneGeometry = function(e, t, i, n) {
  53183. Ci.Geometry.call(this),
  53184. this.type = "PlaneGeometry",
  53185. this.parameters = {
  53186. width: e,
  53187. height: t,
  53188. widthSegments: i,
  53189. heightSegments: n
  53190. },
  53191. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53192. }
  53193. ,
  53194. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53195. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53196. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53197. Ci.BufferGeometry.call(this),
  53198. this.type = "PlaneBufferGeometry",
  53199. this.parameters = {
  53200. width: e,
  53201. height: t,
  53202. widthSegments: i,
  53203. heightSegments: n
  53204. };
  53205. for (var r = e / 2, o = t / 2, a = Math.floor(i) || 1, s = Math.floor(n) || 1, l = a + 1, c = s + 1, h = e / a, u = t / s, d = new Float32Array(l * c * 3), p = new Float32Array(l * c * 3), f = new Float32Array(l * c * 2), g = 0, m = 0, v = 0; v < c; v++)
  53206. for (var y = v * u - o, A = 0; A < l; A++) {
  53207. var C = A * h - r;
  53208. d[g] = C,
  53209. d[g + 1] = -y,
  53210. p[g + 2] = 1,
  53211. f[m] = A / a,
  53212. f[m + 1] = 1 - v / s,
  53213. g += 3,
  53214. m += 2
  53215. }
  53216. g = 0;
  53217. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53218. for (v = 0; v < s; v++)
  53219. for (A = 0; A < a; A++) {
  53220. var E = A + l * v
  53221. , _ = A + l * (v + 1)
  53222. , b = A + 1 + l * (v + 1)
  53223. , w = A + 1 + l * v;
  53224. I[g] = E,
  53225. I[g + 1] = _,
  53226. I[g + 2] = w,
  53227. I[g + 3] = _,
  53228. I[g + 4] = b,
  53229. I[g + 5] = w,
  53230. g += 6
  53231. }
  53232. this.setIndex(new Ci.BufferAttribute(I,1)),
  53233. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53234. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53235. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53236. }
  53237. ,
  53238. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53239. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53240. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53241. Ci.BufferGeometry.call(this),
  53242. this.type = "RingBufferGeometry",
  53243. this.parameters = {
  53244. innerRadius: e,
  53245. outerRadius: t,
  53246. thetaSegments: i,
  53247. phiSegments: n,
  53248. thetaStart: r,
  53249. thetaLength: o
  53250. },
  53251. e = e || 20,
  53252. t = t || 50,
  53253. r = void 0 !== r ? r : 0,
  53254. o = void 0 !== o ? o : 2 * Math.PI;
  53255. var a, s, l, c = ((i = void 0 !== i ? Math.max(3, i) : 8) + 1) * ((n = void 0 !== n ? Math.max(1, n) : 1) + 1), h = i * n * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = e, y = (t - e) / n, A = new Ci.Vector3, C = new Ci.Vector2;
  53256. for (s = 0; s <= n; s++) {
  53257. for (l = 0; l <= i; l++)
  53258. a = r + l / i * o,
  53259. A.x = v * Math.cos(a),
  53260. A.y = v * Math.sin(a),
  53261. d.setXYZ(g, A.x, A.y, A.z),
  53262. p.setXYZ(g, 0, 0, 1),
  53263. C.x = (A.x / t + 1) / 2,
  53264. C.y = (A.y / t + 1) / 2,
  53265. f.setXY(g, C.x, C.y),
  53266. g++;
  53267. v += y
  53268. }
  53269. for (s = 0; s < n; s++) {
  53270. var I = s * (i + 1);
  53271. for (l = 0; l < i; l++) {
  53272. var E = a = l + I
  53273. , _ = a + i + 1
  53274. , b = a + i + 2
  53275. , w = a + 1;
  53276. u.setX(m, E),
  53277. m++,
  53278. u.setX(m, _),
  53279. m++,
  53280. u.setX(m, b),
  53281. m++,
  53282. u.setX(m, E),
  53283. m++,
  53284. u.setX(m, b),
  53285. m++,
  53286. u.setX(m, w),
  53287. m++
  53288. }
  53289. }
  53290. this.setIndex(u),
  53291. this.addAttribute("position", d),
  53292. this.addAttribute("normal", p),
  53293. this.addAttribute("uv", f)
  53294. }
  53295. ,
  53296. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53297. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53298. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53299. Ci.Geometry.call(this),
  53300. this.type = "RingGeometry",
  53301. this.parameters = {
  53302. innerRadius: e,
  53303. outerRadius: t,
  53304. thetaSegments: i,
  53305. phiSegments: n,
  53306. thetaStart: r,
  53307. thetaLength: o
  53308. },
  53309. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53310. }
  53311. ,
  53312. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53313. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53314. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53315. Ci.Geometry.call(this),
  53316. this.type = "SphereGeometry",
  53317. this.parameters = {
  53318. radius: e,
  53319. widthSegments: t,
  53320. heightSegments: i,
  53321. phiStart: n,
  53322. phiLength: r,
  53323. thetaStart: o,
  53324. thetaLength: a
  53325. },
  53326. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53327. }
  53328. ,
  53329. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53330. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53331. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53332. Ci.BufferGeometry.call(this),
  53333. this.type = "SphereBufferGeometry",
  53334. this.parameters = {
  53335. radius: e,
  53336. widthSegments: t,
  53337. heightSegments: i,
  53338. phiStart: n,
  53339. phiLength: r,
  53340. thetaStart: o,
  53341. thetaLength: a
  53342. },
  53343. e = e || 50,
  53344. t = Math.max(3, Math.floor(t) || 8),
  53345. i = Math.max(2, Math.floor(i) || 6),
  53346. n = void 0 !== n ? n : 0,
  53347. r = void 0 !== r ? r : 2 * Math.PI;
  53348. for (var s = (o = void 0 !== o ? o : 0) + (a = void 0 !== a ? a : Math.PI), l = (t + 1) * (i + 1), c = new Ci.BufferAttribute(new Float32Array(3 * l),3), h = new Ci.BufferAttribute(new Float32Array(3 * l),3), u = new Ci.BufferAttribute(new Float32Array(2 * l),2), d = 0, p = [], f = new Ci.Vector3, g = 0; g <= i; g++) {
  53349. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53350. var A = y / t
  53351. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53352. , I = e * Math.cos(o + v * a)
  53353. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53354. f.set(C, I, E).normalize(),
  53355. c.setXYZ(d, C, I, E),
  53356. h.setXYZ(d, f.x, f.y, f.z),
  53357. u.setXY(d, A, 1 - v),
  53358. m.push(d),
  53359. d++
  53360. }
  53361. p.push(m)
  53362. }
  53363. var _ = [];
  53364. for (g = 0; g < i; g++)
  53365. for (y = 0; y < t; y++) {
  53366. var b = p[g][y + 1]
  53367. , w = p[g][y]
  53368. , T = p[g + 1][y]
  53369. , x = p[g + 1][y + 1];
  53370. (0 !== g || 0 < o) && _.push(b, w, x),
  53371. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53372. }
  53373. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53374. this.addAttribute("position", c),
  53375. this.addAttribute("normal", h),
  53376. this.addAttribute("uv", u),
  53377. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53378. }
  53379. ,
  53380. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53381. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53382. Ci.TextGeometry = function(e, t) {
  53383. var i = (t = t || {}).font;
  53384. if (i instanceof Ci.Font == 0)
  53385. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53386. new Ci.Geometry;
  53387. var n = i.generateShapes(e, t.size, t.curveSegments);
  53388. t.amount = void 0 !== t.height ? t.height : 50,
  53389. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53390. void 0 === t.bevelSize && (t.bevelSize = 8),
  53391. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53392. Ci.ExtrudeGeometry.call(this, n, t),
  53393. this.type = "TextGeometry"
  53394. }
  53395. ,
  53396. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53397. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53398. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53399. Ci.BufferGeometry.call(this),
  53400. this.type = "TorusBufferGeometry",
  53401. this.parameters = {
  53402. radius: e,
  53403. tube: t,
  53404. radialSegments: i,
  53405. tubularSegments: n,
  53406. arc: r
  53407. },
  53408. e = e || 100,
  53409. t = t || 40,
  53410. i = Math.floor(i) || 8,
  53411. n = Math.floor(n) || 6,
  53412. r = r || 2 * Math.PI;
  53413. var o, a, s = (i + 1) * (n + 1), l = i * n * 2 * 3, c = new (65535 < l ? Uint32Array : Uint16Array)(l), h = new Float32Array(3 * s), u = new Float32Array(3 * s), d = new Float32Array(2 * s), p = 0, f = 0, g = 0, m = new Ci.Vector3, v = new Ci.Vector3, y = new Ci.Vector3;
  53414. for (o = 0; o <= i; o++)
  53415. for (a = 0; a <= n; a++) {
  53416. var A = a / n * r
  53417. , C = o / i * Math.PI * 2;
  53418. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53419. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53420. v.z = t * Math.sin(C),
  53421. h[p] = v.x,
  53422. h[p + 1] = v.y,
  53423. h[p + 2] = v.z,
  53424. m.x = e * Math.cos(A),
  53425. m.y = e * Math.sin(A),
  53426. y.subVectors(v, m).normalize(),
  53427. u[p] = y.x,
  53428. u[p + 1] = y.y,
  53429. u[p + 2] = y.z,
  53430. d[f] = a / n,
  53431. d[f + 1] = o / i,
  53432. p += 3,
  53433. f += 2
  53434. }
  53435. for (o = 1; o <= i; o++)
  53436. for (a = 1; a <= n; a++) {
  53437. var I = (n + 1) * o + a - 1
  53438. , E = (n + 1) * (o - 1) + a - 1
  53439. , _ = (n + 1) * (o - 1) + a
  53440. , b = (n + 1) * o + a;
  53441. c[g] = I,
  53442. c[g + 1] = E,
  53443. c[g + 2] = b,
  53444. c[g + 3] = E,
  53445. c[g + 4] = _,
  53446. c[g + 5] = b,
  53447. g += 6
  53448. }
  53449. this.setIndex(new Ci.BufferAttribute(c,1)),
  53450. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53451. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53452. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53453. }
  53454. ,
  53455. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53456. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53457. Ci.TorusGeometry = function(e, t, i, n, r) {
  53458. Ci.Geometry.call(this),
  53459. this.type = "TorusGeometry",
  53460. this.parameters = {
  53461. radius: e,
  53462. tube: t,
  53463. radialSegments: i,
  53464. tubularSegments: n,
  53465. arc: r
  53466. },
  53467. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53468. }
  53469. ,
  53470. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53471. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53472. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53473. function a(e, t, i, n, r) {
  53474. var o = Math.cos(e)
  53475. , a = Math.sin(e)
  53476. , s = i / t * e
  53477. , l = Math.cos(s);
  53478. r.x = n * (2 + l) * .5 * o,
  53479. r.y = n * (2 + l) * a * .5,
  53480. r.z = n * Math.sin(s) * .5
  53481. }
  53482. Ci.BufferGeometry.call(this),
  53483. this.type = "TorusKnotBufferGeometry",
  53484. this.parameters = {
  53485. radius: e,
  53486. tube: t,
  53487. tubularSegments: i,
  53488. radialSegments: n,
  53489. p: r,
  53490. q: o
  53491. },
  53492. e = e || 100,
  53493. t = t || 40,
  53494. i = Math.floor(i) || 64,
  53495. r = r || 2,
  53496. o = o || 3;
  53497. var s, l, c = ((n = Math.floor(n) || 8) + 1) * (i + 1), h = n * i * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = new Ci.Vector3, y = new Ci.Vector3, A = new Ci.Vector2, C = new Ci.Vector3, I = new Ci.Vector3, E = new Ci.Vector3, _ = new Ci.Vector3, b = new Ci.Vector3;
  53498. for (s = 0; s <= i; ++s) {
  53499. var w = s / i * r * Math.PI * 2;
  53500. for (a(w, r, o, e, C),
  53501. a(.01 + w, r, o, e, I),
  53502. _.subVectors(I, C),
  53503. b.addVectors(I, C),
  53504. E.crossVectors(_, b),
  53505. b.crossVectors(E, _),
  53506. E.normalize(),
  53507. b.normalize(),
  53508. l = 0; l <= n; ++l) {
  53509. var T = l / n * Math.PI * 2
  53510. , x = -t * Math.cos(T)
  53511. , S = t * Math.sin(T);
  53512. v.x = C.x + (x * b.x + S * E.x),
  53513. v.y = C.y + (x * b.y + S * E.y),
  53514. v.z = C.z + (x * b.z + S * E.z),
  53515. d.setXYZ(g, v.x, v.y, v.z),
  53516. y.subVectors(v, C).normalize(),
  53517. p.setXYZ(g, y.x, y.y, y.z),
  53518. A.x = s / i,
  53519. A.y = l / n,
  53520. f.setXY(g, A.x, A.y),
  53521. g++
  53522. }
  53523. }
  53524. for (l = 1; l <= i; l++)
  53525. for (s = 1; s <= n; s++) {
  53526. var M = (n + 1) * (l - 1) + (s - 1)
  53527. , R = (n + 1) * l + (s - 1)
  53528. , P = (n + 1) * l + s
  53529. , O = (n + 1) * (l - 1) + s;
  53530. u.setX(m, M),
  53531. m++,
  53532. u.setX(m, R),
  53533. m++,
  53534. u.setX(m, O),
  53535. m++,
  53536. u.setX(m, R),
  53537. m++,
  53538. u.setX(m, P),
  53539. m++,
  53540. u.setX(m, O),
  53541. m++
  53542. }
  53543. this.setIndex(u),
  53544. this.addAttribute("position", d),
  53545. this.addAttribute("normal", p),
  53546. this.addAttribute("uv", f)
  53547. }
  53548. ,
  53549. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53550. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53551. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53552. Ci.Geometry.call(this),
  53553. this.type = "TorusKnotGeometry",
  53554. this.parameters = {
  53555. radius: e,
  53556. tube: t,
  53557. tubularSegments: i,
  53558. radialSegments: n,
  53559. p: r,
  53560. q: o
  53561. },
  53562. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53563. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53564. this.mergeVertices()
  53565. }
  53566. ,
  53567. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53568. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53569. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53570. Ci.Geometry.call(this),
  53571. this.type = "TubeGeometry",
  53572. this.parameters = {
  53573. path: e,
  53574. segments: t,
  53575. radius: i,
  53576. radialSegments: n,
  53577. closed: r,
  53578. taper: o
  53579. },
  53580. t = t || 64,
  53581. i = i || 1,
  53582. n = n || 8,
  53583. r = r || !1,
  53584. o = o || Ci.TubeGeometry.NoTaper;
  53585. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = [], R = this, P = t + 1, O = new Ci.Vector3, L = new Ci.TubeGeometry.FrenetFrames(e,t,r), D = L.tangents, N = L.normals, F = L.binormals;
  53586. for (this.tangents = D,
  53587. this.normals = N,
  53588. this.binormals = F,
  53589. f = 0; f < P; f++)
  53590. for (M[f] = [],
  53591. l = f / (P - 1),
  53592. p = e.getPointAt(l),
  53593. D[f],
  53594. a = N[f],
  53595. s = F[f],
  53596. h = i * o(l),
  53597. g = 0; g < n; g++)
  53598. c = g / n * 2 * Math.PI,
  53599. u = -h * Math.cos(c),
  53600. d = h * Math.sin(c),
  53601. O.copy(p),
  53602. O.x += u * a.x + d * s.x,
  53603. O.y += u * a.y + d * s.y,
  53604. O.z += u * a.z + d * s.z,
  53605. M[f][g] = (T = O.x,
  53606. x = O.y,
  53607. S = O.z,
  53608. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  53609. for (f = 0; f < t; f++)
  53610. for (g = 0; g < n; g++)
  53611. m = r ? (f + 1) % t : f + 1,
  53612. v = (g + 1) % n,
  53613. y = M[f][g],
  53614. A = M[m][g],
  53615. C = M[m][v],
  53616. I = M[f][v],
  53617. E = new Ci.Vector2(f / t,g / n),
  53618. _ = new Ci.Vector2((f + 1) / t,g / n),
  53619. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  53620. w = new Ci.Vector2(f / t,(g + 1) / n),
  53621. this.faces.push(new Ci.Face3(y,A,I)),
  53622. this.faceVertexUvs[0].push([E, _, w]),
  53623. this.faces.push(new Ci.Face3(A,C,I)),
  53624. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  53625. this.computeFaceNormals(),
  53626. this.computeVertexNormals()
  53627. }
  53628. ,
  53629. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53630. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  53631. Ci.TubeGeometry.NoTaper = function(e) {
  53632. return 1
  53633. }
  53634. ,
  53635. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  53636. return Math.sin(Math.PI * e)
  53637. }
  53638. ,
  53639. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  53640. var n, r, o, a, s, l, c, h = new Ci.Vector3, u = [], d = [], p = [], f = new Ci.Vector3, g = new Ci.Matrix4, m = t + 1;
  53641. for (this.tangents = u,
  53642. this.normals = d,
  53643. this.binormals = p,
  53644. l = 0; l < m; l++)
  53645. c = l / (m - 1),
  53646. u[l] = e.getTangentAt(c),
  53647. u[l].normalize();
  53648. for (d[0] = new Ci.Vector3,
  53649. p[0] = new Ci.Vector3,
  53650. r = Number.MAX_VALUE,
  53651. o = Math.abs(u[0].x),
  53652. a = Math.abs(u[0].y),
  53653. s = Math.abs(u[0].z),
  53654. o <= r && (r = o,
  53655. h.set(1, 0, 0)),
  53656. a <= r && (r = a,
  53657. h.set(0, 1, 0)),
  53658. s <= r && h.set(0, 0, 1),
  53659. f.crossVectors(u[0], h).normalize(),
  53660. d[0].crossVectors(u[0], f),
  53661. p[0].crossVectors(u[0], d[0]),
  53662. l = 1; l < m; l++)
  53663. d[l] = d[l - 1].clone(),
  53664. p[l] = p[l - 1].clone(),
  53665. f.crossVectors(u[l - 1], u[l]),
  53666. f.length() > Number.EPSILON && (f.normalize(),
  53667. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  53668. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  53669. p[l].crossVectors(u[l], d[l]);
  53670. if (i)
  53671. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  53672. n /= m - 1,
  53673. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  53674. l = 1; l < m; l++)
  53675. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  53676. p[l].crossVectors(u[l], d[l])
  53677. }
  53678. ,
  53679. Ci.PolyhedronGeometry = function(e, t, i, n) {
  53680. function f(e) {
  53681. var t = e.normalize().clone();
  53682. t.index = m.vertices.push(t) - 1;
  53683. var i = a(e) / 2 / Math.PI + .5
  53684. , n = function(e) {
  53685. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  53686. }(e) / Math.PI + .5;
  53687. return t.uv = new Ci.Vector2(i,1 - n),
  53688. t
  53689. }
  53690. function g(e, t, i, n) {
  53691. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  53692. m.faces.push(r),
  53693. y.copy(e).add(t).add(i).divideScalar(3);
  53694. var o = a(y);
  53695. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  53696. }
  53697. function r(e, t) {
  53698. for (var i = Math.pow(2, t), n = f(m.vertices[e.a]), r = f(m.vertices[e.b]), o = f(m.vertices[e.c]), a = [], s = e.materialIndex, l = 0; l <= i; l++) {
  53699. a[l] = [];
  53700. for (var c = f(n.clone().lerp(o, l / i)), h = f(r.clone().lerp(o, l / i)), u = i - l, d = 0; d <= u; d++)
  53701. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  53702. }
  53703. for (l = 0; l < i; l++)
  53704. for (d = 0; d < 2 * (i - l) - 1; d++) {
  53705. var p = Math.floor(d / 2);
  53706. d % 2 == 0 ? g(a[l][p + 1], a[l + 1][p], a[l][p], s) : g(a[l][p + 1], a[l + 1][p + 1], a[l + 1][p], s)
  53707. }
  53708. }
  53709. function a(e) {
  53710. return Math.atan2(e.z, -e.x)
  53711. }
  53712. function s(e, t, i) {
  53713. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  53714. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  53715. e.clone()
  53716. }
  53717. Ci.Geometry.call(this),
  53718. this.type = "PolyhedronGeometry",
  53719. this.parameters = {
  53720. vertices: e,
  53721. indices: t,
  53722. radius: i,
  53723. detail: n
  53724. },
  53725. i = i || 1,
  53726. n = n || 0;
  53727. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  53728. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  53729. var c = this.vertices
  53730. , h = []
  53731. , u = (o = 0,
  53732. 0);
  53733. for (l = t.length; o < l; o += 3,
  53734. u++) {
  53735. var d = c[t[o]]
  53736. , p = c[t[o + 1]]
  53737. , v = c[t[o + 2]];
  53738. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  53739. }
  53740. var y = new Ci.Vector3;
  53741. for (o = 0,
  53742. l = h.length; o < l; o++)
  53743. r(h[o], n);
  53744. for (o = 0,
  53745. l = this.faceVertexUvs[0].length; o < l; o++) {
  53746. var A = this.faceVertexUvs[0][o]
  53747. , C = A[0].x
  53748. , I = A[1].x
  53749. , E = A[2].x
  53750. , _ = Math.max(C, I, E)
  53751. , b = Math.min(C, I, E);
  53752. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  53753. I < .2 && (A[1].x += 1),
  53754. E < .2 && (A[2].x += 1))
  53755. }
  53756. for (o = 0,
  53757. l = this.vertices.length; o < l; o++)
  53758. this.vertices[o].multiplyScalar(i);
  53759. this.mergeVertices(),
  53760. this.computeFaceNormals(),
  53761. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  53762. }
  53763. ,
  53764. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53765. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  53766. Ci.DodecahedronGeometry = function(e, t) {
  53767. var i = (1 + Math.sqrt(5)) / 2
  53768. , n = 1 / i
  53769. , r = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, 0, -i, 0, -n, i, 0, -n, -i, 0, n, i, 0, n];
  53770. Ci.PolyhedronGeometry.call(this, r, [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9], e, t),
  53771. this.type = "DodecahedronGeometry",
  53772. this.parameters = {
  53773. radius: e,
  53774. detail: t
  53775. }
  53776. }
  53777. ,
  53778. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53779. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  53780. Ci.IcosahedronGeometry = function(e, t) {
  53781. var i = (1 + Math.sqrt(5)) / 2
  53782. , n = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1];
  53783. Ci.PolyhedronGeometry.call(this, n, [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1], e, t),
  53784. this.type = "IcosahedronGeometry",
  53785. this.parameters = {
  53786. radius: e,
  53787. detail: t
  53788. }
  53789. }
  53790. ,
  53791. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53792. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  53793. Ci.OctahedronGeometry = function(e, t) {
  53794. Ci.PolyhedronGeometry.call(this, [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1], [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2], e, t),
  53795. this.type = "OctahedronGeometry",
  53796. this.parameters = {
  53797. radius: e,
  53798. detail: t
  53799. }
  53800. }
  53801. ,
  53802. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53803. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  53804. Ci.TetrahedronGeometry = function(e, t) {
  53805. Ci.PolyhedronGeometry.call(this, [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1], [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1], e, t),
  53806. this.type = "TetrahedronGeometry",
  53807. this.parameters = {
  53808. radius: e,
  53809. detail: t
  53810. }
  53811. }
  53812. ,
  53813. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53814. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  53815. Ci.ParametricGeometry = function(e, t, i) {
  53816. Ci.Geometry.call(this),
  53817. this.type = "ParametricGeometry",
  53818. this.parameters = {
  53819. func: e,
  53820. slices: t,
  53821. stacks: i
  53822. };
  53823. var n, r, o, a, s, l, c, h, u, d, p, f, g = this.vertices, m = this.faces, v = this.faceVertexUvs[0], y = t + 1;
  53824. for (n = 0; n <= i; n++)
  53825. for (a = n / i,
  53826. r = 0; r <= t; r++)
  53827. o = e(r / t, a),
  53828. g.push(o);
  53829. for (n = 0; n < i; n++)
  53830. for (r = 0; r < t; r++)
  53831. l = (s = n * y + r) + 1,
  53832. c = (n + 1) * y + r + 1,
  53833. h = (n + 1) * y + r,
  53834. u = new Ci.Vector2(r / t,n / i),
  53835. d = new Ci.Vector2((r + 1) / t,n / i),
  53836. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  53837. f = new Ci.Vector2(r / t,(n + 1) / i),
  53838. m.push(new Ci.Face3(s,l,h)),
  53839. v.push([u, d, f]),
  53840. m.push(new Ci.Face3(l,c,h)),
  53841. v.push([d.clone(), p, f.clone()]);
  53842. this.computeFaceNormals(),
  53843. this.computeVertexNormals()
  53844. }
  53845. ,
  53846. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53847. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  53848. Ci.WireframeGeometry = function(e) {
  53849. function t(e, t) {
  53850. return e - t
  53851. }
  53852. Ci.BufferGeometry.call(this);
  53853. var i = [0, 0]
  53854. , n = {}
  53855. , r = ["a", "b", "c"];
  53856. if (e instanceof Ci.Geometry) {
  53857. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  53858. for (var u = a[c], d = 0; d < 3; d++) {
  53859. i[0] = u[r[d]],
  53860. i[1] = u[r[(d + 1) % 3]],
  53861. i.sort(t),
  53862. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  53863. l[2 * s + 1] = i[1],
  53864. n[E] = !0,
  53865. s++)
  53866. }
  53867. var p = new Float32Array(2 * s * 3);
  53868. for (c = 0,
  53869. h = s; c < h; c++)
  53870. for (d = 0; d < 2; d++) {
  53871. var f = o[l[2 * c + d]];
  53872. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  53873. p[_ + 1] = f.y,
  53874. p[_ + 2] = f.z
  53875. }
  53876. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  53877. } else if (e instanceof Ci.BufferGeometry)
  53878. if (null !== e.index) {
  53879. var g = e.index.array
  53880. , m = (o = e.attributes.position,
  53881. e.groups);
  53882. s = 0;
  53883. 0 === m.length && e.addGroup(0, g.length);
  53884. l = new Uint32Array(2 * g.length);
  53885. for (var v = 0, y = m.length; v < y; ++v)
  53886. for (var A = m[v], C = A.start, I = (c = C,
  53887. C + A.count); c < I; c += 3)
  53888. for (d = 0; d < 3; d++) {
  53889. var E;
  53890. i[0] = g[c + d],
  53891. i[1] = g[c + (d + 1) % 3],
  53892. i.sort(t),
  53893. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  53894. l[2 * s + 1] = i[1],
  53895. n[E] = !0,
  53896. s++)
  53897. }
  53898. for (p = new Float32Array(2 * s * 3),
  53899. c = 0,
  53900. h = s; c < h; c++)
  53901. for (d = 0; d < 2; d++) {
  53902. var _ = 6 * c + 3 * d
  53903. , b = l[2 * c + d];
  53904. p[_ + 0] = o.getX(b),
  53905. p[_ + 1] = o.getY(b),
  53906. p[_ + 2] = o.getZ(b)
  53907. }
  53908. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  53909. } else {
  53910. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  53911. for (p = new Float32Array(2 * s * 3),
  53912. c = 0,
  53913. h = w; c < h; c++)
  53914. for (d = 0; d < 3; d++) {
  53915. var T = 9 * c + 3 * d;
  53916. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  53917. p[_ + 1] = o[1 + T],
  53918. p[_ + 2] = o[2 + T];
  53919. b = 9 * c + (d + 1) % 3 * 3;
  53920. p[_ + 3] = o[b],
  53921. p[_ + 4] = o[b + 1],
  53922. p[_ + 5] = o[b + 2]
  53923. }
  53924. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  53925. }
  53926. }
  53927. ,
  53928. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53929. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  53930. Ci.AxisHelper = function(e) {
  53931. e = e || 1;
  53932. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  53933. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  53934. , n = new Ci.BufferGeometry;
  53935. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  53936. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  53937. var r = new Ci.LineBasicMaterial({
  53938. vertexColors: Ci.VertexColors
  53939. });
  53940. Ci.LineSegments.call(this, n, r)
  53941. }
  53942. ,
  53943. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  53944. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  53945. Ci.ArrowHelper = function() {
  53946. var a = new Ci.Geometry;
  53947. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  53948. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  53949. return s.translate(0, -.5, 0),
  53950. function(e, t, i, n, r, o) {
  53951. Ci.Object3D.call(this),
  53952. void 0 === n && (n = 16776960),
  53953. void 0 === i && (i = 1),
  53954. void 0 === r && (r = .2 * i),
  53955. void 0 === o && (o = .2 * r),
  53956. this.position.copy(t),
  53957. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  53958. color: n
  53959. })),
  53960. this.line.matrixAutoUpdate = !1,
  53961. this.add(this.line),
  53962. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  53963. color: n
  53964. })),
  53965. this.cone.matrixAutoUpdate = !1,
  53966. this.add(this.cone),
  53967. this.setDirection(e),
  53968. this.setLength(i, r, o)
  53969. }
  53970. }(),
  53971. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  53972. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  53973. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  53974. function(e) {
  53975. .99999 < e.y ? this.quaternion.set(0, 0, 0, 1) : e.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (Ai.set(e.z, 0, -e.x).normalize(),
  53976. yi = Math.acos(e.y),
  53977. this.quaternion.setFromAxisAngle(Ai, yi))
  53978. }
  53979. ),
  53980. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  53981. void 0 === t && (t = .2 * e),
  53982. void 0 === i && (i = .2 * t),
  53983. this.line.scale.set(1, Math.max(0, e - t), 1),
  53984. this.line.updateMatrix(),
  53985. this.cone.scale.set(i, t, i),
  53986. this.cone.position.y = e,
  53987. this.cone.updateMatrix()
  53988. }
  53989. ,
  53990. Ci.ArrowHelper.prototype.setColor = function(e) {
  53991. this.line.material.color.set(e),
  53992. this.cone.material.color.set(e)
  53993. }
  53994. ,
  53995. Ci.BoxHelper = function(e) {
  53996. 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])
  53997. , i = new Float32Array(24)
  53998. , n = new Ci.BufferGeometry;
  53999. n.setIndex(new Ci.BufferAttribute(t,1)),
  54000. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54001. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54002. color: 16776960
  54003. })),
  54004. void 0 !== e && this.update(e)
  54005. }
  54006. ,
  54007. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54008. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54009. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54010. function(e) {
  54011. if (vi.setFromObject(e),
  54012. !vi.isEmpty()) {
  54013. var t = vi.min
  54014. , i = vi.max
  54015. , n = this.geometry.attributes.position
  54016. , r = n.array;
  54017. r[0] = i.x,
  54018. r[1] = i.y,
  54019. r[2] = i.z,
  54020. r[3] = t.x,
  54021. r[4] = i.y,
  54022. r[5] = i.z,
  54023. r[6] = t.x,
  54024. r[7] = t.y,
  54025. r[8] = i.z,
  54026. r[9] = i.x,
  54027. r[10] = t.y,
  54028. r[11] = i.z,
  54029. r[12] = i.x,
  54030. r[13] = i.y,
  54031. r[14] = t.z,
  54032. r[15] = t.x,
  54033. r[16] = i.y,
  54034. r[17] = t.z,
  54035. r[18] = t.x,
  54036. r[19] = t.y,
  54037. r[20] = t.z,
  54038. r[21] = i.x,
  54039. r[22] = t.y,
  54040. r[23] = t.z,
  54041. n.needsUpdate = !0,
  54042. this.geometry.computeBoundingSphere()
  54043. }
  54044. }
  54045. ),
  54046. Ci.BoundingBoxHelper = function(e, t) {
  54047. var i = void 0 !== t ? t : 8947848;
  54048. this.object = e,
  54049. this.box = new Ci.Box3,
  54050. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54051. color: i,
  54052. wireframe: !0
  54053. }))
  54054. }
  54055. ,
  54056. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54057. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54058. Ci.BoundingBoxHelper.prototype.update = function() {
  54059. this.box.setFromObject(this.object),
  54060. this.box.size(this.scale),
  54061. this.box.center(this.position)
  54062. }
  54063. ,
  54064. Ci.CameraHelper = function(e) {
  54065. function t(e, t, i) {
  54066. n(e, i),
  54067. n(t, i)
  54068. }
  54069. function n(e, t) {
  54070. i.vertices.push(new Ci.Vector3),
  54071. i.colors.push(new Ci.Color(t)),
  54072. void 0 === o[e] && (o[e] = []),
  54073. o[e].push(i.vertices.length - 1)
  54074. }
  54075. var i = new Ci.Geometry
  54076. , r = new Ci.LineBasicMaterial({
  54077. color: 16777215,
  54078. vertexColors: Ci.FaceColors
  54079. })
  54080. , o = {}
  54081. , a = 16755200
  54082. , s = 16711680
  54083. , l = 3355443;
  54084. t("n1", "n2", a),
  54085. t("n2", "n4", a),
  54086. t("n4", "n3", a),
  54087. t("n3", "n1", a),
  54088. t("f1", "f2", a),
  54089. t("f2", "f4", a),
  54090. t("f4", "f3", a),
  54091. t("f3", "f1", a),
  54092. t("n1", "f1", a),
  54093. t("n2", "f2", a),
  54094. t("n3", "f3", a),
  54095. t("n4", "f4", a),
  54096. t("p", "n1", s),
  54097. t("p", "n2", s),
  54098. t("p", "n3", s),
  54099. t("p", "n4", s),
  54100. t("u1", "u2", 43775),
  54101. t("u2", "u3", 43775),
  54102. t("u3", "u1", 43775),
  54103. t("c", "t", 16777215),
  54104. t("p", "c", l),
  54105. t("cn1", "cn2", l),
  54106. t("cn3", "cn4", l),
  54107. t("cf1", "cf2", l),
  54108. t("cf3", "cf4", l),
  54109. Ci.LineSegments.call(this, i, r),
  54110. this.camera = e,
  54111. this.camera.updateProjectionMatrix(),
  54112. this.matrix = e.matrixWorld,
  54113. this.matrixAutoUpdate = !1,
  54114. this.pointMap = o,
  54115. this.update()
  54116. }
  54117. ,
  54118. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54119. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54120. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54121. mi = new Ci.Camera,
  54122. function() {
  54123. pi = this.geometry,
  54124. fi = this.pointMap,
  54125. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54126. Ni("c", 0, 0, -1),
  54127. Ni("t", 0, 0, 1),
  54128. Ni("n1", -1, -1, -1),
  54129. Ni("n2", 1, -1, -1),
  54130. Ni("n3", -1, 1, -1),
  54131. Ni("n4", 1, 1, -1),
  54132. Ni("f1", -1, -1, 1),
  54133. Ni("f2", 1, -1, 1),
  54134. Ni("f3", -1, 1, 1),
  54135. Ni("f4", 1, 1, 1),
  54136. Ni("u1", .7, 1.1, -1),
  54137. Ni("u2", -.7, 1.1, -1),
  54138. Ni("u3", 0, 2, -1),
  54139. Ni("cf1", -1, 0, 1),
  54140. Ni("cf2", 1, 0, 1),
  54141. Ni("cf3", 0, -1, 1),
  54142. Ni("cf4", 0, 1, 1),
  54143. Ni("cn1", -1, 0, -1),
  54144. Ni("cn2", 1, 0, -1),
  54145. Ni("cn3", 0, -1, -1),
  54146. Ni("cn4", 0, 1, -1),
  54147. pi.verticesNeedUpdate = !0
  54148. }
  54149. ),
  54150. Ci.DirectionalLightHelper = function(e, t) {
  54151. Ci.Object3D.call(this),
  54152. this.light = e,
  54153. this.light.updateMatrixWorld(),
  54154. this.matrix = e.matrixWorld,
  54155. this.matrixAutoUpdate = !1,
  54156. t = t || 1;
  54157. var i = new Ci.Geometry;
  54158. i.vertices.push(new Ci.Vector3(-t,t,0), new Ci.Vector3(t,t,0), new Ci.Vector3(t,-t,0), new Ci.Vector3(-t,-t,0), new Ci.Vector3(-t,t,0));
  54159. var n = new Ci.LineBasicMaterial({
  54160. fog: !1
  54161. });
  54162. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54163. this.lightPlane = new Ci.Line(i,n),
  54164. this.add(this.lightPlane),
  54165. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54166. (n = new Ci.LineBasicMaterial({
  54167. fog: !1
  54168. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54169. this.targetLine = new Ci.Line(i,n),
  54170. this.add(this.targetLine),
  54171. this.update()
  54172. }
  54173. ,
  54174. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54175. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54176. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54177. this.lightPlane.geometry.dispose(),
  54178. this.lightPlane.material.dispose(),
  54179. this.targetLine.geometry.dispose(),
  54180. this.targetLine.material.dispose()
  54181. }
  54182. ,
  54183. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54184. ui = new Ci.Vector3,
  54185. di = new Ci.Vector3,
  54186. function() {
  54187. hi.setFromMatrixPosition(this.light.matrixWorld),
  54188. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54189. di.subVectors(ui, hi),
  54190. this.lightPlane.lookAt(di),
  54191. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54192. this.targetLine.geometry.vertices[1].copy(di),
  54193. this.targetLine.geometry.verticesNeedUpdate = !0,
  54194. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54195. }
  54196. ),
  54197. Ci.EdgesHelper = function(e, t, i) {
  54198. var n = void 0 !== t ? t : 16777215;
  54199. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54200. color: n
  54201. })),
  54202. this.matrix = e.matrixWorld,
  54203. this.matrixAutoUpdate = !1
  54204. }
  54205. ,
  54206. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54207. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54208. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54209. this.object = e,
  54210. this.size = void 0 !== t ? t : 1;
  54211. var r = void 0 !== i ? i : 16776960
  54212. , o = void 0 !== n ? n : 1
  54213. , a = 0
  54214. , s = this.object.geometry;
  54215. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54216. var l = new Ci.BufferGeometry
  54217. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54218. l.addAttribute("position", c),
  54219. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54220. color: r,
  54221. linewidth: o
  54222. })),
  54223. this.matrixAutoUpdate = !1,
  54224. this.update()
  54225. }
  54226. ,
  54227. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54228. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54229. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54230. li = new Ci.Vector3,
  54231. ci = new Ci.Matrix3,
  54232. function() {
  54233. this.object.updateMatrixWorld(!0),
  54234. ci.getNormalMatrix(this.object.matrixWorld);
  54235. for (var e = this.object.matrixWorld, t = this.geometry.attributes.position, i = this.object.geometry, n = i.vertices, r = i.faces, o = 0, a = 0, s = r.length; a < s; a++) {
  54236. var l = r[a]
  54237. , c = l.normal;
  54238. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54239. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54240. t.setXYZ(o, si.x, si.y, si.z),
  54241. o += 1,
  54242. t.setXYZ(o, li.x, li.y, li.z),
  54243. o += 1
  54244. }
  54245. return t.needsUpdate = !0,
  54246. this
  54247. }
  54248. ),
  54249. Ci.GridHelper = function(e, t) {
  54250. var i = new Ci.Geometry
  54251. , n = new Ci.LineBasicMaterial({
  54252. vertexColors: Ci.VertexColors
  54253. });
  54254. this.color1 = new Ci.Color(4473924),
  54255. this.color2 = new Ci.Color(8947848);
  54256. for (var r = -e; r <= e; r += t) {
  54257. i.vertices.push(new Ci.Vector3(-e,0,r), new Ci.Vector3(e,0,r), new Ci.Vector3(r,0,-e), new Ci.Vector3(r,0,e));
  54258. var o = 0 === r ? this.color1 : this.color2;
  54259. i.colors.push(o, o, o, o)
  54260. }
  54261. Ci.LineSegments.call(this, i, n)
  54262. }
  54263. ,
  54264. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54265. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54266. Ci.GridHelper.prototype.setColors = function(e, t) {
  54267. this.color1.set(e),
  54268. this.color2.set(t),
  54269. this.geometry.colorsNeedUpdate = !0
  54270. }
  54271. ,
  54272. Ci.HemisphereLightHelper = function(e, t) {
  54273. Ci.Object3D.call(this),
  54274. this.light = e,
  54275. this.light.updateMatrixWorld(),
  54276. this.matrix = e.matrixWorld,
  54277. this.matrixAutoUpdate = !1,
  54278. this.colors = [new Ci.Color, new Ci.Color];
  54279. var i = new Ci.SphereGeometry(t,4,2);
  54280. i.rotateX(-Math.PI / 2);
  54281. for (var n = 0; n < 8; n++)
  54282. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54283. var r = new Ci.MeshBasicMaterial({
  54284. vertexColors: Ci.FaceColors,
  54285. wireframe: !0
  54286. });
  54287. this.lightSphere = new Ci.Mesh(i,r),
  54288. this.add(this.lightSphere),
  54289. this.update()
  54290. }
  54291. ,
  54292. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54293. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54294. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54295. this.lightSphere.geometry.dispose(),
  54296. this.lightSphere.material.dispose()
  54297. }
  54298. ,
  54299. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54300. function() {
  54301. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54302. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54303. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54304. this.lightSphere.geometry.colorsNeedUpdate = !0
  54305. }
  54306. ),
  54307. Ci.PointLightHelper = function(e, t) {
  54308. this.light = e,
  54309. this.light.updateMatrixWorld();
  54310. var i = new Ci.SphereGeometry(t,4,2)
  54311. , n = new Ci.MeshBasicMaterial({
  54312. wireframe: !0,
  54313. fog: !1
  54314. });
  54315. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54316. Ci.Mesh.call(this, i, n),
  54317. this.matrix = this.light.matrixWorld,
  54318. this.matrixAutoUpdate = !1
  54319. }
  54320. ,
  54321. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54322. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54323. Ci.PointLightHelper.prototype.dispose = function() {
  54324. this.geometry.dispose(),
  54325. this.material.dispose()
  54326. }
  54327. ,
  54328. Ci.PointLightHelper.prototype.update = function() {
  54329. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54330. }
  54331. ,
  54332. Ci.SkeletonHelper = function(e) {
  54333. this.bones = this.getBoneList(e);
  54334. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54335. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54336. t.vertices.push(new Ci.Vector3),
  54337. t.colors.push(new Ci.Color(0,0,1)),
  54338. t.colors.push(new Ci.Color(0,1,0)))
  54339. }
  54340. t.dynamic = !0;
  54341. var n = new Ci.LineBasicMaterial({
  54342. vertexColors: Ci.VertexColors,
  54343. depthTest: !1,
  54344. depthWrite: !1,
  54345. transparent: !0
  54346. });
  54347. Ci.LineSegments.call(this, t, n),
  54348. this.root = e,
  54349. this.matrix = e.matrixWorld,
  54350. this.matrixAutoUpdate = !1,
  54351. this.update()
  54352. }
  54353. ,
  54354. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54355. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54356. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54357. var t = [];
  54358. e instanceof Ci.Bone && t.push(e);
  54359. for (var i = 0; i < e.children.length; i++)
  54360. t.push.apply(t, this.getBoneList(e.children[i]));
  54361. return t
  54362. }
  54363. ,
  54364. Ci.SkeletonHelper.prototype.update = function() {
  54365. for (var e = this.geometry, t = (new Ci.Matrix4).getInverse(this.root.matrixWorld), i = new Ci.Matrix4, n = 0, r = 0; r < this.bones.length; r++) {
  54366. var o = this.bones[r];
  54367. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54368. e.vertices[n].setFromMatrixPosition(i),
  54369. i.multiplyMatrices(t, o.parent.matrixWorld),
  54370. e.vertices[n + 1].setFromMatrixPosition(i),
  54371. n += 2)
  54372. }
  54373. e.verticesNeedUpdate = !0,
  54374. e.computeBoundingSphere()
  54375. }
  54376. ,
  54377. Ci.SpotLightHelper = function(e) {
  54378. Ci.Object3D.call(this),
  54379. this.light = e,
  54380. this.light.updateMatrixWorld(),
  54381. this.matrix = e.matrixWorld,
  54382. this.matrixAutoUpdate = !1;
  54383. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54384. t.translate(0, -.5, 0),
  54385. t.rotateX(-Math.PI / 2);
  54386. var i = new Ci.MeshBasicMaterial({
  54387. wireframe: !0,
  54388. fog: !1
  54389. });
  54390. this.cone = new Ci.Mesh(t,i),
  54391. this.add(this.cone),
  54392. this.update()
  54393. }
  54394. ,
  54395. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54396. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54397. Ci.SpotLightHelper.prototype.dispose = function() {
  54398. this.cone.geometry.dispose(),
  54399. this.cone.material.dispose()
  54400. }
  54401. ,
  54402. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54403. oi = new Ci.Vector3,
  54404. function() {
  54405. var e = this.light.distance ? this.light.distance : 1e4
  54406. , t = e * Math.tan(this.light.angle);
  54407. this.cone.scale.set(t, t, e),
  54408. ri.setFromMatrixPosition(this.light.matrixWorld),
  54409. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54410. this.cone.lookAt(oi.sub(ri)),
  54411. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54412. }
  54413. ),
  54414. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54415. this.object = e,
  54416. this.size = void 0 !== t ? t : 1;
  54417. var r = void 0 !== i ? i : 16711680
  54418. , o = void 0 !== n ? n : 1
  54419. , a = 0
  54420. , s = this.object.geometry;
  54421. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54422. var l = new Ci.BufferGeometry
  54423. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54424. l.addAttribute("position", c),
  54425. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54426. color: r,
  54427. linewidth: o
  54428. })),
  54429. this.matrixAutoUpdate = !1,
  54430. this.update()
  54431. }
  54432. ,
  54433. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54434. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54435. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54436. ii = new Ci.Vector3,
  54437. ni = new Ci.Matrix3,
  54438. function() {
  54439. var e = ["a", "b", "c"];
  54440. this.object.updateMatrixWorld(!0),
  54441. ni.getNormalMatrix(this.object.matrixWorld);
  54442. var t = this.object.matrixWorld
  54443. , i = this.geometry.attributes.position
  54444. , n = this.object.geometry;
  54445. if (n instanceof Ci.Geometry)
  54446. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54447. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54448. var d = r[c[e[h]]]
  54449. , p = c.vertexNormals[h];
  54450. ti.copy(d).applyMatrix4(t),
  54451. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54452. i.setXYZ(a, ti.x, ti.y, ti.z),
  54453. a += 1,
  54454. i.setXYZ(a, ii.x, ii.y, ii.z),
  54455. a += 1
  54456. }
  54457. else if (n instanceof Ci.BufferGeometry) {
  54458. var f = n.attributes.position
  54459. , g = n.attributes.normal;
  54460. for (h = a = 0,
  54461. u = f.count; h < u; h++)
  54462. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54463. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54464. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54465. i.setXYZ(a, ti.x, ti.y, ti.z),
  54466. a += 1,
  54467. i.setXYZ(a, ii.x, ii.y, ii.z),
  54468. a += 1
  54469. }
  54470. return i.needsUpdate = !0,
  54471. this
  54472. }
  54473. ),
  54474. Ci.WireframeHelper = function(e, t) {
  54475. var i = void 0 !== t ? t : 16777215;
  54476. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54477. color: i
  54478. })),
  54479. this.matrix = e.matrixWorld,
  54480. this.matrixAutoUpdate = !1
  54481. }
  54482. ,
  54483. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54484. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54485. Ci.ImmediateRenderObject = function(e) {
  54486. Ci.Object3D.call(this),
  54487. this.material = e,
  54488. this.render = function(e) {}
  54489. }
  54490. ,
  54491. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54492. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54493. Ci.MorphBlendMesh = function(e, t) {
  54494. Ci.Mesh.call(this, e, t),
  54495. this.animationsMap = {},
  54496. this.animationsList = [];
  54497. var i = this.geometry.morphTargets.length
  54498. , n = i - 1
  54499. , r = i / 1;
  54500. this.createAnimation("__default", 0, n, r),
  54501. this.setAnimationWeight("__default", 1)
  54502. }
  54503. ,
  54504. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54505. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54506. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54507. var r = {
  54508. start: t,
  54509. end: i,
  54510. length: i - t + 1,
  54511. fps: n,
  54512. duration: (i - t) / n,
  54513. lastFrame: 0,
  54514. currentFrame: 0,
  54515. active: !1,
  54516. time: 0,
  54517. direction: 1,
  54518. weight: 1,
  54519. directionBackwards: !1,
  54520. mirroredLoop: !1
  54521. };
  54522. this.animationsMap[e] = r,
  54523. this.animationsList.push(r)
  54524. }
  54525. ,
  54526. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54527. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54528. var s = r.morphTargets[o].name.match(i);
  54529. if (s && 1 < s.length)
  54530. n[l = s[1]] || (n[l] = {
  54531. start: 1 / 0,
  54532. end: -1 / 0
  54533. }),
  54534. o < (c = n[l]).start && (c.start = o),
  54535. o > c.end && (c.end = o),
  54536. t = t || l
  54537. }
  54538. for (var l in n) {
  54539. var c = n[l];
  54540. this.createAnimation(l, c.start, c.end, e)
  54541. }
  54542. this.firstAnimation = t
  54543. }
  54544. ,
  54545. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54546. var t = this.animationsMap[e];
  54547. t && (t.direction = 1,
  54548. t.directionBackwards = !1)
  54549. }
  54550. ,
  54551. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54552. var t = this.animationsMap[e];
  54553. t && (t.direction = -1,
  54554. t.directionBackwards = !0)
  54555. }
  54556. ,
  54557. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54558. var i = this.animationsMap[e];
  54559. i && (i.fps = t,
  54560. i.duration = (i.end - i.start) / i.fps)
  54561. }
  54562. ,
  54563. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54564. var i = this.animationsMap[e];
  54565. i && (i.duration = t,
  54566. i.fps = (i.end - i.start) / i.duration)
  54567. }
  54568. ,
  54569. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54570. var i = this.animationsMap[e];
  54571. i && (i.weight = t)
  54572. }
  54573. ,
  54574. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  54575. var i = this.animationsMap[e];
  54576. i && (i.time = t)
  54577. }
  54578. ,
  54579. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  54580. var t = 0
  54581. , i = this.animationsMap[e];
  54582. return i && (t = i.time),
  54583. t
  54584. }
  54585. ,
  54586. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  54587. var t = -1
  54588. , i = this.animationsMap[e];
  54589. return i && (t = i.duration),
  54590. t
  54591. }
  54592. ,
  54593. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  54594. var t = this.animationsMap[e];
  54595. t ? (t.time = 0,
  54596. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  54597. }
  54598. ,
  54599. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  54600. var t = this.animationsMap[e];
  54601. t && (t.active = !1)
  54602. }
  54603. ,
  54604. Ci.MorphBlendMesh.prototype.update = function(e) {
  54605. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  54606. var n = this.animationsList[t];
  54607. if (n.active) {
  54608. var r = n.duration / n.length;
  54609. n.time += n.direction * e,
  54610. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  54611. n.time > n.duration && (n.time = n.duration,
  54612. n.directionBackwards = !0),
  54613. n.time < 0 && (n.time = 0,
  54614. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  54615. n.time < 0 && (n.time += n.duration));
  54616. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  54617. , a = n.weight;
  54618. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  54619. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  54620. this.morphTargetInfluences[o] = 0,
  54621. n.lastFrame = n.currentFrame,
  54622. n.currentFrame = o);
  54623. var s = n.time % r / r;
  54624. n.directionBackwards && (s = 1 - s),
  54625. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  54626. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  54627. }
  54628. }
  54629. }
  54630. ,
  54631. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  54632. i.THREE = Ci) : this.THREE = Ci
  54633. }
  54634. , {}]
  54635. }, {}, [116]);