main_2020_edit.js 2.4 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136
  1. hardwareHotList = {}
  2. //热点 设备控制
  3. $("#hotPannel .close").on('click',()=>{
  4. $("#hotPannel>div").css("display","");
  5. window.hotNeedUpdatePanel = null;
  6. })
  7. $("#hotPannel input.mui-switch").on('change',()=>{
  8. var ifOn = $('#hotPannel input.mui-switch').is(':checked');
  9. })
  10. var dom = {
  11. getOffset: function(e, t, i) {
  12. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  13. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  14. left += "left" == e ? t.offsetLeft : t.offsetTop;
  15. return left
  16. }
  17. };
  18. if (function() {
  19. "use strict";
  20. function o(e, t) {
  21. return typeof e === t
  22. }
  23. function a(e, t) {
  24. return e instanceof t
  25. }
  26. function s(e) {
  27. return e && e.nodeType
  28. }
  29. function l(e) {
  30. return s(e) ? e : a(e, y) ? e[0] : void 0
  31. }
  32. function e(e, i, n) {
  33. return y.each(e, function(e, t) {
  34. n = i.call(t, n, e, t)
  35. }),
  36. n
  37. }
  38. function t(e, t, i) {
  39. var n, r, o;
  40. if (e === t)
  41. return !0;
  42. if (!e || !t || e.constructor !== t.constructor)
  43. return !1;
  44. for (n = 0,
  45. r = i.length; n < r; n += 1) {
  46. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  47. return !1;
  48. if (e[o] !== t[o])
  49. return !1
  50. }
  51. return !0
  52. }
  53. function c(e, t, i, n) {
  54. this.left = w(e),
  55. this.top = w(t),
  56. this.width = w(i),
  57. this.height = w(n),
  58. this.right = this.left + this.width,
  59. this.bottom = this.top + this.height
  60. }
  61. function h(e, t, i, n) {
  62. this.visible = e || 0,
  63. this.viewport = t || 0,
  64. this.possible = i || 0,
  65. this.rects = n && I({}, n) || null
  66. }
  67. function r(e, t) {
  68. this.els = e,
  69. this.viewport = t
  70. }
  71. function n(e, t) {
  72. return e.val - t.val
  73. }
  74. function u(e, t) {
  75. return t.val - e.val
  76. }
  77. function d(e) {
  78. var t = c.ofContent(e, !0)
  79. , i = c.ofViewport(e, !0)
  80. , n = t.width - i.width
  81. , r = t.height - i.height;
  82. this.content = t,
  83. this.viewport = i,
  84. this.width = n <= 0 ? null : i.left / n,
  85. this.height = r <= 0 ? null : i.top / r,
  86. this.left = i.left,
  87. this.top = i.top,
  88. this.right = t.right - i.right,
  89. this.bottom = t.bottom - i.bottom
  90. }
  91. function p(e) {
  92. this.el = e || window
  93. }
  94. function f(e, t) {
  95. this.context = e,
  96. this.viewport = t,
  97. this.init()
  98. }
  99. function g(e, t, i, n) {
  100. this.context = new r(e,t),
  101. this.property = i,
  102. this.descending = n,
  103. this.init()
  104. }
  105. function m(e) {
  106. e && e !== window && e !== document ? (this.context = e,
  107. this.$autoTarget = y(e)) : this.context = window,
  108. this.init()
  109. }
  110. 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 = {},
  111. v = 1,
  112. function(e) {
  113. return e ? (i[e] || (i[e] = v,
  114. v += 1),
  115. i[e]) : 0
  116. }
  117. );
  118. I(c.prototype, {
  119. equals: function(e) {
  120. return t(this, e, ["left", "top", "width", "height"])
  121. },
  122. area: function() {
  123. return this.width * this.height
  124. },
  125. relativeTo: function(e) {
  126. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  127. },
  128. intersection: function(e) {
  129. if (!a(e, c))
  130. return null;
  131. var t = _(this.left, e.left)
  132. , i = b(this.right, e.right)
  133. , n = _(this.top, e.top)
  134. , r = i - t
  135. , o = b(this.bottom, e.bottom) - n;
  136. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  137. },
  138. envelope: function(e) {
  139. if (!a(e, c))
  140. return this;
  141. var t = b(this.left, e.left)
  142. , i = _(this.right, e.right)
  143. , n = b(this.top, e.top);
  144. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  145. }
  146. }),
  147. I(c, {
  148. ofContent: function(e, t) {
  149. 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())
  150. },
  151. ofViewport: function(e, t) {
  152. 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())
  153. },
  154. ofElement: function(e) {
  155. var t = y(e);
  156. if (!t.is(":visible"))
  157. return null;
  158. var i = t.offset();
  159. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  160. }
  161. }),
  162. I(h.prototype, {
  163. equals: function(e) {
  164. return this.fracsEqual(e) && this.rectsEqual(e)
  165. },
  166. fracsEqual: function(e) {
  167. return t(this, e, ["visible", "viewport", "possible"])
  168. },
  169. rectsEqual: function(e) {
  170. return t(this.rects, e.rects, ["document", "element", "viewport"])
  171. }
  172. }),
  173. I(h, {
  174. of: function(e, t) {
  175. var i, n, r;
  176. return e = s(e) && c.ofElement(e) || e,
  177. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  178. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  179. r = b(e.width, t.width) * b(e.height, t.height),
  180. new h(n / e.area(),n / t.area(),n / r,{
  181. document: i,
  182. element: i.relativeTo(e),
  183. viewport: i.relativeTo(t)
  184. })) : new h
  185. }
  186. });
  187. var x = ["width", "height", "left", "right", "top", "bottom"]
  188. , S = ["possible", "visible", "viewport"];
  189. I(r.prototype, {
  190. sorted: function(t, e) {
  191. var i = this.viewport;
  192. return y.map(this.els, function(e) {
  193. return {
  194. el: e,
  195. val: function(e, t, i) {
  196. var n;
  197. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  198. n ? n[i] : 0
  199. }(e, i, t)
  200. }
  201. }).sort(e ? u : n)
  202. },
  203. best: function(e, t) {
  204. return this.els.length ? this.sorted(e, t)[0] : null
  205. }
  206. }),
  207. I(d.prototype, {
  208. equals: function(e) {
  209. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  210. }
  211. }),
  212. I(p.prototype, {
  213. equals: function(e) {
  214. return t(this, e, ["el"])
  215. },
  216. scrollState: function() {
  217. return new d(this.el)
  218. },
  219. scrollTo: function(e, t, i) {
  220. var n = y(this.el === window ? "html,body" : this.el);
  221. e = e || 0,
  222. t = t || 0,
  223. i = isNaN(i) ? 1e3 : i,
  224. n.stop(!0).animate({
  225. scrollLeft: e,
  226. scrollTop: t
  227. }, i)
  228. },
  229. scroll: function(e, t, i) {
  230. var n = this.el === window ? A : y(this.el);
  231. e = e || 0,
  232. t = t || 0,
  233. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  234. },
  235. scrollToRect: function(e, t, i, n) {
  236. t = t || 0,
  237. i = i || 0,
  238. this.scrollTo(e.left - t, e.top - i, n)
  239. },
  240. scrollToElement: function(e, t, i, n) {
  241. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  242. this.scrollToRect(r, t, i, n)
  243. }
  244. });
  245. var M = {
  246. init: function() {
  247. this.callbacks = y.Callbacks("memory unique"),
  248. this.currVal = null,
  249. this.prevVal = null,
  250. this.checkProxy = y.proxy(this.check, this),
  251. this.autoCheck()
  252. },
  253. bind: function(e) {
  254. this.callbacks.add(e)
  255. },
  256. unbind: function(e) {
  257. e ? this.callbacks.remove(e) : this.callbacks.empty()
  258. },
  259. trigger: function() {
  260. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  261. },
  262. check: function(e) {
  263. var t = this.updatedValue(e);
  264. return void 0 !== t && (this.prevVal = this.currVal,
  265. this.currVal = t,
  266. this.trigger(),
  267. !0)
  268. },
  269. $autoTarget: A,
  270. autoEvents: "load resize scroll",
  271. autoCheck: function(e) {
  272. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  273. }
  274. };
  275. I(f.prototype, M, {
  276. updatedValue: function() {
  277. var e = h.of(this.context, this.viewport);
  278. return this.currVal && this.currVal.equals(e) ? void 0 : e
  279. }
  280. }),
  281. I(g.prototype, M, {
  282. updatedValue: function() {
  283. var e = this.context.best(this.property, this.descending);
  284. return e && (e = 0 < e.val ? e.el : null,
  285. this.currVal !== e) ? e : void 0
  286. }
  287. }),
  288. I(m.prototype, M, {
  289. updatedValue: function() {
  290. var e = new d(this.context);
  291. return this.currVal && this.currVal.equals(e) ? void 0 : e
  292. }
  293. });
  294. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  295. function H(e, t, i, n) {
  296. return i = N(i) ? i.apply(e, t) : i,
  297. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  298. }
  299. R = U,
  300. P = {
  301. statics: {
  302. version: "0.15.0",
  303. Rect: c,
  304. Fractions: h,
  305. Group: r,
  306. ScrollState: d,
  307. Viewport: p,
  308. FracsCallbacks: f,
  309. GroupCallbacks: g,
  310. ScrollStateCallbacks: m,
  311. fracs: function(e, t) {
  312. return h.of(e, t)
  313. }
  314. },
  315. methods: {
  316. content: function(e) {
  317. return this.length ? c.ofContent(this[0], e) : null
  318. },
  319. envelope: function() {
  320. return e(this, function(e) {
  321. var t = c.ofElement(this);
  322. return e ? e.envelope(t) : t
  323. })
  324. },
  325. fracs: function(e, i, n) {
  326. o(e, "string") || (n = i,
  327. i = e,
  328. e = null),
  329. E(i) || (n = i,
  330. i = null),
  331. n = l(n);
  332. var r = U + ".fracs." + T(n);
  333. return "unbind" === e ? this.each(function() {
  334. var e = y(this).data(r);
  335. e && e.unbind(i)
  336. }) : "check" === e ? this.each(function() {
  337. var e = y(this).data(r);
  338. e && e.check()
  339. }) : E(i) ? this.each(function() {
  340. var e = y(this)
  341. , t = e.data(r);
  342. t || (t = new f(this,n),
  343. e.data(r, t)),
  344. t.bind(i)
  345. }) : this.length ? h.of(this[0], n) : null
  346. },
  347. intersection: function() {
  348. return e(this, function(e) {
  349. var t = c.ofElement(this);
  350. return e ? e.intersection(t) : t
  351. })
  352. },
  353. max: function(e, t, i) {
  354. return E(t) || (i = t,
  355. t = null),
  356. i = l(i),
  357. t ? (new g(this,i,e,!0).bind(t),
  358. this) : this.pushStack(new r(this,i).best(e, !0).el)
  359. },
  360. min: function(e, t, i) {
  361. return E(t) || (i = t,
  362. t = null),
  363. i = l(i),
  364. t ? (new g(this,i,e).bind(t),
  365. this) : this.pushStack(new r(this,i).best(e).el)
  366. },
  367. rect: function() {
  368. return this.length ? c.ofElement(this[0]) : null
  369. },
  370. scrollState: function(e, i) {
  371. var n = U + ".scrollState";
  372. return o(e, "string") || (i = e,
  373. e = null),
  374. "unbind" === e ? this.each(function() {
  375. var e = y(this).data(n);
  376. e && e.unbind(i)
  377. }) : "check" === e ? this.each(function() {
  378. var e = y(this).data(n);
  379. e && e.check()
  380. }) : E(i) ? this.each(function() {
  381. var e = y(this)
  382. , t = e.data(n);
  383. t || (t = new m(this),
  384. e.data(n, t)),
  385. t.bind(i)
  386. }) : this.length ? new d(this[0]) : null
  387. },
  388. scroll: function(e, t, i) {
  389. return this.each(function() {
  390. new p(this).scroll(e, t, i)
  391. })
  392. },
  393. scrollTo: function(e, t, i, n) {
  394. return y.isNumeric(e) && (n = i,
  395. i = t,
  396. t = e,
  397. e = null),
  398. e = l(e),
  399. this.each(function() {
  400. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  401. })
  402. },
  403. scrollToThis: function(e, t, i, n) {
  404. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  405. this
  406. },
  407. softLink: function(t, i, n, r) {
  408. return r = new p(l(r)),
  409. this.filter("a[href^=#]").each(function() {
  410. var e = y(this);
  411. e.on("click", function() {
  412. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  413. })
  414. })
  415. },
  416. sort: function(e, t, i) {
  417. return o(t, "boolean") || (i = t,
  418. t = null),
  419. i = l(i),
  420. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  421. return e.el
  422. }))
  423. },
  424. viewport: function(e) {
  425. return this.length ? c.ofViewport(this[0], e) : null
  426. }
  427. },
  428. defaultStatic: "fracs",
  429. defaultMethod: "fracs"
  430. },
  431. O = [].slice,
  432. L = jQuery,
  433. D = L.extend,
  434. N = L.isFunction,
  435. F = D({}, P),
  436. B = function() {
  437. return H(this, O.call(arguments), F.defaultStatic, B)
  438. }
  439. ,
  440. V = function(e) {
  441. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  442. }
  443. ,
  444. (k = function(e) {
  445. e && (D(B, e.statics),
  446. D(V, e.methods)),
  447. B.modplug = k
  448. }
  449. ).prev = {
  450. statics: L[R],
  451. methods: L.fn[R]
  452. },
  453. k(P),
  454. L[R] = B,
  455. L.fn[R] = V
  456. }(),
  457. "undefined" == typeof jQuery)
  458. throw new Error("Bootstrap's JavaScript requires jQuery");
  459. !function(m) {
  460. "use strict";
  461. function r(e, t) {
  462. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  463. this.init("tooltip", e, t)
  464. }
  465. r.VERSION = "3.2.0",
  466. r.DEFAULTS = {
  467. animation: !0,
  468. placement: "top",
  469. selector: !1,
  470. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  471. trigger: "hover focus",
  472. title: "",
  473. delay: 0,
  474. html: !1,
  475. container: !1,
  476. viewport: {
  477. selector: "body",
  478. padding: 0
  479. }
  480. },
  481. r.prototype.init = function(e, t, i) {
  482. this.enabled = !0,
  483. this.type = e,
  484. this.$element = m(t),
  485. this.options = this.getOptions(i),
  486. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  487. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  488. var o = n[r];
  489. if ("click" == o)
  490. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  491. else if ("manual" != o) {
  492. var a = "hover" == o ? "mouseenter" : "focusin"
  493. , s = "hover" == o ? "mouseleave" : "focusout";
  494. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  495. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  496. }
  497. }
  498. this.options.selector ? this._options = m.extend({}, this.options, {
  499. trigger: "manual",
  500. selector: ""
  501. }) : this.fixTitle()
  502. }
  503. ,
  504. r.prototype.getDefaults = function() {
  505. return r.DEFAULTS
  506. }
  507. ,
  508. r.prototype.getOptions = function(e) {
  509. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  510. show: e.delay,
  511. hide: e.delay
  512. }),
  513. e
  514. }
  515. ,
  516. r.prototype.getDelegateOptions = function() {
  517. var i = {}
  518. , n = this.getDefaults();
  519. return this._options && m.each(this._options, function(e, t) {
  520. n[e] != t && (i[e] = t)
  521. }),
  522. i
  523. }
  524. ,
  525. r.prototype.enter = 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 = "in",
  531. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  532. }
  533. ,
  534. r.prototype.leave = function(e) {
  535. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  536. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  537. m(e.currentTarget).data("bs." + this.type, t)),
  538. clearTimeout(t.timeout),
  539. t.hoverState = "out",
  540. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  541. "out" == t.hoverState && t.hide()
  542. }, t.options.delay.hide)) : t.hide()
  543. }
  544. ,
  545. r.prototype.show = function() {
  546. var e = m.Event("show.bs." + this.type);
  547. if (this.hasContent() && this.enabled) {
  548. this.$element.trigger(e);
  549. var t = m.contains(document.documentElement, this.$element[0]);
  550. if (e.isDefaultPrevented() || !t)
  551. return;
  552. var i = this
  553. , n = this.tip()
  554. , r = this.getUID(this.type);
  555. this.setContent(),
  556. n.attr("id", r),
  557. this.$element.attr("aria-describedby", r),
  558. this.options.animation && n.addClass("fade");
  559. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  560. , a = /\s?auto?\s?/i
  561. , s = a.test(o);
  562. s && (o = o.replace(a, "") || "top"),
  563. n.detach().css({
  564. top: 0,
  565. left: 0,
  566. display: "block"
  567. }).addClass(o).data("bs." + this.type, this),
  568. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  569. var l = this.getPosition()
  570. , c = n[0].offsetWidth
  571. , h = n[0].offsetHeight;
  572. if (s) {
  573. var u = o
  574. , d = this.$element.parent()
  575. , p = this.getPosition(d);
  576. 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,
  577. n.removeClass(u).addClass(o)
  578. }
  579. var f = this.getCalculatedOffset(o, l, c, h);
  580. this.applyPlacement(f, o);
  581. var g = function() {
  582. i.$element.trigger("shown.bs." + i.type),
  583. i.hoverState = null
  584. };
  585. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  586. }
  587. }
  588. ,
  589. r.prototype.applyPlacement = function(e, t) {
  590. var i = this.tip()
  591. , n = i[0].offsetWidth
  592. , r = i[0].offsetHeight
  593. , o = parseInt(i.css("margin-top"), 10)
  594. , a = parseInt(i.css("margin-left"), 10);
  595. isNaN(o) && (o = 0),
  596. isNaN(a) && (a = 0),
  597. e.top = e.top + o,
  598. e.left = e.left + a,
  599. m.offset.setOffset(i[0], m.extend({
  600. using: function(e) {
  601. i.css({
  602. top: Math.round(e.top),
  603. left: Math.round(e.left)
  604. })
  605. }
  606. }, e), 0),
  607. i.addClass("in");
  608. var s = i[0].offsetWidth
  609. , l = i[0].offsetHeight;
  610. "top" == t && l != r && (e.top = e.top + r - l);
  611. var c = this.getViewportAdjustedDelta(t, e, s, l);
  612. c.left ? e.left += c.left : e.top += c.top;
  613. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  614. , u = c.left ? "left" : "top"
  615. , d = c.left ? "offsetWidth" : "offsetHeight";
  616. i.offset(e),
  617. this.replaceArrow(h, i[0][d], u)
  618. }
  619. ,
  620. r.prototype.replaceArrow = function(e, t, i) {
  621. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  622. }
  623. ,
  624. r.prototype.setContent = function() {
  625. var e = this.tip()
  626. , t = this.getTitle();
  627. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  628. e.removeClass("fade in top bottom left right")
  629. }
  630. ,
  631. r.prototype.hide = function() {
  632. function e() {
  633. "in" != t.hoverState && i.detach(),
  634. t.$element.trigger("hidden.bs." + t.type)
  635. }
  636. var t = this
  637. , i = this.tip()
  638. , n = m.Event("hide.bs." + this.type);
  639. if (this.$element.removeAttr("aria-describedby"),
  640. this.$element.trigger(n),
  641. !n.isDefaultPrevented())
  642. return i.removeClass("in"),
  643. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  644. this.hoverState = null,
  645. this
  646. }
  647. ,
  648. r.prototype.fixTitle = function() {
  649. var e = this.$element;
  650. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  651. }
  652. ,
  653. r.prototype.hasContent = function() {
  654. return this.getTitle()
  655. }
  656. ,
  657. r.prototype.getPosition = function(e) {
  658. var t = (e = e || this.$element)[0]
  659. , i = "BODY" == t.tagName;
  660. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  661. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  662. width: i ? m(window).width() : e.outerWidth(),
  663. height: i ? m(window).height() : e.outerHeight()
  664. }, i ? {
  665. top: 0,
  666. left: 0
  667. } : e.offset())
  668. }
  669. ,
  670. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  671. return "bottom" == e ? {
  672. top: t.top + t.height,
  673. left: t.left + t.width / 2 - i / 2
  674. } : "top" == e ? {
  675. top: t.top - n,
  676. left: t.left + t.width / 2 - i / 2
  677. } : "left" == e ? {
  678. top: t.top + t.height / 2 - n / 2,
  679. left: t.left - i
  680. } : {
  681. top: t.top + t.height / 2 - n / 2,
  682. left: t.left + t.width
  683. }
  684. }
  685. ,
  686. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  687. var r = {
  688. top: 0,
  689. left: 0
  690. };
  691. if (!this.$viewport)
  692. return r;
  693. var o = this.options.viewport && this.options.viewport.padding || 0
  694. , a = this.getPosition(this.$viewport);
  695. if (/right|left/.test(e)) {
  696. var s = t.top - o - a.scroll
  697. , l = t.top + o - a.scroll + n;
  698. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  699. } else {
  700. var c = t.left - o
  701. , h = t.left + o + i;
  702. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  703. }
  704. return r
  705. }
  706. ,
  707. r.prototype.getTitle = function() {
  708. var e = this.$element
  709. , t = this.options;
  710. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  711. }
  712. ,
  713. r.prototype.getUID = function(e) {
  714. for (; e += ~~(1e6 * Math.random()),
  715. document.getElementById(e); )
  716. ;
  717. return e
  718. }
  719. ,
  720. r.prototype.tip = function() {
  721. return this.$tip = this.$tip || m(this.options.template)
  722. }
  723. ,
  724. r.prototype.arrow = function() {
  725. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  726. }
  727. ,
  728. r.prototype.validate = function() {
  729. this.$element[0].parentNode || (this.hide(),
  730. this.$element = null,
  731. this.options = null)
  732. }
  733. ,
  734. r.prototype.enable = function() {
  735. this.enabled = !0
  736. }
  737. ,
  738. r.prototype.disable = function() {
  739. this.enabled = !1
  740. }
  741. ,
  742. r.prototype.toggleEnabled = function() {
  743. this.enabled = !this.enabled
  744. }
  745. ,
  746. r.prototype.toggle = function(e) {
  747. var t = this;
  748. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  749. m(e.currentTarget).data("bs." + this.type, t))),
  750. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  751. }
  752. ,
  753. r.prototype.destroy = function() {
  754. clearTimeout(this.timeout),
  755. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  756. }
  757. ;
  758. var e = m.fn.tooltip;
  759. m.fn.tooltip = function(n) {
  760. return this.each(function() {
  761. var e = m(this)
  762. , t = e.data("bs.tooltip")
  763. , i = "object" == typeof n && n;
  764. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  765. "string" == typeof n && t[n]())
  766. })
  767. }
  768. ,
  769. m.fn.tooltip.Constructor = r,
  770. m.fn.tooltip.noConflict = function() {
  771. return m.fn.tooltip = e,
  772. this
  773. }
  774. }(jQuery),
  775. function(e, t, i) {
  776. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  777. }(0, this, function() {
  778. "use strict";
  779. function Keen() {
  780. return _init.apply(this, arguments)
  781. }
  782. function _init(e) {
  783. if (_isUndefined(e))
  784. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  785. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  786. throw new Error("Please provide a projectId");
  787. this.configure(e)
  788. }
  789. function _extend(e) {
  790. for (var t = 1; t < arguments.length; t++)
  791. for (var i in arguments[t])
  792. e[i] = arguments[t][i];
  793. return e
  794. }
  795. function _isUndefined(e) {
  796. return void 0 === e
  797. }
  798. function _type(e) {
  799. var t = e && e.constructor ? e.constructor.toString() : void 0;
  800. return t ? t.match(/function (.*)\(/)[1] : "Null"
  801. }
  802. function _each(e, t, i) {
  803. var n;
  804. if (!e)
  805. return 0;
  806. if (i = i || e,
  807. "array" === _type(e)) {
  808. for (n = 0; n < e.length; n++)
  809. if (!1 === t.call(i, e[n], n, e))
  810. return 0
  811. } else
  812. for (n in e)
  813. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  814. return 0;
  815. return 1
  816. }
  817. function _parse_params(e) {
  818. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  819. return decodeURIComponent(e.replace(n, " "))
  820. }, a = e.split("?")[1]; t = r.exec(a); )
  821. i[o(t[1])] = o(t[2]);
  822. return i
  823. }
  824. function _set_protocol(e) {
  825. switch (e) {
  826. case "http":
  827. return "http";
  828. case "auto":
  829. return location.protocol.replace(/:/g, "");
  830. case "https":
  831. case void 0:
  832. default:
  833. return "https"
  834. }
  835. }
  836. function _set_request_type(e) {
  837. var t = e || "jsonp"
  838. , i = !1;
  839. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  840. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  841. }
  842. function _build_url(e) {
  843. return this.client.endpoint + "/projects/" + this.client.projectId + e
  844. }
  845. function _uploadEvent(e, t, i, n, r) {
  846. var o = _build_url.apply(this, ["/events/" + e])
  847. , a = {};
  848. for (var s in i = !1 !== i,
  849. this.client.globalProperties && (a = this.client.globalProperties(e)),
  850. t)
  851. t.hasOwnProperty(s) && (a[s] = t[s]);
  852. switch (this.client.requestType) {
  853. case "xhr":
  854. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  855. break;
  856. case "jsonp":
  857. var l = JSON.stringify(a)
  858. , c = Keen.Base64.encode(l);
  859. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  860. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  861. break;
  862. case "beacon":
  863. l = JSON.stringify(a),
  864. c = Keen.Base64.encode(l);
  865. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  866. o += "&c=clv1",
  867. _request.beacon.apply(this, [o, null, n, r])
  868. }
  869. }
  870. Keen.prototype.configure = function(e) {
  871. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  872. e.protocol = _set_protocol(e.protocol),
  873. e.requestType = _set_request_type(e.requestType),
  874. this.client = {
  875. projectId: e.projectId,
  876. writeKey: e.writeKey,
  877. readKey: e.readKey,
  878. globalProperties: null,
  879. endpoint: e.protocol + "://" + e.host,
  880. requestType: e.requestType
  881. },
  882. Keen.trigger("client", this, e),
  883. this.trigger("ready"),
  884. this
  885. }
  886. ;
  887. var _request = {
  888. xhr: function(e, t, i, n, r, o, a, s) {
  889. if (!r)
  890. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  891. var l = new XMLHttpRequest;
  892. if (l.onreadystatechange = function() {
  893. if (4 == l.readyState)
  894. if (200 <= l.status && l.status < 300) {
  895. var e;
  896. try {
  897. e = JSON.parse(l.responseText)
  898. } catch (e) {
  899. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  900. s && s(l, e)
  901. }
  902. a && e && a(e)
  903. } else
  904. Keen.log("HTTP request failed."),
  905. s && s(l, null)
  906. }
  907. ,
  908. l.open(e, t, o),
  909. r && l.setRequestHeader("Authorization", r),
  910. n && l.setRequestHeader("Content-Type", "application/json"),
  911. i)
  912. for (var c in i)
  913. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  914. var h = n ? JSON.stringify(n) : null;
  915. l.send(h)
  916. },
  917. jsonp: function(e, t, i, n) {
  918. if (!t)
  919. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  920. if (t && e.indexOf("api_key") < 0) {
  921. var r = 0 < e.indexOf("?") ? "&" : "?";
  922. e = e + r + "api_key=" + t
  923. }
  924. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  925. o += "a";
  926. var a = !1;
  927. window[o] = function(e) {
  928. a = !0,
  929. i && e && i(e),
  930. window[o] = void 0
  931. }
  932. ,
  933. e = e + "&jsonp=" + o;
  934. var s = document.createElement("script");
  935. s.id = "keen-jsonp",
  936. s.src = e,
  937. document.getElementsByTagName("head")[0].appendChild(s),
  938. s.onreadystatechange = function() {
  939. !1 === a && "loaded" === this.readyState && (a = !0,
  940. n && n())
  941. }
  942. ,
  943. s.onerror = function() {
  944. !1 === a && (a = !0,
  945. n && n())
  946. }
  947. },
  948. beacon: function(e, t, i, n) {
  949. if (t && e.indexOf("api_key") < 0) {
  950. var r = 0 < e.indexOf("?") ? "&" : "?";
  951. e = e + r + "api_key=" + t
  952. }
  953. var o = document.createElement("img");
  954. o.onload = function() {
  955. if (!0,
  956. "naturalHeight"in this) {
  957. if (this.naturalHeight + this.naturalWidth === 0)
  958. return void this.onerror()
  959. } else if (this.width + this.height === 0)
  960. return void this.onerror();
  961. i && i({
  962. created: !0
  963. })
  964. }
  965. ,
  966. o.onerror = function() {
  967. !0,
  968. n && n()
  969. }
  970. ,
  971. o.src = e
  972. }
  973. }
  974. , Events = Keen.Events = {
  975. on: function(e, t) {
  976. return this.listeners || (this.listeners = {}),
  977. (this.listeners[e] || (this.listeners[e] = [])).push({
  978. callback: t
  979. }),
  980. this
  981. },
  982. off: function(e, t) {
  983. if (!e && !t)
  984. return this.listeners = void 0,
  985. delete this.listeners,
  986. this;
  987. for (var i = this.listeners[e] || [], n = i.length; n--; )
  988. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  989. t && 0 != i.length || (this.listeners[e] = void 0,
  990. delete this.listeners[e]);
  991. return this
  992. },
  993. trigger: function(e) {
  994. if (!this.listeners)
  995. return this;
  996. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  997. i[n].callback.apply(this, t);
  998. return this
  999. }
  1000. };
  1001. _extend(Keen.prototype, Events),
  1002. _extend(Keen, Events),
  1003. Keen.loaded = !0,
  1004. Keen.utils = {
  1005. each: _each,
  1006. extend: _extend,
  1007. parseParams: _parse_params
  1008. },
  1009. Keen.ready = function(e) {
  1010. Keen.loaded ? e() : Keen.on("ready", e)
  1011. }
  1012. ,
  1013. Keen.log = function(e) {
  1014. "object" == typeof console && console.log("[Keen IO]", e)
  1015. }
  1016. ;
  1017. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1018. Keen.prototype.addEvent = function() {
  1019. _uploadEvent.apply(this, arguments)
  1020. }
  1021. ,
  1022. Keen.prototype.addEventSync = function(e, t, i, n) {
  1023. _uploadEvent.apply(this, [e, t, !1, i, n])
  1024. }
  1025. ,
  1026. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1027. var o = e
  1028. , a = o.metaKey
  1029. , s = o.target
  1030. , l = !1
  1031. , c = function() {};
  1032. return void 0 === n && (n = 500),
  1033. "A" === s.nodeName ? c = function() {
  1034. a || l || (l = !0,
  1035. window.location = s.href)
  1036. }
  1037. : "FORM" === s.nodeName && (c = function() {
  1038. l || (l = !0,
  1039. s.submit())
  1040. }
  1041. ),
  1042. r && (c = function() {
  1043. l || (l = !0,
  1044. r())
  1045. }
  1046. ),
  1047. _uploadEvent.call(this, t, i, c, c),
  1048. setTimeout(function() {
  1049. c()
  1050. }, n),
  1051. !!a && void 0
  1052. }
  1053. ,
  1054. Keen.prototype.setGlobalProperties = function(e) {
  1055. if (!this.client)
  1056. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1057. if (!e || "function" != typeof e)
  1058. throw new Error("Invalid value for global properties: " + e);
  1059. this.client.globalProperties = e
  1060. }
  1061. ,
  1062. Keen.Base64 = {
  1063. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1064. encode: function(e) {
  1065. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1066. for (e = this.utf8.encode(e); c < e.length; )
  1067. t = e.charCodeAt(c++),
  1068. i = e.charCodeAt(c++),
  1069. n = e.charCodeAt(c++),
  1070. r = t >> 2,
  1071. o = (3 & t) << 4 | i >> 4,
  1072. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1073. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1074. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1075. return l
  1076. },
  1077. decode: function(e) {
  1078. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1079. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1080. t = c.indexOf(e.charAt(l++)),
  1081. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1082. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1083. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1084. return this.utf8.decode(s)
  1085. },
  1086. utf8: {
  1087. encode: function(e) {
  1088. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1089. 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);
  1090. return i
  1091. },
  1092. decode: function(e) {
  1093. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1094. 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];
  1095. return i
  1096. }
  1097. }
  1098. },
  1099. "object" != typeof JSON && (JSON = {}),
  1100. function() {
  1101. function f(e) {
  1102. return e < 10 ? "0" + e : e
  1103. }
  1104. function quote(e) {
  1105. return escapable.lastIndex = 0,
  1106. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1107. var t = meta[e];
  1108. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1109. }) + '"' : '"' + e + '"'
  1110. }
  1111. function str(e, t) {
  1112. var i, n, r, o, a, s = gap, l = t[e];
  1113. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1114. "function" == typeof rep && (l = rep.call(t, e, l)),
  1115. typeof l) {
  1116. case "string":
  1117. return quote(l);
  1118. case "number":
  1119. return isFinite(l) ? String(l) : "null";
  1120. case "boolean":
  1121. case "null":
  1122. return String(l);
  1123. case "object":
  1124. if (!l)
  1125. return "null";
  1126. if (gap += indent,
  1127. a = [],
  1128. "[object Array]" === Object.prototype.toString.apply(l)) {
  1129. for (o = l.length,
  1130. i = 0; i < o; i += 1)
  1131. a[i] = str(i, l) || "null";
  1132. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1133. gap = s,
  1134. r
  1135. }
  1136. if (rep && "object" == typeof rep)
  1137. for (o = rep.length,
  1138. i = 0; i < o; i += 1)
  1139. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1140. else
  1141. for (n in l)
  1142. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1143. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1144. gap = s,
  1145. r
  1146. }
  1147. }
  1148. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1149. 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
  1150. }
  1151. ,
  1152. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1153. return this.valueOf()
  1154. }
  1155. );
  1156. 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 = {
  1157. "\b": "\\b",
  1158. "\t": "\\t",
  1159. "\n": "\\n",
  1160. "\f": "\\f",
  1161. "\r": "\\r",
  1162. '"': '\\"',
  1163. "\\": "\\\\"
  1164. }, rep;
  1165. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1166. var n;
  1167. if (indent = gap = "",
  1168. "number" == typeof i)
  1169. for (n = 0; n < i; n += 1)
  1170. indent += " ";
  1171. else
  1172. "string" == typeof i && (indent = i);
  1173. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1174. throw new Error("JSON.stringify");
  1175. return str("", {
  1176. "": e
  1177. })
  1178. }
  1179. ),
  1180. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1181. function walk(e, t) {
  1182. var i, n, r = e[t];
  1183. if (r && "object" == typeof r)
  1184. for (i in r)
  1185. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1186. return reviver.call(e, t, r)
  1187. }
  1188. var j;
  1189. if (text = String(text),
  1190. cx.lastIndex = 0,
  1191. cx.test(text) && (text = text.replace(cx, function(e) {
  1192. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1193. })),
  1194. /^[\],:{}\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, "")))
  1195. return j = eval("(" + text + ")"),
  1196. "function" == typeof reviver ? walk({
  1197. "": j
  1198. }, "") : j;
  1199. throw new SyntaxError("JSON.parse")
  1200. }
  1201. )
  1202. }(),
  1203. Hh = Keen.utils,
  1204. Ih = function(i) {
  1205. function e(e) {
  1206. for (u = 1; e = n.shift(); )
  1207. e()
  1208. }
  1209. 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]);
  1210. return r[l] && r[l](s, t = function() {
  1211. r.removeEventListener(s, t, !1),
  1212. e()
  1213. }
  1214. , !1),
  1215. a && r.attachEvent(c, t = function() {
  1216. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1217. e())
  1218. }
  1219. ),
  1220. i = a ? function(t) {
  1221. self != top ? u ? t() : n.push(t) : function() {
  1222. try {
  1223. o.doScroll("left")
  1224. } catch (e) {
  1225. return setTimeout(function() {
  1226. i(t)
  1227. }, 50)
  1228. }
  1229. t()
  1230. }()
  1231. }
  1232. : function(e) {
  1233. u ? e() : n.push(e)
  1234. }
  1235. }
  1236. ,
  1237. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1238. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1239. if (loaded && cached) {
  1240. for (var instance in clients = cached.clients || {},
  1241. ready = cached.ready || [],
  1242. clients)
  1243. if (clients.hasOwnProperty(instance)) {
  1244. var client = clients[instance];
  1245. for (var method in Keen.prototype)
  1246. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1247. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1248. ,
  1249. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1250. ,
  1251. client._config && (client.configure.call(client, client._config),
  1252. delete client._config),
  1253. client._setGlobalProperties) {
  1254. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1255. client.setGlobalProperties.apply(client, globals[i]);
  1256. delete client._setGlobalProperties
  1257. }
  1258. if (client._addEvent) {
  1259. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1260. client.addEvent.apply(client, queue[i]);
  1261. delete client._addEvent
  1262. }
  1263. var callback = client._on || [];
  1264. if (client._on) {
  1265. for (var i = 0; i < callback.length; i++)
  1266. client.on.apply(client, callback[i]);
  1267. client.trigger("ready"),
  1268. delete client._on
  1269. }
  1270. }
  1271. for (var i = 0; i < ready.length; i++) {
  1272. var callback = ready[i];
  1273. Keen.on("ready", function() {
  1274. callback()
  1275. })
  1276. }
  1277. }
  1278. return Keen.loaded && setTimeout(function() {
  1279. Keen.utils.domready(function() {
  1280. Keen.trigger("ready")
  1281. })
  1282. }, 0),
  1283. Keen
  1284. }),
  1285. function() {
  1286. var i = window.analytics = window.analytics || [];
  1287. if (!i.initialize) {
  1288. if (i.invoked)
  1289. return window.console && console.error && console.error("Segment snippet included twice.");
  1290. i.invoked = !0,
  1291. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1292. i.factory = function(t) {
  1293. return function() {
  1294. var e = Array.prototype.slice.call(arguments);
  1295. return e.unshift(t),
  1296. i.push(e),
  1297. i
  1298. }
  1299. }
  1300. ;
  1301. for (var e = 0; e < i.methods.length; e++) {
  1302. var t = i.methods[e];
  1303. i[t] = i.factory(t)
  1304. }
  1305. i.load = function(e) {
  1306. var t = document.createElement("script");
  1307. t.type = "text/javascript",
  1308. t.async = !0,
  1309. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1310. var i = document.getElementsByTagName("script")[0];
  1311. i.parentNode.insertBefore(t, i)
  1312. }
  1313. ,
  1314. i.SNIPPET_VERSION = "4.0.0"
  1315. }
  1316. }(),
  1317. function(i, u) {
  1318. "use strict";
  1319. var d = "function"
  1320. , p = "undefined"
  1321. , f = "object"
  1322. , e = "major"
  1323. , t = "model"
  1324. , n = "name"
  1325. , r = "type"
  1326. , o = "vendor"
  1327. , a = "version"
  1328. , s = "architecture"
  1329. , l = "console"
  1330. , c = "mobile"
  1331. , h = "tablet"
  1332. , g = {
  1333. has: function(e, t) {
  1334. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1335. },
  1336. lowerize: function(e) {
  1337. return e.toLowerCase()
  1338. }
  1339. }
  1340. , m = {
  1341. rgx: function() {
  1342. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1343. var c = l[s]
  1344. , h = l[s + 1];
  1345. if (typeof e == p)
  1346. for (n in e = {},
  1347. h)
  1348. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1349. for (t = i = 0; t < c.length; t++)
  1350. if (o = c[t].exec(this.getUA())) {
  1351. for (n = 0; n < h.length; n++)
  1352. a = o[++i],
  1353. 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;
  1354. break
  1355. }
  1356. if (o)
  1357. break
  1358. }
  1359. return e
  1360. },
  1361. str: function(e, t) {
  1362. for (var i in t)
  1363. if (typeof t[i] == f && 0 < t[i].length) {
  1364. for (var n = 0; n < t[i].length; n++)
  1365. if (g.has(t[i][n], e))
  1366. return "?" === i ? u : i
  1367. } else if (g.has(t[i], e))
  1368. return "?" === i ? u : i;
  1369. return e
  1370. }
  1371. }
  1372. , v = {
  1373. browser: {
  1374. oldsafari: {
  1375. major: {
  1376. 1: ["/8", "/1", "/3"],
  1377. 2: "/4",
  1378. "?": "/"
  1379. },
  1380. version: {
  1381. "1.0": "/8",
  1382. 1.2: "/1",
  1383. 1.3: "/3",
  1384. "2.0": "/412",
  1385. "2.0.2": "/416",
  1386. "2.0.3": "/417",
  1387. "2.0.4": "/419",
  1388. "?": "/"
  1389. }
  1390. }
  1391. },
  1392. device: {
  1393. sprint: {
  1394. model: {
  1395. "Evo Shift 4G": "7373KT"
  1396. },
  1397. vendor: {
  1398. HTC: "APA",
  1399. Sprint: "Sprint"
  1400. }
  1401. }
  1402. },
  1403. os: {
  1404. windows: {
  1405. version: {
  1406. ME: "4.90",
  1407. "NT 3.11": "NT3.51",
  1408. "NT 4.0": "NT4.0",
  1409. 2e3: "NT 5.0",
  1410. XP: ["NT 5.1", "NT 5.2"],
  1411. Vista: "NT 6.0",
  1412. 7: "NT 6.1",
  1413. 8: "NT 6.2",
  1414. 8.1: "NT 6.3",
  1415. RT: "ARM"
  1416. }
  1417. }
  1418. }
  1419. }
  1420. , y = {
  1421. 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]],
  1422. 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]],
  1423. 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]],
  1424. 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]],
  1425. 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]]
  1426. }
  1427. , A = function(e) {
  1428. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1429. return this instanceof A ? (this.getBrowser = function() {
  1430. return m.rgx.apply(this, y.browser)
  1431. }
  1432. ,
  1433. this.getCPU = function() {
  1434. return m.rgx.apply(this, y.cpu)
  1435. }
  1436. ,
  1437. this.getDevice = function() {
  1438. return m.rgx.apply(this, y.device)
  1439. }
  1440. ,
  1441. this.getEngine = function() {
  1442. return m.rgx.apply(this, y.engine)
  1443. }
  1444. ,
  1445. this.getOS = function() {
  1446. return m.rgx.apply(this, y.os)
  1447. }
  1448. ,
  1449. this.getResult = function() {
  1450. return {
  1451. ua: this.getUA(),
  1452. browser: this.getBrowser(),
  1453. engine: this.getEngine(),
  1454. os: this.getOS(),
  1455. device: this.getDevice(),
  1456. cpu: this.getCPU()
  1457. }
  1458. }
  1459. ,
  1460. this.getUA = function() {
  1461. return t
  1462. }
  1463. ,
  1464. this.setUA = function(e) {
  1465. return t = e,
  1466. this
  1467. }
  1468. ,
  1469. void this.setUA(t)) : new A(e).getResult()
  1470. };
  1471. if (typeof exports != p)
  1472. typeof module != p && module.exports && (exports = module.exports = A),
  1473. exports.UAParser = A;
  1474. else if (i.UAParser = A,
  1475. typeof define == d && define.amd && define(function() {
  1476. return A
  1477. }),
  1478. typeof i.jQuery != p) {
  1479. var C = i.jQuery
  1480. , I = new A;
  1481. C.ua = I.getResult(),
  1482. C.ua.get = function() {
  1483. return I.getUA()
  1484. }
  1485. ,
  1486. C.ua.set = function(e) {
  1487. I.setUA(e);
  1488. var t = I.getResult();
  1489. for (var i in t)
  1490. C.ua[i] = t[i]
  1491. }
  1492. }
  1493. }(this),
  1494. window.Modernizr = function(e, t) {
  1495. function i(e, t) {
  1496. return typeof e === t
  1497. }
  1498. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1499. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1500. return t in e && i(e.constructor.prototype[t], "undefined")
  1501. }
  1502. : function(e, t) {
  1503. return p.call(e, t)
  1504. }
  1505. ,
  1506. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1507. var r = this;
  1508. if ("function" != typeof r)
  1509. throw new TypeError;
  1510. var o = d.call(arguments, 1)
  1511. , a = function() {
  1512. if (this instanceof a) {
  1513. function e() {}
  1514. e.prototype = r.prototype;
  1515. var t = new e
  1516. , i = r.apply(t, o.concat(d.call(arguments)));
  1517. return Object(i) === i ? i : t
  1518. }
  1519. return r.apply(n, o.concat(d.call(arguments)))
  1520. };
  1521. return a
  1522. }
  1523. ),
  1524. h.webgl = function() {
  1525. return !!e.WebGLRenderingContext
  1526. }
  1527. ,
  1528. h)
  1529. r(h, f) && (n = f.toLowerCase(),
  1530. a[n] = h[f](),
  1531. u.push((a[n] ? "" : "no-") + n));
  1532. return a.addTest = function(e, t) {
  1533. if ("object" == typeof e)
  1534. for (var i in e)
  1535. r(e, i) && a.addTest(i, e[i]);
  1536. else {
  1537. if (e = e.toLowerCase(),
  1538. void 0 !== a[e])
  1539. return a;
  1540. t = "function" == typeof t ? t() : t,
  1541. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1542. a[e] = t
  1543. }
  1544. return a
  1545. }
  1546. ,
  1547. o = "",
  1548. c.cssText = o,
  1549. l = null,
  1550. a._version = "2.8.2",
  1551. a
  1552. }(this, this.document),
  1553. function(xe, e, Se) {
  1554. "use strict";
  1555. function Me(s, e, n) {
  1556. function a(e) {
  1557. var t = Q.length;
  1558. if (G.old = xe.extend({}, G),
  1559. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1560. Y = W[F.horizontal ? "width" : "height"](),
  1561. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1562. Q.length = 0,
  1563. G.start = 0,
  1564. G.end = nt(z - H, 0),
  1565. le) {
  1566. $.length,
  1567. J = U.children(F.itemSelector),
  1568. $.length = 0;
  1569. 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;
  1570. z = 0,
  1571. J.each(function(e, t) {
  1572. var i = xe(t)
  1573. , n = t.getBoundingClientRect()
  1574. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1575. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1576. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1577. , s = r + o + a
  1578. , l = !o || !a
  1579. , c = {};
  1580. c.el = t,
  1581. c.size = l ? r : s,
  1582. c.half = c.size / 2,
  1583. c.start = z + (l ? o : 0),
  1584. c.center = c.start - it(H / 2 - c.size / 2),
  1585. c.end = c.start - H + c.size,
  1586. e || (z += u),
  1587. z += s,
  1588. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1589. e === g && (c.end += d,
  1590. z += d,
  1591. f = l ? a : 0),
  1592. $.push(c),
  1593. h = c
  1594. }),
  1595. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1596. z -= f,
  1597. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1598. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1599. }
  1600. if (G.center = it(G.end / 2 + G.start / 2),
  1601. v(),
  1602. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1603. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1604. X.end = Y - q,
  1605. _e || c()),
  1606. !V && 0 < H) {
  1607. var n = G.start
  1608. , r = "";
  1609. if (le)
  1610. xe.each($, function(e, t) {
  1611. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1612. Q.push(n),
  1613. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1614. });
  1615. else
  1616. for (; n - H < G.end; )
  1617. Q.push(n),
  1618. n += H;
  1619. if (Z[0] && t !== Q.length) {
  1620. for (var o = 0; o < Q.length; o++)
  1621. r += F.pageBuilder.call(B, o);
  1622. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1623. }
  1624. }
  1625. if (ee.slideeSize = z,
  1626. ee.frameSize = H,
  1627. ee.sbSize = Y,
  1628. ee.handleSize = q,
  1629. le) {
  1630. e && null != F.startAt && (m(F.startAt),
  1631. B[se ? "toCenter" : "toStart"](F.startAt));
  1632. var a = $[ee.activeItem];
  1633. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1634. } else
  1635. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1636. L("load")
  1637. }
  1638. function l(e, t, i) {
  1639. if (le && Ie.released && !i) {
  1640. var n = d(e)
  1641. , r = e > G.start && e < G.end;
  1642. se ? (r && (e = $[n.centerItem].center),
  1643. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1644. }
  1645. 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),
  1646. Ae.start = +new Date,
  1647. Ae.time = 0,
  1648. Ae.from = G.cur,
  1649. Ae.to = e,
  1650. Ae.delta = e - G.cur,
  1651. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1652. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1653. Ie.tweese = 0,
  1654. e !== G.dest && (G.dest = e,
  1655. L("change"),
  1656. _e || o()),
  1657. g(),
  1658. v(),
  1659. p(),
  1660. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1661. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1662. L("activePage", ye.page))
  1663. }
  1664. function o() {
  1665. if (B.initialized) {
  1666. if (!_e)
  1667. return _e = Ge(o),
  1668. void (Ie.released && L("moveStart"));
  1669. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1670. $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),
  1671. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1672. Ae.to === G.cur ? (G.cur = Ae.to,
  1673. Ie.tweese = _e = 0) : _e = Ge(o),
  1674. L("move"),
  1675. 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"),
  1676. !_e && Ie.released && L("moveEnd"),
  1677. c()
  1678. }
  1679. }
  1680. function c() {
  1681. 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,
  1682. X.cur = Fe(it(X.cur), X.start, X.end),
  1683. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1684. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1685. }
  1686. function t() {
  1687. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1688. Te = Ie.init ? Ge(t) : 0,
  1689. Ce.now = +new Date,
  1690. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1691. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1692. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1693. Ce.lastTime = Ce.now
  1694. }
  1695. function i(e, t, i) {
  1696. if ("boolean" === Re(t) && (i = t,
  1697. t = Se),
  1698. t === Se)
  1699. l(G[e], i);
  1700. else {
  1701. if (se && "center" !== e)
  1702. return;
  1703. var n = B.getPos(t);
  1704. n && l(n[e], i, !se)
  1705. }
  1706. }
  1707. function h(e) {
  1708. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1709. }
  1710. function u(e) {
  1711. return h(De(e) && e < 0 ? e + $.length : e)
  1712. }
  1713. function m(e, t) {
  1714. var i = h(e);
  1715. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1716. J.eq(i).addClass(F.activeClass),
  1717. ye.active = ee.activeItem = i,
  1718. p(),
  1719. L("active", i)),
  1720. i)
  1721. }
  1722. function d(e) {
  1723. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1724. var t = {}
  1725. , i = ae ? 0 : H / 2;
  1726. if (!V)
  1727. for (var n = 0, r = Q.length; n < r; n++) {
  1728. if (e >= G.end || n === Q.length - 1) {
  1729. t.activePage = Q.length - 1;
  1730. break
  1731. }
  1732. if (e <= Q[n] + i) {
  1733. t.activePage = n;
  1734. break
  1735. }
  1736. }
  1737. if (le) {
  1738. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1739. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1740. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1741. l === c - 1 || e <= $[l].end + $[l].half) {
  1742. a = l;
  1743. break
  1744. }
  1745. t.firstItem = De(o) ? o : 0,
  1746. t.centerItem = De(s) ? s : t.firstItem,
  1747. t.lastItem = De(a) ? a : t.centerItem
  1748. }
  1749. return t
  1750. }
  1751. function v(e) {
  1752. xe.extend(ee, d(e))
  1753. }
  1754. function p() {
  1755. var e = G.dest <= G.start
  1756. , t = G.dest >= G.end
  1757. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1758. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1759. ge.is("button,input") && ge.prop("disabled", e),
  1760. me.is("button,input") && me.prop("disabled", t),
  1761. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1762. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1763. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1764. de.is("button,input") && de.prop("disabled", e),
  1765. ue.is("button,input") && ue.prop("disabled", t)),
  1766. le && null != ee.activeItem) {
  1767. var n = 0 === ee.activeItem
  1768. , r = ee.activeItem >= $.length - 1
  1769. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1770. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1771. pe.is("button,input") && pe.prop("disabled", n),
  1772. fe.is("button,input") && fe.prop("disabled", r),
  1773. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1774. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1775. }
  1776. }
  1777. function r(e, t, i) {
  1778. if (e = u(e),
  1779. t = u(t),
  1780. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1781. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1782. var n = e < t ? e : i ? t : t - 1
  1783. , r = t < e ? e : i ? t + 1 : t
  1784. , o = t < e;
  1785. 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)),
  1786. a()
  1787. }
  1788. }
  1789. function f(e, t) {
  1790. for (var i = 0, n = ve[e].length; i < n; i++)
  1791. if (ve[e][i] === t)
  1792. return i;
  1793. return -1
  1794. }
  1795. function g() {
  1796. Ie.released && !B.isPaused && B.resume()
  1797. }
  1798. function y(e) {
  1799. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1800. }
  1801. function A() {
  1802. Ie.history[0] = Ie.history[1],
  1803. Ie.history[1] = Ie.history[2],
  1804. Ie.history[2] = Ie.history[3],
  1805. Ie.history[3] = Ie.delta
  1806. }
  1807. function C(e) {
  1808. Ie.released = 0,
  1809. Ie.source = e,
  1810. Ie.slidee = "slidee" === e
  1811. }
  1812. function I(e) {
  1813. var t = "touchstart" === e.type
  1814. , i = e.data.source
  1815. , n = "slidee" === i;
  1816. 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),
  1817. C(i),
  1818. Ie.init = 0,
  1819. Ie.$source = xe(e.target),
  1820. Ie.touch = t,
  1821. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1822. Ie.initX = Ie.pointer.pageX,
  1823. Ie.initY = Ie.pointer.pageY,
  1824. Ie.initPos = n ? G.cur : X.cur,
  1825. Ie.start = +new Date,
  1826. Ie.time = 0,
  1827. Ie.path = 0,
  1828. Ie.delta = 0,
  1829. Ie.locked = 0,
  1830. Ie.history = [0, 0, 0, 0],
  1831. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1832. We.on(t ? qe : Ye, E),
  1833. B.pause(1),
  1834. (n ? U : j).addClass(F.draggedClass),
  1835. L("moveStart"),
  1836. n && (be = setInterval(A, 10)))
  1837. }
  1838. function E(e) {
  1839. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1840. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1841. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1842. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1843. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1844. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1845. Ie.released || !(Ie.path < 1)) {
  1846. if (!Ie.init) {
  1847. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1848. return _();
  1849. Ie.init = 1
  1850. }
  1851. Pe(e),
  1852. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1853. Ie.$source.on(Ze, Oe)),
  1854. Ie.released && (_(),
  1855. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1856. Ie.delta += Ie.swing,
  1857. Ie.tweese = 10 < $e(Ie.swing))),
  1858. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1859. }
  1860. }
  1861. function _() {
  1862. clearInterval(be),
  1863. Ie.released = !0,
  1864. We.off(Ie.touch ? qe : Ye, E),
  1865. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1866. setTimeout(function() {
  1867. Ie.$source.off(Ze, Oe)
  1868. }),
  1869. G.cur === G.dest && Ie.init && L("moveEnd"),
  1870. B.resume(1),
  1871. Ie.init = 0
  1872. }
  1873. function b(e) {
  1874. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1875. }
  1876. function w() {
  1877. B.stop(),
  1878. We.off("mouseup", w)
  1879. }
  1880. function T(e) {
  1881. switch (Pe(e),
  1882. this) {
  1883. case ue[0]:
  1884. case de[0]:
  1885. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1886. We.on("mouseup", w);
  1887. break;
  1888. case pe[0]:
  1889. B.prev();
  1890. break;
  1891. case fe[0]:
  1892. B.next();
  1893. break;
  1894. case ge[0]:
  1895. B.prevPage();
  1896. break;
  1897. case me[0]:
  1898. B.nextPage()
  1899. }
  1900. }
  1901. function x(e) {
  1902. e.originalEvent[He] = B;
  1903. var t = +new Date;
  1904. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1905. ot = t;
  1906. else if (F.scrollBy && G.start !== G.end) {
  1907. var i = function(e) {
  1908. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1909. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1910. le ? (Ue = +new Date,
  1911. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1912. Ee.last = Ue,
  1913. Ee.delta += Ee.curDelta,
  1914. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1915. Ee.delta %= 1),
  1916. Ee.finalDelta) : Ee.curDelta
  1917. }(e.originalEvent);
  1918. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1919. B.slideBy(F.scrollBy * i)
  1920. }
  1921. }
  1922. function S(e) {
  1923. F.clickBar && e.target === W[0] && (Pe(e),
  1924. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1925. }
  1926. function M(e) {
  1927. if (F.keyboardNavBy)
  1928. switch (e.which) {
  1929. case F.horizontal ? 37 : 38:
  1930. Pe(e),
  1931. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1932. break;
  1933. case F.horizontal ? 39 : 40:
  1934. Pe(e),
  1935. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1936. }
  1937. }
  1938. function R(e) {
  1939. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1940. }
  1941. function P() {
  1942. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1943. }
  1944. function O(e) {
  1945. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1946. }
  1947. function L(e, t) {
  1948. if (ve[e]) {
  1949. for (N = ve[e].length,
  1950. Je.length = 0,
  1951. D = 0; D < N; D++)
  1952. Je.push(ve[e][D]);
  1953. for (D = 0; D < N; D++)
  1954. Je[D].call(B, e, t)
  1955. }
  1956. }
  1957. 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 = {
  1958. start: 0,
  1959. center: 0,
  1960. end: 0,
  1961. cur: 0,
  1962. dest: 0
  1963. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1964. start: 0,
  1965. end: 0,
  1966. cur: 0
  1967. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1968. firstItem: 0,
  1969. lastItem: 0,
  1970. centerItem: 0,
  1971. activeItem: null,
  1972. activePage: 0
  1973. }, 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 = {
  1974. released: 1
  1975. }, Ee = {
  1976. last: 0,
  1977. delta: 0,
  1978. resetTime: 200
  1979. }, _e = 0, be = 0, we = 0, Te = 0;
  1980. V || (s = k[0]),
  1981. B.initialized = 0,
  1982. B.frame = s,
  1983. B.slidee = U[0],
  1984. B.pos = G,
  1985. B.rel = ee,
  1986. B.items = $,
  1987. B.pages = Q,
  1988. B.isPaused = 0,
  1989. B.options = F,
  1990. B.dragging = Ie,
  1991. B.reload = function() {
  1992. a()
  1993. }
  1994. ,
  1995. B.getPos = function(e) {
  1996. if (le) {
  1997. var t = h(e);
  1998. return -1 !== t && $[t]
  1999. }
  2000. var i = U.find(e).eq(0);
  2001. if (i[0]) {
  2002. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  2003. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  2004. return {
  2005. start: n,
  2006. center: n - H / 2 + r / 2,
  2007. end: n - H + r,
  2008. size: r
  2009. }
  2010. }
  2011. return !1
  2012. }
  2013. ,
  2014. B.moveBy = function(e) {
  2015. Ce.speed = e,
  2016. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2017. Ce.startPos = G.cur,
  2018. C("button"),
  2019. Ie.init = 1,
  2020. L("moveStart"),
  2021. ze(Te),
  2022. t())
  2023. }
  2024. ,
  2025. B.stop = function() {
  2026. "button" === Ie.source && (Ie.init = 0,
  2027. Ie.released = 1)
  2028. }
  2029. ,
  2030. B.prev = function() {
  2031. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2032. }
  2033. ,
  2034. B.next = function() {
  2035. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2036. }
  2037. ,
  2038. B.prevPage = function() {
  2039. B.activatePage(ee.activePage - 1)
  2040. }
  2041. ,
  2042. B.nextPage = function() {
  2043. B.activatePage(ee.activePage + 1)
  2044. }
  2045. ,
  2046. B.slideBy = function(e, t) {
  2047. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2048. }
  2049. ,
  2050. B.slideTo = function(e, t) {
  2051. l(e, t)
  2052. }
  2053. ,
  2054. B.toStart = function(e, t) {
  2055. i("start", e, t)
  2056. }
  2057. ,
  2058. B.toEnd = function(e, t) {
  2059. i("end", e, t)
  2060. }
  2061. ,
  2062. B.toCenter = function(e, t) {
  2063. i("center", e, t)
  2064. }
  2065. ,
  2066. B.getIndex = h,
  2067. B.activate = function(e, t) {
  2068. var i = m(e);
  2069. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2070. }
  2071. ,
  2072. B.activatePage = function(e, t) {
  2073. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2074. }
  2075. ,
  2076. B.resume = function(e) {
  2077. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2078. we ? we = clearTimeout(we) : L("resume"),
  2079. we = setTimeout(function() {
  2080. switch (L("cycle"),
  2081. F.cycleBy) {
  2082. case "items":
  2083. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2084. break;
  2085. case "pages":
  2086. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2087. }
  2088. }, F.cycleInterval))
  2089. }
  2090. ,
  2091. B.pause = function(e) {
  2092. e < B.isPaused || (B.isPaused = e || 100,
  2093. we && (we = clearTimeout(we),
  2094. L("pause")))
  2095. }
  2096. ,
  2097. B.toggle = function() {
  2098. B[we ? "pause" : "resume"]()
  2099. }
  2100. ,
  2101. B.set = function(e, t) {
  2102. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2103. }
  2104. ,
  2105. B.add = function(e, t) {
  2106. var i = xe(e);
  2107. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2108. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2109. a()
  2110. }
  2111. ,
  2112. B.remove = function(e) {
  2113. if (le) {
  2114. var t = u(e);
  2115. if (-1 < t) {
  2116. J.eq(t).remove();
  2117. var i = t === ee.activeItem;
  2118. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2119. a(),
  2120. i && (ye.active = null,
  2121. B.activate(ee.activeItem))
  2122. }
  2123. } else
  2124. xe(e).remove(),
  2125. a()
  2126. }
  2127. ,
  2128. B.moveAfter = function(e, t) {
  2129. r(e, t, 1)
  2130. }
  2131. ,
  2132. B.moveBefore = function(e, t) {
  2133. r(e, t)
  2134. }
  2135. ,
  2136. B.on = function(e, t) {
  2137. if ("object" === Re(e))
  2138. for (var i in e)
  2139. e.hasOwnProperty(i) && B.on(i, e[i]);
  2140. else if ("function" === Re(t))
  2141. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2142. ve[n[r]] = ve[n[r]] || [],
  2143. -1 === f(n[r], t) && ve[n[r]].push(t);
  2144. else if ("array" === Re(t))
  2145. for (var a = 0, s = t.length; a < s; a++)
  2146. B.on(e, t[a])
  2147. }
  2148. ,
  2149. B.one = function(t, i) {
  2150. B.on(t, function e() {
  2151. i.apply(B, arguments),
  2152. B.off(t, e)
  2153. })
  2154. }
  2155. ,
  2156. B.off = function(e, t) {
  2157. if (t instanceof Array)
  2158. for (var i = 0, n = t.length; i < n; i++)
  2159. B.off(e, t[i]);
  2160. else
  2161. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2162. if (ve[r[o]] = ve[r[o]] || [],
  2163. null == t)
  2164. ve[r[o]].length = 0;
  2165. else {
  2166. var s = f(r[o], t);
  2167. -1 !== s && ve[r[o]].splice(s, 1)
  2168. }
  2169. }
  2170. ,
  2171. B.destroy = function() {
  2172. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2173. We.off("keydown", M),
  2174. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2175. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2176. Z.empty(),
  2177. V || (k.off("." + He),
  2178. te.restore(),
  2179. ie.restore(),
  2180. ne.restore(),
  2181. re.restore(),
  2182. xe.removeData(s, He)),
  2183. $.length = Q.length = 0,
  2184. ye = {},
  2185. B.initialized = 0,
  2186. B
  2187. }
  2188. ,
  2189. B.init = function() {
  2190. if (!B.initialized) {
  2191. B.on(n);
  2192. var e = ["overflow", "position"]
  2193. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2194. te.save.apply(te, e),
  2195. ne.save.apply(ne, e),
  2196. ie.save.apply(ie, t),
  2197. re.save.apply(re, t);
  2198. var i = j;
  2199. return V || (i = i.add(U),
  2200. k.css("overflow", "hidden"),
  2201. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2202. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2203. i.css({
  2204. position: "absolute"
  2205. })),
  2206. F.forward && ue.on(Ke, T),
  2207. F.backward && de.on(Ke, T),
  2208. F.prev && pe.on(Ze, T),
  2209. F.next && fe.on(Ze, T),
  2210. F.prevPage && ge.on(Ze, T),
  2211. F.nextPage && me.on(Ze, T),
  2212. ce.on(Xe, x),
  2213. W[0] && W.on(Ze, S),
  2214. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2215. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2216. he.on(je, {
  2217. source: "slidee"
  2218. }, I),
  2219. j && j.on(je, {
  2220. source: "handle"
  2221. }, I),
  2222. We.on("keydown", M),
  2223. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2224. k.on("scroll." + He, Le)),
  2225. B.initialized = 1,
  2226. a(!0),
  2227. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2228. B
  2229. }
  2230. }
  2231. }
  2232. function Re(e) {
  2233. 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
  2234. }
  2235. function Pe(e, t) {
  2236. e.preventDefault(),
  2237. t && e.stopPropagation()
  2238. }
  2239. function Oe(e) {
  2240. Pe(e, 1),
  2241. xe(this).off(e.type, Oe)
  2242. }
  2243. function Le() {
  2244. this.scrollLeft = 0,
  2245. this.scrollTop = 0
  2246. }
  2247. function De(e) {
  2248. return !isNaN(parseFloat(e)) && isFinite(e)
  2249. }
  2250. function Ne(e, t) {
  2251. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2252. }
  2253. function Fe(e, t, i) {
  2254. return e < t ? t : i < e ? i : e
  2255. }
  2256. function Be(t) {
  2257. var i = {
  2258. style: {},
  2259. save: function() {
  2260. if (t && t.nodeType) {
  2261. for (var e = 0; e < arguments.length; e++)
  2262. i.style[arguments[e]] = t.style[arguments[e]];
  2263. return i
  2264. }
  2265. },
  2266. restore: function() {
  2267. if (t && t.nodeType) {
  2268. for (var e in i.style)
  2269. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2270. return i
  2271. }
  2272. }
  2273. };
  2274. return i
  2275. }
  2276. 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;
  2277. function t(e) {
  2278. for (var t = 0, i = r.length; t < i; t++) {
  2279. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2280. if (null != o.style[n])
  2281. return n
  2282. }
  2283. }
  2284. We.on(Xe, function(e) {
  2285. var t = e.originalEvent[He]
  2286. , i = +new Date;
  2287. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2288. }),
  2289. function(t) {
  2290. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2291. var t = (new Date).getTime()
  2292. , i = Math.max(0, 16 - (t - r))
  2293. , n = setTimeout(e, i);
  2294. return r = t,
  2295. n
  2296. }
  2297. ;
  2298. var r = (new Date).getTime()
  2299. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2300. ze = function(e) {
  2301. i.call(t, e)
  2302. }
  2303. }(window),
  2304. r = ["", "webkit", "moz", "ms", "o"],
  2305. o = document.createElement("div"),
  2306. Ve = t("transform"),
  2307. ke = t("perspective") ? "translateZ(0) " : "",
  2308. e.Sly = Me,
  2309. xe.fn.sly = function(n, r) {
  2310. var o, a;
  2311. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2312. a = Array.prototype.slice.call(arguments, 1)),
  2313. n = {}),
  2314. this.each(function(e, t) {
  2315. var i = xe.data(t, He);
  2316. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2317. })
  2318. }
  2319. ,
  2320. Me.defaults = {
  2321. slidee: null,
  2322. horizontal: !1,
  2323. itemNav: null,
  2324. itemSelector: null,
  2325. smart: !1,
  2326. activateOn: null,
  2327. activateMiddle: !1,
  2328. scrollSource: null,
  2329. scrollBy: 0,
  2330. scrollHijack: 300,
  2331. scrollTrap: !1,
  2332. dragSource: null,
  2333. mouseDragging: !1,
  2334. touchDragging: !1,
  2335. releaseSwing: !1,
  2336. swingSpeed: .2,
  2337. elasticBounds: !1,
  2338. interactive: null,
  2339. scrollBar: null,
  2340. dragHandle: !1,
  2341. dynamicHandle: !1,
  2342. minHandleSize: 50,
  2343. clickBar: !1,
  2344. syncSpeed: .5,
  2345. pagesBar: null,
  2346. activatePageOn: null,
  2347. pageBuilder: function(e) {
  2348. return "<li>" + (e + 1) + "</li>"
  2349. },
  2350. forward: null,
  2351. backward: null,
  2352. prev: null,
  2353. next: null,
  2354. prevPage: null,
  2355. nextPage: null,
  2356. cycleBy: null,
  2357. cycleInterval: 5e3,
  2358. pauseOnHover: !1,
  2359. startPaused: !1,
  2360. moveBy: 300,
  2361. speed: 0,
  2362. easing: "swing",
  2363. startAt: null,
  2364. keyboardNavBy: null,
  2365. draggedClass: "dragged",
  2366. activeClass: "active",
  2367. disabledClass: "disabled"
  2368. }
  2369. }(jQuery, window),
  2370. function o(a, s, l) {
  2371. function c(i, e) {
  2372. if (!s[i]) {
  2373. if (!a[i]) {
  2374. var t = "function" == typeof require && require;
  2375. if (!e && t)
  2376. return t(i, !0);
  2377. if (h)
  2378. return h(i, !0);
  2379. var n = new Error("Cannot find module '" + i + "'");
  2380. throw n.code = "MODULE_NOT_FOUND",
  2381. n
  2382. }
  2383. var r = s[i] = {
  2384. exports: {}
  2385. };
  2386. a[i][0].call(r.exports, function(e) {
  2387. var t = a[i][1][e];
  2388. return c(t || e)
  2389. }, r, r.exports, o, a, s, l)
  2390. }
  2391. return s[i].exports
  2392. }
  2393. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2394. c(l[e]);
  2395. return c
  2396. }({
  2397. 1: [function(p, f, e) {
  2398. (function(e) {
  2399. "use strict";
  2400. function t(e) {
  2401. this.player = null,
  2402. this.director = null,
  2403. this.modelManager = null,
  2404. this.container = null,
  2405. this.tagManager = null,
  2406. this.fadeInSpeed = e,
  2407. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2408. }
  2409. var r = p("three")
  2410. , i = p("./util/logger")
  2411. , n = (p("./util/common"),
  2412. p("./enum/PlayerEvents"))
  2413. , o = p("./enum/DirectorEvents")
  2414. , a = p("./settings")
  2415. , s = p("./enum/Viewmode")
  2416. , l = (p("./enum/WarpStyle"),
  2417. p("./enum/BlackoutStyle"),
  2418. p("./enum/ModelManagerEvents"))
  2419. , c = p("./enum/tagEvents")
  2420. , h = p("./util/transitions")
  2421. , u = p("./util/lerp")
  2422. , d = new i(e);
  2423. window.THREE = r,
  2424. t.prototype.init = function(e, t, i, n, r) {
  2425. (window.app = this).player = t,
  2426. this.director = e,
  2427. this.modelManager = i,
  2428. this.tagManager = n,
  2429. this.container = r,
  2430. this.updateModel(),
  2431. this.bindEvents()
  2432. }
  2433. ,
  2434. t.prototype.bindEvents = function() {
  2435. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2436. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2437. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2438. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2439. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2440. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2441. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2442. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2443. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2444. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2445. }
  2446. ,
  2447. t.prototype.updateModel = function() {
  2448. this.model = this.modelManager.getActiveModel()
  2449. }
  2450. ,
  2451. t.prototype.handleWarpStarted = function() {
  2452. this.hidePlayerReticule()
  2453. }
  2454. ,
  2455. t.prototype.ontagActivated = function() {
  2456. this.hidePlayerReticule()
  2457. }
  2458. ,
  2459. t.prototype.onNavigationTotag = function() {
  2460. this.hidePlayerReticule()
  2461. }
  2462. ,
  2463. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2464. var n = this.modelManager.getActiveModel()
  2465. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2466. n.fadePanoMarkers(r),
  2467. n.setMode(t)
  2468. }
  2469. ,
  2470. t.prototype.handlePlayerModeChanged = function(e, t) {
  2471. var i = this.modelManager.getActiveModel()
  2472. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2473. i.setSide(n),
  2474. i.setMode(t)
  2475. }
  2476. ,
  2477. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2478. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2479. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2480. }
  2481. ,
  2482. t.prototype.handleActionInterruption = function() {}
  2483. ,
  2484. t.prototype.handleStartInside = function(e) {
  2485. var t = a[this.player.mode]
  2486. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2487. this.fadeIn(this.fadeInSpeed),
  2488. this.model.alpha = 0,
  2489. this.model.skybox.material.uniforms.opacity.value = 1,
  2490. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2491. var n = this.player.reticule;
  2492. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2493. }
  2494. ,
  2495. t.prototype.handleStartOutside = function(e) {
  2496. this.fadeIn(e)
  2497. }
  2498. ,
  2499. t.prototype.fadeIn = function(e) {
  2500. null != e || (e = 2e3,
  2501. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2502. $(this.container).fadeIn(e)
  2503. }
  2504. ,
  2505. t.prototype.hidePlayerReticule = function() {
  2506. this.player.reticule.hide()
  2507. }
  2508. ,
  2509. f.exports = t
  2510. }
  2511. ).call(this, "/js/DisplayController.js")
  2512. }
  2513. , {
  2514. "./enum/BlackoutStyle": 18,
  2515. "./enum/DirectorEvents": 23,
  2516. "./enum/tagEvents": 32,
  2517. "./enum/ModelManagerEvents": 33,
  2518. "./enum/PlayerEvents": 40,
  2519. "./enum/Viewmode": 51,
  2520. "./enum/WarpStyle": 52,
  2521. "./settings": 166,
  2522. "./util/common": 185,
  2523. "./util/lerp": 188,
  2524. "./util/logger": 189,
  2525. "./util/transitions": 195,
  2526. three: 217
  2527. }],
  2528. 2: [function(e, t, i) {
  2529. "use strict";
  2530. function n() {
  2531. this.baseStartTime = performance.timing.navigationStart,
  2532. this.loadingStartTime = null,
  2533. this.waitingStartTime = null,
  2534. this.appReadyTime = null
  2535. }
  2536. n.prototype.setBaseStartTime = function(e) {
  2537. this.baseStartTime = e || Date.now()
  2538. }
  2539. ,
  2540. n.prototype.setWaitingStartTime = function(e) {
  2541. this.waitingStartTime = e || Date.now()
  2542. }
  2543. ,
  2544. n.prototype.setLoadingStartTime = function(e) {
  2545. this.loadingStartTime = e || Date.now()
  2546. }
  2547. ,
  2548. n.prototype.setAppReadyTime = function(e) {
  2549. this.appReadyTime = e || Date.now()
  2550. }
  2551. ,
  2552. n.prototype.calcFullLoadingTime = function() {
  2553. var e = this.appReadyTime - this.baseStartTime;
  2554. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2555. e
  2556. }
  2557. ,
  2558. t.exports = n
  2559. }
  2560. , {}],
  2561. 3: [function(i, n, e) {
  2562. (function(e) {
  2563. "use strict";
  2564. function a() {
  2565. return 100 * Math.random()
  2566. }
  2567. var t = i("./util/logger")
  2568. , s = i("./util/browser")
  2569. , l = new t(e)
  2570. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2571. initialized: !1,
  2572. init: function(e, t) {
  2573. if (t = t || {},
  2574. !this.initialized) {
  2575. for (var i in this.initialized = !0,
  2576. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2577. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2578. e) {
  2579. var n = i.match("^sc_tilegen_([0-9]+)$");
  2580. n && (c.tilegen = a() < parseInt(n[1]));
  2581. var r = i.match("^sc_imgopt_([0-9]+)$");
  2582. r && (c.imgopt = a() < parseInt(r[1]))
  2583. }
  2584. for (var o in t)
  2585. c[o] = t[o],
  2586. l.debug("A/B override:", o, c[o])
  2587. }
  2588. },
  2589. changeIfTileGenerating: function(e) {
  2590. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2591. e += ""),
  2592. e
  2593. },
  2594. changeIfImageOptimzing: function(e) {
  2595. if(e.includes("blob:http"))return e;//add
  2596. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2597. e += ""),
  2598. e
  2599. },
  2600. tilegen: !1,
  2601. imgopt: !1
  2602. };
  2603. n.exports = c
  2604. }
  2605. ).call(this, "/js/ab.js")
  2606. }
  2607. , {
  2608. "./util/browser": 182,
  2609. "./util/logger": 189
  2610. }],
  2611. 4: [function(u, d, e) {
  2612. (function(e) {
  2613. "use strict";
  2614. function r(n, e, t, i) {
  2615. function r(e) {
  2616. a[e.sid] = !0;
  2617. var t = e.billboard.media && e.billboard.media.type
  2618. , i = {
  2619. tag_id: e.sid,
  2620. tags_visited: Object.keys(a).length,
  2621. tag_count: Object.keys(n.tags).length,
  2622. tag_view_count: ++d,
  2623. has_media: !!t
  2624. };
  2625. t && (i.media_type = t),
  2626. g("tag_opened", i)
  2627. }
  2628. var o, a = {}, s = Date.now() - P, l = null;
  2629. i && (l = Date.now() - window.navigationStart);
  2630. try {
  2631. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2632. } catch (n) {
  2633. o = !1
  2634. }
  2635. var c, h = n.supportsVR;
  2636. h || (c = "VR disabled at the model/account level",
  2637. 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"))),
  2638. g("model_loaded", {
  2639. duration: s,
  2640. duration_from_navigation_start: l,
  2641. has_hlr: o,
  2642. has_vr: h,
  2643. vr_reason: c
  2644. });
  2645. var u = 0;
  2646. n.panos.forEach(function(e) {
  2647. e.on("enter", function() {
  2648. f("pano_viewed", {
  2649. pano_id: e.id,
  2650. pano_view_count: ++u,
  2651. alignment_type: e.alignmentType,
  2652. interaction_source: R,
  2653. navigation_source: v
  2654. })
  2655. })
  2656. });
  2657. var d = 0;
  2658. for (var p in n.tags)
  2659. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2660. e.on("tour_auto", function(e) {
  2661. v = "tour_" + e
  2662. }),
  2663. e.on("tour_manual", function(e) {
  2664. R = "gui-" + e,
  2665. v = "tour_manual"
  2666. }),
  2667. t.on(C.InteractionKey, function() {
  2668. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2669. }),
  2670. t.on(C.InteractionDirect, function() {
  2671. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2672. }),
  2673. function(t) {
  2674. I.on(T.OPENED, function() {
  2675. f("showcase_share_intent", {
  2676. pano_id: t.currentPano && t.currentPano.id
  2677. })
  2678. }),
  2679. I.on(T.LINK_CLICKED, function(e) {
  2680. f("showcase_share_action", {
  2681. channel: e.channel,
  2682. pano_id: t.currentPano && t.currentPano.id
  2683. })
  2684. }),
  2685. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2686. f("showcase_share_origin_link_clicked")
  2687. })
  2688. }(e),
  2689. function() {
  2690. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2691. gui_action: "click_vr_button"
  2692. })),
  2693. _.on(S.LAUNCH, function(e) {
  2694. f("showcase_gui", {
  2695. gui_action: "launch_vr",
  2696. vr_platform: e.vr_platform,
  2697. vr_app: e.vr_app
  2698. })
  2699. }),
  2700. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2701. gui_action: "vr_modal_prev"
  2702. })),
  2703. _.on(S.NEXT, function(e) {
  2704. f("showcase_gui", {
  2705. gui_action: e.nextAction
  2706. })
  2707. }),
  2708. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2709. gui_action: "vr_modal_close"
  2710. })),
  2711. _.on(S.falseICECHOSEN, function(e) {
  2712. f("showcase_gui", {
  2713. gui_action: e.name + " "
  2714. })
  2715. }),
  2716. _.on(S.STORE, function(e) {
  2717. f("showcase_gui", {
  2718. gui_action: "launch_store",
  2719. store: e
  2720. })
  2721. })
  2722. }()
  2723. }
  2724. function f(e, t) {
  2725. if (t = t || {},
  2726. i)
  2727. try {
  2728. window.analytics.track(e, s.extendObject(t, c), {
  2729. context: {
  2730. app: {
  2731. name: "showcase",
  2732. version: "2.25.6-0-gd87e5b1"
  2733. },
  2734. screen: {
  2735. width: window.screen.width,
  2736. height: window.screen.height,
  2737. density: window.devicePixelRatio
  2738. }
  2739. }
  2740. })
  2741. } catch (t) {
  2742. console.warn("Failed to send data to segment for " + e)
  2743. }
  2744. }
  2745. function g(e, t) {
  2746. f(e, t = t || {})
  2747. }
  2748. function m(e, t) {
  2749. R = e === C.InteractionGui ? "gui-" + t : e,
  2750. v = "self_guided"
  2751. }
  2752. var v, o, a = (u("three"),
  2753. u("./util/ajax"),
  2754. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2755. 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"),
  2756. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2757. d.exports = {
  2758. report: function(e, t, i, n) {
  2759. !function(e, t) {
  2760. if (o)
  2761. try {
  2762. o.addEvent(e, s.extendObject({
  2763. host: window.location.host,
  2764. keen: {
  2765. addons: [{
  2766. name: "keen:ua_parser",
  2767. input: {
  2768. ua_string: "user_agent"
  2769. },
  2770. output: "parsed_user_agent"
  2771. }]
  2772. },
  2773. user_agent: "${keen.user_agent}",
  2774. referrer: {
  2775. url: s.normalizeUrl(document.referrer),
  2776. domain: s.domainFromUrl(document.referrer),
  2777. url_original: document.referrer
  2778. },
  2779. embedded: y.inIframe(),
  2780. is_mobile: y.isMobile(),
  2781. version: "2.25.6-0-gd87e5b1"
  2782. }, t))
  2783. } catch (e) {
  2784. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2785. }
  2786. }("Session starts", {
  2787. model: e,
  2788. status: t,
  2789. loadtime: Date.now() - (P || Date.now()),
  2790. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2791. autoplay: i,
  2792. quickstart: n,
  2793. ab_tilegen: a.tilegen,
  2794. ab_imgopt: a.imgopt
  2795. })
  2796. },
  2797. impression: function(e) {
  2798. g("impression", {
  2799. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2800. url_params: (void 0 !== e.immediate && e.immediate,
  2801. window.location.search.substr(1).split("&"))
  2802. })
  2803. },
  2804. initKeen: function(e) {
  2805. return e.token && e.appId ? void (o = new Keen({
  2806. projectId: e.appId,
  2807. writeKey: e.token,
  2808. readKey: "",
  2809. requestType: "xhr"
  2810. })) : void l.warn("no keen token/appId")
  2811. },
  2812. initSegment: function(e) {
  2813. return e.token ? (i = e.token,
  2814. window.analytics.load(e.token),
  2815. c = {
  2816. model_id: e.model,
  2817. start_source: e.startSource,
  2818. autoplay: e.autoplay,
  2819. quickstart: e.quickstart,
  2820. language_tag: t.languageTag,
  2821. is_mobile: y.isMobile(),
  2822. iframe: y.inIframe(),
  2823. aspect_ratio: y.aspectRatio(),
  2824. session_id: h,
  2825. window: {
  2826. width: $("#player").width(),
  2827. height: $("#player").height()
  2828. },
  2829. platform: {
  2830. browser: {
  2831. name: $.ua.browser.name,
  2832. major: $.ua.browser.major,
  2833. version: $.ua.browser.version
  2834. },
  2835. os: {
  2836. name: $.ua.os.name,
  2837. version: $.ua.os.version
  2838. },
  2839. device: {
  2840. vendor: $.ua.device.vendor,
  2841. model: $.ua.device.model,
  2842. type: $.ua.device.type
  2843. }
  2844. }
  2845. },
  2846. n = Math.random() < t.analytics.sessionTrackingRate,
  2847. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2848. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2849. },
  2850. sessionStart: function(e) {
  2851. l.debug("analytics user_session_start"),
  2852. f("session_started"),
  2853. P = Date.now(),
  2854. window.addEventListener("unload", function() {
  2855. !function(e, t) {
  2856. if (t = t || {},
  2857. navigator.sendBeacon && i)
  2858. try {
  2859. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2860. event: e,
  2861. anonymousId: window.analytics.user().anonymousId(),
  2862. properties: s.extendObject(t, c),
  2863. writeKey: i,
  2864. sentAt: Date.now(),
  2865. type: "track",
  2866. context: {
  2867. userAgent: y.userAgent(),
  2868. library: {
  2869. name: "showcase-beacon",
  2870. version: "2.25.6-0-gd87e5b1"
  2871. },
  2872. app: {
  2873. name: "showcase",
  2874. version: "2.25.6-0-gd87e5b1"
  2875. }
  2876. }
  2877. }))
  2878. } catch (e) {
  2879. console.warn("Failed to send async segment request")
  2880. }
  2881. }("session_ended", {
  2882. duration: Date.now() - P
  2883. })
  2884. })
  2885. },
  2886. modelLoaded: function(e, t, i, n) {
  2887. r(e, t, i, n)
  2888. },
  2889. loadComplete: function(e) {
  2890. f("load_times", {
  2891. time_to_app_start: e
  2892. })
  2893. },
  2894. track: function(e, t) {
  2895. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2896. f(e, t))
  2897. },
  2898. trackAlways: function(e, t) {
  2899. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2900. f(e, t)
  2901. },
  2902. getSessionId: function() {
  2903. return h
  2904. },
  2905. updateInteraction: m
  2906. }
  2907. }
  2908. ).call(this, "/js/analytics.js")
  2909. }
  2910. , {
  2911. "./ab": 3,
  2912. "./enum/ControlEvents": 21,
  2913. "./enum/PlayerEvents": 40,
  2914. "./enum/VROption": 47,
  2915. "./enum/VRPlatforms": 49,
  2916. "./enum/Viewmode": 51,
  2917. "./gui/sharing/ShareEvents": 76,
  2918. "./gui/sharing/modal": 77,
  2919. "./gui/title/TitleEvents": 80,
  2920. "./gui/title/titleBar": 82,
  2921. "./gui/vr/vrEvent": 85,
  2922. "./gui/vr/vrModal": 87,
  2923. "./localization/localize": 108,
  2924. "./tag/Billboard/BillboardEvent": 120,
  2925. "./settings": 166,
  2926. "./util/ajax": 181,
  2927. "./util/browser": 182,
  2928. "./util/common": 185,
  2929. "./util/logger": 189,
  2930. three: 217
  2931. }],
  2932. 5: [function(e, t, i) {
  2933. "use strict";
  2934. function n() {
  2935. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2936. this.controls = null
  2937. }
  2938. var r = e("three")
  2939. , o = e("../constants")
  2940. , a = e("../util/cameraLight");
  2941. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2942. this.aspect = e,
  2943. this.updateProjectionMatrix()
  2944. }
  2945. ,
  2946. t.exports = n
  2947. }
  2948. , {
  2949. "../constants": 8,
  2950. "../util/cameraLight": 184,
  2951. three: 217
  2952. }],
  2953. 6: [function(e, t, i) {
  2954. "use strict";
  2955. function n() {
  2956. var e = $("#player").width() / $("#player").height();
  2957. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2958. this.controls = null,
  2959. this.updateAspect(e)
  2960. }
  2961. var r = e("three")
  2962. , o = e("../constants");
  2963. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2964. this.aspect = e,
  2965. this.top = o.orthoBase / e,
  2966. this.bottom = -o.orthoBase / e,
  2967. this.updateProjectionMatrix()
  2968. }
  2969. ,
  2970. t.exports = n
  2971. }
  2972. , {
  2973. "../constants": 8,
  2974. three: 217
  2975. }],
  2976. 7: [function(e, t, i) {
  2977. "use strict";
  2978. function n() {
  2979. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2980. this.controls = null
  2981. }
  2982. var r = e("three")
  2983. , o = e("../settings")
  2984. , a = e("../util/cameraLight");
  2985. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2986. this.aspect = e,
  2987. this.updateProjectionMatrix()
  2988. }
  2989. ,
  2990. t.exports = n
  2991. }
  2992. , {
  2993. "../settings": 166,
  2994. "../util/cameraLight": 184,
  2995. three: 217
  2996. }],
  2997. 8: [function(e, t, i) {
  2998. "use strict";
  2999. t.exports = {
  3000. signedUrlDefaultExpireTime: 24e4,
  3001. signedUrlCheckInterval: 1e4,
  3002. signedUrlRefreshBuffer: 15e3,
  3003. dollhouseFOV: 70,
  3004. dollhouseNear: .1,//1,
  3005. dollhouseFar: 5e3,
  3006. insideFOV: 70,
  3007. insideFOVMax: 120,
  3008. insideNear: .1,
  3009. insideFar: 5e3,
  3010. insideLookSpeed: .12,
  3011. insideLookLimitUp: 40,
  3012. insideLookLimitDown: -40,
  3013. orthoNear: 1,
  3014. orthoFar: 5e3,
  3015. orthoBase: 10,
  3016. narrowLandscapeHeight: 290,
  3017. reallyNarrowLandscapeHeight: 250,
  3018. visionTilingStartDate: new Date("8/26/2016"),
  3019. visionTilingStartVersion: "1.1.407.13667",
  3020. windowHeightHighQualityThreshold: 900,
  3021. tourStepDelayDefault: 3500,
  3022. tourStepDelaySlideShow: 5e3,
  3023. workshopApsect: 9 / 16,
  3024. highQualityMaxZoom: 2,
  3025. ultraHighQualityMaxZoom: 3
  3026. }
  3027. }
  3028. , {}],
  3029. 9: [function(e, t, i) {
  3030. "use strict";
  3031. function n() {
  3032. this.activeControl = null,
  3033. this.controls = {},
  3034. this.cameras = {}
  3035. }
  3036. var a = e("./PanoramaControls")
  3037. , s = e("./DollhouseControls")
  3038. , l = e("./FloorplanControls")
  3039. , c = e("../cameras/PanoramaCamera")
  3040. , h = e("../cameras/DollhouseCamera")
  3041. , u = e("../cameras/FloorplanCamera")
  3042. , r = e("events").EventEmitter
  3043. , d = e("../enum/ControlEvents")
  3044. , o = e("../enum/ModelManagerEvents")
  3045. , p = e("../enum/Viewmode")
  3046. , f = e("../settings");
  3047. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3048. this.setUpControls(),
  3049. this.bindEvents(e, t)
  3050. }
  3051. ,
  3052. n.prototype.activateControls = function(e) {
  3053. this.activeControl && (this.activeControl.reset(),
  3054. this.activeControl.enabled = !1),
  3055. this.controls[e] && (this.controls[e].enabled = !0),
  3056. this.activeControl = this.controls[e]
  3057. }
  3058. ,
  3059. n.prototype.setUpControls = function() {
  3060. var i = {}
  3061. , n = {}
  3062. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3063. , r = [c, h, u]
  3064. , o = [a, s, l];
  3065. e.forEach(function(e, t) {
  3066. i[e] = new r[t],
  3067. n[e] = new o[t](i[e]),
  3068. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3069. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3070. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3071. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3072. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3073. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3074. }
  3075. .bind(this)),
  3076. this.controls = n,
  3077. this.cameras = i
  3078. }
  3079. ,
  3080. n.prototype.bindEvents = function(e, t) {
  3081. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3082. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3083. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3084. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3085. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3086. passive: !1
  3087. }),
  3088. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3089. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3090. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3091. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3092. e.addEventListener("contextmenu", function(e) {
  3093. e.preventDefault()
  3094. }),
  3095. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3096. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3097. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3098. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3099. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3100. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3101. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3102. t.on(o.ActiveModelChanged, function(e) {
  3103. this.setModelForControls(e.model)
  3104. }
  3105. .bind(this))
  3106. }
  3107. ,
  3108. n.prototype.setModelForControls = function(e) {
  3109. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3110. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3111. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3112. this.controls[e].setBounds(t)
  3113. }
  3114. .bind(this))
  3115. }
  3116. ,
  3117. n.prototype.onMouseDown = function(e) {
  3118. e.preventDefault(),
  3119. this.activeControl && this.activeControl.onMouseDown(e)
  3120. }
  3121. ,
  3122. n.prototype.onMouseMove = function(e) {
  3123. e.preventDefault(),
  3124. this.activeControl && this.activeControl.onMouseMove(e)
  3125. }
  3126. ,
  3127. n.prototype.onMouseUp = function(e) {
  3128. e.preventDefault(),
  3129. this.activeControl && this.activeControl.onMouseUp(e)
  3130. }
  3131. ,
  3132. n.prototype.onMouseOver = function(e) {
  3133. e.preventDefault(),
  3134. this.activeControl && this.activeControl.onMouseOver(e)
  3135. }
  3136. ,
  3137. n.prototype.onMouseWheel = function(e) {
  3138. e.preventDefault(),
  3139. this.activeControl && this.activeControl.onMouseWheel(e)
  3140. }
  3141. ,
  3142. n.prototype.onTouchStart = function(e) {
  3143. e.preventDefault(),
  3144. this.activeControl && this.activeControl.onTouchStart(e),
  3145. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3146. $("#hotListContent ul .active").removeClass("active"),
  3147. $("#hotList")[0].classList.remove("active")
  3148. }
  3149. ,
  3150. n.prototype.onTouchMove = function(e) {
  3151. e.preventDefault(),
  3152. this.activeControl && this.activeControl.onTouchMove(e)
  3153. }
  3154. ,
  3155. n.prototype.onTouchEnd = function(e) {
  3156. e.preventDefault(),
  3157. this.activeControl && this.activeControl.onTouchEnd(e)
  3158. }
  3159. ,
  3160. n.prototype.onPointerDown = function(e) {
  3161. if (e.preventDefault(),
  3162. this.activeControl)
  3163. switch (e.pointerType) {
  3164. case "mouse":
  3165. this.activeControl.onMouseDown(e);
  3166. break;
  3167. default:
  3168. this.activeControl.onPointerDown(e)
  3169. }
  3170. }
  3171. ,
  3172. n.prototype.onPointerMove = function(e) {
  3173. if (e.preventDefault(),
  3174. this.activeControl)
  3175. switch (e.pointerType) {
  3176. case "mouse":
  3177. this.activeControl.onMouseMove(e);
  3178. break;
  3179. default:
  3180. this.activeControl.onPointerMove(e)
  3181. }
  3182. }
  3183. ,
  3184. n.prototype.onPointerUp = function(e) {
  3185. if (e.preventDefault(),
  3186. this.activeControl)
  3187. switch (e.pointerType) {
  3188. case "mouse":
  3189. this.activeControl.onMouseUp(e);
  3190. break;
  3191. default:
  3192. this.activeControl.onPointerUp(e)
  3193. }
  3194. }
  3195. ,
  3196. n.prototype.onPointerCancel = function(e) {
  3197. e.preventDefault(),
  3198. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3199. }
  3200. ,
  3201. n.prototype.onKeyDown = function(e) {
  3202. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3203. this.activeControl && this.activeControl.onKeyDown(e))
  3204. }
  3205. ,
  3206. n.prototype.onKeyUp = function(e) {
  3207. e.preventDefault(),
  3208. this.activeControl && this.activeControl.onKeyUp(e)
  3209. }
  3210. ,
  3211. t.exports = n
  3212. }
  3213. , {
  3214. "../cameras/DollhouseCamera": 5,
  3215. "../cameras/FloorplanCamera": 6,
  3216. "../cameras/PanoramaCamera": 7,
  3217. "../enum/ControlEvents": 21,
  3218. "../enum/ModelManagerEvents": 33,
  3219. "../enum/Viewmode": 51,
  3220. "../settings": 166,
  3221. "./DollhouseControls": 10,
  3222. "./FloorplanControls": 11,
  3223. "./PanoramaControls": 13,
  3224. events: 202
  3225. }],
  3226. 10: [function(e, t, i) {
  3227. "use strict";
  3228. function n(e) {
  3229. a.call(this, e),
  3230. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3231. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3232. this.minDistance = o.dollhouseDefault.minDistance,
  3233. this.maxDistance = o.dollhouseDefault.maxDistance,
  3234. this.adjustedMinDistance = this.minDistance,
  3235. this.adjustedMaxDistance = this.maxDistance
  3236. }
  3237. var r = e("three")
  3238. , o = e("../settings")
  3239. , a = e("./OutsideControls");
  3240. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3241. this.camera.updateMatrix();
  3242. var i = this.camera.position.clone().sub(this.target).length();
  3243. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3244. this.panLeft(2 * e * i / $("#player").height()),
  3245. this.panUp(-2 * t * i / $("#player").height())
  3246. }
  3247. ,
  3248. n.prototype.updateZoom = function() {
  3249. return this.offset.length() * this.scale
  3250. }
  3251. ,
  3252. n.prototype.setZoomBounds = function(e) {
  3253. var t = e.min.distanceTo(e.max);
  3254. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3255. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3256. this.minDistance = this.adjustedMinDistance,
  3257. this.maxDistance = this.adjustedMaxDistance
  3258. }
  3259. ,
  3260. n.prototype.resetRanges = function(e, t) {
  3261. e ? (this.minDistance = Math.min(e, this.minDistance),
  3262. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3263. this.maxDistance = this.adjustedMaxDistance),
  3264. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3265. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3266. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3267. }
  3268. ,
  3269. n.prototype.toJSON = function() {
  3270. return a.prototype.toJSON.call(this)
  3271. }
  3272. ,
  3273. t.exports = n
  3274. }
  3275. , {
  3276. "../settings": 166,
  3277. "./OutsideControls": 12,
  3278. three: 217
  3279. }],
  3280. 11: [function(e, t, i) {
  3281. "use strict";
  3282. function n(e) {
  3283. c.call(this, e),
  3284. this.minDistance = 15,
  3285. this.maxDistance = 50,
  3286. this.noRotateUpDown = !0,
  3287. this.minPolarAngle = 0,
  3288. this.maxPolarAngle = 0,
  3289. this.mouseActions[u.LEFT] = h.PAN,
  3290. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3291. this.mouseActions[u.RIGHT] = h.ROTATE,
  3292. this.touchActions[1] = h.PAN,
  3293. this.touchActions[2] = h.ROTATE_DOLLY,
  3294. this.absoluteScale = 1,
  3295. this.currentScale = 1
  3296. }
  3297. 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");
  3298. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3299. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3300. this.currentScale = this.absoluteScale
  3301. }
  3302. ,
  3303. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3304. var t = Math.max(modelSize.x, modelSize.z)
  3305. , i = Math.min(modelSize.x, modelSize.z)
  3306. , n = Math.max(t, i * this.camera.aspect)
  3307. , r = Math.max(i, t * this.camera.aspect);
  3308. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3309. return absoluteScale
  3310. },
  3311. n.prototype.rotateToView = function(e, t) {
  3312. var i = 0;
  3313. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3314. this.rotateLeft(i),
  3315. this.update(0)
  3316. }
  3317. ,
  3318. n.prototype.pan = function(e, t) {
  3319. this.camera.updateMatrix(),
  3320. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3321. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3322. }
  3323. ,
  3324. n.prototype.updateZoom = function() {
  3325. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3326. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3327. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3328. this.camera.left = -l.orthoBase * this.currentScale,
  3329. this.camera.right = l.orthoBase * this.currentScale,
  3330. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3331. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3332. this.camera.updateProjectionMatrix(),
  3333. this.offset.length()
  3334. }
  3335. ,
  3336. n.prototype.toJSON = (r = new s.Quaternion,
  3337. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3338. a = new s.Quaternion,
  3339. function() {
  3340. var e = c.prototype.toJSON.call(this);
  3341. return r.copy(e.camera_quaternion),
  3342. a.copy(o),
  3343. a.multiply(r),
  3344. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3345. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3346. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3347. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3348. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3349. e
  3350. }
  3351. ),
  3352. t.exports = n
  3353. }
  3354. , {
  3355. "../enum/ControlActions": 20,
  3356. "../enum/MouseButton": 34,
  3357. "../settings": 166,
  3358. "../util/browser": 182,
  3359. "../util/math": 190,
  3360. "./OutsideControls": 12,
  3361. three: 217
  3362. }],
  3363. 12: [function(e, t, i) {
  3364. "use strict";
  3365. function n(e) {
  3366. this.camera = e,
  3367. (this.camera.controls = this).enabled = !1,
  3368. this.target = new a.Vector3,
  3369. this.targetBounds = new a.Box3,
  3370. this.zoomSpeed = 2,//编辑时缩放快一些
  3371. this.minDistance = 0,
  3372. this.maxDistance = 1 / 0,
  3373. this.noRotateUpDown = !1,
  3374. this.rotateSpeed = 1,
  3375. this.keyboardZoomSpeed = 0,
  3376. this.keyPanSpeed = 7,
  3377. this.autoRotate = !1,
  3378. this.autoRotateSpeed = 2,
  3379. this.autoPan = !1,
  3380. this.autoPanPosition = new a.Vector3,
  3381. this.minPolarAngle = a.Math.degToRad(25),
  3382. this.maxPolarAngle = a.Math.degToRad(65),
  3383. this.rotationAcceleration = new a.Vector2,
  3384. this.rotationSpeed = new a.Vector2,
  3385. this.panAcceleration = new a.Vector2,
  3386. this.panSpeed = new a.Vector2,
  3387. this.rotateStart = new a.Vector2,
  3388. this.rotateEnd = new a.Vector2,
  3389. this.rotateDelta = new a.Vector2,
  3390. this.panStart = new a.Vector2,
  3391. this.panEnd = new a.Vector2,
  3392. this.panDelta = new a.Vector2,
  3393. this.panOffset = new a.Vector3,
  3394. this.offset = new a.Vector3,
  3395. this.dollyStart = new a.Vector2,
  3396. this.dollyEnd = new a.Vector2,
  3397. this.dollyDelta = new a.Vector2,
  3398. this.phiDelta = 0,
  3399. this.thetaDelta = 0,
  3400. this.scale = 1,
  3401. this.panVector = new a.Vector3,
  3402. this.lastPosition = new a.Vector3,
  3403. this.state = u.NONE,
  3404. this.mouseActions = {},
  3405. this.mouseActions[d.LEFT] = u.ROTATE,
  3406. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3407. this.mouseActions[d.RIGHT] = u.PAN,
  3408. this.touchActions = {},
  3409. this.touchActions[1] = u.ROTATE,
  3410. this.touchActions[2] = u.PAN_DOLLY,
  3411. this.lastMoveTime = 0,
  3412. this.pointersLimit = 2,
  3413. this.pointers = []
  3414. }
  3415. 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;
  3416. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3417. this.targetBounds = e
  3418. }
  3419. ,
  3420. n.prototype.isEngaged = function() {
  3421. return this.state !== u.NONE
  3422. }
  3423. ,
  3424. n.prototype.rotateLeft = function(e) {
  3425. void 0 === e && (e = this.getAutoRotationAngle()),
  3426. this.thetaDelta -= e
  3427. }
  3428. ,
  3429. n.prototype.rotateUp = function(e) {
  3430. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3431. this.phiDelta -= e)
  3432. }
  3433. ,
  3434. n.prototype.panLeft = function(e) {
  3435. var t = this.camera.matrix.elements;
  3436. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3437. this.panOffset.multiplyScalar(-e),
  3438. this.panVector.add(this.panOffset)
  3439. }
  3440. ,
  3441. n.prototype.panUp = function(e) {
  3442. var t = this.camera.matrix.elements;
  3443. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3444. this.panOffset.multiplyScalar(-e),
  3445. this.panVector.add(this.panOffset)
  3446. }
  3447. ,
  3448. n.prototype.startRotating = function(e, t) {
  3449. e && this.navRotationAcc("x", e),
  3450. t && this.navRotationAcc("y", t)
  3451. }
  3452. ,
  3453. n.prototype.stopRotating = function(e) {
  3454. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3455. this.navRotationAcc("x", 0),
  3456. this.navRotationAcc("y", 0)
  3457. }
  3458. ,
  3459. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3460. o = new a.Vector3,
  3461. function(e, t) {
  3462. r.copy(this.camera.position),
  3463. void 0 === e && null === e || r.setX(e),
  3464. void 0 === t && null === t || r.setZ(t);
  3465. var i = this.camera.position.distanceTo(this.target)
  3466. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3467. this.targetClamped = !1,
  3468. o.copy(r).addScaledVector(n, i),
  3469. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3470. r.copy(o).addScaledVector(n, -i),
  3471. this.targetClamped = !0),
  3472. this.autoPanPosition.x = r.x,
  3473. this.autoPanPosition.z = r.z,
  3474. this.autoPan && this.stopAutoPanning()
  3475. }
  3476. ),
  3477. n.prototype.stopAutoPanning = function() {
  3478. var e = this.autoPan;
  3479. this.autoPan = !1,
  3480. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3481. }
  3482. ,
  3483. n.prototype.dollyIn = function(e) {
  3484. void 0 === e && (e = this.getZoomScale()),
  3485. this.scale /= e
  3486. }
  3487. ,
  3488. n.prototype.dollyOut = function(e) {
  3489. void 0 === e && (e = this.getZoomScale()),
  3490. this.scale *= e
  3491. }
  3492. ,
  3493. n.prototype.updatePan = function(e) {
  3494. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3495. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3496. this.autoPan) {
  3497. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3498. t.setY(0).clampLength(0, 50 * e),
  3499. this.target.add(t),
  3500. this.camera.position.add(t),
  3501. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3502. this.stopAutoPanning())
  3503. }
  3504. }
  3505. ,
  3506. n.prototype.update = function(e) {
  3507. e = e || 1 / 60,
  3508. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3509. this.rotateLeft(-this.rotationSpeed.x),
  3510. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3511. this.updatePan(e);
  3512. var t = this.camera.position;
  3513. this.offset.copy(t).sub(this.target);
  3514. var i = Math.atan2(this.offset.x, this.offset.z)
  3515. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3516. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3517. i += this.thetaDelta,
  3518. n += this.phiDelta,
  3519. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3520. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3521. var r = this.updateZoom();
  3522. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3523. this.target.add(this.panVector),
  3524. this.targetBounds.clampPoint(this.target, this.target),
  3525. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3526. this.offset.y = r * Math.cos(n),
  3527. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3528. t.copy(this.target).add(this.offset),
  3529. this.camera.lookAt(this.target),
  3530. this.thetaDelta = 0,
  3531. this.phiDelta = 0,
  3532. this.scale = 1,
  3533. this.panVector.set(0, 0, 0),
  3534. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3535. }
  3536. ,
  3537. n.prototype.getAutoRotationAngle = function() {
  3538. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3539. }
  3540. ,
  3541. n.prototype.getZoomScale = function() {
  3542. return Math.pow(.95, this.zoomSpeed)
  3543. }
  3544. ,
  3545. n.prototype.onMouseDown = function(e) {
  3546. if (this.enabled) {
  3547. switch (e.preventDefault(),
  3548. this.stopAutoPanning(),
  3549. this.mouseDown = !0,
  3550. this.state = this.mouseActions[e.button],
  3551. this.state) {
  3552. case u.ROTATE:
  3553. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3554. this.rotationSpeed.set(0, 0);
  3555. break;
  3556. case u.DOLLY:
  3557. this.dollyStart.set(e.clientX, e.clientY);
  3558. break;
  3559. case u.PAN:
  3560. this.panStart.set(e.clientX, e.clientY)
  3561. }
  3562. this.emit(f.InputStart, "mouse")
  3563. }
  3564. }
  3565. ,
  3566. n.prototype.onMouseMove = function(e) {
  3567. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3568. switch (e.preventDefault(),
  3569. this.state) {
  3570. case u.ROTATE:
  3571. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3572. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3573. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3574. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3575. this.rotateStart.copy(this.rotateEnd);
  3576. break;
  3577. case u.DOLLY:
  3578. this.dollyEnd.set(e.clientX, e.clientY),
  3579. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3580. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3581. this.dollyStart.copy(this.dollyEnd);
  3582. break;
  3583. case u.PAN:
  3584. this.panEnd.set(e.clientX, e.clientY),
  3585. this.panDelta.subVectors(this.panEnd, this.panStart),
  3586. this.pan(this.panDelta.x, this.panDelta.y),
  3587. this.panStart.copy(this.panEnd)
  3588. }
  3589. this.emit(f.Move, "mouse"),
  3590. this.lastMoveTime = e.timeStamp,
  3591. this.update()
  3592. }
  3593. }
  3594. ,
  3595. n.prototype.onMouseUp = function(e) {
  3596. this.enabled && (this.mouseDown = !1,
  3597. this.state = u.NONE,
  3598. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3599. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3600. this.update(),
  3601. this.rotationAcceleration.set(0, 0),
  3602. this.rotateDelta.set(0, 0)))
  3603. }
  3604. ,
  3605. n.prototype.onMouseOver = function(e) {
  3606. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3607. }
  3608. ,
  3609. n.prototype.onMouseWheel = function(e) {
  3610. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3611. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3612. this.update())
  3613. }
  3614. ,
  3615. n.prototype.onKeyDown = function(e) {
  3616. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3617. this.handleKeyDown(e.which)))
  3618. }
  3619. ,
  3620. n.prototype.navRotationAcc = function(e, t) {
  3621. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3622. }
  3623. ,
  3624. n.prototype.navPanAcc = function(e, t) {
  3625. this.stopAutoPanning(),
  3626. this.panAcceleration[e] = t
  3627. }
  3628. ,
  3629. n.prototype.handleKeyDown = function(e) {
  3630. var t = !0;
  3631. switch (e) {
  3632. case p.UPARROW:
  3633. case p.I:
  3634. this.navRotationAcc("y", 1);
  3635. break;
  3636. case p.DOWNARROW:
  3637. case p.K:
  3638. this.navRotationAcc("y", -1);
  3639. break;
  3640. case p.LEFTARROW:
  3641. case p.J:
  3642. this.navRotationAcc("x", -1);
  3643. break;
  3644. case p.RIGHTARROW:
  3645. case p.L:
  3646. this.navRotationAcc("x", 1);
  3647. break;
  3648. case p.W:
  3649. this.navPanAcc("y", 1);
  3650. break;
  3651. case p.S:
  3652. this.navPanAcc("y", -1);
  3653. break;
  3654. case p.A:
  3655. this.navPanAcc("x", -1);
  3656. break;
  3657. case p.D:
  3658. this.navPanAcc("x", 1);
  3659. break;
  3660. default:
  3661. t = !1
  3662. }
  3663. t && this.emit(f.Move, "key")
  3664. }
  3665. ,
  3666. n.prototype.onKeyUp = function(e) {
  3667. this.enabled && (e.preventDefault(),
  3668. e.stopPropagation(),
  3669. this.handleKeyUp(e.which))
  3670. }
  3671. ,
  3672. n.prototype.handleKeyUp = function(e) {
  3673. switch (e) {
  3674. case p.I:
  3675. case p.K:
  3676. case p.UPARROW:
  3677. case p.DOWNARROW:
  3678. this.keyboardZoomSpeed = 0,
  3679. this.rotationAcceleration.y = 0;
  3680. break;
  3681. case p.J:
  3682. case p.L:
  3683. case p.LEFTARROW:
  3684. case p.RIGHTARROW:
  3685. this.rotationAcceleration.x = 0;
  3686. break;
  3687. case p.S:
  3688. case p.W:
  3689. this.panAcceleration.y = 0;
  3690. break;
  3691. case p.A:
  3692. case p.D:
  3693. this.panAcceleration.x = 0
  3694. }
  3695. }
  3696. ,
  3697. n.prototype.onTouchStart = function(i) {
  3698. if (this.enabled || this.state === u.NONE) {
  3699. i.preventDefault(),
  3700. i.stopPropagation(),
  3701. this.stopAutoPanning();
  3702. var e = function() {
  3703. if (2 === i.touches.length) {
  3704. var e = i.touches[0].pageX - i.touches[1].pageX
  3705. , t = i.touches[0].pageY - i.touches[1].pageY;
  3706. this.dollyStart.set(e, t)
  3707. }
  3708. }
  3709. .bind(this)
  3710. , t = function() {
  3711. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3712. }
  3713. .bind(this)
  3714. , n = function() {
  3715. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3716. }
  3717. .bind(this);
  3718. switch (this.state = this.touchActions[i.touches.length],
  3719. this.state) {
  3720. case u.PAN_DOLLY:
  3721. e();
  3722. case u.PAN:
  3723. t();
  3724. break;
  3725. case u.ROTATE_DOLLY:
  3726. e();
  3727. case u.ROTATE:
  3728. n()
  3729. }
  3730. this.rotationSpeed.set(0, 0),
  3731. this.emit(f.InputStart, "touch")
  3732. }
  3733. }
  3734. ,
  3735. n.prototype.onTouchMove = function(a) {
  3736. if (this.enabled && this.state !== u.NONE) {
  3737. a.preventDefault(),
  3738. a.stopPropagation();
  3739. var s = function() {
  3740. var e = a.touches[0].pageX - a.touches[1].pageX
  3741. , t = a.touches[0].pageY - a.touches[1].pageY;
  3742. this.dollyEnd.set(e, t);
  3743. var i = this.dollyStart.length() - this.dollyEnd.length();
  3744. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3745. this.dollyStart.copy(this.dollyEnd)
  3746. }
  3747. .bind(this)
  3748. , e = function() {
  3749. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3750. this.panDelta.subVectors(this.panEnd, this.panStart),
  3751. this.pan(this.panDelta.x, this.panDelta.y),
  3752. this.panStart.copy(this.panEnd),
  3753. this.rotateDelta.set(0, 0)
  3754. }
  3755. .bind(this)
  3756. , l = function() {
  3757. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3758. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3759. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3760. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3761. this.rotateStart.copy(this.rotateEnd)
  3762. }
  3763. .bind(this)
  3764. , t = function() {
  3765. if (2 === a.touches.length) {
  3766. var e = window.devicePixelRatio || 1
  3767. , t = a.touches[1].pageX - a.touches[0].pageX
  3768. , i = a.touches[1].pageY - a.touches[0].pageY
  3769. , n = Math.sqrt(t * t + i * i);
  3770. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3771. this.state = u.DOLLY,
  3772. s();
  3773. else {
  3774. var r = h.average(a.touches, "pageX")
  3775. , o = h.average(a.touches, "pageY");
  3776. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3777. this.rotateStart.set(r, o),
  3778. l())
  3779. }
  3780. }
  3781. }
  3782. .bind(this);
  3783. switch (this.state) {
  3784. case u.PAN_DOLLY:
  3785. s();
  3786. case u.PAN:
  3787. e();
  3788. break;
  3789. case u.ROTATE_DOLLY:
  3790. t();
  3791. break;
  3792. case u.DOLLY:
  3793. s();
  3794. break;
  3795. case u.ROTATE:
  3796. l();
  3797. break;
  3798. default:
  3799. this.state = u.NONE
  3800. }
  3801. this.lastMoveTime = a.timeStamp,
  3802. this.emit(f.Move, "touch")
  3803. }
  3804. }
  3805. ,
  3806. n.prototype.onTouchEnd = function(e) {
  3807. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3808. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3809. this.state = u.NONE,
  3810. this.update(),
  3811. this.rotationAcceleration.set(0, 0),
  3812. this.rotateDelta.set(0, 0))
  3813. }
  3814. ,
  3815. n.prototype.onPointerDown = function(e) {
  3816. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3817. id: e.pointerId,
  3818. pageX: e.pageX,
  3819. pageY: e.pageY
  3820. }),
  3821. e.touches = this.pointers,
  3822. this.onTouchStart(e)),
  3823. this.emit(f.InputStart, "pointer"))
  3824. }
  3825. ,
  3826. n.prototype.onPointerMove = function(t) {
  3827. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3828. t.pointerId === e.id && (e.pageX = t.pageX,
  3829. e.pageY = t.pageY)
  3830. }),
  3831. t.touches = this.pointers,
  3832. this.onTouchMove(t))
  3833. }
  3834. ,
  3835. n.prototype.onPointerUp = function(i) {
  3836. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3837. i.pointerId === e.id && this.pointers.splice(t, 1)
  3838. }
  3839. .bind(this)),
  3840. i.touches = this.pointers,
  3841. this.onTouchEnd(i))
  3842. }
  3843. ,
  3844. n.prototype.reset = function() {
  3845. this.state = u.NONE,
  3846. this.stopAutoPanning(),
  3847. this.rotationSpeed.set(0, 0),
  3848. this.rotationAcceleration.set(0, 0),
  3849. this.panSpeed.set(0, 0),
  3850. this.panAcceleration.set(0, 0)
  3851. }
  3852. ,
  3853. n.prototype.toJSON = function() {
  3854. return {
  3855. camera_position: {
  3856. x: s.toPrecision(this.camera.position.x, 4),
  3857. y: s.toPrecision(this.camera.position.y, 4),
  3858. z: s.toPrecision(this.camera.position.z, 4)
  3859. },
  3860. camera_quaternion: {
  3861. x: s.toPrecision(this.camera.quaternion.x, 4),
  3862. y: s.toPrecision(this.camera.quaternion.y, 4),
  3863. z: s.toPrecision(this.camera.quaternion.z, 4),
  3864. w: s.toPrecision(this.camera.quaternion.w, 4)
  3865. }
  3866. }
  3867. }
  3868. ,
  3869. t.exports = n
  3870. }
  3871. , {
  3872. "../enum/ControlActions": 20,
  3873. "../enum/ControlEvents": 21,
  3874. "../enum/Keys": 30,
  3875. "../enum/MouseButton": 34,
  3876. "../enum/Vectors": 50,
  3877. "../settings": 166,
  3878. "../util/common": 185,
  3879. "../util/math": 190,
  3880. events: 202,
  3881. three: 217
  3882. }],
  3883. 13: [function(u, d, e) {
  3884. (function(e) {
  3885. "use strict";
  3886. function t(e) {
  3887. this.camera = e,
  3888. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3889. this.lookVector = new s.Vector3,
  3890. this.lookSpeed = .05,
  3891. this.rotationAcc = new s.Vector2,
  3892. this.rotationSpeed = new s.Vector2,
  3893. this.lat = 0,
  3894. this.lon = 0,
  3895. this.phi = 0,
  3896. this.theta = 0,
  3897. this.enabled = !1,
  3898. this.locked = !1,
  3899. this.pointer = new s.Vector2(0,0),
  3900. this.rotationHistory = [],
  3901. this.rotationDifference = new s.Vector2,
  3902. this.pointerDragOn = !1,
  3903. this.pointerDragStart = new s.Vector2(0,0),
  3904. this.pinchDistance = 0,
  3905. this.moveStart = new s.Vector2,
  3906. this.moveTolerance = .01,
  3907. this.pointersLimit = 2,
  3908. this.pointers = []
  3909. }
  3910. var s = u("three")
  3911. , i = u("../util/logger")
  3912. , n = u("../settings")
  3913. , r = u("../util/common")
  3914. , o = u("../util/math")
  3915. , a = (u("../enum/Vectors"),
  3916. u("../enum/MouseButton"))
  3917. , l = u("../enum/Keys")
  3918. , c = u("../enum/ControlEvents")
  3919. , h = u("events").EventEmitter;
  3920. new i(e),
  3921. (t.prototype = Object.create(h.prototype)).usable = function() {
  3922. return this.enabled && !this.locked
  3923. }
  3924. ,
  3925. t.prototype.lookAt = function(e) {
  3926. var t = this.camera.position.clone().sub(e)
  3927. , i = Math.atan(t.z / t.x);
  3928. i += t.x < 0 ? Math.PI : 0,
  3929. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3930. this.lon = s.Math.radToDeg(i) + 180;
  3931. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3932. , r = Math.atan(t.y / n);
  3933. this.lat = -s.Math.radToDeg(r)
  3934. }
  3935. ,
  3936. t.prototype.startRotationFrom = function(e, t) {
  3937. o.convertScreenPositionToNDC(e, t, this.pointer),
  3938. this.pointerDragOn = !0,
  3939. this.pointerDragStart.copy(this.pointer),
  3940. this.moveStart.copy(this.pointer),
  3941. this.rotationHistory = [],
  3942. this.rotationSpeed.set(0, 0)
  3943. }
  3944. ,
  3945. t.prototype.onMouseOver = function(e) {
  3946. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3947. }
  3948. ,
  3949. t.prototype.onTouchStart = function(e) {
  3950. if (this.usable()) {
  3951. switch (e.preventDefault(),
  3952. e.stopPropagation(),
  3953. e.touches.length) {
  3954. case 1:
  3955. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3956. break;
  3957. case 2:
  3958. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3959. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3960. this.pinchDistance = Math.sqrt(t * t + i * i)
  3961. }
  3962. this.emit(c.InputStart, "touch")
  3963. }
  3964. }
  3965. ,
  3966. t.prototype.onPointerDown = function(e) {
  3967. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3968. id: e.pointerId,
  3969. clientX: e.clientX,
  3970. clientY: e.clientY
  3971. }),
  3972. e.touches = this.pointers,
  3973. this.onTouchStart(e),
  3974. this.emit(c.InputStart, "pointer"))
  3975. }
  3976. ,
  3977. t.prototype.onMouseDown = function(e) {
  3978. if (this.usable()) {
  3979. switch (e.preventDefault(),
  3980. e.stopPropagation(),
  3981. e.button) {
  3982. case a.LEFT:
  3983. this.startRotationFrom(e.clientX, e.clientY)
  3984. }
  3985. this.emit(c.InputStart, "mouse")
  3986. }
  3987. }
  3988. ,
  3989. t.prototype.updateRotation = function() {
  3990. if (this.usable() && this.pointerDragOn) {
  3991. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  3992. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  3993. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  3994. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  3995. , r = Math.atan2(e.y, i)
  3996. , o = Math.atan2(t.y, n);
  3997. this.rotationDifference.y = s.Math.radToDeg(r - o),
  3998. e.y = 0,
  3999. t.y = 0;
  4000. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4001. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4002. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4003. this.pointerDragStart.copy(this.pointer)
  4004. }
  4005. }
  4006. ,
  4007. t.prototype.onMouseMove = function(e) {
  4008. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4009. 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"))
  4010. }
  4011. ,
  4012. t.prototype.onTouchMove = function(e) {
  4013. if (this.usable())
  4014. switch (this.emit(c.Move, "touch"),
  4015. e.touches.length) {
  4016. case 1:
  4017. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4018. break;
  4019. case 2:
  4020. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4021. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4022. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4023. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4024. this.emit(c.Pinch, n),
  4025. this.pinchDistance -= n)
  4026. }
  4027. }
  4028. ,
  4029. t.prototype.onPointerMove = function(t) {
  4030. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4031. t.pointerId === e.id && (e.clientX = t.clientX,
  4032. e.clientY = t.clientY)
  4033. }),
  4034. t.touches = this.pointers,
  4035. this.onTouchMove(t))
  4036. }
  4037. ,
  4038. t.prototype.endRotation = function() {
  4039. this.pointerDragOn = !1;
  4040. var e = r.averageVectors(this.rotationHistory);
  4041. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4042. }
  4043. ,
  4044. t.prototype.onTouchEnd = function(e) {
  4045. this.usable() && (e.preventDefault(),
  4046. e.stopPropagation(),
  4047. this.endRotation())
  4048. }
  4049. ,
  4050. t.prototype.onMouseUp = function(e) {
  4051. this.usable() && (e.preventDefault(),
  4052. e.stopPropagation(),
  4053. this.endRotation())
  4054. }
  4055. ,
  4056. t.prototype.onPointerUp = function(i) {
  4057. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4058. i.pointerId === e.id && this.pointers.splice(t, 1)
  4059. }
  4060. .bind(this)),
  4061. i.touches = this.pointers,
  4062. this.onTouchEnd(i))
  4063. }
  4064. ,
  4065. t.prototype.update = function(e) {
  4066. for (this.lon,
  4067. this.lat,
  4068. this.updateRotation(),
  4069. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4070. this.rotationHistory.shift();
  4071. this.lon += this.rotationDifference.x,
  4072. this.lat += this.rotationDifference.y,
  4073. this.rotationDifference.set(0, 0),
  4074. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4075. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4076. this.lon += this.rotationSpeed.x * e,
  4077. this.lat += this.rotationSpeed.y * e,
  4078. this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4079. this.phi = s.Math.degToRad(90 - this.lat),
  4080. this.theta = s.Math.degToRad(this.lon),
  4081. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4082. this.lookVector.y = Math.cos(this.phi),
  4083. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4084. this.target.copy(this.lookVector).add(this.camera.position),
  4085. this.camera.lookAt(this.target)
  4086. }
  4087. ,
  4088. t.prototype.onMouseWheel = function(e) {
  4089. if (this.usable()) {
  4090. var t = e.wheelDelta || -e.detail;
  4091. this.emit(c.InteractionDirect),
  4092. this.emit(c.Scroll, t)
  4093. }
  4094. }
  4095. ,
  4096. t.prototype.onKeyDown = function(e) {
  4097. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4098. this.handleKeyDown(e.which)))
  4099. }
  4100. ,
  4101. t.prototype.handleKeyDown = function(e) {
  4102. var t = function(e, t) {
  4103. this.rotationAcc[e] = t
  4104. }
  4105. .bind(this);
  4106. this.emit(c.InteractionKey);
  4107. var i = !0;
  4108. switch (e) {
  4109. case l.LEFTARROW:
  4110. case l.J:
  4111. t("x", -1);
  4112. break;
  4113. case l.RIGHTARROW:
  4114. case l.L:
  4115. t("x", 1);
  4116. break;
  4117. case l.I:
  4118. t("y", 1);
  4119. break;
  4120. case l.K:
  4121. t("y", -1);
  4122. break;
  4123. default:
  4124. i = !1
  4125. }
  4126. i && this.emit(c.Move, "key")
  4127. }
  4128. ,
  4129. t.prototype.onKeyUp = function(e) {
  4130. this.usable() && (e.preventDefault(),
  4131. e.stopPropagation(),
  4132. this.handleKeyUp(e.which))
  4133. }
  4134. ,
  4135. t.prototype.handleKeyUp = function(e) {
  4136. switch (e) {
  4137. case l.LEFTARROW:
  4138. case l.J:
  4139. case l.RIGHTARROW:
  4140. case l.L:
  4141. this.rotationAcc.x = 0;
  4142. break;
  4143. case l.I:
  4144. case l.K:
  4145. this.rotationAcc.y = 0
  4146. }
  4147. }
  4148. ,
  4149. t.prototype.startRotating = function(e, t) {
  4150. e && (this.rotationAcc.x = e),
  4151. t && (this.rotationAcc.y = t)
  4152. }
  4153. ,
  4154. t.prototype.stopRotating = function(e) {
  4155. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4156. this.rotationAcc.set(0, 0)
  4157. }
  4158. ,
  4159. t.prototype.reset = function() {
  4160. this.pointerDragOn = !1,
  4161. this.rotationAcc.set(0, 0),
  4162. this.rotationSpeed.set(0, 0),
  4163. this.pointers = []
  4164. }
  4165. ,
  4166. t.prototype.toJSON = function() {
  4167. return {
  4168. camera_position: {
  4169. x: o.toPrecision(this.camera.position.x, 4),
  4170. y: o.toPrecision(this.camera.position.y, 4),
  4171. z: o.toPrecision(this.camera.position.z, 4)
  4172. },
  4173. camera_quaternion: {
  4174. x: o.toPrecision(this.camera.quaternion.x, 4),
  4175. y: o.toPrecision(this.camera.quaternion.y, 4),
  4176. z: o.toPrecision(this.camera.quaternion.z, 4),
  4177. w: o.toPrecision(this.camera.quaternion.w, 4)
  4178. }
  4179. }
  4180. }
  4181. ,
  4182. t.prototype.setStateFromJSON = function(e) {
  4183. this.camera.position.copy(e.camera_position),
  4184. this.camera.quaternion.copy(e.camera_quaternion)
  4185. }
  4186. ,
  4187. d.exports = t
  4188. }
  4189. ).call(this, "/js/controls/PanoramaControls.js")
  4190. }
  4191. , {
  4192. "../enum/ControlEvents": 21,
  4193. "../enum/Keys": 30,
  4194. "../enum/MouseButton": 34,
  4195. "../enum/Vectors": 50,
  4196. "../settings": 166,
  4197. "../util/common": 185,
  4198. "../util/logger": 189,
  4199. "../util/math": 190,
  4200. events: 202,
  4201. three: 217
  4202. }],
  4203. 14: [function(t, i, e) {
  4204. (function(e) {
  4205. "use strict";
  4206. var c = t("three")
  4207. , h = t("../enum/Viewmode")
  4208. , u = new (t("../util/logger"))(e);
  4209. i.exports = {
  4210. serialize: function(e) {
  4211. return encodeURI(JSON.stringify(e))
  4212. },
  4213. deserialize: function(e) {
  4214. function t(e) {
  4215. return e.reduce(function(e, t) {
  4216. return e && "number" == typeof t && !isNaN(t)
  4217. }, !0)
  4218. }
  4219. try {
  4220. var i = JSON.parse(decodeURI(e))
  4221. , n = {
  4222. mode: h.fromInt(i.camera_mode),
  4223. panoId: i.scan_id,
  4224. position: (new c.Vector3).copy(i.camera_position),
  4225. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4226. zoom: i.ortho_zoom,
  4227. floorVisibility: i.floor_visibility
  4228. }
  4229. , r = n.position;
  4230. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4231. var o = n.quaternion;
  4232. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4233. n
  4234. } catch (i) {
  4235. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4236. try {
  4237. var a = e.split(",")
  4238. , s = {
  4239. x: parseFloat(a[2]),
  4240. y: parseFloat(a[3]),
  4241. z: parseFloat(a[4])
  4242. }
  4243. , l = {
  4244. x: parseFloat(a[5]),
  4245. y: parseFloat(a[6]),
  4246. z: parseFloat(a[7]),
  4247. w: parseFloat(a[8])
  4248. };
  4249. return t([s.x, s.y, s.z]) || (s.x = 0,
  4250. s.y = 0,
  4251. s.z = 0),
  4252. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4253. l.y = 0,
  4254. l.z = 0,
  4255. l.w = 1),
  4256. {
  4257. mode: h.fromInt(a[0]),
  4258. panoId: a[1],
  4259. position: (new c.Vector3).copy(s),
  4260. quaternion: (new c.Quaternion).copy(l)
  4261. }
  4262. } catch (t) {
  4263. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4264. }
  4265. }
  4266. return null
  4267. }
  4268. }
  4269. }
  4270. ).call(this, "/js/controls/serializer.js")
  4271. }
  4272. , {
  4273. "../enum/Viewmode": 51,
  4274. "../util/logger": 189,
  4275. three: 217
  4276. }],
  4277. 15: [function(C, I, e) {
  4278. (function(e) {
  4279. "use strict";
  4280. function t() {
  4281. this.endlessLoop = r.warp.loop,
  4282. this.clock = new i.Clock(!0),
  4283. this.model = null,
  4284. this.player = null,
  4285. this.currentItem = null,
  4286. this.destinationItem = null,
  4287. this.tourIsPlaying = !1,
  4288. this.transitionStage = v.None,
  4289. this.nextFunc = null,
  4290. this.onTheBus = !1,
  4291. this.tourInProgress = !1,
  4292. this.reachSource = null,
  4293. this.interrupted = !1,
  4294. this.nItems = 0,
  4295. this.walkingSectionPaused = !1
  4296. }
  4297. var i = C("three")
  4298. , n = C("./util/logger")
  4299. , r = C("./settings")
  4300. , o = C("./util/transitions")
  4301. , a = C("events").EventEmitter
  4302. , s = C("./enum/Viewmode")
  4303. , l = C("./analytics")
  4304. , c = C("./enum/WarpStyle")
  4305. , h = (o = C("./util/transitions"),
  4306. C("./model/ModelManager"),
  4307. C("./enum/ModelManagerEvents"))
  4308. , u = C("./enum/DirectorEvents")
  4309. , d = C("./enum/PlayerEvents")
  4310. , p = (C("./enum/ControlEvents"),
  4311. C("./enum/BlackoutStyle"))
  4312. , f = C("./enum/PathDiscardMode")
  4313. , g = C("./enum/PathDisplayMode")
  4314. , m = (C("./player"),
  4315. new n(e))
  4316. , v = Object.freeze({
  4317. None: 0,
  4318. Moving: 1,
  4319. Aiming: 2,
  4320. Interlude: 3
  4321. })
  4322. , y = Object.freeze({
  4323. Forward: 1,
  4324. NoChange: 0,
  4325. Backwards: -1
  4326. })
  4327. , A = o.getUniqueId();
  4328. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4329. this.player = e,
  4330. this.modelManager = t,
  4331. this.updateModel(),
  4332. this.resetAll(),
  4333. this.bindEvents()
  4334. }
  4335. ,
  4336. t.prototype.resetAll = function() {
  4337. if (this.currentItem = null,
  4338. this.destinationItem = null,
  4339. this.tourIsPlaying = !1,
  4340. this.bgmReplay(),
  4341. this.transitionStage = v.None,
  4342. this.nextFunc = null,
  4343. this.onTheBus = !1,
  4344. this.reachSource = null,
  4345. this.interrupted = !1,
  4346. this.model) {
  4347. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4348. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4349. } else
  4350. this.defaultWarpStyle = c.BLACK,
  4351. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4352. this.resetSpecialTransition()
  4353. }
  4354. ,
  4355. t.prototype.updateModel = function() {
  4356. this.model = this.modelManager.getActiveModel(),
  4357. this.nItems = this.model.heroLocations.length
  4358. }
  4359. ,
  4360. t.prototype.bindEvents = function() {
  4361. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4362. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4363. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4364. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4365. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4366. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4367. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4368. this.player.once(d.Move, function() {
  4369. o.cancelById(A)
  4370. })
  4371. }
  4372. ,
  4373. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4374. return e === c.WALK && (this.interrupt(p.NONE),
  4375. this.pauseWalkingSection(),
  4376. this.player.fastForwardActivePanoFlight(),
  4377. !0)
  4378. }
  4379. ,
  4380. t.prototype.handlePlayerMove = function(e) {
  4381. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4382. this.emit("update.controls")
  4383. }
  4384. ,
  4385. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4386. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4387. this.emit("update.controls"))
  4388. }
  4389. ,
  4390. t.prototype.handlePlayerModeChanged = function(e, t) {
  4391. this.intermediateState() || e === t || (this.onTheBus = !1,
  4392. this.emit("update.controls"))
  4393. }
  4394. ,
  4395. t.prototype.handlePlayerInputStart = function(e) {
  4396. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4397. }
  4398. ,
  4399. t.prototype.handlePlayerFlyingStarted = function() {
  4400. this.clearWalkingSectionPaused()
  4401. }
  4402. ,
  4403. t.prototype.describe = function() {
  4404. return {
  4405. nItems: this.nItems,
  4406. currentItem: this.currentItem,
  4407. destinationItem: this.destinationItem,
  4408. tourIsPlaying: this.tourIsPlaying,
  4409. onTheBus: this.onTheBus,
  4410. endlessLoop: this.endlessLoop,
  4411. viewMode: this.player.mode,
  4412. inTransition: this._inTransition(),
  4413. transitionStage: this.transitionStage,
  4414. tourInProgress: this.tourInProgress
  4415. }
  4416. }
  4417. ,
  4418. t.prototype._inTransition = function() {
  4419. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4420. }
  4421. ,
  4422. t.prototype.bounceable = function() {
  4423. var e = this.clock.getDelta();
  4424. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4425. }
  4426. ,
  4427. t.prototype.currentMoveDirection = function() {
  4428. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4429. }
  4430. ,
  4431. t.prototype.clearPath = function() {
  4432. this._inTransition() || this.player.path.discardPathObject()
  4433. }
  4434. ,
  4435. t.prototype.allFloors = function() {
  4436. this.model.toggleAllFloors()
  4437. }
  4438. ,
  4439. t.prototype.actionComplete = function(e) {
  4440. if (this.interrupted = !1,
  4441. this.transitionStage = v.None,
  4442. this.resetSpecialTransition(),
  4443. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4444. this.tourIsPlaying || (this.player.disablePreRendering(),
  4445. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4446. this.emit("update.controls"),
  4447. this.nextFunc) {
  4448. var t = this.nextFunc;
  4449. this.nextFunc = null,
  4450. t()
  4451. }
  4452. }
  4453. ,
  4454. t.prototype.awaitCompletion = function(e, t) {
  4455. this.nextFunc = t,
  4456. e()
  4457. }
  4458. ,
  4459. t.prototype.updateSuccessFunction = function(e) {
  4460. this.nextFunc = e
  4461. }
  4462. ,
  4463. t.prototype.interrupt = function(e, t) {
  4464. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4465. this.tourIsPlaying = !1,
  4466. this.bgmReplay(),
  4467. this.interrupted = !0,
  4468. this.nextFunc = null,
  4469. this.emit(u.ActionInterrupted),
  4470. null != e || (e = p.BEGINNING),
  4471. this.player.interruptAndFastForward(e, t),
  4472. !0)
  4473. }
  4474. ,
  4475. t.prototype.wouldInterrupt = function() {
  4476. return this.transitionStage !== v.None
  4477. }
  4478. ,
  4479. t.prototype.intermediateState = function() {
  4480. return this.transitionStage !== v.None
  4481. }
  4482. ,
  4483. t.prototype.isInterrupted = function() {
  4484. return this.interrupted
  4485. }
  4486. ,
  4487. t.prototype.pauseWalkingSection = function() {
  4488. this.walkingSectionPaused = !0
  4489. }
  4490. ,
  4491. t.prototype.clearWalkingSectionPaused = function() {
  4492. this.walkingSectionPaused = !1
  4493. }
  4494. ,
  4495. t.prototype.autoTour = function() {
  4496. var i = Date.now();
  4497. this.model.auxDataPromise.then(function() {
  4498. i = Date.now() - i;
  4499. var e = r.warp.auto
  4500. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4501. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4502. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4503. done: function() {
  4504. this.playTour()
  4505. }
  4506. .bind(this),
  4507. name: "_atr",
  4508. id: A
  4509. })
  4510. }
  4511. .bind(this))
  4512. }
  4513. ,
  4514. t.prototype.atDestinationPano = function() {
  4515. if (!this.player.currentPano || null === this.destinationItem)
  4516. return !1;
  4517. var e = this.player.currentPano.id;
  4518. if (void 0 === e)
  4519. return !1;
  4520. var t = this.model.heroLocations;
  4521. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4522. }
  4523. ,
  4524. t.prototype.redirectToItem = function(e, t) {
  4525. if (null != e)
  4526. if (this.wouldInterrupt())
  4527. if (this.player.mode !== s.TRANSITIONING) {
  4528. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4529. var i = function() {
  4530. o.setTimeout(function() {
  4531. this.setDestinationItem(e),
  4532. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4533. }
  4534. .bind(this), 0)
  4535. }
  4536. .bind(this);
  4537. this.interrupt(p.END, 0),
  4538. this.updateSuccessFunction(i)
  4539. } else
  4540. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4541. else
  4542. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4543. else
  4544. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4545. }
  4546. ,
  4547. t.prototype.useSpecialTransition = function(e) {
  4548. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4549. this.nextWarpStyle = c.BLACK
  4550. }
  4551. ,
  4552. t.prototype.resetSpecialTransition = function() {
  4553. this.nextWarpStyle = this.defaultWarpStyle
  4554. }
  4555. ,
  4556. t.prototype.arrivedAtDestination = function(e) {
  4557. if (this.player.flying || this.player.isWarping())
  4558. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4559. else {
  4560. this.transitionStage = v.Aiming;
  4561. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4562. this.player.model.fadePanoMarkers(0),
  4563. this.awaitCompletion(function() {
  4564. this.resetSpecialTransition(),
  4565. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4566. }
  4567. .bind(this), t)
  4568. }
  4569. }
  4570. ,
  4571. t.prototype.goToDestination = function(e, t, i, n) {
  4572. if (void 0 !== g_data2.tourAudio && null !== g_data2.tourAudio) {
  4573. var r = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4574. if (r && 0 < r.music.length) {
  4575. var o = r.music.includes(g_Prefix.slice(-10)) ? r.music : g_Prefix + r.music;
  4576. g_tourAudio.src = manage.dealURL(o);
  4577. g_tourAudio.load(),
  4578. g_tourAudio.crossOrigin = "anonymous",
  4579. g_tourAudio.oncanplaythrough = function() {
  4580. g_tourAudio.play();
  4581. if(g_bgAudio && !g_bgAudio.paused){
  4582. manage.switchBgmState(false);
  4583. g_bgAudio.pauseByTour = true
  4584. }
  4585. g_playAudio = g_tourAudio;
  4586. }
  4587. }
  4588. }
  4589. if (this.onTheBus = !0,
  4590. this.emit("update.controls"),
  4591. this.player.updateLastView(),
  4592. n || !this.atDestinationPano())
  4593. if (this.player.flying || this.player.isWarping())
  4594. m.warn("Cannot go to new destination while player is flying or warping.");
  4595. else {
  4596. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4597. , s = null
  4598. , l = null;
  4599. if (a.isPano()) {
  4600. o = window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4601. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o, !0, i, this.actionComplete.bind(this)),
  4602. s = this.arrivedAtDestination.bind(this, !0)
  4603. } else
  4604. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4605. s = this.arrivedAtDestination.bind(this, !1);
  4606. this.transitionStage = v.Moving,
  4607. this.model.fadePanoMarkers(0),
  4608. this.awaitCompletion(function() {
  4609. l()
  4610. }
  4611. .bind(this), s),
  4612. this.emit("update.controls")
  4613. }
  4614. else
  4615. this.arrivedAtDestination(!0)
  4616. }
  4617. ,
  4618. t.prototype.tourInterlude = function() {
  4619. if (l.trackAlways("reach_highlight", {
  4620. reach_source: this.reachSource
  4621. }),
  4622. this.model.fadePanoMarkers(0),
  4623. this.emit("update.controls"),
  4624. this.tourIsPlaying)
  4625. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4626. this.stopTour(),
  4627. this.emit(u.TourEnd),
  4628. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4629. this.transitionStage = v.Interlude,
  4630. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4631. }
  4632. .bind(this), this.goNext.bind(this))
  4633. }
  4634. ,
  4635. t.prototype.playTour = function() {
  4636. if (!this.bounceable())
  4637. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4638. this.tourInProgress = !0,
  4639. this.reachSource = "play",
  4640. this.tourIsPlaying = !0,
  4641. this.wasZoomEnabled = this.player.zoomEnabled,
  4642. this.player.zoomEnabled = !1,
  4643. this.resetSpecialTransition(),
  4644. this.emit("update.controls"),
  4645. this.emit(u.TourStart),
  4646. this.player.enablePreRendering(),
  4647. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4648. this.goToDestination()) : this.goNext()))
  4649. }
  4650. ,
  4651. t.prototype.bgmReplay = function() {
  4652. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4653. g_playAudio = g_bgAudio;
  4654. g_tourAudio && g_tourAudio.pause();
  4655. //window.tourAudio && window.tourAudio.pause();
  4656. manage.switchBgmState(true);
  4657. }
  4658. }
  4659. ,
  4660. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4661. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4662. this.tourIsPlaying = !1,
  4663. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4664. this.interrupt(),
  4665. this.clearWalkingSectionPaused(),
  4666. this.resetSpecialTransition(),
  4667. this.emit("update.controls"))
  4668. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4669. {
  4670. g_tourAudio.pause();
  4671. g_tourAudio.src = ""
  4672. }
  4673. }
  4674. ,
  4675. t.prototype.endTourProgress = function() {
  4676. this.tourInProgress = !1,
  4677. this.emit("update.controls"),
  4678. this.emit(u.TourEnd)
  4679. }
  4680. ,
  4681. t.prototype.goToHighlight = function(e) {
  4682. if (this.wouldInterrupt())
  4683. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4684. else {
  4685. if (m.debug("<tour.goto " + e + ">"),
  4686. this.isInterrupted())
  4687. return;
  4688. this.clearWalkingSectionPaused(),
  4689. this.setDestinationItem(e),
  4690. this.useSpecialTransition("Hilight"),
  4691. this.goToDestination(),
  4692. l.trackAlways("reach_highlight", {
  4693. reach_source: "thumb"
  4694. })
  4695. }
  4696. }
  4697. ,
  4698. t.prototype.prevHighlight = function() {
  4699. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4700. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4701. this.reachSource = "prev",
  4702. this.goPrev()))
  4703. }
  4704. ,
  4705. t.prototype.nextHighlight = function() {
  4706. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4707. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4708. this.reachSource = "next",
  4709. this.goNext()))
  4710. }
  4711. ,
  4712. t.prototype.changeMode = function(e) {
  4713. var t = $.Deferred()
  4714. , i = t.resolve.bind(t)
  4715. , n = t.reject.bind(t);
  4716. if (this.emit(u.StartModeChange),
  4717. !function() {
  4718. return this.clearWalkingSectionPaused(),
  4719. !!this.wouldInterrupt() && (this.interrupt(),
  4720. !0)
  4721. }
  4722. .bind(this)()) {
  4723. switch (e) {
  4724. case s.PANORAMA:
  4725. 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);
  4726. break;
  4727. case s.DOLLHOUSE:
  4728. case s.FLOORPLAN:
  4729. this.player.flyToNewMode({
  4730. mode: e
  4731. }).done(i).fail(n);
  4732. break;
  4733. case s.OUTDOOR:
  4734. 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)
  4735. }
  4736. return t.promise()
  4737. }
  4738. }
  4739. ,
  4740. t.prototype.atEndOfTour = function() {
  4741. return this.currentItem >= this.nItems - 1
  4742. }
  4743. ,
  4744. t.prototype.firstDestination = function() {
  4745. return 0 < this.nItems ? 0 : null
  4746. }
  4747. ,
  4748. t.prototype.finalDestination = function() {
  4749. return 0 < this.nItems ? this.nItems - 1 : null
  4750. }
  4751. ,
  4752. t.prototype.goPrev = function() {
  4753. this.tourAdvance(-1)
  4754. }
  4755. ,
  4756. t.prototype.goNext = function() {
  4757. this.tourAdvance(1)
  4758. }
  4759. ,
  4760. t.prototype.setDestinationItem = function(e) {
  4761. this.destinationItem = e,
  4762. this.emit("update.controls")
  4763. }
  4764. ,
  4765. t.prototype.setCurrentItem = function(e) {
  4766. this.currentItem = e,
  4767. this.emit("update.controls")
  4768. }
  4769. ,
  4770. t.prototype.nextItem = function(e) {
  4771. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4772. }
  4773. ,
  4774. t.prototype.prevItem = function(e) {
  4775. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4776. }
  4777. ,
  4778. t.prototype.tourAdvance = function(e) {
  4779. if (m.debug("tourAdvance(" + e + ")"),
  4780. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4781. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4782. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4783. this.useSpecialTransition("looping back to start")),
  4784. "black" === window.MP_PREFETCHED_MODELDATA.momentTour) {
  4785. var i = this.player.zoomLevel;
  4786. this.player.zoomEnabled = !0;
  4787. var t = function(e, t) {
  4788. this.player.zoomTo((1 - e) * i, !0)
  4789. }
  4790. .bind(this);
  4791. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4792. }
  4793. this.goToDestination()
  4794. }
  4795. ,
  4796. I.exports = t
  4797. }
  4798. ).call(this, "/js/director.js")
  4799. }
  4800. , {
  4801. "./analytics": 4,
  4802. "./enum/BlackoutStyle": 18,
  4803. "./enum/ControlEvents": 21,
  4804. "./enum/DirectorEvents": 23,
  4805. "./enum/ModelManagerEvents": 33,
  4806. "./enum/PathDiscardMode": 38,
  4807. "./enum/PathDisplayMode": 39,
  4808. "./enum/PlayerEvents": 40,
  4809. "./enum/Viewmode": 51,
  4810. "./enum/WarpStyle": 52,
  4811. "./model/ModelManager": 140,
  4812. "./player": 155,
  4813. "./settings": 166,
  4814. "./util/logger": 189,
  4815. "./util/transitions": 195,
  4816. events: 202,
  4817. three: 217
  4818. }],
  4819. 16: [function(e, t, i) {
  4820. "use strict";
  4821. var n = e("three")
  4822. , r = e("./enum/Viewmode")
  4823. , o = (e("./settings"),
  4824. e("./util/transitions"))
  4825. , a = e("./enum/PlayerEvents")
  4826. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4827. , l = new n.ShaderPass(n.VerticalBlurShader);
  4828. l.renderToScreen = !0;
  4829. var c = $("#player").width() / $("#player").height();
  4830. isNaN(c) && (c = 1);
  4831. var h = {
  4832. currentBlur: 0,
  4833. aspect: c,
  4834. blurStrength: 1,
  4835. hblurPass: s,
  4836. vblurPass: l,
  4837. bindEvents: function(e) {
  4838. e.on(a.ModeChanged, function(e, t) {
  4839. e === r.PANORAMA && (o.cancel(h.blur),
  4840. o.cancel(h.addBlur),
  4841. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4842. })
  4843. },
  4844. blur: function(e) {
  4845. var t = (h.currentBlur = e) * h.blurStrength;
  4846. l.uniforms.v.value = t / 512 * h.aspect,
  4847. s.uniforms.h.value = t / 512
  4848. },
  4849. addBlur: function(e) {
  4850. e = Math.max(e, h.currentBlur),
  4851. h.blur(e)
  4852. },
  4853. removeBlur: function(e) {
  4854. e = Math.min(1 - e, h.currentBlur),
  4855. h.blur(e)
  4856. }
  4857. };
  4858. h.blur(0),
  4859. t.exports = h
  4860. }
  4861. , {
  4862. "./enum/PlayerEvents": 40,
  4863. "./enum/Viewmode": 51,
  4864. "./settings": 166,
  4865. "./util/transitions": 195,
  4866. three: 217
  4867. }],
  4868. 17: [function(e, t, i) {
  4869. "use strict";
  4870. t.exports = {
  4871. UNKNOWN: 0,
  4872. ALIGNED: 1,
  4873. UNALIGNED: 2,
  4874. PLACED: 3
  4875. }
  4876. }
  4877. , {}],
  4878. 18: [function(e, t, i) {
  4879. "use strict";
  4880. t.exports = {
  4881. NONE: 0,
  4882. MIDDLE: 1,
  4883. END: 2,
  4884. BEGINNING: 3,
  4885. FADEIN: 4
  4886. }
  4887. }
  4888. , {}],
  4889. 19: [function(e, t, i) {
  4890. "use strict";
  4891. var r = e("three");
  4892. t.exports = {
  4893. newBlue: new r.Color(4967932),
  4894. altBlue: new r.Color(47355),
  4895. tagDefault: new r.Color(223357),
  4896. classicBlue: new r.Color(53759),
  4897. mpYellow: new r.Color(16502016),
  4898. mpOrange: new r.Color(16428055),
  4899. mpBlue: new r.Color(12096),
  4900. mpLtGrey: new r.Color(13751252),
  4901. mpDkGrey: new r.Color(10000019),
  4902. mpRed: new r.Color(12525854),
  4903. mpOrangeDesat: new r.Color(16764529),
  4904. mpBlueDesat: new r.Color(4034734),
  4905. mpRedDesat: new r.Color(14705505),
  4906. white: new r.Color(16777215),
  4907. black: new r.Color(0),
  4908. _desat: function(e, t) {
  4909. var i = t || .3
  4910. , n = (new r.Color).copy(e).getHSL();
  4911. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  4912. },
  4913. _darken: function(e, t) {
  4914. var i = t || .2
  4915. , n = e.getHSL();
  4916. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  4917. }
  4918. }
  4919. }
  4920. , {
  4921. three: 217
  4922. }],
  4923. 20: [function(e, t, i) {
  4924. "use strict";
  4925. t.exports = {
  4926. NONE: -1,
  4927. ROTATE: 0,
  4928. DOLLY: 1,
  4929. PAN: 2,
  4930. ROTATE_DOLLY: 3,
  4931. PAN_DOLLY: 4
  4932. }
  4933. }
  4934. , {}],
  4935. 21: [function(e, t, i) {
  4936. "use strict";
  4937. t.exports = {
  4938. Move: "move",
  4939. InteractionDirect: "interaction.direct",
  4940. InteractionKey: "interaction.key",
  4941. InteractionGui: "interaction.gui",
  4942. FlyInDirection: "fly.direction",
  4943. InputStart: "input.start",
  4944. Pinch: "input.pinch",
  4945. Scroll: "input.scroll",
  4946. AutoPanInterrupt: "autopan.interrupt",
  4947. AutoPanComplete: "autopan.complete",
  4948. AutoPanClamped: "autopan.clamped",
  4949. LongTap: "longtap"
  4950. }
  4951. }
  4952. , {}],
  4953. 22: [function(e, t, i) {
  4954. "use strict";
  4955. t.exports = Object.freeze({
  4956. FORWARD: "FORWARD",
  4957. LEFT: "LEFT",
  4958. RIGHT: "RIGHT",
  4959. BACK: "BACK",
  4960. UP: "UP",
  4961. DOWN: "DOWN"
  4962. })
  4963. }
  4964. , {}],
  4965. 23: [function(e, t, i) {
  4966. "use strict";
  4967. t.exports = {
  4968. ActionInterrupted: "action.interrupted",
  4969. TourStart: "tour.start",
  4970. TourEnd: "tour.end",
  4971. StartModeChange: "mode.startChange"
  4972. }
  4973. }
  4974. , {}],
  4975. 24: [function(e, t, i) {
  4976. "use strict";
  4977. t.exports = Object.freeze({
  4978. None: 0,
  4979. Queued: 1,
  4980. ForceQueued: 2,
  4981. Downloading: 3,
  4982. Downloaded: 4,
  4983. DownloadFailed: 5
  4984. })
  4985. }
  4986. , {}],
  4987. 25: [function(e, t, i) {
  4988. "use strict";
  4989. t.exports = {
  4990. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  4991. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  4992. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  4993. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  4994. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  4995. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  4996. }
  4997. }
  4998. , {}],
  4999. 26: [function(e, t, i) {
  5000. "use strict";
  5001. t.exports = {
  5002. Texture2D: 0,
  5003. TextureCube: 1
  5004. }
  5005. }
  5006. , {}],
  5007. 27: [function(e, t, i) {
  5008. "use strict";
  5009. t.exports = {
  5010. SMALL: "small",
  5011. LARGE: "large"
  5012. }
  5013. }
  5014. , {}],
  5015. 28: [function(e, t, i) {
  5016. "use strict";
  5017. var n = e("./Viewmode")
  5018. , r = {
  5019. LANDING: {},
  5020. NAVIGATION: "navigation",
  5021. MORE_HELP: "moreHelp",
  5022. TOUR_INTERACTION: {}
  5023. };
  5024. r.LANDING[n.PANORAMA] = "panorama.landing",
  5025. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5026. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5027. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5028. r.TOUR_INTERACTION.standard = "standard.tour",
  5029. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5030. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5031. t.exports = r
  5032. }
  5033. , {
  5034. "./Viewmode": 51
  5035. }],
  5036. 29: [function(e, t, i) {
  5037. "use strict";
  5038. var n = {
  5039. UP: 1,
  5040. DOWN: -1,
  5041. LEFT: "L",
  5042. RIGHT: "R",
  5043. FORWARD: "F",
  5044. BACK: "B",
  5045. reverse: {},
  5046. opposite: function(e) {
  5047. return this.reverse[e.toString()]
  5048. }
  5049. };
  5050. n.reverse[n.UP] = n.DOWN,
  5051. n.reverse[n.DOWN] = n.UP,
  5052. n.reverse[n.LEFT] = n.RIGHT,
  5053. n.reverse[n.RIGHT] = n.LEFT,
  5054. n.reverse[n.FORWARD] = n.BACK,
  5055. n.reverse[n.BACK] = n.FORWARD,
  5056. t.exports = n
  5057. }
  5058. , {}],
  5059. 30: [function(e, t, i) {
  5060. "use strict";
  5061. var n = {
  5062. ZERO: 48,
  5063. ONE: 49,
  5064. TWO: 50,
  5065. THREE: 51,
  5066. FOUR: 52,
  5067. FIVE: 53,
  5068. SIX: 54,
  5069. SEVEN: 55,
  5070. EIGHT: 56,
  5071. NINE: 57,
  5072. LEFTARROW: 37,
  5073. UPARROW: 38,
  5074. RIGHTARROW: 39,
  5075. DOWNARROW: 40,
  5076. A: 65,
  5077. B: 66,
  5078. C: 67,
  5079. D: 68,
  5080. E: 69,
  5081. F: 70,
  5082. G: 71,
  5083. H: 72,
  5084. I: 73,
  5085. J: 74,
  5086. K: 75,
  5087. L: 76,
  5088. M: 77,
  5089. N: 78,
  5090. O: 79,
  5091. P: 80,
  5092. Q: 81,
  5093. R: 82,
  5094. S: 83,
  5095. T: 84,
  5096. U: 85,
  5097. V: 86,
  5098. W: 87,
  5099. X: 88,
  5100. Y: 89,
  5101. Z: 90,
  5102. SPACE: 32,
  5103. RETURN: 13,
  5104. SEMICOLON: 186,
  5105. PLUSEQUALS: 187,
  5106. DASHUNDERSCORE: 189,
  5107. OPENBRACKET: 219
  5108. };
  5109. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5110. n.PLUSEQUALS = 61,
  5111. n.DASHUNDERSCORE = 173),
  5112. t.exports = n
  5113. }
  5114. , {
  5115. "../util/browser": 182
  5116. }],
  5117. 31: [function(e, t, i) {
  5118. "use strict";
  5119. t.exports = {
  5120. EN_US: "en-US",
  5121. ES_MX: "es-MX",
  5122. FR_FR: "fr-FR",
  5123. DE_DE: "de-DE",
  5124. RU_RU: "ru-RU",
  5125. CN_CN: "cn-CN",
  5126. JP_JP: "jp-JP"
  5127. }
  5128. }
  5129. , {}],
  5130. 32: [function(e, t, i) {
  5131. "use strict";
  5132. t.exports = {
  5133. TagActivated: "tag.activated",
  5134. TagDismissed: "tag.dismissed",
  5135. TagNavigation: "tag.navigation"
  5136. }
  5137. }
  5138. , {}],
  5139. 33: [function(e, t, i) {
  5140. "use strict";
  5141. t.exports = {
  5142. ModelAdded: "model-added",
  5143. ActiveModelChanged: "active-model-changed"
  5144. }
  5145. }
  5146. , {}],
  5147. 34: [function(e, t, i) {
  5148. "use strict";
  5149. t.exports = {
  5150. LEFT: 0,
  5151. MIDDLE: 1,
  5152. RIGHT: 2
  5153. }
  5154. }
  5155. , {}],
  5156. 35: [function(e, t, i) {
  5157. "use strict";
  5158. t.exports = {
  5159. PanoRenderComplete: "panorama.render.complete",
  5160. TileRenderFailure: "panorama.tile.render.failed",
  5161. TileRenderSuccess: "panorama.tile.render.success",
  5162. TileUploadAttempted: "panorama.tile.upload.attempted",
  5163. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5164. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5165. }
  5166. }
  5167. , {}],
  5168. 36: [function(e, t, i) {
  5169. "use strict";
  5170. t.exports = {
  5171. BASE: 1,
  5172. STANDARD: 2,
  5173. HIGH: 3,
  5174. ULTRAHIGH: 4
  5175. }
  5176. }
  5177. , {}],
  5178. 37: [function(e, t, i) {
  5179. "use strict";
  5180. t.exports = {
  5181. LoadComplete: "panorama.load.complete",
  5182. LoadFailed: "panorama.load.failed",
  5183. TileLoaded: "panorama.tile.loaded"
  5184. }
  5185. }
  5186. , {}],
  5187. 38: [function(e, t, i) {
  5188. "use strict";
  5189. t.exports = Object.freeze({
  5190. Standard: 0,
  5191. Slow: 1,
  5192. Retain: 2
  5193. })
  5194. }
  5195. , {}],
  5196. 39: [function(e, t, i) {
  5197. "use strict";
  5198. t.exports = Object.freeze({
  5199. Show: 0,
  5200. Hide: 1,
  5201. Retain: 2
  5202. })
  5203. }
  5204. , {}],
  5205. 40: [function(e, t, i) {
  5206. "use strict";
  5207. t.exports = {
  5208. Move: "move",
  5209. MoveComplete: "move.complete",
  5210. ModeChanged: "mode.changed",
  5211. ModeChanging: "mode.changing",
  5212. PanoChosen: "pano.chosen",
  5213. ClosestPanoChanging: "closest.pano.changing",
  5214. WarpStarted: "warp.started",
  5215. WarpInterrupted: "warp.interrupted",
  5216. WarpEnded: "warp.ended",
  5217. FlyinFinished: "flyin.finished",
  5218. FlyingStarted: "flying.started",
  5219. FlyingInterrupted: "flying.interrupted",
  5220. FlyingEnded: "flying.ended",
  5221. Ready: "ready",
  5222. StartInside: "start.inside",
  5223. StartOutside: "start.outside",
  5224. ViewChanged: "view.changed",
  5225. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5226. InputStart: "input.start"
  5227. }
  5228. }
  5229. , {}],
  5230. 41: [function(e, t, i) {
  5231. "use strict";
  5232. t.exports = Object.freeze({
  5233. DEFAULT: 0,
  5234. PANOMARKERS: 1,
  5235. RETICULE: 2,
  5236. TAG: 3
  5237. })
  5238. }
  5239. , {}],
  5240. 42: [function(e, t, i) {
  5241. "use strict";
  5242. t.exports = {
  5243. visibleFloor: 1,
  5244. ghostFloor: 3,
  5245. boundingSkybox: 1,
  5246. panoMarker: 2,
  5247. reticule: 3,
  5248. tagStem: 4,
  5249. tagDisc: 5,
  5250. ribbon: 100
  5251. }
  5252. }
  5253. , {}],
  5254. 43: [function(e, t, i) {
  5255. "use strict";
  5256. t.exports = {
  5257. ContextCreated: "scene-renderer-context-created",
  5258. AfterRender: "after-render",
  5259. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5260. }
  5261. }
  5262. , {}],
  5263. 44: [function(e, t, i) {
  5264. "use strict";
  5265. t.exports = {
  5266. IDLE: "idle",
  5267. BROWSE: "browse",
  5268. EXAMINE: "examine"
  5269. }
  5270. }
  5271. , {}],
  5272. 45: [function(e, t, i) {
  5273. "use strict";
  5274. t.exports = {
  5275. TileDownloadSuccess: "tiledownloader.download.success",
  5276. TileDownloadFailure: "tiledownloader.download.failure",
  5277. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5278. }
  5279. }
  5280. , {}],
  5281. 46: [function(e, t, i) {
  5282. "use strict";
  5283. t.exports = {
  5284. CardboardAndroid: "googlevr",
  5285. GearVR: "gearvr",
  5286. CardboardIOS: "googlevrios",
  5287. Cardboard: "googlevr"
  5288. }
  5289. }
  5290. , {}],
  5291. 47: [function(e, t, i) {
  5292. "use strict";
  5293. t.exports = {
  5294. NONE: 0,
  5295. CONTEXTUAL: 1,
  5296. ANDROID: 2
  5297. }
  5298. }
  5299. , {}],
  5300. 48: [function(e, t, i) {
  5301. "use strict";
  5302. var n = {
  5303. Title: 0,
  5304. Cardboard: 1
  5305. }
  5306. , r = {
  5307. Title: 0,
  5308. Cardboard: 1,
  5309. Gear: 2
  5310. };
  5311. [n, r].forEach(function(e) {
  5312. e.pageCount = Object.keys(e).length
  5313. }),
  5314. t.exports.ios = n,
  5315. t.exports.standard = r
  5316. }
  5317. , {}],
  5318. 49: [function(e, t, i) {
  5319. "use strict";
  5320. t.exports = {
  5321. Android: "android",
  5322. IOS: "ios",
  5323. Desktop: "desktop",
  5324. UnsupportedAndroid: "android-unsupported"
  5325. }
  5326. }
  5327. , {}],
  5328. 50: [function(e, t, i) {
  5329. "use strict";
  5330. var n = e("three");
  5331. t.exports = {
  5332. UP: new n.Vector3(0,1,0),
  5333. DOWN: new n.Vector3(0,-1,0),
  5334. LEFT: new n.Vector3(-1,0,0),
  5335. RIGHT: new n.Vector3(1,0,0),
  5336. FORWARD: new n.Vector3(0,0,-1),
  5337. BACK: new n.Vector3(0,0,1)
  5338. }
  5339. }
  5340. , {
  5341. three: 217
  5342. }],
  5343. 51: [function(e, t, i) {
  5344. "use strict";
  5345. var n = e("../exception/ViewmodeConvertException")
  5346. , r = e("./coreViewmodes")
  5347. , o = {
  5348. MESH: "mesh",
  5349. OUTDOOR: "outdoor",
  5350. TRANSITIONING: "transitioning",
  5351. toInt: function(e) {
  5352. switch (e) {
  5353. case this.PANORAMA:
  5354. return 1;
  5355. case this.DOLLHOUSE:
  5356. return 2;
  5357. case this.FLOORPLAN:
  5358. return 3;
  5359. case this.OUTDOOR:
  5360. return 4;
  5361. case this.TRANSITIONING:
  5362. return -1
  5363. }
  5364. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5365. },
  5366. fromInt: function(e) {
  5367. switch (e) {
  5368. case "1":
  5369. case 1:
  5370. return this.PANORAMA;
  5371. case "2":
  5372. case 2:
  5373. return this.DOLLHOUSE;
  5374. case "3":
  5375. case 3:
  5376. return this.FLOORPLAN;
  5377. case "4":
  5378. case 4:
  5379. return this.OUTDOOR
  5380. }
  5381. throw new n("No known conversion for int to viewmode for int: " + e)
  5382. },
  5383. convertWorkshopModeInt: function(e) {
  5384. switch (e) {
  5385. case "0":
  5386. case 0:
  5387. case void 0:
  5388. return this.PANORAMA;
  5389. case "1":
  5390. case 1:
  5391. return this.FLOORPLAN;
  5392. case "2":
  5393. case 2:
  5394. return this.DOLLHOUSE;
  5395. case "3":
  5396. case 3:
  5397. return this.MESH
  5398. }
  5399. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5400. }
  5401. };
  5402. e("../util/common").extendObject(o, r),
  5403. t.exports = o
  5404. }
  5405. , {
  5406. "../exception/ViewmodeConvertException": 58,
  5407. "../util/common": 185,
  5408. "./coreViewmodes": 54
  5409. }],
  5410. 52: [function(e, t, i) {
  5411. "use strict";
  5412. t.exports = {
  5413. BLACK: "black",
  5414. STD: "std",
  5415. WALK: "walk"
  5416. }
  5417. }
  5418. , {}],
  5419. 53: [function(e, t, i) {
  5420. "use strict";
  5421. t.exports = {
  5422. ZoomIn: "zoom.in",
  5423. ZoomOut: "zoom.out",
  5424. ZoomMax: "zoom.max",
  5425. ZoomMin: "zoom.min"
  5426. }
  5427. }
  5428. , {}],
  5429. 54: [function(e, t, i) {
  5430. "use strict";
  5431. t.exports = {
  5432. PANORAMA: "panorama",
  5433. DOLLHOUSE: "dollhouse",
  5434. FLOORPLAN: "floorplan"
  5435. }
  5436. }
  5437. , {}],
  5438. 55: [function(e, t, i) {
  5439. "use strict";
  5440. t.exports = function(e) {
  5441. this.message = e
  5442. }
  5443. }
  5444. , {}],
  5445. 56: [function(e, t, i) {
  5446. "use strict";
  5447. function n(e) {
  5448. r.call(this, e)
  5449. }
  5450. var r = e("./BasicException");
  5451. n.prototype = Object.create(r.prototype),
  5452. t.exports = n
  5453. }
  5454. , {
  5455. "./BasicException": 55
  5456. }],
  5457. 57: [function(e, t, i) {
  5458. "use strict";
  5459. function n(e) {
  5460. r.call(this, e)
  5461. }
  5462. var r = e("./BasicException");
  5463. n.prototype = Object.create(r.prototype),
  5464. t.exports = n
  5465. }
  5466. , {
  5467. "./BasicException": 55
  5468. }],
  5469. 58: [function(e, t, i) {
  5470. "use strict";
  5471. function n(e) {
  5472. r.call(this, e)
  5473. }
  5474. var r = e("./BasicException");
  5475. n.prototype = Object.create(r.prototype),
  5476. t.exports = n
  5477. }
  5478. , {
  5479. "./BasicException": 55
  5480. }],
  5481. 59: [function(a, s, e) {
  5482. (function(e) {
  5483. "use strict";
  5484. var i = a("./util/ajax")
  5485. , n = a("./util/showcase")
  5486. , t = a("./util/logger")
  5487. , r = new t(e)
  5488. , o = {};
  5489. s.exports = {
  5490. loadFeatureFlags: function(e) {
  5491. var t = $.Deferred();
  5492. return i.get(e.urlBase + "", {
  5493. responseType: "json",
  5494. prefetchFrom: "user",
  5495. auth: n.getAuthorizationHeader()
  5496. }).done(function(e) {
  5497. (o = function(e) {
  5498. var t = {};
  5499. if (e) {
  5500. var i = e.flags;
  5501. if (i)
  5502. for (var n in i)
  5503. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5504. return t
  5505. }
  5506. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5507. null
  5508. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5509. }).fail(function() {
  5510. r.debug("Retrieval of feature flags failed."),
  5511. t.reject("loading-failed")
  5512. }),
  5513. t.promise()
  5514. },
  5515. getFlags: function() {
  5516. return o
  5517. },
  5518. updateDependentSettings: function(e, t) {
  5519. (e = e || o).labels && (t.labels.enabled = !0),
  5520. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5521. e.showcase_sdk && (t.sdkInit = !0),
  5522. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5523. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5524. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5525. e.hide_sc_sharing && (t.share.enabled = !1)
  5526. }
  5527. }
  5528. }
  5529. ).call(this, "/js/featureflags.js")
  5530. }
  5531. , {
  5532. "./util/ajax": 181,
  5533. "./util/logger": 189,
  5534. "./util/showcase": 193
  5535. }],
  5536. 60: [function(e, t, i) {
  5537. "use strict";
  5538. var n = (e("../util/common"),
  5539. {
  5540. status: 0,
  5541. set: function(e) {
  5542. if (isNaN(e))
  5543. return !1;
  5544. var t = $(".progressbar");
  5545. e < 0 && (e = 0),
  5546. 100 < e && (e = 100);
  5547. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5548. , n = Math.round(e)
  5549. , r = parseInt(i) - 15;
  5550. t.find(".bar").css("width", i),
  5551. t.find(".label").css("left", r),
  5552. t.find(".perc").text(n + "%"),
  5553. this.status = e
  5554. },
  5555. done: function(e) {
  5556. return e || this.status ? (this.status = null,
  5557. this.set(100)) : this
  5558. }
  5559. });
  5560. t.exports.circleLoader = n
  5561. }
  5562. , {
  5563. "../util/common": 185
  5564. }],
  5565. 61: [function(e, t, i) {
  5566. "use strict";
  5567. t.exports = Object.freeze({
  5568. CLOSE: "modal.closer.close"
  5569. })
  5570. }
  5571. , {}],
  5572. 62: [function(e, t, i) {
  5573. "use strict";
  5574. function n(t, e) {
  5575. function i() {
  5576. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5577. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5578. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5579. c.classList.remove("closeByFooter")))
  5580. }
  5581. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5582. }
  5583. var r = e("../../settings")
  5584. , o = (e("../../tag/Media/MediaEvent"),
  5585. e("../../util/browser"))
  5586. , a = e("../../util/common")
  5587. , s = e("./ModalCloserEvent")
  5588. , l = e("events").EventEmitter
  5589. , c = document.getElementsByClassName("footer")[0]
  5590. , h = c.querySelectorAll(".close")[0]
  5591. , u = null
  5592. , d = null
  5593. , p = null
  5594. , f = (o.isMobile(),
  5595. {
  5596. open: function(e) {
  5597. e && (n(e),
  5598. u && h.removeEventListener("click", u, !0),
  5599. u = function(e, t) {
  5600. t && (t.stopPropagation(),
  5601. t.preventDefault()),
  5602. e && this.emit(s.CLOSE, e),
  5603. f.reset()
  5604. }
  5605. .bind(this, e.id),
  5606. h.addEventListener("click", u, !0),
  5607. d && window.removeEventListener("resize", d, !0),
  5608. d = n.bind(this, e),
  5609. window.addEventListener("resize", d, !0))
  5610. },
  5611. reset: function() {
  5612. c.classList.remove("closeByFooter"),
  5613. h.removeEventListener("click", u, !0),
  5614. window.removeEventListener("resize", d, !0),
  5615. u = d = p = null
  5616. }
  5617. });
  5618. a.extendObject(f, l.prototype),
  5619. t.exports = f
  5620. }
  5621. , {
  5622. "../../tag/Media/MediaEvent": 131,
  5623. "../../settings": 166,
  5624. "../../util/browser": 182,
  5625. "../../util/common": 185,
  5626. "./ModalCloserEvent": 61,
  5627. events: 202
  5628. }],
  5629. 63: [function(e, t, i) {
  5630. "use strict";
  5631. var A = e("../lib/dat.gui")
  5632. , C = e("three")
  5633. , I = e("../util/easing")
  5634. , E = e("../enum/Viewmode")
  5635. , _ = e("../enum/Colors")
  5636. , b = e("../enum/WarpStyle")
  5637. , w = e("../settings");
  5638. e("../tag/tag"),
  5639. A.GUI.prototype.removeFolder = function(e) {
  5640. var t = this.__folders[e];
  5641. t && (t.close(),
  5642. this.__ul.removeChild(t.domElement.parentNode),
  5643. delete this.__folders[e],
  5644. this.onResize())
  5645. }
  5646. ,
  5647. t.exports.toggle = function(t, e, i) {
  5648. var n = new A.GUI({
  5649. width: 400
  5650. })
  5651. , r = n.addFolder("Flydown from Dollhouse");
  5652. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5653. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5654. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5655. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5656. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5657. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5658. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5659. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5660. var o = n.addFolder("Transition between panos");
  5661. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5662. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5663. w.transition.flyTime = 0,
  5664. o.__controllers.forEach(function(e) {
  5665. e.updateDisplay()
  5666. })
  5667. }),
  5668. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5669. w.transition.flySpeed = 0,
  5670. o.__controllers.forEach(function(e) {
  5671. e.updateDisplay()
  5672. })
  5673. }),
  5674. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5675. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5676. o.add(w.transition, "movementEasing", Object.keys(I));
  5677. var a = n.addFolder("Path Display");
  5678. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5679. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5680. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5681. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5682. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5683. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5684. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5685. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5686. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5687. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5688. w.path.color = _[w.path.color],
  5689. w.path.colorUp = _._desat(w.path.color),
  5690. w.path.colorDown = _.darken(w.path.color)
  5691. }),
  5692. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5693. w.reticuleColor = _[w.reticuleColor]
  5694. });
  5695. var s = n.addFolder("Warping")
  5696. , l = s.addFolder("Warp/Teleport");
  5697. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5698. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5699. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5700. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5701. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5702. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5703. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5704. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5705. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5706. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5707. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5708. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5709. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5710. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5711. w.path.typ = b[w.path.typ]
  5712. }),
  5713. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5714. e.endlessLoop = w.warp.loop
  5715. }),
  5716. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5717. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5718. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5719. var c = s.addFolder("Long Warp Only");
  5720. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5721. w.warp.flySpeed = 0,
  5722. c.__controllers.forEach(function(e) {
  5723. e.updateDisplay()
  5724. })
  5725. }),
  5726. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5727. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5728. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5729. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5730. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5731. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5732. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5733. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5734. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5735. var h = n.addFolder("Warp Esoterica");
  5736. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5737. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5738. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5739. w.warp.minWarpTime = 0,
  5740. h.__controllers.forEach(function(e) {
  5741. e.updateDisplay()
  5742. })
  5743. }),
  5744. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5745. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5746. h.add(w.warp, "movementEasing", Object.keys(I));
  5747. var u = n.addFolder("Misc");
  5748. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5749. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5750. }),
  5751. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5752. i.cameras[E.PANORAMA].fov = w.insideFOV
  5753. }),
  5754. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5755. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5756. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5757. var d = n.addFolder("Navigation");
  5758. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5759. w.navigation.panoScores || t.panos.forEach(function(e) {
  5760. e.floor.remove(e.text3d),
  5761. e.text3d = null
  5762. })
  5763. }),
  5764. d.add(w.navigation, "mouseDirection"),
  5765. d.add(w.navigation, "filterStrictness", 0, 1),
  5766. d.add(w.navigation, "angleFactor", -60, 0),
  5767. d.add(w.navigation, "directionFactor", 1, 20),
  5768. d.add(w.navigation, "distanceFactor", -5, 5),
  5769. d.add(w.navigation, "optionalityFactor", .1, 10);
  5770. var p = n.addFolder("tags")
  5771. , f = p.addFolder("Tag Creation");
  5772. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5773. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5774. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5775. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5776. var g = p.addFolder("Visibility");
  5777. g.add(w.tags.visibility, "anyDistance"),
  5778. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5779. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5780. g.add(w.tags.visibility, "hideViaFloor"),
  5781. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5782. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5783. var m = p.addFolder("Disc Parameters");
  5784. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5785. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5786. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5787. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5788. }),
  5789. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5790. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5791. }),
  5792. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5793. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5794. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5795. var v = p.addFolder("Navigate");
  5796. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5797. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5798. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5799. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5800. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5801. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5802. var y = n.addFolder("Debug");
  5803. y.add(w, "wireframe").onFinishChange(function() {
  5804. t.chunks.forEach(function(e) {
  5805. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5806. e.wireframeTwin.material.depthWrite = !1,
  5807. e.wireframeTwin.material.depthTest = !1,
  5808. e.wireframeTwin.material.opacity = .5,
  5809. e.wireframeTwin.material.transparent = !0),
  5810. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5811. })
  5812. }),
  5813. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5814. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5815. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5816. t.skybox.wireframe = null)
  5817. }),
  5818. y.add(w, "showSweeps").onFinishChange(function() {
  5819. t.setSweepVisibility(w.showSweeps)
  5820. }),
  5821. y.add(w, "showMesh").onFinishChange(function() {
  5822. t.chunks.forEach(function(e) {
  5823. e.visible = w.showMesh
  5824. })
  5825. }),
  5826. y.add(w, "showFloors").onFinishChange(function() {
  5827. t.floors.forEach(function(e) {
  5828. e.collider.children.forEach(function(e) {
  5829. e.material.visible = w.showFloors
  5830. })
  5831. })
  5832. }),
  5833. y.add(w, "showSkyboxes").onFinishChange(function() {
  5834. t.panos.forEach(function(e) {
  5835. e.skyboxMesh.visible = w.showSkyboxes
  5836. })
  5837. }),
  5838. y.add(w, "showNeighbors").onChange(function() {}),
  5839. y.add(t, "alpha", 0, 1)
  5840. }
  5841. }
  5842. , {
  5843. "../enum/Colors": 19,
  5844. "../enum/Viewmode": 51,
  5845. "../enum/WarpStyle": 52,
  5846. "../lib/dat.gui": 93,
  5847. "../tag/tag": 123,
  5848. "../settings": 166,
  5849. "../util/easing": 186,
  5850. three: 217
  5851. }],
  5852. 64: [function(c, h, e) {
  5853. (function(e) {
  5854. "use strict";
  5855. function i(e, t, i, n) {
  5856. $(".gui-error .error-problem-text").text(e),
  5857. $(".gui-error .error-solution-text").text(t),
  5858. $(".gui-error .error-explanation").text(i),
  5859. $(".gui-error .error-actions").html(n),
  5860. $(window).resize(),
  5861. $(".gui-error").fadeIn(),
  5862. $("#bottom-logo").fadeIn()
  5863. }
  5864. function n(e) {
  5865. 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("");
  5866. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  5867. r.isMobile() || $("[rel=tiletip]").tooltip({
  5868. placement: "bottom",
  5869. delay: {
  5870. show: 50,
  5871. hide: 0
  5872. },
  5873. trigger: "hover",
  5874. viewport: {
  5875. selector: "body",
  5876. padding: 10
  5877. }
  5878. })
  5879. }
  5880. function t() {
  5881. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  5882. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  5883. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  5884. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5885. e.preventDefault(),
  5886. e.stopPropagation(),
  5887. n(" ")
  5888. })
  5889. }
  5890. var r = c("./../util/browser")
  5891. , o = c("./../analytics")
  5892. , a = c("./../settings")
  5893. , s = c("../localization/localize")
  5894. , l = new (c("./../util/logger"))(e);
  5895. h.exports.error = function(e) {
  5896. if ($("head title").text(a.pageTitle),
  5897. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5898. $("#gui-loading").fadeOut(250),
  5899. $("#quick-blackout").hide(),
  5900. o.track("showcase_error", {
  5901. error_key: e
  5902. }),
  5903. s.locale || s.init(),
  5904. "webgl-unsupported" === e)
  5905. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5906. else if ("webgl-ios" === e)
  5907. 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>.");
  5908. else if ("webgl-safari" === e)
  5909. 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>.");
  5910. else if ("webgl-generic" === e)
  5911. t();
  5912. else if ("missing-urls" === e)
  5913. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  5914. else if ("loading-failed" === e)
  5915. 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>.");
  5916. else {
  5917. if ("loading-failed-maintenance" !== e)
  5918. return void l.error("Unhandled error: " + e);
  5919. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  5920. }
  5921. }
  5922. }
  5923. ).call(this, "/js/gui/error.js")
  5924. }
  5925. , {
  5926. "../localization/localize": 108,
  5927. "./../analytics": 4,
  5928. "./../settings": 166,
  5929. "./../util/browser": 182,
  5930. "./../util/logger": 189
  5931. }],
  5932. 65: [function(Oe, Le, e) {
  5933. (function(e) {
  5934. "use strict";
  5935. function c() {
  5936. for (var e in Ce)
  5937. if (Ce.hasOwnProperty(e)) {
  5938. var t = Ce[e];
  5939. if (!t.visible)
  5940. for (var i = 0; i < t.elements.length; i++)
  5941. $(t.elements[i]).hide()
  5942. }
  5943. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  5944. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  5945. ge = [],
  5946. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  5947. ge.push(".hideTarget", ".pinTop.right")
  5948. }
  5949. function v(e, t) {
  5950. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  5951. $("#gui-zoomin").toggle(i),
  5952. $("#gui-zoomout").toggle(i)
  5953. }
  5954. function l() {
  5955. n(),
  5956. $(".pinBottom").toggleClass("open"),
  5957. $("#drawer").toggleClass("open"),
  5958. $(".footer").toggleClass("open"),
  5959. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  5960. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  5961. O.resetDrawer()),
  5962. setTimeout(function() {
  5963. $("#pullTab").toggleClass("opened")
  5964. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  5965. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  5966. }
  5967. function t(e) {
  5968. var t;
  5969. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  5970. t = e.position().top + e.outerHeight(),
  5971. e.attr("style", "display: none")),
  5972. $("#player").outerHeight() - 130 < t + 25
  5973. }
  5974. function y(e) {
  5975. "touchstart" === e.type && e.preventDefault(),
  5976. e.stopPropagation()
  5977. }
  5978. function n() {
  5979. w && (w.reload(),
  5980. w.init())
  5981. }
  5982. function r() {
  5983. $("#gui-spinner").stop(!0, !0),
  5984. $("#gui-spinner").fadeOut(1e3),
  5985. !(Ae = !0)
  5986. }
  5987. function A(e, t) {
  5988. var i = e.mode
  5989. , n = t || e.currentPano;
  5990. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  5991. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  5992. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  5993. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  5994. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  5995. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  5996. $("#gui-modes-outside").removeClass("desktop-only")),
  5997. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  5998. pe = i,
  5999. $("#gui-modes-outside").addClass("hidden"),
  6000. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6001. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6002. }
  6003. function C(t, i) {
  6004. function e() {
  6005. document.getElementById("vr").classList.remove("hidden"),
  6006. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6007. S.supportsFullscreen() ? function(e) {
  6008. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6009. Q.init(t.data, i, e, x),
  6010. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6011. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6012. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6013. $(".improper-embed").toggleClass("hidden", !1),
  6014. n())
  6015. }, function(e) {
  6016. n()
  6017. }) : n()
  6018. }
  6019. function n() {
  6020. var e;
  6021. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6022. X.init(t.data, x),
  6023. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6024. function() {
  6025. _e("vr"),
  6026. V.open(e)
  6027. }
  6028. )),
  6029. X.on(Z.CLOSED, V.reset)
  6030. }
  6031. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6032. switch (M.vr.option) {
  6033. case le.CONTEXTUAL:
  6034. e();
  6035. break;
  6036. case le.ANDROID:
  6037. S.detectAndroid() && e();
  6038. break;
  6039. case le.NONE:
  6040. }
  6041. }
  6042. function h(e, i) {
  6043. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6044. if ("372" !== getQueryVariable("m")) {
  6045. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6046. $(".gui-floor").find(".container").prepend(r)
  6047. }
  6048. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6049. n.on("click", function(e) {
  6050. y(e),
  6051. _e("floor"),
  6052. n.toggleClass("open")
  6053. }),
  6054. $(".floorChoice").on("click", function(e) {
  6055. y(e);
  6056. var t = $(this).data("index");
  6057. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6058. i.player.gotoFloor(t),
  6059. R.track("showcase_gui", {
  6060. gui_action: "click_floor_select_button",
  6061. interaction_source: "gui"
  6062. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6063. _e("move"),
  6064. i.allFloors(),
  6065. R.track("showcase_gui", {
  6066. gui_action: "click_toggle_all_floors_button",
  6067. interaction_source: "gui"
  6068. })),
  6069. n.removeClass("open")
  6070. })
  6071. }
  6072. function I(e, t) {
  6073. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6074. $(".gui-floor-icon").hide(),
  6075. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6076. $(".gui-floor-icon").show(),
  6077. $(".gui-floor-title").hide()),
  6078. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6079. $(".gui-floor-number").text(se.FLOOR_ALL),
  6080. $(".floorChoice").removeClass("active"),
  6081. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6082. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6083. $(".floorChoice").removeClass("active"),
  6084. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6085. }
  6086. function E() {
  6087. var e = $("#player").width() - 20
  6088. , t = $("#scroller")
  6089. , i = $("#drawer")
  6090. , n = $(".pinBottom");
  6091. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6092. i.addClass("noScroll"),
  6093. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6094. i.toggleClass("noScroll"),
  6095. n.toggleClass("noScroll"))
  6096. }
  6097. function _(e) {
  6098. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6099. e = e || 0,
  6100. Ae = !1,
  6101. window.setTimeout(function() {
  6102. Ae || (!0,
  6103. $("#gui-spinner").stop(!0, !0).show())
  6104. }
  6105. .bind(this), e)
  6106. }(M.modelComponentLoadSpinnerDelay)
  6107. }
  6108. function b(e, t) {
  6109. for (var i = []; e; )
  6110. i.push(e),
  6111. e = e.parentNode;
  6112. for (; t && -1 === i.indexOf(t); )
  6113. t = t.parentNode;
  6114. return t
  6115. }
  6116. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6117. Oe("../util/ajax"),
  6118. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6119. Oe("../util/camera"),
  6120. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6121. 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"),
  6122. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6123. Oe("../enum/PathDisplayMode"),
  6124. Oe("../enum/DirectorEvents"),
  6125. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6126. Oe("../enum/WarpStyle"),
  6127. Oe("../enum/AlignmentType"),
  6128. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6129. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6130. coBrand: {
  6131. visible: !0,
  6132. elements: [".co-brand", "#loaderCoBrand"]
  6133. },
  6134. help: {
  6135. visible: !0,
  6136. elements: [".nav-help", "#nav-help"]
  6137. },
  6138. tourControls: {
  6139. visible: !0,
  6140. elements: [".next", ".previous", "#play"]
  6141. },
  6142. highlight: {
  6143. visible: !0,
  6144. elements: ["#drawer", "#pullTab"]
  6145. },
  6146. share: {
  6147. visible: !0,
  6148. elements: [".socialButton", "#share"]
  6149. },
  6150. fullScreen: {
  6151. visible: !0,
  6152. elements: ["#gui-fullscreen"]
  6153. },
  6154. floors: {
  6155. visible: !0,
  6156. elements: [".gui-floor"]
  6157. }
  6158. }, Ie = (g = document.getElementById("drawer"),
  6159. function() {
  6160. $("#player").height() < 400 && g.classList.contains("open") && l()
  6161. }
  6162. ), Ee = (f = document.getElementById("meta-info"),
  6163. function() {
  6164. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6165. }
  6166. ), _e = (i = document.getElementById("meta-info"),
  6167. s = document.getElementById("interaction-modal"),
  6168. u = $("#drawer").eq(0),
  6169. d = $(".gui-floor").eq(0),
  6170. p = $(".vr-popup").eq(0),
  6171. function(e) {
  6172. switch (e) {
  6173. case "info":
  6174. we(),
  6175. Te(),
  6176. Ie(),
  6177. Me(),
  6178. Re(),
  6179. xe(),
  6180. Pe();
  6181. break;
  6182. case "terms":
  6183. be(),
  6184. Te(),
  6185. Se(),
  6186. Me(),
  6187. Re(),
  6188. xe(),
  6189. Pe();
  6190. break;
  6191. case "help":
  6192. be(),
  6193. we(),
  6194. Me(),
  6195. Re(),
  6196. xe(),
  6197. Pe();
  6198. break;
  6199. case "vr":
  6200. be(),
  6201. we(),
  6202. Me(),
  6203. Re(),
  6204. Te(),
  6205. Pe(),
  6206. t(p) && Se();
  6207. break;
  6208. case "highlights":
  6209. Ee(),
  6210. we(),
  6211. Me(),
  6212. Re();
  6213. break;
  6214. case "share":
  6215. be(),
  6216. we(),
  6217. Te(),
  6218. Re(),
  6219. xe(),
  6220. Pe();
  6221. break;
  6222. case "floor":
  6223. we(),
  6224. Me(),
  6225. xe();
  6226. break;
  6227. case "view":
  6228. Re(),
  6229. Me(),
  6230. we(),
  6231. xe();
  6232. break;
  6233. case "tour":
  6234. case "move":
  6235. we(),
  6236. Me(),
  6237. Re(),
  6238. xe();
  6239. break;
  6240. case "resize":
  6241. be(),
  6242. Ie(),
  6243. Re();
  6244. break;
  6245. case "tag":
  6246. we(),
  6247. Te(),
  6248. Me(),
  6249. Re(),
  6250. xe()
  6251. }
  6252. }
  6253. );
  6254. function be() {
  6255. i.classList.contains("expand") && z.toggleMeta(!0)
  6256. }
  6257. function we() {
  6258. W.hide()
  6259. }
  6260. function Te() {
  6261. U.close()
  6262. }
  6263. function xe() {
  6264. X.dismiss()
  6265. }
  6266. function Se() {
  6267. u.hasClass("open") && l()
  6268. }
  6269. function Me() {
  6270. K.hide()
  6271. }
  6272. function Re() {
  6273. d.hasClass("open") && d.removeClass("open")
  6274. }
  6275. function Pe() {
  6276. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6277. }
  6278. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6279. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6280. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6281. setTimeout(function() {
  6282. $(".icon:visible").hide().show(0)
  6283. }, 100)
  6284. }),
  6285. $("#gui-fullscreen").find("a").on("click", function(e) {
  6286. y(e),
  6287. S.requestFullscreen($("body")[0]),
  6288. R.track("showcase_gui", {
  6289. gui_action: "click_enter_fullscreen",
  6290. interaction_source: "gui"
  6291. })
  6292. }),
  6293. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6294. y(e),
  6295. S.exitFullscreen(),
  6296. R.track("showcase_gui", {
  6297. gui_action: "click_exit_fullscreen",
  6298. interaction_source: "gui"
  6299. })
  6300. }),
  6301. $(window).on("resize", function(e) {
  6302. var t = e.target.innerHeight
  6303. , i = e.target.innerWidth;
  6304. t === o && i === a || (Ce.highlight.visible && E(),
  6305. _e("resize"),
  6306. $(".pinTop.right").removeClass("hideUnderMeta"),
  6307. n(),
  6308. o = t,
  6309. a = i)
  6310. }).resize(),
  6311. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6312. $("#pullTab").on("click", function(e) {
  6313. y(e),
  6314. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6315. gui_action: "hide_highlight_reel"
  6316. }),
  6317. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6318. gui_action: "show_highlight_reel"
  6319. }),
  6320. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6321. l()
  6322. }),
  6323. window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
  6324. $("#hotList").on("click", function(e) {
  6325. y(e);
  6326. var t = $("#hotListWrap")[0];
  6327. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6328. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6329. this.classList.add("active"))
  6330. }),
  6331. $("#hotListContent ul").on("mouseover", function(e) {
  6332. y(e);
  6333. var t = e.target
  6334. , i = document.getElementById("hotListWrap");
  6335. if ("SPAN" === t.tagName) {
  6336. var n = t.parentElement.parentElement;
  6337. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6338. } else if ("LI" === t.tagName) {
  6339. n = t.parentElement;
  6340. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6341. } else
  6342. i.style.width = ""
  6343. }),
  6344. $("#hotListContent ul").on("click", function(e) {
  6345. y(e),
  6346. this.preElem && this.preElem.classList.remove("active"),
  6347. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6348. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
  6349. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6350. e.target.hot && e.target.hot.examine(window.player, !0),
  6351. this.preElem = e.target)
  6352. }),
  6353. $("#hotListClose").on("click", function(e) {
  6354. y(e),
  6355. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6356. $("#hotListContent ul .active").removeClass("active"),
  6357. $("#hotList")[0].classList.remove("active")
  6358. })),
  6359. "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
  6360. $("#more-menu-button").on("click", function(e) {
  6361. y(e),
  6362. $("#more-menu").toggleClass("open")
  6363. }),
  6364. Le.exports.init = function(s, l, c, e, t, i, n) {
  6365. var r;
  6366. x = n,
  6367. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6368. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6369. F.init(),
  6370. D.init(s, i),
  6371. ce.init(s, l, e),
  6372. $(".icon").on("mouseover", function() {
  6373. l.player && l.player.reticule.hide()
  6374. }),
  6375. function(e, t) {
  6376. var i = t.player;
  6377. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6378. y(e),
  6379. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6380. R.track("USER", {
  6381. event_type: "showcase_gui",
  6382. gui_action: "click_inside_mode_button"
  6383. }),
  6384. t.changeMode(ie.PANORAMA)
  6385. }),
  6386. $("#gui-modes-outside").find("a").on("click", function(e) {
  6387. y(e),
  6388. R.track("showcase_gui", {
  6389. gui_action: "click_outside_mode_button"
  6390. }),
  6391. t.changeMode(pe)
  6392. }),
  6393. $("#gui-modes-floorplan").on("click", function(e) {
  6394. y(e),
  6395. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6396. gui_action: "click_floorplan_mode_button"
  6397. }),
  6398. t.changeMode(ie.FLOORPLAN))
  6399. }),
  6400. $("#gui-modes-dollhouse").on("click", function(e) {
  6401. y(e),
  6402. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6403. gui_action: "click_dollhouse_mode_button"
  6404. }),
  6405. t.changeMode(ie.DOLLHOUSE))
  6406. })
  6407. }(0, l),
  6408. function(e, t) {
  6409. $("#play").on("mousedown touchstart", function(e) {
  6410. y(e),
  6411. _e("tour"),
  6412. q.play(),
  6413. R.trackAlways("showcase_gui", {
  6414. gui_action: "play_highlights"
  6415. })
  6416. }),
  6417. window.startAndPlay = function(e) {
  6418. _e("tour"),
  6419. q.play(),
  6420. R.trackAlways("showcase_gui", {
  6421. gui_action: "play_highlights"
  6422. })
  6423. }
  6424. ,
  6425. $("#pause").on("mousedown touchstart", function(e) {
  6426. y(e),
  6427. q.pause(),
  6428. R.trackAlways("showcase_gui", {
  6429. gui_action: "pause_highlights"
  6430. })
  6431. }),
  6432. $("#gui-zoomin").find("a").on("click", function(e) {
  6433. y(e),
  6434. t.player.zoomInIncrementally()
  6435. }),
  6436. $("#gui-zoomout").find("a").on("click", function(e) {
  6437. y(e),
  6438. t.player.zoomOutIncrementally()
  6439. })
  6440. }(0, l),
  6441. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(MP_PREFETCHED_MODELDATA.name/* s.data.name */),
  6442. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6443. function() {
  6444. _e("share"),
  6445. V.open(r)
  6446. }
  6447. )),
  6448. K.on(ae.CLOSED, V.reset)),
  6449. //1 < s.heroLocations.length ? function(e, i, t) {
  6450. 0 < s.heroLocations.length ? function(e, i, t) {
  6451. var n = 100 / (fe = e.heroLocations.length) + "%"
  6452. , r = $("#thumb-container")
  6453. , o = $("#progressBar");
  6454. $("#status").find(".totalSteps").text(fe);
  6455. for (var a = 0; a < fe; a++) {
  6456. var s = e.heroLocations[a]
  6457. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6458. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6459. if (l.attr("data-index", a),
  6460. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6461. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6462. s.name) {
  6463. var c = $('<div class="overlay"></div>').text(s.name);
  6464. l.prepend(c)
  6465. }
  6466. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6467. var h = e.panos.get(s.panoId)
  6468. , 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>';
  6469. l.prepend(u)
  6470. }
  6471. r.append(l),
  6472. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6473. }
  6474. T = 144 * fe,
  6475. 111 * fe,
  6476. $(".thumbImg").on("mouseover", function() {
  6477. !function(e) {
  6478. return e.describe().inTransition
  6479. }(i) && t.showPathToHeroLocation($(this).data("index"))
  6480. }),
  6481. $(".thumbImg").on("mouseout", function() {
  6482. i.clearPath()
  6483. }),
  6484. $(".thumbImg").on("click", function(e) {
  6485. y(e);
  6486. var t = $(this);
  6487. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6488. R.trackAlways("showcase_gui", {
  6489. gui_action: "click_highlight"
  6490. }),
  6491. i.goToHighlight(t.data("index"))
  6492. }),
  6493. $(".previous").find("a").on("click", function(e) {
  6494. y(e),
  6495. R.trackAlways("showcase_gui", {
  6496. gui_action: "prev_highlight"
  6497. }),
  6498. i.prevHighlight()
  6499. }),
  6500. $(".next").find("a").on("click", function(e) {
  6501. y(e),
  6502. R.trackAlways("showcase_gui", {
  6503. gui_action: "next_highlight"
  6504. }),
  6505. i.nextHighlight()
  6506. }),
  6507. $("#drawer").on("mouseleave", function(t) {
  6508. var i;
  6509. y(t);
  6510. try {
  6511. i = new MouseEvent("mouseup",{
  6512. clientX: t.clientX,
  6513. clientY: t.clientY,
  6514. screenX: t.screenX,
  6515. screenY: t.screenY
  6516. })
  6517. } catch (e) {
  6518. (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)
  6519. }
  6520. document.dispatchEvent(i)
  6521. }),
  6522. (w = new Sly($("#scrollFrame"),{
  6523. horizontal: !0,
  6524. itemNav: "centered",
  6525. smart: !0,
  6526. scrollTrap: !0,
  6527. scrollBy: 1,
  6528. mouseDragging: !0,
  6529. touchDragging: !0,
  6530. speed: 300,
  6531. dragHandle: !0,
  6532. dynamicHandle: !0,
  6533. clickBar: !0,
  6534. scrollBar: $("#scroller"),
  6535. activateOn: null
  6536. }).init()).on("active", function(e, t) {
  6537. t,
  6538. _e("tour"),
  6539. $(".step").removeClass("active"),
  6540. $("#status").find(".curIdx").text(t + 1);
  6541. for (var i = 0; i <= t; i++)
  6542. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6543. }),
  6544. E()
  6545. }(s, l, c) : (Ce.highlight.visible = !1,
  6546. Ce.tourControls.visible = !1),
  6547. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6548. function() {
  6549. var n;
  6550. document.body.addEventListener("mousedown", function(e) {
  6551. n = 0 === e.button || 1 === e.which ? e.target : null
  6552. }, !0),
  6553. document.body.addEventListener("mouseup", function(t) {
  6554. n !== t.target && (n = b(n, t.target));
  6555. var e = document.getElementById("gui-parent");
  6556. if (b(e, n) !== e && (n = null),
  6557. n) {
  6558. var i;
  6559. try {
  6560. i = new MouseEvent("click",t)
  6561. } catch (e) {
  6562. (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)
  6563. }
  6564. i.syntheticClick = !0,
  6565. n.dispatchEvent(i),
  6566. n = null
  6567. }
  6568. }, !0),
  6569. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6570. e.syntheticClick || (e.stopPropagation(),
  6571. "A" === e.target.nodeName && e.preventDefault())
  6572. }, !0)
  6573. }(),
  6574. A(c),
  6575. C(s, t),
  6576. s.on("floor.changed", I),
  6577. s.on("waiting", function(e) {
  6578. _(e)
  6579. }
  6580. .bind(this, s)),
  6581. s.on("waiting-done", function(e) {
  6582. _(e)
  6583. }
  6584. .bind(this, s)),
  6585. c.on(re.ModeChanged, function(e, t) {
  6586. A(c),
  6587. v(l, c),
  6588. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6589. U.updateMode(t)
  6590. }),
  6591. e.on(oe.Move, _e.bind(this, "move")),
  6592. c.on(re.Ready, function() {
  6593. O.init(e, c, c.tagManager, l),
  6594. c.on(re.ModeChanged, function(e, t) {
  6595. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6596. })
  6597. }),
  6598. c.on(re.PanoChosen, function(e, t) {
  6599. A(c, t),
  6600. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6601. }),
  6602. V.on(k.CLOSE, function(e) {
  6603. switch (e) {
  6604. case "vr-modal":
  6605. X.dismiss();
  6606. break;
  6607. case "share-modal":
  6608. K.hide();
  6609. break;
  6610. case "terms-modal":
  6611. W.hide()
  6612. }
  6613. });
  6614. 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();
  6615. l.on("update.controls", function() {
  6616. var e, t, i, n = l.describe();
  6617. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6618. u.show()),
  6619. n.tourInProgress && (d.forEach(function(e) {
  6620. e.classList.add("playing")
  6621. }),
  6622. p.addClass("playing"),
  6623. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6624. u.hide()),
  6625. n.tourInProgress || (q.stopTour(),
  6626. d.forEach(function(e) {
  6627. e.classList.remove("playing")
  6628. }),
  6629. p.removeClass("playing"),
  6630. f.removeClass("playing"))),
  6631. null !== n.currentItem) {
  6632. var r, o;
  6633. $("#status").find(".curIdx").text(n.currentItem + 1),
  6634. n.onTheBus ? (r = "active",
  6635. o = "recent") : (o = "active",
  6636. r = "recent");
  6637. var a = null === n.destinationItem || n.currentItem === n.destinationItem;
  6638. for (e = 0; e < s.heroLocations.length; e += 1)
  6639. i = g.eq(e),
  6640. t = m.eq(e),
  6641. i.removeClass(o),
  6642. t.removeClass(o),
  6643. n.onTheBus && e === n.destinationItem ? (i.addClass(r),
  6644. t.addClass(r),
  6645. w.activate(e)) : n.onTheBus && a && e === n.currentItem ? (i.addClass(r),
  6646. t.addClass(r)) : (i.removeClass(r),
  6647. t.removeClass(r))
  6648. } else
  6649. for (e = 0; e < s.heroLocations.length; e += 1)
  6650. i = g.eq(e),
  6651. t = m.eq(e),
  6652. i.removeClass("active recent"),
  6653. t.removeClass("active recent");
  6654. v(l, c)
  6655. }),
  6656. document.addEventListener("keydown", function(e) {
  6657. switch (R.updateInteraction(oe.InteractionKey),
  6658. e.which) {
  6659. case te.ZERO:
  6660. M.debug && s.toggleAlpha();
  6661. break;
  6662. case te.NINE:
  6663. M.debug && B.toggle();
  6664. break;
  6665. case te.ONE:
  6666. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6667. break;
  6668. case te.TWO:
  6669. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6670. break;
  6671. case te.THREE:
  6672. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6673. break;
  6674. case te.FOUR:
  6675. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6676. break;
  6677. case te.SPACE:
  6678. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6679. break;
  6680. case te.RETURN:
  6681. M.debug && s.toggleExplodeUp();
  6682. break;
  6683. case te.P:
  6684. !function(e) {
  6685. me.gui || (me.gui = function(e) {
  6686. var t = new he.GUI;
  6687. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6688. e.setSweepVisibility(M.showSweeps)
  6689. }),
  6690. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6691. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6692. M.transition.flySpeed = 0,
  6693. t.__controllers.forEach(function(e) {
  6694. e.updateDisplay()
  6695. })
  6696. }),
  6697. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6698. $(t.__closeButton).hide(),
  6699. t
  6700. }(me.model)),
  6701. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6702. }(!me.visible);
  6703. break;
  6704. case te.U:
  6705. !function(e) {
  6706. ve.gui || (ve.gui = function(t, i) {
  6707. function e() {
  6708. var e = i.toJSON();
  6709. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6710. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6711. }
  6712. var n = {}
  6713. , r = new he.GUI({
  6714. autoPlace: !0,
  6715. width: "60%"
  6716. });
  6717. return e(),
  6718. i.on(re.ViewChanged, e),
  6719. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6720. r.domElement.id = "datLinks",
  6721. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6722. if (!S.detectSafari()) {
  6723. var t = document.createElement("button");
  6724. t.classList.add("btn-deep-link"),
  6725. t.innerText = se.MENU_COPY,
  6726. e.nextSibling.appendChild(t);
  6727. var n = function() {
  6728. alert(se.LINK_ALERT_COPY),
  6729. t.hide()
  6730. };
  6731. t.addEventListener("click", function(e) {
  6732. try {
  6733. var t = e.target.parentNode.childNodes[0];
  6734. t.select();
  6735. var i = document.execCommand("copy");
  6736. t.blur(),
  6737. i || n()
  6738. } catch (e) {
  6739. n()
  6740. }
  6741. })
  6742. }
  6743. }),
  6744. $(r.__closeButton).hide(),
  6745. r
  6746. }(ve.model, ve.player)),
  6747. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6748. }(!ve.visible);
  6749. break;
  6750. case te.X:
  6751. M.debug && s.toggleExplode();
  6752. break;
  6753. case te.PLUSEQUALS:
  6754. l.player.activatePersistentZooming(!0),
  6755. O.hideUi();
  6756. break;
  6757. case te.DASHUNDERSCORE:
  6758. l.player.activatePersistentZooming(!1),
  6759. O.hideUi();
  6760. break;
  6761. case te.SEVEN:
  6762. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6763. break;
  6764. case te.EIGHT:
  6765. l.player.decreaseZoomSpeed();
  6766. break;
  6767. case te.NINE:
  6768. l.player.increaseZoomSpeed()
  6769. }
  6770. return c && c.reticule.hide(),
  6771. !0
  6772. }
  6773. .bind(this)),
  6774. document.addEventListener("keyup", function(e) {
  6775. switch (e.which) {
  6776. case te.PLUSEQUALS:
  6777. l.player.deactivatePersistentZooming();
  6778. break;
  6779. case te.DASHUNDERSCORE:
  6780. l.player.deactivatePersistentZooming()
  6781. }
  6782. }
  6783. .bind(this)),
  6784. function(e) {
  6785. me = {
  6786. gui: null,
  6787. visible: !1,
  6788. model: e
  6789. }
  6790. }(s),
  6791. function(e, t) {
  6792. ve = {
  6793. gui: null,
  6794. visible: !1,
  6795. model: e,
  6796. player: t
  6797. }
  6798. }(s, l.player),
  6799. function(e) {
  6800. function t(e, i) {
  6801. $(e).find("a").each(function(e, t) {
  6802. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6803. t.style.pointerEvents = i ? "auto" : "none"
  6804. })
  6805. }
  6806. e.on(de.ZoomMax, function() {
  6807. t("#gui-zoomin", !1),
  6808. t("#gui-zoomout", !0)
  6809. }),
  6810. e.on(de.ZoomMin, function() {
  6811. t("#gui-zoomin", !0),
  6812. t("#gui-zoomout", !1)
  6813. }),
  6814. e.on(de.ZoomIn, function() {
  6815. t("#gui-zoomout", !0)
  6816. }),
  6817. e.on(de.ZoomOut, function() {
  6818. t("#gui-zoomin", !0)
  6819. }),
  6820. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6821. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6822. }(c),
  6823. P.setAutoPlay(s.heroCount()),
  6824. U.init(c, i.mode),
  6825. U.on(H.OPENED, _e.bind(this, "help")),
  6826. W.init(),
  6827. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6828. function() {
  6829. _e("terms"),
  6830. V.open(o)
  6831. }
  6832. )),
  6833. W.on(j.CLOSED, V.reset),
  6834. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6835. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6836. M.profiling.enabled && B.show(),
  6837. q.init(l)
  6838. }
  6839. ,
  6840. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6841. function a() {
  6842. o.setLoadingStartTime(),
  6843. function() {
  6844. function e(e) {
  6845. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  6846. }
  6847. $("body").css("touch-action", "none"),
  6848. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  6849. var t = document.getElementById("terms-text")
  6850. , i = document.getElementById("more-help-wrapper")
  6851. , n = (document.getElementById("navigation-help-wrapper"),
  6852. document.getElementById("help-dialog"),
  6853. document.getElementById("tag-billboards"));
  6854. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  6855. passive: !1
  6856. }),
  6857. document.body.addEventListener("DOMMouseScroll", e)),
  6858. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6859. e.stopPropagation()
  6860. })
  6861. }(),
  6862. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  6863. l()) : function(e) {
  6864. L.show(e),
  6865. c()
  6866. }(l)
  6867. }
  6868. var s = $.Deferred()
  6869. , l = s.resolve.bind(s);
  6870. ye = !0,
  6871. _(e);
  6872. e.data.player_options && function(e) {
  6873. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  6874. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  6875. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  6876. }(e.data.player_options),
  6877. 1 === M.specialEdition && $("body").addClass("specialEdition");
  6878. se.localizeGUI();
  6879. !function(i) {
  6880. function e(e, t) {
  6881. return !!i.player_options[e] && i[t || e]
  6882. }
  6883. $(".model-title").text(i.name);
  6884. var t = M.pageTitle;
  6885. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  6886. document.title = t,
  6887. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6888. delay: {
  6889. show: 50,
  6890. hide: 0
  6891. },
  6892. trigger: "hover",
  6893. html: !1,
  6894. viewport: {
  6895. selector: "body",
  6896. padding: 10
  6897. }
  6898. }),
  6899. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6900. z.populate({
  6901. name: e("model_name", "name"),
  6902. coBrand: e("presented_by"),
  6903. description: e("model_summary", "summary") || "暂无内容",
  6904. contactName: e("contact_name"),
  6905. address: e("address"),
  6906. phone: e("contact_phone"),
  6907. formattedPhone: i.formatted_contact_phone,
  6908. email: e("contact_email"),
  6909. url: e("external_url"),
  6910. socialSharing: i.enable_social_sharing && i.is_public
  6911. })
  6912. }(e.data);
  6913. r || $(".quick").addClass("hidden");
  6914. n ? (R.impression(),
  6915. a()) : (o.setWaitingStartTime(),
  6916. N.show(r, a))
  6917. return s
  6918. }
  6919. ,
  6920. Le.exports.endLoading = function(e, t, i) {
  6921. var n = t.player;
  6922. function r() {
  6923. i.dismissExaminedTag(),
  6924. i.disableHovering()
  6925. }
  6926. $("#gui-thumb").fadeOut(2500),
  6927. L.hide(function() {
  6928. ye = !1
  6929. }),
  6930. Y.init(e, i),
  6931. z.finishSetup(Object.keys(e.tags).length),
  6932. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  6933. X.on(Z.OPENED, r),
  6934. K.on(ae.OPENED, r),
  6935. U.on(H.OPENED, r),
  6936. W.on(j.OPENED, r);
  6937. var o = i.enableHovering.bind(i);
  6938. if (X.on(Z.CLOSED, o),
  6939. K.on(ae.CLOSED, o),
  6940. U.on(H.CLOSED, o),
  6941. W.on(j.CLOSED, o),
  6942. M.labels.enabled && Object.keys(e.labels).length,
  6943. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  6944. I(e.currentFloor, n.mode)),
  6945. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  6946. h(e, t)),
  6947. c(),
  6948. v(t, t.player),
  6949. $("#gui").fadeIn(1500),
  6950. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  6951. l(),
  6952. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  6953. }, 2e3),
  6954. !S.isMobile())
  6955. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  6956. $(a[s]).addClass("hasHover");
  6957. _(e),
  6958. z.setupToggling(),
  6959. window.editHotPanel && editHotPanel(),
  6960. function() {
  6961. var i = $("#pullTab")
  6962. , e = {
  6963. bottom: {
  6964. "border-bottom-left-radius": "10px",
  6965. "border-bottom-right-radius": "10px"
  6966. },
  6967. top: {
  6968. "border-top-left-radius": "10px",
  6969. "border-top-right-radius": "10px"
  6970. }
  6971. }
  6972. , t = {
  6973. bottom: {
  6974. "border-top-right-radius": "10px",
  6975. "border-bottom-right-radius": "10px"
  6976. },
  6977. top: {
  6978. "border-bottom-left-radius": "10px",
  6979. "border-top-left-radius": "10px"
  6980. }
  6981. };
  6982. function n(e, t) {
  6983. $("#gui-modes-map > div:visible:last").css(e),
  6984. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  6985. }
  6986. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  6987. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  6988. }(),
  6989. window.EditTools && (window.editTool = new EditTools(n.sceneRenderer))
  6990. }
  6991. ,
  6992. Le.exports.onProgress = function(e) {
  6993. L.progress(e)
  6994. }
  6995. }
  6996. ).call(this, "/js/gui/gui.js")
  6997. }
  6998. , {
  6999. "../analytics": 4,
  7000. "../controls/serializer": 14,
  7001. "../enum/AlignmentType": 17,
  7002. "../enum/BlackoutStyle": 18,
  7003. "../enum/ControlEvents": 21,
  7004. "../enum/DirectorEvents": 23,
  7005. "../enum/Keys": 30,
  7006. "../enum/PathDiscardMode": 38,
  7007. "../enum/PathDisplayMode": 39,
  7008. "../enum/PlayerEvents": 40,
  7009. "../enum/VROption": 47,
  7010. "../enum/Vectors": 50,
  7011. "../enum/Viewmode": 51,
  7012. "../enum/WarpStyle": 52,
  7013. "../enum/ZoomEvents": 53,
  7014. "../lib/dat.gui": 93,
  7015. "../localization/localize": 108,
  7016. "../tag/Media/MediaEvent": 131,
  7017. "../objects/Snapshot": 153,
  7018. "../settings": 166,
  7019. "../util/ajax": 181,
  7020. "../util/browser": 182,
  7021. "../util/camera": 183,
  7022. "../util/logger": 189,
  7023. "../util/showcase": 193,
  7024. "../util/transitions": 195,
  7025. "./closer/ModalCloserEvent": 61,
  7026. "./closer/modalCloser": 62,
  7027. "./help/HelpEvent": 66,
  7028. "./help/help": 67,
  7029. "./helpManager": 68,
  7030. "./immersiveMode": 69,
  7031. "./konami": 70,
  7032. "./landingScreen": 71,
  7033. "./loadingScreen": 72,
  7034. "./memoryUsage": 73,
  7035. "./playButton": 74,
  7036. "./populateModal": 75,
  7037. "./sharing/ShareEvents": 76,
  7038. "./sharing/modal": 77,
  7039. "./terms/TermsEvent": 78,
  7040. "./terms/terms": 79,
  7041. "./title/TitleEvents": 80,
  7042. "./title/tagToggle": 81,
  7043. "./title/titleBar": 82,
  7044. "./tourInteraction": 84,
  7045. "./vr/vrEvent": 85,
  7046. "./vr/vrModal": 87,
  7047. "./webvr/WebVrEvent": 88,
  7048. "./webvr/webVRgui": 89,
  7049. three: 217
  7050. }],
  7051. 66: [function(e, t, i) {
  7052. "use strict";
  7053. t.exports = Object.freeze({
  7054. OPENED: "help.opened",
  7055. CLOSED: "help.closed"
  7056. })
  7057. }
  7058. , {}],
  7059. 67: [function(e, t, i) {
  7060. "use strict";
  7061. function n() {
  7062. p.on("click", function(e) {
  7063. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7064. setTimeout(function() {
  7065. x = !1
  7066. }, h.help.modalStayDuration),
  7067. S.emit(l.OPENED),
  7068. f.addClass("open " + T),
  7069. p.addClass("open"),
  7070. o(),
  7071. r(),
  7072. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7073. v.classList.add("fadeIn")))
  7074. }),
  7075. E.on("click", function(e) {
  7076. S.close()
  7077. }),
  7078. C.on("click", function(e) {
  7079. T && T !== a.TRANSITIONING && (o(),
  7080. r())
  7081. }),
  7082. I.on("click", function(e) {
  7083. o(),
  7084. I.addClass("underline-tab"),
  7085. c.fill(b, s.MORE_HELP),
  7086. f.addClass("more-help")
  7087. })
  7088. }
  7089. function r() {
  7090. C.addClass("underline-tab"),
  7091. c.fill(_, s.NAVIGATION, T),
  7092. f.addClass(T)
  7093. }
  7094. function o() {
  7095. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7096. A.forEach(function(e) {
  7097. e.classList.remove("underline-tab")
  7098. })
  7099. }
  7100. var a = e("../../enum/Viewmode")
  7101. , s = e("../../enum/HelpModalType")
  7102. , l = e("./HelpEvent")
  7103. , c = (e("../helpManager"),
  7104. e("./../populateModal"))
  7105. , h = e("../../settings")
  7106. , u = e("../../util/common")
  7107. , d = e("events").EventEmitter
  7108. , p = $(".footer-help").eq(0)
  7109. , f = $("#help-dialog").eq(0)
  7110. , g = document.querySelector("#quick-logo")
  7111. , m = document.querySelector("#loaderCoBrand")
  7112. , v = document.querySelector("#help-dialog")
  7113. , y = document.querySelector(".footer")
  7114. , A = $(".help-tabs").children().toArray()
  7115. , C = $(".navigation-tab").eq(0)
  7116. , I = $(".more-help-tab").eq(0)
  7117. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7118. f.find(".close").eq(0))
  7119. , _ = f.find(".interactions").toArray()
  7120. , b = f.find(".ui-instructions").toArray()
  7121. , w = a.PANORAMA
  7122. , T = a.PANORAMA
  7123. , x = !1
  7124. , S = {
  7125. init: function(e, t) {
  7126. w = T = t,
  7127. [v, m, g, y].forEach(function(e) {
  7128. e.classList.add(c.deviceType)
  7129. }),
  7130. n()
  7131. },
  7132. close: function() {
  7133. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7134. p.removeClass("open"),
  7135. f.removeClass("open"),
  7136. v.classList.contains("fadeIn"))) {
  7137. v.classList.remove("fadeIn");
  7138. var e = T === a.TRANSITIONING ? w : T;
  7139. c.clear(_, s.NAVIGATION, e)
  7140. }
  7141. },
  7142. updateMode: function(e) {
  7143. w = T,
  7144. T = e
  7145. }
  7146. };
  7147. u.extendObject(S, d.prototype),
  7148. t.exports = S
  7149. }
  7150. , {
  7151. "../../enum/HelpModalType": 28,
  7152. "../../enum/Viewmode": 51,
  7153. "../../settings": 166,
  7154. "../../util/common": 185,
  7155. "../helpManager": 68,
  7156. "./../populateModal": 75,
  7157. "./HelpEvent": 66,
  7158. events: 202
  7159. }],
  7160. 68: [function(s, l, e) {
  7161. (function(e) {
  7162. "use strict";
  7163. var t = s("../util/browser")
  7164. , i = s("./../util/logger")
  7165. , n = s("./../settings")
  7166. , r = new i(e)
  7167. , o = function() {
  7168. var t;
  7169. try {
  7170. return t = window.localStorage.getItem("visitCount") || "0",
  7171. t = (parseFloat(t) + 1).toString(),
  7172. window.localStorage.setItem("visitCount", t),
  7173. r.debug("visitCount = " + t),
  7174. t
  7175. } catch (e) {
  7176. t = "1",
  7177. r.debug("couldn't set local storage")
  7178. }
  7179. }()
  7180. , a = !1;
  7181. l.exports = {
  7182. isHelpDisabled: function() {
  7183. return "0" === t.valueFromHash("help", null) || a
  7184. },
  7185. isLargeHelpEnabled: function() {
  7186. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7187. },
  7188. isSmallHelpEnabled: function() {
  7189. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7190. },
  7191. isHelpEnabled: function() {
  7192. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7193. },
  7194. setAutoPlay: function(e) {
  7195. a = 0 <= n.warp.auto && 1 < e
  7196. }
  7197. }
  7198. }
  7199. ).call(this, "/js/gui/helpManager.js")
  7200. }
  7201. , {
  7202. "../util/browser": 182,
  7203. "./../settings": 166,
  7204. "./../util/logger": 189
  7205. }],
  7206. 69: [function(e, t, i) {
  7207. "use strict";
  7208. function r(e) {
  7209. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7210. T = !0,
  7211. h.close(),
  7212. function(e) {
  7213. !n(e) && S ? v.forEach(function(e) {
  7214. e.classList.remove("drawerOpen"),
  7215. e.classList.add("duringTour")
  7216. }) : C.hasClass("open") ? v.forEach(function(e) {
  7217. e.classList.remove("duringTour"),
  7218. e.classList.add("drawerOpen")
  7219. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7220. e.classList.add("fadeOut")
  7221. })
  7222. }(e),
  7223. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7224. C.hasClass("playing") || (y.forEach(function(e) {
  7225. e.classList.add("detectHover")
  7226. }),
  7227. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7228. }
  7229. function o() {
  7230. C.hasClass("playing") || (clearTimeout(x),
  7231. x = setTimeout(a, c.immersive.timeToShowAgain))
  7232. }
  7233. function a() {
  7234. clearTimeout(x),
  7235. T = !1,
  7236. m.forEach(function(e) {
  7237. e.classList.remove("drawerOpen")
  7238. }),
  7239. S || v.forEach(function(e) {
  7240. e.classList.remove("duringTour")
  7241. }),
  7242. y.forEach(function(e) {
  7243. e.classList.remove("detectHover")
  7244. })
  7245. }
  7246. function s() {
  7247. T ? a() : r(),
  7248. M = !0,
  7249. setTimeout(function() {
  7250. M = !1
  7251. }, c.immersive.uiStayDuration)
  7252. }
  7253. function n(e) {
  7254. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7255. }
  7256. var l = e("../util/browser")
  7257. , c = e("../settings")
  7258. , h = e("./help/help")
  7259. , u = e("../enum/tagEvents")
  7260. , d = e("../enum/ControlEvents")
  7261. , p = e("../enum/PlayerEvents")
  7262. , f = e("../enum/DirectorEvents")
  7263. , g = (p = e("../enum/PlayerEvents"),
  7264. e("../enum/Viewmode"))
  7265. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7266. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7267. , y = $("#hover-bottom, #hover-top").toArray()
  7268. , A = ($("#pullTab").eq(0),
  7269. $("#playHead").eq(0),
  7270. $(".pinBottom-container").eq(0))
  7271. , C = $("#drawer").eq(0)
  7272. , I = $("#drawer-container").eq(0)
  7273. , E = $("#meta-info").eq(0)
  7274. , _ = $(".pinTop.left").eq(0)
  7275. , b = $("#player").eq(0)
  7276. , w = document.getElementById("pullTab")
  7277. , T = !1
  7278. , x = null
  7279. , S = !1
  7280. , M = !1
  7281. , R = null
  7282. , P = !1;
  7283. t.exports.init = function(e, t, i, n) {
  7284. (function(t, i, e, n) {
  7285. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7286. t.controls[e].on(d.Move, r),
  7287. t.controls[e].on(d.LongTap, s)
  7288. }),
  7289. b.on("mousewheel DOMMouseScroll", r),
  7290. e.on(u.TagActivated, r),
  7291. e.on(u.TagNavigation, r),
  7292. i.on(p.FlyingEnded, o),
  7293. i.on(p.ModeChanging, function(e, t) {
  7294. P = t !== g.PANORAMA && e !== g.PANORAMA
  7295. }),
  7296. i.on(p.ModeChanged, function(e, t) {
  7297. R = i.mode,
  7298. t !== g.TRANSITIONING ? a() : r("modeChange")
  7299. }),
  7300. n.on(f.TourStart, function() {
  7301. S = !0,
  7302. r()
  7303. }),
  7304. n.on(f.TourEnd, function() {
  7305. S = !1,
  7306. a()
  7307. }),
  7308. n.on(f.ActionInterrupted, function() {
  7309. S = !1
  7310. }),
  7311. w.addEventListener("touchend", function() {
  7312. $("#pullTab").hasClass("opened") && !S && a()
  7313. }, !0)
  7314. }
  7315. )(e, t, i, n),
  7316. l.isMobile() ? (y.forEach(function(e) {
  7317. e.classList.add("mobile")
  7318. }),
  7319. A.click(a)) : (y.forEach(function(e) {
  7320. e.addEventListener("mouseleave", function() {
  7321. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7322. }, !0)
  7323. }),
  7324. b.mouseleave(function() {
  7325. y[0].classList.contains("detectHover") && a()
  7326. })),
  7327. R = t.mode
  7328. }
  7329. ,
  7330. t.exports.hideUi = r,
  7331. t.exports.resetDrawer = function() {
  7332. I.hasClass("duringTour") || (S = !1,
  7333. r("gui"),
  7334. a())
  7335. }
  7336. }
  7337. , {
  7338. "../enum/ControlEvents": 21,
  7339. "../enum/DirectorEvents": 23,
  7340. "../enum/tagEvents": 32,
  7341. "../enum/PlayerEvents": 40,
  7342. "../enum/Viewmode": 51,
  7343. "../settings": 166,
  7344. "../util/browser": 182,
  7345. "./help/help": 67
  7346. }],
  7347. 70: [function(i, n, e) {
  7348. (function(e) {
  7349. "use strict";
  7350. var t = i("./../util/logger")
  7351. , o = i("./../settings")
  7352. , a = i("./debug")
  7353. , s = i("./../util/common")
  7354. , l = (i("./gui"),
  7355. new t(e));
  7356. o.console && $("body").append('<div id="debug-console"></div>'),
  7357. n.exports.init = function(i, n, r) {
  7358. l.debug("konami has the modelInstance");
  7359. var t = [];
  7360. $(window).on("keydown", function(e) {
  7361. t.push(e.which),
  7362. t.length > o.secretPanelWord.length && t.shift(),
  7363. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7364. o.debug = !0)
  7365. }),
  7366. $(window).on("keydown", function e(t) {
  7367. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7368. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7369. })
  7370. }
  7371. }
  7372. ).call(this, "/js/gui/konami.js")
  7373. }
  7374. , {
  7375. "./../settings": 166,
  7376. "./../util/common": 185,
  7377. "./../util/logger": 189,
  7378. "./debug": 63,
  7379. "./gui": 65
  7380. }],
  7381. 71: [function(e, t, i) {
  7382. "use strict";
  7383. function r() {
  7384. s.clear(m, l.LANDING[v]),
  7385. g.removeClass("fadeIn")
  7386. }
  7387. var o = e("../settings")
  7388. , a = (e("./help/help"),
  7389. e("./helpManager"))
  7390. , s = e("./populateModal")
  7391. , l = e("../enum/HelpModalType")
  7392. , n = e("../enum/Viewmode")
  7393. , c = e("../enum/DirectorEvents")
  7394. , h = e("../enum/PlayerEvents")
  7395. , u = $("#quick-blackout").eq(0)
  7396. , d = $("#quick-logo").eq(0)
  7397. , p = $(".quick-brand").toArray()
  7398. , f = $("#loaderCoBrand").eq(0)
  7399. , g = $("#interaction-modal").eq(0)
  7400. , m = g.find(".interaction").toArray()
  7401. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7402. "");
  7403. t.exports.delayLanding = function(e) {
  7404. var t = $.Deferred();
  7405. e || t.resolve();
  7406. var i = o.startupFlyinDelay;
  7407. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7408. setTimeout(t.resolve.bind(t), i),
  7409. t
  7410. }
  7411. ,
  7412. t.exports.showMessage = function(e, t, i) {
  7413. var n = 0;
  7414. o.quickstart.enabled && (function(e) {
  7415. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7416. d.before(f),
  7417. p = $(".quick-brand").toArray()), */
  7418. u.addClass("fadeOut")
  7419. /* setTimeout(function() {
  7420. p.forEach(function(e) {
  7421. e.classList.add("fadeIn")
  7422. })
  7423. }, o.quickstart.showTextDelay),
  7424. setTimeout(function() {
  7425. p.forEach(function(e) {
  7426. e.classList.add("fadeOut")
  7427. })
  7428. }, o.quickstart.fadeOutDelay) */
  7429. }(i),
  7430. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7431. function(e, t) {
  7432. setTimeout(function() {
  7433. if (a.isHelpEnabled()) {
  7434. if (t(),
  7435. s.init(),
  7436. g.addClass("fadeIn landing " + s.deviceType),
  7437. a.isSmallHelpEnabled())
  7438. return void g.addClass("small");
  7439. s.fill(m, l.LANDING[v]),
  7440. g.addClass(v)
  7441. }
  7442. }, e);
  7443. var i = {
  7444. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7445. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7446. }
  7447. , n = $(".nav-icon .icon");
  7448. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7449. function r(e) {
  7450. e.on("click", function() {
  7451. var e = null;
  7452. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7453. i.length < e || e < 1)
  7454. return !1;
  7455. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7456. "data-page": e,
  7457. src: i.mobile[e - 1]
  7458. }) : n.attr({
  7459. "data-page": e,
  7460. src: i.pc[e - 1]
  7461. })
  7462. })
  7463. }
  7464. r($(".next-button")),
  7465. r($(".prev-button"))
  7466. }(n, function() {
  7467. e.once(h.Move, r),
  7468. t.once(c.TourStart, r)
  7469. })
  7470. }
  7471. ,
  7472. t.exports.init = function(e, t) {
  7473. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7474. }
  7475. ,
  7476. t.exports.dismissModal = r
  7477. }
  7478. , {
  7479. "../enum/DirectorEvents": 23,
  7480. "../enum/HelpModalType": 28,
  7481. "../enum/PlayerEvents": 40,
  7482. "../enum/Viewmode": 51,
  7483. "../settings": 166,
  7484. "./help/help": 67,
  7485. "./helpManager": 68,
  7486. "./populateModal": 75
  7487. }],
  7488. 72: [function(e, t, i) {
  7489. "use strict";
  7490. var n = e("./circleLoader").circleLoader;
  7491. t.exports = {
  7492. element: $("#gui-loading"),
  7493. hide: function(e) {
  7494. n.done(),
  7495. this.element.fadeOut(1500, e)
  7496. },
  7497. show: function(e) {
  7498. this.element.fadeIn(500, function() {
  7499. this.element.css("display", "table"),
  7500. e && e()
  7501. }
  7502. .bind(this))
  7503. },
  7504. progress: function(e) {
  7505. n.set(e)
  7506. }
  7507. }
  7508. }
  7509. , {
  7510. "./circleLoader": 60
  7511. }],
  7512. 73: [function(e, t, i) {
  7513. "use strict";
  7514. var n = e("../settings")
  7515. , r = $("#memory-info")
  7516. , o = r.find("#memory-gpu")
  7517. , a = !1;
  7518. t.exports = {
  7519. show: function() {
  7520. n.profiling.enabled && (r.show(),
  7521. a = !0)
  7522. },
  7523. hide: function() {
  7524. r.hide(),
  7525. a = !1
  7526. },
  7527. toggle: function() {
  7528. a ? this.hide() : this.show()
  7529. },
  7530. update: function(e) {
  7531. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7532. }
  7533. }
  7534. }
  7535. , {
  7536. "../settings": 166
  7537. }],
  7538. 74: [function(e, t, i) {
  7539. "use strict";
  7540. e("../util/browser"),
  7541. e("../analytics");
  7542. e("../settings"),
  7543. t.exports = {
  7544. show: function(e, t) {
  7545. $("#gui-message").fadeOut(500, function() {
  7546. t()
  7547. })
  7548. }
  7549. }
  7550. }
  7551. , {
  7552. "../analytics": 4,
  7553. "../settings": 166,
  7554. "../util/browser": 182
  7555. }],
  7556. 75: [function(e, t, i) {
  7557. "use strict";
  7558. function n(e, t, i, n) {
  7559. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7560. }
  7561. var r = e("../util/browser")
  7562. , o = e("../localization/localize")
  7563. , a = e("../enum/HelpModalType")
  7564. , s = (e("../enum/HelpModalSize"),
  7565. e("../enum/Viewmode"));
  7566. t.exports = {
  7567. init: function() {
  7568. if (!this.hasInitialized) {
  7569. this.hasInitialized = !0,
  7570. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7571. this.assets = {},
  7572. this.assets[a.LANDING[s.PANORAMA]] = {
  7573. desktop: {
  7574. left: {
  7575. "top-info": o.ROTATE,
  7576. "big-image": "images/nav_help_mouse_drag_left.png",
  7577. keyboard: "images/nav_help_keyboard_left_right.png"
  7578. },
  7579. middle: {
  7580. "top-info": o.MOVE,
  7581. "big-image": "images/nav_help_mouse_click.png",
  7582. keyboard: "images/nav_help_keyboard_up_down.png"
  7583. },
  7584. right: {
  7585. "top-info": o.ZOOM,
  7586. "big-image": "images/nav_help_mouse_zoom.png",
  7587. keyboard: "images/nav_help_zoom_keys.png"
  7588. }
  7589. },
  7590. mobile: {
  7591. left: {
  7592. "top-info": o.ROTATE,
  7593. "big-image": "images/nav_help_gesture_drag.png"
  7594. },
  7595. middle: {
  7596. "top-info": o.MOVE,
  7597. "big-image": "images/nav_help_gesture_tap.png"
  7598. },
  7599. right: {
  7600. "top-info": o.ZOOM,
  7601. "big-image": "images/nav_help_gesture_pinch.png"
  7602. }
  7603. }
  7604. },
  7605. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7606. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7607. desktop: {
  7608. left: {
  7609. "top-info": o.ROTATE,
  7610. "big-image": "images/nav_help_mouse_drag_left.png",
  7611. keyboard: "images/nav_help_keyboard_left_right.png"
  7612. },
  7613. middle: {
  7614. "top-info": o.MOVE,
  7615. "big-image": "images/nav_help_mouse_position_right.png"
  7616. }
  7617. },
  7618. mobile: {
  7619. left: {
  7620. "top-info": o.ROTATE,
  7621. "big-image": "images/nav_help_gesture_drag.png"
  7622. },
  7623. middle: {
  7624. "top-info": o.MOVE,
  7625. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7626. }
  7627. }
  7628. },
  7629. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7630. desktop: {
  7631. left: {
  7632. "top-info": o.MOVE,
  7633. "big-image": "images/nav_help_mouse_position_left.png"
  7634. },
  7635. middle: {
  7636. "top-info": o.ROTATE,
  7637. "big-image": "images/nav_help_mouse_drag_right.png",
  7638. keyboard: "images/nav_help_keyboard_left_right.png"
  7639. }
  7640. },
  7641. mobile: {
  7642. left: {
  7643. "top-info": o.MOVE,
  7644. "big-image": "images/nav_help_gesture_position.png"
  7645. },
  7646. middle: {
  7647. "top-info": o.ROTATE,
  7648. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7649. }
  7650. }
  7651. };
  7652. var e = {
  7653. "top-info": o.INSIDE,
  7654. "big-image": "images/nav_help_click_inside.png",
  7655. keyboard: "images/nav_help_inside_key.png"
  7656. };
  7657. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7658. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7659. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7660. var t = {
  7661. "top-info": o.INSIDE,
  7662. "big-image": "images/nav_help_tap_inside.png"
  7663. };
  7664. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7665. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7666. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7667. this.assets[a.NAVIGATION] = {},
  7668. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7669. desktop: {
  7670. left: {
  7671. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7672. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7673. "big-image": "images/nav_help_mouse_drag_left.png",
  7674. keyboard: "images/nav_help_keyboard_left_right.png"
  7675. },
  7676. middle: {
  7677. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7678. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7679. "big-image": "images/nav_help_mouse_click.png",
  7680. keyboard: "images/nav_help_keyboard_up_down.png"
  7681. },
  7682. right: {
  7683. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7684. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7685. "big-image": "images/nav_help_mouse_zoom.png",
  7686. keyboard: "images/nav_help_zoom_keys.png"
  7687. }
  7688. },
  7689. mobile: {
  7690. left: {
  7691. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7692. "big-image": "images/nav_help_gesture_drag.png"
  7693. },
  7694. middle: {
  7695. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7696. "big-image": "images/nav_help_gesture_tap.png"
  7697. },
  7698. right: {
  7699. "top-info": o.HELP_MOBILE_3,
  7700. "big-image": "images/nav_help_gesture_pinch.png"
  7701. }
  7702. }
  7703. },
  7704. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7705. desktop: {
  7706. left: {
  7707. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7708. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7709. "big-image": "images/nav_help_mouse_drag_left.png",
  7710. keyboard: "images/nav_help_keyboard_all.png"
  7711. },
  7712. middle: {
  7713. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7714. "big-image": "images/nav_help_mouse_position_right.png"
  7715. },
  7716. right: {
  7717. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7718. "big-image": "images/nav_help_mouse_zoom.png"
  7719. }
  7720. },
  7721. mobile: {
  7722. left: {
  7723. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7724. "big-image": "images/nav_help_gesture_drag.png"
  7725. },
  7726. middle: {
  7727. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7728. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7729. },
  7730. right: {
  7731. "top-info": o.HELP_MOBILE_3,
  7732. "big-image": "images/nav_help_gesture_pinch.png"
  7733. }
  7734. }
  7735. },
  7736. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7737. desktop: {
  7738. left: {
  7739. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7740. "big-image": "images/nav_help_mouse_position_left.png"
  7741. },
  7742. middle: {
  7743. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7744. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7745. "big-image": "images/nav_help_mouse_drag_right.png",
  7746. keyboard: "images/nav_help_keyboard_left_right.png"
  7747. },
  7748. right: {
  7749. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7750. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7751. "big-image": "images/nav_help_mouse_zoom.png",
  7752. keyboard: "images/nav_help_keyboard_up_down.png"
  7753. }
  7754. },
  7755. mobile: {
  7756. left: {
  7757. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7758. "big-image": "images/nav_help_gesture_position.png"
  7759. },
  7760. middle: {
  7761. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7762. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7763. },
  7764. right: {
  7765. "top-info": o.HELP_MOBILE_3,
  7766. "big-image": "images/nav_help_gesture_pinch.png"
  7767. }
  7768. }
  7769. },
  7770. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7771. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7772. "top-info": o.HELP_DESKTOP_360_2A,
  7773. "bottom-info": o.HELP_DESKTOP_360_2B,
  7774. "big-image": "images/nav_help_click_inside.png",
  7775. keyboard: "images/nav_help_inside_key.png"
  7776. },
  7777. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7778. "top-info": o.HELP_MOBILE_360_2,
  7779. "big-image": "images/nav_help_tap_inside.png"
  7780. },
  7781. this.assets[a.MORE_HELP] = {
  7782. desktop: {
  7783. "more-help-hlr": {
  7784. "top-info": o.HELP_MORE_HLR_A,
  7785. "big-image": "images/nav_help_expand.svg",
  7786. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7787. },
  7788. "more-help-dollhouse": {
  7789. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7790. "big-image": "images/nav_help_dollhouse.svg",
  7791. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7792. },
  7793. "more-help-floors": {
  7794. "top-info": o.HELP_MORE_FLOORS_A,
  7795. "big-image": "images/nav_help_floor picker.svg",
  7796. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7797. },
  7798. "more-help-tag": {
  7799. "top-info": o.HELP_MORE_TAG_A,
  7800. "big-image": "images/nav_help_tag.svg",
  7801. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7802. },
  7803. "more-help-zoom": {
  7804. "top-info": o.HELP_MORE_ZOOM_A,
  7805. "big-image": "images/nav_help_zoom.svg",
  7806. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7807. },
  7808. "more-help-tour": {
  7809. "top-info": o.HELP_MORE_TOUR_A,
  7810. "big-image": "images/nav_help_play.png",
  7811. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7812. },
  7813. "more-help-inside": {
  7814. "top-info": o.HELP_MORE_INSIDE_A,
  7815. "big-image": "images/nav_help_inside.svg",
  7816. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7817. },
  7818. "more-help-vr": {
  7819. "top-info": o.HELP_MORE_VR_A,
  7820. "big-image": "images/nav_help_vr.svg",
  7821. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7822. },
  7823. "more-help-360": {
  7824. "top-info": o.HELP_MORE_360_A,
  7825. "big-image": "images/nav_help_360.svg",
  7826. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7827. },
  7828. "more-help-fullscreen": {
  7829. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7830. "big-image": "images/nav_help_fullscreen.svg",
  7831. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7832. }
  7833. },
  7834. mobile: {
  7835. "more-help-hlr": {
  7836. "top-info": o.HELP_MORE_HLR_A,
  7837. "big-image": "images/nav_help_expand.svg",
  7838. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7839. },
  7840. "more-help-dollhouse": {
  7841. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7842. "big-image": "images/nav_help_dollhouse.svg",
  7843. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7844. },
  7845. "more-help-floors": {
  7846. "top-info": o.HELP_MORE_FLOORS_A,
  7847. "big-image": "images/nav_help_floor picker.svg",
  7848. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7849. },
  7850. "more-help-tag": {
  7851. "top-info": o.HELP_MORE_TAG_A,
  7852. "big-image": "images/nav_help_tag.svg",
  7853. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7854. },
  7855. "more-help-tour": {
  7856. "top-info": o.HELP_MORE_TOUR_A,
  7857. "big-image": "images/nav_help_play.png",
  7858. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7859. },
  7860. "more-help-inside": {
  7861. "top-info": o.HELP_MORE_INSIDE_A,
  7862. "big-image": "images/nav_help_inside.svg",
  7863. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  7864. },
  7865. "more-help-vr": {
  7866. "top-info": o.HELP_MORE_VR_A,
  7867. "big-image": "images/webvr.svg",
  7868. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  7869. },
  7870. "more-help-360": {
  7871. "top-info": o.HELP_MORE_360_A,
  7872. "big-image": "images/nav_help_360.svg",
  7873. "bottom-info": o.HELP_MOBILE_MORE_360_B
  7874. }
  7875. }
  7876. },
  7877. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  7878. desktop: {
  7879. left: {
  7880. "top-info": o.ROTATE,
  7881. "big-image": "images/nav_help_mouse_drag_left.png",
  7882. keyboard: "images/nav_help_keyboard_left_right.png"
  7883. },
  7884. middle: {
  7885. "top-info": o.MOVE,
  7886. "big-image": "images/nav_help_mouse_click.png",
  7887. keyboard: "images/nav_help_keyboard_up_down.png"
  7888. },
  7889. right: {
  7890. "top-info": o.PLAY,
  7891. "big-image": "images/Desktop-help-play-button.svg",
  7892. keyboard: "images/Desktop-help-spacebar-2.svg"
  7893. }
  7894. },
  7895. mobile: {
  7896. left: {
  7897. "top-info": o.ROTATE,
  7898. "big-image": "images/nav_help_gesture_drag.png"
  7899. },
  7900. middle: {
  7901. "top-info": o.MOVE,
  7902. "big-image": "images/nav_help_gesture_tap.png"
  7903. },
  7904. right: {
  7905. "top-info": o.PLAY,
  7906. "big-image": "images/mobile-help-play-button.svg"
  7907. }
  7908. }
  7909. },
  7910. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  7911. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  7912. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  7913. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  7914. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  7915. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  7916. }
  7917. },
  7918. fill: function(e, t, i) {
  7919. n.call(this, e, t, i, !0)
  7920. },
  7921. clear: function(e, t, i) {
  7922. n.call(this, e, t, i, !1)
  7923. }
  7924. }
  7925. }
  7926. , {
  7927. "../enum/HelpModalSize": 27,
  7928. "../enum/HelpModalType": 28,
  7929. "../enum/Viewmode": 51,
  7930. "../localization/localize": 108,
  7931. "../util/browser": 182
  7932. }],
  7933. 76: [function(e, t, i) {
  7934. "use strict";
  7935. t.exports = Object.freeze({
  7936. OPENED: "share.open",
  7937. CLOSED: "share.closed",
  7938. LINK_CLICKED: "share.linked"
  7939. })
  7940. }
  7941. , {}],
  7942. 77: [function(e, t, i) {
  7943. "use strict";
  7944. function n(n) {
  7945. function e(e, t) {
  7946. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  7947. I.emit(l.LINK_CLICKED, {
  7948. channel: n
  7949. }),
  7950. window.open(C[n], "shareWindow", i)
  7951. }
  7952. switch (n) {
  7953. case A.FACEBOOK:
  7954. e(580, 420);
  7955. break;
  7956. case A.TWITTER:
  7957. e(550, 440);
  7958. break;
  7959. case A.MAIL:
  7960. I.emit(l.LINK_CLICKED, {
  7961. channel: "email"
  7962. }),
  7963. window.open(C[n], "_blank");
  7964. break;
  7965. case A.LINKEDIN:
  7966. }
  7967. }
  7968. function r(e) {
  7969. I.emit(l.LINK_CLICKED, {
  7970. channel: "copylink"
  7971. });
  7972. var t = document.createRange();
  7973. t.selectNodeContents(v);
  7974. var i = window.getSelection();
  7975. i.removeAllRanges(),
  7976. i.addRange(t),
  7977. document.execCommand("copy"),
  7978. y.classList.remove("hidden"),
  7979. v.classList.add("highlighted")
  7980. }
  7981. function o(e) {
  7982. e && (e.stopPropagation(),
  7983. e.target === v) || (window.getSelection().removeAllRanges(),
  7984. v.classList.remove("highlighted"),
  7985. y.classList.add("hidden"))
  7986. }
  7987. var a = e("../../util/browser")
  7988. , s = e("../../localization/localize")
  7989. , l = e("./ShareEvents")
  7990. , c = e("../../util/common")
  7991. , h = e("events").EventEmitter
  7992. , u = document.getElementById("sharing")
  7993. , d = document.getElementById("share-modal")
  7994. , p = document.getElementById("share-close")
  7995. , f = document.getElementById("facebook-share")
  7996. , g = document.getElementById("twitter-share")
  7997. , m = document.getElementById("mail-share")
  7998. , v = document.getElementById("share-url-text")
  7999. , y = document.getElementById("copy-success")
  8000. , A = Object.freeze({
  8001. FACEBOOK: "facebook",
  8002. TWITTER: "twitter",
  8003. MAIL: "mail",
  8004. LINKEDIN: "linkedin"
  8005. })
  8006. , C = {};
  8007. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8008. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8009. C[A.MAIL] = "mailto:?subject=";
  8010. var I = {
  8011. init: function(e) {
  8012. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8013. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8014. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8015. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8016. u.addEventListener("click", this.toggle.bind(this)),
  8017. p.addEventListener("click", this.hide.bind(this)),
  8018. v.addEventListener("click", r),
  8019. d.addEventListener("click", o),
  8020. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8021. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8022. m.addEventListener("click", n.bind(this, A.MAIL)),
  8023. v.textContent = window.location.href + "&utm_source=4",
  8024. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8025. u.classList.remove("hidden")
  8026. },
  8027. show: function() {
  8028. this.emit(l.OPENED),
  8029. d.classList.add("fadeIn")
  8030. },
  8031. hide: function() {
  8032. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8033. document.selection && document.selection.empty(),
  8034. window.getSelection().removeAllRanges(),
  8035. o(),
  8036. d.classList.remove("fadeIn"))
  8037. },
  8038. toggle: function() {
  8039. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8040. }
  8041. };
  8042. c.extendObject(I, h.prototype),
  8043. t.exports = I
  8044. }
  8045. , {
  8046. "../../localization/localize": 108,
  8047. "../../util/browser": 182,
  8048. "../../util/common": 185,
  8049. "./ShareEvents": 76,
  8050. events: 202
  8051. }],
  8052. 78: [function(e, t, i) {
  8053. "use strict";
  8054. t.exports = Object.freeze({
  8055. OPENED: "terms.opened",
  8056. CLOSED: "terms.closed"
  8057. })
  8058. }
  8059. , {}],
  8060. 79: [function(e, t, i) {
  8061. "use strict";
  8062. var n = e("./TermsEvent")
  8063. , r = e("../../localization/localize")
  8064. , o = e("../../analytics")
  8065. , a = e("../../util/ajax")
  8066. , s = e("../../util/common")
  8067. , l = e("events").EventEmitter
  8068. , c = document.getElementById("terms-modal")
  8069. , h = {
  8070. init: function() {
  8071. $(".footer-terms").on("click", function(e) {
  8072. e.preventDefault(),
  8073. this.show()
  8074. }
  8075. .bind(this)),
  8076. $("#terms-modal .close").on("click", this.hide.bind(this))
  8077. },
  8078. show: function() {
  8079. this.emit(n.OPENED),
  8080. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8081. var t = $("#terms-text").html(e);
  8082. o.track("showcase_gui", {
  8083. gui_action: "click_terms_button",
  8084. interaction_source: "gui"
  8085. }),
  8086. t.find("a").attr("target", "_blank")
  8087. }).fail(function() {
  8088. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8089. }),
  8090. c.classList.add("fadeIn")
  8091. },
  8092. hide: function(e) {
  8093. e && e.preventDefault(),
  8094. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8095. c.classList.remove("fadeIn")
  8096. }
  8097. };
  8098. s.extendObject(h, l.prototype),
  8099. t.exports = h
  8100. }
  8101. , {
  8102. "../../analytics": 4,
  8103. "../../localization/localize": 108,
  8104. "../../util/ajax": 181,
  8105. "../../util/common": 185,
  8106. "./TermsEvent": 78,
  8107. events: 202
  8108. }],
  8109. 80: [function(e, t, i) {
  8110. "use strict";
  8111. t.exports = Object.freeze({
  8112. OPEN_INFO: "title.open.info",
  8113. CLOSE_INFO: "title.close.info",
  8114. SHOW_INFO: "title.show.info",
  8115. HIDE_INFO: "title.hide.info",
  8116. LINK_CLICKED: "title.link.click",
  8117. CONTACT_LINK_CLICKED: "title.contact.click",
  8118. ORIGIN_LINK_CLICKED: "title.origin.click"
  8119. })
  8120. }
  8121. , {}],
  8122. 81: [function(e, t, i) {
  8123. "use strict";
  8124. var o = e("../../settings");
  8125. t.exports.init = function(e, t) {
  8126. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8127. function e(e) {
  8128. t.shouldShowtags = "show" === this.value,
  8129. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8130. }
  8131. document.getElementById("tag-toggles").classList.remove("hidden"),
  8132. document.getElementById("radio-tag-show").checked = !0;
  8133. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8134. n[r].addEventListener("change", e)
  8135. }(e, t)
  8136. }
  8137. }
  8138. , {
  8139. "../../settings": 166
  8140. }],
  8141. 82: [function(S, M, e) {
  8142. (function(e) {
  8143. "use strict";
  8144. function i(e) {
  8145. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8146. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8147. _.appendChild(function(e) {
  8148. var t = document.createElement("a");
  8149. return t.id = "url",
  8150. t.target = "_blank",
  8151. t.href = e,
  8152. t.innerText = e,
  8153. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8154. t
  8155. }(e)),
  8156. b.forEach(function(e) {
  8157. e.classList.add("share-link")
  8158. }),
  8159. 0))
  8160. }
  8161. function s(e, t) {
  8162. var i = e
  8163. , n = t;
  8164. return function(e, t) {
  8165. i.push(t || n, e)
  8166. }
  8167. }
  8168. var l = S("../../util/browser")
  8169. , t = S("../../util/common")
  8170. , n = S("../../util/logger")
  8171. , r = S("../../localization/localize")
  8172. , o = S("./titleBarSettings")
  8173. , c = S("../../settings")
  8174. , a = S("./TitleEvents")
  8175. , h = S("events").EventEmitter
  8176. , u = new n(e)
  8177. , d = document.querySelector(".pinTop.left")
  8178. , p = document.getElementsByClassName("title-container")[0]
  8179. , f = document.getElementById("title-toggle").querySelector("i")
  8180. , g = document.getElementById("meta-info-wrapper")
  8181. , m = document.getElementById("meta-info")
  8182. , v = document.getElementById("meta-description")
  8183. , y = document.getElementsByClassName("contact-info")[0]
  8184. , A = document.getElementById("contact-data")
  8185. , C = document.getElementById("addressTxt")
  8186. , I = document.getElementById("tag-toggles")
  8187. , E = document.getElementById("share-origin")
  8188. , _ = document.getElementById("share-link-wrapper")
  8189. , b = [m, g, p]
  8190. , w = !1
  8191. , T = !1
  8192. , x = {
  8193. populate: function(e) {
  8194. if (function(e, t) {
  8195. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8196. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8197. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8198. document.getElementById("gui-name").classList.add("noCoBrand"),
  8199. document.getElementById("cobrandTitle").classList.add("hidden")),
  8200. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8201. !1)
  8202. }(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  8203. if (function(e) {
  8204. e ? (w = !0,
  8205. v.innerHTML = e) : v.classList.add("hidden")
  8206. }(e.description),
  8207. function(e, t, i, n) {
  8208. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8209. w = !0;
  8210. var r = []
  8211. , o = s(r, "<br>");
  8212. if (e && o('<span id="contactName">' + e + "</span>"),
  8213. t) {
  8214. var a = n || t;
  8215. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8216. }
  8217. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8218. r[0] = "",
  8219. A.innerHTML = r.join("")
  8220. } else
  8221. y.classList.add("hidden")
  8222. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8223. function(e) {
  8224. if ("string" == typeof e)
  8225. try {
  8226. e = JSON.parse(e)
  8227. } catch (e) {
  8228. return u.warn("Unable to parse address data"),
  8229. C.parentElement.classList.add("hidden")
  8230. }
  8231. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8232. w = !0;
  8233. var t = []
  8234. , i = s(t, " ");
  8235. e.address_1 && i(e.address_1),
  8236. e.address_2 && i(e.address_2),
  8237. e.city && i(e.city, ", "),
  8238. e.state && i(e.state, ", "),
  8239. e.zip && i(e.zip, e.state ? " " : ", "),
  8240. t[0] = "",
  8241. C.innerText = t.join("")
  8242. } else
  8243. C.parentElement.classList.add("hidden")
  8244. }(e.address),
  8245. w) {
  8246. var t = document.createElement("br");
  8247. I.insertBefore(t, I.firstElementChild)
  8248. }
  8249. e.socialSharing && c.share.enabled && (T = i(e.url))
  8250. }
  8251. },
  8252. finishSetup: function(e) {
  8253. w = w || !!e,
  8254. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8255. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8256. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8257. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8258. }),
  8259. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8260. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8261. contact_type: e.getAttribute("id")
  8262. }))
  8263. }),
  8264. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8265. },
  8266. toggleMeta: function(e, t) {
  8267. var i = document.getElementById("model-title");
  8268. t && t.preventDefault();
  8269. var n = m.classList.contains("expand");
  8270. e && !n || (n ? (b.forEach(function(e) {
  8271. e.classList.remove("expand")
  8272. }),
  8273. this.emit(a.CLOSE_INFO),
  8274. i.classList.remove("expand")) : (b.forEach(function(e) {
  8275. e.classList.add("expand")
  8276. }),
  8277. i.classList.add("expand"),
  8278. this.emit(a.OPEN_INFO)))
  8279. },
  8280. setupToggling: function() {
  8281. g.style.height = m.offsetHeight + "px",
  8282. m.addEventListener("transitionend", function() {
  8283. g.style.height = m.offsetHeight + "px"
  8284. })
  8285. },
  8286. toggleTitle: function(e) {
  8287. e && e.preventDefault(),
  8288. d.classList.contains("closed") ? (d.classList.add("open"),
  8289. f.classList.remove("icon-dpad-right"),
  8290. f.classList.add("icon-dpad-left"),
  8291. this.emit(a.SHOW_INFO),
  8292. setTimeout(function() {
  8293. d.classList.remove("closed"),
  8294. d.classList.remove("open")
  8295. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8296. f.classList.remove("icon-dpad-left"),
  8297. f.classList.add("icon-dpad-right"),
  8298. this.emit(a.HIDE_INFO))
  8299. }
  8300. };
  8301. t.extendObject(x, h.prototype),
  8302. M.exports = x
  8303. }
  8304. ).call(this, "/js/gui/title/titleBar.js")
  8305. }
  8306. , {
  8307. "../../localization/localize": 108,
  8308. "../../settings": 166,
  8309. "../../util/browser": 182,
  8310. "../../util/common": 185,
  8311. "../../util/logger": 189,
  8312. "./TitleEvents": 80,
  8313. "./titleBarSettings": 83,
  8314. events: 202
  8315. }],
  8316. 83: [function(e, t, i) {
  8317. "use strict";
  8318. t.exports = Object.freeze({
  8319. minTooltipCharacters: 19,
  8320. removeAnimationClasses: 500
  8321. })
  8322. }
  8323. , {}],
  8324. 84: [function(e, t, i) {
  8325. "use strict";
  8326. function n() {
  8327. v.playTour(),
  8328. y && clearTimeout(y),
  8329. c(),
  8330. E.removeClass("fadeIn")
  8331. }
  8332. function r() {
  8333. A.classList.contains("playing") && (v.stopTour(),
  8334. E.addClass("fadeIn"),
  8335. setTimeout(function() {
  8336. E.removeClass("fadeIn")
  8337. }, h.tourInteraction.showPauseButton),
  8338. M || (clearTimeout(y),
  8339. y = setTimeout(s, h.tourInteraction.showModal)),
  8340. setTimeout(function() {
  8341. A.classList.remove("playing")
  8342. }, h.tourInteraction.allowNextClick))
  8343. }
  8344. function o() {
  8345. v.tourInProgress && (v.stopTour(),
  8346. v.endTourProgress(),
  8347. A.classList.remove("playing"))
  8348. }
  8349. function a() {
  8350. _.is(":visible") ? n() : r()
  8351. }
  8352. function s() {//去掉导览结束时的提示
  8353. /* if (!h.tourInteraction.disabled) {
  8354. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8355. T.addClass("fadeIn tour " + p.deviceType);
  8356. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8357. if (!h.tourInteraction.smallModal)
  8358. 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,
  8359. p.fill(x, g.TOUR_INTERACTION[e]),
  8360. T.addClass(e);
  8361. T.addClass(t)
  8362. } */
  8363. }
  8364. function l(e, t) {
  8365. if (t) {
  8366. var i = "keydown" === t.type
  8367. , n = t.which === u.SPACE || v.tourIsPlaying;
  8368. i && n || e || (M = !0),
  8369. v.atEndOfTour() && c(),
  8370. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8371. c(),
  8372. t.which !== u.SPACE && o()),
  8373. i && n && a()
  8374. }
  8375. }
  8376. function c() {
  8377. T.removeClass("fadeIn")
  8378. }
  8379. var h = (e("../util/browser"),
  8380. e("../settings"))
  8381. , u = e("../enum/Keys")
  8382. , d = e("../enum/Viewmode")
  8383. , p = (e("./helpManager"),
  8384. e("./populateModal"))
  8385. , f = e("../enum/DirectorEvents")
  8386. , g = e("../enum/HelpModalType")
  8387. , m = e("../enum/HelpModalSize")
  8388. , v = null
  8389. , y = null
  8390. , A = document.getElementById("pause-overlay")
  8391. , C = document.getElementById("player")
  8392. , I = document.getElementById("gui")
  8393. , E = $("#pause-icon").eq(0)
  8394. , _ = $("#play").eq(0)
  8395. , b = $("#playHead").eq(0)
  8396. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8397. , T = $("#interaction-modal").eq(0)
  8398. , x = $("#interaction-modal .interaction").toArray()
  8399. , S = ["touchstart", "mousedown", "pointerdown"]
  8400. , M = !1;
  8401. t.exports.init = function(e) {
  8402. v = e,
  8403. S.forEach(function(t) {
  8404. C.addEventListener(t, l.bind(this, !1), !0),
  8405. I.addEventListener(t, l.bind(this, !0), !0),
  8406. A.addEventListener(t, r, !0),
  8407. w.forEach(function(e) {
  8408. e.addEventListener(t, o, !0)
  8409. }),
  8410. $("#drawer img").on(t, o)
  8411. }),
  8412. document.addEventListener("keydown", l.bind(this, !1), !0),
  8413. v.on(f.TourStart, function() {
  8414. A.classList.add("playing")
  8415. })
  8416. }
  8417. ,
  8418. t.exports.play = n,
  8419. t.exports.pause = r,
  8420. t.exports.pauseWithoutCTA = o,
  8421. t.exports.togglePlay = a,
  8422. t.exports.stopTour = function() {
  8423. b.hasClass("playing") && (clearTimeout(y),
  8424. v.atEndOfTour() ? (A.classList.remove("playing"),
  8425. s()) : E.removeClass("fadeIn"))
  8426. }
  8427. ,
  8428. t.exports.dismissModal = c
  8429. }
  8430. , {
  8431. "../enum/DirectorEvents": 23,
  8432. "../enum/HelpModalSize": 27,
  8433. "../enum/HelpModalType": 28,
  8434. "../enum/Keys": 30,
  8435. "../enum/Viewmode": 51,
  8436. "../settings": 166,
  8437. "../util/browser": 182,
  8438. "./helpManager": 68,
  8439. "./populateModal": 75
  8440. }],
  8441. 85: [function(e, t, i) {
  8442. "use strict";
  8443. t.exports = Object.freeze({
  8444. OPENED: "vr.modal.opened",
  8445. LAUNCH: "vr.modal.launch",
  8446. CLOSED: "vr.modal.closed",
  8447. NEXT: "vr.modal.next",
  8448. PREV: "vr.modal.prev",
  8449. STORE: "vr.modal.store",
  8450. falseICECHOSEN: "vr.modal.device"
  8451. })
  8452. }
  8453. , {}],
  8454. 86: [function(e, t, i) {
  8455. "use strict";
  8456. var h = e("../../util/browser")
  8457. , u = e("../../enum/VRApps")
  8458. , n = e("../../enum/VRPlatforms")
  8459. , d = e("../../util/ajax")
  8460. , p = e("../../settings")
  8461. , r = {};
  8462. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8463. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8464. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8465. u) {
  8466. var a = u[o];
  8467. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8468. }
  8469. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8470. "https://" + s);
  8471. t.exports.init = function(e, t, o) {
  8472. function a(e, t, i, n) {
  8473. function r() {
  8474. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8475. }
  8476. 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()
  8477. }
  8478. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8479. , l = g + "/vr/dlist/?ret=" + s
  8480. , c = g + "/vr/show/?ret=" + s;
  8481. switch (e) {
  8482. case n.IOS:
  8483. !function(t, e, i, n) {
  8484. var r = a(t, e, i, n)
  8485. , o = {
  8486. responseType: "json",
  8487. data: {
  8488. branch_key: p.appConfig.branch_key,
  8489. data: {
  8490. m: e,
  8491. full_url: r,
  8492. $desktop_url: "",
  8493. $og_app_id: "331853976762864119",
  8494. $og_title: i,
  8495. $og_description: n,
  8496. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8497. $canonical_url: window.location.href
  8498. }
  8499. }
  8500. };
  8501. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8502. f[t] = e.url
  8503. }).fail(function(e) {
  8504. f[t] = e
  8505. }
  8506. .bind(this, r))
  8507. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8508. break;
  8509. default:
  8510. !function(e, t, i) {
  8511. for (var n in u) {
  8512. var r = u[n]
  8513. , o = a(r, e, t, i);
  8514. f[r] = o
  8515. }
  8516. }(t.sid, t.name, t.summary)
  8517. }
  8518. }
  8519. ,
  8520. t.exports.launch = function(e) {
  8521. var t = f[e];
  8522. window.open(t, "_blank")
  8523. }
  8524. ,
  8525. t.exports.launchStore = function(e) {
  8526. var t = r[e];
  8527. window.open(t, "_blank")
  8528. }
  8529. }
  8530. , {
  8531. "../../enum/VRApps": 46,
  8532. "../../enum/VRPlatforms": 49,
  8533. "../../settings": 166,
  8534. "../../util/ajax": 181,
  8535. "../../util/browser": 182
  8536. }],
  8537. 87: [function(e, t, i) {
  8538. "use strict";
  8539. function c(e) {
  8540. var t;
  8541. switch (e) {
  8542. case y.IOS:
  8543. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8544. case y.Android:
  8545. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8546. }
  8547. return !1
  8548. }
  8549. function h(e) {
  8550. switch (e) {
  8551. case y.Android:
  8552. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8553. x.filter(".gearvr").off().on("click", q.gear),
  8554. n(k, U, "logo-button", "same-line");
  8555. break;
  8556. case y.UnsupportedAndroid:
  8557. n("", H, "", "");
  8558. break;
  8559. case y.IOS:
  8560. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8561. n(k, "", "logo-button", "");
  8562. break;
  8563. case y.Desktop:
  8564. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8565. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8566. n(k, U, "logo-button", "same-line"),
  8567. Q.cardboard()
  8568. }
  8569. }
  8570. function u(e) {
  8571. $(".p1, .p2, .p3").hide(),
  8572. l.insertAfter(T),
  8573. w.removeClass("front-page"),
  8574. w.removeClass("details-page"),
  8575. w.removeClass("lastPage"),
  8576. x.removeClass("logo-button"),
  8577. x.removeClass("same-line"),
  8578. T.removeClass("headsetOptions"),
  8579. S.attr("src", ""),
  8580. S.filter(".second").removeClass("gear"),
  8581. S.css("display", "inline-block"),
  8582. S.off(),
  8583. M.filter(".second").css("display", ""),
  8584. O.css("display", "none"),
  8585. $(".p" + (e + 1) + _).show(),
  8586. S.filter(".third").insertBefore(M.filter(".third"))
  8587. }
  8588. function n(e, t, i, n) {
  8589. w.addClass("front-page"),
  8590. S.filter(".first").attr("src", e),
  8591. S.filter(".second").attr("src", t),
  8592. x.filter(".first").addClass(i),
  8593. x.filter(".second").addClass(i),
  8594. x.addClass(n),
  8595. ".show-desktop" === _ && T.insertAfter(l)
  8596. }
  8597. function r(e, t, i) {
  8598. T.addClass("headsetOptions"),
  8599. x.off(),
  8600. S.filter(".second").attr("src", t),
  8601. O.css("display", "block"),
  8602. M.filter(".second").css("display", "none"),
  8603. O.on("click", function() {
  8604. u(b.Title),
  8605. h(y.Desktop)
  8606. }),
  8607. e && (X.emit(C.falseICECHOSEN, {
  8608. name: v.GearVR
  8609. }),
  8610. S.filter(".first").attr("src", e),
  8611. S.filter(".second").addClass("gear"),
  8612. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8613. Q.gearvr()),
  8614. i && (X.emit(C.falseICECHOSEN, {
  8615. name: v.Cardboard
  8616. }),
  8617. S.filter(".third").attr("src", i),
  8618. S.filter(".third").show(),
  8619. S.filter(".third").insertAfter(S.filter(".second")),
  8620. S.filter(".third").addClass("link"),
  8621. S.filter(".second").addClass("link"),
  8622. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8623. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8624. Q.cardboard())
  8625. }
  8626. function d(e, t) {
  8627. switch (t) {
  8628. case y.IOS:
  8629. j = W,
  8630. Y = G;
  8631. break;
  8632. case y.Desktop:
  8633. e === b.Cardboard ? (j = N,
  8634. Y = B,
  8635. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8636. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8637. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8638. Y = "");
  8639. break;
  8640. default:
  8641. Y = e === b.Cardboard ? (j = H,
  8642. G) : (j = V,
  8643. z)
  8644. }
  8645. }
  8646. function p(e, t, i) {
  8647. w.find(".inner").addClass("details-page"),
  8648. w.addClass("details-page"),
  8649. S.filter(".first").attr("src", e),
  8650. S.filter(".second").attr("src", t),
  8651. S.filter(".third").attr("src", i)
  8652. }
  8653. function f() {
  8654. var e = 1 < g.aspectRatio() && g.isMobile();
  8655. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8656. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8657. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8658. }
  8659. var g = e("../../util/browser")
  8660. , m = e("./vrLink")
  8661. , v = e("../../enum/VRApps")
  8662. , y = e("../../enum/VRPlatforms")
  8663. , A = e("../../enum/VRPages")
  8664. , C = e("./vrEvent")
  8665. , o = (e("../../settings"),
  8666. e("../../constants"))
  8667. , I = e("../../localization/localize")
  8668. , a = e("../../util/common")
  8669. , s = e("events").EventEmitter
  8670. , E = 0
  8671. , _ = null
  8672. , b = A.standard
  8673. , w = $(".vr-popup")
  8674. , l = w.find(".vr-popup-body")
  8675. , T = w.find(".vr-images")
  8676. , x = w.find(".img-container")
  8677. , S = w.find(".vr-sm-image")
  8678. , M = x.find(".vr-img-caption")
  8679. , R = $(".vr-buttons").find(".prev-button")
  8680. , P = $(".vr-buttons").find(".next-button")
  8681. , O = T.find(".front-close")
  8682. , L = $(".vr-page")
  8683. , D = w.find("img")
  8684. , N = "images/apple-store.png"
  8685. , F = "images/badge-oculus.png"
  8686. , B = "images/badge-cardboard.png"
  8687. , V = "images/logo-samsung.png"
  8688. , k = "images/headset-cardboard.png"
  8689. , U = "images/headset-gearvr.png"
  8690. , H = "images/ico-android-robot.png"
  8691. , z = "images/ico-gearvr.png"
  8692. , G = "images/ico-vr.png"
  8693. , W = "images/apple-logo-white.svg"
  8694. , j = null
  8695. , Y = null
  8696. , q = {}
  8697. , X = {
  8698. init: function(e, t) {
  8699. function i(e) {
  8700. X.emit(C.STORE, {
  8701. type: e
  8702. }),
  8703. m.launchStore(e)
  8704. }
  8705. function n(e) {
  8706. switch (e !== b.pageCount && (u(e),
  8707. L.text(e + 1 + " / " + b.pageCount)),
  8708. e) {
  8709. case b.Title:
  8710. R.css("display", "none"),
  8711. P.text(a[e]),
  8712. h(r);
  8713. break;
  8714. case b.Cardboard:
  8715. R.css("display", "block"),
  8716. P.text(a[e]),
  8717. x.filter(".cardboard").off(),
  8718. x.filter(".gearvr").off(),
  8719. d(e, r),
  8720. p(k, j, Y);
  8721. break;
  8722. case b.Gear:
  8723. P.text(a[e]),
  8724. d(e, r),
  8725. w.addClass("lastPage"),
  8726. p(U, j, Y);
  8727. break;
  8728. case b.pageCount:
  8729. w.removeClass("fadeIn"),
  8730. X.emit(C.CLOSED)
  8731. }
  8732. D.filter("[src='']").hide()
  8733. }
  8734. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8735. _ = ".show-supported",
  8736. y.Android) : (w.addClass("unsupported"),
  8737. _ = ".show-unsupported",
  8738. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8739. _ = ".show-ios",
  8740. b = A.ios,
  8741. y.IOS) : (w.addClass("desktop"),
  8742. _ = ".show-desktop",
  8743. y.Desktop);
  8744. function o(e) {
  8745. X.emit(C.LAUNCH, {
  8746. vr_platform: r,
  8747. vr_app: e
  8748. }),
  8749. m.launch(e)
  8750. }
  8751. m.init(r, e, t),
  8752. r !== y.Desktop && w.addClass("mobile"),
  8753. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8754. q.gear = o.bind(this, v.GearVR),
  8755. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8756. f(),
  8757. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8758. $(_).show();
  8759. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8760. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8761. r === y.IOS && (a.splice(1, 1),
  8762. s.splice(1, 1)),
  8763. $("#vr").on("click", function(e) {
  8764. e.preventDefault(),
  8765. window.vrEnabled || (window.vrEnabled = !0,
  8766. this.classList.add("active"),
  8767. $("#gui div").not("#vrOff").addClass("vrHide"),
  8768. $("#vrOffImg").css({
  8769. display: "inline-block"
  8770. }))
  8771. }),
  8772. $("#vrOff").on("click", function() {
  8773. window.vrEnabled = !1,
  8774. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8775. $("#vrOffImg").css({
  8776. display: "none"
  8777. }),
  8778. $("#player canvas").css({
  8779. width: "",
  8780. height: ""
  8781. }),
  8782. $("#vr").removeClass("active")
  8783. });
  8784. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8785. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8786. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8787. $("span.modelLink").text(l),
  8788. R.on("click", function(e) {
  8789. X.emit(C.PREV),
  8790. n(--E)
  8791. }),
  8792. P.on("click", function(e) {
  8793. P.text(),
  8794. X.emit(C.NEXT, {
  8795. nextAction: s[E]
  8796. }),
  8797. n(++E)
  8798. }),
  8799. w.find(".close").on("click", X.dismiss)
  8800. },
  8801. dismiss: function() {
  8802. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8803. X.emit(C.CLOSED))
  8804. },
  8805. isDeviceSupported: c
  8806. };
  8807. a.extendObject(X, s.prototype),
  8808. $(window).resize(f);
  8809. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8810. K = M.filter(".first").find(".gearvr"),
  8811. {
  8812. cardboard: function() {
  8813. K.addClass("hidden"),
  8814. Z.removeClass("hidden")
  8815. },
  8816. gearvr: function() {
  8817. Z.addClass("hidden"),
  8818. K.removeClass("hidden")
  8819. }
  8820. });
  8821. t.exports = X
  8822. }
  8823. , {
  8824. "../../constants": 8,
  8825. "../../enum/VRApps": 46,
  8826. "../../enum/VRPages": 48,
  8827. "../../enum/VRPlatforms": 49,
  8828. "../../localization/localize": 108,
  8829. "../../settings": 166,
  8830. "../../util/browser": 182,
  8831. "../../util/common": 185,
  8832. "./vrEvent": 85,
  8833. "./vrLink": 86,
  8834. events: 202
  8835. }],
  8836. 88: [function(e, t, i) {
  8837. "use strict";
  8838. t.exports = Object.freeze({
  8839. OPENED: "webvr.modal.opened",
  8840. SHOW_TERMS: "webvr.footer.show.terms"
  8841. })
  8842. }
  8843. , {}],
  8844. 89: [function(B, V, e) {
  8845. (function(e) {
  8846. "use strict";
  8847. function a() {
  8848. function t() {
  8849. p.isPresenting || (r.info("exiting webVR"),
  8850. c("webvr_exit_app"),
  8851. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  8852. window.removeEventListener("vrdisplaypresentchange", t))
  8853. }
  8854. r.info("Headset mounted"),
  8855. u.suspend();
  8856. var e = document.createElement("canvas");
  8857. for (e.getContext("webgl"),
  8858. e.className = "webvr-canvas",
  8859. document.bgColor = "#000",
  8860. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  8861. document.body.removeChild(document.body.firstChild);
  8862. document.body.appendChild(e),
  8863. c("webvr_enter_app"),
  8864. p.requestPresent([{
  8865. source: e,
  8866. predistorted: !0
  8867. }]).catch(function(e) {
  8868. r.error("Failed to present: " + e),
  8869. c("webvr_exit_calibrate"),
  8870. t()
  8871. }),
  8872. d.then(function() {
  8873. window.dispatchEvent(new Event("vrapp-start"))
  8874. }),
  8875. window.addEventListener("vrdisplaypresentchange", t)
  8876. }
  8877. function s() {
  8878. c("webvr_modal_close"),
  8879. _.find(".enter-button").off("click", a),
  8880. E.fadeOut(g.guiAnimationSpeed, function() {
  8881. _.toggleClass("hidden", !1),
  8882. b.toggleClass("hidden", !0),
  8883. f.exitFullscreen()
  8884. }),
  8885. I.fadeIn(g.guiAnimationSpeed)
  8886. }
  8887. function t() {
  8888. M.toggleClass("hidden", !0),
  8889. S.toggleClass("hidden", !1)
  8890. }
  8891. function l() {
  8892. _.toggleClass("hidden"),
  8893. b.toggleClass("hidden")
  8894. }
  8895. function c(e) {
  8896. var t = f.isLandscape() ? "landscape" : "portrait";
  8897. i.trackAlways("showcase_gui", {
  8898. gui_action: e,
  8899. orientation: t
  8900. })
  8901. }
  8902. function h() {
  8903. var e = f.isLandscape();
  8904. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  8905. }
  8906. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  8907. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  8908. 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 = {
  8909. init: function(e, t, i, n) {
  8910. function r(e) {
  8911. e.preventDefault(),
  8912. o(e.currentTarget.id)
  8913. }
  8914. function o(i) {
  8915. F[i](),
  8916. Object.keys(F).map(function(e, t) {
  8917. $("#" + e).toggleClass("tabs-underlined", e === i)
  8918. })
  8919. }
  8920. p = i,
  8921. u = t,
  8922. y.init(m.Android, e, n),
  8923. h(),
  8924. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  8925. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  8926. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  8927. w.filter(".device-headset-side").attr("src", R),
  8928. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  8929. $("#vr").on("click", function(e) {
  8930. e.preventDefault(),
  8931. c("click_webvr_button"),
  8932. E.is(":hidden") && (N.emit(A.OPENED),
  8933. I.fadeOut(g.guiAnimationSpeed),
  8934. E.fadeIn(g.guiAnimationSpeed),
  8935. function() {
  8936. if (!d) {
  8937. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  8938. d = new Promise(function(e, t) {
  8939. var i = document.createElement("script");
  8940. i.type = "text/javascript",
  8941. i.src = n,
  8942. i.onload = e,
  8943. document.head.appendChild(i)
  8944. }
  8945. )
  8946. }
  8947. _.find(".enter-button").on("click", a)
  8948. }())
  8949. }),
  8950. $(".webvr-popup .close").on("click", function(e) {
  8951. e.preventDefault(),
  8952. _.hasClass("hidden") ? (c("webvr_help_close"),
  8953. l()) : s()
  8954. }),
  8955. $("#tabcardboard").on("click", r),
  8956. $("#tabdaydream").on("click", r),
  8957. $("#tabnative").on("click", r),
  8958. $(".webvr-popup .open-with-app").on("click", function(e) {
  8959. e.preventDefault(),
  8960. c("webvr_learn_more"),
  8961. o("tabnative"),
  8962. l()
  8963. }),
  8964. $(".webvr-popup .help").on("click", function(e) {
  8965. e.preventDefault(),
  8966. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  8967. l()
  8968. }),
  8969. $(".webvr-popup .terms").on("click", function(e) {
  8970. e.preventDefault(),
  8971. c("webvr_click_terms"),
  8972. s(),
  8973. N.emit(A.SHOW_TERMS)
  8974. }),
  8975. T.on("click", function(e) {
  8976. e.preventDefault(),
  8977. c(D),
  8978. window.open(L, "_blank")
  8979. }),
  8980. x.on("click", function(e) {
  8981. e.preventDefault(),
  8982. c("webvr_phone_link"),
  8983. window.open("https://vr.google.com/daydream/phones/", "_blank")
  8984. }),
  8985. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  8986. e.preventDefault(),
  8987. c("webvr_cardboard_link"),
  8988. y.launch(v.CardboardAndroid)
  8989. }),
  8990. $(".webvr-popup .badge-oculus").on("click", function(e) {
  8991. e.preventDefault(),
  8992. c("webvr_oculus_link"),
  8993. y.launch(v.GearVR)
  8994. })
  8995. }
  8996. }, F = {
  8997. tabcardboard: function() {
  8998. w.filter(".device-headset").attr("src", R),
  8999. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9000. L = "https://vr.google.com/cardboard/get-cardboard/",
  9001. D = "webvr_cardboard_link",
  9002. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9003. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9004. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9005. t()
  9006. },
  9007. tabdaydream: function() {
  9008. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9009. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9010. L = P,
  9011. D = O,
  9012. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9013. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9014. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9015. t()
  9016. },
  9017. tabnative: function() {
  9018. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9019. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9020. M.toggleClass("hidden", !1),
  9021. S.toggleClass("hidden", !0)
  9022. }
  9023. };
  9024. n.extendObject(N, o.prototype),
  9025. $(window).resize(h),
  9026. V.exports = N
  9027. }
  9028. ).call(this, "/js/gui/webvr/webVRgui.js")
  9029. }
  9030. , {
  9031. "../../analytics": 4,
  9032. "../../constants": 8,
  9033. "../../enum/VRApps": 46,
  9034. "../../enum/VRPlatforms": 49,
  9035. "../../localization/localize": 108,
  9036. "../../settings": 166,
  9037. "../../util/browser": 182,
  9038. "../../util/common": 185,
  9039. "../../util/logger": 189,
  9040. "./../gui": 65,
  9041. "./../vr/vrLink": 86,
  9042. "./WebVrEvent": 88,
  9043. events: 202
  9044. }],
  9045. 90: [function(e, t, i) {
  9046. "use strict";
  9047. function n(e, t, i, n, r) {
  9048. this.floorId = n || 0 === n ? n : -1,
  9049. this.roomId = r || "",
  9050. this.labelId = e,
  9051. this.position = (new o.Vector3).copy(t),
  9052. this.text = i
  9053. }
  9054. var o = e("three")
  9055. , r = e("../util/browser");
  9056. n.prototype.build = function() {
  9057. var e = window.document.createElement("div");
  9058. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9059. var t = window.document.createElement("div");
  9060. t.setAttribute("class", "gui-floorplan-label-text");
  9061. var i = window.document.createTextNode(this.text);
  9062. t.appendChild(i),
  9063. e.appendChild(t),
  9064. window.document.body.appendChild(e),
  9065. this.labelGui = e,
  9066. this.textBlock = t,
  9067. $(this.labelGui).hide();
  9068. var n = window.getComputedStyle(this.labelGui);
  9069. this.initialTransform = n.transform || n.webkitTransform
  9070. }
  9071. ,
  9072. t.exports = n
  9073. }
  9074. , {
  9075. "../util/browser": 182,
  9076. three: 217
  9077. }],
  9078. 91: [function(e, t, i) {
  9079. "use strict";
  9080. function n() {
  9081. this.player = null,
  9082. this.modelManager = null,
  9083. this.container = null
  9084. }
  9085. var c, o, r = e("three"), a = (e("../util/common"),
  9086. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9087. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9088. e("../util/transitions"),
  9089. e("../util/lerp"),
  9090. e("../util/browser"));
  9091. n.prototype.init = function(e, t, i) {
  9092. this.player = e,
  9093. this.modelManager = t,
  9094. this.container = i,
  9095. this.updateModel(),
  9096. this.bindEvents()
  9097. }
  9098. ,
  9099. n.prototype.bindEvents = function() {
  9100. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9101. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9102. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9103. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9104. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9105. }
  9106. ,
  9107. n.prototype.updateModel = function() {
  9108. this.model = this.modelManager.getActiveModel()
  9109. }
  9110. ,
  9111. n.prototype.handlePlayerViewChanged = function() {
  9112. this.updateLabelVisibility(),
  9113. this.updateLabelDisplay()
  9114. }
  9115. ,
  9116. n.prototype.getLabelsForFloor = function(t, i) {
  9117. return (i = i || []).length = 0,
  9118. this.model.labels.forEach(function(e) {
  9119. this.labelVisibleForFloor(e, t) && i.push(e)
  9120. }
  9121. .bind(this)),
  9122. i
  9123. }
  9124. ,
  9125. n.prototype.getLabelsForCurrentFloor = function(e) {
  9126. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9127. }
  9128. ,
  9129. n.prototype.labelVisibleForFloor = function(e, t) {
  9130. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9131. if (!this.model.showingLabels || !e.labelGui || !i)
  9132. return !1;
  9133. var n = e.floorId === this.model.floors.size() - 1;
  9134. return this.model.allFloorsVisible ? n : e.floorId === t
  9135. }
  9136. ,
  9137. n.prototype.updateLabelVisibility = function(e) {
  9138. this.model.labels.forEach(function(e) {
  9139. 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)
  9140. }
  9141. .bind(this))
  9142. }
  9143. ,
  9144. n.prototype.showAllLabels = function(t, i) {
  9145. this.model.labels.forEach(function(e) {
  9146. this.showLabel(e, t, i)
  9147. }
  9148. .bind(this))
  9149. }
  9150. ,
  9151. n.prototype.hideAllLabels = function(t, i) {
  9152. this.model.labels.forEach(function(e) {
  9153. this.hideLabel(e, t, i)
  9154. }
  9155. .bind(this))
  9156. }
  9157. ,
  9158. n.prototype.showLabel = function(e, t, i) {
  9159. this.model.showingLabels && (e.visible || (e.visible = !0,
  9160. e.labelGui.style.display = "block",
  9161. e.labelGui.style.opacity = 0,
  9162. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9163. }
  9164. ,
  9165. n.prototype.hideLabel = function(e, t, i) {
  9166. e.visible && (e.visible = !1,
  9167. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9168. }
  9169. ,
  9170. n.prototype.supportedMode = function() {
  9171. return this.player.mode === h.FLOORPLAN
  9172. }
  9173. ,
  9174. n.prototype.updateLabelDisplay = (new r.Vector3,
  9175. new r.Vector3,
  9176. o = [],
  9177. function() {
  9178. var e = this.player.getLabelScaleFactor()
  9179. , t = 1.2 * (1 - e) + .6
  9180. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9181. this.getLabelsForCurrentFloor(o);
  9182. for (var n = 0; n < o.length; n++) {
  9183. var r = o[n];
  9184. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9185. 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)
  9186. }
  9187. }
  9188. ),
  9189. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9190. new r.Vector3,
  9191. function(e, t, i, n, r) {
  9192. t.style.fontSize = 100 * r + "%";
  9193. var o = .5 * $("#player").width()
  9194. , a = .5 * $("#player").height();
  9195. c.copy(i),
  9196. c.project(this.player.camera);
  9197. var s = c.x * o + o
  9198. , l = -c.y * a + a;
  9199. s -= e.offsetWidth / 2,
  9200. l -= e.offsetHeight / 2,
  9201. e.style.left = s + "px",
  9202. e.style.top = l + "px"
  9203. }
  9204. ),
  9205. n.prototype.handleStartInside = function(e) {
  9206. this.updateLabelVisibility()
  9207. }
  9208. ,
  9209. n.prototype.handleStartOutside = function() {
  9210. this.updateLabelVisibility()
  9211. }
  9212. ,
  9213. t.exports = n
  9214. }
  9215. , {
  9216. "../enum/DirectorEvents": 23,
  9217. "../enum/ModelManagerEvents": 33,
  9218. "../enum/PlayerEvents": 40,
  9219. "../enum/Viewmode": 51,
  9220. "../enum/WarpStyle": 52,
  9221. "../settings": 166,
  9222. "../util/browser": 182,
  9223. "../util/common": 185,
  9224. "../util/lerp": 188,
  9225. "../util/transitions": 195,
  9226. three: 217
  9227. }],
  9228. 92: [function(e, t, i) {
  9229. "use strict";
  9230. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9231. if (null == this)
  9232. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9233. if ("function" != typeof e)
  9234. throw new TypeError("predicate must be a function");
  9235. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9236. if (t = i[o],
  9237. e.call(r, t, o, i))
  9238. return o;
  9239. return -1
  9240. }
  9241. ),
  9242. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9243. value: function(e) {
  9244. if (null == this)
  9245. throw new TypeError('"this" is null or not defined');
  9246. var t = Object(this)
  9247. , i = t.length >>> 0;
  9248. if ("function" != typeof e)
  9249. throw new TypeError("predicate must be a function");
  9250. for (var n = arguments[1], r = 0; r < i; ) {
  9251. var o = t[r];
  9252. if (e.call(n, o, r, t))
  9253. return o;
  9254. r++
  9255. }
  9256. }
  9257. })
  9258. }
  9259. , {}],
  9260. 93: [function(e, t, i) {
  9261. "use strict";
  9262. 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 || {};
  9263. function te() {
  9264. this.backgroundElement = document.createElement("div"),
  9265. r.extend(this.backgroundElement.style, {
  9266. backgroundColor: "rgba(0,0,0,0.8)",
  9267. top: 0,
  9268. left: 0,
  9269. display: "none",
  9270. zIndex: "1000",
  9271. opacity: 0,
  9272. WebkitTransition: "opacity 0.2s linear"
  9273. }),
  9274. n.makeFullscreen(this.backgroundElement),
  9275. this.backgroundElement.style.position = "fixed",
  9276. this.domElement = document.createElement("div"),
  9277. r.extend(this.domElement.style, {
  9278. position: "fixed",
  9279. display: "none",
  9280. zIndex: "1001",
  9281. opacity: 0,
  9282. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9283. }),
  9284. document.body.appendChild(this.backgroundElement),
  9285. document.body.appendChild(this.domElement);
  9286. var e = this;
  9287. n.bind(this.backgroundElement, "click", function() {
  9288. e.hide()
  9289. })
  9290. }
  9291. function ie(e, t, i) {
  9292. Object.defineProperty(e, t, {
  9293. get: function() {
  9294. return "RGB" === this.__state.space || re(this, t, i),
  9295. this.__state[t]
  9296. },
  9297. set: function(e) {
  9298. "RGB" !== this.__state.space && (re(this, t, i),
  9299. this.__state.space = "RGB"),
  9300. this.__state[t] = e
  9301. }
  9302. })
  9303. }
  9304. function ne(e, t) {
  9305. Object.defineProperty(e, t, {
  9306. get: function() {
  9307. return "HSV" === this.__state.space || oe(this),
  9308. this.__state[t]
  9309. },
  9310. set: function(e) {
  9311. "HSV" !== this.__state.space && (oe(this),
  9312. this.__state.space = "HSV"),
  9313. this.__state[t] = e
  9314. }
  9315. })
  9316. }
  9317. function re(e, t, i) {
  9318. if ("HEX" === e.__state.space)
  9319. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9320. else {
  9321. if ("HSV" !== e.__state.space)
  9322. throw "Corrupted color state";
  9323. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9324. }
  9325. }
  9326. function oe(e) {
  9327. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9328. l.extend(e.__state, {
  9329. s: t.s,
  9330. v: t.v
  9331. }),
  9332. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9333. }
  9334. function ae() {
  9335. if (this.__state = o.apply(this, arguments),
  9336. !1 === this.__state)
  9337. throw "Failed to interpret color arguments";
  9338. this.__state.a = this.__state.a || 1
  9339. }
  9340. function se(e) {
  9341. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9342. }
  9343. function le(e, t) {
  9344. this.initialValue = e[t],
  9345. this.domElement = document.createElement("div"),
  9346. this.object = e,
  9347. this.property = t,
  9348. this.__onChange = void 0,
  9349. this.__onFinishChange = void 0
  9350. }
  9351. (t.exports = ee).gui = ee.gui || {},
  9352. ee.utils = ee.utils || {},
  9353. ee.controllers = ee.controllers || {},
  9354. ee.dom = ee.dom || {},
  9355. ee.color = ee.color || {},
  9356. ee.utils.css = {
  9357. load: function(e, t) {
  9358. var i = (t = t || document).createElement("link");
  9359. i.type = "text/css",
  9360. i.rel = "stylesheet",
  9361. i.href = e,
  9362. t.getElementsByTagName("head")[0].appendChild(i)
  9363. },
  9364. inject: function(e, t) {
  9365. t = t || document;
  9366. var i = document.createElement("style");
  9367. i.type = "text/css",
  9368. i.innerHTML = e,
  9369. t.getElementsByTagName("head")[0].appendChild(i)
  9370. }
  9371. },
  9372. ee.utils.common = (Q = Array.prototype.forEach,
  9373. J = Array.prototype.slice,
  9374. {
  9375. BREAK: {},
  9376. extend: function(i) {
  9377. return this.each(J.call(arguments, 1), function(e) {
  9378. for (var t in e)
  9379. this.isUndefined(e[t]) || (i[t] = e[t])
  9380. }, this),
  9381. i
  9382. },
  9383. defaults: function(i) {
  9384. return this.each(J.call(arguments, 1), function(e) {
  9385. for (var t in e)
  9386. this.isUndefined(i[t]) && (i[t] = e[t])
  9387. }, this),
  9388. i
  9389. },
  9390. compose: function() {
  9391. var i = J.call(arguments);
  9392. return function() {
  9393. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9394. e = [i[t].apply(this, e)];
  9395. return e[0]
  9396. }
  9397. },
  9398. each: function(e, t, i) {
  9399. if (e)
  9400. if (Q && e.forEach && e.forEach === Q)
  9401. e.forEach(t, i);
  9402. else if (e.length === e.length + 0) {
  9403. for (var n = 0, r = e.length; n < r; n++)
  9404. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9405. return
  9406. } else
  9407. for (var n in e)
  9408. if (t.call(i, e[n], n) === this.BREAK)
  9409. return
  9410. },
  9411. defer: function(e) {
  9412. setTimeout(e, 0)
  9413. },
  9414. toArray: function(e) {
  9415. return e.toArray ? e.toArray() : J.call(e)
  9416. },
  9417. isUndefined: function(e) {
  9418. return void 0 === e
  9419. },
  9420. isNull: function(e) {
  9421. return null === e
  9422. },
  9423. isNaN: function(e) {
  9424. return e != e
  9425. },
  9426. isArray: Array.isArray || function(e) {
  9427. return e.constructor === Array
  9428. }
  9429. ,
  9430. isObject: function(e) {
  9431. return e === Object(e)
  9432. },
  9433. isNumber: function(e) {
  9434. return e === e + 0
  9435. },
  9436. isString: function(e) {
  9437. return e === e + ""
  9438. },
  9439. isBoolean: function(e) {
  9440. return !1 === e || !0 === e
  9441. },
  9442. isFunction: function(e) {
  9443. return "[object Function]" === Object.prototype.toString.call(e)
  9444. }
  9445. }),
  9446. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9447. onChange: function(e) {
  9448. return this.__onChange = e,
  9449. this
  9450. },
  9451. onFinishChange: function(e) {
  9452. return this.__onFinishChange = e,
  9453. this
  9454. },
  9455. setValue: function(e) {
  9456. return this.object[this.property] = e,
  9457. this.__onChange && this.__onChange.call(this, e),
  9458. this.updateDisplay(),
  9459. this
  9460. },
  9461. getValue: function() {
  9462. return this.object[this.property]
  9463. },
  9464. updateDisplay: function() {
  9465. return this
  9466. },
  9467. isModified: function() {
  9468. return this.initialValue !== this.getValue()
  9469. }
  9470. }),
  9471. le),
  9472. ee.dom.dom = function(c) {
  9473. function i(e) {
  9474. if ("0" === e || c.isUndefined(e))
  9475. return 0;
  9476. var t = e.match(n);
  9477. return c.isNull(t) ? 0 : parseFloat(t[1])
  9478. }
  9479. var h = {};
  9480. c.each({
  9481. HTMLEvents: ["change"],
  9482. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9483. KeyboardEvents: ["keydown"]
  9484. }, function(e, t) {
  9485. c.each(e, function(e) {
  9486. h[e] = t
  9487. })
  9488. });
  9489. var n = /(\d+(\.\d+)?)px/
  9490. , r = {
  9491. makeSelectable: function(e, t) {
  9492. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9493. return !1
  9494. }
  9495. : function() {}
  9496. ,
  9497. e.style.MozUserSelect = t ? "auto" : "none",
  9498. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9499. e.unselectable = t ? "on" : "off")
  9500. },
  9501. makeFullscreen: function(e, t, i) {
  9502. c.isUndefined(t) && (t = !0),
  9503. c.isUndefined(i) && (i = !0),
  9504. e.style.position = "absolute",
  9505. t && (e.style.left = 0,
  9506. e.style.right = 0),
  9507. i && (e.style.top = 0,
  9508. e.style.bottom = 0)
  9509. },
  9510. fakeEvent: function(e, t, i, n) {
  9511. i = i || {};
  9512. var r = h[t];
  9513. if (!r)
  9514. throw new Error("Event type " + t + " not supported.");
  9515. var o = document.createEvent(r);
  9516. switch (r) {
  9517. case "MouseEvents":
  9518. var a = i.x || i.clientX || 0
  9519. , s = i.y || i.clientY || 0;
  9520. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9521. break;
  9522. case "KeyboardEvents":
  9523. var l = o.initKeyboardEvent || o.initKeyEvent;
  9524. c.defaults(i, {
  9525. cancelable: !0,
  9526. ctrlKey: !1,
  9527. altKey: !1,
  9528. shiftKey: !1,
  9529. metaKey: !1,
  9530. keyCode: void 0,
  9531. charCode: void 0
  9532. }),
  9533. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9534. break;
  9535. default:
  9536. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9537. }
  9538. c.defaults(o, n),
  9539. e.dispatchEvent(o)
  9540. },
  9541. bind: function(e, t, i, n) {
  9542. return n = n || !1,
  9543. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9544. r
  9545. },
  9546. unbind: function(e, t, i, n) {
  9547. return n = n || !1,
  9548. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9549. r
  9550. },
  9551. addClass: function(e, t) {
  9552. if (void 0 === e.className)
  9553. e.className = t;
  9554. else if (e.className !== t) {
  9555. var i = e.className.split(/ +/);
  9556. -1 == i.indexOf(t) && (i.push(t),
  9557. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9558. }
  9559. return r
  9560. },
  9561. removeClass: function(e, t) {
  9562. if (t)
  9563. if (void 0 === e.className)
  9564. ;
  9565. else if (e.className === t)
  9566. e.removeAttribute("class");
  9567. else {
  9568. var i = e.className.split(/ +/)
  9569. , n = i.indexOf(t);
  9570. -1 != n && (i.splice(n, 1),
  9571. e.className = i.join(" "))
  9572. }
  9573. else
  9574. e.className = void 0;
  9575. return r
  9576. },
  9577. hasClass: function(e, t) {
  9578. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9579. },
  9580. getWidth: function(e) {
  9581. var t = getComputedStyle(e);
  9582. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9583. },
  9584. getHeight: function(e) {
  9585. var t = getComputedStyle(e);
  9586. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9587. },
  9588. getOffset: function(e) {
  9589. var t = {
  9590. left: 0,
  9591. top: 0
  9592. };
  9593. if (e.offsetParent)
  9594. for (; t.left += e.offsetLeft,
  9595. t.top += e.offsetTop,
  9596. e = e.offsetParent; )
  9597. ;
  9598. return t
  9599. },
  9600. isActive: function(e) {
  9601. return e === document.activeElement && (e.type || e.href)
  9602. }
  9603. };
  9604. return r
  9605. }(ee.utils.common),
  9606. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9607. X = ee.dom.dom,
  9608. Z = ee.utils.common,
  9609. (K = function(e, t, i) {
  9610. K.superclass.call(this, e, t);
  9611. var n = this;
  9612. if (this.__select = document.createElement("select"),
  9613. Z.isArray(i)) {
  9614. var r = {};
  9615. Z.each(i, function(e) {
  9616. r[e] = e
  9617. }),
  9618. i = r
  9619. }
  9620. Z.each(i, function(e, t) {
  9621. var i = document.createElement("option");
  9622. i.innerHTML = t,
  9623. i.setAttribute("value", e),
  9624. n.__select.appendChild(i)
  9625. }),
  9626. this.updateDisplay(),
  9627. X.bind(this.__select, "change", function() {
  9628. var e = this.options[this.selectedIndex].value;
  9629. n.setValue(e)
  9630. }),
  9631. this.domElement.appendChild(this.__select)
  9632. }
  9633. ).superclass = q,
  9634. Z.extend(K.prototype, q.prototype, {
  9635. setValue: function(e) {
  9636. var t = K.superclass.prototype.setValue.call(this, e);
  9637. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9638. t
  9639. },
  9640. updateDisplay: function() {
  9641. return this.__select.value = this.getValue(),
  9642. K.superclass.prototype.updateDisplay.call(this)
  9643. }
  9644. }),
  9645. K),
  9646. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9647. j = ee.utils.common,
  9648. (Y = function(e, t, i) {
  9649. Y.superclass.call(this, e, t),
  9650. i = i || {},
  9651. this.__min = i.min,
  9652. this.__max = i.max,
  9653. this.__step = i.step,
  9654. 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,
  9655. this.__precision = se(this.__impliedStep)
  9656. }
  9657. ).superclass = W,
  9658. j.extend(Y.prototype, W.prototype, {
  9659. setValue: function(e) {
  9660. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9661. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9662. Y.superclass.prototype.setValue.call(this, e)
  9663. },
  9664. min: function(e) {
  9665. return this.__min = e,
  9666. this
  9667. },
  9668. max: function(e) {
  9669. return this.__max = e,
  9670. this
  9671. },
  9672. step: function(e) {
  9673. return this.__step = e,
  9674. this.__impliedStep = e,
  9675. this.__precision = se(e),
  9676. this
  9677. }
  9678. }),
  9679. Y),
  9680. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9681. H = ee.dom.dom,
  9682. z = ee.utils.common,
  9683. (G = function(e, t, i) {
  9684. function n() {
  9685. var e = parseFloat(s.__input.value);
  9686. z.isNaN(e) || s.setValue(e)
  9687. }
  9688. function r(e) {
  9689. var t = a - e.clientY;
  9690. s.setValue(s.getValue() + t * s.__impliedStep),
  9691. a = e.clientY
  9692. }
  9693. function o() {
  9694. H.unbind(window, "mousemove", r),
  9695. H.unbind(window, "mouseup", o)
  9696. }
  9697. this.__truncationSuspended = !1,
  9698. G.superclass.call(this, e, t, i);
  9699. var a, s = this;
  9700. this.__input = document.createElement("input"),
  9701. this.__input.setAttribute("type", "text"),
  9702. H.bind(this.__input, "change", n),
  9703. H.bind(this.__input, "blur", function() {
  9704. n(),
  9705. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9706. }),
  9707. H.bind(this.__input, "mousedown", function(e) {
  9708. H.bind(window, "mousemove", r),
  9709. H.bind(window, "mouseup", o),
  9710. a = e.clientY
  9711. }),
  9712. H.bind(this.__input, "keydown", function(e) {
  9713. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9714. this.blur(),
  9715. s.__truncationSuspended = !1)
  9716. }),
  9717. this.updateDisplay(),
  9718. this.domElement.appendChild(this.__input)
  9719. }
  9720. ).superclass = U,
  9721. z.extend(G.prototype, U.prototype, {
  9722. updateDisplay: function() {
  9723. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9724. var i = Math.pow(10, t);
  9725. return Math.round(e * i) / i
  9726. }(this.getValue(), this.__precision),
  9727. G.superclass.prototype.updateDisplay.call(this)
  9728. }
  9729. }),
  9730. G),
  9731. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9732. F = ee.dom.dom,
  9733. B = ee.utils.css,
  9734. V = ee.utils.common,
  9735. (k = function(e, t, i, n, r) {
  9736. function o(e) {
  9737. e.preventDefault();
  9738. var t = F.getOffset(s.__background)
  9739. , i = F.getWidth(s.__background);
  9740. return s.setValue(function(e, t, i, n, r) {
  9741. return n + (e - t) / (i - t) * (r - n)
  9742. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9743. !1
  9744. }
  9745. function a() {
  9746. F.unbind(window, "mousemove", o),
  9747. F.unbind(window, "mouseup", a),
  9748. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9749. }
  9750. k.superclass.call(this, e, t, {
  9751. min: i,
  9752. max: n,
  9753. step: r
  9754. });
  9755. var s = this;
  9756. this.__background = document.createElement("div"),
  9757. this.__foreground = document.createElement("div"),
  9758. F.bind(this.__background, "mousedown", function(e) {
  9759. F.bind(window, "mousemove", o),
  9760. F.bind(window, "mouseup", a),
  9761. o(e)
  9762. }),
  9763. F.addClass(this.__background, "slider"),
  9764. F.addClass(this.__foreground, "slider-fg"),
  9765. this.updateDisplay(),
  9766. this.__background.appendChild(this.__foreground),
  9767. this.domElement.appendChild(this.__background)
  9768. }
  9769. ).superclass = N,
  9770. k.useDefaultStyles = function() {
  9771. 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}")
  9772. }
  9773. ,
  9774. V.extend(k.prototype, N.prototype, {
  9775. updateDisplay: function() {
  9776. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9777. return this.__foreground.style.width = 100 * e + "%",
  9778. k.superclass.prototype.updateDisplay.call(this)
  9779. }
  9780. }),
  9781. k),
  9782. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9783. O = ee.dom.dom,
  9784. L = ee.utils.common,
  9785. (D = function(e, t, i) {
  9786. D.superclass.call(this, e, t);
  9787. var n = this;
  9788. this.__button = document.createElement("div"),
  9789. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9790. O.bind(this.__button, "click", function(e) {
  9791. return e.preventDefault(),
  9792. n.fire(),
  9793. !1
  9794. }),
  9795. O.addClass(this.__button, "button"),
  9796. this.domElement.appendChild(this.__button)
  9797. }
  9798. ).superclass = P,
  9799. L.extend(D.prototype, P.prototype, {
  9800. fire: function() {
  9801. this.__onChange && this.__onChange.call(this),
  9802. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9803. this.getValue().call(this.object)
  9804. }
  9805. }),
  9806. D),
  9807. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9808. S = ee.dom.dom,
  9809. M = ee.utils.common,
  9810. (R = function(e, t) {
  9811. R.superclass.call(this, e, t);
  9812. var i = this;
  9813. this.__prev = this.getValue(),
  9814. this.__checkbox = document.createElement("input"),
  9815. this.__checkbox.setAttribute("type", "checkbox"),
  9816. S.bind(this.__checkbox, "change", function() {
  9817. i.setValue(!i.__prev)
  9818. }, !1),
  9819. this.domElement.appendChild(this.__checkbox),
  9820. this.updateDisplay()
  9821. }
  9822. ).superclass = x,
  9823. M.extend(R.prototype, x.prototype, {
  9824. setValue: function(e) {
  9825. var t = R.superclass.prototype.setValue.call(this, e);
  9826. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9827. this.__prev = this.getValue(),
  9828. t
  9829. },
  9830. updateDisplay: function() {
  9831. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9832. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9833. R.superclass.prototype.updateDisplay.call(this)
  9834. }
  9835. }),
  9836. R),
  9837. ee.color.toString = (T = ee.utils.common,
  9838. function(e) {
  9839. if (1 == e.a || T.isUndefined(e.a)) {
  9840. for (var t = e.hex.toString(16); t.length < 6; )
  9841. t = "0" + t;
  9842. return "#" + t
  9843. }
  9844. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  9845. }
  9846. ),
  9847. ee.color.interpret = (I = ee.color.toString,
  9848. E = ee.utils.common,
  9849. w = [{
  9850. litmus: E.isString,
  9851. conversions: {
  9852. THREE_CHAR_HEX: {
  9853. read: function(e) {
  9854. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  9855. return null !== t && {
  9856. space: "HEX",
  9857. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  9858. }
  9859. },
  9860. write: I
  9861. },
  9862. SIX_CHAR_HEX: {
  9863. read: function(e) {
  9864. var t = e.match(/^#([A-F0-9]{6})$/i);
  9865. return null !== t && {
  9866. space: "HEX",
  9867. hex: parseInt("0x" + t[1].toString())
  9868. }
  9869. },
  9870. write: I
  9871. },
  9872. CSS_RGB: {
  9873. read: function(e) {
  9874. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  9875. return null !== t && {
  9876. space: "RGB",
  9877. r: parseFloat(t[1]),
  9878. g: parseFloat(t[2]),
  9879. b: parseFloat(t[3])
  9880. }
  9881. },
  9882. write: I
  9883. },
  9884. CSS_RGBA: {
  9885. read: function(e) {
  9886. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  9887. return null !== t && {
  9888. space: "RGB",
  9889. r: parseFloat(t[1]),
  9890. g: parseFloat(t[2]),
  9891. b: parseFloat(t[3]),
  9892. a: parseFloat(t[4])
  9893. }
  9894. },
  9895. write: I
  9896. }
  9897. }
  9898. }, {
  9899. litmus: E.isNumber,
  9900. conversions: {
  9901. HEX: {
  9902. read: function(e) {
  9903. return {
  9904. space: "HEX",
  9905. hex: e,
  9906. conversionName: "HEX"
  9907. }
  9908. },
  9909. write: function(e) {
  9910. return e.hex
  9911. }
  9912. }
  9913. }
  9914. }, {
  9915. litmus: E.isArray,
  9916. conversions: {
  9917. RGB_ARRAY: {
  9918. read: function(e) {
  9919. return 3 == e.length && {
  9920. space: "RGB",
  9921. r: e[0],
  9922. g: e[1],
  9923. b: e[2]
  9924. }
  9925. },
  9926. write: function(e) {
  9927. return [e.r, e.g, e.b]
  9928. }
  9929. },
  9930. RGBA_ARRAY: {
  9931. read: function(e) {
  9932. return 4 == e.length && {
  9933. space: "RGB",
  9934. r: e[0],
  9935. g: e[1],
  9936. b: e[2],
  9937. a: e[3]
  9938. }
  9939. },
  9940. write: function(e) {
  9941. return [e.r, e.g, e.b, e.a]
  9942. }
  9943. }
  9944. }
  9945. }, {
  9946. litmus: E.isObject,
  9947. conversions: {
  9948. RGBA_OBJ: {
  9949. read: function(e) {
  9950. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  9951. space: "RGB",
  9952. r: e.r,
  9953. g: e.g,
  9954. b: e.b,
  9955. a: e.a
  9956. }
  9957. },
  9958. write: function(e) {
  9959. return {
  9960. r: e.r,
  9961. g: e.g,
  9962. b: e.b,
  9963. a: e.a
  9964. }
  9965. }
  9966. },
  9967. RGB_OBJ: {
  9968. read: function(e) {
  9969. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  9970. space: "RGB",
  9971. r: e.r,
  9972. g: e.g,
  9973. b: e.b
  9974. }
  9975. },
  9976. write: function(e) {
  9977. return {
  9978. r: e.r,
  9979. g: e.g,
  9980. b: e.b
  9981. }
  9982. }
  9983. },
  9984. HSVA_OBJ: {
  9985. read: function(e) {
  9986. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  9987. space: "HSV",
  9988. h: e.h,
  9989. s: e.s,
  9990. v: e.v,
  9991. a: e.a
  9992. }
  9993. },
  9994. write: function(e) {
  9995. return {
  9996. h: e.h,
  9997. s: e.s,
  9998. v: e.v,
  9999. a: e.a
  10000. }
  10001. }
  10002. },
  10003. HSV_OBJ: {
  10004. read: function(e) {
  10005. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10006. space: "HSV",
  10007. h: e.h,
  10008. s: e.s,
  10009. v: e.v
  10010. }
  10011. },
  10012. write: function(e) {
  10013. return {
  10014. h: e.h,
  10015. s: e.s,
  10016. v: e.v
  10017. }
  10018. }
  10019. }
  10020. }
  10021. }],
  10022. function() {
  10023. b = !1;
  10024. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10025. return E.each(w, function(e) {
  10026. if (e.litmus(i))
  10027. return E.each(e.conversions, function(e, t) {
  10028. if (_ = e.read(i),
  10029. !1 === b && !1 !== _)
  10030. return (b = _).conversionName = t,
  10031. _.conversion = e,
  10032. E.BREAK
  10033. }),
  10034. E.BREAK
  10035. }),
  10036. b
  10037. }
  10038. ),
  10039. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10040. function y(e, t, i, n) {
  10041. if (void 0 === t[i])
  10042. throw new Error("Object " + t + ' has no property "' + i + '"');
  10043. var r;
  10044. if (n.color)
  10045. r = new g(t,i);
  10046. else {
  10047. var o = [t, i].concat(n.factoryArgs);
  10048. r = c.apply(e, o)
  10049. }
  10050. n.before instanceof h && (n.before = n.before.__li),
  10051. C(e, r),
  10052. m.addClass(r.domElement, "c");
  10053. var a = document.createElement("span");
  10054. m.addClass(a, "property-name"),
  10055. a.innerHTML = r.property;
  10056. var s = document.createElement("div");
  10057. s.appendChild(a),
  10058. s.appendChild(r.domElement);
  10059. var l = A(e, s, n.before);
  10060. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10061. m.addClass(l, typeof r.getValue()),
  10062. function(t, i, n) {
  10063. if (n.__li = i,
  10064. n.__gui = t,
  10065. v.extend(n, {
  10066. options: function(e) {
  10067. return 1 < arguments.length ? (n.remove(),
  10068. y(t, n.object, n.property, {
  10069. before: n.__li.nextElementSibling,
  10070. factoryArgs: [v.toArray(arguments)]
  10071. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10072. y(t, n.object, n.property, {
  10073. before: n.__li.nextElementSibling,
  10074. factoryArgs: [e]
  10075. })) : void 0
  10076. },
  10077. name: function(e) {
  10078. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10079. n
  10080. },
  10081. listen: function() {
  10082. return n.__gui.listen(n),
  10083. n
  10084. },
  10085. remove: function() {
  10086. return n.__gui.remove(n),
  10087. n
  10088. }
  10089. }),
  10090. n instanceof f) {
  10091. var r = new p(n.object,n.property,{
  10092. min: n.__min,
  10093. max: n.__max,
  10094. step: n.__step
  10095. });
  10096. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10097. var t = n[e]
  10098. , i = r[e];
  10099. n[e] = r[e] = function() {
  10100. var e = Array.prototype.slice.call(arguments);
  10101. return t.apply(n, e),
  10102. i.apply(r, e)
  10103. }
  10104. }),
  10105. m.addClass(i, "has-slider"),
  10106. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10107. } else if (n instanceof p) {
  10108. var e = function(e) {
  10109. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10110. y(t, n.object, n.property, {
  10111. before: n.__li.nextElementSibling,
  10112. factoryArgs: [n.__min, n.__max, n.__step]
  10113. })) : e
  10114. };
  10115. n.min = v.compose(e, n.min),
  10116. n.max = v.compose(e, n.max)
  10117. } else
  10118. n instanceof u ? (m.bind(i, "click", function() {
  10119. m.fakeEvent(n.__checkbox, "click")
  10120. }),
  10121. m.bind(n.__checkbox, "click", function(e) {
  10122. e.stopPropagation()
  10123. })) : n instanceof d ? (m.bind(i, "click", function() {
  10124. m.fakeEvent(n.__button, "click")
  10125. }),
  10126. m.bind(i, "mouseover", function() {
  10127. m.addClass(n.__button, "hover")
  10128. }),
  10129. m.bind(i, "mouseout", function() {
  10130. m.removeClass(n.__button, "hover")
  10131. })) : n instanceof g && (m.addClass(i, "color"),
  10132. n.updateDisplay = v.compose(function(e) {
  10133. return i.style.borderLeftColor = n.__color.toString(),
  10134. e
  10135. }, n.updateDisplay),
  10136. n.updateDisplay());
  10137. n.setValue = v.compose(function(e) {
  10138. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10139. e
  10140. }, n.setValue)
  10141. }(e, l, r),
  10142. e.__controllers.push(r),
  10143. r
  10144. }
  10145. function A(e, t, i) {
  10146. var n = document.createElement("li");
  10147. return t && n.appendChild(t),
  10148. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10149. e.onResize(),
  10150. n
  10151. }
  10152. function C(e, t) {
  10153. var i = e.getRoot()
  10154. , n = i.__rememberedObjects.indexOf(t.object);
  10155. if (-1 != n) {
  10156. var r = i.__rememberedObjectIndecesToControllers[n];
  10157. if (void 0 === r && (r = {},
  10158. i.__rememberedObjectIndecesToControllers[n] = r),
  10159. r[t.property] = t,
  10160. i.load && i.load.remembered) {
  10161. var o, a = i.load.remembered;
  10162. if (a[e.preset])
  10163. o = a[e.preset];
  10164. else {
  10165. if (!a[T])
  10166. return;
  10167. o = a[T]
  10168. }
  10169. if (o[n] && void 0 !== o[n][t.property]) {
  10170. var s = o[n][t.property];
  10171. t.initialValue = s,
  10172. t.setValue(s)
  10173. }
  10174. }
  10175. }
  10176. }
  10177. function I(e, t) {
  10178. return document.location.href + "." + t
  10179. }
  10180. function l(e, t) {
  10181. e.domElement.style.width = t + "px",
  10182. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10183. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10184. }
  10185. function a(r, o) {
  10186. var a = {};
  10187. return v.each(r.__rememberedObjects, function(e, t) {
  10188. var i = {}
  10189. , n = r.__rememberedObjectIndecesToControllers[t];
  10190. v.each(n, function(e, t) {
  10191. i[t] = o ? e.initialValue : e.getValue()
  10192. }),
  10193. a[t] = i
  10194. }),
  10195. a
  10196. }
  10197. function E(e, t, i) {
  10198. var n = document.createElement("option");
  10199. n.innerHTML = t,
  10200. n.value = t,
  10201. e.__preset_select.appendChild(n),
  10202. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10203. }
  10204. function _(e, t) {
  10205. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10206. i.innerHTML = t ? i.value + "*" : i.value
  10207. }
  10208. 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");
  10209. var b, w, T = "Default", x = function() {
  10210. try {
  10211. return "localStorage"in window && null !== window.localStorage
  10212. } catch (e) {
  10213. return !1
  10214. }
  10215. }(), S = !0, s = !1, M = [], R = function(t) {
  10216. var i = this;
  10217. this.domElement = document.createElement("div"),
  10218. this.__ul = document.createElement("ul"),
  10219. this.domElement.appendChild(this.__ul),
  10220. m.addClass(this.domElement, "dg"),
  10221. this.__folders = {},
  10222. this.__controllers = [],
  10223. this.__rememberedObjects = [],
  10224. this.__rememberedObjectIndecesToControllers = [],
  10225. this.__listening = [],
  10226. t = t || {},
  10227. t = v.defaults(t, {
  10228. autoPlace: !0,
  10229. width: R.DEFAULT_WIDTH
  10230. }),
  10231. t = v.defaults(t, {
  10232. resizable: t.autoPlace,
  10233. hideable: t.autoPlace
  10234. }),
  10235. v.isUndefined(t.load) ? t.load = {
  10236. preset: T
  10237. } : t.preset && (t.load.preset = t.preset),
  10238. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10239. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10240. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10241. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10242. if (Object.defineProperties(this, {
  10243. parent: {
  10244. get: function() {
  10245. return t.parent
  10246. }
  10247. },
  10248. scrollable: {
  10249. get: function() {
  10250. return t.scrollable
  10251. }
  10252. },
  10253. autoPlace: {
  10254. get: function() {
  10255. return t.autoPlace
  10256. }
  10257. },
  10258. preset: {
  10259. get: function() {
  10260. return i.parent ? i.getRoot().preset : t.load.preset
  10261. },
  10262. set: function(e) {
  10263. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10264. function(e) {
  10265. for (var t = 0; t < e.__preset_select.length; t++)
  10266. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10267. }(this),
  10268. i.revert()
  10269. }
  10270. },
  10271. width: {
  10272. get: function() {
  10273. return t.width
  10274. },
  10275. set: function(e) {
  10276. t.width = e,
  10277. l(i, e)
  10278. }
  10279. },
  10280. name: {
  10281. get: function() {
  10282. return t.name
  10283. },
  10284. set: function(e) {
  10285. t.name = e,
  10286. a && (a.innerHTML = t.name)
  10287. }
  10288. },
  10289. closed: {
  10290. get: function() {
  10291. return t.closed
  10292. },
  10293. set: function(e) {
  10294. t.closed = e,
  10295. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10296. this.onResize(),
  10297. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10298. }
  10299. },
  10300. load: {
  10301. get: function() {
  10302. return t.load
  10303. }
  10304. },
  10305. useLocalStorage: {
  10306. get: function() {
  10307. return r
  10308. },
  10309. set: function(e) {
  10310. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10311. localStorage.setItem(I(0, "isLocal"), e))
  10312. }
  10313. }
  10314. }),
  10315. v.isUndefined(t.parent)) {
  10316. if (t.closed = !1,
  10317. m.addClass(this.domElement, R.CLASS_MAIN),
  10318. m.makeSelectable(this.domElement, !1),
  10319. x && r) {
  10320. i.useLocalStorage = !0;
  10321. var o = localStorage.getItem(I(0, "gui"));
  10322. o && (t.load = JSON.parse(o))
  10323. }
  10324. this.__closeButton = document.createElement("div"),
  10325. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10326. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10327. this.domElement.appendChild(this.__closeButton),
  10328. m.bind(this.__closeButton, "click", function() {
  10329. i.closed = !i.closed
  10330. })
  10331. } else {
  10332. void 0 === t.closed && (t.closed = !0);
  10333. var a = document.createTextNode(t.name);
  10334. m.addClass(a, "controller-name");
  10335. var s = A(i, a);
  10336. m.addClass(this.__ul, R.CLASS_CLOSED),
  10337. m.addClass(s, "title"),
  10338. m.bind(s, "click", function(e) {
  10339. return e.preventDefault(),
  10340. i.closed = !i.closed,
  10341. !1
  10342. }),
  10343. t.closed || (this.closed = !1)
  10344. }
  10345. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10346. m.addClass(w, "dg"),
  10347. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10348. document.body.appendChild(w),
  10349. S = !1),
  10350. w.appendChild(this.domElement),
  10351. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10352. this.parent || l(i, t.width)),
  10353. m.bind(window, "resize", function() {
  10354. i.onResize()
  10355. }),
  10356. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10357. i.onResize()
  10358. }),
  10359. m.bind(this.__ul, "transitionend", function() {
  10360. i.onResize()
  10361. }),
  10362. m.bind(this.__ul, "oTransitionEnd", function() {
  10363. i.onResize()
  10364. }),
  10365. this.onResize(),
  10366. t.resizable && function(t) {
  10367. function e(e) {
  10368. return e.preventDefault(),
  10369. r = e.clientX,
  10370. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10371. m.bind(window, "mousemove", i),
  10372. m.bind(window, "mouseup", n),
  10373. !1
  10374. }
  10375. function i(e) {
  10376. return e.preventDefault(),
  10377. t.width += r - e.clientX,
  10378. t.onResize(),
  10379. r = e.clientX,
  10380. !1
  10381. }
  10382. function n() {
  10383. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10384. m.unbind(window, "mousemove", i),
  10385. m.unbind(window, "mouseup", n)
  10386. }
  10387. var r;
  10388. t.__resize_handle = document.createElement("div"),
  10389. v.extend(t.__resize_handle.style, {
  10390. width: "6px",
  10391. marginLeft: "-3px",
  10392. height: "200px",
  10393. cursor: "ew-resize",
  10394. position: "absolute"
  10395. }),
  10396. m.bind(t.__resize_handle, "mousedown", e),
  10397. m.bind(t.__closeButton, "mousedown", e),
  10398. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10399. }(this),
  10400. n = function() {
  10401. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10402. }
  10403. ,
  10404. this.saveToLocalStorageIfPossible = n,
  10405. i.getRoot(),
  10406. t.parent || ((e = i.getRoot()).width += 1,
  10407. v.defer(function() {
  10408. e.width -= 1
  10409. }))
  10410. };
  10411. return R.toggleHide = function() {
  10412. s = !s,
  10413. v.each(M, function(e) {
  10414. e.domElement.style.zIndex = s ? -999 : 999,
  10415. e.domElement.style.opacity = s ? 0 : 1
  10416. })
  10417. }
  10418. ,
  10419. R.CLASS_AUTO_PLACE = "a",
  10420. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10421. R.CLASS_MAIN = "main",
  10422. R.CLASS_CONTROLLER_ROW = "cr",
  10423. R.CLASS_TOO_TALL = "taller-than-window",
  10424. R.CLASS_CLOSED = "closed",
  10425. R.CLASS_CLOSE_BUTTON = "close-button",
  10426. R.CLASS_DRAG = "drag",
  10427. R.DEFAULT_WIDTH = 245,
  10428. R.TEXT_CLOSED = "Close Controls",
  10429. R.TEXT_OPEN = "Open Controls",
  10430. m.bind(window, "keydown", function(e) {
  10431. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10432. }, !1),
  10433. v.extend(R.prototype, {
  10434. add: function(e, t) {
  10435. return y(this, e, t, {
  10436. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10437. })
  10438. },
  10439. addColor: function(e, t) {
  10440. return y(this, e, t, {
  10441. color: !0
  10442. })
  10443. },
  10444. remove: function(e) {
  10445. this.__ul.removeChild(e.__li),
  10446. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10447. var t = this;
  10448. v.defer(function() {
  10449. t.onResize()
  10450. })
  10451. },
  10452. destroy: function() {
  10453. this.autoPlace && w.removeChild(this.domElement)
  10454. },
  10455. addFolder: function(e) {
  10456. if (void 0 !== this.__folders[e])
  10457. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10458. var t = {
  10459. name: e,
  10460. parent: this
  10461. };
  10462. t.autoPlace = this.autoPlace,
  10463. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10464. t.load = this.load.folders[e]);
  10465. var i = new R(t);
  10466. this.__folders[e] = i;
  10467. var n = A(this, i.domElement);
  10468. return m.addClass(n, "folder"),
  10469. i
  10470. },
  10471. open: function() {
  10472. this.closed = !1
  10473. },
  10474. close: function() {
  10475. this.closed = !0
  10476. },
  10477. onResize: function() {
  10478. var t = this.getRoot();
  10479. if (t.scrollable) {
  10480. var e = m.getOffset(t.__ul).top
  10481. , i = 0;
  10482. v.each(t.__ul.childNodes, function(e) {
  10483. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10484. }),
  10485. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10486. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10487. t.__ul.style.height = "auto")
  10488. }
  10489. t.__resize_handle && v.defer(function() {
  10490. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10491. }),
  10492. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10493. },
  10494. remember: function() {
  10495. 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>'),
  10496. this.parent)
  10497. throw new Error("You can only call remember on a top level GUI.");
  10498. var t = this;
  10499. v.each(Array.prototype.slice.call(arguments), function(e) {
  10500. 0 == t.__rememberedObjects.length && function(i) {
  10501. var e = i.__save_row = document.createElement("li");
  10502. m.addClass(i.domElement, "has-save"),
  10503. i.__ul.insertBefore(e, i.__ul.firstChild),
  10504. m.addClass(e, "save-row");
  10505. var t = document.createElement("span");
  10506. t.innerHTML = "&nbsp;",
  10507. m.addClass(t, "button gears");
  10508. var n = document.createElement("span");
  10509. n.innerHTML = "Save",
  10510. m.addClass(n, "button"),
  10511. m.addClass(n, "save");
  10512. var r = document.createElement("span");
  10513. r.innerHTML = "New",
  10514. m.addClass(r, "button"),
  10515. m.addClass(r, "save-as");
  10516. var o = document.createElement("span");
  10517. o.innerHTML = "Revert",
  10518. m.addClass(o, "button"),
  10519. m.addClass(o, "revert");
  10520. var a = i.__preset_select = document.createElement("select");
  10521. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10522. E(i, t, t == i.preset)
  10523. }) : E(i, T, !1),
  10524. m.bind(a, "change", function() {
  10525. for (var e = 0; e < i.__preset_select.length; e++)
  10526. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10527. i.preset = this.value
  10528. }),
  10529. e.appendChild(a),
  10530. e.appendChild(t),
  10531. e.appendChild(n),
  10532. e.appendChild(r),
  10533. e.appendChild(o),
  10534. x) {
  10535. var s = document.getElementById("dg-save-locally")
  10536. , l = document.getElementById("dg-local-explain");
  10537. s.style.display = "block";
  10538. var c = document.getElementById("dg-local-storage");
  10539. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10540. var h = function() {
  10541. l.style.display = i.useLocalStorage ? "block" : "none"
  10542. };
  10543. h(),
  10544. m.bind(c, "change", function() {
  10545. i.useLocalStorage = !i.useLocalStorage,
  10546. h()
  10547. })
  10548. }
  10549. var u = document.getElementById("dg-new-constructor");
  10550. m.bind(u, "keydown", function(e) {
  10551. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10552. }),
  10553. m.bind(t, "click", function() {
  10554. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10555. b.show(),
  10556. u.focus(),
  10557. u.select()
  10558. }),
  10559. m.bind(n, "click", function() {
  10560. i.save()
  10561. }),
  10562. m.bind(r, "click", function() {
  10563. var e = prompt("Enter a new preset name.");
  10564. e && i.saveAs(e)
  10565. }),
  10566. m.bind(o, "click", function() {
  10567. i.revert()
  10568. })
  10569. }(t),
  10570. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10571. }),
  10572. this.autoPlace && l(this, this.width)
  10573. },
  10574. getRoot: function() {
  10575. for (var e = this; e.parent; )
  10576. e = e.parent;
  10577. return e
  10578. },
  10579. getSaveObject: function() {
  10580. var i = this.load;
  10581. return i.closed = this.closed,
  10582. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10583. i.remembered || (i.remembered = {}),
  10584. i.remembered[this.preset] = a(this)),
  10585. i.folders = {},
  10586. v.each(this.__folders, function(e, t) {
  10587. i.folders[t] = e.getSaveObject()
  10588. }),
  10589. i
  10590. },
  10591. save: function() {
  10592. this.load.remembered || (this.load.remembered = {}),
  10593. this.load.remembered[this.preset] = a(this),
  10594. _(this, !1),
  10595. this.saveToLocalStorageIfPossible()
  10596. },
  10597. saveAs: function(e) {
  10598. this.load.remembered || (this.load.remembered = {},
  10599. this.load.remembered[T] = a(this, !0)),
  10600. this.load.remembered[e] = a(this),
  10601. this.preset = e,
  10602. E(this, e, !0),
  10603. this.saveToLocalStorageIfPossible()
  10604. },
  10605. revert: function(t) {
  10606. v.each(this.__controllers, function(e) {
  10607. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10608. }, this),
  10609. v.each(this.__folders, function(e) {
  10610. e.revert(e)
  10611. }),
  10612. t || _(this.getRoot(), !1)
  10613. },
  10614. listen: function(e) {
  10615. var t = 0 == this.__listening.length;
  10616. this.__listening.push(e),
  10617. t && function e(t) {
  10618. 0 != t.length && r(function() {
  10619. e(t)
  10620. }),
  10621. v.each(t, function(e) {
  10622. e.updateDisplay()
  10623. })
  10624. }(this.__listening)
  10625. }
  10626. }),
  10627. R
  10628. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10629. u = ee.controllers.NumberControllerBox,
  10630. d = ee.controllers.NumberControllerSlider,
  10631. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10632. y = ee.dom.dom,
  10633. A = ee.utils.common,
  10634. (C = function(e, t) {
  10635. function i() {
  10636. n.setValue(n.__input.value)
  10637. }
  10638. C.superclass.call(this, e, t);
  10639. var n = this;
  10640. this.__input = document.createElement("input"),
  10641. this.__input.setAttribute("type", "text"),
  10642. y.bind(this.__input, "keyup", i),
  10643. y.bind(this.__input, "change", i),
  10644. y.bind(this.__input, "blur", function() {
  10645. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10646. }),
  10647. y.bind(this.__input, "keydown", function(e) {
  10648. 13 === e.keyCode && this.blur()
  10649. }),
  10650. this.updateDisplay(),
  10651. this.domElement.appendChild(this.__input)
  10652. }
  10653. ).superclass = v,
  10654. A.extend(C.prototype, v.prototype, {
  10655. updateDisplay: function() {
  10656. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10657. C.superclass.prototype.updateDisplay.call(this)
  10658. }
  10659. }),
  10660. C),
  10661. f = ee.controllers.FunctionController,
  10662. g = ee.controllers.BooleanController,
  10663. m = ee.utils.common,
  10664. function(e, t) {
  10665. var i = e[t];
  10666. 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,{
  10667. min: arguments[2],
  10668. max: arguments[3]
  10669. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10670. }
  10671. ), 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) {
  10672. function f(t, i, n, r) {
  10673. t.style.background = "",
  10674. p.each(o, function(e) {
  10675. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10676. })
  10677. }
  10678. var g = function(e, t) {
  10679. function i(e) {
  10680. a(e),
  10681. h.bind(window, "mousemove", a),
  10682. h.bind(window, "mouseup", n)
  10683. }
  10684. function n() {
  10685. h.unbind(window, "mousemove", a),
  10686. h.unbind(window, "mouseup", n)
  10687. }
  10688. function r() {
  10689. var e = d(this.value);
  10690. !1 !== e ? (l.__color.__state = e,
  10691. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10692. }
  10693. function o() {
  10694. h.unbind(window, "mousemove", s),
  10695. h.unbind(window, "mouseup", o)
  10696. }
  10697. function a(e) {
  10698. e.preventDefault();
  10699. var t = h.getWidth(l.__saturation_field)
  10700. , i = h.getOffset(l.__saturation_field)
  10701. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10702. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10703. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10704. 1 < n ? n = 1 : n < 0 && (n = 0),
  10705. l.__color.v = r,
  10706. l.__color.s = n,
  10707. l.setValue(l.__color.toOriginal()),
  10708. !1
  10709. }
  10710. function s(e) {
  10711. e.preventDefault();
  10712. var t = h.getHeight(l.__hue_field)
  10713. , i = h.getOffset(l.__hue_field)
  10714. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10715. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10716. l.__color.h = 360 * n,
  10717. l.setValue(l.__color.toOriginal()),
  10718. !1
  10719. }
  10720. g.superclass.call(this, e, t),
  10721. this.__color = new u(this.getValue()),
  10722. this.__temp = new u(0);
  10723. var l = this;
  10724. this.domElement = document.createElement("div"),
  10725. h.makeSelectable(this.domElement, !1),
  10726. this.__selector = document.createElement("div"),
  10727. this.__selector.className = "selector",
  10728. this.__saturation_field = document.createElement("div"),
  10729. this.__saturation_field.className = "saturation-field",
  10730. this.__field_knob = document.createElement("div"),
  10731. this.__field_knob.className = "field-knob",
  10732. this.__field_knob_border = "2px solid ",
  10733. this.__hue_knob = document.createElement("div"),
  10734. this.__hue_knob.className = "hue-knob",
  10735. this.__hue_field = document.createElement("div"),
  10736. this.__hue_field.className = "hue-field",
  10737. this.__input = document.createElement("input"),
  10738. this.__input.type = "text",
  10739. this.__input_textShadow = "0 1px 1px ",
  10740. h.bind(this.__input, "keydown", function(e) {
  10741. 13 === e.keyCode && r.call(this)
  10742. }),
  10743. h.bind(this.__input, "blur", r),
  10744. h.bind(this.__selector, "mousedown", function(e) {
  10745. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10746. h.removeClass(l.__selector, "drag")
  10747. })
  10748. });
  10749. var c = document.createElement("div");
  10750. p.extend(this.__selector.style, {
  10751. width: "122px",
  10752. height: "102px",
  10753. padding: "3px",
  10754. backgroundColor: "#222",
  10755. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10756. }),
  10757. p.extend(this.__field_knob.style, {
  10758. position: "absolute",
  10759. width: "12px",
  10760. height: "12px",
  10761. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10762. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10763. borderRadius: "12px",
  10764. zIndex: 1
  10765. }),
  10766. p.extend(this.__hue_knob.style, {
  10767. position: "absolute",
  10768. width: "15px",
  10769. height: "2px",
  10770. borderRight: "4px solid #fff",
  10771. zIndex: 1
  10772. }),
  10773. p.extend(this.__saturation_field.style, {
  10774. width: "100px",
  10775. height: "100px",
  10776. border: "1px solid #555",
  10777. marginRight: "3px",
  10778. display: "inline-block",
  10779. cursor: "pointer"
  10780. }),
  10781. p.extend(c.style, {
  10782. width: "100%",
  10783. height: "100%",
  10784. background: "none"
  10785. }),
  10786. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10787. p.extend(this.__hue_field.style, {
  10788. width: "15px",
  10789. height: "100px",
  10790. display: "inline-block",
  10791. border: "1px solid #555",
  10792. cursor: "ns-resize"
  10793. }),
  10794. function(e) {
  10795. e.style.background = "",
  10796. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10797. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10798. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10799. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10800. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10801. }(this.__hue_field),
  10802. p.extend(this.__input.style, {
  10803. outline: "none",
  10804. textAlign: "center",
  10805. color: "#fff",
  10806. border: 0,
  10807. fontWeight: "bold",
  10808. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10809. }),
  10810. h.bind(this.__saturation_field, "mousedown", i),
  10811. h.bind(this.__field_knob, "mousedown", i),
  10812. h.bind(this.__hue_field, "mousedown", function(e) {
  10813. s(e),
  10814. h.bind(window, "mousemove", s),
  10815. h.bind(window, "mouseup", o)
  10816. }),
  10817. this.__saturation_field.appendChild(c),
  10818. this.__selector.appendChild(this.__field_knob),
  10819. this.__selector.appendChild(this.__saturation_field),
  10820. this.__selector.appendChild(this.__hue_field),
  10821. this.__hue_field.appendChild(this.__hue_knob),
  10822. this.domElement.appendChild(this.__input),
  10823. this.domElement.appendChild(this.__selector),
  10824. this.updateDisplay()
  10825. };
  10826. g.superclass = e,
  10827. p.extend(g.prototype, e.prototype, {
  10828. updateDisplay: function() {
  10829. var t = d(this.getValue());
  10830. if (!1 !== t) {
  10831. var i = !1;
  10832. p.each(u.COMPONENTS, function(e) {
  10833. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10834. return i = !0,
  10835. {}
  10836. }, this),
  10837. i && p.extend(this.__color.__state, t)
  10838. }
  10839. p.extend(this.__temp.__state, this.__color.__state),
  10840. this.__temp.a = 1;
  10841. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  10842. , n = 255 - e;
  10843. p.extend(this.__field_knob.style, {
  10844. marginLeft: 100 * this.__color.s - 7 + "px",
  10845. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10846. backgroundColor: this.__temp.toString(),
  10847. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  10848. }),
  10849. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10850. this.__temp.s = 1,
  10851. this.__temp.v = 1,
  10852. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10853. p.extend(this.__input.style, {
  10854. backgroundColor: this.__input.value = this.__color.toString(),
  10855. color: "rgb(" + e + "," + e + "," + e + ")",
  10856. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  10857. })
  10858. }
  10859. });
  10860. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  10861. return g
  10862. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  10863. a = ee.color.math = {
  10864. hsv_to_rgb: function(e, t, i) {
  10865. var n = Math.floor(e / 60) % 6
  10866. , r = e / 60 - Math.floor(e / 60)
  10867. , o = i * (1 - t)
  10868. , a = i * (1 - r * t)
  10869. , s = i * (1 - (1 - r) * t)
  10870. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  10871. return {
  10872. r: 255 * l[0],
  10873. g: 255 * l[1],
  10874. b: 255 * l[2]
  10875. }
  10876. },
  10877. rgb_to_hsv: function(e, t, i) {
  10878. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  10879. return 0 == o ? {
  10880. h: NaN,
  10881. s: 0,
  10882. v: 0
  10883. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  10884. (n /= 6) < 0 && (n += 1),
  10885. {
  10886. h: 360 * n,
  10887. s: a / o,
  10888. v: o / 255
  10889. })
  10890. },
  10891. rgb_to_hex: function(e, t, i) {
  10892. var n = this.hex_with_component(0, 2, e);
  10893. return n = this.hex_with_component(n, 1, t),
  10894. this.hex_with_component(n, 0, i)
  10895. },
  10896. component_from_hex: function(e, t) {
  10897. return e >> 8 * t & 255
  10898. },
  10899. hex_with_component: function(e, t, i) {
  10900. return i << (c = 8 * t) | e & ~(255 << c)
  10901. }
  10902. },
  10903. s = ee.color.toString,
  10904. l = ee.utils.common,
  10905. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  10906. l.extend(ae.prototype, {
  10907. toString: function() {
  10908. return s(this)
  10909. },
  10910. toOriginal: function() {
  10911. return this.__state.conversion.write(this)
  10912. }
  10913. }),
  10914. ie(ae.prototype, "r", 2),
  10915. ie(ae.prototype, "g", 1),
  10916. ie(ae.prototype, "b", 0),
  10917. ne(ae.prototype, "h"),
  10918. ne(ae.prototype, "s"),
  10919. ne(ae.prototype, "v"),
  10920. Object.defineProperty(ae.prototype, "a", {
  10921. get: function() {
  10922. return this.__state.a
  10923. },
  10924. set: function(e) {
  10925. this.__state.a = e
  10926. }
  10927. }),
  10928. Object.defineProperty(ae.prototype, "hex", {
  10929. get: function() {
  10930. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  10931. this.__state.hex
  10932. },
  10933. set: function(e) {
  10934. this.__state.space = "HEX",
  10935. this.__state.hex = e
  10936. }
  10937. }),
  10938. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  10939. window.setTimeout(e, 1e3 / 60)
  10940. }
  10941. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  10942. r = ee.utils.common,
  10943. te.prototype.show = function() {
  10944. var e = this;
  10945. this.backgroundElement.style.display = "block",
  10946. this.domElement.style.display = "block",
  10947. this.domElement.style.opacity = 0,
  10948. this.domElement.style.webkitTransform = "scale(1.1)",
  10949. this.layout(),
  10950. r.defer(function() {
  10951. e.backgroundElement.style.opacity = 1,
  10952. e.domElement.style.opacity = 1,
  10953. e.domElement.style.webkitTransform = "scale(1)"
  10954. })
  10955. }
  10956. ,
  10957. te.prototype.hide = function() {
  10958. var e = this
  10959. , t = function() {
  10960. e.domElement.style.display = "none",
  10961. e.backgroundElement.style.display = "none",
  10962. n.unbind(e.domElement, "webkitTransitionEnd", t),
  10963. n.unbind(e.domElement, "transitionend", t),
  10964. n.unbind(e.domElement, "oTransitionEnd", t)
  10965. };
  10966. n.bind(this.domElement, "webkitTransitionEnd", t),
  10967. n.bind(this.domElement, "transitionend", t),
  10968. n.bind(this.domElement, "oTransitionEnd", t),
  10969. this.backgroundElement.style.opacity = 0,
  10970. this.domElement.style.opacity = 0,
  10971. this.domElement.style.webkitTransform = "scale(1.1)"
  10972. }
  10973. ,
  10974. te.prototype.layout = function() {
  10975. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  10976. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  10977. }
  10978. ,
  10979. te), ee.dom.dom, ee.utils.common)
  10980. }
  10981. , {}],
  10982. 94: [function(e, t, i) {
  10983. (function(J) {
  10984. "use strict";
  10985. function i(e) {
  10986. function t(e, t) {
  10987. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  10988. for (var a = 1; a <= e[o]; a++)
  10989. r[t[n]] = [],
  10990. r[t[n]][0] = i,
  10991. r[t[n]][1] = o,
  10992. n++,
  10993. i++;
  10994. i *= 2
  10995. }
  10996. return r
  10997. }
  10998. function _(e) {
  10999. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11000. t & 1 << i && (B |= 1 << V),
  11001. i--,
  11002. --V < 0 && (255 == B ? (b(255),
  11003. b(0)) : b(B),
  11004. V = 7,
  11005. B = 0)
  11006. }
  11007. function b(e) {
  11008. F.push(e)
  11009. }
  11010. function w(e) {
  11011. b(e >> 8 & 255),
  11012. b(255 & e)
  11013. }
  11014. function T(e, t, i, n, r) {
  11015. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11016. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11017. for (h = 0; h < 8; ++h) {
  11018. i = e[d],
  11019. n = e[d + 1],
  11020. r = e[d + 2],
  11021. o = e[d + 3],
  11022. a = e[d + 4],
  11023. s = e[d + 5],
  11024. l = e[d + 6];
  11025. var p = i + (c = e[d + 7])
  11026. , f = i - c
  11027. , g = n + l
  11028. , m = n - l
  11029. , v = r + s
  11030. , y = r - s
  11031. , A = o + a
  11032. , C = o - a
  11033. , I = p + A
  11034. , E = p - A
  11035. , _ = g + v
  11036. , b = g - v;
  11037. e[d] = I + _,
  11038. e[d + 4] = I - _;
  11039. var w = .707106781 * (b + E);
  11040. e[d + 2] = E + w,
  11041. e[d + 6] = E - w;
  11042. var T = .382683433 * ((I = C + y) - (b = m + f))
  11043. , x = .5411961 * I + T
  11044. , S = 1.306562965 * b + T
  11045. , M = .707106781 * (_ = y + m)
  11046. , R = f + M
  11047. , P = f - M;
  11048. e[d + 5] = P + x,
  11049. e[d + 3] = P - x,
  11050. e[d + 1] = R + S,
  11051. e[d + 7] = R - S,
  11052. d += 8
  11053. }
  11054. for (h = d = 0; h < 8; ++h) {
  11055. i = e[d],
  11056. n = e[d + 8],
  11057. r = e[d + 16],
  11058. o = e[d + 24],
  11059. a = e[d + 32],
  11060. s = e[d + 40],
  11061. l = e[d + 48];
  11062. var O = i + (c = e[d + 56])
  11063. , L = i - c
  11064. , D = n + l
  11065. , N = n - l
  11066. , F = r + s
  11067. , B = r - s
  11068. , V = o + a
  11069. , k = o - a
  11070. , U = O + V
  11071. , H = O - V
  11072. , z = D + F
  11073. , G = D - F;
  11074. e[d] = U + z,
  11075. e[d + 32] = U - z;
  11076. var W = .707106781 * (G + H);
  11077. e[d + 16] = H + W,
  11078. e[d + 48] = H - W;
  11079. var j = .382683433 * ((U = k + B) - (G = N + L))
  11080. , Y = .5411961 * U + j
  11081. , q = 1.306562965 * G + j
  11082. , X = .707106781 * (z = B + N)
  11083. , Z = L + X
  11084. , K = L - X;
  11085. e[d + 40] = K + Y,
  11086. e[d + 24] = K - Y,
  11087. e[d + 8] = Z + q,
  11088. e[d + 56] = Z - q,
  11089. d++
  11090. }
  11091. for (h = 0; h < 64; ++h)
  11092. u = e[h] * t[h],
  11093. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11094. return Q
  11095. }(e, t), c = 0; c < 64; ++c)
  11096. A[C[c]] = l[c];
  11097. var h = A[0] - i;
  11098. i = A[0],
  11099. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11100. _(v[o]));
  11101. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11102. ;
  11103. if (0 == u)
  11104. return _(a),
  11105. i;
  11106. for (var d, p = 1; p <= u; ) {
  11107. for (var f = p; 0 == A[p] && p <= u; ++p)
  11108. ;
  11109. var g = p - f;
  11110. if (16 <= g) {
  11111. d = g >> 4;
  11112. for (var m = 1; m <= d; ++m)
  11113. _(s);
  11114. g &= 15
  11115. }
  11116. o = 32767 + A[p],
  11117. _(r[(g << 4) + y[o]]),
  11118. _(v[o]),
  11119. p++
  11120. }
  11121. return 63 != u && _(a),
  11122. i
  11123. }
  11124. function x(e) {
  11125. if (e <= 0 && (e = 1),
  11126. 100 < e && (e = 100),
  11127. i != e) {
  11128. (function(e) {
  11129. 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++) {
  11130. var n = u((t[i] * e + 50) / 100);
  11131. n < 1 ? n = 1 : 255 < n && (n = 255),
  11132. O[C[i]] = n
  11133. }
  11134. 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++) {
  11135. var a = u((r[o] * e + 50) / 100);
  11136. a < 1 ? a = 1 : 255 < a && (a = 255),
  11137. L[C[o]] = a
  11138. }
  11139. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11140. for (var h = 0; h < 8; h++)
  11141. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11142. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11143. l++
  11144. }
  11145. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11146. i = e
  11147. }
  11148. }
  11149. var S, M, R, P, i, u = (Math.round,
  11150. 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];
  11151. this.encode = function(e, t) {
  11152. var i = ((new Date).getTime(),
  11153. t.quality);
  11154. i && x(i),
  11155. F = new Array,
  11156. B = 0,
  11157. V = 7,
  11158. w(65496),
  11159. w(65504),
  11160. w(16),
  11161. b(74),
  11162. b(70),
  11163. b(73),
  11164. b(70),
  11165. b(0),
  11166. b(1),
  11167. b(1),
  11168. b(0),
  11169. w(1),
  11170. w(1),
  11171. b(0),
  11172. b(0),
  11173. function() {
  11174. w(65499),
  11175. w(132),
  11176. b(0);
  11177. for (var e = 0; e < 64; e++)
  11178. b(O[e]);
  11179. b(1);
  11180. for (var t = 0; t < 64; t++)
  11181. b(L[t])
  11182. }(),
  11183. function(e, t) {
  11184. w(65472),
  11185. w(17),
  11186. b(8),
  11187. w(t),
  11188. w(e),
  11189. b(3),
  11190. b(1),
  11191. b(17),
  11192. b(0),
  11193. b(2),
  11194. b(17),
  11195. b(1),
  11196. b(3),
  11197. b(17),
  11198. b(1)
  11199. }(e.width, e.height),
  11200. function() {
  11201. w(65476),
  11202. w(418),
  11203. b(0);
  11204. for (var e = 0; e < 16; e++)
  11205. b(G[e + 1]);
  11206. for (var t = 0; t <= 11; t++)
  11207. b(W[t]);
  11208. b(16);
  11209. for (var i = 0; i < 16; i++)
  11210. b(j[i + 1]);
  11211. for (var n = 0; n <= 161; n++)
  11212. b(Y[n]);
  11213. b(1);
  11214. for (var r = 0; r < 16; r++)
  11215. b(q[r + 1]);
  11216. for (var o = 0; o <= 11; o++)
  11217. b(X[o]);
  11218. b(17);
  11219. for (var a = 0; a < 16; a++)
  11220. b(Z[a + 1]);
  11221. for (var s = 0; s <= 161; s++)
  11222. b(K[s])
  11223. }(),
  11224. w(65498),
  11225. w(12),
  11226. b(3),
  11227. b(1),
  11228. b(0),
  11229. b(2),
  11230. b(17),
  11231. b(3),
  11232. b(17),
  11233. b(0),
  11234. b(63),
  11235. b(0);
  11236. var n = 0
  11237. , r = 0
  11238. , o = 0;
  11239. B = 0,
  11240. V = 7,
  11241. this.encode.displayName = "_encode_";
  11242. 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; ) {
  11243. for (a = 0; a < A; ) {
  11244. for (u = h = A * C + a,
  11245. d = -1,
  11246. f = p = 0; f < 64; f++)
  11247. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11248. v <= C + p && (u -= A * (C + 1 + p - v)),
  11249. A <= a + d && (u -= a + d - A + 4),
  11250. s = g[u++],
  11251. l = g[u++],
  11252. c = g[u++],
  11253. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11254. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11255. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11256. n = T(k, D, n, S, R),
  11257. r = T(U, N, r, M, P),
  11258. o = T(H, N, o, M, P),
  11259. a += 32
  11260. }
  11261. C += I
  11262. }
  11263. if (0 <= V) {
  11264. var E = [];
  11265. E[1] = V + 1,
  11266. E[0] = (1 << V + 1) - 1,
  11267. _(E)
  11268. }
  11269. return w(65497),
  11270. new J(F)
  11271. }
  11272. ,
  11273. (new Date).getTime(),
  11274. e = e || 50,
  11275. function() {
  11276. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11277. n[t] = e(t)
  11278. }(),
  11279. S = t(G, W),
  11280. M = t(q, X),
  11281. R = t(j, Y),
  11282. P = t(Z, K),
  11283. function() {
  11284. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11285. for (var n = e; n < t; n++)
  11286. y[32767 + n] = i,
  11287. v[32767 + n] = [],
  11288. v[32767 + n][1] = i,
  11289. v[32767 + n][0] = n;
  11290. for (var r = -(t - 1); r <= -e; r++)
  11291. y[32767 + r] = i,
  11292. v[32767 + r] = [],
  11293. v[32767 + r][1] = i,
  11294. v[32767 + r][0] = t - 1 + r;
  11295. e <<= 1,
  11296. t <<= 1
  11297. }
  11298. }(),
  11299. function() {
  11300. for (var e = 0; e < 256; e++)
  11301. z[e] = 19595 * e,
  11302. z[e + 256 >> 0] = 38470 * e,
  11303. z[e + 512 >> 0] = 7471 * e + 32768,
  11304. z[e + 768 >> 0] = -11059 * e,
  11305. z[e + 1024 >> 0] = -21709 * e,
  11306. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11307. z[e + 1536 >> 0] = -27439 * e,
  11308. z[e + 1792 >> 0] = -5329 * e
  11309. }(),
  11310. x(e),
  11311. (new Date).getTime()
  11312. }
  11313. t.exports.encode = function(e, t) {
  11314. return (t = t || {}).quality = t.quality || 50,
  11315. {
  11316. data: new i(t.quality).encode(e, t),
  11317. width: e.width,
  11318. height: e.height
  11319. }
  11320. }
  11321. }
  11322. ).call(this, e("buffer").Buffer)
  11323. }
  11324. , {
  11325. buffer: 198
  11326. }],
  11327. 95: [function(e, t, i) {
  11328. "use strict";
  11329. !function() {
  11330. if ("performance"in window == 0 && (window.performance = {}),
  11331. Date.now = Date.now || function() {
  11332. return (new Date).getTime()
  11333. }
  11334. ,
  11335. "now"in window.performance == 0) {
  11336. var e = Date.now();
  11337. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11338. window.performance.now = function() {
  11339. return Date.now() - e
  11340. }
  11341. }
  11342. }()
  11343. }
  11344. , {}],
  11345. 96: [function(e, t, i) {
  11346. "use strict";
  11347. var a = e("three");
  11348. a.EffectComposer = function(e, t) {
  11349. if (this.renderer = e,
  11350. void 0 === t) {
  11351. var i = {
  11352. minFilter: a.LinearFilter,
  11353. magFilter: a.LinearFilter,
  11354. format: a.RGBAFormat,
  11355. stencilBuffer: !1
  11356. }
  11357. , n = e.getSize();
  11358. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11359. }
  11360. this.renderTarget1 = t,
  11361. this.renderTarget2 = t.clone(),
  11362. this.writeBuffer = this.renderTarget1,
  11363. this.readBuffer = this.renderTarget2,
  11364. this.passes = [],
  11365. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11366. this.copyPass = new a.ShaderPass(a.CopyShader)
  11367. }
  11368. ,
  11369. a.EffectComposer.prototype = {
  11370. swapBuffers: function() {
  11371. var e = this.readBuffer;
  11372. this.readBuffer = this.writeBuffer,
  11373. this.writeBuffer = e
  11374. },
  11375. addPass: function(e) {
  11376. this.passes.push(e)
  11377. },
  11378. insertPass: function(e, t) {
  11379. this.passes.splice(t, 0, e)
  11380. },
  11381. render: function(e) {
  11382. this.writeBuffer = this.renderTarget1,
  11383. this.readBuffer = this.renderTarget2;
  11384. var t, i, n = !1, r = this.passes.length;
  11385. for (i = 0; i < r; i++)
  11386. if ((t = this.passes[i]).enabled) {
  11387. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11388. t.needsSwap) {
  11389. if (n) {
  11390. var o = this.renderer.context;
  11391. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11392. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11393. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11394. }
  11395. this.swapBuffers()
  11396. }
  11397. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11398. }
  11399. },
  11400. reset: function(e) {
  11401. if (void 0 === e) {
  11402. var t = this.renderer.getSize();
  11403. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11404. }
  11405. this.renderTarget1.dispose(),
  11406. this.renderTarget2.dispose(),
  11407. this.renderTarget1 = e,
  11408. this.renderTarget2 = e.clone(),
  11409. this.writeBuffer = this.renderTarget1,
  11410. this.readBuffer = this.renderTarget2
  11411. },
  11412. setSize: function(e, t) {
  11413. this.renderTarget1.setSize(e, t),
  11414. this.renderTarget2.setSize(e, t)
  11415. }
  11416. }
  11417. }
  11418. , {
  11419. three: 217
  11420. }],
  11421. 97: [function(e, t, i) {
  11422. "use strict";
  11423. var n = e("three");
  11424. n.MaskPass = function(e, t) {
  11425. this.scene = e,
  11426. this.camera = t,
  11427. this.enabled = !0,
  11428. this.clear = !0,
  11429. this.needsSwap = !1,
  11430. this.inverse = !1
  11431. }
  11432. ,
  11433. n.MaskPass.prototype = {
  11434. render: function(e, t, i, n) {
  11435. var r, o, a = e.context;
  11436. a.colorMask(!1, !1, !1, !1),
  11437. a.depthMask(!1),
  11438. o = this.inverse ? (r = 0,
  11439. 1) : (r = 1,
  11440. 0),
  11441. a.enable(a.STENCIL_TEST),
  11442. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11443. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11444. a.clearStencil(o),
  11445. e.render(this.scene, this.camera, i, this.clear),
  11446. e.render(this.scene, this.camera, t, this.clear),
  11447. a.colorMask(!0, !0, !0, !0),
  11448. a.depthMask(!0),
  11449. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11450. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11451. }
  11452. },
  11453. n.ClearMaskPass = function() {
  11454. this.enabled = !0
  11455. }
  11456. ,
  11457. n.ClearMaskPass.prototype = {
  11458. render: function(e, t, i, n) {
  11459. var r = e.context;
  11460. r.disable(r.STENCIL_TEST)
  11461. }
  11462. }
  11463. }
  11464. , {
  11465. three: 217
  11466. }],
  11467. 98: [function(e, t, i) {
  11468. "use strict";
  11469. var o = e("three");
  11470. o.RenderPass = function(e, t, i, n, r) {
  11471. this.scene = e,
  11472. this.camera = t,
  11473. this.overrideMaterial = i,
  11474. this.clearColor = n,
  11475. this.clearAlpha = void 0 !== r ? r : 1,
  11476. this.oldClearColor = new o.Color,
  11477. this.oldClearAlpha = 1,
  11478. this.enabled = !0,
  11479. this.clear = !0,
  11480. this.needsSwap = !1
  11481. }
  11482. ,
  11483. o.RenderPass.prototype = {
  11484. render: function(e, t, i, n) {
  11485. this.scene.overrideMaterial = this.overrideMaterial,
  11486. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11487. this.oldClearAlpha = e.getClearAlpha(),
  11488. e.setClearColor(this.clearColor, this.clearAlpha)),
  11489. e.render(this.scene, this.camera, i, this.clear),
  11490. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11491. this.scene.overrideMaterial = null
  11492. }
  11493. }
  11494. }
  11495. , {
  11496. three: 217
  11497. }],
  11498. 99: [function(e, t, i) {
  11499. "use strict";
  11500. var n = e("three");
  11501. n.ShaderPass = function(e, t) {
  11502. this.textureID = void 0 !== t ? t : "tDiffuse",
  11503. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11504. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11505. this.material = new n.ShaderMaterial({
  11506. defines: e.defines || {},
  11507. uniforms: this.uniforms,
  11508. vertexShader: e.vertexShader,
  11509. fragmentShader: e.fragmentShader
  11510. })),
  11511. this.renderToScreen = !1,
  11512. this.enabled = !0,
  11513. this.needsSwap = !0,
  11514. this.clear = !1,
  11515. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11516. this.scene = new n.Scene,
  11517. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11518. this.scene.add(this.quad)
  11519. }
  11520. ,
  11521. n.ShaderPass.prototype = {
  11522. render: function(e, t, i, n) {
  11523. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11524. this.quad.material = this.material,
  11525. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11526. }
  11527. }
  11528. }
  11529. , {
  11530. three: 217
  11531. }],
  11532. 100: [function(e, t, i) {
  11533. "use strict";
  11534. e("three").CopyShader = {
  11535. uniforms: {
  11536. tDiffuse: {
  11537. type: "t",
  11538. value: null
  11539. },
  11540. opacity: {
  11541. type: "f",
  11542. value: 1
  11543. }
  11544. },
  11545. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11546. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11547. }
  11548. }
  11549. , {
  11550. three: 217
  11551. }],
  11552. 101: [function(e, t, i) {
  11553. "use strict";
  11554. e("three").HorizontalBlurShader = {
  11555. uniforms: {
  11556. tDiffuse: {
  11557. type: "t",
  11558. value: null
  11559. },
  11560. h: {
  11561. type: "f",
  11562. value: 1 / 512
  11563. }
  11564. },
  11565. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11566. 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")
  11567. }
  11568. }
  11569. , {
  11570. three: 217
  11571. }],
  11572. 102: [function(e, t, i) {
  11573. "use strict";
  11574. e("three").VerticalBlurShader = {
  11575. uniforms: {
  11576. tDiffuse: {
  11577. type: "t",
  11578. value: null
  11579. },
  11580. v: {
  11581. type: "f",
  11582. value: 1 / 512
  11583. }
  11584. },
  11585. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11586. 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")
  11587. }
  11588. }
  11589. , {
  11590. three: 217
  11591. }],
  11592. 103: [function(e, t, i) {
  11593. "use strict";
  11594. var z = e("three");
  11595. !function() {
  11596. if ("performance"in window == 0 && (window.performance = {}),
  11597. "now"in window.performance == 0) {
  11598. var e = Date.now();
  11599. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11600. window.performance.now = function() {
  11601. return Date.now() - e
  11602. }
  11603. }
  11604. }(),
  11605. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11606. var t, i = this.extensions, n = this.context;
  11607. if (e === z.RepeatWrapping)
  11608. return n.REPEAT;
  11609. if (e === z.ClampToEdgeWrapping)
  11610. return n.CLAMP_TO_EDGE;
  11611. if (e === z.MirroredRepeatWrapping)
  11612. return n.MIRRORED_REPEAT;
  11613. if (e === z.NearestFilter)
  11614. return n.NEAREST;
  11615. if (e === z.NearestMipMapNearestFilter)
  11616. return n.NEAREST_MIPMAP_NEAREST;
  11617. if (e === z.NearestMipMapLinearFilter)
  11618. return n.NEAREST_MIPMAP_LINEAR;
  11619. if (e === z.LinearFilter)
  11620. return n.LINEAR;
  11621. if (e === z.LinearMipMapNearestFilter)
  11622. return n.LINEAR_MIPMAP_NEAREST;
  11623. if (e === z.LinearMipMapLinearFilter)
  11624. return n.LINEAR_MIPMAP_LINEAR;
  11625. if (e === z.UnsignedByteType)
  11626. return n.UNSIGNED_BYTE;
  11627. if (e === z.UnsignedShort4444Type)
  11628. return n.UNSIGNED_SHORT_4_4_4_4;
  11629. if (e === z.UnsignedShort5551Type)
  11630. return n.UNSIGNED_SHORT_5_5_5_1;
  11631. if (e === z.UnsignedShort565Type)
  11632. return n.UNSIGNED_SHORT_5_6_5;
  11633. if (e === z.ByteType)
  11634. return n.BYTE;
  11635. if (e === z.ShortType)
  11636. return n.SHORT;
  11637. if (e === z.UnsignedShortType)
  11638. return n.UNSIGNED_SHORT;
  11639. if (e === z.IntType)
  11640. return n.INT;
  11641. if (e === z.UnsignedIntType)
  11642. return n.UNSIGNED_INT;
  11643. if (e === z.FloatType)
  11644. return n.FLOAT;
  11645. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11646. return t.HALF_FLOAT_OES;
  11647. if (e === z.AlphaFormat)
  11648. return n.ALPHA;
  11649. if (e === z.RGBFormat)
  11650. return n.RGB;
  11651. if (e === z.RGBAFormat)
  11652. return n.RGBA;
  11653. if (e === z.LuminanceFormat)
  11654. return n.LUMINANCE;
  11655. if (e === z.LuminanceAlphaFormat)
  11656. return n.LUMINANCE_ALPHA;
  11657. if (e === z.AddEquation)
  11658. return n.FUNC_ADD;
  11659. if (e === z.SubtractEquation)
  11660. return n.FUNC_SUBTRACT;
  11661. if (e === z.ReverseSubtractEquation)
  11662. return n.FUNC_REVERSE_SUBTRACT;
  11663. if (e === z.ZeroFactor)
  11664. return n.ZERO;
  11665. if (e === z.OneFactor)
  11666. return n.ONE;
  11667. if (e === z.SrcColorFactor)
  11668. return n.SRC_COLOR;
  11669. if (e === z.OneMinusSrcColorFactor)
  11670. return n.ONE_MINUS_SRC_COLOR;
  11671. if (e === z.SrcAlphaFactor)
  11672. return n.SRC_ALPHA;
  11673. if (e === z.OneMinusSrcAlphaFactor)
  11674. return n.ONE_MINUS_SRC_ALPHA;
  11675. if (e === z.DstAlphaFactor)
  11676. return n.DST_ALPHA;
  11677. if (e === z.OneMinusDstAlphaFactor)
  11678. return n.ONE_MINUS_DST_ALPHA;
  11679. if (e === z.DstColorFactor)
  11680. return n.DST_COLOR;
  11681. if (e === z.OneMinusDstColorFactor)
  11682. return n.ONE_MINUS_DST_COLOR;
  11683. if (e === z.SrcAlphaSaturateFactor)
  11684. return n.SRC_ALPHA_SATURATE;
  11685. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11686. if (e === z.RGB_S3TC_DXT1_Format)
  11687. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11688. if (e === z.RGBA_S3TC_DXT1_Format)
  11689. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11690. if (e === z.RGBA_S3TC_DXT3_Format)
  11691. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11692. if (e === z.RGBA_S3TC_DXT5_Format)
  11693. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11694. }
  11695. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11696. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11697. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11698. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11699. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11700. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11701. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11702. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11703. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11704. }
  11705. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11706. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11707. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11708. if (e === z.MinEquation)
  11709. return t.MIN_EXT;
  11710. if (e === z.MaxEquation)
  11711. return t.MAX_EXT
  11712. }
  11713. return 0
  11714. }
  11715. ,
  11716. z.WebGLState = function(l, i, c) {
  11717. var n = this
  11718. , r = new z.Vector4
  11719. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11720. , o = new Uint8Array(e)
  11721. , a = new Uint8Array(e)
  11722. , s = new Uint8Array(e)
  11723. , t = {}
  11724. , h = null
  11725. , u = null
  11726. , d = null
  11727. , p = null
  11728. , f = null
  11729. , g = null
  11730. , m = null
  11731. , v = null
  11732. , y = !1
  11733. , A = null
  11734. , C = null
  11735. , I = null
  11736. , E = null
  11737. , _ = null
  11738. , b = null
  11739. , w = null
  11740. , T = null
  11741. , x = null
  11742. , S = null
  11743. , M = null
  11744. , R = null
  11745. , P = null
  11746. , O = null
  11747. , L = null
  11748. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11749. , N = void 0
  11750. , F = {}
  11751. , B = new z.Vector4
  11752. , V = null
  11753. , k = null
  11754. , U = new z.Vector4
  11755. , H = new z.Vector4;
  11756. this.init = function() {
  11757. this.clearColor(0, 0, 0, 1),
  11758. this.clearDepth(1),
  11759. this.clearStencil(0),
  11760. this.enable(l.DEPTH_TEST),
  11761. l.depthFunc(l.LEQUAL),
  11762. l.frontFace(l.CCW),
  11763. l.cullFace(l.BACK),
  11764. this.enable(l.CULL_FACE),
  11765. this.enable(l.BLEND),
  11766. l.blendEquation(l.FUNC_ADD),
  11767. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11768. }
  11769. ,
  11770. this.initAttributes = function() {
  11771. for (var e = 0, t = o.length; e < t; e++)
  11772. o[e] = 0
  11773. }
  11774. ,
  11775. this.enableAttribute = function(e) {
  11776. o[e] = 1,
  11777. 0 === a[e] && (l.enableVertexAttribArray(e),
  11778. a[e] = 1),
  11779. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11780. s[e] = 0)
  11781. }
  11782. ,
  11783. this.enableAttributeAndDivisor = function(e, t, i) {
  11784. o[e] = 1,
  11785. 0 === a[e] && (l.enableVertexAttribArray(e),
  11786. a[e] = 1),
  11787. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11788. s[e] = t)
  11789. }
  11790. ,
  11791. this.disableUnusedAttributes = function() {
  11792. for (var e = 0, t = a.length; e < t; e++)
  11793. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11794. a[e] = 0)
  11795. }
  11796. ,
  11797. this.enable = function(e) {
  11798. !0 !== t[e] && (l.enable(e),
  11799. t[e] = !0)
  11800. }
  11801. ,
  11802. this.disable = function(e) {
  11803. !1 !== t[e] && (l.disable(e),
  11804. t[e] = !1)
  11805. }
  11806. ,
  11807. this.getCompressedTextureFormats = function() {
  11808. if (null === h && (h = [],
  11809. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11810. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11811. h.push(e[t]);
  11812. return h
  11813. }
  11814. ,
  11815. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11816. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11817. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11818. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11819. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11820. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11821. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11822. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11823. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11824. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11825. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11826. u = e,
  11827. y = s),
  11828. e === z.CustomBlending ? (r = r || t,
  11829. o = o || i,
  11830. a = a || n,
  11831. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11832. d = t,
  11833. g = r),
  11834. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11835. p = i,
  11836. f = n,
  11837. m = o,
  11838. v = a)) : v = m = g = f = p = d = null
  11839. }
  11840. ,
  11841. this.setDepthFunc = function(e) {
  11842. if (A !== e) {
  11843. if (e)
  11844. switch (e) {
  11845. case z.NeverDepth:
  11846. l.depthFunc(l.NEVER);
  11847. break;
  11848. case z.AlwaysDepth:
  11849. l.depthFunc(l.ALWAYS);
  11850. break;
  11851. case z.LessDepth:
  11852. l.depthFunc(l.LESS);
  11853. break;
  11854. case z.LessEqualDepth:
  11855. l.depthFunc(l.LEQUAL);
  11856. break;
  11857. case z.EqualDepth:
  11858. l.depthFunc(l.EQUAL);
  11859. break;
  11860. case z.GreaterEqualDepth:
  11861. l.depthFunc(l.GEQUAL);
  11862. break;
  11863. case z.GreaterDepth:
  11864. l.depthFunc(l.GREATER);
  11865. break;
  11866. case z.NotEqualDepth:
  11867. l.depthFunc(l.NOTEQUAL);
  11868. break;
  11869. default:
  11870. l.depthFunc(l.LEQUAL)
  11871. }
  11872. else
  11873. l.depthFunc(l.LEQUAL);
  11874. A = e
  11875. }
  11876. }
  11877. ,
  11878. this.setDepthTest = function(e) {
  11879. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  11880. }
  11881. ,
  11882. this.setDepthWrite = function(e) {
  11883. C !== e && (l.depthMask(e),
  11884. C = e)
  11885. }
  11886. ,
  11887. this.setColorWrite = function(e) {
  11888. I !== e && (l.colorMask(e, e, e, e),
  11889. I = e)
  11890. }
  11891. ,
  11892. this.setStencilFunc = function(e, t, i) {
  11893. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  11894. _ = e,
  11895. b = t,
  11896. w = i)
  11897. }
  11898. ,
  11899. this.setStencilOp = function(e, t, i) {
  11900. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  11901. T = e,
  11902. x = t,
  11903. S = i)
  11904. }
  11905. ,
  11906. this.setStencilTest = function(e) {
  11907. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  11908. }
  11909. ,
  11910. this.setStencilWrite = function(e) {
  11911. E !== e && (l.stencilMask(e),
  11912. E = e)
  11913. }
  11914. ,
  11915. this.setFlipSided = function(e) {
  11916. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  11917. M = e)
  11918. }
  11919. ,
  11920. this.setLineWidth = function(e) {
  11921. e !== R && (l.lineWidth(e),
  11922. R = e)
  11923. }
  11924. ,
  11925. this.setPolygonOffset = function(e, t, i) {
  11926. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  11927. !e || P === t && O === i || (l.polygonOffset(t, i),
  11928. P = t,
  11929. O = i)
  11930. }
  11931. ,
  11932. this.getScissorTest = function() {
  11933. return L
  11934. }
  11935. ,
  11936. this.setScissorTest = function(e) {
  11937. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  11938. }
  11939. ,
  11940. this.activeTexture = function(e) {
  11941. void 0 === e && (e = l.TEXTURE0 + D - 1),
  11942. N !== e && (l.activeTexture(e),
  11943. N = e)
  11944. }
  11945. ,
  11946. this.bindTexture = function(e, t) {
  11947. void 0 === N && n.activeTexture();
  11948. var i = F[N];
  11949. void 0 === i && (i = {
  11950. type: void 0,
  11951. texture: void 0
  11952. },
  11953. F[N] = i),
  11954. i.type === e && i.texture === t || (l.bindTexture(e, t),
  11955. i.type = e,
  11956. i.texture = t)
  11957. }
  11958. ,
  11959. this.compressedTexImage2D = function() {
  11960. try {
  11961. l.compressedTexImage2D.apply(l, arguments)
  11962. } catch (e) {
  11963. console.error(e)
  11964. }
  11965. }
  11966. ,
  11967. this.texImage2D = function() {
  11968. try {
  11969. l.texImage2D.apply(l, arguments)
  11970. } catch (e) {
  11971. console.error(e)
  11972. }
  11973. }
  11974. ,
  11975. this.clearColor = function(e, t, i, n) {
  11976. r.set(e, t, i, n),
  11977. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  11978. B.copy(r))
  11979. }
  11980. ,
  11981. this.clearDepth = function(e) {
  11982. V !== e && (l.clearDepth(e),
  11983. V = e)
  11984. }
  11985. ,
  11986. this.clearStencil = function(e) {
  11987. k !== e && (l.clearStencil(e),
  11988. k = e)
  11989. }
  11990. ,
  11991. this.scissor = function(e) {
  11992. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  11993. U.copy(e))
  11994. }
  11995. ,
  11996. this.viewport = function(e) {
  11997. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  11998. H.copy(e))
  11999. }
  12000. ,
  12001. this.reset = function() {
  12002. for (var e = 0; e < a.length; e++)
  12003. 1 === a[e] && (l.disableVertexAttribArray(e),
  12004. a[e] = 0);
  12005. t = {},
  12006. N = void 0,
  12007. F = {},
  12008. M = E = C = I = u = h = null
  12009. }
  12010. }
  12011. }
  12012. , {
  12013. three: 217
  12014. }],
  12015. 104: [function(a, h, e) {
  12016. (function(i, e) {
  12017. "use strict";
  12018. function t(e) {
  12019. this.urls = e;
  12020. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12021. this.builder = n.loadProto(t),
  12022. this.decoder = this.builder.build("binary_mesh")
  12023. }
  12024. var s = a("three")
  12025. , n = a("protobufjs")
  12026. , r = a("../util/logger")
  12027. , o = (a("../util/common"),
  12028. a("../util/ajax"))
  12029. , l = a("../objects/Chunk")
  12030. , c = new r(e);
  12031. t.prototype = {
  12032. constructor: t,
  12033. load: function(t, i, n, r) {
  12034. return c.time("download"),
  12035. o.get(t, {
  12036. responseType: "arraybuffer"
  12037. }).done(function(e) {
  12038. c.timeEnd("download"),
  12039. this.parse(e, t, i, n, r)
  12040. }
  12041. .bind(this)).fail(r)
  12042. },
  12043. parse: function(e, t, i, n, r) {
  12044. var o = this.readProtobuf(e);
  12045. if (!o)
  12046. return r();
  12047. try {
  12048. c.time("convert to webgl"),
  12049. this.convertProtobufToSceneObject(o, t, i, n, r),
  12050. c.timeEnd("convert to webgl")
  12051. } catch (e) {
  12052. return c.error("failed parsing .dam"),
  12053. c.error(e.message),
  12054. r()
  12055. }
  12056. },
  12057. readProtobuf: function(e) {
  12058. var t;
  12059. try {
  12060. c.time("parse proto"),
  12061. t = this.decoder.decode(e),
  12062. c.timeEnd("parse proto")
  12063. } catch (e) {
  12064. return c.error("failed parsing proto for .dam"),
  12065. c.error(e.message),
  12066. null
  12067. }
  12068. return t
  12069. },
  12070. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12071. if (0 === e.chunk.length)
  12072. return c.warn("No chunks in damfile..."),
  12073. t([]);
  12074. var o = new s.Matrix4;
  12075. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12076. var a = e.chunk.map(function(e) {
  12077. var t = new s.BufferGeometry;
  12078. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12079. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12080. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12081. t.applyMatrix(o),
  12082. t.computeBoundingBox(),
  12083. new l({
  12084. geometry: t,
  12085. textureName: e.material_name,
  12086. name: e.chunk_name,
  12087. meshUrl: i
  12088. })
  12089. });
  12090. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12091. r())
  12092. }
  12093. },
  12094. h.exports = t
  12095. }
  12096. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12097. }
  12098. , {
  12099. "../objects/Chunk": 144,
  12100. "../util/ajax": 181,
  12101. "../util/common": 185,
  12102. "../util/logger": 189,
  12103. buffer: 198,
  12104. protobufjs: 214,
  12105. three: 217
  12106. }],
  12107. 105: [function(n, r, e) {
  12108. (function(e) {
  12109. "use strict";
  12110. var t = (n("three"),
  12111. n("../settings"),
  12112. n("../util/browser"),
  12113. n("./DamLoader"))
  12114. , i = n("../util/logger")
  12115. , u = (n("../ab"),
  12116. new i(e));
  12117. r.exports = {
  12118. getLoaders: function() {
  12119. return [["_50k", ".dam", t], ["", ".dam", t]]
  12120. },
  12121. load: function(e, t, i, n, r, o) {
  12122. var a = this.getLoaders()[o = o || 0];
  12123. if (a) {
  12124. var s = a[0]
  12125. , l = a[1]
  12126. , c = new a[2](t)
  12127. , h = t.get(e + s + l);
  12128. h ? (u.debug("Trying " + s + l),
  12129. c.load(h, i, n, function() {
  12130. this.load(e, t, i, n, r, ++o)
  12131. }
  12132. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12133. this.load(e, t, i, n, r, ++o))
  12134. } else
  12135. r && r("No suitable model file found...")
  12136. }
  12137. }
  12138. }
  12139. ).call(this, "/js/loaders/ModelLoader.js")
  12140. }
  12141. , {
  12142. "../ab": 3,
  12143. "../settings": 166,
  12144. "../util/browser": 182,
  12145. "../util/logger": 189,
  12146. "./DamLoader": 104,
  12147. three: 217
  12148. }],
  12149. 106: [function(i, n, e) {
  12150. (function(e) {
  12151. "use strict";
  12152. var l = i("../util/common")
  12153. , c = i("../util/texture")
  12154. , h = i("../util/browser")
  12155. , t = i("../util/logger")
  12156. , u = i("../settings")
  12157. , d = new t(e);
  12158. n.exports = {
  12159. load: function(i, n) {
  12160. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12161. return $.when();
  12162. var r = l.countUnique(i.chunks.map(function(e) {
  12163. return e.textureName
  12164. }))
  12165. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12166. , t = "_50k" == e ? "high" : "low";
  12167. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12168. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12169. t = "low"));
  12170. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12171. , a = $.Deferred()
  12172. , s = 0;
  12173. return i.chunks.forEach(function(e) {
  12174. if (!e.material.map && e.textureName) {
  12175. var t = i.urls.get(o + e.textureName);
  12176. e.setTextureMap(c.load(t, function(e, t) {
  12177. e || (n.push(t),
  12178. s++,
  12179. a.notify(s, r),
  12180. s === r && a.resolve())
  12181. }
  12182. .bind(this, c.isLoaded(t))))
  12183. }
  12184. }),
  12185. a.promise()
  12186. }
  12187. }
  12188. }
  12189. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12190. }
  12191. , {
  12192. "../settings": 166,
  12193. "../util/browser": 182,
  12194. "../util/common": 185,
  12195. "../util/logger": 189,
  12196. "../util/texture": 194
  12197. }],
  12198. 107: [function(s, l, e) {
  12199. (function(n, e) {
  12200. "use strict";
  12201. function t(e) {
  12202. this.model = e,
  12203. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12204. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12205. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12206. , i = r.loadProto(t);
  12207. this.decoder = i.build("VisionModeldata")
  12208. }
  12209. var r = s("protobufjs")
  12210. , i = s("../util/ajax")
  12211. , o = (s("../util/common"),
  12212. s("../util/math"))
  12213. , a = new (s("../util/logger"))(e);
  12214. t.prototype.load = function() {
  12215. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12216. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12217. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12218. $.when([]))
  12219. }
  12220. ,
  12221. t.prototype.loadVisionModelData = function() {
  12222. return i.get(this.modelDataPath, {
  12223. responseType: "arraybuffer"
  12224. }).then(function(e) {
  12225. var t;
  12226. try {
  12227. t = this.decoder.decode(e)
  12228. } catch (e) {
  12229. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12230. this.loadSweepLocationsCSV()
  12231. }
  12232. var i = t.sweepLocations.map(function(e) {
  12233. return {
  12234. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12235. position: {
  12236. x: e.pose.translation.x,
  12237. y: e.pose.translation.y,
  12238. z: e.pose.translation.z
  12239. },
  12240. quaternion: {
  12241. x: e.pose.rotation.x,
  12242. y: e.pose.rotation.y,
  12243. z: e.pose.rotation.z,
  12244. w: e.pose.rotation.w
  12245. },
  12246. puck: {
  12247. x: e.puck.x,
  12248. y: e.puck.y,
  12249. z: e.puck.z
  12250. },
  12251. floor: e.group,
  12252. neighbours: e.visibles,
  12253. alignmentType: e.alignment_type
  12254. }
  12255. }).map(function(e) {
  12256. return e.position = o.convertVisionVector(e.position),
  12257. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12258. e.puck = o.convertVisionVector(e.puck),
  12259. e
  12260. });
  12261. return i.forEach(function(e) {
  12262. e.neighbours = e.neighbours.map(function(e) {
  12263. return i[e].uuid
  12264. })
  12265. }),
  12266. i
  12267. }
  12268. .bind(this), function() {
  12269. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12270. this.loadSweepLocationsCSV()
  12271. }
  12272. .bind(this))
  12273. }
  12274. ,
  12275. t.prototype.loadSweepLocationsCSV = function() {
  12276. return i.get(this.sweepLocationsPath).then(function(e) {
  12277. return e.split("\n").map(function(e) {
  12278. return e.split(", ")
  12279. }).filter(function(e) {
  12280. return 1 < e.length
  12281. }).map(function(e) {
  12282. return {
  12283. uuid: e[0],
  12284. position: {
  12285. x: parseFloat(e[1]),
  12286. y: parseFloat(e[2]),
  12287. z: parseFloat(e[3])
  12288. },
  12289. quaternion: {
  12290. x: parseFloat(e[4]),
  12291. y: parseFloat(e[5]),
  12292. z: parseFloat(e[6]),
  12293. w: parseFloat(e[7])
  12294. }
  12295. }
  12296. }).map(function(e) {
  12297. return e.position = o.convertVisionVector(e.position),
  12298. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12299. e
  12300. })
  12301. }).fail(function() {
  12302. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12303. })
  12304. }
  12305. ,
  12306. l.exports = t
  12307. }
  12308. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12309. }
  12310. , {
  12311. "../util/ajax": 181,
  12312. "../util/common": 185,
  12313. "../util/logger": 189,
  12314. "../util/math": 190,
  12315. buffer: 198,
  12316. protobufjs: 214
  12317. }],
  12318. 108: [function(s, l, e) {
  12319. (function(e) {
  12320. "use strict";
  12321. function t() {
  12322. this.locale = null
  12323. }
  12324. var i = s("../settings")
  12325. , n = s("../util/common")
  12326. , r = s("../util/logger")
  12327. , o = s("../enum/Locale")
  12328. , a = new r(e);
  12329. t.prototype.init = function() {
  12330. var e;
  12331. switch (i.languageTag) {
  12332. case null:
  12333. case "en":
  12334. case o.EN_US:
  12335. this.locale = o.EN_US,
  12336. e = s("./strings-en-US");
  12337. break;
  12338. case "es":
  12339. case o.ES_MX:
  12340. this.locale = o.ES_MX,
  12341. e = s("./strings-es-MX");
  12342. break;
  12343. case "fr":
  12344. case o.FR_FR:
  12345. this.locale = o.FR_FR,
  12346. e = s("./strings-fr-FR");
  12347. break;
  12348. case "de":
  12349. case o.DE_DE:
  12350. this.locale = o.DE_DE,
  12351. e = s("./strings-de-DE");
  12352. break;
  12353. case "ru":
  12354. case o.RU_RU:
  12355. this.locale = o.RU_RU,
  12356. e = s("./strings-ru-RU");
  12357. break;
  12358. case "cn":
  12359. case o.CN_CN:
  12360. this.locale = o.CN_CN,
  12361. e = s("./strings-cn-CN");
  12362. break;
  12363. case "jp":
  12364. case o.JP_JP:
  12365. this.locale = o.JP_JP,
  12366. e = s("./strings-jp-JP");
  12367. break;
  12368. default:
  12369. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12370. this.locale = o.EN_US,
  12371. e = s("./strings-en-US")
  12372. }
  12373. a.info("Using locale '" + this.locale + "'"),
  12374. n.extendObject(this, e)
  12375. }
  12376. ,
  12377. t.prototype.localizeGUI = function() {
  12378. var e = document.querySelector("#gui-parent");
  12379. this.localizeTree(e),
  12380. this.localizeLoadingText()
  12381. }
  12382. ,
  12383. t.prototype.localizeLoadingText = function() {
  12384. document.querySelector("#help-dialog").classList.add(this.locale),
  12385. document.querySelector("#interaction-modal").classList.add(this.locale),
  12386. document.querySelector("#gui").classList.add(this.locale)
  12387. }
  12388. ,
  12389. t.prototype.localizeTree = function(e) {
  12390. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12391. if (e.nodeType === Node.TEXT_NODE)
  12392. (t = e.data.match(n)) && (i = t[1],
  12393. e.data = this.localizeText(i) || i);
  12394. else if (e.nodeType === Node.ELEMENT_NODE) {
  12395. var r = e.getAttribute("title");
  12396. r && ((t = r.match(n)) && (i = t[1],
  12397. e.setAttribute("title", this.localizeText(i) || i)))
  12398. }
  12399. for (e = e.firstChild; e; )
  12400. this.localizeTree(e),
  12401. e = e.nextSibling
  12402. }
  12403. ,
  12404. t.prototype.localizeText = function(e) {
  12405. var t = this[e];
  12406. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12407. t = s("./strings-en-US")[e]),
  12408. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12409. t
  12410. }
  12411. ,
  12412. l.exports = new t
  12413. }
  12414. ).call(this, "/js/localization/localize.js")
  12415. }
  12416. , {
  12417. "../enum/Locale": 31,
  12418. "../settings": 166,
  12419. "../util/common": 185,
  12420. "../util/logger": 189,
  12421. "./strings-cn-CN": 109,
  12422. "./strings-de-DE": 110,
  12423. "./strings-en-US": 111,
  12424. "./strings-es-MX": 112,
  12425. "./strings-fr-FR": 113,
  12426. "./strings-jp-JP": 114,
  12427. "./strings-ru-RU": 115
  12428. }],
  12429. 109: [function(e, t, i) {
  12430. "use strict";
  12431. t.exports = {
  12432. PAGE_TITLE: "",
  12433. LOADING: "正在加载",
  12434. PRESENTED_BY_CAPS: "呈现者:",
  12435. POWERED_BY: "技术支持:",
  12436. POWERED_BY_CAPS: "技术支持:",
  12437. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12438. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12439. PRESENTED_BY: "呈现者:",
  12440. MORE: "更多 ",
  12441. LESS: "更少 ",
  12442. TAG_CONTENT: "tag™ 内容",
  12443. SHOW: "显示",
  12444. HIDE: "隐藏",
  12445. DOLLHOUSE: "场景屋",
  12446. FLOOR_PLAN: "楼层平面图",
  12447. OPEN_HIGHLIGHTS: "打开精彩片段",
  12448. CLOSE_HIGHLIGHTS: "关闭",
  12449. PREVIOUS: "上一个",
  12450. PLAY: "播放",
  12451. PAUSE: "暂停",
  12452. NEXT: "下一个",
  12453. EXPLORE_3D_SPACE: "探索 3D 空间",
  12454. VIEW_DOLLHOUSE: "观看场景屋",
  12455. SOCIAL_SHARING: "分享这个空间",
  12456. VIEW_IN_VR: "以 VR 观看",
  12457. VIEW_FULLSCREEN: "全屏观看",
  12458. EXIT_FULLSCREEN: " 退出全屏",
  12459. ZOOM_IN: "放大",
  12460. ZOOM_OUT: "缩小",
  12461. FLOOR_NAME: "楼层",
  12462. FLOOR_ALL: "ALL",
  12463. FLOOR_Lang: ["Floor", ""],
  12464. TERMS: "条款",
  12465. PORT_TERMS: "port 条款",
  12466. TERMS_OF_USE: "使用条款",
  12467. CLOSE_TERMS: "关闭",
  12468. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12469. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12470. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12471. WEBVR_ENTER_WEBVR: "进入 VR",
  12472. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12473. WEBVR_LEARN_MORE: "了解更多",
  12474. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12475. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12476. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12477. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12478. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12479. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12480. VR_LEARN_MORE_CAPS: "了解更多",
  12481. VR_PREVIOUS_CAPS: "上一个’,",
  12482. VR_NEXT_CAPS: "下一个",
  12483. VR_GOT_IT_CAPS: "明白了",
  12484. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12485. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12486. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12487. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12488. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12489. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12490. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12491. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12492. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12493. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12494. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12495. VR_APP: "port VR 应用程序",
  12496. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12497. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12498. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12499. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12500. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12501. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12502. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12503. VR_ANDROID_DVICES: "Android 设备",
  12504. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12505. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12506. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12507. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12508. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12509. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12510. VR_DOWNLOAD_HERE: "在此下载",
  12511. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12512. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12513. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12514. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12515. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12516. SHARE_TO: "分享到",
  12517. SHARE_LINK: "直接链接",
  12518. SHARE_EXPLORE: "探索",
  12519. SHARE_AT: "在",
  12520. SHARE_WITH: "使用",
  12521. SHARE_3D: "以 3D",
  12522. SHARE_COPIED: "已复制!",
  12523. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12524. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12525. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12526. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12527. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12528. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12529. ERROR_GENERIC_ACTIONS_3: " 或",
  12530. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12531. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12532. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12533. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12534. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12535. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12536. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12537. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12538. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12539. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12540. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12541. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12542. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12543. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12544. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12545. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12546. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12547. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12548. LINK_TO_LOCATION: "地点链接",
  12549. MENU_COPY: "复制",
  12550. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12551. ROTATE: "旋转",
  12552. MOVE: "移动",
  12553. INSIDE: "内部",
  12554. ZOOM: "缩放",
  12555. HELP: "小帮手",
  12556. HELP_NAVIGATION_TAB: "导航",
  12557. HELP_MORE_HELP_TAB: "更多帮助",
  12558. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12559. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12560. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12561. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12562. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12563. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12564. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12565. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12566. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12567. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12568. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12569. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12570. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12571. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12572. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12573. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12574. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12575. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12576. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12577. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12578. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12579. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12580. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12581. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12582. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12583. HELP_MORE_HLR_A: "精彩片段集锦",
  12584. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12585. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12586. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12587. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12588. HELP_MORE_FLOORS_A: "楼层选择器",
  12589. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12590. HELP_MORE_TAG_A: "tag™ 贴文",
  12591. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12592. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12593. HELP_MORE_ZOOM_A: "缩放控件",
  12594. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12595. HELP_MORE_TOUR_A: "导览控件",
  12596. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12597. HELP_MORE_INSIDE_A: "内部视图",
  12598. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12599. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12600. HELP_MORE_VR_A: "VR 模式",
  12601. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12602. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12603. HELP_MORE_360_A: "360° 视图",
  12604. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12605. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12606. HELP_MORE_FULLSCREEN_A: "全屏",
  12607. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12608. CLOSE: "关闭"
  12609. }
  12610. }
  12611. , {}],
  12612. 110: [function(e, t, i) {
  12613. "use strict";
  12614. t.exports = {
  12615. PAGE_TITLE: "",
  12616. LOADING: "Lädt",
  12617. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12618. POWERED_BY: "Angetrieben von",
  12619. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12620. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12621. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12622. PRESENTED_BY: "Präsentiert von ",
  12623. MORE: "Mehr ",
  12624. LESS: "Weniger ",
  12625. TAG_CONTENT: "tag™ Inhalt",
  12626. SHOW: "Anzeigen",
  12627. HIDE: "Verbergen",
  12628. DOLLHOUSE: "Puppenhaus",
  12629. FLOOR_PLAN: "Grundriss",
  12630. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12631. CLOSE_HIGHLIGHTS: "Schließen",
  12632. PREVIOUS: "Vorheriges",
  12633. PLAY: "Abspielen",
  12634. PAUSE: "Pausieren",
  12635. NEXT: "Nächstes",
  12636. EXPLORE_3D_SPACE: "Innenraum betreten",
  12637. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12638. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12639. VIEW_IN_VR: "In VR ansehen",
  12640. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12641. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12642. ZOOM_IN: "Vergrößern",
  12643. ZOOM_OUT: "Verkleinern",
  12644. FLOOR_NAME: "Etage ",
  12645. FLOOR_ALL: "Alle",
  12646. TERMS: "Bedingungen",
  12647. PORT_TERMS: "port Bedingungen",
  12648. TERMS_OF_USE: "Nutzungsbedingungen",
  12649. TERMS_TEXT_FILE: "terms-de-DE.html",
  12650. CLOSE_TERMS: "Schließen",
  12651. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12652. HELP: "Hilfe",
  12653. HELP_NAVIGATION_TAB: "Navigation",
  12654. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12655. CLOSE: "Schließen",
  12656. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12657. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12658. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12659. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12660. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12661. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12662. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12663. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12664. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12665. 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.",
  12666. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12667. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12668. 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.",
  12669. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12670. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12671. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12672. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12673. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12674. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12675. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12676. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12677. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12678. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12679. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12680. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12681. HELP_MORE_HLR_A: "Liste das Highlight",
  12682. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12683. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12684. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12685. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12686. HELP_MORE_FLOORS_A: "Etage auswählen",
  12687. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12688. HELP_MORE_TAG_A: "tag™ Posts",
  12689. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12690. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12691. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12692. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12693. HELP_MORE_TOUR_A: "Tour Steuerung",
  12694. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12695. HELP_MORE_INSIDE_A: "Innenansicht",
  12696. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12697. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12698. HELP_MORE_VR_A: "VR Modus",
  12699. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12700. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12701. HELP_MORE_360_A: "360° Views Ansicht ",
  12702. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12703. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12704. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12705. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12706. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12707. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12708. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12709. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12710. WEBVR_LEARN_MORE: "Mehr Infos",
  12711. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12712. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12713. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12714. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12715. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12716. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12717. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12718. VR_APP: "port VR App",
  12719. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12720. 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",
  12721. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12722. VR_APP_FOR_ANDROID: "port VR app für Android",
  12723. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12724. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12725. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12726. VR_PREVIOUS_CAPS: "ZURÜCK",
  12727. VR_NEXT_CAPS: "WEITER",
  12728. VR_GOT_IT_CAPS: "VERSTANDEN",
  12729. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12730. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12731. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12732. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12733. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12734. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12735. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12736. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12737. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12738. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12739. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12740. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12741. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12742. VR_ANDROID_DVICES: "Android Geräte",
  12743. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12744. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12745. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12746. VR_DOWNLOAD_HERE: "Hier runterladen",
  12747. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12748. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12749. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12750. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12751. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12752. SHARE_TO: "Teilen auf",
  12753. SHARE_LINK: "Direkter Link",
  12754. SHARE_EXPLORE: "Umsehen",
  12755. SHARE_AT: "auf",
  12756. SHARE_WITH: "mit",
  12757. SHARE_3D: "in 3D",
  12758. SHARE_COPIED: "Kopiert!",
  12759. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12760. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12761. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12762. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12763. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12764. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12765. ERROR_GENERIC_ACTIONS_3: " oder ",
  12766. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12767. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12768. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12769. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12770. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12771. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12772. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12773. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12774. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12775. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12776. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12777. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12778. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12779. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12780. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12781. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12782. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12783. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12784. LINK_TO_LOCATION: "Link zu",
  12785. MENU_COPY: "Kopieren",
  12786. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12787. ROTATE: "Drehen",
  12788. INSIDE: "Drinnen",
  12789. MOVE: "Bewegen",
  12790. ZOOM: "Vergrößern"
  12791. }
  12792. }
  12793. , {}],
  12794. 111: [function(e, t, i) {
  12795. "use strict";
  12796. t.exports = {
  12797. PAGE_TITLE: "",
  12798. LOADING: "Loading",
  12799. PRESENTED_BY_CAPS: "PRESENTED BY",
  12800. POWERED_BY: "powered by ",
  12801. POWERED_BY_CAPS: "POWERED BY",
  12802. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12803. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12804. PRESENTED_BY: "Presented by ",
  12805. MORE: "More ",
  12806. LESS: "Less ",
  12807. TAG_CONTENT: "tag™ Content",
  12808. SHOW: "Show",
  12809. HIDE: "Hide",
  12810. DOLLHOUSE: "Dollhouse",
  12811. FLOOR_PLAN: "Floor plan",
  12812. OPEN_HIGHLIGHTS: "Open Highlights",
  12813. CLOSE_HIGHLIGHTS: "Close",
  12814. PREVIOUS: "Previous",
  12815. PLAY: "Play",
  12816. PAUSE: "Pause",
  12817. NEXT: "Next",
  12818. EXPLORE_3D_SPACE: "Explore 3D Space",
  12819. VIEW_DOLLHOUSE: "View dollhouse",
  12820. SOCIAL_SHARING: "Share this Space",
  12821. VIEW_IN_VR: "View in VR",
  12822. VIEW_FULLSCREEN: "全屏",
  12823. EXIT_FULLSCREEN: "退出全屏",
  12824. ZOOM_IN: "Zoom in",
  12825. ZOOM_OUT: "Zoom out",
  12826. FLOOR_NAME: "Floor ",
  12827. FLOOR_ALL: "全部",
  12828. TERMS: "Terms",
  12829. PORT_TERMS: "port terms",
  12830. TERMS_OF_USE: "Terms of Use",
  12831. TERMS_TEXT_FILE: "terms-en-US.html",
  12832. CLOSE_TERMS: "Close",
  12833. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  12834. HELP: "Help",
  12835. HELP_NAVIGATION_TAB: "Navigation",
  12836. HELP_MORE_HELP_TAB: "More Help",
  12837. CLOSE: "Close",
  12838. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  12839. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  12840. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  12841. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  12842. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  12843. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  12844. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  12845. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  12846. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  12847. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  12848. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  12849. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  12850. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  12851. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  12852. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  12853. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  12854. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  12855. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  12856. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  12857. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  12858. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  12859. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  12860. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  12861. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  12862. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  12863. HELP_MORE_HLR_A: "Highlight Reel",
  12864. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  12865. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  12866. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  12867. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  12868. HELP_MORE_FLOORS_A: "Floor Selector",
  12869. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  12870. HELP_MORE_TAG_A: "tag™ Posts",
  12871. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  12872. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  12873. HELP_MORE_ZOOM_A: "Zoom Controls",
  12874. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  12875. HELP_MORE_TOUR_A: "Tour Controls",
  12876. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  12877. HELP_MORE_INSIDE_A: "Inside View",
  12878. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  12879. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  12880. HELP_MORE_VR_A: "VR Mode",
  12881. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  12882. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  12883. HELP_MORE_360_A: "360° Views",
  12884. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  12885. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  12886. HELP_MORE_FULLSCREEN_A: "Full screen",
  12887. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  12888. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  12889. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  12890. WEBVR_FOR_DAYDREAM: "For Daydream View",
  12891. WEBVR_ENTER_WEBVR: "ENTER VR",
  12892. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  12893. WEBVR_LEARN_MORE: "Learn more",
  12894. WEBVR_VIEW_SPACE: "View Space in VR",
  12895. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12896. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  12897. VR_VIEW_SPACE: "View Space in Virtual Reality",
  12898. VR_LEARN_MORE_CAPS: "LEARN MORE",
  12899. VR_PREVIOUS_CAPS: "PREVIOUS",
  12900. VR_NEXT_CAPS: "NEXT",
  12901. VR_GOT_IT_CAPS: "GOT IT",
  12902. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  12903. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  12904. VR_SHOW_IOS_1: "Tap to view the space in VR",
  12905. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  12906. VR_WHAT_YOU_NEED: "What You'll Need For...",
  12907. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  12908. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  12909. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  12910. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  12911. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12912. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12913. VR_APP: "port VR App",
  12914. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12915. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12916. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  12917. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  12918. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  12919. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12920. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12921. VR_ANDROID_DVICES: "Android Devices",
  12922. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  12923. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  12924. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  12925. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  12926. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  12927. VR_APP_OPEN: "Open with the port VR app instead",
  12928. VR_DOWNLOAD_HERE: "Download here",
  12929. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  12930. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  12931. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  12932. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  12933. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  12934. SHARE_TO: "Share to",
  12935. SHARE_LINK: "Direct Link",
  12936. SHARE_EXPLORE: "Explore ",
  12937. SHARE_AT: "at",
  12938. SHARE_WITH: "with",
  12939. SHARE_3D: " in 3D",
  12940. SHARE_COPIED: "Copied!",
  12941. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  12942. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  12943. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  12944. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  12945. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  12946. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  12947. ERROR_GENERIC_ACTIONS_3: " or ",
  12948. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  12949. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  12950. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  12951. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  12952. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  12953. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  12954. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  12955. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  12956. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  12957. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  12958. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  12959. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  12960. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  12961. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  12962. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  12963. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  12964. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  12965. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  12966. LINK_TO_LOCATION: "Link to location",
  12967. MENU_COPY: "Copy",
  12968. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  12969. ROTATE: "Rotate",
  12970. INSIDE: "Inside",
  12971. MOVE: "Move",
  12972. ZOOM: "Zoom"
  12973. }
  12974. }
  12975. , {}],
  12976. 112: [function(e, t, i) {
  12977. "use strict";
  12978. t.exports = {
  12979. PAGE_TITLE: "",
  12980. LOADING: "Cargando",
  12981. PRESENTED_BY_CAPS: "PRESENTADO POR",
  12982. POWERED_BY: "potenciando por ",
  12983. POWERED_BY_CAPS: "POTENCIADO POR ",
  12984. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  12985. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  12986. PRESENTED_BY: "Presentado por ",
  12987. MORE: "Más ",
  12988. LESS: "Menos ",
  12989. TAG_CONTENT: "Contenido de tag™",
  12990. SHOW: "Mostrar",
  12991. HIDE: "Ocultar",
  12992. DOLLHOUSE: "Dollhouse",
  12993. FLOOR_PLAN: "Planos",
  12994. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  12995. CLOSE_HIGHLIGHTS: "Cerrar",
  12996. PREVIOUS: "Anterior",
  12997. PLAY: "Play",
  12998. PAUSE: "Pausa",
  12999. NEXT: "Siguiente",
  13000. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13001. VIEW_DOLLHOUSE: "Ver dollhouse",
  13002. SOCIAL_SHARING: "Compartir este espacio",
  13003. VIEW_IN_VR: "Ver en realidad virtual",
  13004. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13005. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13006. ZOOM_IN: "Acercar",
  13007. ZOOM_OUT: "Alejar",
  13008. FLOOR_NAME: "Piso ",
  13009. FLOOR_ALL: "Todas",
  13010. TERMS: "Condiciones",
  13011. PORT_TERMS: "port términos de uso",
  13012. TERMS_OF_USE: "Términos de uso",
  13013. TERMS_TEXT_FILE: "terms-es-MX.html",
  13014. CLOSE_TERMS: "Cerrar",
  13015. 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.",
  13016. HELP: "Ayuda",
  13017. HELP_NAVIGATION_TAB: "Navegación",
  13018. HELP_MORE_HELP_TAB: "Más Ayuda",
  13019. CLOSE: "Cerrar",
  13020. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13021. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13022. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13023. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13024. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13025. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13026. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13027. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13028. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13029. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13030. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13031. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13032. 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.",
  13033. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13034. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13035. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13036. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13037. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13038. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13039. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13040. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13041. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13042. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13043. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13044. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13045. HELP_MORE_HLR_A: "Galería destacada",
  13046. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13047. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13048. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13049. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13050. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13051. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13052. HELP_MORE_TAG_A: "tag™ Posts",
  13053. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13054. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13055. HELP_MORE_ZOOM_A: "Controles de zoom",
  13056. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13057. HELP_MORE_TOUR_A: "Controles de recorrido",
  13058. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13059. HELP_MORE_INSIDE_A: "Vista interior",
  13060. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13061. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13062. HELP_MORE_VR_A: "Modo de realidad virtual",
  13063. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13064. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13065. HELP_MORE_360_A: "360° Views",
  13066. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13067. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13068. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13069. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13070. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13071. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13072. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13073. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13074. WEBVR_LEARN_MORE: "Más información",
  13075. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13076. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13077. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13078. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13079. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13080. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13081. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13082. VR_APP: "port VR App",
  13083. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13084. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13085. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13086. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13087. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13088. VR_PREVIOUS_CAPS: "ANTERIOR",
  13089. VR_NEXT_CAPS: "SIGUIENTE",
  13090. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13091. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13092. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13093. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13094. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13095. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13096. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13097. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13098. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13099. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13100. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13101. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13102. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13103. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13104. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13105. VR_ANDROID_DVICES: "Dispositivos Android",
  13106. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13107. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13108. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13109. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13110. VR_DOWNLOAD_HERE: "Descargar aquí",
  13111. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13112. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13113. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13114. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13115. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13116. SHARE_TO: "Compartir en",
  13117. SHARE_LINK: "Enlace directo",
  13118. SHARE_EXPLORE: "Explorar ",
  13119. SHARE_AT: "en",
  13120. SHARE_WITH: "con",
  13121. SHARE_3D: " en 3D",
  13122. SHARE_COPIED: "¡Copiado!",
  13123. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13124. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13125. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13126. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13127. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13128. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13129. ERROR_GENERIC_ACTIONS_3: " o ",
  13130. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13131. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13132. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13133. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13134. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13135. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13136. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13137. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13138. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13139. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13140. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13141. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13142. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13143. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13144. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13145. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13146. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13147. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13148. LINK_TO_LOCATION: "Enlace a la ubicación",
  13149. MENU_COPY: "Copiar",
  13150. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13151. ROTATE: "Girar",
  13152. INSIDE: "Interior",
  13153. MOVE: "Moverse",
  13154. ZOOM: "Acercar o alejar"
  13155. }
  13156. }
  13157. , {}],
  13158. 113: [function(e, t, i) {
  13159. "use strict";
  13160. t.exports = {
  13161. PAGE_TITLE: "",
  13162. LOADING: "Chargement",
  13163. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13164. POWERED_BY: "alimenté par ",
  13165. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13166. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13167. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13168. PRESENTED_BY: "Présenté par ",
  13169. MORE: "Plus ",
  13170. LESS: "Moins ",
  13171. TAG_CONTENT: "Contenu tag™",
  13172. SHOW: "Montrer",
  13173. HIDE: "Cacher",
  13174. DOLLHOUSE: "Dollhouse",
  13175. FLOOR_PLAN: "Plan de sol",
  13176. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13177. CLOSE_HIGHLIGHTS: "Fermer",
  13178. PREVIOUS: "Précédent",
  13179. PLAY: "Lecture",
  13180. PAUSE: "Pause",
  13181. NEXT: "Suivant",
  13182. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13183. VIEW_DOLLHOUSE: "Voir dollhouse",
  13184. SOCIAL_SHARING: "Partager cet espace",
  13185. VIEW_IN_VR: "Voir en VR",
  13186. VIEW_FULLSCREEN: "Plein écran",
  13187. EXIT_FULLSCREEN: "Fermer plein écran",
  13188. ZOOM_IN: "Zoom avant",
  13189. ZOOM_OUT: "Zoom arrière",
  13190. FLOOR_NAME: "Étage ",
  13191. FLOOR_ALL: "Tous",
  13192. TERMS: "Mentions légales",
  13193. PORT_TERMS: "port mentions légales",
  13194. TERMS_OF_USE: "Conditions d'utilisation",
  13195. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13196. CLOSE_TERMS: "Fermer",
  13197. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13198. HELP: "Aide",
  13199. HELP_NAVIGATION_TAB: "Navigation",
  13200. HELP_MORE_HELP_TAB: "Aide",
  13201. CLOSE: "Fermer",
  13202. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13203. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13204. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13205. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13206. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13207. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13208. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13209. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13210. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13211. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13212. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13213. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13214. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13215. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13216. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13217. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13218. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13219. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13220. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13221. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13222. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13223. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13224. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13225. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13226. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13227. HELP_MORE_HLR_A: "Carrousel",
  13228. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13229. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13230. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13231. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13232. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13233. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13234. HELP_MORE_TAG_A: "tag™ Posts",
  13235. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13236. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13237. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13238. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13239. HELP_MORE_TOUR_A: "Commandes de la visite",
  13240. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13241. HELP_MORE_INSIDE_A: "Vue intérieure",
  13242. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13243. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13244. HELP_MORE_VR_A: "Mode RV",
  13245. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13246. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13247. HELP_MORE_360_A: "Vues 360°",
  13248. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13249. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13250. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13251. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13252. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13253. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13254. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13255. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13256. WEBVR_LEARN_MORE: "En savoir plus",
  13257. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13258. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13259. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13260. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13261. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13262. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13263. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13264. VR_NEXT_CAPS: "SUIVANT",
  13265. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13266. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13267. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13268. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13269. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13270. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13271. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13272. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13273. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13274. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13275. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13276. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13277. VR_APP: "port VR App",
  13278. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13279. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13280. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13281. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13282. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13283. 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",
  13284. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13285. VR_ANDROID_DVICES: "Appareils Android",
  13286. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13287. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13288. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13289. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13290. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13291. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13292. VR_DOWNLOAD_HERE: "Télécharger ici",
  13293. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13294. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13295. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13296. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13297. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13298. SHARE_TO: "Partager sur",
  13299. SHARE_LINK: "Lien direct",
  13300. SHARE_EXPLORE: "Explorer ",
  13301. SHARE_AT: "à",
  13302. SHARE_WITH: "avec",
  13303. SHARE_3D: " en 3D",
  13304. SHARE_COPIED: "Copié!",
  13305. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13306. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13307. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13308. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13309. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13310. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13311. ERROR_GENERIC_ACTIONS_3: " ou ",
  13312. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13313. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13314. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13315. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13316. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13317. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13318. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13319. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13320. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13321. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13322. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13323. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13324. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13325. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13326. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13327. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13328. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13329. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13330. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13331. MENU_COPY: "Copie",
  13332. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13333. ROTATE: "Faire pivoter",
  13334. INSIDE: "Intérieure",
  13335. MOVE: "Se déplacer",
  13336. ZOOM: "Zoom"
  13337. }
  13338. }
  13339. , {}],
  13340. 114: [function(e, t, i) {
  13341. "use strict";
  13342. t.exports = {
  13343. PAGE_TITLE: "",
  13344. LOADING: "読み込み中",
  13345. PRESENTED_BY_CAPS: "PRESENTED BY",
  13346. POWERED_BY: "powered by",
  13347. POWERED_BY_CAPS: "POWERED BY",
  13348. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13349. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13350. PRESENTED_BY: "Presented by ",
  13351. MORE: "全て表示 ",
  13352. LESS: "閉じる ",
  13353. TAG_CONTENT: "tag™コンテンツ ",
  13354. SHOW: "表示",
  13355. HIDE: "非表示",
  13356. DOLLHOUSE: "ドールハウス",
  13357. FLOOR_PLAN: "フロアプラン",
  13358. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13359. CLOSE_HIGHLIGHTS: "閉じる",
  13360. PREVIOUS: "前へ",
  13361. PLAY: "再生",
  13362. PAUSE: "一時停止",
  13363. NEXT: "次へ",
  13364. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13365. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13366. SOCIAL_SHARING: "このSpaceを共有する",
  13367. VIEW_IN_VR: "VRで表示",
  13368. VIEW_FULLSCREEN: "フルスクリーン表示",
  13369. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13370. ZOOM_IN: "ズームイン",
  13371. ZOOM_OUT: "ズームアウト",
  13372. FLOOR_NAME: "フロア ",
  13373. FLOOR_ALL: "すべて",
  13374. TERMS: "規約",
  13375. PORT_TERMS: "port規約",
  13376. TERMS_OF_USE: "利用規約",
  13377. CLOSE_TERMS: "閉じる",
  13378. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13379. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13380. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13381. WEBVR_ENTER_WEBVR: "VRに入る",
  13382. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13383. WEBVR_LEARN_MORE: "もっと詳しく",
  13384. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13385. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13386. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13387. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13388. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13389. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13390. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13391. VR_PREVIOUS_CAPS: "前へ",
  13392. VR_NEXT_CAPS: "次へ",
  13393. VR_GOT_IT_CAPS: "了解",
  13394. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13395. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13396. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13397. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13398. VR_WHAT_YOU_NEED: "必要なもの",
  13399. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13400. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13401. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13402. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13403. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13404. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13405. VR_APP: "port VRアプリ",
  13406. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13407. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13408. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13409. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13410. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13411. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13412. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13413. VR_ANDROID_DVICES: "Androidデバイス",
  13414. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13415. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13416. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13417. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13418. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13419. VR_APP_OPEN: "port VRアプリで開く",
  13420. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13421. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13422. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13423. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13424. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13425. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13426. SHARE_TO: "共有先",
  13427. SHARE_LINK: "ダイレクトリンク",
  13428. SHARE_EXPLORE: "探索",
  13429. SHARE_AT: "場所",
  13430. SHARE_WITH: "使用アプリ",
  13431. SHARE_3D: "3Dで",
  13432. SHARE_COPIED: "コピーされました!",
  13433. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13434. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13435. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13436. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13437. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13438. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13439. ERROR_GENERIC_ACTIONS_3: "または",
  13440. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13441. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13442. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13443. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13444. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13445. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13446. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13447. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13448. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13449. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13450. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13451. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13452. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13453. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13454. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13455. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13456. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13457. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13458. LINK_TO_LOCATION: "ロケーションへのリンク",
  13459. MENU_COPY: "コピー",
  13460. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13461. ROTATE: "回転",
  13462. MOVE: "移動",
  13463. INSIDE: "内側",
  13464. ZOOM: "ズーム",
  13465. HELP: "ヘルプ",
  13466. HELP_NAVIGATION_TAB: "ナビゲーション",
  13467. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13468. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13469. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13470. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13471. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13472. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13473. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13474. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13475. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13476. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13477. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13478. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13479. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13480. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13481. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13482. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13483. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13484. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13485. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13486. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13487. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13488. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13489. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13490. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13491. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13492. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13493. HELP_MORE_HLR_A: "ハイライト",
  13494. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13495. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13496. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13497. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13498. HELP_MORE_FLOORS_A: "フロアセレクター",
  13499. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13500. HELP_MORE_TAG_A: "tag™ Posts",
  13501. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13502. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13503. HELP_MORE_ZOOM_A: "ズームコントロール",
  13504. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13505. HELP_MORE_TOUR_A: "ツアーコントロール",
  13506. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13507. HELP_MORE_INSIDE_A: "内側ビュー",
  13508. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13509. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13510. HELP_MORE_VR_A: "VRモード",
  13511. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13512. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13513. HELP_MORE_360_A: "360° Views",
  13514. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13515. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13516. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13517. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13518. CLOSE: "閉じる"
  13519. }
  13520. }
  13521. , {}],
  13522. 115: [function(e, t, i) {
  13523. "use strict";
  13524. t.exports = {
  13525. PAGE_TITLE: "",
  13526. LOADING: "Загрузка",
  13527. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13528. POWERED_BY: "разработано на платформе ",
  13529. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13530. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13531. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13532. PRESENTED_BY: "Представлено ",
  13533. MORE: "Больше ",
  13534. LESS: "Меньше ",
  13535. TAG_CONTENT: "tag™ Контент",
  13536. SHOW: "Показать",
  13537. HIDE: "Скрыть",
  13538. DOLLHOUSE: "Dollhouse",
  13539. FLOOR_PLAN: "Планировка",
  13540. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13541. CLOSE_HIGHLIGHTS: "Закрыть",
  13542. PREVIOUS: "Предыдущий",
  13543. PLAY: "Воспроизвести",
  13544. PAUSE: "Пауза",
  13545. NEXT: "Следующий",
  13546. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13547. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13548. SOCIAL_SHARING: "Поделиться этой моделью",
  13549. VIEW_IN_VR: "Посмотреть в VR",
  13550. VIEW_FULLSCREEN: "Полный экран",
  13551. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13552. ZOOM_IN: "Увеличить",
  13553. ZOOM_OUT: "Уменьшить",
  13554. FLOOR_NAME: "Этаж ",
  13555. FLOOR_ALL: "Все",
  13556. TERMS: "Условия",
  13557. PORT_TERMS: "Правила пользования",
  13558. TERMS_OF_USE: "Условия использования",
  13559. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13560. CLOSE_TERMS: "Закрыть",
  13561. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13562. HELP: "Помощь",
  13563. HELP_NAVIGATION_TAB: "Навигация",
  13564. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13565. CLOSE: "Закрыть",
  13566. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13567. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13568. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13569. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13570. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13571. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13572. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13573. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13574. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13575. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13576. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13577. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13578. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13579. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13580. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13581. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13582. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13583. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13584. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13585. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13586. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13587. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13588. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13589. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13590. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13591. HELP_MORE_HLR_A: "Фотоколлаж",
  13592. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13593. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13594. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13595. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13596. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13597. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13598. HELP_MORE_TAG_A: "tag™ Posts",
  13599. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13600. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13601. HELP_MORE_ZOOM_A: "Масштаб",
  13602. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13603. HELP_MORE_TOUR_A: "Управление Туром",
  13604. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13605. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13606. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13607. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13608. HELP_MORE_VR_A: "Режим VR",
  13609. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13610. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13611. HELP_MORE_360_A: "360° Views",
  13612. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13613. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13614. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13615. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13616. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13617. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13618. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13619. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13620. WEBVR_LEARN_MORE: "Узнать больше",
  13621. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13622. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13623. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13624. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13625. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13626. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13627. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13628. VR_APP: "port VR App",
  13629. VR_APP_OPEN: "Или открыть через приложение port VR",
  13630. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13631. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13632. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13633. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13634. VR_VIEW_SPACE: "Запустить модель в VR",
  13635. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13636. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13637. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13638. VR_GOT_IT_CAPS: "ЯСНО",
  13639. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13640. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13641. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13642. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13643. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13644. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13645. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13646. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13647. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13648. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13649. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13650. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13651. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13652. VR_ANDROID_DVICES: "Android устройства",
  13653. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13654. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13655. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13656. VR_DOWNLOAD_HERE: "Скачать здесь",
  13657. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13658. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13659. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13660. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13661. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13662. SHARE_TO: "Поделиться",
  13663. SHARE_LINK: "Прямая ссылка",
  13664. SHARE_EXPLORE: "просмотреть",
  13665. SHARE_AT: "на",
  13666. SHARE_WITH: "с",
  13667. SHARE_3D: "в 3D",
  13668. SHARE_COPIED: "Скопировано!",
  13669. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13670. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13671. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13672. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13673. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13674. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13675. ERROR_GENERIC_ACTIONS_3: " или ",
  13676. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13677. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13678. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13679. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13680. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13681. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13682. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13683. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13684. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13685. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13686. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13687. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13688. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13689. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13690. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13691. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13692. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13693. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13694. LINK_TO_LOCATION: "Ссылка на местоположение",
  13695. MENU_COPY: "Копировать",
  13696. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13697. ROTATE: "Вращать",
  13698. MOVE: "Передвигаться",
  13699. INSIDE: "Вид изнутри",
  13700. ZOOM: "Масштаб"
  13701. }
  13702. }
  13703. , {}],
  13704. 116: [function(r, e, t) {
  13705. (function(i) {
  13706. "use strict";
  13707. function re(e) {
  13708. console.log("e1:" + e),
  13709. e = Math.round(.4 * e * 100),
  13710. console.log("e2:" + e);
  13711. var t = $(".progressbar");
  13712. t.find(".bar").css("width", e + "%"),
  13713. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13714. t.find(".perc").text(e + "%")
  13715. }
  13716. $("#gui-loading").fadeIn(200),
  13717. re(.1);
  13718. var e = g_version ? "modeldata.js" : "someData.json";
  13719. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13720. dataType: "json"
  13721. }).done(function(e) {
  13722. var t = matcher(e);
  13723. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13724. t.user = {
  13725. is_authenticated: !1,
  13726. 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"]
  13727. }
  13728. try{//处理一下导览数据,旧的曾有导览数据是错误的,将它删除
  13729. var newImages = [];
  13730. t.model.images.forEach((tourImg)=>{tourImg.thumbnail_signed_src && newImages.push(tourImg)})
  13731. t.model.images = newImages
  13732. }catch(e){console.log(e) }
  13733. window.MP_PREFETCHED_MODELDATA = t
  13734. t.model.summary = t.summary
  13735. t.model.name = t.name
  13736. for(let i in t){
  13737. t[i] == "false" && (t[i] = false)
  13738. }
  13739. re(.7),
  13740. function() {
  13741. function y(e) {
  13742. t.update(e)
  13743. }
  13744. function A(e, t) {
  13745. ne.error(t),
  13746. n.error(t),
  13747. N.report(e, "error-" + t)
  13748. }
  13749. function C(e, t, i) {
  13750. try {
  13751. e.start(t)
  13752. } catch (e) {
  13753. throw ne.warn(e.message),
  13754. function(e) {
  13755. var t = O.details();
  13756. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13757. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13758. N.report(e, "error-webgl-generic"))
  13759. }(i.sid),
  13760. e
  13761. }
  13762. }
  13763. function I(e) {
  13764. e.stopPropagation(),
  13765. e.preventDefault()
  13766. }
  13767. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  13768. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13769. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13770. });
  13771. /* window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic,
  13772. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  13773. */
  13774. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  13775. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  13776. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  13777. $("#volume").show();
  13778. }else if (g_version === "one"){
  13779. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  13780. //g_bgAudio.src = manage.dealURL(src) ;
  13781. }
  13782. //隐藏公司logo
  13783. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  13784. r("./lib/three75-shim"),
  13785. r("./lib/array-polyfill"),
  13786. r("./lib/performance-polyfill"),
  13787. r("./lib/shaders/CopyShader.js"),
  13788. r("./lib/shaders/HorizontalBlurShader.js"),
  13789. r("./lib/shaders/VerticalBlurShader.js"),
  13790. r("./lib/postprocessing/EffectComposer.js"),
  13791. r("./lib/postprocessing/RenderPass.js"),
  13792. r("./lib/postprocessing/MaskPass.js"),
  13793. r("./lib/postprocessing/ShaderPass.js"),
  13794. window.Promise || (window.Promise = r("promise-polyfill"));
  13795. var E = r("three")
  13796. , _ = r("three")
  13797. , b = (r("./util/sentry"),
  13798. r("./player"))
  13799. , w = r("./director")
  13800. , T = r("./controls/CameraControls")
  13801. , x = r("./model/ModelManager")
  13802. , S = r("./DisplayController")
  13803. , M = r("./label/LabelDisplayController")
  13804. , R = r("./enum/Viewmode")
  13805. , e = r("./util/logger")
  13806. , P = r("./showcase")
  13807. , O = r("./util/browser")
  13808. , L = r("./settings")
  13809. , D = r("./gui/gui")
  13810. , n = r("./gui/error")
  13811. , N = r("./analytics")
  13812. , F = r("./util/transitions")
  13813. , B = r("./effects")
  13814. , V = r("./objects/Skybox")
  13815. , k = (r("./util/common"),
  13816. r("./util/PanoramaCollection"),
  13817. r("./util/math"),
  13818. r("./util/showcase"))
  13819. , U = r("./util/camera")
  13820. , H = (r("./objects/Panorama"),
  13821. r("./cameras/PanoramaCamera"),
  13822. r("./preloaders"))
  13823. , z = r("events").EventEmitter
  13824. , G = r("./featureflags")
  13825. , W = (r("./util/lerp"),
  13826. r("./util/ajax"),
  13827. r("./ab"))
  13828. , j = r("./sdk/automation.js")
  13829. , Y = r("./scene/SceneRenderer")
  13830. , q = r("./scene/QuickstartManager")
  13831. , X = r("./tile/QualityManager.js")
  13832. , Z = r("./localization/localize")
  13833. , K = r("./tag/tagManager")
  13834. , Q = r("./tile/TileDownloader")
  13835. , J = r("./tile/PanoRenderer")
  13836. , ee = (r("./enum/PanoSizeClass"),
  13837. r("./enum/PanoramaEvents"),
  13838. r("./enum/SceneRendererEvents"))
  13839. , t = r("./gui/memoryUsage")
  13840. , te = r("./enum/RenderLayers")
  13841. , ie = r("./TimingData")
  13842. , ne = new e(i);
  13843. e.level = L.logLevel,
  13844. e.consoleEnabled = L.console,
  13845. function() {
  13846. var e = k.getModelIDFromQueryString();
  13847. if (!e)
  13848. return A(null, "loading-failed");
  13849. var t = k.parseSidUrl(e)
  13850. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  13851. , n = {
  13852. panoElementsToLoad: 6,
  13853. modelElementsToLoad: 0,
  13854. totalElementsLoaded: 0,
  13855. totalElementsToLoad: 0,
  13856. totalPercentageLoaded: 0,
  13857. progressCallback: null
  13858. }
  13859. , r = document.getElementById("player")
  13860. , o = L.quickstart.enabled
  13861. , a = null
  13862. , s = null
  13863. , l = null
  13864. , c = null
  13865. , h = null
  13866. , u = null
  13867. , d = null
  13868. , p = null
  13869. , f = null
  13870. , g = null
  13871. , m = null
  13872. , v = new ie;
  13873. !function(e) {
  13874. ne.info("Version", "2.25.6-0-gd87e5b1"),
  13875. z.defaultMaxListeners = 1e3,
  13876. function(e) {
  13877. e.addEventListener("dragenter", I, !1),
  13878. e.addEventListener("dragover", I, !1)
  13879. }(e),
  13880. O.valueFromHash("title", !0) || $(document).ready(function() {
  13881. $(".model-title").hide()
  13882. })
  13883. }(r),
  13884. function(e) {
  13885. return G.loadFeatureFlags(e).done(function(e) {
  13886. G.updateDependentSettings(e, L)
  13887. })
  13888. }({
  13889. urlBase: t.urlBase
  13890. }).then(function() {
  13891. return Z.init(),
  13892. function(e, t) {
  13893. var i = P.getModel({
  13894. url: t,
  13895. floors: O.valueFromHash("f", !0),
  13896. autoload: !1
  13897. });
  13898. return $.when(i, y).then(null, function(e) {
  13899. return this
  13900. })
  13901. }(0, e)
  13902. }).then(function(e) {
  13903. return re(.9),
  13904. function(e, t, i, n, r) {
  13905. ne.info("Model data loaded"),
  13906. ne.debug("UUID: " + e.data.job.uuid),
  13907. W.init(G.getFlags()),
  13908. i && N.initKeen({
  13909. token: i,
  13910. appId: n
  13911. }),
  13912. N.initSegment({
  13913. model: e.sid,
  13914. version: "2.25.6-0-gd87e5b1",
  13915. startSource: r.startSource,
  13916. token: t,
  13917. autoplay: r.autoplay,
  13918. quickstart: r.quickstart
  13919. })
  13920. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  13921. startSource: i,
  13922. autoplay: L.autoplay,
  13923. quickstart: o
  13924. }),
  13925. g.urls.init()
  13926. }).then(function() {
  13927. return g.loadPanos()
  13928. }).then(function() {
  13929. s = U.getStartCameraOptions(g, g.panos);
  13930. //初始画面
  13931. window.MP_PREFETCHED_MODELDATA.camera_start && window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg && function(e) {
  13932. $("<img/>").attr("src", e).on("load", function() {
  13933. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  13934. $(this).remove()
  13935. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  13936. })
  13937. }(window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg);
  13938. d = function(e) {
  13939. var t = new E.PerspectiveCamera;
  13940. t.layers.enable(te.PANOMARKERS),
  13941. t.layers.enable(te.RETICULE),
  13942. t.layers.enable(te.TAG);
  13943. var o = new E.Scene
  13944. , i = new E.AmbientLight(16777215);
  13945. return o.add(i),
  13946. o.skybox = new V,
  13947. o.add(o.skybox),
  13948. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  13949. side: E.DoubleSide
  13950. })),
  13951. o.plane.position.y = 0,
  13952. o.plane.rotateX(-Math.PI / 2),
  13953. o.plane.material.visible = !1,
  13954. o.add(o.plane),
  13955. o.updateMatrixWorld(),
  13956. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  13957. if (e.metadata && e.metadata.camera_position) {
  13958. var t = e.metadata.camera_position
  13959. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  13960. i.position = t.clone(),
  13961. o.add(i);
  13962. var n = e.metadata.camera_quaternion
  13963. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  13964. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  13965. }
  13966. }),
  13967. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  13968. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  13969. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  13970. new Y(o,t,B)
  13971. }(g),
  13972. m = function(e, t) {
  13973. var i = e ? 1 : 1e3
  13974. , n = W.tilegen || W.imgopt ? 6 : 2;
  13975. n = O.valueFromHash("tileconc", n);
  13976. var r = new X
  13977. , o = new Q({
  13978. concurrentDownloads: n
  13979. })
  13980. , a = new J
  13981. , s = new x
  13982. , l = new w
  13983. , c = new b(t)
  13984. , h = new T
  13985. , u = new S(i)
  13986. , d = new M
  13987. , p = new K;
  13988. return {
  13989. qualityManager: r,
  13990. panoRenderer: a,
  13991. tileDownloader: o,
  13992. player: c,
  13993. director: l,
  13994. modelManager: s,
  13995. tagManager: p,
  13996. displayController: u,
  13997. labelDisplayController: d,
  13998. controls: h
  13999. }
  14000. }(o, s.mode),
  14001. l = m.controls,
  14002. c = m.player,
  14003. h = m.director,
  14004. u = m.tagManager,
  14005. p = m.tileDownloader,
  14006. f = m.qualityManager,
  14007. m.panoRenderer,
  14008. function(e, t, i, n) {
  14009. var r = i.controls
  14010. , o = i.qualityManager
  14011. , a = i.panoRenderer
  14012. , s = i.tileDownloader
  14013. , l = i.modelManager;
  14014. r.init(n, l),
  14015. j.init(i.director, r, i.player, l, t),
  14016. o.init(l),
  14017. s.init(o),
  14018. a.init(t, s, o),
  14019. l.init(s, a, o),
  14020. l.addModel(e),
  14021. t.addComponent(F)
  14022. }(g, d, m, r),
  14023. c.director = h,
  14024. g.supportsTiles && p.start(),
  14025. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14026. o = !1);
  14027. var e = null;
  14028. if (o) {
  14029. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14030. var t = l.controls[R.PANORAMA];
  14031. a = new q(f,d.scene,d.camera,t,r),
  14032. C(d, r, g),
  14033. e = a.load(s).then(function() {
  14034. d.addComponent(a),
  14035. d.once(ee.AfterRender, function() {
  14036. ne.warn("First render after quickstart load finished.")
  14037. })
  14038. })
  14039. }
  14040. return window.flyToFirst = function() {
  14041. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14042. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14043. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14044. c.flyToPano({
  14045. pano: e,
  14046. lookAtPoint: i
  14047. })
  14048. }
  14049. ,
  14050. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14051. }).then(function() {
  14052. return function(e, t, i, n, r) {
  14053. return r.progressCallback = t,
  14054. N.sessionStart(),
  14055. e.load(n).progress(function(e, t) {
  14056. e.modelElementsToLoad = t[1],
  14057. function(e) {
  14058. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14059. }(e),
  14060. function(e) {
  14061. e.totalElementsLoaded++,
  14062. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14063. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14064. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14065. console.log("pro:" + e.totalPercentageLoaded),
  14066. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14067. }(e)
  14068. }
  14069. .bind(this, r))
  14070. }(g, D.onProgress, 0, !o, n)
  14071. }).then(function() {
  14072. s.quickstart = o,
  14073. function(e, t, i, n) {
  14074. var r = i.qualityManager
  14075. , o = i.panoRenderer
  14076. , a = i.tileDownloader
  14077. , s = i.modelManager
  14078. , l = i.player
  14079. , c = i.director
  14080. , h = i.tagManager
  14081. , u = i.displayController
  14082. , d = i.labelDisplayController
  14083. , p = i.controls;
  14084. t.scene.add(e),
  14085. t.qualityManager = r;
  14086. var f = {
  14087. camera: t.camera,
  14088. director: c,
  14089. modelManager: s,
  14090. tileDownloader: a,
  14091. panoRenderer: o,
  14092. qualityManager: r,
  14093. tagManager: h,
  14094. container: n,
  14095. controls: p
  14096. };
  14097. l.init(f),
  14098. l.setScene(t.scene),
  14099. h.init(s, l),
  14100. c.init(l, s),
  14101. u.init(c, l, s, h, n),
  14102. d.init(l, s, n),
  14103. B.bindEvents(l),
  14104. t.addComponent(h),
  14105. t.addComponent(l),
  14106. t.addComponent(o),
  14107. l.sceneRenderer = t
  14108. }(g, d, m, r),
  14109. d.started || C(d, r, g),
  14110. N.modelLoaded(g, c, l, L.autoplay),
  14111. function(e, t, i, n) {
  14112. return ne.info("Starting player in " + i.mode),
  14113. N.report(t.sid, "started-playing", n, i.quickstart),
  14114. e.start(i)
  14115. }(c, g, s, L.autoplay).done(function() {
  14116. h.autoTour()
  14117. }),
  14118. g.supportsTiles || new H(g,c).start();
  14119. o && (d.removeComponent(a),
  14120. a.destroy(),
  14121. s.pano.enter()),
  14122. D.init(g, h, c, l, d, s, N.getSessionId()),
  14123. D.endLoading(g, h, u),
  14124. d.once(ee.AfterRender, function() {
  14125. v.setAppReadyTime();
  14126. var e = v.calcFullLoadingTime();
  14127. ne.warn("Total load time: " + e / 1e3),
  14128. N.loadComplete(e),
  14129. ne.warn("First render after model load finished.")
  14130. }),
  14131. d.on(ee.MemoryUsageUpdated, y)
  14132. }).fail(A.bind(this, e))
  14133. }()
  14134. }()
  14135. })
  14136. }
  14137. ).call(this, "/js/main.js")
  14138. }
  14139. , {
  14140. "./DisplayController": 1,
  14141. "./TimingData": 2,
  14142. "./ab": 3,
  14143. "./analytics": 4,
  14144. "./cameras/PanoramaCamera": 7,
  14145. "./controls/CameraControls": 9,
  14146. "./director": 15,
  14147. "./effects": 16,
  14148. "./enum/PanoSizeClass": 36,
  14149. "./enum/PanoramaEvents": 37,
  14150. "./enum/RenderLayers": 41,
  14151. "./enum/SceneRendererEvents": 43,
  14152. "./enum/Viewmode": 51,
  14153. "./featureflags": 59,
  14154. "./gui/error": 64,
  14155. "./gui/gui": 65,
  14156. "./gui/memoryUsage": 73,
  14157. "./label/LabelDisplayController": 91,
  14158. "./lib/array-polyfill": 92,
  14159. "./lib/performance-polyfill": 95,
  14160. "./lib/postprocessing/EffectComposer.js": 96,
  14161. "./lib/postprocessing/MaskPass.js": 97,
  14162. "./lib/postprocessing/RenderPass.js": 98,
  14163. "./lib/postprocessing/ShaderPass.js": 99,
  14164. "./lib/shaders/CopyShader.js": 100,
  14165. "./lib/shaders/HorizontalBlurShader.js": 101,
  14166. "./lib/shaders/VerticalBlurShader.js": 102,
  14167. "./lib/three75-shim": 103,
  14168. "./localization/localize": 108,
  14169. "./tag/tagManager": 124,
  14170. "./model/ModelManager": 140,
  14171. "./objects/Panorama": 148,
  14172. "./objects/Skybox": 152,
  14173. "./player": 155,
  14174. "./preloaders": 156,
  14175. "./scene/QuickstartManager": 157,
  14176. "./scene/SceneRenderer": 158,
  14177. "./sdk/automation.js": 164,
  14178. "./settings": 166,
  14179. "./showcase": 168,
  14180. "./tile/PanoRenderer": 169,
  14181. "./tile/QualityManager.js": 170,
  14182. "./tile/TileDownloader": 171,
  14183. "./util/PanoramaCollection": 178,
  14184. "./util/ajax": 181,
  14185. "./util/browser": 182,
  14186. "./util/camera": 183,
  14187. "./util/common": 185,
  14188. "./util/lerp": 188,
  14189. "./util/logger": 189,
  14190. "./util/math": 190,
  14191. "./util/sentry": 192,
  14192. "./util/showcase": 193,
  14193. "./util/transitions": 195,
  14194. events: 202,
  14195. "promise-polyfill": 213,
  14196. three: 217
  14197. }],
  14198. 117: [function(e, t, i) {
  14199. "use strict";
  14200. function n(e) {
  14201. e = e || {},
  14202. r.RawShaderMaterial.call(this, a.extendObject({
  14203. fragmentShader: o.cube.fragmentShader,
  14204. vertexShader: o.cube.vertexShader,
  14205. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14206. name: "CubemapMaterial"
  14207. }, e))
  14208. }
  14209. var r = e("three")
  14210. , o = e("../shaders")
  14211. , a = e("../util/common");
  14212. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14213. t.exports = n
  14214. }
  14215. , {
  14216. "../shaders": 167,
  14217. "../util/common": 185,
  14218. three: 217
  14219. }],
  14220. 118: [function(e, t, i) {
  14221. "use strict";
  14222. function n(e) {
  14223. e = e || {},
  14224. r.RawShaderMaterial.call(this, a.extendObject({
  14225. fragmentShader: o.model.fragmentShader,
  14226. vertexShader: o.model.vertexShader,
  14227. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14228. name: "ModelTextureMaterial"
  14229. }, e))
  14230. }
  14231. var r = e("three")
  14232. , o = e("../shaders")
  14233. , a = e("../util/common");
  14234. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14235. i && (this.uniforms.progress.value = 0),
  14236. e.ensureSkyboxReadyForRender(),
  14237. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14238. this.uniforms.pano0Position.value.copy(e.position),
  14239. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14240. t.ensureSkyboxReadyForRender(),
  14241. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14242. this.uniforms.pano1Position.value.copy(t.position),
  14243. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14244. }
  14245. ,
  14246. t.exports = n
  14247. }
  14248. , {
  14249. "../shaders": 167,
  14250. "../util/common": 185,
  14251. three: 217
  14252. }],
  14253. 119: [function(m, v, e) {
  14254. (function(e) {
  14255. "use strict";
  14256. function t(e, t, i, n) {
  14257. this.div = null,
  14258. this.body = null,
  14259. this.label = e,
  14260. this.description = t,
  14261. this.parsedDescription = [],
  14262. this.media = i || {
  14263. type: null
  14264. },
  14265. this.loadingSpinner = null,
  14266. this.parser = new r({
  14267. supportLinks: !c.valueFromHash("mls"),
  14268. keepLinkLabels: !0
  14269. }),
  14270. this.state = g.CLOSED,
  14271. this.orientation = "",
  14272. this.initialTransform = "",
  14273. this.hovering = !1,
  14274. this.openTransition = null,
  14275. this.closeTransition = null,
  14276. this.openPromise = null,
  14277. this.closePromise = null,
  14278. this.animationTransition = null,
  14279. this.animationScale = 0
  14280. }
  14281. var r = m("../Parser/DescriptionParser")
  14282. , i = m("../Media/Link")
  14283. , n = m("../Media/Image")
  14284. , o = m("../Media/EmbedlyPlayer")
  14285. , a = m("../Media/EmbedlyEmbed")
  14286. , s = m("../../util/transitions")
  14287. , l = m("../../util/lerp")
  14288. , c = m("../../util/browser")
  14289. , b = m("./BillboardEvent")
  14290. , w = m("../Media/MediaEvent")
  14291. , h = m("../Parser/DescriptionChunkType")
  14292. , u = m("events").EventEmitter
  14293. , d = m("./billboardSettings")
  14294. , T = m("./overlaySettings")
  14295. , p = new (m("../../util/logger"))(e)
  14296. , f = document.getElementById("tag-billboards");
  14297. f.addEventListener("touchend", function(e) {
  14298. f.style.pointerEvents = "none"
  14299. }),
  14300. f.addEventListener("touchcancel", function(e) {
  14301. f.style.pointerEvents = "none"
  14302. });
  14303. var g = {
  14304. CLOSED: "closed",
  14305. OPENING: "opening",
  14306. OPEN: "open",
  14307. CLOSING: "closing",
  14308. ACTIVE: "active"
  14309. };
  14310. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14311. this.parsedDescription = this.parser.parse(this.description);
  14312. var t = document.createElement("div");
  14313. t.className = "tag-container has-hotzone",
  14314. this.div = t,
  14315. this.body = document.createElement("div"),
  14316. this.body.className = "tag-body";
  14317. var i = document.createElement("div");
  14318. i.classList.add("tag-content");
  14319. var n = document.createElement("div");
  14320. n.classList.add("tag-text-content");
  14321. var r = document.createElement("div");
  14322. r.className = "tag-label",
  14323. r.textContent = this.label,
  14324. n.appendChild(r);
  14325. var o = document.createElement("div");
  14326. o.className = "tag-desc",
  14327. n.appendChild(o),
  14328. i.appendChild(n),
  14329. this.body.appendChild(i),
  14330. this.appendDescriptionElements(this.parsedDescription, o),
  14331. this.appendMedia(),
  14332. t.appendChild(this.body),
  14333. f.appendChild(t),
  14334. this.bindEvents(t, this.body)
  14335. }
  14336. ,
  14337. t.prototype.bindEvents = function(i, e) {
  14338. function t(n) {
  14339. return function(e) {
  14340. if (!this.div.classList.contains("overlay")) {
  14341. var t, i = document.getElementById("player");
  14342. try {
  14343. t = new MouseEvent(n,e)
  14344. } catch (i) {
  14345. (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)
  14346. }
  14347. i.dispatchEvent(t)
  14348. }
  14349. }
  14350. }
  14351. e.addEventListener("mousedown", function(e) {
  14352. e.stopPropagation()
  14353. }),
  14354. e.addEventListener("mouseup", function(e) {
  14355. e.stopPropagation()
  14356. }),
  14357. i.addEventListener("touchstart", function(e) {
  14358. f.style.pointerEvents = "auto"
  14359. }),
  14360. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14361. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14362. e.addEventListener("mouseover", function(e) {
  14363. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14364. }
  14365. .bind(this)),
  14366. i.addEventListener("mouseenter", function(e) {
  14367. this.state !== g.CLOSING && (this.hovering = !0,
  14368. this.emit(b.ENTER))
  14369. }
  14370. .bind(this)),
  14371. i.addEventListener("mouseleave", function(e) {
  14372. this.hovering = !1,
  14373. this.emit(b.LEAVE)
  14374. }
  14375. .bind(this)),
  14376. i.addEventListener("gesturestart", function(e) {
  14377. e.preventDefault()
  14378. });
  14379. var n = i.querySelector(".tag-text-content")
  14380. , r = 0;
  14381. n.addEventListener("touchstart", function(e) {
  14382. r = e.changedTouches[0].clientY
  14383. }),
  14384. n.addEventListener("touchmove", function(t) {
  14385. function e(e) {
  14386. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14387. }
  14388. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14389. }),
  14390. i.addEventListener("touchmove", function(e) {
  14391. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14392. })
  14393. }
  14394. ,
  14395. t.prototype.appendDescriptionElements = function(e, i) {
  14396. 0 < e.length && this.div.classList.add("has-text"),
  14397. e.forEach(function(e, t) {
  14398. switch (e.type) {
  14399. case h.TEXT:
  14400. i.appendChild(this.createTextElement(e.text));
  14401. break;
  14402. case h.LINK:
  14403. i.appendChild(this.createLinkElement(e.link))
  14404. }
  14405. }
  14406. .bind(this))
  14407. }
  14408. ,
  14409. t.prototype.appendLoadingSpinner = function() {
  14410. this.loadingSpinner = document.createElement("div"),
  14411. this.loadingSpinner.classList.add("loading-spinner");
  14412. var e = document.createElement("div");
  14413. e.classList.add("gui-spinner-icon"),
  14414. this.loadingSpinner.appendChild(e),
  14415. this.body.appendChild(this.loadingSpinner)
  14416. }
  14417. ,
  14418. t.prototype.onMediaLoadFinished = function() {
  14419. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14420. this.applyOrientation(this.orientation),
  14421. this.loadingSpinner = null)
  14422. }
  14423. ,
  14424. t.prototype.appendMedia = function() {
  14425. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14426. this.appendLoadingSpinner();
  14427. var e = document.createElement("div");
  14428. e.classList.add("tag-media-content");
  14429. var t = document.createElement("i");
  14430. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14431. t.classList.add(e)
  14432. }),
  14433. this.body.appendChild(t),
  14434. this.body.appendChild(e),
  14435. this.media.type) {
  14436. case h.IMAGE:
  14437. e.appendChild(this.createImageElement(this.media, this.body));
  14438. break;
  14439. case h.VIDEO:
  14440. e.appendChild(this.createVideoElement(this.media, this.body));
  14441. break;
  14442. case h.RICH:
  14443. e.appendChild(this.createEmbedElement(this.media, this.body))
  14444. }
  14445. }
  14446. }
  14447. ,
  14448. t.prototype.createTextElement = function(e) {
  14449. var t = document.createElement("span");
  14450. return t.textContent = e,
  14451. t
  14452. }
  14453. ,
  14454. t.prototype.createLinkElement = function(e) {
  14455. var t = new i(e);
  14456. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14457. t.createDomElement()
  14458. }
  14459. ,
  14460. t.prototype.createImageElement = function(t, C) {
  14461. function e() {
  14462. function e() {
  14463. p || (E.classList.remove("view-image"),
  14464. a.classList.add("overlay"),
  14465. t(),
  14466. window.addEventListener("resize", A),
  14467. a.addEventListener("click", i),
  14468. c.addEventListener("click", r),
  14469. o.addEventListener("click", n),
  14470. p = !0,
  14471. _.emit(w.IMAGE_OPENED))
  14472. }
  14473. function t() {
  14474. C.classList.add("show-info"),
  14475. s.classList.remove("collapsible"),
  14476. s.style.height = "";
  14477. var e = parseFloat(getComputedStyle(v).lineHeight)
  14478. , t = g + e
  14479. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14480. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14481. , r = n
  14482. , o = r * I.aspect;
  14483. i < o && (r = (o = i) / I.aspect),
  14484. n < r && (o = (r = n) * I.aspect),
  14485. o += m,
  14486. r += m + t,
  14487. C.style.width = o + "px",
  14488. C.style.height = r + "px",
  14489. l.style.paddingTop = e + m + "px",
  14490. 0 < _.description.length && (s.classList.add("collapsible"),
  14491. s.style.height = s.clientHeight + 12 + "px",
  14492. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14493. }
  14494. function i(e) {
  14495. e.target === a && n()
  14496. }
  14497. function n() {
  14498. p && (p = !1,
  14499. E.classList.add("view-image"),
  14500. a.classList.remove("overlay"),
  14501. s.style.height = "",
  14502. l.style.paddingTop = "",
  14503. C.style.width = "",
  14504. C.style.height = "",
  14505. window.removeEventListener("resize", A),
  14506. a.removeEventListener("click", i),
  14507. c.removeEventListener("click", r),
  14508. o.removeEventListener("click", n),
  14509. _.emit(w.IMAGE_CLOSED),
  14510. _.close(!0))
  14511. }
  14512. function r(e) {
  14513. C.classList.toggle("show-info")
  14514. }
  14515. var a = _.div
  14516. , s = a.getElementsByClassName("tag-content")[0]
  14517. , l = a.getElementsByClassName("tag-media-content")[0]
  14518. , o = C.getElementsByClassName("close")[0]
  14519. , c = s.getElementsByClassName("tag-label")[0];
  14520. a.classList.add("has-image"),
  14521. E.classList.add("view-image"),
  14522. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14523. _.applyOrientation(_.orientation);
  14524. 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,
  14525. function() {
  14526. clearInterval(h),
  14527. clearTimeout(u),
  14528. h = setInterval(function() {
  14529. var e = a.clientHeight;
  14530. d !== e && (t(),
  14531. d = e)
  14532. }, 100),
  14533. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14534. }
  14535. );
  14536. I.on(w.IMAGE_OPENING, e),
  14537. _.on(b.ACTIVATE, e),
  14538. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14539. _.on(b.CLOSING, n)
  14540. }
  14541. var I = new n
  14542. , E = I.createDomElement();
  14543. this.once(b.OPENED, function() {
  14544. I.load(t.src).then(e).catch(function(e) {
  14545. p.warn("Failed to load image:", t.src),
  14546. p.warn("with error:", e)
  14547. }).then(this.onMediaLoadFinished.bind(this))
  14548. });
  14549. var _ = this;
  14550. return E
  14551. }
  14552. ,
  14553. t.prototype.createVideoElement = function(t, e) {
  14554. var i = new o({
  14555. autoPlay: !0,
  14556. autoResume: !0,
  14557. startMuted: !1,
  14558. loop: !1
  14559. })
  14560. , n = i.createDomElement();
  14561. return this.once(b.OPENED, function() {
  14562. i.load(t.src).then(function() {
  14563. this.div.classList.add("has-video"),
  14564. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14565. i.play()),
  14566. this.on(b.OPENING, i.show.bind(i)),
  14567. this.on(b.OPENED, i.play.bind(i)),
  14568. this.on(b.CLOSING, i.pause.bind(i)),
  14569. this.on(b.CLOSED, i.hide.bind(i))
  14570. }
  14571. .bind(this)).catch(function(e) {
  14572. p.warn("Failed to embed video:", t.src),
  14573. p.warn("with error:", e)
  14574. }).then(this.onMediaLoadFinished.bind(this))
  14575. }
  14576. .bind(this)),
  14577. n
  14578. }
  14579. ,
  14580. t.prototype.createEmbedElement = function(t, e) {
  14581. var i = new a
  14582. , n = i.createDomElement();
  14583. return this.once(b.OPENED, function() {
  14584. i.load(t.src).then(function() {
  14585. this.div.classList.add("has-embed"),
  14586. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14587. this.applyOrientation(this.orientation),
  14588. this.on(b.OPENING, i.show.bind(i)),
  14589. this.on(b.CLOSED, i.hide.bind(i))
  14590. }
  14591. .bind(this)).catch(function(e) {
  14592. p.warn("Failed to embed:", t.src),
  14593. p.warn("with error:", e)
  14594. }).then(this.onMediaLoadFinished.bind(this))
  14595. }
  14596. .bind(this)),
  14597. n
  14598. }
  14599. ,
  14600. t.prototype.open = function(e) {
  14601. return this.openPromise = $.Deferred(),
  14602. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14603. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14604. this.state !== g.OPEN && (this.emit(b.OPENING),
  14605. e && this.emit(b.ACTIVATING),
  14606. this.state = g.OPENING,
  14607. this.animateOpen(function() {
  14608. e && this.setActiveState(),
  14609. this.openPromise.resolve()
  14610. }
  14611. .bind(this)))
  14612. }
  14613. .bind(this), d.animation.openDelay),
  14614. s.cancel(this.closeTransition),
  14615. this.closePromise && this.closePromise.reject(),
  14616. this.closeTransition = void 0,
  14617. this.openPromise.promise())
  14618. }
  14619. ,
  14620. t.prototype.close = function(e) {
  14621. return this.closePromise = $.Deferred(),
  14622. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14623. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14624. this.state = g.CLOSING,
  14625. this.animateClose())
  14626. }
  14627. .bind(this), d.animation.closeDelay)),
  14628. s.cancel(this.openTransition),
  14629. this.openPromise && this.openPromise.reject(),
  14630. this.openTransition = void 0,
  14631. this.closePromise.resolve(),
  14632. this.closePromise.promise())
  14633. }
  14634. ,
  14635. t.prototype.setActiveState = function() {
  14636. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14637. this.emit(b.ACTIVATE),
  14638. this.div.classList.remove("has-hotzone"))
  14639. }
  14640. ,
  14641. t.prototype.animateOpen = function(e) {
  14642. if (this.state === g.OPENING) {
  14643. if (s.cancel(this.animationTransition),
  14644. c.detectSamsungNative())
  14645. return this.boardOrientation = null,
  14646. this.div.style.visibility = "visible",
  14647. this.emit(b.OPENED),
  14648. this.state = g.OPEN,
  14649. void (e && e());
  14650. this.div.style.webkitTransform = "scale(0)",
  14651. this.div.style.transform = "scale(0)",
  14652. this.div.style.visibility = "visible",
  14653. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14654. this.emit(b.OPENED),
  14655. this.state = g.OPEN,
  14656. e && e()
  14657. }
  14658. .bind(this))
  14659. }
  14660. }
  14661. ,
  14662. t.prototype.animateClose = function(e) {
  14663. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14664. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14665. this.emit(b.CLOSED),
  14666. this.state = g.CLOSED,
  14667. this.div.style.visibility = "hidden",
  14668. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14669. e && e()
  14670. }
  14671. .bind(this)))
  14672. }
  14673. ,
  14674. t.prototype.needsUpdate = function() {
  14675. return this.state !== g.CLOSED
  14676. }
  14677. ,
  14678. t.prototype.update = function(e, t) {
  14679. if (this.needsUpdate()) {
  14680. var i = (this.updateOrientation(e),
  14681. this.calcScale(t))
  14682. , n = {
  14683. x: (e.x + 1) * $("#player").width() / 2,
  14684. y: (e.y + 1) * $("#player").height() / 2
  14685. };
  14686. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14687. this.div.style.webkitTransform = this.div.screenTransform,
  14688. this.div.style.transform = this.div.screenTransform
  14689. }
  14690. }
  14691. ,
  14692. t.prototype.getDimensions = function() {
  14693. return this.div.getBoundingClientRect()
  14694. }
  14695. ,
  14696. t.prototype.calcScale = function(e) {
  14697. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14698. }
  14699. ,
  14700. t.prototype.updateOrientation = function(e) {
  14701. if (this.state !== g.ACTIVE) {
  14702. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14703. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14704. , n = "";
  14705. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14706. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14707. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14708. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14709. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14710. }
  14711. }
  14712. ,
  14713. t.prototype.applyOrientation = function(e) {
  14714. this.div.style.transform = this.div.style.webkitTransform = "",
  14715. this.div.classList.remove("tag-container-" + this.orientation),
  14716. this.div.classList.add("tag-container-" + e);
  14717. var t = window.getComputedStyle(this.div);
  14718. this.initialTransform = t.transform || t.webkitTransform,
  14719. "none" === this.initialTransform && (this.initialTransform = "");
  14720. var i = t.transform.slice(7, -1).split(",")
  14721. , n = -i[4]
  14722. , r = -i[5];
  14723. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14724. this.div.style.transformOrigin = n + "px " + r + "px",
  14725. this.orientation = e
  14726. }
  14727. ,
  14728. v.exports = t
  14729. }
  14730. ).call(this, "/js/tag/Billboard/Billboard.js")
  14731. }
  14732. , {
  14733. "../../util/browser": 182,
  14734. "../../util/lerp": 188,
  14735. "../../util/logger": 189,
  14736. "../../util/transitions": 195,
  14737. "../Media/EmbedlyEmbed": 125,
  14738. "../Media/EmbedlyPlayer": 126,
  14739. "../Media/Image": 128,
  14740. "../Media/Link": 129,
  14741. "../Media/MediaEvent": 131,
  14742. "../Parser/DescriptionChunkType": 133,
  14743. "../Parser/DescriptionParser": 134,
  14744. "./BillboardEvent": 120,
  14745. "./billboardSettings": 121,
  14746. "./overlaySettings": 122,
  14747. events: 202
  14748. }],
  14749. 120: [function(e, t, i) {
  14750. "use strict";
  14751. t.exports = Object.freeze({
  14752. ENTER: "billboard.enter",
  14753. LEAVE: "billboard.leave",
  14754. OPENING: "billboard.opening",
  14755. OPENED: "billboard.open",
  14756. CLOSING: "billboard.closing",
  14757. CLOSED: "billboard.closed",
  14758. ACTIVATING: "billboard.activating",
  14759. ACTIVATE: "billboard.activate"
  14760. })
  14761. }
  14762. , {}],
  14763. 121: [function(e, t, i) {
  14764. "use strict";
  14765. t.exports = Object.freeze({
  14766. animation: Object.freeze({
  14767. hoverOnClosing: !1,
  14768. openDelay: 100,
  14769. closeDelay: 50,
  14770. openDuration: 200,
  14771. closeDuration: 100
  14772. }),
  14773. boardToDiscRatio: 1.2
  14774. })
  14775. }
  14776. , {}],
  14777. 122: [function(e, t, i) {
  14778. "use strict";
  14779. t.exports = Object.freeze({
  14780. boundaryWidth: 30,
  14781. boundaryHeight: 0
  14782. })
  14783. }
  14784. , {}],
  14785. hot: [function(e, t, i) {
  14786. "use strict";
  14787. function n(e, t, i) {
  14788. this.sid = e,
  14789. this.position = this.convertValue(t.position, g.Vector3)
  14790. if(t.quaternion){
  14791. this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
  14792. }else{
  14793. this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
  14794. }
  14795. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  14796. this.isSprite = t.isSprite
  14797. this.noAction = t.noAction
  14798. this.linkType = t.linkType || "common"
  14799. this.link = t.link,
  14800. this.model = i,
  14801. this.size = t.size;
  14802. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  14803. this.build()
  14804. t.infoAttribute && t.infoAttribute.title && this.createTitleElem(t.infoAttribute.title)
  14805. this.changeTex()
  14806. this.setVisiblePanos(t.visiblePanos);
  14807. this.infoAttribute = t.infoAttribute;
  14808. }
  14809. var g = e("three")
  14810. , r = e("../shaders")
  14811. , m = e("../settings")
  14812. , v = e("../enum/Viewmode")
  14813. , d = e("../objects/Panorama")
  14814. , o = e("../util/texture")
  14815. , math = e("../util/math")
  14816. , p = new g.Raycaster
  14817. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  14818. var defaultTex1 = o.load(g_HotImage.point);
  14819. var defaultTex2 = o.load(g_HotImage.point2)
  14820. n.prototype.changeTex = function(){
  14821. var u = this.mesh.material.uniforms
  14822. if(this.styleTex.length){
  14823. u.texture1.value = o.load(this.styleTex[0].src);
  14824. u.texture2.value = o.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  14825. }else{
  14826. u.texture1.value = defaultTex1;
  14827. u.texture2.value = defaultTex2;
  14828. }
  14829. }
  14830. n.prototype.initStyleImg = function(t){
  14831. this.styleTex = []
  14832. t.styleImg = t.styleImg || [];
  14833. t.styleImg.forEach((src)=>{
  14834. this.styleTex.push({src:manage.dealURL(src)})
  14835. })
  14836. this.changeTex()
  14837. }
  14838. n.prototype.update = function(camera) {
  14839. if(this.isSprite){
  14840. this.mesh.quaternion.copy(camera.quaternion)
  14841. }
  14842. if(window.hotNeedUpdatePannel == this){
  14843. this.updatePannel()
  14844. }
  14845. }
  14846. n.prototype.setVisiblePanos = function(visibleData){
  14847. if(visibleData == "get"){
  14848. this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
  14849. }else if(visibleData){
  14850. this.visiblePanos = visibleData;
  14851. }
  14852. }
  14853. n.prototype.build = function() {
  14854. var t = g.UniformsUtils.clone(r.hot.uniforms);
  14855. var e = new g.Mesh(a, new g.ShaderMaterial({
  14856. uniforms: t,
  14857. vertexShader: r.hot.vertexShader,
  14858. fragmentShader: r.hot.fragmentShader,
  14859. transparent: !0
  14860. }))
  14861. , t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  14862. e.dynamic = !0,
  14863. e.position.copy(this.position);
  14864. e.quaternion.copy(this.quaternion)
  14865. t && e.scale.set(t, t, t),
  14866. e.name = this.sid,
  14867. e.type = "hotSprite",
  14868. (e.belongHot = this).link && (e.hotLink = this.link),
  14869. this.mesh = e,
  14870. this.model.add(e),
  14871. g_HotMeshes.push(e);
  14872. }
  14873. n.prototype.showPannel = function(){
  14874. var hardware = this.hardwareTemp || this.infoAttribute.hardware //hardwareTemp为编辑时绝对有的,如果是{}代表没有
  14875. if(hardware && hardware.id!=void 0){
  14876. $("#hotPannel>div").css("display","block");
  14877. $("#hotPannel .title").text(hardware.name);
  14878. this.updatePannel()
  14879. window.hotNeedUpdatePannel = this
  14880. return true
  14881. }else{
  14882. $("#hotPannel>div").css("display","");
  14883. }
  14884. }
  14885. n.prototype.updatePannel = function(){
  14886. var pos = math.getPos2d(this.position, player.camera, $("#player")[0]);
  14887. if(pos.trueSide){
  14888. $("#hotPannel>div").css( {display:'block', "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  14889. }else{
  14890. $("#hotPannel>div").css({display:'none'})
  14891. }
  14892. }
  14893. n.prototype.createTitleElem = function(title){
  14894. var root = $("#hot");
  14895. var elem = $(`<div> ${title}</div>`)
  14896. root.append(elem);
  14897. this.titleElem = elem;
  14898. }
  14899. n.prototype.showTitle = function(){
  14900. if(!this.titleElem)return;
  14901. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  14902. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  14903. this.titleElem.css("display","block");
  14904. }
  14905. n.prototype.hideTitle = function(){
  14906. if(!this.titleElem)return;
  14907. this.titleElem.css("display","none");
  14908. }
  14909. ,
  14910. n.prototype.closestPanoTowardTag = function(e, t) {
  14911. var i = []
  14912. , n = []
  14913. , r = this.mesh.position;
  14914. if (e === v.PANORAMA) {
  14915. var o = t.position.clone().sub(r).normalize();
  14916. n.push(d.scoreFunctions.direction(r, o))
  14917. }
  14918. var a = new g.Vector3;
  14919. i.push(function(e) {
  14920. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  14921. }, function(e) {
  14922. a.copy(r).sub(e.position);
  14923. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  14924. , i = m.tags.navigate.tiltTolerance;
  14925. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  14926. },
  14927. (pano)=>{ // add
  14928. player.checkHasNeighbor(pano)
  14929. }
  14930. ),
  14931. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  14932. var s = t.model.panos.sortByScore(i, n);
  14933. if (s && m.tags.navigate.lineOfSight) {
  14934. for (var l = 0; l < s.length; l++) {
  14935. var c = s[l].pano
  14936. , h = c.position.distanceTo(r);
  14937. p.set(c.position, r.clone().sub(c.position).normalize());
  14938. var u = p.intersectObjects(t.model.colliders);
  14939. if (0 === u.length || u[0].distance > h)
  14940. return console.log(l),
  14941. c
  14942. }
  14943. return null
  14944. }
  14945. return s && 0 < s.length && s[0].pano
  14946. }
  14947. var getLink = function(link){
  14948. var src = '';
  14949. var r = link.substring(link.indexOf("html") + 4)
  14950. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  14951. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  14952. return src
  14953. }
  14954. n.prototype.examine = function(e, options) {
  14955. options = options || {}
  14956. var hotPop = document.getElementById('popup');
  14957. var hasHardware
  14958. if(window.MP_PREFETCHED_MODELDATA.flyInOnlyBySwitch){
  14959. hasHardware = this.showPannel();
  14960. if(player.mode != 'panorama' || !player.currentPano)return;
  14961. }else{
  14962. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  14963. var src = getLink(this.infoAttribute.iframe[0]);
  14964. if(this.linkType=="jumpLink"){
  14965. var newPage = window.open(src, "_blank" );
  14966. newPage.focus();
  14967. }else if(this.linkType=="iframeDiv"){
  14968. var div = document.createElement("div");
  14969. $("body").append(div);
  14970. div.style.position = 'fixed';
  14971. div.style.width = div.style.height = "100%";
  14972. div.style.left = div.style.top = '0';
  14973. div.style["z-index"] = "999"
  14974. var exit = document.createElement("div");
  14975. exit.style["background-image"] = "url(images/vrOffImg.png)";
  14976. exit.style.position = 'absolute';
  14977. exit.style.width = exit.style.height = "50px";
  14978. exit.style.left = '17px'; exit.style.top = "20px"
  14979. exit.style.cursor = "pointer";
  14980. exit.style["background-repeat"] = "no-repeat";
  14981. exit.style["background-size"] = "25%";
  14982. exit.style["background-position"] = "center center";
  14983. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  14984. exit.style["border-radius"] = "50%";
  14985. exit.style["z-index"] = "3"
  14986. exit.onclick = ()=>{
  14987. $(div).remove()
  14988. if(g_bgAudio && g_bgAudio.pauseByHot){
  14989. manage.switchBgmState(true)
  14990. }
  14991. }
  14992. var myElement = document.createElement("iframe");
  14993. myElement.style.position = 'absolute';
  14994. myElement.style.width = myElement.style.height = "100%";
  14995. myElement.style.left = myElement.style.top = '0';
  14996. myElement.src = src
  14997. div.appendChild(exit);
  14998. div.appendChild(myElement)
  14999. if(g_bgAudio && !g_bgAudio.paused){
  15000. manage.switchBgmState(false);
  15001. g_bgAudio.pauseByHot = true
  15002. }
  15003. if(g_tourAudio)g_tourAudio.pause()
  15004. }
  15005. return;
  15006. }
  15007. }
  15008. if(!player.currentPano)return;
  15009. var i = document.getElementById("popup");
  15010. if (this.link && !options.dontOpen && !hasHardware) {
  15011. g_currentHot = this,
  15012. i.style.display = "block",
  15013. i.classList.add("wait");
  15014. var n = document.createElement("iframe");
  15015. if(g_bgAudio && !g_bgAudio.paused){
  15016. manage.switchBgmState(false);
  15017. g_bgAudio.pauseByHot = true
  15018. }
  15019. if(g_tourAudio)g_tourAudio.pause()
  15020. var src = getLink(this.link )
  15021. n.src = src;
  15022. n.id = "id1",
  15023. n.allowTransparency = "true";
  15024. var a = document.getElementById("id1");
  15025. if (void 0 === a || null == a) {
  15026. document.querySelector(".popup-content").appendChild(n);
  15027. var s = !1;
  15028. window.loaddingSuccess = function() {
  15029. s = !0
  15030. }
  15031. ,
  15032. setTimeout(function e() {
  15033. if (s) {
  15034. var t = document.querySelector("#id1").contentWindow.document;
  15035. t.querySelector("video") && (t.querySelector("video").play(),
  15036. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  15037. t.querySelector("audio") && t.querySelector("audio").play()
  15038. } else
  15039. setTimeout(e, 300)
  15040. }, 800)
  15041. }
  15042. }
  15043. var l = e.mode
  15044. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  15045. , h = this.mesh.position;
  15046. e.flyingToTag = !0;
  15047. var u = function() {
  15048. e.flyingToTag = !1;
  15049. options.dontOpen || this.link && i.classList.remove("wait")
  15050. }
  15051. .bind(this);
  15052. if (l === v.PANORAMA) {
  15053. var d = {
  15054. pano: c,
  15055. lookAtPoint: h,
  15056. duration: null,
  15057. maxDistanceOverride: null,
  15058. skipWarpingCheck: !1
  15059. };
  15060. e.flyToPano(d, u)
  15061. } else {
  15062. var p = {
  15063. pano: c
  15064. };
  15065. if (h) {
  15066. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  15067. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  15068. }
  15069. p.callback = u,
  15070. p.duration = 1500,
  15071. p.mode = v.PANORAMA,
  15072. e.flyToNewMode(p)
  15073. }
  15074. }
  15075. ,
  15076. n.prototype.dispose = function(){
  15077. this.mesh.parent.remove(this.mesh);
  15078. var index = g_HotMeshes.indexOf(this.mesh);
  15079. g_HotMeshes.splice(index,1)
  15080. }
  15081. /* n.prototype.conversionArray = function(e) {
  15082. if ("[object Array]" == Object.prototype.toString.call(e))
  15083. return e;
  15084. var t = [];
  15085. for (var i in e)
  15086. t.push(parseFloat(e[i]));
  15087. return t
  15088. } */
  15089. n.prototype.convertValue = function(v ,Type){
  15090. var value;
  15091. if(v instanceof Array){
  15092. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15093. value = new Type().fromArray(v);
  15094. }else{
  15095. for(let i in v){v[i] = parseFloat(v[i])}
  15096. value = new Type().copy(v);
  15097. }
  15098. return value
  15099. }
  15100. ,
  15101. t.exports = n
  15102. }
  15103. , {
  15104. three: 217,
  15105. "../shaders": 167,
  15106. "../enum/Viewmode": 51,
  15107. "../objects/Panorama": 148,
  15108. "../util/texture": 194,
  15109. "../settings": 166,
  15110. "../util/math": 190,
  15111. }],
  15112. 123: [function(M, R, e) {
  15113. (function(e) {
  15114. "use strict";
  15115. function d(e, t, i) {
  15116. var n = i.version || "0";
  15117. "0" !== n && w.info("tag defined using version " + n),
  15118. this.model = e,
  15119. this.sid = t,
  15120. this.color = (new f.Color).set(i.color || o.tagDefault),
  15121. this.hoverColor = o._darken(this.color, .2),
  15122. this.floor = null,
  15123. this.floorIndex = i.floor,
  15124. this.mode = m.PANORAMA,
  15125. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15126. this.obj3d = null,
  15127. this.disc = null,
  15128. this.materials = {
  15129. disc: null,
  15130. pole: null
  15131. },
  15132. this.position = (new f.Vector3).copy(i.position),
  15133. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15134. this.discWorldPosition = null,
  15135. this.discScale = .05,
  15136. this.poleEnabled = i.stem.enabled,
  15137. this.billboard = new r(i.label,i.description,i.media,this),
  15138. this.visibleTransition = null,
  15139. this.hoveringDisc = !1
  15140. }
  15141. 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"),
  15142. 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);
  15143. d.prototype = Object.create(b.prototype),
  15144. d.raycaster = new f.Raycaster,
  15145. d.prototype.bindEvents = function() {
  15146. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15147. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15148. }
  15149. ,
  15150. d.prototype.build = function() {
  15151. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15152. this.floor && (this.billboard.build(this.model.sid),
  15153. this.obj3d = this.buildObject3D(),
  15154. this.floor.add(this.obj3d)),
  15155. this
  15156. }
  15157. ,
  15158. d.prototype.buildObject3D = function() {
  15159. var e = new f.Object3D;
  15160. e.position.copy(this.position);
  15161. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15162. t.bg.value = x,
  15163. t.mask.value = T,
  15164. t.color.value.copy(this.color),
  15165. this.materials.disc = new f.RawShaderMaterial({
  15166. transparent: !0,
  15167. vertexShader: A.tagDisc.vertexShader,
  15168. fragmentShader: A.tagDisc.fragmentShader,
  15169. uniforms: t
  15170. }),
  15171. this.disc = new f.Mesh(S,this.materials.disc),
  15172. this.disc.layers.set(a.TAG),
  15173. this.disc.position.copy(this.discPosition),
  15174. this.disc.renderOrder = s.tagDisc;
  15175. var i = (this.disc.tag = this).buildPole();
  15176. return i.layers.set(a.TAG),
  15177. i.renderOrder = s.tagStem,
  15178. e.add(i),
  15179. e.layers.set(a.TAG),
  15180. e.add(this.disc)
  15181. }
  15182. ,
  15183. d.prototype.buildPole = function() {
  15184. var e = new f.BufferGeometry
  15185. , t = new Float32Array(6);
  15186. return t[0] = t[1] = t[2] = 0,
  15187. t[3] = this.discPosition.x,
  15188. t[4] = this.discPosition.y,
  15189. t[5] = this.discPosition.z,
  15190. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15191. this.materials.pole = new f.LineBasicMaterial({
  15192. linewidth: g.tags.pole.width,
  15193. color: g.tags.pole.color,
  15194. opacity: 0,
  15195. visible: this.poleEnabled,
  15196. transparent: !0,
  15197. depthWrite: !1
  15198. }),
  15199. new f.Line(e,this.materials.pole)
  15200. }
  15201. ,
  15202. d.prototype.setFreeState = function(e) {
  15203. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15204. this.materials.disc.uniforms.color.value = this.color
  15205. }
  15206. .bind(this))
  15207. }
  15208. ,
  15209. d.prototype.setHoverState = function(e) {
  15210. this.billboard.open(e),
  15211. this.materials.disc.uniforms.color.value = this.hoverColor
  15212. }
  15213. ,
  15214. d.prototype.hide = function(e, t) {
  15215. var i = $.Deferred();
  15216. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15217. return i.resolve().promise();
  15218. e = e || 0,
  15219. t = t || 0,
  15220. C.cancel(this.visibleTransition);
  15221. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15222. return this.visibleTransition = C.start((n = this,
  15223. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15224. o = I.property(n.materials.pole, "opacity", 0),
  15225. function(e) {
  15226. r(e),
  15227. n.materials.pole && o(e)
  15228. }
  15229. ), s * a, function() {
  15230. i.resolve()
  15231. }, l, E[g.warp.blendEasing]),
  15232. i.promise()
  15233. }
  15234. ,
  15235. d.prototype.show = function(e, t) {
  15236. var i = $.Deferred();
  15237. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15238. return i.resolve().promise();
  15239. e = e || 0,
  15240. t = t || 0,
  15241. C.cancel(this.visibleTransition);
  15242. 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;
  15243. return this.visibleTransition = C.start((n = this,
  15244. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15245. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15246. function(e) {
  15247. r(e),
  15248. n.materials.pole && o(e)
  15249. }
  15250. ), s * a, function() {
  15251. i.resolve()
  15252. }, l, E[g.warp.blendEasing]),
  15253. i.promise()
  15254. }
  15255. ,
  15256. d.prototype.closestPanoTowardTag = function(e, t) {
  15257. var i = []
  15258. , n = []
  15259. , r = this.disc.getWorldPosition();
  15260. if (e === m.PANORAMA) {
  15261. var o = t.position.clone().sub(r).normalize();
  15262. i.push(y.filters.isPanoAligned()),
  15263. i.push(y.filters.inPanoDirection(r, o, .5)),
  15264. i.push(y.filters.isNeighbourPanoTo(t)),
  15265. n.push(y.scoreFunctions.direction(r, o))
  15266. }
  15267. var a = new f.Vector3;
  15268. i.push(function(e) {
  15269. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15270. }, function(e) {
  15271. a.copy(r).sub(e.position);
  15272. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15273. , i = g.tags.navigate.tiltTolerance;
  15274. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15275. }),
  15276. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15277. var s = this.model.panos.sortByScore(i, n);
  15278. if (g.tags.navigate.lineOfSight) {
  15279. for (var l = 0; l < s.length; l++) {
  15280. var c = s[l].pano
  15281. , h = c.position.distanceTo(r);
  15282. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15283. return null;
  15284. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15285. var u = d.raycaster.intersectObjects(this.model.colliders);
  15286. if (0 === u.length || u[0].distance > h)
  15287. return c
  15288. }
  15289. return null
  15290. }
  15291. return 0 < s.length && s[0].pano
  15292. }
  15293. ,
  15294. d.prototype.examine = function(i) {
  15295. if(!player.currentPano)return;
  15296. var e = i.mode
  15297. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15298. , t = this.disc.getWorldPosition();
  15299. this.billboard.setActiveState();
  15300. var r = function() {
  15301. var e = this.billboard.getDimensions()
  15302. , t = new f.Vector3;
  15303. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15304. t.unproject(i.camera),
  15305. i.flyToPano({
  15306. pano: n,
  15307. lookAtPoint: t
  15308. })
  15309. }
  15310. .bind(this);
  15311. if (e === m.PANORAMA)
  15312. if (n !== i.currentPano) {
  15313. var o = {
  15314. pano: n,
  15315. lookAtPoint: t,
  15316. duration: null,
  15317. maxDistanceOverride: null,
  15318. skipWarpingCheck: !1
  15319. };
  15320. i.flyToPano(o, r)
  15321. } else
  15322. setTimeout(function() {
  15323. this.billboard.open().then(function() {
  15324. r()
  15325. })
  15326. }
  15327. .bind(this), 0);
  15328. else {
  15329. var a = {
  15330. pano: n
  15331. };
  15332. if (t) {
  15333. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15334. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15335. }
  15336. a.callback = r,
  15337. a.duration = 1500,
  15338. a.mode = m.PANORAMA,
  15339. i.flyToNewMode(a)
  15340. }
  15341. }
  15342. ,
  15343. d.prototype.update = (n = new f.Vector3,
  15344. function(e, t) {
  15345. this.discWorldPosition = this.disc.getWorldPosition(),
  15346. this.updateDisc(e, t),
  15347. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15348. n.z < 1 && (n.y *= -1,
  15349. this.billboard.update(n, this.getDiscRadius(n, t))))
  15350. }
  15351. ),
  15352. d.prototype.updateDisc = (l = new f.Vector3,
  15353. c = new f.Vector3,
  15354. h = new f.Vector3,
  15355. u = new f.Vector3,
  15356. p = new f.Vector3,
  15357. function(e, t) {
  15358. var i = g.tags.visibility
  15359. , n = g.tags.disc.scale
  15360. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15361. 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)),
  15362. this.obj3d.visible) {
  15363. this.disc.quaternion.copy(t.quaternion);
  15364. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15365. l.copy(this.discWorldPosition).project(t),
  15366. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15367. h.set(o / 2, 0, 0).add(c),
  15368. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15369. p.copy(u).unproject(t);
  15370. var a = p.distanceTo(this.discWorldPosition)
  15371. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15372. this.discScale = a * s,
  15373. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15374. }
  15375. }
  15376. ),
  15377. d.prototype.getDiscRadius = (i = new f.Vector3,
  15378. function(e, t) {
  15379. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15380. Math.abs(e.x - i.x) * $("#player").width()
  15381. }
  15382. ),
  15383. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15384. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15385. }
  15386. ,
  15387. d.prototype.offScreen = function(e, t) {
  15388. var i = e.getWorldPosition().project(t);
  15389. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15390. }
  15391. ,
  15392. d.viewportScale = function() {
  15393. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15394. d.viewportHeight = $("#player").height(),
  15395. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15396. d.currentViewportScale
  15397. }
  15398. ,
  15399. R.exports = d
  15400. }
  15401. ).call(this, "/js/tag/tag.js")
  15402. }
  15403. , {
  15404. "../enum/Colors": 19,
  15405. "../enum/RenderLayers": 41,
  15406. "../enum/RenderOrder": 42,
  15407. "../enum/Viewmode": 51,
  15408. "../objects/Panorama": 148,
  15409. "../settings": 166,
  15410. "../shaders": 167,
  15411. "../util/common": 185,
  15412. "../util/easing": 186,
  15413. "../util/lerp": 188,
  15414. "../util/logger": 189,
  15415. "../util/math": 190,
  15416. "../util/texture": 194,
  15417. "../util/transitions": 195,
  15418. "./Billboard/Billboard": 119,
  15419. "./Billboard/BillboardEvent": 120,
  15420. events: 202,
  15421. three: 217
  15422. }],
  15423. 124: [function(M, R, e) {
  15424. (function(e) {
  15425. "use strict";
  15426. function t() {
  15427. this.tagState = T.IDLE,
  15428. this.intersectTag = null,
  15429. this.hoveredTag = null,
  15430. this.activeTag = null,
  15431. this.tagDiscs = [],
  15432. this.raycaster = new i.Raycaster,
  15433. this.modelManager = null,
  15434. this.player = null,
  15435. this.totaltags = 0,
  15436. this.navigatingViaTag = !1,
  15437. this.enabled = !1
  15438. }
  15439. 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"),
  15440. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15441. r.extend(t, x),
  15442. t.prototype.init = function(e, t) {
  15443. this.modelManager = e,
  15444. this.player = t,
  15445. this.updateModel(),
  15446. this.bindEvents()
  15447. }
  15448. ,
  15449. t.prototype.update = function(e) {
  15450. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15451. }
  15452. ,
  15453. t.prototype.updateTags = function(e, t, i, n) {
  15454. for (var r in this.model.tags)
  15455. this.model.tags[r].update(e, t, i, n)
  15456. }
  15457. ,
  15458. t.prototype.updateModel = function() {
  15459. this.model = this.modelManager.getActiveModel(),
  15460. this.gettagsFromModel(),
  15461. this.totaltags = Object.keys(this.model.tags).length
  15462. }
  15463. ,
  15464. t.prototype.gettagsFromModel = function() {
  15465. for (var e in this.tagDiscs = [],
  15466. this.model.tags) {
  15467. var t = this.model.tags[e].disc;
  15468. t && this.tagDiscs.push(t)
  15469. }
  15470. }
  15471. ,
  15472. t.prototype.bindEvents = function() {
  15473. function e() {
  15474. Object.keys(this.model.tags).forEach(function(e) {
  15475. var t = this.model.tags[e];
  15476. t.bindEvents(),
  15477. t.billboard.on(y.LINK_CLICK, function(e) {
  15478. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15479. }
  15480. .bind(this)),
  15481. t.billboard.on(y.IMAGE_OPENED, function() {
  15482. this.tagState = T.EXAMINE,
  15483. this.emit(y.IMAGE_OPENED)
  15484. }
  15485. .bind(this)),
  15486. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15487. }
  15488. .bind(this))
  15489. }
  15490. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15491. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15492. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15493. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15494. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15495. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15496. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15497. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15498. e.call(this)
  15499. }
  15500. ,
  15501. t.prototype.navigateViaLink = function(e) {
  15502. var t = a.deserialize(e);
  15503. if (t)
  15504. if (t.mode === C.PANORAMA) {
  15505. try {
  15506. this.player.model.panos.get(t.panoId)
  15507. } catch (e) {
  15508. return void S.warn("Unable to find panorama location", t.panoId)
  15509. }
  15510. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15511. } else {
  15512. var i = {
  15513. cameraMode: t.mode,
  15514. position: t.position,
  15515. quaternion: t.quaternion,
  15516. scanId: t.panoId,
  15517. orthoZoom: t.zoom,
  15518. floorVisibility: t.floorVisibility,
  15519. thumbUrl: null,
  15520. name: null
  15521. };
  15522. this.player.flyToNewMode({
  15523. mode: t.mode,
  15524. duration: m.warp.outsideTime,
  15525. warpDest: new g(i),
  15526. force: !0
  15527. })
  15528. }
  15529. }
  15530. ,
  15531. t.prototype.handleWarpStart = function(e, t, i, n) {
  15532. this.dismissExaminedTag(),
  15533. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15534. e && (i = E.END),
  15535. this.hideShowTagsForBlackoutStyle(i, n))
  15536. }
  15537. ,
  15538. t.prototype.handleWarpInterruption = function(e, t, i) {
  15539. null != i || (i = m.warp.teleportTime),
  15540. this.hideShowTagsForBlackoutStyle(t, i)
  15541. }
  15542. ,
  15543. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15544. var i = 0
  15545. , n = 0
  15546. , r = t / 2;
  15547. switch (null != e || (e = E.MIDDLE),
  15548. e) {
  15549. case E.END:
  15550. this.hideAlltags(r);
  15551. break;
  15552. case E.BEGINNING:
  15553. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15554. break;
  15555. case E.NONE:
  15556. break;
  15557. case E.MIDDLE:
  15558. n = i = r,
  15559. this.hideAlltags(n),
  15560. setTimeout(function() {
  15561. this.showAlltags(i)
  15562. }
  15563. .bind(this), n);
  15564. break;
  15565. case E.FADEIN:
  15566. setTimeout(function() {
  15567. this.showAlltags(r)
  15568. }
  15569. .bind(this), r)
  15570. }
  15571. }
  15572. ,
  15573. t.prototype.onPlayerModeChanging = function(e, t) {
  15574. t !== C.PANORAMA && this.dismissExaminedTag(),
  15575. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15576. var i = t !== C.OUTDOOR;
  15577. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15578. }
  15579. ,
  15580. t.prototype.onPanoChange = function(e, t) {
  15581. var i = this.navigatingViaTag;
  15582. if (this.navigatingViaTag = !1,
  15583. !i) {
  15584. this.dismissExaminedTag();
  15585. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15586. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15587. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15588. }
  15589. }
  15590. ,
  15591. t.prototype.onPlayerReady = function(e, t, i) {
  15592. this.startAlltags(e, t ? i : null)
  15593. }
  15594. ,
  15595. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15596. this.updateClosestTags(e)
  15597. }
  15598. ,
  15599. t.prototype.dismissExaminedTag = function() {
  15600. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15601. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15602. this.hoveredTag = null)
  15603. }
  15604. ,
  15605. t.prototype.startAlltags = function(e, t) {
  15606. this.model.shouldShowtags = m.tags.enabled,
  15607. this.enabled = !0,
  15608. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15609. t && setTimeout(function() {
  15610. this.activateTag(this.model.getTagBySid(t))
  15611. }
  15612. .bind(this), m.tags.startup.fadeInDuration / 2))
  15613. }
  15614. ,
  15615. t.prototype.showAlltags = function(e, t, i) {
  15616. function n() {
  15617. ++o === this.totaltags && (this.model.tagsShown = !0,
  15618. r.resolve())
  15619. }
  15620. var r = $.Deferred();
  15621. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15622. return r.resolve().promise();
  15623. var o = 0;
  15624. for (var a in this.model.tags) {
  15625. this.model.tags[a].show(e, t).done(n.bind(this))
  15626. }
  15627. return r.promise()
  15628. }
  15629. ,
  15630. t.prototype.hideAlltags = function(e, t) {
  15631. function i() {
  15632. ++r === this.totaltags && (this.model.tagsShown = !1,
  15633. n.resolve())
  15634. }
  15635. var n = $.Deferred()
  15636. , r = 0;
  15637. for (var o in this.model.tags) {
  15638. var a = this.model.tags[o];
  15639. a.hide(e, t).done(i.bind(this)),
  15640. a === this.activeTag && this.dismissActiveTag()
  15641. }
  15642. return n.promise()
  15643. }
  15644. ,
  15645. t.prototype.enableHovering = function() {
  15646. this.enabled = !0
  15647. }
  15648. ,
  15649. t.prototype.disableHovering = function() {
  15650. this.enabled = !1
  15651. }
  15652. ,
  15653. t.prototype.activateTag = function(e, t) {
  15654. t = t || T.EXAMINE,
  15655. this.activeTag = e,
  15656. this.activeTag.hoveringDisc = !0,
  15657. this.activeTag.setHoverState(t === T.EXAMINE),
  15658. this.tagState = t,
  15659. this.emit(b.TagActivated, e)
  15660. }
  15661. ,
  15662. t.prototype.dismissActiveTag = function() {
  15663. this.activeTag.hoveringDisc = !1,
  15664. this.activeTag.setFreeState(!0);
  15665. var e = this.activeTag;
  15666. this.activeTag = null,
  15667. this.tagState = T.IDLE,
  15668. this.emit(b.TagDismissed, e)
  15669. }
  15670. ,
  15671. t.prototype.clickedOnTag = function(e) {
  15672. var t = function() {
  15673. this.navigatingViaTag = !0,
  15674. this.activeTag.examine(this.player),
  15675. this.emit(b.TagNavigation, this.activeTag)
  15676. }
  15677. .bind(this);
  15678. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15679. this.activeTag = this.intersectTag,
  15680. t(),
  15681. !0) : (this.dismissActiveTag(),
  15682. !1)
  15683. }
  15684. ,
  15685. t.prototype.intersecttag = (s = new i.Vector3,
  15686. l = new i.Vector3,
  15687. c = new i.Vector3,
  15688. function(e, t, i) {
  15689. if (!this.enabled)
  15690. return null;
  15691. var n = null
  15692. , r = this.tagDiscs.filter(function(e) {
  15693. return e.parent.visible
  15694. });
  15695. if (0 < r.length) {
  15696. var o = this.model.floors.reduce(function(e, t) {
  15697. return t.hidden ? e : e.concat(t.collider.children)
  15698. }, r);
  15699. s.set(e.x, e.y, -1).unproject(i),
  15700. l.set(e.x, e.y, 1).unproject(i),
  15701. c.copy(l).sub(s).normalize(),
  15702. this.raycaster.set(s, c);
  15703. var a = this.raycaster.intersectObjects(o);
  15704. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15705. }
  15706. return this.intersectTag = n,
  15707. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15708. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15709. this.hoveredTag = n
  15710. }
  15711. .bind(this)),
  15712. n.billboard.on(v.LEAVE, function() {
  15713. this.hoveredTag = null
  15714. }
  15715. .bind(this))),
  15716. this.activateTag(n, T.BROWSE))),
  15717. n
  15718. }
  15719. ),
  15720. t.prototype.rankedtagInDirection = (h = [],
  15721. u = [],
  15722. d = new i.Vector3,
  15723. p = new i.Vector3,
  15724. f = new i.Vector3,
  15725. function(e, t, i, n) {
  15726. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15727. var a = this.closesttags[o];
  15728. p.copy(a.position),
  15729. p.add(a.discPosition),
  15730. d.copy(t),
  15731. d.sub(p).negate(),
  15732. d.normalize();
  15733. var s = d.dot(n);
  15734. if (0 <= s && (f.copy(p),
  15735. f.project(i),
  15736. this.intersecttag(f, !1, i))) {
  15737. if (r >= h.length)
  15738. for (var l = 0; l < 64; l++)
  15739. h.push({
  15740. tag: a,
  15741. dot: s
  15742. });
  15743. var c = h[r];
  15744. c.tag = a,
  15745. c.dot = s,
  15746. c.position = math.projectPositionToCanvas(p, i),
  15747. u.push(c),
  15748. r++
  15749. }
  15750. }
  15751. return u.sort(function(e, t) {
  15752. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15753. }),
  15754. e < u.length ? u[e].tag : null
  15755. }
  15756. ),
  15757. t.prototype.updateClosestTags = (o = new i.Vector3,
  15758. function(e) {
  15759. this.closesttags || (this.closesttags = []),
  15760. this.closesttags.length = 0;
  15761. var t = this.model.tags;
  15762. if (t)
  15763. for (var i in t)
  15764. if (t.hasOwnProperty(i)) {
  15765. var n = t[i]
  15766. , r = n.position;
  15767. o.copy(e),
  15768. o.sub(r).negate(),
  15769. o.lengthSq() < 30 && this.closesttags.push(n)
  15770. }
  15771. }
  15772. ),
  15773. R.exports = t
  15774. }
  15775. ).call(this, "/js/tag/tagManager.js")
  15776. }
  15777. , {
  15778. "../controls/serializer": 14,
  15779. "../enum/BlackoutStyle": 18,
  15780. "../enum/tagEvents": 32,
  15781. "../enum/ModelManagerEvents": 33,
  15782. "../enum/PlayerEvents": 40,
  15783. "../enum/TagStates": 44,
  15784. "../enum/Viewmode": 51,
  15785. "../enum/WarpStyle": 52,
  15786. "../objects/Snapshot": 153,
  15787. "../settings": 166,
  15788. "../util/common": 185,
  15789. "../util/lerp": 188,
  15790. "../util/logger": 189,
  15791. "./Billboard/BillboardEvent": 120,
  15792. "./Media/LinkType": 130,
  15793. "./Media/MediaEvent": 131,
  15794. events: 202,
  15795. three: 217
  15796. }],
  15797. 125: [function(r, o, e) {
  15798. (function(e) {
  15799. "use strict";
  15800. function t() {
  15801. this.embedWrapper = null,
  15802. this.embedElement = null
  15803. }
  15804. var i = r("../../util/ajax")
  15805. , a = r("./mediaSettings")
  15806. , n = r("../../settings")
  15807. , s = new (r("../../util/logger"))(e);
  15808. t.prototype.createDomElement = function() {
  15809. return this.embedWrapper = document.createElement("div"),
  15810. this.embedWrapper.classList.add("tag-embed"),
  15811. this.embedWrapper.classList.add("hidden"),
  15812. this.embedWrapper
  15813. }
  15814. ,
  15815. t.prototype.load = function(e) {
  15816. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15817. return new Promise(function(r, o) {
  15818. i.get(t).then(function(e) {
  15819. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15820. this.embedWrapper.innerHTML = e.html;
  15821. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15822. if (this.embedWrapper.style.width = t + "px",
  15823. e.height) {
  15824. var i = e.height / e.width;
  15825. this.embedWrapper.style.height = t * i + "px"
  15826. }
  15827. this.embedElement = this.embedWrapper.firstChild;
  15828. var n = [];
  15829. try {
  15830. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15831. } catch (e) {
  15832. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15833. }
  15834. n.forEach(function(e) {
  15835. e.setAttribute("target", "_blank")
  15836. }),
  15837. this.embedElement.classList.add("hidden"),
  15838. this.embedWrapper.classList.remove("hidden"),
  15839. r()
  15840. } else
  15841. o("Not a valid embed")
  15842. }
  15843. .bind(this), function(e) {
  15844. o(e.response)
  15845. })
  15846. }
  15847. .bind(this))
  15848. }
  15849. ,
  15850. t.prototype.show = function() {
  15851. this.embedElement && this.embedElement.classList.remove("hidden")
  15852. }
  15853. ,
  15854. t.prototype.hide = function() {
  15855. this.embedElement && this.embedElement.classList.add("hidden")
  15856. }
  15857. ,
  15858. o.exports = t
  15859. }
  15860. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15861. }
  15862. , {
  15863. "../../settings": 166,
  15864. "../../util/ajax": 181,
  15865. "../../util/logger": 189,
  15866. "./mediaSettings": 132
  15867. }],
  15868. 126: [function(a, s, e) {
  15869. (function(e) {
  15870. "use strict";
  15871. function t(e) {
  15872. r.call(this),
  15873. this.options = e,
  15874. this.playerControls = null,
  15875. this.state = o.NOT_READY
  15876. }
  15877. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15878. Object.freeze({
  15879. NOT_READY: "player.not.ready",
  15880. CUED: "player.cued",
  15881. PLAYING: "player.playing",
  15882. PAUSED: "player.paused"
  15883. }));
  15884. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15885. return this.embedWrapper = document.createElement("div"),
  15886. this.embedWrapper.classList.add("tag-video"),
  15887. this.embedWrapper.classList.add("hidden"),
  15888. this.embedWrapper
  15889. }
  15890. ,
  15891. t.prototype.load = function(e) {
  15892. var t = function() {
  15893. function e(e) {
  15894. this.playerState = e
  15895. }
  15896. this.playerControls = new playerjs.Player(this.embedElement),
  15897. this.playerControls.on("ready", function(e) {
  15898. this.playerState = o.CUED,
  15899. this.options.startMuted && this.playerControls.mute()
  15900. }
  15901. .bind(this)),
  15902. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15903. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15904. this.playerControls.on("ended", function(e) {
  15905. this.playerControls.setCurrentTime(0),
  15906. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15907. }
  15908. .bind(this))
  15909. }
  15910. .bind(this);
  15911. return r.prototype.load.call(this, e).then(t.bind(this))
  15912. }
  15913. ,
  15914. t.prototype.play = (i = n.isMobile(),
  15915. function() {
  15916. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15917. }
  15918. ),
  15919. t.prototype.pause = function() {
  15920. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15921. }
  15922. ,
  15923. s.exports = t
  15924. }
  15925. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15926. }
  15927. , {
  15928. "../../util/browser": 182,
  15929. "../../util/logger": 189,
  15930. "./EmbedlyEmbed": 125
  15931. }],
  15932. 127: [function(t, i, e) {
  15933. (function(e) {
  15934. "use strict";
  15935. var r = t("../../util/ajax")
  15936. , o = new (t("./mediaSettings"),
  15937. t("../../util/logger"))(e)
  15938. , a = Promise.resolve();
  15939. i.exports.enqueue = function(i) {
  15940. function n() {}
  15941. return a = new Promise(function(e, t) {
  15942. a.catch(n).then(function() {
  15943. (o.debug("requesting file from embedly:", i.href),
  15944. r.get(i.href, {
  15945. responseType: i.responseType
  15946. }).then(function(e) {
  15947. return o.debug("requesting file finished:", i.href),
  15948. e
  15949. })).then(e, t)
  15950. })
  15951. }
  15952. )
  15953. }
  15954. }
  15955. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15956. }
  15957. , {
  15958. "../../util/ajax": 181,
  15959. "../../util/logger": 189,
  15960. "./mediaSettings": 132
  15961. }],
  15962. 128: [function(s, l, e) {
  15963. (function(e) {
  15964. "use strict";
  15965. function t() {
  15966. this.imageWrapper = null,
  15967. this.width = 0,
  15968. this.height = 0,
  15969. this.aspect = 1
  15970. }
  15971. var i = s("./MediaEvent")
  15972. , n = s("./EmbedlyQueue")
  15973. , r = s("events").EventEmitter
  15974. , o = s("../../util/logger")
  15975. , a = s("../../settings");
  15976. new o(e),
  15977. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15978. return this.imageWrapper = document.createElement("div"),
  15979. this.imageWrapper.classList.add("tag-image"),
  15980. this.imageWrapper.classList.add("hidden"),
  15981. this.imageWrapper.addEventListener("click", function(e) {
  15982. e.stopPropagation(),
  15983. this.emit(i.IMAGE_OPENING),
  15984. this.imageWrapper.style.pointerEvents = "none"
  15985. }
  15986. .bind(this)),
  15987. this.imageWrapper
  15988. }
  15989. ,
  15990. t.prototype.onClosed = function() {
  15991. this.imageWrapper.style.pointerEvents = "auto"
  15992. }
  15993. ,
  15994. t.prototype.load = function(e) {
  15995. var t = Math.max(window.screen.height, window.screen.width)
  15996. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15997. return new Promise(function(o, e) {
  15998. n.enqueue({
  15999. href: i,
  16000. responseType: "arraybuffer"
  16001. }).then(function(e) {
  16002. var t = new Uint8Array(e)
  16003. , i = new Blob([t])
  16004. , n = new window.Image;
  16005. n.addEventListener("load", function(e) {
  16006. var t = e.target;
  16007. this.width = t.naturalWidth,
  16008. this.height = t.naturalHeight,
  16009. this.aspect = this.width / this.height;
  16010. var i = e.target.src;
  16011. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  16012. this.imageWrapper.style.width = this.width + "px",
  16013. this.imageWrapper.style.height = this.height + "px",
  16014. this.imageWrapper.classList.remove("hidden"),
  16015. o()
  16016. }
  16017. .bind(this));
  16018. var r = URL.createObjectURL(i);
  16019. n.src = r
  16020. }
  16021. .bind(this), e)
  16022. }
  16023. .bind(this))
  16024. }
  16025. ,
  16026. l.exports = t
  16027. }
  16028. ).call(this, "/js/tag/Media/Image.js")
  16029. }
  16030. , {
  16031. "../../settings": 166,
  16032. "../../util/logger": 189,
  16033. "./EmbedlyQueue": 127,
  16034. "./MediaEvent": 131,
  16035. events: 202
  16036. }],
  16037. 129: [function(e, t, i) {
  16038. "use strict";
  16039. function n(e) {
  16040. this.label = e.label,
  16041. this.href = e.url,
  16042. this.type = this.updateLinkForType(),
  16043. this.domElement = null,
  16044. this.id = c++
  16045. }
  16046. var r = e("./LinkType")
  16047. , o = e("./MediaEvent")
  16048. , a = e("../../util/browser")
  16049. , s = e("../../analytics")
  16050. , l = e("events").EventEmitter
  16051. , c = 0;
  16052. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16053. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16054. 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,
  16055. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16056. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16057. r.MODEL) : r.EXT_LINK
  16058. }
  16059. ;
  16060. var h = {};
  16061. n.prototype.createDomElement = function() {
  16062. if (this.domElement = document.createElement("a"),
  16063. this.domElement.classList.add("tag-link"),
  16064. this.domElement.textContent = this.label,
  16065. this.type === r.EXT_LINK) {
  16066. this.domElement.textContent += " ";
  16067. var e = document.createElement("i");
  16068. e.classList.add("icon-ext-link"),
  16069. e.title = "Link to external web site",
  16070. this.domElement.appendChild(e)
  16071. }
  16072. return this.domElement.addEventListener("click", function(e) {
  16073. switch (e.stopPropagation(),
  16074. h[this.id] = !0,
  16075. s.trackAlways("click_tag_link", {
  16076. link_type: this.type,
  16077. link_count: c,
  16078. links_clicked: Object.keys(h).length
  16079. }),
  16080. this.type) {
  16081. case r.MODEL:
  16082. window.location.replace(this.href);
  16083. break;
  16084. case r.EXT_LINK:
  16085. window.open(this.href, "_blank")
  16086. }
  16087. this.emit(o.LINK_CLICK, {
  16088. type: this.type,
  16089. url: this.href
  16090. })
  16091. }
  16092. .bind(this)),
  16093. this.domElement
  16094. }
  16095. ,
  16096. t.exports = n
  16097. }
  16098. , {
  16099. "../../analytics": 4,
  16100. "../../util/browser": 182,
  16101. "./LinkType": 130,
  16102. "./MediaEvent": 131,
  16103. events: 202
  16104. }],
  16105. 130: [function(e, t, i) {
  16106. "use strict";
  16107. t.exports = {
  16108. NAVIGATION: "navigation",
  16109. MODEL: "model",
  16110. EXT_LINK: "ext-link"
  16111. }
  16112. }
  16113. , {}],
  16114. 131: [function(e, t, i) {
  16115. "use strict";
  16116. t.exports = Object.freeze({
  16117. LINK_CLICK: "mtmedia.link",
  16118. IMAGE_LOADED: "mtmedia.image.loaded",
  16119. IMAGE_OPENING: "mtmedia.image.opening",
  16120. IMAGE_OPENED: "mtmedia.image.opened",
  16121. IMAGE_CLOSING: "mtmedia.image.closing",
  16122. IMAGE_CLOSED: "mtmedia.image.closed",
  16123. VIDEO_START: "mtmedia.video.start",
  16124. VIDEO_PAUSE: "mtmedia.video.pause",
  16125. VIDEO_ENDED: "mtmedia.video.end"
  16126. })
  16127. }
  16128. , {}],
  16129. 132: [function(e, t, i) {
  16130. "use strict";
  16131. t.exports = Object.freeze({
  16132. maxEmbedWidth: 350,
  16133. defaultAspectRatio: .75
  16134. })
  16135. }
  16136. , {}],
  16137. 133: [function(e, t, i) {
  16138. "use strict";
  16139. t.exports = Object.freeze({
  16140. TEXT: "text",
  16141. LINK: "link",
  16142. IMAGE: "photo",
  16143. VIDEO: "video",
  16144. RICH: "rich"
  16145. })
  16146. }
  16147. , {}],
  16148. 134: [function(e, t, i) {
  16149. "use strict";
  16150. function n(e) {
  16151. this.capabilities = {
  16152. links: {
  16153. enable: e.supportLinks,
  16154. keepLabels: e.keepLinkLabels
  16155. }
  16156. }
  16157. }
  16158. var r = e("./DescriptionChunkType");
  16159. n.prototype.parse = function(e, i) {
  16160. var n = [];
  16161. return e.split("[").map(function(e, t) {
  16162. return 0 === t ? e : "[" + e
  16163. }).forEach(function(e) {
  16164. var t = this.findMarkdown(e);
  16165. if (t) {
  16166. if (-1 !== t.url.indexOf("javascript:"))
  16167. return;
  16168. this.addLinkChunk(n, t, i),
  16169. this.addTextChunk(n, e.slice(t.markdown.length))
  16170. } else
  16171. this.addTextChunk(n, e)
  16172. }
  16173. .bind(this)),
  16174. n
  16175. }
  16176. ,
  16177. n.prototype.findMarkdown = function(e) {
  16178. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16179. if (t) {
  16180. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16181. 0 !== n); )
  16182. r++;
  16183. var o = i.length - r;
  16184. return {
  16185. markdown: t[0].substring(0, t[0].length - o),
  16186. label: t[1],
  16187. url: t[2].substring(0, r)
  16188. }
  16189. }
  16190. }
  16191. ,
  16192. n.prototype.addTextChunk = function(e, t) {
  16193. 0 !== t.length && e.push({
  16194. type: r.TEXT,
  16195. text: t
  16196. })
  16197. }
  16198. ,
  16199. n.prototype.addLinkChunk = function(e, t) {
  16200. if (this.capabilities.links.enable) {
  16201. var i = {
  16202. label: t.label,
  16203. url: t.url
  16204. };
  16205. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16206. e.push({
  16207. type: r.LINK,
  16208. link: i
  16209. })
  16210. } else
  16211. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16212. }
  16213. ,
  16214. t.exports = n
  16215. }
  16216. , {
  16217. "./DescriptionChunkType": 133
  16218. }],
  16219. 135: [function(t, r, e) {
  16220. (function(e) {
  16221. "use strict";
  16222. var i = new (t("../util/logger"))(e)
  16223. , n = {
  16224. parseIdsFromChunkName: function(e, t) {
  16225. t.floorId = n.parseFloor(e),
  16226. t.roomId = n.parseRoom(e)
  16227. },
  16228. parseFloor: function(e) {
  16229. var t = e.match(/_group([0-9]+)/);
  16230. if (!t)
  16231. return 0;
  16232. try {
  16233. return parseInt(t[1], 10)
  16234. } catch (e) {
  16235. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16236. 0
  16237. }
  16238. },
  16239. parseRoom: function(e) {
  16240. var t = e.match(/_sub([0-9]+)/);
  16241. if (!t)
  16242. return -1;
  16243. try {
  16244. return parseInt(t[1], 10)
  16245. } catch (e) {
  16246. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16247. 0
  16248. }
  16249. }
  16250. };
  16251. r.exports = n
  16252. }
  16253. ).call(this, "/js/model/Chunks.js")
  16254. }
  16255. , {
  16256. "../util/logger": 189
  16257. }],
  16258. 136: [function(a, c, e) {
  16259. (function(e) {
  16260. "use strict";
  16261. function t(e) {
  16262. r.call(this),
  16263. this.model = e,
  16264. this.exploded = !1
  16265. }
  16266. var i = a("../objects/Floor")
  16267. , n = (a("../settings"),
  16268. a("../util/logger"))
  16269. , s = a("../util/transitions")
  16270. , r = a("../util/IndexedCollection")
  16271. , o = a("../util/common")
  16272. , l = a("../util/easing");
  16273. new n(e),
  16274. o.inherit(t, r),
  16275. t.prototype.add = function(e) {
  16276. r.prototype.add.call(this, e),
  16277. this.model.add(e)
  16278. }
  16279. ,
  16280. t.prototype.getIndex = function(e) {
  16281. return e.floorIndex
  16282. }
  16283. ,
  16284. t.prototype.build = function() {
  16285. this.list.forEach(function(e) {
  16286. e.build()
  16287. })
  16288. }
  16289. ,
  16290. t.prototype.size = function() {
  16291. return this.length
  16292. }
  16293. ,
  16294. t.prototype.sort = function() {
  16295. r.prototype.sort.call(this, function(e, t) {
  16296. return e.floorIndex - t.floorIndex
  16297. })
  16298. }
  16299. ,
  16300. t.prototype.nextFloor = function(e, t) {
  16301. return this.index[e.floorIndex + t] || null
  16302. }
  16303. ,
  16304. t.prototype.getFloorAtPoint = function(e) {
  16305. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16306. var r = this.list[n]
  16307. , o = r.distanceToPoint(e);
  16308. (!t || o < i) && (i = o,
  16309. t = r)
  16310. }
  16311. return t
  16312. }
  16313. ,
  16314. t.prototype.getOrMakeFloor = function(e) {
  16315. var t = this.index[e];
  16316. return t || (t = new i(this.model,e),
  16317. this.add(t)),
  16318. t
  16319. }
  16320. ,
  16321. t.prototype.hide = function() {
  16322. this.list.forEach(function(e) {
  16323. e.hide()
  16324. })
  16325. }
  16326. ,
  16327. t.prototype.show = function() {
  16328. this.list.forEach(function(e) {
  16329. e.show()
  16330. })
  16331. }
  16332. ,
  16333. t.prototype.names = function() {
  16334. return this.list.reduce(function(e, t) {
  16335. return e.concat(t.name)
  16336. }, [])
  16337. }
  16338. ,
  16339. t.prototype.toggleExplodeHorizontal = function() {
  16340. function i(e, t) {
  16341. a.copy(e.position),
  16342. e.position.x = r[e.floorIndex] * t,
  16343. e.position.y = 1 * e.floorIndex * t,
  16344. a.sub(e.position).multiplyScalar(-1),
  16345. e.panos.forEach(function(e) {
  16346. e.translate(a)
  16347. })
  16348. }
  16349. var n, r = [], o = 0;
  16350. this.list.forEach(function(e, t, i) {
  16351. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16352. o += n,
  16353. r[t] = o
  16354. }),
  16355. r = r.map(function(e) {
  16356. return e - o / 2
  16357. });
  16358. var a = this.list[0].position.clone();
  16359. this.exploded ? this.list.forEach(function(t) {
  16360. s.start(function(e) {
  16361. i(t, 1 - e)
  16362. }, 1500, null, 0, l.easeOutExpo)
  16363. }) : this.list.forEach(function(t) {
  16364. s.start(function(e) {
  16365. i(t, e)
  16366. }, 1500, null, 0, l.easeOutExpo)
  16367. }),
  16368. this.exploded = !this.exploded
  16369. }
  16370. ,
  16371. t.prototype.toggleExplodeVertical = function() {
  16372. function i(e, t) {
  16373. var i = i.copy(e.position);
  16374. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16375. i.sub(e.position).multiplyScalar(-1),
  16376. e.panos.forEach(function(e) {
  16377. e.translate(i)
  16378. })
  16379. }
  16380. var n = this.model.size;
  16381. this.list[0].position.clone(),
  16382. this.exploded ? this.list.forEach(function(t) {
  16383. s.start(function(e) {
  16384. i(t, 1 - e)
  16385. }, 1500, null, 0, l.easeOutExpo)
  16386. }) : this.list.forEach(function(t) {
  16387. s.start(function(e) {
  16388. i(t, e)
  16389. }, 1500, null, 0, l.easeOutExpo)
  16390. }),
  16391. this.exploded = !this.exploded
  16392. }
  16393. ,
  16394. c.exports = t
  16395. }
  16396. ).call(this, "/js/model/FloorCollection.js")
  16397. }
  16398. , {
  16399. "../objects/Floor": 146,
  16400. "../settings": 166,
  16401. "../util/IndexedCollection": 175,
  16402. "../util/common": 185,
  16403. "../util/easing": 186,
  16404. "../util/logger": 189,
  16405. "../util/transitions": 195
  16406. }],
  16407. 137: [function(r, o, e) {
  16408. (function(e) {
  16409. "use strict";
  16410. function h() {
  16411. n.call(this)
  16412. }
  16413. var u = r("../settings")
  16414. , t = r("../util/logger")
  16415. , d = r("../enum/Viewmode")
  16416. , p = r("../objects/Snapshot")
  16417. , i = (r("../util/math"),
  16418. r("../util/common"))
  16419. , n = r("../util/IndexedCollection")
  16420. , l = new t(e);
  16421. i.inherit(h, n),
  16422. h.prototype.getImage = function(e) {
  16423. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16424. }
  16425. ,
  16426. h.prototype.filterByModesAndReel = function(e, t) {
  16427. for (var i = [], n = 0; n < t.length; n += 1) {
  16428. var r = t[n]
  16429. , o = this.index[r.sid];
  16430. o && i.push(o)
  16431. }
  16432. var a = e[d.DOLLHOUSE]
  16433. , s = e[d.FLOORPLAN];
  16434. (i = i.filter(function(e) {
  16435. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16436. return !0;
  16437. var t;
  16438. try {
  16439. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16440. } catch (e) {
  16441. return l.debug(e.message),
  16442. !1
  16443. }
  16444. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16445. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16446. this.list = i,
  16447. this.reIndex()
  16448. }
  16449. ,
  16450. h.prototype.getHeroLocations = function(e) {
  16451. if (0 === this.list.length)
  16452. return [];
  16453. for (var t = [], i = 0; i < this.list.length; ++i) {
  16454. var n = this.list[i]
  16455. , r = n.thumbnail_signed_src
  16456. , o = n.name || "";
  16457. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16458. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16459. var a = e.get(n.metadata.scan_id);
  16460. if (a && !a.isAligned())
  16461. continue
  16462. }
  16463. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16464. if (s === d.MESH)
  16465. continue;
  16466. if(window.isLocal)var src = manage.dealURL(r)
  16467. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16468. var l = {
  16469. cameraMode: s,
  16470. position: n.metadata.camera_position,
  16471. quaternion: n.metadata.camera_quaternion,
  16472. zoom: n.metadata.zoom,
  16473. panoId: n.metadata.scan_id,
  16474. orthoZoom: n.metadata.ortho_zoom,
  16475. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16476. thumbUrl: src,
  16477. name: h.filterImageName(o),
  16478. sid: n.sid
  16479. }
  16480. , c = new p(l);
  16481. t.push(c)
  16482. }
  16483. }
  16484. return t
  16485. }
  16486. ,
  16487. h.prototype.getIndex = function(e) {
  16488. return e.sid
  16489. }
  16490. ,
  16491. h.filterImageName = function(e) {
  16492. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16493. }
  16494. ,
  16495. o.exports = h
  16496. }
  16497. ).call(this, "/js/model/ImageCollection.js")
  16498. }
  16499. , {
  16500. "../enum/Viewmode": 51,
  16501. "../objects/Snapshot": 153,
  16502. "../settings": 166,
  16503. "../util/IndexedCollection": 175,
  16504. "../util/common": 185,
  16505. "../util/logger": 189,
  16506. "../util/math": 190
  16507. }],
  16508. 138: [function(h, u, e) {
  16509. (function(e) {
  16510. "use strict";
  16511. function n() {
  16512. c.call(this)
  16513. }
  16514. var r = h("../label/Label")
  16515. , i = h("../settings")
  16516. , t = h("../util/logger")
  16517. , o = h("../util/math")
  16518. , a = h("../util/ajax")
  16519. , s = h("./RoomCollection")
  16520. , l = h("../util/common")
  16521. , c = h("../util/IndexedCollection");
  16522. new t(e),
  16523. l.inherit(n, c),
  16524. n.prototype.getIndex = function(e) {
  16525. return e.labelId
  16526. }
  16527. ,
  16528. n.prototype.associateWithRooms = function(e) {
  16529. this.forEach(function(t) {
  16530. e.forEach(function(e) {
  16531. e.roomId === t.roomId && (t.room = e)
  16532. })
  16533. })
  16534. }
  16535. ,
  16536. n.prototype.createFromLabelData = function(e) {
  16537. e.forEach(function(e) {
  16538. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16539. t = s.generateRoomId(e.floorId, t);
  16540. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16541. i.position = o.convertWorkshopVector(i.position),
  16542. this.add(i),
  16543. i.build()
  16544. }
  16545. .bind(this))
  16546. }
  16547. ,
  16548. n.prototype.load = function(e, t) {
  16549. return a.get(e, {
  16550. responseType: "json",
  16551. auth: t ? i.authorizationHeader : null
  16552. }).done(function(e) {
  16553. var t = [];
  16554. for (var i in e) {
  16555. var n = e[i];
  16556. t.push(n)
  16557. }
  16558. this.createFromLabelData(t)
  16559. }
  16560. .bind(this))
  16561. }
  16562. ,
  16563. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16564. var t = -1;
  16565. if (e) {
  16566. var i = e.split("_");
  16567. t = parseInt(i[0])
  16568. }
  16569. return t
  16570. }
  16571. ,
  16572. u.exports = n
  16573. }
  16574. ).call(this, "/js/model/LabelCollection.js")
  16575. }
  16576. , {
  16577. "../label/Label": 90,
  16578. "../settings": 166,
  16579. "../util/IndexedCollection": 175,
  16580. "../util/ajax": 181,
  16581. "../util/common": 185,
  16582. "../util/logger": 189,
  16583. "../util/math": 190,
  16584. "./RoomCollection": 141
  16585. }],
  16586. 139: [function(P, O, e) {
  16587. (function(e) {
  16588. "use strict";
  16589. function t(e, t) {
  16590. o.Object3D.call(this),
  16591. this.sid = window.number;//t.sid,
  16592. this.data = t,
  16593. this.options = e,
  16594. this.urls = new i(e.urlFiles),
  16595. this.isPublic = void 0 !== t.is_public && t.is_public,
  16596. this.images = new E(this),
  16597. this.images.extend(t.images),
  16598. this.heroImage = this.images.getImage(t.icon),
  16599. this.heroLocations = [],
  16600. this.outdoorPanoLocations = [],
  16601. this.floors = new c(this),
  16602. this.floorsEnabled = void 0 === e.floors || e.floors,
  16603. this.changingFloor = !1,
  16604. this.chunks = [],
  16605. this.panos = new g,
  16606. this.colliders = [],
  16607. this.loadPanosPromise = null,
  16608. this.loadMeshTexturesPromise = null,
  16609. this.auxDataPromise = null,
  16610. this.meshTexturesLoaded = !1,
  16611. this.meshTextures = [],
  16612. this.tags = {},
  16613. this.tagsShown = !1,
  16614. this.shouldShowtags = !1,
  16615. this.has360Views = !1,
  16616. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16617. this.supportedModes = {},
  16618. this.supportedModes[s.PANORAMA] = !0,
  16619. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16620. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16621. this.supportedModes[s.TRANSITIONING] = !0,
  16622. this.supportsTiles = this.configureTiling(),
  16623. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//!0,
  16624. this.mode = s.DOLLHOUSE,
  16625. this.size = null,
  16626. this.center = null,
  16627. this.boundingBox = new o.Box3,
  16628. this.currentFloor = null,
  16629. this.allFloorsVisible = !0,
  16630. this.projectedPano0 = null,
  16631. this.projectedPano1 = null,
  16632. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16633. this.addFloor(new r(this,t,e.trim()))
  16634. }
  16635. .bind(this)),
  16636. this.waitQueue = [],
  16637. this.on("load", function(e) {
  16638. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16639. return !e.isLoadedCallback()
  16640. }),
  16641. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16642. }
  16643. .bind(this)),
  16644. this.setupCustomProperties(),
  16645. this.hots = {}
  16646. }
  16647. var o = P("three")
  16648. , a = P("../util/ajax")
  16649. , i = P("../util/ModelUrls")
  16650. , n = P("../objects/BoundingTextureSkybox")
  16651. , s = P("../enum/Viewmode")
  16652. , l = P("../enum/RenderOrder")
  16653. , r = (P("../enum/AlignmentType"),
  16654. P("../objects/Floor"))
  16655. , c = P("./FloorCollection")
  16656. , h = P("../objects/Chunk")
  16657. , u = (P("../objects/Room"),
  16658. P("../objects/Snapshot"),
  16659. P("../label/Label"),
  16660. P("../util/math"),
  16661. P("../settings"))
  16662. , d = P("../shaders")
  16663. , p = P("../util/logger")
  16664. , f = (P("../tag/tag"),
  16665. P("../tag/tagManager"),
  16666. P("../objects/Panorama"))
  16667. , g = P("../util/PanoramaCollection")
  16668. , m = P("../loaders/ModelLoader")
  16669. , v = P("../loaders/ModelTextureLoader")
  16670. , y = P("../loaders/SweepDataLoader")
  16671. , A = P("../util/transitions")
  16672. , C = (P("../util/easing"),
  16673. P("../util/lerp"),
  16674. P("../util/common"))
  16675. , I = (P("../util/texture"),
  16676. P("./../util/browser"))
  16677. , E = P("./ImageCollection")
  16678. , _ = P("./RoomCollection")
  16679. , b = P("./LabelCollection")
  16680. , w = P("./Chunks")
  16681. , T = P("./../util/showcase")
  16682. , x = P("../exception/BasicException")
  16683. , S = (P("../constants"),
  16684. P("events").EventEmitter)
  16685. , M = P("hot")
  16686. , R = new p(e);
  16687. t.prototype = Object.create(o.Object3D.prototype),
  16688. C.extend(t, S),
  16689. t.prototype.setupCustomProperties = function() {
  16690. var t = u.modelAlpha;
  16691. Object.defineProperty(this, "alpha", {
  16692. get: function() {
  16693. return t
  16694. },
  16695. set: function(e) {
  16696. t = e,
  16697. this.chunks.forEach(function(e) {
  16698. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16699. })
  16700. }
  16701. })
  16702. }
  16703. ,
  16704. t.prototype.configureTiling = function() {
  16705. var e = function() {
  16706. try {
  16707. var e = document.createElement("canvas")
  16708. , t = e.getContext("webgl");
  16709. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16710. } catch (e) {
  16711. return 0
  16712. }
  16713. }();
  16714. if (e < 2048)
  16715. return !1;
  16716. R.warn("Max cube texture size: " + e);
  16717. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16718. var i = u.tiling.tilingFlagNames[t];
  16719. if ("1" === I.valueFromHash(i, null))
  16720. return !0;
  16721. if ("0" === I.valueFromHash(i, null))
  16722. return !1
  16723. }
  16724. return !!T.modelDataPromisesTiles(this.data)
  16725. }
  16726. ,
  16727. t.prototype.toggleAlpha = function() {
  16728. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16729. }
  16730. ,
  16731. t.prototype.load = function(e) {
  16732. var t = this.urls.init().then(function() {
  16733. return $.when(this.loadPanos(), this.loadMesh())
  16734. }
  16735. .bind(this));
  16736. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16737. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16738. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16739. }
  16740. ,
  16741. t.prototype.loadMesh = function() {
  16742. var n = $.Deferred()
  16743. , r = this;
  16744. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16745. if (0 === e.length) {
  16746. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16747. r.supportedModes[s.DOLLHOUSE] = !1,
  16748. r.supportedModes[s.FLOORPLAN] = !1;
  16749. var i = new h({
  16750. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16751. });
  16752. i.material.visible = !1,
  16753. i.rotateX(-Math.PI / 2),
  16754. i.geometry.computeBoundingBox(),
  16755. e = [i]
  16756. }
  16757. e.forEach(function(e) {
  16758. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16759. r.addChunk(t, e)
  16760. }),
  16761. r.floors.sort(),
  16762. n.resolve(r)
  16763. }, function(e, t) {
  16764. n.notify(e, t)
  16765. }, function(e) {
  16766. R.error(e),
  16767. n.reject("loading-failed")
  16768. }),
  16769. n.promise()
  16770. }
  16771. ,
  16772. t.prototype.loadMeshTextures = function() {
  16773. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16774. this.meshTexturesLoaded = !0
  16775. }
  16776. .bind(this))),
  16777. this.loadTexturesPromise
  16778. }
  16779. ,
  16780. t.prototype.shineHots = function() {
  16781. A.trigger({
  16782. func: function(e) {
  16783. var opa = e <= .5 ? 2 * e : -2 * e + 2
  16784. for(var i in this.hots){
  16785. this.hots[i].mesh.material.uniforms.opac.value = opa;
  16786. }
  16787. }
  16788. .bind(this),
  16789. cycling: !0,
  16790. duration: 3e3,
  16791. name: "hotShine"
  16792. })
  16793. }
  16794. ,
  16795. t.prototype.createHotItem = function(e, t) {
  16796. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  16797. var o = document.createElement("li")
  16798. , a = document.createElement("span");
  16799. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute.title || "热点",
  16800. o.hot = t[n[r]],
  16801. o.appendChild(a),
  16802. i.appendChild(o)
  16803. }
  16804. document.querySelector("#hotListContent ul").appendChild(i),
  16805. console.log(i)
  16806. }
  16807. ,
  16808. t.prototype.loadOverlays = function(overlays){
  16809. var overlays = window.data2 && window.data2.overlays /* ||
  16810. [
  16811. { depth: 0.02,
  16812. file: "https://super.4dage.com/data/TEST/overlay/b6fe7cb6bd2b6.mp4",
  16813. hasBox: 0,
  16814. height: 0.8165,
  16815. media: ["video"],
  16816. pos: [-4.3132, 0.6788, -13.5162],
  16817. qua: [0, 0.9396, 0, 0.3421],
  16818. sid: "1591079418827",
  16819. width: 0.6124
  16820. }] */
  16821. overlays && overlays.forEach((info)=>{
  16822. new Overlay(info)
  16823. })
  16824. }
  16825. ,
  16826. t.prototype.loadhots = function() {
  16827. var r = $.Deferred()
  16828. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16829. return a.get(e, {
  16830. responseType: "json",
  16831. auth: this.isPublic ? null : u.authorizationHeader
  16832. }).done(function(e) {
  16833. window.data2 = e;
  16834. if(!e){
  16835. console.error("data2 is null")
  16836. }else{
  16837. g_data2 = hotMatcher(e)
  16838. this.hotsCount = 0;
  16839. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16840. window.hotData = {}
  16841. if(e.hots){
  16842. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16843. sids.forEach((sid)=>{
  16844. this.hotsCount++,
  16845. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  16846. e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  16847. this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  16848. window.hotData[sid] = e.hots[sid];
  16849. })
  16850. }
  16851. this.createHotItem(window.hotData, this.hots);
  16852. g_index = I.valueFromHash("m"),
  16853. e.tourAudio && (g_tourAudio = new Audio,
  16854. g_tourAudio.loop = !1,
  16855. g_tourAudio.addEventListener("ended", function() {
  16856. var e = document.createEvent("MouseEvent");
  16857. e.initEvent("tourAudioEnded", !0, !0),
  16858. window.dispatchEvent(e)
  16859. }));
  16860. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16861. //window.wx && manage.weixinShare(),
  16862. }
  16863. /* var i = $.Deferred()
  16864. , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  16865. a.get(n, {
  16866. responseType: "json",
  16867. auth: this.isPublic ? null : u.authorizationHeader
  16868. }).done(function(e) {
  16869. window.hotData = e,
  16870. this.createHotItem(e, this.hots);
  16871. for(let i in this.hots){
  16872. e[i] && this.hots[i].initStyleImg(e[i]);
  16873. }
  16874. i.resolve()
  16875. }
  16876. .bind(this)).fail(function() {
  16877. console.log("Data.js is empty");
  16878. i.resolve()
  16879. }),
  16880. */
  16881. r.resolve()
  16882. }
  16883. .bind(this)).fail(function() {
  16884. console.log("没有热点"),
  16885. //window.wx && manage.weixinShare(),
  16886. r.resolve()
  16887. }),
  16888. r
  16889. }
  16890. ,
  16891. t.prototype.loadPanos = function() {
  16892. if (this.loadPanosPromise)
  16893. return this.loadPanosPromise;
  16894. var e = new y(this);
  16895. return this.loadPanosPromise = e.load().then(function(e) {
  16896. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16897. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16898. else console.log(e.uuid)
  16899. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16900. }
  16901. .bind(this))),
  16902. this.panos.extend(e.map(function(e) {
  16903. return new f(this,e.uuid,e,this.supportsTiles)
  16904. }
  16905. .bind(this))),
  16906. this.panos.forEach(function(i) {
  16907. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16908. var t = this.panos.get(e);
  16909. t && this.panos.setNeighbour(i, t, !0)
  16910. }
  16911. .bind(this)),
  16912. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16913. }
  16914. .bind(this)),
  16915. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16916. this.supportedModes[s.PANORAMA] = !1),
  16917. $.when(this)
  16918. }
  16919. .bind(this)),
  16920. this.loadPanosPromise
  16921. }
  16922. ,
  16923. t.prototype.loadHighlightReel = function() {
  16924. var t = $.Deferred()
  16925. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16926. return a.get(e, {
  16927. responseType: "json",
  16928. auth: this.isPublic ? null : u.authorizationHeader
  16929. }).done(function(e) {
  16930. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16931. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16932. t.resolve()
  16933. }
  16934. .bind(this)).fail(function() {
  16935. R.warn("Getting highlight reel failed, no highlights available"),
  16936. t.resolve()
  16937. }),
  16938. t
  16939. }
  16940. ,
  16941. t.prototype.waitForLoad = function(e, t) {
  16942. t() || (this.waitQueue.push({
  16943. object: e,
  16944. isLoadedCallback: t
  16945. }),
  16946. 1 === this.waitQueue.length && this.emit("waiting"))
  16947. }
  16948. ,
  16949. t.prototype.hide = function() {
  16950. this.floors.hide()
  16951. }
  16952. ,
  16953. t.prototype.show = function() {
  16954. this.floors.show()
  16955. }
  16956. ,
  16957. t.prototype.floorNames = function() {
  16958. return this.floors.names()
  16959. }
  16960. ,
  16961. t.prototype.warpDestFloors = function(e, t) {
  16962. if (e && this.floors.length === e.length) {
  16963. var i = e.findIndex(function(e) {
  16964. return e
  16965. }
  16966. .bind(this));
  16967. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16968. } else
  16969. this.toggleAllFloors(!0)
  16970. }
  16971. ,
  16972. t.prototype.setFloor = function(e, t, i) {
  16973. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16974. this.allFloorsVisible = !1,
  16975. this._setFloor(e, t, i)
  16976. }
  16977. ,
  16978. t.prototype.toggleAllFloors = function(e) {
  16979. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16980. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16981. this._setFloor(this.currentFloor)
  16982. }
  16983. ,
  16984. t.prototype._setFloor = function(e, t, i) {
  16985. var n;
  16986. if (t = t || this.mode,
  16987. this.emit("floor.changed", e, t, this.currentFloor),
  16988. this.currentFloor = e,
  16989. t === s.PANORAMA) {
  16990. if (this.show(),
  16991. this.shouldShowtags && this.tagsShown)
  16992. for (n in this.tags)
  16993. this.tags[n].show(u.showFloorDuration)
  16994. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16995. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16996. }
  16997. .bind(this)),
  16998. this.shouldShowtags && this.tagsShown))
  16999. for (n in this.tags) {
  17000. var r = this.tags[n];
  17001. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  17002. }
  17003. var o = this
  17004. , a = e;
  17005. A.start(function() {}, u.showFloorDelay, function() {
  17006. o.floors.forEach(function(t) {
  17007. t.chunks.forEach(function(e) {
  17008. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  17009. })
  17010. })
  17011. }
  17012. .bind(this))
  17013. }
  17014. ,
  17015. t.prototype.toggleExplode = function() {
  17016. this.floors.toggleExplodeHorizontal()
  17017. }
  17018. ,
  17019. t.prototype.toggleExplodeUp = function() {
  17020. this.floors.toggleExplodeVertical()
  17021. }
  17022. ,
  17023. t.prototype.nextFloor = function(e) {
  17024. return this.floors.nextFloor(this.currentFloor, e)
  17025. }
  17026. ,
  17027. t.prototype.addFloor = function(e) {
  17028. this.floors.add(e)
  17029. }
  17030. ,
  17031. t.prototype.getFloorAtPoint = function(e) {
  17032. return this.floors.getFloorAtPoint(e)
  17033. }
  17034. ,
  17035. t.prototype.getTagBySid = function(e) {
  17036. return this.tags[e]
  17037. }
  17038. ,
  17039. t.prototype.addChunk = function(e, t) {
  17040. this.floors.getOrMakeFloor(e).addChunk(t),
  17041. this.chunks.push(t)
  17042. }
  17043. ,
  17044. t.prototype.setMode = function(t) {
  17045. if (!this.supportedModes[t])
  17046. throw new x("Mode not supported for this model: " + t);
  17047. this.mode = t
  17048. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17049. this.chunks.forEach(function(e) {
  17050. e.setMode(t)
  17051. })
  17052. }
  17053. ,
  17054. t.prototype.build = function() {
  17055. this.heroLocations = this.images.getHeroLocations(this.panos);
  17056. var e = function() {
  17057. 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()
  17058. }
  17059. .bind(this)();
  17060. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17061. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17062. }
  17063. .bind(this)) || e,
  17064. null === this.heroImage && R.warn("No hero image defined."),
  17065. this.currentFloor = this.floors.last(),
  17066. this.floors.build(),
  17067. this.colliders = this.floors.reduce(function(e, t) {
  17068. return e.concat(t.collider.children)
  17069. }, []),
  17070. this.panos.forEach(function(e) {
  17071. e.build1(),
  17072. e.on("enter", function() {
  17073. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17074. }
  17075. .bind(this))
  17076. }
  17077. .bind(this)),
  17078. this.panos.forEach(function(e) {
  17079. e.build2()
  17080. }),
  17081. this.floors.forEach(function(e) {
  17082. this.boundingBox.union(e.boundingBox)
  17083. }
  17084. .bind(this)),
  17085. this.size = this.boundingBox.size(),
  17086. this.center = this.boundingBox.center(),
  17087. this.floors.forEach(function(e) {
  17088. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17089. }
  17090. .bind(this)),
  17091. this.panos.populate_path_graph(),
  17092. this.skybox = new n(this.boundingBox),
  17093. this.skybox.matrixWorldNeedsUpdate = !0,
  17094. this.add(this.skybox),
  17095. setTimeout(function() {
  17096. this.hotsCount && this.shineHots()
  17097. }
  17098. .bind(this), 1300),
  17099. this.tags)
  17100. this.tags[t].build();
  17101. return R.debug("Done building model"),
  17102. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17103. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17104. this.buildRooms(),
  17105. this.labels.associateWithRooms(this.rooms),
  17106. $.when(this)
  17107. }
  17108. ,
  17109. t.prototype.loadLabels = function() {
  17110. this.labels = new b(this);
  17111. var e = $.Deferred();
  17112. /* if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0),
  17113. !this.showingLabels) */
  17114. return e.resolve();
  17115. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17116. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17117. R.warn("Getting labels failed, not displaying labels."),
  17118. e.resolve()
  17119. }),
  17120. e
  17121. }
  17122. ,
  17123. t.prototype.buildRooms = function() {
  17124. this.rooms = new _(this),
  17125. this.rooms.createFromChunks(this.chunks),
  17126. this.rooms.calcRoomBoundaries()
  17127. }
  17128. ,
  17129. t.prototype.updateProjectedPanos = function() {
  17130. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17131. }
  17132. ,
  17133. t.prototype.setProjectedPanos = function(t, i, n) {
  17134. null != n || (n = !0),
  17135. n = !!n,
  17136. this.projectedPano0 = t,
  17137. this.projectedPano1 = i,
  17138. this.skybox.material.setProjectedPanos(t, i, n),
  17139. this.chunks.forEach(function(e) {
  17140. e.materialInside.setProjectedPanos(t, i, n)
  17141. })
  17142. }
  17143. ,
  17144. t.prototype.setSide = function(t) {
  17145. this.floors.forEach(function(e) {
  17146. e.collider.material.side = t
  17147. })
  17148. }
  17149. ,
  17150. t.prototype.heroCount = function() {
  17151. return this.heroLocations ? this.heroLocations.length : 0
  17152. }
  17153. ,
  17154. t.prototype.getHeroDescriptorByIndex = function(e) {
  17155. if (e < 0)
  17156. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17157. null;
  17158. if (this.heroCount() < 1)
  17159. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17160. null;
  17161. var t = this.heroLocations[e];
  17162. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17163. null) : t
  17164. }
  17165. ,
  17166. t.prototype.findPanoramicHero = function() {
  17167. for (var e in this.heroLocations)
  17168. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17169. return this.heroLocations[e];
  17170. return null
  17171. }
  17172. ,
  17173. t.prototype.listImagePanos = function() {
  17174. var i = []
  17175. , n = this;
  17176. return this.images.forEach(function(e) {
  17177. if (e.metadata && e.metadata.scan_id) {
  17178. var t = n.panos.get(e.metadata.scan_id);
  17179. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17180. }
  17181. }),
  17182. i
  17183. }
  17184. ,
  17185. t.prototype.fadePanoMarkers = function(e, t) {
  17186. this.panos.fadeMarkerOpacity(e, t)
  17187. }
  17188. ,
  17189. t.prototype.setSweepVisibility = function(t) {
  17190. this.panos.forEach(function(e) {
  17191. e.marker && (e.marker.visible = t)
  17192. })
  17193. }
  17194. ,
  17195. t.prototype.outsideAllowed = function() {
  17196. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17197. }
  17198. ,
  17199. O.exports = t
  17200. }
  17201. ).call(this, "/js/model/Model.js")
  17202. }
  17203. , {
  17204. "../constants": 8,
  17205. "../enum/AlignmentType": 17,
  17206. "../enum/RenderOrder": 42,
  17207. "../enum/Viewmode": 51,
  17208. "../exception/BasicException": 55,
  17209. "../label/Label": 90,
  17210. "../loaders/ModelLoader": 105,
  17211. "../loaders/ModelTextureLoader": 106,
  17212. "../loaders/SweepDataLoader": 107,
  17213. "../tag/tag": 123,
  17214. "../tag/tagManager": 124,
  17215. "../objects/BoundingTextureSkybox": 143,
  17216. "../objects/Chunk": 144,
  17217. "../objects/Floor": 146,
  17218. "../objects/Panorama": 148,
  17219. "../objects/Room": 150,
  17220. "../objects/Snapshot": 153,
  17221. "../settings": 166,
  17222. "../shaders": 167,
  17223. "../util/ModelUrls": 177,
  17224. "../util/PanoramaCollection": 178,
  17225. "../util/ajax": 181,
  17226. "../util/common": 185,
  17227. "../util/easing": 186,
  17228. "../util/lerp": 188,
  17229. "../util/logger": 189,
  17230. "../util/math": 190,
  17231. "../util/texture": 194,
  17232. "../util/transitions": 195,
  17233. "./../util/browser": 182,
  17234. "./../util/showcase": 193,
  17235. "./Chunks": 135,
  17236. "./FloorCollection": 136,
  17237. "./ImageCollection": 137,
  17238. "./LabelCollection": 138,
  17239. "./RoomCollection": 141,
  17240. events: 202,
  17241. three: 217,
  17242. hot: "hot"
  17243. }],
  17244. 140: [function(e, t, i) {
  17245. "use strict";
  17246. function n() {
  17247. this.modelMap = {},
  17248. this.activeModel = null,
  17249. this.modelCount = 0,
  17250. this.tileDownloader = null,
  17251. this.panoRenderer = null
  17252. }
  17253. var r = (e("three"),
  17254. e("../util/common"))
  17255. , o = e("../exception/BasicException")
  17256. , a = e("../enum/ModelManagerEvents")
  17257. , s = e("../enum/PanoRendererEvents")
  17258. , l = e("events").EventEmitter;
  17259. n.prototype.init = function(e, t, i) {
  17260. this.tileDownloader = e,
  17261. this.panoRenderer = t,
  17262. this.qualityManager = i,
  17263. this.bindEvents()
  17264. }
  17265. ,
  17266. n.prototype.bindEvents = function() {
  17267. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17268. }
  17269. ,
  17270. n.prototype.onTileRendered = function(e, t, i, n) {}
  17271. ,
  17272. n.prototype.addModel = function(e) {
  17273. this.modelMap[e.sid] = e,
  17274. 0 === this.modelCount && this.activateModel(e.sid),
  17275. this.modelCount++,
  17276. this.emit(a.ModelAdded)
  17277. }
  17278. ,
  17279. n.prototype.getModel = function(e) {
  17280. return this.modelMap[e]
  17281. }
  17282. ,
  17283. n.prototype.activateModel = function(e) {
  17284. var t = this.modelMap[e];
  17285. if (!t)
  17286. throw new o("Tried to activate invalid model!");
  17287. var i = this.activeModel;
  17288. this.activeModel = t,
  17289. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17290. this.tileDownloader.setUrls(t.urls),
  17291. t.panos.forEach(function(e) {
  17292. e.attachToPanoRenderer(this.panoRenderer),
  17293. e.tileDownloader = this.tileDownloader,
  17294. e.qualityManager = this.qualityManager
  17295. }
  17296. .bind(this)),
  17297. this.emit(a.ActiveModelChanged, {
  17298. oldModel: i,
  17299. model: t
  17300. })
  17301. }
  17302. ,
  17303. n.prototype.getActiveModel = function() {
  17304. return this.activeModel
  17305. }
  17306. ,
  17307. r.extend(n, l),
  17308. t.exports = n
  17309. }
  17310. , {
  17311. "../enum/ModelManagerEvents": 33,
  17312. "../enum/PanoRendererEvents": 35,
  17313. "../exception/BasicException": 55,
  17314. "../util/common": 185,
  17315. events: 202,
  17316. three: 217
  17317. }],
  17318. 141: [function(r, l, e) {
  17319. (function(e) {
  17320. "use strict";
  17321. function o() {
  17322. n.call(this)
  17323. }
  17324. var a = r("../objects/Room")
  17325. , t = (r("../settings"),
  17326. r("../util/logger"))
  17327. , i = (r("../util/transitions"),
  17328. r("../util/easing"),
  17329. r("../util/common"))
  17330. , n = r("../util/IndexedCollection")
  17331. , s = r("./Chunks");
  17332. new t(e),
  17333. i.inherit(o, n),
  17334. o.prototype.getIndex = function(e) {
  17335. return e.roomId
  17336. }
  17337. ,
  17338. o.prototype.calcRoomBoundaries = function() {
  17339. this.forEach(function(e) {
  17340. e.calcBoundaries()
  17341. })
  17342. }
  17343. ,
  17344. o.prototype.createFromChunks = function(e) {
  17345. var n = {
  17346. floorId: -1,
  17347. roomId: -1
  17348. }
  17349. , r = {};
  17350. e.forEach(function(e) {
  17351. s.parseIdsFromChunkName(e.name, n);
  17352. var t = r[n.roomId];
  17353. if (!t) {
  17354. var i = o.generateRoomId(n.floorId, n.roomId);
  17355. t = new a(n.floorId,i),
  17356. this.add(t),
  17357. r[n.roomId] = t
  17358. }
  17359. t.addChunk(e)
  17360. }
  17361. .bind(this)),
  17362. this.calcRoomBoundaries()
  17363. }
  17364. ,
  17365. o.generateRoomId = function(e, t) {
  17366. return e + "_" + t
  17367. }
  17368. ,
  17369. l.exports = o
  17370. }
  17371. ).call(this, "/js/model/RoomCollection.js")
  17372. }
  17373. , {
  17374. "../objects/Room": 150,
  17375. "../settings": 166,
  17376. "../util/IndexedCollection": 175,
  17377. "../util/common": 185,
  17378. "../util/easing": 186,
  17379. "../util/logger": 189,
  17380. "../util/transitions": 195,
  17381. "./Chunks": 135
  17382. }],
  17383. 142: [function(e, t, i) {
  17384. "use strict";
  17385. function n(e, t, i) {
  17386. var n = (e = e.clone().expandByScalar(0.01)).size()
  17387. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17388. r.boundingBox = e,
  17389. o.Mesh.call(this, r, t),
  17390. this.position.copy(e.center()),
  17391. this.frustumCulled = !1,
  17392. i && this.add(new o.WireframeHelper(this))
  17393. }
  17394. var o = e("three");
  17395. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17396. t.exports = n
  17397. }
  17398. , {
  17399. three: 217
  17400. }],
  17401. 143: [function(l, c, e) {
  17402. (function(e) {
  17403. "use strict";
  17404. function t(e) {
  17405. s.time("Computing a nice bounding cubemap");
  17406. var t = new r({
  17407. side: i.BackSide,
  17408. transparent: !0
  17409. });
  17410. t.uniforms.modelAlpha.value = 0,
  17411. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17412. this.renderOrder = a.boundingSkybox,
  17413. n.call(this, e, t),
  17414. s.timeEnd("Computing a nice bounding cubemap")
  17415. }
  17416. var i = l("three")
  17417. , n = (l("../enum/Viewmode"),
  17418. l("../shaders"),
  17419. l("./BoundingMesh"))
  17420. , r = l("../materials/ModelTextureMaterial")
  17421. , o = l("../settings")
  17422. , a = l("../enum/RenderOrder")
  17423. , s = new (l("../util/logger"))(e);
  17424. (t.prototype = Object.create(n.prototype)).constructor = t,
  17425. c.exports = t
  17426. }
  17427. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17428. }
  17429. , {
  17430. "../enum/RenderOrder": 42,
  17431. "../enum/Viewmode": 51,
  17432. "../materials/ModelTextureMaterial": 118,
  17433. "../settings": 166,
  17434. "../shaders": 167,
  17435. "../util/logger": 189,
  17436. "./BoundingMesh": 142,
  17437. three: 217
  17438. }],
  17439. 144: [function(e, t, i) {
  17440. "use strict";
  17441. function n(e) {
  17442. this.materialInside = new s({
  17443. side: r.DoubleSide
  17444. });
  17445. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17446. this.materialOutside = new r.RawShaderMaterial({
  17447. fragmentShader: o.modelOutside.fragmentShader,
  17448. vertexShader: o.modelOutside.vertexShader,
  17449. uniforms: t,
  17450. side: r.FrontSide,
  17451. name: "chunkOut"
  17452. }),
  17453. r.Mesh.call(this, e.geometry, this.materialInside),
  17454. this.name = e.name || "",
  17455. this.textureName = e.textureName,
  17456. this.meshUrl = e.meshUrl
  17457. }
  17458. var r = e("three")
  17459. , o = e("../shaders")
  17460. , a = e("../enum/Viewmode")
  17461. , s = e("../materials/ModelTextureMaterial");
  17462. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17463. this.materialInside.uniforms.map.value = e,
  17464. this.materialOutside.uniforms.map.value = e
  17465. }
  17466. ,
  17467. n.prototype.setMode = function(e) {
  17468. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17469. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17470. t.transparent = this.material.transparent,
  17471. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17472. this.material = t
  17473. }
  17474. ,
  17475. t.exports = n
  17476. }
  17477. , {
  17478. "../enum/Viewmode": 51,
  17479. "../materials/ModelTextureMaterial": 118,
  17480. "../shaders": 167,
  17481. three: 217
  17482. }],
  17483. 145: [function(e, t, i) {
  17484. "use strict";
  17485. function n(e) {
  17486. this.chunksize = e || 10,
  17487. this.chunks = {},
  17488. this.boundingBoxes = {},
  17489. this.children = [],
  17490. this.offset = new m.Vector3(0,.5,0),
  17491. this.material = new m.MeshBasicMaterial({
  17492. color: 16777215 * Math.random(),
  17493. side: m.DoubleSide
  17494. })
  17495. }
  17496. var m = e("three");
  17497. e("../enum/Viewmode"),
  17498. n.prototype.add = function(e) {
  17499. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17500. u ? (t = u.position.array,
  17501. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17502. e.faces);
  17503. var d = new m.Vector3;
  17504. if (i)
  17505. for (n = 0,
  17506. r = i.length; n < r; n += 3) {
  17507. var p = 3 * i[n]
  17508. , f = 3 * i[n + 1]
  17509. , g = 3 * i[n + 2];
  17510. o = (t[p] + t[f] + t[g]) / 3,
  17511. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17512. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17513. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17514. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17515. this.boundingBoxes[l] = new m.Box3),
  17516. 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]),
  17517. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17518. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17519. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17520. }
  17521. else
  17522. for (n = 0,
  17523. r = t.length; n < r; n += 9)
  17524. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17525. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17526. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17527. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17528. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17529. this.boundingBoxes[l] = new m.Box3),
  17530. 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]),
  17531. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17532. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17533. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17534. }
  17535. ,
  17536. n.prototype.build = function() {
  17537. var e = new m.Object3D;
  17538. for (var t in e.material = this.material,
  17539. this.chunks) {
  17540. var i = this.chunks[t]
  17541. , n = new m.BufferGeometry;
  17542. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17543. n.boundingBox = this.boundingBoxes[t];
  17544. var r = new m.Mesh(n,this.material);
  17545. r.material.visible = !1,
  17546. e.add(r),
  17547. this.chunks[t] = []
  17548. }
  17549. return e
  17550. }
  17551. ,
  17552. t.exports = n
  17553. }
  17554. , {
  17555. "../enum/Viewmode": 51,
  17556. three: 217
  17557. }],
  17558. 146: [function(e, t, i) {
  17559. "use strict";
  17560. var n = e("three")
  17561. , r = e("../settings")
  17562. , o = e("../util/common")
  17563. , a = e("../util/lerp")
  17564. , s = e("./ChunkedCollider")
  17565. , l = e("../util/transitions")
  17566. , c = e("../util/easing")
  17567. , h = (e("../objects/Panorama"),
  17568. e("../enum/RenderOrder"));
  17569. e("../localization/localize");
  17570. function u(e, t, i) {
  17571. n.Object3D.call(this),
  17572. this.model = e,
  17573. this.floorIndex = t,
  17574. this.lang = r.languageTag,
  17575. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17576. this.panos = [],
  17577. this.chunks = [],
  17578. this.colliderBuilder = new s(3),
  17579. this.collider = null,
  17580. this.center = null,
  17581. this.boundingBox = new n.Box3,
  17582. this.size = null,
  17583. this.hidden = !1,
  17584. this.conservativeBoundingBox = new n.Box3,
  17585. this.debugColor = 16777215 * Math.random(),
  17586. this.transition = null
  17587. }
  17588. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17589. this.model.setFloor(this, e)
  17590. }
  17591. ,
  17592. u.prototype.hide = function(e) {
  17593. if (!this.hidden || this.transition) {
  17594. this.chunks.forEach(function(e) {
  17595. e.material.transparent = !0
  17596. }),
  17597. l.cancel(this.transition);
  17598. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17599. , i = e ? 0 : r.hideFloorDelay / t;
  17600. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17601. this.hidden = !0
  17602. }
  17603. .bind(this), i, c.easeInOutQuad)
  17604. }
  17605. }
  17606. ,
  17607. u.prototype.show = function(e) {
  17608. if (this.hidden || this.transition) {
  17609. this.hidden = !1,
  17610. l.cancel(this.transition);
  17611. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17612. , i = e ? 0 : r.showFloorDelay / t;
  17613. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17614. this.hidden || this.chunks.forEach(function(e) {
  17615. e.material.transparent = !1
  17616. })
  17617. }
  17618. .bind(this), i, c.easeInOutQuad)
  17619. }
  17620. }
  17621. ,
  17622. u.prototype.toggle = function(e, t) {
  17623. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17624. }
  17625. ,
  17626. u.prototype.containsPoint = function(t) {
  17627. return this.collider.children.some(function(e) {
  17628. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17629. e.geometry.boundingBox.containsPoint(t)
  17630. })
  17631. }
  17632. ,
  17633. u.prototype.distanceToPoint = function(i) {
  17634. var n = null
  17635. , r = 1 / 0;
  17636. return this.collider.children.forEach(function(e) {
  17637. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17638. var t = e.geometry.boundingBox.distanceToPoint(i);
  17639. (!n || t < r) && (r = t,
  17640. n = e)
  17641. }),
  17642. r
  17643. }
  17644. ,
  17645. u.prototype.addChunk = function(e) {
  17646. e.renderOrder = h.ghostFloor,
  17647. this.add(e),
  17648. this.chunks.push(e),
  17649. this.boundingBox.union(e.geometry.boundingBox),
  17650. this.size = this.boundingBox.size(),
  17651. this.colliderBuilder.add(e.geometry)
  17652. }
  17653. ,
  17654. u.prototype.addPano = function(e) {
  17655. this.panos.push(e),
  17656. this.add(e.skyboxMesh),
  17657. e.marker && this.add(e.marker);
  17658. var t = new n.Vector3(1,1,1)
  17659. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17660. this.boundingBox.union(i)
  17661. }
  17662. ,
  17663. u.prototype.build = function() {
  17664. this.collider = this.colliderBuilder.build(!0),
  17665. this.add(this.collider),
  17666. this.center = this.boundingBox.center(),
  17667. this.conservativeBoundingBox.copy(this.boundingBox),
  17668. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17669. return e.geometry.boundingBox.min.y
  17670. }), 5),
  17671. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17672. return e.geometry.boundingBox.max.y
  17673. }), 5),
  17674. this.colliderBuilder = null
  17675. }
  17676. ,
  17677. u.prototype.toShortString = function() {
  17678. return o.nth(this.floorIndex + 1)
  17679. }
  17680. ,
  17681. u.prototype.toString = function() {
  17682. return this.name
  17683. }
  17684. ,
  17685. t.exports = u
  17686. }
  17687. , {
  17688. "../enum/RenderOrder": 42,
  17689. "../localization/localize": 108,
  17690. "./strings-cn-CN": 109,
  17691. "../objects/Panorama": 148,
  17692. "../settings": 166,
  17693. "../util/common": 185,
  17694. "../util/easing": 186,
  17695. "../util/lerp": 188,
  17696. "../util/transitions": 195,
  17697. "./ChunkedCollider": 145,
  17698. three: 217
  17699. }],
  17700. 147: [function(e, t, i) {
  17701. "use strict";
  17702. function n(e) {
  17703. this.player = e,
  17704. this.obj3d = null,
  17705. this.UP = new u.Vector3(0,1,0)
  17706. }
  17707. var u = e("three")
  17708. , d = e("../settings");
  17709. n.prototype.prefs = {
  17710. linewidth: 3,
  17711. height: .07,
  17712. opacity: .45,
  17713. endScale: .05
  17714. },
  17715. n.prototype.discard = function() {
  17716. if (this.obj3d) {
  17717. var e = this.obj3d.parent;
  17718. e && e.remove(this.obj3d)
  17719. }
  17720. this.obj3d = null
  17721. }
  17722. ,
  17723. n.prototype.draw = function() {
  17724. if (this.discard(),
  17725. d.showNeighbors) {
  17726. var e = this.player.currentPano.floor;
  17727. this.obj3d = new u.Object3D;
  17728. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17729. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17730. i.y += this.prefs.height;
  17731. var n = .1525
  17732. , r = new u.Matrix4;
  17733. for (var o in t)
  17734. if (t[o]) {
  17735. var a = this.player.model.panos.get(o)
  17736. , s = (a.position.clone().sub(this.player.model.position),
  17737. a.position.clone().sub(a.floorPosition))
  17738. , l = a.floorPosition.clone().sub(this.player.model.position);
  17739. l.y += this.prefs.height;
  17740. var c = new u.Geometry;
  17741. 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)),
  17742. 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)),
  17743. r.identity().setPosition(s),
  17744. c.applyMatrix(r),
  17745. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17746. 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)),
  17747. r.lookAt(l, i, this.UP).setPosition(l),
  17748. c.applyMatrix(r),
  17749. c.vertices.push(l, i);
  17750. var h = new u.Line(c,new u.LineBasicMaterial({
  17751. color: a.debugColor.getHex(),
  17752. transparent: !0,
  17753. opacity: this.prefs.opacity,
  17754. depthWrite: !1,
  17755. name: "sLine" + o,
  17756. linewidth: this.prefs.linewidth
  17757. }));
  17758. this.obj3d.add(h)
  17759. }
  17760. e.add(this.obj3d)
  17761. }
  17762. }
  17763. ,
  17764. n.prototype.update = function() {
  17765. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17766. }
  17767. ,
  17768. t.exports = n
  17769. }
  17770. , {
  17771. "../settings": 166,
  17772. three: 217
  17773. }],
  17774. 148: [function(S, M, e) {
  17775. (function(e) {
  17776. "use strict";
  17777. function r(e, t, i, n) {
  17778. this.model = e,
  17779. this.id = t,
  17780. this.alignmentType = i.alignmentType || c.ALIGNED,
  17781. this.neighbourUUIDs = i.neighbours || null,
  17782. this.neighbourPanos = null,
  17783. this.floor = null,
  17784. this.floorIndex = i.floor,
  17785. this.failedLoadingAt = 0,
  17786. this.maxLoadRetries = 4,
  17787. this.origin = i.position.clone(),
  17788. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17789. this.quaternion = i.quaternion.clone(),
  17790. this.skyboxMesh = new s.Mesh(E),
  17791. this.skyboxMesh.position.copy(this.position),
  17792. this.skyboxMesh.quaternion.copy(this.quaternion),
  17793. this.skyboxMesh.name = "skybox",
  17794. this.skyboxMesh.visible = !1,
  17795. this.skyboxMesh.updateMatrix(),
  17796. this.skyboxMesh.updateMatrixWorld(),
  17797. this.marker = null,
  17798. this.showFloorMarker = this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
  17799. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17800. map: b,
  17801. side: s.DoubleSide,
  17802. opacity: 0,
  17803. transparent: !0,
  17804. depthWrite: !1
  17805. })),
  17806. this.marker.visible = this.showFloorMarker,
  17807. this.marker.renderOrder = l.panoMarker,
  17808. this.marker.name = "marker",
  17809. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17810. this.marker.updateMatrixWorld(),
  17811. a.colorMarkerOnLoad && this.on("load", function() {
  17812. this.marker.material.color.set(65280)
  17813. })),
  17814. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17815. this.floorPosition = i.puck ? i.puck.clone() : null,
  17816. this.tiled = n,
  17817. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17818. this.solidSkybox.flipY = !1,
  17819. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17820. this.solidSkybox.magFilter = s.LinearFilter,
  17821. this.solidSkybox.generateMipmaps = !1)),
  17822. this.zoomed = !1,
  17823. this.panoRenderer = null,
  17824. this.qualityManager = null,
  17825. this.tileDownloader = null,
  17826. this.tiledPanoRenderTarget = null,
  17827. this.minimumTiledPanoLoaded = !1,
  17828. this.highestPartialTileRenderOpCompleted = 0,
  17829. this.highestFullTileRenderOpCompleted = 0,
  17830. this.shouldRedrawOnBaseLoaded = !1,
  17831. this.lockUntilRenderingComplete = !1,
  17832. a.colorMarkerOnLoad && this.on("load", function() {
  17833. this.marker.material.color.set(65280)
  17834. }),
  17835. (e = new s.TextureLoader).setCrossOrigin(!0);
  17836. var r = e.load("images/texture.jpg");
  17837. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17838. color: 16777215,
  17839. transparent: !0,
  17840. opacity: .75,
  17841. map: r
  17842. })),
  17843. this.vrMarker.boluoType = "vr",
  17844. this.vrMarker.position.z = 1,
  17845. this.vrMarker.enabled = !0,
  17846. this.vrMarker.visible = !1,
  17847. window.vrMarkers = window.vrMarkers || [],
  17848. window.vrMarkers.push(this.vrMarker),
  17849. this.marker && this.marker.add(this.vrMarker),
  17850. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17851. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17852. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17853. this.adjustAngleEnable) {
  17854. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17855. this.skyboxMesh.quaternion.multiply(i);
  17856. var o = new s.Quaternion;
  17857. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17858. this.skyboxMesh.quaternion.multiply(o),
  17859. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17860. this.skyboxMesh.quaternion.multiply(n),
  17861. this.skyboxMesh.updateMatrix(),
  17862. this.skyboxMesh.updateMatrixWorld(),
  17863. this.model.updateProjectedPanos()
  17864. }
  17865. }
  17866. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17867. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17868. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17869. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17870. S("../enum/GLCubeFaces"),
  17871. 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");
  17872. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17873. function() {
  17874. this.setZoomed(!1),
  17875. this.emit("enter", {
  17876. oldPano: t,
  17877. newPano: this
  17878. }),
  17879. t = this
  17880. }
  17881. ),
  17882. r.prototype.exit = function() {
  17883. this.tiled ? (this.clearWaitDeferreds(),
  17884. this.minimumTiledPanoLoaded = !1,
  17885. this.tiledPanoRenderTarget = null,
  17886. this.setZoomed(!1),
  17887. this.panoRenderer.deactivateTiledPano(this),
  17888. this.highestPartialTileRenderOpCompleted = 0,
  17889. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17890. this.solidSkybox.loaded = !1,
  17891. this.solidSkybox.version = 0),
  17892. this.emit("exit")
  17893. }
  17894. ,
  17895. r.prototype.hoverOn = function(e) {
  17896. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17897. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17898. }
  17899. ,
  17900. r.prototype.hoverOff = function(e) {
  17901. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17902. }
  17903. ,
  17904. r.prototype.build1 = function() {
  17905. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  17906. this.floor.addPano(this),
  17907. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17908. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17909. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17910. }
  17911. ,
  17912. r.prototype.build2 = function() {
  17913. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17914. this.height = this.position.distanceTo(this.floorPosition),
  17915. this.placeMarker()
  17916. }
  17917. ,
  17918. r.prototype.interpolateFloorPosition = function() {
  17919. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17920. return !!e.floorPosition
  17921. }).sort(function(e, t) {
  17922. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17923. }
  17924. .bind(this))
  17925. , t = this.position.clone();
  17926. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17927. t
  17928. }
  17929. ,
  17930. r.prototype.raycastFloorPosition = function() {
  17931. I.warn("Performance warning: Raycasting to find floor position");
  17932. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17933. return e.length ? e[0].point : null
  17934. }
  17935. ,
  17936. 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)],
  17937. function() {
  17938. I.warn("Performance warning: Raycasting to find floor index");
  17939. for (var e = 0; e < i.length; e++) {
  17940. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17941. if (t.length)
  17942. return t[0].object.parent.parent
  17943. }
  17944. return null
  17945. }
  17946. ),
  17947. r.prototype.placeMarker = function() {
  17948. this.marker && (this.marker.position.copy(this.floorPosition),
  17949. this.marker.position.y += .05,
  17950. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17951. }
  17952. ,
  17953. r.prototype.translate = function(e) {
  17954. this.position.add(e),
  17955. this.floorPosition.add(e)
  17956. }
  17957. ,
  17958. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17959. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17960. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17961. }
  17962. ,
  17963. r.prototype.attachToPanoRenderer = function(e) {
  17964. this.panoRenderer = e,
  17965. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17966. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17967. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17968. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17969. }
  17970. ;
  17971. var w, T, x = {};
  17972. r.prototype.getWaitDeferred = function(e) {
  17973. var t = x[this.id];
  17974. t || (t = {},
  17975. x[this.id] = t);
  17976. var i = t[e];
  17977. return i || (i = {
  17978. deferred: $.Deferred(),
  17979. active: !1
  17980. },
  17981. t[e] = i),
  17982. i
  17983. }
  17984. ,
  17985. r.prototype.resetWaitDeferred = function(e) {
  17986. var t = this.getWaitDeferred(e);
  17987. t.active = !1,
  17988. t.deferred = $.Deferred()
  17989. }
  17990. ,
  17991. r.prototype.clearWaitDeferreds = function() {
  17992. var e = x[this.id];
  17993. for (var t in e || (e = {},
  17994. x[this.id] = e),
  17995. e)
  17996. if (e.hasOwnProperty(t)) {
  17997. var i = e[t];
  17998. i.active = !1,
  17999. i.deferred = $.Deferred()
  18000. }
  18001. }
  18002. ,
  18003. r.prototype.loadTiledPano = (new s.Vector3,
  18004. w = [],
  18005. T = [],
  18006. function(e, t, i, n, r, o) {
  18007. null != n || (n = !0),
  18008. null != r || (r = !0);
  18009. var a = this.getWaitDeferred(e)
  18010. , s = a.deferred
  18011. , l = null
  18012. , c = null;
  18013. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  18014. c = i.vFov)),
  18015. !this.isLoaded(e)) {
  18016. if (!a.active) {
  18017. if (a.active = !0,
  18018. i) {
  18019. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18020. w[this.id + ":" + e] = {
  18021. tileCount: 0,
  18022. targetTileCount: h
  18023. },
  18024. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18025. }
  18026. T[this.id] || (T[this.id] = !0,
  18027. this.on(f.LoadComplete, function(e, t) {
  18028. var i = this.getWaitDeferred(e).deferred;
  18029. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18030. this.resetWaitDeferred(e))
  18031. }
  18032. .bind(this)),
  18033. this.on(f.LoadFailed, function(e) {
  18034. var t = this.getWaitDeferred(e).deferred;
  18035. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18036. this.resetWaitDeferred(e))
  18037. }
  18038. .bind(this)),
  18039. this.on(f.TileLoaded, function(e, t, i) {
  18040. var n = this.getWaitDeferred(e).deferred;
  18041. if (n && "pending" === n.state()) {
  18042. n.notify(e, t, i);
  18043. var r = w[this.id + ":" + e];
  18044. r && (r.tileCount++,
  18045. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18046. n.resolve(e, i),
  18047. this.resetWaitDeferred(e)))
  18048. }
  18049. }
  18050. .bind(this)))
  18051. }
  18052. this.tileDownloader.clearForceQueue(),
  18053. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18054. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18055. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18056. }
  18057. return s.promise()
  18058. }
  18059. ),
  18060. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18061. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18062. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18063. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18064. }
  18065. ,
  18066. r.prototype.onTileRendered = function(e, t, i, n) {
  18067. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18068. }
  18069. ,
  18070. r.prototype.onPanoRendered = function(e, t, i, n) {
  18071. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18072. this.updateSkyboxForZoomLevel(),
  18073. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18074. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18075. this.emit("load", t),
  18076. this.model.emit("load", this),
  18077. this.emit(f.LoadComplete, t, i))
  18078. }
  18079. ,
  18080. r.prototype.setZoomed = function(e) {
  18081. this.zoomed = e,
  18082. this.updateSkyboxForZoomLevel()
  18083. }
  18084. ,
  18085. r.prototype.ensureSkyboxReadyForRender = function() {
  18086. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18087. this.solidSkybox.loaded = !0)
  18088. }
  18089. ,
  18090. r.prototype.updateSkyboxForZoomLevel = function() {
  18091. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18092. }
  18093. ,
  18094. r.prototype.getSkyboxTexture = function() {
  18095. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18096. }
  18097. ,
  18098. r.prototype.onTileRenderFail = function(e, t, i) {
  18099. e === this.id && this.emit(f.LoadFailed, t)
  18100. }
  18101. ,
  18102. r.prototype.isLoaded = function(e) {
  18103. if (this.tiled) {
  18104. if (e && "string" == typeof e)
  18105. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18106. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18107. }
  18108. if (e && "number" == typeof e)
  18109. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18110. return !!this.solidSkybox.high || e in this.solidSkybox
  18111. }
  18112. ,
  18113. r.prototype.loadCube = function(a) {
  18114. if (this.isLoaded(a))
  18115. return I.info("Skipping load of pano, already loaded"),
  18116. $.when();
  18117. this.emit("loading", a),
  18118. this.model.emit("loading", this);
  18119. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18120. , e = n.filter(function(e) {
  18121. return !e
  18122. });
  18123. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18124. a = "high",
  18125. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18126. var t = 0
  18127. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18128. return u.getImage(n[t])
  18129. }
  18130. .bind(this));
  18131. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18132. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18133. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18134. this.solidSkybox.low = null),
  18135. this.solidSkybox.needsUpdate = !0,
  18136. this.emit("load", a),
  18137. this.model.emit("load", this),
  18138. this
  18139. }
  18140. .bind(this), function() {
  18141. I.error("Downloading cubemap for pano", this.id, "failed"),
  18142. this.failedLoadingAt = Date.now()
  18143. }
  18144. .bind(this), function() {
  18145. return $.when(++t, 6)
  18146. })
  18147. }
  18148. ,
  18149. r.raycastsSkipped = 0,
  18150. r.raycastsDone = 0,
  18151. r.prototype.findNeighourPanos = function() {
  18152. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18153. this.model.panos.forEach(function(e) {
  18154. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18155. var t = this.position.distanceTo(e.position);
  18156. if (t > a.panoramaNeighbourMaxDistance)
  18157. return this.model.panos.setNeighbour(this, e, !1),
  18158. void r.raycastsSkipped++;
  18159. var i = e.position.clone().sub(this.position).normalize()
  18160. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18161. r.raycastsDone++,
  18162. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18163. 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)))
  18164. }
  18165. }
  18166. .bind(this)),
  18167. this.model.panos.neighbourMap[this.id]
  18168. }
  18169. ,
  18170. r.prototype.worldPosition = function() {
  18171. return this.position
  18172. }
  18173. ,
  18174. r.prototype.addTextSprite = function(e, t) {
  18175. this.removeTextSprite();
  18176. var i = document.createElement("canvas")
  18177. , n = i.getContext("2d");
  18178. i.width = 256,
  18179. i.height = 256;
  18180. n.font = "bold 60px Arial",
  18181. n.fillStyle = "white";
  18182. var r = n.measureText(e).width;
  18183. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18184. var o = new s.Texture(i);
  18185. o.needsUpdate = !0;
  18186. var a = new s.SpriteMaterial({
  18187. map: o,
  18188. color: t || 16428055
  18189. });
  18190. this.text3d = new s.Sprite(a),
  18191. this.text3d.position.copy(this.skyboxMesh.position),
  18192. this.floor.add(this.text3d)
  18193. }
  18194. ,
  18195. r.prototype.removeTextSprite = function() {
  18196. this.text3d && (this.floor.remove(this.text3d),
  18197. this.text3d = null)
  18198. }
  18199. ,
  18200. r.prototype.isAligned = function() {
  18201. return this.alignmentType === c.ALIGNED
  18202. }
  18203. ,
  18204. r.filters = {
  18205. inDirection: function(t, i, n) {
  18206. return function(e) {
  18207. return e.position.clone().sub(t).normalize().dot(i) > n
  18208. }
  18209. },
  18210. inFloorDirection: function(t, i, n) {
  18211. return function(e) {
  18212. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18213. }
  18214. },
  18215. inPanoDirection: function(n, r, o) {
  18216. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18217. function(e) {
  18218. var t = e.floorPosition.clone().sub(n).normalize()
  18219. , i = e.position.clone().sub(n).normalize();
  18220. return t.dot(r) > o || i.dot(r) > o
  18221. }
  18222. },
  18223. atFloor: function(t) {
  18224. return function(e) {
  18225. return !t || e.floor === t
  18226. }
  18227. },
  18228. not: function(t) {
  18229. return function(e) {
  18230. return e !== t
  18231. }
  18232. },
  18233. notIn: function(t) {
  18234. return function(e) {
  18235. return -1 === t.indexOf(e)
  18236. }
  18237. },
  18238. isLoaded: function() {
  18239. return function(e) {
  18240. return e.isLoaded()
  18241. }
  18242. },
  18243. isNotLoaded: function() {
  18244. return function(e) {
  18245. return !e.isLoaded()
  18246. }
  18247. },
  18248. isCloseEnoughTo: function(t, i) {
  18249. return function(e) {
  18250. return t.distanceTo(e.floorPosition) < i
  18251. }
  18252. },
  18253. hasMinimumHeightDifferenceTo: function(t, i) {
  18254. return function(e) {
  18255. return Math.abs(e.position.y - t.y) > i
  18256. }
  18257. },
  18258. isNotBehindNormal: function(t, i) {
  18259. var n = new s.Vector3;
  18260. return i = i.clone(),
  18261. function(e) {
  18262. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18263. }
  18264. },
  18265. isNeighbourPanoTo: function(t) {
  18266. return function(e) {
  18267. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18268. }
  18269. },
  18270. isNeighbourOfNeighbourTo: function(n) {
  18271. return function(i) {
  18272. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18273. var t = n.model.panos.get(e);
  18274. return !!t && t.neighbourPanos[i.id]
  18275. })
  18276. }
  18277. },
  18278. isNotRecentlyFailed: function(t) {
  18279. return function(e) {
  18280. return Date.now() - e.failedLoadingAt > t
  18281. }
  18282. },
  18283. isOnVisibleFloor: function() {
  18284. return function(e) {
  18285. return !e.floor.hidden
  18286. }
  18287. },
  18288. isPanoAligned: function() {
  18289. return function(e) {
  18290. return e.isAligned()
  18291. }
  18292. }
  18293. },
  18294. r.sortFunctions = {
  18295. distanceToPoint: function(i) {
  18296. return function(e, t) {
  18297. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18298. }
  18299. },
  18300. floorDistanceToPoint: function(i) {
  18301. return function(e, t) {
  18302. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18303. }
  18304. },
  18305. choose: function(i) {
  18306. return function(e, t) {
  18307. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18308. }
  18309. }
  18310. },
  18311. r.scoreFunctions = {
  18312. distance: function(t, i) {
  18313. return i = i || a.navigation.distanceFactor,
  18314. function(e) {
  18315. return t ? t.position.distanceTo(e.position) * i : 0
  18316. }
  18317. },
  18318. distanceSquared: function(t, i) {
  18319. return i = i || a.navigation.distanceFactor,
  18320. function(e) {
  18321. return t ? t.position.distanceToSquared(e.position) * i : 0
  18322. }
  18323. },
  18324. direction: function(t, i) {
  18325. return function(e) {
  18326. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18327. }
  18328. },
  18329. angle: function(t, i) {
  18330. return function(e) {
  18331. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18332. }
  18333. },
  18334. inFieldOfView: function(t, i) {
  18335. return function(e) {
  18336. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18337. }
  18338. },
  18339. optionality: function(t) {
  18340. return function(e) {
  18341. return e.neighbourUUIDs.filter(function(e) {
  18342. return !(e in t.neighbourUUIDs) && e !== t.id
  18343. }).length * a.navigation.optionalityFactor
  18344. }
  18345. },
  18346. penalizeHeightDifferenceUnder: function(t, i) {
  18347. return function(e) {
  18348. return t.y - e.position.y < i ? -20 : 0
  18349. }
  18350. }
  18351. },
  18352. M.exports = r
  18353. }
  18354. ).call(this, "/js/objects/Panorama.js")
  18355. }
  18356. , {
  18357. "../enum/AlignmentType": 17,
  18358. "../enum/GLCubeFaces": 25,
  18359. "../enum/PanoRendererEvents": 35,
  18360. "../enum/PanoSizeClass": 36,
  18361. "../enum/PanoramaEvents": 37,
  18362. "../enum/RenderLayers": 41,
  18363. "../enum/RenderOrder": 42,
  18364. "../enum/TileDownloaderEvents": 45,
  18365. "../enum/Viewmode": 51,
  18366. "../exception/BasicException": 55,
  18367. "../scene/SceneRenderer": 158,
  18368. "../settings": 166,
  18369. "../tile/TileUtils": 174,
  18370. "../util/ajax": 181,
  18371. "../util/common": 185,
  18372. "../util/lerp": 188,
  18373. "../util/logger": 189,
  18374. "../util/panorama": 191,
  18375. "../util/texture": 194,
  18376. "../util/transitions": 195,
  18377. events: 202,
  18378. three: 217
  18379. }],
  18380. 149: [function(e, t, i) {
  18381. "use strict";
  18382. function n(e) {
  18383. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18384. t.map.value = d,
  18385. t.opacity.value = 0,
  18386. t.color.value.set(o.reticuleColor),
  18387. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  18388. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18389. side: r.DoubleSide,
  18390. depthWrite: !1,
  18391. depthTest: !1,
  18392. transparent: !0,
  18393. vertexShader: c.waypoint.vertexShader,
  18394. fragmentShader: c.waypoint.fragmentShader,
  18395. uniforms: t,
  18396. name: "waypoint",
  18397. opacity: 0,
  18398. visible: t.showMouseMarker
  18399. })),
  18400. this.layers.set(h.RETICULE),
  18401. this.renderOrder = u.reticule,
  18402. this.player = e,
  18403. this.direction = new r.Vector3,
  18404. this.hidden = !0,
  18405. this.mouseLastMoveTime = Date.now()
  18406. }
  18407. var r = e("three")
  18408. , o = e("../settings")
  18409. , a = e("../util/transitions")
  18410. , s = e("../util/texture")
  18411. , l = e("../util/lerp")
  18412. , c = e("../shaders")
  18413. , h = e("../enum/RenderLayers")
  18414. , u = e("../enum/RenderOrder")
  18415. , d = s.load("images/reticule-256x256.png");
  18416. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18417. this.hidden = i,
  18418. this.mouseLastMoveTime = Date.now()
  18419. }
  18420. ,
  18421. n.prototype.hide = function() {
  18422. this.hidden || (this.hidden = !0,
  18423. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18424. }
  18425. ,
  18426. n.prototype.show = function() {
  18427. this.hidden = !1,
  18428. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18429. }
  18430. ,
  18431. n.prototype.update = function() {
  18432. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18433. }
  18434. ,
  18435. n.prototype.updatePosition = function(e, t) {
  18436. if (!this.hidden) {
  18437. if (!t)
  18438. return this.hide();
  18439. var i = t.point
  18440. , n = e.distanceTo(i)
  18441. , r = 1 + .01 * n;
  18442. n < 1 && (r -= 1 - n),
  18443. this.show(),
  18444. this.scale.set(r, r, r),
  18445. this.direction = this.direction.multiplyScalar(.8),
  18446. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18447. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18448. this.lookAt(this.position.clone().add(this.direction))
  18449. }
  18450. }
  18451. ,
  18452. n.prototype.writeAstag = function() {
  18453. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18454. , t = new Date;
  18455. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18456. var i = {
  18457. enabled: !0,
  18458. version: "0",
  18459. created: t.toISOString(),
  18460. created_by: "APITest",
  18461. position: this.position.clone(),
  18462. stem: {
  18463. enabled: o.tags.pole.enabled,
  18464. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18465. },
  18466. label: "tag " + this.tagCount,
  18467. description: "Description " + e,
  18468. floor: function(e) {
  18469. if (e.currentFloor) {
  18470. var t = e.floors.indexOf(e.currentFloor);
  18471. return -1 < t ? t : void 0
  18472. }
  18473. }(this.player.model),
  18474. type: "info",
  18475. metadata: {
  18476. preferred_camera: {
  18477. mode: this.player.mode
  18478. }
  18479. }
  18480. };
  18481. console.log("--------------------------"),
  18482. console.log(JSON.stringify(i));
  18483. var n = this.player.model.addtag(e, i).build();
  18484. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18485. n.visible || n.show(o.tags.startup.fadeInDuration))
  18486. }
  18487. ,
  18488. t.exports = n
  18489. }
  18490. , {
  18491. "../enum/RenderLayers": 41,
  18492. "../enum/RenderOrder": 42,
  18493. "../settings": 166,
  18494. "../shaders": 167,
  18495. "../util/lerp": 188,
  18496. "../util/texture": 194,
  18497. "../util/transitions": 195,
  18498. three: 217
  18499. }],
  18500. 150: [function(e, t, i) {
  18501. "use strict";
  18502. function n(e, t) {
  18503. this.chunks = [],
  18504. this.floorId = e,
  18505. this.roomId = t,
  18506. this.position = new l.Vector3
  18507. }
  18508. var l = e("three");
  18509. n.prototype.addChunk = function(e) {
  18510. this.chunks.push(e)
  18511. }
  18512. ,
  18513. n.prototype.calcBoundaries = function() {
  18514. 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++) {
  18515. var a = this.chunks[o].geometry.attributes.position;
  18516. if (a)
  18517. for (var s = 0; s < a.array.length; s += 3)
  18518. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18519. t.add(e),
  18520. 0 === s ? (i.copy(e),
  18521. n.copy(e)) : (i.max(e),
  18522. n.min(e)),
  18523. r++
  18524. }
  18525. 0 < r ? (t.multiplyScalar(1 / r),
  18526. this.average = t) : this.average = null,
  18527. this.boundsMax = i,
  18528. this.boundsMin = n,
  18529. this.center = new l.Vector3,
  18530. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18531. }
  18532. ,
  18533. t.exports = n
  18534. }
  18535. , {
  18536. three: 217
  18537. }],
  18538. 151: [function(o, v, e) {
  18539. (function(e) {
  18540. "use strict";
  18541. function t(e, t, i) {
  18542. this.obj3d = null,
  18543. this.nodes = [],
  18544. this.colorHull = [],
  18545. this.shortPaths = {},
  18546. this.floorHull = null,
  18547. this.cameraHull = null,
  18548. this.floorPathDistance = 0,
  18549. this.floorCurvePoints = null,
  18550. this.floorCurveColors = null,
  18551. this.camCurvePoints = null,
  18552. this.warpDestHeroLoc = null,
  18553. this.warpDestPano = null,
  18554. this.warpPathPoints = null,
  18555. this.warpPathLengths = [0],
  18556. this.warpLength = 0,
  18557. this.closeWarpDistance = 4,
  18558. this.UP = U.UP.clone(),
  18559. this.longestStep = 0,
  18560. this.upcomingTransType = null,
  18561. this.burnsDir = 1,
  18562. this.prevNextDist = 0,
  18563. this.nextI = 0,
  18564. this.activeTransType = null,
  18565. this.lastTransType = null,
  18566. this.bunnyObj = null,
  18567. this.director = e,
  18568. this.player = t,
  18569. this.playerControls = i,
  18570. this.modelManager = t.modelManager,
  18571. this.updateModel(),
  18572. this.updateDefaultsFromModelData(),
  18573. this.bindEvents(),
  18574. this.warping = !1,
  18575. this.waitingToWarp = !1,
  18576. this.warpInterrupted = !1,
  18577. this.warpInterruptionBlackoutStyle = null,
  18578. this.warpInterruptionTravelTime = null
  18579. }
  18580. 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"),
  18581. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18582. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18583. 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"),
  18584. pathEnd: n.load("images/End.png"),
  18585. 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==")
  18586. };
  18587. t.prototype.setScene = function(e) {
  18588. this.createCpm(e),
  18589. this.createBunnyObj(e)
  18590. }
  18591. ,
  18592. t.prototype.updateModel = function() {
  18593. this.model = this.modelManager.getActiveModel()
  18594. }
  18595. ,
  18596. t.prototype.bindEvents = function() {
  18597. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18598. }
  18599. ,
  18600. t.prototype.updateDefaultsFromModelData = function() {
  18601. this.model.data
  18602. }
  18603. ,
  18604. t.prototype.pointPathDistance = function(e) {
  18605. for (var t = 0, i = 1; i < e.length; i += 1)
  18606. t += e[i - 1].distanceTo(e[i]);
  18607. return t
  18608. }
  18609. ,
  18610. t.prototype.pointPathLengths = function(e) {
  18611. for (var t = [0], i = 1; i < e.length; i += 1)
  18612. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18613. return t
  18614. }
  18615. ,
  18616. t.prototype.interpAlongPath = function(e, t, i) {
  18617. var n, r = new P.Vector3, o = t[t.length - 1];
  18618. if (i < 1) {
  18619. n = i * o;
  18620. for (var a = 1; a < t.length; a += 1)
  18621. if (t[a] > n) {
  18622. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18623. return r.copy(e[a]),
  18624. r.sub(e[a - 1]),
  18625. r.multiplyScalar(s),
  18626. r.add(e[a - 1]),
  18627. r
  18628. }
  18629. } else
  18630. r.copy(e[e.length - 1]);
  18631. return r
  18632. }
  18633. ,
  18634. t.prototype.pathHeight = function() {
  18635. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18636. }
  18637. ,
  18638. t.prototype.createBunnyObj = function(e) {
  18639. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18640. this.bunnyObj.visible = D.warp.showBunny),
  18641. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18642. e.add(this.bunnyObj)
  18643. }
  18644. ,
  18645. t.prototype.createCpm = function(e) {
  18646. if (!this.currentPanoMarker) {
  18647. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18648. t.material.uniforms.opacity.value = 0,
  18649. this.currentPanoMarker = {
  18650. mesh: t,
  18651. placed: !1
  18652. }
  18653. }
  18654. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18655. this.placeCpm(),
  18656. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18657. }
  18658. ,
  18659. t.prototype.placeCpm = function() {
  18660. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18661. var e = this.player.currentPano.floor;
  18662. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18663. e.add(this.currentPanoMarker.mesh)),
  18664. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18665. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18666. this.currentPanoMarker.placed = !0
  18667. } else
  18668. this.popOutCpm()
  18669. }
  18670. ,
  18671. t.prototype.fadeInCpm = function(e) {
  18672. 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)
  18673. }
  18674. ,
  18675. t.prototype.fadeOutCpm = function(e) {
  18676. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18677. }
  18678. ,
  18679. t.prototype.popInCpm = function() {
  18680. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18681. }
  18682. ,
  18683. t.prototype.popOutCpm = function() {
  18684. this.fadeOutCpm(2)
  18685. }
  18686. ,
  18687. t.prototype.brushPrefs = {
  18688. linewidth: 7,
  18689. strokeWidth: 15,
  18690. cvSegments: 48,
  18691. paveStep: .1,
  18692. paveWidth: .2,
  18693. lookBlendDist: 3,
  18694. maxTurn: P.Math.degToRad(2)
  18695. },
  18696. t.prototype.panoPathDistance = function(e) {
  18697. var t = this.model.panos;
  18698. if (!e || e.length < 2)
  18699. return 0;
  18700. for (var i = [], n = 0; n < e.length; n += 1)
  18701. i.push(t.get(e[n]).floorPosition);
  18702. return this.pointPathDistance(i)
  18703. }
  18704. ,
  18705. t.prototype.loadTileTexture = function(t) {
  18706. var e = n.load(t, function(e) {
  18707. e.wrapS = P.RepeatWrapping,
  18708. e.wrapT = P.RepeatWrapping,
  18709. e.needsUpdate = !0,
  18710. H.debug('path texture "' + t + '" is ready')
  18711. }, function() {
  18712. H.error('path texture "' + t + '" failed')
  18713. });
  18714. return e.mapping = P.UVMapping,
  18715. e
  18716. }
  18717. ,
  18718. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18719. return new l({
  18720. cameraMode: n,
  18721. position: e,
  18722. quaternion: t,
  18723. panoId: i,
  18724. orthoZoom: o,
  18725. floorVisibility: r,
  18726. thumbUrl: null,
  18727. name: null
  18728. })
  18729. }
  18730. ,
  18731. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18732. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18733. }
  18734. ,
  18735. t.prototype.setWarpDestination = function(e) {
  18736. this.warpDestHeroLoc = e
  18737. }
  18738. ,
  18739. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18740. var t = this.getHeroDescriptorByHeroIndex(e);
  18741. return null !== t && (this.setWarpDestination(t),
  18742. !0)
  18743. }
  18744. ,
  18745. t.prototype.setWarpDestinationByPano = function(e, t) {
  18746. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18747. }
  18748. ,
  18749. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18750. var i = this.model.panos.get(e);
  18751. if (i) {
  18752. t = t || new P.Quaternion;
  18753. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18754. return this.setWarpDestination(n),
  18755. !0
  18756. }
  18757. return !1
  18758. }
  18759. ,
  18760. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18761. var t = this.model.heroCount();
  18762. if (null !== this.warpDestHeroLoc && t < 2)
  18763. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18764. this.model.getHeroDescriptorByIndex(0);
  18765. var i = this.model.getHeroDescriptorByIndex(e);
  18766. if (i) {
  18767. var n = i.isPano() ? i.panoId : i.cameraMode;
  18768. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18769. }
  18770. return i
  18771. }
  18772. ,
  18773. t.prototype.getHeroDescriptorByPano = function(e) {
  18774. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18775. }
  18776. ,
  18777. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18778. var t = this.getHeroIndexFromPanoId(e);
  18779. return this.getHeroDescriptorByHeroIndex(t)
  18780. }
  18781. ,
  18782. t.prototype.getHeroIndexFromPanoId = function(e) {
  18783. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18784. var i = this.model.heroLocations[t]
  18785. , n = this.getHeroId(i);
  18786. if (n && n === e)
  18787. return t
  18788. }
  18789. return -1
  18790. }
  18791. ,
  18792. t.prototype.getHeroPano = function(e) {
  18793. if (null === e)
  18794. return H.warn("getHeroPano(): no destination"),
  18795. null;
  18796. var t = this.getHeroId(e)
  18797. , i = this.model.panos.get(t);
  18798. return void 0 === i && (i = null,
  18799. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18800. i
  18801. }
  18802. ,
  18803. t.prototype.getHeroId = function(e) {
  18804. return e.panoId
  18805. }
  18806. ,
  18807. t.prototype.setWarpDestPano = function() {
  18808. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18809. this.warpDestPano
  18810. }
  18811. ,
  18812. t.prototype.brushToWarpPano = function(e, t) {
  18813. if (this.discardPathObject(),
  18814. !this.setWarpDestPano())
  18815. return !1;
  18816. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18817. !this.warpDestPano)
  18818. return H.info("No brush"),
  18819. !1;
  18820. if (!this.player.currentPano)
  18821. return H.debug("No current pano, visibility undefined"),
  18822. !1;
  18823. if (!this.warpDestPano)
  18824. return H.info("No wPano, visibility undefined"),
  18825. !1;
  18826. if (!this.warpDestPano.isAligned())
  18827. return H.debug("Cannot brush to unaligned pano"),
  18828. !1;
  18829. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18830. , n = !0;
  18831. if (this.player.currentPano.id === this.warpDestPano.id)
  18832. H.debug("Already at destination pano");
  18833. else {
  18834. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18835. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18836. this.obj3d = new P.Object3D,
  18837. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18838. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18839. e = t) : (this.setPathHulls(this.nodes),
  18840. this.setFloorCurves(),
  18841. 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)))),
  18842. this.player.currentPano.floor.add(this.obj3d);
  18843. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18844. , o = e === L.STD;
  18845. if (!n && (i || o)) {
  18846. if (r) {
  18847. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18848. this.obj3d.add(a)
  18849. }
  18850. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18851. this.obj3d.add(s)
  18852. }
  18853. this.appearSlow()
  18854. }
  18855. return this.upcomingTransType = e,
  18856. !n
  18857. }
  18858. ,
  18859. t.prototype.findShortestPath = function(e, t) {
  18860. if (!e || !t)
  18861. return null;
  18862. var i = D.warp.walkExtraPanosDistance
  18863. , n = e.id + ":" + t.id + ":" + i;
  18864. if (this.shortPaths.hasOwnProperty(n))
  18865. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18866. var r = t.id + ":" + e.id + ":" + i;
  18867. if (this.shortPaths.hasOwnProperty(r))
  18868. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18869. var o = this.model.panos.aStarSearch(e, t);
  18870. return this.model.panos.includeNodesNearPath(o, i),
  18871. this.shortPaths[n] = o ? o.slice() : null,
  18872. o
  18873. }
  18874. ,
  18875. t.prototype.makePathHulls = function(e) {
  18876. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18877. r = (t = h.get(e[0])).floor.floorIndex;
  18878. for (var u = 0; u < e.length; u += 1)
  18879. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18880. s.push(i),
  18881. l.push(t.position.clone()),
  18882. n = t.floor.floorIndex,
  18883. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18884. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18885. return a > this.longestStep && (this.longestStep = a,
  18886. H.debug("path contains " + a + " meter segment")),
  18887. {
  18888. floor: s,
  18889. camera: l,
  18890. color: c
  18891. }
  18892. }
  18893. ,
  18894. t.prototype.makeFloorCurves = function(e, t, i) {
  18895. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18896. , r = this.pointPathDistance(e) - 2 * n
  18897. , o = e.slice(0)
  18898. , a = o[1].clone().sub(o[0]);
  18899. a.y = 0,
  18900. a.normalize().multiplyScalar(n),
  18901. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18902. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18903. a.normalize().multiplyScalar(n),
  18904. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18905. var s = new P.CatmullRomCurve3(o)
  18906. , l = Math.floor(r / i);
  18907. l = 4 * Math.floor(l / 4),
  18908. l = Math.max(4, l);
  18909. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18910. h = 0,
  18911. c = u[f].distanceTo(e[0]);
  18912. for (var g = 1; g < e.length; g += 1)
  18913. p.copy(u[f]).sub(e[g]),
  18914. p.y *= 4,
  18915. p.length() < c && (h = g);
  18916. d.push(t[h])
  18917. }
  18918. return {
  18919. distance: r,
  18920. points: u,
  18921. colors: d
  18922. }
  18923. }
  18924. ,
  18925. t.prototype.makeCameraCurvePoints = function(e, t) {
  18926. var i = this.pointPathDistance(e);
  18927. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18928. }
  18929. ,
  18930. t.prototype.makeCameraCurveTangents = function(e, t) {
  18931. var i = this.pointPathDistance(e)
  18932. , n = new P.CatmullRomCurve3(e)
  18933. , r = Math.max(2, Math.floor(i / t));
  18934. r = r || 5;
  18935. for (var o = [], a = 0; a <= r; a++)
  18936. o.push(n.getTangentAt(a / r));
  18937. return o
  18938. }
  18939. ,
  18940. t.prototype.setPathHulls = function(e) {
  18941. var t = this.makePathHulls(e);
  18942. this.floorHull = t.floor,
  18943. this.cameraHull = t.camera,
  18944. this.colorHull = t.color
  18945. }
  18946. ,
  18947. t.prototype.setFloorCurves = function() {
  18948. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18949. this.floorPathDistance = e.distance,
  18950. this.floorCurvePoints = e.points,
  18951. this.floorCurveColors = e.colors
  18952. }
  18953. ,
  18954. t.prototype.setCameraCurvePoints = function() {
  18955. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18956. }
  18957. ,
  18958. t.prototype.chooseWarpPath = function(e) {
  18959. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18960. if (this.player.currentPano === this.warpDestPano || !e)
  18961. return this.warpPathPoints = null,
  18962. this.warpLength = 0,
  18963. !1;
  18964. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18965. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18966. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18967. t.multiplyScalar(.15).add(r.position),
  18968. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18969. t.y = r.position.y,
  18970. i.y = this.warpDestPano.position.y,
  18971. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18972. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18973. this.setCameraCurvePoints(),
  18974. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18975. this.warpLength = 0,
  18976. this.warpPathLengths = [0];
  18977. 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) {
  18978. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18979. var h = o.length();
  18980. o.y *= D.warp.climbEffort;
  18981. var u = o.length() / h;
  18982. if (1 < c) {
  18983. o.setY(0).normalize(),
  18984. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18985. var d = Math.min(1, o.dot(a))
  18986. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18987. u = Math.max(p, u)
  18988. }
  18989. this.warpLength += h * u,
  18990. this.warpPathLengths[c] = this.warpLength
  18991. }
  18992. return !0
  18993. }
  18994. ,
  18995. t.prototype.drawPathRibbon = function(e, t) {
  18996. this.bunnyObj.visible = D.warp.showBunny;
  18997. 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) {
  18998. a.copy(e[s]),
  18999. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19000. a.normalize(),
  19001. n.crossVectors(a, U.UP),
  19002. n.multiplyScalar(i);
  19003. var l = (new P.Vector3).copy(e[s]).add(r);
  19004. l.sub(n),
  19005. o.vertices.push(l),
  19006. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19007. o.vertices.push(l)
  19008. }
  19009. var c, h, u, d = 0;
  19010. for (s = 0; s < e.length - 1; s += 1) {
  19011. var p = 2 * s
  19012. , f = d
  19013. , g = d += e[s + 1].distanceTo(e[s])
  19014. , m = t[s]
  19015. , v = t[s + 1];
  19016. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19017. o.faces.push(c),
  19018. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19019. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19020. o.faces.push(c),
  19021. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19022. }
  19023. o.computeFaceNormals(),
  19024. o.computeVertexNormals(),
  19025. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19026. u.opacity.value = 0,
  19027. u.color.value.set(D.path.color),
  19028. new P.RawShaderMaterial({
  19029. side: P.DoubleSide,
  19030. depthWrite: !1,
  19031. transparent: !0,
  19032. vertexShader: C.ribbon.vertexShader,
  19033. fragmentShader: C.ribbon.fragmentShader,
  19034. uniforms: u,
  19035. name: "ribbonT",
  19036. opacity: 0
  19037. })) : new P.MeshBasicMaterial({
  19038. color: 16777215,
  19039. side: P.DoubleSide,
  19040. name: "ribbonOut",
  19041. vertexColors: P.VertexColors
  19042. });
  19043. var y = new P.Mesh(o,h);
  19044. return y.name = "ribbon",
  19045. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19046. y
  19047. }
  19048. ,
  19049. t.prototype.drawPathPavement = function(e) {
  19050. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19051. r.copy(e[o]),
  19052. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19053. r.normalize(),
  19054. i.crossVectors(r, U.UP),
  19055. i.multiplyScalar(this.brushPrefs.paveWidth),
  19056. (t = (new P.Vector3).copy(e[o])).sub(i),
  19057. n.vertices.push(t),
  19058. n.vertices.push((new P.Vector3).copy(e[o])),
  19059. (t = (new P.Vector3).copy(e[o])).add(i),
  19060. n.vertices.push(t);
  19061. var a, s, l;
  19062. for (o = 0; o < e.length - 1; o += 1)
  19063. a = 3 * o + 1,
  19064. l = .25 + (s = .25 * o),
  19065. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19066. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19067. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19068. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19069. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19070. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19071. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19072. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19073. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19074. color: D.path.color,
  19075. side: P.DoubleSide,
  19076. transparent: !0,
  19077. depthWrite: !1,
  19078. opacity: 0,
  19079. name: "paveT",
  19080. map: I.path
  19081. }) : new P.MeshBasicMaterial({
  19082. color: D.path.color,
  19083. side: P.DoubleSide,
  19084. transparent: !0,
  19085. depthWrite: !1,
  19086. opacity: 1,
  19087. name: "paveO",
  19088. map: I.path
  19089. });
  19090. return new P.Mesh(n,c)
  19091. }
  19092. ,
  19093. t.prototype.hintPrefs = {
  19094. rad: .18,
  19095. width: .0125,
  19096. depth: .0625,
  19097. setBack: -.04,
  19098. markRad: .25,
  19099. markInnerRad: .16
  19100. },
  19101. t.prototype.makeWaypointObj = function(e, t) {
  19102. var i = new P.Geometry
  19103. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19104. , r = this.pathHeight();
  19105. 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)),
  19106. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19107. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19108. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19109. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19110. o.map.value = e,
  19111. o.opacity.value = 0,
  19112. o.color.value.set(D.path.color);
  19113. var a = {
  19114. side: P.DoubleSide,
  19115. depthWrite: !1,
  19116. transparent: !0,
  19117. vertexShader: C.waypoint.vertexShader,
  19118. fragmentShader: C.waypoint.fragmentShader,
  19119. uniforms: o,
  19120. name: "waypoint",
  19121. opacity: 0
  19122. };
  19123. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19124. a.name = "wayPtOut");
  19125. var s = new P.RawShaderMaterial(a)
  19126. , l = new P.Mesh(i,s);
  19127. return l.name = t,
  19128. l
  19129. }
  19130. ,
  19131. t.prototype.makeStartMarker = function(e, t) {
  19132. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19133. i.y = 0,
  19134. i.normalize();
  19135. var n = Math.acos(i.x)
  19136. , r = this.makeWaypointObj(I.pathStart, "Start");
  19137. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19138. r.position.copy(e),
  19139. r
  19140. }
  19141. ,
  19142. t.prototype.makeEndMarker = function(e) {
  19143. var t = this.makeWaypointObj(I.pathEnd, "End")
  19144. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19145. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19146. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19147. t.position.copy(e),
  19148. t
  19149. }
  19150. ,
  19151. t.prototype.pathClean = function(e) {
  19152. if (e) {
  19153. for (var t in e.children)
  19154. this.pathClean(e.children[t]);
  19155. e.geometry && e.geometry.dispose(),
  19156. e.material && e.material.dispose()
  19157. }
  19158. }
  19159. ,
  19160. t.prototype.discardPathObject = function() {
  19161. if (this.obj3d) {
  19162. var e = this.obj3d.parent;
  19163. e && e.remove(this.obj3d),
  19164. this.pathClean(this.obj3d)
  19165. }
  19166. this.obj3d = null,
  19167. this.popInCpm()
  19168. }
  19169. ,
  19170. t.prototype.discardSlow = function() {
  19171. if (this.obj3d) {
  19172. if (this.player.mode !== O.PANORAMA)
  19173. return void this.discardPathObject();
  19174. for (var e, t = 0, i = function() {
  19175. this.discardPathObject()
  19176. }
  19177. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19178. 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]),
  19179. t += 1,
  19180. i = null);
  19181. 0 === t && this.discardPathObject(),
  19182. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19183. }
  19184. }
  19185. ,
  19186. t.prototype.appearSlow = function() {
  19187. var e;
  19188. this.fadeOutCpm(D.path.fadeInTime);
  19189. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19190. 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]))
  19191. }
  19192. ,
  19193. t.prototype.update = function() {
  19194. this.obj3d && this.obj3d.updateMatrixWorld()
  19195. }
  19196. ,
  19197. t.prototype.calcBurnsAmount = function(e) {
  19198. var n = P.Math.degToRad(D.warp.burnsAngle);
  19199. if (this.player.mode !== O.PANORAMA)
  19200. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19201. var t = this.burnsDir * n;
  19202. if (this.upcomingTransType === L.BLACK)
  19203. return t;
  19204. var i = e;
  19205. if (null === i)
  19206. return H.warn("Transition request for non-highlight"),
  19207. t;
  19208. var r = this.getHeroDescriptorByHeroIndex(i);
  19209. if (null === r)
  19210. return t;
  19211. if (!r.isPano())
  19212. return t;
  19213. function o(e) {
  19214. var t = Math.acos(Math.min(1, e.dot(l)))
  19215. , i = (new P.Vector3).crossVectors(l, e);
  19216. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19217. }
  19218. var a = this.getHeroPano(r)
  19219. , s = this.playerControls.cameras[O.PANORAMA]
  19220. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19221. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19222. if (a === this.player.currentPano)
  19223. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19224. var h = this.findShortestPath(this.player.currentPano, a);
  19225. if (null == h || h.length < 1)
  19226. return H.debug("Empty path ahead..."),
  19227. t;
  19228. var u = this.makePathHulls(h)
  19229. , d = new P.CatmullRomCurve3(u.camera)
  19230. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19231. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19232. }
  19233. ,
  19234. t.prototype.waitNextStep = function(e, t, i) {
  19235. var o = null == i ? D.warp.tourStepDelay : i;
  19236. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19237. var a = new P.Euler
  19238. , s = new P.Vector3;
  19239. H.debug("Starting wait: " + (void 0 !== t));
  19240. var l = this.calcBurnsAmount(e)
  19241. , c = function() {
  19242. this.endWarpState(),
  19243. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19244. t && t()
  19245. }
  19246. .bind(this)
  19247. , n = function(e, t) {
  19248. if (this.warpInterrupted)
  19249. return c(),
  19250. !0;
  19251. var i = t || 1e3 / 60;
  19252. if (D.warp.doBurns)
  19253. if (this.player.mode === O.PANORAMA) {
  19254. var n = this.playerControls.cameras[O.PANORAMA];
  19255. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19256. var r = i * l / o;
  19257. a.y += r,
  19258. s.set(0, 0, -1),
  19259. s.applyEuler(a),
  19260. s.add(n.position),
  19261. n.controls.lookAt(s),
  19262. n.controls.lookVector.copy(s),
  19263. n.lookAt(s)
  19264. } else
  19265. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19266. }
  19267. .bind(this);
  19268. this.startWarpState(),
  19269. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19270. /* var r = player.model.heroLocations[app.director.currentItem];
  19271. this.player.zoomEnabled = !0;
  19272. var h = function(e, t) {
  19273. //console.log(e),
  19274. this.player.zoomTo(e * r.zoom.toFixed(2), !0)
  19275. }
  19276. .bind(this);
  19277. V.start(h, 2e3, null, 0, B.easeOutQuad, "zoom") */
  19278. }
  19279. ,
  19280. t.prototype.warpToNonPano = function(e) {
  19281. if (this.discardPathObject(),
  19282. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19283. var t = function() {
  19284. e && e()
  19285. }
  19286. .bind(this);
  19287. this.player.flyToNewMode({
  19288. mode: this.warpDestHeroLoc.cameraMode,
  19289. duration: D.warp.outsideTime,
  19290. warpDest: this.warpDestHeroLoc,
  19291. callback: t,
  19292. force: !0
  19293. })
  19294. } else
  19295. H.warn("no warp destination!!!"),
  19296. e && e()
  19297. }
  19298. ,
  19299. t.prototype._resetWarpShaderParams = function(e) {
  19300. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19301. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19302. }
  19303. ,
  19304. t.prototype._clearWarpShading = function() {
  19305. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19306. this._resetWarpShaderParams(e[t]),
  19307. e[t].visible = !0;
  19308. this._resetWarpShaderParams(this.model.skybox)
  19309. }
  19310. ,
  19311. t.prototype._warpStopFlying = function() {
  19312. this.activeTransType = null,
  19313. this.placeCpm()
  19314. }
  19315. ,
  19316. t.prototype._wrapupTravelOnlyBits = function() {
  19317. this._warpStopFlying(),
  19318. this.warpPathPoints && (this.player.currentPano.exit(),
  19319. this.warpDestPano.enter(),
  19320. this.player.currentPano = this.warpDestPano),
  19321. this.player.spider.draw(),
  19322. this.placeCpm()
  19323. }
  19324. ,
  19325. t.prototype._wrapupTravel = function(e) {
  19326. this._wrapupTravelOnlyBits(),
  19327. this.warpCameraAim(e)
  19328. }
  19329. ,
  19330. t.prototype._wrapupWarpShading = function(e) {
  19331. this._clearWarpShading(),
  19332. this._wrapupTravel(e)
  19333. }
  19334. ,
  19335. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19336. t !== z.END && this._clearWarpShading(),
  19337. this._wrapupTravelOnlyBits(),
  19338. this.upcomingTransType = null,
  19339. e && e()
  19340. }
  19341. ,
  19342. t.prototype._warpCameraAim = function(e, t) {
  19343. var i = this.warpDestHeroLoc.quaternion
  19344. , n = this.playerControls.cameras[O.PANORAMA]
  19345. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19346. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19347. , a = P.Math.radToDeg(Math.acos(o))
  19348. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19349. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19350. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19351. c.y = N.constrainedTurn(c.y),
  19352. this.burnsDir = Math.sign(c.y);
  19353. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19354. , u = new P.Vector3
  19355. , d = function(e, t) {
  19356. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19357. h.y = l.y + e * c.y,
  19358. h.z = l.z + e * c.z,
  19359. u.set(0, 0, -1),
  19360. u.applyEuler(h),
  19361. u.add(n.position),
  19362. n.controls.lookAt(u),
  19363. n.controls.lookVector.copy(u),
  19364. void n.lookAt(u))
  19365. }
  19366. .bind(this);
  19367. 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"),
  19368. void (t && t()))
  19369. }
  19370. ,
  19371. t.prototype._warpBendAim = function(e, t, i, n) {
  19372. var r = n || 0
  19373. , o = this.playerControls.cameras[O.PANORAMA]
  19374. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19375. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19376. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19377. l.y = N.constrainedTurn(l.y);
  19378. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19379. l.x = c * Math.sign(l.x),
  19380. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19381. this.burnsDir = Math.sign(l.y),
  19382. c *= Math.sign(l.y),
  19383. l.y = c;
  19384. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19385. , u = new P.Vector3
  19386. , d = function(e, t) {
  19387. if (e < .5)
  19388. h.x = s.x + e * l.x,
  19389. h.y = s.y + e * l.y,
  19390. h.z = s.z + e * l.z;
  19391. else {
  19392. var i = (1 - e) * D.warp.softBendEnd;
  19393. h.x = a.x - i * l.x,
  19394. h.y = a.y - i * l.y,
  19395. h.z = a.z - i * l.z
  19396. }
  19397. u.set(0, 0, -1),
  19398. u.applyEuler(h),
  19399. u.add(o.position),
  19400. o.controls.lookAt(u),
  19401. o.controls.lookVector.copy(u),
  19402. o.lookAt(u)
  19403. }
  19404. .bind(this);
  19405. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19406. }
  19407. ,
  19408. t.prototype._warpStepCameraAim = function(e, t, i) {
  19409. var n = this.playerControls.cameras[O.PANORAMA]
  19410. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19411. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19412. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19413. a.y = N.constrainedTurn(a.y),
  19414. this.burnsDir = Math.sign(a.y);
  19415. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19416. , l = new P.Vector3
  19417. , c = function(e, t) {
  19418. e < .5 ? s.copy(o) : s.copy(r),
  19419. l.set(0, 0, -1),
  19420. l.applyEuler(s),
  19421. l.add(n.position),
  19422. n.controls.lookAt(l),
  19423. n.controls.lookVector.copy(l),
  19424. n.lookAt(l)
  19425. }
  19426. .bind(this);
  19427. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19428. }
  19429. ,
  19430. t.prototype.setBurnsDir = function() {
  19431. var e = this.playerControls.cameras[O.PANORAMA]
  19432. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19433. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19434. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19435. n.y = N.constrainedTurn(n.y),
  19436. this.burnsDir = Math.sign(n.y)
  19437. }
  19438. ,
  19439. t.prototype.stepWarpPath = function(e, t) {
  19440. var i = this.playerControls.cameras[O.PANORAMA];
  19441. if (!this.warpPathPoints)
  19442. return i.position.copy(this.warpDestPano.position),
  19443. !0;
  19444. var n = this.warpPathPoints[0]
  19445. , r = this.warpDestPano.position;
  19446. if (null !== this.nodes && 1 < this.cameraHull.length) {
  19447. var o = new P.Vector3;
  19448. 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),
  19449. i.position.copy(o)
  19450. } else
  19451. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19452. }
  19453. ,
  19454. t.prototype.interruptAndFastForward = function(e, t) {
  19455. this.warping && (this.warpInterrupted = !0,
  19456. this.warpInterruptionBlackoutStyle = e,
  19457. this.warpInterruptionTravelTime = t,
  19458. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19459. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19460. }
  19461. ,
  19462. t.prototype.warpCameraAim = function(e) {
  19463. var t = D.warp.minWarpTime;
  19464. if (this.upcomingTransType === L.BLACK)
  19465. t = D.warp.teleportTime;
  19466. else {
  19467. var i = this.playerControls.cameras[O.PANORAMA]
  19468. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19469. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19470. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19471. o.y = N.constrainedTurn(o.y);
  19472. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19473. t = Math.max(t, a)
  19474. }
  19475. var s = function() {
  19476. this._warpStopFlying(),
  19477. this.discardSlow(),
  19478. e && e()
  19479. }
  19480. .bind(this);
  19481. this._warpCameraAim(t, s)
  19482. }
  19483. ,
  19484. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19485. this.model.skybox.material.uniforms.blackout.value = n;
  19486. var r = F.uniform(this.model.skybox, "progress", 1)
  19487. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19488. , a = !1
  19489. , s = function() {
  19490. if (this.warpInterrupted)
  19491. return a = !0
  19492. }
  19493. .bind(this)
  19494. , l = function(e, t) {
  19495. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19496. }
  19497. .bind(this)
  19498. , c = function(e, t) {
  19499. return i && a ? (o(0),
  19500. !0) : void o(e, t)
  19501. }
  19502. .bind(this);
  19503. V.start(s, e, null, t, null, "safeHaltWatch"),
  19504. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19505. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19506. }
  19507. ,
  19508. t.prototype.warpTravel_STD = function(e) {
  19509. 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),
  19510. 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;
  19511. t += this.warpLength * D.warp.timePerMeter,
  19512. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19513. function n(e) {
  19514. var t = i;
  19515. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19516. }
  19517. var y = !1
  19518. , r = this.warpDestHeroLoc.quaternion
  19519. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19520. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19521. , a = A.dot(o)
  19522. , C = P.Math.radToDeg(Math.acos(a))
  19523. , s = function() {
  19524. return m.lookAt(g, l, U.UP),
  19525. u.setFromRotationMatrix(m, D.warp.eOrder),
  19526. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19527. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19528. N.constrainedTurn(v.y)
  19529. }
  19530. .bind(this)
  19531. , I = function(e, t) {
  19532. if (this.warpInterrupted)
  19533. return y = !0
  19534. }
  19535. .bind(this)
  19536. , E = function(e, t) {
  19537. return y || !this.warpPathPoints ? (k.blur(0),
  19538. !0) : void k.blur(e)
  19539. }
  19540. .bind(this)
  19541. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19542. , b = function(e, t) {
  19543. return y || !this.warpPathPoints ? (_(0),
  19544. !0) : void _(e, t)
  19545. }
  19546. .bind(this)
  19547. , w = function(e, t) {
  19548. if (!this.warpPathPoints)
  19549. return h.position.copy(this.warpDestPano.position),
  19550. !0;
  19551. if (y)
  19552. return !0;
  19553. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19554. h.position.copy(i),
  19555. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19556. }
  19557. .bind(this)
  19558. , T = function(e, t) {
  19559. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19560. !0)
  19561. }
  19562. .bind(this)
  19563. , x = function(e, t) {
  19564. if (y)
  19565. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19566. !0;
  19567. if (!this.warpPathPoints)
  19568. return !0;
  19569. var i = this.warpLength * e
  19570. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19571. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19572. D.warp.matchCam && (n *= 1 - r),
  19573. m.lookAt(g, l, U.UP),
  19574. u.setFromRotationMatrix(m, D.warp.eOrder),
  19575. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19576. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19577. v.y = N.constrainedTurn(v.y),
  19578. u.x = p.x + n * v.x,
  19579. u.y = p.y + n * v.y,
  19580. u.z = p.z + n * v.z,
  19581. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19582. v.y = N.constrainedTurn(v.y);
  19583. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19584. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19585. f.x = f.x + v.x * D.warp.turnFriction,
  19586. f.y = f.y + v.y * D.warp.turnFriction,
  19587. f.z = f.z + v.z * D.warp.turnFriction,
  19588. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19589. var a = l.clone().sub(g).normalize();
  19590. if (C < D.warp.maxAimRotation && 0 < r) {
  19591. var s = 1 - r;
  19592. a.x = a.x * s + r * A.x,
  19593. a.y = a.y * s + r * A.y,
  19594. a.z = a.z * s + r * A.z,
  19595. a.normalize()
  19596. }
  19597. this.bunnyObj.position.copy(h.position).add(a),
  19598. d.set(0, 0, -1).applyEuler(f).normalize(),
  19599. d.multiplyScalar(8),
  19600. d.add(h.position),
  19601. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19602. h.controls.lookVector.copy(d),
  19603. h.lookAt(d))
  19604. }
  19605. .bind(this)
  19606. , S = function() {
  19607. y ? (this.discardSlow(),
  19608. this.upcomingTransType = L.BLACK,
  19609. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19610. }
  19611. .bind(this);
  19612. T(0);
  19613. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19614. , R = M / (t += M);
  19615. this.warpCommonParameters(t, R, !0, z.NONE),
  19616. V.start(I, t, null, 0, null, "_haltWatcher"),
  19617. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19618. V.start(E, t, null, R, n, "blurring")),
  19619. V.start(b, t, null, R, n, "modelAlpha"),
  19620. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19621. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19622. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19623. }
  19624. ,
  19625. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19626. var r = e || 0;
  19627. null != t || (t = D.warp.teleportTime),
  19628. this.warpCommonParameters(t, r, !1, i),
  19629. this.model.chunks.forEach(function(e) {
  19630. e.material.uniforms.blackout.value = i
  19631. }),
  19632. this._warpBendAim(null, t, null, r);
  19633. var o = function() {
  19634. this.wrapupWarpShadingOnly(n, i)
  19635. }
  19636. .bind(this);
  19637. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19638. }
  19639. ,
  19640. t.prototype.flightStepWalk = (a = new P.Vector3,
  19641. s = new P.Vector3,
  19642. function(e, t, i) {
  19643. if (this.warpInterrupted)
  19644. i && i();
  19645. else if (this.activeTransType !== L.WALK)
  19646. this._clearWarpShading(),
  19647. this._warpStopFlying(),
  19648. this.player.spider.draw(),
  19649. this.placeCpm(),
  19650. i && i();
  19651. else if (this.player.currentPano !== e) {
  19652. var n = {
  19653. pano: e,
  19654. lookAtPoint: t,
  19655. duration: null,
  19656. maxDistanceOverride: D.warp.walkMaxDist,
  19657. skipWarpingCheck: !1,
  19658. constantMoveSpeed: !0
  19659. };
  19660. n.duration = function(e, t) {
  19661. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19662. s.copy(U.FORWARD),
  19663. this.player.getDirection(s),
  19664. a.copy(t).sub(e.position).normalize();
  19665. var n = a.dot(s)
  19666. , r = Math.acos(n)
  19667. , o = r / i;
  19668. return .001 < o && (i *= o / .001,
  19669. r < 1 && (i *= 1.2)),
  19670. i
  19671. }
  19672. .call(this, e, t),
  19673. this.player.nonInterruptingFlyToPano(n, i)
  19674. } else
  19675. i && i()
  19676. }
  19677. ),
  19678. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19679. return this.flightStepWalk.bind(this, e, t, i)
  19680. }
  19681. ,
  19682. t.prototype.warpTravel_WALK = (f = [],
  19683. function(e) {
  19684. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19685. var o = this.nodes[r]
  19686. , a = t.get(o);
  19687. this.nodes.length,
  19688. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19689. i && n || (f.push(o),
  19690. i = a)
  19691. }
  19692. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19693. var s = f.length
  19694. , l = t.get(f[s - 1])
  19695. , c = new Array(s + 1);
  19696. c[c.length - 1] = function() {
  19697. e && e()
  19698. }
  19699. .bind(this);
  19700. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19701. var d = f[h];
  19702. l = t.get(d);
  19703. var p = new P.Vector3;
  19704. this.getLookAtForWalkingTourNode(f, h, p),
  19705. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19706. h--
  19707. }
  19708. c[0]()
  19709. }
  19710. ),
  19711. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19712. h = new P.Vector3,
  19713. u = new P.Vector3,
  19714. d = new P.Vector3,
  19715. p = new P.Vector3,
  19716. function(e, t, i) {
  19717. var n = e.length;
  19718. if (n <= t)
  19719. return !1;
  19720. var r = 1
  19721. , o = 1;
  19722. h.set(0, 0, 0),
  19723. p.set(0, 0, 0);
  19724. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19725. if (a = this.player.model.panos.get(e[s]),
  19726. this.getOrientationForWalkingTourNode(e, s, u),
  19727. s === t && c.copy(u),
  19728. d.copy(u),
  19729. t < s) {
  19730. var l = d.dot(c) < .65;
  19731. r *= l ? .2 : .75,
  19732. o *= l ? .2 : .4
  19733. }
  19734. u.multiplyScalar(r),
  19735. h.add(u),
  19736. p.lerp(a.position, o)
  19737. }
  19738. return h.normalize(),
  19739. i.copy(p),
  19740. i.add(h),
  19741. !0
  19742. }
  19743. ),
  19744. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19745. var n = e.length;
  19746. if (n <= t)
  19747. return !1;
  19748. if (t === n - 1)
  19749. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19750. else {
  19751. var r = this.player.model.panos.get(e[t])
  19752. , o = this.player.model.panos.get(e[t + 1]);
  19753. i.copy(o.position).sub(r.position)
  19754. }
  19755. return i.normalize(),
  19756. !0
  19757. }
  19758. ,
  19759. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19760. if (this.activeTransType = this.upcomingTransType,
  19761. this.lastTransType = this.activeTransType,
  19762. this.upcomingTransType = null,
  19763. e)
  19764. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19765. this._clearWarpShading(),
  19766. this._warpStopFlying(),
  19767. this.player.spider.draw(),
  19768. this.placeCpm(),
  19769. n && n()
  19770. }
  19771. .bind(this)) : this.warpTravel_STD(n);
  19772. else {
  19773. var r = function() {
  19774. this._wrapupTravel(n)
  19775. }
  19776. .bind(this)
  19777. , o = {
  19778. pano: this.warpDestPano,
  19779. lookAtPoint: null,
  19780. duration: null,
  19781. maxDistanceOverride: null,
  19782. skipWarpingCheck: !1
  19783. };
  19784. this.player.flyToPano(o, r)
  19785. }
  19786. }
  19787. ,
  19788. t.prototype.startWarpState = function() {
  19789. this.warping = !0,
  19790. this.warpInterrupted = !1,
  19791. this.warpInterruptionBlackoutStyle = null,
  19792. this.warpInterruptionTravelTime = null
  19793. }
  19794. ,
  19795. t.prototype.endWarpState = function() {
  19796. this.warping = !1
  19797. }
  19798. ,
  19799. t.prototype.warpToPano = function(e, t, i, n) {
  19800. if (this.warping)
  19801. H.warn("Cannot warp when already warping");
  19802. else {
  19803. if (this.upcomingTransType = e,
  19804. this.activeTransType = null,
  19805. !this.setWarpDestPano())
  19806. return this.upcomingTransType = null,
  19807. void this.warpToNonPano(n);
  19808. if (this.player.mode !== O.PANORAMA)
  19809. return this.upcomingTransType = null,
  19810. this.discardSlow(),
  19811. void this.player.flyToNewMode({
  19812. mode: O.PANORAMA,
  19813. pano: this.warpDestPano,
  19814. duration: D.warp.outsideTime,
  19815. warpDest: this.warpDestHeroLoc,
  19816. callback: n,
  19817. force: !0
  19818. });
  19819. if (!this.warpDestPano)
  19820. return H.warn("no warp destination, callback dropped"),
  19821. void (this.upcomingTransType = null);
  19822. 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)
  19823. , o = this.chooseWarpPath(r);
  19824. if (o && this.upcomingTransType !== L.WALK) {
  19825. var a = function() {
  19826. this.waitingToWarp = !1,
  19827. this.warpToPano(e, t, i, n)
  19828. }
  19829. .bind(this);
  19830. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19831. return void (this.waitingToWarp = !0)
  19832. }
  19833. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19834. this.player.currentPano = this.warpDestPano,
  19835. this.placeCpm(),
  19836. this.fadeOutCpm(D.path.fadeOutTime),
  19837. this.player.spider.draw()),
  19838. H.debug("Warping to pano ", this.warpDestPano.position),
  19839. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19840. this.startWarpState();
  19841. var s = function() {
  19842. this.endWarpState(),
  19843. n && n()
  19844. }
  19845. .bind(this);
  19846. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19847. }
  19848. }
  19849. ,
  19850. v.exports = t
  19851. }
  19852. ).call(this, "/js/objects/ShowPath.js")
  19853. }
  19854. , {
  19855. "../constants": 8,
  19856. "../effects": 16,
  19857. "../enum/BlackoutStyle": 18,
  19858. "../enum/ModelManagerEvents": 33,
  19859. "../enum/PlayerEvents": 40,
  19860. "../enum/RenderOrder": 42,
  19861. "../enum/Vectors": 50,
  19862. "../enum/Viewmode": 51,
  19863. "../enum/WarpStyle": 52,
  19864. "../gui/gui": 65,
  19865. "../model/ModelManager": 140,
  19866. "../objects/Snapshot": 153,
  19867. "../settings": 166,
  19868. "../shaders": 167,
  19869. "../util/easing": 186,
  19870. "../util/lerp": 188,
  19871. "../util/logger": 189,
  19872. "../util/math": 190,
  19873. "../util/texture": 194,
  19874. "../util/transitions": 195,
  19875. three: 217
  19876. }],
  19877. 152: [function(e, t, i) {
  19878. "use strict";
  19879. function n() {
  19880. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19881. , t = new r.RawShaderMaterial({
  19882. fragmentShader: o.skysphere.fragmentShader,
  19883. vertexShader: o.skysphere.vertexShader,
  19884. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19885. side: r.BackSide,
  19886. name: "skysphere"
  19887. });
  19888. t.uniforms.radius.value = e.parameters.radius,
  19889. r.Mesh.call(this, e, t)
  19890. }
  19891. var r = e("three")
  19892. , o = e("../shaders")
  19893. , a = e("../settings");
  19894. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19895. t.exports = n
  19896. }
  19897. , {
  19898. "../settings": 166,
  19899. "../shaders": 167,
  19900. three: 217
  19901. }],
  19902. 153: [function(r, o, e) {
  19903. (function(e) {
  19904. "use strict";
  19905. function t(e) {
  19906. n.call(this, e),
  19907. this.sid = e.sid,
  19908. this.panoId = e.panoId,
  19909. this.orthoZoom = e.orthoZoom,
  19910. this.floorVisibility = e.floorVisibility,
  19911. this.thumbUrl = e.thumbUrl,
  19912. this.name = e.name,
  19913. this.zoom = e.zoom
  19914. }
  19915. var i = (r("three"),
  19916. r("../util/logger"))
  19917. , n = (r("../settings"),
  19918. r("../enum/Viewmode"),
  19919. r("../util/common"),
  19920. r("../util/transitions"),
  19921. r("../util/lerp"),
  19922. r("../util/ajax"),
  19923. r("../util/texture"),
  19924. r("./View"));
  19925. r("events").EventEmitter,
  19926. new i(e),
  19927. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19928. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19929. }
  19930. ,
  19931. o.exports = t
  19932. }
  19933. ).call(this, "/js/objects/Snapshot.js")
  19934. }
  19935. , {
  19936. "../enum/Viewmode": 51,
  19937. "../settings": 166,
  19938. "../util/ajax": 181,
  19939. "../util/common": 185,
  19940. "../util/lerp": 188,
  19941. "../util/logger": 189,
  19942. "../util/texture": 194,
  19943. "../util/transitions": 195,
  19944. "./View": 154,
  19945. events: 202,
  19946. three: 217
  19947. }],
  19948. 154: [function(o, a, e) {
  19949. (function(e) {
  19950. "use strict";
  19951. function t(e) {
  19952. e = e || {},
  19953. this.position = new i.Vector3,
  19954. this.quaternion = new i.Quaternion,
  19955. this.update(e)
  19956. }
  19957. var i = o("three")
  19958. , n = o("../util/logger")
  19959. , r = (o("../settings"),
  19960. o("../enum/Viewmode"),
  19961. o("../util/common"),
  19962. o("../util/transitions"),
  19963. o("../util/lerp"),
  19964. o("../util/ajax"),
  19965. o("../util/texture"),
  19966. o("events").EventEmitter);
  19967. new n(e),
  19968. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19969. return !!this.cameraMode
  19970. }
  19971. ,
  19972. t.prototype.update = function(e) {
  19973. return this.cameraMode = e.cameraMode || this.cameraMode,
  19974. this.pano = e.pano || this.pano,
  19975. e.position && this.position.copy(e.position),
  19976. e.quaternion && this.quaternion.copy(e.quaternion),
  19977. this
  19978. }
  19979. ,
  19980. a.exports = t
  19981. }
  19982. ).call(this, "/js/objects/View.js")
  19983. }
  19984. , {
  19985. "../enum/Viewmode": 51,
  19986. "../settings": 166,
  19987. "../util/ajax": 181,
  19988. "../util/common": 185,
  19989. "../util/lerp": 188,
  19990. "../util/logger": 189,
  19991. "../util/texture": 194,
  19992. "../util/transitions": 195,
  19993. events: 202,
  19994. three: 217
  19995. }],
  19996. 155: [function(J, ee, e) {
  19997. (function(e) {
  19998. "use strict";
  19999. function t(e) {
  20000. this.currentPano = null,
  20001. this.nextPano = null,
  20002. this.camera = null,
  20003. this.paused = !1,
  20004. this.flying = !1,
  20005. this.sceneIntersectionPlane = null,
  20006. this.target = new B.Vector3,
  20007. this.mouse = new B.Vector3(1.1,1.1,.5),
  20008. this.mouseAtMouseDown = new B.Vector2,
  20009. this.mouseCouldBeClickToMove = !1,
  20010. this.mouseLastMoveTime = Date.now(),
  20011. this.mouseDown = !1,
  20012. this.mouseDownTimer = null,
  20013. this.couldBeLongTap = !1,
  20014. this.containsMouse = !0,
  20015. this.isTouchEvent = !1,
  20016. this.isPanoHover = !1,
  20017. this.reticule = new n(this),
  20018. this.panoMarkers = [],
  20019. this.spider = new s(this),
  20020. this.quaternion = new B.Quaternion,
  20021. this.position = new B.Vector3(15,10,15),
  20022. this.previousState = null,
  20023. this.lastInsideView = new o,
  20024. this.last360View = new o,
  20025. this.raycaster = new B.Raycaster,
  20026. this.intersect = null,
  20027. this.lastChangeTime = Date.now(),
  20028. this.history = new h,
  20029. this.cameraControls = null,
  20030. this.path = null,
  20031. this.model = null,
  20032. this.domElement = null,
  20033. this.cachedPanoCandidates = null,
  20034. this.basePanoSize = 0,
  20035. this.standardPanoSize = 0,
  20036. this.highPanoSize = 0,
  20037. this.ultraHighPanoSize = 0,
  20038. this.zoomLevel = 1,
  20039. this.zooming = 0,
  20040. this.zoomSpeed = .5,
  20041. this.scrollZoomSpeed = .06,
  20042. this.zoomSpeedAdjust = .05,
  20043. this.defaultZoomIncrement = .2,
  20044. this.baseFov = k.insideFOV,
  20045. this.zoomFov = this.baseFov,
  20046. this.zoomEnabled = !0,
  20047. this.preRenderingEnabled = !1,
  20048. this.setupCustomProperties(e),
  20049. this.zoomStats = new v,
  20050. this.modeTran = ''
  20051. this.currentCursor = '';
  20052. }
  20053. var B = J("three")
  20054. , i = J("./util/logger")
  20055. , n = J("./objects/Reticule")
  20056. , a = J("./objects/Panorama")
  20057. , r = J("./objects/ShowPath")
  20058. , o = J("./objects/View")
  20059. , s = (J("./objects/Snapshot"),
  20060. J("./objects/NSpider"))
  20061. , V = J("./enum/Viewmode")
  20062. , T = (J("./enum/TagStates"),
  20063. J("./enum/Vectors"))
  20064. , l = J("./enum/Keys")
  20065. , k = (J("./enum/AlignmentType"),
  20066. J("./settings"))
  20067. , x = J("./util/common")
  20068. , U = (J("./util/browser"),
  20069. J("./util/math"))
  20070. , H = J("./util/lerp")
  20071. , z = J("./util/easing")
  20072. , G = J("./util/transitions")
  20073. , c = J("events").EventEmitter
  20074. , h = (J("./shaders"),
  20075. J("./util/history"))
  20076. , S = (J("./util/camera"),
  20077. J("./model/ModelManager"),
  20078. J("./enum/PathDiscardMode"))
  20079. , M = J("./enum/PathDisplayMode")
  20080. , W = J("./enum/PlayerEvents")
  20081. , u = J("./enum/ControlEvents")
  20082. , d = J("./enum/ModelManagerEvents")
  20083. , R = J("./enum/WarpStyle")
  20084. , P = J("./enum/BlackoutStyle")
  20085. , p = J("./exception/BasicException")
  20086. , f = J("./enum/PanoSizeClass")
  20087. , g = (J("./tile/TileDownloader"),
  20088. J("./tile/TilePrioritizer"))
  20089. , m = (J("./enum/PanoramaEvents"),
  20090. J("./enum/ZoomEvents"))
  20091. , v = J("./util/ZoomStats")
  20092. , y = J("./constants")
  20093. , j = J("./util/common")
  20094. , A = J("./util/cameraLight")
  20095. , C = J("hot")
  20096. , Y = new i(e)
  20097. , q = Object.freeze({
  20098. FlyToPano: G.getUniqueId(),
  20099. FlyToNewMode: G.getUniqueId(),
  20100. FlyToSameMode: G.getUniqueId(),
  20101. FlyToViewFloor: G.getUniqueId(),
  20102. LookTransition: G.getUniqueId(),
  20103. ZoomTransition: G.getUniqueId()
  20104. });
  20105. function I(e) {
  20106. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20107. o[r] = n.charCodeAt(r);
  20108. return new Blob([o],{
  20109. type: i
  20110. })
  20111. }
  20112. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20113. (window.player = this).modelManager = e.modelManager,
  20114. this.tileDownloader = e.tileDownloader,
  20115. this.panoRenderer = e.panoRenderer,
  20116. this.qualityManager = e.qualityManager,
  20117. this.domElement = e.container,
  20118. this.camera = e.camera,
  20119. this.tagManager = e.tagManager,
  20120. this.cameraControls = e.controls,
  20121. this.path = new r(e.director,this,e.controls),
  20122. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20123. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20124. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20125. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20126. this.tileDownloader.processPriorityQueue = !1,
  20127. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20128. this.bindEvents(e.container),
  20129. this.updateModel()
  20130. }
  20131. ,
  20132. t.prototype.screenShot = function(i) {
  20133. if (!this.flying && !this.flyingToTag) {
  20134. var n = this.sceneRenderer;
  20135. for (var e in n.updateScreenSize(i),
  20136. this.model.panos.index)
  20137. this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
  20138. this.model.panos.index[e].marker.visible = !1);
  20139. for (var e in this.model.hots)
  20140. this.model.hots[e].mesh.visible = !1;
  20141. this.reticule.visible = !1,
  20142. this.reticule.forceUnvisible = !0,
  20143. this.path.currentPanoMarker.mesh.visible = !1,
  20144. setTimeout(function() {
  20145. n.renderer.clear(!0, !0, !0),
  20146. n.renderer.render(n.scene, n.camera);
  20147. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20148. for (var t in i.f && i.f(e),
  20149. n.updateScreenSize({
  20150. resize: !0
  20151. }),
  20152. this.reticule.visible = !0,
  20153. this.model.hots)
  20154. this.model.hots[t].mesh.visible = !0;
  20155. for (var t in this.model.panos.index)
  20156. this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  20157. this.path.currentPanoMarker.mesh.visible = !0,
  20158. n.renderer.render(n.scene, n.camera)
  20159. }
  20160. .bind(this), 30)
  20161. }
  20162. }
  20163. ;
  20164. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20165. t.prototype.getWrapShot = function() {
  20166. var i = this.getSnapAngleInfo()
  20167. , n = ",{\r\t" + i
  20168. , r = arguments[0];
  20169. this.screenShot({
  20170. width: g_snapShotWidth,
  20171. height: g_snapShotHeight,
  20172. type: "image/jpeg",
  20173. f: function(e) {
  20174. if (r && r.__callback)
  20175. return r.__callback(e, i);
  20176. var t = new Image;
  20177. t.src = e,
  20178. t.onload = function() {
  20179. var e = function(r, i) {
  20180. function n(e, t) {
  20181. var i = o || r
  20182. , n = document.createElement("canvas");
  20183. n.width = i.width,
  20184. n.height = i.height,
  20185. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20186. o = Q(e, n, t)
  20187. }
  20188. function e() {
  20189. var e = o || r
  20190. , t = I(e.src);
  20191. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20192. t = I(e.src)),
  20193. (o = o || new Image).base64Src = e.src,
  20194. o.src = window.URL.createObjectURL(t)
  20195. }
  20196. var o, t = Math.max(r.width, r.height);
  20197. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20198. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20199. e())),
  20200. o || r
  20201. }(this, {
  20202. maxSize: g_snapShotWidth,
  20203. oldType: "jpeg"
  20204. });
  20205. e.src.replace(function(e) {
  20206. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20207. }("image/jpeg"), "image/octet-stream");
  20208. var t = "snap" + (new Date).getTime();
  20209. !function(e, t) {
  20210. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20211. i.href = e,
  20212. i.download = t;
  20213. var n = document.createEvent("MouseEvents");
  20214. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20215. i.dispatchEvent(n)
  20216. }(e.src, t + ".jpg"),
  20217. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20218. n += '\r\t"sid":"' + t + '",',
  20219. n += '\r\t"name":"' + t + '"\r}',
  20220. logData(n)
  20221. }
  20222. }
  20223. })
  20224. }
  20225. /* ,
  20226. t.prototype.getSnapAngleInfo = function() {
  20227. var e = {}
  20228. , t = '"metadata":{'
  20229. , i = this.camera.quaternion.clone();
  20230. switch (this.mode) {
  20231. case "panorama":
  20232. e.scan_id = this.currentPano.id,
  20233. t += '"scan_id":"' + this.currentPano.id + '",';
  20234. break;
  20235. case "floorplan":
  20236. e.camera_mode = 1,
  20237. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20238. t += '"camera_mode":1,',
  20239. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20240. break;
  20241. case "dollhouse":
  20242. e.camera_mode = 2,
  20243. t += '"camera_mode":2,'
  20244. }
  20245. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20246. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20247. n.x *= -1,
  20248. n.w *= -1,
  20249. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20250. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20251. e.zoom = this.zoomLevel,
  20252. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20253. }
  20254. , */
  20255. t.prototype.getSnapAngleInfo = function(){
  20256. var info = {};
  20257. var str = '"metadata":{';
  20258. var q = this.camera.quaternion.clone();
  20259. switch (this.mode) {
  20260. case "panorama":
  20261. info.scan_id = this.currentPano.id;
  20262. str += ('"scan_id":"'+this.currentPano.id+'",');
  20263. break;
  20264. case "floorplan":
  20265. info.camera_mode = 1;
  20266. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20267. q.multiply(this.camera.quaternion);
  20268. str += ('"camera_mode":1,');
  20269. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20270. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20271. break;
  20272. case "dollhouse":
  20273. info.camera_mode = 2;
  20274. str += ('"camera_mode":2,');
  20275. break;
  20276. }
  20277. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20278. //console.log(info.camera_position)
  20279. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20280. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20281. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20282. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20283. out.x *= -1;
  20284. out.w *= -1;
  20285. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20286. }else{
  20287. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20288. } */
  20289. info.zoom = this.zoomLevel;
  20290. //console.log(info.camera_quaternion)
  20291. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20292. // fyz 扩展编辑页面, 加上导览点缩放值
  20293. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20294. console.log(str)
  20295. return str;
  20296. }
  20297. //------end
  20298. t.prototype.closePopup = function() {
  20299. if (g_currentHot) {
  20300. g_currentHot = null,
  20301. document.getElementById("popup").style.display = "none",
  20302. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20303. $("#popup iframe:last").remove();
  20304. document.getElementById("bgaudio");
  20305. if(g_bgAudio && g_bgAudio.pauseByHot){
  20306. manage.switchBgmState(true)
  20307. }
  20308. return false
  20309. }
  20310. }
  20311. ,
  20312. t.prototype.setupCustomProperties = function(e) {
  20313. var i = e || V.PANORAMA;
  20314. Object.defineProperty(this, "mode", {
  20315. get: function() {
  20316. return i
  20317. },
  20318. set: function(e) {
  20319. var t = i;
  20320. i = e,
  20321. this.onModeUpdated(t, i)
  20322. }
  20323. })
  20324. }
  20325. ,
  20326. t.prototype.isInMode = function() {
  20327. for (var e = 0; e < arguments.length; e++)
  20328. if (this.mode === arguments[e])
  20329. return !0;
  20330. return !1
  20331. }
  20332. ,
  20333. t.prototype.isOutsideMode = function(e) {
  20334. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20335. }
  20336. ,
  20337. t.prototype.is360View = function(e, t) {
  20338. return e === V.PANORAMA && t && !t.isAligned()
  20339. }
  20340. ,
  20341. t.prototype.setScene = function(e) {
  20342. this.sceneIntersectionPlane = e.plane,
  20343. this.path.setScene(e),
  20344. this.moveReticuleToScene(e)
  20345. }
  20346. ,
  20347. t.prototype.moveReticuleToScene = function(e) {
  20348. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20349. e.add(this.reticule)
  20350. }
  20351. ,
  20352. t.prototype.updateModel = function() {
  20353. function n(e) {
  20354. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20355. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20356. , n = t.position.y + (e - i.target.y)
  20357. , r = k.showFloorDuration + k.showFloorDelay;
  20358. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20359. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20360. }
  20361. this.model = this.modelManager.getActiveModel(),
  20362. this.model.on("floor.changed", function(e, t, i) {
  20363. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20364. }
  20365. .bind(this)),
  20366. this.model.on("allfloors.toggled", function(e, t) {
  20367. if (this.mode === V.DOLLHOUSE) {
  20368. var i = e ? this.model.center.y : i = t.center.y;
  20369. n.call(this, i)
  20370. }
  20371. }
  20372. .bind(this)),
  20373. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20374. var t = this;
  20375. this.model.panos.list.forEach(function(e) {
  20376. e.vrMarker.addEventListener("click", function() {
  20377. t.flyToPano({
  20378. pano: e
  20379. })
  20380. })
  20381. })
  20382. }
  20383. ,
  20384. t.prototype.updateModelDependentData = function() {
  20385. this.cameraControls.setModelForControls(this.model),
  20386. this.getPanoMarkersFromModel(this.model)
  20387. }
  20388. ,
  20389. t.prototype.onModelChanged = function() {
  20390. this.updateModel(),
  20391. this.updateModelDependentData()
  20392. }
  20393. ,
  20394. t.prototype.getPanoMarkersFromModel = function(e) {
  20395. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20396. return t.marker ? e.concat(t.marker) : e
  20397. }, [])
  20398. }
  20399. ,
  20400. t.prototype.handleControlMove = function(e) {
  20401. this.emit(W.Move, e)
  20402. }
  20403. ,
  20404. t.prototype.handleControlInputStart = function(e) {
  20405. this.emit(W.InputStart, e)
  20406. }
  20407. ,
  20408. t.prototype.onModeUpdated = function(e, t) {
  20409. this.cameraControls.activateControls(t),
  20410. this.emit(W.ModeChanged, e, t)
  20411. }
  20412. ,
  20413. t.prototype.isWarping = function() {
  20414. return this.path.warping
  20415. }
  20416. ,
  20417. t.prototype.isWaitingToWarp = function() {
  20418. return this.path.waitingToWarp
  20419. }
  20420. ,
  20421. t.prototype.getLabelScaleFactor = function() {
  20422. if (this.isOutsideMode()) {
  20423. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20424. }
  20425. return .5
  20426. }
  20427. ,
  20428. t.prototype.changeMusic = function() {
  20429. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20430. }
  20431. ,
  20432. t.prototype.bindEvents = function(e) {
  20433. e !== document && e.setAttribute("tabindex", -1),
  20434. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20435. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20436. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20437. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20438. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20439. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20440. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20441. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20442. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20443. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20444. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20445. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20446. document.addEventListener("pointerup", ()=>{//add
  20447. window.transformControls && transformControls.onPointerUp()
  20448. }),
  20449. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20450. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20451. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20452. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20453. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20454. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20455. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20456. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20457. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20458. window.getSeft && getSeft(this),
  20459. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20460. }
  20461. ,
  20462. t.prototype.onMouseDown = function(e) {
  20463. e.currentTarget !== document && e.currentTarget.focus(),
  20464. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20465. this.updateIntersect())
  20466. }
  20467. ,
  20468. t.prototype.onMouseMove = function(e) {
  20469. this.isTouchEvent = !1,
  20470. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20471. }
  20472. ,
  20473. t.prototype.onMouseOver = function(e) {
  20474. this.containsMouse = !0,
  20475. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20476. }
  20477. ,
  20478. t.prototype.onMouseOut = function(e) {
  20479. this.containsMouse = !1
  20480. }
  20481. ,
  20482. t.prototype.onMouseUp = function(e) {
  20483. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20484. }
  20485. ,
  20486. t.prototype.onTouchStart = function(e) {
  20487. if (e.currentTarget !== document && e.currentTarget.focus(),
  20488. !this.mouseDown) {
  20489. this.couldBeLongTap = !0;
  20490. var t = x.average(e.changedTouches, "clientX")
  20491. , i = x.average(e.changedTouches, "clientY");
  20492. this.handleInputStart.call(this, t, i, !0),
  20493. this.mouseDownTimer = setTimeout(function() {
  20494. this.updateIntersect(),
  20495. this.handleInputEnd.call(this, t, i, !0)
  20496. }
  20497. .bind(this), k.input.longTapThreshold)
  20498. }
  20499. }
  20500. ,
  20501. t.prototype.onTouchMove = function(e) {
  20502. var t = x.average(e.changedTouches, "clientX")
  20503. , i = x.average(e.changedTouches, "clientY");
  20504. this.handleInputMove.call(this, t, i, !0)
  20505. }
  20506. ,
  20507. t.prototype.onTouchEnd = function(e) {
  20508. if (clearTimeout(this.mouseDownTimer),
  20509. this.mouseDown) {
  20510. this.couldBeLongTap = !1,
  20511. this.updateIntersect();
  20512. var t = x.average(e.changedTouches, "clientX")
  20513. , i = x.average(e.changedTouches, "clientY");
  20514. this.handleInputEnd.call(this, t, i, !0)
  20515. }
  20516. }
  20517. ,
  20518. t.prototype.onPointerDown = function(e) {
  20519. return e.currentTarget !== document && e.currentTarget.focus(),
  20520. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20521. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20522. void (this.mouseDownTimer = setTimeout(function() {
  20523. this.updateIntersect(),
  20524. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20525. }
  20526. .bind(this), k.input.longTapThreshold)))
  20527. }
  20528. ,
  20529. t.prototype.onPointerMove = function(e) {
  20530. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20531. }
  20532. ,
  20533. t.prototype.onPointerUp = function(e) {
  20534. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20535. this.couldBeLongTap = !1,
  20536. this.updateIntersect(),
  20537. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20538. }
  20539. ,
  20540. t.prototype.onPointerOut = function(e) {
  20541. this.mouseDown = !1
  20542. }
  20543. ,
  20544. t.prototype.onPointerCancel = function(e) {
  20545. this.mouseDown = !1
  20546. }
  20547. ,
  20548. t.prototype.onKeyDown = function(e) {
  20549. var t = function() {
  20550. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20551. }
  20552. .bind(this)
  20553. , i = e.which;
  20554. switch (i) {
  20555. case l.F:
  20556. t(),
  20557. this.changeFloor(-1);
  20558. break;
  20559. case l.R:
  20560. t(),
  20561. this.changeFloor(1)
  20562. }
  20563. if (this.mode === V.PANORAMA)
  20564. switch (i) {
  20565. case l.UPARROW:
  20566. case l.W:
  20567. this.flyLocalDirection(T.FORWARD.clone());
  20568. break;
  20569. case l.DOWNARROW:
  20570. case l.S:
  20571. this.flyLocalDirection(T.BACK.clone());
  20572. break;
  20573. case l.A:
  20574. this.flyLocalDirection(T.LEFT.clone());
  20575. break;
  20576. case l.D:
  20577. this.flyLocalDirection(T.RIGHT.clone())
  20578. }
  20579. }
  20580. ,
  20581. t.prototype.handleScrollPinchZoom = function(e) {
  20582. var t = e
  20583. , i = this.zoomLevel;
  20584. this.zoomBy(t),
  20585. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20586. }
  20587. ,
  20588. t.prototype.handleControlPinch = function(e) {
  20589. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20590. }
  20591. ,
  20592. t.prototype.handleControlScroll = function(e) {
  20593. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20594. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20595. }
  20596. ,
  20597. t.prototype.handleInputStart = function(e, t, i) {
  20598. var n = this.handelPadding(e, t);
  20599. e = n.x,
  20600. t = n.y,
  20601. this.isTouchEvent = i,
  20602. U.convertScreenPositionToNDC(e, t, this.mouse),
  20603. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20604. this.mouseCouldBeClickToMove = !0,
  20605. this.mouseDown = !0,
  20606. this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20607. window.transformControls && transformControls.onPointerDown()
  20608. if(!this.overlayInitedPlay && this.overlayGroup.children.length){
  20609. try{
  20610. this.overlayGroup.children.forEach((overlay)=>{
  20611. overlay.overlayType == "video" && overlay.plane.material.map.image.play()
  20612. })
  20613. }catch(e){}
  20614. this.overlayInitedPlay = true
  20615. }
  20616. }
  20617. ,
  20618. t.prototype.handelPadding = function(e, t) {
  20619. return this.pad || (this.pad = {
  20620. x: dom.getOffset("left", $("#player")[0]),
  20621. y: dom.getOffset("top", $("#player")[0])
  20622. }),
  20623. {
  20624. x: e - this.pad.x,
  20625. y: t - this.pad.y
  20626. }
  20627. }
  20628. ,
  20629. t.prototype.handleInputMove = function(e, t, i) {
  20630. var n = this.handelPadding(e, t);
  20631. e = n.x,
  20632. t = n.y,
  20633. this.isTouchEvent = i,
  20634. U.convertScreenPositionToNDC(e, t, this.mouse);
  20635. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20636. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20637. this.couldBeLongTap = !1,
  20638. clearTimeout(this.mouseDownTimer)),
  20639. this.mouseLastMoveTime = Date.now(),
  20640. this.reticule.move(e, t, i)
  20641. window.transformControls && transformControls.onPointerMove()
  20642. }
  20643. ,
  20644. t.prototype.handleInputEnd = function(e, t, i) {
  20645. if (this.isTouchEvent = i,
  20646. this.mouseDown = !1,
  20647. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20648. !i && this.couldBeLongTap)
  20649. return !0;
  20650. if (this.handleLongTap())
  20651. return !0;
  20652. window.transformControls && transformControls.onPointerUp()
  20653. if (this.mouseCouldBeClickToMove) {
  20654. if (this.flying)
  20655. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20656. !0;
  20657. //add----
  20658. if (this.checkHotClick())
  20659. return !0;
  20660. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20661. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20662. return;
  20663. }
  20664. if (window.VisiSet && VisiSet.setTagVisible ) {
  20665. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20666. return;
  20667. }
  20668. if(this.hoveringPlane){
  20669. this.clickOverlay(this.hoveringPlane)
  20670. return;
  20671. }
  20672. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20673. return EditOverlay.addPlane({intersect:this.intersect});
  20674. }
  20675. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20676. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20677. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20678. } */
  20679. //----------
  20680. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20681. this.history.invalidate(),
  20682. this.intersect)
  20683. return this.flyToPanoClosestToMouse();
  20684. if (this.mode === V.PANORAMA) {
  20685. var n = this.closestPanoInDirection(this.getMouseDirection());
  20686. return n ? this.flyToPano({
  20687. pano: n
  20688. }) : this.bump(this.getMouseDirection())
  20689. }
  20690. }
  20691. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20692. }
  20693. ,
  20694. t.prototype.handleLongTap = function() {
  20695. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20696. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20697. !0
  20698. }
  20699. ,
  20700. t.prototype.checktagClick = function() {
  20701. if (this.tagManager.intersectTag) {
  20702. var e = this.isTouchEvent
  20703. , t = this.tagManager.clickedOnTag(e, this);
  20704. return e || t || G.cancelById(q.LookTransition),
  20705. !0
  20706. }
  20707. if (this.tagManager.activeTag)
  20708. return this.tagManager.dismissActiveTag(),
  20709. !1
  20710. }
  20711. ,
  20712. t.prototype.rankedtagInDirection = function(e, t) {
  20713. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20714. }
  20715. ,
  20716. t.prototype.start = function(e) {
  20717. $(".toolLeft").removeClass("unable");
  20718. $(".toolTop").removeClass("unable");
  20719. //-------------------
  20720. window.initTransformCtl(B)
  20721. window.initOverlay(B)
  20722. this.model.loadOverlays()
  20723. window.EditOverlay && window.EditOverlay.init(B);
  20724. window.VisiSet && VisiSet.init()
  20725. //-------------------
  20726. var t = e.mode
  20727. , i = e.pano
  20728. , n = e.position
  20729. , r = e.quaternion
  20730. , o = e.tag
  20731. , a = e.quickstart
  20732. , s = $.Deferred();
  20733. this.updateModelDependentData(),
  20734. this.updateFromControls(),
  20735. this.findDefaultViews();
  20736. var l = this.is360View(t, i);
  20737. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20738. s.done(function(e) {
  20739. this.emit(W.Ready, l, e, o)
  20740. }
  20741. .bind(this)),
  20742. s.promise()
  20743. }
  20744. ,
  20745. t.prototype.startOutside = function(e, t) {
  20746. var i = e.mode
  20747. , n = e.pano
  20748. , r = e.position
  20749. , o = e.quaternion
  20750. , a = e.zoom
  20751. , s = e.floorVisibility
  20752. , l = e.tag;
  20753. this.emit(W.StartOutside, k[i].transitionTime),
  20754. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20755. G.cancelById(q.FlyToViewFloor),
  20756. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20757. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20758. }
  20759. ,
  20760. t.prototype.startInside = function(e, t, i, n, r) {
  20761. r = r || $.Deferred();
  20762. var o = (this.currentPano = e) && !e.isAligned();
  20763. if (t = o ? e.position : t || e.position,
  20764. i = i || e.quaternion,
  20765. e) {
  20766. var a = this.startInside.bind(this, e, t, i, n, r);
  20767. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20768. return
  20769. }
  20770. //add
  20771. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20772. return this.mode = V.PANORAMA,
  20773. e.floor.enter(this.mode),
  20774. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20775. this.switchCameraMode(this.mode, i),
  20776. this.emit(W.StartInside, o),
  20777. r.resolve(!0),
  20778. r
  20779. }
  20780. ,
  20781. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20782. if (r = r || $.Deferred(),
  20783. this.dollhouseMode(),
  20784. !i)
  20785. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20786. r.resolve(!1),
  20787. r;
  20788. e = e || i.position;
  20789. var o = n || this.cameraControls.activeControl.camera.quaternion
  20790. , a = i.position;
  20791. return this.fitDollhouse(a, e, o),
  20792. setTimeout(function(e) {
  20793. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20794. var t = {
  20795. mode: V.PANORAMA,
  20796. pano: i,
  20797. quaternion: n,
  20798. callback: function() {
  20799. this.emit(W.FlyinFinished),
  20800. r.resolve(!0)
  20801. }
  20802. .bind(this)
  20803. };
  20804. this.flyToNewMode(t)
  20805. }
  20806. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20807. r
  20808. }
  20809. ,
  20810. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20811. K = {},
  20812. function(t, e, i, n, r, o, a, s, l, c) {
  20813. if (function() {
  20814. for (var e in Z)
  20815. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20816. return !0;
  20817. return !1
  20818. }())
  20819. return !0;
  20820. var h = function(e, t, i) {
  20821. j.delayOneFrame(function() {
  20822. Z[e] = !1,
  20823. r && r(t, i)
  20824. }
  20825. .bind(this))
  20826. }
  20827. .bind(this, t.id)
  20828. , u = function(e, t) {
  20829. j.delayOneFrame(function() {
  20830. Z[e] = !1,
  20831. o && o(t)
  20832. }
  20833. .bind(this))
  20834. }
  20835. .bind(this, t.id);
  20836. try {
  20837. return null != s || (s = !0),
  20838. 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),
  20839. Z[t.id] && (K[t.id] = performance.now()),
  20840. Z[t.id]
  20841. } catch (e) {
  20842. throw Z[t.id] = !1,
  20843. K[t.id] = performance.now() - 5e3,
  20844. e
  20845. }
  20846. }
  20847. ),
  20848. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20849. if (!e)
  20850. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20851. return r && this.model.waitForLoad(e, function() {
  20852. return e.isLoaded(i)
  20853. }),
  20854. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20855. !0)
  20856. }
  20857. ,
  20858. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20859. function(e, t, i, n, r, o, a, s) {
  20860. if (!e)
  20861. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20862. return X.copy(T.FORWARD),
  20863. this.getDirection(X),
  20864. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20865. return e.isLoaded(t)
  20866. }),
  20867. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20868. i && i(e, t)
  20869. }
  20870. .bind(this)).fail(function(e) {
  20871. n && n(e)
  20872. }
  20873. .bind(this)).progress(function(e, t, i) {
  20874. r && r(e, t, i)
  20875. }
  20876. .bind(this)),
  20877. !0)
  20878. }
  20879. ),
  20880. t.prototype.switchCameraMode = function(e, t) {
  20881. var i = this.cameraControls.controls[e]
  20882. , n = i.camera;
  20883. switch (e) {
  20884. case V.PANORAMA:
  20885. n.position.copy(this.currentPano.position);
  20886. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20887. i.lookAt(r.add(n.position));
  20888. break;
  20889. case V.DOLLHOUSE:
  20890. /* var o = this.position.clone();
  20891. 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),
  20892. n.position.copy(o),
  20893. i.target.copy(this.target.clone().setY(this.model.center.y));
  20894. break; */
  20895. //for多楼层 且 让模型刚好适应屏幕
  20896. var box = this.model.boundingBox.clone();
  20897. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  20898. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  20899. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  20900. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  20901. console.log(boxSize.x,distance, boxSize.length() / 2)
  20902. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  20903. if(this.mode === V.PANORAMA){
  20904. i.target.copy(this.model.center);
  20905. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  20906. }else{
  20907. i.target.copy(this.target.clone().setY(this.model.center.y))
  20908. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  20909. }
  20910. vec.multiplyScalar(distance )
  20911. n.position.copy(i.target.clone().add(vec))
  20912. break
  20913. case V.FLOORPLAN:
  20914. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20915. i.target.copy(this.model.center).setY(0),
  20916. i.zoomToContain(this.model.size),
  20917. i.rotateToView(this.model.size, this.getDirection())
  20918. }
  20919. i.update(0)
  20920. }
  20921. ,
  20922. t.prototype.update = (new B.Vector3,
  20923. N = {},
  20924. F = [],
  20925. function(e) {
  20926. this.updatePersistentZooming(e),
  20927. this.updateFromControls(e),
  20928. this.getCurrentNodePanos(F)
  20929. if(this.hasChanged(N)){
  20930. this.lastChangeTime = Date.now(),
  20931. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20932. this.emit(W.ViewChanged)
  20933. //add:
  20934. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) VisiSet.updateFootIconSize();
  20935. this.intersectHot && this.intersectHot.showTitle()
  20936. for(var i in this.model.hots){
  20937. this.model.hots[i].update(this.camera)
  20938. }
  20939. }
  20940. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  20941. this.model.supportsTiles && (this.updateTileDownloader(F),
  20942. this.updatePanoRenderer(F)),
  20943. this.updatePreRendering(F),
  20944. this.reticule.update(),
  20945. this.path.update(),
  20946. this.spider.update(),
  20947. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20948. this.updateControlLocks(),
  20949. this.model.supportsTiles && this.updateZoomPano()
  20950. }
  20951. ),
  20952. t.prototype.updatePersistentZooming = function(e) {
  20953. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20954. }
  20955. ,
  20956. t.prototype.updateControlLocks = function() {
  20957. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20958. }
  20959. ,
  20960. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20961. function(e) {
  20962. var t = this.nextPano || this.currentPano;
  20963. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20964. this.getDirection(D),
  20965. this.panoRenderer.updateDirection(D))
  20966. }
  20967. ),
  20968. t.prototype.cleanupInactivePanos = (O = [],
  20969. L = [],
  20970. function() {
  20971. O.length = 0,
  20972. O.push(this.currentPano),
  20973. this.nextPano && O.push(this.nextPano);
  20974. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20975. L.push(this.panoRenderer.activePanos[e]);
  20976. for (var t = 0; t < L.length; t++) {
  20977. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20978. i.id === O[r].id && (n = !1);
  20979. n && i.exit()
  20980. }
  20981. }
  20982. ),
  20983. t.prototype.updatePreRendering = (w = {},
  20984. function(e) {
  20985. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20986. var t = this.nextPano || this.currentPano;
  20987. if (t && e && 1 < e.length) {
  20988. var i = e.findIndex(function(e) {
  20989. if (e.id === t.id)
  20990. return !0
  20991. });
  20992. if (0 <= i && i + 1 < e.length) {
  20993. var n = e[i + 1];
  20994. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  20995. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20996. window.setTimeout(function(e) {
  20997. w[e.id] = !1
  20998. }
  20999. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21000. }
  21001. .bind(this, n), k.tiling.panoPreRenderDelay),
  21002. w[n.id] = !0)
  21003. }
  21004. }
  21005. }
  21006. }
  21007. ),
  21008. t.prototype.enablePreRendering = function() {
  21009. this.preRenderingEnabled = !0
  21010. }
  21011. ,
  21012. t.prototype.disablePreRendering = function() {
  21013. this.preRenderingEnabled = !1,
  21014. this.cleanupInactivePanos()
  21015. }
  21016. ,
  21017. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21018. function(e) {
  21019. var t = this.nextPano || this.currentPano;
  21020. t && (b.copy(T.FORWARD),
  21021. this.getDirection(b),
  21022. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21023. this.tileDownloader.processPriorityQueue = !0)
  21024. }
  21025. ),
  21026. t.prototype.updateFromControls = function(e) {
  21027. null != e || (e = 0),
  21028. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21029. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21030. this.position.copy(this.cameraControls.activeControl.camera.position),
  21031. this.target.copy(this.cameraControls.activeControl.target),
  21032. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21033. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21034. this.camera.position.copy(this.position),
  21035. this.camera.quaternion.copy(this.quaternion),
  21036. this.camera.updateMatrix(),
  21037. this.camera.updateMatrixWorld()
  21038. }
  21039. ,
  21040. t.prototype.hasChanged = function(e) {
  21041. if (!this.previousState)
  21042. return this.previousState = {
  21043. allFloorsVisible: this.model.allFloorsVisible,
  21044. position: this.position.clone(),
  21045. quaternion: this.quaternion.clone(),
  21046. mouse: this.mouse.clone(),
  21047. labelScaleFactor: this.getLabelScaleFactor(),
  21048. currentFloor: this.model.currentFloor,
  21049. projectionMatrix: this.camera.projectionMatrix.clone(),
  21050. worldMatrix: this.camera.matrixWorld.clone(),
  21051. mode: this.mode,
  21052. modelPosition: this.model.position.clone(),
  21053. modelCenter: this.model.center.clone(),
  21054. zoomLevel: this.zoomLevel
  21055. },
  21056. !0;
  21057. 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;
  21058. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21059. e.moved = !this.position.equals(this.previousState.position),
  21060. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21061. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21062. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21063. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21064. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21065. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21066. e.modeChanged = this.mode !== this.previousState.mode,
  21067. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21068. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21069. e.nextPanoActive = null !== this.nextPano,
  21070. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21071. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21072. this.previousState.position.copy(this.position),
  21073. this.previousState.quaternion.copy(this.quaternion),
  21074. this.previousState.mouse.copy(this.mouse),
  21075. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21076. this.previousState.currentFloor = this.model.currentFloor,
  21077. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21078. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21079. this.previousState.mode = this.mode,
  21080. this.previousState.modelPosition.copy(this.model.position),
  21081. this.previousState.modelCenter.copy(this.model.center),
  21082. this.previousState.zoomLevel = this.zoomLevel,
  21083. !t
  21084. }
  21085. ,
  21086. t.prototype.updateIntersect = function() {
  21087. var e = this.flying || this.isWarping()
  21088. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21089. , i = G.getById(q.LookTransition);
  21090. e || t || this.isTouchEvent || i.length && i[0].running;
  21091. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) {
  21092. this.intersect = this.getMouseIntersect(null, VisiSet.footIcons);
  21093. if (this.intersect && this.intersect.object.visible )
  21094. $("#player").css("cursor", "pointer");
  21095. else
  21096. $("#player").css("cursor", "")
  21097. return;
  21098. }
  21099. this.intersect = this.getMouseIntersect(),
  21100. this.intersect && this.updateClosestPano(this.intersect),
  21101. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21102. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21103. }
  21104. ,
  21105. t.prototype.checkHotClick = function() {
  21106. if (this.intersectHot){
  21107. if (window.VisiSet && VisiSet.setTagVisible ) {
  21108. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21109. return;
  21110. }
  21111. this.intersectHot.noAction || this.intersectHot.examine(this)
  21112. return !0
  21113. }
  21114. }
  21115. ,
  21116. t.prototype.getMouseDirection = function(e) {
  21117. e = e || this.mouse;
  21118. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21119. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21120. }
  21121. ,
  21122. t.prototype.hoverOverlay = function(mesh){
  21123. if(!mesh){
  21124. this.hoveringPlane = null;
  21125. $("#player").css("cursor",this.currentCursor || "" );
  21126. }else{
  21127. var overlay = mesh.parent;
  21128. $("#player").css("cursor","pointer");
  21129. this.hoveringPlane = overlay;
  21130. return true;
  21131. }
  21132. },
  21133. t.prototype.clickOverlay = function(overlay){
  21134. if(this.openOverlay && !overlay)return;
  21135. var plane = overlay.plane;
  21136. if(overlay.overlayType == "video"){
  21137. if(plane.material.map.image.paused)plane.material.map.image.play()
  21138. else plane.material.map.image.pause();
  21139. }
  21140. if(window.EditOverlay &&EditOverlay.editing){
  21141. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  21142. $('#overlayProp').removeClass('atRight').removeClass('hide')
  21143. EditOverlay.endAddPlane();
  21144. EditOverlay.updateOverlayPanel(overlay)
  21145. transformControls.attach(overlay)
  21146. return;
  21147. }
  21148. },
  21149. t.prototype.getMouseIntersect = function(e, t) {
  21150. e = e || this.mouse.clone(),
  21151. t = t || this.model.floors.reduce(function(e, t) {
  21152. return t.hidden ? e : e.concat(t.collider.children)
  21153. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21154. t = t.slice(0)
  21155. for (var i in this.model.hots) t.push(this.model.hots[i].mesh);
  21156. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  21157. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21158. this.raycaster.set(i, this.getMouseDirection(e));
  21159. var n = this.raycaster.intersectObjects(t, true);//add true
  21160. if ("add" == g_HotStatus) {
  21161. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  21162. //console.log(r[0]),
  21163. 1 <= r.length ? ($("#player").css("cursor", "cell"),
  21164. window.hotIntersect = r[0]) : ($("#player").css("cursor", "not-allowed"),
  21165. window.hotIntersect = !1)
  21166. return;
  21167. }
  21168. this.intersectHot && this.intersectHot.hideTitle()
  21169. if (0 === n.length)
  21170. return this.intersectHot = null,
  21171. "add" != g_HotStatus && $("#player").css("cursor", ""),
  21172. null;
  21173. var o = n[0];
  21174. if ("hotSprite" == o.object.type){
  21175. this.intersectHot = o.object.belongHot
  21176. this.intersectHot.showTitle()
  21177. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21178. this.intersectHot.noAction || $("#player").css("cursor", "pointer");
  21179. return;
  21180. }
  21181. $(".toolRight .spotList ul li").removeClass("active")
  21182. this.intersectHot = null;
  21183. /* if(window.EditOverlay && n && n.length){
  21184. if(n[0].object.parent.parent == this.overlayGroup){
  21185. this.hoverOverlay(n[0].object);
  21186. }else()
  21187. } */
  21188. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  21189. intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
  21190. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21191. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21192. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21193. o.horizontal = .8 < o.normal.y);
  21194. return o
  21195. }
  21196. ,
  21197. t.prototype.updateClosestPano = function(e) {
  21198. var t = [a.filters.isPanoAligned()];
  21199. if (this.mode === V.PANORAMA) {
  21200. if (!this.currentPano)
  21201. return;
  21202. t.push(a.filters.not(this.currentPano)),
  21203. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21204. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21205. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21206. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21207. } else{
  21208. t.push((pano)=>{ // add
  21209. return this.checkHasNeighbor(pano)
  21210. })
  21211. t.push(a.filters.isOnVisibleFloor()),
  21212. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21213. }
  21214. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21215. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21216. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21217. this.closestPano = i) : this.isPanoHover = !1
  21218. }
  21219. ,
  21220. t.prototype.dollhouseMode = function(e, t) {
  21221. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21222. this.mode = V.DOLLHOUSE,
  21223. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21224. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21225. , n = new B.Vector3(15,10,15);
  21226. if (e && t) {
  21227. var r = T.FORWARD.clone().applyQuaternion(t)
  21228. , o = this.model.center.clone().sub(e).dot(r);
  21229. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21230. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21231. }
  21232. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21233. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21234. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21235. this.updateFromControls(),
  21236. this.model.alpha = 1,
  21237. this.model.skybox.material.uniforms.opacity.value = 0
  21238. }
  21239. ,
  21240. t.prototype.insideMode = function(e, t) {
  21241. var i = $.Deferred()
  21242. , n = t || null;
  21243. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21244. var r = [a.filters.isPanoAligned()];
  21245. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21246. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21247. this.flyToNewMode({
  21248. mode: V.PANORAMA,
  21249. pano: e,
  21250. callback: n
  21251. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21252. } else {
  21253. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21254. i.reject(o)
  21255. }
  21256. return i.promise()
  21257. }
  21258. ,
  21259. t.prototype.fitDollhouse = function(e, t, i) {
  21260. var maxY = this.model.boundingBox.max.y;//add
  21261. var n = T.FORWARD.clone().applyQuaternion(i);
  21262. i = n.clone().add(e);
  21263. this.cameraControls.activeControl.target.copy(i),
  21264. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21265. }
  21266. ,
  21267. t.prototype.floorplanMode = function(e, t, i) {
  21268. this.mode = V.FLOORPLAN;
  21269. var n = this.cameraControls.controls[V.FLOORPLAN];
  21270. n.reset();
  21271. var r = e || this.model.center;
  21272. if (n.target.copy(r).setY(0),
  21273. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21274. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21275. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21276. t) {
  21277. var o = T.LEFT.clone().applyQuaternion(t);
  21278. n.rotateLeft(-Math.atan2(o.x, o.z))
  21279. } else
  21280. n.rotateToView(this.model.size, this.getDirection());
  21281. n.update(0)
  21282. }
  21283. ,
  21284. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21285. return e.skipWarpingCheck = !0,
  21286. this.flyToPano(e, t)
  21287. }
  21288. ,
  21289. t.prototype.updateMarkerVisi = function() {//加
  21290. if(this.mode != "panorama")return;
  21291. this.model.panos.list.forEach((pano)=>{
  21292. if(!pano.marker)return;
  21293. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21294. })
  21295. }
  21296. ,
  21297. t.prototype.updateHotVisible = function(pano){
  21298. var hots = this.model.hots;
  21299. pano = pano || this.currentPano;
  21300. for (var index in hots){
  21301. var visible;
  21302. if(this.mode != "panorama"){
  21303. visible = true;
  21304. }else{
  21305. //hots[index].mesh.material.depthTest = false;
  21306. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21307. }
  21308. hots[index].mesh.visible = visible;
  21309. }
  21310. },
  21311. t.prototype.flyToPano = function(e, t) {
  21312. 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;
  21313. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21314. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21315. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21316. t && t(),
  21317. !1;
  21318. if (this.updateLastView(),
  21319. this.mode !== V.PANORAMA)
  21320. return r && (i = (new B.Quaternion).setFromUnitVectors(T.FORWARD, r.sub(n.position).normalize())),
  21321. void this.flyToNewMode({
  21322. mode: V.PANORAMA,
  21323. pano: n,
  21324. duration: o,
  21325. quaternion: i,
  21326. callback: t
  21327. });
  21328. if (!n || (h = x.deepExtend(e),
  21329. u = function() {
  21330. j.delayOneFrame(function() {
  21331. this.flyToPano(h, t)
  21332. }
  21333. .bind(this))
  21334. }
  21335. .bind(this),
  21336. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21337. var d = function(e) {
  21338. t && t(e)
  21339. }
  21340. .bind(this);
  21341. this.currentPano || (this.currentPano = n,
  21342. this.path.placeCpm(),
  21343. this.path.fadeOutCpm(k.path.fadeOutTime),
  21344. this.spider.draw());
  21345. var p = o;
  21346. if ("number" != typeof o) {
  21347. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21348. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21349. }
  21350. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21351. 1 !== this.zoomLevel)
  21352. switch (k.zoom.transitionStyle) {
  21353. case 1:
  21354. this.smoothZoomToDefault(p / 2);
  21355. break;
  21356. case 2:
  21357. return h = x.deepExtend(e),
  21358. u = this.flyToPano.bind(this, h, t),
  21359. void this.smoothZoomToDefault(k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21360. }
  21361. if (r) {
  21362. G.cancelById(q.LookTransition),
  21363. p *= k.transition.aimSlowFactor;
  21364. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21365. , m = (new B.Matrix4).lookAt(n.position, r, T.UP)
  21366. , v = (new B.Quaternion).setFromRotationMatrix(m)
  21367. , y = g.clone()
  21368. , A = new B.Vector3;
  21369. if (n === this.currentPano) {
  21370. var C = T.FORWARD.clone().applyQuaternion(g)
  21371. , I = T.FORWARD.clone().applyQuaternion(v)
  21372. , E = C.angleTo(I);
  21373. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21374. void G.start(function(e) {
  21375. y.copy(g),
  21376. H.quaternion(y, v)(e),
  21377. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21378. this.cameraControls.activeControl.lookAt(A)
  21379. }
  21380. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21381. }
  21382. }
  21383. if (n === this.currentPano || this.flying)
  21384. return void d();
  21385. this.flying = !0;
  21386. var _ = this.position.clone()
  21387. , b = this.currentPano;
  21388. Y.debug("Flying to pano ", n.position);
  21389. this.emit(W.PanoChosen, this.currentPano, n);
  21390. this.emit(W.FlyingStarted, n.position, _, n, b);
  21391. this.updateHotVisible(n); //更新热点显示
  21392. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21393. r && G.start(function(e) {
  21394. y.copy(g),
  21395. H.quaternion(y, v)(e),
  21396. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21397. this.cameraControls.activeControl.lookAt(A)
  21398. }
  21399. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21400. var w = c ? null : z[k.transition.movementEasing];
  21401. this.nextPano = n;
  21402. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21403. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21404. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21405. this.flying = !1,
  21406. this.currentPano !== n && this.currentPano.exit(),
  21407. n.enter(),
  21408. this.currentPano = n,
  21409. this.nextPano = null,
  21410. this.path.placeCpm(),
  21411. this.path.fadeOutCpm(k.path.fadeOutTime),
  21412. this.spider.draw(),
  21413. this.emit(W.FlyingEnded, n.position, _, n, b),
  21414. this.updateMarkerVisi();//add
  21415. d(e)
  21416. if(this.mode == "panorama" && EditOverlay.editing){
  21417. EditOverlay.updatePano(this.currentPano)
  21418. }
  21419. }
  21420. .bind(this), 0, w, "camFly", q.FlyToPano)
  21421. }
  21422. }
  21423. ,
  21424. window._transitionPosId = 9999
  21425. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21426. G.cancelById(_transitionPosId)
  21427. var begin = function(object, pos, qua, scale){
  21428. if(pos){
  21429. if(!same(object.position, pos, 0.01)){
  21430. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21431. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21432. }
  21433. if(!same(object.quaternion, qua, 1e-6)){
  21434. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21435. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21436. }
  21437. if(!same(object.scale, scale, 0.001)){
  21438. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21439. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21440. }
  21441. }
  21442. }
  21443. var same = function(vec1, vec2, diff){
  21444. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21445. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21446. return s
  21447. }
  21448. this.overlayGroup.children.forEach(overlay=>{
  21449. var panoData = o.pano != void 0 && overlay.transformAtPanos[o.pano.id]
  21450. var useCustom = o.type == "beforeFlyOut" || !panoData
  21451. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21452. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21453. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21454. overlay.getScaleBySize(panoData.width , panoData.height)
  21455. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21456. begin(overlay, pos, qua, scale )
  21457. })
  21458. }
  21459. t.prototype.fastForwardActivePanoFlight = function(e) {
  21460. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21461. G.adjustSpeed(q.FlyToPano, e),
  21462. G.adjustSpeed(q.LookTransition, e)
  21463. }
  21464. ,
  21465. t.prototype.flyToPanoClosestToMouse = function() {
  21466. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21467. this.intersect && this.updateClosestPano(this.intersect)),
  21468. this.closestPano)
  21469. return this.flyToPano({
  21470. pano: this.closestPano
  21471. });
  21472. var e = this.getMouseDirection();
  21473. this.flyDirection(e) || this.flyToPano({
  21474. pano: this.currentPano
  21475. })
  21476. }
  21477. ,
  21478. t.prototype.flyLocalDirection = function(e) {
  21479. var t = this.getDirection(e)
  21480. , i = 1 === e.z ? .4 : .75
  21481. , n = 1 === Math.abs(e.x);
  21482. return this.flyDirection(t, i, n)
  21483. }
  21484. ,
  21485. t.prototype.flyDirection = function(e, t, i) {
  21486. this.closePopup();
  21487. var n = $.Deferred();
  21488. this.history.invalidate();
  21489. var r = this.closestPanoInDirection(e, t, i);
  21490. return r ? this.flyToPano({
  21491. pano: r
  21492. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21493. n.resolve(!1)),
  21494. n.promise()
  21495. }
  21496. ,
  21497. t.prototype.closestPanoInDirection = function(e, t, i) {
  21498. return this.rankedPanoInDirection(0, e, t, i)
  21499. }
  21500. ,
  21501. t.prototype.rankedPanoInDirection = (_ = {
  21502. pano: null,
  21503. candidates: []
  21504. },
  21505. function(e, t, i, n) {
  21506. e = e || 0,
  21507. i = void 0 !== i ? i : .75;
  21508. var r = n ? "angle" : "direction";
  21509. 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)], _),
  21510. this.cachedPanoCandidates = _.candidates,
  21511. _.pano
  21512. }
  21513. ),
  21514. t.prototype.bump = function(e) {
  21515. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21516. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21517. if (.5 < Math.abs(a))
  21518. t = function() {
  21519. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21520. }
  21521. .bind(this),
  21522. i = function() {
  21523. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21524. }
  21525. .bind(this);
  21526. else {
  21527. var s = this.camera.position.clone()
  21528. , l = e.clone();
  21529. this.raycaster.set(s, l);
  21530. var c = this.model.floors.reduce(function(e, t) {
  21531. return e.concat(t.collider.children)
  21532. }, [])
  21533. , h = this.raycaster.intersectObjects(c)
  21534. , u = 0 < h.length ? h[0].distance / 25 : .04
  21535. , d = s.clone().add(l.multiplyScalar(u));
  21536. t = function() {
  21537. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21538. }
  21539. .bind(this),
  21540. i = function() {
  21541. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21542. }
  21543. .bind(this)
  21544. }
  21545. n = function() {
  21546. this.flying = !1
  21547. }
  21548. .bind(this),
  21549. this.flying = !0,
  21550. t()
  21551. }
  21552. }
  21553. ,
  21554. t.prototype.changeFloor = function(e) {
  21555. if (!this.is360View(this.mode, this.currentPano))
  21556. if (this.mode === V.PANORAMA) {
  21557. var t = this.history.reversePano(e);
  21558. t && t.isAligned() ? this.flyToPano({
  21559. pano: t
  21560. }) : this.changeFloorByScore(e)
  21561. } else
  21562. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21563. }
  21564. ,
  21565. t.prototype.changeFloorByScore = (E = {
  21566. pano: null,
  21567. candidates: []
  21568. },
  21569. function(e) {
  21570. var t = this.model.nextFloor(e);
  21571. 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),
  21572. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21573. this.history.push(e, this.currentPano),
  21574. this.flyToPano({
  21575. pano: E.pano
  21576. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21577. }
  21578. ),
  21579. t.prototype.gotoFloor = function(e) {
  21580. var t = e - this.model.currentFloor.floorIndex;
  21581. this.changeFloor(t)
  21582. }
  21583. ,
  21584. t.prototype.getDirection = function(e) {
  21585. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21586. }
  21587. ,
  21588. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21589. if (r = r || $.Deferred(),
  21590. this.mode === V.TRANSITIONING)
  21591. return Y.warn("should not be transitioning here"),
  21592. n && n(!1),
  21593. r.reject().promise();
  21594. var o = i || !1
  21595. , a = i ? i.position : this.position
  21596. , s = this.position.clone()
  21597. , l = this.currentPano;
  21598. if (Y.debug("New pose in mode " + this.mode),
  21599. !e || (retryCallback = function() {
  21600. j.delayOneFrame(function() {
  21601. this.flyToSameMode(e, t, i, n, r)
  21602. }
  21603. .bind(this))
  21604. }
  21605. .bind(this),
  21606. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21607. var c = function() {
  21608. this.emit(W.FlyingEnded, a, s, e, l),
  21609. n && n(!0)
  21610. }
  21611. .bind(this)
  21612. , h = k[this.mode]
  21613. , u = void 0 !== t ? t : h.transitionTime
  21614. , d = new B.Vector3
  21615. , p = new B.Vector3;
  21616. if (this.emit(W.FlyingStarted, a, s, e, l),
  21617. this.mode === V.PANORAMA)
  21618. Y.warn("we should not be here for panorama views");
  21619. else if (this.mode === V.DOLLHOUSE)
  21620. if (o) {
  21621. var f = new B.Vector3(0,1,0);
  21622. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21623. this.model.warpDestFloors(i.floorVisibility),
  21624. p.copy(i.position);
  21625. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21626. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21627. , v = 3;
  21628. m.length ? (d.copy(m[0].point),
  21629. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21630. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21631. var y = (new B.Matrix4).lookAt(p, d, f)
  21632. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21633. , C = d.distanceTo(p)
  21634. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21635. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21636. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21637. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21638. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21639. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21640. this.path.burnsDir = Math.sign(b.y);
  21641. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21642. , T = new B.Vector3;
  21643. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21644. G.start(function(e, t) {
  21645. w.x = E.x + e * b.x,
  21646. w.y = E.y + e * b.y,
  21647. w.z = E.z + e * b.z;
  21648. var i = _ + e * (C - _);
  21649. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21650. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21651. }
  21652. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21653. G.start(function(e, t) {
  21654. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21655. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21656. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21657. }
  21658. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21659. } else
  21660. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21661. else if (this.path.placeCpm(),
  21662. this.path.fadeInCpm(k.path.fadeInTime),
  21663. i) {
  21664. this.model.warpDestFloors(i.floorVisibility);
  21665. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21666. , S = this.cameraControls.controls[V.FLOORPLAN]
  21667. , M = S.target.clone()
  21668. , R = i.position.clone().sub(M)
  21669. , P = x.position.clone().sub(S.target).length()
  21670. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21671. , L = Math.atan2(S.offset.x, S.offset.z)
  21672. , D = Math.atan2(O.x, O.z)
  21673. , N = S.absoluteScale
  21674. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21675. G.start(function(e, t) {
  21676. S.target.copy(R).multiplyScalar(e).add(M);
  21677. var i = L + (D - L) * e;
  21678. S.offset.x = P * Math.sin(i),
  21679. S.offset.z = P * Math.cos(i),
  21680. x.position.copy(S.target).add(S.offset),
  21681. S.absoluteScale = N + e * (F - N),
  21682. S.update(),
  21683. this.quaternion.copy(x.quaternion),
  21684. this.position.copy(x.position),
  21685. this.target.copy(S.target),
  21686. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21687. }
  21688. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21689. } else
  21690. Y.info("flyToSameMode() funny floorplan view? skipping");
  21691. return G.setTimeout(function(e) {
  21692. this.mode = e,
  21693. c(),
  21694. r.resolve(!0)
  21695. }
  21696. .bind(this, this.mode), u, q.FlyToSameMode),
  21697. this.mode = V.TRANSITIONING,
  21698. r.promise()
  21699. }
  21700. }
  21701. ,
  21702. t.prototype.flyToNewMode = function(e, t) {
  21703. var i = (e = e || {}).mode
  21704. , n = e.pano
  21705. , r = e.duration
  21706. , o = e.warpDest
  21707. , a = e.callback
  21708. , s = e.force
  21709. , l = e.quaternion;
  21710. if (t = t || $.Deferred(),
  21711. this.isWarping())
  21712. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21713. a && a(!1),
  21714. t.reject("Cannot change mode during tour transition").promise();
  21715. if (this.mode === V.TRANSITIONING)
  21716. return a && a(!1),
  21717. t.reject("Cannot change mode during mode transition").promise();
  21718. if (i === this.mode)
  21719. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21720. t.promise()) : (a && a(!1),
  21721. t.reject("Already in " + i + " mode").promise());
  21722. var c = o || !1;
  21723. Y.debug("Switching mode to " + i);
  21724. var h = function() {
  21725. j.delayOneFrame(function() {
  21726. this.flyToNewMode(e, t)
  21727. }
  21728. .bind(this))
  21729. }
  21730. .bind(this);
  21731. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21732. return t.promise();
  21733. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21734. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21735. this.model.waitForLoad(this.model, function() {
  21736. return this.model.meshTexturesLoaded
  21737. }
  21738. .bind(this)),
  21739. this.model.loadMeshTextures().done(h),
  21740. t.promise();
  21741. this.history.invalidate(),
  21742. this.updateLastView();
  21743. var u = this.mode
  21744. , d = this.cameraControls.cameras[i];
  21745. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21746. var p = void 0 !== r ? r : e.transitionTime;
  21747. this.emit(W.ModeChanging, u, i, n),
  21748. n && (this.currentPano = n),
  21749. this.switchCameraMode(i, l),
  21750. G.cancelById(q.LookTransition);
  21751. var f = (new B.Vector3).copy(this.position);
  21752. this.modeTran = this.mode + "-" + i;
  21753. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)){
  21754. VisiSet.finishSetPanoVisible()
  21755. VisiSet.finishSetTagVisible()
  21756. }
  21757. if(editTool.atPanel == "screen"){
  21758. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21759. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21760. }
  21761. if(i == "panorama"){
  21762. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  21763. }else{
  21764. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  21765. }
  21766. if (i === V.PANORAMA)
  21767. this.emit(W.PanoChosen, n, n),
  21768. setTimeout(function() {
  21769. n.floor.enter(i)
  21770. }
  21771. .bind(this), p / 2),
  21772. this.path.fadeOutCpm(k.path.fadeOutTime);
  21773. else if (i === V.DOLLHOUSE) {
  21774. if (c && (this.model.stayPut = !0),
  21775. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21776. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21777. this.path.placeCpm(),
  21778. this.path.fadeInCpm(k.path.fadeInTime),
  21779. c) {
  21780. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21781. f.set(15, 10, 15);
  21782. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21783. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21784. v.length ? (g.copy(v[0].point),
  21785. f.copy(o.position),
  21786. 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),
  21787. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21788. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21789. f.add(this.model.position),
  21790. d.position.copy(f),
  21791. this.cameraControls.controls[V.DOLLHOUSE].update()
  21792. }
  21793. } else if (this.path.placeCpm(),
  21794. this.path.fadeInCpm(k.path.fadeInTime),
  21795. o) {
  21796. this.model.warpDestFloors(o.floorVisibility);
  21797. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21798. , A = this.cameraControls.controls[V.FLOORPLAN]
  21799. , C = y.position.clone().sub(A.target)
  21800. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21801. , E = Math.atan2(I.x, I.z);
  21802. A.target.copy(o.position);
  21803. var _ = C.length();
  21804. A.offset.x = _ * Math.sin(E),
  21805. A.offset.y = 0,
  21806. A.offset.z = _ * Math.cos(E),
  21807. y.position.copy(A.target).add(A.offset),
  21808. A.target.clone().sub(d.position),
  21809. d.quaternion.copy(o.quaternion),
  21810. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21811. A.absoluteScale = A.currentScale,
  21812. A.update()
  21813. } else
  21814. this.model.currentFloor.enter(i);
  21815. var b = this.currentPano
  21816. , w = this.position.clone();
  21817. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21818. this.flying = !0,
  21819. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21820. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21821. d.controls.update()),
  21822. e.blackoutStyle = P.FADEIN,
  21823. p = k.show360Views.transitionTime,
  21824. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21825. this.mode = i,
  21826. this.path && this.path.popOutCpm(),
  21827. e.blackoutStyle = P.END,
  21828. p = k.show360Views.transitionTime,
  21829. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21830. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21831. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21832. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21833. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21834. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21835. G.setTimeout(function() {
  21836. this.flying = !1,
  21837. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21838. this.currentPano.enter(),
  21839. this.path.placeCpm(),
  21840. this.path.fadeOutCpm(k.path.fadeOutTime),
  21841. this.spider.draw()),
  21842. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21843. this.mode = i,
  21844. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21845. if (this.afterCModeFuc) {
  21846. //手动加的函数
  21847. var cf = this.afterCModeFuc;
  21848. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  21849. cf();
  21850. }
  21851. this.updateMarkerVisi();//add
  21852. (u === V.PANORAMA || i == V.PANORAMA) && this.updateHotVisible()//add
  21853. if(this.mode == "panorama" && EditOverlay.editing){
  21854. EditOverlay.updatePano(this.currentPano)
  21855. }
  21856. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  21857. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21858. t.resolve())
  21859. }
  21860. .bind(this), p, q.FlyToNewMode),
  21861. this.mode = V.TRANSITIONING,
  21862. t.promise()
  21863. }
  21864. ,
  21865. t.prototype.fade360View = function(e, t, i) {
  21866. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21867. $(this.domElement).fadeOut(.5 * e, function() {
  21868. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21869. this.model.alpha = i.modelAlpha,
  21870. this.position.copy(t.position),
  21871. this.quaternion.copy(t.quaternion),
  21872. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21873. $(this.domElement).fadeIn(.5 * e)
  21874. }
  21875. .bind(this))
  21876. }
  21877. ,
  21878. t.prototype.findDefaultViews = function() {
  21879. this.findDefaultView(this.lastInsideView, !0),
  21880. this.findDefaultView(this.last360View, !1)
  21881. }
  21882. ,
  21883. t.prototype.findDefaultView = function(e, i) {
  21884. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21885. if (e.cameraMode !== V.PANORAMA)
  21886. return !1;
  21887. var t = r.get(e.panoId);
  21888. return t && t.isAligned() === i
  21889. });
  21890. 0 <= o ? (t = r.get(n[o].panoId),
  21891. e.update({
  21892. cameraMode: V.PANORAMA,
  21893. pano: t,
  21894. position: n[o].position,
  21895. quaternion: n[o].quaternion
  21896. })) : 0 <= (o = r.list.findIndex(function(e) {
  21897. return e.isAligned() === i
  21898. })) ? (t = r.list[o],
  21899. e.update({
  21900. cameraMode: V.PANORAMA,
  21901. pano: t,
  21902. position: t.position
  21903. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  21904. }
  21905. ,
  21906. t.prototype.updateLastView = function() {
  21907. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  21908. pano: this.currentPano,
  21909. position: this.position,
  21910. quaternion: this.quaternion
  21911. })
  21912. }
  21913. ,
  21914. t.prototype.goToLastView = function(e, t) {
  21915. var i = $.Deferred()
  21916. , n = i.resolve.bind(i)
  21917. , r = i.reject.bind(i)
  21918. , o = e ? this.lastInsideView : this.last360View;
  21919. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  21920. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  21921. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  21922. mode: o.cameraMode,
  21923. pano: o.pano,
  21924. quaternion: o.quaternion,
  21925. callback: t
  21926. }).done(n).fail(r),
  21927. i.promise()
  21928. }
  21929. ,
  21930. t.prototype.fadeToView = function(e, t, i, n) {
  21931. var r = $.Deferred()
  21932. , o = r.resolve.bind(r)
  21933. , a = r.reject.bind(r);
  21934. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  21935. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  21936. a("Cannot go to illegal view"),
  21937. r.promise();
  21938. var s = (k[t.cameraMode],
  21939. function() {
  21940. $(this.domElement).fadeIn(.5 * i),
  21941. n && n(),
  21942. o()
  21943. }
  21944. .bind(this))
  21945. , l = e ? P.FADEIN : P.END;
  21946. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  21947. $(this.domElement).fadeOut(.5 * i, function() {
  21948. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  21949. t.cameraMode === V.PANORAMA ? this.flyToPano({
  21950. pano: t.pano,
  21951. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  21952. duration: 0
  21953. }, s) : this.flyToNewMode({
  21954. mode: t.cameraMode,
  21955. quaternion: t.quaternion,
  21956. duration: 0,
  21957. callback: s
  21958. })
  21959. }
  21960. .bind(this)),
  21961. r.promise()
  21962. }
  21963. ,
  21964. t.prototype.startWarp = function(e, t, i, n, r, o) {
  21965. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  21966. this.flying)
  21967. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  21968. o && o(),
  21969. !1;
  21970. null != e || (e = M.Show),
  21971. this.history.invalidate(),
  21972. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  21973. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  21974. return this.emit(W.WarpStarted, a, i, n, r),
  21975. n = n || P.MIDDLE,
  21976. this.path.warpToPano(i, n, r, function() {
  21977. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  21978. this.emit(W.WarpEnded, i),
  21979. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  21980. o && o()
  21981. }
  21982. .bind(this)),
  21983. e === M.Hide && this.path.discardPathObject(),
  21984. !0
  21985. }
  21986. ,
  21987. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  21988. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  21989. s && s(),
  21990. !1)
  21991. }
  21992. ,
  21993. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  21994. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21995. a && a(),
  21996. !1)
  21997. }
  21998. ,
  21999. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22000. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22001. }
  22002. ,
  22003. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22004. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22005. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22006. t && t(),
  22007. !1)
  22008. }
  22009. ,
  22010. t.prototype.aimTourCamera = function(e, t, i, n) {
  22011. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22012. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22013. }
  22014. ,
  22015. t.prototype.showPathToHeroLocation = function(e) {
  22016. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22017. }
  22018. ,
  22019. t.prototype.tourInterlude = function(e, t) {
  22020. this.history.invalidate(),
  22021. this.path.discardSlow();
  22022. var i = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid]
  22023. , n = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22024. , r = i && i.music ? i.time - n : 2e3;
  22025. this.path.waitNextStep(e, function() {
  22026. t && t()
  22027. }
  22028. .bind(this), r)
  22029. }
  22030. ,
  22031. t.prototype.stopInterlude = function() {
  22032. this.interruptAndFastForward(null, 0)
  22033. }
  22034. ,
  22035. t.prototype.interruptAndFastForward = function(e, t) {
  22036. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22037. this.flying && this.emit(W.FlyingInterrupted),
  22038. this.path.interruptAndFastForward(e, t)
  22039. }
  22040. ,
  22041. t.prototype.setSize = function(e, t) {
  22042. var i = e / t;
  22043. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22044. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22045. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22046. this.cameraControls.cameras) {
  22047. var o = this.cameraControls.cameras[r];
  22048. o.fov = this.baseFov * (1 / this.zoomLevel),
  22049. o.updateAspect(i)
  22050. }
  22051. }
  22052. ,
  22053. t.prototype.toJSON = function() {
  22054. var e = {};
  22055. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22056. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22057. return e.hidden ? 0 : 1
  22058. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22059. e
  22060. }
  22061. ,
  22062. t.prototype.getCurrentNodePanos = function(e) {
  22063. if (this.model.panos.map,
  22064. e.length = 0,
  22065. this.path.nodes)
  22066. for (var t = 0; t < this.path.nodes.length; t++) {
  22067. var i = this.path.nodes[t];
  22068. e.push(this.model.panos.get(i))
  22069. }
  22070. }
  22071. ,
  22072. t.prototype.zoomIncrementally = function(e) {
  22073. var t = this.zoomLevel;
  22074. this.zoomTo(this.zoomLevel + e),
  22075. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22076. }
  22077. ,
  22078. t.prototype.zoomInIncrementally = function(e) {
  22079. e = e || this.defaultZoomIncrement,
  22080. this.zoomIncrementally(e)
  22081. }
  22082. ,
  22083. t.prototype.zoomOutIncrementally = function(e) {
  22084. e = e || -this.defaultZoomIncrement,
  22085. this.zoomIncrementally(e)
  22086. }
  22087. ,
  22088. t.prototype.zoomBy = function(e) {
  22089. this.zoomTo(this.zoomLevel * e)
  22090. }
  22091. ,
  22092. t.prototype.zoomIn = function() {
  22093. this.zoomBy(1 + this.zoomSpeed)
  22094. }
  22095. ,
  22096. t.prototype.zoomOut = function() {
  22097. this.zoomBy(1 - this.zoomSpeed)
  22098. }
  22099. ,
  22100. t.prototype.zoomTo = function(e, t) {
  22101. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22102. e > k.zoom.max && (e = k.zoom.max),
  22103. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22104. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22105. e === k.zoom.min && this.emit(m.ZoomMin)),
  22106. this.cameraControls.activeControl)) {
  22107. var i = this.cameraControls.activeControl.camera;
  22108. this.zoomLevel = e,
  22109. i.fov = this.baseFov * (1 / this.zoomLevel),
  22110. i.updateProjectionMatrix(),
  22111. this.zoomFov = i.fov
  22112. }
  22113. }
  22114. ,
  22115. t.prototype.increaseZoomSpeed = function() {
  22116. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22117. }
  22118. ,
  22119. t.prototype.decreaseZoomSpeed = function() {
  22120. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22121. }
  22122. ,
  22123. t.prototype.clampZoomSpeed = function(e) {
  22124. return e < 0 ? 0 : e
  22125. }
  22126. ,
  22127. t.prototype.activatePersistentZooming = function(e) {
  22128. this.zooming = e ? 1 : -1
  22129. }
  22130. ,
  22131. t.prototype.deactivatePersistentZooming = function() {
  22132. this.zooming = 0
  22133. }
  22134. ,
  22135. t.prototype.zoomDefault = function() {
  22136. this.zoomTo(1, !0)
  22137. }
  22138. ,
  22139. t.prototype.smoothZoomToDefault = function(e, t) {
  22140. var i, n = this.zoomLevel, r = function(e) {
  22141. 1 < e && (e = 1),
  22142. i = n * (1 - e) + e,
  22143. this.zoomTo(i, !0)
  22144. }
  22145. .bind(this), o = function() {
  22146. this.zoomDefault(),
  22147. t && window.setTimeout(t, 50)
  22148. }
  22149. .bind(this);
  22150. G.start(r, e, o, null, 0, z[k.transition.blendEasing])
  22151. }
  22152. ,
  22153. t.prototype.updateZoomPano = function() {
  22154. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22155. var e = this.currentPano;
  22156. if (e) {
  22157. var t = this.zoomLevel > k.zoom.activationThreshold
  22158. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22159. t);
  22160. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22161. this.panoRenderer.setZoomingActive(i, e, !0);
  22162. var n = function(e, t) {
  22163. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22164. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22165. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22166. e.setZoomed(t)
  22167. }
  22168. .bind(this);
  22169. i && !e.zoomed ? (n(e, !0),
  22170. this.panoRenderer.enableUltraHighQualityMode(function() {
  22171. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22172. i && n(e, !0)
  22173. }
  22174. .bind(this))) : !t && e.zoomed && n(e, !1)
  22175. }
  22176. }
  22177. },
  22178. //--------
  22179. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22180. var f2;
  22181. if (this.mode == mode) {
  22182. f1 && f1()
  22183. } else {
  22184. f2 = f1;
  22185. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22186. this.afterCModeFuc = function() {
  22187. this.afterCModeFuc = f2
  22188. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22189. }.bind(this)
  22190. } else {
  22191. this.afterCModeFuc = f2;//飞入后执行
  22192. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22193. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22194. }catch(e){}
  22195. }
  22196. }
  22197. }
  22198. ,
  22199. t.prototype.checkHasNeighbor = function(pano){//add
  22200. for(var i in pano.neighbourPanos ){
  22201. if(i == pano.id)continue;
  22202. if(pano.neighbourPanos[i]){
  22203. return true;
  22204. }
  22205. }
  22206. }
  22207. ,
  22208. ee.exports = t
  22209. }
  22210. ).call(this, "/js/player.js")
  22211. }
  22212. , {
  22213. "./constants": 8,
  22214. "./enum/AlignmentType": 17,
  22215. "./enum/BlackoutStyle": 18,
  22216. "./enum/ControlEvents": 21,
  22217. "./enum/Keys": 30,
  22218. "./enum/ModelManagerEvents": 33,
  22219. "./enum/PanoSizeClass": 36,
  22220. "./enum/PanoramaEvents": 37,
  22221. "./enum/PathDiscardMode": 38,
  22222. "./enum/PathDisplayMode": 39,
  22223. "./enum/PlayerEvents": 40,
  22224. "./enum/TagStates": 44,
  22225. "./enum/Vectors": 50,
  22226. "./enum/Viewmode": 51,
  22227. "./enum/WarpStyle": 52,
  22228. "./enum/ZoomEvents": 53,
  22229. "./exception/BasicException": 55,
  22230. "./model/ModelManager": 140,
  22231. "./objects/NSpider": 147,
  22232. "./objects/Panorama": 148,
  22233. "./objects/Reticule": 149,
  22234. "./objects/ShowPath": 151,
  22235. "./objects/Snapshot": 153,
  22236. "./objects/View": 154,
  22237. "./settings": 166,
  22238. "./shaders": 167,
  22239. "./tile/TileDownloader": 171,
  22240. "./tile/TilePrioritizer": 172,
  22241. "./util/ZoomStats": 179,
  22242. "./util/browser": 182,
  22243. "./util/camera": 183,
  22244. "./util/cameraLight": 184,
  22245. "./util/common": 185,
  22246. "./util/easing": 186,
  22247. "./util/history": 187,
  22248. "./util/lerp": 188,
  22249. "./util/logger": 189,
  22250. "./util/math": 190,
  22251. "./util/transitions": 195,
  22252. hot: "hot",
  22253. scaleImg: "scaleImg",
  22254. events: 202,
  22255. three: 217
  22256. }],
  22257. scaleImg: [function(e, t) {
  22258. var i = t;
  22259. (function() {
  22260. function e(e, t, i, n) {
  22261. function r() {
  22262. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22263. U.height = p,
  22264. H = U.getContext("2d")
  22265. }
  22266. function o(e) {
  22267. if (e) {
  22268. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22269. for (t = 0; t < ie; t += 4)
  22270. n[t] = e[t] * ne | 0,
  22271. n[t + 1] = e[t + 1] * ne | 0,
  22272. n[t + 2] = e[t + 2] * ne | 0,
  22273. n[t + 3] = e[t + 3] * ne | 0;
  22274. return delete e,
  22275. i
  22276. }
  22277. return H.getImageData(0, 0, d, p)
  22278. }
  22279. function a(e, t, i, n, r) {
  22280. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22281. }
  22282. var s, l;
  22283. if (t || (t = e.input,
  22284. i = e.output,
  22285. n = e.inputRemovable,
  22286. e.scale && (e = e.scale)),
  22287. t.src)
  22288. if (s = document.createElement("canvas"),
  22289. null != t.naturalWidth)
  22290. s.width = t.naturalWidth,
  22291. s.height = t.naturalHeight;
  22292. else if (null != t.runtimeStyle) {
  22293. var c = t.runtimeStyle
  22294. , h = c.width
  22295. , u = c.height;
  22296. c.width = "auto",
  22297. c.height = "auto",
  22298. s.width = t.width,
  22299. s.height = t.height,
  22300. c.width = h,
  22301. c.height = u
  22302. } else {
  22303. h = t.width,
  22304. u = t.height;
  22305. t.removeAttribute && (t.removeAttribute("width"),
  22306. t.removeAttribute("height")),
  22307. s.width = t.width,
  22308. s.height = t.height,
  22309. t.width = h,
  22310. t.height = u
  22311. }
  22312. else
  22313. s = t;
  22314. l = s.getContext("2d"),
  22315. t.src && l.drawImage(t, 0, 0);
  22316. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22317. if (!f || !g)
  22318. return !1;
  22319. (t.src || n) && s.clearRect(0, 0, f, g),
  22320. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22321. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22322. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22323. e * g + .5 | 0);
  22324. 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;
  22325. if (1 < re || 1 < oe)
  22326. for (r(),
  22327. G = (z = o()).data,
  22328. C = 0; C < p; C++)
  22329. for (V = (y = C / oe) - (w = 0 | y),
  22330. j = w * $,
  22331. W = w < 1 ? j : j - $,
  22332. w < g - 2 ? (Y = j + $,
  22333. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22334. A = 0; A < d; A++,
  22335. te += 4)
  22336. Z = (b = 0 | (v = A / re)) << 2,
  22337. b < f - 2 ? (K = Z + 4,
  22338. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22339. 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,
  22340. ++Z,
  22341. ++K,
  22342. ++Q,
  22343. 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,
  22344. ++Z,
  22345. ++K,
  22346. ++Q,
  22347. 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,
  22348. ++Z,
  22349. ++K,
  22350. ++Q,
  22351. 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,
  22352. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22353. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22354. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22355. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22356. else {
  22357. if (le.Float32Array)
  22358. L = new Float32Array(ie);
  22359. else
  22360. for (L = [],
  22361. te = 0; te < ie; ++te)
  22362. L[te] = 0;
  22363. for (y = 0; y < g; y++)
  22364. for (I = (_ = 0 | (C = y * oe)) * J,
  22365. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22366. R = C + oe - _ - 1),
  22367. v = 0; v < f; v++,
  22368. ee += 4)
  22369. switch (A = v * re,
  22370. E = 0 | A,
  22371. te = I + (E << 2),
  22372. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22373. P && (x = 1 + E - A,
  22374. S = A + re - E - 1),
  22375. D = m[ee],
  22376. F = m[ee + 1],
  22377. B = m[ee + 2],
  22378. N = m[ee + 3],
  22379. P + O) {
  22380. case 0:
  22381. L[te] += D * ae,
  22382. L[te + 1] += F * ae,
  22383. L[te + 2] += B * ae,
  22384. L[te + 3] += N * ae;
  22385. break;
  22386. case 1:
  22387. T = x * oe,
  22388. L[te] += D * T,
  22389. L[te + 1] += F * T,
  22390. L[te + 2] += B * T,
  22391. L[te + 3] += N * T,
  22392. T = S * oe,
  22393. L[te + 4] += D * T,
  22394. L[te + 5] += F * T,
  22395. L[te + 6] += B * T,
  22396. L[te + 7] += N * T;
  22397. break;
  22398. case 2:
  22399. T = re * M,
  22400. L[te] += D * T,
  22401. L[te + 1] += F * T,
  22402. L[te + 2] += B * T,
  22403. L[te + 3] += N * T,
  22404. T = re * R,
  22405. L[te += J] += D * T,
  22406. L[te + 1] += F * T,
  22407. L[te + 2] += B * T,
  22408. L[te + 3] += N * T;
  22409. break;
  22410. default:
  22411. T = x * M,
  22412. L[te] += D * T,
  22413. L[te + 1] += F * T,
  22414. L[te + 2] += B * T,
  22415. L[te + 3] += N * T,
  22416. T = S * M,
  22417. L[te + 4] += D * T,
  22418. L[te + 5] += F * T,
  22419. L[te + 6] += B * T,
  22420. L[te + 7] += N * T,
  22421. T = x * R,
  22422. L[te += J] += D * T,
  22423. L[te + 1] += F * T,
  22424. L[te + 2] += B * T,
  22425. L[te + 3] += N * T,
  22426. T = S * R,
  22427. L[te + 4] += D * T,
  22428. L[te + 5] += F * T,
  22429. L[te + 6] += B * T,
  22430. L[te + 7] += N * T
  22431. }
  22432. delete m,
  22433. r(),
  22434. z = o(L)
  22435. }
  22436. if (H.putImageData(z, 0, 0),
  22437. "string" == typeof i) {
  22438. var se;
  22439. if ("png" === i || "jpeg" === i)
  22440. return (se = n && t.src ? t : new Image).width = d,
  22441. se.height = p,
  22442. se.src = U.toDataURL("image/" + i, .85),
  22443. se;
  22444. if ("png-src" === i || "jpeg-src" === i)
  22445. return U.toDataURL("image/" + i.split("-")[0], .85)
  22446. }
  22447. return U
  22448. }
  22449. var le = this;
  22450. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22451. exports.scale = e) : c = e
  22452. }
  22453. ).call(this),
  22454. i.exports = c
  22455. }
  22456. , {}],
  22457. 156: [function(i, n, e) {
  22458. (function(e) {
  22459. "use strict";
  22460. function t(e, t) {
  22461. this.model = e,
  22462. this.panos = e.panos,
  22463. this.player = t,
  22464. this.imagePanos = this.listImagePanos(),
  22465. this.retryMinimumTime = 1e4
  22466. }
  22467. var r = (i("three"),
  22468. i("./enum/Viewmode"))
  22469. , o = (i("./settings"),
  22470. i("./objects/Panorama"))
  22471. , a = new (i("./util/logger"))(e);
  22472. t.prototype.start = function() {
  22473. this.loadNextPano(function(e) {
  22474. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22475. setTimeout(function() {
  22476. this.start()
  22477. }
  22478. .bind(this), 1e3))
  22479. }
  22480. .bind(this))
  22481. }
  22482. ,
  22483. t.prototype.validLoadTarget = function(e) {
  22484. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22485. }
  22486. ,
  22487. t.prototype.listImagePanos = function() {
  22488. var i = []
  22489. , n = this;
  22490. return this.model.images.forEach(function(e) {
  22491. if (e.metadata && e.metadata.scan_id) {
  22492. var t = n.model.panos.get(e.metadata.scan_id);
  22493. t && !t.isLoaded("high") && i.push(t)
  22494. }
  22495. }),
  22496. i
  22497. }
  22498. ,
  22499. t.prototype.nextNotLoadedImage = function() {
  22500. for (; 0 < this.imagePanos.length; ) {
  22501. var e = this.imagePanos[0];
  22502. if (!e.isLoaded("high"))
  22503. return e;
  22504. this.imagePanos.shift()
  22505. }
  22506. return null
  22507. }
  22508. ,
  22509. t.prototype.loadNextPano = function(e) {
  22510. var t, i, n = this.model.waitQueue.filter(function(e) {
  22511. return e.object instanceof o
  22512. });
  22513. 0 < n.length ? (t = n[0].object,
  22514. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22515. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22516. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22517. t = this.imagePanos[0],
  22518. 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),
  22519. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22520. a.debug("Preloading " + i + "-res pano " + t.id),
  22521. t.loadCube(i).done(e).fail(function() {
  22522. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22523. e()
  22524. })) : e && e(null)
  22525. }
  22526. ,
  22527. n.exports = t
  22528. }
  22529. ).call(this, "/js/preloaders.js")
  22530. }
  22531. , {
  22532. "./enum/Viewmode": 51,
  22533. "./objects/Panorama": 148,
  22534. "./settings": 166,
  22535. "./util/logger": 189,
  22536. three: 217
  22537. }],
  22538. 157: [function(a, s, e) {
  22539. (function(e) {
  22540. "use strict";
  22541. function t(e, t, i, n, r) {
  22542. this.qualityManager = e,
  22543. this.scene = t,
  22544. this.camera = i,
  22545. this.container = r,
  22546. this.controls = n,
  22547. this.controls.enabled = !0,
  22548. this.controls.locked = !0,
  22549. this.quickstartCamera = n.camera,
  22550. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22551. this.skybox = null
  22552. }
  22553. var i = a("three")
  22554. , n = a("../util/logger")
  22555. , o = a("../constants")
  22556. , h = (a("../util/transitions"),
  22557. a("../util/lerp"),
  22558. a("../util/easing"),
  22559. a("../enum/Vectors"))
  22560. , u = a("../enum/PanoSizeClass")
  22561. , r = (a("../materials/ModelTextureMaterial"),
  22562. a("../materials/CubemapMaterial"))
  22563. , d = (a("../cameras/PanoramaCamera"),
  22564. a("../controls/PanoramaControls"),
  22565. a("../tile/TileUtils"),
  22566. a("../util/camera"),
  22567. a("../util/cameraLight"))
  22568. , p = (a("../util/browser"),
  22569. a("../settings"),
  22570. a("../gui/helpManager"),
  22571. new n(e));
  22572. t.prototype.load = function(e) {
  22573. e.pano.shouldRedrawOnBaseLoaded = !0;
  22574. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22575. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22576. var a = this.qualityManager.getPanoSize(u.BASE)
  22577. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22578. if (e.pano.tiled) {
  22579. p.warn("Loading startPano, TILED", e.pano.id);
  22580. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22581. , c = this.quickstartCamera.fov;
  22582. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22583. t = e.pano.loadTiledPano(s, r, {
  22584. hFov: l,
  22585. vFov: c
  22586. }, !1, !1, !0),
  22587. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22588. } else
  22589. p.warn("Loading startPano", e.pano.id),
  22590. t = e.pano.loadCube("high");
  22591. return $.when(t).then(function() {
  22592. n.init(e.pano, e.quaternion),
  22593. e.pano.tiled ? i.done(function() {
  22594. e.pano.lockUntilRenderingComplete = !1,
  22595. this.controls.locked = !1
  22596. }
  22597. .bind(this)) : this.controls.locked = !1
  22598. }
  22599. .bind(this))
  22600. }
  22601. ,
  22602. t.prototype.init = function(e, t) {
  22603. p.info("Quickstart done loading, adding scene objects"),
  22604. e.lockUntilRenderingComplete = !0,
  22605. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22606. side: i.BackSide
  22607. })),
  22608. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22609. this.skybox.quaternion.copy(e.quaternion),
  22610. this.scene.add(this.skybox),
  22611. $(this.container).show()
  22612. }
  22613. ,
  22614. t.prototype.update = function(e) {
  22615. this.controls.update(e),
  22616. this.camera.copy(this.quickstartCamera)
  22617. }
  22618. ,
  22619. t.prototype.setSize = function(e, t) {
  22620. this.quickstartCamera.updateAspect(e / t)
  22621. }
  22622. ,
  22623. t.prototype.destroy = function() {
  22624. this.scene.remove(this.skybox)
  22625. }
  22626. ,
  22627. s.exports = t
  22628. }
  22629. ).call(this, "/js/scene/QuickstartManager.js")
  22630. }
  22631. , {
  22632. "../cameras/PanoramaCamera": 7,
  22633. "../constants": 8,
  22634. "../controls/PanoramaControls": 13,
  22635. "../enum/PanoSizeClass": 36,
  22636. "../enum/Vectors": 50,
  22637. "../gui/helpManager": 68,
  22638. "../materials/CubemapMaterial": 117,
  22639. "../materials/ModelTextureMaterial": 118,
  22640. "../settings": 166,
  22641. "../tile/TileUtils": 174,
  22642. "../util/browser": 182,
  22643. "../util/camera": 183,
  22644. "../util/cameraLight": 184,
  22645. "../util/easing": 186,
  22646. "../util/lerp": 188,
  22647. "../util/logger": 189,
  22648. "../util/transitions": 195,
  22649. three: 217
  22650. }],
  22651. 158: [function(e, t, i) {
  22652. "use strict";
  22653. function h(e, t, i) {
  22654. this.scene = e,
  22655. this.camera = t,
  22656. this.renderer = null,
  22657. this.effects = i,
  22658. this.animateCallback = null,
  22659. this.composer = null,
  22660. this.qualityManager = null,
  22661. e.renderWidth = 0,
  22662. e.renderHeight = 0,
  22663. this.updateClock = new M.Clock,
  22664. this.components = [],
  22665. this.updateListeners = [],
  22666. this.resizeListeners = [],
  22667. this.forceUpdateSize = !1,
  22668. this.started = !1,
  22669. this.textures = {},
  22670. this.suspendedObjects = []
  22671. }
  22672. 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;
  22673. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22674. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22675. this.components.push(e),
  22676. e.update && this.updateListeners.push(e),
  22677. e.setSize && (this.resizeListeners.push(e),
  22678. this.forceUpdateSize = !0)
  22679. }
  22680. ,
  22681. h.prototype.removeComponent = function(t) {
  22682. function e(e) {
  22683. return e !== t
  22684. }
  22685. this.components = this.components.filter(e),
  22686. this.updateListeners = this.updateListeners.filter(e),
  22687. this.resizeListeners = this.resizeListeners.filter(e)
  22688. }
  22689. ,
  22690. h.prototype.start = function(e) {
  22691. if (this.started)
  22692. throw new l("Can't start SceneRenderer, already started");
  22693. this.createContext(e),
  22694. //u.isMobile() && this.boluoVrInit(),
  22695. this.initComposer(),
  22696. this.started = !0,
  22697. (b = b.bind(this))()
  22698. }
  22699. ,
  22700. h.prototype.createContext = function(e) {
  22701. try {
  22702. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22703. this.renderer.autoClear = !0,
  22704. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22705. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22706. this.emit(r.ContextCreated)
  22707. } catch (e) {
  22708. throw new c("Unable to create a WebGL rendering context")
  22709. }
  22710. d.profiling.enabled && this.overrideTextures(),
  22711. e.appendChild(this.renderer.domElement)
  22712. }
  22713. ,
  22714. h.prototype.overrideTextures = function() {
  22715. var d = this.renderer.context
  22716. , t = 0
  22717. , i = d.createTexture;
  22718. d.createTexture = function() {
  22719. var e = i.call(d);
  22720. return e.id = t++,
  22721. this.textures[e.id] = e
  22722. }
  22723. .bind(this);
  22724. var p = d.texImage2D;
  22725. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22726. var c, h = this.getTextureTypeFromTarget(d, e);
  22727. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22728. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22729. s = r,
  22730. n = (l = o).naturalWidth,
  22731. r = l.naturalHeight,
  22732. p.call(d, e, t, i, a, s, l));
  22733. var u = this.textures[c.id];
  22734. u.width = h === f.TextureCube ? 6 * n : n,
  22735. u.height = r
  22736. }
  22737. .bind(this);
  22738. var n = d.deleteTexture;
  22739. d.deleteTexture = function(e) {
  22740. delete this.textures[e.id],
  22741. n.call(d, e)
  22742. }
  22743. .bind(this)
  22744. }
  22745. ,
  22746. h.prototype.updateTextureMemory = (n = null,
  22747. function() {
  22748. var e = 0;
  22749. for (var t in this.textures) {
  22750. var i = this.textures[t];
  22751. i.width && i.height && (e += i.width * i.height * 4)
  22752. }
  22753. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22754. n = e
  22755. }
  22756. ),
  22757. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22758. switch (t) {
  22759. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22760. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22761. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22762. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22763. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22764. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22765. return f.TextureCube;
  22766. case e.TEXTURE_2D:
  22767. return f.Texture2D;
  22768. default:
  22769. return null
  22770. }
  22771. }
  22772. ,
  22773. h.prototype.initComposer = function() {
  22774. this.composer = new M.EffectComposer(this.renderer),
  22775. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22776. this.composer.addPass(this.effects.hblurPass),
  22777. this.composer.addPass(this.effects.vblurPass)
  22778. }
  22779. ,
  22780. h.prototype.setSize = function(e, t, i) {
  22781. this.renderWidth = e,
  22782. this.renderHeight = t,
  22783. this.effects.aspect = e / t,
  22784. this.renderer.setSize(e, t, !1, i),
  22785. this.composer.setSize(e, t);
  22786. for (var n = 0; n < this.resizeListeners.length; n++)
  22787. this.resizeListeners[n].setSize(e, t)
  22788. }
  22789. ,
  22790. h.prototype.render = function() {
  22791. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22792. }
  22793. ,
  22794. h.prototype.boluoVrInit = function() {
  22795. console.log("boluoVrInit"),
  22796. this.isHuawei5X = u.detectHUAWEI5X(),
  22797. this.oldRenderer = this.renderer,
  22798. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22799. window.panoCamera = this.camera;
  22800. var i = this;
  22801. window._vrEnabled = !1,
  22802. Object.defineProperty(window, "vrEnabled", {
  22803. get: function() {
  22804. return window._vrEnabled
  22805. },
  22806. set: function(e) {
  22807. (e = !!e) ? (i.renderer = i.newRenderer,
  22808. window.vrMarkers.forEach(function(e) {
  22809. e.visible = !0
  22810. })) : (i.renderer = i.oldRenderer,
  22811. window.vrMarkers.forEach(function(e) {
  22812. e.visible = !1
  22813. })),
  22814. i.cursor.visible = e,
  22815. i.setSize(window.innerWidth, window.innerHeight),
  22816. window._vrEnabled = e,
  22817. setTimeout(function() {
  22818. console.log(player.cameraControls.activeControl.camera.fov)
  22819. }, 500)
  22820. }
  22821. }),
  22822. this.createCursor(.5, !1, 1, 16777215, 0);
  22823. var e = {
  22824. setSize: function(e, t) {
  22825. i.camera.aspect = e / t
  22826. }
  22827. };
  22828. this.resizeListeners.push(e),
  22829. this.vrLoadingInit()
  22830. }
  22831. ,
  22832. h.prototype.vrLoadingInit = function() {
  22833. var e = new (e = function(camera) {
  22834. var t = this
  22835. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22836. , i = new M.MeshBasicMaterial({
  22837. color: 4967932,
  22838. side: M.DoubleSide
  22839. })
  22840. , n = new M.Mesh(e,i);
  22841. (this.mesh = n).position.z = -2,
  22842. n.scale.set(.08, .08, .08),
  22843. n.visible = !1,
  22844. //window.player.camera.add(n),
  22845. camera.add(n),
  22846. t.enabled = !1,
  22847. this.update = function(e) {
  22848. 1 == t.enabled && (n.rotation.z += 15 * e)
  22849. }
  22850. }
  22851. )(this.camera);
  22852. window.Loading = e,
  22853. this.updateListeners.push(e)
  22854. }
  22855. ,
  22856. h.prototype.createCursor = function(e, t, i, n, r) {
  22857. var o, a = new M.SpriteMaterial({
  22858. opacity: i,
  22859. color: n,
  22860. transparent: t,
  22861. map: this.boluoGetTexture("images/cursor.png"),
  22862. needsUpdate: !0,
  22863. side: M.DoubleSide
  22864. });
  22865. a.map.offset = new M.Vector2(1 / 17 * r,0),
  22866. a.map.repeat = new M.Vector2(1 / 17,1),
  22867. a.depthTest = !1,
  22868. a.blending = M.AdditiveBlending,
  22869. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  22870. o.position.z = -2,
  22871. o.visible = !1,
  22872. o.name = "cursor",
  22873. this.camera.add(o),
  22874. this.scene.add(this.camera),
  22875. this.cursor = o;
  22876. var s = new this.CursorAnimation(this.scene,o,this.camera);
  22877. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  22878. this.updateListeners.push(s)
  22879. }
  22880. ,
  22881. h.prototype.CursorAnimation = function(e, t, o) {
  22882. this.cursor = t,
  22883. this.raycaster = new M.Raycaster,
  22884. this.targetEventObj = {},
  22885. this.type = 1,
  22886. this.tweenFlag = !0;
  22887. var s = this;
  22888. this.target = o,
  22889. console.log(o.uuid),
  22890. this.euler = new M.Euler,
  22891. this.q0 = new M.Quaternion,
  22892. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  22893. this.zee = new M.Vector3(0,0,1),
  22894. this.alpha = -1e3,
  22895. this.beta = -1e3,
  22896. this.gamma = -1e3,
  22897. this.orient = M.Math.degToRad(window.orientation || 0),
  22898. window.addEventListener("orientationchange", function() {
  22899. s.orient = M.Math.degToRad(window.orientation || 0)
  22900. }),
  22901. window.addEventListener("deviceorientation", function(e) {
  22902. var t = M.Math.degToRad(e.alpha)
  22903. , i = M.Math.degToRad(e.beta)
  22904. , n = M.Math.degToRad(e.gamma);
  22905. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  22906. -1e3 === s.beta && (s.beta = i),
  22907. -1e3 === s.gamma && (s.gamma = n),
  22908. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  22909. .006 < Math.abs(i - s.beta) && (s.beta = i),
  22910. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  22911. s.beta = i,
  22912. s.gamma = n),
  22913. h.vrDebug) {
  22914. $("#info-device-orientation").css("display", "block");
  22915. var r = "";
  22916. r += "alpha=(" + s.alpha + ")<BR/>",
  22917. r += "beta=(" + s.beta + ")<BR/>",
  22918. r += "gamma=" + s.gamma + "<BR/>",
  22919. document.getElementById("info-device-orientation").innerHTML = r
  22920. }
  22921. }),
  22922. this.setObjectQuaternion = function(e, t, i, n, r) {
  22923. s.euler.set(i, t, -n, "YXZ"),
  22924. e.setFromEuler(s.euler),
  22925. e.multiply(s.q1),
  22926. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  22927. o.updateMatrixWorld()
  22928. }
  22929. ,
  22930. parent !== window && window.addEventListener("message", function(e) {
  22931. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  22932. o && o.alpha && o.beta && o.gamma && (t = a,
  22933. i = M.Math.degToRad(o.alpha),
  22934. n = M.Math.degToRad(o.beta),
  22935. r = M.Math.degToRad(o.gamma),
  22936. t ? (-1e3 === s.alpha && (s.alpha = i),
  22937. -1e3 === s.beta && (s.beta = n),
  22938. -1e3 === s.gamma && (s.gamma = r),
  22939. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  22940. .006 < Math.abs(n - s.beta) && (s.beta = n),
  22941. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  22942. s.beta = n,
  22943. s.gamma = r))
  22944. }),
  22945. this.update = function(e) {
  22946. TWEEN.update(),
  22947. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  22948. this.triggerTargetEvent())
  22949. }
  22950. ,
  22951. this.triggerTargetEvent = function() {
  22952. var e = this.choseObj()
  22953. , t = e ? e.object : void 0;
  22954. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  22955. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  22956. t && t.enabled && this.startAnimate(function() {
  22957. this.clickCallback(t)
  22958. }
  22959. .bind(this))) : this.type,
  22960. this.targetEventObj.lastObj = t)
  22961. }
  22962. ,
  22963. this.choseObj = function() {
  22964. this.raycaster.setFromCamera({
  22965. x: 0,
  22966. y: 0
  22967. }, o);
  22968. var e = (this.raycaster.ray,
  22969. window.vrMarkers)
  22970. , t = this.raycaster.intersectObjects(e);
  22971. if (0 < t.length)
  22972. return t[0]
  22973. }
  22974. ,
  22975. this.clickCallback = function(e) {
  22976. this.runTHREEAction(e, "onclick")
  22977. }
  22978. ,
  22979. this.runTHREEAction = function(e, t) {
  22980. switch (t) {
  22981. case "onclick":
  22982. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  22983. e()
  22984. });
  22985. break;
  22986. case "onhover":
  22987. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  22988. e()
  22989. });
  22990. break;
  22991. case "onout":
  22992. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  22993. e()
  22994. })
  22995. }
  22996. }
  22997. ,
  22998. this.startAnimate = function(e) {
  22999. this.tweenFlag && this.initAnimation(e)
  23000. }
  23001. ,
  23002. this.initAnimation = function(e) {
  23003. var t = this
  23004. , i = this.cursor.material.map.offset;
  23005. t.tweenFlag = !1,
  23006. this.cursorAnimate = new TWEEN.Tween(i).to({
  23007. x: 1
  23008. }, 1e3).onStart(function() {
  23009. t.tweenFlag = !1
  23010. }).onStop(function() {
  23011. t.tweenFlag = !0,
  23012. this.x = 0,
  23013. i.x = 0
  23014. }).onUpdate(function() {}).onComplete(function() {
  23015. e(),
  23016. i.x = 0,
  23017. setTimeout(function() {
  23018. t.tweenFlag = !0
  23019. }, 1500)
  23020. }),
  23021. this.cursorAnimate.easing(function(e) {
  23022. return Math.floor(17 * e) / 17
  23023. }),
  23024. this.cursorAnimate.start()
  23025. }
  23026. ,
  23027. this.autoCursorPosition = function(e) {
  23028. this.cursor.scale.set(.3, .3, .3)
  23029. }
  23030. }
  23031. ,
  23032. h.prototype.vrRenderer = function(a, i, e) {
  23033. var s = new i.vrCamera(e);
  23034. s.bananaAspect = .8,
  23035. this.width,
  23036. this.height;
  23037. i = this;
  23038. this.setSize = function(e, t) {
  23039. a.setSize.call(this, e, t),
  23040. i.width = e,
  23041. i.height = t
  23042. }
  23043. ,
  23044. this.render = function(e, t, i, n) {
  23045. var r, o;
  23046. if (window.cameraQua = t.quaternion.clone(),
  23047. t.__RESS__SKIP__STEREO__)
  23048. return a.render(e, t, i, n);
  23049. if ("PerspectiveCamera" === t.type)
  23050. r = s.cameraL,
  23051. o = s.cameraR,
  23052. e.updateMatrixWorld(),
  23053. null === t.parent && t.updateMatrixWorld(),
  23054. s.vrCameraUpdate(t);
  23055. else {
  23056. if ("OrthographicCamera" !== t.type)
  23057. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23058. r = o = t
  23059. }
  23060. a.setScissorTest(!0),
  23061. a.setScissor(0, 0, this.width / 2, this.height),
  23062. a.setViewport(0, 0, this.width / 2, this.height),
  23063. a.render.call(this, e, r, i, n),
  23064. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23065. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23066. a.render.call(this, e, o, i, n),
  23067. a.setScissorTest(!1)
  23068. }
  23069. ,
  23070. this.__proto__ = {
  23071. __proto__: a
  23072. }
  23073. }
  23074. ,
  23075. h.prototype.vrCamera = function(e) {
  23076. this.type = "StereoCamera",
  23077. this._aspect = 1,
  23078. this._overlap = .064,
  23079. this.cameraL = new M.PerspectiveCamera,
  23080. this.cameraL.layers.enable(1),
  23081. this.cameraL.matrixAutoUpdate = !1,
  23082. this.cameraR = new M.PerspectiveCamera,
  23083. this.cameraR.layers.enable(2),
  23084. this.cameraR.matrixAutoUpdate = !1,
  23085. this.eyeRight = new M.Matrix4,
  23086. this.eyeLeft = new M.Matrix4,
  23087. this.vrCameraNeedsUpdate = !0,
  23088. window.vrCameraL = this.cameraL,
  23089. Object.defineProperty(this, "bananaAspect", {
  23090. get: function() {
  23091. return this._aspect
  23092. },
  23093. set: function(e) {
  23094. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23095. this._aspect = e
  23096. }
  23097. }),
  23098. Object.defineProperty(this, "overlap", {
  23099. get: function() {
  23100. return this._overlap
  23101. },
  23102. set: function(e) {
  23103. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23104. this._overlap = e
  23105. }
  23106. }),
  23107. this.vrCameraUpdate = function(e) {
  23108. if (this.vrCameraNeedsUpdate = !0,
  23109. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23110. this.vrCameraNeedsUpdate) {
  23111. this.vrCameraNeedsUpdate = !1,
  23112. console.debug("vrCameraUpdate"),
  23113. this.bananaFocus = e.focus,
  23114. this.bananaFov = e.fov,
  23115. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23116. this.bananaNear = e.near,
  23117. this.bananaFar = e.far,
  23118. console.debug(e.aspect),
  23119. this.bananaFocus = 10;
  23120. 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);
  23121. this.eyeLeft.elements[12] = -r,
  23122. this.eyeRight.elements[12] = r,
  23123. t = -a * this.bananaReal_aspect + o,
  23124. i = a * this.bananaReal_aspect + o,
  23125. n.elements[0] = 2 * this.bananaNear / (i - t),
  23126. n.elements[8] = (i + t) / (i - t),
  23127. this.cameraL.projectionMatrix.copy(n),
  23128. t = -a * this.bananaReal_aspect - o,
  23129. i = a * this.bananaReal_aspect - o,
  23130. n.elements[0] = 2 * this.bananaNear / (i - t),
  23131. n.elements[8] = (i + t) / (i - t),
  23132. this.cameraR.projectionMatrix.copy(n)
  23133. }
  23134. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23135. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23136. }
  23137. }
  23138. ,
  23139. h.prototype.boluoGetTexture = function(e) {
  23140. var t = new M.TextureLoader;
  23141. return t.crossOrigin = "anonymous",
  23142. t.load(e)
  23143. }
  23144. ,
  23145. h.prototype.updateScreenSize = function(e) {
  23146. var t, i, n, r = !1;
  23147. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23148. n = e.height,
  23149. r = !0,
  23150. t = 1) : (i = $("#player").width(),
  23151. n = $("#player").height(),
  23152. e && e.resize && (o = this.renderWidth,
  23153. a = this.renderHeight),
  23154. i === o && n === a && !this.forceUpdateSize || (o = i,
  23155. a = n,
  23156. r = !0,
  23157. t = window.devicePixelRatio)),
  23158. r && (this.setSize(i, n, t),
  23159. this.forceUpdateSize = !1)
  23160. }
  23161. ,
  23162. h.prototype.updateComponents = function() {
  23163. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23164. this.updateListeners[t].update(e)
  23165. }
  23166. ,
  23167. h.prototype.suspend = function() {
  23168. this.started = !1,
  23169. this.suspendedObjects = this.scene.children.map(function(e) {
  23170. return this.scene.remove(e),
  23171. e
  23172. }
  23173. .bind(this)),
  23174. this.render()
  23175. }
  23176. ,
  23177. h.prototype.resume = function() {
  23178. this.suspendedObjects.forEach(function(e) {
  23179. this.scene.add(e)
  23180. }
  23181. .bind(this)),
  23182. this.suspendedObjects = [],
  23183. this.started = !0,
  23184. b()
  23185. }
  23186. ;
  23187. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23188. this.started && (window.requestAnimationFrame(b),
  23189. this.updateScreenSize(),
  23190. this.updateComponents(),
  23191. this.updateTextureMemory(),
  23192. this.render(),
  23193. this.emit(r.AfterRender))
  23194. };
  23195. h.prototype.getImageData = (E = document.createElement("canvas"),
  23196. _ = E.getContext("2d"),
  23197. function(e, t, i) {
  23198. return E.width === t && E.height === i || (E.width = t,
  23199. E.height = i),
  23200. _.drawImage(e, 0, 0, t, i),
  23201. _.getImageData(0, 0, t, i)
  23202. }
  23203. ),
  23204. h.prototype.initSizedTexture2D = function(e, t, i) {
  23205. var n = this.renderer
  23206. , r = n.context
  23207. , o = n.state
  23208. , a = new M.Texture(null);
  23209. !(a.flipY = !1) !== i && (i = !1),
  23210. a.generateMipmaps = i;
  23211. var s = n.paramThreeToGL(a.format)
  23212. , l = n.paramThreeToGL(a.type)
  23213. , c = n.properties.get(a)
  23214. , h = r.createTexture();
  23215. o.bindTexture(r.TEXTURE_2D, h),
  23216. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23217. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23218. a.wrapS = t,
  23219. a.wrapT = t;
  23220. var u = n.paramThreeToGL(t);
  23221. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23222. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23223. i ? (a.magFilter = M.LinearFilter,
  23224. a.minFilter = M.LinearMipMapLinearFilter,
  23225. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23226. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23227. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23228. a.minFilter = M.LinearFilter,
  23229. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23230. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23231. o.bindTexture(r.TEXTURE_2D, null),
  23232. c.__webglTexture = h,
  23233. a
  23234. }
  23235. ,
  23236. h.prototype.initSizedCubeMap = function(e, t) {
  23237. var i = this.renderer
  23238. , n = i.context
  23239. , r = i.state
  23240. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23241. o.flipY = !1,
  23242. o.generateMipmaps = t;
  23243. var a = i.paramThreeToGL(o.format)
  23244. , s = i.paramThreeToGL(o.type)
  23245. , l = i.properties.get(o)
  23246. , c = n.createTexture();
  23247. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23248. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23249. for (var h = 0; h < 6; h++)
  23250. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23251. return t ? (o.magFilter = M.LinearFilter,
  23252. o.minFilter = M.LinearMipMapLinearFilter,
  23253. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23254. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23255. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23256. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23257. o.minFilter = M.LinearFilter,
  23258. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23259. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23260. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23261. l.__image__webglTextureCube = c,
  23262. o
  23263. }
  23264. ,
  23265. h.prototype.deallocateCubeTexture = function(e) {
  23266. var t = this.renderer
  23267. , i = t.context
  23268. , n = t.properties.get(e);
  23269. i.deleteTexture(n.__image__webglTextureCube)
  23270. }
  23271. ,
  23272. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23273. var a = this.renderer
  23274. , s = a.context
  23275. , l = a.state
  23276. , c = a.properties.get(t);
  23277. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23278. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23279. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23280. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23281. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23282. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23283. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23284. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23285. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23286. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23287. l.bindTexture(s.TEXTURE_2D, null)
  23288. }
  23289. ,
  23290. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23291. var s = this.renderer
  23292. , l = s.context
  23293. , c = s.state
  23294. , h = s.properties.get(t);
  23295. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23296. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23297. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23298. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23299. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23300. }
  23301. ,
  23302. h.prototype.rebuildMipMaps2D = function(e) {
  23303. var t = this.renderer
  23304. , i = t.context
  23305. , n = t.state;
  23306. t.properties.get(e),
  23307. i.generateMipmap(i.TEXTURE_2D),
  23308. n.bindTexture(i.TEXTURE_2D, null)
  23309. }
  23310. ,
  23311. h.prototype.rebuildMipMaps3D = function(e) {
  23312. var t = this.renderer
  23313. , i = t.context
  23314. , n = t.state
  23315. , r = t.properties.get(e);
  23316. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23317. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23318. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23319. }
  23320. ,
  23321. h.prototype.renderToCubeMap = (P = !1,
  23322. F = N = D = L = O = null,
  23323. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23324. this.renderer.context,
  23325. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23326. (O = new M.Scene).add(L),
  23327. D = new M.ShaderMaterial({
  23328. uniforms: {
  23329. tDiffuse: {
  23330. type: "t",
  23331. value: null
  23332. },
  23333. alpha: {
  23334. type: "f",
  23335. value: 1
  23336. }
  23337. },
  23338. vertexShader: R.basicTextured.vertexShader,
  23339. fragmentShader: R.basicTextured.fragmentShader,
  23340. depthWrite: !1,
  23341. depthTest: !1,
  23342. side: M.DoubleSide
  23343. }),
  23344. N = new M.PlaneBufferGeometry(1,1),
  23345. (F = new M.Mesh(N,D)).position.z = 0,
  23346. O.add(F),
  23347. P = !0);
  23348. var m = N.getAttribute("uv");
  23349. m.setDynamic(!0),
  23350. m.needsUpdate = !0;
  23351. var v = m.array
  23352. , y = r / i
  23353. , A = o / n
  23354. , C = a / i
  23355. , I = s / n;
  23356. v[0] = y,
  23357. v[1] = A + I,
  23358. v[2] = y + C,
  23359. v[3] = A + I,
  23360. v[4] = y,
  23361. v[5] = A,
  23362. v[6] = y + C,
  23363. v[7] = A;
  23364. var E = N.getAttribute("position");
  23365. E.setDynamic(!0),
  23366. E.needsUpdate = !0;
  23367. var _ = E.array
  23368. , b = l / t.width - .5
  23369. , w = c / t.height - .5
  23370. , T = h / t.width
  23371. , x = u / t.height;
  23372. _[0] = b,
  23373. _[1] = w + x,
  23374. _[3] = b + T,
  23375. _[4] = w + x,
  23376. _[6] = b,
  23377. _[7] = w,
  23378. _[9] = b + T,
  23379. _[10] = w,
  23380. this.renderer.properties.get(e),
  23381. D.uniforms.tDiffuse.value = e,
  23382. D.blending = p || M.NoBlending,
  23383. D.transparent = !!f,
  23384. null != g || (g = 1),
  23385. D.uniforms.alpha.value = g,
  23386. D.needUpdate = !0,
  23387. t.activeCubeFace = d,
  23388. t.viewport.set(0, 0, t.width, t.height);
  23389. var S = this.renderer.autoClear;
  23390. this.renderer.autoClear = !1,
  23391. this.renderer.render(O, L, t, !1),
  23392. this.renderer.autoClear = S
  23393. }
  23394. ),
  23395. h.prototype.copyCubeMap = (g = !1,
  23396. C = A = y = v = m = null,
  23397. I = new M.Euler,
  23398. new M.Vector3,
  23399. function(e, t, i, n, r, o, a, s, l) {
  23400. this.renderer,
  23401. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23402. (m = new M.Scene).add(v),
  23403. y = new M.ShaderMaterial({
  23404. uniforms: {
  23405. tDiffuse: {
  23406. type: "t",
  23407. value: null
  23408. },
  23409. alpha: {
  23410. type: "f",
  23411. value: 1
  23412. }
  23413. },
  23414. vertexShader: R.copyCubeMap.vertexShader,
  23415. fragmentShader: R.copyCubeMap.fragmentShader,
  23416. depthWrite: !1,
  23417. depthTest: !1,
  23418. side: M.DoubleSide
  23419. }),
  23420. A = new M.BoxGeometry(2,2,2),
  23421. C = new M.Mesh(A,y),
  23422. m.add(C),
  23423. g = !0);
  23424. for (var c = 0; c < 6; c++)
  23425. h.getCubeOrientationForCubeFace(c, I),
  23426. C.rotation.copy(I),
  23427. C.matrixWorldNeedsUpdate = !0,
  23428. C.updateMatrixWorld(),
  23429. y.uniforms.tDiffuse.value = e,
  23430. y.blending = a || M.NoBlending,
  23431. y.transparent = !!s,
  23432. null != l || (l = 1),
  23433. y.uniforms.alpha.value = l,
  23434. y.needUpdate = !0,
  23435. t.activeCubeFace = c,
  23436. t.viewport.set(0, 0, r, o),
  23437. this.renderer.render(m, v, t, !1)
  23438. }
  23439. ),
  23440. h.getLookAtForCubeFace = function(e, t) {
  23441. switch (e) {
  23442. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23443. t.set(1, 0, 0);
  23444. break;
  23445. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23446. t.set(-1, 0, 0);
  23447. break;
  23448. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23449. t.set(0, 1, 0);
  23450. break;
  23451. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23452. t.set(0, -1, 0);
  23453. break;
  23454. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23455. t.set(0, 0, 1);
  23456. break;
  23457. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23458. t.set(0, 0, -1)
  23459. }
  23460. }
  23461. ,
  23462. h.getCubeOrientationForCubeFace = function(e, t) {
  23463. switch (e) {
  23464. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23465. t.set(0, -Math.PI / 2, 0);
  23466. break;
  23467. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23468. t.set(0, Math.PI / 2, 0);
  23469. break;
  23470. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23471. t.set(Math.PI / 2, Math.PI, 0);
  23472. break;
  23473. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23474. t.set(-Math.PI / 2, Math.PI, 0);
  23475. break;
  23476. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23477. t.set(0, -Math.PI, 0);
  23478. break;
  23479. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23480. t.set(0, 0, 0)
  23481. }
  23482. }
  23483. ,
  23484. t.exports = h
  23485. }
  23486. , {
  23487. "../enum/GLCubeFaces": 25,
  23488. "../enum/GLTextureType": 26,
  23489. "../enum/SceneRendererEvents": 43,
  23490. "../exception/BasicException": 55,
  23491. "../exception/RendererCreationException": 57,
  23492. "../settings": 166,
  23493. "../shaders": 167,
  23494. "../util/browser": 182,
  23495. events: 202,
  23496. three: 217
  23497. }],
  23498. 159: [function(e, t, i) {
  23499. "use strict";
  23500. function n(e) {
  23501. this.messenger = new a(e),
  23502. this.clientKey = null
  23503. }
  23504. var o = e("../util/ajax")
  23505. , r = e("./PostMessageType")
  23506. , a = e("./postmessage")
  23507. , s = e("./VersionInfo")
  23508. , l = e("events").EventEmitter
  23509. , c = window.location.origin + "/api/v1/user/";
  23510. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23511. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23512. }
  23513. ,
  23514. n.prototype.waitForConnection = function() {
  23515. return new Promise(function(t, i) {
  23516. this.messenger.on(r.CONNECT, function(e) {
  23517. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23518. }
  23519. .bind(this))
  23520. }
  23521. .bind(this))
  23522. }
  23523. ,
  23524. n.prototype.onConnectionReceived = function(i) {
  23525. return this.messenger.setTarget(i.source, i.origin),
  23526. this.verifyConnection(i).then(function(e, t) {
  23527. this.messenger.send({
  23528. type: r.ACCEPT,
  23529. toId: i.fromId,
  23530. warning: t
  23531. }),
  23532. this.clientKey = e,
  23533. this.messenger.removeAllListeners(r.CONNECT),
  23534. this.bindEvents()
  23535. }
  23536. .bind(this), function(e) {
  23537. this.messenger.send({
  23538. type: r.REJECT,
  23539. toId: i.fromId,
  23540. reason: e
  23541. }),
  23542. this.messenger.setTarget()
  23543. }
  23544. .bind(this))
  23545. }
  23546. ,
  23547. n.prototype.verifyConnection = function(r) {
  23548. return new Promise(function(e, t) {
  23549. var i;
  23550. if (s.isDeprecated(r.sdkVersion))
  23551. i = "这个版本正在被弃用";
  23552. else if (!s.isSupported(r.sdkVersion))
  23553. return t("不支持此版本的SDK");
  23554. var n = {
  23555. cache: !1,
  23556. headers: {
  23557. "X-port-Application-Key": r.applicationKey,
  23558. "X-port-Referrer": r.origin
  23559. }
  23560. };
  23561. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23562. }
  23563. )
  23564. }
  23565. ,
  23566. n.prototype.onMessageReceived = function(t) {
  23567. if (this.validateClientApplicationKey(t.applicationKey)) {
  23568. var i = this;
  23569. t.onDone = function(e) {
  23570. e.toId = t.fromId,
  23571. e.uid = t.uid,
  23572. e.type = r.RESPONSE,
  23573. i.messenger.send(e)
  23574. }
  23575. ,
  23576. this.emit(r.ACTION, t)
  23577. }
  23578. }
  23579. ,
  23580. n.prototype.validateClientApplicationKey = function(e) {
  23581. return this.clientKey === e
  23582. }
  23583. ,
  23584. n.prototype.sendEvent = function(e, t) {
  23585. this.messenger.send({
  23586. type: r.EVENT,
  23587. eventType: e,
  23588. eventData: t
  23589. })
  23590. }
  23591. ,
  23592. t.exports = n
  23593. }
  23594. , {
  23595. "../util/ajax": 181,
  23596. "./PostMessageType": 160,
  23597. "./VersionInfo": 163,
  23598. "./postmessage": 165,
  23599. events: 202
  23600. }],
  23601. 160: [function(e, t, i) {
  23602. "use strict";
  23603. t.exports = Object.freeze({
  23604. CONNECT: "postmessage.connect",
  23605. ACCEPT: "postmessage.accept",
  23606. REJECT: "postmessage.reject",
  23607. ACTION: "postmessage.action",
  23608. RESPONSE: "postmessage.response",
  23609. EVENT: "postmessage.event"
  23610. })
  23611. }
  23612. , {}],
  23613. 161: [function(e, t, i) {
  23614. "use strict";
  23615. t.exports = Object.freeze({
  23616. MOVE: "sdk.move",
  23617. ENTER_PANO: "sdk.enterpano",
  23618. MODEL_LOADED: "sdk.modelloaded"
  23619. })
  23620. }
  23621. , {}],
  23622. 162: [function(e, t, i) {
  23623. "use strict";
  23624. t.exports = Object.freeze({
  23625. FLY: "transition.fly",
  23626. FADEOUT: "transition.fade",
  23627. INSTANT: "transition.instant"
  23628. })
  23629. }
  23630. , {}],
  23631. 163: [function(e, t, i) {
  23632. "use strict";
  23633. t.exports = {
  23634. current: "1.0",
  23635. supported: ["1.0"],
  23636. deprecated: [],
  23637. isSupported: function(e) {
  23638. return -1 !== this.supported.indexOf(e)
  23639. },
  23640. isDeprecated: function(e) {
  23641. return -1 !== this.deprecated.indexOf(e)
  23642. },
  23643. isValid: function(e) {
  23644. return this.isSupported(e) || this.isDeprecated(e)
  23645. }
  23646. }
  23647. }
  23648. , {}],
  23649. 164: [function(q, X, e) {
  23650. (function(e) {
  23651. "use strict";
  23652. function r(e, t, i) {
  23653. e = e && e.toLowerCase().trim();
  23654. var n = new C.UP.clone
  23655. , r = Math.PI / 3
  23656. , o = Math.PI / 2;
  23657. switch (e) {
  23658. case "left":
  23659. i.copy(t),
  23660. i.applyAxisAngle(n, o);
  23661. break;
  23662. case "right":
  23663. i.copy(t),
  23664. i.applyAxisAngle(n, -o);
  23665. break;
  23666. case "forwardleft":
  23667. i.copy(t),
  23668. i.applyAxisAngle(n, r);
  23669. break;
  23670. case "forwardright":
  23671. i.copy(t),
  23672. i.applyAxisAngle(n, -r);
  23673. break;
  23674. case "forward":
  23675. default:
  23676. i.copy(t)
  23677. }
  23678. return i
  23679. }
  23680. function o(e, t) {
  23681. if (e) {
  23682. var i = {
  23683. pano: e,
  23684. lookAtPoint: null,
  23685. duration: null,
  23686. maxDistanceOverride: null,
  23687. skipWarpingCheck: !1
  23688. };
  23689. this.player.flyToPano(i, function() {
  23690. t && t({
  23691. success: !0,
  23692. message: "Transition complete."
  23693. })
  23694. })
  23695. } else
  23696. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23697. t && t({
  23698. success: !1,
  23699. error: "Unable to find pano."
  23700. })
  23701. }
  23702. function a(e, t) {
  23703. t.copy(C.FORWARD),
  23704. e.getDirection(t)
  23705. }
  23706. function c(i) {
  23707. return {
  23708. panos: i.panos.list.map(function(e) {
  23709. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23710. return {
  23711. uuid: e.id,
  23712. aligned: e.alignmentType === g.ALIGNED,
  23713. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23714. position: function(e) {
  23715. return e.alignmentType !== g.ALIGNED ? null : {
  23716. x: e.position.x,
  23717. y: e.position.y,
  23718. z: e.position.z
  23719. }
  23720. }(e),
  23721. rotation: function(e) {
  23722. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23723. return {
  23724. x: h.Math.radToDeg(t._x),
  23725. y: h.Math.radToDeg(t._y),
  23726. z: h.Math.radToDeg(t._z)
  23727. }
  23728. }(e),
  23729. thumbnail: t
  23730. }
  23731. })
  23732. }
  23733. }
  23734. 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"),
  23735. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23736. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23737. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23738. N.angle = 0,
  23739. N.angleTravelled = 0,
  23740. N.playerDirection = new h.Vector3,
  23741. N.lastFacingDirection = new h.Vector3,
  23742. N.onDone = null,
  23743. N.player = null,
  23744. N.start = function(e, t, i, n) {
  23745. N.active = !0,
  23746. e && t && (t = 0),
  23747. N.angle = e || t,
  23748. N.xAngle = e,
  23749. N.yAngle = t,
  23750. N.angleTravelled = 0,
  23751. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23752. i.getDirection(N.playerDirection),
  23753. N.lastFacingDirection.copy(N.playerDirection),
  23754. N.projectVectors(),
  23755. N.onDone = n,
  23756. N.player = i,
  23757. N()
  23758. }
  23759. ,
  23760. N.projectVectors = function() {
  23761. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23762. N.lastFacingDirection.projectOnPlane(C.UP))
  23763. }
  23764. ,
  23765. N), P = (i = new h.Vector3,
  23766. function(e) {
  23767. e ? (i.copy(e.position),
  23768. i.add(e.discPosition),
  23769. s.projectPositionToCanvas(i, this.player.camera, i),
  23770. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23771. }
  23772. ), O = (l = new h.Vector3,
  23773. function(e) {
  23774. var t = this.player.getDirection();
  23775. l.copy(t);
  23776. var i = l.y;
  23777. l.y = 0,
  23778. l.normalize();
  23779. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23780. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23781. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23782. 0;
  23783. this.player.mode === I.DOLLHOUSE && (n = -n);
  23784. var r = function() {
  23785. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23786. }
  23787. .call(this) - .1
  23788. , o = function() {
  23789. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23790. }
  23791. .call(this) + .1
  23792. , a = n + e;
  23793. r < a ? a = r : a < o && (a = o);
  23794. var s = a - n;
  23795. return 0 < e && s < .01 && (s = 0),
  23796. e < 0 && -.01 < s && (s = 0),
  23797. s
  23798. }
  23799. ), L = (t = new h.Euler,
  23800. function(e) {
  23801. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23802. {
  23803. position: {
  23804. x: e.position.x,
  23805. y: e.position.y,
  23806. z: e.position.z
  23807. },
  23808. rotation: {
  23809. x: h.Math.radToDeg(t.x),
  23810. y: h.Math.radToDeg(t.y),
  23811. z: 0
  23812. },
  23813. pano: e.currentPano ? e.currentPano.id : null,
  23814. mode: e.mode
  23815. }
  23816. }
  23817. ), D = null;
  23818. function N() {
  23819. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23820. N.player.getDirection(N.playerDirection),
  23821. N.projectVectors();
  23822. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23823. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23824. N.onDone && (0,
  23825. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23826. window.setTimeout(N, 4))
  23827. }
  23828. X.exports = {
  23829. init: function(e, t, i, n, r) {
  23830. Y.init(e, t, i, r),
  23831. D = new Promise(function(e, t) {
  23832. i.on(_.Ready, function() {
  23833. e()
  23834. })
  23835. }
  23836. .bind(this));
  23837. var o = new u(window)
  23838. , a = o.waitForConnection();
  23839. a.then(function(e) {
  23840. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  23841. });
  23842. var s, l = (s = Date.now(),
  23843. function() {
  23844. if (!(Date.now() - s < 100)) {
  23845. var e = L(i);
  23846. o.sendEvent(b.MOVE, {
  23847. state: e
  23848. }),
  23849. s = Date.now()
  23850. }
  23851. }
  23852. );
  23853. i.on(_.Move, l),
  23854. i.on(_.ViewChanged, l),
  23855. n.on(p.ActiveModelChanged, function(e) {
  23856. function t(e) {
  23857. var t, i = e.newPano.id;
  23858. e.oldPano && (t = e.oldPano.id),
  23859. i !== t && o.sendEvent(b.ENTER_PANO, {
  23860. oldPano: t,
  23861. newPano: i
  23862. })
  23863. }
  23864. var i = e.model
  23865. , n = e.oldModel;
  23866. Y.model = i,
  23867. a.then(function() {
  23868. o.sendEvent(b.MODEL_LOADED, {
  23869. metadata: c(i)
  23870. })
  23871. }),
  23872. n && n.panos.forEach(function(e) {
  23873. e.removeEventListener("enter", t)
  23874. }),
  23875. i.panos.forEach(function(e) {
  23876. e.on("enter", t)
  23877. })
  23878. })
  23879. }
  23880. };
  23881. var F, B, V, k, U, H, z, G, W, j, Y = {
  23882. director: null,
  23883. player: null,
  23884. controls: null,
  23885. sceneRenderer: null,
  23886. model: null,
  23887. init: function(e, t, i, n) {
  23888. this.director = e,
  23889. this.player = i,
  23890. this.controls = t,
  23891. this.sceneRenderer = n
  23892. },
  23893. handleToObject: {},
  23894. objectToHandle: {},
  23895. handleCount: 0,
  23896. onMessageReceive: function(e) {
  23897. if (e) {
  23898. var t = e.targetFunction
  23899. , i = e.params
  23900. , n = e.onDone;
  23901. t && this[t] && this[t](i, n)
  23902. }
  23903. },
  23904. waitForInit: function(e, t) {
  23905. D.then(t.bind({
  23906. success: !0,
  23907. message: "Init complete."
  23908. }))
  23909. },
  23910. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  23911. j = new h.Quaternion,
  23912. function(e, t) {
  23913. var i = e.pano
  23914. , n = e.rotation
  23915. , r = e.transition;
  23916. if (!this.model)
  23917. return t({
  23918. success: !1,
  23919. error: "The model has not been loaded yet"
  23920. });
  23921. var o = this.model.panos.get(i);
  23922. if (!o)
  23923. return t({
  23924. success: !1,
  23925. error: i + " does not exist in this model"
  23926. });
  23927. if (!n)
  23928. return t({
  23929. sucess: !1,
  23930. erorr: n + " is not a valid rotation"
  23931. });
  23932. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  23933. console.log(n.z);
  23934. var a = {
  23935. success: !0,
  23936. message: i
  23937. };
  23938. if (r === v.FADEOUT)
  23939. j.setFromEuler(W),
  23940. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  23941. else {
  23942. var s, l;
  23943. r === v.INSTANT && (l = s = 0);
  23944. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  23945. this.player.flyToPano({
  23946. pano: o,
  23947. lookAtPoint: c,
  23948. duration: s,
  23949. aimDuration: l
  23950. }, t.bind(this, a))
  23951. }
  23952. }
  23953. ),
  23954. moveInDirection: function(e, t) {
  23955. var i = e.direction;
  23956. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23957. void (t && t({
  23958. success: !1,
  23959. error: "Invalid direction."
  23960. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  23961. t(e ? {
  23962. success: !0,
  23963. message: "moved " + i
  23964. } : {
  23965. success: !1,
  23966. error: "Cannot move in direction: " + i
  23967. })
  23968. })
  23969. },
  23970. getPose: function(e, t) {
  23971. return this.player.camera.position,
  23972. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  23973. t({
  23974. success: !0,
  23975. message: L(this.player)
  23976. })
  23977. },
  23978. takeScreenShot: (z = new h.PerspectiveCamera,
  23979. G = new h.WebGLRenderTarget,
  23980. function(e, t) {
  23981. if (!e.resolution)
  23982. return t({
  23983. success: !1,
  23984. error: "An invalid resolution was specified"
  23985. });
  23986. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  23987. var i = this.sceneRenderer.renderer.getSize();
  23988. e.resolution.width = i.width,
  23989. e.resolution.height = i.height
  23990. }
  23991. z.layers.set(T.DEFAULT),
  23992. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  23993. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  23994. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  23995. var n = e.resolution.width
  23996. , r = e.resolution.height
  23997. , o = n / r;
  23998. z.position.copy(this.sceneRenderer.camera.position),
  23999. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24000. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24001. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24002. G.setSize(n, r),
  24003. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24004. var a = new Uint8Array(n * r * 4);
  24005. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24006. var s = S.encode({
  24007. data: a,
  24008. width: n,
  24009. height: r,
  24010. heading: 180,
  24011. pitch: 0
  24012. }, {
  24013. quality: 75,
  24014. flipY: !0
  24015. });
  24016. t({
  24017. success: !0,
  24018. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24019. })
  24020. }
  24021. ),
  24022. findRankedPano: (U = new h.Vector3,
  24023. H = new h.Vector3,
  24024. function(e, t) {
  24025. a(this.player, H),
  24026. r(t, H, U);
  24027. var i = this.player.rankedPanoInDirection(e, U);
  24028. if (i) {
  24029. var n = this.objectToHandle[i.id];
  24030. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24031. this.handleToObject[n] = i),
  24032. n
  24033. }
  24034. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24035. -1
  24036. }
  24037. ),
  24038. findRankedtag: (V = new h.Vector3,
  24039. k = new h.Vector3,
  24040. function(e, t) {
  24041. a(this.player, k),
  24042. r(t, k, V);
  24043. var i = this.player.rankedtagInDirection(e, V);
  24044. if (i) {
  24045. var n = this.objectToHandle[i.sid];
  24046. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24047. this.handleToObject[n] = i),
  24048. n
  24049. }
  24050. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24051. -1
  24052. }
  24053. ),
  24054. clickNearesttag: function(e) {
  24055. this.clickRankedtag(0, e)
  24056. },
  24057. clickRankedtag: function(e, t) {
  24058. var i = function(e, t) {
  24059. var i = this.findRankedtag(e, t);
  24060. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24061. null)
  24062. }
  24063. .call(this, e, t);
  24064. i && P.call(this, i)
  24065. },
  24066. clickNearestPano: function(e, t) {
  24067. this.clickRankedPano(0, e, t)
  24068. },
  24069. clickRankedPano: function(e, t, i) {
  24070. var n = function(e, t) {
  24071. var i = this.findRankedPano(e, t);
  24072. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24073. null)
  24074. }
  24075. .call(this, e, t);
  24076. n ? o.call(this, n, i) : i(null)
  24077. },
  24078. clickPano: function(e, t) {
  24079. var i = this.handleTable[e];
  24080. i ? o.call(this, i, t) : t(null)
  24081. },
  24082. rotateDirection: function(e, t) {
  24083. var i = e.direction
  24084. , n = e.angle;
  24085. if (!R.active) {
  24086. var r = 0
  24087. , o = 0
  24088. , a = 0
  24089. , s = 0;
  24090. if (!n || isNaN(n))
  24091. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24092. void (t && t({
  24093. success: !1,
  24094. error: "Invalid rotation angle."
  24095. }));
  24096. if (this.player.mode === I.TRANSITIONING)
  24097. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24098. void (t && t({
  24099. success: !1,
  24100. error: "Cannot rotate while transitioning"
  24101. }));
  24102. if (i === m.RIGHT || i === m.LEFT)
  24103. i === m.RIGHT && (n = -n),
  24104. r = 0 < n ? -1 : 1,
  24105. a = n;
  24106. else {
  24107. if (i !== m.UP && i !== m.DOWN)
  24108. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24109. void (t && t({
  24110. success: !1,
  24111. error: "Invalid direction for rotation."
  24112. }));
  24113. if (this.player.mode === I.FLOORPLAN)
  24114. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24115. void (t && t({
  24116. success: !1,
  24117. error: "Cannot rotate " + i + " in floorplan mode"
  24118. }));
  24119. if (i === m.DOWN && (n = -n),
  24120. 0 === (n = O.call(this, n)))
  24121. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24122. void (t && t({
  24123. success: !1,
  24124. error: "Already at maximum rotation in direction: " + i
  24125. }));
  24126. o = 0 < n ? 1 : -1,
  24127. s = n
  24128. }
  24129. var l = n;
  24130. n = h.Math.degToRad(n),
  24131. a = h.Math.degToRad(a),
  24132. s = h.Math.degToRad(s);
  24133. var c = this.controls.activeControl;
  24134. c.startRotating(r, o),
  24135. R.start(a, s, this.player, function() {
  24136. c.stopRotating(!0),
  24137. t && t({
  24138. success: !0,
  24139. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24140. })
  24141. })
  24142. }
  24143. },
  24144. rotate: (F = new h.Vector3,
  24145. B = new h.Vector3,
  24146. function(e, t) {
  24147. var i = e.xAngle
  24148. , n = e.yAngle;
  24149. if (!R.active) {
  24150. if (i = i || 0,
  24151. n = n || 0,
  24152. isNaN(i) || isNaN(n))
  24153. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24154. void (t && t({
  24155. success: !1,
  24156. error: "Invalid rotation angle."
  24157. }));
  24158. if (this.player.mode === I.TRANSITIONING)
  24159. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24160. void (t && t({
  24161. success: !1,
  24162. error: "Cannot rotate while transitioning"
  24163. }));
  24164. Math.abs(i) < .01 && (i = 0),
  24165. Math.abs(n) < .01 && (n = 0);
  24166. var r = n;
  24167. n = O.call(this, n);
  24168. var o = 0 < r ? "UP" : "DOWN";
  24169. if (!(i = -i) && r && !n)
  24170. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24171. void (t && t({
  24172. success: !1,
  24173. error: "Already at maximum rotation in direction: " + o
  24174. }));
  24175. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24176. var a = n;
  24177. n = h.Math.degToRad(n),
  24178. i = h.Math.degToRad(i),
  24179. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24180. this.player.getDirection(F),
  24181. B.copy(F).applyAxisAngle(C.UP, i),
  24182. B.applyAxisAngle(C.RIGHT, n);
  24183. var s = (F.angleTo(B),
  24184. 0 < i ? -1 : i < 0 ? 1 : 0)
  24185. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24186. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24187. var c = this.controls.activeControl;
  24188. c.startRotating(s, l),
  24189. R.start(i, n, this.player, function() {
  24190. c.stopRotating(!0),
  24191. t && t({
  24192. success: !0,
  24193. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24194. })
  24195. })
  24196. }
  24197. }
  24198. ),
  24199. panCamera: function(e, i) {
  24200. function t(e) {
  24201. switch (r.removeAllListeners(w.AutoPanComplete),
  24202. r.removeAllListeners(w.AutoPanInterrupt),
  24203. r.removeAllListeners(w.AutoPanClamped),
  24204. e) {
  24205. case w.AutoPanInterrupt:
  24206. i({
  24207. success: !0,
  24208. message: "Camera panning interrupted."
  24209. });
  24210. break;
  24211. case w.AutoPanClamped:
  24212. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24213. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24214. return void i({
  24215. success: !1,
  24216. error: "Already at edge of current model bounds."
  24217. });
  24218. var t = "The view point is outside the bounds for the current model. ";
  24219. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24220. console.warn(t)
  24221. }
  24222. case w.AutoPanComplete:
  24223. i({
  24224. success: !0,
  24225. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24226. })
  24227. }
  24228. }
  24229. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24230. return i({
  24231. success: !1,
  24232. error: "Camera panning is not available in the current mode: " + this.player.mode
  24233. });
  24234. var n = e.position
  24235. , r = this.player.control;
  24236. r.setAutoPanPosition(n.x, n.z),
  24237. r.autoPan = !0;
  24238. var o = function(e, t) {
  24239. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24240. };
  24241. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24242. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24243. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24244. },
  24245. click: function(e, t) {
  24246. var i = e.x
  24247. , n = e.y;
  24248. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24249. n = n / 100 * $("#player").height()),
  24250. this.player.handleInputStart(i, n),
  24251. this.player.updateIntersect(),
  24252. this.player.handleInputEnd(i, n)
  24253. },
  24254. mouseOver: function(e, t) {
  24255. var i = e.x
  24256. , n = e.y;
  24257. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24258. n = n / 100 * $("#player").height()),
  24259. this.player.handleInputMove(i, n),
  24260. this.player.updateIntersect()
  24261. },
  24262. moveToMode: function(e, t) {
  24263. function i(e) {
  24264. t(e ? {
  24265. success: !1,
  24266. error: "Failed to load new mode: " + e
  24267. } : {
  24268. success: !0,
  24269. message: "Moved to new mode: " + n
  24270. })
  24271. }
  24272. var n = e.mode;
  24273. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24274. i()
  24275. }, function(e) {
  24276. i(e)
  24277. }) : t({
  24278. success: !1,
  24279. error: "Invalid mode selection"
  24280. })
  24281. }
  24282. }
  24283. }
  24284. ).call(this, "/js/sdk/automation.js")
  24285. }
  24286. , {
  24287. "../constants": 8,
  24288. "../enum/AlignmentType": 17,
  24289. "../enum/ControlEvents": 21,
  24290. "../enum/Direction": 22,
  24291. "../enum/GLCubeFaces": 25,
  24292. "../enum/Keys": 30,
  24293. "../enum/ModelManagerEvents": 33,
  24294. "../enum/PlayerEvents": 40,
  24295. "../enum/RenderLayers": 41,
  24296. "../enum/Vectors": 50,
  24297. "../enum/Viewmode": 51,
  24298. "../enum/WarpStyle": 52,
  24299. "../lib/jpeg_encoder": 94,
  24300. "../sdk/SdkEvents": 161,
  24301. "../settings": 166,
  24302. "../util/common": 185,
  24303. "../util/logger": 189,
  24304. "../util/math": 190,
  24305. "../util/panorama": 191,
  24306. "./ApiHost": 159,
  24307. "./PostMessageType": 160,
  24308. "./TransitionStyles": 162,
  24309. three: 217
  24310. }],
  24311. 165: [function(e, t, i) {
  24312. "use strict";
  24313. function n(e) {
  24314. this.sourceWindow = e,
  24315. this.targetWindow = null,
  24316. this.targetOrigin = null,
  24317. this.id = Math.floor(1e5 * Math.random()),
  24318. this.bindEvents()
  24319. }
  24320. var r = e("./PostMessageType")
  24321. , o = e("events").EventEmitter;
  24322. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24323. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24324. }
  24325. ,
  24326. n.prototype.setTarget = function(e, t) {
  24327. this.targetWindow = e,
  24328. this.targetOrigin = t
  24329. }
  24330. ,
  24331. n.prototype.onPostmessageReceived = function(e) {
  24332. var t = e.origin || e.originalEvent.origin
  24333. , i = e.source;
  24334. switch (e.data.type) {
  24335. case r.CONNECT:
  24336. break;
  24337. case r.RESPONSE:
  24338. if (this.id !== e.data.toId)
  24339. return;
  24340. default:
  24341. if (!this.validateMessageOrigin(t))
  24342. return
  24343. }
  24344. var n = e.data;
  24345. n.source = i,
  24346. n.origin = t,
  24347. n.timestamp = Date.now(),
  24348. this.emit(e.data.type, n)
  24349. }
  24350. ,
  24351. n.prototype.validateMessageOrigin = function(e) {
  24352. return "*" === this.targetOrigin || e === this.targetOrigin
  24353. }
  24354. ,
  24355. n.prototype.send = function(e) {
  24356. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24357. this.targetWindow.postMessage(e, this.targetOrigin))
  24358. }
  24359. ,
  24360. t.exports = n
  24361. }
  24362. , {
  24363. "./PostMessageType": 160,
  24364. events: 202
  24365. }],
  24366. 166: [function(e, t, i) {
  24367. "use strict";
  24368. var n = e("three")
  24369. , r = e("./util/browser")
  24370. , o = e("./enum/Viewmode")
  24371. , a = e("./enum/VROption")
  24372. , s = e("./enum/Colors")
  24373. , l = e("./enum/WarpStyle")
  24374. , c = e("./util/easing")
  24375. , h = e("./util/common")
  24376. , u = e("./util/showcase")
  24377. , d = e("./constants")
  24378. , p = {
  24379. debug: !1,
  24380. version: "2.25.6-0-gd87e5b1",
  24381. languageTag: r.valueFromHash("lang", null),
  24382. pageTitle: "四维虚拟漫游",
  24383. authorizationHeader: u.getAuthorizationHeader(),
  24384. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24385. logLevel: r.valueFromHash("log", 2),
  24386. skyboxRadius: 2500,
  24387. modelBoundsPadding: 5,
  24388. showNeighbors: !1,
  24389. brand: r.valueFromHash("brand", !0),
  24390. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24391. startHighlights: r.valueFromHash("hl", -1),
  24392. specialEdition: r.valueFromHash("bn", 0),
  24393. useWheel: r.valueFromHash("wh", !0),
  24394. crossOrigin: "anonymous",
  24395. fancierTransition: !1,
  24396. wireframe: !1,
  24397. skyboxWireframe: !1,
  24398. modelAlpha: 1,
  24399. highlightPanoSelection: !1,
  24400. showSweeps: !0,
  24401. showSkyboxes: !1,
  24402. showMesh: !0,
  24403. showFloors: !1,
  24404. showFloorDuration: 300,
  24405. showFloorDelay: 300,
  24406. hideFloorDuration: 300,
  24407. hideFloorDelay: 0,
  24408. reticuleOpacityTransitionTime: 250,
  24409. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  24410. markerOpacityTransitionTime: 500,
  24411. guiAnimationSpeed: 250,
  24412. highlightAnimationDuration: 500,
  24413. modelComponentLoadSpinnerDelay: 150,
  24414. captureErrors: !1,
  24415. maxMobileTextures: 6,
  24416. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24417. startupFlyinDelay: 3e3,
  24418. dollhouseDefault: {
  24419. minDistance: 1,//15, //编辑页面给近一些
  24420. maxDistance: 50,
  24421. minPolarAngle: n.Math.degToRad(10),
  24422. maxPolarAngle: n.Math.degToRad(90)
  24423. },
  24424. hideReticuleTimeout: 1e3,
  24425. analytics: {
  24426. inactivityThreshold: 30,
  24427. sessionTrackingRate: .15,
  24428. maxTrackedErrors: 20,
  24429. sessionDurationPingFrequency: 10,
  24430. sessionDurationTimeout: 15
  24431. },
  24432. flydown: {
  24433. movementEasing: "easeInOutQuad",
  24434. movementDelay: .001,
  24435. rotationEasing: "easeInOutQuad",
  24436. rotationDelay: .5,
  24437. modelTextureDelay: .75,
  24438. skyboxDelay: .75
  24439. },
  24440. transition: {
  24441. flySpeed: .001,
  24442. flyTime: 750,
  24443. flytimeMaxDistanceThreshold: 5,
  24444. flytimeDistanceMultiplier: 150,
  24445. aimTime: 1500,
  24446. aimSlowFactor: 1.5,
  24447. blur: .8,
  24448. movementEasing: "easeInOutQuad",
  24449. blendEasing: "easeInOutQuad",
  24450. fastForwardFactor: 3
  24451. },
  24452. show360Views: {
  24453. enabled: !0,
  24454. transitionTime: 1e3
  24455. },
  24456. quickstart: {
  24457. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24458. animation: 1400,
  24459. showTextDelay: 500,
  24460. fadeOutDelay: 3e3,
  24461. fovChange: 10
  24462. },
  24463. appConfig: {
  24464. webvr_version: null,
  24465. segment_key: null,
  24466. embedly_key: null,
  24467. branch_key: null,
  24468. keen_write_key: null,
  24469. keen_project_id: null
  24470. },
  24471. vr: {
  24472. enabled: !0,
  24473. allowWebVR: !1,
  24474. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24475. },
  24476. share: {
  24477. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24478. },
  24479. input: {
  24480. longTapThreshold: 200,
  24481. moveToleranceNDC: .08,
  24482. touchMoveThreshold: 25
  24483. },
  24484. help: {
  24485. modalStayDuration: 600
  24486. },
  24487. immersive: {
  24488. timeToShowAgain: 1250,
  24489. uiStayDuration: 600
  24490. },
  24491. tourInteraction: {
  24492. disabled: "0" === r.valueFromHash("tourcta", null),
  24493. showPauseButton: 1e3,
  24494. showModal: 1500,
  24495. allowNextClick: 200,
  24496. largeModal: "1" === r.valueFromHash("tourcta", null),
  24497. smallModal: "2" === r.valueFromHash("tourcta", null)
  24498. },
  24499. labels: {
  24500. enabled: !1,
  24501. hideUntilStart: !0,
  24502. fadeInDuration: 250,
  24503. fadeInDelay: 250,
  24504. fadeOutDuration: 250,
  24505. fadeOutDelay: 0,
  24506. zoomHideThreshhold: {
  24507. mobile: r.isSmallScreen() ? .45 : .6,
  24508. desktop: 2
  24509. },
  24510. zoomTruncateThreshhold: {
  24511. mobile: r.isSmallScreen() ? .35 : .45,
  24512. desktop: .85
  24513. },
  24514. minLengthForTruncate: 16,
  24515. truncateLength: 12,
  24516. truncateSuffix: "..."
  24517. },
  24518. tags: {
  24519. enabled: r.valueFromHash("mt", 1),
  24520. startup: {
  24521. hideUntilStart: !0,
  24522. fadeInDuration: 500,
  24523. fadeInDelay: 100
  24524. },
  24525. visibility: {
  24526. anyDistance: !0,
  24527. visibleDistance: 8,
  24528. cameraClearance: .1,
  24529. alphaTestLevel: .05,
  24530. hideViaFloor: !0,
  24531. hideOffScreenDisc: !1,
  24532. hideOffScreenObject: !1
  24533. },
  24534. disc: {
  24535. opacity: 1,
  24536. disabledOpacity: .5,
  24537. scale: {
  24538. nearBound: 1.5,
  24539. farBound: 4.8,
  24540. linkFarBound: !1,
  24541. linkPercent: 40,
  24542. maxSize: 80,
  24543. minSize: 40,
  24544. baseViewportSize: 800,
  24545. responsiveness: 100
  24546. }
  24547. },
  24548. pole: {
  24549. enabled: !0,
  24550. height: .5,
  24551. width: 2,
  24552. opacity: .5,
  24553. color: "white"
  24554. },
  24555. navigate: {
  24556. nearestPano: !0,
  24557. lineOfSight: !0,
  24558. reactivate: !0,
  24559. aimAt: "disc",
  24560. tiltTolerance: 25,
  24561. rotateSpeedFactor: .6
  24562. }
  24563. },
  24564. path: {
  24565. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  24566. colorUp: s._desat(s.newBlue, .5),
  24567. colorDown: s._darken(s.newBlue, .35),
  24568. opacity: .5,
  24569. style: "ribbon",
  24570. height: .025,
  24571. ribbonWidth: .24,
  24572. outsideHeight: .5,
  24573. waypointRadius: .5,
  24574. waypointIndoorRadius: .24,
  24575. waypointPulse: 1e3,
  24576. typ: l.BLACK,
  24577. meshFree: r.valueFromHash("mf", 1),
  24578. mapGuides: r.valueFromHash("guides", !0),
  24579. fadeInTime: 400,
  24580. fadeOutTime: 300
  24581. },
  24582. warp: {
  24583. nearPanoDist: .1,
  24584. matchCam: !1,
  24585. blur: .33,
  24586. fastTime: 1500,
  24587. teleportTime: 1500,
  24588. outsideTime: 2e3,
  24589. lookAheadMax: .3,
  24590. lookAheadDist: 2.5,
  24591. softPushDist: .37,
  24592. softPushEnd: .3,
  24593. softBendAngle: 8,
  24594. softBendTilt: 4,
  24595. softBendEnd: .3,
  24596. doBurns: !0,
  24597. burnsAngle: 8,
  24598. minBurnsAngle: 35,
  24599. minDownAngle: -35,
  24600. maxTurnPerSec: 280,
  24601. maxAimPerSec: 35,
  24602. minRotation: 12,
  24603. maxAimRotation: 33.2,
  24604. turnFriction: .2,
  24605. flySpeed: .01,
  24606. minWarpTime: 1200,
  24607. warpInterruptionRedirectTime: 500,
  24608. tourStepDelay: r.valueFromHash("st", 0),
  24609. walkDelay: 0,
  24610. walkMaxDist: 50,
  24611. walkMinDist: .8,
  24612. walkSlideShowThreshhold: 3e3,
  24613. walkExtraPanosDistance: .4,
  24614. timePerMeter: 1200,
  24615. motionLeadTime: 5e3,
  24616. movementEasing: "easeInOutQuad",
  24617. blendEasing: "easeInOutQuad",
  24618. showBunny: !1,
  24619. loop: r.valueFromHash("lp", !1),
  24620. auto: r.valueFromHash("ts", -1),
  24621. eOrder: "YXZ",
  24622. stepFactor: .25,
  24623. brakeStrength: 2,
  24624. minBrakeAngle: .1,
  24625. maxBrakeAngle: 1.8,
  24626. climbEffort: 4
  24627. },
  24628. rotationFriction: .05,
  24629. rotationAccelerationInside: 4.5,
  24630. rotationAccelerationOutside: .15,
  24631. rotationAfterMoveMultiplier: 40,
  24632. rotationAfterMoveHistoryCount: 5,
  24633. panFriction: .09,
  24634. panAccelerationOutside: 60,
  24635. onload: r.valueFromHash("onload", o.PANORAMA),
  24636. zoomNearLimit: .1,
  24637. zoomFarLimit: 10,
  24638. navigation: {
  24639. panoScores: !1,
  24640. mouseDirection: !0,
  24641. filterStrictness: .75,
  24642. angleFactor: -30,
  24643. directionFactor: 10,
  24644. distanceFactor: -1,
  24645. optionalityFactor: 3
  24646. },
  24647. sdkInit: !1,
  24648. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24649. console: r.valueFromHash("console", !1),
  24650. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24651. panoramaNeighbourMaxDistance: 5,
  24652. panoFloorClickRadius: .35,
  24653. showScreenshotLocations: !1,
  24654. showAxis: !1,
  24655. showNeighbourRaycasts: !1,
  24656. colorMarkerOnLoad: !1,
  24657. colorMarkerByFloor: !1,
  24658. tiling: {
  24659. panoPreRenderRepeatDelay: 2500,
  24660. panoPreRenderDelay: 500,
  24661. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24662. tilingFlagNames: ["usetiles", "tiles"],
  24663. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24664. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24665. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24666. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24667. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24668. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24669. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24670. customCompression: r.valueFromHash("tilecustcomp", 0),
  24671. mobileHighQualityOverride: 1,
  24672. allowUltraHighResolution: !0
  24673. },
  24674. zoom: {
  24675. enabled: !0,
  24676. forceOff: r.valueFromHash("nozoom", 0),
  24677. overridemax: r.valueFromHash("maxzoom", null),
  24678. overridemin: r.valueFromHash("minzoom", null),
  24679. max: d.highQualityMaxZoom,
  24680. min: 1,
  24681. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24682. activationThreshold: 1.1,
  24683. restoreTime: 500
  24684. },
  24685. profiling: {
  24686. enabled: r.valueFromHash("mem", !1)
  24687. }
  24688. };
  24689. (p = h.deepExtend(p, d, {
  24690. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24691. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24692. panorama: {
  24693. transitionTime: 1e3,
  24694. modelAlpha: 0,
  24695. modelAlphaDelay: p.flydown.modelTextureDelay,
  24696. modelAlphaLength: 1,
  24697. skyboxOpacity: 1,
  24698. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24699. skyboxOpacityLength: .9,
  24700. fovLength: 1,
  24701. fovDelay: 0,
  24702. cameraMatrixDuration: .8,
  24703. cameraMatrixDelay: 0,
  24704. cameraMatrixEase: c.easeInCubic,
  24705. reticuleOpacity: 1,
  24706. markerOpacity: .3,
  24707. markerOpacityOnHover: 1
  24708. },
  24709. dollhouse: {
  24710. transitionTime: 1e3,
  24711. modelAlpha: 1,
  24712. modelAlphaDelay: 0,
  24713. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24714. skyboxOpacity: 0,
  24715. skyboxOpacityDelay: 0,
  24716. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24717. fovLength: 1,
  24718. fovDelay: 0,
  24719. cameraMatrixDuration: .8,
  24720. cameraMatrixDelay: .3,
  24721. cameraMatrixEase: c.easeInCubic,
  24722. reticuleOpacity: 1,
  24723. markerOpacity: 0,
  24724. markerOpacityOnHover: 0
  24725. },
  24726. floorplan: {
  24727. transitionTime: 1e3,
  24728. modelAlpha: 1,
  24729. modelAlphaDelay: 0,
  24730. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24731. skyboxOpacity: 0,
  24732. skyboxOpacityDelay: 0,
  24733. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24734. fovLength: 1,
  24735. fovDelay: 0,
  24736. cameraMatrixDuration: .5,
  24737. cameraMatrixDelay: 0,
  24738. cameraMatrixEase: c.easeOutCubic,
  24739. reticuleOpacity: 1,
  24740. markerOpacity: 0,
  24741. markerOpacityOnHover: 0,
  24742. cameraHeight: 50
  24743. },
  24744. transitioning: {
  24745. reticuleOpacity: 0,
  24746. markerOpacity: .3,
  24747. markerOpacityOnHover: 1
  24748. },
  24749. "floorplan-dollhouse": {
  24750. rotationDelay: 0,
  24751. rotationDuration: 1
  24752. },
  24753. "floorplan-panorama": {
  24754. rotationDelay: .5,
  24755. rotationDuration: 1
  24756. },
  24757. "dollhouse-panorama": {
  24758. rotationDelay: .5,
  24759. rotationDuration: 1
  24760. },
  24761. "dollhouse-floorplan": {
  24762. rotationDelay: 0,
  24763. rotationDuration: 1,
  24764. cameraMatrixDuration: 1.05,
  24765. cameraMatrixDelay: .5
  24766. },
  24767. "panorama-dollhouse": {
  24768. rotationDelay: 0,
  24769. rotationDuration: .5
  24770. },
  24771. "panorama-floorplan": {
  24772. transitionTime: 1500,
  24773. rotationDelay: 0,
  24774. rotationDuration: .5
  24775. }
  24776. })).path.meshFree && (p.path.typ = l.WALK),
  24777. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24778. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24779. t.exports = p
  24780. }
  24781. , {
  24782. "./constants": 8,
  24783. "./enum/Colors": 19,
  24784. "./enum/VROption": 47,
  24785. "./enum/Viewmode": 51,
  24786. "./enum/WarpStyle": 52,
  24787. "./util/browser": 182,
  24788. "./util/common": 185,
  24789. "./util/easing": 186,
  24790. "./util/showcase": 193,
  24791. three: 217
  24792. }],
  24793. 167: [function(e, t, i) {
  24794. "use strict";
  24795. var n = e("three")
  24796. , r = e("./settings")
  24797. , 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"
  24798. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24799. t.exports = {
  24800. basicTextured: {
  24801. uniforms: {
  24802. tDiffuse: {
  24803. type: "t",
  24804. value: null
  24805. },
  24806. alpha: {
  24807. type: "f",
  24808. value: 1
  24809. }
  24810. },
  24811. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24812. 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}"
  24813. },
  24814. copyCubeMap: {
  24815. uniforms: {
  24816. tDiffuse: {
  24817. type: "t",
  24818. value: null
  24819. },
  24820. alpha: {
  24821. type: "f",
  24822. value: 1
  24823. }
  24824. },
  24825. 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}",
  24826. 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}"
  24827. },
  24828. cube: {
  24829. uniforms: {
  24830. map: {
  24831. type: "t",
  24832. value: null
  24833. },
  24834. opacity: {
  24835. type: "f",
  24836. value: 1
  24837. }
  24838. },
  24839. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24840. 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"
  24841. },
  24842. model: {
  24843. uniforms: {
  24844. map: {
  24845. type: "t",
  24846. value: null
  24847. },
  24848. modelAlpha: {
  24849. type: "f",
  24850. value: r.modelAlpha
  24851. },
  24852. opacity: {
  24853. type: "f",
  24854. value: 1
  24855. },
  24856. progress: {
  24857. type: "f",
  24858. value: 0
  24859. },
  24860. blackout: {
  24861. type: "i",
  24862. value: 0
  24863. },
  24864. pano0Map: {
  24865. type: "t",
  24866. value: null
  24867. },
  24868. pano0Position: {
  24869. type: "v3",
  24870. value: new n.Vector3
  24871. },
  24872. pano0Matrix: {
  24873. type: "m4",
  24874. value: new n.Matrix4
  24875. },
  24876. pano1Map: {
  24877. type: "t",
  24878. value: null
  24879. },
  24880. pano1Position: {
  24881. type: "v3",
  24882. value: new n.Vector3
  24883. },
  24884. pano1Matrix: {
  24885. type: "m4",
  24886. value: new n.Matrix4
  24887. }
  24888. },
  24889. 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",
  24890. 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"
  24891. },
  24892. hot: {
  24893. uniforms: {
  24894. color: {
  24895. type: "c",
  24896. value: new n.Color(16720384)
  24897. },
  24898. opac: {
  24899. type: "f",
  24900. value: 0
  24901. },
  24902. texture1: {
  24903. type: "t",
  24904. value: null
  24905. },
  24906. texture2: {
  24907. type: "t",
  24908. value: null
  24909. }
  24910. },
  24911. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24912. 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"
  24913. },
  24914. modelOutside: {
  24915. uniforms: {
  24916. map: {
  24917. type: "t",
  24918. value: null
  24919. },
  24920. opacity: {
  24921. type: "f",
  24922. value: 1
  24923. }
  24924. },
  24925. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24926. 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"
  24927. },
  24928. ribbon: {
  24929. uniforms: {
  24930. map: {
  24931. type: "t",
  24932. value: null
  24933. },
  24934. opacity: {
  24935. type: "f",
  24936. value: 1
  24937. },
  24938. color: {
  24939. type: "c",
  24940. value: new n.Color(r.path.color)
  24941. }
  24942. },
  24943. 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",
  24944. 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"
  24945. },
  24946. waypoint: {
  24947. uniforms: {
  24948. map: {
  24949. type: "t",
  24950. value: null
  24951. },
  24952. opacity: {
  24953. type: "f",
  24954. value: 1
  24955. },
  24956. pulse: {
  24957. type: "f",
  24958. value: 1
  24959. },
  24960. nearFade: {
  24961. type: "v2",
  24962. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24963. },
  24964. color: {
  24965. type: "c",
  24966. value: new n.Color(r.reticuleColor)
  24967. }
  24968. },
  24969. 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",
  24970. 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"
  24971. },
  24972. modelDebug: {
  24973. uniforms: {
  24974. map: {
  24975. type: "t",
  24976. value: null
  24977. },
  24978. modelAlpha: {
  24979. type: "f",
  24980. value: r.modelAlpha
  24981. },
  24982. depthmapRatio: {
  24983. type: "f",
  24984. value: 0
  24985. },
  24986. opacity: {
  24987. type: "f",
  24988. value: 1
  24989. },
  24990. progress: {
  24991. type: "f",
  24992. value: 0
  24993. },
  24994. considerOcclusion: {
  24995. type: "i",
  24996. value: r.fancierTransition
  24997. },
  24998. highlightPanoSelection: {
  24999. type: "i",
  25000. value: 0
  25001. },
  25002. useThirdPano: {
  25003. type: "i",
  25004. value: r.useThirdPano
  25005. },
  25006. pano0Map: {
  25007. type: "t",
  25008. value: null
  25009. },
  25010. pano0Depth: {
  25011. type: "t",
  25012. value: null
  25013. },
  25014. pano0Position: {
  25015. type: "v3",
  25016. value: new n.Vector3
  25017. },
  25018. pano0Matrix: {
  25019. type: "m4",
  25020. value: new n.Matrix4
  25021. },
  25022. pano0Weight: {
  25023. type: "f",
  25024. value: r.transition.pano0Weight
  25025. },
  25026. pano1Map: {
  25027. type: "t",
  25028. value: null
  25029. },
  25030. pano1Depth: {
  25031. type: "t",
  25032. value: null
  25033. },
  25034. pano1Position: {
  25035. type: "v3",
  25036. value: new n.Vector3
  25037. },
  25038. pano1Matrix: {
  25039. type: "m4",
  25040. value: new n.Matrix4
  25041. },
  25042. pano1Weight: {
  25043. type: "f",
  25044. value: r.transition.pano1Weight
  25045. },
  25046. pano2Map: {
  25047. type: "t",
  25048. value: null
  25049. },
  25050. pano2Depth: {
  25051. type: "t",
  25052. value: null
  25053. },
  25054. pano2Position: {
  25055. type: "v3",
  25056. value: new n.Vector3
  25057. },
  25058. pano2Matrix: {
  25059. type: "m4",
  25060. value: new n.Matrix4
  25061. },
  25062. pano2Weight: {
  25063. type: "f",
  25064. value: r.transition.pano2Weight
  25065. }
  25066. },
  25067. 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",
  25068. 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"
  25069. },
  25070. customDepth: {
  25071. uniforms: {
  25072. panoPosition: {
  25073. type: "v3",
  25074. value: new n.Vector3
  25075. }
  25076. },
  25077. 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",
  25078. 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"
  25079. },
  25080. skysphere: {
  25081. uniforms: {
  25082. radius: {
  25083. type: "f",
  25084. value: 0
  25085. }
  25086. },
  25087. 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",
  25088. 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"
  25089. },
  25090. tagDisc: {
  25091. uniforms: {
  25092. opacity: {
  25093. type: "f",
  25094. value: 0
  25095. },
  25096. color: {
  25097. type: "c",
  25098. value: new n.Color
  25099. },
  25100. bg: {
  25101. type: "t",
  25102. value: null
  25103. },
  25104. mask: {
  25105. type: "t",
  25106. value: null
  25107. }
  25108. },
  25109. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25110. 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"
  25111. }
  25112. }
  25113. window.shaders = t.exports;
  25114. }
  25115. , {
  25116. "./settings": 166,
  25117. three: 217
  25118. }],
  25119. 168: [function(E, _, e) {
  25120. (function(e) {
  25121. "use strict";
  25122. var t = E("three")
  25123. , i = (E("url"),
  25124. E("./util/ajax"))
  25125. , n = E("./settings")
  25126. , r = E("./util/logger")
  25127. , o = E("./util/math")
  25128. , a = E("./util/showcase")
  25129. , s = E("./objects/Panorama")
  25130. , l = new r(e)
  25131. , c = E("./model/Model")
  25132. , h = E("./shaders")
  25133. , u = E("./util/transitions")
  25134. , d = E("./objects/Chunk")
  25135. , p = E("./objects/Reticule")
  25136. , f = E("./objects/Skybox")
  25137. , g = E("./objects/Floor")
  25138. , m = E("./cameras/DollhouseCamera")
  25139. , v = E("./cameras/FloorplanCamera")
  25140. , y = E("./cameras/PanoramaCamera")
  25141. , A = E("./controls/DollhouseControls")
  25142. , C = E("./controls/FloorplanControls")
  25143. , I = E("./controls/PanoramaControls");
  25144. t.ImageUtils.crossOrigin = n.crossOrigin,
  25145. _.exports = {
  25146. shaders: h,
  25147. transitions: u,
  25148. Model: c,
  25149. Chunk: d,
  25150. Floor: g,
  25151. Skybox: f,
  25152. Reticule: p,
  25153. Panorama: s,
  25154. DollhouseCamera: m,
  25155. FloorplanCamera: v,
  25156. PanoramaCamera: y,
  25157. DollhouseControls: A,
  25158. FloorplanControls: C,
  25159. PanoramaControls: I,
  25160. getModel: function(e) {
  25161. if (!e.url)
  25162. throw 'getModel(): missing parameter "url"';
  25163. e.autoload = void 0 === e.autoload || e.autoload;
  25164. var t = a.parseSidUrl(e.url);
  25165. e.urlBase = t.urlBase,
  25166. e.urlModel = t.urlModel,
  25167. e.urlFiles = t.urlFiles;
  25168. var i = this._getPlatformError();
  25169. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25170. this._loadModel().then(this._buildModel.bind(this)))
  25171. },
  25172. _getPlatformError: function() {
  25173. 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"
  25174. },
  25175. _loadModel: function() {
  25176. return i.get(this.options.urlModel, {
  25177. responseType: "json",
  25178. prefetchFrom: "model",
  25179. auth: a.getAuthorizationHeader()
  25180. }).then(null, function() {
  25181. return l.warn("Model loading failed at initial metadata load"),
  25182. "loading-failed"
  25183. })
  25184. },
  25185. _buildModel: function(e) {
  25186. e = a.normalizeModeldata(e, o);
  25187. var t = new c(this.options,e);
  25188. return this.options.autoload ? t.load(!0) : $.when(t)
  25189. }
  25190. }
  25191. }
  25192. ).call(this, "/js/showcase.js")
  25193. }
  25194. , {
  25195. "./cameras/DollhouseCamera": 5,
  25196. "./cameras/FloorplanCamera": 6,
  25197. "./cameras/PanoramaCamera": 7,
  25198. "./controls/DollhouseControls": 10,
  25199. "./controls/FloorplanControls": 11,
  25200. "./controls/PanoramaControls": 13,
  25201. "./model/Model": 139,
  25202. "./objects/Chunk": 144,
  25203. "./objects/Floor": 146,
  25204. "./objects/Panorama": 148,
  25205. "./objects/Reticule": 149,
  25206. "./objects/Skybox": 152,
  25207. "./settings": 166,
  25208. "./shaders": 167,
  25209. "./util/ajax": 181,
  25210. "./util/logger": 189,
  25211. "./util/math": 190,
  25212. "./util/showcase": 193,
  25213. "./util/transitions": 195,
  25214. three: 217,
  25215. url: 208
  25216. }],
  25217. 169: [function(e, t, i) {
  25218. "use strict";
  25219. function l(e) {
  25220. var t = {
  25221. renderTarget: null,
  25222. inUse: !1,
  25223. size: -1,
  25224. pano: null
  25225. };
  25226. return t.inUse = !0,
  25227. t.size = e,
  25228. function(e) {
  25229. O.push(e)
  25230. }(t),
  25231. t
  25232. }
  25233. function c(e) {
  25234. for (var t = 0; t < O.length; t++) {
  25235. var i = O[t];
  25236. if (i.renderTarget === e)
  25237. return !(i.inUse = !1)
  25238. }
  25239. return !1
  25240. }
  25241. function n() {
  25242. this.tileDirectory = {},
  25243. this.activeRenderTargetDescriptors = {},
  25244. this.activePanos = [],
  25245. this.panoLODDescriptors = {},
  25246. this.panoDescriptors = {},
  25247. this.tileTrees = {},
  25248. this.sceneRenderer = null,
  25249. this.tileDownloader = null,
  25250. this.forceQueue = [],
  25251. this.uploadQueues = {},
  25252. this.uploadInterval = null,
  25253. this.uploadIntervalCancelled = !1,
  25254. this.usingTileOverlay = !1,
  25255. this.overlayTilesLoaded = !1,
  25256. this.overlayTileBase = null,
  25257. this.overlayTilesBasic = {},
  25258. this.overlayTilesEnhanced = {},
  25259. this.zoomRenderTarget = null,
  25260. this.zoomPano = null,
  25261. this.zoomingActive = !1,
  25262. this.zoomPanoId = null,
  25263. this.zoomPanoRenderingDisabled = !1,
  25264. this.direction = new _.Vector3,
  25265. this.initTime = -1,
  25266. this.maxBaseUploadsPerFrame = R,
  25267. this.maxNonBaseUploadsPerFrame = M
  25268. }
  25269. 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"),
  25270. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25271. e("../objects/Panorama"),
  25272. e("./TileTree")), y = (e("./TileDownloader"),
  25273. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25274. e("../util/browser"),
  25275. 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 = {
  25276. Base: 0,
  25277. Remaining: 1
  25278. }, O = [];
  25279. function L(e) {
  25280. var t = e.shift();
  25281. return t.uploadQueued = !1,
  25282. t
  25283. }
  25284. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25285. this.sceneRenderer = e,
  25286. this.tileDownloader = t,
  25287. this.qualityManager = i,
  25288. this.bindEvents(),
  25289. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25290. this.initTime = performance.now()
  25291. }
  25292. ,
  25293. n.prototype.getActivePanoTextures = function(e) {
  25294. e = e || [];
  25295. for (var t = 0; t < O.length; t++) {
  25296. var i = O[t];
  25297. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25298. }
  25299. }
  25300. ,
  25301. n.prototype.hasQueuedTiles = function() {
  25302. var e = this.peekNextFromUploadQueue();
  25303. return null != e
  25304. }
  25305. ,
  25306. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25307. return this.activeRenderTargetDescriptors[e]
  25308. }
  25309. ,
  25310. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25311. this.activeRenderTargetDescriptors[e] = t
  25312. }
  25313. ,
  25314. n.prototype.loadOverlayTiles = function() {
  25315. if (0 !== d.tiling.overlayStyle) {
  25316. var n = 0
  25317. , e = function(e, t, i) {
  25318. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25319. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25320. ++n === r.length && (this.overlayTilesLoaded = !0)
  25321. }
  25322. .bind(this)
  25323. , 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)]];
  25324. r.forEach(function(e) {
  25325. this.tileDownloader.loadImage(e[0], 0, e[1])
  25326. }
  25327. .bind(this)),
  25328. this.usingTileOverlay = !0
  25329. } else
  25330. this.usingTileOverlay = !1
  25331. }
  25332. ,
  25333. n.prototype.bindEvents = function() {
  25334. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25335. }
  25336. ,
  25337. n.prototype.setupZoomRenderTarget = function() {
  25338. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25339. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25340. return;
  25341. var e = this.zoomRenderTarget;
  25342. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25343. e) {
  25344. var t = e.width
  25345. , i = this.zoomRenderTarget.width;
  25346. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25347. e.texture.dispose(),
  25348. e.texture.loaded = !1,
  25349. e.texture.version = 0,
  25350. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25351. e.texture = null
  25352. }
  25353. this.zoomPanoRenderingDisabled = !1
  25354. } else
  25355. this.zoomPanoRenderingDisabled = !0
  25356. }
  25357. ,
  25358. n.prototype.enableUltraHighQualityMode = function(t) {
  25359. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25360. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25361. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25362. e && (this.qualityManager.enableUltraHighQualityMode(),
  25363. this.setupZoomRenderTarget(),
  25364. t())
  25365. }
  25366. .bind(this))
  25367. }
  25368. }
  25369. ,
  25370. n.prototype.activateTiledPano = function(e, t, i) {
  25371. i && this.clearAllQueuedUploads();
  25372. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25373. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25374. this.linkAllTilesAndNodes(e);
  25375. var r = this.getActiveRenderTargetDescriptor(e.id)
  25376. , o = t;
  25377. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25378. !r || o !== r.size) {
  25379. if (r && c(r.renderTarget),
  25380. !(r = function(e) {
  25381. for (var t = 0; t < O.length; t++) {
  25382. var i = O[t];
  25383. if (!i.inUse && i.size === e)
  25384. return i.inUse = !0,
  25385. i
  25386. }
  25387. return null
  25388. }(o))) {
  25389. var a = this.initTiledPano(o, !1);
  25390. (r = l(a.width)).renderTarget = a
  25391. }
  25392. r.pano = e,
  25393. this.resetPanoDescriptor(e.id),
  25394. this.resetPanoLODDescriptors(e.id),
  25395. this.resetRenderStatus(e.id, !0, !0)
  25396. }
  25397. this.setActiveRenderTargetDescriptor(e.id, r);
  25398. var s = i ? 0 : 1;
  25399. return this.updateActivePanos(e, s),
  25400. r.renderTarget
  25401. }
  25402. ,
  25403. n.prototype.deactivateTiledPano = function(e) {
  25404. var t = this.getActiveRenderTargetDescriptor(e.id);
  25405. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25406. this.setActiveRenderTargetDescriptor(e.id, null);
  25407. var i = this.getUploadQueueForPano(e.id);
  25408. this.clearUploadQueue(i),
  25409. this.updateActivePanos()
  25410. }
  25411. ,
  25412. n.prototype.updateActivePanos = (s = [],
  25413. function(e, t) {
  25414. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25415. e && s.length === t && s.push(e);
  25416. var n = this.activePanos[i]
  25417. , r = this.getActiveRenderTargetDescriptor(n.id);
  25418. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25419. }
  25420. e && t >= s.length && s.push(e),
  25421. this.activePanos.length = 0,
  25422. this.activePanos.push.apply(this.activePanos, s)
  25423. }
  25424. ),
  25425. n.prototype.getActivePanoCount = function() {
  25426. return this.activePanos.length
  25427. }
  25428. ,
  25429. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25430. var i = null;
  25431. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25432. for (var n = function(e, t, i, n) {
  25433. o && (t.tile.zoomUploaded = !1),
  25434. r && (t.tile.uploaded = !1)
  25435. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25436. this.getTileTree(e, a).breadthFirst({
  25437. callback: n.bind(this, a),
  25438. minLevel: i
  25439. })
  25440. }
  25441. }
  25442. ,
  25443. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25444. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25445. t.tile.zoomUploaded = t.tile.uploaded,
  25446. t.zoomCovered = t.covered
  25447. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25448. this.getTileTree(e, n).breadthFirst({
  25449. callback: i.bind(this, n),
  25450. maxLevel: t
  25451. })
  25452. }
  25453. }
  25454. ,
  25455. n.prototype.renderPanoTiles = (h = [],
  25456. function(e, t, i, n) {
  25457. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25458. t = t || this.direction || m.FORWARD;
  25459. var r = this.getActiveRenderTargetDescriptor(e);
  25460. if (!this.isRenderTargetDescriptorValid(r))
  25461. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25462. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25463. var a = this.getTileTree(e, o);
  25464. h.length = 0,
  25465. a.breadthFirst({
  25466. saveVisited: h
  25467. });
  25468. for (var s = 0; s < h.length; s++) {
  25469. var l = h[s];
  25470. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25471. }
  25472. }
  25473. this.updateDirection(t)
  25474. }
  25475. ),
  25476. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25477. return e && e.renderTarget
  25478. }
  25479. ,
  25480. n.prototype.isPanoActive = function(e) {
  25481. var t = this.getActiveRenderTargetDescriptor(e);
  25482. return this.isRenderTargetDescriptorValid(t)
  25483. }
  25484. ,
  25485. n.prototype.isPanoZoomed = function(e) {
  25486. return this.zoomingActive && this.zoomPanoId === e
  25487. }
  25488. ,
  25489. n.prototype.initTileTree = function(e, t, i) {
  25490. var n = this.tileTrees[e];
  25491. n || (n = [],
  25492. this.tileTrees[e] = n);
  25493. var r = n[t];
  25494. if (!r) {
  25495. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25496. r = new v(A.TILE_SIZE,o),
  25497. n[t] = r
  25498. }
  25499. }
  25500. ,
  25501. n.prototype.getTileTree = function(e, t) {
  25502. var i = this.tileTrees[e];
  25503. if (!i)
  25504. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25505. var n = i[t];
  25506. if (!n)
  25507. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25508. return n
  25509. }
  25510. ,
  25511. n.prototype.initTiledPano = function(e, t) {
  25512. var i = this.sceneRenderer.renderer
  25513. , n = (i.context,
  25514. new _.WebGLRenderTargetCube(e,e,{
  25515. stencilBuffer: !1
  25516. }))
  25517. , r = new _.CubeTexture([]);
  25518. (n.texture = r).image = [null, null, null, null, null, null],
  25519. r.flipY = !0,
  25520. t ? (r.generateMipmaps = !0,
  25521. r.magFilter = _.LinearFilter,
  25522. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25523. r.magFilter = _.LinearFilter,
  25524. r.minFilter = _.LinearFilter),
  25525. r.format = _.RGBAFormat,
  25526. i.setRenderTarget(n),
  25527. i.setRenderTarget(null);
  25528. var o = i.properties.get(r);
  25529. return o.__image__webglTextureCube = o.__webglTexture,
  25530. n
  25531. }
  25532. ,
  25533. n.prototype.getUploadQueueForPano = function(e) {
  25534. var t = this.uploadQueues[e];
  25535. return t || (t = [],
  25536. this.uploadQueues[e] = t),
  25537. t
  25538. }
  25539. ,
  25540. n.prototype.isTileUploaded = function(e) {
  25541. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25542. }
  25543. ,
  25544. n.prototype.setUploaded = function(e, t) {
  25545. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25546. }
  25547. ,
  25548. n.prototype.queueTileUpload = function(e, t, i) {
  25549. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25550. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25551. var r = this.getUploadQueueForPano(e.panoId);
  25552. 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),
  25553. e.uploadQueued = !0,
  25554. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25555. }
  25556. }
  25557. ,
  25558. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25559. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25560. }
  25561. ,
  25562. n.prototype.getTopUploadQueue = function() {
  25563. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25564. for (var n = 0; n < this.activePanos.length; n++)
  25565. if (e = this.activePanos[n],
  25566. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25567. switch (i) {
  25568. case P.Base:
  25569. if (0 === t[0].level)
  25570. return t;
  25571. break;
  25572. case P.Remaining:
  25573. return t
  25574. }
  25575. return null
  25576. }
  25577. ,
  25578. n.prototype.getNextFromUploadQueue = function() {
  25579. if (0 < this.forceQueue.length)
  25580. return L(this.forceQueue);
  25581. var e = this.getTopUploadQueue();
  25582. return e && 0 < e.length ? L(e) : null
  25583. }
  25584. ,
  25585. n.prototype.peekNextFromUploadQueue = function() {
  25586. if (0 < this.forceQueue.length)
  25587. return this.forceQueue[0];
  25588. var e = this.getTopUploadQueue();
  25589. return e && 0 < e.length ? e[0] : null
  25590. }
  25591. ,
  25592. n.prototype.clearAllQueuedUploads = function() {
  25593. this.clearAllUploadQueues(null, 0)
  25594. }
  25595. ,
  25596. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25597. this.clearAllUploadQueues(e, 0)
  25598. }
  25599. ,
  25600. n.prototype.clearAllUploadQueues = function(e, t) {
  25601. if (e)
  25602. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25603. this.clearUploadQueue(this.forceQueue, t, e);
  25604. else {
  25605. for (var i = 0; i < this.activePanos.length; i++) {
  25606. var n = this.activePanos[i];
  25607. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25608. }
  25609. this.clearUploadQueue(this.forceQueue, t)
  25610. }
  25611. }
  25612. ,
  25613. n.prototype.clearUploadQueue = function(e, t, i) {
  25614. null != t || (t = 0);
  25615. for (var n = 0; n < e.length; ) {
  25616. var r = e[n];
  25617. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25618. e.splice(n, 1)) : n++
  25619. }
  25620. }
  25621. ,
  25622. n.prototype.refreshUploadInterval = (a = null,
  25623. function(e) {
  25624. this.uploadIntervalCancelled || (a = a || function() {
  25625. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25626. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25627. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25628. }
  25629. .bind(this),
  25630. null != e || (e = x),
  25631. T || (e = S),
  25632. this.uploadInterval = window.setTimeout(a, e),
  25633. this.uploadIntervalDelay = e)
  25634. }
  25635. ),
  25636. n.prototype.update = (r = performance.now(),
  25637. o = 0,
  25638. function() {
  25639. this.uploadIntervalCancelled = !0,
  25640. window.clearTimeout(this.uploadInterval),
  25641. this.uploadInterval = null;
  25642. var e = performance.now() - r;
  25643. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25644. r = performance.now()),
  25645. o++
  25646. }
  25647. ),
  25648. n.prototype.updateUploadQueue = function(e, t) {
  25649. e = e || 1;
  25650. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25651. var r = this.getNextFromUploadQueue();
  25652. if (!r)
  25653. break;
  25654. if (0 !== r.level ? i++ : n++,
  25655. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25656. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25657. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25658. }
  25659. }
  25660. }
  25661. ,
  25662. n.prototype.updateDirection = function(e) {
  25663. if (e = e || this.direction) {
  25664. this.direction = e;
  25665. for (var t = 0; t < this.activePanos.length; t++) {
  25666. var i = this.activePanos[t]
  25667. , n = this.getUploadQueueForPano(i.id);
  25668. y.sortPanoTiles(n, i, this.direction)
  25669. }
  25670. }
  25671. }
  25672. ,
  25673. n.prototype.uploadTile = (I = {},
  25674. new _.Vector4,
  25675. E = d.tiling.overlayStyle,
  25676. function(e, t) {
  25677. var i = e.panoId
  25678. , n = e.image
  25679. , r = e.tileSize
  25680. , o = e.panoSize
  25681. , a = e.tileIndex
  25682. , s = (e.faceTileIndex,
  25683. e.totalTiles)
  25684. , l = (e.face,
  25685. e.tileX)
  25686. , c = e.tileY
  25687. , h = !0
  25688. , u = !1
  25689. , d = (this.getPanoDescriptor(i),
  25690. this.getPanoLODDescriptor(i, o))
  25691. , p = this.getActiveRenderTargetDescriptor(i)
  25692. , f = p.renderTarget
  25693. , g = p.size;
  25694. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25695. g = this.qualityManager.getMaxZoomPanoSize()),
  25696. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25697. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25698. this.isTileUploaded(e) && (u = h = !1)),
  25699. h) {
  25700. var m = r / o * g
  25701. , v = l * r / o * g
  25702. , y = c * r / o * g;
  25703. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25704. var A = I[r];
  25705. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25706. 1 === E || 2 === E) {
  25707. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25708. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25709. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25710. } else
  25711. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25712. d.uploadCount++,
  25713. this.emit(b.TileRenderSuccess, i, o, a, s),
  25714. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25715. this.setUploaded(e, !0),
  25716. this.addCoverageForNode(e.node)
  25717. } else
  25718. this.setUploaded(e, !1);
  25719. return e.uploadAttempted || (d.uploadAttempts++,
  25720. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25721. e.uploadAttempted = !0,
  25722. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25723. u
  25724. }
  25725. ),
  25726. n.prototype.linkTileAndNode = function(e, t) {
  25727. (t.tile = e).node = t
  25728. }
  25729. ,
  25730. n.prototype.linkAllTilesAndNodes = function(a) {
  25731. for (var e = function(e, t, i, n, r) {
  25732. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25733. this.linkTileAndNode(o, i)
  25734. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25735. var i = this.getTileTree(a.id, t);
  25736. i.breadthFirst({
  25737. callback: e.bind(this, i, t)
  25738. })
  25739. }
  25740. }
  25741. ,
  25742. n.prototype.anyUploaded = function(e) {
  25743. if (!e)
  25744. return !1;
  25745. if (e.tile && this.isTileUploaded(e.tile))
  25746. return !0;
  25747. if (e.children)
  25748. for (var t = 0; t < e.children.length; t++) {
  25749. var i = e.children[t];
  25750. if (this.anyUploaded(i))
  25751. return !0
  25752. }
  25753. return !1
  25754. }
  25755. ,
  25756. n.prototype.setNodeCovered = function(e, t) {
  25757. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25758. }
  25759. ,
  25760. n.prototype.isNodeCovered = function(e) {
  25761. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25762. }
  25763. ,
  25764. n.prototype.addCoverageForNode = function(e) {
  25765. if (this.setNodeCovered(e, !0),
  25766. e.parent && e.covered) {
  25767. var t = e.parent;
  25768. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25769. }
  25770. }
  25771. ,
  25772. n.prototype.calcFullCoverage = function(e) {
  25773. var t = !1;
  25774. if (e.children)
  25775. for (var i = 0; i < e.children.length; i++) {
  25776. var n = e.children[i];
  25777. t = t || this.calcFullCoverage(n)
  25778. }
  25779. e.covered = e.tile.uploaded || t
  25780. }
  25781. ,
  25782. n.prototype.nodeSubcovered = function(e) {
  25783. if (!e.children)
  25784. return !1;
  25785. for (var t = 0; t < e.children.length; t++)
  25786. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25787. return !1;
  25788. return !0
  25789. }
  25790. ,
  25791. n.prototype.resetPanoDescriptor = function(e) {
  25792. this.getPanoDescriptor(e)
  25793. }
  25794. ,
  25795. n.prototype.getPanoDescriptor = function(e) {
  25796. var t = this.panoDescriptors[e];
  25797. return t || (t = {},
  25798. this.panoDescriptors[e] = t),
  25799. t
  25800. }
  25801. ,
  25802. n.prototype.resetPanoLODDescriptors = function(e) {
  25803. var t = this.getPanoLODDescriptors(e);
  25804. for (var i in t)
  25805. if (t.hasOwnProperty(i)) {
  25806. var n = t[i];
  25807. n.uploadCount = 0,
  25808. n.uploadAttempts = 0
  25809. }
  25810. }
  25811. ,
  25812. n.prototype.getPanoLODDescriptor = function(e, t) {
  25813. var i = this.getPanoLODDescriptors(e)
  25814. , n = i[t];
  25815. return n || (n = {
  25816. uploadCount: 0,
  25817. uploadAttempts: 0
  25818. },
  25819. i[t] = n),
  25820. n
  25821. }
  25822. ,
  25823. n.prototype.getPanoLODDescriptors = function(e) {
  25824. var t = this.panoLODDescriptors[e];
  25825. return t || (t = {},
  25826. this.panoLODDescriptors[e] = t),
  25827. t
  25828. }
  25829. ,
  25830. n.prototype.onTileDownloaded = function(e) {
  25831. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25832. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25833. if (i.downloaded = !0,
  25834. i.image = e.image,
  25835. i.panoSize = e.panoSize,
  25836. i.tileX = e.tileX,
  25837. i.tileY = e.tileY,
  25838. i.totalTiles = e.totalTiles,
  25839. i.tileIndex = e.tileIndex,
  25840. i.faceTileIndex = e.faceTileIndex,
  25841. i.face = e.face,
  25842. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  25843. i.panoId = e.panoId,
  25844. i.tileSize = e.tileSize,
  25845. i.direction = (new _.Vector3).copy(e.direction),
  25846. i.node = null,
  25847. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  25848. this.isPanoActive(i.panoId)) {
  25849. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  25850. this.linkTileAndNode(i, n),
  25851. this.queueTileUpload(i, !0)
  25852. }
  25853. }
  25854. ,
  25855. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25856. var r = this.tileDirectory[e];
  25857. r || (r = {},
  25858. this.tileDirectory[e] = r);
  25859. var o = 16384 * t + 1024 * i + n
  25860. , a = r[o];
  25861. return a || (a = {
  25862. downloaded: !1,
  25863. uploaded: !1,
  25864. zoomUploaded: !1
  25865. },
  25866. r[o] = a),
  25867. a._key = e + ":" + t + ":" + i + ":" + n,
  25868. a._tileKey = o,
  25869. a
  25870. }
  25871. ,
  25872. n.prototype.setZoomingActive = function(e, t, i) {
  25873. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25874. this.zoomPanoId = t.id,
  25875. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25876. }
  25877. ,
  25878. n.prototype.updateZoomedPanoFromBase = function(e) {
  25879. if (!this.zoomPanoRenderingDisabled) {
  25880. var t = this.getActiveRenderTargetDescriptor(e.id);
  25881. if (t && t.renderTarget) {
  25882. var i = this.qualityManager.getMaxZoomPanoSize()
  25883. , n = t.renderTarget
  25884. , r = t.size;
  25885. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25886. this.copyBaseRenderStatusToZoomed(e.id)
  25887. }
  25888. }
  25889. }
  25890. ,
  25891. t.exports = n
  25892. }
  25893. , {
  25894. "../enum/GLCubeFaces": 25,
  25895. "../enum/PanoRendererEvents": 35,
  25896. "../enum/PanoSizeClass": 36,
  25897. "../enum/SceneRendererEvents": 43,
  25898. "../enum/TileDownloaderEvents": 45,
  25899. "../enum/Vectors": 50,
  25900. "../exception/BasicException": 55,
  25901. "../objects/Panorama": 148,
  25902. "../settings": 166,
  25903. "../util/browser": 182,
  25904. "../util/panorama": 191,
  25905. "./TileDownloader": 171,
  25906. "./TilePrioritizer": 172,
  25907. "./TileTree": 173,
  25908. "./TileUtils": 174,
  25909. events: 202,
  25910. three: 217
  25911. }],
  25912. 170: [function(e, t, i) {
  25913. "use strict";
  25914. function n(e, t, i) {
  25915. this.maxNavPanoSize = -1,
  25916. this.maxZoomPanoSize = -1,
  25917. this.devicePixelDensity = e,
  25918. this.deviceScreenSize = t,
  25919. this.clientBandwidth = i,
  25920. this.panoSizeClassMap = {},
  25921. this.useHighResolutionPanos = !0,
  25922. this.useUltraHighResolutionPanos = !1,
  25923. this.modelHasUltraHighPanos = !1
  25924. }
  25925. var r = e("../enum/PanoSizeClass")
  25926. , o = e("../settings")
  25927. , a = e("../util/browser")
  25928. , s = e("../constants")
  25929. , l = e("../util/showcase")
  25930. , c = e("../enum/ModelManagerEvents");
  25931. n.prototype.init = function(e) {
  25932. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25933. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25934. this.highSize = this.getPanoSize(r.HIGH),
  25935. this.standardSize = this.getPanoSize(r.STANDARD),
  25936. this.baseSize = this.getPanoSize(r.BASE),
  25937. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25938. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25939. this.updateMaximums(),
  25940. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25941. }
  25942. ,
  25943. n.prototype.updateFromModel = function(e) {
  25944. this.updateHighResolutionSettings(e),
  25945. this.updateUltraHighResolutionSettings(e)
  25946. }
  25947. ,
  25948. n.prototype.updateHighResolutionSettings = function(e) {
  25949. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25950. this.updateMaximums()
  25951. }
  25952. ,
  25953. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25954. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25955. this.updateMaximums()
  25956. }
  25957. ,
  25958. n.prototype.enableUltraHighQualityMode = function() {
  25959. this.modelHasUltraHighPanos = !0,
  25960. this.updateUltraHighResolutionSettings(null)
  25961. }
  25962. ,
  25963. n.prototype.ultraHighQualityModeEnabled = function() {
  25964. return this.modelHasUltraHighPanos
  25965. }
  25966. ,
  25967. n.prototype.onModelChanged = function(e) {
  25968. this.updateFromModel(e.model),
  25969. this.updateMaximums()
  25970. }
  25971. ,
  25972. n.prototype.updateMaximums = function() {
  25973. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25974. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25975. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25976. }
  25977. ,
  25978. n.prototype.buildPanoSizeClassMap = function() {
  25979. this.panoSizeClassMap[r.BASE] = 512,
  25980. this.panoSizeClassMap[r.STANDARD] = 1024,
  25981. this.panoSizeClassMap[r.HIGH] = 2048,
  25982. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25983. }
  25984. ,
  25985. n.prototype.getPanoSize = function(e) {
  25986. return this.panoSizeClassMap[e]
  25987. }
  25988. ,
  25989. n.prototype.getMaxPossiblePanoSize = function() {
  25990. return this.getPanoSize(r.ULTRAHIGH)
  25991. }
  25992. ,
  25993. n.prototype.getMaxPanoSize = function() {
  25994. return this.maxZoomPanoSize
  25995. }
  25996. ,
  25997. n.prototype.getMaxNavPanoSize = function() {
  25998. return this.maxNavPanoSize
  25999. }
  26000. ,
  26001. n.prototype.getMaxZoomPanoSize = function() {
  26002. return this.maxZoomPanoSize
  26003. }
  26004. ,
  26005. n.prototype.detectMaxNavPanoSizeClass = function() {
  26006. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26007. }
  26008. ,
  26009. n.prototype.detectMaxNavPanoSize = function() {
  26010. var e = this.detectMaxNavPanoSizeClass();
  26011. return this.getPanoSize(e)
  26012. }
  26013. ,
  26014. n.prototype.detectMaxZoomPanoSize = function() {
  26015. 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)
  26016. }
  26017. ,
  26018. t.exports = n
  26019. }
  26020. , {
  26021. "../constants": 8,
  26022. "../enum/ModelManagerEvents": 33,
  26023. "../enum/PanoSizeClass": 36,
  26024. "../settings": 166,
  26025. "../util/browser": 182,
  26026. "../util/showcase": 193
  26027. }],
  26028. 171: [function(A, C, e) {
  26029. (function(e) {
  26030. "use strict";
  26031. function i(e) {
  26032. this.panos = null,
  26033. this.retryMinimumTime = 1e4,
  26034. this.urls = null,
  26035. this.panoLoadCallbacks = {},
  26036. this.downloadDescriptors = {},
  26037. this.priorityQueue = [],
  26038. this.forceQueue = [],
  26039. this.activeDownloads = [],
  26040. this.qualityManager = null,
  26041. this.tilePrioritizer = null,
  26042. this.refreshInterval = null,
  26043. this.processPriorityQueue = !1,
  26044. this.concurrentDownloads = e.concurrentDownloads || 1,
  26045. this.downloadTestResults = {}
  26046. }
  26047. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26048. A("../settings")), r = (A("../objects/Panorama"),
  26049. A("../util/logger")), o = (A("../enum/Vectors"),
  26050. A("../enum/PanoSizeClass"),
  26051. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26052. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26053. Object.freeze({
  26054. Testing: 1,
  26055. Success: 2,
  26056. Fail: 3
  26057. }));
  26058. i.prototype = Object.create(l.prototype),
  26059. i.IDLE_REFRESH_DELAY = 500,
  26060. i.ACTIVE_REFRESH_DELAY = 16,
  26061. i.DOWNLOAD_RETRIES = 4,
  26062. i.prototype.init = function(e) {
  26063. this.qualityManager = e
  26064. }
  26065. ,
  26066. i.prototype.setUrls = function(e) {
  26067. this.urls = e
  26068. }
  26069. ,
  26070. i.prototype.setPanoData = function(e, t, i) {
  26071. this.panos = e,
  26072. this.imagePanos = t,
  26073. this.panoGroupId = i
  26074. }
  26075. ,
  26076. i.prototype.start = function() {
  26077. this.refreshUpdateInterval(0)
  26078. }
  26079. ,
  26080. i.prototype.stop = function() {
  26081. window.cancel(this.refreshInterval)
  26082. }
  26083. ,
  26084. i.prototype.refreshUpdateInterval = function(e) {
  26085. e = e || 0,
  26086. this.refreshInterval = window.setTimeout(function() {
  26087. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26088. }
  26089. .bind(this), e)
  26090. }
  26091. ,
  26092. i.prototype.update = function() {
  26093. var e = 0 < this.forceQueue.length;
  26094. return this.processQueueForDownloading(this.forceQueue),
  26095. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26096. 0 < this.priorityQueue.length && (e = !0),
  26097. this.processQueueForDownloading(this.priorityQueue)),
  26098. e
  26099. }
  26100. ,
  26101. i.prototype.forceQueueTilesForPano = (p = [],
  26102. f = [],
  26103. function(e, t, i, n, r, o) {
  26104. p.length = 0;
  26105. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26106. var l = a[s];
  26107. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26108. }
  26109. if (i && 0 < p.length) {
  26110. g.sortPanoTiles(p, e, i),
  26111. f.length = 0,
  26112. m.matchingTilesInDirection(e, t, i, n, r, f);
  26113. for (var c = 0, h = function(e) {
  26114. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26115. }; c < p.length; ) {
  26116. var u = p[c];
  26117. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26118. }
  26119. }
  26120. for (var d = 0; d < p.length; d++)
  26121. this.forceQueue.push(p[d]);
  26122. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26123. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26124. o && this.processQueueForDownloading(this.forceQueue, !0)
  26125. }
  26126. ),
  26127. i.prototype.clearForceQueue = function() {
  26128. this.clearQueue(this.forceQueue)
  26129. }
  26130. ,
  26131. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26132. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26133. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26134. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26135. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26136. }
  26137. ,
  26138. i.prototype.clearQueue = function(e) {
  26139. this.setStatusForAllDescriptors(e, v.None),
  26140. e.length = 0
  26141. }
  26142. ,
  26143. i.prototype.clearFromQueue = function(e, t, i) {
  26144. for (var n = 0; n < e.length; n++) {
  26145. var r = e[n];
  26146. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26147. }
  26148. }
  26149. ,
  26150. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26151. for (var i = 0; i < e.length; i++) {
  26152. var n = e[i];
  26153. n && (n.status = t)
  26154. }
  26155. }
  26156. ,
  26157. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26158. for (var i = 0; i < e.length; i++) {
  26159. var n = e[i];
  26160. n && (n.status !== t ? n.status = t : e[i] = null)
  26161. }
  26162. }
  26163. ,
  26164. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26165. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26166. , n = i[t];
  26167. return n || (n = this.buildDownloadDescriptorArray(t),
  26168. i[t] = n,
  26169. this.initTileDownloadDescriptors(n, e, t)),
  26170. n
  26171. }
  26172. ,
  26173. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26174. var t = this.downloadDescriptors[e.id];
  26175. return t || (t = {},
  26176. this.downloadDescriptors[e.id] = t),
  26177. t
  26178. }
  26179. ,
  26180. i.prototype.processQueueForDownloading = function(e, t) {
  26181. if (this.cleanupActiveDownloads(),
  26182. this.activeDownloads.length < this.concurrentDownloads || t)
  26183. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26184. var r = e.shift();
  26185. r && (this.startDownload(r),
  26186. n++)
  26187. }
  26188. }
  26189. ,
  26190. i.prototype.testDownload = function(t, e, i) {
  26191. var n = this.downloadTestResults[t];
  26192. if (n)
  26193. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26194. else {
  26195. this.downloadTestResults[t] = y.Testing;
  26196. var r = this.panos.list[0]
  26197. , o = this.getTileUrl(r.id, t, e, 0)
  26198. , a = function(e) {
  26199. this.downloadTestResults[t] = y.Success,
  26200. i(!0)
  26201. }
  26202. .bind(this)
  26203. , s = function() {
  26204. this.downloadTestResults[t] = y.Fail,
  26205. i(!1)
  26206. }
  26207. .bind(this);
  26208. this.loadImage(o, 0, a, s)
  26209. }
  26210. }
  26211. ,
  26212. i.prototype.startDownload = function(e) {
  26213. e.status = v.Downloading;
  26214. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26215. this.activeDownloads.push(e),
  26216. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26217. }
  26218. ,
  26219. i.prototype.downloadFailed = function(e, t) {}
  26220. ,
  26221. i.prototype.downloadComplete = function(e, t) {
  26222. if (e.panoGroupId === this.panoGroupId) {
  26223. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26224. e.status = v.Downloaded,
  26225. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26226. var n = {
  26227. panoId: e.pano.id,
  26228. image: t,
  26229. tileSize: e.tileSize,
  26230. panoSize: e.panoSize,
  26231. tileIndex: e.tileIndex,
  26232. faceTileIndex: e.faceTileIndex,
  26233. totalTiles: e.totalTiles,
  26234. face: e.face,
  26235. tileX: e.tileX,
  26236. tileY: e.tileY,
  26237. direction: e.direction
  26238. };
  26239. e.image = t,
  26240. this.emit(o.TileDownloadSuccess, n),
  26241. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26242. panoId: e.pano.id,
  26243. tileSize: e.tileSize,
  26244. panoSize: e.panoSize
  26245. },
  26246. this.emit(o.PanoDownloadComplete, n),
  26247. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26248. }
  26249. }
  26250. ,
  26251. i.prototype.cleanupActiveDownloads = (n = [],
  26252. function() {
  26253. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26254. var t = this.activeDownloads[e];
  26255. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26256. }
  26257. this.activeDownloads.length = 0,
  26258. this.activeDownloads.push.apply(this.activeDownloads, n)
  26259. }
  26260. ),
  26261. i.prototype.isPanoDownloaded = function(e, t) {
  26262. var i = this.getTileDownloadDescriptors(e, t);
  26263. if (i.length <= 0)
  26264. return !1;
  26265. for (var n = 0; n < i.length; n++) {
  26266. if (i[n].status !== v.Downloaded)
  26267. return !1
  26268. }
  26269. return !0
  26270. }
  26271. ,
  26272. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26273. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26274. this.panoLoadCallbacks[o] = {
  26275. onLoad: i,
  26276. onFail: n,
  26277. onProgress: r
  26278. }
  26279. }
  26280. ,
  26281. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26282. var i = e.id + ":" + t;
  26283. return this.panoLoadCallbacks[i]
  26284. }
  26285. ,
  26286. i.prototype.buildDownloadDescriptorArray = function(e) {
  26287. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26288. var r = this.buildDownloadDescriptor();
  26289. i.push(r)
  26290. }
  26291. return i
  26292. }
  26293. ,
  26294. i.prototype.buildDownloadDescriptor = function() {
  26295. return {
  26296. panoGroupId: null,
  26297. pano: null,
  26298. panoSize: -1,
  26299. tileSize: -1,
  26300. tileIndex: -1,
  26301. totalTiles: -1,
  26302. faceTileIndex: -1,
  26303. status: v.None,
  26304. url: null,
  26305. image: null,
  26306. direction: new t.Vector3,
  26307. face: -1,
  26308. cubeFace: -1,
  26309. tileX: -1,
  26310. tileY: -1
  26311. }
  26312. }
  26313. ,
  26314. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26315. for (var n = 0; n < e.length; n++) {
  26316. var r = e[n];
  26317. this.initTileDownloadDescriptor(r, t, i, n)
  26318. }
  26319. }
  26320. ,
  26321. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26322. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26323. e.face = m.getFaceForTile(i, n),
  26324. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26325. e.panoGroupId = this.panoGroupId,
  26326. e.pano = t,
  26327. e.panoSize = i,
  26328. e.tileSize = r,
  26329. e.tileIndex = n,
  26330. e.totalTiles = m.getTileCountForSize(i),
  26331. e.status = v.None,
  26332. e.image = null,
  26333. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26334. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26335. }
  26336. ,
  26337. i.prototype.getTileUrl = (c = {
  26338. 256: "256",
  26339. 512: "512",
  26340. 1024: "1k",
  26341. 2048: "2k",
  26342. 4096: "4k"
  26343. },
  26344. h = {
  26345. face: -1,
  26346. faceTileIndex: -1,
  26347. tileX: -1,
  26348. tileY: -1
  26349. },
  26350. function(e, t, i, n) {
  26351. m.getTileLocation(t, n, h);
  26352. var r = Math.floor(t / i)
  26353. , o = r * r
  26354. , a = Math.floor(n / o)
  26355. , s = "";
  26356. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26357. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26358. return d.changeIfTileGenerating(l)
  26359. }
  26360. ),
  26361. i.prototype.loadImage = function(e, t, i, n) {
  26362. s.getImage(e, t).then(function(e) {
  26363. i(e)
  26364. }).fail(n)
  26365. }
  26366. ,
  26367. C.exports = i
  26368. }
  26369. ).call(this, "/js/tile/TileDownloader.js")
  26370. }
  26371. , {
  26372. "../ab": 3,
  26373. "../enum/DownloadStatus": 24,
  26374. "../enum/GLCubeFaces": 25,
  26375. "../enum/PanoSizeClass": 36,
  26376. "../enum/TileDownloaderEvents": 45,
  26377. "../enum/Vectors": 50,
  26378. "../enum/Viewmode": 51,
  26379. "../objects/Panorama": 148,
  26380. "../settings": 166,
  26381. "../util/ajax": 181,
  26382. "../util/logger": 189,
  26383. "../util/panorama": 191,
  26384. "./TilePrioritizer": 172,
  26385. "./TileUtils": 174,
  26386. events: 202,
  26387. three: 217
  26388. }],
  26389. 172: [function(n, C, e) {
  26390. (function(e) {
  26391. "use strict";
  26392. function h(e, t, i, n, r) {
  26393. this.qualityManager = e,
  26394. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26395. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26396. this.baseSize = t,
  26397. this.standardSize = i,
  26398. this.highSize = n,
  26399. this.ultraHighSize = r,
  26400. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26401. }
  26402. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26403. n("../settings"),
  26404. n("../settings"),
  26405. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26406. n("../enum/PanoSizeClass"),
  26407. n("../enum/ModelManagerEvents"),
  26408. n("../enum/GLCubeFaces"),
  26409. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26410. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26411. new t(e),
  26412. Object.freeze({
  26413. None: 0,
  26414. DirectionalFOV: 1
  26415. }));
  26416. h.PriorityCriteria = function(e, t, i, n, r) {
  26417. this.pano = e,
  26418. this.cameraPosition = (new o.Vector3).copy(t),
  26419. this.cameraDir = (new o.Vector3).copy(i),
  26420. this.panoSpaceDir = (new o.Vector3).copy(n),
  26421. this.upcomingPanos = r,
  26422. this.copy = function(e) {
  26423. this.pano = e.pano,
  26424. this.cameraPosition.copy(e.cameraPosition),
  26425. this.cameraDir.copy(e.cameraDir),
  26426. this.panoSpaceDir.copy(e.panoSpaceDir),
  26427. this.upcomingPanos = r
  26428. }
  26429. ,
  26430. this.zoomingActive = !1
  26431. }
  26432. ,
  26433. h.DIRECTIONAL_FOV = 180,
  26434. h.DIRECTIONAL_FOV_NARROW = 120,
  26435. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26436. h.MAX_SCORED_PANOS_TOADD = 2,
  26437. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26438. h.DIRECTION_SCORE_STRICTNESS = .75,
  26439. h.appendQueue = function(e, t) {
  26440. if (e && t)
  26441. for (var i = 0; i < t.length; i++)
  26442. e.push(t[i])
  26443. }
  26444. ,
  26445. h.prototype.updateCriteria = function(e, t, i, n) {
  26446. this.priorityCriteria.pano = e,
  26447. this.priorityCriteria.cameraPosition.copy(t),
  26448. this.priorityCriteria.cameraDir.copy(i),
  26449. this.priorityCriteria.upcomingPanos = n,
  26450. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26451. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26452. }
  26453. ,
  26454. h.prototype.filterAndPrioritize = (u = [],
  26455. p = [],
  26456. f = [],
  26457. function(e, t, i) {
  26458. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26459. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26460. var n = this.baseSize
  26461. , r = this.standardSize
  26462. , o = this.highSize
  26463. , a = this.ultraHighSize;
  26464. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26465. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26466. f.length = 0,
  26467. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26468. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26469. h.appendQueue(e, f),
  26470. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26471. f.length = 0,
  26472. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26473. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26474. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26475. h.appendQueue(e, f),
  26476. f.length = 0,
  26477. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26478. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26479. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26480. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26481. h.appendQueue(e, f),
  26482. this.queueTilesForPanos(e, u, i, n)
  26483. }
  26484. ),
  26485. h.prototype.canDownloadSize = function(e) {
  26486. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26487. }
  26488. ,
  26489. h.prototype.populateNeighborPanos = function(e, t, i) {
  26490. (i = i || []).length = 0;
  26491. var n = t.getNeighbours(e);
  26492. for (var r in n)
  26493. if (n.hasOwnProperty(r)) {
  26494. var o = t.get(r);
  26495. i.push(o)
  26496. }
  26497. return i
  26498. }
  26499. ,
  26500. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26501. (i = i || []).length = 0;
  26502. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26503. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26504. , s = t.sortByScore(o, a);
  26505. if (s)
  26506. for (var l = 0; l < s.length && l < r; l++) {
  26507. var c = s[l].pano;
  26508. i.push(c)
  26509. }
  26510. return i
  26511. }
  26512. ,
  26513. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26514. for (var o = 0, a = 0; a < t.length; a++) {
  26515. var s = t[a];
  26516. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26517. r && r <= o)
  26518. break
  26519. }
  26520. return o
  26521. }
  26522. ,
  26523. h.prototype.queueTilesForPano = (r = {
  26524. filter: a.None
  26525. },
  26526. function(e, t, i, n) {
  26527. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26528. }
  26529. ),
  26530. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26531. function(e, t, i, n, r, o, a, s) {
  26532. for (var l = 0, c = 0; c < i.length; c++) {
  26533. var h = i[c];
  26534. d.copy(h.position),
  26535. d.sub(r),
  26536. d.normalize();
  26537. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26538. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26539. s && s <= l))
  26540. break
  26541. }
  26542. return l
  26543. }
  26544. ),
  26545. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26546. for (var l = 0, c = 0; c < i.length; c++) {
  26547. var h = i[c];
  26548. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26549. s && s <= l)
  26550. break
  26551. }
  26552. return l
  26553. }
  26554. ,
  26555. h.prototype.queueTilesInDirectionForPano = (s = {
  26556. filter: a.DirectionalFOV,
  26557. direction: new o.Vector3,
  26558. fov: 60
  26559. },
  26560. l = new o.Vector3,
  26561. function(e, t, i, n, r, o, a) {
  26562. return l.copy(o),
  26563. m.getRelativeDirection(i.quaternion, l),
  26564. s.direction.copy(l),
  26565. s.fov = a,
  26566. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26567. }
  26568. ),
  26569. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26570. function(e, t, i, n, r) {
  26571. var o = t.getTileDownloadDescriptors(i, n);
  26572. c.length = 0,
  26573. this.filterTileDownloadDescriptors(i, o, c, r);
  26574. for (var a = 0, s = 0; s < c.length; s++) {
  26575. var l = c[s];
  26576. l && (e.push(l),
  26577. a++)
  26578. }
  26579. return a
  26580. }
  26581. ),
  26582. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26583. function(e, t, i, n) {
  26584. var r, o;
  26585. switch (n.filter) {
  26586. case a.DirectionalFOV:
  26587. for (r = 0; r < t.length; r++)
  26588. o = t[r],
  26589. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26590. break;
  26591. default:
  26592. for (r = 0; r < t.length; r++)
  26593. o = t[r],
  26594. i.push(o)
  26595. }
  26596. for (r = 0; r < i.length; r++)
  26597. o = i[r],
  26598. this.canIncludeDescriptor(o) || (i[r] = null)
  26599. }
  26600. ),
  26601. h.prototype.canIncludeDescriptor = function(e) {
  26602. return e.status !== i.Downloading && e.status !== i.Downloaded
  26603. }
  26604. ,
  26605. h.prototype.canIncludePano = function(e, t) {
  26606. return !e.isLoaded(t)
  26607. }
  26608. ,
  26609. h.getFOVDotThreshold = function(e) {
  26610. return Math.cos(o.Math.degToRad(e / 2))
  26611. }
  26612. ;
  26613. var y = (A._panoSpaceDir = new o.Vector3,
  26614. A._fovThreshold = -1,
  26615. A._fovThresholdNarrow = -1,
  26616. A);
  26617. function A(e, t) {
  26618. var i = A._panoSpaceDir
  26619. , n = A._fovThreshold
  26620. , r = A._fovThresholdNarrow
  26621. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26622. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26623. return e._dot = o,
  26624. t._dot = a,
  26625. 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)
  26626. }
  26627. h.sortPanoTiles = function(e, t, i) {
  26628. y._panoSpaceDir.copy(i),
  26629. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26630. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26631. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26632. e.sort(y)
  26633. }
  26634. ,
  26635. h.insertSortedPanoTile = function(e, t, i, n) {
  26636. y._panoSpaceDir.copy(n),
  26637. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26638. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26639. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26640. for (var r = -1, o = 0; o < e.length; o++) {
  26641. if (y(t, e[o]) <= 0) {
  26642. r = o;
  26643. break
  26644. }
  26645. }
  26646. if (-1 === r)
  26647. e[e.length] = t;
  26648. else {
  26649. for (var a = e.length; r < a; a--)
  26650. e[a] = e[a - 1];
  26651. e[r] = t
  26652. }
  26653. }
  26654. ,
  26655. h.prototype.setZoomingActive = function(e) {
  26656. e !== this.zoomingActive && (this.zoomingActive = e)
  26657. }
  26658. ,
  26659. C.exports = h
  26660. }
  26661. ).call(this, "/js/tile/TilePrioritizer.js")
  26662. }
  26663. , {
  26664. "../enum/DownloadStatus": 24,
  26665. "../enum/GLCubeFaces": 25,
  26666. "../enum/ModelManagerEvents": 33,
  26667. "../enum/PanoSizeClass": 36,
  26668. "../enum/Vectors": 50,
  26669. "../enum/Viewmode": 51,
  26670. "../objects/Panorama": 148,
  26671. "../settings": 166,
  26672. "../util/browser": 182,
  26673. "../util/logger": 189,
  26674. "../util/math": 190,
  26675. "./TileUtils": 174,
  26676. events: 202,
  26677. three: 217
  26678. }],
  26679. 173: [function(e, t, i) {
  26680. "use strict";
  26681. function f(e, t) {
  26682. this.levels = t,
  26683. this.tileSize = e,
  26684. this.root = null,
  26685. this.allNodes = [],
  26686. function(e) {
  26687. e.root = function e(t, i, n) {
  26688. if (n > t.levels)
  26689. return null;
  26690. var r = new a(t,i);
  26691. t.allNodes.push(r);
  26692. for (var o = 0; o < s; o++)
  26693. r.children[o] = e(t, r, n + 1);
  26694. return r
  26695. }(e, null, 0)
  26696. }(this)
  26697. }
  26698. function a(e, t) {
  26699. this.tree = e,
  26700. this.parent = t,
  26701. this.children = [],
  26702. this.id = ++n
  26703. }
  26704. var g = (e("three"),
  26705. e("./TileUtils"),
  26706. e("../objects/Panorama"),
  26707. e("../util/panorama"),
  26708. e("events").EventEmitter,
  26709. 2)
  26710. , s = g * g;
  26711. f.TraversalType = Object.freeze({
  26712. PreOrder: 0,
  26713. PostOrder: 1
  26714. });
  26715. var n = 0;
  26716. f.getLevelCountForSize = function(e, t) {
  26717. var i = 0;
  26718. for (t < e && (t = e); !((t /= g) < e); )
  26719. i++;
  26720. return i
  26721. }
  26722. ,
  26723. f.getSizeForLevel = function(e, t) {
  26724. return Math.pow(g, t) * e
  26725. }
  26726. ,
  26727. f.prototype.getSubNode = function(e, t, i) {
  26728. (!t || e < this.tileSize) && (t = 0),
  26729. (!i || e < this.tileSize) && (i = 0),
  26730. e < this.tileSize && (e = this.tileSize);
  26731. var n = f.getLevelCountForSize(this.tileSize, e);
  26732. return function e(t, i, n, r, o) {
  26733. if (!t)
  26734. return null;
  26735. if (0 === n)
  26736. return t;
  26737. if (!t.children || 0 === t.children.length)
  26738. return null;
  26739. var a = Math.pow(g, n) / g
  26740. , s = r % a
  26741. , l = o % a
  26742. , c = Math.floor(o / a)
  26743. , h = Math.floor(r / a)
  26744. , u = c * g + h;
  26745. return e(t.children[u], i + 1, n - 1, s, l)
  26746. }(this.root, 0, n, t, i)
  26747. }
  26748. ,
  26749. f.prototype.breadthFirst = function(e) {
  26750. var t = !!(e = e || {}).nullLevelEnd
  26751. , i = e.maxLevel
  26752. , n = e.minLevel
  26753. , r = e.callback
  26754. , o = e.saveVisited
  26755. , a = []
  26756. , s = {}
  26757. , l = 0;
  26758. for (a.push(this.root),
  26759. a.push(s); 0 < a.length && !(i && i < l); ) {
  26760. var c = a.shift();
  26761. if (c === s)
  26762. (!n || n <= l) && (r && t && r(null),
  26763. o && t && o.push(null)),
  26764. 0 < a.length && a.push(s),
  26765. l++,
  26766. 0;
  26767. else {
  26768. if (c.children)
  26769. for (var h = 0; h < c.children.length; h++) {
  26770. c.children[h] && a.push(c.children[h])
  26771. }
  26772. var u = this.getFaceIndexFromNode(c);
  26773. (!n || n <= l) && (r && r(c, l, u),
  26774. o && o.push(c)),
  26775. 0
  26776. }
  26777. }
  26778. }
  26779. ,
  26780. f.prototype.getFaceIndexFromNode = function(e) {
  26781. if (!e)
  26782. return -1;
  26783. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26784. var o = i.parent;
  26785. if (!o)
  26786. break;
  26787. for (var a = -1, s = 0; s < o.children.length; s++)
  26788. o.children[s] === i && (a = s);
  26789. n = a % g * t + n,
  26790. r = Math.floor(a / g) * t + r,
  26791. t *= g,
  26792. i = o
  26793. }
  26794. return r * t + n
  26795. }
  26796. ,
  26797. f.prototype.depthFirst = function(e, t, i) {
  26798. !function e(t, i, n, r, o, a, s, l) {
  26799. if (t) {
  26800. s = s || f.TraversalType.PreOrder;
  26801. var c = r * g + n;
  26802. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26803. a && a.push(t)),
  26804. t.children && 0 !== t.children.length) {
  26805. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26806. for (var p = 0; p < g; p++)
  26807. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26808. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26809. a && a.push(t))
  26810. }
  26811. }
  26812. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26813. }
  26814. ,
  26815. t.exports = f
  26816. }
  26817. , {
  26818. "../objects/Panorama": 148,
  26819. "../util/panorama": 191,
  26820. "./TileUtils": 174,
  26821. events: 202,
  26822. three: 217
  26823. }],
  26824. 174: [function(e, t, i) {
  26825. "use strict";
  26826. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26827. b.TILE_SIZE = 512,
  26828. b.FACES_PER_PANO = 6,
  26829. b.LocationOnTile = {
  26830. Center: 0,
  26831. UpperLeft: 1,
  26832. UpperRight: 2,
  26833. LowerRight: 3,
  26834. LowerLeft: 4
  26835. },
  26836. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  26837. var l = e / t
  26838. , c = t / e * 2
  26839. , h = c / 2
  26840. , u = n / l * 2 - 1 + h
  26841. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  26842. switch (o = o || b.LocationOnTile.Center) {
  26843. case b.LocationOnTile.UpperLeft:
  26844. u -= h,
  26845. d += h,
  26846. u += a * c;
  26847. break;
  26848. case b.LocationOnTile.UpperRight:
  26849. u += h,
  26850. d += h,
  26851. d -= a * c;
  26852. break;
  26853. case b.LocationOnTile.LowerRight:
  26854. u += h,
  26855. d -= h,
  26856. u -= a * c;
  26857. break;
  26858. case b.LocationOnTile.LowerLeft:
  26859. u -= h,
  26860. d -= h,
  26861. d += a * c;
  26862. break;
  26863. case b.LocationOnTile.Center:
  26864. }
  26865. switch (i) {
  26866. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26867. _.setVector(s, -1, d, -u);
  26868. break;
  26869. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26870. _.setVector(s, 1, d, u);
  26871. break;
  26872. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26873. _.setVector(s, -u, 1, -d);
  26874. break;
  26875. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26876. _.setVector(s, -u, -1, d);
  26877. break;
  26878. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26879. _.setVector(s, -u, d, 1);
  26880. break;
  26881. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26882. _.setVector(s, u, d, -1)
  26883. }
  26884. _.normalize(s)
  26885. }
  26886. ,
  26887. b.getFaceForTile = function(e, t) {
  26888. var i = b.TILE_SIZE;
  26889. e < b.TILE_SIZE && (i = e);
  26890. var n = Math.floor(e / i)
  26891. , r = n * n;
  26892. return Math.floor(t / r)
  26893. }
  26894. ,
  26895. b.getTileLocation = function(e, t, i) {
  26896. var n = b.TILE_SIZE;
  26897. e < b.TILE_SIZE && (n = e);
  26898. var r = b.getFaceForTile(e, t)
  26899. , o = Math.floor(e / n)
  26900. , a = t - r * (o * o);
  26901. i.tileX = a % o,
  26902. i.tileY = Math.floor(a / o),
  26903. i.face = r,
  26904. i.faceTileIndex = a
  26905. }
  26906. ,
  26907. b.getTileCountForSize = function(e) {
  26908. if (e <= b.TILE_SIZE)
  26909. return b.FACES_PER_PANO;
  26910. var t = Math.floor(e / b.TILE_SIZE);
  26911. return t * t * b.FACES_PER_PANO
  26912. }
  26913. ,
  26914. b.getRelativeDirection = (r = new _.Matrix4,
  26915. o = new _.Quaternion,
  26916. function(e, t) {
  26917. o.copy(e),
  26918. o.inverse(),
  26919. r.makeRotationFromQuaternion(o),
  26920. r.applyToVector3(t),
  26921. _.normalize(t)
  26922. }
  26923. ),
  26924. b.matchingTilesInDirection = (c = new _.Vector3,
  26925. h = new _.Vector3(0,0,-1),
  26926. u = new _.Quaternion,
  26927. l = {
  26928. face: -1,
  26929. faceTileIndex: -1,
  26930. tileX: -1,
  26931. tileY: -1
  26932. },
  26933. d = function(e, t, i) {
  26934. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  26935. b.getTileLocation(e, o, l),
  26936. t && !t(l) || (r++,
  26937. i && (a = l,
  26938. i.push({
  26939. face: a.face,
  26940. faceTileIndex: a.faceTileIndex,
  26941. tileX: a.tileX,
  26942. tileY: a.tileY
  26943. })));
  26944. var a;
  26945. return r
  26946. }
  26947. ,
  26948. function(e, t, i, n, r, o) {
  26949. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  26950. if (b.getTileCountForSize(t),
  26951. !n && !r)
  26952. return d(t, null, o);
  26953. var s = !!r;
  26954. return r = r || n,
  26955. r = Math.max(0, Math.min(r, 360)),
  26956. n = Math.max(0, Math.min(n, 360)),
  26957. _.copyVector(i, c),
  26958. b.getRelativeDirection(e.quaternion, c),
  26959. s ? (u.setFromUnitVectors(c, h),
  26960. d(t, function(e) {
  26961. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  26962. }, o)) : d(t, function(e) {
  26963. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  26964. }, o)
  26965. }
  26966. ),
  26967. b.isTileWithinFrustum = (E = new _.Vector3,
  26968. function(e, t, i, n, r, o, a, s) {
  26969. 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++)
  26970. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  26971. _.applyQuaternionToVector(o, E),
  26972. -1e-5 <= E.z)
  26973. ;
  26974. else {
  26975. var A = -1 / E.z
  26976. , C = E.x * A
  26977. , I = E.y * A;
  26978. l < I ? p++ : I < c && f++,
  26979. h < C ? g++ : C < u && m++,
  26980. v++
  26981. }
  26982. return f !== v && p !== v && g !== v && m !== v
  26983. }
  26984. ),
  26985. b.isTileWithinFOV = (p = new _.Vector3,
  26986. f = new _.Vector3(0,1,0),
  26987. g = new _.Vector3(1,0,0),
  26988. function(e, t, i, n, r, o, a) {
  26989. var s = b.mapFaceToCubemapFace(i);
  26990. if (_.cross(o, f, g),
  26991. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  26992. b.isWithinFOV(p, o, a, null))
  26993. return !0;
  26994. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  26995. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  26996. if (b.getTileVector(e, t, s, n, r, d, h, p),
  26997. b.isWithinFOV(p, o, a, null))
  26998. return !0;
  26999. h += l
  27000. }
  27001. return !1
  27002. }
  27003. ),
  27004. b.isWithinFOV = (a = new _.Vector3,
  27005. s = new _.Vector3,
  27006. function(e, t, i, n) {
  27007. if (_.copyVector(e, s),
  27008. n) {
  27009. _.copyVector(n, a),
  27010. _.normalize(a);
  27011. var r = _.dot(a, e);
  27012. a.x *= r,
  27013. a.y *= r,
  27014. a.z *= r,
  27015. _.subVector(s, a)
  27016. }
  27017. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27018. return Math.cos(o) <= _.dot(s, t)
  27019. }
  27020. ),
  27021. b.mapFaceToCubemapFace = (n = {
  27022. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27023. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27024. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27025. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27026. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27027. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27028. },
  27029. function(e) {
  27030. return n[e]
  27031. }
  27032. ),
  27033. t.exports = b
  27034. }
  27035. , {
  27036. "../enum/GLCubeFaces": 25,
  27037. "../util/MathLight": 176
  27038. }],
  27039. 175: [function(i, n, e) {
  27040. (function(e) {
  27041. "use strict";
  27042. function t() {
  27043. this.list = [],
  27044. this.index = {},
  27045. Object.defineProperty(this, "length", {
  27046. get: function() {
  27047. return this.list.length
  27048. }
  27049. })
  27050. }
  27051. new (i("./common"),
  27052. i("./logger"))(e),
  27053. t.prototype.forEach = function(e) {
  27054. this.list.forEach(e)
  27055. }
  27056. ,
  27057. t.prototype.add = function(e) {
  27058. this.list.push(e),
  27059. this.index[this.getIndex(e)] = e
  27060. }
  27061. ,
  27062. t.prototype.getIndex = function(e) {
  27063. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27064. }
  27065. ,
  27066. t.prototype.extend = function(e) {
  27067. for (var t = 0; t < e.length; t++)
  27068. this.add(e[t])
  27069. }
  27070. ,
  27071. t.prototype.get = function(e) {
  27072. return this.index[e]
  27073. }
  27074. ,
  27075. t.prototype.first = function() {
  27076. return this.list[0]
  27077. }
  27078. ,
  27079. t.prototype.last = function() {
  27080. return this.list[this.list.length - 1]
  27081. }
  27082. ,
  27083. t.prototype.reIndex = function() {
  27084. this.index = {};
  27085. var t = this;
  27086. this.forEach(function(e) {
  27087. t.index[t.getIndex(e)] = e
  27088. })
  27089. }
  27090. ,
  27091. t.prototype.filter = function(e) {
  27092. var t = this.list.filter(e);
  27093. return this.reIndex(),
  27094. t
  27095. }
  27096. ,
  27097. t.prototype.reduce = function(e, t) {
  27098. return this.list.reduce(e, t)
  27099. }
  27100. ,
  27101. t.prototype.sort = function(e) {
  27102. return this.list.sort(e)
  27103. }
  27104. ,
  27105. t.prototype.indexOf = function(e) {
  27106. for (var t = 0; t < this.list.length; ++t)
  27107. if (this.list[t] === e)
  27108. return t;
  27109. return -1
  27110. }
  27111. ,
  27112. n.exports = t
  27113. }
  27114. ).call(this, "/js/util/IndexedCollection.js")
  27115. }
  27116. , {
  27117. "./common": 185,
  27118. "./logger": 189
  27119. }],
  27120. 176: [function(e, t, i) {
  27121. "use strict";
  27122. e("../constants");
  27123. var n, r, o = {};
  27124. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27125. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27126. o.Vector3 = function(e, t, i) {
  27127. this.x = e || 0,
  27128. this.y = t || 0,
  27129. this.z = i || 0
  27130. }
  27131. ,
  27132. o.Matrix4 = function() {
  27133. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27134. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27135. }
  27136. ,
  27137. o.Matrix4.prototype = {
  27138. identity: function() {
  27139. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27140. this
  27141. },
  27142. copy: function(e) {
  27143. return this.elements.set(e.elements),
  27144. this
  27145. },
  27146. applyToVector3: function(e) {
  27147. var t = e.x
  27148. , i = e.y
  27149. , n = e.z
  27150. , r = this.elements;
  27151. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27152. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27153. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27154. this
  27155. },
  27156. getInverse: function(e, t) {
  27157. var i = this.elements
  27158. , n = e.elements
  27159. , r = n[0]
  27160. , o = n[1]
  27161. , a = n[2]
  27162. , s = n[3]
  27163. , l = n[4]
  27164. , c = n[5]
  27165. , h = n[6]
  27166. , u = n[7]
  27167. , d = n[8]
  27168. , p = n[9]
  27169. , f = n[10]
  27170. , g = n[11]
  27171. , m = n[12]
  27172. , v = n[13]
  27173. , y = n[14]
  27174. , A = n[15]
  27175. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27176. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27177. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27178. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27179. , b = r * C + o * I + a * E + s * _;
  27180. if (0 == b) {
  27181. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27182. if (t)
  27183. throw new Error(w);
  27184. return console.warn(w),
  27185. this.identity()
  27186. }
  27187. var T = 1 / b;
  27188. return i[0] = C * T,
  27189. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27190. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27191. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27192. i[4] = I * T,
  27193. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27194. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27195. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27196. i[8] = E * T,
  27197. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27198. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27199. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27200. i[12] = _ * T,
  27201. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27202. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27203. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27204. this
  27205. },
  27206. makeRotationFromQuaternion: function(e) {
  27207. var t = this.elements
  27208. , i = e.x
  27209. , n = e.y
  27210. , r = e.z
  27211. , o = e.w
  27212. , a = i + i
  27213. , s = n + n
  27214. , l = r + r
  27215. , c = i * a
  27216. , h = i * s
  27217. , u = i * l
  27218. , d = n * s
  27219. , p = n * l
  27220. , f = r * l
  27221. , g = o * a
  27222. , m = o * s
  27223. , v = o * l;
  27224. return t[0] = 1 - (d + f),
  27225. t[4] = h - v,
  27226. t[8] = u + m,
  27227. t[1] = h + v,
  27228. t[5] = 1 - (c + f),
  27229. t[9] = p - g,
  27230. t[2] = u - m,
  27231. t[6] = p + g,
  27232. t[10] = 1 - (c + d),
  27233. t[3] = 0,
  27234. t[7] = 0,
  27235. t[11] = 0,
  27236. t[12] = 0,
  27237. t[13] = 0,
  27238. t[14] = 0,
  27239. t[15] = 1,
  27240. this
  27241. }
  27242. },
  27243. o.Quaternion = function(e, t, i, n) {
  27244. this._x = e || 0,
  27245. this._y = t || 0,
  27246. this._z = i || 0,
  27247. this._w = void 0 !== n ? n : 1
  27248. }
  27249. ,
  27250. o.Quaternion.prototype = {
  27251. get x() {
  27252. return this._x
  27253. },
  27254. set x(e) {
  27255. this._x = e
  27256. },
  27257. get y() {
  27258. return this._y
  27259. },
  27260. set y(e) {
  27261. this._y = e
  27262. },
  27263. get z() {
  27264. return this._z
  27265. },
  27266. set z(e) {
  27267. this._z = e
  27268. },
  27269. get w() {
  27270. return this._w
  27271. },
  27272. set w(e) {
  27273. this._w = e
  27274. },
  27275. copy: function(e) {
  27276. this._x = e.x,
  27277. this._y = e.y,
  27278. this._z = e.z,
  27279. this._w = e.w
  27280. },
  27281. inverse: function() {
  27282. return this.conjugate().normalize()
  27283. },
  27284. conjugate: function() {
  27285. return this._x *= -1,
  27286. this._y *= -1,
  27287. this._z *= -1,
  27288. this
  27289. },
  27290. length: function() {
  27291. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27292. },
  27293. normalize: function() {
  27294. var e = this.length();
  27295. return 0 === e ? (this._x = 0,
  27296. this._y = 0,
  27297. this._z = 0,
  27298. this._w = 1) : (e = 1 / e,
  27299. this._x = this._x * e,
  27300. this._y = this._y * e,
  27301. this._z = this._z * e,
  27302. this._w = this._w * e),
  27303. this
  27304. },
  27305. setFromAxisAngle: function(e, t) {
  27306. var i = t / 2
  27307. , n = Math.sin(i);
  27308. return this._x = e.x * n,
  27309. this._y = e.y * n,
  27310. this._z = e.z * n,
  27311. this._w = Math.cos(i),
  27312. this
  27313. },
  27314. setFromUnitVectors: function(e, t) {
  27315. return void 0 === n && (n = new o.Vector3),
  27316. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27317. 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),
  27318. this._x = n.x,
  27319. this._y = n.y,
  27320. this._z = n.z,
  27321. this._w = r,
  27322. this.normalize()
  27323. },
  27324. multiply: function(e) {
  27325. return this.multiplyQuaternions(this, e)
  27326. },
  27327. premultiply: function(e) {
  27328. return this.multiplyQuaternions(e, this)
  27329. },
  27330. multiplyQuaternions: function(e, t) {
  27331. var i = e._x
  27332. , n = e._y
  27333. , r = e._z
  27334. , o = e._w
  27335. , a = t._x
  27336. , s = t._y
  27337. , l = t._z
  27338. , c = t._w;
  27339. return this._x = i * c + o * a + n * l - r * s,
  27340. this._y = n * c + o * s + r * a - i * l,
  27341. this._z = r * c + o * l + i * s - n * a,
  27342. this._w = o * c - i * a - n * s - r * l,
  27343. this
  27344. }
  27345. },
  27346. o.convertWorkshopVector = function(e) {
  27347. return new o.Vector3(-e.x,e.y,e.z)
  27348. }
  27349. ,
  27350. o.convertWorkshopQuaternion = function(e) {
  27351. 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))
  27352. }
  27353. ,
  27354. o.convertWorkshopOrthoZoom = function(e) {
  27355. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27356. }
  27357. ,
  27358. o.convertWorkshopPanoramaQuaternion = function(e) {
  27359. 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))
  27360. }
  27361. ,
  27362. o.normalize = function(e) {
  27363. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27364. , i = Math.sqrt(t);
  27365. e.x /= i,
  27366. e.y /= i,
  27367. e.z /= i
  27368. }
  27369. ,
  27370. o.dot = function(e, t) {
  27371. return e.x * t.x + e.y * t.y + e.z * t.z
  27372. }
  27373. ,
  27374. o.cross = function(e, t, i) {
  27375. var n = e.x
  27376. , r = e.y
  27377. , o = e.z;
  27378. i.x = r * t.z - o * t.y,
  27379. i.y = o * t.x - n * t.z,
  27380. i.z = n * t.y - r * t.x
  27381. }
  27382. ,
  27383. o.setVector = function(e, t, i, n) {
  27384. e.x = t,
  27385. e.y = i,
  27386. e.z = n
  27387. }
  27388. ,
  27389. o.copyVector = function(e, t) {
  27390. t.x = e.x,
  27391. t.y = e.y,
  27392. t.z = e.z
  27393. }
  27394. ,
  27395. o.addVector = function(e, t) {
  27396. e.x += t.x,
  27397. e.y += t.y,
  27398. e.z += t.z
  27399. }
  27400. ,
  27401. o.subVector = function(e, t) {
  27402. e.x -= t.x,
  27403. e.y -= t.y,
  27404. e.z -= t.z
  27405. }
  27406. ,
  27407. o.applyQuaternionToVector = function(e, t) {
  27408. var i = t.x
  27409. , n = t.y
  27410. , r = t.z
  27411. , o = e.x
  27412. , a = e.y
  27413. , s = e.z
  27414. , l = e.w
  27415. , c = l * i + a * r - s * n
  27416. , h = l * n + s * i - o * r
  27417. , u = l * r + o * n - a * i
  27418. , d = -o * i - a * n - s * r;
  27419. t.x = c * l + d * -o + h * -s - u * -a,
  27420. t.y = h * l + d * -a + u * -o - c * -s,
  27421. t.z = u * l + d * -s + c * -a - h * -o
  27422. }
  27423. ,
  27424. o.angleBetweenVectors = function(e, t) {
  27425. return Math.acos(o.dot(e, t))
  27426. }
  27427. ,
  27428. t.exports = o
  27429. }
  27430. , {
  27431. "../constants": 8
  27432. }],
  27433. 177: [function(c, h, e) {
  27434. (function(e) {
  27435. "use strict";
  27436. function t(e) {
  27437. this.cache = null,
  27438. this.expires = 0
  27439. }
  27440. function i() {
  27441. this.baseUrl = null,
  27442. this.cache = null,
  27443. this.expires = 0
  27444. }
  27445. function n() {
  27446. this.baseUrl = null,
  27447. this.expires = 0
  27448. }
  27449. function r(e) {
  27450. this.initialLoadingPromise = null,
  27451. this.endpoint = e + "?type=3",
  27452. this.urlContainer = null,
  27453. this.authorizationHeader = s.getAuthorizationHeader(),
  27454. this.containerClasses = [n, i, t]
  27455. }
  27456. c("./ajax");
  27457. var o = c("./logger")
  27458. , a = c("../constants")
  27459. , s = c("./showcase")
  27460. , l = (c("../ab"),
  27461. new o(e));
  27462. t.prototype = {
  27463. version: 1,
  27464. validate: function(e) {
  27465. return "catalog.json"in e && 0 < Object.keys(e).length
  27466. },
  27467. update: function(e) {
  27468. return this.cache = e,
  27469. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27470. $.when()
  27471. },
  27472. get: function(e) {
  27473. return this.cache[e]
  27474. }
  27475. },
  27476. i.prototype = {
  27477. version: 2,
  27478. validate: function(e) {
  27479. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27480. },
  27481. update: function(e) {
  27482. return this.baseUrl = e["base.url"],
  27483. this.cache = e,
  27484. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27485. $.when()
  27486. },
  27487. get: function(e) {
  27488. var t = this.cache[e];
  27489. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27490. }
  27491. },
  27492. n.prototype = {
  27493. version: 3,
  27494. validate: function(e) {
  27495. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27496. },
  27497. update: function(e) {
  27498. return this.baseUrl = e.templates[0],
  27499. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27500. $.when()
  27501. },
  27502. get: function(e) {
  27503. return this.baseUrl.replace("{{filename}}", e)
  27504. }
  27505. },
  27506. r.prototype = {
  27507. init: function() {
  27508. return this.initialLoadingPromise || (setInterval(function() {
  27509. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27510. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27511. this.refresh().done(function() {
  27512. l.debug("Refreshed")
  27513. }).fail(function() {
  27514. l.error("Failed url refresh, urls might go stale soon")
  27515. }))
  27516. }
  27517. .bind(this), a.signedUrlCheckInterval),
  27518. this.initialLoadingPromise = this.refresh()),
  27519. this.initialLoadingPromise
  27520. },
  27521. refresh: function(e) {
  27522. return {},
  27523. $.Deferred().resolve()
  27524. },
  27525. get: function(e) {
  27526. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27527. }
  27528. },
  27529. h.exports = r
  27530. }
  27531. ).call(this, "/js/util/ModelUrls.js")
  27532. }
  27533. , {
  27534. "../ab": 3,
  27535. "../constants": 8,
  27536. "./ajax": 181,
  27537. "./logger": 189,
  27538. "./showcase": 193
  27539. }],
  27540. 178: [function(l, c, e) {
  27541. (function(e) {
  27542. "use strict";
  27543. function t() {
  27544. i.call(this),
  27545. this.neighbourMap = {},
  27546. this.map = null
  27547. }
  27548. 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"),
  27549. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27550. n.inherit(t, i),
  27551. t.prototype.getIndex = function(e) {
  27552. return e.id
  27553. }
  27554. ,
  27555. t.prototype.find = function(e, t) {
  27556. var i = n.filterAll(this.list, e);
  27557. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27558. i = n.stableSort(i, e)
  27559. }),
  27560. i[0])
  27561. }
  27562. ,
  27563. t.prototype.sortByScore = function(e, t) {
  27564. var i = n.filterAll(this.list, e);
  27565. return 0 === i.length ? null : i = i.map(function(i) {
  27566. return {
  27567. pano: i,
  27568. score: t.reduce(function(e, t) {
  27569. return e + t(i)
  27570. }, 0)
  27571. }
  27572. }).sort(function(e, t) {
  27573. return t.score - e.score
  27574. })
  27575. }
  27576. ,
  27577. t.prototype.lowestByScore = function(e, t, i) {
  27578. return this.findRankedByScore(0, e, t, i)
  27579. }
  27580. ,
  27581. t.prototype.findRankedByScore = function(e, t, i, n) {
  27582. n && (n.candidates = null,
  27583. n.pano = null),
  27584. e = e || 0;
  27585. var r = this.sortByScore(t, i);
  27586. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27587. n.pano = r[e].pano),
  27588. r[e].pano)
  27589. }
  27590. ,
  27591. t.prototype.showPanoScores = function(e) {
  27592. this.list.forEach(function(e) {
  27593. e.removeTextSprite()
  27594. });
  27595. var t = 6344768;
  27596. e.forEach(function(e) {
  27597. e.pano.addTextSprite(e.score.toFixed(2), t),
  27598. t = 16428055
  27599. })
  27600. }
  27601. ,
  27602. t.prototype.isNeighbour = function(e, t) {
  27603. return this.neighbourMap[e.id][t.id]
  27604. }
  27605. ,
  27606. t.prototype.getNeighbours = function(e) {
  27607. return this.neighbourMap[e.id]
  27608. }
  27609. ,
  27610. t.prototype.setNeighbour = function(e, t, i) {
  27611. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27612. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27613. this.neighbourMap[e.id][e.id] = !0,
  27614. this.neighbourMap[t.id][t.id] = !0,
  27615. this.neighbourMap[e.id][t.id] = i,
  27616. this.neighbourMap[t.id][e.id] = i,
  27617. this.neighbourMap[e.id]
  27618. }
  27619. ,
  27620. t.prototype.findClosest = function(e, t) {
  27621. var i = [r.filters.isPanoAligned()];
  27622. return t && i.push(r.filters.inDirection(e, t, .75)),
  27623. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27624. }
  27625. ,
  27626. t.prototype.dualNeighbors = function(e, t) {
  27627. var i, n = [];
  27628. for (i in this.neighbourMap[e.id])
  27629. this.neighbourMap[t.id][i] && n.push(i);
  27630. return n
  27631. }
  27632. ,
  27633. t.prototype.populate_path_graph = function() {
  27634. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27635. for (e = 0; e < this.list.length; e += 1) {
  27636. for (t in s = !(a = {}),
  27637. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27638. if (i[t]) {
  27639. o = this.index[t],
  27640. u.copy(r.floorPosition),
  27641. u.sub(o.floorPosition);
  27642. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27643. , p = (Math.abs(u.y),
  27644. Math.max(d, .01),
  27645. Math.max(0, Math.abs(u.y) - .2));
  27646. n = 0 < p ? (1,
  27647. p = Math.pow(4 * p, 2),
  27648. d = Math.pow(d, 2),
  27649. Math.sqrt(p * p + d * d)) : (1,
  27650. u.length()),
  27651. a[o.id] = n,
  27652. s = !0
  27653. }
  27654. s ? c[r.id] = a : h += 1
  27655. }
  27656. this.map = c,
  27657. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27658. }
  27659. ,
  27660. t.prototype.aStarSearch = function(e, t) {
  27661. var i = Date.now()
  27662. , n = new o({
  27663. start: e,
  27664. isEnd: function(e) {
  27665. return e === t
  27666. },
  27667. neighbor: function(e) {
  27668. var t = e.neighbourPanos || e.findNeighourPanos()
  27669. , i = [];
  27670. for (var n in t)
  27671. i.push(this.index[n]);
  27672. return i
  27673. }
  27674. .bind(this),
  27675. distance: function(e, t) {
  27676. return this.map[e.id][t.id]
  27677. }
  27678. .bind(this),
  27679. heuristic: function(e, t) {
  27680. return 1
  27681. }
  27682. .bind(this),
  27683. hash: function(e) {
  27684. return e.id
  27685. },
  27686. timeout: 5e3
  27687. });
  27688. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27689. "success" !== n.status)
  27690. return T.debug("Did not find A* path from " + e + " to " + t),
  27691. null;
  27692. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27693. var r = [];
  27694. return n.path.forEach(function(e) {
  27695. r.push(e.id)
  27696. }),
  27697. r
  27698. }
  27699. ,
  27700. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27701. g = new w.Vector3,
  27702. m = new w.Vector3,
  27703. v = new w.Vector3,
  27704. y = new w.Vector3,
  27705. A = new w.Vector3,
  27706. C = new w.Vector3,
  27707. I = new w.Vector3,
  27708. E = [],
  27709. _ = new w.Vector3,
  27710. b = new w.Vector3,
  27711. function(e, t) {
  27712. if (e)
  27713. for (var i = function(e, t, i) {
  27714. return y.copy(t).sub(e),
  27715. y.dot(i)
  27716. }, n = function(e, t) {
  27717. return i(_, e.position, m) - i(_, t.position, m)
  27718. }, r = 0; r < e.length - 1; ) {
  27719. var o = e[r]
  27720. , a = e[r + 1]
  27721. , s = this.index[o]
  27722. , l = this.index[a];
  27723. _.copy(s.position),
  27724. b.copy(l.position),
  27725. E.length = 0,
  27726. f.copy(b).sub(_),
  27727. m.copy(f).normalize();
  27728. for (var c = 0; c < this.list.length; c++) {
  27729. var h = this.list[c];
  27730. y.copy(h.position).sub(_);
  27731. var u = y.dot(m);
  27732. 0 < u && (C.copy(m),
  27733. C.multiplyScalar(u),
  27734. A.copy(y),
  27735. A.sub(C),
  27736. A.length() < t && (g.copy(f).negate(),
  27737. v.copy(g).normalize(),
  27738. I.copy(h.position).sub(b),
  27739. 0 < I.dot(v) && E.push(h)))
  27740. }
  27741. if (0 < E.length) {
  27742. E.sort(n);
  27743. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27744. e[d] = e[d - E.length];
  27745. for (var p = 0; p < E.length; p++)
  27746. e[p + r + 1] = E[p].id
  27747. }
  27748. r += E.length + 1
  27749. }
  27750. }
  27751. ),
  27752. t.prototype.fadeMarkerOpacity = function(e, t) {
  27753. var i = void 0 === e ? a.panorama.markerOpacity : e
  27754. , n = this.list.findIndex(function(e) {
  27755. return e.marker
  27756. });
  27757. if (!(n < 0)) {
  27758. var r = this.list[n].marker.material.opacity;
  27759. if (r !== e) {
  27760. var o = i - r;
  27761. s.trigger({
  27762. func: function(e, t) {
  27763. var i = r + e * o;
  27764. this.forEach(function(e) {
  27765. e.marker && (e.marker.material.opacity = i)
  27766. })
  27767. }
  27768. .bind(this),
  27769. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27770. name: "_fpm"
  27771. })
  27772. }
  27773. }
  27774. }
  27775. ,
  27776. c.exports = t
  27777. }
  27778. ).call(this, "/js/util/PanoramaCollection.js")
  27779. }
  27780. , {
  27781. "../objects/Panorama": 148,
  27782. "../settings": 166,
  27783. "./IndexedCollection": 175,
  27784. "./aStar": 180,
  27785. "./common": 185,
  27786. "./logger": 189,
  27787. "./transitions": 195,
  27788. three: 217
  27789. }],
  27790. 179: [function(e, t, i) {
  27791. "use strict";
  27792. function n() {
  27793. this.actionSequence = [],
  27794. this.actionSequenceInProgress = !1
  27795. }
  27796. function r(e, t, i, n) {
  27797. c.trackAlways("zoom_" + e, {
  27798. from: t,
  27799. to: i,
  27800. pano: n
  27801. })
  27802. }
  27803. var o, a, s, l, c = e("../analytics");
  27804. n.prototype.reset = function(e) {
  27805. this.actionSequenceInProgress = !1,
  27806. this.actionSequence.length = 0
  27807. }
  27808. ,
  27809. n.prototype.addZoomAction = (a = o = null,
  27810. s = !1,
  27811. l = function() {
  27812. if (o = null,
  27813. 0 < this.actionSequence.length) {
  27814. var e = this.actionSequence[0].start
  27815. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27816. 1 === e ? function(e, t) {
  27817. r("initial", 1, e, t)
  27818. }(t, a) : function(e, t, i) {
  27819. r("followup", e, t, i)
  27820. }(e, t, a)
  27821. }
  27822. this.reset()
  27823. }
  27824. ,
  27825. function(e, t, i) {
  27826. if (e !== t) {
  27827. s || (l = l.bind(this),
  27828. s = !0),
  27829. o && (window.clearTimeout(o),
  27830. o = null),
  27831. i === a && this.actionSequenceInProgress || (this.reset(),
  27832. a = i),
  27833. this.actionSequenceInProgress = !0;
  27834. var n = {
  27835. start: e,
  27836. end: t
  27837. };
  27838. this.actionSequence.push(n),
  27839. o = window.setTimeout(l, 150)
  27840. }
  27841. }
  27842. ),
  27843. t.exports = n
  27844. }
  27845. , {
  27846. "../analytics": 4
  27847. }],
  27848. 180: [function(e, t, i) {
  27849. "use strict";
  27850. function g(e) {
  27851. if (void 0 === e.parent)
  27852. return [e.data];
  27853. var t = g(e.parent);
  27854. return t.push(e.data),
  27855. t
  27856. }
  27857. function m(e) {
  27858. return e.toString()
  27859. }
  27860. function v(e, t) {
  27861. return e.f - t.f
  27862. }
  27863. var y = e("Set")
  27864. , A = e("heap")
  27865. , C = e("dict");
  27866. t.exports = function(e) {
  27867. void 0 === e.timeout && (e.timeout = 1 / 0);
  27868. var t = e.hash || m
  27869. , i = {
  27870. data: e.start,
  27871. g: 0,
  27872. h: e.heuristic(e.start)
  27873. }
  27874. , n = i;
  27875. i.f = i.h;
  27876. var r = new y
  27877. , o = new A(v)
  27878. , a = C();
  27879. o.push(i),
  27880. a.set(t(i.data), i);
  27881. for (var s = new Date; o.size(); ) {
  27882. if (new Date - s > e.timeout)
  27883. return {
  27884. status: "timeout",
  27885. cost: n.g,
  27886. path: g(n)
  27887. };
  27888. var l = o.pop();
  27889. if (a.delete(t(l.data)),
  27890. e.isEnd(l.data))
  27891. return {
  27892. status: "success",
  27893. cost: l.g,
  27894. path: g(l)
  27895. };
  27896. r.add(t(l.data));
  27897. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  27898. var u = c[h];
  27899. if (!r.contains(t(u))) {
  27900. var d = l.g + e.distance(l.data, u)
  27901. , p = a.get(t(u))
  27902. , f = !1;
  27903. if (void 0 === p)
  27904. p = {
  27905. data: u
  27906. },
  27907. a.set(t(u), p);
  27908. else {
  27909. if (p.g < d)
  27910. continue;
  27911. f = !0
  27912. }
  27913. p.parent = l,
  27914. p.g = d,
  27915. p.h = e.heuristic(u),
  27916. p.f = d + p.h,
  27917. p.h < n.h && (n = p),
  27918. f ? o.heapify() : o.push(p)
  27919. }
  27920. }
  27921. }
  27922. return {
  27923. status: "noPath",
  27924. cost: n.g,
  27925. path: g(n)
  27926. }
  27927. }
  27928. }
  27929. , {
  27930. Set: 196,
  27931. dict: 210,
  27932. heap: 211
  27933. }],
  27934. 181: [function(i, n, e) {
  27935. (function(e) {
  27936. "use strict";
  27937. function s(e, t, i) {
  27938. function n() {
  27939. l.warn("Retrying ", t),
  27940. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  27941. }
  27942. var r = function(e, t, i) {
  27943. var n = new XMLHttpRequest;
  27944. if (i && "withCredentials"in n)
  27945. n.open(e, t, i);
  27946. else if ("undefined" != typeof XDomainRequest)
  27947. (n = new XDomainRequest).open(e, t);
  27948. else {
  27949. if (i)
  27950. throw "Browser does not support CORS!";
  27951. n.open(e, t)
  27952. }
  27953. return n
  27954. }(e, t, !1);
  27955. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  27956. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27957. i.responseType)
  27958. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  27959. r.responseType = i.responseType;
  27960. else {
  27961. if ("image/jpeg" !== i.responseType)
  27962. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27963. r.responseType = "arraybuffer"
  27964. }
  27965. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  27966. i.auth && r.setRequestHeader("Authorization", i.auth),
  27967. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27968. r.setRequestHeader("Content-Type", "application/json")),
  27969. "object" == typeof i.headers)
  27970. for (var o in i.headers)
  27971. r.setRequestHeader(o, i.headers[o]);
  27972. var a = $.Deferred();
  27973. return r.onreadystatechange = function(e) {
  27974. if (4 === this.readyState)
  27975. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  27976. i.retries++,
  27977. setTimeout(n, 1e3);
  27978. else if (200 === this.status) {
  27979. var t = function(e, t) {
  27980. var i = e.response;
  27981. if ("json" === t && "object" != typeof i)
  27982. try {
  27983. i = JSON.parse(e.responseText)
  27984. } catch (e) {
  27985. return void a.reject({
  27986. error: "Failed parsing JSON"
  27987. })
  27988. }
  27989. else if ("image/jpeg" === t) {
  27990. var n = new Uint8Array(e.response)
  27991. , r = new Blob([n],{
  27992. type: "image/jpeg"
  27993. })
  27994. , o = URL.createObjectURL(r);
  27995. (i = new Image).src = o,
  27996. i.crossOrigin = "Anonymous",
  27997. i.onload = function() {
  27998. URL.revokeObjectURL(o)
  27999. }
  28000. }
  28001. return i
  28002. }(this, i.responseType);
  28003. a.resolve(t)
  28004. } else
  28005. a.reject(this)
  28006. }
  28007. ,
  28008. r.onprogress = function(e) {
  28009. a.notify(e)
  28010. }
  28011. ,
  28012. r.send(i.data),
  28013. a.promise()
  28014. }
  28015. function o(e, t) {
  28016. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28017. return t.headers && function(t) {
  28018. return Object.keys(t).sort().map(function(e) {
  28019. return {
  28020. key: e,
  28021. value: t[e]
  28022. }
  28023. })
  28024. }(t.headers).forEach(function(e) {
  28025. i += "__" + e.key + ":" + e.value
  28026. }),
  28027. i
  28028. }
  28029. var t = i("./logger")
  28030. , a = i("../ab")
  28031. , l = new t(e);
  28032. window.URL = window.URL || window.webkitURL,
  28033. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28034. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
  28035. n.exports = {
  28036. get: function(e, t) {
  28037. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28038. if (n) {
  28039. var r = function(e, t) {
  28040. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28041. }(e, t);
  28042. if (r)
  28043. return r
  28044. }
  28045. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
  28046. n && function(e, t, i) {
  28047. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28048. }(e, t, i),
  28049. i
  28050. },
  28051. post: function(e, t) {
  28052. return s("POST", e, t)
  28053. },
  28054. patch: function(e, t) {
  28055. return s("PATCH", e, t)
  28056. },
  28057. getImage: function(e, t) {
  28058. function i() {
  28059. l.warn("Retrying ", e),
  28060. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28061. }
  28062. var n = $.Deferred()
  28063. , r = new Image
  28064. , o = this;
  28065. return e = a.changeIfImageOptimzing(e),
  28066. null != t || (t = 3),
  28067. r.onerror = function() {
  28068. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28069. }
  28070. ,
  28071. r.onload = function() {
  28072. n.resolve(r)
  28073. }
  28074. ,
  28075. r.crossOrigin = "anonymous",
  28076. r.src = e,
  28077. n
  28078. }
  28079. }
  28080. }
  28081. ).call(this, "/js/util/ajax.js")
  28082. }
  28083. , {
  28084. "../ab": 3,
  28085. "./logger": 189
  28086. }],
  28087. 182: [function(e, t, i) {
  28088. "use strict";
  28089. function n(e, t) {
  28090. var i = window.navigator.userAgent.match(e);
  28091. return i = i ? i[1].split(t) : [],
  28092. {
  28093. major: parseInt(i[0]) || 0,
  28094. minor: parseInt(i[1]) || 0,
  28095. patch: parseInt(i[2]) || 0
  28096. }
  28097. }
  28098. var r = e("../exception/DeviceMismatchException");
  28099. t.exports = {
  28100. isFullscreen: function() {
  28101. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28102. },
  28103. supportsFullscreen: function() {
  28104. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28105. },
  28106. isPointerLocked: function() {
  28107. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28108. },
  28109. requestFullscreen: function(e, t) {
  28110. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28111. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28112. },
  28113. requestPointerLock: function() {
  28114. var e;
  28115. if (document.fullscreenElement)
  28116. e = document.fullscreenElement();
  28117. else if (document.mozFullscreenElement)
  28118. e = document.mozFullscreenElement();
  28119. else if (document.mozFullScreenElement)
  28120. e = document.mozFullScreenElement();
  28121. else {
  28122. if (!document.webkitFullscreenElement)
  28123. return;
  28124. e = document.webkitFullscreenElement()
  28125. }
  28126. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28127. e.requestPointerLock(),
  28128. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28129. },
  28130. exitPointerLock: function() {
  28131. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28132. document.exitPointerLock()
  28133. },
  28134. exitFullscreen: function() {
  28135. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28136. },
  28137. details: function() {
  28138. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28139. return e ? {
  28140. name: e[1],
  28141. version: parseInt(e[2]),
  28142. platform: navigator.platform
  28143. } : {}
  28144. },
  28145. is: function(e) {
  28146. return this.details() && this.details().name === e
  28147. },
  28148. inIframe: function() {
  28149. return window.parent !== window
  28150. },
  28151. aspectRatio: function() {
  28152. var e = $("#player").width() / $("#player").height();
  28153. return isFinite(e) ? e : 0
  28154. },
  28155. userAgent: function() {
  28156. return window.navigator.userAgent
  28157. },
  28158. isMobile: function() {
  28159. var e = navigator.userAgent || navigator.vendor || window.opera;
  28160. 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))
  28161. },
  28162. isLandscape: function() {
  28163. return this.isMobile && 1 < this.aspectRatio()
  28164. },
  28165. isSmallScreen: function() {
  28166. return screen.width / window.devicePixelRatio < 240
  28167. },
  28168. detectIE: function() {
  28169. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28170. },
  28171. detectSafari: function() {
  28172. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28173. },
  28174. detectFirefox: function() {
  28175. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28176. },
  28177. detectChrome: function() {
  28178. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28179. },
  28180. detectOpera: function() {
  28181. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28182. },
  28183. detectIOS: function() {
  28184. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28185. },
  28186. detectIPad: function() {
  28187. var e = window.navigator.userAgent;
  28188. return /iPad/.test(e)
  28189. },
  28190. detectIPod: function() {
  28191. var e = window.navigator.userAgent;
  28192. return /iPod/.test(e)
  28193. },
  28194. detectIPhone: function() {
  28195. var e = window.navigator.userAgent;
  28196. return /iPhone/.test(e)
  28197. },
  28198. detectAndroid: function() {
  28199. return -1 !== window.navigator.userAgent.indexOf("Android")
  28200. },
  28201. detectAndroidMobile: function() {
  28202. var e = window.navigator.userAgent;
  28203. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28204. },
  28205. detectSamsungNative: function() {
  28206. var e = window.navigator.userAgent;
  28207. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28208. },
  28209. detectSamsungS6: function() {
  28210. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28211. },
  28212. detectHUAWEI5X: function() {
  28213. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28214. },
  28215. detectWebVR: function() {
  28216. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28217. },
  28218. getVRDisplay: function() {
  28219. var t = $.Deferred();
  28220. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28221. 1 <= e.length && t.resolve(e[0]),
  28222. t.reject(null)
  28223. }),
  28224. t) : t.reject(null)
  28225. },
  28226. iosVersion: function() {
  28227. if (!this.detectIOS())
  28228. throw new r("Did not detect an iDevice");
  28229. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28230. },
  28231. androidVersion: function() {
  28232. if (!this.detectAndroid())
  28233. throw new r("Did not detect an Android based device");
  28234. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28235. },
  28236. valueFromCookie: function(e, t) {
  28237. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28238. if (!i)
  28239. return t;
  28240. var n = i[1];
  28241. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28242. },
  28243. valueFromHash: function(e, t) {
  28244. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28245. if (!i)
  28246. return t;
  28247. var n = i[1];
  28248. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28249. }
  28250. }
  28251. }
  28252. , {
  28253. "../exception/DeviceMismatchException": 56
  28254. }],
  28255. 183: [function(i, n, e) {
  28256. (function(e) {
  28257. "use strict";
  28258. var o = i("../controls/serializer")
  28259. , a = i("../util/math")
  28260. , s = i("./browser")
  28261. , l = i("../enum/Viewmode")
  28262. , t = i("../util/logger")
  28263. , c = i("three")
  28264. , h = new t(e);
  28265. n.exports = {
  28266. getStartCameraOptions: function(e, t) {
  28267. var i = function(e) {
  28268. var t = s.valueFromHash("start", "")
  28269. , i = {};
  28270. if ("" !== t) {
  28271. h.debug("Start override found in parameters, trying to parse..."),
  28272. i = function(e) {
  28273. return o.deserialize(e)
  28274. }(t) || {};
  28275. var n = s.valueFromHash("tag", null);
  28276. n && (i.tag = n),
  28277. i.panoId && (i.pano = e.get(i.panoId))
  28278. }
  28279. return i
  28280. }(t);
  28281. if (0 < Object.keys(i).length)
  28282. return i;
  28283. if (e.heroImage)
  28284. i = function(e, t) {
  28285. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28286. return {};
  28287. var i = {}
  28288. , n = e.heroImage.metadata;
  28289. h.debug("Using start position from thumbnail image"),
  28290. i.position = n.camera_position,
  28291. i.quaternion = n.camera_quaternion;
  28292. try {
  28293. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28294. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28295. } catch (e) {
  28296. h.debug(e.message)
  28297. }
  28298. return i
  28299. }(e, t);
  28300. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  28301. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  28302. try {
  28303. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28304. i.position = (new c.Vector3).fromArray(n.camera.position),
  28305. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28306. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28307. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28308. h.debug("Using camera_start"),
  28309. h.debug("Modeldata pano: ", i.pano.quaternion),
  28310. h.debug("Camera start pano: ", n.pano.quaternion)),
  28311. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28312. } catch (e) {
  28313. h.warn(e.message)
  28314. if(i.mode == "panorama" && !i.pano){
  28315. i.pano = t.list[0]
  28316. }
  28317. }
  28318. }
  28319. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28320. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28321. i.pano = t.findClosest(i.position) ,
  28322. i.quaternion = i.pano.quaternion),
  28323. 0 === Object.keys(i).length) {
  28324. var r = t.list[0];
  28325. r && (i.mode = l.PANORAMA,
  28326. i.pano = r,
  28327. i.position = r.position,
  28328. i.quaternion = r.quaternion,
  28329. h.info("Starting at 1st pano " + r.id))
  28330. }
  28331. return i.mode = i.mode || l.DOLLHOUSE,
  28332. i
  28333. }
  28334. }
  28335. }
  28336. ).call(this, "/js/util/camera.js")
  28337. }
  28338. , {
  28339. "../controls/serializer": 14,
  28340. "../enum/Viewmode": 51,
  28341. "../util/logger": 189,
  28342. "../util/math": 190,
  28343. "./browser": 182,
  28344. three: 217
  28345. }],
  28346. 184: [function(e, t, i) {
  28347. "use strict";
  28348. function r(e, t, i) {
  28349. var n = t
  28350. , r = i;
  28351. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28352. }
  28353. function o(e, t, i) {
  28354. var n = t
  28355. , r = i;
  28356. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28357. }
  28358. var a = e("./MathLight");
  28359. t.exports = {
  28360. clampVFOV: function(e, t, i, n) {
  28361. return t < r(e, i, n) ? o(t, i, n) : e
  28362. },
  28363. getHFOVForCamera: function(e, t, i) {
  28364. return r(e.fov, t, i)
  28365. },
  28366. getHFOVFromVFOV: r,
  28367. getVFOVFromHFOV: o
  28368. }
  28369. }
  28370. , {
  28371. "./MathLight": 176
  28372. }],
  28373. 185: [function(e, t, i) {
  28374. "use strict";
  28375. var a = e("three");
  28376. t.exports = {
  28377. delayOneFrame: function(e) {
  28378. window.setTimeout(e, 1)
  28379. },
  28380. normalizeUrl: function(e) {
  28381. return e.replace("https://", "http://")
  28382. },
  28383. domainFromUrl: function(e) {
  28384. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28385. return t ? t[3] : e
  28386. },
  28387. average: function(e, t) {
  28388. if (0 === e.length)
  28389. return null;
  28390. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28391. i += t ? e[r][t] : e[r],
  28392. n++
  28393. }
  28394. return i / n
  28395. },
  28396. countUnique: function(e) {
  28397. for (var t = {}, i = 0; i < e.length; i++)
  28398. t[e[i]] = 1 + (t[e[i]] || 0);
  28399. return Object.keys(t).length
  28400. },
  28401. averageVectors: function(e, t) {
  28402. var i = new a.Vector3;
  28403. if (0 === e.length)
  28404. return i;
  28405. for (var n = 0, r = 0; r < e.length; r++) {
  28406. var o = t ? e[r][t] : e[r];
  28407. i.add(o),
  28408. n++
  28409. }
  28410. return i.divideScalar(n)
  28411. },
  28412. equalLists: function(e, t) {
  28413. if (e.length !== t.length)
  28414. return !1;
  28415. for (var i = 0; i < e.length; i++)
  28416. if (e[i] !== t[i])
  28417. return !1;
  28418. return !0
  28419. },
  28420. lowerMedian: function(e, t) {
  28421. return 0 === e.length ? null : (t = t || 2,
  28422. e.sort(function(e, t) {
  28423. return e - t
  28424. }),
  28425. e[Math.floor(e.length / t)])
  28426. },
  28427. stableSort: function(e, n) {
  28428. return e.map(function(e, t) {
  28429. return {
  28430. value: e,
  28431. index: t
  28432. }
  28433. }).sort(function(e, t) {
  28434. var i = n(e.value, t.value);
  28435. return 0 !== i ? i : e.index - t.index
  28436. }).map(function(e) {
  28437. return e.value
  28438. })
  28439. },
  28440. filterAll: function(e, i) {
  28441. return e.filter(function(t) {
  28442. return i.every(function(e) {
  28443. return e(t)
  28444. })
  28445. })
  28446. },
  28447. formatDate: function(e) {
  28448. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28449. },
  28450. formatDatetime: function(e) {
  28451. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28452. },
  28453. randomString: function(e) {
  28454. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28455. t += i.charAt(Math.floor(Math.random() * i.length));
  28456. return t
  28457. },
  28458. uint8ToBase64: function(e, t) {
  28459. t && "number" == typeof t || (t = 8192);
  28460. for (var i = [], n = 0; n < e.length; n += t)
  28461. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28462. return btoa(i.join(""))
  28463. },
  28464. uuid4: function e(t) {
  28465. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28466. },
  28467. nth: function(e) {
  28468. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28469. },
  28470. extendObject: function(t, i) {
  28471. return Object.keys(i).forEach(function(e) {
  28472. t[e] = i[e]
  28473. }),
  28474. t
  28475. },
  28476. deepExtend: function e(t) {
  28477. t = t || {};
  28478. for (var i = 1; i < arguments.length; i++) {
  28479. var n = arguments[i];
  28480. if (n)
  28481. for (var r in n)
  28482. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28483. }
  28484. return t
  28485. },
  28486. inherit: function(e, t) {
  28487. e.prototype = Object.create(t.prototype),
  28488. e.prototype.constructor = e
  28489. },
  28490. extend: function(e, t) {
  28491. for (var i in t.prototype)
  28492. e.prototype[i] = t.prototype[i]
  28493. }
  28494. },
  28495. Math.sign = function(e) {
  28496. return e < 0 ? -1 : 1
  28497. }
  28498. }
  28499. , {
  28500. three: 217
  28501. }],
  28502. 186: [function(e, t, i) {
  28503. "use strict";
  28504. var r = {
  28505. linearTween: function(e, t, i, n) {
  28506. return i * e / n + t
  28507. },
  28508. easeInQuad: function(e, t, i, n) {
  28509. return i * (e /= n) * e + t
  28510. },
  28511. easeOutQuad: function(e, t, i, n) {
  28512. return -i * (e /= n) * (e - 2) + t
  28513. },
  28514. easeInOutQuad: function(e, t, i, n) {
  28515. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28516. },
  28517. easeInCubic: function(e, t, i, n) {
  28518. return i * (e /= n) * e * e + t
  28519. },
  28520. easeOutCubic: function(e, t, i, n) {
  28521. return e /= n,
  28522. i * (--e * e * e + 1) + t
  28523. },
  28524. easeInOutCubic: function(e, t, i, n) {
  28525. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28526. },
  28527. easeInQuart: function(e, t, i, n) {
  28528. return i * (e /= n) * e * e * e + t
  28529. },
  28530. easeOutQuart: function(e, t, i, n) {
  28531. return e /= n,
  28532. -i * (--e * e * e * e - 1) + t
  28533. },
  28534. easeInOutQuart: function(e, t, i, n) {
  28535. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28536. },
  28537. easeInQuint: function(e, t, i, n) {
  28538. return i * (e /= n) * e * e * e * e + t
  28539. },
  28540. easeOutQuint: function(e, t, i, n) {
  28541. return e /= n,
  28542. i * (--e * e * e * e * e + 1) + t
  28543. },
  28544. easeInOutQuint: function(e, t, i, n) {
  28545. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28546. },
  28547. easeInSine: function(e, t, i, n) {
  28548. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28549. },
  28550. easeOutSine: function(e, t, i, n) {
  28551. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28552. },
  28553. easeInOutSine: function(e, t, i, n) {
  28554. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28555. },
  28556. easeInExpo: function(e, t, i, n) {
  28557. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28558. },
  28559. easeOutExpo: function(e, t, i, n) {
  28560. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28561. },
  28562. easeInOutExpo: function(e, t, i, n) {
  28563. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28564. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28565. },
  28566. easeInCirc: function(e, t, i, n) {
  28567. return e /= n,
  28568. -i * (Math.sqrt(1 - e * e) - 1) + t
  28569. },
  28570. easeOutCirc: function(e, t, i, n) {
  28571. return e /= n,
  28572. e--,
  28573. i * Math.sqrt(1 - e * e) + t
  28574. },
  28575. easeInOutCirc: function(e, t, i, n) {
  28576. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28577. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28578. },
  28579. easeInElastic: function(e, t, i, n) {
  28580. var r = 1.70158
  28581. , o = 0
  28582. , a = i;
  28583. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28584. r = a < Math.abs(i) ? (a = i,
  28585. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28586. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28587. },
  28588. easeOutElastic: function(e, t, i, n) {
  28589. var r = 1.70158
  28590. , o = 0
  28591. , a = i;
  28592. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28593. r = a < Math.abs(i) ? (a = i,
  28594. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28595. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28596. },
  28597. easeInOutElastic: function(e, t, i, n) {
  28598. var r = 1.70158
  28599. , o = 0
  28600. , a = i;
  28601. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28602. r = a < Math.abs(i) ? (a = i,
  28603. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28604. 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)
  28605. },
  28606. easeInBack: function(e, t, i, n, r) {
  28607. return void 0 === r && (r = 1.70158),
  28608. i * (e /= n) * e * ((r + 1) * e - r) + t
  28609. },
  28610. easeOutBack: function(e, t, i, n, r) {
  28611. return void 0 === r && (r = 1.70158),
  28612. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28613. },
  28614. easeInOutBack: function(e, t, i, n, r) {
  28615. return void 0 === r && (r = 1.70158),
  28616. (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
  28617. },
  28618. easeOutBounce: function(e, t, i, n) {
  28619. 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
  28620. },
  28621. easeInBounce: function(e, t, i, n) {
  28622. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28623. },
  28624. easeInOutBounce: function(e, t, i, n) {
  28625. 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
  28626. }
  28627. };
  28628. t.exports = r
  28629. }
  28630. , {}],
  28631. 187: [function(e, t, i) {
  28632. "use strict";
  28633. function n() {
  28634. this.events = [],
  28635. this.valid = !1
  28636. }
  28637. var r = e("../enum/Joystick");
  28638. n.prototype.push = function(e, t) {
  28639. this.events.push({
  28640. direction: e,
  28641. pano: t
  28642. }),
  28643. this.valid = !0
  28644. }
  28645. ,
  28646. n.prototype.pop = function(e) {
  28647. var t = this.events.pop();
  28648. return this.events.length < 1 && (this.valid = !1),
  28649. t
  28650. }
  28651. ,
  28652. n.prototype.peek = function() {
  28653. return this.events.length ? this.events[this.events.length - 1] : {
  28654. direction: null,
  28655. pano: null
  28656. }
  28657. }
  28658. ,
  28659. n.prototype.invalidate = function() {
  28660. this.events = [],
  28661. this.valid = !1
  28662. }
  28663. ,
  28664. n.prototype.reversePano = function(e) {
  28665. if (!this.valid)
  28666. return null;
  28667. var t = this.peek();
  28668. return r.opposite(e) === t.direction ? (this.pop(),
  28669. t.pano) : null
  28670. }
  28671. ,
  28672. t.exports = n
  28673. }
  28674. , {
  28675. "../enum/Joystick": 29
  28676. }],
  28677. 188: [function(e, t, i) {
  28678. "use strict";
  28679. t.exports = {
  28680. vector: function(t, i) {
  28681. var n = t.clone();
  28682. return i = i.clone(),
  28683. function(e) {
  28684. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28685. }
  28686. },
  28687. quaternion: function(t, i) {
  28688. var n = t.clone();
  28689. return function(e) {
  28690. t.copy(n).slerp(i, e)
  28691. }
  28692. },
  28693. property: function(t, i, n, r) {
  28694. var o = t[i];
  28695. return function(e) {
  28696. t[i] = o * (1 - e) + n * e,
  28697. r && r(t[i])
  28698. }
  28699. },
  28700. uniform: function(t, i, n) {
  28701. var r = t.material.uniforms[i].value;
  28702. return function(e) {
  28703. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28704. }
  28705. },
  28706. matrix4: function(o, a) {
  28707. var s = o.clone();
  28708. return function(e) {
  28709. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28710. t[r] = i[r] * (1 - e) + n[r] * e
  28711. }
  28712. },
  28713. allUniforms: function(e, t, i) {
  28714. var n = e.map(function(e) {
  28715. return this.uniform(e, t, i)
  28716. }
  28717. .bind(this));
  28718. return function(t) {
  28719. n.forEach(function(e) {
  28720. e(t)
  28721. })
  28722. }
  28723. }
  28724. }
  28725. }
  28726. , {}],
  28727. 189: [function(e, t, i) {
  28728. "use strict";
  28729. function h(n) {
  28730. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28731. if (h.consoleEnabled) {
  28732. var l = function(e) {
  28733. $("#debug-console").append("<p>" + e + "</p>"),
  28734. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28735. };
  28736. e = function(e) {
  28737. l(Array.prototype.slice.call(arguments).join(" "))
  28738. }
  28739. ,
  28740. t = function(e) {
  28741. l(Array.prototype.slice.call(arguments).join(" "))
  28742. }
  28743. ,
  28744. i = function(e) {
  28745. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28746. }
  28747. ,
  28748. r = function(e) {
  28749. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28750. }
  28751. } else
  28752. console.log ? (e = console.log,
  28753. t = console.info ? console.info : console.log,
  28754. i = console.warn ? console.warn : console.log,
  28755. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28756. ;
  28757. function c(e) {
  28758. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28759. }
  28760. return {
  28761. debug: function() {
  28762. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28763. },
  28764. info: function() {
  28765. h.level >= h.levels.info && t.apply(console, c(arguments))
  28766. },
  28767. warn: function() {
  28768. (function(e, t) {
  28769. if (u) {
  28770. var i = Array.prototype.slice.call(e).join(" ");
  28771. u.captureMessage(i, {
  28772. level: t,
  28773. path: n,
  28774. timestamp: h.timestamp()
  28775. })
  28776. }
  28777. }
  28778. )(arguments, "warn"),
  28779. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28780. },
  28781. error: function() {
  28782. (function(e, t) {
  28783. if (u) {
  28784. var i = Array.prototype.slice.call(e).join(" ");
  28785. u.captureException(new Error(i), {
  28786. level: t,
  28787. path: n,
  28788. timestamp: h.timestamp()
  28789. })
  28790. }
  28791. }
  28792. )(arguments, "error"),
  28793. h.level >= h.levels.error && r.apply(console, c(arguments))
  28794. },
  28795. v3str: function(e, t) {
  28796. var i = void 0 === t ? 2 : t;
  28797. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28798. },
  28799. eulstr: function(e, t) {
  28800. var i = void 0 === t ? 2 : t;
  28801. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28802. },
  28803. time: function(e) {
  28804. h.level >= h.levels.debug && (s[e] = Date.now())
  28805. },
  28806. timeEnd: function(e) {
  28807. if (h.level >= h.levels.debug) {
  28808. var t = s[e];
  28809. if (!t)
  28810. return;
  28811. var i = (Date.now() - t) / 1e3;
  28812. this.debug(e, i + "s")
  28813. }
  28814. }
  28815. }
  28816. }
  28817. var u = window.Raven;
  28818. h.timestamp = function() {
  28819. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28820. }
  28821. ,
  28822. h.level = (h.levels = {
  28823. debug: 3,
  28824. info: 2,
  28825. warn: 1,
  28826. error: 0
  28827. }).info,
  28828. t.exports = h
  28829. }
  28830. , {}],
  28831. 190: [function(e, t, i) {
  28832. "use strict";
  28833. var o = e("three")
  28834. , r = e("../enum/GLCubeFaces");
  28835. e("../constants");
  28836. t.exports = {
  28837. convertVisionVector: function(e) {
  28838. return new o.Vector3(e.x,e.z,-e.y)
  28839. },
  28840. convertVisionQuaternion: function(e) {
  28841. 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)))
  28842. },
  28843. convertWorkshopVector: function(e) {
  28844. return new o.Vector3(-e.x,e.y,e.z)
  28845. },
  28846. convertWorkshopQuaternion: function(e) {
  28847. 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))
  28848. },
  28849. convertWorkshopPanoramaQuaternion: function(e) {
  28850. 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)))
  28851. },
  28852. convertWorkshopOrthoZoom: function(e) {
  28853. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  28854. },
  28855. toPrecision: function(e, t) {
  28856. function i(e, t) {
  28857. var i = Math.pow(10, t);
  28858. return Math.round(e * i) / i
  28859. }
  28860. if (e instanceof Array) {
  28861. for (var n = 0; n < e.length; n++)
  28862. e[n] = i(e[n], t);
  28863. return e
  28864. }
  28865. return i(e, t)
  28866. },
  28867. isEmptyQuaternion: function(e) {
  28868. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28869. },
  28870. projectPositionToCanvas: function(e, t, i) {
  28871. (i = i || new o.Vector3).copy(e);
  28872. var n = .5 * $("#player").width()
  28873. , r = .5 * $("#player").height();
  28874. return i.project(t),
  28875. i.x = i.x * n + n,
  28876. i.y = -i.y * r + r,
  28877. i
  28878. },
  28879. convertScreenPositionToNDC: function(e, t, i) {
  28880. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  28881. i.y = -t / $("#player").height() * 2 + 1,
  28882. i
  28883. },
  28884. constrainedTurn: function(e) {
  28885. var t = e % (2 * Math.PI);
  28886. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28887. },
  28888. getFOVDotThreshold: function(e) {
  28889. return Math.cos(o.Math.degToRad(e / 2))
  28890. },
  28891. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28892. switch (e) {
  28893. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28894. i.set(1, t.y, t.x);
  28895. break;
  28896. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28897. i.set(-1, t.y, -t.x);
  28898. break;
  28899. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28900. i.set(-t.x, 1, -t.y);
  28901. break;
  28902. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28903. i.set(-t.x, -1, t.y);
  28904. break;
  28905. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28906. i.set(-t.x, t.y, 1);
  28907. break;
  28908. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28909. i.set(t.x, t.y, -1)
  28910. }
  28911. n && i.normalize()
  28912. },
  28913. //add:
  28914. getPos2d : function(point, camera, dom){
  28915. var camera = camera ;
  28916. var dom = dom;
  28917. 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);
  28918. var x,y;
  28919. x = (pos.x + 1) / 2 * dom.clientWidth;
  28920. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  28921. var inSight = x <= dom.clientWidth && x >= 0
  28922. && y <= dom.clientHeight && y >= 0
  28923. return {
  28924. pos: new THREE.Vector2(x,y),
  28925. vector: pos,
  28926. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  28927. inSight : inSight //在屏幕范围内可见
  28928. };
  28929. },
  28930. }
  28931. }
  28932. , {
  28933. "../constants": 8,
  28934. "../enum/GLCubeFaces": 25,
  28935. three: 217
  28936. }],
  28937. 191: [function(e, t, i) {
  28938. "use strict";
  28939. function o(e) {
  28940. return r[e]
  28941. }
  28942. var n = e("../enum/GLCubeFaces")
  28943. , a = [0, 1, 2, 3, 4, 5]
  28944. , r = {
  28945. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28946. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28947. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28948. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28949. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28950. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28951. };
  28952. t.exports = {
  28953. mapFaceToCubemapFace: o,
  28954. getCubemapUrls: function(i, n, r) {
  28955. return a.map(function(e, t) {
  28956. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  28957. }
  28958. .bind(this))
  28959. }
  28960. }
  28961. }
  28962. , {
  28963. "../enum/GLCubeFaces": 25
  28964. }],
  28965. 192: [function(e, t, i) {
  28966. "use strict";
  28967. t.exports = {
  28968. captureErrors: function(e, t, i) {
  28969. if ("Raven"in window) {
  28970. Raven.config(e, t).install(),
  28971. i && Raven.setTagsContext(i);
  28972. var n = console.warn
  28973. , r = console.error;
  28974. console.warn = function() {
  28975. var e = Array.prototype.slice.call(arguments);
  28976. Raven.captureMessage(e.join(" "), {
  28977. level: "warning"
  28978. }),
  28979. n.apply(console, e)
  28980. }
  28981. ,
  28982. console.error = function() {
  28983. var e = Array.prototype.slice.call(arguments);
  28984. Raven.captureException(new Error(e.join(" ")), {
  28985. level: "error"
  28986. }),
  28987. r.apply(console, e)
  28988. }
  28989. } else
  28990. console.error("Raven not found, not capturing errors.")
  28991. }
  28992. }
  28993. }
  28994. , {}],
  28995. 193: [function(c, h, e) {
  28996. (function(e) {
  28997. "use strict";
  28998. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  28999. getAuthorizationHeader: function() {
  29000. var e = n.valueFromHash("auth");
  29001. if (e)
  29002. return e.replace(",", " ");
  29003. var t = n.valueFromCookie("token");
  29004. return t ? "Token " + t : null
  29005. },
  29006. parseSidUrl: function(e) {
  29007. var t, i;
  29008. if (t = g_Prefix,
  29009. (e = e || "").match(/^https?/)) {
  29010. o.parse(e);
  29011. t = g_Prefix,
  29012. i = e
  29013. } else
  29014. i = (t = g_Prefix) + "data/" + e;
  29015. return {
  29016. urlBase: t,
  29017. urlModel: i,
  29018. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29019. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29020. }
  29021. },
  29022. getModelIDFromQueryString: function() {
  29023. return n.valueFromHash("model") || n.valueFromHash("m")
  29024. },
  29025. /* normalizeModeldata: function(e, i) {
  29026. e = JSON.parse(JSON.stringify(e));
  29027. var n = null;
  29028. if (e.images.forEach(function(t) {
  29029. if (t.metadata) {
  29030. if ("string" == typeof t.metadata)
  29031. try {
  29032. t.metadata = JSON.parse(t.metadata)
  29033. } catch (e) {
  29034. s.warn("Unable to parse image metadata"),
  29035. t.metadata = null
  29036. }
  29037. else
  29038. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29039. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29040. 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)),
  29041. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29042. t.metadata.zoom = t.metadata.zoom || 1),
  29043. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29044. }
  29045. }),
  29046. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29047. var t = {};
  29048. t.pano = {
  29049. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29050. position: i.convertWorkshopVector(n.scan_position),
  29051. uuid: n.scan_id
  29052. },
  29053. t.camera = {
  29054. quaternion: n.camera_quaternion,
  29055. position: n.camera_position
  29056. },
  29057. e.startPano = t
  29058. }
  29059. return e
  29060. }, */
  29061. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29062. e = JSON.parse(JSON.stringify(e));
  29063. var i = null;
  29064. if (e.images.forEach(function(n) {
  29065. if(!n.metadata) return;
  29066. if ("string" == typeof n.metadata)
  29067. try {
  29068. n.metadata = JSON.parse(n.metadata)
  29069. } catch (e) {
  29070. s.warn("Unable to parse image metadata"),
  29071. n.metadata = null
  29072. }
  29073. else{
  29074. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29075. }
  29076. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29077. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29078. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29079. }else{
  29080. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29081. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29082. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29083. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29084. }
  29085. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29086. }),
  29087. //icon初始视角的:
  29088. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29089. var n = {};
  29090. n.pano = {
  29091. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29092. position: t.convertWorkshopVector(i.scan_position),
  29093. uuid: i.scan_id
  29094. },
  29095. n.camera = {
  29096. quaternion: i.camera_quaternion,
  29097. position: i.camera_position
  29098. },
  29099. e.startPano = n
  29100. }
  29101. return e
  29102. },
  29103. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29104. function(e) {
  29105. if (!e)
  29106. throw new Error("Vision version is required");
  29107. var t = i.exec(e);
  29108. if (null === t)
  29109. throw new Error("String is not a vision version: " + e);
  29110. return parseInt(t[1])
  29111. }
  29112. ),
  29113. modelDataPromisesTiles: function(e) {
  29114. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  29115. if (t)
  29116. try {
  29117. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29118. } catch (e) {
  29119. s.warn("Invalid vision version: " + t)
  29120. }
  29121. return !1
  29122. }
  29123. };
  29124. h.exports = l
  29125. }
  29126. ).call(this, "/js/util/showcase.js")
  29127. }
  29128. , {
  29129. "../constants": 8,
  29130. "./browser": 182,
  29131. "./logger": 189,
  29132. three: 217,
  29133. url: 208
  29134. }],
  29135. 194: [function(e, t, i) {
  29136. "use strict";
  29137. var r = e("../util/ajax")
  29138. , o = e("three")
  29139. , a = e("../settings")
  29140. , s = {};
  29141. t.exports = {
  29142. load: function(e, t, i) {
  29143. var n = s[e];
  29144. return n ? t && setTimeout(function() {
  29145. t(n)
  29146. }, 1) : (n = new o.Texture,
  29147. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29148. n.magFilter = o.LinearFilter,
  29149. n.generateMipmaps = !1),
  29150. n.sourceFile = e,
  29151. s[e] = n,
  29152. r.getImage(e).then(function(e) {
  29153. n.image = e,
  29154. n.needsUpdate = !0,
  29155. t && t(n)
  29156. }).fail(i)),
  29157. n
  29158. },
  29159. loadBase64: function(e, t) {
  29160. t = t || "png";
  29161. var i = new o.Texture;
  29162. return i.image = document.createElement("img"),
  29163. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29164. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29165. i.magFilter = o.LinearFilter,
  29166. i.generateMipmaps = !1),
  29167. i.needsUpdate = !0,
  29168. i
  29169. },
  29170. isLoaded: function(e) {
  29171. return !!s[e]
  29172. }
  29173. }
  29174. window.Texture = t.exports
  29175. }
  29176. , {
  29177. "../settings": 166,
  29178. "../util/ajax": 181,
  29179. three: 217
  29180. }],
  29181. 195: [function(e, t, i) {
  29182. "use strict";
  29183. var l = e("./easing");
  29184. t.exports = {
  29185. globalDone: null,
  29186. funcs: [],
  29187. counter: 0,
  29188. uniqueID: 0,
  29189. start: function(e, t, i, n, r, o, a) {
  29190. return n = n || 0,
  29191. this.funcs.push({
  29192. func: e,
  29193. current: -n * Math.abs(t),
  29194. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29195. done: i,
  29196. easing: r || l.linearTween,
  29197. cycling: t < 0,
  29198. running: !0,
  29199. debug: n < 0,
  29200. name: o || "T" + this.counter,
  29201. id: void 0 === a ? this.counter : a,
  29202. paused: !1
  29203. }),
  29204. e(0, 16),
  29205. this.counter += 1,
  29206. e
  29207. },
  29208. trigger: function(e) {
  29209. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29210. , i = e.func || function() {}
  29211. , n = void 0 === e.duration ? 0 : e.duration;
  29212. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29213. var r = e.done || null
  29214. , o = e.easing || l.linearTween
  29215. , a = e.name || "R" + this.counter
  29216. , s = void 0 === e.id ? this.counter : e.id;
  29217. return this.start(i, n, r, t, o, a, s)
  29218. },
  29219. setTimeout: function(e, t, i) {
  29220. var n = void 0 === i ? this.counter : i;
  29221. return this.trigger({
  29222. done: e,
  29223. duration: void 0 === t ? 0 : t,
  29224. name: "O" + this.counter,
  29225. id: n
  29226. })
  29227. },
  29228. pause: function() {
  29229. this.paused = !0
  29230. },
  29231. resume: function() {
  29232. this.paused = !1
  29233. },
  29234. update: function(n) {
  29235. this.funcs.forEach(function(e) {
  29236. if (!(e.paused || (e.current += 1e3 * n,
  29237. e.current < 0)))
  29238. if (e.current >= e.duration && !e.cycling) {
  29239. var t = e.easing(1, 0, 1, 1);
  29240. e.func(t, 1e3 * n),
  29241. e.done && e.done(),
  29242. e.running = !1
  29243. } else {
  29244. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29245. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29246. e.running = !1)
  29247. }
  29248. });
  29249. var e = this.funcs.length;
  29250. this.funcs = this.funcs.filter(function(e) {
  29251. return e.running
  29252. });
  29253. var t = this.funcs.length;
  29254. if (0 < e && 0 === t && this.globalDone) {
  29255. var i = this.globalDone;
  29256. this.globalDone = null,
  29257. i()
  29258. }
  29259. },
  29260. adjustSpeed: function(e, t) {
  29261. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29262. var r = i[n];
  29263. r.duration /= t,
  29264. r.current /= t
  29265. }
  29266. },
  29267. getById: function(t) {
  29268. return this.funcs.filter(function(e) {
  29269. return t === e.id
  29270. })
  29271. },
  29272. get: function(e) {
  29273. for (var t = 0; t < this.funcs.length; t += 1)
  29274. if (this.funcs[t].func === e)
  29275. return this.funcs[t];
  29276. return null
  29277. },
  29278. isRunning: function(e) {
  29279. var t = this.get(e);
  29280. return null !== t && t.running
  29281. },
  29282. countActive: function() {
  29283. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29284. e += this.funcs[t].running;
  29285. return e
  29286. },
  29287. listActive: function() {
  29288. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29289. this.funcs[t].running && e.push(this.funcs[t].name);
  29290. return e
  29291. },
  29292. done: function(e) {
  29293. this.globalDone = e
  29294. },
  29295. cancelById: function(e) {
  29296. var t = void 0 === e ? 0 : e;
  29297. this.funcs = this.funcs.filter(function(e) {
  29298. return e.id !== t
  29299. })
  29300. },
  29301. cancel: function(t) {
  29302. this.funcs = this.funcs.filter(function(e) {
  29303. return e.func !== t
  29304. })
  29305. },
  29306. getUniqueId: function() {
  29307. return this.uniqueID -= 1,
  29308. this.uniqueID
  29309. }
  29310. }
  29311. }
  29312. , {
  29313. "./easing": 186
  29314. }],
  29315. 196: [function(e, t, i) {
  29316. function n(e) {
  29317. if (this.set = {},
  29318. this.infContains = function() {
  29319. return !0
  29320. }
  29321. ,
  29322. "object" == typeof e)
  29323. if (e instanceof Array)
  29324. for (var t = 0; t < e.length; t++)
  29325. this.set[e[t]] = !0;
  29326. else
  29327. this.set = e;
  29328. else if ("function" == typeof e)
  29329. this.infContains = e;
  29330. else if (void 0 !== e)
  29331. throw new Error("set must be either an array or an object.")
  29332. }
  29333. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29334. return !!this.set[e]
  29335. }
  29336. ,
  29337. n.prototype.add = function(e) {
  29338. if (1 == arguments.length)
  29339. this.set[e] = !0;
  29340. else
  29341. for (var t = 0; t < arguments.length; t++)
  29342. this.set[arguments[t]] = !0
  29343. }
  29344. ,
  29345. n.prototype.addAll = function(e) {
  29346. if ("object" != typeof e && !(e instanceof Array))
  29347. throw new Error("arr must be an array.");
  29348. for (var t = 0; t < e.length; t++)
  29349. this.add(e[t])
  29350. }
  29351. ,
  29352. n.prototype.delete = n.prototype.remove = function(e) {
  29353. if (1 == arguments.length)
  29354. delete this.set[e];
  29355. else
  29356. for (var t = 0; t < arguments.length; t++)
  29357. delete this.set[arguments[t]]
  29358. }
  29359. ,
  29360. n.prototype.clear = function() {
  29361. this.set = {}
  29362. }
  29363. ,
  29364. n.prototype.size = function() {
  29365. return Object.keys(this.set).length
  29366. }
  29367. ,
  29368. n.prototype.toString = function() {
  29369. return "{" + Object.keys(this.set).toString() + "}"
  29370. }
  29371. ,
  29372. n.prototype["*values"] = n.prototype.toArray = function() {
  29373. return void 0 === this.set ? [] : Object.keys(this.set)
  29374. }
  29375. }
  29376. , {}],
  29377. 197: [function(e, t, i) {}
  29378. , {}],
  29379. 198: [function(N, e, F) {
  29380. (function(e) {
  29381. "use strict";
  29382. function i() {
  29383. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29384. }
  29385. function o(e, t) {
  29386. if (i() < t)
  29387. throw new RangeError("Invalid typed array length");
  29388. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29389. e.length = t),
  29390. e
  29391. }
  29392. function u(e, t, i) {
  29393. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29394. return new u(e,t,i);
  29395. if ("number" != typeof e)
  29396. return n(this, e, t, i);
  29397. if ("string" == typeof t)
  29398. throw new Error("If encoding is specified then the first argument must be a string");
  29399. return a(this, e)
  29400. }
  29401. function n(e, t, i, n) {
  29402. if ("number" == typeof t)
  29403. throw new TypeError('"value" argument must not be a number');
  29404. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29405. if (t.byteLength,
  29406. i < 0 || t.byteLength < i)
  29407. throw new RangeError("'offset' is out of bounds");
  29408. if (t.byteLength < i + (n || 0))
  29409. throw new RangeError("'length' is out of bounds");
  29410. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29411. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29412. e
  29413. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29414. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29415. !u.isEncoding(i))
  29416. throw new TypeError('"encoding" must be a valid string encoding');
  29417. var n = 0 | c(t, i)
  29418. , r = (e = o(e, n)).write(t, i);
  29419. return r !== n && (e = e.slice(0, r)),
  29420. e
  29421. }(e, t, i) : function(e, t) {
  29422. if (u.isBuffer(t)) {
  29423. var i = 0 | l(t.length);
  29424. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29425. e
  29426. }
  29427. if (t) {
  29428. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29429. return "number" != typeof t.length || function(e) {
  29430. return e != e
  29431. }(t.length) ? o(e, 0) : s(e, t);
  29432. if ("Buffer" === t.type && L(t.data))
  29433. return s(e, t.data)
  29434. }
  29435. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29436. }(e, t)
  29437. }
  29438. function r(e) {
  29439. if ("number" != typeof e)
  29440. throw new TypeError('"size" argument must be a number');
  29441. if (e < 0)
  29442. throw new RangeError('"size" argument must not be negative')
  29443. }
  29444. function a(e, t) {
  29445. if (r(t),
  29446. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29447. !u.TYPED_ARRAY_SUPPORT)
  29448. for (var i = 0; i < t; ++i)
  29449. e[i] = 0;
  29450. return e
  29451. }
  29452. function s(e, t) {
  29453. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29454. e = o(e, i);
  29455. for (var n = 0; n < i; n += 1)
  29456. e[n] = 255 & t[n];
  29457. return e
  29458. }
  29459. function l(e) {
  29460. if (e >= i())
  29461. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29462. return 0 | e
  29463. }
  29464. function c(e, t) {
  29465. if (u.isBuffer(e))
  29466. return e.length;
  29467. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29468. return e.byteLength;
  29469. "string" != typeof e && (e = "" + e);
  29470. var i = e.length;
  29471. if (0 === i)
  29472. return 0;
  29473. for (var n = !1; ; )
  29474. switch (t) {
  29475. case "ascii":
  29476. case "latin1":
  29477. case "binary":
  29478. return i;
  29479. case "utf8":
  29480. case "utf-8":
  29481. case void 0:
  29482. return S(e).length;
  29483. case "ucs2":
  29484. case "ucs-2":
  29485. case "utf16le":
  29486. case "utf-16le":
  29487. return 2 * i;
  29488. case "hex":
  29489. return i >>> 1;
  29490. case "base64":
  29491. return M(e).length;
  29492. default:
  29493. if (n)
  29494. return S(e).length;
  29495. t = ("" + t).toLowerCase(),
  29496. n = !0
  29497. }
  29498. }
  29499. function h(e, t, i) {
  29500. var n = e[t];
  29501. e[t] = e[i],
  29502. e[i] = n
  29503. }
  29504. function d(e, t, i, n, r) {
  29505. if (0 === e.length)
  29506. return -1;
  29507. if ("string" == typeof i ? (n = i,
  29508. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29509. i = +i,
  29510. isNaN(i) && (i = r ? 0 : e.length - 1),
  29511. i < 0 && (i = e.length + i),
  29512. i >= e.length) {
  29513. if (r)
  29514. return -1;
  29515. i = e.length - 1
  29516. } else if (i < 0) {
  29517. if (!r)
  29518. return -1;
  29519. i = 0
  29520. }
  29521. if ("string" == typeof t && (t = u.from(t, n)),
  29522. u.isBuffer(t))
  29523. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29524. if ("number" == typeof t)
  29525. return t &= 255,
  29526. 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);
  29527. throw new TypeError("val must be string, number or Buffer")
  29528. }
  29529. function p(e, t, i, n, r) {
  29530. function o(e, t) {
  29531. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29532. }
  29533. var a, s = 1, l = e.length, c = t.length;
  29534. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29535. if (e.length < 2 || t.length < 2)
  29536. return -1;
  29537. l /= s = 2,
  29538. c /= 2,
  29539. i /= 2
  29540. }
  29541. if (r) {
  29542. var h = -1;
  29543. for (a = i; a < l; a++)
  29544. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29545. if (-1 === h && (h = a),
  29546. a - h + 1 === c)
  29547. return h * s
  29548. } else
  29549. -1 !== h && (a -= a - h),
  29550. h = -1
  29551. } else
  29552. for (l < i + c && (i = l - c),
  29553. a = i; 0 <= a; a--) {
  29554. for (var u = !0, d = 0; d < c; d++)
  29555. if (o(e, a + d) !== o(t, d)) {
  29556. u = !1;
  29557. break
  29558. }
  29559. if (u)
  29560. return a
  29561. }
  29562. return -1
  29563. }
  29564. function g(e, t, i, n) {
  29565. i = Number(i) || 0;
  29566. var r = e.length - i;
  29567. n ? r < (n = Number(n)) && (n = r) : n = r;
  29568. var o = t.length;
  29569. if (o % 2 != 0)
  29570. throw new TypeError("Invalid hex string");
  29571. o / 2 < n && (n = o / 2);
  29572. for (var a = 0; a < n; ++a) {
  29573. var s = parseInt(t.substr(2 * a, 2), 16);
  29574. if (isNaN(s))
  29575. return a;
  29576. e[i + a] = s
  29577. }
  29578. return a
  29579. }
  29580. function m(e, t, i, n) {
  29581. return R(function(e) {
  29582. for (var t = [], i = 0; i < e.length; ++i)
  29583. t.push(255 & e.charCodeAt(i));
  29584. return t
  29585. }(t), e, i, n)
  29586. }
  29587. function f(e, t, i) {
  29588. i = Math.min(e.length, i);
  29589. for (var n = [], r = t; r < i; ) {
  29590. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29591. if (r + u <= i)
  29592. switch (u) {
  29593. case 1:
  29594. c < 128 && (h = c);
  29595. break;
  29596. case 2:
  29597. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29598. break;
  29599. case 3:
  29600. o = e[r + 1],
  29601. a = e[r + 2],
  29602. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29603. break;
  29604. case 4:
  29605. o = e[r + 1],
  29606. a = e[r + 2],
  29607. s = e[r + 3],
  29608. 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))
  29609. }
  29610. null === h ? (h = 65533,
  29611. u = 1) : 65535 < h && (h -= 65536,
  29612. n.push(h >>> 10 & 1023 | 55296),
  29613. h = 56320 | 1023 & h),
  29614. n.push(h),
  29615. r += u
  29616. }
  29617. return function(e) {
  29618. var t = e.length;
  29619. if (t <= D)
  29620. return String.fromCharCode.apply(String, e);
  29621. for (var i = "", n = 0; n < t; )
  29622. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29623. return i
  29624. }(n)
  29625. }
  29626. function v(e, t, i) {
  29627. var n = "";
  29628. i = Math.min(e.length, i);
  29629. for (var r = t; r < i; ++r)
  29630. n += String.fromCharCode(127 & e[r]);
  29631. return n
  29632. }
  29633. function y(e, t, i) {
  29634. var n = "";
  29635. i = Math.min(e.length, i);
  29636. for (var r = t; r < i; ++r)
  29637. n += String.fromCharCode(e[r]);
  29638. return n
  29639. }
  29640. function A(e, t, i) {
  29641. var n, r = e.length;
  29642. (!t || t < 0) && (t = 0),
  29643. (!i || i < 0 || r < i) && (i = r);
  29644. for (var o = "", a = t; a < i; ++a)
  29645. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29646. return o
  29647. }
  29648. function C(e, t, i) {
  29649. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29650. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29651. return r
  29652. }
  29653. function I(e, t, i) {
  29654. if (e % 1 != 0 || e < 0)
  29655. throw new RangeError("offset is not uint");
  29656. if (i < e + t)
  29657. throw new RangeError("Trying to access beyond buffer length")
  29658. }
  29659. function E(e, t, i, n, r, o) {
  29660. if (!u.isBuffer(e))
  29661. throw new TypeError('"buffer" argument must be a Buffer instance');
  29662. if (r < t || t < o)
  29663. throw new RangeError('"value" argument is out of bounds');
  29664. if (i + n > e.length)
  29665. throw new RangeError("Index out of range")
  29666. }
  29667. function _(e, t, i, n) {
  29668. t < 0 && (t = 65535 + t + 1);
  29669. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29670. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29671. }
  29672. function b(e, t, i, n) {
  29673. t < 0 && (t = 4294967295 + t + 1);
  29674. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29675. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29676. }
  29677. function w(e, t, i, n) {
  29678. if (i + n > e.length)
  29679. throw new RangeError("Index out of range");
  29680. if (i < 0)
  29681. throw new RangeError("Index out of range")
  29682. }
  29683. function T(e, t, i, n, r) {
  29684. return r || w(e, 0, i, 4),
  29685. O.write(e, t, i, n, 23, 4),
  29686. i + 4
  29687. }
  29688. function x(e, t, i, n, r) {
  29689. return r || w(e, 0, i, 8),
  29690. O.write(e, t, i, n, 52, 8),
  29691. i + 8
  29692. }
  29693. function S(e, t) {
  29694. t = t || 1 / 0;
  29695. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29696. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29697. if (!r) {
  29698. if (56319 < i) {
  29699. -1 < (t -= 3) && o.push(239, 191, 189);
  29700. continue
  29701. }
  29702. if (a + 1 === n) {
  29703. -1 < (t -= 3) && o.push(239, 191, 189);
  29704. continue
  29705. }
  29706. r = i;
  29707. continue
  29708. }
  29709. if (i < 56320) {
  29710. -1 < (t -= 3) && o.push(239, 191, 189),
  29711. r = i;
  29712. continue
  29713. }
  29714. i = 65536 + (r - 55296 << 10 | i - 56320)
  29715. } else
  29716. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29717. if (r = null,
  29718. i < 128) {
  29719. if ((t -= 1) < 0)
  29720. break;
  29721. o.push(i)
  29722. } else if (i < 2048) {
  29723. if ((t -= 2) < 0)
  29724. break;
  29725. o.push(i >> 6 | 192, 63 & i | 128)
  29726. } else if (i < 65536) {
  29727. if ((t -= 3) < 0)
  29728. break;
  29729. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29730. } else {
  29731. if (!(i < 1114112))
  29732. throw new Error("Invalid code point");
  29733. if ((t -= 4) < 0)
  29734. break;
  29735. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29736. }
  29737. }
  29738. return o
  29739. }
  29740. function M(e) {
  29741. return P.toByteArray(function(e) {
  29742. if ((e = function(e) {
  29743. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29744. }(e).replace(t, "")).length < 2)
  29745. return "";
  29746. for (; e.length % 4 != 0; )
  29747. e += "=";
  29748. return e
  29749. }(e))
  29750. }
  29751. function R(e, t, i, n) {
  29752. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29753. t[r + i] = e[r];
  29754. return r
  29755. }
  29756. var P = N("base64-js")
  29757. , O = N("ieee754")
  29758. , L = N("isarray");
  29759. F.Buffer = u,
  29760. F.SlowBuffer = function(e) {
  29761. return +e != e && (e = 0),
  29762. u.alloc(+e)
  29763. }
  29764. ,
  29765. F.INSPECT_MAX_BYTES = 50,
  29766. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29767. try {
  29768. var e = new Uint8Array(1);
  29769. return e.__proto__ = {
  29770. __proto__: Uint8Array.prototype,
  29771. foo: function() {
  29772. return 42
  29773. }
  29774. },
  29775. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29776. } catch (e) {
  29777. return !1
  29778. }
  29779. }(),
  29780. F.kMaxLength = i(),
  29781. u.poolSize = 8192,
  29782. u._augment = function(e) {
  29783. return e.__proto__ = u.prototype,
  29784. e
  29785. }
  29786. ,
  29787. u.from = function(e, t, i) {
  29788. return n(null, e, t, i)
  29789. }
  29790. ,
  29791. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  29792. u.__proto__ = Uint8Array,
  29793. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  29794. value: null,
  29795. configurable: !0
  29796. })),
  29797. u.alloc = function(e, t, i) {
  29798. return function(e, t, i, n) {
  29799. return r(t),
  29800. 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)
  29801. }(null, e, t, i)
  29802. }
  29803. ,
  29804. u.allocUnsafe = function(e) {
  29805. return a(null, e)
  29806. }
  29807. ,
  29808. u.allocUnsafeSlow = function(e) {
  29809. return a(null, e)
  29810. }
  29811. ,
  29812. u.isBuffer = function(e) {
  29813. return !(null == e || !e._isBuffer)
  29814. }
  29815. ,
  29816. u.compare = function(e, t) {
  29817. if (!u.isBuffer(e) || !u.isBuffer(t))
  29818. throw new TypeError("Arguments must be Buffers");
  29819. if (e === t)
  29820. return 0;
  29821. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29822. if (e[r] !== t[r]) {
  29823. i = e[r],
  29824. n = t[r];
  29825. break
  29826. }
  29827. return i < n ? -1 : n < i ? 1 : 0
  29828. }
  29829. ,
  29830. u.isEncoding = function(e) {
  29831. switch (String(e).toLowerCase()) {
  29832. case "hex":
  29833. case "utf8":
  29834. case "utf-8":
  29835. case "ascii":
  29836. case "latin1":
  29837. case "binary":
  29838. case "base64":
  29839. case "ucs2":
  29840. case "ucs-2":
  29841. case "utf16le":
  29842. case "utf-16le":
  29843. return !0;
  29844. default:
  29845. return !1
  29846. }
  29847. }
  29848. ,
  29849. u.concat = function(e, t) {
  29850. if (!L(e))
  29851. throw new TypeError('"list" argument must be an Array of Buffers');
  29852. if (0 === e.length)
  29853. return u.alloc(0);
  29854. var i;
  29855. if (void 0 === t)
  29856. for (i = t = 0; i < e.length; ++i)
  29857. t += e[i].length;
  29858. var n = u.allocUnsafe(t)
  29859. , r = 0;
  29860. for (i = 0; i < e.length; ++i) {
  29861. var o = e[i];
  29862. if (!u.isBuffer(o))
  29863. throw new TypeError('"list" argument must be an Array of Buffers');
  29864. o.copy(n, r),
  29865. r += o.length
  29866. }
  29867. return n
  29868. }
  29869. ,
  29870. u.byteLength = c,
  29871. u.prototype._isBuffer = !0,
  29872. u.prototype.swap16 = function() {
  29873. var e = this.length;
  29874. if (e % 2 != 0)
  29875. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29876. for (var t = 0; t < e; t += 2)
  29877. h(this, t, t + 1);
  29878. return this
  29879. }
  29880. ,
  29881. u.prototype.swap32 = function() {
  29882. var e = this.length;
  29883. if (e % 4 != 0)
  29884. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29885. for (var t = 0; t < e; t += 4)
  29886. h(this, t, t + 3),
  29887. h(this, t + 1, t + 2);
  29888. return this
  29889. }
  29890. ,
  29891. u.prototype.swap64 = function() {
  29892. var e = this.length;
  29893. if (e % 8 != 0)
  29894. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29895. for (var t = 0; t < e; t += 8)
  29896. h(this, t, t + 7),
  29897. h(this, t + 1, t + 6),
  29898. h(this, t + 2, t + 5),
  29899. h(this, t + 3, t + 4);
  29900. return this
  29901. }
  29902. ,
  29903. u.prototype.toString = function() {
  29904. var e = 0 | this.length;
  29905. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  29906. var n, r, o, a = !1;
  29907. if ((void 0 === t || t < 0) && (t = 0),
  29908. t > this.length)
  29909. return "";
  29910. if ((void 0 === i || i > this.length) && (i = this.length),
  29911. i <= 0)
  29912. return "";
  29913. if ((i >>>= 0) <= (t >>>= 0))
  29914. return "";
  29915. for (e = e || "utf8"; ; )
  29916. switch (e) {
  29917. case "hex":
  29918. return A(this, t, i);
  29919. case "utf8":
  29920. case "utf-8":
  29921. return f(this, t, i);
  29922. case "ascii":
  29923. return v(this, t, i);
  29924. case "latin1":
  29925. case "binary":
  29926. return y(this, t, i);
  29927. case "base64":
  29928. return n = this,
  29929. o = i,
  29930. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  29931. case "ucs2":
  29932. case "ucs-2":
  29933. case "utf16le":
  29934. case "utf-16le":
  29935. return C(this, t, i);
  29936. default:
  29937. if (a)
  29938. throw new TypeError("Unknown encoding: " + e);
  29939. e = (e + "").toLowerCase(),
  29940. a = !0
  29941. }
  29942. }
  29943. .apply(this, arguments)
  29944. }
  29945. ,
  29946. u.prototype.equals = function(e) {
  29947. if (!u.isBuffer(e))
  29948. throw new TypeError("Argument must be a Buffer");
  29949. return this === e || 0 === u.compare(this, e)
  29950. }
  29951. ,
  29952. u.prototype.inspect = function() {
  29953. var e = ""
  29954. , t = F.INSPECT_MAX_BYTES;
  29955. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29956. this.length > t && (e += " ... ")),
  29957. "<Buffer " + e + ">"
  29958. }
  29959. ,
  29960. u.prototype.compare = function(e, t, i, n, r) {
  29961. if (!u.isBuffer(e))
  29962. throw new TypeError("Argument must be a Buffer");
  29963. if (void 0 === t && (t = 0),
  29964. void 0 === i && (i = e ? e.length : 0),
  29965. void 0 === n && (n = 0),
  29966. void 0 === r && (r = this.length),
  29967. t < 0 || i > e.length || n < 0 || r > this.length)
  29968. throw new RangeError("out of range index");
  29969. if (r <= n && i <= t)
  29970. return 0;
  29971. if (r <= n)
  29972. return -1;
  29973. if (i <= t)
  29974. return 1;
  29975. if (this === e)
  29976. return 0;
  29977. 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)
  29978. if (l[h] !== c[h]) {
  29979. o = l[h],
  29980. a = c[h];
  29981. break
  29982. }
  29983. return o < a ? -1 : a < o ? 1 : 0
  29984. }
  29985. ,
  29986. u.prototype.includes = function(e, t, i) {
  29987. return -1 !== this.indexOf(e, t, i)
  29988. }
  29989. ,
  29990. u.prototype.indexOf = function(e, t, i) {
  29991. return d(this, e, t, i, !0)
  29992. }
  29993. ,
  29994. u.prototype.lastIndexOf = function(e, t, i) {
  29995. return d(this, e, t, i, !1)
  29996. }
  29997. ,
  29998. u.prototype.write = function(e, t, i, n) {
  29999. if (void 0 === t)
  30000. n = "utf8",
  30001. i = this.length,
  30002. t = 0;
  30003. else if (void 0 === i && "string" == typeof t)
  30004. n = t,
  30005. i = this.length,
  30006. t = 0;
  30007. else {
  30008. if (!isFinite(t))
  30009. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30010. t |= 0,
  30011. isFinite(i) ? (i |= 0,
  30012. void 0 === n && (n = "utf8")) : (n = i,
  30013. i = void 0)
  30014. }
  30015. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30016. if ((void 0 === i || p < i) && (i = p),
  30017. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30018. throw new RangeError("Attempt to write outside buffer bounds");
  30019. n = n || "utf8";
  30020. for (var f = !1; ; )
  30021. switch (n) {
  30022. case "hex":
  30023. return g(this, e, t, i);
  30024. case "utf8":
  30025. case "utf-8":
  30026. return u = t,
  30027. d = i,
  30028. R(S(e, (h = this).length - u), h, u, d);
  30029. case "ascii":
  30030. return m(this, e, t, i);
  30031. case "latin1":
  30032. case "binary":
  30033. return m(this, e, t, i);
  30034. case "base64":
  30035. return s = this,
  30036. l = t,
  30037. c = i,
  30038. R(M(e), s, l, c);
  30039. case "ucs2":
  30040. case "ucs-2":
  30041. case "utf16le":
  30042. case "utf-16le":
  30043. return o = t,
  30044. a = i,
  30045. R(function(e, t) {
  30046. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30047. i = e.charCodeAt(a),
  30048. n = i >> 8,
  30049. r = i % 256,
  30050. o.push(r),
  30051. o.push(n);
  30052. return o
  30053. }(e, (r = this).length - o), r, o, a);
  30054. default:
  30055. if (f)
  30056. throw new TypeError("Unknown encoding: " + n);
  30057. n = ("" + n).toLowerCase(),
  30058. f = !0
  30059. }
  30060. }
  30061. ,
  30062. u.prototype.toJSON = function() {
  30063. return {
  30064. type: "Buffer",
  30065. data: Array.prototype.slice.call(this._arr || this, 0)
  30066. }
  30067. }
  30068. ;
  30069. var D = 4096;
  30070. u.prototype.slice = function(e, t) {
  30071. var i, n = this.length;
  30072. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30073. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30074. t < e && (t = e),
  30075. u.TYPED_ARRAY_SUPPORT)
  30076. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30077. else {
  30078. var r = t - e;
  30079. i = new u(r,void 0);
  30080. for (var o = 0; o < r; ++o)
  30081. i[o] = this[o + e]
  30082. }
  30083. return i
  30084. }
  30085. ,
  30086. u.prototype.readUIntLE = function(e, t, i) {
  30087. e |= 0,
  30088. t |= 0,
  30089. i || I(e, t, this.length);
  30090. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30091. n += this[e + o] * r;
  30092. return n
  30093. }
  30094. ,
  30095. u.prototype.readUIntBE = function(e, t, i) {
  30096. e |= 0,
  30097. t |= 0,
  30098. i || I(e, t, this.length);
  30099. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30100. n += this[e + --t] * r;
  30101. return n
  30102. }
  30103. ,
  30104. u.prototype.readUInt8 = function(e, t) {
  30105. return t || I(e, 1, this.length),
  30106. this[e]
  30107. }
  30108. ,
  30109. u.prototype.readUInt16LE = function(e, t) {
  30110. return t || I(e, 2, this.length),
  30111. this[e] | this[e + 1] << 8
  30112. }
  30113. ,
  30114. u.prototype.readUInt16BE = function(e, t) {
  30115. return t || I(e, 2, this.length),
  30116. this[e] << 8 | this[e + 1]
  30117. }
  30118. ,
  30119. u.prototype.readUInt32LE = function(e, t) {
  30120. return t || I(e, 4, this.length),
  30121. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30122. }
  30123. ,
  30124. u.prototype.readUInt32BE = function(e, t) {
  30125. return t || I(e, 4, this.length),
  30126. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30127. }
  30128. ,
  30129. u.prototype.readIntLE = function(e, t, i) {
  30130. e |= 0,
  30131. t |= 0,
  30132. i || I(e, t, this.length);
  30133. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30134. n += this[e + o] * r;
  30135. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30136. n
  30137. }
  30138. ,
  30139. u.prototype.readIntBE = function(e, t, i) {
  30140. e |= 0,
  30141. t |= 0,
  30142. i || I(e, t, this.length);
  30143. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30144. o += this[e + --n] * r;
  30145. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30146. o
  30147. }
  30148. ,
  30149. u.prototype.readInt8 = function(e, t) {
  30150. return t || I(e, 1, this.length),
  30151. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30152. }
  30153. ,
  30154. u.prototype.readInt16LE = function(e, t) {
  30155. t || I(e, 2, this.length);
  30156. var i = this[e] | this[e + 1] << 8;
  30157. return 32768 & i ? 4294901760 | i : i
  30158. }
  30159. ,
  30160. u.prototype.readInt16BE = function(e, t) {
  30161. t || I(e, 2, this.length);
  30162. var i = this[e + 1] | this[e] << 8;
  30163. return 32768 & i ? 4294901760 | i : i
  30164. }
  30165. ,
  30166. u.prototype.readInt32LE = function(e, t) {
  30167. return t || I(e, 4, this.length),
  30168. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30169. }
  30170. ,
  30171. u.prototype.readInt32BE = function(e, t) {
  30172. return t || I(e, 4, this.length),
  30173. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30174. }
  30175. ,
  30176. u.prototype.readFloatLE = function(e, t) {
  30177. return t || I(e, 4, this.length),
  30178. O.read(this, e, !0, 23, 4)
  30179. }
  30180. ,
  30181. u.prototype.readFloatBE = function(e, t) {
  30182. return t || I(e, 4, this.length),
  30183. O.read(this, e, !1, 23, 4)
  30184. }
  30185. ,
  30186. u.prototype.readDoubleLE = function(e, t) {
  30187. return t || I(e, 8, this.length),
  30188. O.read(this, e, !0, 52, 8)
  30189. }
  30190. ,
  30191. u.prototype.readDoubleBE = function(e, t) {
  30192. return t || I(e, 8, this.length),
  30193. O.read(this, e, !1, 52, 8)
  30194. }
  30195. ,
  30196. u.prototype.writeUIntLE = function(e, t, i, n) {
  30197. e = +e,
  30198. t |= 0,
  30199. i |= 0,
  30200. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30201. var r = 1
  30202. , o = 0;
  30203. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30204. this[t + o] = e / r & 255;
  30205. return t + i
  30206. }
  30207. ,
  30208. u.prototype.writeUIntBE = function(e, t, i, n) {
  30209. e = +e,
  30210. t |= 0,
  30211. i |= 0,
  30212. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30213. var r = i - 1
  30214. , o = 1;
  30215. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30216. this[t + r] = e / o & 255;
  30217. return t + i
  30218. }
  30219. ,
  30220. u.prototype.writeUInt8 = function(e, t, i) {
  30221. return e = +e,
  30222. t |= 0,
  30223. i || E(this, e, t, 1, 255, 0),
  30224. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30225. this[t] = 255 & e,
  30226. t + 1
  30227. }
  30228. ,
  30229. u.prototype.writeUInt16LE = function(e, t, i) {
  30230. return e = +e,
  30231. t |= 0,
  30232. i || E(this, e, t, 2, 65535, 0),
  30233. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30234. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30235. t + 2
  30236. }
  30237. ,
  30238. u.prototype.writeUInt16BE = function(e, t, i) {
  30239. return e = +e,
  30240. t |= 0,
  30241. i || E(this, e, t, 2, 65535, 0),
  30242. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30243. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30244. t + 2
  30245. }
  30246. ,
  30247. u.prototype.writeUInt32LE = function(e, t, i) {
  30248. return e = +e,
  30249. t |= 0,
  30250. i || E(this, e, t, 4, 4294967295, 0),
  30251. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30252. this[t + 2] = e >>> 16,
  30253. this[t + 1] = e >>> 8,
  30254. this[t] = 255 & e) : b(this, e, t, !0),
  30255. t + 4
  30256. }
  30257. ,
  30258. u.prototype.writeUInt32BE = function(e, t, i) {
  30259. return e = +e,
  30260. t |= 0,
  30261. i || E(this, e, t, 4, 4294967295, 0),
  30262. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30263. this[t + 1] = e >>> 16,
  30264. this[t + 2] = e >>> 8,
  30265. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30266. t + 4
  30267. }
  30268. ,
  30269. u.prototype.writeIntLE = function(e, t, i, n) {
  30270. if (e = +e,
  30271. t |= 0,
  30272. !n) {
  30273. var r = Math.pow(2, 8 * i - 1);
  30274. E(this, e, t, i, r - 1, -r)
  30275. }
  30276. var o = 0
  30277. , a = 1
  30278. , s = 0;
  30279. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30280. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30281. this[t + o] = (e / a >> 0) - s & 255;
  30282. return t + i
  30283. }
  30284. ,
  30285. u.prototype.writeIntBE = function(e, t, i, n) {
  30286. if (e = +e,
  30287. t |= 0,
  30288. !n) {
  30289. var r = Math.pow(2, 8 * i - 1);
  30290. E(this, e, t, i, r - 1, -r)
  30291. }
  30292. var o = i - 1
  30293. , a = 1
  30294. , s = 0;
  30295. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30296. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30297. this[t + o] = (e / a >> 0) - s & 255;
  30298. return t + i
  30299. }
  30300. ,
  30301. u.prototype.writeInt8 = function(e, t, i) {
  30302. return e = +e,
  30303. t |= 0,
  30304. i || E(this, e, t, 1, 127, -128),
  30305. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30306. e < 0 && (e = 255 + e + 1),
  30307. this[t] = 255 & e,
  30308. t + 1
  30309. }
  30310. ,
  30311. u.prototype.writeInt16LE = function(e, t, i) {
  30312. return e = +e,
  30313. t |= 0,
  30314. i || E(this, e, t, 2, 32767, -32768),
  30315. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30316. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30317. t + 2
  30318. }
  30319. ,
  30320. u.prototype.writeInt16BE = function(e, t, i) {
  30321. return e = +e,
  30322. t |= 0,
  30323. i || E(this, e, t, 2, 32767, -32768),
  30324. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30325. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30326. t + 2
  30327. }
  30328. ,
  30329. u.prototype.writeInt32LE = function(e, t, i) {
  30330. return e = +e,
  30331. t |= 0,
  30332. i || E(this, e, t, 4, 2147483647, -2147483648),
  30333. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30334. this[t + 1] = e >>> 8,
  30335. this[t + 2] = e >>> 16,
  30336. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30337. t + 4
  30338. }
  30339. ,
  30340. u.prototype.writeInt32BE = function(e, t, i) {
  30341. return e = +e,
  30342. t |= 0,
  30343. i || E(this, e, t, 4, 2147483647, -2147483648),
  30344. e < 0 && (e = 4294967295 + e + 1),
  30345. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30346. this[t + 1] = e >>> 16,
  30347. this[t + 2] = e >>> 8,
  30348. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30349. t + 4
  30350. }
  30351. ,
  30352. u.prototype.writeFloatLE = function(e, t, i) {
  30353. return T(this, e, t, !0, i)
  30354. }
  30355. ,
  30356. u.prototype.writeFloatBE = function(e, t, i) {
  30357. return T(this, e, t, !1, i)
  30358. }
  30359. ,
  30360. u.prototype.writeDoubleLE = function(e, t, i) {
  30361. return x(this, e, t, !0, i)
  30362. }
  30363. ,
  30364. u.prototype.writeDoubleBE = function(e, t, i) {
  30365. return x(this, e, t, !1, i)
  30366. }
  30367. ,
  30368. u.prototype.copy = function(e, t, i, n) {
  30369. if (i = i || 0,
  30370. n || 0 === n || (n = this.length),
  30371. t >= e.length && (t = e.length),
  30372. t = t || 0,
  30373. 0 < n && n < i && (n = i),
  30374. n === i)
  30375. return 0;
  30376. if (0 === e.length || 0 === this.length)
  30377. return 0;
  30378. if (t < 0)
  30379. throw new RangeError("targetStart out of bounds");
  30380. if (i < 0 || i >= this.length)
  30381. throw new RangeError("sourceStart out of bounds");
  30382. if (n < 0)
  30383. throw new RangeError("sourceEnd out of bounds");
  30384. n > this.length && (n = this.length),
  30385. e.length - t < n - i && (n = e.length - t + i);
  30386. var r, o = n - i;
  30387. if (this === e && i < t && t < n)
  30388. for (r = o - 1; 0 <= r; --r)
  30389. e[r + t] = this[r + i];
  30390. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30391. for (r = 0; r < o; ++r)
  30392. e[r + t] = this[r + i];
  30393. else
  30394. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30395. return o
  30396. }
  30397. ,
  30398. u.prototype.fill = function(e, t, i, n) {
  30399. if ("string" == typeof e) {
  30400. if ("string" == typeof t ? (n = t,
  30401. t = 0,
  30402. i = this.length) : "string" == typeof i && (n = i,
  30403. i = this.length),
  30404. 1 === e.length) {
  30405. var r = e.charCodeAt(0);
  30406. r < 256 && (e = r)
  30407. }
  30408. if (void 0 !== n && "string" != typeof n)
  30409. throw new TypeError("encoding must be a string");
  30410. if ("string" == typeof n && !u.isEncoding(n))
  30411. throw new TypeError("Unknown encoding: " + n)
  30412. } else
  30413. "number" == typeof e && (e &= 255);
  30414. if (t < 0 || this.length < t || this.length < i)
  30415. throw new RangeError("Out of range index");
  30416. if (i <= t)
  30417. return this;
  30418. var o;
  30419. if (t >>>= 0,
  30420. i = void 0 === i ? this.length : i >>> 0,
  30421. "number" == typeof (e = e || 0))
  30422. for (o = t; o < i; ++o)
  30423. this[o] = e;
  30424. else {
  30425. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30426. , s = a.length;
  30427. for (o = 0; o < i - t; ++o)
  30428. this[o + t] = a[o % s]
  30429. }
  30430. return this
  30431. }
  30432. ;
  30433. var t = /[^+\/0-9A-Za-z-_]/g
  30434. }
  30435. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30436. }
  30437. , {
  30438. "base64-js": 199,
  30439. ieee754: 200,
  30440. isarray: 201
  30441. }],
  30442. 199: [function(e, t, i) {
  30443. "use strict";
  30444. function l(e) {
  30445. var t = e.length;
  30446. if (0 < t % 4)
  30447. throw new Error("Invalid string. Length must be a multiple of 4");
  30448. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30449. }
  30450. function c(e, t, i) {
  30451. for (var n, r = [], o = t; o < i; o += 3)
  30452. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30453. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30454. var a;
  30455. return r.join("")
  30456. }
  30457. i.byteLength = function(e) {
  30458. return 3 * e.length / 4 - l(e)
  30459. }
  30460. ,
  30461. i.toByteArray = function(e) {
  30462. var t, i, n, r, o, a = e.length;
  30463. r = l(e),
  30464. o = new d(3 * a / 4 - r),
  30465. i = 0 < r ? a - 4 : a;
  30466. var s = 0;
  30467. for (t = 0; t < i; t += 4,
  30468. 3)
  30469. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30470. o[s++] = n >> 16 & 255,
  30471. o[s++] = n >> 8 & 255,
  30472. o[s++] = 255 & n;
  30473. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30474. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30475. o[s++] = n >> 8 & 255,
  30476. o[s++] = 255 & n),
  30477. o
  30478. }
  30479. ,
  30480. i.fromByteArray = function(e) {
  30481. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30482. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30483. return 1 == n ? (t = e[i - 1],
  30484. r += h[t >> 2],
  30485. r += h[t << 4 & 63],
  30486. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30487. r += h[t >> 10],
  30488. r += h[t >> 4 & 63],
  30489. r += h[t << 2 & 63],
  30490. r += "="),
  30491. o.push(r),
  30492. o.join("")
  30493. }
  30494. ;
  30495. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30496. h[r] = n[r],
  30497. u[n.charCodeAt(r)] = r;
  30498. u["-".charCodeAt(0)] = 62,
  30499. u["_".charCodeAt(0)] = 63
  30500. }
  30501. , {}],
  30502. 200: [function(e, t, i) {
  30503. i.read = function(e, t, i, n, r) {
  30504. 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];
  30505. for (u += d,
  30506. o = p & (1 << -h) - 1,
  30507. p >>= -h,
  30508. h += s; 0 < h; o = 256 * o + e[t + u],
  30509. u += d,
  30510. h -= 8)
  30511. ;
  30512. for (a = o & (1 << -h) - 1,
  30513. o >>= -h,
  30514. h += n; 0 < h; a = 256 * a + e[t + u],
  30515. u += d,
  30516. h -= 8)
  30517. ;
  30518. if (0 === o)
  30519. o = 1 - c;
  30520. else {
  30521. if (o === l)
  30522. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30523. a += Math.pow(2, n),
  30524. o -= c
  30525. }
  30526. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30527. }
  30528. ,
  30529. i.write = function(e, t, i, n, r, o) {
  30530. 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;
  30531. for (t = Math.abs(t),
  30532. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30533. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30534. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30535. l *= 2),
  30536. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30537. l /= 2),
  30538. h <= a + u ? (s = 0,
  30539. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30540. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30541. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30542. p += f,
  30543. s /= 256,
  30544. r -= 8)
  30545. ;
  30546. for (a = a << r | s,
  30547. c += r; 0 < c; e[i + p] = 255 & a,
  30548. p += f,
  30549. a /= 256,
  30550. c -= 8)
  30551. ;
  30552. e[i + p - f] |= 128 * g
  30553. }
  30554. }
  30555. , {}],
  30556. 201: [function(e, t, i) {
  30557. var n = {}.toString;
  30558. t.exports = Array.isArray || function(e) {
  30559. return "[object Array]" == n.call(e)
  30560. }
  30561. }
  30562. , {}],
  30563. 202: [function(e, t, i) {
  30564. function n() {
  30565. this._events = this._events || {},
  30566. this._maxListeners = this._maxListeners || void 0
  30567. }
  30568. function l(e) {
  30569. return "function" == typeof e
  30570. }
  30571. function c(e) {
  30572. return "object" == typeof e && null !== e
  30573. }
  30574. function h(e) {
  30575. return void 0 === e
  30576. }
  30577. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30578. n.prototype._maxListeners = void 0,
  30579. n.defaultMaxListeners = 10,
  30580. n.prototype.setMaxListeners = function(e) {
  30581. if (!function(e) {
  30582. return "number" == typeof e
  30583. }(e) || e < 0 || isNaN(e))
  30584. throw TypeError("n must be a positive number");
  30585. return this._maxListeners = e,
  30586. this
  30587. }
  30588. ,
  30589. n.prototype.emit = function(e) {
  30590. var t, i, n, r, o, a;
  30591. if (this._events || (this._events = {}),
  30592. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30593. if ((t = arguments[1])instanceof Error)
  30594. throw t;
  30595. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30596. throw s.context = t,
  30597. s
  30598. }
  30599. if (h(i = this._events[e]))
  30600. return !1;
  30601. if (l(i))
  30602. switch (arguments.length) {
  30603. case 1:
  30604. i.call(this);
  30605. break;
  30606. case 2:
  30607. i.call(this, arguments[1]);
  30608. break;
  30609. case 3:
  30610. i.call(this, arguments[1], arguments[2]);
  30611. break;
  30612. default:
  30613. r = Array.prototype.slice.call(arguments, 1),
  30614. i.apply(this, r)
  30615. }
  30616. else if (c(i))
  30617. for (r = Array.prototype.slice.call(arguments, 1),
  30618. n = (a = i.slice()).length,
  30619. o = 0; o < n; o++)
  30620. a[o].apply(this, r);
  30621. return !0
  30622. }
  30623. ,
  30624. n.prototype.on = n.prototype.addListener = function(e, t) {
  30625. var i;
  30626. if (!l(t))
  30627. throw TypeError("listener must be a function");
  30628. return this._events || (this._events = {}),
  30629. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30630. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30631. 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,
  30632. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30633. "function" == typeof console.trace && console.trace())),
  30634. this
  30635. }
  30636. ,
  30637. n.prototype.once = function(e, t) {
  30638. function i() {
  30639. this.removeListener(e, i),
  30640. n || (n = !0,
  30641. t.apply(this, arguments))
  30642. }
  30643. if (!l(t))
  30644. throw TypeError("listener must be a function");
  30645. var n = !1;
  30646. return i.listener = t,
  30647. this.on(e, i),
  30648. this
  30649. }
  30650. ,
  30651. n.prototype.removeListener = function(e, t) {
  30652. var i, n, r, o;
  30653. if (!l(t))
  30654. throw TypeError("listener must be a function");
  30655. if (!this._events || !this._events[e])
  30656. return this;
  30657. if (r = (i = this._events[e]).length,
  30658. n = -1,
  30659. i === t || l(i.listener) && i.listener === t)
  30660. delete this._events[e],
  30661. this._events.removeListener && this.emit("removeListener", e, t);
  30662. else if (c(i)) {
  30663. for (o = r; 0 < o--; )
  30664. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30665. n = o;
  30666. break
  30667. }
  30668. if (n < 0)
  30669. return this;
  30670. 1 === i.length ? (i.length = 0,
  30671. delete this._events[e]) : i.splice(n, 1),
  30672. this._events.removeListener && this.emit("removeListener", e, t)
  30673. }
  30674. return this
  30675. }
  30676. ,
  30677. n.prototype.removeAllListeners = function(e) {
  30678. var t, i;
  30679. if (!this._events)
  30680. return this;
  30681. if (!this._events.removeListener)
  30682. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30683. this;
  30684. if (0 === arguments.length) {
  30685. for (t in this._events)
  30686. "removeListener" !== t && this.removeAllListeners(t);
  30687. return this.removeAllListeners("removeListener"),
  30688. this._events = {},
  30689. this
  30690. }
  30691. if (l(i = this._events[e]))
  30692. this.removeListener(e, i);
  30693. else if (i)
  30694. for (; i.length; )
  30695. this.removeListener(e, i[i.length - 1]);
  30696. return delete this._events[e],
  30697. this
  30698. }
  30699. ,
  30700. n.prototype.listeners = function(e) {
  30701. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30702. }
  30703. ,
  30704. n.prototype.listenerCount = function(e) {
  30705. if (this._events) {
  30706. var t = this._events[e];
  30707. if (l(t))
  30708. return 1;
  30709. if (t)
  30710. return t.length
  30711. }
  30712. return 0
  30713. }
  30714. ,
  30715. n.listenerCount = function(e, t) {
  30716. return e.listenerCount(t)
  30717. }
  30718. }
  30719. , {}],
  30720. 203: [function(e, t, i) {
  30721. function n() {
  30722. throw new Error("setTimeout has not been defined")
  30723. }
  30724. function r() {
  30725. throw new Error("clearTimeout has not been defined")
  30726. }
  30727. function o(t) {
  30728. if (h === setTimeout)
  30729. return setTimeout(t, 0);
  30730. if ((h === n || !h) && setTimeout)
  30731. return h = setTimeout,
  30732. setTimeout(t, 0);
  30733. try {
  30734. return h(t, 0)
  30735. } catch (e) {
  30736. try {
  30737. return h.call(null, t, 0)
  30738. } catch (e) {
  30739. return h.call(this, t, 0)
  30740. }
  30741. }
  30742. }
  30743. function a() {
  30744. g && p && (g = !1,
  30745. p.length ? f = p.concat(f) : m = -1,
  30746. f.length && s())
  30747. }
  30748. function s() {
  30749. if (!g) {
  30750. var e = o(a);
  30751. g = !0;
  30752. for (var t = f.length; t; ) {
  30753. for (p = f,
  30754. f = []; ++m < t; )
  30755. p && p[m].run();
  30756. m = -1,
  30757. t = f.length
  30758. }
  30759. p = null,
  30760. g = !1,
  30761. function(t) {
  30762. if (u === clearTimeout)
  30763. return clearTimeout(t);
  30764. if ((u === r || !u) && clearTimeout)
  30765. return u = clearTimeout,
  30766. clearTimeout(t);
  30767. try {
  30768. u(t)
  30769. } catch (e) {
  30770. try {
  30771. return u.call(null, t)
  30772. } catch (e) {
  30773. return u.call(this, t)
  30774. }
  30775. }
  30776. }(e)
  30777. }
  30778. }
  30779. function l(e, t) {
  30780. this.fun = e,
  30781. this.array = t
  30782. }
  30783. function c() {}
  30784. var h, u, d = t.exports = {};
  30785. !function() {
  30786. try {
  30787. h = "function" == typeof setTimeout ? setTimeout : n
  30788. } catch (e) {
  30789. h = n
  30790. }
  30791. try {
  30792. u = "function" == typeof clearTimeout ? clearTimeout : r
  30793. } catch (e) {
  30794. u = r
  30795. }
  30796. }();
  30797. var p, f = [], g = !1, m = -1;
  30798. d.nextTick = function(e) {
  30799. var t = new Array(arguments.length - 1);
  30800. if (1 < arguments.length)
  30801. for (var i = 1; i < arguments.length; i++)
  30802. t[i - 1] = arguments[i];
  30803. f.push(new l(e,t)),
  30804. 1 !== f.length || g || o(s)
  30805. }
  30806. ,
  30807. l.prototype.run = function() {
  30808. this.fun.apply(null, this.array)
  30809. }
  30810. ,
  30811. d.title = "browser",
  30812. d.browser = !0,
  30813. d.env = {},
  30814. d.argv = [],
  30815. d.version = "",
  30816. d.versions = {},
  30817. d.on = c,
  30818. d.addListener = c,
  30819. d.once = c,
  30820. d.off = c,
  30821. d.removeListener = c,
  30822. d.removeAllListeners = c,
  30823. d.emit = c,
  30824. d.binding = function(e) {
  30825. throw new Error("process.binding is not supported")
  30826. }
  30827. ,
  30828. d.cwd = function() {
  30829. return "/"
  30830. }
  30831. ,
  30832. d.chdir = function(e) {
  30833. throw new Error("process.chdir is not supported")
  30834. }
  30835. ,
  30836. d.umask = function() {
  30837. return 0
  30838. }
  30839. }
  30840. , {}],
  30841. 204: [function(e, O, L) {
  30842. (function(P) {
  30843. !function(e) {
  30844. function v(e) {
  30845. throw new RangeError(g[e])
  30846. }
  30847. function r(e, t) {
  30848. for (var i = e.length, n = []; i--; )
  30849. n[i] = t(e[i]);
  30850. return n
  30851. }
  30852. function t(e, t) {
  30853. var i = e.split("@")
  30854. , n = "";
  30855. return 1 < i.length && (n = i[0] + "@",
  30856. e = i[1]),
  30857. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  30858. }
  30859. function y(e) {
  30860. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30861. 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),
  30862. r--) : n.push(t);
  30863. return n
  30864. }
  30865. function A(e) {
  30866. return r(e, function(e) {
  30867. var t = "";
  30868. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  30869. e = 56320 | 1023 & e),
  30870. t + R(e)
  30871. }).join("")
  30872. }
  30873. function C(e, t) {
  30874. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30875. }
  30876. function I(e, t, i) {
  30877. var n = 0;
  30878. for (e = i ? M(e / u) : e >> 1,
  30879. e += M(e / t); m * w >> 1 < e; n += _)
  30880. e = M(e / m);
  30881. return M(n + (m + 1) * e / (e + h))
  30882. }
  30883. function i(e) {
  30884. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  30885. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  30886. n = 0; n < i; ++n)
  30887. 128 <= e.charCodeAt(n) && v("not-basic"),
  30888. d.push(e.charCodeAt(n));
  30889. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  30890. for (o = f,
  30891. a = 1,
  30892. s = _; p <= r && v("invalid-input"),
  30893. u = e.charCodeAt(r++),
  30894. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  30895. f += l * a,
  30896. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  30897. a > M(E / (h = _ - c)) && v("overflow"),
  30898. a *= h;
  30899. m = I(f - o, t = d.length + 1, 0 == o),
  30900. M(f / t) > E - g && v("overflow"),
  30901. g += M(f / t),
  30902. f %= t,
  30903. d.splice(f++, 0, g)
  30904. }
  30905. return A(d)
  30906. }
  30907. function n(e) {
  30908. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  30909. for (d = (e = y(e)).length,
  30910. t = x,
  30911. o = T,
  30912. a = i = 0; a < d; ++a)
  30913. (u = e[a]) < 128 && m.push(R(u));
  30914. for (n = r = m.length,
  30915. r && m.push(S); n < d; ) {
  30916. for (s = E,
  30917. a = 0; a < d; ++a)
  30918. t <= (u = e[a]) && u < s && (s = u);
  30919. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  30920. i += (s - t) * p,
  30921. t = s,
  30922. a = 0; a < d; ++a)
  30923. if ((u = e[a]) < t && ++i > E && v("overflow"),
  30924. u == t) {
  30925. for (l = i,
  30926. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  30927. g = l - h,
  30928. f = _ - h,
  30929. m.push(R(C(h + g % f, 0))),
  30930. l = M(g / f);
  30931. m.push(R(C(l, 0))),
  30932. o = I(i, p, n == r),
  30933. i = 0,
  30934. ++n
  30935. }
  30936. ++i,
  30937. ++t
  30938. }
  30939. return m.join("")
  30940. }
  30941. var o = "object" == typeof L && L && !L.nodeType && L
  30942. , a = "object" == typeof O && O && !O.nodeType && O
  30943. , s = "object" == typeof P && P;
  30944. s.global !== s && s.window !== s && s.self !== s || (e = s);
  30945. 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 = {
  30946. overflow: "Overflow: input needs wider integers to process",
  30947. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30948. "invalid-input": "Invalid input"
  30949. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  30950. if (l = {
  30951. version: "1.4.1",
  30952. ucs2: {
  30953. decode: y,
  30954. encode: A
  30955. },
  30956. decode: i,
  30957. encode: n,
  30958. toASCII: function(e) {
  30959. return t(e, function(e) {
  30960. return p.test(e) ? "xn--" + n(e) : e
  30961. })
  30962. },
  30963. toUnicode: function(e) {
  30964. return t(e, function(e) {
  30965. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  30966. })
  30967. }
  30968. },
  30969. "function" == typeof define && "object" == typeof define.amd && define.amd)
  30970. define("punycode", function() {
  30971. return l
  30972. });
  30973. else if (o && a)
  30974. if (O.exports == o)
  30975. a.exports = l;
  30976. else
  30977. for (c in l)
  30978. l.hasOwnProperty(c) && (o[c] = l[c]);
  30979. else
  30980. e.punycode = l
  30981. }(this)
  30982. }
  30983. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30984. }
  30985. , {}],
  30986. 205: [function(e, t, i) {
  30987. "use strict";
  30988. t.exports = function(e, t, i, n) {
  30989. t = t || "&",
  30990. i = i || "=";
  30991. var r = {};
  30992. if ("string" != typeof e || 0 === e.length)
  30993. return r;
  30994. var o = /\+/g;
  30995. e = e.split(t);
  30996. var a = 1e3;
  30997. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  30998. var s, l, c = e.length;
  30999. 0 < a && a < c && (c = a);
  31000. for (var h = 0; h < c; ++h) {
  31001. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31002. d = 0 <= m ? (u = g.substr(0, m),
  31003. g.substr(m + 1)) : (u = g,
  31004. ""),
  31005. p = decodeURIComponent(u),
  31006. f = decodeURIComponent(d),
  31007. s = r,
  31008. l = p,
  31009. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31010. }
  31011. return r
  31012. }
  31013. ;
  31014. var v = Array.isArray || function(e) {
  31015. return "[object Array]" === Object.prototype.toString.call(e)
  31016. }
  31017. }
  31018. , {}],
  31019. 206: [function(e, t, i) {
  31020. "use strict";
  31021. function o(e, t) {
  31022. if (e.map)
  31023. return e.map(t);
  31024. for (var i = [], n = 0; n < e.length; n++)
  31025. i.push(t(e[n], n));
  31026. return i
  31027. }
  31028. function a(e) {
  31029. switch (typeof e) {
  31030. case "string":
  31031. return e;
  31032. case "boolean":
  31033. return e ? "true" : "false";
  31034. case "number":
  31035. return isFinite(e) ? e : "";
  31036. default:
  31037. return ""
  31038. }
  31039. }
  31040. t.exports = function(i, n, r, e) {
  31041. return n = n || "&",
  31042. r = r || "=",
  31043. null === i && (i = void 0),
  31044. "object" == typeof i ? o(l(i), function(e) {
  31045. var t = encodeURIComponent(a(e)) + r;
  31046. return s(i[e]) ? o(i[e], function(e) {
  31047. return t + encodeURIComponent(a(e))
  31048. }).join(n) : t + encodeURIComponent(a(i[e]))
  31049. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31050. }
  31051. ;
  31052. var s = Array.isArray || function(e) {
  31053. return "[object Array]" === Object.prototype.toString.call(e)
  31054. }
  31055. , l = Object.keys || function(e) {
  31056. var t = [];
  31057. for (var i in e)
  31058. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31059. return t
  31060. }
  31061. }
  31062. , {}],
  31063. 207: [function(e, t, i) {
  31064. "use strict";
  31065. i.decode = i.parse = e("./decode"),
  31066. i.encode = i.stringify = e("./encode")
  31067. }
  31068. , {
  31069. "./decode": 205,
  31070. "./encode": 206
  31071. }],
  31072. 208: [function(e, t, i) {
  31073. "use strict";
  31074. function x() {
  31075. this.protocol = null,
  31076. this.slashes = null,
  31077. this.auth = null,
  31078. this.host = null,
  31079. this.port = null,
  31080. this.hostname = null,
  31081. this.hash = null,
  31082. this.search = null,
  31083. this.query = null,
  31084. this.pathname = null,
  31085. this.path = null,
  31086. this.href = null
  31087. }
  31088. function n(e, t, i) {
  31089. if (e && D.isObject(e) && e instanceof x)
  31090. return e;
  31091. var n = new x;
  31092. return n.parse(e, t, i),
  31093. n
  31094. }
  31095. var L = e("punycode")
  31096. , D = e("./util");
  31097. i.parse = n,
  31098. i.resolve = function(e, t) {
  31099. return n(e, !1, !0).resolve(t)
  31100. }
  31101. ,
  31102. i.resolveObject = function(e, t) {
  31103. return e ? n(e, !1, !0).resolveObject(t) : t
  31104. }
  31105. ,
  31106. i.format = function(e) {
  31107. return D.isString(e) && (e = n(e)),
  31108. e instanceof x ? e.format() : x.prototype.format.call(e)
  31109. }
  31110. ,
  31111. i.Url = x;
  31112. var N = /^([a-z0-9.+-]+:)/i
  31113. , r = /:[0-9]*$/
  31114. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31115. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31116. , B = ["'"].concat(o)
  31117. , V = ["%", "/", "?", ";", "#"].concat(B)
  31118. , k = ["/", "?", "#"]
  31119. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31120. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31121. , z = {
  31122. javascript: !0,
  31123. "javascript:": !0
  31124. }
  31125. , G = {
  31126. javascript: !0,
  31127. "javascript:": !0
  31128. }
  31129. , W = {
  31130. http: !0,
  31131. https: !0,
  31132. ftp: !0,
  31133. gopher: !0,
  31134. file: !0,
  31135. "http:": !0,
  31136. "https:": !0,
  31137. "ftp:": !0,
  31138. "gopher:": !0,
  31139. "file:": !0
  31140. }
  31141. , j = e("querystring");
  31142. x.prototype.parse = function(e, t, i) {
  31143. if (!D.isString(e))
  31144. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31145. var n = e.indexOf("?")
  31146. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31147. , o = e.split(r);
  31148. o[0] = o[0].replace(/\\/g, "/");
  31149. var a = e = o.join(r);
  31150. if (a = a.trim(),
  31151. !i && 1 === e.split("#").length) {
  31152. var s = F.exec(a);
  31153. if (s)
  31154. return this.path = a,
  31155. this.href = a,
  31156. this.pathname = s[1],
  31157. s[2] ? (this.search = s[2],
  31158. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31159. this.query = {}),
  31160. this
  31161. }
  31162. var l = N.exec(a);
  31163. if (l) {
  31164. var c = (l = l[0]).toLowerCase();
  31165. this.protocol = c,
  31166. a = a.substr(l.length)
  31167. }
  31168. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31169. var h = "//" === a.substr(0, 2);
  31170. !h || l && G[l] || (a = a.substr(2),
  31171. this.slashes = !0)
  31172. }
  31173. if (!G[l] && (h || l && !W[l])) {
  31174. for (var u = -1, d = 0; d < k.length; d++) {
  31175. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31176. }
  31177. var p, f;
  31178. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31179. a = a.slice(f + 1),
  31180. this.auth = decodeURIComponent(p)),
  31181. u = -1;
  31182. for (d = 0; d < V.length; d++) {
  31183. var g;
  31184. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31185. }
  31186. -1 === u && (u = a.length),
  31187. this.host = a.slice(0, u),
  31188. a = a.slice(u),
  31189. this.parseHost(),
  31190. this.hostname = this.hostname || "";
  31191. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31192. if (!m)
  31193. for (var v = this.hostname.split(/\./), y = (d = 0,
  31194. v.length); d < y; d++) {
  31195. var A = v[d];
  31196. if (A && !A.match(U)) {
  31197. for (var C = "", I = 0, E = A.length; I < E; I++)
  31198. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31199. if (!C.match(U)) {
  31200. var _ = v.slice(0, d)
  31201. , b = v.slice(d + 1)
  31202. , w = A.match(H);
  31203. w && (_.push(w[1]),
  31204. b.unshift(w[2])),
  31205. b.length && (a = "/" + b.join(".") + a),
  31206. this.hostname = _.join(".");
  31207. break
  31208. }
  31209. }
  31210. }
  31211. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31212. m || (this.hostname = L.toASCII(this.hostname));
  31213. var T = this.port ? ":" + this.port : ""
  31214. , x = this.hostname || "";
  31215. this.host = x + T,
  31216. this.href += this.host,
  31217. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31218. "/" !== a[0] && (a = "/" + a))
  31219. }
  31220. if (!z[c])
  31221. for (d = 0,
  31222. y = B.length; d < y; d++) {
  31223. var S = B[d];
  31224. if (-1 !== a.indexOf(S)) {
  31225. var M = encodeURIComponent(S);
  31226. M === S && (M = escape(S)),
  31227. a = a.split(S).join(M)
  31228. }
  31229. }
  31230. var R = a.indexOf("#");
  31231. -1 !== R && (this.hash = a.substr(R),
  31232. a = a.slice(0, R));
  31233. var P = a.indexOf("?");
  31234. if (-1 !== P ? (this.search = a.substr(P),
  31235. this.query = a.substr(P + 1),
  31236. t && (this.query = j.parse(this.query)),
  31237. a = a.slice(0, P)) : t && (this.search = "",
  31238. this.query = {}),
  31239. a && (this.pathname = a),
  31240. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31241. this.pathname || this.search) {
  31242. T = this.pathname || "";
  31243. var O = this.search || "";
  31244. this.path = T + O
  31245. }
  31246. return this.href = this.format(),
  31247. this
  31248. }
  31249. ,
  31250. x.prototype.format = function() {
  31251. var e = this.auth || "";
  31252. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31253. e += "@");
  31254. var t = this.protocol || ""
  31255. , i = this.pathname || ""
  31256. , n = this.hash || ""
  31257. , r = !1
  31258. , o = "";
  31259. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31260. this.port && (r += ":" + this.port)),
  31261. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31262. var a = this.search || o && "?" + o || "";
  31263. return t && ":" !== t.substr(-1) && (t += ":"),
  31264. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31265. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31266. n && "#" !== n.charAt(0) && (n = "#" + n),
  31267. a && "?" !== a.charAt(0) && (a = "?" + a),
  31268. t + r + (i = i.replace(/[?#]/g, function(e) {
  31269. return encodeURIComponent(e)
  31270. })) + (a = a.replace("#", "%23")) + n
  31271. }
  31272. ,
  31273. x.prototype.resolve = function(e) {
  31274. return this.resolveObject(n(e, !1, !0)).format()
  31275. }
  31276. ,
  31277. x.prototype.resolveObject = function(e) {
  31278. if (D.isString(e)) {
  31279. var t = new x;
  31280. t.parse(e, !1, !0),
  31281. e = t
  31282. }
  31283. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31284. var o = n[r];
  31285. i[o] = this[o]
  31286. }
  31287. if (i.hash = e.hash,
  31288. "" === e.href)
  31289. return i.href = i.format(),
  31290. i;
  31291. if (e.slashes && !e.protocol) {
  31292. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31293. var l = a[s];
  31294. "protocol" !== l && (i[l] = e[l])
  31295. }
  31296. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31297. i.href = i.format(),
  31298. i
  31299. }
  31300. if (e.protocol && e.protocol !== i.protocol) {
  31301. if (!W[e.protocol]) {
  31302. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31303. var u = c[h];
  31304. i[u] = e[u]
  31305. }
  31306. return i.href = i.format(),
  31307. i
  31308. }
  31309. if (i.protocol = e.protocol,
  31310. e.host || G[e.protocol])
  31311. i.pathname = e.pathname;
  31312. else {
  31313. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31314. ;
  31315. e.host || (e.host = ""),
  31316. e.hostname || (e.hostname = ""),
  31317. "" !== d[0] && d.unshift(""),
  31318. d.length < 2 && d.unshift(""),
  31319. i.pathname = d.join("/")
  31320. }
  31321. if (i.search = e.search,
  31322. i.query = e.query,
  31323. i.host = e.host || "",
  31324. i.auth = e.auth,
  31325. i.hostname = e.hostname || e.host,
  31326. i.port = e.port,
  31327. i.pathname || i.search) {
  31328. var p = i.pathname || ""
  31329. , f = i.search || "";
  31330. i.path = p + f
  31331. }
  31332. return i.slashes = i.slashes || e.slashes,
  31333. i.href = i.format(),
  31334. i
  31335. }
  31336. var g = i.pathname && "/" === i.pathname.charAt(0)
  31337. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31338. , v = m || g || i.host && e.pathname
  31339. , y = v
  31340. , A = i.pathname && i.pathname.split("/") || []
  31341. , C = (d = e.pathname && e.pathname.split("/") || [],
  31342. i.protocol && !W[i.protocol]);
  31343. if (C && (i.hostname = "",
  31344. i.port = null,
  31345. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31346. i.host = "",
  31347. e.protocol && (e.hostname = null,
  31348. e.port = null,
  31349. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31350. e.host = null),
  31351. v = v && ("" === d[0] || "" === A[0])),
  31352. m)
  31353. i.host = e.host || "" === e.host ? e.host : i.host,
  31354. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31355. i.search = e.search,
  31356. i.query = e.query,
  31357. A = d;
  31358. else if (d.length)
  31359. (A = A || []).pop(),
  31360. A = A.concat(d),
  31361. i.search = e.search,
  31362. i.query = e.query;
  31363. else if (!D.isNullOrUndefined(e.search)) {
  31364. if (C)
  31365. i.hostname = i.host = A.shift(),
  31366. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31367. i.host = i.hostname = w.shift());
  31368. return i.search = e.search,
  31369. i.query = e.query,
  31370. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31371. i.href = i.format(),
  31372. i
  31373. }
  31374. if (!A.length)
  31375. return i.pathname = null,
  31376. i.search ? i.path = "/" + i.search : i.path = null,
  31377. i.href = i.format(),
  31378. i;
  31379. 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--)
  31380. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31381. _++) : _ && (A.splice(b, 1),
  31382. _--);
  31383. if (!v && !y)
  31384. for (; _--; )
  31385. A.unshift("..");
  31386. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31387. E && "/" !== A.join("/").substr(-1) && A.push("");
  31388. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31389. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31390. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31391. i.host = i.hostname = w.shift()));
  31392. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31393. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31394. i.path = null),
  31395. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31396. i.auth = e.auth || i.auth,
  31397. i.slashes = i.slashes || e.slashes,
  31398. i.href = i.format(),
  31399. i
  31400. }
  31401. ,
  31402. x.prototype.parseHost = function() {
  31403. var e = this.host
  31404. , t = r.exec(e);
  31405. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31406. e = e.substr(0, e.length - t.length)),
  31407. e && (this.hostname = e)
  31408. }
  31409. }
  31410. , {
  31411. "./util": 209,
  31412. punycode: 204,
  31413. querystring: 207
  31414. }],
  31415. 209: [function(e, t, i) {
  31416. "use strict";
  31417. t.exports = {
  31418. isString: function(e) {
  31419. return "string" == typeof e
  31420. },
  31421. isObject: function(e) {
  31422. return "object" == typeof e && null !== e
  31423. },
  31424. isNull: function(e) {
  31425. return null === e
  31426. },
  31427. isNullOrUndefined: function(e) {
  31428. return null == e
  31429. }
  31430. }
  31431. }
  31432. , {}],
  31433. 210: [function(e, t, i) {
  31434. "use strict";
  31435. function r(e) {
  31436. return c + e
  31437. }
  31438. function s(e) {
  31439. if ("string" != typeof e)
  31440. throw new TypeError("key must be a string.")
  31441. }
  31442. var l = Object.prototype.hasOwnProperty
  31443. , c = "~";
  31444. t.exports = function(t) {
  31445. var o = Object.create(null)
  31446. , n = 0
  31447. , a = {};
  31448. return function(e, t) {
  31449. for (var i in t)
  31450. Object.defineProperty(e, i, {
  31451. value: t[i],
  31452. configurable: !0,
  31453. writable: !0
  31454. })
  31455. }(a, {
  31456. get: function(e, t) {
  31457. s(e);
  31458. var i = r(e);
  31459. return i in o ? o[i] : t
  31460. },
  31461. set: function(e, t) {
  31462. s(e);
  31463. var i = r(e);
  31464. return i in o || ++n,
  31465. o[i] = t
  31466. },
  31467. has: function(e) {
  31468. return s(e),
  31469. r(e)in o
  31470. },
  31471. delete: function(e) {
  31472. s(e);
  31473. var t = r(e);
  31474. return t in o && (--n,
  31475. delete o[t],
  31476. !0)
  31477. },
  31478. clear: function() {
  31479. o = Object.create(null),
  31480. n = 0
  31481. },
  31482. forEach: function(e, t) {
  31483. if ("function" != typeof e)
  31484. throw new TypeError("`callback` must be a function");
  31485. for (var i in o)
  31486. if (l.call(o, i)) {
  31487. var n = i.substring(c.length)
  31488. , r = o[i];
  31489. e.call(t, r, n, a)
  31490. }
  31491. }
  31492. }),
  31493. Object.defineProperty(a, "size", {
  31494. get: function() {
  31495. return n
  31496. },
  31497. configurable: !0
  31498. }),
  31499. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31500. a.set(e, t[e])
  31501. }),
  31502. a
  31503. }
  31504. }
  31505. , {}],
  31506. 211: [function(e, t, i) {
  31507. t.exports = e("./lib/heap")
  31508. }
  31509. , {
  31510. "./lib/heap": 212
  31511. }],
  31512. 212: [function(e, y, A) {
  31513. (function() {
  31514. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31515. function v(e) {
  31516. this.cmp = null != e ? e : d,
  31517. this.nodes = []
  31518. }
  31519. l = Math.floor,
  31520. m = Math.min,
  31521. d = function(e, t) {
  31522. return e < t ? -1 : t < e ? 1 : 0
  31523. }
  31524. ,
  31525. g = function(e, t, i, n, r) {
  31526. var o;
  31527. if (null == i && (i = 0),
  31528. null == r && (r = d),
  31529. i < 0)
  31530. throw new Error("lo must be non-negative");
  31531. for (null == n && (n = e.length); i < n; )
  31532. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31533. return [].splice.apply(e, [i, i - i].concat(t)),
  31534. t
  31535. }
  31536. ,
  31537. t = function(e, t, i) {
  31538. return null == i && (i = d),
  31539. e.push(t),
  31540. h(e, 0, e.length - 1, i)
  31541. }
  31542. ,
  31543. f = function(e, t) {
  31544. var i, n;
  31545. return null == t && (t = d),
  31546. i = e.pop(),
  31547. e.length ? (n = e[0],
  31548. e[0] = i,
  31549. u(e, 0, t)) : n = i,
  31550. n
  31551. }
  31552. ,
  31553. i = function(e, t, i) {
  31554. var n;
  31555. return null == i && (i = d),
  31556. n = e[0],
  31557. e[0] = t,
  31558. u(e, 0, i),
  31559. n
  31560. }
  31561. ,
  31562. c = function(e, t, i) {
  31563. var n;
  31564. return null == i && (i = d),
  31565. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31566. e[0] = n[1],
  31567. u(e, 0, i)),
  31568. t
  31569. }
  31570. ,
  31571. p = function(i, e) {
  31572. var t, n, r, o, a, s;
  31573. for (null == e && (e = d),
  31574. a = [],
  31575. n = 0,
  31576. r = (o = function() {
  31577. s = [];
  31578. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31579. s.push(e);
  31580. return s
  31581. }
  31582. .apply(this).reverse()).length; n < r; n++)
  31583. t = o[n],
  31584. a.push(u(i, t, e));
  31585. return a
  31586. }
  31587. ,
  31588. o = function(e, t, i) {
  31589. var n;
  31590. if (null == i && (i = d),
  31591. -1 !== (n = e.indexOf(t)))
  31592. return h(e, 0, n, i),
  31593. u(e, n, i)
  31594. }
  31595. ,
  31596. n = function(e, t, i) {
  31597. var n, r, o, a, s;
  31598. if (null == i && (i = d),
  31599. !(r = e.slice(0, t)).length)
  31600. return r;
  31601. for (p(r, i),
  31602. o = 0,
  31603. a = (s = e.slice(t)).length; o < a; o++)
  31604. n = s[o],
  31605. c(r, n, i);
  31606. return r.sort(i).reverse()
  31607. }
  31608. ,
  31609. r = function(e, t, i) {
  31610. var n, r, o, a, s, l, c, h, u;
  31611. if (null == i && (i = d),
  31612. 10 * t <= e.length) {
  31613. if (!(o = e.slice(0, t).sort(i)).length)
  31614. return o;
  31615. for (r = o[o.length - 1],
  31616. a = 0,
  31617. l = (c = e.slice(t)).length; a < l; a++)
  31618. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31619. o.pop(),
  31620. r = o[o.length - 1]);
  31621. return o
  31622. }
  31623. for (p(e, i),
  31624. u = [],
  31625. s = 0,
  31626. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31627. u.push(f(e, i));
  31628. return u
  31629. }
  31630. ,
  31631. h = function(e, t, i, n) {
  31632. var r, o, a;
  31633. for (null == n && (n = d),
  31634. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31635. e[i] = o,
  31636. i = a;
  31637. return e[i] = r
  31638. }
  31639. ,
  31640. u = function(e, t, i) {
  31641. var n, r, o, a, s;
  31642. for (null == i && (i = d),
  31643. r = e.length,
  31644. o = e[s = t],
  31645. n = 2 * t + 1; n < r; )
  31646. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31647. e[t] = e[n],
  31648. n = 2 * (t = n) + 1;
  31649. return e[t] = o,
  31650. h(e, s, t, i)
  31651. }
  31652. ,
  31653. v.push = t,
  31654. v.pop = f,
  31655. v.replace = i,
  31656. v.pushpop = c,
  31657. v.heapify = p,
  31658. v.updateItem = o,
  31659. v.nlargest = n,
  31660. v.nsmallest = r,
  31661. v.prototype.push = function(e) {
  31662. return t(this.nodes, e, this.cmp)
  31663. }
  31664. ,
  31665. v.prototype.pop = function() {
  31666. return f(this.nodes, this.cmp)
  31667. }
  31668. ,
  31669. v.prototype.peek = function() {
  31670. return this.nodes[0]
  31671. }
  31672. ,
  31673. v.prototype.contains = function(e) {
  31674. return -1 !== this.nodes.indexOf(e)
  31675. }
  31676. ,
  31677. v.prototype.replace = function(e) {
  31678. return i(this.nodes, e, this.cmp)
  31679. }
  31680. ,
  31681. v.prototype.pushpop = function(e) {
  31682. return c(this.nodes, e, this.cmp)
  31683. }
  31684. ,
  31685. v.prototype.heapify = function() {
  31686. return p(this.nodes, this.cmp)
  31687. }
  31688. ,
  31689. v.prototype.updateItem = function(e) {
  31690. return o(this.nodes, e, this.cmp)
  31691. }
  31692. ,
  31693. v.prototype.clear = function() {
  31694. return this.nodes = []
  31695. }
  31696. ,
  31697. v.prototype.empty = function() {
  31698. return 0 === this.nodes.length
  31699. }
  31700. ,
  31701. v.prototype.size = function() {
  31702. return this.nodes.length
  31703. }
  31704. ,
  31705. v.prototype.clone = function() {
  31706. var e;
  31707. return (e = new v).nodes = this.nodes.slice(0),
  31708. e
  31709. }
  31710. ,
  31711. v.prototype.toArray = function() {
  31712. return this.nodes.slice(0)
  31713. }
  31714. ,
  31715. v.prototype.insert = v.prototype.push,
  31716. v.prototype.top = v.prototype.peek,
  31717. v.prototype.front = v.prototype.peek,
  31718. v.prototype.has = v.prototype.contains,
  31719. v.prototype.copy = v.prototype.clone,
  31720. e = v,
  31721. a = this,
  31722. s = function() {
  31723. return e
  31724. }
  31725. ,
  31726. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31727. }
  31728. ).call(this)
  31729. }
  31730. , {}],
  31731. 213: [function(e, t, i) {
  31732. function n() {}
  31733. function o(e) {
  31734. if ("object" != typeof this)
  31735. throw new TypeError("Promises must be constructed via new");
  31736. if ("function" != typeof e)
  31737. throw new TypeError("not a function");
  31738. this._state = 0,
  31739. this._handled = !1,
  31740. this._value = void 0,
  31741. this._deferreds = [],
  31742. h(e, this)
  31743. }
  31744. function r(i, n) {
  31745. for (; 3 === i._state; )
  31746. i = i._value;
  31747. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31748. void o._immediateFn(function() {
  31749. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31750. if (null !== e) {
  31751. var t;
  31752. try {
  31753. t = e(i._value)
  31754. } catch (e) {
  31755. return void s(n.promise, e)
  31756. }
  31757. a(n.promise, t)
  31758. } else
  31759. (1 === i._state ? a : s)(n.promise, i._value)
  31760. }))
  31761. }
  31762. function a(e, t) {
  31763. try {
  31764. if (t === e)
  31765. throw new TypeError("A promise cannot be resolved with itself.");
  31766. if (t && ("object" == typeof t || "function" == typeof t)) {
  31767. var i = t.then;
  31768. if (t instanceof o)
  31769. return e._state = 3,
  31770. e._value = t,
  31771. void l(e);
  31772. if ("function" == typeof i)
  31773. return void h(function(e, t) {
  31774. return function() {
  31775. e.apply(t, arguments)
  31776. }
  31777. }(i, t), e)
  31778. }
  31779. e._state = 1,
  31780. e._value = t,
  31781. l(e)
  31782. } catch (t) {
  31783. s(e, t)
  31784. }
  31785. }
  31786. function s(e, t) {
  31787. e._state = 2,
  31788. e._value = t,
  31789. l(e)
  31790. }
  31791. function l(e) {
  31792. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  31793. e._handled || o._unhandledRejectionFn(e._value)
  31794. });
  31795. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31796. r(e, e._deferreds[t]);
  31797. e._deferreds = null
  31798. }
  31799. function c(e, t, i) {
  31800. this.onFulfilled = "function" == typeof e ? e : null,
  31801. this.onRejected = "function" == typeof t ? t : null,
  31802. this.promise = i
  31803. }
  31804. function h(e, t) {
  31805. var i = !1;
  31806. try {
  31807. e(function(e) {
  31808. i || (i = !0,
  31809. a(t, e))
  31810. }, function(e) {
  31811. i || (i = !0,
  31812. s(t, e))
  31813. })
  31814. } catch (e) {
  31815. if (i)
  31816. return;
  31817. i = !0,
  31818. s(t, e)
  31819. }
  31820. }
  31821. var u, d;
  31822. u = this,
  31823. d = setTimeout,
  31824. o.prototype.catch = function(e) {
  31825. return this.then(null, e)
  31826. }
  31827. ,
  31828. o.prototype.then = function(e, t) {
  31829. var i = new this.constructor(n);
  31830. return r(this, new c(e,t,i)),
  31831. i
  31832. }
  31833. ,
  31834. o.all = function(e) {
  31835. var s = Array.prototype.slice.call(e);
  31836. return new o(function(n, r) {
  31837. function o(t, e) {
  31838. try {
  31839. if (e && ("object" == typeof e || "function" == typeof e)) {
  31840. var i = e.then;
  31841. if ("function" == typeof i)
  31842. return void i.call(e, function(e) {
  31843. o(t, e)
  31844. }, r)
  31845. }
  31846. s[t] = e,
  31847. 0 == --a && n(s)
  31848. } catch (e) {
  31849. r(e)
  31850. }
  31851. }
  31852. if (0 === s.length)
  31853. return n([]);
  31854. for (var a = s.length, e = 0; e < s.length; e++)
  31855. o(e, s[e])
  31856. }
  31857. )
  31858. }
  31859. ,
  31860. o.resolve = function(t) {
  31861. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  31862. e(t)
  31863. }
  31864. )
  31865. }
  31866. ,
  31867. o.reject = function(i) {
  31868. return new o(function(e, t) {
  31869. t(i)
  31870. }
  31871. )
  31872. }
  31873. ,
  31874. o.race = function(r) {
  31875. return new o(function(e, t) {
  31876. for (var i = 0, n = r.length; i < n; i++)
  31877. r[i].then(e, t)
  31878. }
  31879. )
  31880. }
  31881. ,
  31882. o._immediateFn = "function" == typeof setImmediate && function(e) {
  31883. setImmediate(e)
  31884. }
  31885. || function(e) {
  31886. d(e, 0)
  31887. }
  31888. ,
  31889. o._unhandledRejectionFn = function(e) {
  31890. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31891. }
  31892. ,
  31893. o._setImmediateFn = function(e) {
  31894. o._immediateFn = e
  31895. }
  31896. ,
  31897. o._setUnhandledRejectionFn = function(e) {
  31898. o._unhandledRejectionFn = e
  31899. }
  31900. ,
  31901. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  31902. }
  31903. , {}],
  31904. 214: [function(p, i, e) {
  31905. (function(d) {
  31906. var e, t;
  31907. e = this,
  31908. t = function(I, e) {
  31909. "use strict";
  31910. var a, t, u, i, s, n, r, o = {};
  31911. return o.ByteBuffer = I,
  31912. o.Long = I.Long || null,
  31913. o.VERSION = "5.0.1",
  31914. o.WIRE_TYPES = {},
  31915. o.WIRE_TYPES.VARINT = 0,
  31916. o.WIRE_TYPES.BITS64 = 1,
  31917. o.WIRE_TYPES.LDELIM = 2,
  31918. o.WIRE_TYPES.STARTGROUP = 3,
  31919. o.WIRE_TYPES.ENDGROUP = 4,
  31920. o.WIRE_TYPES.BITS32 = 5,
  31921. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  31922. o.TYPES = {
  31923. int32: {
  31924. name: "int32",
  31925. wireType: o.WIRE_TYPES.VARINT,
  31926. defaultValue: 0
  31927. },
  31928. uint32: {
  31929. name: "uint32",
  31930. wireType: o.WIRE_TYPES.VARINT,
  31931. defaultValue: 0
  31932. },
  31933. sint32: {
  31934. name: "sint32",
  31935. wireType: o.WIRE_TYPES.VARINT,
  31936. defaultValue: 0
  31937. },
  31938. int64: {
  31939. name: "int64",
  31940. wireType: o.WIRE_TYPES.VARINT,
  31941. defaultValue: o.Long ? o.Long.ZERO : void 0
  31942. },
  31943. uint64: {
  31944. name: "uint64",
  31945. wireType: o.WIRE_TYPES.VARINT,
  31946. defaultValue: o.Long ? o.Long.UZERO : void 0
  31947. },
  31948. sint64: {
  31949. name: "sint64",
  31950. wireType: o.WIRE_TYPES.VARINT,
  31951. defaultValue: o.Long ? o.Long.ZERO : void 0
  31952. },
  31953. bool: {
  31954. name: "bool",
  31955. wireType: o.WIRE_TYPES.VARINT,
  31956. defaultValue: !1
  31957. },
  31958. double: {
  31959. name: "double",
  31960. wireType: o.WIRE_TYPES.BITS64,
  31961. defaultValue: 0
  31962. },
  31963. string: {
  31964. name: "string",
  31965. wireType: o.WIRE_TYPES.LDELIM,
  31966. defaultValue: ""
  31967. },
  31968. bytes: {
  31969. name: "bytes",
  31970. wireType: o.WIRE_TYPES.LDELIM,
  31971. defaultValue: null
  31972. },
  31973. fixed32: {
  31974. name: "fixed32",
  31975. wireType: o.WIRE_TYPES.BITS32,
  31976. defaultValue: 0
  31977. },
  31978. sfixed32: {
  31979. name: "sfixed32",
  31980. wireType: o.WIRE_TYPES.BITS32,
  31981. defaultValue: 0
  31982. },
  31983. fixed64: {
  31984. name: "fixed64",
  31985. wireType: o.WIRE_TYPES.BITS64,
  31986. defaultValue: o.Long ? o.Long.UZERO : void 0
  31987. },
  31988. sfixed64: {
  31989. name: "sfixed64",
  31990. wireType: o.WIRE_TYPES.BITS64,
  31991. defaultValue: o.Long ? o.Long.ZERO : void 0
  31992. },
  31993. float: {
  31994. name: "float",
  31995. wireType: o.WIRE_TYPES.BITS32,
  31996. defaultValue: 0
  31997. },
  31998. enum: {
  31999. name: "enum",
  32000. wireType: o.WIRE_TYPES.VARINT,
  32001. defaultValue: 0
  32002. },
  32003. message: {
  32004. name: "message",
  32005. wireType: o.WIRE_TYPES.LDELIM,
  32006. defaultValue: null
  32007. },
  32008. group: {
  32009. name: "group",
  32010. wireType: o.WIRE_TYPES.STARTGROUP,
  32011. defaultValue: null
  32012. }
  32013. },
  32014. 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],
  32015. o.ID_MIN = 1,
  32016. o.ID_MAX = 536870911,
  32017. o.convertFieldsToCamelCase = !1,
  32018. o.populateAccessors = !0,
  32019. o.populateDefaults = !0,
  32020. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32021. r.XHR = function() {
  32022. for (var e = [function() {
  32023. return new XMLHttpRequest
  32024. }
  32025. , function() {
  32026. return new ActiveXObject("Msxml2.XMLHTTP")
  32027. }
  32028. , function() {
  32029. return new ActiveXObject("Msxml3.XMLHTTP")
  32030. }
  32031. , function() {
  32032. return new ActiveXObject("Microsoft.XMLHTTP")
  32033. }
  32034. ], t = null, i = 0; i < e.length; i++) {
  32035. try {
  32036. t = e[i]()
  32037. } catch (e) {
  32038. continue
  32039. }
  32040. break
  32041. }
  32042. if (!t)
  32043. throw Error("XMLHttpRequest is not supported");
  32044. return t
  32045. }
  32046. ,
  32047. r.fetch = function(e, i) {
  32048. if (i && "function" != typeof i && (i = null),
  32049. r.IS_NODE) {
  32050. var t = p("fs");
  32051. if (i)
  32052. t.readFile(e, function(e, t) {
  32053. i(e ? null : "" + t)
  32054. });
  32055. else
  32056. try {
  32057. return t.readFileSync(e)
  32058. } catch (e) {
  32059. return null
  32060. }
  32061. } else {
  32062. var n = r.XHR();
  32063. if (n.open("GET", e, !!i),
  32064. n.setRequestHeader("Accept", "text/plain"),
  32065. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32066. !i)
  32067. return n.send(null),
  32068. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32069. if (n.onreadystatechange = function() {
  32070. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32071. }
  32072. ,
  32073. 4 == n.readyState)
  32074. return;
  32075. n.send(null)
  32076. }
  32077. }
  32078. ,
  32079. r.toCamelCase = function(e) {
  32080. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32081. return t.toUpperCase()
  32082. })
  32083. }
  32084. ,
  32085. r),
  32086. o.Lang = {
  32087. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32088. RULE: /^(?:required|optional|repeated|map)$/,
  32089. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32090. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32091. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32092. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32093. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32094. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32095. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32096. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32097. NUMBER_OCT: /^0[0-7]+$/,
  32098. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32099. BOOL: /^(?:true|false)$/i,
  32100. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32101. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32102. WHITESPACE: /\s/,
  32103. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32104. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32105. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32106. },
  32107. o.DotProto = function(r, a) {
  32108. function s(e, t) {
  32109. var i = -1
  32110. , n = 1;
  32111. if ("-" == e.charAt(0) && (n = -1,
  32112. e = e.substring(1)),
  32113. a.NUMBER_DEC.test(e))
  32114. i = parseInt(e);
  32115. else if (a.NUMBER_HEX.test(e))
  32116. i = parseInt(e.substring(2), 16);
  32117. else {
  32118. if (!a.NUMBER_OCT.test(e))
  32119. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32120. i = parseInt(e.substring(1), 8)
  32121. }
  32122. if (i = n * i | 0,
  32123. !t && i < 0)
  32124. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32125. return i
  32126. }
  32127. function o(e) {
  32128. var t = 1;
  32129. if ("-" == e.charAt(0) && (t = -1,
  32130. e = e.substring(1)),
  32131. a.NUMBER_DEC.test(e))
  32132. return t * parseInt(e, 10);
  32133. if (a.NUMBER_HEX.test(e))
  32134. return t * parseInt(e.substring(2), 16);
  32135. if (a.NUMBER_OCT.test(e))
  32136. return t * parseInt(e.substring(1), 8);
  32137. if ("inf" === e)
  32138. return t * (1 / 0);
  32139. if ("nan" === e)
  32140. return NaN;
  32141. if (a.NUMBER_FLT.test(e))
  32142. return t * parseFloat(e);
  32143. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32144. }
  32145. function n(e, t, i) {
  32146. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32147. e[t].push(i))
  32148. }
  32149. function t(e) {
  32150. this.source = e + "",
  32151. this.index = 0,
  32152. this.line = 1,
  32153. this.stack = [],
  32154. this._stringOpen = null
  32155. }
  32156. var e = {}
  32157. , i = t.prototype;
  32158. i._readString = function() {
  32159. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32160. e.lastIndex = this.index - 1;
  32161. var t = e.exec(this.source);
  32162. if (!t)
  32163. throw Error("unterminated string");
  32164. return this.index = e.lastIndex,
  32165. this.stack.push(this._stringOpen),
  32166. this._stringOpen = null,
  32167. t[1]
  32168. }
  32169. ,
  32170. i.next = function() {
  32171. if (0 < this.stack.length)
  32172. return this.stack.shift();
  32173. if (this.index >= this.source.length)
  32174. return null;
  32175. if (null !== this._stringOpen)
  32176. return this._readString();
  32177. var e, t, i;
  32178. do {
  32179. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32180. if ("\n" === i && ++this.line,
  32181. ++this.index === this.source.length)
  32182. return null;
  32183. if ("/" === this.source.charAt(this.index))
  32184. if (++this.index,
  32185. "/" === this.source.charAt(this.index)) {
  32186. for (; "\n" !== this.source.charAt(++this.index); )
  32187. if (this.index == this.source.length)
  32188. return null;
  32189. ++this.index,
  32190. ++this.line,
  32191. e = !0
  32192. } else {
  32193. if ("*" !== (i = this.source.charAt(this.index)))
  32194. return "/";
  32195. do {
  32196. if ("\n" === i && ++this.line,
  32197. ++this.index === this.source.length)
  32198. return null;
  32199. t = i,
  32200. i = this.source.charAt(this.index)
  32201. } while ("*" !== t || "/" !== i);++this.index,
  32202. e = !0
  32203. }
  32204. } while (e);if (this.index === this.source.length)
  32205. return null;
  32206. var n = this.index;
  32207. if (a.DELIM.lastIndex = 0,
  32208. !a.DELIM.test(this.source.charAt(n++)))
  32209. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32210. ++n;
  32211. var r = this.source.substring(this.index, this.index = n);
  32212. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32213. r
  32214. }
  32215. ,
  32216. i.peek = function() {
  32217. if (0 === this.stack.length) {
  32218. var e = this.next();
  32219. if (null === e)
  32220. return null;
  32221. this.stack.push(e)
  32222. }
  32223. return this.stack[0]
  32224. }
  32225. ,
  32226. i.skip = function(e) {
  32227. var t = this.next();
  32228. if (t !== e)
  32229. throw Error("illegal '" + t + "', '" + e + "' expected")
  32230. }
  32231. ,
  32232. i.omit = function(e) {
  32233. return this.peek() === e && (this.next(),
  32234. !0)
  32235. }
  32236. ,
  32237. i.toString = function() {
  32238. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32239. }
  32240. ,
  32241. e.Tokenizer = t;
  32242. function l(e) {
  32243. this.tn = new t(e),
  32244. this.proto3 = !1
  32245. }
  32246. var c = l.prototype;
  32247. return c.parse = function() {
  32248. var e, t, i = {
  32249. name: "[ROOT]",
  32250. package: null,
  32251. messages: [],
  32252. enums: [],
  32253. imports: [],
  32254. options: {},
  32255. services: []
  32256. }, n = !0;
  32257. try {
  32258. for (; e = this.tn.next(); )
  32259. switch (e) {
  32260. case "package":
  32261. if (!n || null !== i.package)
  32262. throw Error("unexpected 'package'");
  32263. if (e = this.tn.next(),
  32264. !a.TYPEREF.test(e))
  32265. throw Error("illegal package name: " + e);
  32266. this.tn.skip(";"),
  32267. i.package = e;
  32268. break;
  32269. case "import":
  32270. if (!n)
  32271. throw Error("unexpected 'import'");
  32272. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32273. e = this._readString(),
  32274. this.tn.skip(";"),
  32275. t || i.imports.push(e);
  32276. break;
  32277. case "syntax":
  32278. if (!n)
  32279. throw Error("unexpected 'syntax'");
  32280. this.tn.skip("="),
  32281. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32282. this.tn.skip(";");
  32283. break;
  32284. case "message":
  32285. this._parseMessage(i, null),
  32286. n = !1;
  32287. break;
  32288. case "enum":
  32289. this._parseEnum(i),
  32290. n = !1;
  32291. break;
  32292. case "option":
  32293. this._parseOption(i);
  32294. break;
  32295. case "service":
  32296. this._parseService(i);
  32297. break;
  32298. case "extend":
  32299. this._parseExtend(i);
  32300. break;
  32301. default:
  32302. throw Error("unexpected '" + e + "'")
  32303. }
  32304. } catch (e) {
  32305. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32306. e
  32307. }
  32308. return delete i.name,
  32309. i
  32310. }
  32311. ,
  32312. l.parse = function(e) {
  32313. return new l(e).parse()
  32314. }
  32315. ,
  32316. c._readString = function() {
  32317. var e, t, i = "";
  32318. do {
  32319. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32320. throw Error("illegal string delimiter: " + t);
  32321. i += this.tn.next(),
  32322. this.tn.skip(t),
  32323. e = this.tn.peek()
  32324. } while ('"' === e || '"' === e);return i
  32325. }
  32326. ,
  32327. c._readValue = function(e) {
  32328. var t = this.tn.peek();
  32329. if ('"' === t || "'" === t)
  32330. return this._readString();
  32331. if (this.tn.next(),
  32332. a.NUMBER.test(t))
  32333. return o(t);
  32334. if (a.BOOL.test(t))
  32335. return "true" === t.toLowerCase();
  32336. if (e && a.TYPEREF.test(t))
  32337. return t;
  32338. throw Error("illegal value: " + t)
  32339. }
  32340. ,
  32341. c._parseOption = function(e, t) {
  32342. var i = this.tn.next()
  32343. , n = !1;
  32344. if ("(" === i && (n = !0,
  32345. i = this.tn.next()),
  32346. !a.TYPEREF.test(i))
  32347. throw Error("illegal option name: " + i);
  32348. var r = i;
  32349. n && (this.tn.skip(")"),
  32350. r = "(" + r + ")",
  32351. i = this.tn.peek(),
  32352. a.FQTYPEREF.test(i) && (r += i,
  32353. this.tn.next())),
  32354. this.tn.skip("="),
  32355. this._parseOptionValue(e, r),
  32356. t || this.tn.skip(";")
  32357. }
  32358. ,
  32359. c._parseOptionValue = function(e, t) {
  32360. var i = this.tn.peek();
  32361. if ("{" !== i)
  32362. n(e.options, t, this._readValue(!0));
  32363. else
  32364. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32365. if (!a.NAME.test(i))
  32366. throw Error("illegal option name: " + t + "." + i);
  32367. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32368. }
  32369. }
  32370. ,
  32371. c._parseService = function(e) {
  32372. var t = this.tn.next();
  32373. if (!a.NAME.test(t))
  32374. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32375. var i = {
  32376. name: t,
  32377. rpc: {},
  32378. options: {}
  32379. };
  32380. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32381. if ("option" === t)
  32382. this._parseOption(i);
  32383. else {
  32384. if ("rpc" !== t)
  32385. throw Error("illegal service token: " + t);
  32386. this._parseServiceRPC(i)
  32387. }
  32388. this.tn.omit(";"),
  32389. e.services.push(i)
  32390. }
  32391. ,
  32392. c._parseServiceRPC = function(e) {
  32393. var t = this.tn.next();
  32394. if (!a.NAME.test(t))
  32395. throw Error("illegal rpc service method name: " + t);
  32396. var i = t
  32397. , n = {
  32398. request: null,
  32399. response: null,
  32400. request_stream: !1,
  32401. response_stream: !1,
  32402. options: {}
  32403. };
  32404. if (this.tn.skip("("),
  32405. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32406. t = this.tn.next()),
  32407. !a.TYPEREF.test(t))
  32408. throw Error("illegal rpc service request type: " + t);
  32409. if (n.request = t,
  32410. this.tn.skip(")"),
  32411. "returns" !== (t = this.tn.next()).toLowerCase())
  32412. throw Error("illegal rpc service request type delimiter: " + t);
  32413. if (this.tn.skip("("),
  32414. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32415. t = this.tn.next()),
  32416. n.response = t,
  32417. this.tn.skip(")"),
  32418. "{" === (t = this.tn.peek())) {
  32419. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32420. if ("option" !== t)
  32421. throw Error("illegal rpc service token: " + t);
  32422. this._parseOption(n)
  32423. }
  32424. this.tn.omit(";")
  32425. } else
  32426. this.tn.skip(";");
  32427. void 0 === e.rpc && (e.rpc = {}),
  32428. e.rpc[i] = n
  32429. }
  32430. ,
  32431. c._parseMessage = function(e, t) {
  32432. var i = !!t
  32433. , n = this.tn.next()
  32434. , r = {
  32435. name: "",
  32436. fields: [],
  32437. enums: [],
  32438. messages: [],
  32439. options: {},
  32440. services: [],
  32441. oneofs: {}
  32442. };
  32443. if (!a.NAME.test(n))
  32444. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32445. for (r.name = n,
  32446. i && (this.tn.skip("="),
  32447. t.id = s(this.tn.next()),
  32448. r.isGroup = !0),
  32449. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32450. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32451. if (a.RULE.test(n))
  32452. this._parseMessageField(r, n);
  32453. else if ("oneof" === n)
  32454. this._parseMessageOneOf(r);
  32455. else if ("enum" === n)
  32456. this._parseEnum(r);
  32457. else if ("message" === n)
  32458. this._parseMessage(r);
  32459. else if ("option" === n)
  32460. this._parseOption(r);
  32461. else if ("service" === n)
  32462. this._parseService(r);
  32463. else if ("extensions" === n)
  32464. r.extensions = this._parseExtensionRanges();
  32465. else if ("reserved" === n)
  32466. this._parseIgnored();
  32467. else if ("extend" === n)
  32468. this._parseExtend(r);
  32469. else {
  32470. if (!a.TYPEREF.test(n))
  32471. throw Error("illegal message token: " + n);
  32472. if (!this.proto3)
  32473. throw Error("illegal field rule: " + n);
  32474. this._parseMessageField(r, "optional", n)
  32475. }
  32476. return this.tn.omit(";"),
  32477. e.messages.push(r),
  32478. r
  32479. }
  32480. ,
  32481. c._parseIgnored = function() {
  32482. for (; ";" !== this.tn.peek(); )
  32483. this.tn.next();
  32484. this.tn.skip(";")
  32485. }
  32486. ,
  32487. c._parseMessageField = function(e, t, i) {
  32488. if (!a.RULE.test(t))
  32489. throw Error("illegal message field rule: " + t);
  32490. var n, r = {
  32491. rule: t,
  32492. type: "",
  32493. name: "",
  32494. options: {},
  32495. id: 0
  32496. };
  32497. if ("map" === t) {
  32498. if (i)
  32499. throw Error("illegal type: " + i);
  32500. if (this.tn.skip("<"),
  32501. n = this.tn.next(),
  32502. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32503. throw Error("illegal message field type: " + n);
  32504. if (r.keytype = n,
  32505. this.tn.skip(","),
  32506. n = this.tn.next(),
  32507. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32508. throw Error("illegal message field: " + n);
  32509. if (r.type = n,
  32510. this.tn.skip(">"),
  32511. n = this.tn.next(),
  32512. !a.NAME.test(n))
  32513. throw Error("illegal message field name: " + n);
  32514. r.name = n,
  32515. this.tn.skip("="),
  32516. r.id = s(this.tn.next()),
  32517. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32518. this.tn.skip(";")
  32519. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32520. var o = this._parseMessage(e, r);
  32521. if (!/^[A-Z]/.test(o.name))
  32522. throw Error("illegal group name: " + o.name);
  32523. r.type = o.name,
  32524. r.name = o.name.toLowerCase(),
  32525. this.tn.omit(";")
  32526. } else {
  32527. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32528. throw Error("illegal message field type: " + i);
  32529. if (r.type = i,
  32530. n = this.tn.next(),
  32531. !a.NAME.test(n))
  32532. throw Error("illegal message field name: " + n);
  32533. r.name = n,
  32534. this.tn.skip("="),
  32535. r.id = s(this.tn.next()),
  32536. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32537. this.tn.skip(";")
  32538. }
  32539. return e.fields.push(r),
  32540. r
  32541. }
  32542. ,
  32543. c._parseMessageOneOf = function(e) {
  32544. var t = this.tn.next();
  32545. if (!a.NAME.test(t))
  32546. throw Error("illegal oneof name: " + t);
  32547. var i, n = t, r = [];
  32548. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32549. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32550. r.push(i.id);
  32551. this.tn.omit(";"),
  32552. e.oneofs[n] = r
  32553. }
  32554. ,
  32555. c._parseFieldOptions = function(e) {
  32556. this.tn.skip("[");
  32557. for (var t = !0; "]" !== this.tn.peek(); )
  32558. t || this.tn.skip(","),
  32559. this._parseOption(e, !0),
  32560. t = !1;
  32561. this.tn.next()
  32562. }
  32563. ,
  32564. c._parseEnum = function(e) {
  32565. var t = {
  32566. name: "",
  32567. values: [],
  32568. options: {}
  32569. }
  32570. , i = this.tn.next();
  32571. if (!a.NAME.test(i))
  32572. throw Error("illegal name: " + i);
  32573. for (t.name = i,
  32574. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32575. if ("option" === i)
  32576. this._parseOption(t);
  32577. else {
  32578. if (!a.NAME.test(i))
  32579. throw Error("illegal name: " + i);
  32580. this.tn.skip("=");
  32581. var n = {
  32582. name: i,
  32583. id: s(this.tn.next(), !0)
  32584. };
  32585. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32586. options: {}
  32587. }),
  32588. this.tn.skip(";"),
  32589. t.values.push(n)
  32590. }
  32591. this.tn.omit(";"),
  32592. e.enums.push(t)
  32593. }
  32594. ,
  32595. c._parseExtensionRanges = function() {
  32596. var e, t, i, n = [];
  32597. do {
  32598. for (t = []; ; ) {
  32599. switch (e = this.tn.next()) {
  32600. case "min":
  32601. i = r.ID_MIN;
  32602. break;
  32603. case "max":
  32604. i = r.ID_MAX;
  32605. break;
  32606. default:
  32607. i = o(e)
  32608. }
  32609. if (t.push(i),
  32610. 2 === t.length)
  32611. break;
  32612. if ("to" !== this.tn.peek()) {
  32613. t.push(i);
  32614. break
  32615. }
  32616. this.tn.next()
  32617. }
  32618. n.push(t)
  32619. } while (this.tn.omit(","));return this.tn.skip(";"),
  32620. n
  32621. }
  32622. ,
  32623. c._parseExtend = function(e) {
  32624. var t = this.tn.next();
  32625. if (!a.TYPEREF.test(t))
  32626. throw Error("illegal extend reference: " + t);
  32627. var i = {
  32628. ref: t,
  32629. fields: []
  32630. };
  32631. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32632. if (a.RULE.test(t))
  32633. this._parseMessageField(i, t);
  32634. else {
  32635. if (!a.TYPEREF.test(t))
  32636. throw Error("illegal extend token: " + t);
  32637. if (!this.proto3)
  32638. throw Error("illegal field rule: " + t);
  32639. this._parseMessageField(i, "optional", t)
  32640. }
  32641. return this.tn.omit(";"),
  32642. e.messages.push(i),
  32643. i
  32644. }
  32645. ,
  32646. c.toString = function() {
  32647. return "Parser at line " + this.tn.line
  32648. }
  32649. ,
  32650. e.Parser = l,
  32651. e
  32652. }(o, o.Lang),
  32653. o.Reflect = function(g) {
  32654. function a(e, t) {
  32655. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32656. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32657. if ("string" == typeof e)
  32658. return g.Long.fromString(e, t || !1, 10);
  32659. if ("number" == typeof e)
  32660. return g.Long.fromNumber(e, t || !1);
  32661. throw Error("not convertible to Long")
  32662. }
  32663. function m(e, t) {
  32664. var i = t.readVarint32()
  32665. , n = 7 & i
  32666. , r = i >>> 3;
  32667. switch (n) {
  32668. case g.WIRE_TYPES.VARINT:
  32669. for (; 128 == (128 & (i = t.readUint8())); )
  32670. ;
  32671. break;
  32672. case g.WIRE_TYPES.BITS64:
  32673. t.offset += 8;
  32674. break;
  32675. case g.WIRE_TYPES.LDELIM:
  32676. i = t.readVarint32(),
  32677. t.offset += i;
  32678. break;
  32679. case g.WIRE_TYPES.STARTGROUP:
  32680. m(r, t);
  32681. break;
  32682. case g.WIRE_TYPES.ENDGROUP:
  32683. if (r === e)
  32684. return !1;
  32685. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32686. case g.WIRE_TYPES.BITS32:
  32687. t.offset += 4;
  32688. break;
  32689. default:
  32690. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32691. }
  32692. return !0
  32693. }
  32694. function h(e, t, i) {
  32695. this.builder = e,
  32696. this.parent = t,
  32697. this.name = i,
  32698. this.className
  32699. }
  32700. var s = {}
  32701. , e = h.prototype;
  32702. e.fqn = function() {
  32703. for (var e = this.name, t = this; null != (t = t.parent); )
  32704. e = t.name + "." + e;
  32705. return e
  32706. }
  32707. ,
  32708. e.toString = function(e) {
  32709. return (e ? this.className + " " : "") + this.fqn()
  32710. }
  32711. ,
  32712. e.build = function() {
  32713. throw Error(this.toString(!0) + " cannot be built directly")
  32714. }
  32715. ,
  32716. s.T = h;
  32717. function l(e, t, i, n, r) {
  32718. h.call(this, e, t, i),
  32719. this.className = "Namespace",
  32720. this.children = [],
  32721. this.options = n || {},
  32722. this.syntax = r || "proto2"
  32723. }
  32724. var t = l.prototype = Object.create(h.prototype);
  32725. t.getChildren = function(e) {
  32726. if (null == (e = e || null))
  32727. return this.children.slice();
  32728. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32729. this.children[i]instanceof e && t.push(this.children[i]);
  32730. return t
  32731. }
  32732. ,
  32733. t.addChild = function(e) {
  32734. var t;
  32735. if (t = this.getChild(e.name))
  32736. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32737. t.name = t.originalName;
  32738. else {
  32739. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32740. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32741. e.name = e.originalName
  32742. }
  32743. this.children.push(e)
  32744. }
  32745. ,
  32746. t.getChild = function(e) {
  32747. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32748. if (this.children[i][t] === e)
  32749. return this.children[i];
  32750. return null
  32751. }
  32752. ,
  32753. t.resolve = function(e, t) {
  32754. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32755. if ("" === n[o]) {
  32756. for (; null !== r.parent; )
  32757. r = r.parent;
  32758. o++
  32759. }
  32760. do {
  32761. do {
  32762. if (!(r instanceof s.Namespace)) {
  32763. r = null;
  32764. break
  32765. }
  32766. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32767. r = null;
  32768. break
  32769. }
  32770. r = i,
  32771. o++
  32772. } while (o < n.length);if (null != r)
  32773. break;
  32774. if (null !== this.parent)
  32775. return this.parent.resolve(e, t)
  32776. } while (null != r);return r
  32777. }
  32778. ,
  32779. t.qn = function(e) {
  32780. for (var t = [], i = e; t.unshift(i.name),
  32781. null !== (i = i.parent); )
  32782. ;
  32783. for (var n = 1; n <= t.length; n++) {
  32784. var r = t.slice(t.length - n);
  32785. if (e === this.resolve(r, e instanceof s.Namespace))
  32786. return r.join(".")
  32787. }
  32788. return e.fqn()
  32789. }
  32790. ,
  32791. t.build = function() {
  32792. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32793. (e = i[n])instanceof l && (t[e.name] = e.build());
  32794. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32795. value: this.buildOpt()
  32796. }),
  32797. t
  32798. }
  32799. ,
  32800. t.buildOpt = function() {
  32801. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32802. var r = t[i]
  32803. , o = this.options[t[i]];
  32804. e[r] = o
  32805. }
  32806. return e
  32807. }
  32808. ,
  32809. t.getOption = function(e) {
  32810. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32811. }
  32812. ,
  32813. s.Namespace = l;
  32814. function u(e, t, i, n) {
  32815. if (this.type = e,
  32816. this.resolvedType = t,
  32817. this.isMapKey = i,
  32818. this.syntax = n,
  32819. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  32820. throw Error("Invalid map key type: " + e.name)
  32821. }
  32822. var i = u.prototype;
  32823. u.defaultFieldValue = function(e) {
  32824. if ("string" == typeof e && (e = g.TYPES[e]),
  32825. void 0 === e.defaultValue)
  32826. throw Error("default value for type " + e.name + " is not supported");
  32827. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  32828. }
  32829. ,
  32830. i.verifyValue = function(t) {
  32831. function i(e, t) {
  32832. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  32833. }
  32834. var n = this;
  32835. switch (this.type) {
  32836. case g.TYPES.int32:
  32837. case g.TYPES.sint32:
  32838. case g.TYPES.sfixed32:
  32839. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32840. 4294967295 < t ? 0 | t : t;
  32841. case g.TYPES.uint32:
  32842. case g.TYPES.fixed32:
  32843. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32844. t < 0 ? t >>> 0 : t;
  32845. case g.TYPES.int64:
  32846. case g.TYPES.sint64:
  32847. case g.TYPES.sfixed64:
  32848. if (g.Long)
  32849. try {
  32850. return a(t, !1)
  32851. } catch (e) {
  32852. i(typeof t, e.message)
  32853. }
  32854. else
  32855. i(typeof t, "requires Long.js");
  32856. case g.TYPES.uint64:
  32857. case g.TYPES.fixed64:
  32858. if (g.Long)
  32859. try {
  32860. return a(t, !0)
  32861. } catch (e) {
  32862. i(typeof t, e.message)
  32863. }
  32864. else
  32865. i(typeof t, "requires Long.js");
  32866. case g.TYPES.bool:
  32867. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  32868. t;
  32869. case g.TYPES.float:
  32870. case g.TYPES.double:
  32871. return "number" != typeof t && i(typeof t, "not a number"),
  32872. t;
  32873. case g.TYPES.string:
  32874. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  32875. "" + t;
  32876. case g.TYPES.bytes:
  32877. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  32878. case g.TYPES.enum:
  32879. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  32880. for (o = 0; o < e.length; o++) {
  32881. if (e[o].name == t)
  32882. return e[o].id;
  32883. if (e[o].id == t)
  32884. return e[o].id
  32885. }
  32886. if ("proto3" === this.syntax)
  32887. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32888. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  32889. t;
  32890. i(t, "not a valid enum value");
  32891. case g.TYPES.group:
  32892. case g.TYPES.message:
  32893. if (t && "object" == typeof t || i(typeof t, "object expected"),
  32894. t instanceof this.resolvedType.clazz)
  32895. return t;
  32896. if (t instanceof g.Builder.Message) {
  32897. var r = {};
  32898. for (var o in t)
  32899. t.hasOwnProperty(o) && (r[o] = t[o]);
  32900. t = r
  32901. }
  32902. return new this.resolvedType.clazz(t)
  32903. }
  32904. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  32905. }
  32906. ,
  32907. i.calculateLength = function(e, t) {
  32908. if (null === t)
  32909. return 0;
  32910. var i;
  32911. switch (this.type) {
  32912. case g.TYPES.int32:
  32913. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  32914. case g.TYPES.uint32:
  32915. return I.calculateVarint32(t);
  32916. case g.TYPES.sint32:
  32917. return I.calculateVarint32(I.zigZagEncode32(t));
  32918. case g.TYPES.fixed32:
  32919. case g.TYPES.sfixed32:
  32920. case g.TYPES.float:
  32921. return 4;
  32922. case g.TYPES.int64:
  32923. case g.TYPES.uint64:
  32924. return I.calculateVarint64(t);
  32925. case g.TYPES.sint64:
  32926. return I.calculateVarint64(I.zigZagEncode64(t));
  32927. case g.TYPES.fixed64:
  32928. case g.TYPES.sfixed64:
  32929. return 8;
  32930. case g.TYPES.bool:
  32931. return 1;
  32932. case g.TYPES.enum:
  32933. return I.calculateVarint32(t);
  32934. case g.TYPES.double:
  32935. return 8;
  32936. case g.TYPES.string:
  32937. return i = I.calculateUTF8Bytes(t),
  32938. I.calculateVarint32(i) + i;
  32939. case g.TYPES.bytes:
  32940. if (t.remaining() < 0)
  32941. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32942. return I.calculateVarint32(t.remaining()) + t.remaining();
  32943. case g.TYPES.message:
  32944. return i = this.resolvedType.calculate(t),
  32945. I.calculateVarint32(i) + i;
  32946. case g.TYPES.group:
  32947. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  32948. }
  32949. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32950. }
  32951. ,
  32952. i.encodeValue = function(e, t, i) {
  32953. if (null === t)
  32954. return i;
  32955. switch (this.type) {
  32956. case g.TYPES.int32:
  32957. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  32958. break;
  32959. case g.TYPES.uint32:
  32960. i.writeVarint32(t);
  32961. break;
  32962. case g.TYPES.sint32:
  32963. i.writeVarint32ZigZag(t);
  32964. break;
  32965. case g.TYPES.fixed32:
  32966. i.writeUint32(t);
  32967. break;
  32968. case g.TYPES.sfixed32:
  32969. i.writeInt32(t);
  32970. break;
  32971. case g.TYPES.int64:
  32972. case g.TYPES.uint64:
  32973. i.writeVarint64(t);
  32974. break;
  32975. case g.TYPES.sint64:
  32976. i.writeVarint64ZigZag(t);
  32977. break;
  32978. case g.TYPES.fixed64:
  32979. i.writeUint64(t);
  32980. break;
  32981. case g.TYPES.sfixed64:
  32982. i.writeInt64(t);
  32983. break;
  32984. case g.TYPES.bool:
  32985. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  32986. break;
  32987. case g.TYPES.enum:
  32988. i.writeVarint32(t);
  32989. break;
  32990. case g.TYPES.float:
  32991. i.writeFloat32(t);
  32992. break;
  32993. case g.TYPES.double:
  32994. i.writeFloat64(t);
  32995. break;
  32996. case g.TYPES.string:
  32997. i.writeVString(t);
  32998. break;
  32999. case g.TYPES.bytes:
  33000. if (t.remaining() < 0)
  33001. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33002. var n = t.offset;
  33003. i.writeVarint32(t.remaining()),
  33004. i.append(t),
  33005. t.offset = n;
  33006. break;
  33007. case g.TYPES.message:
  33008. var r = (new I).LE();
  33009. this.resolvedType.encode(t, r),
  33010. i.writeVarint32(r.offset),
  33011. i.append(r.flip());
  33012. break;
  33013. case g.TYPES.group:
  33014. this.resolvedType.encode(t, i),
  33015. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33016. break;
  33017. default:
  33018. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33019. }
  33020. return i
  33021. }
  33022. ,
  33023. i.decode = function(e, t, i) {
  33024. if (t != this.type.wireType)
  33025. throw Error("Unexpected wire type for element");
  33026. var n, r;
  33027. switch (this.type) {
  33028. case g.TYPES.int32:
  33029. return 0 | e.readVarint32();
  33030. case g.TYPES.uint32:
  33031. return e.readVarint32() >>> 0;
  33032. case g.TYPES.sint32:
  33033. return 0 | e.readVarint32ZigZag();
  33034. case g.TYPES.fixed32:
  33035. return e.readUint32() >>> 0;
  33036. case g.TYPES.sfixed32:
  33037. return 0 | e.readInt32();
  33038. case g.TYPES.int64:
  33039. return e.readVarint64();
  33040. case g.TYPES.uint64:
  33041. return e.readVarint64().toUnsigned();
  33042. case g.TYPES.sint64:
  33043. return e.readVarint64ZigZag();
  33044. case g.TYPES.fixed64:
  33045. return e.readUint64();
  33046. case g.TYPES.sfixed64:
  33047. return e.readInt64();
  33048. case g.TYPES.bool:
  33049. return !!e.readVarint32();
  33050. case g.TYPES.enum:
  33051. return e.readVarint32();
  33052. case g.TYPES.float:
  33053. return e.readFloat();
  33054. case g.TYPES.double:
  33055. return e.readDouble();
  33056. case g.TYPES.string:
  33057. return e.readVString();
  33058. case g.TYPES.bytes:
  33059. if (r = e.readVarint32(),
  33060. e.remaining() < r)
  33061. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33062. return (n = e.clone()).limit = n.offset + r,
  33063. e.offset += r,
  33064. n;
  33065. case g.TYPES.message:
  33066. return r = e.readVarint32(),
  33067. this.resolvedType.decode(e, r);
  33068. case g.TYPES.group:
  33069. return this.resolvedType.decode(e, -1, i)
  33070. }
  33071. throw Error("[INTERNAL] Illegal decode type")
  33072. }
  33073. ,
  33074. i.valueFromString = function(e) {
  33075. if (!this.isMapKey)
  33076. throw Error("valueFromString() called on non-map-key element");
  33077. switch (this.type) {
  33078. case g.TYPES.int32:
  33079. case g.TYPES.sint32:
  33080. case g.TYPES.sfixed32:
  33081. case g.TYPES.uint32:
  33082. case g.TYPES.fixed32:
  33083. return this.verifyValue(parseInt(e));
  33084. case g.TYPES.int64:
  33085. case g.TYPES.sint64:
  33086. case g.TYPES.sfixed64:
  33087. case g.TYPES.uint64:
  33088. case g.TYPES.fixed64:
  33089. return this.verifyValue(e);
  33090. case g.TYPES.bool:
  33091. return "true" === e;
  33092. case g.TYPES.string:
  33093. return this.verifyValue(e);
  33094. case g.TYPES.bytes:
  33095. return I.fromBinary(e)
  33096. }
  33097. }
  33098. ,
  33099. i.valueToString = function(e) {
  33100. if (!this.isMapKey)
  33101. throw Error("valueToString() called on non-map-key element");
  33102. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33103. }
  33104. ,
  33105. s.Element = u;
  33106. var d = function(e, t, i, n, r, o) {
  33107. l.call(this, e, t, i, n, o),
  33108. this.className = "Message",
  33109. this.extensions = void 0,
  33110. this.clazz = null,
  33111. this.isGroup = !!r,
  33112. this._fields = null,
  33113. this._fieldsById = null,
  33114. this._fieldsByName = null
  33115. }
  33116. , n = d.prototype = Object.create(l.prototype);
  33117. n.build = function(e) {
  33118. if (this.clazz && !e)
  33119. return this.clazz;
  33120. var t = function(u, a) {
  33121. function d(e, i, n, r) {
  33122. if (null === e || "object" != typeof e) {
  33123. if (r && r instanceof u.Reflect.Enum) {
  33124. var t = u.Reflect.Enum.getName(r.object, e);
  33125. if (null !== t)
  33126. return t
  33127. }
  33128. return e
  33129. }
  33130. if (I.isByteBuffer(e))
  33131. return i ? e.toBase64() : e.toBuffer();
  33132. if (u.Long.isLong(e))
  33133. return n ? e.toString() : u.Long.fromValue(e);
  33134. var o;
  33135. if (Array.isArray(e))
  33136. return o = [],
  33137. e.forEach(function(e, t) {
  33138. o[t] = d(e, i, n, r)
  33139. }),
  33140. o;
  33141. if (o = {},
  33142. e instanceof u.Map) {
  33143. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33144. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33145. return o
  33146. }
  33147. var l = e.$type
  33148. , c = void 0;
  33149. for (var h in e)
  33150. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33151. return o
  33152. }
  33153. var s = a.getChildren(u.Reflect.Message.Field)
  33154. , l = a.getChildren(u.Reflect.Message.OneOf)
  33155. , c = function(e, t) {
  33156. u.Builder.Message.call(this);
  33157. for (var i = 0, n = l.length; i < n; ++i)
  33158. this[l[i].name] = null;
  33159. for (i = 0,
  33160. n = s.length; i < n; ++i) {
  33161. var r = s[i];
  33162. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33163. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33164. }
  33165. var o;
  33166. if (0 < arguments.length)
  33167. 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)
  33168. for (i = 0,
  33169. n = arguments.length; i < n; ++i)
  33170. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33171. else
  33172. this.$set(e)
  33173. }
  33174. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33175. o.add = function(e, t, i) {
  33176. var n = a._fieldsByName[e];
  33177. if (!i) {
  33178. if (!n)
  33179. throw Error(this + "#" + e + " is undefined");
  33180. if (!(n instanceof u.Reflect.Message.Field))
  33181. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33182. if (!n.repeated)
  33183. throw Error(this + "#" + e + " is not a repeated field");
  33184. t = n.verifyValue(t, !0)
  33185. }
  33186. return null === this[e] && (this[e] = []),
  33187. this[e].push(t),
  33188. this
  33189. }
  33190. ,
  33191. o.$add = o.add,
  33192. o.set = function(e, t, i) {
  33193. if (e && "object" == typeof e) {
  33194. for (var n in i = t,
  33195. e)
  33196. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33197. return this
  33198. }
  33199. var r = a._fieldsByName[e];
  33200. if (i)
  33201. this[e] = t;
  33202. else {
  33203. if (!r)
  33204. throw Error(this + "#" + e + " is not a field: undefined");
  33205. if (!(r instanceof u.Reflect.Message.Field))
  33206. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33207. this[r.name] = t = r.verifyValue(t)
  33208. }
  33209. if (r && r.oneof) {
  33210. var o = this[r.oneof.name];
  33211. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33212. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33213. }
  33214. return this
  33215. }
  33216. ,
  33217. o.$set = o.set,
  33218. o.get = function(e, t) {
  33219. if (t)
  33220. return this[e];
  33221. var i = a._fieldsByName[e];
  33222. if (!(i && i instanceof u.Reflect.Message.Field))
  33223. throw Error(this + "#" + e + " is not a field: undefined");
  33224. if (!(i instanceof u.Reflect.Message.Field))
  33225. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33226. return this[i.name]
  33227. }
  33228. ,
  33229. o.$get = o.get;
  33230. for (var e = 0; e < s.length; e++) {
  33231. var t = s[e];
  33232. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33233. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33234. return e.toUpperCase().replace("_", "")
  33235. });
  33236. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33237. function t(e, t) {
  33238. return this[i.name] = t ? e : i.verifyValue(e),
  33239. this
  33240. }
  33241. function n() {
  33242. return this[i.name]
  33243. }
  33244. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33245. return "_" + e
  33246. });
  33247. null === a.getChild("set" + e) && (o["set" + e] = t),
  33248. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33249. null === a.getChild("get" + e) && (o["get" + e] = n),
  33250. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33251. }(t)
  33252. }
  33253. return o.encode = function(t, e) {
  33254. "boolean" == typeof t && (e = t,
  33255. t = void 0);
  33256. var i = !1;
  33257. t || (t = new I,
  33258. i = !0);
  33259. var n = t.littleEndian;
  33260. try {
  33261. return a.encode(this, t.LE(), e),
  33262. (i ? t.flip() : t).LE(n)
  33263. } catch (e) {
  33264. throw t.LE(n),
  33265. e
  33266. }
  33267. }
  33268. ,
  33269. c.encode = function(e, t, i) {
  33270. return new c(e).encode(t, i)
  33271. }
  33272. ,
  33273. o.calculate = function() {
  33274. return a.calculate(this)
  33275. }
  33276. ,
  33277. o.encodeDelimited = function(e, t) {
  33278. var i = !1;
  33279. e || (e = new I,
  33280. i = !0);
  33281. var n = (new I).LE();
  33282. return a.encode(this, n, t).flip(),
  33283. e.writeVarint32(n.remaining()),
  33284. e.append(n),
  33285. i ? e.flip() : e
  33286. }
  33287. ,
  33288. o.encodeAB = function() {
  33289. try {
  33290. return this.encode().toArrayBuffer()
  33291. } catch (e) {
  33292. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33293. e
  33294. }
  33295. }
  33296. ,
  33297. o.toArrayBuffer = o.encodeAB,
  33298. o.encodeNB = function() {
  33299. try {
  33300. return this.encode().toBuffer()
  33301. } catch (e) {
  33302. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33303. e
  33304. }
  33305. }
  33306. ,
  33307. o.toBuffer = o.encodeNB,
  33308. o.encode64 = function() {
  33309. try {
  33310. return this.encode().toBase64()
  33311. } catch (e) {
  33312. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33313. e
  33314. }
  33315. }
  33316. ,
  33317. o.toBase64 = o.encode64,
  33318. o.encodeHex = function() {
  33319. try {
  33320. return this.encode().toHex()
  33321. } catch (e) {
  33322. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33323. e
  33324. }
  33325. }
  33326. ,
  33327. o.toHex = o.encodeHex,
  33328. o.toRaw = function(e, t) {
  33329. return d(this, !!e, !!t, this.$type)
  33330. }
  33331. ,
  33332. o.encodeJSON = function() {
  33333. return JSON.stringify(d(this, !0, !0, this.$type))
  33334. }
  33335. ,
  33336. c.decode = function(t, e, i) {
  33337. "string" == typeof e && (i = e,
  33338. e = -1),
  33339. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33340. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33341. try {
  33342. var r = a.decode(t.LE());
  33343. return t.LE(n),
  33344. r
  33345. } catch (e) {
  33346. throw t.LE(n),
  33347. e
  33348. }
  33349. }
  33350. ,
  33351. c.decodeDelimited = function(t, e) {
  33352. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33353. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33354. return null;
  33355. var i = t.offset
  33356. , n = t.readVarint32();
  33357. if (t.remaining() < n)
  33358. return t.offset = i,
  33359. null;
  33360. try {
  33361. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33362. return t.offset += n,
  33363. r
  33364. } catch (e) {
  33365. throw t.offset += n,
  33366. e
  33367. }
  33368. }
  33369. ,
  33370. c.decode64 = function(e) {
  33371. return c.decode(e, "base64")
  33372. }
  33373. ,
  33374. c.decodeHex = function(e) {
  33375. return c.decode(e, "hex")
  33376. }
  33377. ,
  33378. c.decodeJSON = function(e) {
  33379. return new c(JSON.parse(e))
  33380. }
  33381. ,
  33382. o.toString = function() {
  33383. return a.toString()
  33384. }
  33385. ,
  33386. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33387. value: a.buildOpt()
  33388. }),
  33389. Object.defineProperty(o, "$options", {
  33390. value: c.$options
  33391. }),
  33392. Object.defineProperty(c, "$type", {
  33393. value: a
  33394. }),
  33395. Object.defineProperty(o, "$type", {
  33396. value: a
  33397. })),
  33398. c
  33399. }(g, this);
  33400. this._fields = [],
  33401. this._fieldsById = {},
  33402. this._fieldsByName = {};
  33403. for (var i, n = 0, r = this.children.length; n < r; n++)
  33404. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33405. if (t.hasOwnProperty(i.name))
  33406. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33407. t[i.name] = i.build()
  33408. } else if (i instanceof d.Field)
  33409. i.build(),
  33410. this._fields.push(i),
  33411. this._fieldsById[i.id] = i,
  33412. this._fieldsByName[i.name] = i;
  33413. else if (!(i instanceof d.OneOf || i instanceof v))
  33414. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33415. return this.clazz = t
  33416. }
  33417. ,
  33418. n.encode = function(e, t, i) {
  33419. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33420. r = e[(n = this._fields[a]).name],
  33421. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33422. if (null === o)
  33423. return t;
  33424. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33425. throw l.encoded = t,
  33426. l
  33427. }
  33428. ,
  33429. n.calculate = function(e) {
  33430. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33431. if (i = e[(t = this._fields[r]).name],
  33432. t.required && null === i)
  33433. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33434. n += t.calculate(i, e)
  33435. }
  33436. return n
  33437. }
  33438. ,
  33439. n.decode = function(e, t, i) {
  33440. t = "number" == typeof t ? t : -1;
  33441. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33442. if (o = (n = e.readVarint32()) >>> 3,
  33443. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33444. if (o !== i)
  33445. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33446. break
  33447. }
  33448. if (a = this._fieldsById[o]) {
  33449. if (a.repeated && !a.options.packed)
  33450. l[a.name].push(a.decode(r, e));
  33451. else if (a.map) {
  33452. var c = a.decode(r, e);
  33453. l[a.name].set(c[0], c[1])
  33454. } else if (l[a.name] = a.decode(r, e),
  33455. a.oneof) {
  33456. var h = l[a.oneof.name];
  33457. null !== h && h !== a.name && (l[h] = null),
  33458. l[a.oneof.name] = a.name
  33459. }
  33460. } else
  33461. switch (r) {
  33462. case g.WIRE_TYPES.VARINT:
  33463. e.readVarint32();
  33464. break;
  33465. case g.WIRE_TYPES.BITS32:
  33466. e.offset += 4;
  33467. break;
  33468. case g.WIRE_TYPES.BITS64:
  33469. e.offset += 8;
  33470. break;
  33471. case g.WIRE_TYPES.LDELIM:
  33472. var u = e.readVarint32();
  33473. e.offset += u;
  33474. break;
  33475. case g.WIRE_TYPES.STARTGROUP:
  33476. for (; m(o, e); )
  33477. ;
  33478. break;
  33479. default:
  33480. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33481. }
  33482. }
  33483. for (var d = 0, p = this._fields.length; d < p; ++d)
  33484. if (null === l[(a = this._fields[d]).name])
  33485. if ("proto3" === this.syntax)
  33486. l[a.name] = a.defaultValue;
  33487. else {
  33488. if (a.required) {
  33489. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33490. throw f.decoded = l,
  33491. f
  33492. }
  33493. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33494. }
  33495. return l
  33496. }
  33497. ,
  33498. s.Message = d;
  33499. function c(e, t, i, n, r, o, a, s, l, c) {
  33500. h.call(this, e, t, o),
  33501. this.className = "Message.Field",
  33502. this.required = "required" === i,
  33503. this.repeated = "repeated" === i,
  33504. this.map = "map" === i,
  33505. this.keyType = n || null,
  33506. this.type = r,
  33507. this.resolvedType = null,
  33508. this.id = a,
  33509. this.options = s || {},
  33510. this.defaultValue = null,
  33511. this.oneof = l || null,
  33512. this.syntax = c || "proto2",
  33513. this.originalName = this.name,
  33514. this.element = null,
  33515. this.keyElement = null,
  33516. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33517. }
  33518. var r = c.prototype = Object.create(h.prototype);
  33519. r.build = function() {
  33520. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33521. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33522. "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)
  33523. }
  33524. ,
  33525. r.verifyValue = function(e, t) {
  33526. function i(e, t) {
  33527. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33528. }
  33529. t = t || !1;
  33530. var n, r = this;
  33531. if (null === e)
  33532. return this.required && i(typeof e, "required"),
  33533. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33534. null;
  33535. if (!this.repeated || t)
  33536. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33537. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33538. this.element.verifyValue(e));
  33539. Array.isArray(e) || (e = [e]);
  33540. var o = [];
  33541. for (n = 0; n < e.length; n++)
  33542. o.push(this.element.verifyValue(e[n]));
  33543. return o
  33544. }
  33545. ,
  33546. r.hasWirePresence = function(e, t) {
  33547. if ("proto3" !== this.syntax)
  33548. return null !== e;
  33549. if (this.oneof && t[this.oneof.name] === this.name)
  33550. return !0;
  33551. switch (this.type) {
  33552. case g.TYPES.int32:
  33553. case g.TYPES.sint32:
  33554. case g.TYPES.sfixed32:
  33555. case g.TYPES.uint32:
  33556. case g.TYPES.fixed32:
  33557. return 0 !== e;
  33558. case g.TYPES.int64:
  33559. case g.TYPES.sint64:
  33560. case g.TYPES.sfixed64:
  33561. case g.TYPES.uint64:
  33562. case g.TYPES.fixed64:
  33563. return 0 !== e.low || 0 !== e.high;
  33564. case g.TYPES.bool:
  33565. return e;
  33566. case g.TYPES.float:
  33567. case g.TYPES.double:
  33568. return 0 !== e;
  33569. case g.TYPES.string:
  33570. return 0 < e.length;
  33571. case g.TYPES.bytes:
  33572. return 0 < e.remaining();
  33573. case g.TYPES.enum:
  33574. return 0 !== e;
  33575. case g.TYPES.message:
  33576. return null !== e;
  33577. default:
  33578. return !0
  33579. }
  33580. }
  33581. ,
  33582. r.encode = function(t, r, e) {
  33583. if (null === this.type || "object" != typeof this.type)
  33584. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33585. if (null === t || this.repeated && 0 == t.length)
  33586. return r;
  33587. try {
  33588. var i;
  33589. if (this.repeated)
  33590. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33591. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33592. r.ensureCapacity(r.offset += 1);
  33593. var n = r.offset;
  33594. for (i = 0; i < t.length; i++)
  33595. this.element.encodeValue(this.id, t[i], r);
  33596. var o = r.offset - n
  33597. , a = I.calculateVarint32(o);
  33598. if (1 < a) {
  33599. var s = r.slice(n, r.offset);
  33600. n += a - 1,
  33601. r.offset = n,
  33602. r.append(s)
  33603. }
  33604. r.writeVarint32(o, n - a)
  33605. } else
  33606. for (i = 0; i < t.length; i++)
  33607. r.writeVarint32(this.id << 3 | this.type.wireType),
  33608. this.element.encodeValue(this.id, t[i], r);
  33609. else
  33610. this.map ? t.forEach(function(e, t, i) {
  33611. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33612. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33613. r.writeVarint32(n),
  33614. r.writeVarint32(8 | this.keyType.wireType),
  33615. this.keyElement.encodeValue(1, t, r),
  33616. r.writeVarint32(16 | this.type.wireType),
  33617. this.element.encodeValue(2, e, r)
  33618. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33619. this.element.encodeValue(this.id, t, r))
  33620. } catch (e) {
  33621. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33622. }
  33623. return r
  33624. }
  33625. ,
  33626. r.calculate = function(t, e) {
  33627. if (t = this.verifyValue(t),
  33628. null === this.type || "object" != typeof this.type)
  33629. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33630. if (null === t || this.repeated && 0 == t.length)
  33631. return 0;
  33632. var r = 0;
  33633. try {
  33634. var i, n;
  33635. if (this.repeated)
  33636. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33637. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33638. i = n = 0; i < t.length; i++)
  33639. n += this.element.calculateLength(this.id, t[i]);
  33640. r += I.calculateVarint32(n),
  33641. r += n
  33642. } else
  33643. for (i = 0; i < t.length; i++)
  33644. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33645. r += this.element.calculateLength(this.id, t[i]);
  33646. else
  33647. this.map ? t.forEach(function(e, t, i) {
  33648. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33649. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33650. r += I.calculateVarint32(n),
  33651. r += n
  33652. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33653. r += this.element.calculateLength(this.id, t))
  33654. } catch (e) {
  33655. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33656. }
  33657. return r
  33658. }
  33659. ,
  33660. r.decode = function(e, t, i) {
  33661. var n, r;
  33662. 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))
  33663. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33664. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33665. r = t.readVarint32(),
  33666. r = t.offset + r;
  33667. for (var o = []; t.offset < r; )
  33668. o.push(this.decode(this.type.wireType, t, !0));
  33669. return o
  33670. }
  33671. if (this.map) {
  33672. var a = u.defaultFieldValue(this.keyType);
  33673. if (n = u.defaultFieldValue(this.type),
  33674. r = t.readVarint32(),
  33675. t.remaining() < r)
  33676. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33677. var s = t.clone();
  33678. for (s.limit = s.offset + r,
  33679. t.offset += r; 0 < s.remaining(); ) {
  33680. var l = s.readVarint32();
  33681. e = 7 & l;
  33682. var c = l >>> 3;
  33683. if (1 == c)
  33684. a = this.keyElement.decode(s, e, c);
  33685. else {
  33686. if (2 != c)
  33687. throw Error("Unexpected tag in map field key/value submessage");
  33688. n = this.element.decode(s, e, c)
  33689. }
  33690. }
  33691. return [a, n]
  33692. }
  33693. return this.element.decode(t, e, this.id)
  33694. }
  33695. ,
  33696. s.Message.Field = c;
  33697. function o(e, t, i, n, r, o, a) {
  33698. c.call(this, e, t, i, null, n, r, o, a),
  33699. this.extension
  33700. }
  33701. o.prototype = Object.create(c.prototype),
  33702. s.Message.ExtensionField = o;
  33703. s.Message.OneOf = function(e, t, i) {
  33704. h.call(this, e, t, i),
  33705. this.fields = []
  33706. }
  33707. ;
  33708. var p = function(e, t, i, n, r) {
  33709. l.call(this, e, t, i, n, r),
  33710. this.className = "Enum",
  33711. this.object = null
  33712. };
  33713. p.getName = function(e, t) {
  33714. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33715. if (e[i = n[r]] === t)
  33716. return i;
  33717. return null
  33718. }
  33719. ,
  33720. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33721. if (this.object && !e)
  33722. return this.object;
  33723. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33724. t[i[n].name] = i[n].id;
  33725. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33726. value: this.buildOpt(),
  33727. enumerable: !1
  33728. }),
  33729. this.object = t
  33730. }
  33731. ,
  33732. s.Enum = p;
  33733. function f(e, t, i, n) {
  33734. h.call(this, e, t, i),
  33735. this.className = "Enum.Value",
  33736. this.id = n
  33737. }
  33738. f.prototype = Object.create(h.prototype),
  33739. s.Enum.Value = f;
  33740. var v = function(e, t, i, n) {
  33741. h.call(this, e, t, i),
  33742. this.field = n
  33743. };
  33744. v.prototype = Object.create(h.prototype),
  33745. s.Extension = v;
  33746. var y = function(e, t, i, n) {
  33747. l.call(this, e, t, i, n),
  33748. this.className = "Service",
  33749. this.clazz = null
  33750. };
  33751. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33752. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33753. for (var o = function(e) {
  33754. t.Builder.Service.call(this),
  33755. this.rpcImpl = e || function(e, t, i) {
  33756. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33757. }
  33758. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33759. !function(n) {
  33760. e[n.name] = function(e, i) {
  33761. try {
  33762. try {
  33763. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33764. } catch (e) {
  33765. if (!(e instanceof TypeError))
  33766. throw e
  33767. }
  33768. if (null === e || "object" != typeof e)
  33769. throw Error("Illegal arguments");
  33770. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33771. this.rpcImpl(n.fqn(), e, function(e, t) {
  33772. if (!e) {
  33773. null === t && (t = "");
  33774. try {
  33775. t = n.resolvedResponseType.clazz.decode(t)
  33776. } catch (e) {}
  33777. 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))
  33778. }
  33779. i(e)
  33780. })
  33781. } catch (e) {
  33782. setTimeout(i.bind(this, e), 0)
  33783. }
  33784. }
  33785. ,
  33786. o[n.name] = function(e, t, i) {
  33787. new o(e)[n.name](t, i)
  33788. }
  33789. ,
  33790. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  33791. value: n.buildOpt()
  33792. }),
  33793. Object.defineProperty(e[n.name], "$options", {
  33794. value: o[n.name].$options
  33795. }))
  33796. }(i[n]);
  33797. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  33798. value: r.buildOpt()
  33799. }),
  33800. Object.defineProperty(e, "$options", {
  33801. value: o.$options
  33802. }),
  33803. Object.defineProperty(o, "$type", {
  33804. value: r
  33805. }),
  33806. Object.defineProperty(e, "$type", {
  33807. value: r
  33808. })),
  33809. o
  33810. }(g, this)
  33811. }
  33812. ,
  33813. s.Service = y;
  33814. function A(e, t, i, n) {
  33815. h.call(this, e, t, i),
  33816. this.className = "Service.Method",
  33817. this.options = n || {}
  33818. }
  33819. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  33820. s.Service.Method = A;
  33821. function C(e, t, i, n, r, o, a, s) {
  33822. A.call(this, e, t, i, s),
  33823. this.className = "Service.RPCMethod",
  33824. this.requestName = n,
  33825. this.responseName = r,
  33826. this.requestStream = o,
  33827. this.responseStream = a,
  33828. this.resolvedRequestType = null,
  33829. this.resolvedResponseType = null
  33830. }
  33831. return C.prototype = Object.create(A.prototype),
  33832. s.Service.RPCMethod = C,
  33833. s
  33834. }(o),
  33835. o.Builder = (i = (u = o).Lang,
  33836. s = o.Reflect,
  33837. n = h.prototype,
  33838. h.isMessage = function(e) {
  33839. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  33840. }
  33841. ,
  33842. h.isMessageField = function(e) {
  33843. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  33844. }
  33845. ,
  33846. h.isEnum = function(e) {
  33847. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33848. }
  33849. ,
  33850. h.isService = function(e) {
  33851. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33852. }
  33853. ,
  33854. h.isExtend = function(e) {
  33855. return "string" == typeof e.ref
  33856. }
  33857. ,
  33858. n.reset = function() {
  33859. return this.ptr = this.ns,
  33860. this
  33861. }
  33862. ,
  33863. n.define = function(e) {
  33864. if ("string" != typeof e || !i.TYPEREF.test(e))
  33865. throw Error("illegal namespace: " + e);
  33866. return e.split(".").forEach(function(e) {
  33867. var t = this.ptr.getChild(e);
  33868. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  33869. this.ptr = t
  33870. }, this),
  33871. this
  33872. }
  33873. ,
  33874. n.create = function(e) {
  33875. if (!e)
  33876. return this;
  33877. if (Array.isArray(e)) {
  33878. if (0 === e.length)
  33879. return this;
  33880. e = e.slice()
  33881. } else
  33882. e = [e];
  33883. for (var t = [e]; 0 < t.length; ) {
  33884. if (e = t.pop(),
  33885. !Array.isArray(e))
  33886. throw Error("not a valid namespace: " + JSON.stringify(e));
  33887. for (; 0 < e.length; ) {
  33888. var i = e.shift();
  33889. if (h.isMessage(i)) {
  33890. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  33891. , n = {};
  33892. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  33893. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  33894. }, this),
  33895. i.fields && i.fields.forEach(function(e) {
  33896. if (null !== o.getChild(0 | e.id))
  33897. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  33898. if (e.options && "object" != typeof e.options)
  33899. throw Error("illegal field options in " + o.name + "#" + e.name);
  33900. var t = null;
  33901. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  33902. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  33903. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  33904. t && t.fields.push(e),
  33905. o.addChild(e)
  33906. }, this);
  33907. var r = [];
  33908. if (i.enums && i.enums.forEach(function(e) {
  33909. r.push(e)
  33910. }),
  33911. i.messages && i.messages.forEach(function(e) {
  33912. r.push(e)
  33913. }),
  33914. i.services && i.services.forEach(function(e) {
  33915. r.push(e)
  33916. }),
  33917. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  33918. this.ptr.addChild(o),
  33919. 0 < r.length) {
  33920. t.push(e),
  33921. e = r,
  33922. r = null,
  33923. this.ptr = o,
  33924. o = null;
  33925. continue
  33926. }
  33927. r = null
  33928. } else if (h.isEnum(i))
  33929. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  33930. i.values.forEach(function(e) {
  33931. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  33932. }, this),
  33933. this.ptr.addChild(o);
  33934. else if (h.isService(i))
  33935. o = new s.Service(this,this.ptr,i.name,i.options),
  33936. Object.keys(i.rpc).forEach(function(e) {
  33937. var t = i.rpc[e];
  33938. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  33939. }, this),
  33940. this.ptr.addChild(o);
  33941. else {
  33942. if (!h.isExtend(i))
  33943. throw Error("not a valid definition: " + JSON.stringify(i));
  33944. if (o = this.ptr.resolve(i.ref, !0))
  33945. i.fields.forEach(function(t) {
  33946. if (null !== o.getChild(0 | t.id))
  33947. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  33948. if (o.extensions) {
  33949. var i = !1;
  33950. if (o.extensions.forEach(function(e) {
  33951. t.id >= e[0] && t.id <= e[1] && (i = !0)
  33952. }),
  33953. !i)
  33954. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  33955. }
  33956. var e = t.name;
  33957. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  33958. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  33959. , r = new s.Extension(this,this.ptr,t.name,n);
  33960. n.extension = r,
  33961. this.ptr.addChild(r),
  33962. o.addChild(n)
  33963. }, this);
  33964. else if (!/\.?google\.protobuf\./.test(i.ref))
  33965. throw Error("extended message " + i.ref + " is not defined")
  33966. }
  33967. o = i = null
  33968. }
  33969. e = null,
  33970. this.ptr = this.ptr.parent
  33971. }
  33972. return this.resolved = !1,
  33973. this.result = null,
  33974. this
  33975. }
  33976. ,
  33977. n.import = function(t, e) {
  33978. var i = "/";
  33979. if ("string" == typeof e) {
  33980. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  33981. !0 === this.files[e])
  33982. return this.reset();
  33983. this.files[e] = !0
  33984. } else if ("object" == typeof e) {
  33985. var n = e.root;
  33986. u.Util.IS_NODE && (n = p("path").resolve(n)),
  33987. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  33988. var r = n + i + e.file;
  33989. if (!0 === this.files[r])
  33990. return this.reset();
  33991. this.files[r] = !0
  33992. }
  33993. if (t.imports && 0 < t.imports.length) {
  33994. var o, a = !1;
  33995. "object" == typeof e ? (this.importRoot = e.root,
  33996. a = !0,
  33997. o = this.importRoot,
  33998. e = e.file,
  33999. (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(/\\[^\\]*$/, ""),
  34000. i = "\\") : o = "." : o = null;
  34001. for (var s = 0; s < t.imports.length; s++)
  34002. if ("string" == typeof t.imports[s]) {
  34003. if (!o)
  34004. throw Error("cannot determine import root");
  34005. var l = t.imports[s];
  34006. if ("google/protobuf/descriptor.proto" === l)
  34007. continue;
  34008. if (l = o + i + l,
  34009. !0 === this.files[l])
  34010. continue;
  34011. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34012. var c = u.Util.fetch(l);
  34013. if (null === c)
  34014. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34015. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34016. } else
  34017. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34018. return t + "_import" + s + "." + i
  34019. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34020. a && (this.importRoot = null)
  34021. }
  34022. t.package && this.define(t.package),
  34023. t.syntax && function t(i) {
  34024. i.messages && i.messages.forEach(function(e) {
  34025. e.syntax = i.syntax,
  34026. t(e)
  34027. }),
  34028. i.enums && i.enums.forEach(function(e) {
  34029. e.syntax = i.syntax
  34030. })
  34031. }(t);
  34032. var h = this.ptr;
  34033. return t.options && Object.keys(t.options).forEach(function(e) {
  34034. h.options[e] = t.options[e]
  34035. }),
  34036. t.messages && (this.create(t.messages),
  34037. this.ptr = h),
  34038. t.enums && (this.create(t.enums),
  34039. this.ptr = h),
  34040. t.services && (this.create(t.services),
  34041. this.ptr = h),
  34042. t.extends && this.create(t.extends),
  34043. this.reset()
  34044. }
  34045. ,
  34046. n.resolveAll = function() {
  34047. var e;
  34048. if (null == this.ptr || "object" == typeof this.ptr.type)
  34049. return this;
  34050. if (this.ptr instanceof s.Namespace)
  34051. this.ptr.children.forEach(function(e) {
  34052. this.ptr = e,
  34053. this.resolveAll()
  34054. }, this);
  34055. else if (this.ptr instanceof s.Message.Field) {
  34056. if (i.TYPE.test(this.ptr.type))
  34057. this.ptr.type = u.TYPES[this.ptr.type];
  34058. else {
  34059. if (!i.TYPEREF.test(this.ptr.type))
  34060. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34061. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34062. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34063. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34064. if (this.ptr.type = u.TYPES.enum,
  34065. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34066. throw Error("proto3 message cannot reference proto2 enum")
  34067. } else {
  34068. if (!(e instanceof s.Message))
  34069. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34070. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34071. }
  34072. }
  34073. if (this.ptr.map) {
  34074. if (!i.TYPE.test(this.ptr.keyType))
  34075. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34076. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34077. }
  34078. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34079. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34080. throw Error("illegal service type in " + this.ptr.toString(!0));
  34081. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34082. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34083. if (this.ptr.resolvedRequestType = e,
  34084. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34085. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34086. this.ptr.resolvedResponseType = e
  34087. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34088. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34089. return this.reset()
  34090. }
  34091. ,
  34092. n.build = function(e) {
  34093. if (this.reset(),
  34094. this.resolved || (this.resolveAll(),
  34095. this.resolved = !0,
  34096. this.result = null),
  34097. null === this.result && (this.result = this.ns.build()),
  34098. !e)
  34099. return this.result;
  34100. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34101. if (!i[t[n]]) {
  34102. i = null;
  34103. break
  34104. }
  34105. i = i[t[n]]
  34106. }
  34107. return i
  34108. }
  34109. ,
  34110. n.lookup = function(e, t) {
  34111. return e ? this.ns.resolve(e, t) : this.ns
  34112. }
  34113. ,
  34114. n.toString = function() {
  34115. return "Builder"
  34116. }
  34117. ,
  34118. h.Message = function() {}
  34119. ,
  34120. h.Enum = function() {}
  34121. ,
  34122. h.Service = function() {}
  34123. ,
  34124. h),
  34125. o.Map = (a = o.Reflect,
  34126. (t = c.prototype).clear = function() {
  34127. this.map = {}
  34128. }
  34129. ,
  34130. t.delete = function(e) {
  34131. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34132. , i = t in this.map;
  34133. return delete this.map[t],
  34134. i
  34135. }
  34136. ,
  34137. t.entries = function() {
  34138. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34139. t.push([(e = this.map[i[n]]).key, e.value]);
  34140. return l(t)
  34141. }
  34142. ,
  34143. t.keys = function() {
  34144. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34145. e.push(this.map[t[i]].key);
  34146. return l(e)
  34147. }
  34148. ,
  34149. t.values = function() {
  34150. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34151. e.push(this.map[t[i]].value);
  34152. return l(e)
  34153. }
  34154. ,
  34155. t.forEach = function(e, t) {
  34156. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34157. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34158. }
  34159. ,
  34160. t.set = function(e, t) {
  34161. var i = this.keyElem.verifyValue(e)
  34162. , n = this.valueElem.verifyValue(t);
  34163. return this.map[this.keyElem.valueToString(i)] = {
  34164. key: i,
  34165. value: n
  34166. },
  34167. this
  34168. }
  34169. ,
  34170. t.get = function(e) {
  34171. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34172. if (t in this.map)
  34173. return this.map[t].value
  34174. }
  34175. ,
  34176. t.has = function(e) {
  34177. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34178. }
  34179. ,
  34180. c),
  34181. o.loadProto = function(e, t, i) {
  34182. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34183. t = void 0),
  34184. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34185. }
  34186. ,
  34187. o.protoFromString = o.loadProto,
  34188. o.loadProtoFile = function(t, i, n) {
  34189. if (i && "object" == typeof i ? (n = i,
  34190. i = null) : i && "function" == typeof i || (i = null),
  34191. i)
  34192. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34193. if (null !== e)
  34194. try {
  34195. i(null, o.loadProto(e, n, t))
  34196. } catch (e) {
  34197. i(e)
  34198. }
  34199. else
  34200. i(Error("Failed to fetch file"))
  34201. });
  34202. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34203. return null === e ? null : o.loadProto(e, n, t)
  34204. }
  34205. ,
  34206. o.protoFromFile = o.loadProtoFile,
  34207. o.newBuilder = function(e) {
  34208. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34209. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34210. new o.Builder(e)
  34211. }
  34212. ,
  34213. o.loadJson = function(e, t, i) {
  34214. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34215. t = null),
  34216. t && "object" == typeof t || (t = o.newBuilder()),
  34217. "string" == typeof e && (e = JSON.parse(e)),
  34218. t.import(e, i),
  34219. t.resolveAll(),
  34220. t
  34221. }
  34222. ,
  34223. o.loadJsonFile = function(t, i, n) {
  34224. if (i && "object" == typeof i ? (n = i,
  34225. i = null) : i && "function" == typeof i || (i = null),
  34226. i)
  34227. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34228. if (null !== e)
  34229. try {
  34230. i(null, o.loadJson(JSON.parse(e), n, t))
  34231. } catch (e) {
  34232. i(e)
  34233. }
  34234. else
  34235. i(Error("Failed to fetch file"))
  34236. });
  34237. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34238. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34239. }
  34240. ,
  34241. o;
  34242. function l(e) {
  34243. var t = 0;
  34244. return {
  34245. next: function() {
  34246. return t < e.length ? {
  34247. done: !1,
  34248. value: e[t++]
  34249. } : {
  34250. done: !0
  34251. }
  34252. }
  34253. }
  34254. }
  34255. function c(e, t) {
  34256. if (!e.map)
  34257. throw Error("field is not a map");
  34258. if (this.field = e,
  34259. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34260. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34261. this.map = {},
  34262. Object.defineProperty(this, "size", {
  34263. get: function() {
  34264. return Object.keys(this.map).length
  34265. }
  34266. }),
  34267. t)
  34268. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34269. var r = this.keyElem.valueFromString(i[n])
  34270. , o = this.valueElem.verifyValue(t[i[n]]);
  34271. this.map[this.keyElem.valueToString(r)] = {
  34272. key: r,
  34273. value: o
  34274. }
  34275. }
  34276. }
  34277. function h(e) {
  34278. this.ns = new s.Namespace(this,null,""),
  34279. this.ptr = this.ns,
  34280. this.resolved = !1,
  34281. this.result = null,
  34282. this.files = {},
  34283. this.importRoot = null,
  34284. this.options = e || {}
  34285. }
  34286. }
  34287. ,
  34288. "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)
  34289. }
  34290. ).call(this, p("_process"))
  34291. }
  34292. , {
  34293. _process: 203,
  34294. bytebuffer: 215,
  34295. fs: 197,
  34296. path: 197
  34297. }],
  34298. 215: [function(t, e, i) {
  34299. var n, r;
  34300. n = this,
  34301. r = function(l) {
  34302. "use strict";
  34303. function s(e) {
  34304. var t = 0;
  34305. return function() {
  34306. return t < e.length ? e.charCodeAt(t++) : null
  34307. }
  34308. }
  34309. function c() {
  34310. var e = []
  34311. , t = [];
  34312. return function() {
  34313. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34314. e.length = 0),
  34315. void Array.prototype.push.apply(e, arguments))
  34316. }
  34317. }
  34318. function n(e, t, i, n, r) {
  34319. 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];
  34320. for (u += d,
  34321. o = p & (1 << -h) - 1,
  34322. p >>= -h,
  34323. h += s; 0 < h; o = 256 * o + e[t + u],
  34324. u += d,
  34325. h -= 8)
  34326. ;
  34327. for (a = o & (1 << -h) - 1,
  34328. o >>= -h,
  34329. h += n; 0 < h; a = 256 * a + e[t + u],
  34330. u += d,
  34331. h -= 8)
  34332. ;
  34333. if (0 === o)
  34334. o = 1 - c;
  34335. else {
  34336. if (o === l)
  34337. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34338. a += Math.pow(2, n),
  34339. o -= c
  34340. }
  34341. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34342. }
  34343. function r(e, t, i, n, r, o) {
  34344. 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;
  34345. for (t = Math.abs(t),
  34346. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34347. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34348. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34349. l *= 2),
  34350. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34351. l /= 2),
  34352. h <= a + u ? (s = 0,
  34353. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34354. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34355. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34356. p += f,
  34357. s /= 256,
  34358. r -= 8)
  34359. ;
  34360. for (a = a << r | s,
  34361. c += r; 0 < c; e[i + p] = 255 & a,
  34362. p += f,
  34363. a /= 256,
  34364. c -= 8)
  34365. ;
  34366. e[i + p - f] |= 128 * g
  34367. }
  34368. var f = function(e, t, i) {
  34369. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34370. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34371. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34372. !i) {
  34373. if ((e |= 0) < 0)
  34374. throw RangeError("Illegal capacity");
  34375. t = !!t,
  34376. i = !!i
  34377. }
  34378. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34379. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34380. this.offset = 0,
  34381. this.markedOffset = -1,
  34382. this.limit = e,
  34383. this.littleEndian = t,
  34384. this.noAssert = i
  34385. };
  34386. f.VERSION = "5.0.1",
  34387. f.LITTLE_ENDIAN = !0,
  34388. f.BIG_ENDIAN = !1,
  34389. f.DEFAULT_CAPACITY = 16,
  34390. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34391. f.DEFAULT_NOASSERT = !1,
  34392. f.Long = l || null;
  34393. var a = f.prototype;
  34394. a.__isByteBuffer__,
  34395. Object.defineProperty(a, "__isByteBuffer__", {
  34396. value: !0,
  34397. enumerable: !1,
  34398. configurable: !1
  34399. });
  34400. var o = new ArrayBuffer(0)
  34401. , i = String.fromCharCode;
  34402. f.accessor = function() {
  34403. return Uint8Array
  34404. }
  34405. ,
  34406. f.allocate = function(e, t, i) {
  34407. return new f(e,t,i)
  34408. }
  34409. ,
  34410. f.concat = function(e, t, i, n) {
  34411. "boolean" != typeof t && "string" == typeof t || (n = i,
  34412. i = t,
  34413. t = void 0);
  34414. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34415. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34416. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34417. if (0 === o)
  34418. return new f(0,i,n);
  34419. var l, c = new f(o,i,n);
  34420. for (a = 0; a < s; )
  34421. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34422. c.offset += r);
  34423. return c.limit = c.offset,
  34424. c.offset = 0,
  34425. c
  34426. }
  34427. ,
  34428. f.isByteBuffer = function(e) {
  34429. return !0 === (e && e.__isByteBuffer__)
  34430. }
  34431. ,
  34432. f.type = function() {
  34433. return ArrayBuffer
  34434. }
  34435. ,
  34436. f.wrap = function(e, t, i, n) {
  34437. if ("string" != typeof t && (n = i,
  34438. i = t,
  34439. t = void 0),
  34440. "string" == typeof e)
  34441. switch (void 0 === t && (t = "utf8"),
  34442. t) {
  34443. case "base64":
  34444. return f.fromBase64(e, i);
  34445. case "hex":
  34446. return f.fromHex(e, i);
  34447. case "binary":
  34448. return f.fromBinary(e, i);
  34449. case "utf8":
  34450. return f.fromUTF8(e, i);
  34451. case "debug":
  34452. return f.fromDebug(e, i);
  34453. default:
  34454. throw Error("Unsupported encoding: " + t)
  34455. }
  34456. if (null === e || "object" != typeof e)
  34457. throw TypeError("Illegal buffer");
  34458. var r;
  34459. if (f.isByteBuffer(e))
  34460. return (r = a.clone.call(e)).markedOffset = -1,
  34461. r;
  34462. if (e instanceof Uint8Array)
  34463. r = new f(0,i,n),
  34464. 0 < e.length && (r.buffer = e.buffer,
  34465. r.offset = e.byteOffset,
  34466. r.limit = e.byteOffset + e.byteLength,
  34467. r.view = new Uint8Array(e.buffer));
  34468. else if (e instanceof ArrayBuffer)
  34469. r = new f(0,i,n),
  34470. 0 < e.byteLength && (r.buffer = e,
  34471. r.offset = 0,
  34472. r.limit = e.byteLength,
  34473. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34474. else {
  34475. if ("[object Array]" !== Object.prototype.toString.call(e))
  34476. throw TypeError("Illegal buffer");
  34477. (r = new f(e.length,i,n)).limit = e.length;
  34478. for (var o = 0; o < e.length; ++o)
  34479. r.view[o] = e[o]
  34480. }
  34481. return r
  34482. }
  34483. ,
  34484. a.writeBitSet = function(e, t) {
  34485. var i = void 0 === t;
  34486. if (i && (t = this.offset),
  34487. !this.noAssert) {
  34488. if (!(e instanceof Array))
  34489. throw TypeError("Illegal BitSet: Not an array");
  34490. if ("number" != typeof t || t % 1 != 0)
  34491. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34492. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34493. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34494. }
  34495. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34496. for (t += this.writeVarint32(o, t); a--; )
  34497. 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,
  34498. this.writeByte(n, t++);
  34499. if (s < o) {
  34500. var l = 0;
  34501. for (n = 0; s < o; )
  34502. n |= (1 & !!e[s++]) << l++;
  34503. this.writeByte(n, t++)
  34504. }
  34505. return i ? (this.offset = t,
  34506. this) : t - r
  34507. }
  34508. ,
  34509. a.readBitSet = function(e) {
  34510. var t = void 0 === e;
  34511. t && (e = this.offset);
  34512. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34513. for (e += n.length; o--; )
  34514. i = this.readByte(e++),
  34515. s[a++] = !!(1 & i),
  34516. s[a++] = !!(2 & i),
  34517. s[a++] = !!(4 & i),
  34518. s[a++] = !!(8 & i),
  34519. s[a++] = !!(16 & i),
  34520. s[a++] = !!(32 & i),
  34521. s[a++] = !!(64 & i),
  34522. s[a++] = !!(128 & i);
  34523. if (a < r) {
  34524. var l = 0;
  34525. for (i = this.readByte(e++); a < r; )
  34526. s[a++] = !!(i >> l++ & 1)
  34527. }
  34528. return t && (this.offset = e),
  34529. s
  34530. }
  34531. ,
  34532. a.readBytes = function(e, t) {
  34533. var i = void 0 === t;
  34534. if (i && (t = this.offset),
  34535. !this.noAssert) {
  34536. if ("number" != typeof t || t % 1 != 0)
  34537. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34538. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34539. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34540. }
  34541. var n = this.slice(t, t + e);
  34542. return i && (this.offset += e),
  34543. n
  34544. }
  34545. ,
  34546. a.writeBytes = a.append,
  34547. a.writeInt8 = function(e, t) {
  34548. var i = void 0 === t;
  34549. if (i && (t = this.offset),
  34550. !this.noAssert) {
  34551. if ("number" != typeof e || e % 1 != 0)
  34552. throw TypeError("Illegal value: " + e + " (not an integer)");
  34553. if (e |= 0,
  34554. "number" != typeof t || t % 1 != 0)
  34555. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34556. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34557. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34558. }
  34559. t += 1;
  34560. var n = this.buffer.byteLength;
  34561. return n < t && this.resize((n *= 2) > t ? n : t),
  34562. t -= 1,
  34563. this.view[t] = e,
  34564. i && (this.offset += 1),
  34565. this
  34566. }
  34567. ,
  34568. a.writeByte = a.writeInt8,
  34569. a.readInt8 = function(e) {
  34570. var t = void 0 === e;
  34571. if (t && (e = this.offset),
  34572. !this.noAssert) {
  34573. if ("number" != typeof e || e % 1 != 0)
  34574. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34575. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34576. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34577. }
  34578. var i = this.view[e];
  34579. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34580. t && (this.offset += 1),
  34581. i
  34582. }
  34583. ,
  34584. a.readByte = a.readInt8,
  34585. a.writeUint8 = function(e, t) {
  34586. var i = void 0 === t;
  34587. if (i && (t = this.offset),
  34588. !this.noAssert) {
  34589. if ("number" != typeof e || e % 1 != 0)
  34590. throw TypeError("Illegal value: " + e + " (not an integer)");
  34591. if (e >>>= 0,
  34592. "number" != typeof t || t % 1 != 0)
  34593. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34594. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34595. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34596. }
  34597. t += 1;
  34598. var n = this.buffer.byteLength;
  34599. return n < t && this.resize((n *= 2) > t ? n : t),
  34600. t -= 1,
  34601. this.view[t] = e,
  34602. i && (this.offset += 1),
  34603. this
  34604. }
  34605. ,
  34606. a.writeUInt8 = a.writeUint8,
  34607. a.readUint8 = function(e) {
  34608. var t = void 0 === e;
  34609. if (t && (e = this.offset),
  34610. !this.noAssert) {
  34611. if ("number" != typeof e || e % 1 != 0)
  34612. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34613. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34614. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34615. }
  34616. var i = this.view[e];
  34617. return t && (this.offset += 1),
  34618. i
  34619. }
  34620. ,
  34621. a.readUInt8 = a.readUint8,
  34622. a.writeInt16 = function(e, t) {
  34623. var i = void 0 === t;
  34624. if (i && (t = this.offset),
  34625. !this.noAssert) {
  34626. if ("number" != typeof e || e % 1 != 0)
  34627. throw TypeError("Illegal value: " + e + " (not an integer)");
  34628. if (e |= 0,
  34629. "number" != typeof t || t % 1 != 0)
  34630. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34631. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34632. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34633. }
  34634. t += 2;
  34635. var n = this.buffer.byteLength;
  34636. return n < t && this.resize((n *= 2) > t ? n : t),
  34637. t -= 2,
  34638. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34639. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34640. this.view[t + 1] = 255 & e),
  34641. i && (this.offset += 2),
  34642. this
  34643. }
  34644. ,
  34645. a.writeShort = a.writeInt16,
  34646. a.readInt16 = function(e) {
  34647. var t = void 0 === e;
  34648. if (t && (e = this.offset),
  34649. !this.noAssert) {
  34650. if ("number" != typeof e || e % 1 != 0)
  34651. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34652. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34653. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34654. }
  34655. var i = 0;
  34656. return this.littleEndian ? (i = this.view[e],
  34657. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34658. i |= this.view[e + 1]),
  34659. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34660. t && (this.offset += 2),
  34661. i
  34662. }
  34663. ,
  34664. a.readShort = a.readInt16,
  34665. a.writeUint16 = function(e, t) {
  34666. var i = void 0 === t;
  34667. if (i && (t = this.offset),
  34668. !this.noAssert) {
  34669. if ("number" != typeof e || e % 1 != 0)
  34670. throw TypeError("Illegal value: " + e + " (not an integer)");
  34671. if (e >>>= 0,
  34672. "number" != typeof t || t % 1 != 0)
  34673. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34674. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34675. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34676. }
  34677. t += 2;
  34678. var n = this.buffer.byteLength;
  34679. return n < t && this.resize((n *= 2) > t ? n : t),
  34680. t -= 2,
  34681. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34682. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34683. this.view[t + 1] = 255 & e),
  34684. i && (this.offset += 2),
  34685. this
  34686. }
  34687. ,
  34688. a.writeUInt16 = a.writeUint16,
  34689. a.readUint16 = function(e) {
  34690. var t = void 0 === e;
  34691. if (t && (e = this.offset),
  34692. !this.noAssert) {
  34693. if ("number" != typeof e || e % 1 != 0)
  34694. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34695. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34696. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34697. }
  34698. var i = 0;
  34699. return this.littleEndian ? (i = this.view[e],
  34700. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34701. i |= this.view[e + 1]),
  34702. t && (this.offset += 2),
  34703. i
  34704. }
  34705. ,
  34706. a.readUInt16 = a.readUint16,
  34707. a.writeInt32 = function(e, t) {
  34708. var i = void 0 === t;
  34709. if (i && (t = this.offset),
  34710. !this.noAssert) {
  34711. if ("number" != typeof e || e % 1 != 0)
  34712. throw TypeError("Illegal value: " + e + " (not an integer)");
  34713. if (e |= 0,
  34714. "number" != typeof t || t % 1 != 0)
  34715. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34716. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34717. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34718. }
  34719. t += 4;
  34720. var n = this.buffer.byteLength;
  34721. return n < t && this.resize((n *= 2) > t ? n : t),
  34722. t -= 4,
  34723. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34724. this.view[t + 2] = e >>> 16 & 255,
  34725. this.view[t + 1] = e >>> 8 & 255,
  34726. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34727. this.view[t + 1] = e >>> 16 & 255,
  34728. this.view[t + 2] = e >>> 8 & 255,
  34729. this.view[t + 3] = 255 & e),
  34730. i && (this.offset += 4),
  34731. this
  34732. }
  34733. ,
  34734. a.writeInt = a.writeInt32,
  34735. a.readInt32 = function(e) {
  34736. var t = void 0 === e;
  34737. if (t && (e = this.offset),
  34738. !this.noAssert) {
  34739. if ("number" != typeof e || e % 1 != 0)
  34740. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34741. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34742. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34743. }
  34744. var i = 0;
  34745. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34746. i |= this.view[e + 1] << 8,
  34747. i |= this.view[e],
  34748. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34749. i |= this.view[e + 2] << 8,
  34750. i |= this.view[e + 3],
  34751. i += this.view[e] << 24 >>> 0),
  34752. i |= 0,
  34753. t && (this.offset += 4),
  34754. i
  34755. }
  34756. ,
  34757. a.readInt = a.readInt32,
  34758. a.writeUint32 = function(e, t) {
  34759. var i = void 0 === t;
  34760. if (i && (t = this.offset),
  34761. !this.noAssert) {
  34762. if ("number" != typeof e || e % 1 != 0)
  34763. throw TypeError("Illegal value: " + e + " (not an integer)");
  34764. if (e >>>= 0,
  34765. "number" != typeof t || t % 1 != 0)
  34766. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34767. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34768. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34769. }
  34770. t += 4;
  34771. var n = this.buffer.byteLength;
  34772. return n < t && this.resize((n *= 2) > t ? n : t),
  34773. t -= 4,
  34774. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34775. this.view[t + 2] = e >>> 16 & 255,
  34776. this.view[t + 1] = e >>> 8 & 255,
  34777. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34778. this.view[t + 1] = e >>> 16 & 255,
  34779. this.view[t + 2] = e >>> 8 & 255,
  34780. this.view[t + 3] = 255 & e),
  34781. i && (this.offset += 4),
  34782. this
  34783. }
  34784. ,
  34785. a.writeUInt32 = a.writeUint32,
  34786. a.readUint32 = function(e) {
  34787. var t = void 0 === e;
  34788. if (t && (e = this.offset),
  34789. !this.noAssert) {
  34790. if ("number" != typeof e || e % 1 != 0)
  34791. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34792. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34793. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34794. }
  34795. var i = 0;
  34796. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34797. i |= this.view[e + 1] << 8,
  34798. i |= this.view[e],
  34799. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34800. i |= this.view[e + 2] << 8,
  34801. i |= this.view[e + 3],
  34802. i += this.view[e] << 24 >>> 0),
  34803. t && (this.offset += 4),
  34804. i
  34805. }
  34806. ,
  34807. a.readUInt32 = a.readUint32,
  34808. l && (a.writeInt64 = function(e, t) {
  34809. var i = void 0 === t;
  34810. if (i && (t = this.offset),
  34811. !this.noAssert) {
  34812. if ("number" == typeof e)
  34813. e = l.fromNumber(e);
  34814. else if ("string" == typeof e)
  34815. e = l.fromString(e);
  34816. else if (!(e && e instanceof l))
  34817. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34818. if ("number" != typeof t || t % 1 != 0)
  34819. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34820. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34821. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34822. }
  34823. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34824. t += 8;
  34825. var n = this.buffer.byteLength;
  34826. n < t && this.resize((n *= 2) > t ? n : t),
  34827. t -= 8;
  34828. var r = e.low
  34829. , o = e.high;
  34830. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34831. this.view[t + 2] = r >>> 16 & 255,
  34832. this.view[t + 1] = r >>> 8 & 255,
  34833. this.view[t] = 255 & r,
  34834. t += 4,
  34835. this.view[t + 3] = o >>> 24 & 255,
  34836. this.view[t + 2] = o >>> 16 & 255,
  34837. this.view[t + 1] = o >>> 8 & 255,
  34838. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34839. this.view[t + 1] = o >>> 16 & 255,
  34840. this.view[t + 2] = o >>> 8 & 255,
  34841. this.view[t + 3] = 255 & o,
  34842. t += 4,
  34843. this.view[t] = r >>> 24 & 255,
  34844. this.view[t + 1] = r >>> 16 & 255,
  34845. this.view[t + 2] = r >>> 8 & 255,
  34846. this.view[t + 3] = 255 & r),
  34847. i && (this.offset += 8),
  34848. this
  34849. }
  34850. ,
  34851. a.writeLong = a.writeInt64,
  34852. a.readInt64 = function(e) {
  34853. var t = void 0 === e;
  34854. if (t && (e = this.offset),
  34855. !this.noAssert) {
  34856. if ("number" != typeof e || e % 1 != 0)
  34857. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34858. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34859. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34860. }
  34861. var i = 0
  34862. , n = 0;
  34863. this.littleEndian ? (i = this.view[e + 2] << 16,
  34864. i |= this.view[e + 1] << 8,
  34865. i |= this.view[e],
  34866. i += this.view[e + 3] << 24 >>> 0,
  34867. e += 4,
  34868. n = this.view[e + 2] << 16,
  34869. n |= this.view[e + 1] << 8,
  34870. n |= this.view[e],
  34871. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34872. n |= this.view[e + 2] << 8,
  34873. n |= this.view[e + 3],
  34874. n += this.view[e] << 24 >>> 0,
  34875. e += 4,
  34876. i = this.view[e + 1] << 16,
  34877. i |= this.view[e + 2] << 8,
  34878. i |= this.view[e + 3],
  34879. i += this.view[e] << 24 >>> 0);
  34880. var r = new l(i,n,!1);
  34881. return t && (this.offset += 8),
  34882. r
  34883. }
  34884. ,
  34885. a.readLong = a.readInt64,
  34886. a.writeUint64 = function(e, t) {
  34887. var i = void 0 === t;
  34888. if (i && (t = this.offset),
  34889. !this.noAssert) {
  34890. if ("number" == typeof e)
  34891. e = l.fromNumber(e);
  34892. else if ("string" == typeof e)
  34893. e = l.fromString(e);
  34894. else if (!(e && e instanceof l))
  34895. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34896. if ("number" != typeof t || t % 1 != 0)
  34897. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34898. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34899. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34900. }
  34901. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34902. t += 8;
  34903. var n = this.buffer.byteLength;
  34904. n < t && this.resize((n *= 2) > t ? n : t),
  34905. t -= 8;
  34906. var r = e.low
  34907. , o = e.high;
  34908. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34909. this.view[t + 2] = r >>> 16 & 255,
  34910. this.view[t + 1] = r >>> 8 & 255,
  34911. this.view[t] = 255 & r,
  34912. t += 4,
  34913. this.view[t + 3] = o >>> 24 & 255,
  34914. this.view[t + 2] = o >>> 16 & 255,
  34915. this.view[t + 1] = o >>> 8 & 255,
  34916. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34917. this.view[t + 1] = o >>> 16 & 255,
  34918. this.view[t + 2] = o >>> 8 & 255,
  34919. this.view[t + 3] = 255 & o,
  34920. t += 4,
  34921. this.view[t] = r >>> 24 & 255,
  34922. this.view[t + 1] = r >>> 16 & 255,
  34923. this.view[t + 2] = r >>> 8 & 255,
  34924. this.view[t + 3] = 255 & r),
  34925. i && (this.offset += 8),
  34926. this
  34927. }
  34928. ,
  34929. a.writeUInt64 = a.writeUint64,
  34930. a.readUint64 = function(e) {
  34931. var t = void 0 === e;
  34932. if (t && (e = this.offset),
  34933. !this.noAssert) {
  34934. if ("number" != typeof e || e % 1 != 0)
  34935. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34936. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34937. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34938. }
  34939. var i = 0
  34940. , n = 0;
  34941. this.littleEndian ? (i = this.view[e + 2] << 16,
  34942. i |= this.view[e + 1] << 8,
  34943. i |= this.view[e],
  34944. i += this.view[e + 3] << 24 >>> 0,
  34945. e += 4,
  34946. n = this.view[e + 2] << 16,
  34947. n |= this.view[e + 1] << 8,
  34948. n |= this.view[e],
  34949. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34950. n |= this.view[e + 2] << 8,
  34951. n |= this.view[e + 3],
  34952. n += this.view[e] << 24 >>> 0,
  34953. e += 4,
  34954. i = this.view[e + 1] << 16,
  34955. i |= this.view[e + 2] << 8,
  34956. i |= this.view[e + 3],
  34957. i += this.view[e] << 24 >>> 0);
  34958. var r = new l(i,n,!0);
  34959. return t && (this.offset += 8),
  34960. r
  34961. }
  34962. ,
  34963. a.readUInt64 = a.readUint64),
  34964. a.writeFloat32 = function(e, t) {
  34965. var i = void 0 === t;
  34966. if (i && (t = this.offset),
  34967. !this.noAssert) {
  34968. if ("number" != typeof e)
  34969. throw TypeError("Illegal value: " + e + " (not a number)");
  34970. if ("number" != typeof t || t % 1 != 0)
  34971. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34972. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34973. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34974. }
  34975. t += 4;
  34976. var n = this.buffer.byteLength;
  34977. return n < t && this.resize((n *= 2) > t ? n : t),
  34978. t -= 4,
  34979. r(this.view, e, t, this.littleEndian, 23, 4),
  34980. i && (this.offset += 4),
  34981. this
  34982. }
  34983. ,
  34984. a.writeFloat = a.writeFloat32,
  34985. a.readFloat32 = function(e) {
  34986. var t = void 0 === e;
  34987. if (t && (e = this.offset),
  34988. !this.noAssert) {
  34989. if ("number" != typeof e || e % 1 != 0)
  34990. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34991. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34992. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34993. }
  34994. var i = n(this.view, e, this.littleEndian, 23, 4);
  34995. return t && (this.offset += 4),
  34996. i
  34997. }
  34998. ,
  34999. a.readFloat = a.readFloat32,
  35000. a.writeFloat64 = function(e, t) {
  35001. var i = void 0 === t;
  35002. if (i && (t = this.offset),
  35003. !this.noAssert) {
  35004. if ("number" != typeof e)
  35005. throw TypeError("Illegal value: " + e + " (not a number)");
  35006. if ("number" != typeof t || t % 1 != 0)
  35007. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35008. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35009. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35010. }
  35011. t += 8;
  35012. var n = this.buffer.byteLength;
  35013. return n < t && this.resize((n *= 2) > t ? n : t),
  35014. t -= 8,
  35015. r(this.view, e, t, this.littleEndian, 52, 8),
  35016. i && (this.offset += 8),
  35017. this
  35018. }
  35019. ,
  35020. a.writeDouble = a.writeFloat64,
  35021. a.readFloat64 = function(e) {
  35022. var t = void 0 === e;
  35023. if (t && (e = this.offset),
  35024. !this.noAssert) {
  35025. if ("number" != typeof e || e % 1 != 0)
  35026. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35027. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35028. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35029. }
  35030. var i = n(this.view, e, this.littleEndian, 52, 8);
  35031. return t && (this.offset += 8),
  35032. i
  35033. }
  35034. ,
  35035. a.readDouble = a.readFloat64,
  35036. f.MAX_VARINT32_BYTES = 5,
  35037. f.calculateVarint32 = function(e) {
  35038. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35039. }
  35040. ,
  35041. f.zigZagEncode32 = function(e) {
  35042. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35043. }
  35044. ,
  35045. f.zigZagDecode32 = function(e) {
  35046. return e >>> 1 ^ -(1 & e) | 0
  35047. }
  35048. ,
  35049. a.writeVarint32 = function(e, t) {
  35050. var i = void 0 === t;
  35051. if (i && (t = this.offset),
  35052. !this.noAssert) {
  35053. if ("number" != typeof e || e % 1 != 0)
  35054. throw TypeError("Illegal value: " + e + " (not an integer)");
  35055. if (e |= 0,
  35056. "number" != typeof t || t % 1 != 0)
  35057. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35058. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35059. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35060. }
  35061. var n, r = f.calculateVarint32(e);
  35062. t += r;
  35063. var o = this.buffer.byteLength;
  35064. for (o < t && this.resize((o *= 2) > t ? o : t),
  35065. t -= r,
  35066. e >>>= 0; 128 <= e; )
  35067. n = 127 & e | 128,
  35068. this.view[t++] = n,
  35069. e >>>= 7;
  35070. return this.view[t++] = e,
  35071. i ? (this.offset = t,
  35072. this) : r
  35073. }
  35074. ,
  35075. a.writeVarint32ZigZag = function(e, t) {
  35076. return this.writeVarint32(f.zigZagEncode32(e), t)
  35077. }
  35078. ,
  35079. a.readVarint32 = function(e) {
  35080. var t = void 0 === e;
  35081. if (t && (e = this.offset),
  35082. !this.noAssert) {
  35083. if ("number" != typeof e || e % 1 != 0)
  35084. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35085. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35086. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35087. }
  35088. var i, n = 0, r = 0;
  35089. do {
  35090. if (!this.noAssert && e > this.limit) {
  35091. var o = Error("Truncated");
  35092. throw o.truncated = !0,
  35093. o
  35094. }
  35095. i = this.view[e++],
  35096. n < 5 && (r |= (127 & i) << 7 * n),
  35097. ++n
  35098. } while (0 != (128 & i));return r |= 0,
  35099. t ? (this.offset = e,
  35100. r) : {
  35101. value: r,
  35102. length: n
  35103. }
  35104. }
  35105. ,
  35106. a.readVarint32ZigZag = function(e) {
  35107. var t = this.readVarint32(e);
  35108. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35109. t
  35110. }
  35111. ,
  35112. l && (f.MAX_VARINT64_BYTES = 10,
  35113. f.calculateVarint64 = function(e) {
  35114. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35115. var t = e.toInt() >>> 0
  35116. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35117. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35118. 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
  35119. }
  35120. ,
  35121. f.zigZagEncode64 = function(e) {
  35122. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35123. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35124. }
  35125. ,
  35126. f.zigZagDecode64 = function(e) {
  35127. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35128. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35129. }
  35130. ,
  35131. a.writeVarint64 = function(e, t) {
  35132. var i = void 0 === t;
  35133. if (i && (t = this.offset),
  35134. !this.noAssert) {
  35135. if ("number" == typeof e)
  35136. e = l.fromNumber(e);
  35137. else if ("string" == typeof e)
  35138. e = l.fromString(e);
  35139. else if (!(e && e instanceof l))
  35140. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35141. if ("number" != typeof t || t % 1 != 0)
  35142. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35143. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35144. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35145. }
  35146. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35147. var n = f.calculateVarint64(e)
  35148. , r = e.toInt() >>> 0
  35149. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35150. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35151. t += n;
  35152. var s = this.buffer.byteLength;
  35153. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35154. t -= n,
  35155. n) {
  35156. case 10:
  35157. this.view[t + 9] = a >>> 7 & 1;
  35158. case 9:
  35159. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35160. case 8:
  35161. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35162. case 7:
  35163. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35164. case 6:
  35165. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35166. case 5:
  35167. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35168. case 4:
  35169. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35170. case 3:
  35171. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35172. case 2:
  35173. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35174. case 1:
  35175. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35176. }
  35177. return i ? (this.offset += n,
  35178. this) : n
  35179. }
  35180. ,
  35181. a.writeVarint64ZigZag = function(e, t) {
  35182. return this.writeVarint64(f.zigZagEncode64(e), t)
  35183. }
  35184. ,
  35185. a.readVarint64 = function(e) {
  35186. var t = void 0 === e;
  35187. if (t && (e = this.offset),
  35188. !this.noAssert) {
  35189. if ("number" != typeof e || e % 1 != 0)
  35190. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35191. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35192. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35193. }
  35194. var i = e
  35195. , n = 0
  35196. , r = 0
  35197. , o = 0
  35198. , a = 0;
  35199. if (n = 127 & (a = this.view[e++]),
  35200. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35201. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35202. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35203. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35204. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35205. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35206. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35207. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35208. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35209. 128 & a || this.noAssert && void 0 === a))))))))))
  35210. throw Error("Buffer overrun");
  35211. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35212. return t ? (this.offset = e,
  35213. s) : {
  35214. value: s,
  35215. length: e - i
  35216. }
  35217. }
  35218. ,
  35219. a.readVarint64ZigZag = function(e) {
  35220. var t = this.readVarint64(e);
  35221. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35222. t
  35223. }
  35224. ),
  35225. a.writeCString = function(e, t) {
  35226. var i = void 0 === t;
  35227. i && (t = this.offset);
  35228. var n, r = e.length;
  35229. if (!this.noAssert) {
  35230. if ("string" != typeof e)
  35231. throw TypeError("Illegal str: Not a string");
  35232. for (n = 0; n < r; ++n)
  35233. if (0 === e.charCodeAt(n))
  35234. throw RangeError("Illegal str: Contains NULL-characters");
  35235. if ("number" != typeof t || t % 1 != 0)
  35236. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35237. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35238. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35239. }
  35240. r = d.calculateUTF16asUTF8(s(e))[1],
  35241. t += r + 1;
  35242. var o = this.buffer.byteLength;
  35243. return o < t && this.resize((o *= 2) > t ? o : t),
  35244. t -= r + 1,
  35245. d.encodeUTF16toUTF8(s(e), function(e) {
  35246. this.view[t++] = e
  35247. }
  35248. .bind(this)),
  35249. this.view[t++] = 0,
  35250. i ? (this.offset = t,
  35251. this) : r
  35252. }
  35253. ,
  35254. a.readCString = function(e) {
  35255. var t = void 0 === e;
  35256. if (t && (e = this.offset),
  35257. !this.noAssert) {
  35258. if ("number" != typeof e || e % 1 != 0)
  35259. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35260. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35261. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35262. }
  35263. var i, n = e, r = -1;
  35264. return d.decodeUTF8toUTF16(function() {
  35265. if (0 === r)
  35266. return null;
  35267. if (e >= this.limit)
  35268. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35269. return 0 === (r = this.view[e++]) ? null : r
  35270. }
  35271. .bind(this), i = c(), !0),
  35272. t ? (this.offset = e,
  35273. i()) : {
  35274. string: i(),
  35275. length: e - n
  35276. }
  35277. }
  35278. ,
  35279. a.writeIString = function(e, t) {
  35280. var i = void 0 === t;
  35281. if (i && (t = this.offset),
  35282. !this.noAssert) {
  35283. if ("string" != typeof e)
  35284. throw TypeError("Illegal str: Not a string");
  35285. if ("number" != typeof t || t % 1 != 0)
  35286. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35287. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35288. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35289. }
  35290. var n, r = t;
  35291. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35292. t += 4 + n;
  35293. var o = this.buffer.byteLength;
  35294. if (o < t && this.resize((o *= 2) > t ? o : t),
  35295. t -= 4 + n,
  35296. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35297. this.view[t + 2] = n >>> 16 & 255,
  35298. this.view[t + 1] = n >>> 8 & 255,
  35299. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35300. this.view[t + 1] = n >>> 16 & 255,
  35301. this.view[t + 2] = n >>> 8 & 255,
  35302. this.view[t + 3] = 255 & n),
  35303. t += 4,
  35304. d.encodeUTF16toUTF8(s(e), function(e) {
  35305. this.view[t++] = e
  35306. }
  35307. .bind(this)),
  35308. t !== r + 4 + n)
  35309. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35310. return i ? (this.offset = t,
  35311. this) : t - r
  35312. }
  35313. ,
  35314. a.readIString = function(e) {
  35315. var t = void 0 === e;
  35316. if (t && (e = this.offset),
  35317. !this.noAssert) {
  35318. if ("number" != typeof e || e % 1 != 0)
  35319. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35320. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35321. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35322. }
  35323. var i = e
  35324. , n = this.readUint32(e)
  35325. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35326. return e += r.length,
  35327. t ? (this.offset = e,
  35328. r.string) : {
  35329. string: r.string,
  35330. length: e - i
  35331. }
  35332. }
  35333. ,
  35334. f.METRICS_CHARS = "c",
  35335. f.METRICS_BYTES = "b",
  35336. a.writeUTF8String = function(e, t) {
  35337. var i = void 0 === t;
  35338. if (i && (t = this.offset),
  35339. !this.noAssert) {
  35340. if ("number" != typeof t || t % 1 != 0)
  35341. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35342. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35343. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35344. }
  35345. var n, r = t;
  35346. n = d.calculateUTF16asUTF8(s(e))[1],
  35347. t += n;
  35348. var o = this.buffer.byteLength;
  35349. return o < t && this.resize((o *= 2) > t ? o : t),
  35350. t -= n,
  35351. d.encodeUTF16toUTF8(s(e), function(e) {
  35352. this.view[t++] = e
  35353. }
  35354. .bind(this)),
  35355. i ? (this.offset = t,
  35356. this) : t - r
  35357. }
  35358. ,
  35359. a.writeString = a.writeUTF8String,
  35360. f.calculateUTF8Chars = function(e) {
  35361. return d.calculateUTF16asUTF8(s(e))[0]
  35362. }
  35363. ,
  35364. f.calculateUTF8Bytes = function(e) {
  35365. return d.calculateUTF16asUTF8(s(e))[1]
  35366. }
  35367. ,
  35368. f.calculateString = f.calculateUTF8Bytes,
  35369. a.readUTF8String = function(e, t, i) {
  35370. "number" == typeof t && (i = t,
  35371. t = void 0);
  35372. var n = void 0 === i;
  35373. if (n && (i = this.offset),
  35374. void 0 === t && (t = f.METRICS_CHARS),
  35375. !this.noAssert) {
  35376. if ("number" != typeof e || e % 1 != 0)
  35377. throw TypeError("Illegal length: " + e + " (not an integer)");
  35378. if (e |= 0,
  35379. "number" != typeof i || i % 1 != 0)
  35380. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35381. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35382. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35383. }
  35384. var r, o = 0, a = i;
  35385. if (t === f.METRICS_CHARS) {
  35386. if (r = c(),
  35387. d.decodeUTF8(function() {
  35388. return o < e && i < this.limit ? this.view[i++] : null
  35389. }
  35390. .bind(this), function(e) {
  35391. ++o,
  35392. d.UTF8toUTF16(e, r)
  35393. }),
  35394. o !== e)
  35395. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35396. return n ? (this.offset = i,
  35397. r()) : {
  35398. string: r(),
  35399. length: i - a
  35400. }
  35401. }
  35402. if (t !== f.METRICS_BYTES)
  35403. throw TypeError("Unsupported metrics: " + t);
  35404. if (!this.noAssert) {
  35405. if ("number" != typeof i || i % 1 != 0)
  35406. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35407. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35408. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35409. }
  35410. var s = i + e;
  35411. if (d.decodeUTF8toUTF16(function() {
  35412. return i < s ? this.view[i++] : null
  35413. }
  35414. .bind(this), r = c(), this.noAssert),
  35415. i !== s)
  35416. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35417. return n ? (this.offset = i,
  35418. r()) : {
  35419. string: r(),
  35420. length: i - a
  35421. }
  35422. }
  35423. ,
  35424. a.readString = a.readUTF8String,
  35425. a.writeVString = function(e, t) {
  35426. var i = void 0 === t;
  35427. if (i && (t = this.offset),
  35428. !this.noAssert) {
  35429. if ("string" != typeof e)
  35430. throw TypeError("Illegal str: Not a string");
  35431. if ("number" != typeof t || t % 1 != 0)
  35432. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35433. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35434. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35435. }
  35436. var n, r, o = t;
  35437. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35438. r = f.calculateVarint32(n),
  35439. t += r + n;
  35440. var a = this.buffer.byteLength;
  35441. if (a < t && this.resize((a *= 2) > t ? a : t),
  35442. t -= r + n,
  35443. t += this.writeVarint32(n, t),
  35444. d.encodeUTF16toUTF8(s(e), function(e) {
  35445. this.view[t++] = e
  35446. }
  35447. .bind(this)),
  35448. t !== o + n + r)
  35449. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35450. return i ? (this.offset = t,
  35451. this) : t - o
  35452. }
  35453. ,
  35454. a.readVString = function(e) {
  35455. var t = void 0 === e;
  35456. if (t && (e = this.offset),
  35457. !this.noAssert) {
  35458. if ("number" != typeof e || e % 1 != 0)
  35459. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35460. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35461. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35462. }
  35463. var i = e
  35464. , n = this.readVarint32(e)
  35465. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35466. return e += r.length,
  35467. t ? (this.offset = e,
  35468. r.string) : {
  35469. string: r.string,
  35470. length: e - i
  35471. }
  35472. }
  35473. ,
  35474. a.append = function(e, t, i) {
  35475. "number" != typeof t && "string" == typeof t || (i = t,
  35476. t = void 0);
  35477. var n = void 0 === i;
  35478. if (n && (i = this.offset),
  35479. !this.noAssert) {
  35480. if ("number" != typeof i || i % 1 != 0)
  35481. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35482. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35483. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35484. }
  35485. e instanceof f || (e = f.wrap(e, t));
  35486. var r = e.limit - e.offset;
  35487. if (r <= 0)
  35488. return this;
  35489. i += r;
  35490. var o = this.buffer.byteLength;
  35491. return o < i && this.resize((o *= 2) > i ? o : i),
  35492. i -= r,
  35493. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35494. e.offset += r,
  35495. n && (this.offset += r),
  35496. this
  35497. }
  35498. ,
  35499. a.appendTo = function(e, t) {
  35500. return e.append(this, t),
  35501. this
  35502. }
  35503. ,
  35504. a.assert = function(e) {
  35505. return this.noAssert = !e,
  35506. this
  35507. }
  35508. ,
  35509. a.capacity = function() {
  35510. return this.buffer.byteLength
  35511. }
  35512. ,
  35513. a.clear = function() {
  35514. return this.offset = 0,
  35515. this.limit = this.buffer.byteLength,
  35516. this.markedOffset = -1,
  35517. this
  35518. }
  35519. ,
  35520. a.clone = function(e) {
  35521. var t = new f(0,this.littleEndian,this.noAssert);
  35522. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35523. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35524. t.view = this.view),
  35525. t.offset = this.offset,
  35526. t.markedOffset = this.markedOffset,
  35527. t.limit = this.limit,
  35528. t
  35529. }
  35530. ,
  35531. a.compact = function(e, t) {
  35532. if (void 0 === e && (e = this.offset),
  35533. void 0 === t && (t = this.limit),
  35534. !this.noAssert) {
  35535. if ("number" != typeof e || e % 1 != 0)
  35536. throw TypeError("Illegal begin: Not an integer");
  35537. if (e >>>= 0,
  35538. "number" != typeof t || t % 1 != 0)
  35539. throw TypeError("Illegal end: Not an integer");
  35540. if (t >>>= 0,
  35541. e < 0 || t < e || t > this.buffer.byteLength)
  35542. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35543. }
  35544. if (0 === e && t === this.buffer.byteLength)
  35545. return this;
  35546. var i = t - e;
  35547. if (0 == i)
  35548. return this.buffer = o,
  35549. this.view = null,
  35550. 0 <= this.markedOffset && (this.markedOffset -= e),
  35551. this.offset = 0,
  35552. this.limit = 0,
  35553. this;
  35554. var n = new ArrayBuffer(i)
  35555. , r = new Uint8Array(n);
  35556. return r.set(this.view.subarray(e, t)),
  35557. this.buffer = n,
  35558. this.view = r,
  35559. 0 <= this.markedOffset && (this.markedOffset -= e),
  35560. this.offset = 0,
  35561. this.limit = i,
  35562. this
  35563. }
  35564. ,
  35565. a.copy = function(e, t) {
  35566. if (void 0 === e && (e = this.offset),
  35567. void 0 === t && (t = this.limit),
  35568. !this.noAssert) {
  35569. if ("number" != typeof e || e % 1 != 0)
  35570. throw TypeError("Illegal begin: Not an integer");
  35571. if (e >>>= 0,
  35572. "number" != typeof t || t % 1 != 0)
  35573. throw TypeError("Illegal end: Not an integer");
  35574. if (t >>>= 0,
  35575. e < 0 || t < e || t > this.buffer.byteLength)
  35576. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35577. }
  35578. if (e === t)
  35579. return new f(0,this.littleEndian,this.noAssert);
  35580. var i = t - e
  35581. , n = new f(i,this.littleEndian,this.noAssert);
  35582. return n.offset = 0,
  35583. n.limit = i,
  35584. 0 <= n.markedOffset && (n.markedOffset -= e),
  35585. this.copyTo(n, 0, e, t),
  35586. n
  35587. }
  35588. ,
  35589. a.copyTo = function(e, t, i, n) {
  35590. var r, o;
  35591. if (!this.noAssert && !f.isByteBuffer(e))
  35592. throw TypeError("Illegal target: Not a ByteBuffer");
  35593. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35594. i = (r = void 0 === i) ? this.offset : 0 | i,
  35595. n = void 0 === n ? this.limit : 0 | n,
  35596. t < 0 || t > e.buffer.byteLength)
  35597. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35598. if (i < 0 || n > this.buffer.byteLength)
  35599. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35600. var a = n - i;
  35601. return 0 == a ? e : (e.ensureCapacity(t + a),
  35602. e.view.set(this.view.subarray(i, n), t),
  35603. r && (this.offset += a),
  35604. o && (e.offset += a),
  35605. this)
  35606. }
  35607. ,
  35608. a.ensureCapacity = function(e) {
  35609. var t = this.buffer.byteLength;
  35610. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35611. }
  35612. ,
  35613. a.fill = function(e, t, i) {
  35614. var n = void 0 === t;
  35615. if (n && (t = this.offset),
  35616. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35617. void 0 === t && (t = this.offset),
  35618. void 0 === i && (i = this.limit),
  35619. !this.noAssert) {
  35620. if ("number" != typeof e || e % 1 != 0)
  35621. throw TypeError("Illegal value: " + e + " (not an integer)");
  35622. if (e |= 0,
  35623. "number" != typeof t || t % 1 != 0)
  35624. throw TypeError("Illegal begin: Not an integer");
  35625. if (t >>>= 0,
  35626. "number" != typeof i || i % 1 != 0)
  35627. throw TypeError("Illegal end: Not an integer");
  35628. if (i >>>= 0,
  35629. t < 0 || i < t || i > this.buffer.byteLength)
  35630. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35631. }
  35632. if (i <= t)
  35633. return this;
  35634. for (; t < i; )
  35635. this.view[t++] = e;
  35636. return n && (this.offset = t),
  35637. this
  35638. }
  35639. ,
  35640. a.flip = function() {
  35641. return this.limit = this.offset,
  35642. this.offset = 0,
  35643. this
  35644. }
  35645. ,
  35646. a.mark = function(e) {
  35647. if (e = void 0 === e ? this.offset : e,
  35648. !this.noAssert) {
  35649. if ("number" != typeof e || e % 1 != 0)
  35650. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35651. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35652. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35653. }
  35654. return this.markedOffset = e,
  35655. this
  35656. }
  35657. ,
  35658. a.order = function(e) {
  35659. if (!this.noAssert && "boolean" != typeof e)
  35660. throw TypeError("Illegal littleEndian: Not a boolean");
  35661. return this.littleEndian = !!e,
  35662. this
  35663. }
  35664. ,
  35665. a.LE = function(e) {
  35666. return this.littleEndian = void 0 === e || !!e,
  35667. this
  35668. }
  35669. ,
  35670. a.BE = function(e) {
  35671. return this.littleEndian = void 0 !== e && !e,
  35672. this
  35673. }
  35674. ,
  35675. a.prepend = function(e, t, i) {
  35676. "number" != typeof t && "string" == typeof t || (i = t,
  35677. t = void 0);
  35678. var n = void 0 === i;
  35679. if (n && (i = this.offset),
  35680. !this.noAssert) {
  35681. if ("number" != typeof i || i % 1 != 0)
  35682. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35683. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35684. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35685. }
  35686. e instanceof f || (e = f.wrap(e, t));
  35687. var r = e.limit - e.offset;
  35688. if (r <= 0)
  35689. return this;
  35690. var o = r - i;
  35691. if (0 < o) {
  35692. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35693. , s = new Uint8Array(a);
  35694. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35695. this.buffer = a,
  35696. this.view = s,
  35697. this.offset += o,
  35698. 0 <= this.markedOffset && (this.markedOffset += o),
  35699. this.limit += o,
  35700. i += o
  35701. } else
  35702. new Uint8Array(this.buffer);
  35703. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35704. e.offset = e.limit,
  35705. n && (this.offset -= r),
  35706. this
  35707. }
  35708. ,
  35709. a.prependTo = function(e, t) {
  35710. return e.prepend(this, t),
  35711. this
  35712. }
  35713. ,
  35714. a.printDebug = function(e) {
  35715. "function" != typeof e && (e = console.log.bind(console)),
  35716. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35717. }
  35718. ,
  35719. a.remaining = function() {
  35720. return this.limit - this.offset
  35721. }
  35722. ,
  35723. a.reset = function() {
  35724. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35725. this.markedOffset = -1) : this.offset = 0,
  35726. this
  35727. }
  35728. ,
  35729. a.resize = function(e) {
  35730. if (!this.noAssert) {
  35731. if ("number" != typeof e || e % 1 != 0)
  35732. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35733. if ((e |= 0) < 0)
  35734. throw RangeError("Illegal capacity: 0 <= " + e)
  35735. }
  35736. if (this.buffer.byteLength < e) {
  35737. var t = new ArrayBuffer(e)
  35738. , i = new Uint8Array(t);
  35739. i.set(this.view),
  35740. this.buffer = t,
  35741. this.view = i
  35742. }
  35743. return this
  35744. }
  35745. ,
  35746. a.reverse = function(e, t) {
  35747. if (void 0 === e && (e = this.offset),
  35748. void 0 === t && (t = this.limit),
  35749. !this.noAssert) {
  35750. if ("number" != typeof e || e % 1 != 0)
  35751. throw TypeError("Illegal begin: Not an integer");
  35752. if (e >>>= 0,
  35753. "number" != typeof t || t % 1 != 0)
  35754. throw TypeError("Illegal end: Not an integer");
  35755. if (t >>>= 0,
  35756. e < 0 || t < e || t > this.buffer.byteLength)
  35757. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35758. }
  35759. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35760. this
  35761. }
  35762. ,
  35763. a.skip = function(e) {
  35764. if (!this.noAssert) {
  35765. if ("number" != typeof e || e % 1 != 0)
  35766. throw TypeError("Illegal length: " + e + " (not an integer)");
  35767. e |= 0
  35768. }
  35769. var t = this.offset + e;
  35770. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35771. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35772. return this.offset = t,
  35773. this
  35774. }
  35775. ,
  35776. a.slice = function(e, t) {
  35777. if (void 0 === e && (e = this.offset),
  35778. void 0 === t && (t = this.limit),
  35779. !this.noAssert) {
  35780. if ("number" != typeof e || e % 1 != 0)
  35781. throw TypeError("Illegal begin: Not an integer");
  35782. if (e >>>= 0,
  35783. "number" != typeof t || t % 1 != 0)
  35784. throw TypeError("Illegal end: Not an integer");
  35785. if (t >>>= 0,
  35786. e < 0 || t < e || t > this.buffer.byteLength)
  35787. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35788. }
  35789. var i = this.clone();
  35790. return i.offset = e,
  35791. i.limit = t,
  35792. i
  35793. }
  35794. ,
  35795. a.toBuffer = function(e) {
  35796. var t = this.offset
  35797. , i = this.limit;
  35798. if (!this.noAssert) {
  35799. if ("number" != typeof t || t % 1 != 0)
  35800. throw TypeError("Illegal offset: Not an integer");
  35801. if (t >>>= 0,
  35802. "number" != typeof i || i % 1 != 0)
  35803. throw TypeError("Illegal limit: Not an integer");
  35804. if (i >>>= 0,
  35805. t < 0 || i < t || i > this.buffer.byteLength)
  35806. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35807. }
  35808. if (!e && 0 === t && i === this.buffer.byteLength)
  35809. return this.buffer;
  35810. if (t === i)
  35811. return o;
  35812. var n = new ArrayBuffer(i - t);
  35813. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35814. n
  35815. }
  35816. ,
  35817. a.toArrayBuffer = a.toBuffer,
  35818. a.toString = function(e, t, i) {
  35819. if (void 0 === e)
  35820. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35821. switch ("number" == typeof e && (i = t = e = "utf8"),
  35822. e) {
  35823. case "utf8":
  35824. return this.toUTF8(t, i);
  35825. case "base64":
  35826. return this.toBase64(t, i);
  35827. case "hex":
  35828. return this.toHex(t, i);
  35829. case "binary":
  35830. return this.toBinary(t, i);
  35831. case "debug":
  35832. return this.toDebug();
  35833. case "columns":
  35834. return this.toColumns();
  35835. default:
  35836. throw Error("Unsupported encoding: " + e)
  35837. }
  35838. }
  35839. ;
  35840. var h = function() {
  35841. 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)
  35842. a[r[t]] = t;
  35843. return e.encode = function(e, t) {
  35844. for (var i, n; null !== (i = e()); )
  35845. t(r[i >> 2 & 63]),
  35846. n = (3 & i) << 4,
  35847. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  35848. n = (15 & i) << 2,
  35849. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  35850. t(r[63 & i])) : (t(r[63 & n]),
  35851. t(61))) : (t(r[63 & n]),
  35852. t(61),
  35853. t(61))
  35854. }
  35855. ,
  35856. e.decode = function(e, t) {
  35857. function i(e) {
  35858. throw Error("Illegal character code: " + e)
  35859. }
  35860. for (var n, r, o; null !== (n = e()); )
  35861. if (void 0 === (r = a[n]) && i(n),
  35862. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  35863. t(r << 2 >>> 0 | (48 & o) >> 4),
  35864. null !== (n = e()))) {
  35865. if (void 0 === (r = a[n])) {
  35866. if (61 === n)
  35867. break;
  35868. i(n)
  35869. }
  35870. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  35871. null !== (n = e())) {
  35872. if (void 0 === (o = a[n])) {
  35873. if (61 === n)
  35874. break;
  35875. i(n)
  35876. }
  35877. t((3 & r) << 6 >>> 0 | o)
  35878. }
  35879. }
  35880. }
  35881. ,
  35882. e.test = function(e) {
  35883. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  35884. }
  35885. ,
  35886. e
  35887. }();
  35888. a.toBase64 = function(e, t) {
  35889. if (void 0 === e && (e = this.offset),
  35890. void 0 === t && (t = this.limit),
  35891. t |= 0,
  35892. (e |= 0) < 0 || t > this.capacity || t < e)
  35893. throw RangeError("begin, end");
  35894. var i;
  35895. return h.encode(function() {
  35896. return e < t ? this.view[e++] : null
  35897. }
  35898. .bind(this), i = c()),
  35899. i()
  35900. }
  35901. ,
  35902. f.fromBase64 = function(e, t) {
  35903. if ("string" != typeof e)
  35904. throw TypeError("str");
  35905. var i = new f(e.length / 4 * 3,t)
  35906. , n = 0;
  35907. return h.decode(s(e), function(e) {
  35908. i.view[n++] = e
  35909. }),
  35910. i.limit = n,
  35911. i
  35912. }
  35913. ,
  35914. f.btoa = function(e) {
  35915. return f.fromBinary(e).toBase64()
  35916. }
  35917. ,
  35918. f.atob = function(e) {
  35919. return f.fromBase64(e).toBinary()
  35920. }
  35921. ,
  35922. a.toBinary = function(e, t) {
  35923. if (void 0 === e && (e = this.offset),
  35924. void 0 === t && (t = this.limit),
  35925. t |= 0,
  35926. (e |= 0) < 0 || t > this.capacity() || t < e)
  35927. throw RangeError("begin, end");
  35928. if (e === t)
  35929. return "";
  35930. for (var i = [], n = []; e < t; )
  35931. i.push(this.view[e++]),
  35932. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  35933. i = []);
  35934. return n.join("") + String.fromCharCode.apply(String, i)
  35935. }
  35936. ,
  35937. f.fromBinary = function(e, t) {
  35938. if ("string" != typeof e)
  35939. throw TypeError("str");
  35940. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  35941. if (255 < (i = e.charCodeAt(n)))
  35942. throw RangeError("illegal char code: " + i);
  35943. o.view[n++] = i
  35944. }
  35945. return o.limit = r,
  35946. o
  35947. }
  35948. ,
  35949. a.toDebug = function(e) {
  35950. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  35951. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  35952. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  35953. ++i,
  35954. e && 0 < i && i % 16 == 0 && i !== n) {
  35955. for (; r.length < 51; )
  35956. r += " ";
  35957. a += r + o + "\n",
  35958. r = o = ""
  35959. }
  35960. 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 ? " " : ""
  35961. }
  35962. if (e && " " !== r) {
  35963. for (; r.length < 51; )
  35964. r += " ";
  35965. a += r + o + "\n"
  35966. }
  35967. return e ? a : r
  35968. }
  35969. ,
  35970. f.fromDebug = function(e, t, i) {
  35971. 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; ) {
  35972. switch (n = e.charAt(s++)) {
  35973. case "!":
  35974. if (!i) {
  35975. if (h || u || d) {
  35976. p = !0;
  35977. break
  35978. }
  35979. h = u = d = !0
  35980. }
  35981. a.offset = a.markedOffset = a.limit = l,
  35982. c = !1;
  35983. break;
  35984. case "|":
  35985. if (!i) {
  35986. if (h || d) {
  35987. p = !0;
  35988. break
  35989. }
  35990. h = d = !0
  35991. }
  35992. a.offset = a.limit = l,
  35993. c = !1;
  35994. break;
  35995. case "[":
  35996. if (!i) {
  35997. if (h || u) {
  35998. p = !0;
  35999. break
  36000. }
  36001. h = u = !0
  36002. }
  36003. a.offset = a.markedOffset = l,
  36004. c = !1;
  36005. break;
  36006. case "<":
  36007. if (!i) {
  36008. if (h) {
  36009. p = !0;
  36010. break
  36011. }
  36012. h = !0
  36013. }
  36014. a.offset = l,
  36015. c = !1;
  36016. break;
  36017. case "]":
  36018. if (!i) {
  36019. if (d || u) {
  36020. p = !0;
  36021. break
  36022. }
  36023. d = u = !0
  36024. }
  36025. a.limit = a.markedOffset = l,
  36026. c = !1;
  36027. break;
  36028. case ">":
  36029. if (!i) {
  36030. if (d) {
  36031. p = !0;
  36032. break
  36033. }
  36034. d = !0
  36035. }
  36036. a.limit = l,
  36037. c = !1;
  36038. break;
  36039. case "'":
  36040. if (!i) {
  36041. if (u) {
  36042. p = !0;
  36043. break
  36044. }
  36045. u = !0
  36046. }
  36047. a.markedOffset = l,
  36048. c = !1;
  36049. break;
  36050. case " ":
  36051. c = !1;
  36052. break;
  36053. default:
  36054. if (!i && c) {
  36055. p = !0;
  36056. break
  36057. }
  36058. if (r = parseInt(n + e.charAt(s++), 16),
  36059. !i && (isNaN(r) || r < 0 || 255 < r))
  36060. throw TypeError("Illegal str: Not a debug encoded string");
  36061. a.view[l++] = r,
  36062. c = !0
  36063. }
  36064. if (p)
  36065. throw TypeError("Illegal str: Invalid symbol at " + s)
  36066. }
  36067. if (!i) {
  36068. if (!h || !d)
  36069. throw TypeError("Illegal str: Missing offset or limit");
  36070. if (l < a.buffer.byteLength)
  36071. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36072. }
  36073. return a
  36074. }
  36075. ,
  36076. a.toHex = function(e, t) {
  36077. if (e = void 0 === e ? this.offset : e,
  36078. t = void 0 === t ? this.limit : t,
  36079. !this.noAssert) {
  36080. if ("number" != typeof e || e % 1 != 0)
  36081. throw TypeError("Illegal begin: Not an integer");
  36082. if (e >>>= 0,
  36083. "number" != typeof t || t % 1 != 0)
  36084. throw TypeError("Illegal end: Not an integer");
  36085. if (t >>>= 0,
  36086. e < 0 || t < e || t > this.buffer.byteLength)
  36087. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36088. }
  36089. for (var i, n = new Array(t - e); e < t; )
  36090. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36091. return n.join("")
  36092. }
  36093. ,
  36094. f.fromHex = function(e, t, i) {
  36095. if (!i) {
  36096. if ("string" != typeof e)
  36097. throw TypeError("Illegal str: Not a string");
  36098. if (e.length % 2 != 0)
  36099. throw TypeError("Illegal str: Length not a multiple of 2")
  36100. }
  36101. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36102. if (n = parseInt(e.substring(a, a + 2), 16),
  36103. !i && (!isFinite(n) || n < 0 || 255 < n))
  36104. throw TypeError("Illegal str: Contains non-hex characters");
  36105. o.view[s++] = n
  36106. }
  36107. return o.limit = s,
  36108. o
  36109. }
  36110. ;
  36111. var u, d = u = {
  36112. MAX_CODEPOINT: 1114111,
  36113. encodeUTF8: function(e, t) {
  36114. var i = null;
  36115. for ("number" == typeof e && (i = e,
  36116. e = function() {
  36117. return null
  36118. }
  36119. ); null !== i || null !== (i = e()); )
  36120. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36121. t(i >> 12 & 63 | 128)),
  36122. t(i >> 6 & 63 | 128)),
  36123. t(63 & i | 128)),
  36124. i = null
  36125. },
  36126. decodeUTF8: function(e, t) {
  36127. for (var i, n, r, o, a = function(e) {
  36128. e = e.slice(0, e.indexOf(null));
  36129. var t = Error(e.toString());
  36130. throw t.name = "TruncatedError",
  36131. t.bytes = e,
  36132. t
  36133. }; null !== (i = e()); )
  36134. if (0 == (128 & i))
  36135. t(i);
  36136. else if (192 == (224 & i))
  36137. null === (n = e()) && a([i, n]),
  36138. t((31 & i) << 6 | 63 & n);
  36139. else if (224 == (240 & i))
  36140. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36141. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36142. else {
  36143. if (240 != (248 & i))
  36144. throw RangeError("Illegal starting byte: " + i);
  36145. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36146. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36147. }
  36148. },
  36149. UTF16toUTF8: function(e, t) {
  36150. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36151. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36152. n = null) : t(i);
  36153. null !== n && t(n)
  36154. },
  36155. UTF8toUTF16: function(e, t) {
  36156. var i = null;
  36157. for ("number" == typeof e && (i = e,
  36158. e = function() {
  36159. return null
  36160. }
  36161. ); null !== i || null !== (i = e()); )
  36162. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36163. t(i % 1024 + 56320)),
  36164. i = null
  36165. },
  36166. encodeUTF16toUTF8: function(e, t) {
  36167. u.UTF16toUTF8(e, function(e) {
  36168. u.encodeUTF8(e, t)
  36169. })
  36170. },
  36171. decodeUTF8toUTF16: function(e, t) {
  36172. u.decodeUTF8(e, function(e) {
  36173. u.UTF8toUTF16(e, t)
  36174. })
  36175. },
  36176. calculateCodePoint: function(e) {
  36177. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36178. },
  36179. calculateUTF8: function(e) {
  36180. for (var t, i = 0; null !== (t = e()); )
  36181. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36182. return i
  36183. },
  36184. calculateUTF16asUTF8: function(e) {
  36185. var t = 0
  36186. , i = 0;
  36187. return u.UTF16toUTF8(e, function(e) {
  36188. ++t,
  36189. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36190. }),
  36191. [t, i]
  36192. }
  36193. };
  36194. return a.toUTF8 = function(t, i) {
  36195. if (void 0 === t && (t = this.offset),
  36196. void 0 === i && (i = this.limit),
  36197. !this.noAssert) {
  36198. if ("number" != typeof t || t % 1 != 0)
  36199. throw TypeError("Illegal begin: Not an integer");
  36200. if (t >>>= 0,
  36201. "number" != typeof i || i % 1 != 0)
  36202. throw TypeError("Illegal end: Not an integer");
  36203. if (i >>>= 0,
  36204. t < 0 || i < t || i > this.buffer.byteLength)
  36205. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36206. }
  36207. var e;
  36208. try {
  36209. d.decodeUTF8toUTF16(function() {
  36210. return t < i ? this.view[t++] : null
  36211. }
  36212. .bind(this), e = c())
  36213. } catch (e) {
  36214. if (t !== i)
  36215. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36216. }
  36217. return e()
  36218. }
  36219. ,
  36220. f.fromUTF8 = function(e, t, i) {
  36221. if (!i && "string" != typeof e)
  36222. throw TypeError("Illegal str: Not a string");
  36223. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36224. , r = 0;
  36225. return d.encodeUTF16toUTF8(s(e), function(e) {
  36226. n.view[r++] = e
  36227. }),
  36228. n.limit = r,
  36229. n
  36230. }
  36231. ,
  36232. f
  36233. }
  36234. ,
  36235. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36236. var e;
  36237. try {
  36238. e = t("long")
  36239. } catch (e) {}
  36240. return r(e)
  36241. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36242. }
  36243. , {
  36244. long: 216
  36245. }],
  36246. 216: [function(e, t, i) {
  36247. var n, r;
  36248. n = this,
  36249. r = function() {
  36250. "use strict";
  36251. function n(e, t, i) {
  36252. this.low = 0 | e,
  36253. this.high = 0 | t,
  36254. this.unsigned = !!i
  36255. }
  36256. function p(e) {
  36257. return !0 === (e && e.__isLong__)
  36258. }
  36259. function e(e, t) {
  36260. var i, n, r;
  36261. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36262. r && (a[e] = i),
  36263. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36264. r && (o[e] = i),
  36265. i)
  36266. }
  36267. function f(e, t) {
  36268. if (isNaN(e) || !isFinite(e))
  36269. return t ? l : y;
  36270. if (t) {
  36271. if (e < 0)
  36272. return l;
  36273. if (r <= e)
  36274. return I
  36275. } else {
  36276. if (e <= -s)
  36277. return E;
  36278. if (s <= e + 1)
  36279. return C
  36280. }
  36281. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36282. }
  36283. function g(e, t, i) {
  36284. return new n(e,t,i)
  36285. }
  36286. function h(e, t, i) {
  36287. if (0 === e.length)
  36288. throw Error("empty string");
  36289. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36290. return y;
  36291. if (t = "number" == typeof t ? (i = t,
  36292. !1) : !!t,
  36293. (i = i || 10) < 2 || 36 < i)
  36294. throw RangeError("radix");
  36295. var n;
  36296. if (0 < (n = e.indexOf("-")))
  36297. throw Error("interior hyphen");
  36298. if (0 === n)
  36299. return h(e.substring(1), t, i).neg();
  36300. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36301. var s = Math.min(8, e.length - a)
  36302. , l = parseInt(e.substring(a, a + s), i);
  36303. if (s < 8) {
  36304. var c = f(u(i, s));
  36305. o = o.mul(c).add(f(l))
  36306. } else
  36307. o = (o = o.mul(r)).add(f(l))
  36308. }
  36309. return o.unsigned = t,
  36310. o
  36311. }
  36312. function m(e) {
  36313. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36314. }
  36315. Object.defineProperty(n.prototype, "__isLong__", {
  36316. value: !0,
  36317. enumerable: !1,
  36318. configurable: !1
  36319. }),
  36320. n.isLong = p;
  36321. var o = {}
  36322. , a = {};
  36323. n.fromInt = e,
  36324. n.fromNumber = f,
  36325. n.fromBits = g;
  36326. var u = Math.pow;
  36327. n.fromString = h,
  36328. n.fromValue = m;
  36329. var i = 4294967296
  36330. , r = 0x10000000000000000
  36331. , s = r / 2
  36332. , v = e(1 << 24)
  36333. , y = e(0);
  36334. n.ZERO = y;
  36335. var l = e(0, !0);
  36336. n.UZERO = l;
  36337. var c = e(1);
  36338. n.ONE = c;
  36339. var d = e(1, !0);
  36340. n.UONE = d;
  36341. var A = e(-1);
  36342. n.NEG_ONE = A;
  36343. var C = g(-1, 2147483647, !1);
  36344. n.MAX_VALUE = C;
  36345. var I = g(-1, -1, !0);
  36346. n.MAX_UNSIGNED_VALUE = I;
  36347. var E = g(0, -2147483648, !1);
  36348. n.MIN_VALUE = E;
  36349. var t = n.prototype;
  36350. return t.toInt = function() {
  36351. return this.unsigned ? this.low >>> 0 : this.low
  36352. }
  36353. ,
  36354. t.toNumber = function() {
  36355. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36356. }
  36357. ,
  36358. t.toString = function(e) {
  36359. if ((e = e || 10) < 2 || 36 < e)
  36360. throw RangeError("radix");
  36361. if (this.isZero())
  36362. return "0";
  36363. if (this.isNegative()) {
  36364. if (this.eq(E)) {
  36365. var t = f(e)
  36366. , i = this.div(t)
  36367. , n = i.mul(t).sub(this);
  36368. return i.toString(e) + n.toInt().toString(e)
  36369. }
  36370. return "-" + this.neg().toString(e)
  36371. }
  36372. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36373. var s = o.div(r)
  36374. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36375. if ((o = s).isZero())
  36376. return l + a;
  36377. for (; l.length < 6; )
  36378. l = "0" + l;
  36379. a = "" + l + a
  36380. }
  36381. }
  36382. ,
  36383. t.getHighBits = function() {
  36384. return this.high
  36385. }
  36386. ,
  36387. t.getHighBitsUnsigned = function() {
  36388. return this.high >>> 0
  36389. }
  36390. ,
  36391. t.getLowBits = function() {
  36392. return this.low
  36393. }
  36394. ,
  36395. t.getLowBitsUnsigned = function() {
  36396. return this.low >>> 0
  36397. }
  36398. ,
  36399. t.getNumBitsAbs = function() {
  36400. if (this.isNegative())
  36401. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36402. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36403. ;
  36404. return 0 != this.high ? t + 33 : t + 1
  36405. }
  36406. ,
  36407. t.isZero = function() {
  36408. return 0 === this.high && 0 === this.low
  36409. }
  36410. ,
  36411. t.isNegative = function() {
  36412. return !this.unsigned && this.high < 0
  36413. }
  36414. ,
  36415. t.isPositive = function() {
  36416. return this.unsigned || 0 <= this.high
  36417. }
  36418. ,
  36419. t.isOdd = function() {
  36420. return 1 == (1 & this.low)
  36421. }
  36422. ,
  36423. t.isEven = function() {
  36424. return 0 == (1 & this.low)
  36425. }
  36426. ,
  36427. t.equals = function(e) {
  36428. return p(e) || (e = m(e)),
  36429. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36430. }
  36431. ,
  36432. t.eq = t.equals,
  36433. t.notEquals = function(e) {
  36434. return !this.eq(e)
  36435. }
  36436. ,
  36437. t.neq = t.notEquals,
  36438. t.lessThan = function(e) {
  36439. return this.comp(e) < 0
  36440. }
  36441. ,
  36442. t.lt = t.lessThan,
  36443. t.lessThanOrEqual = function(e) {
  36444. return this.comp(e) <= 0
  36445. }
  36446. ,
  36447. t.lte = t.lessThanOrEqual,
  36448. t.greaterThan = function(e) {
  36449. return 0 < this.comp(e)
  36450. }
  36451. ,
  36452. t.gt = t.greaterThan,
  36453. t.greaterThanOrEqual = function(e) {
  36454. return 0 <= this.comp(e)
  36455. }
  36456. ,
  36457. t.gte = t.greaterThanOrEqual,
  36458. t.compare = function(e) {
  36459. if (p(e) || (e = m(e)),
  36460. this.eq(e))
  36461. return 0;
  36462. var t = this.isNegative()
  36463. , i = e.isNegative();
  36464. 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
  36465. }
  36466. ,
  36467. t.comp = t.compare,
  36468. t.negate = function() {
  36469. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36470. }
  36471. ,
  36472. t.neg = t.negate,
  36473. t.add = function(e) {
  36474. p(e) || (e = m(e));
  36475. var t = this.high >>> 16
  36476. , i = 65535 & this.high
  36477. , n = this.low >>> 16
  36478. , r = 65535 & this.low
  36479. , o = e.high >>> 16
  36480. , a = 65535 & e.high
  36481. , s = e.low >>> 16
  36482. , l = 0
  36483. , c = 0
  36484. , h = 0
  36485. , u = 0;
  36486. return h += (u += r + (65535 & e.low)) >>> 16,
  36487. c += (h += n + s) >>> 16,
  36488. l += (c += i + a) >>> 16,
  36489. l += t + o,
  36490. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36491. }
  36492. ,
  36493. t.subtract = function(e) {
  36494. return p(e) || (e = m(e)),
  36495. this.add(e.neg())
  36496. }
  36497. ,
  36498. t.sub = t.subtract,
  36499. t.multiply = function(e) {
  36500. if (this.isZero())
  36501. return y;
  36502. if (p(e) || (e = m(e)),
  36503. e.isZero())
  36504. return y;
  36505. if (this.eq(E))
  36506. return e.isOdd() ? E : y;
  36507. if (e.eq(E))
  36508. return this.isOdd() ? E : y;
  36509. if (this.isNegative())
  36510. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36511. if (e.isNegative())
  36512. return this.mul(e.neg()).neg();
  36513. if (this.lt(v) && e.lt(v))
  36514. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36515. var t = this.high >>> 16
  36516. , i = 65535 & this.high
  36517. , n = this.low >>> 16
  36518. , r = 65535 & this.low
  36519. , o = e.high >>> 16
  36520. , a = 65535 & e.high
  36521. , s = e.low >>> 16
  36522. , l = 65535 & e.low
  36523. , c = 0
  36524. , h = 0
  36525. , u = 0
  36526. , d = 0;
  36527. return u += (d += r * l) >>> 16,
  36528. h += (u += n * l) >>> 16,
  36529. u &= 65535,
  36530. h += (u += r * s) >>> 16,
  36531. c += (h += i * l) >>> 16,
  36532. h &= 65535,
  36533. c += (h += n * s) >>> 16,
  36534. h &= 65535,
  36535. c += (h += r * a) >>> 16,
  36536. c += t * l + i * s + n * a + r * o,
  36537. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36538. }
  36539. ,
  36540. t.mul = t.multiply,
  36541. t.divide = function(e) {
  36542. if (p(e) || (e = m(e)),
  36543. e.isZero())
  36544. throw Error("division by zero");
  36545. if (this.isZero())
  36546. return this.unsigned ? l : y;
  36547. var t, i, n;
  36548. if (this.unsigned) {
  36549. if (e.unsigned || (e = e.toUnsigned()),
  36550. e.gt(this))
  36551. return l;
  36552. if (e.gt(this.shru(1)))
  36553. return d;
  36554. n = l
  36555. } else {
  36556. if (this.eq(E))
  36557. 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)),
  36558. n = t.add(i.div(e)));
  36559. if (e.eq(E))
  36560. return this.unsigned ? l : y;
  36561. if (this.isNegative())
  36562. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36563. if (e.isNegative())
  36564. return this.div(e.neg()).neg();
  36565. n = y
  36566. }
  36567. for (i = this; i.gte(e); ) {
  36568. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36569. 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); )
  36570. s = (a = f(t -= o, this.unsigned)).mul(e);
  36571. a.isZero() && (a = c),
  36572. n = n.add(a),
  36573. i = i.sub(s)
  36574. }
  36575. return n
  36576. }
  36577. ,
  36578. t.div = t.divide,
  36579. t.modulo = function(e) {
  36580. return p(e) || (e = m(e)),
  36581. this.sub(this.div(e).mul(e))
  36582. }
  36583. ,
  36584. t.mod = t.modulo,
  36585. t.not = function() {
  36586. return g(~this.low, ~this.high, this.unsigned)
  36587. }
  36588. ,
  36589. t.and = function(e) {
  36590. return p(e) || (e = m(e)),
  36591. g(this.low & e.low, this.high & e.high, this.unsigned)
  36592. }
  36593. ,
  36594. t.or = function(e) {
  36595. return p(e) || (e = m(e)),
  36596. g(this.low | e.low, this.high | e.high, this.unsigned)
  36597. }
  36598. ,
  36599. t.xor = function(e) {
  36600. return p(e) || (e = m(e)),
  36601. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36602. }
  36603. ,
  36604. t.shiftLeft = function(e) {
  36605. return p(e) && (e = e.toInt()),
  36606. 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)
  36607. }
  36608. ,
  36609. t.shl = t.shiftLeft,
  36610. t.shiftRight = function(e) {
  36611. return p(e) && (e = e.toInt()),
  36612. 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)
  36613. }
  36614. ,
  36615. t.shr = t.shiftRight,
  36616. t.shiftRightUnsigned = function(e) {
  36617. if (p(e) && (e = e.toInt()),
  36618. 0 === (e &= 63))
  36619. return this;
  36620. var t = this.high;
  36621. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36622. }
  36623. ,
  36624. t.shru = t.shiftRightUnsigned,
  36625. t.toSigned = function() {
  36626. return this.unsigned ? g(this.low, this.high, !1) : this
  36627. }
  36628. ,
  36629. t.toUnsigned = function() {
  36630. return this.unsigned ? this : g(this.low, this.high, !0)
  36631. }
  36632. ,
  36633. t.toBytes = function(e) {
  36634. return e ? this.toBytesLE() : this.toBytesBE()
  36635. }
  36636. ,
  36637. t.toBytesLE = function() {
  36638. var e = this.high
  36639. , t = this.low;
  36640. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36641. }
  36642. ,
  36643. t.toBytesBE = function() {
  36644. var e = this.high
  36645. , t = this.low;
  36646. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36647. }
  36648. ,
  36649. n
  36650. }
  36651. ,
  36652. "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()
  36653. }
  36654. , {}],
  36655. 217: [function(e, t, i) {
  36656. 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 = {
  36657. REVISION: "75"
  36658. };
  36659. function Ii(e, t) {
  36660. return e.distance - t.distance
  36661. }
  36662. function Ei(e, t, i, n) {
  36663. if (!1 !== e.visible && (e.raycast(t, i),
  36664. !0 === n))
  36665. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36666. Ei(r[o], t, i, !0)
  36667. }
  36668. function _i(e, t, i) {
  36669. return i < 0 && (i += 1),
  36670. 1 < i && (i -= 1),
  36671. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36672. }
  36673. function bi(e, t, i, n, r, o, a) {
  36674. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36675. r.multiplyScalar(Vt.x),
  36676. o.multiplyScalar(Vt.y),
  36677. a.multiplyScalar(Vt.z),
  36678. r.add(o).add(a),
  36679. r.clone()
  36680. }
  36681. function wi(e, t, i, n, r, o, a) {
  36682. var s = e.material;
  36683. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36684. return null;
  36685. Ut.copy(a),
  36686. Ut.applyMatrix4(e.matrixWorld);
  36687. var l = t.ray.origin.distanceTo(Ut);
  36688. return l < t.near || l > t.far ? null : {
  36689. distance: l,
  36690. point: Ut.clone(),
  36691. object: e
  36692. }
  36693. }
  36694. function Ti(e, t, i, n, r, o, a, s) {
  36695. Mt.fromArray(n, 3 * o),
  36696. Rt.fromArray(n, 3 * a),
  36697. Pt.fromArray(n, 3 * s);
  36698. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36699. return l && (r && (Nt.fromArray(r, 2 * o),
  36700. Ft.fromArray(r, 2 * a),
  36701. Bt.fromArray(r, 2 * s),
  36702. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36703. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36704. l.faceIndex = o),
  36705. l
  36706. }
  36707. function xi() {}
  36708. function Si(e, t, i, n, r, o) {
  36709. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36710. if (s = e[o[t]].x,
  36711. l = e[o[t]].y,
  36712. c = e[o[i]].x,
  36713. h = e[o[i]].y,
  36714. u = e[o[n]].x,
  36715. d = e[o[n]].y,
  36716. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36717. return !1;
  36718. for (g = u - c,
  36719. m = d - h,
  36720. v = s - u,
  36721. y = l - d,
  36722. A = c - s,
  36723. C = h - l,
  36724. a = 0; a < r; a++)
  36725. if (p = e[o[a]].x,
  36726. f = e[o[a]].y,
  36727. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36728. E = v * (f - d) - y * (p - u),
  36729. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36730. return !1;
  36731. return !0
  36732. }
  36733. function Mi(e) {
  36734. switch (e) {
  36735. case Ci.LinearEncoding:
  36736. return ["Linear", "( value )"];
  36737. case Ci.sRGBEncoding:
  36738. return ["sRGB", "( value )"];
  36739. case Ci.RGBEEncoding:
  36740. return ["RGBE", "( value )"];
  36741. case Ci.RGBM7Encoding:
  36742. return ["RGBM", "( value, 7.0 )"];
  36743. case Ci.RGBM16Encoding:
  36744. return ["RGBM", "( value, 16.0 )"];
  36745. case Ci.RGBDEncoding:
  36746. return ["RGBD", "( value, 256.0 )"];
  36747. case Ci.GammaEncoding:
  36748. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36749. default:
  36750. throw new Error("unsupported encoding: " + e)
  36751. }
  36752. }
  36753. function Ri(e, t) {
  36754. var i = Mi(t);
  36755. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36756. }
  36757. function Pi(e) {
  36758. return "" !== e
  36759. }
  36760. function Oi(e, t) {
  36761. 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)
  36762. }
  36763. function Li(e) {
  36764. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36765. var i = Ci.ShaderChunk[t];
  36766. if (void 0 === i)
  36767. throw new Error("Can not resolve #include <" + t + ">");
  36768. return Li(i)
  36769. })
  36770. }
  36771. function Di(e) {
  36772. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36773. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36774. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  36775. return r
  36776. })
  36777. }
  36778. function Ni(e, t, i, n) {
  36779. gi.set(t, i, n).unproject(mi);
  36780. var r = fi[e];
  36781. if (void 0 !== r)
  36782. for (var o = 0, a = r.length; o < a; o++)
  36783. pi.vertices[r[o]].copy(gi)
  36784. }
  36785. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36786. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36787. void 0 === Math.sign && (Math.sign = function(e) {
  36788. return e < 0 ? -1 : 0 < e ? 1 : +e
  36789. }
  36790. ),
  36791. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36792. get: function() {
  36793. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36794. }
  36795. }),
  36796. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36797. writable: !0,
  36798. configurable: !0,
  36799. value: function(e) {
  36800. "use strict";
  36801. if (null == e)
  36802. throw new TypeError("Cannot convert first argument to object");
  36803. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36804. var r = arguments[i];
  36805. if (null != r) {
  36806. r = Object(r);
  36807. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36808. var l = o[a]
  36809. , c = Object.getOwnPropertyDescriptor(r, l);
  36810. void 0 !== c && c.enumerable && (t[l] = r[l])
  36811. }
  36812. }
  36813. }
  36814. return t
  36815. }
  36816. }),
  36817. Ci.MOUSE = {
  36818. LEFT: 0,
  36819. MIDDLE: 1,
  36820. RIGHT: 2
  36821. },
  36822. Ci.CullFaceNone = 0,
  36823. Ci.CullFaceBack = 1,
  36824. Ci.CullFaceFront = 2,
  36825. Ci.CullFaceFrontBack = 3,
  36826. Ci.FrontFaceDirectionCW = 0,
  36827. Ci.FrontFaceDirectionCCW = 1,
  36828. Ci.BasicShadowMap = 0,
  36829. Ci.PCFShadowMap = 1,
  36830. Ci.PCFSoftShadowMap = 2,
  36831. Ci.FrontSide = 0,
  36832. Ci.BackSide = 1,
  36833. Ci.DoubleSide = 2,
  36834. Ci.FlatShading = 1,
  36835. Ci.SmoothShading = 2,
  36836. Ci.NoColors = 0,
  36837. Ci.FaceColors = 1,
  36838. Ci.VertexColors = 2,
  36839. Ci.NoBlending = 0,
  36840. Ci.NormalBlending = 1,
  36841. Ci.AdditiveBlending = 2,
  36842. Ci.SubtractiveBlending = 3,
  36843. Ci.MultiplyBlending = 4,
  36844. Ci.CustomBlending = 5,
  36845. Ci.AddEquation = 100,
  36846. Ci.SubtractEquation = 101,
  36847. Ci.ReverseSubtractEquation = 102,
  36848. Ci.MinEquation = 103,
  36849. Ci.MaxEquation = 104,
  36850. Ci.ZeroFactor = 200,
  36851. Ci.OneFactor = 201,
  36852. Ci.SrcColorFactor = 202,
  36853. Ci.OneMinusSrcColorFactor = 203,
  36854. Ci.SrcAlphaFactor = 204,
  36855. Ci.OneMinusSrcAlphaFactor = 205,
  36856. Ci.DstAlphaFactor = 206,
  36857. Ci.OneMinusDstAlphaFactor = 207,
  36858. Ci.DstColorFactor = 208,
  36859. Ci.OneMinusDstColorFactor = 209,
  36860. Ci.SrcAlphaSaturateFactor = 210,
  36861. Ci.NeverDepth = 0,
  36862. Ci.AlwaysDepth = 1,
  36863. Ci.LessDepth = 2,
  36864. Ci.LessEqualDepth = 3,
  36865. Ci.EqualDepth = 4,
  36866. Ci.GreaterEqualDepth = 5,
  36867. Ci.GreaterDepth = 6,
  36868. Ci.NotEqualDepth = 7,
  36869. Ci.MultiplyOperation = 0,
  36870. Ci.MixOperation = 1,
  36871. Ci.AddOperation = 2,
  36872. Ci.NoToneMapping = 0,
  36873. Ci.LinearToneMapping = 1,
  36874. Ci.ReinhardToneMapping = 2,
  36875. Ci.Uncharted2ToneMapping = 3,
  36876. Ci.CineonToneMapping = 4,
  36877. Ci.UVMapping = 300,
  36878. Ci.CubeReflectionMapping = 301,
  36879. Ci.CubeRefractionMapping = 302,
  36880. Ci.EquirectangularReflectionMapping = 303,
  36881. Ci.EquirectangularRefractionMapping = 304,
  36882. Ci.SphericalReflectionMapping = 305,
  36883. Ci.CubeUVReflectionMapping = 306,
  36884. Ci.CubeUVRefractionMapping = 307,
  36885. Ci.RepeatWrapping = 1e3,
  36886. Ci.ClampToEdgeWrapping = 1001,
  36887. Ci.MirroredRepeatWrapping = 1002,
  36888. Ci.NearestFilter = 1003,
  36889. Ci.NearestMipMapNearestFilter = 1004,
  36890. Ci.NearestMipMapLinearFilter = 1005,
  36891. Ci.LinearFilter = 1006,
  36892. Ci.LinearMipMapNearestFilter = 1007,
  36893. Ci.LinearMipMapLinearFilter = 1008,
  36894. Ci.UnsignedByteType = 1009,
  36895. Ci.ByteType = 1010,
  36896. Ci.ShortType = 1011,
  36897. Ci.UnsignedShortType = 1012,
  36898. Ci.IntType = 1013,
  36899. Ci.UnsignedIntType = 1014,
  36900. Ci.FloatType = 1015,
  36901. Ci.HalfFloatType = 1025,
  36902. Ci.UnsignedShort4444Type = 1016,
  36903. Ci.UnsignedShort5551Type = 1017,
  36904. Ci.UnsignedShort565Type = 1018,
  36905. Ci.AlphaFormat = 1019,
  36906. Ci.RGBFormat = 1020,
  36907. Ci.RGBAFormat = 1021,
  36908. Ci.LuminanceFormat = 1022,
  36909. Ci.LuminanceAlphaFormat = 1023,
  36910. Ci.RGBEFormat = Ci.RGBAFormat,
  36911. Ci.RGB_S3TC_DXT1_Format = 2001,
  36912. Ci.RGBA_S3TC_DXT1_Format = 2002,
  36913. Ci.RGBA_S3TC_DXT3_Format = 2003,
  36914. Ci.RGBA_S3TC_DXT5_Format = 2004,
  36915. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  36916. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  36917. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  36918. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  36919. Ci.RGB_ETC1_Format = 2151,
  36920. Ci.LoopOnce = 2200,
  36921. Ci.LoopRepeat = 2201,
  36922. Ci.LoopPingPong = 2202,
  36923. Ci.InterpolateDiscrete = 2300,
  36924. Ci.InterpolateLinear = 2301,
  36925. Ci.InterpolateSmooth = 2302,
  36926. Ci.ZeroCurvatureEnding = 2400,
  36927. Ci.ZeroSlopeEnding = 2401,
  36928. Ci.WrapAroundEnding = 2402,
  36929. Ci.TrianglesDrawMode = 0,
  36930. Ci.TriangleStripDrawMode = 1,
  36931. Ci.TriangleFanDrawMode = 2,
  36932. Ci.LinearEncoding = 3e3,
  36933. Ci.sRGBEncoding = 3001,
  36934. Ci.GammaEncoding = 3007,
  36935. Ci.RGBEEncoding = 3002,
  36936. Ci.LogLuvEncoding = 3003,
  36937. Ci.RGBM7Encoding = 3004,
  36938. Ci.RGBM16Encoding = 3005,
  36939. Ci.RGBDEncoding = 3006,
  36940. Ci.Color = function(e) {
  36941. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36942. }
  36943. ,
  36944. Ci.Color.prototype = {
  36945. constructor: Ci.Color,
  36946. r: 1,
  36947. g: 1,
  36948. b: 1,
  36949. set: function(e) {
  36950. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  36951. this
  36952. },
  36953. setScalar: function(e) {
  36954. this.r = e,
  36955. this.g = e,
  36956. this.b = e
  36957. },
  36958. setHex: function(e) {
  36959. return e = Math.floor(e),
  36960. this.r = (e >> 16 & 255) / 255,
  36961. this.g = (e >> 8 & 255) / 255,
  36962. this.b = (255 & e) / 255,
  36963. this
  36964. },
  36965. setRGB: function(e, t, i) {
  36966. return this.r = e,
  36967. this.g = t,
  36968. this.b = i,
  36969. this
  36970. },
  36971. setHSL: function(e, t, i) {
  36972. if (e = Ci.Math.euclideanModulo(e, 1),
  36973. t = Ci.Math.clamp(t, 0, 1),
  36974. i = Ci.Math.clamp(i, 0, 1),
  36975. 0 === t)
  36976. this.r = this.g = this.b = i;
  36977. else {
  36978. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  36979. , r = 2 * i - n;
  36980. this.r = _i(r, n, e + 1 / 3),
  36981. this.g = _i(r, n, e),
  36982. this.b = _i(r, n, e - 1 / 3)
  36983. }
  36984. return this
  36985. },
  36986. setStyle: function(t) {
  36987. function e(e) {
  36988. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  36989. }
  36990. var i;
  36991. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  36992. var n, r = i[1], o = i[2];
  36993. switch (r) {
  36994. case "rgb":
  36995. case "rgba":
  36996. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  36997. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  36998. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  36999. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37000. e(n[5]),
  37001. this;
  37002. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37003. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37004. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37005. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37006. e(n[5]),
  37007. this;
  37008. break;
  37009. case "hsl":
  37010. case "hsla":
  37011. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37012. var a = parseFloat(n[1]) / 360
  37013. , s = parseInt(n[2], 10) / 100
  37014. , l = parseInt(n[3], 10) / 100;
  37015. return e(n[5]),
  37016. this.setHSL(a, s, l)
  37017. }
  37018. }
  37019. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37020. var c, h = (c = i[1]).length;
  37021. if (3 === h)
  37022. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37023. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37024. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37025. this;
  37026. if (6 === h)
  37027. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37028. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37029. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37030. this
  37031. }
  37032. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37033. return this
  37034. },
  37035. clone: function() {
  37036. return new this.constructor(this.r,this.g,this.b)
  37037. },
  37038. copy: function(e) {
  37039. return this.r = e.r,
  37040. this.g = e.g,
  37041. this.b = e.b,
  37042. this
  37043. },
  37044. copyGammaToLinear: function(e, t) {
  37045. return void 0 === t && (t = 2),
  37046. this.r = Math.pow(e.r, t),
  37047. this.g = Math.pow(e.g, t),
  37048. this.b = Math.pow(e.b, t),
  37049. this
  37050. },
  37051. copyLinearToGamma: function(e, t) {
  37052. void 0 === t && (t = 2);
  37053. var i = 0 < t ? 1 / t : 1;
  37054. return this.r = Math.pow(e.r, i),
  37055. this.g = Math.pow(e.g, i),
  37056. this.b = Math.pow(e.b, i),
  37057. this
  37058. },
  37059. convertGammaToLinear: function() {
  37060. var e = this.r
  37061. , t = this.g
  37062. , i = this.b;
  37063. return this.r = e * e,
  37064. this.g = t * t,
  37065. this.b = i * i,
  37066. this
  37067. },
  37068. convertLinearToGamma: function() {
  37069. return this.r = Math.sqrt(this.r),
  37070. this.g = Math.sqrt(this.g),
  37071. this.b = Math.sqrt(this.b),
  37072. this
  37073. },
  37074. getHex: function() {
  37075. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37076. },
  37077. getHexString: function() {
  37078. return ("000000" + this.getHex().toString(16)).slice(-6)
  37079. },
  37080. getHSL: function(e) {
  37081. var t, i, n = e || {
  37082. h: 0,
  37083. s: 0,
  37084. l: 0
  37085. }, 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;
  37086. if (l === s)
  37087. i = t = 0;
  37088. else {
  37089. var h = s - l;
  37090. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37091. s) {
  37092. case r:
  37093. t = (o - a) / h + (o < a ? 6 : 0);
  37094. break;
  37095. case o:
  37096. t = (a - r) / h + 2;
  37097. break;
  37098. case a:
  37099. t = (r - o) / h + 4
  37100. }
  37101. t /= 6
  37102. }
  37103. return n.h = t,
  37104. n.s = i,
  37105. n.l = c,
  37106. n
  37107. },
  37108. getStyle: function() {
  37109. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37110. },
  37111. offsetHSL: function(e, t, i) {
  37112. var n = this.getHSL();
  37113. return n.h += e,
  37114. n.s += t,
  37115. n.l += i,
  37116. this.setHSL(n.h, n.s, n.l),
  37117. this
  37118. },
  37119. add: function(e) {
  37120. return this.r += e.r,
  37121. this.g += e.g,
  37122. this.b += e.b,
  37123. this
  37124. },
  37125. addColors: function(e, t) {
  37126. return this.r = e.r + t.r,
  37127. this.g = e.g + t.g,
  37128. this.b = e.b + t.b,
  37129. this
  37130. },
  37131. addScalar: function(e) {
  37132. return this.r += e,
  37133. this.g += e,
  37134. this.b += e,
  37135. this
  37136. },
  37137. multiply: function(e) {
  37138. return this.r *= e.r,
  37139. this.g *= e.g,
  37140. this.b *= e.b,
  37141. this
  37142. },
  37143. multiplyScalar: function(e) {
  37144. return this.r *= e,
  37145. this.g *= e,
  37146. this.b *= e,
  37147. this
  37148. },
  37149. lerp: function(e, t) {
  37150. return this.r += (e.r - this.r) * t,
  37151. this.g += (e.g - this.g) * t,
  37152. this.b += (e.b - this.b) * t,
  37153. this
  37154. },
  37155. equals: function(e) {
  37156. return e.r === this.r && e.g === this.g && e.b === this.b
  37157. },
  37158. fromArray: function(e, t) {
  37159. return void 0 === t && (t = 0),
  37160. this.r = e[t],
  37161. this.g = e[t + 1],
  37162. this.b = e[t + 2],
  37163. this
  37164. },
  37165. toArray: function(e, t) {
  37166. return void 0 === e && (e = []),
  37167. void 0 === t && (t = 0),
  37168. e[t] = this.r,
  37169. e[t + 1] = this.g,
  37170. e[t + 2] = this.b,
  37171. e
  37172. }
  37173. },
  37174. Ci.ColorKeywords = {
  37175. aliceblue: 15792383,
  37176. antiquewhite: 16444375,
  37177. aqua: 65535,
  37178. aquamarine: 8388564,
  37179. azure: 15794175,
  37180. beige: 16119260,
  37181. bisque: 16770244,
  37182. black: 0,
  37183. blanchedalmond: 16772045,
  37184. blue: 255,
  37185. blueviolet: 9055202,
  37186. brown: 10824234,
  37187. burlywood: 14596231,
  37188. cadetblue: 6266528,
  37189. chartreuse: 8388352,
  37190. chocolate: 13789470,
  37191. coral: 16744272,
  37192. cornflowerblue: 6591981,
  37193. cornsilk: 16775388,
  37194. crimson: 14423100,
  37195. cyan: 65535,
  37196. darkblue: 139,
  37197. darkcyan: 35723,
  37198. darkgoldenrod: 12092939,
  37199. darkgray: 11119017,
  37200. darkgreen: 25600,
  37201. darkgrey: 11119017,
  37202. darkkhaki: 12433259,
  37203. darkmagenta: 9109643,
  37204. darkolivegreen: 5597999,
  37205. darkorange: 16747520,
  37206. darkorchid: 10040012,
  37207. darkred: 9109504,
  37208. darksalmon: 15308410,
  37209. darkseagreen: 9419919,
  37210. darkslateblue: 4734347,
  37211. darkslategray: 3100495,
  37212. darkslategrey: 3100495,
  37213. darkturquoise: 52945,
  37214. darkviolet: 9699539,
  37215. deeppink: 16716947,
  37216. deepskyblue: 49151,
  37217. dimgray: 6908265,
  37218. dimgrey: 6908265,
  37219. dodgerblue: 2003199,
  37220. firebrick: 11674146,
  37221. floralwhite: 16775920,
  37222. forestgreen: 2263842,
  37223. fuchsia: 16711935,
  37224. gainsboro: 14474460,
  37225. ghostwhite: 16316671,
  37226. gold: 16766720,
  37227. goldenrod: 14329120,
  37228. gray: 8421504,
  37229. green: 32768,
  37230. greenyellow: 11403055,
  37231. grey: 8421504,
  37232. honeydew: 15794160,
  37233. hotpink: 16738740,
  37234. indianred: 13458524,
  37235. indigo: 4915330,
  37236. ivory: 16777200,
  37237. khaki: 15787660,
  37238. lavender: 15132410,
  37239. lavenderblush: 16773365,
  37240. lawngreen: 8190976,
  37241. lemonchiffon: 16775885,
  37242. lightblue: 11393254,
  37243. lightcoral: 15761536,
  37244. lightcyan: 14745599,
  37245. lightgoldenrodyellow: 16448210,
  37246. lightgray: 13882323,
  37247. lightgreen: 9498256,
  37248. lightgrey: 13882323,
  37249. lightpink: 16758465,
  37250. lightsalmon: 16752762,
  37251. lightseagreen: 2142890,
  37252. lightskyblue: 8900346,
  37253. lightslategray: 7833753,
  37254. lightslategrey: 7833753,
  37255. lightsteelblue: 11584734,
  37256. lightyellow: 16777184,
  37257. lime: 65280,
  37258. limegreen: 3329330,
  37259. linen: 16445670,
  37260. magenta: 16711935,
  37261. maroon: 8388608,
  37262. mediumaquamarine: 6737322,
  37263. mediumblue: 205,
  37264. mediumorchid: 12211667,
  37265. mediumpurple: 9662683,
  37266. mediumseagreen: 3978097,
  37267. mediumslateblue: 8087790,
  37268. mediumspringgreen: 64154,
  37269. mediumturquoise: 4772300,
  37270. mediumvioletred: 13047173,
  37271. midnightblue: 1644912,
  37272. mintcream: 16121850,
  37273. mistyrose: 16770273,
  37274. moccasin: 16770229,
  37275. navajowhite: 16768685,
  37276. navy: 128,
  37277. oldlace: 16643558,
  37278. olive: 8421376,
  37279. olivedrab: 7048739,
  37280. orange: 16753920,
  37281. orangered: 16729344,
  37282. orchid: 14315734,
  37283. palegoldenrod: 15657130,
  37284. palegreen: 10025880,
  37285. paleturquoise: 11529966,
  37286. palevioletred: 14381203,
  37287. papayawhip: 16773077,
  37288. peachpuff: 16767673,
  37289. peru: 13468991,
  37290. pink: 16761035,
  37291. plum: 14524637,
  37292. powderblue: 11591910,
  37293. purple: 8388736,
  37294. red: 16711680,
  37295. rosybrown: 12357519,
  37296. royalblue: 4286945,
  37297. saddlebrown: 9127187,
  37298. salmon: 16416882,
  37299. sandybrown: 16032864,
  37300. seagreen: 3050327,
  37301. seashell: 16774638,
  37302. sienna: 10506797,
  37303. silver: 12632256,
  37304. skyblue: 8900331,
  37305. slateblue: 6970061,
  37306. slategray: 7372944,
  37307. slategrey: 7372944,
  37308. snow: 16775930,
  37309. springgreen: 65407,
  37310. steelblue: 4620980,
  37311. tan: 13808780,
  37312. teal: 32896,
  37313. thistle: 14204888,
  37314. tomato: 16737095,
  37315. turquoise: 4251856,
  37316. violet: 15631086,
  37317. wheat: 16113331,
  37318. white: 16777215,
  37319. whitesmoke: 16119285,
  37320. yellow: 16776960,
  37321. yellowgreen: 10145074
  37322. },
  37323. Ci.Quaternion = function(e, t, i, n) {
  37324. this._x = e || 0,
  37325. this._y = t || 0,
  37326. this._z = i || 0,
  37327. this._w = void 0 !== n ? n : 1
  37328. }
  37329. ,
  37330. Ci.Quaternion.prototype = {
  37331. constructor: Ci.Quaternion,
  37332. get x() {
  37333. return this._x
  37334. },
  37335. set x(e) {
  37336. this._x = e,
  37337. this.onChangeCallback()
  37338. },
  37339. get y() {
  37340. return this._y
  37341. },
  37342. set y(e) {
  37343. this._y = e,
  37344. this.onChangeCallback()
  37345. },
  37346. get z() {
  37347. return this._z
  37348. },
  37349. set z(e) {
  37350. this._z = e,
  37351. this.onChangeCallback()
  37352. },
  37353. get w() {
  37354. return this._w
  37355. },
  37356. set w(e) {
  37357. this._w = e,
  37358. this.onChangeCallback()
  37359. },
  37360. set: function(e, t, i, n) {
  37361. return this._x = e,
  37362. this._y = t,
  37363. this._z = i,
  37364. this._w = n,
  37365. this.onChangeCallback(),
  37366. this
  37367. },
  37368. clone: function() {
  37369. return new this.constructor(this._x,this._y,this._z,this._w)
  37370. },
  37371. toObject:function(){//add
  37372. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37373. },
  37374. copy: function(e) {
  37375. return this._x = e.x,
  37376. this._y = e.y,
  37377. this._z = e.z,
  37378. this._w = e.w,
  37379. this.onChangeCallback(),
  37380. this
  37381. },
  37382. setFromEuler: function(e, t) {
  37383. if (e instanceof Ci.Euler == 0)
  37384. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37385. var i = Math.cos(e._x / 2)
  37386. , n = Math.cos(e._y / 2)
  37387. , r = Math.cos(e._z / 2)
  37388. , o = Math.sin(e._x / 2)
  37389. , a = Math.sin(e._y / 2)
  37390. , s = Math.sin(e._z / 2)
  37391. , l = e.order;
  37392. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37393. this._y = i * a * r - o * n * s,
  37394. this._z = i * n * s + o * a * r,
  37395. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37396. this._y = i * a * r - o * n * s,
  37397. this._z = i * n * s - o * a * r,
  37398. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37399. this._y = i * a * r + o * n * s,
  37400. this._z = i * n * s + o * a * r,
  37401. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37402. this._y = i * a * r + o * n * s,
  37403. this._z = i * n * s - o * a * r,
  37404. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37405. this._y = i * a * r + o * n * s,
  37406. this._z = i * n * s - o * a * r,
  37407. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37408. this._y = i * a * r - o * n * s,
  37409. this._z = i * n * s + o * a * r,
  37410. this._w = i * n * r + o * a * s),
  37411. !1 !== t && this.onChangeCallback(),
  37412. this
  37413. },
  37414. setFromAxisAngle: function(e, t) {
  37415. var i = t / 2
  37416. , n = Math.sin(i);
  37417. return this._x = e.x * n,
  37418. this._y = e.y * n,
  37419. this._z = e.z * n,
  37420. this._w = Math.cos(i),
  37421. this.onChangeCallback(),
  37422. this
  37423. },
  37424. setFromRotationMatrix: function(e) {
  37425. 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;
  37426. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37427. this._w = .25 / t,
  37428. this._x = (h - l) * t,
  37429. this._y = (o - c) * t,
  37430. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37431. this._w = (h - l) / t,
  37432. this._x = .25 * t,
  37433. this._y = (r + a) / t,
  37434. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37435. this._w = (o - c) / t,
  37436. this._x = (r + a) / t,
  37437. this._y = .25 * t,
  37438. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37439. this._w = (a - r) / t,
  37440. this._x = (o + c) / t,
  37441. this._y = (l + h) / t,
  37442. this._z = .25 * t),
  37443. this.onChangeCallback(),
  37444. this
  37445. },
  37446. setFromUnitVectors: function(e, t) {
  37447. return void 0 === Be && (Be = new Ci.Vector3),
  37448. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37449. 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),
  37450. this._x = Be.x,
  37451. this._y = Be.y,
  37452. this._z = Be.z,
  37453. this._w = Ve,
  37454. this.normalize(),
  37455. this
  37456. },
  37457. inverse: function() {
  37458. return this.conjugate().normalize(),
  37459. this
  37460. },
  37461. conjugate: function() {
  37462. return this._x *= -1,
  37463. this._y *= -1,
  37464. this._z *= -1,
  37465. this.onChangeCallback(),
  37466. this
  37467. },
  37468. dot: function(e) {
  37469. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37470. },
  37471. lengthSq: function() {
  37472. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37473. },
  37474. length: function() {
  37475. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37476. },
  37477. normalize: function() {
  37478. var e = this.length();
  37479. return 0 === e ? (this._x = 0,
  37480. this._y = 0,
  37481. this._z = 0,
  37482. this._w = 1) : (e = 1 / e,
  37483. this._x = this._x * e,
  37484. this._y = this._y * e,
  37485. this._z = this._z * e,
  37486. this._w = this._w * e),
  37487. this.onChangeCallback(),
  37488. this
  37489. },
  37490. multiply: function(e, t) {
  37491. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37492. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37493. },
  37494. multiplyQuaternions: function(e, t) {
  37495. var i = e._x
  37496. , n = e._y
  37497. , r = e._z
  37498. , o = e._w
  37499. , a = t._x
  37500. , s = t._y
  37501. , l = t._z
  37502. , c = t._w;
  37503. return this._x = i * c + o * a + n * l - r * s,
  37504. this._y = n * c + o * s + r * a - i * l,
  37505. this._z = r * c + o * l + i * s - n * a,
  37506. this._w = o * c - i * a - n * s - r * l,
  37507. this.onChangeCallback(),
  37508. this
  37509. },
  37510. slerp: function(e, t) {
  37511. if (0 === t)
  37512. return this;
  37513. if (1 === t)
  37514. return this.copy(e);
  37515. var i = this._x
  37516. , n = this._y
  37517. , r = this._z
  37518. , o = this._w
  37519. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37520. if (a < 0 ? (this._w = -e._w,
  37521. this._x = -e._x,
  37522. this._y = -e._y,
  37523. this._z = -e._z,
  37524. a = -a) : this.copy(e),
  37525. 1 <= a)
  37526. return this._w = o,
  37527. this._x = i,
  37528. this._y = n,
  37529. this._z = r,
  37530. this;
  37531. var s = Math.sqrt(1 - a * a);
  37532. if (Math.abs(s) < .001)
  37533. return this._w = .5 * (o + this._w),
  37534. this._x = .5 * (i + this._x),
  37535. this._y = .5 * (n + this._y),
  37536. this._z = .5 * (r + this._z),
  37537. this;
  37538. var l = Math.atan2(s, a)
  37539. , c = Math.sin((1 - t) * l) / s
  37540. , h = Math.sin(t * l) / s;
  37541. return this._w = o * c + this._w * h,
  37542. this._x = i * c + this._x * h,
  37543. this._y = n * c + this._y * h,
  37544. this._z = r * c + this._z * h,
  37545. this.onChangeCallback(),
  37546. this
  37547. },
  37548. equals: function(e) {
  37549. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37550. },
  37551. fromArray: function(e, t) {
  37552. return void 0 === t && (t = 0),
  37553. this._x = e[t],
  37554. this._y = e[t + 1],
  37555. this._z = e[t + 2],
  37556. this._w = e[t + 3],
  37557. this.onChangeCallback(),
  37558. this
  37559. },
  37560. toArray: function(e, t) {
  37561. return void 0 === e && (e = []),
  37562. void 0 === t && (t = 0),
  37563. e[t] = this._x,
  37564. e[t + 1] = this._y,
  37565. e[t + 2] = this._z,
  37566. e[t + 3] = this._w,
  37567. e
  37568. },
  37569. onChange: function(e) {
  37570. return this.onChangeCallback = e,
  37571. this
  37572. },
  37573. onChangeCallback: function() {}
  37574. },
  37575. Object.assign(Ci.Quaternion, {
  37576. slerp: function(e, t, i, n) {
  37577. return i.copy(e).slerp(t, n)
  37578. },
  37579. slerpFlat: function(e, t, i, n, r, o, a) {
  37580. var s = i[n + 0]
  37581. , l = i[n + 1]
  37582. , c = i[n + 2]
  37583. , h = i[n + 3]
  37584. , u = r[o + 0]
  37585. , d = r[o + 1]
  37586. , p = r[o + 2]
  37587. , f = r[o + 3];
  37588. if (h !== f || s !== u || l !== d || c !== p) {
  37589. var g = 1 - a
  37590. , m = s * u + l * d + c * p + h * f
  37591. , v = 0 <= m ? 1 : -1
  37592. , y = 1 - m * m;
  37593. if (y > Number.EPSILON) {
  37594. var A = Math.sqrt(y)
  37595. , C = Math.atan2(A, m * v);
  37596. g = Math.sin(g * C) / A,
  37597. a = Math.sin(a * C) / A
  37598. }
  37599. var I = a * v;
  37600. if (s = s * g + u * I,
  37601. l = l * g + d * I,
  37602. c = c * g + p * I,
  37603. h = h * g + f * I,
  37604. g === 1 - a) {
  37605. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37606. s *= E,
  37607. l *= E,
  37608. c *= E,
  37609. h *= E
  37610. }
  37611. }
  37612. e[t] = s,
  37613. e[t + 1] = l,
  37614. e[t + 2] = c,
  37615. e[t + 3] = h
  37616. }
  37617. }),
  37618. Ci.Vector2 = function(e, t) {
  37619. this.x = e || 0,
  37620. this.y = t || 0
  37621. }
  37622. ,
  37623. Ci.Vector2.prototype = {
  37624. constructor: Ci.Vector2,
  37625. get width() {
  37626. return this.x
  37627. },
  37628. set width(e) {
  37629. this.x = e
  37630. },
  37631. get height() {
  37632. return this.y
  37633. },
  37634. set height(e) {
  37635. this.y = e
  37636. },
  37637. set: function(e, t) {
  37638. return this.x = e,
  37639. this.y = t,
  37640. this
  37641. },
  37642. setScalar: function(e) {
  37643. return this.x = e,
  37644. this.y = e,
  37645. this
  37646. },
  37647. setX: function(e) {
  37648. return this.x = e,
  37649. this
  37650. },
  37651. setY: function(e) {
  37652. return this.y = e,
  37653. this
  37654. },
  37655. setComponent: function(e, t) {
  37656. switch (e) {
  37657. case 0:
  37658. this.x = t;
  37659. break;
  37660. case 1:
  37661. this.y = t;
  37662. break;
  37663. default:
  37664. throw new Error("index is out of range: " + e)
  37665. }
  37666. },
  37667. getComponent: function(e) {
  37668. switch (e) {
  37669. case 0:
  37670. return this.x;
  37671. case 1:
  37672. return this.y;
  37673. default:
  37674. throw new Error("index is out of range: " + e)
  37675. }
  37676. },
  37677. clone: function() {
  37678. return new this.constructor(this.x,this.y)
  37679. },
  37680. copy: function(e) {
  37681. return this.x = e.x,
  37682. this.y = e.y,
  37683. this
  37684. },
  37685. add: function(e, t) {
  37686. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37687. this.addVectors(e, t)) : (this.x += e.x,
  37688. this.y += e.y,
  37689. this)
  37690. },
  37691. addScalar: function(e) {
  37692. return this.x += e,
  37693. this.y += e,
  37694. this
  37695. },
  37696. addVectors: function(e, t) {
  37697. return this.x = e.x + t.x,
  37698. this.y = e.y + t.y,
  37699. this
  37700. },
  37701. addScaledVector: function(e, t) {
  37702. return this.x += e.x * t,
  37703. this.y += e.y * t,
  37704. this
  37705. },
  37706. sub: function(e, t) {
  37707. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37708. this.subVectors(e, t)) : (this.x -= e.x,
  37709. this.y -= e.y,
  37710. this)
  37711. },
  37712. subScalar: function(e) {
  37713. return this.x -= e,
  37714. this.y -= e,
  37715. this
  37716. },
  37717. subVectors: function(e, t) {
  37718. return this.x = e.x - t.x,
  37719. this.y = e.y - t.y,
  37720. this
  37721. },
  37722. multiply: function(e) {
  37723. return this.x *= e.x,
  37724. this.y *= e.y,
  37725. this
  37726. },
  37727. multiplyScalar: function(e) {
  37728. return isFinite(e) ? (this.x *= e,
  37729. this.y *= e) : (this.x = 0,
  37730. this.y = 0),
  37731. this
  37732. },
  37733. divide: function(e) {
  37734. return this.x /= e.x,
  37735. this.y /= e.y,
  37736. this
  37737. },
  37738. divideScalar: function(e) {
  37739. return this.multiplyScalar(1 / e)
  37740. },
  37741. min: function(e) {
  37742. return this.x = Math.min(this.x, e.x),
  37743. this.y = Math.min(this.y, e.y),
  37744. this
  37745. },
  37746. max: function(e) {
  37747. return this.x = Math.max(this.x, e.x),
  37748. this.y = Math.max(this.y, e.y),
  37749. this
  37750. },
  37751. clamp: function(e, t) {
  37752. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37753. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37754. this
  37755. },
  37756. clampScalar: function(e, t) {
  37757. return void 0 === Ne && (Ne = new Ci.Vector2,
  37758. Fe = new Ci.Vector2),
  37759. Ne.set(e, e),
  37760. Fe.set(t, t),
  37761. this.clamp(Ne, Fe)
  37762. },
  37763. clampLength: function(e, t) {
  37764. var i = this.length();
  37765. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37766. this
  37767. },
  37768. floor: function() {
  37769. return this.x = Math.floor(this.x),
  37770. this.y = Math.floor(this.y),
  37771. this
  37772. },
  37773. ceil: function() {
  37774. return this.x = Math.ceil(this.x),
  37775. this.y = Math.ceil(this.y),
  37776. this
  37777. },
  37778. round: function() {
  37779. return this.x = Math.round(this.x),
  37780. this.y = Math.round(this.y),
  37781. this
  37782. },
  37783. roundToZero: function() {
  37784. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37785. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37786. this
  37787. },
  37788. negate: function() {
  37789. return this.x = -this.x,
  37790. this.y = -this.y,
  37791. this
  37792. },
  37793. dot: function(e) {
  37794. return this.x * e.x + this.y * e.y
  37795. },
  37796. lengthSq: function() {
  37797. return this.x * this.x + this.y * this.y
  37798. },
  37799. length: function() {
  37800. return Math.sqrt(this.x * this.x + this.y * this.y)
  37801. },
  37802. lengthManhattan: function() {
  37803. return Math.abs(this.x) + Math.abs(this.y)
  37804. },
  37805. normalize: function() {
  37806. return this.divideScalar(this.length())
  37807. },
  37808. angle: function() {
  37809. var e = Math.atan2(this.y, this.x);
  37810. return e < 0 && (e += 2 * Math.PI),
  37811. e
  37812. },
  37813. distanceTo: function(e) {
  37814. return Math.sqrt(this.distanceToSquared(e))
  37815. },
  37816. distanceToSquared: function(e) {
  37817. var t = this.x - e.x
  37818. , i = this.y - e.y;
  37819. return t * t + i * i
  37820. },
  37821. setLength: function(e) {
  37822. return this.multiplyScalar(e / this.length())
  37823. },
  37824. lerp: function(e, t) {
  37825. return this.x += (e.x - this.x) * t,
  37826. this.y += (e.y - this.y) * t,
  37827. this
  37828. },
  37829. lerpVectors: function(e, t, i) {
  37830. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37831. this
  37832. },
  37833. equals: function(e) {
  37834. return e.x === this.x && e.y === this.y
  37835. },
  37836. fromArray: function(e, t) {
  37837. return void 0 === t && (t = 0),
  37838. this.x = e[t],
  37839. this.y = e[t + 1],
  37840. this
  37841. },
  37842. toArray: function(e, t) {
  37843. return void 0 === e && (e = []),
  37844. void 0 === t && (t = 0),
  37845. e[t] = this.x,
  37846. e[t + 1] = this.y,
  37847. e
  37848. },
  37849. fromAttribute: function(e, t, i) {
  37850. return void 0 === i && (i = 0),
  37851. t = t * e.itemSize + i,
  37852. this.x = e.array[t],
  37853. this.y = e.array[t + 1],
  37854. this
  37855. },
  37856. rotateAround: function(e, t) {
  37857. var i = Math.cos(t)
  37858. , n = Math.sin(t)
  37859. , r = this.x - e.x
  37860. , o = this.y - e.y;
  37861. return this.x = r * i - o * n + e.x,
  37862. this.y = r * n + o * i + e.y,
  37863. this
  37864. }
  37865. },
  37866. Ci.Vector3 = function(e, t, i) {
  37867. this.x = e || 0,
  37868. this.y = t || 0,
  37869. this.z = i || 0
  37870. }
  37871. ,
  37872. Ci.Vector3.prototype = {
  37873. constructor: Ci.Vector3,
  37874. set: function(e, t, i) {
  37875. return this.x = e,
  37876. this.y = t,
  37877. this.z = i,
  37878. this
  37879. },
  37880. setScalar: function(e) {
  37881. return this.x = e,
  37882. this.y = e,
  37883. this.z = e,
  37884. this
  37885. },
  37886. setX: function(e) {
  37887. return this.x = e,
  37888. this
  37889. },
  37890. setY: function(e) {
  37891. return this.y = e,
  37892. this
  37893. },
  37894. setZ: function(e) {
  37895. return this.z = e,
  37896. this
  37897. },
  37898. setComponent: function(e, t) {
  37899. switch (e) {
  37900. case 0:
  37901. this.x = t;
  37902. break;
  37903. case 1:
  37904. this.y = t;
  37905. break;
  37906. case 2:
  37907. this.z = t;
  37908. break;
  37909. default:
  37910. throw new Error("index is out of range: " + e)
  37911. }
  37912. },
  37913. getComponent: function(e) {
  37914. switch (e) {
  37915. case 0:
  37916. return this.x;
  37917. case 1:
  37918. return this.y;
  37919. case 2:
  37920. return this.z;
  37921. default:
  37922. throw new Error("index is out of range: " + e)
  37923. }
  37924. },
  37925. clone: function() {
  37926. return new this.constructor(this.x,this.y,this.z)
  37927. },
  37928. copy: function(e) {
  37929. return this.x = e.x,
  37930. this.y = e.y,
  37931. this.z = e.z,
  37932. this
  37933. },
  37934. add: function(e, t) {
  37935. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37936. this.addVectors(e, t)) : (this.x += e.x,
  37937. this.y += e.y,
  37938. this.z += e.z,
  37939. this)
  37940. },
  37941. addScalar: function(e) {
  37942. return this.x += e,
  37943. this.y += e,
  37944. this.z += e,
  37945. this
  37946. },
  37947. addVectors: function(e, t) {
  37948. return this.x = e.x + t.x,
  37949. this.y = e.y + t.y,
  37950. this.z = e.z + t.z,
  37951. this
  37952. },
  37953. addScaledVector: function(e, t) {
  37954. return this.x += e.x * t,
  37955. this.y += e.y * t,
  37956. this.z += e.z * t,
  37957. this
  37958. },
  37959. sub: function(e, t) {
  37960. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37961. this.subVectors(e, t)) : (this.x -= e.x,
  37962. this.y -= e.y,
  37963. this.z -= e.z,
  37964. this)
  37965. },
  37966. subScalar: function(e) {
  37967. return this.x -= e,
  37968. this.y -= e,
  37969. this.z -= e,
  37970. this
  37971. },
  37972. subVectors: function(e, t) {
  37973. return this.x = e.x - t.x,
  37974. this.y = e.y - t.y,
  37975. this.z = e.z - t.z,
  37976. this
  37977. },
  37978. multiply: function(e, t) {
  37979. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  37980. this.multiplyVectors(e, t)) : (this.x *= e.x,
  37981. this.y *= e.y,
  37982. this.z *= e.z,
  37983. this)
  37984. },
  37985. multiplyScalar: function(e) {
  37986. return isFinite(e) ? (this.x *= e,
  37987. this.y *= e,
  37988. this.z *= e) : (this.x = 0,
  37989. this.y = 0,
  37990. this.z = 0),
  37991. this
  37992. },
  37993. multiplyVectors: function(e, t) {
  37994. return this.x = e.x * t.x,
  37995. this.y = e.y * t.y,
  37996. this.z = e.z * t.z,
  37997. this
  37998. },
  37999. applyEuler: function(e) {
  38000. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38001. void 0 === De && (De = new Ci.Quaternion),
  38002. this.applyQuaternion(De.setFromEuler(e)),
  38003. this
  38004. },
  38005. applyAxisAngle: function(e, t) {
  38006. return void 0 === Le && (Le = new Ci.Quaternion),
  38007. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38008. this
  38009. },
  38010. applyMatrix3: function(e) {
  38011. var t = this.x
  38012. , i = this.y
  38013. , n = this.z
  38014. , r = e.elements;
  38015. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38016. this.y = r[1] * t + r[4] * i + r[7] * n,
  38017. this.z = r[2] * t + r[5] * i + r[8] * n,
  38018. this
  38019. },
  38020. applyMatrix4: function(e) {
  38021. var t = this.x
  38022. , i = this.y
  38023. , n = this.z
  38024. , r = e.elements;
  38025. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38026. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38027. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38028. this
  38029. },
  38030. applyProjection: function(e) {
  38031. var t = this.x
  38032. , i = this.y
  38033. , n = this.z
  38034. , r = e.elements
  38035. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38036. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38037. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38038. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38039. this
  38040. },
  38041. applyQuaternion: function(e) {
  38042. var t = this.x
  38043. , i = this.y
  38044. , n = this.z
  38045. , r = e.x
  38046. , o = e.y
  38047. , a = e.z
  38048. , s = e.w
  38049. , l = s * t + o * n - a * i
  38050. , c = s * i + a * t - r * n
  38051. , h = s * n + r * i - o * t
  38052. , u = -r * t - o * i - a * n;
  38053. return this.x = l * s + u * -r + c * -a - h * -o,
  38054. this.y = c * s + u * -o + h * -r - l * -a,
  38055. this.z = h * s + u * -a + l * -o - c * -r,
  38056. this
  38057. },
  38058. project: function(e) {
  38059. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38060. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38061. this.applyProjection(Oe)
  38062. },
  38063. unproject: function(e) {
  38064. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38065. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38066. this.applyProjection(Pe)
  38067. },
  38068. transformDirection: function(e) {
  38069. var t = this.x
  38070. , i = this.y
  38071. , n = this.z
  38072. , r = e.elements;
  38073. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38074. this.y = r[1] * t + r[5] * i + r[9] * n,
  38075. this.z = r[2] * t + r[6] * i + r[10] * n,
  38076. this.normalize(),
  38077. this
  38078. },
  38079. divide: function(e) {
  38080. return this.x /= e.x,
  38081. this.y /= e.y,
  38082. this.z /= e.z,
  38083. this
  38084. },
  38085. divideScalar: function(e) {
  38086. return this.multiplyScalar(1 / e)
  38087. },
  38088. min: function(e) {
  38089. return this.x = Math.min(this.x, e.x),
  38090. this.y = Math.min(this.y, e.y),
  38091. this.z = Math.min(this.z, e.z),
  38092. this
  38093. },
  38094. max: function(e) {
  38095. return this.x = Math.max(this.x, e.x),
  38096. this.y = Math.max(this.y, e.y),
  38097. this.z = Math.max(this.z, e.z),
  38098. this
  38099. },
  38100. clamp: function(e, t) {
  38101. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38102. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38103. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38104. this
  38105. },
  38106. clampScalar: function(e, t) {
  38107. return void 0 === Me && (Me = new Ci.Vector3,
  38108. Re = new Ci.Vector3),
  38109. Me.set(e, e, e),
  38110. Re.set(t, t, t),
  38111. this.clamp(Me, Re)
  38112. },
  38113. clampLength: function(e, t) {
  38114. var i = this.length();
  38115. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38116. this
  38117. },
  38118. floor: function() {
  38119. return this.x = Math.floor(this.x),
  38120. this.y = Math.floor(this.y),
  38121. this.z = Math.floor(this.z),
  38122. this
  38123. },
  38124. ceil: function() {
  38125. return this.x = Math.ceil(this.x),
  38126. this.y = Math.ceil(this.y),
  38127. this.z = Math.ceil(this.z),
  38128. this
  38129. },
  38130. round: function() {
  38131. return this.x = Math.round(this.x),
  38132. this.y = Math.round(this.y),
  38133. this.z = Math.round(this.z),
  38134. this
  38135. },
  38136. roundToZero: function() {
  38137. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38138. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38139. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38140. this
  38141. },
  38142. negate: function() {
  38143. return this.x = -this.x,
  38144. this.y = -this.y,
  38145. this.z = -this.z,
  38146. this
  38147. },
  38148. dot: function(e) {
  38149. return this.x * e.x + this.y * e.y + this.z * e.z
  38150. },
  38151. lengthSq: function() {
  38152. return this.x * this.x + this.y * this.y + this.z * this.z
  38153. },
  38154. length: function() {
  38155. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38156. },
  38157. lengthManhattan: function() {
  38158. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38159. },
  38160. normalize: function() {
  38161. return this.divideScalar(this.length())
  38162. },
  38163. setLength: function(e) {
  38164. return this.multiplyScalar(e / this.length())
  38165. },
  38166. lerp: function(e, t) {
  38167. return this.x += (e.x - this.x) * t,
  38168. this.y += (e.y - this.y) * t,
  38169. this.z += (e.z - this.z) * t,
  38170. this
  38171. },
  38172. lerpVectors: function(e, t, i) {
  38173. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38174. this
  38175. },
  38176. cross: function(e, t) {
  38177. if (void 0 !== t)
  38178. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38179. this.crossVectors(e, t);
  38180. var i = this.x
  38181. , n = this.y
  38182. , r = this.z;
  38183. return this.x = n * e.z - r * e.y,
  38184. this.y = r * e.x - i * e.z,
  38185. this.z = i * e.y - n * e.x,
  38186. this
  38187. },
  38188. crossVectors: function(e, t) {
  38189. var i = e.x
  38190. , n = e.y
  38191. , r = e.z
  38192. , o = t.x
  38193. , a = t.y
  38194. , s = t.z;
  38195. return this.x = n * s - r * a,
  38196. this.y = r * o - i * s,
  38197. this.z = i * a - n * o,
  38198. this
  38199. },
  38200. projectOnVector: function(e) {
  38201. return void 0 === xe && (xe = new Ci.Vector3),
  38202. xe.copy(e).normalize(),
  38203. Se = this.dot(xe),
  38204. this.copy(xe).multiplyScalar(Se)
  38205. },
  38206. projectOnPlane: function(e) {
  38207. return void 0 === Te && (Te = new Ci.Vector3),
  38208. Te.copy(this).projectOnVector(e),
  38209. this.sub(Te)
  38210. },
  38211. reflect: function(e) {
  38212. return void 0 === we && (we = new Ci.Vector3),
  38213. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38214. },
  38215. angleTo: function(e) {
  38216. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38217. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38218. },
  38219. distanceTo: function(e) {
  38220. return Math.sqrt(this.distanceToSquared(e))
  38221. },
  38222. distanceToSquared: function(e) {
  38223. var t = this.x - e.x
  38224. , i = this.y - e.y
  38225. , n = this.z - e.z;
  38226. return t * t + i * i + n * n
  38227. },
  38228. setFromSpherical: function(e) {
  38229. var t = Math.sin(e.phi) * e.radius;
  38230. return this.x = t * Math.sin(e.theta),
  38231. this.y = Math.cos(e.phi) * e.radius,
  38232. this.z = t * Math.cos(e.theta),
  38233. this
  38234. },
  38235. setFromMatrixPosition: function(e) {
  38236. return this.setFromMatrixColumn(e, 3)
  38237. },
  38238. setFromMatrixScale: function(e) {
  38239. var t = this.setFromMatrixColumn(e, 0).length()
  38240. , i = this.setFromMatrixColumn(e, 1).length()
  38241. , n = this.setFromMatrixColumn(e, 2).length();
  38242. return this.x = t,
  38243. this.y = i,
  38244. this.z = n,
  38245. this
  38246. },
  38247. setFromMatrixColumn: function(e, t) {
  38248. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38249. t = e = t),
  38250. this.fromArray(e.elements, 4 * t)
  38251. },
  38252. equals: function(e) {
  38253. return e.x === this.x && e.y === this.y && e.z === this.z
  38254. },
  38255. fromArray: function(e, t) {
  38256. return void 0 === t && (t = 0),
  38257. this.x = e[t],
  38258. this.y = e[t + 1],
  38259. this.z = e[t + 2],
  38260. this
  38261. },
  38262. toArray: function(e, t) {
  38263. return void 0 === e && (e = []),
  38264. void 0 === t && (t = 0),
  38265. e[t] = this.x,
  38266. e[t + 1] = this.y,
  38267. e[t + 2] = this.z,
  38268. e
  38269. },
  38270. fromAttribute: function(e, t, i) {
  38271. return void 0 === i && (i = 0),
  38272. t = t * e.itemSize + i,
  38273. this.x = e.array[t],
  38274. this.y = e.array[t + 1],
  38275. this.z = e.array[t + 2],
  38276. this
  38277. }
  38278. },
  38279. Ci.Vector4 = function(e, t, i, n) {
  38280. this.x = e || 0,
  38281. this.y = t || 0,
  38282. this.z = i || 0,
  38283. this.w = void 0 !== n ? n : 1
  38284. }
  38285. ,
  38286. Ci.Vector4.prototype = {
  38287. constructor: Ci.Vector4,
  38288. set: function(e, t, i, n) {
  38289. return this.x = e,
  38290. this.y = t,
  38291. this.z = i,
  38292. this.w = n,
  38293. this
  38294. },
  38295. setScalar: function(e) {
  38296. return this.x = e,
  38297. this.y = e,
  38298. this.z = e,
  38299. this.w = e,
  38300. this
  38301. },
  38302. setX: function(e) {
  38303. return this.x = e,
  38304. this
  38305. },
  38306. setY: function(e) {
  38307. return this.y = e,
  38308. this
  38309. },
  38310. setZ: function(e) {
  38311. return this.z = e,
  38312. this
  38313. },
  38314. setW: function(e) {
  38315. return this.w = e,
  38316. this
  38317. },
  38318. setComponent: function(e, t) {
  38319. switch (e) {
  38320. case 0:
  38321. this.x = t;
  38322. break;
  38323. case 1:
  38324. this.y = t;
  38325. break;
  38326. case 2:
  38327. this.z = t;
  38328. break;
  38329. case 3:
  38330. this.w = t;
  38331. break;
  38332. default:
  38333. throw new Error("index is out of range: " + e)
  38334. }
  38335. },
  38336. getComponent: function(e) {
  38337. switch (e) {
  38338. case 0:
  38339. return this.x;
  38340. case 1:
  38341. return this.y;
  38342. case 2:
  38343. return this.z;
  38344. case 3:
  38345. return this.w;
  38346. default:
  38347. throw new Error("index is out of range: " + e)
  38348. }
  38349. },
  38350. clone: function() {
  38351. return new this.constructor(this.x,this.y,this.z,this.w)
  38352. },
  38353. copy: function(e) {
  38354. return this.x = e.x,
  38355. this.y = e.y,
  38356. this.z = e.z,
  38357. this.w = void 0 !== e.w ? e.w : 1,
  38358. this
  38359. },
  38360. add: function(e, t) {
  38361. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38362. this.addVectors(e, t)) : (this.x += e.x,
  38363. this.y += e.y,
  38364. this.z += e.z,
  38365. this.w += e.w,
  38366. this)
  38367. },
  38368. addScalar: function(e) {
  38369. return this.x += e,
  38370. this.y += e,
  38371. this.z += e,
  38372. this.w += e,
  38373. this
  38374. },
  38375. addVectors: function(e, t) {
  38376. return this.x = e.x + t.x,
  38377. this.y = e.y + t.y,
  38378. this.z = e.z + t.z,
  38379. this.w = e.w + t.w,
  38380. this
  38381. },
  38382. addScaledVector: function(e, t) {
  38383. return this.x += e.x * t,
  38384. this.y += e.y * t,
  38385. this.z += e.z * t,
  38386. this.w += e.w * t,
  38387. this
  38388. },
  38389. sub: function(e, t) {
  38390. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38391. this.subVectors(e, t)) : (this.x -= e.x,
  38392. this.y -= e.y,
  38393. this.z -= e.z,
  38394. this.w -= e.w,
  38395. this)
  38396. },
  38397. subScalar: function(e) {
  38398. return this.x -= e,
  38399. this.y -= e,
  38400. this.z -= e,
  38401. this.w -= e,
  38402. this
  38403. },
  38404. subVectors: function(e, t) {
  38405. return this.x = e.x - t.x,
  38406. this.y = e.y - t.y,
  38407. this.z = e.z - t.z,
  38408. this.w = e.w - t.w,
  38409. this
  38410. },
  38411. multiplyScalar: function(e) {
  38412. return isFinite(e) ? (this.x *= e,
  38413. this.y *= e,
  38414. this.z *= e,
  38415. this.w *= e) : (this.x = 0,
  38416. this.y = 0,
  38417. this.z = 0,
  38418. this.w = 0),
  38419. this
  38420. },
  38421. applyMatrix4: function(e) {
  38422. var t = this.x
  38423. , i = this.y
  38424. , n = this.z
  38425. , r = this.w
  38426. , o = e.elements;
  38427. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38428. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38429. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38430. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38431. this
  38432. },
  38433. divideScalar: function(e) {
  38434. return this.multiplyScalar(1 / e)
  38435. },
  38436. setAxisAngleFromQuaternion: function(e) {
  38437. this.w = 2 * Math.acos(e.w);
  38438. var t = Math.sqrt(1 - e.w * e.w);
  38439. return t < 1e-4 ? (this.x = 1,
  38440. this.y = 0,
  38441. this.z = 0) : (this.x = e.x / t,
  38442. this.y = e.y / t,
  38443. this.z = e.z / t),
  38444. this
  38445. },
  38446. setAxisAngleFromRotationMatrix: function(e) {
  38447. 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];
  38448. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38449. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38450. return this.set(1, 0, 0, 0),
  38451. this;
  38452. t = Math.PI;
  38453. var g = (a + 1) / 2
  38454. , m = (h + 1) / 2
  38455. , v = (f + 1) / 2
  38456. , y = (s + c) / 4
  38457. , A = (l + d) / 4
  38458. , C = (u + p) / 4;
  38459. return m < g && v < g ? r = g < .01 ? (i = 0,
  38460. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38461. A / i) : v < m ? r = m < .01 ? (n = 0,
  38462. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38463. C / n) : v < .01 ? (n = i = .707106781,
  38464. r = 0) : (i = A / (r = Math.sqrt(v)),
  38465. n = C / r),
  38466. this.set(i, n, r, t),
  38467. this
  38468. }
  38469. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38470. return Math.abs(I) < .001 && (I = 1),
  38471. this.x = (p - u) / I,
  38472. this.y = (l - d) / I,
  38473. this.z = (c - s) / I,
  38474. this.w = Math.acos((a + h + f - 1) / 2),
  38475. this
  38476. },
  38477. min: function(e) {
  38478. return this.x = Math.min(this.x, e.x),
  38479. this.y = Math.min(this.y, e.y),
  38480. this.z = Math.min(this.z, e.z),
  38481. this.w = Math.min(this.w, e.w),
  38482. this
  38483. },
  38484. max: function(e) {
  38485. return this.x = Math.max(this.x, e.x),
  38486. this.y = Math.max(this.y, e.y),
  38487. this.z = Math.max(this.z, e.z),
  38488. this.w = Math.max(this.w, e.w),
  38489. this
  38490. },
  38491. clamp: function(e, t) {
  38492. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38493. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38494. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38495. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38496. this
  38497. },
  38498. clampScalar: function(e, t) {
  38499. return void 0 === _e && (_e = new Ci.Vector4,
  38500. be = new Ci.Vector4),
  38501. _e.set(e, e, e, e),
  38502. be.set(t, t, t, t),
  38503. this.clamp(_e, be)
  38504. },
  38505. floor: function() {
  38506. return this.x = Math.floor(this.x),
  38507. this.y = Math.floor(this.y),
  38508. this.z = Math.floor(this.z),
  38509. this.w = Math.floor(this.w),
  38510. this
  38511. },
  38512. ceil: function() {
  38513. return this.x = Math.ceil(this.x),
  38514. this.y = Math.ceil(this.y),
  38515. this.z = Math.ceil(this.z),
  38516. this.w = Math.ceil(this.w),
  38517. this
  38518. },
  38519. round: function() {
  38520. return this.x = Math.round(this.x),
  38521. this.y = Math.round(this.y),
  38522. this.z = Math.round(this.z),
  38523. this.w = Math.round(this.w),
  38524. this
  38525. },
  38526. roundToZero: function() {
  38527. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38528. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38529. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38530. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38531. this
  38532. },
  38533. negate: function() {
  38534. return this.x = -this.x,
  38535. this.y = -this.y,
  38536. this.z = -this.z,
  38537. this.w = -this.w,
  38538. this
  38539. },
  38540. dot: function(e) {
  38541. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38542. },
  38543. lengthSq: function() {
  38544. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38545. },
  38546. length: function() {
  38547. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38548. },
  38549. lengthManhattan: function() {
  38550. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38551. },
  38552. normalize: function() {
  38553. return this.divideScalar(this.length())
  38554. },
  38555. setLength: function(e) {
  38556. return this.multiplyScalar(e / this.length())
  38557. },
  38558. lerp: function(e, t) {
  38559. return this.x += (e.x - this.x) * t,
  38560. this.y += (e.y - this.y) * t,
  38561. this.z += (e.z - this.z) * t,
  38562. this.w += (e.w - this.w) * t,
  38563. this
  38564. },
  38565. lerpVectors: function(e, t, i) {
  38566. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38567. this
  38568. },
  38569. equals: function(e) {
  38570. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38571. },
  38572. fromArray: function(e, t) {
  38573. return void 0 === t && (t = 0),
  38574. this.x = e[t],
  38575. this.y = e[t + 1],
  38576. this.z = e[t + 2],
  38577. this.w = e[t + 3],
  38578. this
  38579. },
  38580. toArray: function(e, t) {
  38581. return void 0 === e && (e = []),
  38582. void 0 === t && (t = 0),
  38583. e[t] = this.x,
  38584. e[t + 1] = this.y,
  38585. e[t + 2] = this.z,
  38586. e[t + 3] = this.w,
  38587. e
  38588. },
  38589. fromAttribute: function(e, t, i) {
  38590. return void 0 === i && (i = 0),
  38591. t = t * e.itemSize + i,
  38592. this.x = e.array[t],
  38593. this.y = e.array[t + 1],
  38594. this.z = e.array[t + 2],
  38595. this.w = e.array[t + 3],
  38596. this
  38597. }
  38598. },
  38599. Ci.Euler = function(e, t, i, n) {
  38600. this._x = e || 0,
  38601. this._y = t || 0,
  38602. this._z = i || 0,
  38603. this._order = n || Ci.Euler.DefaultOrder
  38604. }
  38605. ,
  38606. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38607. Ci.Euler.DefaultOrder = "XYZ",
  38608. Ci.Euler.prototype = {
  38609. constructor: Ci.Euler,
  38610. get x() {
  38611. return this._x
  38612. },
  38613. set x(e) {
  38614. this._x = e,
  38615. this.onChangeCallback()
  38616. },
  38617. get y() {
  38618. return this._y
  38619. },
  38620. set y(e) {
  38621. this._y = e,
  38622. this.onChangeCallback()
  38623. },
  38624. get z() {
  38625. return this._z
  38626. },
  38627. set z(e) {
  38628. this._z = e,
  38629. this.onChangeCallback()
  38630. },
  38631. get order() {
  38632. return this._order
  38633. },
  38634. set order(e) {
  38635. this._order = e,
  38636. this.onChangeCallback()
  38637. },
  38638. set: function(e, t, i, n) {
  38639. return this._x = e,
  38640. this._y = t,
  38641. this._z = i,
  38642. this._order = n || this._order,
  38643. this.onChangeCallback(),
  38644. this
  38645. },
  38646. clone: function() {
  38647. return new this.constructor(this._x,this._y,this._z,this._order)
  38648. },
  38649. copy: function(e) {
  38650. return this._x = e._x,
  38651. this._y = e._y,
  38652. this._z = e._z,
  38653. this._order = e._order,
  38654. this.onChangeCallback(),
  38655. this
  38656. },
  38657. toObject: function() {//xzw
  38658. return {x:this.x,y:this.y,z:this.z}
  38659. },
  38660. setFromRotationMatrix: function(e, t, i) {
  38661. var n = Ci.Math.clamp
  38662. , r = e.elements
  38663. , o = r[0]
  38664. , a = r[4]
  38665. , s = r[8]
  38666. , l = r[1]
  38667. , c = r[5]
  38668. , h = r[9]
  38669. , u = r[2]
  38670. , d = r[6]
  38671. , p = r[10];
  38672. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38673. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38674. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38675. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38676. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38677. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38678. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38679. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38680. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38681. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38682. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38683. this._z = Math.atan2(l, o)) : (this._x = 0,
  38684. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38685. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38686. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38687. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38688. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38689. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38690. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38691. this._order = t,
  38692. !1 !== i && this.onChangeCallback(),
  38693. this
  38694. },
  38695. setFromQuaternion: function(e, t, i) {
  38696. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38697. Ee.makeRotationFromQuaternion(e),
  38698. this.setFromRotationMatrix(Ee, t, i),
  38699. this
  38700. },
  38701. setFromVector3: function(e, t) {
  38702. return this.set(e.x, e.y, e.z, t || this._order)
  38703. },
  38704. reorder: (Ie = new Ci.Quaternion,
  38705. function(e) {
  38706. Ie.setFromEuler(this),
  38707. this.setFromQuaternion(Ie, e)
  38708. }
  38709. ),
  38710. equals: function(e) {
  38711. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38712. },
  38713. fromArray: function(e) {
  38714. return this._x = e[0],
  38715. this._y = e[1],
  38716. this._z = e[2],
  38717. void 0 !== e[3] && (this._order = e[3]),
  38718. this.onChangeCallback(),
  38719. this
  38720. },
  38721. toArray: function(e, t) {
  38722. return void 0 === e && (e = []),
  38723. void 0 === t && (t = 0),
  38724. e[t] = this._x,
  38725. e[t + 1] = this._y,
  38726. e[t + 2] = this._z,
  38727. e[t + 3] = this._order,
  38728. e
  38729. },
  38730. toVector3: function(e) {
  38731. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38732. },
  38733. onChange: function(e) {
  38734. return this.onChangeCallback = e,
  38735. this
  38736. },
  38737. onChangeCallback: function() {}
  38738. },
  38739. Ci.Line3 = function(e, t) {
  38740. this.start = void 0 !== e ? e : new Ci.Vector3,
  38741. this.end = void 0 !== t ? t : new Ci.Vector3
  38742. }
  38743. ,
  38744. Ci.Line3.prototype = {
  38745. constructor: Ci.Line3,
  38746. set: function(e, t) {
  38747. return this.start.copy(e),
  38748. this.end.copy(t),
  38749. this
  38750. },
  38751. clone: function() {
  38752. return (new this.constructor).copy(this)
  38753. },
  38754. copy: function(e) {
  38755. return this.start.copy(e.start),
  38756. this.end.copy(e.end),
  38757. this
  38758. },
  38759. center: function(e) {
  38760. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38761. },
  38762. delta: function(e) {
  38763. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38764. },
  38765. distanceSq: function() {
  38766. return this.start.distanceToSquared(this.end)
  38767. },
  38768. distance: function() {
  38769. return this.start.distanceTo(this.end)
  38770. },
  38771. at: function(e, t) {
  38772. var i = t || new Ci.Vector3;
  38773. return this.delta(i).multiplyScalar(e).add(this.start)
  38774. },
  38775. closestPointToPointParameter: (Ae = new Ci.Vector3,
  38776. Ce = new Ci.Vector3,
  38777. function(e, t) {
  38778. Ae.subVectors(e, this.start),
  38779. Ce.subVectors(this.end, this.start);
  38780. var i = Ce.dot(Ce)
  38781. , n = Ce.dot(Ae) / i;
  38782. return t && (n = Ci.Math.clamp(n, 0, 1)),
  38783. n
  38784. }
  38785. ),
  38786. closestPointToPoint: function(e, t, i) {
  38787. var n = this.closestPointToPointParameter(e, t)
  38788. , r = i || new Ci.Vector3;
  38789. return this.delta(r).multiplyScalar(n).add(this.start)
  38790. },
  38791. applyMatrix4: function(e) {
  38792. return this.start.applyMatrix4(e),
  38793. this.end.applyMatrix4(e),
  38794. this
  38795. },
  38796. equals: function(e) {
  38797. return e.start.equals(this.start) && e.end.equals(this.end)
  38798. }
  38799. },
  38800. Ci.Box2 = function(e, t) {
  38801. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  38802. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  38803. }
  38804. ,
  38805. Ci.Box2.prototype = {
  38806. constructor: Ci.Box2,
  38807. set: function(e, t) {
  38808. return this.min.copy(e),
  38809. this.max.copy(t),
  38810. this
  38811. },
  38812. setFromPoints: function(e) {
  38813. this.makeEmpty();
  38814. for (var t = 0, i = e.length; t < i; t++)
  38815. this.expandByPoint(e[t]);
  38816. return this
  38817. },
  38818. setFromCenterAndSize: (ye = new Ci.Vector2,
  38819. function(e, t) {
  38820. var i = ye.copy(t).multiplyScalar(.5);
  38821. return this.min.copy(e).sub(i),
  38822. this.max.copy(e).add(i),
  38823. this
  38824. }
  38825. ),
  38826. clone: function() {
  38827. return (new this.constructor).copy(this)
  38828. },
  38829. copy: function(e) {
  38830. return this.min.copy(e.min),
  38831. this.max.copy(e.max),
  38832. this
  38833. },
  38834. makeEmpty: function() {
  38835. return this.min.x = this.min.y = 1 / 0,
  38836. this.max.x = this.max.y = -1 / 0,
  38837. this
  38838. },
  38839. isEmpty: function() {
  38840. return this.max.x < this.min.x || this.max.y < this.min.y
  38841. },
  38842. center: function(e) {
  38843. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  38844. },
  38845. size: function(e) {
  38846. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  38847. },
  38848. expandByPoint: function(e) {
  38849. return this.min.min(e),
  38850. this.max.max(e),
  38851. this
  38852. },
  38853. expandByVector: function(e) {
  38854. return this.min.sub(e),
  38855. this.max.add(e),
  38856. this
  38857. },
  38858. expandByScalar: function(e) {
  38859. return this.min.addScalar(-e),
  38860. this.max.addScalar(e),
  38861. this
  38862. },
  38863. containsPoint: function(e) {
  38864. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  38865. },
  38866. containsBox: function(e) {
  38867. 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
  38868. },
  38869. getParameter: function(e, t) {
  38870. 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))
  38871. },
  38872. intersectsBox: function(e) {
  38873. 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)
  38874. },
  38875. clampPoint: function(e, t) {
  38876. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  38877. },
  38878. distanceToPoint: (ve = new Ci.Vector2,
  38879. function(e) {
  38880. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  38881. }
  38882. ),
  38883. intersect: function(e) {
  38884. return this.min.max(e.min),
  38885. this.max.min(e.max),
  38886. this
  38887. },
  38888. union: function(e) {
  38889. return this.min.min(e.min),
  38890. this.max.max(e.max),
  38891. this
  38892. },
  38893. translate: function(e) {
  38894. return this.min.add(e),
  38895. this.max.add(e),
  38896. this
  38897. },
  38898. equals: function(e) {
  38899. return e.min.equals(this.min) && e.max.equals(this.max)
  38900. }
  38901. },
  38902. Ci.Box3 = function(e, t) {
  38903. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  38904. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  38905. }
  38906. ,
  38907. Ci.Box3.prototype = {
  38908. constructor: Ci.Box3,
  38909. set: function(e, t) {
  38910. return this.min.copy(e),
  38911. this.max.copy(t),
  38912. this
  38913. },
  38914. setFromArray: function(e) {
  38915. this.makeEmpty();
  38916. 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) {
  38917. var c = e[s]
  38918. , h = e[s + 1]
  38919. , u = e[s + 2];
  38920. c < t && (t = c),
  38921. h < i && (i = h),
  38922. u < n && (n = u),
  38923. r < c && (r = c),
  38924. o < h && (o = h),
  38925. a < u && (a = u)
  38926. }
  38927. this.min.set(t, i, n),
  38928. this.max.set(r, o, a)
  38929. },
  38930. setFromPoints: function(e) {
  38931. this.makeEmpty();
  38932. for (var t = 0, i = e.length; t < i; t++)
  38933. this.expandByPoint(e[t]);
  38934. return this
  38935. },
  38936. setFromCenterAndSize: (me = new Ci.Vector3,
  38937. function(e, t) {
  38938. var i = me.copy(t).multiplyScalar(.5);
  38939. return this.min.copy(e).sub(i),
  38940. this.max.copy(e).add(i),
  38941. this
  38942. }
  38943. ),
  38944. setFromObject: function(e) {
  38945. void 0 === ge && (ge = new Ci.Box3);
  38946. var i = this;
  38947. return this.makeEmpty(),
  38948. e.updateMatrixWorld(!0),
  38949. e.traverse(function(e) {
  38950. var t = e.geometry;
  38951. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  38952. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  38953. ge.applyMatrix4(e.matrixWorld),
  38954. i.union(ge)))
  38955. }),
  38956. this
  38957. },
  38958. clone: function() {
  38959. return (new this.constructor).copy(this)
  38960. },
  38961. copy: function(e) {
  38962. return this.min.copy(e.min),
  38963. this.max.copy(e.max),
  38964. this
  38965. },
  38966. makeEmpty: function() {
  38967. return this.min.x = this.min.y = this.min.z = 1 / 0,
  38968. this.max.x = this.max.y = this.max.z = -1 / 0,
  38969. this
  38970. },
  38971. isEmpty: function() {
  38972. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  38973. },
  38974. center: function(e) {
  38975. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  38976. },
  38977. size: function(e) {
  38978. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  38979. },
  38980. expandByPoint: function(e) {
  38981. return this.min.min(e),
  38982. this.max.max(e),
  38983. this
  38984. },
  38985. expandByVector: function(e) {
  38986. return this.min.sub(e),
  38987. this.max.add(e),
  38988. this
  38989. },
  38990. expandByScalar: function(e) {
  38991. return this.min.addScalar(-e),
  38992. this.max.addScalar(e),
  38993. this
  38994. },
  38995. containsPoint: function(e) {
  38996. 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)
  38997. },
  38998. containsBox: function(e) {
  38999. 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
  39000. },
  39001. getParameter: function(e, t) {
  39002. 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))
  39003. },
  39004. intersectsBox: function(e) {
  39005. 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)
  39006. },
  39007. intersectsSphere: function(e) {
  39008. return void 0 === fe && (fe = new Ci.Vector3),
  39009. this.clampPoint(e.center, fe),
  39010. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39011. },
  39012. intersectsPlane: function(e) {
  39013. var t, i;
  39014. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39015. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39016. e.normal.x * this.min.x),
  39017. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39018. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39019. i += e.normal.y * this.min.y),
  39020. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39021. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39022. i += e.normal.z * this.min.z),
  39023. t <= e.constant && i >= e.constant
  39024. },
  39025. clampPoint: function(e, t) {
  39026. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39027. },
  39028. distanceToPoint: (pe = new Ci.Vector3,
  39029. function(e) {
  39030. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39031. }
  39032. ),
  39033. getBoundingSphere: (de = new Ci.Vector3,
  39034. function(e) {
  39035. var t = e || new Ci.Sphere;
  39036. return t.center = this.center(),
  39037. t.radius = .5 * this.size(de).length(),
  39038. t
  39039. }
  39040. ),
  39041. intersect: function(e) {
  39042. return this.min.max(e.min),
  39043. this.max.min(e.max),
  39044. this
  39045. },
  39046. union: function(e) {
  39047. return this.min.min(e.min),
  39048. this.max.max(e.max),
  39049. this
  39050. },
  39051. 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],
  39052. function(e) {
  39053. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39054. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39055. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39056. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39057. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39058. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39059. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39060. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39061. this.makeEmpty(),
  39062. this.setFromPoints(ue),
  39063. this
  39064. }
  39065. ),
  39066. translate: function(e) {
  39067. return this.min.add(e),
  39068. this.max.add(e),
  39069. this
  39070. },
  39071. equals: function(e) {
  39072. return e.min.equals(this.min) && e.max.equals(this.max)
  39073. }
  39074. },
  39075. Ci.Matrix3 = function() {
  39076. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39077. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39078. }
  39079. ,
  39080. Ci.Matrix3.prototype = {
  39081. constructor: Ci.Matrix3,
  39082. set: function(e, t, i, n, r, o, a, s, l) {
  39083. var c = this.elements;
  39084. return c[0] = e,
  39085. c[1] = n,
  39086. c[2] = a,
  39087. c[3] = t,
  39088. c[4] = r,
  39089. c[5] = s,
  39090. c[6] = i,
  39091. c[7] = o,
  39092. c[8] = l,
  39093. this
  39094. },
  39095. identity: function() {
  39096. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39097. this
  39098. },
  39099. clone: function() {
  39100. return (new this.constructor).fromArray(this.elements)
  39101. },
  39102. copy: function(e) {
  39103. var t = e.elements;
  39104. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39105. this
  39106. },
  39107. setFromMatrix4: function(e) {
  39108. var t = e.elements;
  39109. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39110. this
  39111. },
  39112. applyToVector3Array: function(e, t, i) {
  39113. void 0 === he && (he = new Ci.Vector3),
  39114. void 0 === t && (t = 0),
  39115. void 0 === i && (i = e.length);
  39116. for (var n = 0, r = t; n < i; n += 3,
  39117. r += 3)
  39118. he.fromArray(e, r),
  39119. he.applyMatrix3(this),
  39120. he.toArray(e, r);
  39121. return e
  39122. },
  39123. applyToBuffer: function(e, t, i) {
  39124. void 0 === ce && (ce = new Ci.Vector3),
  39125. void 0 === t && (t = 0),
  39126. void 0 === i && (i = e.length / e.itemSize);
  39127. for (var n = 0, r = t; n < i; n++,
  39128. r++)
  39129. ce.x = e.getX(r),
  39130. ce.y = e.getY(r),
  39131. ce.z = e.getZ(r),
  39132. ce.applyMatrix3(this),
  39133. e.setXYZ(ce.x, ce.y, ce.z);
  39134. return e
  39135. },
  39136. multiplyScalar: function(e) {
  39137. var t = this.elements;
  39138. return t[0] *= e,
  39139. t[3] *= e,
  39140. t[6] *= e,
  39141. t[1] *= e,
  39142. t[4] *= e,
  39143. t[7] *= e,
  39144. t[2] *= e,
  39145. t[5] *= e,
  39146. t[8] *= e,
  39147. this
  39148. },
  39149. determinant: function() {
  39150. var e = this.elements
  39151. , t = e[0]
  39152. , i = e[1]
  39153. , n = e[2]
  39154. , r = e[3]
  39155. , o = e[4]
  39156. , a = e[5]
  39157. , s = e[6]
  39158. , l = e[7]
  39159. , c = e[8];
  39160. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39161. },
  39162. getInverse: function(e, t) {
  39163. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39164. var i = e.elements
  39165. , n = this.elements
  39166. , r = i[0]
  39167. , o = i[1]
  39168. , a = i[2]
  39169. , s = i[3]
  39170. , l = i[4]
  39171. , c = i[5]
  39172. , h = i[6]
  39173. , u = i[7]
  39174. , d = i[8]
  39175. , p = d * l - c * u
  39176. , f = c * h - d * s
  39177. , g = u * s - l * h
  39178. , m = r * p + o * f + a * g;
  39179. if (0 != m)
  39180. return n[0] = p,
  39181. n[1] = a * u - d * o,
  39182. n[2] = c * o - a * l,
  39183. n[3] = f,
  39184. n[4] = d * r - a * h,
  39185. n[5] = a * s - c * r,
  39186. n[6] = g,
  39187. n[7] = o * h - u * r,
  39188. n[8] = l * r - o * s,
  39189. this.multiplyScalar(1 / m);
  39190. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39191. if (t)
  39192. throw new Error(v);
  39193. return console.warn(v),
  39194. this.identity()
  39195. },
  39196. transpose: function() {
  39197. var e, t = this.elements;
  39198. return e = t[1],
  39199. t[1] = t[3],
  39200. t[3] = e,
  39201. e = t[2],
  39202. t[2] = t[6],
  39203. t[6] = e,
  39204. e = t[5],
  39205. t[5] = t[7],
  39206. t[7] = e,
  39207. this
  39208. },
  39209. flattenToArrayOffset: function(e, t) {
  39210. var i = this.elements;
  39211. return e[t] = i[0],
  39212. e[t + 1] = i[1],
  39213. e[t + 2] = i[2],
  39214. e[t + 3] = i[3],
  39215. e[t + 4] = i[4],
  39216. e[t + 5] = i[5],
  39217. e[t + 6] = i[6],
  39218. e[t + 7] = i[7],
  39219. e[t + 8] = i[8],
  39220. e
  39221. },
  39222. getNormalMatrix: function(e) {
  39223. return this.setFromMatrix4(e).getInverse(this).transpose()
  39224. },
  39225. transposeIntoArray: function(e) {
  39226. var t = this.elements;
  39227. return e[0] = t[0],
  39228. e[1] = t[3],
  39229. e[2] = t[6],
  39230. e[3] = t[1],
  39231. e[4] = t[4],
  39232. e[5] = t[7],
  39233. e[6] = t[2],
  39234. e[7] = t[5],
  39235. e[8] = t[8],
  39236. this
  39237. },
  39238. fromArray: function(e) {
  39239. return this.elements.set(e),
  39240. this
  39241. },
  39242. toArray: function() {
  39243. var e = this.elements;
  39244. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39245. }
  39246. },
  39247. Ci.Matrix4 = function() {
  39248. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39249. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39250. }
  39251. ,
  39252. Ci.Matrix4.prototype = {
  39253. constructor: Ci.Matrix4,
  39254. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39255. var m = this.elements;
  39256. return m[0] = e,
  39257. m[4] = t,
  39258. m[8] = i,
  39259. m[12] = n,
  39260. m[1] = r,
  39261. m[5] = o,
  39262. m[9] = a,
  39263. m[13] = s,
  39264. m[2] = l,
  39265. m[6] = c,
  39266. m[10] = h,
  39267. m[14] = u,
  39268. m[3] = d,
  39269. m[7] = p,
  39270. m[11] = f,
  39271. m[15] = g,
  39272. this
  39273. },
  39274. identity: function() {
  39275. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39276. this
  39277. },
  39278. clone: function() {
  39279. return (new Ci.Matrix4).fromArray(this.elements)
  39280. },
  39281. copy: function(e) {
  39282. return this.elements.set(e.elements),
  39283. this
  39284. },
  39285. copyPosition: function(e) {
  39286. var t = this.elements
  39287. , i = e.elements;
  39288. return t[12] = i[12],
  39289. t[13] = i[13],
  39290. t[14] = i[14],
  39291. this
  39292. },
  39293. extractBasis: function(e, t, i) {
  39294. return e.setFromMatrixColumn(this, 0),
  39295. t.setFromMatrixColumn(this, 1),
  39296. i.setFromMatrixColumn(this, 2),
  39297. this
  39298. },
  39299. makeBasis: function(e, t, i) {
  39300. 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),
  39301. this
  39302. },
  39303. extractRotation: function(e) {
  39304. void 0 === le && (le = new Ci.Vector3);
  39305. var t = this.elements
  39306. , i = e.elements
  39307. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39308. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39309. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39310. return t[0] = i[0] * n,
  39311. t[1] = i[1] * n,
  39312. t[2] = i[2] * n,
  39313. t[4] = i[4] * r,
  39314. t[5] = i[5] * r,
  39315. t[6] = i[6] * r,
  39316. t[8] = i[8] * o,
  39317. t[9] = i[9] * o,
  39318. t[10] = i[10] * o,
  39319. this
  39320. },
  39321. makeRotationFromEuler: function(e) {
  39322. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39323. var t = this.elements
  39324. , i = e.x
  39325. , n = e.y
  39326. , r = e.z
  39327. , o = Math.cos(i)
  39328. , a = Math.sin(i)
  39329. , s = Math.cos(n)
  39330. , l = Math.sin(n)
  39331. , c = Math.cos(r)
  39332. , h = Math.sin(r);
  39333. if ("XYZ" === e.order) {
  39334. var u = o * c
  39335. , d = o * h
  39336. , p = a * c
  39337. , f = a * h;
  39338. t[0] = s * c,
  39339. t[4] = -s * h,
  39340. t[8] = l,
  39341. t[1] = d + p * l,
  39342. t[5] = u - f * l,
  39343. t[9] = -a * s,
  39344. t[2] = f - u * l,
  39345. t[6] = p + d * l,
  39346. t[10] = o * s
  39347. } else if ("YXZ" === e.order) {
  39348. var g = s * c
  39349. , m = s * h
  39350. , v = l * c
  39351. , y = l * h;
  39352. t[0] = g + y * a,
  39353. t[4] = v * a - m,
  39354. t[8] = o * l,
  39355. t[1] = o * h,
  39356. t[5] = o * c,
  39357. t[9] = -a,
  39358. t[2] = m * a - v,
  39359. t[6] = y + g * a,
  39360. t[10] = o * s
  39361. } else if ("ZXY" === e.order) {
  39362. g = s * c,
  39363. m = s * h,
  39364. v = l * c,
  39365. y = l * h;
  39366. t[0] = g - y * a,
  39367. t[4] = -o * h,
  39368. t[8] = v + m * a,
  39369. t[1] = m + v * a,
  39370. t[5] = o * c,
  39371. t[9] = y - g * a,
  39372. t[2] = -o * l,
  39373. t[6] = a,
  39374. t[10] = o * s
  39375. } else if ("ZYX" === e.order) {
  39376. u = o * c,
  39377. d = o * h,
  39378. p = a * c,
  39379. f = a * h;
  39380. t[0] = s * c,
  39381. t[4] = p * l - d,
  39382. t[8] = u * l + f,
  39383. t[1] = s * h,
  39384. t[5] = f * l + u,
  39385. t[9] = d * l - p,
  39386. t[2] = -l,
  39387. t[6] = a * s,
  39388. t[10] = o * s
  39389. } else if ("YZX" === e.order) {
  39390. var A = o * s
  39391. , C = o * l
  39392. , I = a * s
  39393. , E = a * l;
  39394. t[0] = s * c,
  39395. t[4] = E - A * h,
  39396. t[8] = I * h + C,
  39397. t[1] = h,
  39398. t[5] = o * c,
  39399. t[9] = -a * c,
  39400. t[2] = -l * c,
  39401. t[6] = C * h + I,
  39402. t[10] = A - E * h
  39403. } else if ("XZY" === e.order) {
  39404. A = o * s,
  39405. C = o * l,
  39406. I = a * s,
  39407. E = a * l;
  39408. t[0] = s * c,
  39409. t[4] = -h,
  39410. t[8] = l * c,
  39411. t[1] = A * h + E,
  39412. t[5] = o * c,
  39413. t[9] = C * h - I,
  39414. t[2] = I * h - C,
  39415. t[6] = a * c,
  39416. t[10] = E * h + A
  39417. }
  39418. return t[3] = 0,
  39419. t[7] = 0,
  39420. t[11] = 0,
  39421. t[12] = 0,
  39422. t[13] = 0,
  39423. t[14] = 0,
  39424. t[15] = 1,
  39425. this
  39426. },
  39427. makeRotationFromQuaternion: function(e) {
  39428. var t = this.elements
  39429. , i = e.x
  39430. , n = e.y
  39431. , r = e.z
  39432. , o = e.w
  39433. , a = i + i
  39434. , s = n + n
  39435. , l = r + r
  39436. , c = i * a
  39437. , h = i * s
  39438. , u = i * l
  39439. , d = n * s
  39440. , p = n * l
  39441. , f = r * l
  39442. , g = o * a
  39443. , m = o * s
  39444. , v = o * l;
  39445. return t[0] = 1 - (d + f),
  39446. t[4] = h - v,
  39447. t[8] = u + m,
  39448. t[1] = h + v,
  39449. t[5] = 1 - (c + f),
  39450. t[9] = p - g,
  39451. t[2] = u - m,
  39452. t[6] = p + g,
  39453. t[10] = 1 - (c + d),
  39454. t[3] = 0,
  39455. t[7] = 0,
  39456. t[11] = 0,
  39457. t[12] = 0,
  39458. t[13] = 0,
  39459. t[14] = 0,
  39460. t[15] = 1,
  39461. this
  39462. },
  39463. lookAt: function(e, t, i) {
  39464. void 0 === oe && (oe = new Ci.Vector3),
  39465. void 0 === ae && (ae = new Ci.Vector3),
  39466. void 0 === se && (se = new Ci.Vector3);
  39467. var n = this.elements;
  39468. return se.subVectors(e, t).normalize(),
  39469. 0 === se.lengthSq() && (se.z = 1),
  39470. oe.crossVectors(i, se).normalize(),
  39471. 0 === oe.lengthSq() && (se.x += 1e-4,
  39472. oe.crossVectors(i, se).normalize()),
  39473. ae.crossVectors(se, oe),
  39474. n[0] = oe.x,
  39475. n[4] = ae.x,
  39476. n[8] = se.x,
  39477. n[1] = oe.y,
  39478. n[5] = ae.y,
  39479. n[9] = se.y,
  39480. n[2] = oe.z,
  39481. n[6] = ae.z,
  39482. n[10] = se.z,
  39483. this
  39484. },
  39485. multiply: function(e, t) {
  39486. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39487. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39488. },
  39489. multiplyMatrices: function(e, t) {
  39490. var i = e.elements
  39491. , n = t.elements
  39492. , r = this.elements
  39493. , o = i[0]
  39494. , a = i[4]
  39495. , s = i[8]
  39496. , l = i[12]
  39497. , c = i[1]
  39498. , h = i[5]
  39499. , u = i[9]
  39500. , d = i[13]
  39501. , p = i[2]
  39502. , f = i[6]
  39503. , g = i[10]
  39504. , m = i[14]
  39505. , v = i[3]
  39506. , y = i[7]
  39507. , A = i[11]
  39508. , C = i[15]
  39509. , I = n[0]
  39510. , E = n[4]
  39511. , _ = n[8]
  39512. , b = n[12]
  39513. , w = n[1]
  39514. , T = n[5]
  39515. , x = n[9]
  39516. , S = n[13]
  39517. , M = n[2]
  39518. , R = n[6]
  39519. , P = n[10]
  39520. , O = n[14]
  39521. , L = n[3]
  39522. , D = n[7]
  39523. , N = n[11]
  39524. , F = n[15];
  39525. return r[0] = o * I + a * w + s * M + l * L,
  39526. r[4] = o * E + a * T + s * R + l * D,
  39527. r[8] = o * _ + a * x + s * P + l * N,
  39528. r[12] = o * b + a * S + s * O + l * F,
  39529. r[1] = c * I + h * w + u * M + d * L,
  39530. r[5] = c * E + h * T + u * R + d * D,
  39531. r[9] = c * _ + h * x + u * P + d * N,
  39532. r[13] = c * b + h * S + u * O + d * F,
  39533. r[2] = p * I + f * w + g * M + m * L,
  39534. r[6] = p * E + f * T + g * R + m * D,
  39535. r[10] = p * _ + f * x + g * P + m * N,
  39536. r[14] = p * b + f * S + g * O + m * F,
  39537. r[3] = v * I + y * w + A * M + C * L,
  39538. r[7] = v * E + y * T + A * R + C * D,
  39539. r[11] = v * _ + y * x + A * P + C * N,
  39540. r[15] = v * b + y * S + A * O + C * F,
  39541. this
  39542. },
  39543. multiplyToArray: function(e, t, i) {
  39544. var n = this.elements;
  39545. return this.multiplyMatrices(e, t),
  39546. i[0] = n[0],
  39547. i[1] = n[1],
  39548. i[2] = n[2],
  39549. i[3] = n[3],
  39550. i[4] = n[4],
  39551. i[5] = n[5],
  39552. i[6] = n[6],
  39553. i[7] = n[7],
  39554. i[8] = n[8],
  39555. i[9] = n[9],
  39556. i[10] = n[10],
  39557. i[11] = n[11],
  39558. i[12] = n[12],
  39559. i[13] = n[13],
  39560. i[14] = n[14],
  39561. i[15] = n[15],
  39562. this
  39563. },
  39564. multiplyScalar: function(e) {
  39565. var t = this.elements;
  39566. return t[0] *= e,
  39567. t[4] *= e,
  39568. t[8] *= e,
  39569. t[12] *= e,
  39570. t[1] *= e,
  39571. t[5] *= e,
  39572. t[9] *= e,
  39573. t[13] *= e,
  39574. t[2] *= e,
  39575. t[6] *= e,
  39576. t[10] *= e,
  39577. t[14] *= e,
  39578. t[3] *= e,
  39579. t[7] *= e,
  39580. t[11] *= e,
  39581. t[15] *= e,
  39582. this
  39583. },
  39584. applyToVector3Array: function(e, t, i) {
  39585. void 0 === re && (re = new Ci.Vector3),
  39586. void 0 === t && (t = 0),
  39587. void 0 === i && (i = e.length);
  39588. for (var n = 0, r = t; n < i; n += 3,
  39589. r += 3)
  39590. re.fromArray(e, r),
  39591. re.applyMatrix4(this),
  39592. re.toArray(e, r);
  39593. return e
  39594. },
  39595. applyToBuffer: function(e, t, i) {
  39596. void 0 === ne && (ne = new Ci.Vector3),
  39597. void 0 === t && (t = 0),
  39598. void 0 === i && (i = e.length / e.itemSize);
  39599. for (var n = 0, r = t; n < i; n++,
  39600. r++)
  39601. ne.x = e.getX(r),
  39602. ne.y = e.getY(r),
  39603. ne.z = e.getZ(r),
  39604. ne.applyMatrix4(this),
  39605. e.setXYZ(ne.x, ne.y, ne.z);
  39606. return e
  39607. },
  39608. determinant: function() {
  39609. var e = this.elements
  39610. , t = e[0]
  39611. , i = e[4]
  39612. , n = e[8]
  39613. , r = e[12]
  39614. , o = e[1]
  39615. , a = e[5]
  39616. , s = e[9]
  39617. , l = e[13]
  39618. , c = e[2]
  39619. , h = e[6]
  39620. , u = e[10]
  39621. , d = e[14];
  39622. 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)
  39623. },
  39624. transpose: function() {
  39625. var e, t = this.elements;
  39626. return e = t[1],
  39627. t[1] = t[4],
  39628. t[4] = e,
  39629. e = t[2],
  39630. t[2] = t[8],
  39631. t[8] = e,
  39632. e = t[6],
  39633. t[6] = t[9],
  39634. t[9] = e,
  39635. e = t[3],
  39636. t[3] = t[12],
  39637. t[12] = e,
  39638. e = t[7],
  39639. t[7] = t[13],
  39640. t[13] = e,
  39641. e = t[11],
  39642. t[11] = t[14],
  39643. t[14] = e,
  39644. this
  39645. },
  39646. flattenToArrayOffset: function(e, t) {
  39647. var i = this.elements;
  39648. return e[t] = i[0],
  39649. e[t + 1] = i[1],
  39650. e[t + 2] = i[2],
  39651. e[t + 3] = i[3],
  39652. e[t + 4] = i[4],
  39653. e[t + 5] = i[5],
  39654. e[t + 6] = i[6],
  39655. e[t + 7] = i[7],
  39656. e[t + 8] = i[8],
  39657. e[t + 9] = i[9],
  39658. e[t + 10] = i[10],
  39659. e[t + 11] = i[11],
  39660. e[t + 12] = i[12],
  39661. e[t + 13] = i[13],
  39662. e[t + 14] = i[14],
  39663. e[t + 15] = i[15],
  39664. e
  39665. },
  39666. getPosition: function() {
  39667. return void 0 === ie && (ie = new Ci.Vector3),
  39668. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39669. ie.setFromMatrixColumn(this, 3)
  39670. },
  39671. setPosition: function(e) {
  39672. var t = this.elements;
  39673. return t[12] = e.x,
  39674. t[13] = e.y,
  39675. t[14] = e.z,
  39676. this
  39677. },
  39678. getInverse: function(e, t) {
  39679. var i = this.elements
  39680. , n = e.elements
  39681. , r = n[0]
  39682. , o = n[1]
  39683. , a = n[2]
  39684. , s = n[3]
  39685. , l = n[4]
  39686. , c = n[5]
  39687. , h = n[6]
  39688. , u = n[7]
  39689. , d = n[8]
  39690. , p = n[9]
  39691. , f = n[10]
  39692. , g = n[11]
  39693. , m = n[12]
  39694. , v = n[13]
  39695. , y = n[14]
  39696. , A = n[15]
  39697. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39698. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39699. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39700. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39701. , b = r * C + o * I + a * E + s * _;
  39702. if (0 != b)
  39703. return i[0] = C,
  39704. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39705. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39706. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39707. i[4] = I,
  39708. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39709. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39710. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39711. i[8] = E,
  39712. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39713. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39714. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39715. i[12] = _,
  39716. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39717. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39718. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39719. this.multiplyScalar(1 / b);
  39720. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39721. if (t)
  39722. throw new Error(w);
  39723. return console.warn(w),
  39724. this.identity()
  39725. },
  39726. scale: function(e) {
  39727. var t = this.elements
  39728. , i = e.x
  39729. , n = e.y
  39730. , r = e.z;
  39731. return t[0] *= i,
  39732. t[4] *= n,
  39733. t[8] *= r,
  39734. t[1] *= i,
  39735. t[5] *= n,
  39736. t[9] *= r,
  39737. t[2] *= i,
  39738. t[6] *= n,
  39739. t[10] *= r,
  39740. t[3] *= i,
  39741. t[7] *= n,
  39742. t[11] *= r,
  39743. this
  39744. },
  39745. getMaxScaleOnAxis: function() {
  39746. var e = this.elements
  39747. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39748. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39749. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39750. return Math.sqrt(Math.max(t, i, n))
  39751. },
  39752. makeTranslation: function(e, t, i) {
  39753. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39754. this
  39755. },
  39756. makeRotationX: function(e) {
  39757. var t = Math.cos(e)
  39758. , i = Math.sin(e);
  39759. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39760. this
  39761. },
  39762. makeRotationY: function(e) {
  39763. var t = Math.cos(e)
  39764. , i = Math.sin(e);
  39765. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39766. this
  39767. },
  39768. makeRotationZ: function(e) {
  39769. var t = Math.cos(e)
  39770. , i = Math.sin(e);
  39771. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39772. this
  39773. },
  39774. makeRotationAxis: function(e, t) {
  39775. var i = Math.cos(t)
  39776. , n = Math.sin(t)
  39777. , r = 1 - i
  39778. , o = e.x
  39779. , a = e.y
  39780. , s = e.z
  39781. , l = r * o
  39782. , c = r * a;
  39783. 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),
  39784. this
  39785. },
  39786. makeScale: function(e, t, i) {
  39787. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39788. this
  39789. },
  39790. compose: function(e, t, i) {
  39791. return this.makeRotationFromQuaternion(t),
  39792. this.scale(i),
  39793. this.setPosition(e),
  39794. this
  39795. },
  39796. decompose: function(e, t, i) {
  39797. void 0 === ee && (ee = new Ci.Vector3),
  39798. void 0 === te && (te = new Ci.Matrix4);
  39799. var n = this.elements
  39800. , r = ee.set(n[0], n[1], n[2]).length()
  39801. , o = ee.set(n[4], n[5], n[6]).length()
  39802. , a = ee.set(n[8], n[9], n[10]).length();
  39803. this.determinant() < 0 && (r = -r),
  39804. e.x = n[12],
  39805. e.y = n[13],
  39806. e.z = n[14],
  39807. te.elements.set(this.elements);
  39808. var s = 1 / r
  39809. , l = 1 / o
  39810. , c = 1 / a;
  39811. return te.elements[0] *= s,
  39812. te.elements[1] *= s,
  39813. te.elements[2] *= s,
  39814. te.elements[4] *= l,
  39815. te.elements[5] *= l,
  39816. te.elements[6] *= l,
  39817. te.elements[8] *= c,
  39818. te.elements[9] *= c,
  39819. te.elements[10] *= c,
  39820. t.setFromRotationMatrix(te),
  39821. i.x = r,
  39822. i.y = o,
  39823. i.z = a,
  39824. this
  39825. },
  39826. makeFrustum: function(e, t, i, n, r, o) {
  39827. var a = this.elements
  39828. , s = 2 * r / (t - e)
  39829. , l = 2 * r / (n - i)
  39830. , c = (t + e) / (t - e)
  39831. , h = (n + i) / (n - i)
  39832. , u = -(o + r) / (o - r)
  39833. , d = -2 * o * r / (o - r);
  39834. return a[0] = s,
  39835. a[4] = 0,
  39836. a[8] = c,
  39837. a[12] = 0,
  39838. a[1] = 0,
  39839. a[5] = l,
  39840. a[9] = h,
  39841. a[13] = 0,
  39842. a[2] = 0,
  39843. a[6] = 0,
  39844. a[10] = u,
  39845. a[14] = d,
  39846. a[3] = 0,
  39847. a[7] = 0,
  39848. a[11] = -1,
  39849. a[15] = 0,
  39850. this
  39851. },
  39852. makePerspective: function(e, t, i, n) {
  39853. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  39854. , o = -r
  39855. , a = o * t
  39856. , s = r * t;
  39857. return this.makeFrustum(a, s, o, r, i, n)
  39858. },
  39859. makeOrthographic: function(e, t, i, n, r, o) {
  39860. var a = this.elements
  39861. , s = 1 / (t - e)
  39862. , l = 1 / (i - n)
  39863. , c = 1 / (o - r)
  39864. , h = (t + e) * s
  39865. , u = (i + n) * l
  39866. , d = (o + r) * c;
  39867. return a[0] = 2 * s,
  39868. a[4] = 0,
  39869. a[8] = 0,
  39870. a[12] = -h,
  39871. a[1] = 0,
  39872. a[5] = 2 * l,
  39873. a[9] = 0,
  39874. a[13] = -u,
  39875. a[2] = 0,
  39876. a[6] = 0,
  39877. a[10] = -2 * c,
  39878. a[14] = -d,
  39879. a[3] = 0,
  39880. a[7] = 0,
  39881. a[11] = 0,
  39882. a[15] = 1,
  39883. this
  39884. },
  39885. equals: function(e) {
  39886. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  39887. if (t[n] !== i[n])
  39888. return !1;
  39889. return !0
  39890. },
  39891. fromArray: function(e) {
  39892. return this.elements.set(e),
  39893. this
  39894. },
  39895. toArray: function() {
  39896. var e = this.elements;
  39897. 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]]
  39898. }
  39899. },
  39900. Ci.Ray = function(e, t) {
  39901. this.origin = void 0 !== e ? e : new Ci.Vector3,
  39902. this.direction = void 0 !== t ? t : new Ci.Vector3
  39903. }
  39904. ,
  39905. Ci.Ray.prototype = {
  39906. constructor: Ci.Ray,
  39907. set: function(e, t) {
  39908. return this.origin.copy(e),
  39909. this.direction.copy(t),
  39910. this
  39911. },
  39912. clone: function() {
  39913. return (new this.constructor).copy(this)
  39914. },
  39915. copy: function(e) {
  39916. return this.origin.copy(e.origin),
  39917. this.direction.copy(e.direction),
  39918. this
  39919. },
  39920. at: function(e, t) {
  39921. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  39922. },
  39923. lookAt: function(e) {
  39924. this.direction.copy(e).sub(this.origin).normalize()
  39925. },
  39926. recast: ($ = new Ci.Vector3,
  39927. function(e) {
  39928. return this.origin.copy(this.at(e, $)),
  39929. this
  39930. }
  39931. ),
  39932. closestPointToPoint: function(e, t) {
  39933. var i = t || new Ci.Vector3;
  39934. i.subVectors(e, this.origin);
  39935. var n = i.dot(this.direction);
  39936. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  39937. },
  39938. distanceToPoint: function(e) {
  39939. return Math.sqrt(this.distanceSqToPoint(e))
  39940. },
  39941. distanceSqToPoint: (J = new Ci.Vector3,
  39942. function(e) {
  39943. var t = J.subVectors(e, this.origin).dot(this.direction);
  39944. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  39945. J.distanceToSquared(e))
  39946. }
  39947. ),
  39948. distanceSqToSegment: (Z = new Ci.Vector3,
  39949. K = new Ci.Vector3,
  39950. Q = new Ci.Vector3,
  39951. function(e, t, i, n) {
  39952. Z.copy(e).add(t).multiplyScalar(.5),
  39953. K.copy(t).sub(e).normalize(),
  39954. Q.copy(this.origin).sub(Z);
  39955. 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);
  39956. if (0 < p)
  39957. if (o = c * h - u,
  39958. s = l * p,
  39959. 0 <= (r = c * u - h))
  39960. if (-s <= o)
  39961. if (o <= s) {
  39962. var f = 1 / p;
  39963. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  39964. } else
  39965. o = l,
  39966. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39967. else
  39968. o = -l,
  39969. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39970. else
  39971. 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,
  39972. (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;
  39973. else
  39974. o = 0 < c ? -l : l,
  39975. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39976. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  39977. n && n.copy(K).multiplyScalar(o).add(Z),
  39978. a
  39979. }
  39980. ),
  39981. intersectSphere: (X = new Ci.Vector3,
  39982. function(e, t) {
  39983. X.subVectors(e.center, this.origin);
  39984. var i = X.dot(this.direction)
  39985. , n = X.dot(X) - i * i
  39986. , r = e.radius * e.radius;
  39987. if (r < n)
  39988. return null;
  39989. var o = Math.sqrt(r - n)
  39990. , a = i - o
  39991. , s = i + o;
  39992. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  39993. }
  39994. ),
  39995. intersectsSphere: function(e) {
  39996. return this.distanceToPoint(e.center) <= e.radius
  39997. },
  39998. distanceToPlane: function(e) {
  39999. var t = e.normal.dot(this.direction);
  40000. if (0 === t)
  40001. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40002. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40003. return 0 <= i ? i : null
  40004. },
  40005. intersectPlane: function(e, t) {
  40006. var i = this.distanceToPlane(e);
  40007. return null === i ? null : this.at(i, t)
  40008. },
  40009. intersectsPlane: function(e) {
  40010. var t = e.distanceToPoint(this.origin);
  40011. return 0 === t || e.normal.dot(this.direction) * t < 0
  40012. },
  40013. intersectBox: function(e, t) {
  40014. 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;
  40015. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40016. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40017. (e.min.x - u.x) * l),
  40018. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40019. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40020. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40021. (o < n || n != n) && (n = o),
  40022. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40023. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40024. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40025. (s < n || n != n) && (n = s),
  40026. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40027. },
  40028. intersectsBox: (q = new Ci.Vector3,
  40029. function(e) {
  40030. return null !== this.intersectBox(e, q)
  40031. }
  40032. ),
  40033. intersectTriangle: (G = new Ci.Vector3,
  40034. W = new Ci.Vector3,
  40035. j = new Ci.Vector3,
  40036. Y = new Ci.Vector3,
  40037. function(e, t, i, n, r) {
  40038. W.subVectors(t, e),
  40039. j.subVectors(i, e),
  40040. Y.crossVectors(W, j);
  40041. var o, a = this.direction.dot(Y);
  40042. if (0 < a) {
  40043. if (n)
  40044. return null;
  40045. o = 1
  40046. } else {
  40047. if (!(a < 0))
  40048. return null;
  40049. o = -1,
  40050. a = -a
  40051. }
  40052. G.subVectors(this.origin, e);
  40053. var s = o * this.direction.dot(j.crossVectors(G, j));
  40054. if (s < 0)
  40055. return null;
  40056. var l = o * this.direction.dot(W.cross(G));
  40057. if (l < 0)
  40058. return null;
  40059. if (a < s + l)
  40060. return null;
  40061. var c = -o * G.dot(Y);
  40062. return c < 0 ? null : this.at(c / a, r)
  40063. }
  40064. ),
  40065. applyMatrix4: function(e) {
  40066. return this.direction.add(this.origin).applyMatrix4(e),
  40067. this.origin.applyMatrix4(e),
  40068. this.direction.sub(this.origin),
  40069. this.direction.normalize(),
  40070. this
  40071. },
  40072. equals: function(e) {
  40073. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40074. }
  40075. },
  40076. Ci.Sphere = function(e, t) {
  40077. this.center = void 0 !== e ? e : new Ci.Vector3,
  40078. this.radius = void 0 !== t ? t : 0
  40079. }
  40080. ,
  40081. Ci.Sphere.prototype = {
  40082. constructor: Ci.Sphere,
  40083. set: function(e, t) {
  40084. return this.center.copy(e),
  40085. this.radius = t,
  40086. this
  40087. },
  40088. setFromPoints: (z = new Ci.Box3,
  40089. function(e, t) {
  40090. var i = this.center;
  40091. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40092. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40093. n = Math.max(n, i.distanceToSquared(e[r]));
  40094. return this.radius = Math.sqrt(n),
  40095. this
  40096. }
  40097. ),
  40098. clone: function() {
  40099. return (new this.constructor).copy(this)
  40100. },
  40101. copy: function(e) {
  40102. return this.center.copy(e.center),
  40103. this.radius = e.radius,
  40104. this
  40105. },
  40106. empty: function() {
  40107. return this.radius <= 0
  40108. },
  40109. containsPoint: function(e) {
  40110. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40111. },
  40112. distanceToPoint: function(e) {
  40113. return e.distanceTo(this.center) - this.radius
  40114. },
  40115. intersectsSphere: function(e) {
  40116. var t = this.radius + e.radius;
  40117. return e.center.distanceToSquared(this.center) <= t * t
  40118. },
  40119. intersectsBox: function(e) {
  40120. return e.intersectsSphere(this)
  40121. },
  40122. intersectsPlane: function(e) {
  40123. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40124. },
  40125. clampPoint: function(e, t) {
  40126. var i = this.center.distanceToSquared(e)
  40127. , n = t || new Ci.Vector3;
  40128. return n.copy(e),
  40129. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40130. n.multiplyScalar(this.radius).add(this.center)),
  40131. n
  40132. },
  40133. getBoundingBox: function(e) {
  40134. var t = e || new Ci.Box3;
  40135. return t.set(this.center, this.center),
  40136. t.expandByScalar(this.radius),
  40137. t
  40138. },
  40139. applyMatrix4: function(e) {
  40140. return this.center.applyMatrix4(e),
  40141. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40142. this
  40143. },
  40144. translate: function(e) {
  40145. return this.center.add(e),
  40146. this
  40147. },
  40148. equals: function(e) {
  40149. return e.center.equals(this.center) && e.radius === this.radius
  40150. }
  40151. },
  40152. Ci.Frustum = function(e, t, i, n, r, o) {
  40153. 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]
  40154. }
  40155. ,
  40156. Ci.Frustum.prototype = {
  40157. constructor: Ci.Frustum,
  40158. set: function(e, t, i, n, r, o) {
  40159. var a = this.planes;
  40160. return a[0].copy(e),
  40161. a[1].copy(t),
  40162. a[2].copy(i),
  40163. a[3].copy(n),
  40164. a[4].copy(r),
  40165. a[5].copy(o),
  40166. this
  40167. },
  40168. clone: function() {
  40169. return (new this.constructor).copy(this)
  40170. },
  40171. copy: function(e) {
  40172. for (var t = this.planes, i = 0; i < 6; i++)
  40173. t[i].copy(e.planes[i]);
  40174. return this
  40175. },
  40176. setFromMatrix: function(e) {
  40177. var t = this.planes
  40178. , i = e.elements
  40179. , n = i[0]
  40180. , r = i[1]
  40181. , o = i[2]
  40182. , a = i[3]
  40183. , s = i[4]
  40184. , l = i[5]
  40185. , c = i[6]
  40186. , h = i[7]
  40187. , u = i[8]
  40188. , d = i[9]
  40189. , p = i[10]
  40190. , f = i[11]
  40191. , g = i[12]
  40192. , m = i[13]
  40193. , v = i[14]
  40194. , y = i[15];
  40195. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40196. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40197. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40198. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40199. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40200. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40201. this
  40202. },
  40203. intersectsObject: (H = new Ci.Sphere,
  40204. function(e) {
  40205. var t = e.geometry;
  40206. return null === t.boundingSphere && t.computeBoundingSphere(),
  40207. H.copy(t.boundingSphere),
  40208. H.applyMatrix4(e.matrixWorld),
  40209. this.intersectsSphere(H)
  40210. }
  40211. ),
  40212. intersectsSphere: function(e) {
  40213. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40214. if (t[r].distanceToPoint(i) < n)
  40215. return !1
  40216. }
  40217. return !0
  40218. },
  40219. intersectsBox: (k = new Ci.Vector3,
  40220. U = new Ci.Vector3,
  40221. function(e) {
  40222. for (var t = this.planes, i = 0; i < 6; i++) {
  40223. var n = t[i];
  40224. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40225. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40226. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40227. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40228. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40229. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40230. var r = n.distanceToPoint(k)
  40231. , o = n.distanceToPoint(U);
  40232. if (r < 0 && o < 0)
  40233. return !1
  40234. }
  40235. return !0
  40236. }
  40237. ),
  40238. containsPoint: function(e) {
  40239. for (var t = this.planes, i = 0; i < 6; i++)
  40240. if (t[i].distanceToPoint(e) < 0)
  40241. return !1;
  40242. return !0
  40243. }
  40244. },
  40245. Ci.Plane = function(e, t) {
  40246. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40247. this.constant = void 0 !== t ? t : 0
  40248. }
  40249. ,
  40250. Ci.Plane.prototype = {
  40251. constructor: Ci.Plane,
  40252. set: function(e, t) {
  40253. return this.normal.copy(e),
  40254. this.constant = t,
  40255. this
  40256. },
  40257. setComponents: function(e, t, i, n) {
  40258. return this.normal.set(e, t, i),
  40259. this.constant = n,
  40260. this
  40261. },
  40262. setFromNormalAndCoplanarPoint: function(e, t) {
  40263. return this.normal.copy(e),
  40264. this.constant = -t.dot(this.normal),
  40265. this
  40266. },
  40267. setFromCoplanarPoints: (B = new Ci.Vector3,
  40268. V = new Ci.Vector3,
  40269. function(e, t, i) {
  40270. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40271. return this.setFromNormalAndCoplanarPoint(n, e),
  40272. this
  40273. }
  40274. ),
  40275. clone: function() {
  40276. return (new this.constructor).copy(this)
  40277. },
  40278. copy: function(e) {
  40279. return this.normal.copy(e.normal),
  40280. this.constant = e.constant,
  40281. this
  40282. },
  40283. normalize: function() {
  40284. var e = 1 / this.normal.length();
  40285. return this.normal.multiplyScalar(e),
  40286. this.constant *= e,
  40287. this
  40288. },
  40289. negate: function() {
  40290. return this.constant *= -1,
  40291. this.normal.negate(),
  40292. this
  40293. },
  40294. distanceToPoint: function(e) {
  40295. return this.normal.dot(e) + this.constant
  40296. },
  40297. distanceToSphere: function(e) {
  40298. return this.distanceToPoint(e.center) - e.radius
  40299. },
  40300. projectPoint: function(e, t) {
  40301. return this.orthoPoint(e, t).sub(e).negate()
  40302. },
  40303. orthoPoint: function(e, t) {
  40304. var i = this.distanceToPoint(e);
  40305. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40306. },
  40307. intersectLine: (F = new Ci.Vector3,
  40308. function(e, t) {
  40309. var i = t || new Ci.Vector3
  40310. , n = e.delta(F)
  40311. , r = this.normal.dot(n);
  40312. if (0 !== r) {
  40313. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40314. if (!(o < 0 || 1 < o))
  40315. return i.copy(n).multiplyScalar(o).add(e.start)
  40316. } else if (0 === this.distanceToPoint(e.start))
  40317. return i.copy(e.start)
  40318. }
  40319. ),
  40320. intersectsLine: function(e) {
  40321. var t = this.distanceToPoint(e.start)
  40322. , i = this.distanceToPoint(e.end);
  40323. return t < 0 && 0 < i || i < 0 && 0 < t
  40324. },
  40325. intersectsBox: function(e) {
  40326. return e.intersectsPlane(this)
  40327. },
  40328. intersectsSphere: function(e) {
  40329. return e.intersectsPlane(this)
  40330. },
  40331. coplanarPoint: function(e) {
  40332. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40333. },
  40334. applyMatrix4: (L = new Ci.Vector3,
  40335. D = new Ci.Vector3,
  40336. N = new Ci.Matrix3,
  40337. function(e, t) {
  40338. var i = t || N.getNormalMatrix(e)
  40339. , n = L.copy(this.normal).applyMatrix3(i)
  40340. , r = this.coplanarPoint(D);
  40341. return r.applyMatrix4(e),
  40342. this.setFromNormalAndCoplanarPoint(n, r),
  40343. this
  40344. }
  40345. ),
  40346. translate: function(e) {
  40347. return this.constant = this.constant - e.dot(this.normal),
  40348. this
  40349. },
  40350. equals: function(e) {
  40351. return e.normal.equals(this.normal) && e.constant === this.constant
  40352. }
  40353. },
  40354. Ci.Spherical = function(e, t, i) {
  40355. return this.radius = void 0 !== e ? e : 1,
  40356. this.phi = void 0 !== t ? t : 0,
  40357. this.theta = void 0 !== i ? i : 0,
  40358. this
  40359. }
  40360. ,
  40361. Ci.Spherical.prototype = {
  40362. constructor: Ci.Spherical,
  40363. set: function(e, t, i) {
  40364. this.radius = e,
  40365. this.phi = t,
  40366. this.theta = i
  40367. },
  40368. clone: function() {
  40369. return (new this.constructor).copy(this)
  40370. },
  40371. copy: function(e) {
  40372. return this.radius.copy(e.radius),
  40373. this.phi.copy(e.phi),
  40374. this.theta.copy(e.theta),
  40375. this
  40376. },
  40377. makeSafe: function() {
  40378. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40379. },
  40380. setFromVector3: function(e) {
  40381. return this.radius = e.length(),
  40382. 0 === this.radius ? (this.theta = 0,
  40383. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40384. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40385. this
  40386. }
  40387. },
  40388. Ci.Math = {
  40389. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40390. P = new Array(36),
  40391. O = 0,
  40392. function() {
  40393. for (var e = 0; e < 36; e++)
  40394. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40395. M = 15 & O,
  40396. O >>= 4,
  40397. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40398. return P.join("")
  40399. }
  40400. ),
  40401. clamp: function(e, t, i) {
  40402. return Math.max(t, Math.min(i, e))
  40403. },
  40404. euclideanModulo: function(e, t) {
  40405. return (e % t + t) % t
  40406. },
  40407. mapLinear: function(e, t, i, n, r) {
  40408. return n + (e - t) * (r - n) / (i - t)
  40409. },
  40410. smoothstep: function(e, t, i) {
  40411. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40412. },
  40413. smootherstep: function(e, t, i) {
  40414. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40415. },
  40416. random16: function() {
  40417. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40418. Math.random()
  40419. },
  40420. randInt: function(e, t) {
  40421. return e + Math.floor(Math.random() * (t - e + 1))
  40422. },
  40423. randFloat: function(e, t) {
  40424. return e + Math.random() * (t - e)
  40425. },
  40426. randFloatSpread: function(e) {
  40427. return e * (.5 - Math.random())
  40428. },
  40429. degToRad: (S = Math.PI / 180,
  40430. function(e) {
  40431. return e * S
  40432. }
  40433. ),
  40434. radToDeg: (x = 180 / Math.PI,
  40435. function(e) {
  40436. return e * x
  40437. }
  40438. ),
  40439. isPowerOfTwo: function(e) {
  40440. return 0 == (e & e - 1) && 0 !== e
  40441. },
  40442. nearestPowerOfTwo: function(e) {
  40443. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40444. },
  40445. nextPowerOfTwo: function(e) {
  40446. return e--,
  40447. e |= e >> 1,
  40448. e |= e >> 2,
  40449. e |= e >> 4,
  40450. e |= e >> 8,
  40451. e |= e >> 16,
  40452. ++e
  40453. }
  40454. },
  40455. Ci.Spline = function(e) {
  40456. function t(e, t, i, n, r, o, a) {
  40457. var s = .5 * (i - e)
  40458. , l = .5 * (n - t);
  40459. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40460. }
  40461. this.points = e;
  40462. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40463. x: 0,
  40464. y: 0,
  40465. z: 0
  40466. };
  40467. this.initFromArray = function(e) {
  40468. this.points = [];
  40469. for (var t = 0; t < e.length; t++)
  40470. this.points[t] = {
  40471. x: e[t][0],
  40472. y: e[t][1],
  40473. z: e[t][2]
  40474. }
  40475. }
  40476. ,
  40477. this.getPoint = function(e) {
  40478. return i = (this.points.length - 1) * e,
  40479. n = Math.floor(i),
  40480. r = i - n,
  40481. u[0] = 0 === n ? n : n - 1,
  40482. u[1] = n,
  40483. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40484. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40485. s = this.points[u[0]],
  40486. l = this.points[u[1]],
  40487. c = this.points[u[2]],
  40488. h = this.points[u[3]],
  40489. a = r * (o = r * r),
  40490. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40491. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40492. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40493. d
  40494. }
  40495. ,
  40496. this.getControlPointsArray = function() {
  40497. var e, t, i = this.points.length, n = [];
  40498. for (e = 0; e < i; e++)
  40499. t = this.points[e],
  40500. n[e] = [t.x, t.y, t.z];
  40501. return n
  40502. }
  40503. ,
  40504. this.getLength = function(e) {
  40505. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40506. for (h[0] = 0,
  40507. e = e || 100,
  40508. n = this.points.length * e,
  40509. l.copy(this.points[0]),
  40510. t = 1; t < n; t++)
  40511. i = t / n,
  40512. r = this.getPoint(i),
  40513. c.copy(r),
  40514. u += c.distanceTo(l),
  40515. l.copy(r),
  40516. o = (this.points.length - 1) * i,
  40517. (a = Math.floor(o)) !== s && (h[a] = u,
  40518. s = a);
  40519. return h[h.length] = u,
  40520. {
  40521. chunks: h,
  40522. total: u
  40523. }
  40524. }
  40525. ,
  40526. this.reparametrizeByArcLength = function(e) {
  40527. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40528. for (c.push(h.copy(this.points[0]).clone()),
  40529. t = 1; t < this.points.length; t++) {
  40530. for (a = u.chunks[t] - u.chunks[t - 1],
  40531. s = Math.ceil(e * a / u.total),
  40532. r = (t - 1) / (this.points.length - 1),
  40533. o = t / (this.points.length - 1),
  40534. i = 1; i < s - 1; i++)
  40535. n = r + i * (1 / s) * (o - r),
  40536. l = this.getPoint(n),
  40537. c.push(h.copy(l).clone());
  40538. c.push(h.copy(this.points[t]).clone())
  40539. }
  40540. this.points = c
  40541. }
  40542. }
  40543. ,
  40544. Ci.Triangle = function(e, t, i) {
  40545. this.a = void 0 !== e ? e : new Ci.Vector3,
  40546. this.b = void 0 !== t ? t : new Ci.Vector3,
  40547. this.c = void 0 !== i ? i : new Ci.Vector3
  40548. }
  40549. ,
  40550. Ci.Triangle.normal = (T = new Ci.Vector3,
  40551. function(e, t, i, n) {
  40552. var r = n || new Ci.Vector3;
  40553. r.subVectors(i, t),
  40554. T.subVectors(e, t),
  40555. r.cross(T);
  40556. var o = r.lengthSq();
  40557. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40558. }
  40559. ),
  40560. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40561. b = new Ci.Vector3,
  40562. w = new Ci.Vector3,
  40563. function(e, t, i, n, r) {
  40564. _.subVectors(n, t),
  40565. b.subVectors(i, t),
  40566. w.subVectors(e, t);
  40567. var o = _.dot(_)
  40568. , a = _.dot(b)
  40569. , s = _.dot(w)
  40570. , l = b.dot(b)
  40571. , c = b.dot(w)
  40572. , h = o * l - a * a
  40573. , u = r || new Ci.Vector3;
  40574. if (0 == h)
  40575. return u.set(-2, -1, -1);
  40576. var d = 1 / h
  40577. , p = (l * s - a * c) * d
  40578. , f = (o * c - a * s) * d;
  40579. return u.set(1 - p - f, f, p)
  40580. }
  40581. ),
  40582. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40583. function(e, t, i, n) {
  40584. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40585. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40586. }
  40587. ),
  40588. Ci.Triangle.prototype = {
  40589. constructor: Ci.Triangle,
  40590. set: function(e, t, i) {
  40591. return this.a.copy(e),
  40592. this.b.copy(t),
  40593. this.c.copy(i),
  40594. this
  40595. },
  40596. setFromPointsAndIndices: function(e, t, i, n) {
  40597. return this.a.copy(e[t]),
  40598. this.b.copy(e[i]),
  40599. this.c.copy(e[n]),
  40600. this
  40601. },
  40602. clone: function() {
  40603. return (new this.constructor).copy(this)
  40604. },
  40605. copy: function(e) {
  40606. return this.a.copy(e.a),
  40607. this.b.copy(e.b),
  40608. this.c.copy(e.c),
  40609. this
  40610. },
  40611. area: (C = new Ci.Vector3,
  40612. I = new Ci.Vector3,
  40613. function() {
  40614. return C.subVectors(this.c, this.b),
  40615. I.subVectors(this.a, this.b),
  40616. .5 * C.cross(I).length()
  40617. }
  40618. ),
  40619. midpoint: function(e) {
  40620. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40621. },
  40622. normal: function(e) {
  40623. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40624. },
  40625. plane: function(e) {
  40626. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40627. },
  40628. barycoordFromPoint: function(e, t) {
  40629. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40630. },
  40631. containsPoint: function(e) {
  40632. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40633. },
  40634. equals: function(e) {
  40635. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40636. }
  40637. },
  40638. Ci.Interpolant = function(e, t, i, n) {
  40639. this.parameterPositions = e,
  40640. this._cachedIndex = 0,
  40641. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40642. this.sampleValues = t,
  40643. this.valueSize = i
  40644. }
  40645. ,
  40646. Ci.Interpolant.prototype = {
  40647. constructor: Ci.Interpolant,
  40648. evaluate: function(e) {
  40649. var t = this.parameterPositions
  40650. , i = this._cachedIndex
  40651. , n = t[i]
  40652. , r = t[i - 1];
  40653. e: {
  40654. t: {
  40655. var o;
  40656. i: {
  40657. n: if (!(e < n)) {
  40658. for (var a = i + 2; ; ) {
  40659. if (void 0 === n) {
  40660. if (e < r)
  40661. break n;
  40662. return i = t.length,
  40663. this._cachedIndex = i,
  40664. this.afterEnd_(i - 1, e, r)
  40665. }
  40666. if (i === a)
  40667. break;
  40668. if (r = n,
  40669. e < (n = t[++i]))
  40670. break t
  40671. }
  40672. o = t.length;
  40673. break i
  40674. }
  40675. if (r <= e)
  40676. break e;
  40677. var s = t[1];
  40678. e < s && (i = 2,
  40679. r = s);
  40680. for (a = i - 2; ; ) {
  40681. if (void 0 === r)
  40682. return this._cachedIndex = 0,
  40683. this.beforeStart_(0, e, n);
  40684. if (i === a)
  40685. break;
  40686. if (n = r,
  40687. (r = t[--i - 1]) <= e)
  40688. break t
  40689. }
  40690. o = i,
  40691. i = 0
  40692. }
  40693. for (; i < o; ) {
  40694. var l = i + o >>> 1;
  40695. e < t[l] ? o = l : i = 1 + l
  40696. }
  40697. if (n = t[i],
  40698. void 0 === (r = t[i - 1]))
  40699. return this._cachedIndex = 0,
  40700. this.beforeStart_(0, e, n);
  40701. if (void 0 === n)
  40702. return i = t.length,
  40703. this._cachedIndex = i,
  40704. this.afterEnd_(i - 1, r, e)
  40705. }
  40706. this._cachedIndex = i,
  40707. this.intervalChanged_(i, r, n)
  40708. }
  40709. return this.interpolate_(i, r, e, n)
  40710. },
  40711. settings: null,
  40712. DefaultSettings_: {},
  40713. getSettings_: function() {
  40714. return this.settings || this.DefaultSettings_
  40715. },
  40716. copySampleValue_: function(e) {
  40717. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40718. t[o] = i[r + o];
  40719. return t
  40720. },
  40721. interpolate_: function(e, t, i, n) {
  40722. throw new Error("call to abstract method")
  40723. },
  40724. intervalChanged_: function(e, t, i) {}
  40725. },
  40726. Object.assign(Ci.Interpolant.prototype, {
  40727. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40728. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40729. }),
  40730. Ci.CubicInterpolant = function(e, t, i, n) {
  40731. Ci.Interpolant.call(this, e, t, i, n),
  40732. this._weightPrev = -0,
  40733. this._offsetPrev = -0,
  40734. this._weightNext = -0,
  40735. this._offsetNext = -0
  40736. }
  40737. ,
  40738. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40739. constructor: Ci.CubicInterpolant,
  40740. DefaultSettings_: {
  40741. endingStart: Ci.ZeroCurvatureEnding,
  40742. endingEnd: Ci.ZeroCurvatureEnding
  40743. },
  40744. intervalChanged_: function(e, t, i) {
  40745. var n = this.parameterPositions
  40746. , r = e - 2
  40747. , o = e + 1
  40748. , a = n[r]
  40749. , s = n[o];
  40750. if (void 0 === a)
  40751. switch (this.getSettings_().endingStart) {
  40752. case Ci.ZeroSlopeEnding:
  40753. r = e,
  40754. a = 2 * t - i;
  40755. break;
  40756. case Ci.WrapAroundEnding:
  40757. a = t + n[r = n.length - 2] - n[r + 1];
  40758. break;
  40759. default:
  40760. r = e,
  40761. a = i
  40762. }
  40763. if (void 0 === s)
  40764. switch (this.getSettings_().endingEnd) {
  40765. case Ci.ZeroSlopeEnding:
  40766. o = e,
  40767. s = 2 * i - t;
  40768. break;
  40769. case Ci.WrapAroundEnding:
  40770. s = i + n[o = 1] - n[0];
  40771. break;
  40772. default:
  40773. o = e - 1,
  40774. s = t
  40775. }
  40776. var l = .5 * (i - t)
  40777. , c = this.valueSize;
  40778. this._weightPrev = l / (t - a),
  40779. this._weightNext = l / (s - i),
  40780. this._offsetPrev = r * c,
  40781. this._offsetNext = o * c
  40782. },
  40783. interpolate_: function(e, t, i, n) {
  40784. 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)
  40785. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  40786. return r
  40787. }
  40788. }),
  40789. Ci.DiscreteInterpolant = function(e, t, i, n) {
  40790. Ci.Interpolant.call(this, e, t, i, n)
  40791. }
  40792. ,
  40793. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40794. constructor: Ci.DiscreteInterpolant,
  40795. interpolate_: function(e, t, i, n) {
  40796. return this.copySampleValue_(e - 1)
  40797. }
  40798. }),
  40799. Ci.LinearInterpolant = function(e, t, i, n) {
  40800. Ci.Interpolant.call(this, e, t, i, n)
  40801. }
  40802. ,
  40803. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40804. constructor: Ci.LinearInterpolant,
  40805. interpolate_: function(e, t, i, n) {
  40806. 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)
  40807. r[u] = o[l + u] * h + o[s + u] * c;
  40808. return r
  40809. }
  40810. }),
  40811. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  40812. Ci.Interpolant.call(this, e, t, i, n)
  40813. }
  40814. ,
  40815. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40816. constructor: Ci.QuaternionLinearInterpolant,
  40817. interpolate_: function(e, t, i, n) {
  40818. 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)
  40819. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  40820. return r
  40821. }
  40822. }),
  40823. Ci.Clock = function(e) {
  40824. this.autoStart = void 0 === e || e,
  40825. this.startTime = 0,
  40826. this.oldTime = 0,
  40827. this.elapsedTime = 0,
  40828. this.running = !1
  40829. }
  40830. ,
  40831. Ci.Clock.prototype = {
  40832. constructor: Ci.Clock,
  40833. start: function() {
  40834. this.startTime = performance.now(),
  40835. this.oldTime = this.startTime,
  40836. this.running = !0
  40837. },
  40838. stop: function() {
  40839. this.getElapsedTime(),
  40840. this.running = !1
  40841. },
  40842. getElapsedTime: function() {
  40843. return this.getDelta(),
  40844. this.elapsedTime
  40845. },
  40846. getDelta: function() {
  40847. var e = 0;
  40848. if (this.autoStart && !this.running && this.start(),
  40849. this.running) {
  40850. var t = performance.now();
  40851. e = .001 * (t - this.oldTime),
  40852. this.oldTime = t,
  40853. this.elapsedTime += e
  40854. }
  40855. return e
  40856. }
  40857. },
  40858. Ci.EventDispatcher = function() {}
  40859. ,
  40860. Ci.EventDispatcher.prototype = {
  40861. constructor: Ci.EventDispatcher,
  40862. apply: function(e) {
  40863. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  40864. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  40865. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  40866. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  40867. },
  40868. addEventListener: function(e, t) {
  40869. void 0 === this._listeners && (this._listeners = {});
  40870. var i = this._listeners;
  40871. void 0 === i[e] && (i[e] = []),
  40872. -1 === i[e].indexOf(t) && i[e].push(t)
  40873. },
  40874. hasEventListener: function(e, t) {
  40875. if (void 0 === this._listeners)
  40876. return !1;
  40877. var i = this._listeners;
  40878. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  40879. },
  40880. removeEventListener: function(e, t) {
  40881. if (void 0 !== this._listeners) {
  40882. var i = this._listeners[e];
  40883. if (void 0 !== i) {
  40884. var n = i.indexOf(t);
  40885. -1 !== n && i.splice(n, 1)
  40886. }
  40887. }
  40888. },
  40889. dispatchEvent: function(e) {
  40890. if (void 0 !== this._listeners) {
  40891. var t = this._listeners[e.type];
  40892. if (void 0 !== t) {
  40893. e.target = this;
  40894. for (var i = [], n = t.length, r = 0; r < n; r++)
  40895. i[r] = t[r];
  40896. for (r = 0; r < n; r++)
  40897. i[r].call(this, e)
  40898. }
  40899. }
  40900. }
  40901. },
  40902. Ci.Layers = function() {
  40903. this.mask = 1
  40904. }
  40905. ,
  40906. Ci.Layers.prototype = {
  40907. constructor: Ci.Layers,
  40908. set: function(e) {
  40909. this.mask = 1 << e
  40910. },
  40911. enable: function(e) {
  40912. this.mask |= 1 << e
  40913. },
  40914. toggle: function(e) {
  40915. this.mask ^= 1 << e
  40916. },
  40917. disable: function(e) {
  40918. this.mask &= ~(1 << e)
  40919. },
  40920. test: function(e) {
  40921. return 0 != (this.mask & e.mask)
  40922. }
  40923. },
  40924. (A = Ci).Raycaster = function(e, t, i, n) {
  40925. this.ray = new A.Ray(e,t),
  40926. this.near = i || 0,
  40927. this.far = n || 1 / 0,
  40928. this.params = {
  40929. Mesh: {},
  40930. Line: {},
  40931. LOD: {},
  40932. Points: {
  40933. threshold: 1
  40934. },
  40935. Sprite: {}
  40936. },
  40937. Object.defineProperties(this.params, {
  40938. PointCloud: {
  40939. get: function() {
  40940. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  40941. this.Points
  40942. }
  40943. }
  40944. })
  40945. }
  40946. ,
  40947. A.Raycaster.prototype = {
  40948. constructor: A.Raycaster,
  40949. linePrecision: 1,
  40950. set: function(e, t) {
  40951. this.ray.set(e, t)
  40952. },
  40953. setFromCamera: function(e, t) {
  40954. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  40955. 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),
  40956. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  40957. },
  40958. intersectObject: function(e, t) {
  40959. var i = [];
  40960. return Ei(e, this, i, t),
  40961. i.sort(Ii),
  40962. i
  40963. },
  40964. intersectObjects: function(e, t) {
  40965. var i = [];
  40966. if (!1 === Array.isArray(e))
  40967. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  40968. i;
  40969. for (var n = 0, r = e.length; n < r; n++)
  40970. Ei(e[n], this, i, t);
  40971. return i.sort(Ii),
  40972. i
  40973. }
  40974. },
  40975. Ci.Object3D = function() {
  40976. Object.defineProperty(this, "id", {
  40977. value: Ci.Object3DIdCount++
  40978. }),
  40979. this.uuid = Ci.Math.generateUUID(),
  40980. this.name = "",
  40981. this.type = "Object3D",
  40982. this.parent = null,
  40983. this.children = [],
  40984. this.up = Ci.Object3D.DefaultUp.clone();
  40985. var e = new Ci.Vector3
  40986. , t = new Ci.Euler
  40987. , i = new Ci.Quaternion
  40988. , n = new Ci.Vector3(1,1,1);
  40989. t.onChange(function() {
  40990. i.setFromEuler(t, !1)
  40991. }),
  40992. i.onChange(function() {
  40993. t.setFromQuaternion(i, void 0, !1)
  40994. }),
  40995. Object.defineProperties(this, {
  40996. position: {
  40997. enumerable: !0,
  40998. value: e
  40999. },
  41000. rotation: {
  41001. enumerable: !0,
  41002. value: t
  41003. },
  41004. quaternion: {
  41005. enumerable: !0,
  41006. value: i
  41007. },
  41008. scale: {
  41009. enumerable: !0,
  41010. value: n
  41011. },
  41012. modelViewMatrix: {
  41013. value: new Ci.Matrix4
  41014. },
  41015. normalMatrix: {
  41016. value: new Ci.Matrix3
  41017. }
  41018. }),
  41019. this.rotationAutoUpdate = !0,
  41020. this.matrix = new Ci.Matrix4,
  41021. this.matrixWorld = new Ci.Matrix4,
  41022. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41023. this.matrixWorldNeedsUpdate = !1,
  41024. this.layers = new Ci.Layers,
  41025. this.visible = !0,
  41026. this.castShadow = !1,
  41027. this.receiveShadow = !1,
  41028. this.frustumCulled = !0,
  41029. this.renderOrder = 0,
  41030. this.userData = {}
  41031. }
  41032. ,
  41033. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41034. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41035. Ci.Object3D.prototype = {
  41036. constructor: Ci.Object3D,
  41037. applyMatrix: function(e) {
  41038. this.matrix.multiplyMatrices(e, this.matrix),
  41039. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41040. },
  41041. setRotationFromAxisAngle: function(e, t) {
  41042. this.quaternion.setFromAxisAngle(e, t)
  41043. },
  41044. setRotationFromEuler: function(e) {
  41045. this.quaternion.setFromEuler(e, !0)
  41046. },
  41047. setRotationFromMatrix: function(e) {
  41048. this.quaternion.setFromRotationMatrix(e)
  41049. },
  41050. setRotationFromQuaternion: function(e) {
  41051. this.quaternion.copy(e)
  41052. },
  41053. rotateOnAxis: (y = new Ci.Quaternion,
  41054. function(e, t) {
  41055. return y.setFromAxisAngle(e, t),
  41056. this.quaternion.multiply(y),
  41057. this
  41058. }
  41059. ),
  41060. rotateX: (v = new Ci.Vector3(1,0,0),
  41061. function(e) {
  41062. return this.rotateOnAxis(v, e)
  41063. }
  41064. ),
  41065. rotateY: (m = new Ci.Vector3(0,1,0),
  41066. function(e) {
  41067. return this.rotateOnAxis(m, e)
  41068. }
  41069. ),
  41070. rotateZ: (g = new Ci.Vector3(0,0,1),
  41071. function(e) {
  41072. return this.rotateOnAxis(g, e)
  41073. }
  41074. ),
  41075. translateOnAxis: (f = new Ci.Vector3,
  41076. function(e, t) {
  41077. return f.copy(e).applyQuaternion(this.quaternion),
  41078. this.position.add(f.multiplyScalar(t)),
  41079. this
  41080. }
  41081. ),
  41082. translateX: (p = new Ci.Vector3(1,0,0),
  41083. function(e) {
  41084. return this.translateOnAxis(p, e)
  41085. }
  41086. ),
  41087. translateY: (d = new Ci.Vector3(0,1,0),
  41088. function(e) {
  41089. return this.translateOnAxis(d, e)
  41090. }
  41091. ),
  41092. translateZ: (u = new Ci.Vector3(0,0,1),
  41093. function(e) {
  41094. return this.translateOnAxis(u, e)
  41095. }
  41096. ),
  41097. localToWorld: function(e) {
  41098. return e.applyMatrix4(this.matrixWorld)
  41099. },
  41100. worldToLocal: (h = new Ci.Matrix4,
  41101. function(e) {
  41102. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41103. }
  41104. ),
  41105. lookAt: (c = new Ci.Matrix4,
  41106. function(e) {
  41107. c.lookAt(e, this.position, this.up),
  41108. this.quaternion.setFromRotationMatrix(c)
  41109. }
  41110. ),
  41111. add: function(e) {
  41112. if (1 < arguments.length) {
  41113. for (var t = 0; t < arguments.length; t++)
  41114. this.add(arguments[t]);
  41115. return this
  41116. }
  41117. 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),
  41118. e.parent = this,
  41119. e.dispatchEvent({
  41120. type: "added"
  41121. }),
  41122. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41123. this
  41124. },
  41125. remove: function(e) {
  41126. if (1 < arguments.length)
  41127. for (var t = 0; t < arguments.length; t++)
  41128. this.remove(arguments[t]);
  41129. var i = this.children.indexOf(e);
  41130. -1 !== i && (e.parent = null,
  41131. e.dispatchEvent({
  41132. type: "removed"
  41133. }),
  41134. this.children.splice(i, 1))
  41135. },
  41136. getObjectById: function(e) {
  41137. return this.getObjectByProperty("id", e)
  41138. },
  41139. getObjectByName: function(e) {
  41140. return this.getObjectByProperty("name", e)
  41141. },
  41142. getObjectByProperty: function(e, t) {
  41143. if (this[e] === t)
  41144. return this;
  41145. for (var i = 0, n = this.children.length; i < n; i++) {
  41146. var r = this.children[i].getObjectByProperty(e, t);
  41147. if (void 0 !== r)
  41148. return r
  41149. }
  41150. },
  41151. getWorldPosition: function(e) {
  41152. var t = e || new Ci.Vector3;
  41153. return this.updateMatrixWorld(!0),
  41154. t.setFromMatrixPosition(this.matrixWorld)
  41155. },
  41156. getWorldQuaternion: (s = new Ci.Vector3,
  41157. l = new Ci.Vector3,
  41158. function(e) {
  41159. var t = e || new Ci.Quaternion;
  41160. return this.updateMatrixWorld(!0),
  41161. this.matrixWorld.decompose(s, t, l),
  41162. t
  41163. }
  41164. ),
  41165. getWorldRotation: (a = new Ci.Quaternion,
  41166. function(e) {
  41167. var t = e || new Ci.Euler;
  41168. return this.getWorldQuaternion(a),
  41169. t.setFromQuaternion(a, this.rotation.order, !1)
  41170. }
  41171. ),
  41172. getWorldScale: (r = new Ci.Vector3,
  41173. o = new Ci.Quaternion,
  41174. function(e) {
  41175. var t = e || new Ci.Vector3;
  41176. return this.updateMatrixWorld(!0),
  41177. this.matrixWorld.decompose(r, o, t),
  41178. t
  41179. }
  41180. ),
  41181. getWorldDirection: (n = new Ci.Quaternion,
  41182. function(e) {
  41183. var t = e || new Ci.Vector3;
  41184. return this.getWorldQuaternion(n),
  41185. t.set(0, 0, 1).applyQuaternion(n)
  41186. }
  41187. ),
  41188. raycast: function() {},
  41189. traverse: function(e) {
  41190. e(this);
  41191. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41192. t[i].traverse(e)
  41193. },
  41194. traverseVisible: function(e) {
  41195. if (!1 !== this.visible) {
  41196. e(this);
  41197. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41198. t[i].traverseVisible(e)
  41199. }
  41200. },
  41201. traverseAncestors: function(e) {
  41202. var t = this.parent;
  41203. null !== t && (e(t),
  41204. t.traverseAncestors(e))
  41205. },
  41206. updateMatrix: function() {
  41207. this.matrix.compose(this.position, this.quaternion, this.scale),
  41208. this.matrixWorldNeedsUpdate = !0
  41209. },
  41210. updateMatrixWorld: function(e) {
  41211. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41212. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41213. e = !(this.matrixWorldNeedsUpdate = !1));
  41214. for (var t = 0, i = this.children.length; t < i; t++)
  41215. this.children[t].updateMatrixWorld(e)
  41216. },
  41217. toJSON: function(e) {
  41218. function t(e) {
  41219. var t = [];
  41220. for (var i in e) {
  41221. var n = e[i];
  41222. delete n.metadata,
  41223. t.push(n)
  41224. }
  41225. return t
  41226. }
  41227. var i = void 0 === e
  41228. , n = {};
  41229. i && (e = {
  41230. geometries: {},
  41231. materials: {},
  41232. textures: {},
  41233. images: {}
  41234. },
  41235. n.metadata = {
  41236. version: 4.4,
  41237. type: "Object",
  41238. generator: "Object3D.toJSON"
  41239. });
  41240. var r = {};
  41241. if (r.uuid = this.uuid,
  41242. r.type = this.type,
  41243. "" !== this.name && (r.name = this.name),
  41244. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41245. !0 === this.castShadow && (r.castShadow = !0),
  41246. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41247. !1 === this.visible && (r.visible = !1),
  41248. r.matrix = this.matrix.toArray(),
  41249. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41250. r.geometry = this.geometry.uuid),
  41251. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41252. r.material = this.material.uuid),
  41253. 0 < this.children.length) {
  41254. r.children = [];
  41255. for (var o = 0; o < this.children.length; o++)
  41256. r.children.push(this.children[o].toJSON(e).object)
  41257. }
  41258. if (i) {
  41259. var a = t(e.geometries)
  41260. , s = t(e.materials)
  41261. , l = t(e.textures)
  41262. , c = t(e.images);
  41263. 0 < a.length && (n.geometries = a),
  41264. 0 < s.length && (n.materials = s),
  41265. 0 < l.length && (n.textures = l),
  41266. 0 < c.length && (n.images = c)
  41267. }
  41268. return n.object = r,
  41269. n
  41270. },
  41271. clone: function(e) {
  41272. return (new this.constructor).copy(this, e)
  41273. },
  41274. copy: function(e, t) {
  41275. if (void 0 === t && (t = !0),
  41276. this.name = e.name,
  41277. this.up.copy(e.up),
  41278. this.position.copy(e.position),
  41279. this.quaternion.copy(e.quaternion),
  41280. this.scale.copy(e.scale),
  41281. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41282. this.matrix.copy(e.matrix),
  41283. this.matrixWorld.copy(e.matrixWorld),
  41284. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41285. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41286. this.visible = e.visible,
  41287. this.castShadow = e.castShadow,
  41288. this.receiveShadow = e.receiveShadow,
  41289. this.frustumCulled = e.frustumCulled,
  41290. this.renderOrder = e.renderOrder,
  41291. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41292. !0 === t)
  41293. for (var i = 0; i < e.children.length; i++) {
  41294. var n = e.children[i];
  41295. this.add(n.clone())
  41296. }
  41297. return this
  41298. }
  41299. },
  41300. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41301. Ci.Object3DIdCount = 0,
  41302. Ci.Face3 = function(e, t, i, n, r, o) {
  41303. this.a = e,
  41304. this.b = t,
  41305. this.c = i,
  41306. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41307. this.vertexNormals = Array.isArray(n) ? n : [],
  41308. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41309. this.vertexColors = Array.isArray(r) ? r : [],
  41310. this.materialIndex = void 0 !== o ? o : 0
  41311. }
  41312. ,
  41313. Ci.Face3.prototype = {
  41314. constructor: Ci.Face3,
  41315. clone: function() {
  41316. return (new this.constructor).copy(this)
  41317. },
  41318. copy: function(e) {
  41319. this.a = e.a,
  41320. this.b = e.b,
  41321. this.c = e.c,
  41322. this.normal.copy(e.normal),
  41323. this.color.copy(e.color),
  41324. this.materialIndex = e.materialIndex;
  41325. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41326. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41327. for (t = 0,
  41328. i = e.vertexColors.length; t < i; t++)
  41329. this.vertexColors[t] = e.vertexColors[t].clone();
  41330. return this
  41331. }
  41332. },
  41333. Ci.BufferAttribute = function(e, t) {
  41334. this.uuid = Ci.Math.generateUUID(),
  41335. this.array = e,
  41336. this.itemSize = t,
  41337. this.dynamic = !1,
  41338. this.updateRange = {
  41339. offset: 0,
  41340. count: -1
  41341. },
  41342. this.version = 0
  41343. }
  41344. ,
  41345. Ci.BufferAttribute.prototype = {
  41346. constructor: Ci.BufferAttribute,
  41347. get count() {
  41348. return this.array.length / this.itemSize
  41349. },
  41350. set needsUpdate(e) {
  41351. !0 === e && this.version++
  41352. },
  41353. setDynamic: function(e) {
  41354. return this.dynamic = e,
  41355. this
  41356. },
  41357. copy: function(e) {
  41358. return this.array = new e.array.constructor(e.array),
  41359. this.itemSize = e.itemSize,
  41360. this.dynamic = e.dynamic,
  41361. this
  41362. },
  41363. copyAt: function(e, t, i) {
  41364. e *= this.itemSize,
  41365. i *= t.itemSize;
  41366. for (var n = 0, r = this.itemSize; n < r; n++)
  41367. this.array[e + n] = t.array[i + n];
  41368. return this
  41369. },
  41370. copyArray: function(e) {
  41371. return this.array.set(e),
  41372. this
  41373. },
  41374. copyColorsArray: function(e) {
  41375. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41376. var o = e[n];
  41377. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41378. o = new Ci.Color),
  41379. t[i++] = o.r,
  41380. t[i++] = o.g,
  41381. t[i++] = o.b
  41382. }
  41383. return this
  41384. },
  41385. copyIndicesArray: function(e) {
  41386. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41387. var o = e[n];
  41388. t[i++] = o.a,
  41389. t[i++] = o.b,
  41390. t[i++] = o.c
  41391. }
  41392. return this
  41393. },
  41394. copyVector2sArray: function(e) {
  41395. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41396. var o = e[n];
  41397. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41398. o = new Ci.Vector2),
  41399. t[i++] = o.x,
  41400. t[i++] = o.y
  41401. }
  41402. return this
  41403. },
  41404. copyVector3sArray: function(e) {
  41405. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41406. var o = e[n];
  41407. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41408. o = new Ci.Vector3),
  41409. t[i++] = o.x,
  41410. t[i++] = o.y,
  41411. t[i++] = o.z
  41412. }
  41413. return this
  41414. },
  41415. copyVector4sArray: function(e) {
  41416. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41417. var o = e[n];
  41418. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41419. o = new Ci.Vector4),
  41420. t[i++] = o.x,
  41421. t[i++] = o.y,
  41422. t[i++] = o.z,
  41423. t[i++] = o.w
  41424. }
  41425. return this
  41426. },
  41427. set: function(e, t) {
  41428. return void 0 === t && (t = 0),
  41429. this.array.set(e, t),
  41430. this
  41431. },
  41432. getX: function(e) {
  41433. return this.array[e * this.itemSize]
  41434. },
  41435. setX: function(e, t) {
  41436. return this.array[e * this.itemSize] = t,
  41437. this
  41438. },
  41439. getY: function(e) {
  41440. return this.array[e * this.itemSize + 1]
  41441. },
  41442. setY: function(e, t) {
  41443. return this.array[e * this.itemSize + 1] = t,
  41444. this
  41445. },
  41446. getZ: function(e) {
  41447. return this.array[e * this.itemSize + 2]
  41448. },
  41449. setZ: function(e, t) {
  41450. return this.array[e * this.itemSize + 2] = t,
  41451. this
  41452. },
  41453. getW: function(e) {
  41454. return this.array[e * this.itemSize + 3]
  41455. },
  41456. setW: function(e, t) {
  41457. return this.array[e * this.itemSize + 3] = t,
  41458. this
  41459. },
  41460. setXY: function(e, t, i) {
  41461. return e *= this.itemSize,
  41462. this.array[e + 0] = t,
  41463. this.array[e + 1] = i,
  41464. this
  41465. },
  41466. setXYZ: function(e, t, i, n) {
  41467. return e *= this.itemSize,
  41468. this.array[e + 0] = t,
  41469. this.array[e + 1] = i,
  41470. this.array[e + 2] = n,
  41471. this
  41472. },
  41473. setXYZW: function(e, t, i, n, r) {
  41474. return e *= this.itemSize,
  41475. this.array[e + 0] = t,
  41476. this.array[e + 1] = i,
  41477. this.array[e + 2] = n,
  41478. this.array[e + 3] = r,
  41479. this
  41480. },
  41481. clone: function() {
  41482. return (new this.constructor).copy(this)
  41483. }
  41484. },
  41485. Ci.Int8Attribute = function(e, t) {
  41486. return new Ci.BufferAttribute(new Int8Array(e),t)
  41487. }
  41488. ,
  41489. Ci.Uint8Attribute = function(e, t) {
  41490. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41491. }
  41492. ,
  41493. Ci.Uint8ClampedAttribute = function(e, t) {
  41494. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41495. }
  41496. ,
  41497. Ci.Int16Attribute = function(e, t) {
  41498. return new Ci.BufferAttribute(new Int16Array(e),t)
  41499. }
  41500. ,
  41501. Ci.Uint16Attribute = function(e, t) {
  41502. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41503. }
  41504. ,
  41505. Ci.Int32Attribute = function(e, t) {
  41506. return new Ci.BufferAttribute(new Int32Array(e),t)
  41507. }
  41508. ,
  41509. Ci.Uint32Attribute = function(e, t) {
  41510. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41511. }
  41512. ,
  41513. Ci.Float32Attribute = function(e, t) {
  41514. return new Ci.BufferAttribute(new Float32Array(e),t)
  41515. }
  41516. ,
  41517. Ci.Float64Attribute = function(e, t) {
  41518. return new Ci.BufferAttribute(new Float64Array(e),t)
  41519. }
  41520. ,
  41521. Ci.DynamicBufferAttribute = function(e, t) {
  41522. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41523. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41524. }
  41525. ,
  41526. Ci.InstancedBufferAttribute = function(e, t, i) {
  41527. Ci.BufferAttribute.call(this, e, t),
  41528. this.meshPerAttribute = i || 1
  41529. }
  41530. ,
  41531. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41532. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41533. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41534. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41535. this.meshPerAttribute = e.meshPerAttribute,
  41536. this
  41537. }
  41538. ,
  41539. Ci.InterleavedBuffer = function(e, t) {
  41540. this.uuid = Ci.Math.generateUUID(),
  41541. this.array = e,
  41542. this.stride = t,
  41543. this.dynamic = !1,
  41544. this.updateRange = {
  41545. offset: 0,
  41546. count: -1
  41547. },
  41548. this.version = 0
  41549. }
  41550. ,
  41551. Ci.InterleavedBuffer.prototype = {
  41552. constructor: Ci.InterleavedBuffer,
  41553. get length() {
  41554. return this.array.length
  41555. },
  41556. get count() {
  41557. return this.array.length / this.stride
  41558. },
  41559. set needsUpdate(e) {
  41560. !0 === e && this.version++
  41561. },
  41562. setDynamic: function(e) {
  41563. return this.dynamic = e,
  41564. this
  41565. },
  41566. copy: function(e) {
  41567. return this.array = new e.array.constructor(e.array),
  41568. this.stride = e.stride,
  41569. this.dynamic = e.dynamic,
  41570. this
  41571. },
  41572. copyAt: function(e, t, i) {
  41573. e *= this.stride,
  41574. i *= t.stride;
  41575. for (var n = 0, r = this.stride; n < r; n++)
  41576. this.array[e + n] = t.array[i + n];
  41577. return this
  41578. },
  41579. set: function(e, t) {
  41580. return void 0 === t && (t = 0),
  41581. this.array.set(e, t),
  41582. this
  41583. },
  41584. clone: function() {
  41585. return (new this.constructor).copy(this)
  41586. }
  41587. },
  41588. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41589. Ci.InterleavedBuffer.call(this, e, t),
  41590. this.meshPerAttribute = i || 1
  41591. }
  41592. ,
  41593. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41594. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41595. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41596. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41597. this.meshPerAttribute = e.meshPerAttribute,
  41598. this
  41599. }
  41600. ,
  41601. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41602. this.uuid = Ci.Math.generateUUID(),
  41603. this.data = e,
  41604. this.itemSize = t,
  41605. this.offset = i
  41606. }
  41607. ,
  41608. Ci.InterleavedBufferAttribute.prototype = {
  41609. constructor: Ci.InterleavedBufferAttribute,
  41610. get length() {
  41611. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41612. this.array.length
  41613. },
  41614. get count() {
  41615. return this.data.count
  41616. },
  41617. setX: function(e, t) {
  41618. return this.data.array[e * this.data.stride + this.offset] = t,
  41619. this
  41620. },
  41621. setY: function(e, t) {
  41622. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41623. this
  41624. },
  41625. setZ: function(e, t) {
  41626. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41627. this
  41628. },
  41629. setW: function(e, t) {
  41630. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41631. this
  41632. },
  41633. getX: function(e) {
  41634. return this.data.array[e * this.data.stride + this.offset]
  41635. },
  41636. getY: function(e) {
  41637. return this.data.array[e * this.data.stride + this.offset + 1]
  41638. },
  41639. getZ: function(e) {
  41640. return this.data.array[e * this.data.stride + this.offset + 2]
  41641. },
  41642. getW: function(e) {
  41643. return this.data.array[e * this.data.stride + this.offset + 3]
  41644. },
  41645. setXY: function(e, t, i) {
  41646. return e = e * this.data.stride + this.offset,
  41647. this.data.array[e + 0] = t,
  41648. this.data.array[e + 1] = i,
  41649. this
  41650. },
  41651. setXYZ: function(e, t, i, n) {
  41652. return e = e * this.data.stride + this.offset,
  41653. this.data.array[e + 0] = t,
  41654. this.data.array[e + 1] = i,
  41655. this.data.array[e + 2] = n,
  41656. this
  41657. },
  41658. setXYZW: function(e, t, i, n, r) {
  41659. return e = e * this.data.stride + this.offset,
  41660. this.data.array[e + 0] = t,
  41661. this.data.array[e + 1] = i,
  41662. this.data.array[e + 2] = n,
  41663. this.data.array[e + 3] = r,
  41664. this
  41665. }
  41666. },
  41667. Ci.Geometry = function() {
  41668. Object.defineProperty(this, "id", {
  41669. value: Ci.GeometryIdCount++
  41670. }),
  41671. this.uuid = Ci.Math.generateUUID(),
  41672. this.name = "",
  41673. this.type = "Geometry",
  41674. this.vertices = [],
  41675. this.colors = [],
  41676. this.faces = [],
  41677. this.faceVertexUvs = [[]],
  41678. this.morphTargets = [],
  41679. this.morphNormals = [],
  41680. this.skinWeights = [],
  41681. this.skinIndices = [],
  41682. this.lineDistances = [],
  41683. this.boundingBox = null,
  41684. this.boundingSphere = null,
  41685. this.verticesNeedUpdate = !1,
  41686. this.elementsNeedUpdate = !1,
  41687. this.uvsNeedUpdate = !1,
  41688. this.normalsNeedUpdate = !1,
  41689. this.colorsNeedUpdate = !1,
  41690. this.lineDistancesNeedUpdate = !1,
  41691. this.groupsNeedUpdate = !1
  41692. }
  41693. ,
  41694. Ci.Geometry.prototype = {
  41695. constructor: Ci.Geometry,
  41696. applyMatrix: function(e) {
  41697. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41698. this.vertices[i].applyMatrix4(e)
  41699. }
  41700. for (i = 0,
  41701. n = this.faces.length; i < n; i++) {
  41702. var r = this.faces[i];
  41703. r.normal.applyMatrix3(t).normalize();
  41704. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41705. r.vertexNormals[o].applyMatrix3(t).normalize()
  41706. }
  41707. return null !== this.boundingBox && this.computeBoundingBox(),
  41708. null !== this.boundingSphere && this.computeBoundingSphere(),
  41709. this.verticesNeedUpdate = !0,
  41710. this.normalsNeedUpdate = !0,
  41711. this
  41712. },
  41713. rotateX: function(e) {
  41714. return void 0 === mt && (mt = new Ci.Matrix4),
  41715. mt.makeRotationX(e),
  41716. this.applyMatrix(mt),
  41717. this
  41718. },
  41719. rotateY: function(e) {
  41720. return void 0 === gt && (gt = new Ci.Matrix4),
  41721. gt.makeRotationY(e),
  41722. this.applyMatrix(gt),
  41723. this
  41724. },
  41725. rotateZ: function(e) {
  41726. return void 0 === ft && (ft = new Ci.Matrix4),
  41727. ft.makeRotationZ(e),
  41728. this.applyMatrix(ft),
  41729. this
  41730. },
  41731. translate: function(e, t, i) {
  41732. return void 0 === pt && (pt = new Ci.Matrix4),
  41733. pt.makeTranslation(e, t, i),
  41734. this.applyMatrix(pt),
  41735. this
  41736. },
  41737. scale: function(e, t, i) {
  41738. return void 0 === dt && (dt = new Ci.Matrix4),
  41739. dt.makeScale(e, t, i),
  41740. this.applyMatrix(dt),
  41741. this
  41742. },
  41743. lookAt: function(e) {
  41744. void 0 === ut && (ut = new Ci.Object3D),
  41745. ut.lookAt(e),
  41746. ut.updateMatrix(),
  41747. this.applyMatrix(ut.matrix)
  41748. },
  41749. fromBufferGeometry: function(e) {
  41750. function t(e, t, i, n) {
  41751. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41752. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41753. , a = new Ci.Face3(e,t,i,r,o,n);
  41754. s.faces.push(a),
  41755. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41756. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41757. }
  41758. var s = this
  41759. , i = null !== e.index ? e.index.array : void 0
  41760. , n = e.attributes
  41761. , r = n.position.array
  41762. , l = void 0 !== n.normal ? n.normal.array : void 0
  41763. , c = void 0 !== n.color ? n.color.array : void 0
  41764. , h = void 0 !== n.uv ? n.uv.array : void 0
  41765. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41766. void 0 !== u && (this.faceVertexUvs[1] = []);
  41767. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41768. a += 2)
  41769. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41770. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41771. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41772. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41773. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41774. if (void 0 !== i) {
  41775. var g = e.groups;
  41776. if (0 < g.length)
  41777. for (o = 0; o < g.length; o++)
  41778. for (var m = g[o], v = m.start, y = (a = v,
  41779. v + m.count); a < y; a += 3)
  41780. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  41781. else
  41782. for (o = 0; o < i.length; o += 3)
  41783. t(i[o], i[o + 1], i[o + 2])
  41784. } else
  41785. for (o = 0; o < r.length / 3; o += 3)
  41786. t(o, o + 1, o + 2);
  41787. return this.computeFaceNormals(),
  41788. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41789. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41790. this
  41791. },
  41792. center: function() {
  41793. this.computeBoundingBox();
  41794. var e = this.boundingBox.center().negate();
  41795. return this.translate(e.x, e.y, e.z),
  41796. e
  41797. },
  41798. normalize: function() {
  41799. this.computeBoundingSphere();
  41800. var e = this.boundingSphere.center
  41801. , t = this.boundingSphere.radius
  41802. , i = 0 === t ? 1 : 1 / t
  41803. , n = new Ci.Matrix4;
  41804. 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),
  41805. this.applyMatrix(n),
  41806. this
  41807. },
  41808. computeFaceNormals: function() {
  41809. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  41810. var r = this.faces[i]
  41811. , o = this.vertices[r.a]
  41812. , a = this.vertices[r.b]
  41813. , s = this.vertices[r.c];
  41814. e.subVectors(s, a),
  41815. t.subVectors(o, a),
  41816. e.cross(t),
  41817. e.normalize(),
  41818. r.normal.copy(e)
  41819. }
  41820. },
  41821. computeVertexNormals: function(e) {
  41822. var t, i, n, r, o, a;
  41823. for (void 0 === e && (e = !0),
  41824. a = new Array(this.vertices.length),
  41825. t = 0,
  41826. i = this.vertices.length; t < i; t++)
  41827. a[t] = new Ci.Vector3;
  41828. if (e) {
  41829. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  41830. for (n = 0,
  41831. r = this.faces.length; n < r; n++)
  41832. o = this.faces[n],
  41833. s = this.vertices[o.a],
  41834. l = this.vertices[o.b],
  41835. c = this.vertices[o.c],
  41836. h.subVectors(c, l),
  41837. u.subVectors(s, l),
  41838. h.cross(u),
  41839. a[o.a].add(h),
  41840. a[o.b].add(h),
  41841. a[o.c].add(h)
  41842. } else
  41843. for (n = 0,
  41844. r = this.faces.length; n < r; n++)
  41845. a[(o = this.faces[n]).a].add(o.normal),
  41846. a[o.b].add(o.normal),
  41847. a[o.c].add(o.normal);
  41848. for (t = 0,
  41849. i = this.vertices.length; t < i; t++)
  41850. a[t].normalize();
  41851. for (n = 0,
  41852. r = this.faces.length; n < r; n++) {
  41853. var d = (o = this.faces[n]).vertexNormals;
  41854. 3 === d.length ? (d[0].copy(a[o.a]),
  41855. d[1].copy(a[o.b]),
  41856. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  41857. d[1] = a[o.b].clone(),
  41858. d[2] = a[o.c].clone())
  41859. }
  41860. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  41861. },
  41862. computeMorphNormals: function() {
  41863. var e, t, i, n, r;
  41864. for (i = 0,
  41865. n = this.faces.length; i < n; i++)
  41866. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  41867. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  41868. e = 0,
  41869. t = r.vertexNormals.length; e < t; e++)
  41870. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  41871. var o = new Ci.Geometry;
  41872. for (o.faces = this.faces,
  41873. e = 0,
  41874. t = this.morphTargets.length; e < t; e++) {
  41875. if (!this.morphNormals[e]) {
  41876. this.morphNormals[e] = {},
  41877. this.morphNormals[e].faceNormals = [],
  41878. this.morphNormals[e].vertexNormals = [];
  41879. var a = this.morphNormals[e].faceNormals
  41880. , s = this.morphNormals[e].vertexNormals;
  41881. for (i = 0,
  41882. n = this.faces.length; i < n; i++)
  41883. l = new Ci.Vector3,
  41884. c = {
  41885. a: new Ci.Vector3,
  41886. b: new Ci.Vector3,
  41887. c: new Ci.Vector3
  41888. },
  41889. a.push(l),
  41890. s.push(c)
  41891. }
  41892. var l, c, h = this.morphNormals[e];
  41893. for (o.vertices = this.morphTargets[e].vertices,
  41894. o.computeFaceNormals(),
  41895. o.computeVertexNormals(),
  41896. i = 0,
  41897. n = this.faces.length; i < n; i++)
  41898. r = this.faces[i],
  41899. l = h.faceNormals[i],
  41900. c = h.vertexNormals[i],
  41901. l.copy(r.normal),
  41902. c.a.copy(r.vertexNormals[0]),
  41903. c.b.copy(r.vertexNormals[1]),
  41904. c.c.copy(r.vertexNormals[2])
  41905. }
  41906. for (i = 0,
  41907. n = this.faces.length; i < n; i++)
  41908. (r = this.faces[i]).normal = r.__originalFaceNormal,
  41909. r.vertexNormals = r.__originalVertexNormals
  41910. },
  41911. computeTangents: function() {
  41912. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  41913. },
  41914. computeLineDistances: function() {
  41915. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  41916. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  41917. this.lineDistances[i] = e
  41918. },
  41919. computeBoundingBox: function() {
  41920. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  41921. this.boundingBox.setFromPoints(this.vertices)
  41922. },
  41923. computeBoundingSphere: function() {
  41924. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  41925. this.boundingSphere.setFromPoints(this.vertices)
  41926. },
  41927. merge: function(e, t, i) {
  41928. if (e instanceof Ci.Geometry != 0) {
  41929. 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];
  41930. void 0 === i && (i = 0),
  41931. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  41932. for (var u = 0, d = a.length; u < d; u++) {
  41933. var p = a[u].clone();
  41934. void 0 !== t && p.applyMatrix4(t),
  41935. o.push(p)
  41936. }
  41937. for (u = 0,
  41938. d = l.length; u < d; u++) {
  41939. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  41940. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  41941. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  41942. for (var C = 0, I = y.length; C < I; C++)
  41943. g = y[C].clone(),
  41944. void 0 !== n && g.applyMatrix3(n).normalize(),
  41945. f.vertexNormals.push(g);
  41946. f.color.copy(v.color);
  41947. for (C = 0,
  41948. I = A.length; C < I; C++)
  41949. m = A[C],
  41950. f.vertexColors.push(m.clone());
  41951. f.materialIndex = v.materialIndex + i,
  41952. s.push(f)
  41953. }
  41954. for (u = 0,
  41955. d = h.length; u < d; u++) {
  41956. var E = h[u]
  41957. , _ = [];
  41958. if (void 0 !== E) {
  41959. for (C = 0,
  41960. I = E.length; C < I; C++)
  41961. _.push(E[C].clone());
  41962. c.push(_)
  41963. }
  41964. }
  41965. } else
  41966. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  41967. },
  41968. mergeMesh: function(e) {
  41969. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  41970. void this.merge(e.geometry, e.matrix))
  41971. },
  41972. mergeVertices: function() {
  41973. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  41974. for (i = 0,
  41975. n = this.vertices.length; i < n; i++)
  41976. e = this.vertices[i],
  41977. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  41978. c.push(this.vertices[i]),
  41979. h[i] = c.length - 1) : h[i] = h[l[t]];
  41980. var d = [];
  41981. for (i = 0,
  41982. n = this.faces.length; i < n; i++) {
  41983. (r = this.faces[i]).a = h[r.a],
  41984. r.b = h[r.b],
  41985. r.c = h[r.c],
  41986. o = [r.a, r.b, r.c];
  41987. for (var p = 0; p < 3; p++)
  41988. if (o[p] === o[(p + 1) % 3]) {
  41989. p,
  41990. d.push(i);
  41991. break
  41992. }
  41993. }
  41994. for (i = d.length - 1; 0 <= i; i--) {
  41995. var f = d[i];
  41996. for (this.faces.splice(f, 1),
  41997. a = 0,
  41998. s = this.faceVertexUvs.length; a < s; a++)
  41999. this.faceVertexUvs[a].splice(f, 1)
  42000. }
  42001. var g = this.vertices.length - c.length;
  42002. return this.vertices = c,
  42003. g
  42004. },
  42005. sortFacesByMaterialIndex: function() {
  42006. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42007. e[i]._id = i;
  42008. e.sort(function(e, t) {
  42009. return e.materialIndex - t.materialIndex
  42010. });
  42011. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42012. o && o.length === t && (n = []),
  42013. a && a.length === t && (r = []);
  42014. for (i = 0; i < t; i++) {
  42015. var s = e[i]._id;
  42016. n && n.push(o[s]),
  42017. r && r.push(a[s])
  42018. }
  42019. n && (this.faceVertexUvs[0] = n),
  42020. r && (this.faceVertexUvs[1] = r)
  42021. },
  42022. toJSON: function() {
  42023. function e(e, t, i) {
  42024. return i ? e | 1 << t : e & ~(1 << t)
  42025. }
  42026. function t(e) {
  42027. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42028. return void 0 !== d[t] || (d[t] = u.length / 3,
  42029. u.push(e.x, e.y, e.z)),
  42030. d[t]
  42031. }
  42032. function i(e) {
  42033. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42034. return void 0 !== f[t] || (f[t] = p.length,
  42035. p.push(e.getHex())),
  42036. f[t]
  42037. }
  42038. function n(e) {
  42039. var t = e.x.toString() + e.y.toString();
  42040. return void 0 !== m[t] || (m[t] = g.length / 2,
  42041. g.push(e.x, e.y)),
  42042. m[t]
  42043. }
  42044. var r = {
  42045. metadata: {
  42046. version: 4.4,
  42047. type: "Geometry",
  42048. generator: "Geometry.toJSON"
  42049. }
  42050. };
  42051. if (r.uuid = this.uuid,
  42052. r.type = this.type,
  42053. "" !== this.name && (r.name = this.name),
  42054. void 0 !== this.parameters) {
  42055. var o = this.parameters;
  42056. for (var a in o)
  42057. void 0 !== o[a] && (r[a] = o[a]);
  42058. return r
  42059. }
  42060. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42061. var c = this.vertices[l];
  42062. s.push(c.x, c.y, c.z)
  42063. }
  42064. var h = []
  42065. , u = []
  42066. , d = {}
  42067. , p = []
  42068. , f = {}
  42069. , g = []
  42070. , m = {};
  42071. for (l = 0; l < this.faces.length; l++) {
  42072. var v = this.faces[l]
  42073. , y = void 0 !== this.faceVertexUvs[0][l]
  42074. , A = 0 < v.normal.length()
  42075. , C = 0 < v.vertexNormals.length
  42076. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42077. , E = 0 < v.vertexColors.length
  42078. , _ = 0;
  42079. 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),
  42080. h.push(_),
  42081. h.push(v.a, v.b, v.c),
  42082. h.push(v.materialIndex),
  42083. y) {
  42084. var b = this.faceVertexUvs[0][l];
  42085. h.push(n(b[0]), n(b[1]), n(b[2]))
  42086. }
  42087. if (A && h.push(t(v.normal)),
  42088. C) {
  42089. var w = v.vertexNormals;
  42090. h.push(t(w[0]), t(w[1]), t(w[2]))
  42091. }
  42092. if (I && h.push(i(v.color)),
  42093. E) {
  42094. var T = v.vertexColors;
  42095. h.push(i(T[0]), i(T[1]), i(T[2]))
  42096. }
  42097. }
  42098. return r.data = {},
  42099. r.data.vertices = s,
  42100. r.data.normals = u,
  42101. 0 < p.length && (r.data.colors = p),
  42102. 0 < g.length && (r.data.uvs = [g]),
  42103. r.data.faces = h,
  42104. r
  42105. },
  42106. clone: function() {
  42107. return (new Ci.Geometry).copy(this)
  42108. },
  42109. copy: function(e) {
  42110. this.vertices = [],
  42111. this.faces = [],
  42112. this.faceVertexUvs = [[]];
  42113. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42114. this.vertices.push(t[i].clone());
  42115. var r = e.faces;
  42116. for (i = 0,
  42117. n = r.length; i < n; i++)
  42118. this.faces.push(r[i].clone());
  42119. for (i = 0,
  42120. n = e.faceVertexUvs.length; i < n; i++) {
  42121. var o = e.faceVertexUvs[i];
  42122. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42123. for (var a = 0, s = o.length; a < s; a++) {
  42124. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42125. var d = l[h];
  42126. c.push(d.clone())
  42127. }
  42128. this.faceVertexUvs[i].push(c)
  42129. }
  42130. }
  42131. return this
  42132. },
  42133. dispose: function() {
  42134. this.dispatchEvent({
  42135. type: "dispose"
  42136. })
  42137. }
  42138. },
  42139. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42140. Ci.GeometryIdCount = 0,
  42141. Ci.DirectGeometry = function() {
  42142. Object.defineProperty(this, "id", {
  42143. value: Ci.GeometryIdCount++
  42144. }),
  42145. this.uuid = Ci.Math.generateUUID(),
  42146. this.name = "",
  42147. this.type = "DirectGeometry",
  42148. this.indices = [],
  42149. this.vertices = [],
  42150. this.normals = [],
  42151. this.colors = [],
  42152. this.uvs = [],
  42153. this.uvs2 = [],
  42154. this.groups = [],
  42155. this.morphTargets = {},
  42156. this.skinWeights = [],
  42157. this.skinIndices = [],
  42158. this.boundingBox = null,
  42159. this.boundingSphere = null,
  42160. this.verticesNeedUpdate = !1,
  42161. this.normalsNeedUpdate = !1,
  42162. this.colorsNeedUpdate = !1,
  42163. this.uvsNeedUpdate = !1,
  42164. this.groupsNeedUpdate = !1
  42165. }
  42166. ,
  42167. Ci.DirectGeometry.prototype = {
  42168. constructor: Ci.DirectGeometry,
  42169. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42170. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42171. computeFaceNormals: function() {
  42172. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42173. },
  42174. computeVertexNormals: function() {
  42175. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42176. },
  42177. computeGroups: function(e) {
  42178. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42179. var a = r[o];
  42180. a.materialIndex !== i && (i = a.materialIndex,
  42181. void 0 !== t && (t.count = 3 * o - t.start,
  42182. n.push(t)),
  42183. t = {
  42184. start: 3 * o,
  42185. materialIndex: i
  42186. })
  42187. }
  42188. void 0 !== t && (t.count = 3 * o - t.start,
  42189. n.push(t)),
  42190. this.groups = n
  42191. },
  42192. fromGeometry: function(e) {
  42193. 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;
  42194. if (0 < l) {
  42195. t = [];
  42196. for (var c = 0; c < l; c++)
  42197. t[c] = [];
  42198. this.morphTargets.position = t
  42199. }
  42200. var h, u = e.morphNormals, d = u.length;
  42201. if (0 < d) {
  42202. h = [];
  42203. for (c = 0; c < d; c++)
  42204. h[c] = [];
  42205. this.morphTargets.normal = h
  42206. }
  42207. var p = e.skinIndices
  42208. , f = e.skinWeights
  42209. , g = p.length === n.length
  42210. , m = f.length === n.length;
  42211. for (c = 0; c < i.length; c++) {
  42212. var v = i[c];
  42213. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42214. var y = v.vertexNormals;
  42215. if (3 === y.length)
  42216. this.normals.push(y[0], y[1], y[2]);
  42217. else {
  42218. var A = v.normal;
  42219. this.normals.push(A, A, A)
  42220. }
  42221. var C, I = v.vertexColors;
  42222. if (3 === I.length)
  42223. this.colors.push(I[0], I[1], I[2]);
  42224. else {
  42225. var E = v.color;
  42226. this.colors.push(E, E, E)
  42227. }
  42228. if (!0 === o)
  42229. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42230. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42231. if (!0 === a)
  42232. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42233. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42234. for (var _ = 0; _ < l; _++) {
  42235. var b = s[_].vertices;
  42236. t[_].push(b[v.a], b[v.b], b[v.c])
  42237. }
  42238. for (_ = 0; _ < d; _++) {
  42239. var w = u[_].vertexNormals[c];
  42240. h[_].push(w.a, w.b, w.c)
  42241. }
  42242. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42243. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42244. }
  42245. return this.computeGroups(e),
  42246. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42247. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42248. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42249. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42250. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42251. this
  42252. },
  42253. dispose: function() {
  42254. this.dispatchEvent({
  42255. type: "dispose"
  42256. })
  42257. }
  42258. },
  42259. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42260. Ci.BufferGeometry = function() {
  42261. Object.defineProperty(this, "id", {
  42262. value: Ci.GeometryIdCount++
  42263. }),
  42264. this.uuid = Ci.Math.generateUUID(),
  42265. this.name = "",
  42266. this.type = "BufferGeometry",
  42267. this.index = null,
  42268. this.attributes = {},
  42269. this.morphAttributes = {},
  42270. this.groups = [],
  42271. this.boundingBox = null,
  42272. this.boundingSphere = null,
  42273. this.drawRange = {
  42274. start: 0,
  42275. count: 1 / 0
  42276. }
  42277. }
  42278. ,
  42279. Ci.BufferGeometry.prototype = {
  42280. constructor: Ci.BufferGeometry,
  42281. getIndex: function() {
  42282. return this.index
  42283. },
  42284. setIndex: function(e) {
  42285. this.index = e
  42286. },
  42287. addAttribute: function(e, t) {
  42288. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42289. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42290. void this.setIndex(t)) : (this.attributes[e] = t,
  42291. this)
  42292. },
  42293. getAttribute: function(e) {
  42294. return this.attributes[e]
  42295. },
  42296. removeAttribute: function(e) {
  42297. return delete this.attributes[e],
  42298. this
  42299. },
  42300. addGroup: function(e, t, i) {
  42301. this.groups.push({
  42302. start: e,
  42303. count: t,
  42304. materialIndex: void 0 !== i ? i : 0
  42305. })
  42306. },
  42307. clearGroups: function() {
  42308. this.groups = []
  42309. },
  42310. setDrawRange: function(e, t) {
  42311. this.drawRange.start = e,
  42312. this.drawRange.count = t
  42313. },
  42314. applyMatrix: function(e) {
  42315. var t = this.attributes.position;
  42316. void 0 !== t && (e.applyToVector3Array(t.array),
  42317. t.needsUpdate = !0);
  42318. var i = this.attributes.normal;
  42319. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42320. i.needsUpdate = !0);
  42321. return null !== this.boundingBox && this.computeBoundingBox(),
  42322. null !== this.boundingSphere && this.computeBoundingSphere(),
  42323. this
  42324. },
  42325. rotateX: function(e) {
  42326. return void 0 === ht && (ht = new Ci.Matrix4),
  42327. ht.makeRotationX(e),
  42328. this.applyMatrix(ht),
  42329. this
  42330. },
  42331. rotateY: function(e) {
  42332. return void 0 === ct && (ct = new Ci.Matrix4),
  42333. ct.makeRotationY(e),
  42334. this.applyMatrix(ct),
  42335. this
  42336. },
  42337. rotateZ: function(e) {
  42338. return void 0 === lt && (lt = new Ci.Matrix4),
  42339. lt.makeRotationZ(e),
  42340. this.applyMatrix(lt),
  42341. this
  42342. },
  42343. translate: function(e, t, i) {
  42344. return void 0 === st && (st = new Ci.Matrix4),
  42345. st.makeTranslation(e, t, i),
  42346. this.applyMatrix(st),
  42347. this
  42348. },
  42349. scale: function(e, t, i) {
  42350. return void 0 === at && (at = new Ci.Matrix4),
  42351. at.makeScale(e, t, i),
  42352. this.applyMatrix(at),
  42353. this
  42354. },
  42355. lookAt: function(e) {
  42356. void 0 === ot && (ot = new Ci.Object3D),
  42357. ot.lookAt(e),
  42358. ot.updateMatrix(),
  42359. this.applyMatrix(ot.matrix)
  42360. },
  42361. center: function() {
  42362. this.computeBoundingBox();
  42363. var e = this.boundingBox.center().negate();
  42364. return this.translate(e.x, e.y, e.z),
  42365. e
  42366. },
  42367. setFromObject: function(e) {
  42368. var t = e.geometry;
  42369. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42370. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42371. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42372. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42373. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42374. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42375. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42376. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42377. }
  42378. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42379. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42380. } else
  42381. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42382. return this
  42383. },
  42384. updateFromObject: function(e) {
  42385. var t, i = e.geometry;
  42386. if (e instanceof Ci.Mesh) {
  42387. var n = i.__directGeometry;
  42388. if (void 0 === n)
  42389. return this.fromGeometry(i);
  42390. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42391. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42392. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42393. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42394. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42395. i.verticesNeedUpdate = !1,
  42396. i.normalsNeedUpdate = !1,
  42397. i.colorsNeedUpdate = !1,
  42398. i.uvsNeedUpdate = !1,
  42399. i.groupsNeedUpdate = !1,
  42400. i = n
  42401. }
  42402. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42403. t.needsUpdate = !0),
  42404. i.verticesNeedUpdate = !1);
  42405. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42406. t.needsUpdate = !0),
  42407. i.normalsNeedUpdate = !1);
  42408. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42409. t.needsUpdate = !0),
  42410. i.colorsNeedUpdate = !1);
  42411. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42412. t.needsUpdate = !0),
  42413. i.uvsNeedUpdate = !1);
  42414. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42415. t.needsUpdate = !0),
  42416. i.lineDistancesNeedUpdate = !1);
  42417. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42418. this.groups = i.groups,
  42419. i.groupsNeedUpdate = !1),
  42420. this
  42421. },
  42422. fromGeometry: function(e) {
  42423. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42424. this.fromDirectGeometry(e.__directGeometry)
  42425. },
  42426. fromDirectGeometry: function(e) {
  42427. var t = new Float32Array(3 * e.vertices.length);
  42428. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42429. 0 < e.normals.length) {
  42430. var i = new Float32Array(3 * e.normals.length);
  42431. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42432. }
  42433. if (0 < e.colors.length) {
  42434. var n = new Float32Array(3 * e.colors.length);
  42435. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42436. }
  42437. if (0 < e.uvs.length) {
  42438. var r = new Float32Array(2 * e.uvs.length);
  42439. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42440. }
  42441. if (0 < e.uvs2.length) {
  42442. var o = new Float32Array(2 * e.uvs2.length);
  42443. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42444. }
  42445. if (0 < e.indices.length) {
  42446. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42447. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42448. }
  42449. for (var s in this.groups = e.groups,
  42450. e.morphTargets) {
  42451. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42452. var d = c[h]
  42453. , p = new Ci.Float32Attribute(3 * d.length,3);
  42454. l.push(p.copyVector3sArray(d))
  42455. }
  42456. this.morphAttributes[s] = l
  42457. }
  42458. if (0 < e.skinIndices.length) {
  42459. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42460. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42461. }
  42462. if (0 < e.skinWeights.length) {
  42463. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42464. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42465. }
  42466. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42467. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42468. this
  42469. },
  42470. computeBoundingBox: (new Ci.Vector3,
  42471. function() {
  42472. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42473. var e = this.attributes.position.array;
  42474. e && this.boundingBox.setFromArray(e),
  42475. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42476. this.boundingBox.max.set(0, 0, 0)),
  42477. (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)
  42478. }
  42479. ),
  42480. computeBoundingSphere: (nt = new Ci.Box3,
  42481. rt = new Ci.Vector3,
  42482. function() {
  42483. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42484. var e = this.attributes.position.array;
  42485. if (e) {
  42486. var t = this.boundingSphere.center;
  42487. nt.setFromArray(e),
  42488. nt.center(t);
  42489. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42490. rt.fromArray(e, n),
  42491. i = Math.max(i, t.distanceToSquared(rt));
  42492. this.boundingSphere.radius = Math.sqrt(i),
  42493. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42494. }
  42495. }
  42496. ),
  42497. computeFaceNormals: function() {},
  42498. computeVertexNormals: function() {
  42499. var e = this.index
  42500. , t = this.attributes
  42501. , i = this.groups;
  42502. if (t.position) {
  42503. var n = t.position.array;
  42504. if (void 0 === t.normal)
  42505. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42506. else
  42507. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42508. r[o] = 0;
  42509. 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;
  42510. if (e) {
  42511. var m = e.array;
  42512. 0 === i.length && this.addGroup(0, m.length);
  42513. for (var v = 0, y = i.length; v < y; ++v) {
  42514. var A = i[v]
  42515. , C = A.start;
  42516. for (o = C,
  42517. a = C + A.count; o < a; o += 3)
  42518. s = 3 * m[o + 0],
  42519. l = 3 * m[o + 1],
  42520. c = 3 * m[o + 2],
  42521. u.fromArray(n, s),
  42522. d.fromArray(n, l),
  42523. p.fromArray(n, c),
  42524. f.subVectors(p, d),
  42525. g.subVectors(u, d),
  42526. f.cross(g),
  42527. h[s] += f.x,
  42528. h[1 + s] += f.y,
  42529. h[2 + s] += f.z,
  42530. h[l] += f.x,
  42531. h[1 + l] += f.y,
  42532. h[2 + l] += f.z,
  42533. h[c] += f.x,
  42534. h[1 + c] += f.y,
  42535. h[2 + c] += f.z
  42536. }
  42537. } else
  42538. for (o = 0,
  42539. a = n.length; o < a; o += 9)
  42540. u.fromArray(n, o),
  42541. d.fromArray(n, o + 3),
  42542. p.fromArray(n, o + 6),
  42543. f.subVectors(p, d),
  42544. g.subVectors(u, d),
  42545. f.cross(g),
  42546. h[o] = f.x,
  42547. h[o + 1] = f.y,
  42548. h[o + 2] = f.z,
  42549. h[o + 3] = f.x,
  42550. h[o + 4] = f.y,
  42551. h[o + 5] = f.z,
  42552. h[o + 6] = f.x,
  42553. h[o + 7] = f.y,
  42554. h[o + 8] = f.z;
  42555. this.normalizeNormals(),
  42556. t.normal.needsUpdate = !0
  42557. }
  42558. },
  42559. merge: function(e, t) {
  42560. if (e instanceof Ci.BufferGeometry != 0) {
  42561. void 0 === t && (t = 0);
  42562. var i = this.attributes;
  42563. for (var n in i)
  42564. if (void 0 !== e.attributes[n])
  42565. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42566. l++)
  42567. r[l] = a[s];
  42568. return this
  42569. }
  42570. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42571. },
  42572. normalizeNormals: function() {
  42573. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42574. e = r[o],
  42575. t = r[o + 1],
  42576. i = r[o + 2],
  42577. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42578. r[o] *= n,
  42579. r[o + 1] *= n,
  42580. r[o + 2] *= n
  42581. },
  42582. toNonIndexed: function() {
  42583. if (null === this.index)
  42584. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42585. this;
  42586. var e = new Ci.BufferGeometry
  42587. , t = this.index.array
  42588. , i = this.attributes;
  42589. for (var n in i) {
  42590. 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++) {
  42591. l = t[h] * a;
  42592. for (var d = 0; d < a; d++)
  42593. s[c++] = o[l++]
  42594. }
  42595. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42596. }
  42597. return e
  42598. },
  42599. toJSON: function() {
  42600. var e = {
  42601. metadata: {
  42602. version: 4.4,
  42603. type: "BufferGeometry",
  42604. generator: "BufferGeometry.toJSON"
  42605. }
  42606. };
  42607. if (e.uuid = this.uuid,
  42608. e.type = this.type,
  42609. "" !== this.name && (e.name = this.name),
  42610. void 0 !== this.parameters) {
  42611. var t = this.parameters;
  42612. for (var i in t)
  42613. void 0 !== t[i] && (e[i] = t[i]);
  42614. return e
  42615. }
  42616. e.data = {
  42617. attributes: {}
  42618. };
  42619. var n = this.index;
  42620. if (null !== n) {
  42621. var r = Array.prototype.slice.call(n.array);
  42622. e.data.index = {
  42623. type: n.array.constructor.name,
  42624. array: r
  42625. }
  42626. }
  42627. var o = this.attributes;
  42628. for (var i in o) {
  42629. var a = o[i];
  42630. r = Array.prototype.slice.call(a.array);
  42631. e.data.attributes[i] = {
  42632. itemSize: a.itemSize,
  42633. type: a.array.constructor.name,
  42634. array: r
  42635. }
  42636. }
  42637. var s = this.groups;
  42638. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42639. var l = this.boundingSphere;
  42640. return null !== l && (e.data.boundingSphere = {
  42641. center: l.center.toArray(),
  42642. radius: l.radius
  42643. }),
  42644. e
  42645. },
  42646. clone: function() {
  42647. return (new Ci.BufferGeometry).copy(this)
  42648. },
  42649. copy: function(e) {
  42650. var t = e.index;
  42651. null !== t && this.setIndex(t.clone());
  42652. var i = e.attributes;
  42653. for (var n in i) {
  42654. var r = i[n];
  42655. this.addAttribute(n, r.clone())
  42656. }
  42657. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42658. var l = o[a];
  42659. this.addGroup(l.start, l.count)
  42660. }
  42661. return this
  42662. },
  42663. dispose: function() {
  42664. this.dispatchEvent({
  42665. type: "dispose"
  42666. })
  42667. }
  42668. },
  42669. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42670. Ci.BufferGeometry.MaxIndex = 65535,
  42671. Ci.InstancedBufferGeometry = function() {
  42672. Ci.BufferGeometry.call(this),
  42673. this.type = "InstancedBufferGeometry",
  42674. this.maxInstancedCount = void 0
  42675. }
  42676. ,
  42677. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42678. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42679. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42680. this.groups.push({
  42681. start: e,
  42682. count: t,
  42683. instances: i
  42684. })
  42685. }
  42686. ,
  42687. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42688. var t = e.index;
  42689. null !== t && this.setIndex(t.clone());
  42690. var i = e.attributes;
  42691. for (var n in i) {
  42692. var r = i[n];
  42693. this.addAttribute(n, r.clone())
  42694. }
  42695. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42696. var l = o[a];
  42697. this.addGroup(l.start, l.count, l.instances)
  42698. }
  42699. return this
  42700. }
  42701. ,
  42702. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42703. Ci.Uniform = function(e, t) {
  42704. this.type = e,
  42705. this.value = t,
  42706. this.dynamic = !1
  42707. }
  42708. ,
  42709. Ci.Uniform.prototype = {
  42710. constructor: Ci.Uniform,
  42711. onUpdate: function(e) {
  42712. return this.dynamic = !0,
  42713. this.onUpdateCallback = e,
  42714. this
  42715. }
  42716. },
  42717. Ci.AnimationClip = function(e, t, i) {
  42718. this.name = e || Ci.Math.generateUUID(),
  42719. this.tracks = i,
  42720. this.duration = void 0 !== t ? t : -1,
  42721. this.duration < 0 && this.resetDuration(),
  42722. this.trim(),
  42723. this.optimize()
  42724. }
  42725. ,
  42726. Ci.AnimationClip.prototype = {
  42727. constructor: Ci.AnimationClip,
  42728. resetDuration: function() {
  42729. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42730. var n = this.tracks[t];
  42731. e = Math.max(e, n.times[n.times.length - 1])
  42732. }
  42733. this.duration = e
  42734. },
  42735. trim: function() {
  42736. for (var e = 0; e < this.tracks.length; e++)
  42737. this.tracks[e].trim(0, this.duration);
  42738. return this
  42739. },
  42740. optimize: function() {
  42741. for (var e = 0; e < this.tracks.length; e++)
  42742. this.tracks[e].optimize();
  42743. return this
  42744. }
  42745. },
  42746. Object.assign(Ci.AnimationClip, {
  42747. parse: function(e) {
  42748. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42749. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42750. return new Ci.AnimationClip(e.name,e.duration,t)
  42751. },
  42752. toJSON: function(e) {
  42753. for (var t = [], i = e.tracks, n = {
  42754. name: e.name,
  42755. duration: e.duration,
  42756. tracks: t
  42757. }, r = 0, o = i.length; r !== o; ++r)
  42758. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42759. return n
  42760. },
  42761. CreateFromMorphTargetSequence: function(e, t, i) {
  42762. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42763. var a = []
  42764. , s = [];
  42765. a.push((o + n - 1) % n, o, (o + 1) % n),
  42766. s.push(0, 1, 0);
  42767. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42768. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42769. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42770. 0 === a[0] && (a.push(n),
  42771. s.push(s[0])),
  42772. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42773. }
  42774. return new Ci.AnimationClip(e,-1,r)
  42775. },
  42776. findByName: function(e, t) {
  42777. for (var i = 0; i < e.length; i++)
  42778. if (e[i].name === t)
  42779. return e[i];
  42780. return null
  42781. },
  42782. CreateClipsFromMorphTargetSequences: function(e, t) {
  42783. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  42784. var a = e[r]
  42785. , s = a.name.match(n);
  42786. if (s && 1 < s.length) {
  42787. var l = i[h = s[1]];
  42788. l || (i[h] = l = []),
  42789. l.push(a)
  42790. }
  42791. }
  42792. var c = [];
  42793. for (var h in i)
  42794. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  42795. return c
  42796. },
  42797. parseAnimation: function(e, t, i) {
  42798. if (!e)
  42799. return console.error(" no animation in JSONLoader data"),
  42800. null;
  42801. function n(e, t, i, n, r) {
  42802. if (0 !== i.length) {
  42803. var o = []
  42804. , a = [];
  42805. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  42806. 0 !== o.length && r.push(new e(t,o,a))
  42807. }
  42808. }
  42809. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  42810. var h = l[c].keys;
  42811. if (h && 0 != h.length)
  42812. if (h[0].morphTargets) {
  42813. for (var u = {}, d = 0; d < h.length; d++)
  42814. if (h[d].morphTargets)
  42815. for (var p = 0; p < h[d].morphTargets.length; p++)
  42816. u[h[d].morphTargets[p]] = -1;
  42817. for (var f in u) {
  42818. var g = []
  42819. , m = [];
  42820. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  42821. var v = h[d];
  42822. g.push(v.time),
  42823. m.push(v.morphTarget === f ? 1 : 0)
  42824. }
  42825. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  42826. }
  42827. a = u.length * (s || 1)
  42828. } else {
  42829. var y = ".bones[" + t[c].name + "]";
  42830. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  42831. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  42832. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  42833. }
  42834. }
  42835. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  42836. }
  42837. }),
  42838. Ci.AnimationMixer = function(e) {
  42839. this._root = e,
  42840. this._initMemoryManager(),
  42841. this._accuIndex = 0,
  42842. this.time = 0,
  42843. this.timeScale = 1
  42844. }
  42845. ,
  42846. Ci.AnimationMixer.prototype = {
  42847. constructor: Ci.AnimationMixer,
  42848. clipAction: function(e, t) {
  42849. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  42850. if (void 0 !== a) {
  42851. var s = a.actionByRoot[n];
  42852. if (void 0 !== s)
  42853. return s;
  42854. if (o = (i = a.knownActions[0])._clip,
  42855. e !== r && e !== o)
  42856. throw new Error("Different clips with the same name detected!")
  42857. }
  42858. if (null === o)
  42859. return null;
  42860. var l = new Ci.AnimationMixer._Action(this,o,t);
  42861. return this._bindAction(l, i),
  42862. this._addInactiveAction(l, r, n),
  42863. l
  42864. },
  42865. existingAction: function(e, t) {
  42866. var i = (t || this._root).uuid
  42867. , n = "string" == typeof e ? e : e.name
  42868. , r = this._actionsByClip[n];
  42869. return void 0 !== r && r.actionByRoot[i] || null
  42870. },
  42871. stopAllAction: function() {
  42872. var e = this._actions
  42873. , t = this._nActiveActions
  42874. , i = this._bindings
  42875. , n = this._nActiveBindings;
  42876. this._nActiveActions = 0;
  42877. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  42878. e[r].reset();
  42879. for (r = 0; r !== n; ++r)
  42880. i[r].useCount = 0;
  42881. return this
  42882. },
  42883. update: function(e) {
  42884. e *= this.timeScale;
  42885. 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) {
  42886. var s = t[a];
  42887. s.enabled && s._update(n, e, r, o)
  42888. }
  42889. var l = this._bindings
  42890. , c = this._nActiveBindings;
  42891. for (a = 0; a !== c; ++a)
  42892. l[a].apply(o);
  42893. return this
  42894. },
  42895. getRoot: function() {
  42896. return this._root
  42897. },
  42898. uncacheClip: function(e) {
  42899. var t = this._actions
  42900. , i = e.name
  42901. , n = this._actionsByClip
  42902. , r = n[i];
  42903. if (void 0 !== r) {
  42904. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  42905. var l = o[a];
  42906. this._deactivateAction(l);
  42907. var c = l._cacheIndex
  42908. , h = t[t.length - 1];
  42909. l._cacheIndex = null,
  42910. l._byClipCacheIndex = null,
  42911. t[h._cacheIndex = c] = h,
  42912. t.pop(),
  42913. this._removeInactiveBindingsForAction(l)
  42914. }
  42915. delete n[i]
  42916. }
  42917. },
  42918. uncacheRoot: function(e) {
  42919. var t = e.uuid
  42920. , i = this._actionsByClip;
  42921. for (var n in i) {
  42922. var r = i[n].actionByRoot[t];
  42923. void 0 !== r && (this._deactivateAction(r),
  42924. this._removeInactiveAction(r))
  42925. }
  42926. var o = this._bindingsByRootAndName[t];
  42927. if (void 0 !== o)
  42928. for (var a in o) {
  42929. var s = o[a];
  42930. s.restoreOriginalState(),
  42931. this._removeInactiveBinding(s)
  42932. }
  42933. },
  42934. uncacheAction: function(e, t) {
  42935. var i = this.existingAction(e, t);
  42936. null !== i && (this._deactivateAction(i),
  42937. this._removeInactiveAction(i))
  42938. }
  42939. },
  42940. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  42941. Ci.AnimationMixer._Action = function(e, t, i) {
  42942. this._mixer = e,
  42943. this._clip = t,
  42944. this._localRoot = i || null;
  42945. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  42946. endingStart: Ci.ZeroCurvatureEnding,
  42947. endingEnd: Ci.ZeroCurvatureEnding
  42948. }, s = 0; s !== r; ++s) {
  42949. var l = n[s].createInterpolant(null);
  42950. (o[s] = l).settings = a
  42951. }
  42952. this._interpolantSettings = a,
  42953. this._interpolants = o,
  42954. this._propertyBindings = new Array(r),
  42955. this._cacheIndex = null,
  42956. this._byClipCacheIndex = null,
  42957. this._timeScaleInterpolant = null,
  42958. this._weightInterpolant = null,
  42959. this.loop = Ci.LoopRepeat,
  42960. this._loopCount = -1,
  42961. this._startTime = null,
  42962. this.time = 0,
  42963. this.timeScale = 1,
  42964. this._effectiveTimeScale = 1,
  42965. this.weight = 1,
  42966. this._effectiveWeight = 1,
  42967. this.repetitions = 1 / 0,
  42968. this.paused = !1,
  42969. this.enabled = !0,
  42970. this.clampWhenFinished = !1,
  42971. this.zeroSlopeAtStart = !0,
  42972. this.zeroSlopeAtEnd = !0
  42973. }
  42974. ,
  42975. Ci.AnimationMixer._Action.prototype = {
  42976. constructor: Ci.AnimationMixer._Action,
  42977. play: function() {
  42978. return this._mixer._activateAction(this),
  42979. this
  42980. },
  42981. stop: function() {
  42982. return this._mixer._deactivateAction(this),
  42983. this.reset()
  42984. },
  42985. reset: function() {
  42986. return this.paused = !1,
  42987. this.enabled = !0,
  42988. this.time = 0,
  42989. this._loopCount = -1,
  42990. this._startTime = null,
  42991. this.stopFading().stopWarping()
  42992. },
  42993. isRunning: function() {
  42994. return this._startTime,
  42995. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  42996. },
  42997. isScheduled: function() {
  42998. return this._mixer._isActiveAction(this)
  42999. },
  43000. startAt: function(e) {
  43001. return this._startTime = e,
  43002. this
  43003. },
  43004. setLoop: function(e, t) {
  43005. return this.loop = e,
  43006. this.repetitions = t,
  43007. this
  43008. },
  43009. setEffectiveWeight: function(e) {
  43010. return this.weight = e,
  43011. this._effectiveWeight = this.enabled ? e : 0,
  43012. this.stopFading()
  43013. },
  43014. getEffectiveWeight: function() {
  43015. return this._effectiveWeight
  43016. },
  43017. fadeIn: function(e) {
  43018. return this._scheduleFading(e, 0, 1)
  43019. },
  43020. fadeOut: function(e) {
  43021. return this._scheduleFading(e, 1, 0)
  43022. },
  43023. crossFadeFrom: function(e, t, i) {
  43024. if (this._mixer,
  43025. e.fadeOut(t),
  43026. this.fadeIn(t),
  43027. i) {
  43028. var n = this._clip.duration
  43029. , r = e._clip.duration
  43030. , o = r / n
  43031. , a = n / r;
  43032. e.warp(1, o, t),
  43033. this.warp(a, 1, t)
  43034. }
  43035. return this
  43036. },
  43037. crossFadeTo: function(e, t, i) {
  43038. return e.crossFadeFrom(this, t, i)
  43039. },
  43040. stopFading: function() {
  43041. var e = this._weightInterpolant;
  43042. return null !== e && (this._weightInterpolant = null,
  43043. this._mixer._takeBackControlInterpolant(e)),
  43044. this
  43045. },
  43046. setEffectiveTimeScale: function(e) {
  43047. return this.timeScale = e,
  43048. this._effectiveTimeScale = this.paused ? 0 : e,
  43049. this.stopWarping()
  43050. },
  43051. getEffectiveTimeScale: function() {
  43052. return this._effectiveTimeScale
  43053. },
  43054. setDuration: function(e) {
  43055. return this.timeScale = this._clip.duration / e,
  43056. this.stopWarping()
  43057. },
  43058. syncWith: function(e) {
  43059. return this.time = e.time,
  43060. this.timeScale = e.timeScale,
  43061. this.stopWarping()
  43062. },
  43063. halt: function(e) {
  43064. return this.warp(this._currentTimeScale, 0, e)
  43065. },
  43066. warp: function(e, t, i) {
  43067. var n = this._mixer
  43068. , r = n.time
  43069. , o = this._timeScaleInterpolant
  43070. , a = this.timeScale;
  43071. null === o && (o = n._lendControlInterpolant(),
  43072. this._timeScaleInterpolant = o);
  43073. var s = o.parameterPositions
  43074. , l = o.sampleValues;
  43075. return s[0] = r,
  43076. s[1] = r + i,
  43077. l[0] = e / a,
  43078. l[1] = t / a,
  43079. this
  43080. },
  43081. stopWarping: function() {
  43082. var e = this._timeScaleInterpolant;
  43083. return null !== e && (this._timeScaleInterpolant = null,
  43084. this._mixer._takeBackControlInterpolant(e)),
  43085. this
  43086. },
  43087. getMixer: function() {
  43088. return this._mixer
  43089. },
  43090. getClip: function() {
  43091. return this._clip
  43092. },
  43093. getRoot: function() {
  43094. return this._localRoot || this._mixer._root
  43095. },
  43096. _update: function(e, t, i, n) {
  43097. var r = this._startTime;
  43098. if (null !== r) {
  43099. var o = (e - r) * i;
  43100. if (o < 0 || 0 === i)
  43101. return;
  43102. this._startTime = null,
  43103. t = i * o
  43104. }
  43105. t *= this._updateTimeScale(e);
  43106. var a = this._updateTime(t)
  43107. , s = this._updateWeight(e);
  43108. if (0 < s)
  43109. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43110. l[h].evaluate(a),
  43111. c[h].accumulate(n, s)
  43112. },
  43113. _updateWeight: function(e) {
  43114. var t = 0;
  43115. if (this.enabled) {
  43116. t = this.weight;
  43117. var i = this._weightInterpolant;
  43118. if (null !== i) {
  43119. var n = i.evaluate(e)[0];
  43120. t *= n,
  43121. e > i.parameterPositions[1] && (this.stopFading(),
  43122. 0 === n && (this.enabled = !1))
  43123. }
  43124. }
  43125. return this._effectiveWeight = t
  43126. },
  43127. _updateTimeScale: function(e) {
  43128. var t = 0;
  43129. if (!this.paused) {
  43130. t = this.timeScale;
  43131. var i = this._timeScaleInterpolant;
  43132. if (null !== i)
  43133. t *= i.evaluate(e)[0],
  43134. e > i.parameterPositions[1] && (this.stopWarping(),
  43135. 0 === t ? this.pause = !0 : this.timeScale = t)
  43136. }
  43137. return this._effectiveTimeScale = t
  43138. },
  43139. _updateTime: function(e) {
  43140. var t = this.time + e;
  43141. if (0 === e)
  43142. return t;
  43143. var i = this._clip.duration
  43144. , n = this.loop
  43145. , r = this._loopCount
  43146. , o = !1;
  43147. switch (n) {
  43148. case Ci.LoopOnce:
  43149. if (-1 === r && (this.loopCount = 0,
  43150. this._setEndings(!0, !0, !1)),
  43151. i <= t)
  43152. t = i;
  43153. else {
  43154. if (!(t < 0))
  43155. break;
  43156. t = 0
  43157. }
  43158. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43159. this._mixer.dispatchEvent({
  43160. type: "finished",
  43161. action: this,
  43162. direction: e < 0 ? -1 : 1
  43163. });
  43164. break;
  43165. case Ci.LoopPingPong:
  43166. o = !0;
  43167. case Ci.LoopRepeat:
  43168. if (-1 === r && (0 < e ? (r = 0,
  43169. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43170. i <= t || t < 0) {
  43171. var a = Math.floor(t / i);
  43172. t -= i * a,
  43173. r += Math.abs(a);
  43174. var s = this.repetitions - r;
  43175. if (s < 0) {
  43176. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43177. t = 0 < e ? i : 0,
  43178. this._mixer.dispatchEvent({
  43179. type: "finished",
  43180. action: this,
  43181. direction: 0 < e ? 1 : -1
  43182. });
  43183. break
  43184. }
  43185. if (0 == s) {
  43186. var l = e < 0;
  43187. this._setEndings(l, !l, o)
  43188. } else
  43189. this._setEndings(!1, !1, o);
  43190. this._loopCount = r,
  43191. this._mixer.dispatchEvent({
  43192. type: "loop",
  43193. action: this,
  43194. loopDelta: a
  43195. })
  43196. }
  43197. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43198. return i - (this.time = t)
  43199. }
  43200. return this.time = t
  43201. },
  43202. _setEndings: function(e, t, i) {
  43203. var n = this._interpolantSettings;
  43204. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43205. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43206. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43207. },
  43208. _scheduleFading: function(e, t, i) {
  43209. var n = this._mixer
  43210. , r = n.time
  43211. , o = this._weightInterpolant;
  43212. null === o && (o = n._lendControlInterpolant(),
  43213. this._weightInterpolant = o);
  43214. var a = o.parameterPositions
  43215. , s = o.sampleValues;
  43216. return a[0] = r,
  43217. s[0] = t,
  43218. a[1] = r + e,
  43219. s[1] = i,
  43220. this
  43221. }
  43222. },
  43223. Object.assign(Ci.AnimationMixer.prototype, {
  43224. _bindAction: function(e, t) {
  43225. var i = e._localRoot || this._root
  43226. , n = e._clip.tracks
  43227. , r = n.length
  43228. , o = e._propertyBindings
  43229. , a = e._interpolants
  43230. , s = i.uuid
  43231. , l = this._bindingsByRootAndName
  43232. , c = l[s];
  43233. void 0 === c && (c = {},
  43234. l[s] = c);
  43235. for (var h = 0; h !== r; ++h) {
  43236. var u = n[h]
  43237. , d = u.name
  43238. , p = c[d];
  43239. if (void 0 !== p)
  43240. o[h] = p;
  43241. else {
  43242. if (void 0 !== (p = o[h])) {
  43243. null === p._cacheIndex && (++p.referenceCount,
  43244. this._addInactiveBinding(p, s, d));
  43245. continue
  43246. }
  43247. var f = t && t._propertyBindings[h].binding.parsedPath;
  43248. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43249. this._addInactiveBinding(p, s, d),
  43250. o[h] = p
  43251. }
  43252. a[h].resultBuffer = p.buffer
  43253. }
  43254. },
  43255. _activateAction: function(e) {
  43256. if (!this._isActiveAction(e)) {
  43257. if (null === e._cacheIndex) {
  43258. var t = (e._localRoot || this._root).uuid
  43259. , i = e._clip.name
  43260. , n = this._actionsByClip[i];
  43261. this._bindAction(e, n && n.knownActions[0]),
  43262. this._addInactiveAction(e, i, t)
  43263. }
  43264. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43265. var s = r[o];
  43266. 0 == s.useCount++ && (this._lendBinding(s),
  43267. s.saveOriginalState())
  43268. }
  43269. this._lendAction(e)
  43270. }
  43271. },
  43272. _deactivateAction: function(e) {
  43273. if (this._isActiveAction(e)) {
  43274. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43275. var r = t[i];
  43276. 0 == --r.useCount && (r.restoreOriginalState(),
  43277. this._takeBackBinding(r))
  43278. }
  43279. this._takeBackAction(e)
  43280. }
  43281. },
  43282. _initMemoryManager: function() {
  43283. this._actions = [],
  43284. this._nActiveActions = 0,
  43285. this._actionsByClip = {},
  43286. this._bindings = [],
  43287. this._nActiveBindings = 0,
  43288. this._bindingsByRootAndName = {},
  43289. this._controlInterpolants = [],
  43290. this._nActiveControlInterpolants = 0;
  43291. var e = this;
  43292. this.stats = {
  43293. actions: {
  43294. get total() {
  43295. return e._actions.length
  43296. },
  43297. get inUse() {
  43298. return e._nActiveActions
  43299. }
  43300. },
  43301. bindings: {
  43302. get total() {
  43303. return e._bindings.length
  43304. },
  43305. get inUse() {
  43306. return e._nActiveBindings
  43307. }
  43308. },
  43309. controlInterpolants: {
  43310. get total() {
  43311. return e._controlInterpolants.length
  43312. },
  43313. get inUse() {
  43314. return e._nActiveControlInterpolants
  43315. }
  43316. }
  43317. }
  43318. },
  43319. _isActiveAction: function(e) {
  43320. var t = e._cacheIndex;
  43321. return null !== t && t < this._nActiveActions
  43322. },
  43323. _addInactiveAction: function(e, t, i) {
  43324. var n = this._actions
  43325. , r = this._actionsByClip
  43326. , o = r[t];
  43327. if (void 0 === o)
  43328. o = {
  43329. knownActions: [e],
  43330. actionByRoot: {}
  43331. },
  43332. e._byClipCacheIndex = 0,
  43333. r[t] = o;
  43334. else {
  43335. var a = o.knownActions;
  43336. e._byClipCacheIndex = a.length,
  43337. a.push(e)
  43338. }
  43339. e._cacheIndex = n.length,
  43340. n.push(e),
  43341. o.actionByRoot[i] = e
  43342. },
  43343. _removeInactiveAction: function(e) {
  43344. var t = this._actions
  43345. , i = t[t.length - 1]
  43346. , n = e._cacheIndex;
  43347. t[i._cacheIndex = n] = i,
  43348. t.pop(),
  43349. e._cacheIndex = null;
  43350. var r = e._clip.name
  43351. , o = this._actionsByClip
  43352. , a = o[r]
  43353. , s = a.knownActions
  43354. , l = s[s.length - 1]
  43355. , c = e._byClipCacheIndex;
  43356. s[l._byClipCacheIndex = c] = l,
  43357. s.pop(),
  43358. e._byClipCacheIndex = null,
  43359. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43360. 0 === s.length && delete o[r],
  43361. this._removeInactiveBindingsForAction(e)
  43362. },
  43363. _removeInactiveBindingsForAction: function(e) {
  43364. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43365. var r = t[i];
  43366. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43367. }
  43368. },
  43369. _lendAction: function(e) {
  43370. var t = this._actions
  43371. , i = e._cacheIndex
  43372. , n = this._nActiveActions++
  43373. , r = t[n];
  43374. t[e._cacheIndex = n] = e,
  43375. t[r._cacheIndex = i] = r
  43376. },
  43377. _takeBackAction: function(e) {
  43378. var t = this._actions
  43379. , i = e._cacheIndex
  43380. , n = --this._nActiveActions
  43381. , r = t[n];
  43382. t[e._cacheIndex = n] = e,
  43383. t[r._cacheIndex = i] = r
  43384. },
  43385. _addInactiveBinding: function(e, t, i) {
  43386. var n = this._bindingsByRootAndName
  43387. , r = n[t]
  43388. , o = this._bindings;
  43389. void 0 === r && (r = {},
  43390. n[t] = r),
  43391. (r[i] = e)._cacheIndex = o.length,
  43392. o.push(e)
  43393. },
  43394. _removeInactiveBinding: function(e) {
  43395. var t = this._bindings
  43396. , i = e.binding
  43397. , n = i.rootNode.uuid
  43398. , r = i.path
  43399. , o = this._bindingsByRootAndName
  43400. , a = o[n]
  43401. , s = t[t.length - 1]
  43402. , l = e._cacheIndex;
  43403. t[s._cacheIndex = l] = s,
  43404. t.pop(),
  43405. delete a[r];
  43406. e: {
  43407. for (var c in a)
  43408. break e;
  43409. delete o[n]
  43410. }
  43411. },
  43412. _lendBinding: function(e) {
  43413. var t = this._bindings
  43414. , i = e._cacheIndex
  43415. , n = this._nActiveBindings++
  43416. , r = t[n];
  43417. t[e._cacheIndex = n] = e,
  43418. t[r._cacheIndex = i] = r
  43419. },
  43420. _takeBackBinding: function(e) {
  43421. var t = this._bindings
  43422. , i = e._cacheIndex
  43423. , n = --this._nActiveBindings
  43424. , r = t[n];
  43425. t[e._cacheIndex = n] = e,
  43426. t[r._cacheIndex = i] = r
  43427. },
  43428. _lendControlInterpolant: function() {
  43429. var e = this._controlInterpolants
  43430. , t = this._nActiveControlInterpolants++
  43431. , i = e[t];
  43432. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43433. i
  43434. },
  43435. _takeBackControlInterpolant: function(e) {
  43436. var t = this._controlInterpolants
  43437. , i = e.__cacheIndex
  43438. , n = --this._nActiveControlInterpolants
  43439. , r = t[n];
  43440. t[e.__cacheIndex = n] = e,
  43441. t[r.__cacheIndex = i] = r
  43442. },
  43443. _controlInterpolantsResultBuffer: new Float32Array(1)
  43444. }),
  43445. Ci.AnimationObjectGroup = function(e) {
  43446. this.uuid = Ci.Math.generateUUID(),
  43447. this._objects = Array.prototype.slice.call(arguments),
  43448. this.nCachedObjects_ = 0;
  43449. var t = {};
  43450. this._indicesByUUID = t;
  43451. for (var i = 0, n = arguments.length; i !== n; ++i)
  43452. t[arguments[i].uuid] = i;
  43453. this._paths = [],
  43454. this._parsedPaths = [],
  43455. this._bindings = [],
  43456. this._bindingsIndicesByPath = {};
  43457. var r = this;
  43458. this.stats = {
  43459. objects: {
  43460. get total() {
  43461. return r._objects.length
  43462. },
  43463. get inUse() {
  43464. return this.total - r.nCachedObjects_
  43465. }
  43466. },
  43467. get bindingsPerObject() {
  43468. return r._bindings.length
  43469. }
  43470. }
  43471. }
  43472. ,
  43473. Ci.AnimationObjectGroup.prototype = {
  43474. constructor: Ci.AnimationObjectGroup,
  43475. add: function(e) {
  43476. 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) {
  43477. var u = arguments[c]
  43478. , d = u.uuid
  43479. , p = r[d];
  43480. if (void 0 === p) {
  43481. p = i++,
  43482. r[d] = p,
  43483. t.push(u);
  43484. for (var f = 0, g = l; f !== g; ++f)
  43485. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43486. } else if (p < n) {
  43487. var m = t[p]
  43488. , v = --n
  43489. , y = t[v];
  43490. t[r[y.uuid] = p] = y,
  43491. t[r[d] = v] = u;
  43492. for (f = 0,
  43493. g = l; f !== g; ++f) {
  43494. var A = s[f]
  43495. , C = A[v]
  43496. , I = A[p];
  43497. A[p] = C,
  43498. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43499. A[v] = I
  43500. }
  43501. } else
  43502. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43503. }
  43504. this.nCachedObjects_ = n
  43505. },
  43506. remove: function(e) {
  43507. for (var t = this._objects, i = (t.length,
  43508. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43509. var l = arguments[a]
  43510. , c = l.uuid
  43511. , h = n[c];
  43512. if (void 0 !== h && i <= h) {
  43513. var u = i++
  43514. , d = t[u];
  43515. t[n[d.uuid] = h] = d,
  43516. t[n[c] = u] = l;
  43517. for (var p = 0, f = o; p !== f; ++p) {
  43518. var g = r[p]
  43519. , m = g[u]
  43520. , v = g[h];
  43521. g[h] = m,
  43522. g[u] = v
  43523. }
  43524. }
  43525. }
  43526. this.nCachedObjects_ = i
  43527. },
  43528. uncache: function(e) {
  43529. 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) {
  43530. var c = arguments[s].uuid
  43531. , h = r[c];
  43532. if (void 0 !== h)
  43533. if (delete r[c],
  43534. h < n) {
  43535. var u = --n
  43536. , d = t[u]
  43537. , p = t[y = --i];
  43538. t[r[d.uuid] = h] = d,
  43539. t[r[p.uuid] = u] = p,
  43540. t.pop();
  43541. for (var f = 0, g = a; f !== g; ++f) {
  43542. var m = (A = o[f])[u]
  43543. , v = A[y];
  43544. A[h] = m,
  43545. A[u] = v,
  43546. A.pop()
  43547. }
  43548. } else {
  43549. var y;
  43550. t[r[(p = t[y = --i]).uuid] = h] = p,
  43551. t.pop();
  43552. for (f = 0,
  43553. g = a; f !== g; ++f) {
  43554. var A;
  43555. (A = o[f])[h] = A[y],
  43556. A.pop()
  43557. }
  43558. }
  43559. }
  43560. this.nCachedObjects_ = n
  43561. },
  43562. subscribe_: function(e, t) {
  43563. var i = this._bindingsIndicesByPath
  43564. , n = i[e]
  43565. , r = this._bindings;
  43566. if (void 0 !== n)
  43567. return r[n];
  43568. var o = this._paths
  43569. , a = this._parsedPaths
  43570. , s = this._objects
  43571. , l = s.length
  43572. , c = this.nCachedObjects_
  43573. , h = new Array(l);
  43574. n = r.length,
  43575. i[e] = n,
  43576. o.push(e),
  43577. a.push(t),
  43578. r.push(h);
  43579. for (var u = c, d = s.length; u !== d; ++u) {
  43580. var p = s[u];
  43581. h[u] = new Ci.PropertyBinding(p,e,t)
  43582. }
  43583. return h
  43584. },
  43585. unsubscribe_: function(e) {
  43586. var t = this._bindingsIndicesByPath
  43587. , i = t[e];
  43588. if (void 0 !== i) {
  43589. var n = this._paths
  43590. , r = this._parsedPaths
  43591. , o = this._bindings
  43592. , a = o.length - 1
  43593. , s = o[a];
  43594. o[t[e[a]] = i] = s,
  43595. o.pop(),
  43596. r[i] = r[a],
  43597. r.pop(),
  43598. n[i] = n[a],
  43599. n.pop()
  43600. }
  43601. }
  43602. },
  43603. Ci.AnimationUtils = {
  43604. arraySlice: function(e, t, i) {
  43605. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43606. },
  43607. convertArray: function(e, t, i) {
  43608. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43609. },
  43610. isTypedArray: function(e) {
  43611. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43612. },
  43613. getKeyframeOrder: function(i) {
  43614. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43615. t[n] = n;
  43616. return t.sort(function(e, t) {
  43617. return i[e] - i[t]
  43618. }),
  43619. t
  43620. },
  43621. sortedArray: function(e, t, i) {
  43622. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43623. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43624. r[a++] = e[s + l];
  43625. return r
  43626. },
  43627. flattenJSON: function(e, t, i, n) {
  43628. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43629. o = e[r++];
  43630. if (void 0 !== o) {
  43631. var a = o[n];
  43632. if (void 0 !== a)
  43633. if (Array.isArray(a))
  43634. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43635. i.push.apply(i, a)),
  43636. void 0 !== (o = e[r++]); )
  43637. ;
  43638. else if (void 0 !== a.toArray)
  43639. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43640. a.toArray(i, i.length)),
  43641. void 0 !== (o = e[r++]); )
  43642. ;
  43643. else
  43644. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43645. i.push(a)),
  43646. void 0 !== (o = e[r++]); )
  43647. ;
  43648. }
  43649. }
  43650. },
  43651. Ci.KeyframeTrack = function(e, t, i, n) {
  43652. if (void 0 === e)
  43653. throw new Error("track name is undefined");
  43654. if (void 0 === t || 0 === t.length)
  43655. throw new Error("no keyframes in track named " + e);
  43656. this.name = e,
  43657. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43658. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43659. this.setInterpolation(n || this.DefaultInterpolation),
  43660. this.validate(),
  43661. this.optimize()
  43662. }
  43663. ,
  43664. Ci.KeyframeTrack.prototype = {
  43665. constructor: Ci.KeyframeTrack,
  43666. TimeBufferType: Float32Array,
  43667. ValueBufferType: Float32Array,
  43668. DefaultInterpolation: Ci.InterpolateLinear,
  43669. InterpolantFactoryMethodDiscrete: function(e) {
  43670. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43671. },
  43672. InterpolantFactoryMethodLinear: function(e) {
  43673. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43674. },
  43675. InterpolantFactoryMethodSmooth: function(e) {
  43676. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43677. },
  43678. setInterpolation: function(e) {
  43679. var t = void 0;
  43680. switch (e) {
  43681. case Ci.InterpolateDiscrete:
  43682. t = this.InterpolantFactoryMethodDiscrete;
  43683. break;
  43684. case Ci.InterpolateLinear:
  43685. t = this.InterpolantFactoryMethodLinear;
  43686. break;
  43687. case Ci.InterpolateSmooth:
  43688. t = this.InterpolantFactoryMethodSmooth
  43689. }
  43690. if (void 0 !== t)
  43691. this.createInterpolant = t;
  43692. else {
  43693. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43694. if (void 0 === this.createInterpolant) {
  43695. if (e === this.DefaultInterpolation)
  43696. throw new Error(i);
  43697. this.setInterpolation(this.DefaultInterpolation)
  43698. }
  43699. console.warn(i)
  43700. }
  43701. },
  43702. getInterpolation: function() {
  43703. switch (this.createInterpolant) {
  43704. case this.InterpolantFactoryMethodDiscrete:
  43705. return Ci.InterpolateDiscrete;
  43706. case this.InterpolantFactoryMethodLinear:
  43707. return Ci.InterpolateLinear;
  43708. case this.InterpolantFactoryMethodSmooth:
  43709. return Ci.InterpolateSmooth
  43710. }
  43711. },
  43712. getValueSize: function() {
  43713. return this.values.length / this.times.length
  43714. },
  43715. shift: function(e) {
  43716. if (0 !== e)
  43717. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43718. t[i] += e;
  43719. return this
  43720. },
  43721. scale: function(e) {
  43722. if (1 !== e)
  43723. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43724. t[i] *= e;
  43725. return this
  43726. },
  43727. trim: function(e, t) {
  43728. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43729. ++r;
  43730. for (; -1 !== o && i[o] > t; )
  43731. --o;
  43732. if (++o,
  43733. 0 !== r || o !== n) {
  43734. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43735. var a = this.getValueSize();
  43736. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43737. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43738. }
  43739. return this
  43740. },
  43741. validate: function() {
  43742. var e = !0
  43743. , t = this.getValueSize();
  43744. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43745. e = !1);
  43746. var i = this.times
  43747. , n = this.values
  43748. , r = i.length;
  43749. 0 === r && (console.error("track is empty", this),
  43750. e = !1);
  43751. for (var o = null, a = 0; a !== r; a++) {
  43752. var s = i[a];
  43753. if ("number" == typeof s && isNaN(s)) {
  43754. console.error("time is not a valid number", this, a, s),
  43755. e = !1;
  43756. break
  43757. }
  43758. if (null !== o && s < o) {
  43759. console.error("out of order keys", this, a, s, o),
  43760. e = !1;
  43761. break
  43762. }
  43763. o = s
  43764. }
  43765. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43766. a = 0;
  43767. for (var l = n.length; a !== l; ++a) {
  43768. var c = n[a];
  43769. if (isNaN(c)) {
  43770. console.error("value is not a valid number", this, a, c),
  43771. e = !1;
  43772. break
  43773. }
  43774. }
  43775. }
  43776. return e
  43777. },
  43778. optimize: function() {
  43779. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  43780. var a = !1
  43781. , s = e[r];
  43782. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  43783. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  43784. var d = t[l + u];
  43785. if (d !== t[c + u] || d !== t[h + u]) {
  43786. a = !0;
  43787. break
  43788. }
  43789. }
  43790. if (a) {
  43791. if (r !== n) {
  43792. e[n] = e[r];
  43793. var p = r * i
  43794. , f = n * i;
  43795. for (u = 0; u !== i; ++u)
  43796. t[f + u] = t[p + u]
  43797. }
  43798. ++n
  43799. }
  43800. }
  43801. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  43802. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  43803. this
  43804. }
  43805. },
  43806. Object.assign(Ci.KeyframeTrack, {
  43807. parse: function(e) {
  43808. if (void 0 === e.type)
  43809. throw new Error("track type undefined, can not parse");
  43810. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  43811. if (void 0 === e.times) {
  43812. console.warn("legacy JSON format detected, converting");
  43813. var i = []
  43814. , n = [];
  43815. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  43816. e.times = i,
  43817. e.values = n
  43818. }
  43819. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  43820. },
  43821. toJSON: function(e) {
  43822. var t, i = e.constructor;
  43823. if (void 0 !== i.toJSON)
  43824. t = i.toJSON(e);
  43825. else {
  43826. t = {
  43827. name: e.name,
  43828. times: Ci.AnimationUtils.convertArray(e.times, Array),
  43829. values: Ci.AnimationUtils.convertArray(e.values, Array)
  43830. };
  43831. var n = e.getInterpolation();
  43832. n !== e.DefaultInterpolation && (t.interpolation = n)
  43833. }
  43834. return t.type = e.ValueTypeName,
  43835. t
  43836. },
  43837. _getTrackTypeForValueTypeName: function(e) {
  43838. switch (e.toLowerCase()) {
  43839. case "scalar":
  43840. case "double":
  43841. case "float":
  43842. case "number":
  43843. case "integer":
  43844. return Ci.NumberKeyframeTrack;
  43845. case "vector":
  43846. case "vector2":
  43847. case "vector3":
  43848. case "vector4":
  43849. return Ci.VectorKeyframeTrack;
  43850. case "color":
  43851. return Ci.ColorKeyframeTrack;
  43852. case "quaternion":
  43853. return Ci.QuaternionKeyframeTrack;
  43854. case "bool":
  43855. case "boolean":
  43856. return Ci.BooleanKeyframeTrack;
  43857. case "string":
  43858. return Ci.StringKeyframeTrack
  43859. }
  43860. throw new Error("Unsupported typeName: " + e)
  43861. }
  43862. }),
  43863. Ci.PropertyBinding = function(e, t, i) {
  43864. this.path = t,
  43865. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  43866. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  43867. this.rootNode = e
  43868. }
  43869. ,
  43870. Ci.PropertyBinding.prototype = {
  43871. constructor: Ci.PropertyBinding,
  43872. getValue: function(e, t) {
  43873. this.bind(),
  43874. this.getValue(e, t)
  43875. },
  43876. setValue: function(e, t) {
  43877. this.bind(),
  43878. this.setValue(e, t)
  43879. },
  43880. bind: function() {
  43881. var e = this.node
  43882. , t = this.parsedPath
  43883. , i = t.objectName
  43884. , n = t.propertyName
  43885. , r = t.propertyIndex;
  43886. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  43887. this.node = e),
  43888. this.getValue = this._getValue_unavailable,
  43889. this.setValue = this._setValue_unavailable,
  43890. e) {
  43891. if (i) {
  43892. var o = t.objectIndex;
  43893. switch (i) {
  43894. case "materials":
  43895. if (!e.material)
  43896. return void console.error(" can not bind to material as node does not have a material", this);
  43897. if (!e.material.materials)
  43898. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  43899. e = e.material.materials;
  43900. break;
  43901. case "bones":
  43902. if (!e.skeleton)
  43903. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  43904. e = e.skeleton.bones;
  43905. for (var a = 0; a < e.length; a++)
  43906. if (e[a].name === o) {
  43907. o = a;
  43908. break
  43909. }
  43910. break;
  43911. default:
  43912. if (void 0 === e[i])
  43913. return void console.error(" can not bind to objectName of node, undefined", this);
  43914. e = e[i]
  43915. }
  43916. if (void 0 !== o) {
  43917. if (void 0 === e[o])
  43918. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  43919. e = e[o]
  43920. }
  43921. }
  43922. var s = e[n];
  43923. if (s) {
  43924. var l = this.Versioning.None;
  43925. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  43926. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  43927. this.targetObject = e);
  43928. var c = this.BindingType.Direct;
  43929. if (void 0 !== r) {
  43930. if ("morphTargetInfluences" === n) {
  43931. if (!e.geometry)
  43932. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  43933. if (!e.geometry.morphTargets)
  43934. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  43935. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  43936. if (e.geometry.morphTargets[a].name === r) {
  43937. r = a;
  43938. break
  43939. }
  43940. }
  43941. c = this.BindingType.ArrayElement,
  43942. this.resolvedProperty = s,
  43943. this.propertyIndex = r
  43944. } else
  43945. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  43946. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  43947. this.resolvedProperty = s) : this.propertyName = n;
  43948. this.getValue = this.GetterByBindingType[c],
  43949. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  43950. } else {
  43951. var h = t.nodeName;
  43952. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  43953. }
  43954. } else
  43955. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  43956. },
  43957. unbind: function() {
  43958. this.node = null,
  43959. this.getValue = this._getValue_unbound,
  43960. this.setValue = this._setValue_unbound
  43961. }
  43962. },
  43963. Object.assign(Ci.PropertyBinding.prototype, {
  43964. _getValue_unavailable: function() {},
  43965. _setValue_unavailable: function() {},
  43966. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  43967. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  43968. BindingType: {
  43969. Direct: 0,
  43970. EntireArray: 1,
  43971. ArrayElement: 2,
  43972. HasFromToArray: 3
  43973. },
  43974. Versioning: {
  43975. None: 0,
  43976. NeedsUpdate: 1,
  43977. MatrixWorldNeedsUpdate: 2
  43978. },
  43979. GetterByBindingType: [function(e, t) {
  43980. e[t] = this.node[this.propertyName]
  43981. }
  43982. , function(e, t) {
  43983. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43984. e[t++] = i[n]
  43985. }
  43986. , function(e, t) {
  43987. e[t] = this.resolvedProperty[this.propertyIndex]
  43988. }
  43989. , function(e, t) {
  43990. this.resolvedProperty.toArray(e, t)
  43991. }
  43992. ],
  43993. SetterByBindingTypeAndVersioning: [[function(e, t) {
  43994. this.node[this.propertyName] = e[t]
  43995. }
  43996. , function(e, t) {
  43997. this.node[this.propertyName] = e[t],
  43998. this.targetObject.needsUpdate = !0
  43999. }
  44000. , function(e, t) {
  44001. this.node[this.propertyName] = e[t],
  44002. this.targetObject.matrixWorldNeedsUpdate = !0
  44003. }
  44004. ], [function(e, t) {
  44005. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44006. i[n] = e[t++]
  44007. }
  44008. , function(e, t) {
  44009. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44010. i[n] = e[t++];
  44011. this.targetObject.needsUpdate = !0
  44012. }
  44013. , function(e, t) {
  44014. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44015. i[n] = e[t++];
  44016. this.targetObject.matrixWorldNeedsUpdate = !0
  44017. }
  44018. ], [function(e, t) {
  44019. this.resolvedProperty[this.propertyIndex] = e[t]
  44020. }
  44021. , function(e, t) {
  44022. this.resolvedProperty[this.propertyIndex] = e[t],
  44023. this.targetObject.needsUpdate = !0
  44024. }
  44025. , function(e, t) {
  44026. this.resolvedProperty[this.propertyIndex] = e[t],
  44027. this.targetObject.matrixWorldNeedsUpdate = !0
  44028. }
  44029. ], [function(e, t) {
  44030. this.resolvedProperty.fromArray(e, t)
  44031. }
  44032. , function(e, t) {
  44033. this.resolvedProperty.fromArray(e, t),
  44034. this.targetObject.needsUpdate = !0
  44035. }
  44036. , function(e, t) {
  44037. this.resolvedProperty.fromArray(e, t),
  44038. this.targetObject.matrixWorldNeedsUpdate = !0
  44039. }
  44040. ]]
  44041. }),
  44042. Ci.PropertyBinding.Composite = function(e, t, i) {
  44043. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44044. this._targetGroup = e,
  44045. this._bindings = e.subscribe_(t, n)
  44046. }
  44047. ,
  44048. Ci.PropertyBinding.Composite.prototype = {
  44049. constructor: Ci.PropertyBinding.Composite,
  44050. getValue: function(e, t) {
  44051. this.bind();
  44052. var i = this._targetGroup.nCachedObjects_
  44053. , n = this._bindings[i];
  44054. void 0 !== n && n.getValue(e, t)
  44055. },
  44056. setValue: function(e, t) {
  44057. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44058. i[n].setValue(e, t)
  44059. },
  44060. bind: function() {
  44061. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44062. e[t].bind()
  44063. },
  44064. unbind: function() {
  44065. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44066. e[t].unbind()
  44067. }
  44068. },
  44069. Ci.PropertyBinding.create = function(e, t, i) {
  44070. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44071. }
  44072. ,
  44073. Ci.PropertyBinding.parseTrackName = function(e) {
  44074. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44075. , i = t.exec(e);
  44076. if (!i)
  44077. throw new Error("cannot parse trackName at all: " + e);
  44078. i.index === t.lastIndex && t.lastIndex++;
  44079. var n = {
  44080. nodeName: i[3],
  44081. objectName: i[5],
  44082. objectIndex: i[7],
  44083. propertyName: i[9],
  44084. propertyIndex: i[11]
  44085. };
  44086. if (null === n.propertyName || 0 === n.propertyName.length)
  44087. throw new Error("can not parse propertyName from trackName: " + e);
  44088. return n
  44089. }
  44090. ,
  44091. Ci.PropertyBinding.findNode = function(e, r) {
  44092. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44093. return e;
  44094. if (e.skeleton) {
  44095. var t = function(e) {
  44096. for (var t = 0; t < e.bones.length; t++) {
  44097. var i = e.bones[t];
  44098. if (i.name === r)
  44099. return i
  44100. }
  44101. return null
  44102. }(e.skeleton);
  44103. if (t)
  44104. return t
  44105. }
  44106. if (e.children) {
  44107. var o = function(e) {
  44108. for (var t = 0; t < e.length; t++) {
  44109. var i = e[t];
  44110. if (i.name === r || i.uuid === r)
  44111. return i;
  44112. var n = o(i.children);
  44113. if (n)
  44114. return n
  44115. }
  44116. return null
  44117. }
  44118. , i = o(e.children);
  44119. if (i)
  44120. return i
  44121. }
  44122. return null
  44123. }
  44124. ,
  44125. Ci.PropertyMixer = function(e, t, i) {
  44126. this.binding = e,
  44127. this.valueSize = i;
  44128. var n, r = Float64Array;
  44129. switch (t) {
  44130. case "quaternion":
  44131. n = this._slerp;
  44132. break;
  44133. case "string":
  44134. case "bool":
  44135. r = Array,
  44136. n = this._select;
  44137. break;
  44138. default:
  44139. n = this._lerp
  44140. }
  44141. this.buffer = new r(4 * i),
  44142. this._mixBufferRegion = n,
  44143. this.cumulativeWeight = 0,
  44144. this.useCount = 0,
  44145. this.referenceCount = 0
  44146. }
  44147. ,
  44148. Ci.PropertyMixer.prototype = {
  44149. constructor: Ci.PropertyMixer,
  44150. accumulate: function(e, t) {
  44151. var i = this.buffer
  44152. , n = this.valueSize
  44153. , r = e * n + n
  44154. , o = this.cumulativeWeight;
  44155. if (0 === o) {
  44156. for (var a = 0; a !== n; ++a)
  44157. i[r + a] = i[a];
  44158. o = t
  44159. } else {
  44160. var s = t / (o += t);
  44161. this._mixBufferRegion(i, r, 0, s, n)
  44162. }
  44163. this.cumulativeWeight = o
  44164. },
  44165. apply: function(e) {
  44166. var t = this.valueSize
  44167. , i = this.buffer
  44168. , n = e * t + t
  44169. , r = this.cumulativeWeight
  44170. , o = this.binding;
  44171. if (this.cumulativeWeight = 0,
  44172. r < 1) {
  44173. var a = 3 * t;
  44174. this._mixBufferRegion(i, n, a, 1 - r, t)
  44175. }
  44176. for (var s = t, l = t + t; s !== l; ++s)
  44177. if (i[s] !== i[s + t]) {
  44178. o.setValue(i, n);
  44179. break
  44180. }
  44181. },
  44182. saveOriginalState: function() {
  44183. var e = this.binding
  44184. , t = this.buffer
  44185. , i = this.valueSize
  44186. , n = 3 * i;
  44187. e.getValue(t, n);
  44188. for (var r = i, o = n; r !== o; ++r)
  44189. t[r] = t[n + r % i];
  44190. this.cumulativeWeight = 0
  44191. },
  44192. restoreOriginalState: function() {
  44193. var e = 3 * this.valueSize;
  44194. this.binding.setValue(this.buffer, e)
  44195. },
  44196. _select: function(e, t, i, n, r) {
  44197. if (.5 <= n)
  44198. for (var o = 0; o !== r; ++o)
  44199. e[t + o] = e[i + o]
  44200. },
  44201. _slerp: function(e, t, i, n, r) {
  44202. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44203. },
  44204. _lerp: function(e, t, i, n, r) {
  44205. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44206. var s = t + a;
  44207. e[s] = e[s] * o + e[i + a] * n
  44208. }
  44209. }
  44210. },
  44211. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44212. Ci.KeyframeTrack.call(this, e, t, i)
  44213. }
  44214. ,
  44215. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44216. constructor: Ci.BooleanKeyframeTrack,
  44217. ValueTypeName: "bool",
  44218. ValueBufferType: Array,
  44219. DefaultInterpolation: Ci.IntepolateDiscrete,
  44220. InterpolantFactoryMethodLinear: void 0,
  44221. InterpolantFactoryMethodSmooth: void 0
  44222. }),
  44223. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44224. Ci.KeyframeTrack.call(this, e, t, i, n)
  44225. }
  44226. ,
  44227. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44228. constructor: Ci.NumberKeyframeTrack,
  44229. ValueTypeName: "number"
  44230. }),
  44231. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44232. Ci.KeyframeTrack.call(this, e, t, i, n)
  44233. }
  44234. ,
  44235. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44236. constructor: Ci.QuaternionKeyframeTrack,
  44237. ValueTypeName: "quaternion",
  44238. DefaultInterpolation: Ci.InterpolateLinear,
  44239. InterpolantFactoryMethodLinear: function(e) {
  44240. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44241. },
  44242. InterpolantFactoryMethodSmooth: void 0
  44243. }),
  44244. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44245. Ci.KeyframeTrack.call(this, e, t, i, n)
  44246. }
  44247. ,
  44248. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44249. constructor: Ci.StringKeyframeTrack,
  44250. ValueTypeName: "string",
  44251. ValueBufferType: Array,
  44252. DefaultInterpolation: Ci.IntepolateDiscrete,
  44253. InterpolantFactoryMethodLinear: void 0,
  44254. InterpolantFactoryMethodSmooth: void 0
  44255. }),
  44256. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44257. Ci.KeyframeTrack.call(this, e, t, i, n)
  44258. }
  44259. ,
  44260. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44261. constructor: Ci.VectorKeyframeTrack,
  44262. ValueTypeName: "vector"
  44263. }),
  44264. Ci.Audio = function(e) {
  44265. Ci.Object3D.call(this),
  44266. this.type = "Audio",
  44267. this.context = e.context,
  44268. this.source = this.context.createBufferSource(),
  44269. this.source.onended = this.onEnded.bind(this),
  44270. this.gain = this.context.createGain(),
  44271. this.gain.connect(e.getInput()),
  44272. this.autoplay = !1,
  44273. this.startTime = 0,
  44274. this.playbackRate = 1,
  44275. this.isPlaying = !1,
  44276. this.hasPlaybackControl = !0,
  44277. this.sourceType = "empty",
  44278. this.filter = null
  44279. }
  44280. ,
  44281. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44282. Ci.Audio.prototype.constructor = Ci.Audio,
  44283. Ci.Audio.prototype.getOutput = function() {
  44284. return this.gain
  44285. }
  44286. ,
  44287. Ci.Audio.prototype.load = function(e) {
  44288. var t = new Ci.AudioBuffer(this.context);
  44289. return t.load(e),
  44290. this.setBuffer(t),
  44291. this
  44292. }
  44293. ,
  44294. Ci.Audio.prototype.setNodeSource = function(e) {
  44295. return this.hasPlaybackControl = !1,
  44296. this.sourceType = "audioNode",
  44297. this.source = e,
  44298. this.connect(),
  44299. this
  44300. }
  44301. ,
  44302. Ci.Audio.prototype.setBuffer = function(e) {
  44303. var t = this;
  44304. return e.onReady(function(e) {
  44305. t.source.buffer = e,
  44306. t.sourceType = "buffer",
  44307. t.autoplay && t.play()
  44308. }),
  44309. this
  44310. }
  44311. ,
  44312. Ci.Audio.prototype.play = function() {
  44313. if (!0 !== this.isPlaying)
  44314. if (!1 !== this.hasPlaybackControl) {
  44315. var e = this.context.createBufferSource();
  44316. e.buffer = this.source.buffer,
  44317. e.loop = this.source.loop,
  44318. e.onended = this.source.onended,
  44319. e.start(0, this.startTime),
  44320. e.playbackRate.value = this.playbackRate,
  44321. this.isPlaying = !0,
  44322. this.source = e,
  44323. this.connect()
  44324. } else
  44325. console.warn("THREE.Audio: this Audio has no playback control.");
  44326. else
  44327. console.warn("THREE.Audio: Audio is already playing.")
  44328. }
  44329. ,
  44330. Ci.Audio.prototype.pause = function() {
  44331. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44332. void (this.startTime = this.context.currentTime))
  44333. }
  44334. ,
  44335. Ci.Audio.prototype.stop = function() {
  44336. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44337. void (this.startTime = 0))
  44338. }
  44339. ,
  44340. Ci.Audio.prototype.connect = function() {
  44341. null !== this.filter ? (this.source.connect(this.filter),
  44342. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44343. }
  44344. ,
  44345. Ci.Audio.prototype.disconnect = function() {
  44346. null !== this.filter ? (this.source.disconnect(this.filter),
  44347. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44348. }
  44349. ,
  44350. Ci.Audio.prototype.getFilter = function() {
  44351. return this.filter
  44352. }
  44353. ,
  44354. Ci.Audio.prototype.setFilter = function(e) {
  44355. void 0 === e && (e = null),
  44356. !0 === this.isPlaying ? (this.disconnect(),
  44357. this.filter = e,
  44358. this.connect()) : this.filter = e
  44359. }
  44360. ,
  44361. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44362. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44363. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44364. }
  44365. ,
  44366. Ci.Audio.prototype.getPlaybackRate = function() {
  44367. return this.playbackRate
  44368. }
  44369. ,
  44370. Ci.Audio.prototype.onEnded = function() {
  44371. this.isPlaying = !1
  44372. }
  44373. ,
  44374. Ci.Audio.prototype.setLoop = function(e) {
  44375. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44376. }
  44377. ,
  44378. Ci.Audio.prototype.getLoop = function() {
  44379. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44380. !1) : this.source.loop
  44381. }
  44382. ,
  44383. Ci.Audio.prototype.setVolume = function(e) {
  44384. this.gain.gain.value = e
  44385. }
  44386. ,
  44387. Ci.Audio.prototype.getVolume = function() {
  44388. return this.gain.gain.value
  44389. }
  44390. ,
  44391. Ci.AudioAnalyser = function(e, t) {
  44392. this.analyser = e.context.createAnalyser(),
  44393. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44394. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44395. e.getOutput().connect(this.analyser)
  44396. }
  44397. ,
  44398. Ci.AudioAnalyser.prototype = {
  44399. constructor: Ci.AudioAnalyser,
  44400. getData: function() {
  44401. return this.analyser.getByteFrequencyData(this.data),
  44402. this.data
  44403. }
  44404. },
  44405. Ci.AudioBuffer = function(e) {
  44406. this.context = e,
  44407. this.ready = !1,
  44408. this.readyCallbacks = []
  44409. }
  44410. ,
  44411. Ci.AudioBuffer.prototype.load = function(e) {
  44412. var i = this
  44413. , t = new XMLHttpRequest;
  44414. return t.open("GET", e, !0),
  44415. t.responseType = "arraybuffer",
  44416. t.onload = function(e) {
  44417. i.context.decodeAudioData(this.response, function(e) {
  44418. i.buffer = e,
  44419. i.ready = !0;
  44420. for (var t = 0; t < i.readyCallbacks.length; t++)
  44421. i.readyCallbacks[t](i.buffer);
  44422. i.readyCallbacks = []
  44423. })
  44424. }
  44425. ,
  44426. t.send(),
  44427. this
  44428. }
  44429. ,
  44430. Ci.AudioBuffer.prototype.onReady = function(e) {
  44431. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44432. }
  44433. ,
  44434. Ci.PositionalAudio = function(e) {
  44435. Ci.Audio.call(this, e),
  44436. this.panner = this.context.createPanner(),
  44437. this.panner.connect(this.gain)
  44438. }
  44439. ,
  44440. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44441. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44442. Ci.PositionalAudio.prototype.getOutput = function() {
  44443. return this.panner
  44444. }
  44445. ,
  44446. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44447. this.panner.refDistance = e
  44448. }
  44449. ,
  44450. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44451. return this.panner.refDistance
  44452. }
  44453. ,
  44454. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44455. this.panner.rolloffFactor = e
  44456. }
  44457. ,
  44458. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44459. return this.panner.rolloffFactor
  44460. }
  44461. ,
  44462. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44463. this.panner.distanceModel = e
  44464. }
  44465. ,
  44466. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44467. return this.panner.distanceModel
  44468. }
  44469. ,
  44470. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44471. this.panner.maxDistance = e
  44472. }
  44473. ,
  44474. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44475. return this.panner.maxDistance
  44476. }
  44477. ,
  44478. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44479. function(e) {
  44480. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44481. it.setFromMatrixPosition(this.matrixWorld),
  44482. this.panner.setPosition(it.x, it.y, it.z)
  44483. }
  44484. ),
  44485. Ci.AudioListener = function() {
  44486. Ci.Object3D.call(this),
  44487. this.type = "AudioListener",
  44488. this.context = new (window.AudioContext || window.webkitAudioContext),
  44489. this.gain = this.context.createGain(),
  44490. this.gain.connect(this.context.destination),
  44491. this.filter = null
  44492. }
  44493. ,
  44494. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44495. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44496. Ci.AudioListener.prototype.getInput = function() {
  44497. return this.gain
  44498. }
  44499. ,
  44500. Ci.AudioListener.prototype.removeFilter = function() {
  44501. null !== this.filter && (this.gain.disconnect(this.filter),
  44502. this.filter.disconnect(this.context.destination),
  44503. this.gain.connect(this.context.destination),
  44504. this.filter = null)
  44505. }
  44506. ,
  44507. Ci.AudioListener.prototype.setFilter = function(e) {
  44508. null !== this.filter ? (this.gain.disconnect(this.filter),
  44509. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44510. this.filter = e,
  44511. this.gain.connect(this.filter),
  44512. this.filter.connect(this.context.destination)
  44513. }
  44514. ,
  44515. Ci.AudioListener.prototype.getFilter = function() {
  44516. return this.filter
  44517. }
  44518. ,
  44519. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44520. this.gain.gain.value = e
  44521. }
  44522. ,
  44523. Ci.AudioListener.prototype.getMasterVolume = function() {
  44524. return this.gain.gain.value
  44525. }
  44526. ,
  44527. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44528. $e = new Ci.Quaternion,
  44529. et = new Ci.Vector3,
  44530. tt = new Ci.Vector3,
  44531. function(e) {
  44532. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44533. var t = this.context.listener
  44534. , i = this.up;
  44535. this.matrixWorld.decompose(Je, $e, et),
  44536. tt.set(0, 0, -1).applyQuaternion($e),
  44537. t.setPosition(Je.x, Je.y, Je.z),
  44538. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44539. }
  44540. ),
  44541. Ci.Camera = function() {
  44542. Ci.Object3D.call(this),
  44543. this.type = "Camera",
  44544. this.matrixWorldInverse = new Ci.Matrix4,
  44545. this.projectionMatrix = new Ci.Matrix4
  44546. }
  44547. ,
  44548. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44549. Ci.Camera.prototype.constructor = Ci.Camera,
  44550. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44551. function(e) {
  44552. var t = e || new Ci.Vector3;
  44553. return this.getWorldQuaternion(Qe),
  44554. t.set(0, 0, -1).applyQuaternion(Qe)
  44555. }
  44556. ),
  44557. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44558. function(e) {
  44559. Ke.lookAt(this.position, e, this.up),
  44560. this.quaternion.setFromRotationMatrix(Ke)
  44561. }
  44562. ),
  44563. Ci.Camera.prototype.clone = function() {
  44564. return (new this.constructor).copy(this)
  44565. }
  44566. ,
  44567. Ci.Camera.prototype.copy = function(e) {
  44568. return Ci.Object3D.prototype.copy.call(this, e),
  44569. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44570. this.projectionMatrix.copy(e.projectionMatrix),
  44571. this
  44572. }
  44573. ,
  44574. Ci.CubeCamera = function(e, t, i) {
  44575. Ci.Object3D.call(this),
  44576. this.type = "CubeCamera";
  44577. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44578. r.up.set(0, -1, 0),
  44579. r.lookAt(new Ci.Vector3(1,0,0)),
  44580. this.add(r);
  44581. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44582. o.up.set(0, -1, 0),
  44583. o.lookAt(new Ci.Vector3(-1,0,0)),
  44584. this.add(o);
  44585. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44586. a.up.set(0, 0, 1),
  44587. a.lookAt(new Ci.Vector3(0,1,0)),
  44588. this.add(a);
  44589. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44590. s.up.set(0, 0, -1),
  44591. s.lookAt(new Ci.Vector3(0,-1,0)),
  44592. this.add(s);
  44593. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44594. l.up.set(0, -1, 0),
  44595. l.lookAt(new Ci.Vector3(0,0,1)),
  44596. this.add(l);
  44597. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44598. c.up.set(0, -1, 0),
  44599. c.lookAt(new Ci.Vector3(0,0,-1)),
  44600. this.add(c);
  44601. var n = {
  44602. format: Ci.RGBFormat,
  44603. magFilter: Ci.LinearFilter,
  44604. minFilter: Ci.LinearFilter
  44605. };
  44606. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44607. this.updateCubeMap = function(e, t) {
  44608. null === this.parent && this.updateMatrixWorld();
  44609. var i = this.renderTarget
  44610. , n = i.texture.generateMipmaps;
  44611. i.texture.generateMipmaps = !1,
  44612. i.activeCubeFace = 0,
  44613. e.render(t, r, i),
  44614. i.activeCubeFace = 1,
  44615. e.render(t, o, i),
  44616. i.activeCubeFace = 2,
  44617. e.render(t, a, i),
  44618. i.activeCubeFace = 3,
  44619. e.render(t, s, i),
  44620. i.activeCubeFace = 4,
  44621. e.render(t, l, i),
  44622. i.texture.generateMipmaps = n,
  44623. i.activeCubeFace = 5,
  44624. e.render(t, c, i),
  44625. e.setRenderTarget(null)
  44626. }
  44627. }
  44628. ,
  44629. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44630. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44631. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44632. Ci.Camera.call(this),
  44633. this.type = "OrthographicCamera",
  44634. this.zoom = 1,
  44635. this.left = e,
  44636. this.right = t,
  44637. this.top = i,
  44638. this.bottom = n,
  44639. this.near = void 0 !== r ? r : .1,
  44640. this.far = void 0 !== o ? o : 2e3,
  44641. this.updateProjectionMatrix()
  44642. }
  44643. ,
  44644. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44645. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44646. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44647. var e = (this.right - this.left) / (2 * this.zoom)
  44648. , t = (this.top - this.bottom) / (2 * this.zoom)
  44649. , i = (this.right + this.left) / 2
  44650. , n = (this.top + this.bottom) / 2;
  44651. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44652. }
  44653. ,
  44654. Ci.OrthographicCamera.prototype.copy = function(e) {
  44655. return Ci.Camera.prototype.copy.call(this, e),
  44656. this.left = e.left,
  44657. this.right = e.right,
  44658. this.top = e.top,
  44659. this.bottom = e.bottom,
  44660. this.near = e.near,
  44661. this.far = e.far,
  44662. this.zoom = e.zoom,
  44663. this
  44664. }
  44665. ,
  44666. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44667. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44668. return t.object.zoom = this.zoom,
  44669. t.object.left = this.left,
  44670. t.object.right = this.right,
  44671. t.object.top = this.top,
  44672. t.object.bottom = this.bottom,
  44673. t.object.near = this.near,
  44674. t.object.far = this.far,
  44675. t
  44676. }
  44677. ,
  44678. Ci.PerspectiveCamera = function(e, t, i, n) {
  44679. Ci.Camera.call(this),
  44680. this.type = "PerspectiveCamera",
  44681. this.focalLength = 10,
  44682. this.zoom = 1,
  44683. this.fov = void 0 !== e ? e : 50,
  44684. this.aspect = void 0 !== t ? t : 1,
  44685. this.near = void 0 !== i ? i : .1,
  44686. this.far = void 0 !== n ? n : 2e3,
  44687. this.updateProjectionMatrix()
  44688. }
  44689. ,
  44690. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44691. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44692. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44693. void 0 === t && (t = 24),
  44694. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44695. this.updateProjectionMatrix()
  44696. }
  44697. ,
  44698. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44699. this.fullWidth = e,
  44700. this.fullHeight = t,
  44701. this.x = i,
  44702. this.y = n,
  44703. this.width = r,
  44704. this.height = o,
  44705. this.updateProjectionMatrix()
  44706. }
  44707. ,
  44708. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44709. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44710. if (this.fullWidth) {
  44711. var t = this.fullWidth / this.fullHeight
  44712. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44713. , n = -i
  44714. , r = t * n
  44715. , o = t * i
  44716. , a = Math.abs(o - r)
  44717. , s = Math.abs(i - n);
  44718. 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)
  44719. } else
  44720. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44721. }
  44722. ,
  44723. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44724. return Ci.Camera.prototype.copy.call(this, e),
  44725. this.focalLength = e.focalLength,
  44726. this.zoom = e.zoom,
  44727. this.fov = e.fov,
  44728. this.aspect = e.aspect,
  44729. this.near = e.near,
  44730. this.far = e.far,
  44731. this
  44732. }
  44733. ,
  44734. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44735. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44736. return t.object.focalLength = this.focalLength,
  44737. t.object.zoom = this.zoom,
  44738. t.object.fov = this.fov,
  44739. t.object.aspect = this.aspect,
  44740. t.object.near = this.near,
  44741. t.object.far = this.far,
  44742. t
  44743. }
  44744. ,
  44745. Ci.StereoCamera = function() {
  44746. this.type = "StereoCamera",
  44747. this.aspect = 1,
  44748. this.cameraL = new Ci.PerspectiveCamera,
  44749. this.cameraL.layers.enable(1),
  44750. this.cameraL.matrixAutoUpdate = !1,
  44751. this.cameraR = new Ci.PerspectiveCamera,
  44752. this.cameraR.layers.enable(2),
  44753. this.cameraR.matrixAutoUpdate = !1
  44754. }
  44755. ,
  44756. Ci.StereoCamera.prototype = {
  44757. constructor: Ci.StereoCamera,
  44758. update: (Xe = new Ci.Matrix4,
  44759. Ze = new Ci.Matrix4,
  44760. function(e) {
  44761. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44762. Ge = e.focalLength,
  44763. We = e.fov,
  44764. je = e.aspect * this.aspect,
  44765. Ye = e.near,
  44766. qe = e.far;
  44767. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44768. Ze.elements[12] = -.032,
  44769. Xe.elements[12] = .032,
  44770. t = -o * je + r,
  44771. i = o * je + r,
  44772. n.elements[0] = 2 * Ye / (i - t),
  44773. n.elements[8] = (i + t) / (i - t),
  44774. this.cameraL.projectionMatrix.copy(n),
  44775. t = -o * je - r,
  44776. i = o * je - r,
  44777. n.elements[0] = 2 * Ye / (i - t),
  44778. n.elements[8] = (i + t) / (i - t),
  44779. this.cameraR.projectionMatrix.copy(n)
  44780. }
  44781. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  44782. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  44783. }
  44784. )
  44785. },
  44786. Ci.Light = function(e, t) {
  44787. Ci.Object3D.call(this),
  44788. this.type = "Light",
  44789. this.color = new Ci.Color(e),
  44790. this.intensity = void 0 !== t ? t : 1,
  44791. this.receiveShadow = void 0
  44792. }
  44793. ,
  44794. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  44795. Ci.Light.prototype.constructor = Ci.Light,
  44796. Ci.Light.prototype.copy = function(e) {
  44797. return Ci.Object3D.prototype.copy.call(this, e),
  44798. this.color.copy(e.color),
  44799. this.intensity = e.intensity,
  44800. this
  44801. }
  44802. ,
  44803. Ci.Light.prototype.toJSON = function(e) {
  44804. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44805. return t.object.color = this.color.getHex(),
  44806. t.object.intensity = this.intensity,
  44807. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44808. void 0 !== this.distance && (t.object.distance = this.distance),
  44809. void 0 !== this.angle && (t.object.angle = this.angle),
  44810. void 0 !== this.decay && (t.object.decay = this.decay),
  44811. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44812. t
  44813. }
  44814. ,
  44815. Ci.LightShadow = function(e) {
  44816. this.camera = e,
  44817. this.bias = 0,
  44818. this.radius = 1,
  44819. this.mapSize = new Ci.Vector2(512,512),
  44820. this.map = null,
  44821. this.matrix = new Ci.Matrix4
  44822. }
  44823. ,
  44824. Ci.LightShadow.prototype = {
  44825. constructor: Ci.LightShadow,
  44826. copy: function(e) {
  44827. return this.camera = e.camera.clone(),
  44828. this.bias = e.bias,
  44829. this.radius = e.radius,
  44830. this.mapSize.copy(e.mapSize),
  44831. this
  44832. },
  44833. clone: function() {
  44834. return (new this.constructor).copy(this)
  44835. }
  44836. },
  44837. Ci.AmbientLight = function(e, t) {
  44838. Ci.Light.call(this, e, t),
  44839. this.type = "AmbientLight",
  44840. this.castShadow = void 0
  44841. }
  44842. ,
  44843. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  44844. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  44845. Ci.DirectionalLight = function(e, t) {
  44846. Ci.Light.call(this, e, t),
  44847. this.type = "DirectionalLight",
  44848. this.position.set(0, 1, 0),
  44849. this.updateMatrix(),
  44850. this.target = new Ci.Object3D,
  44851. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  44852. }
  44853. ,
  44854. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  44855. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  44856. Ci.DirectionalLight.prototype.copy = function(e) {
  44857. return Ci.Light.prototype.copy.call(this, e),
  44858. this.target = e.target.clone(),
  44859. this.shadow = e.shadow.clone(),
  44860. this
  44861. }
  44862. ,
  44863. Ci.HemisphereLight = function(e, t, i) {
  44864. Ci.Light.call(this, e, i),
  44865. this.type = "HemisphereLight",
  44866. this.castShadow = void 0,
  44867. this.position.set(0, 1, 0),
  44868. this.updateMatrix(),
  44869. this.groundColor = new Ci.Color(t)
  44870. }
  44871. ,
  44872. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  44873. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  44874. Ci.HemisphereLight.prototype.copy = function(e) {
  44875. return Ci.Light.prototype.copy.call(this, e),
  44876. this.groundColor.copy(e.groundColor),
  44877. this
  44878. }
  44879. ,
  44880. Ci.PointLight = function(e, t, i, n) {
  44881. Ci.Light.call(this, e, t),
  44882. this.type = "PointLight",
  44883. this.distance = void 0 !== i ? i : 0,
  44884. this.decay = void 0 !== n ? n : 1,
  44885. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  44886. }
  44887. ,
  44888. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  44889. Ci.PointLight.prototype.constructor = Ci.PointLight,
  44890. Object.defineProperty(Ci.PointLight.prototype, "power", {
  44891. get: function() {
  44892. return 4 * this.intensity * Math.PI
  44893. },
  44894. set: function(e) {
  44895. this.intensity = e / (4 * Math.PI)
  44896. }
  44897. }),
  44898. Ci.PointLight.prototype.copy = function(e) {
  44899. return Ci.Light.prototype.copy.call(this, e),
  44900. this.distance = e.distance,
  44901. this.decay = e.decay,
  44902. this.shadow = e.shadow.clone(),
  44903. this
  44904. }
  44905. ,
  44906. Ci.SpotLight = function(e, t, i, n, r, o) {
  44907. Ci.Light.call(this, e, t),
  44908. this.type = "SpotLight",
  44909. this.position.set(0, 1, 0),
  44910. this.updateMatrix(),
  44911. this.target = new Ci.Object3D,
  44912. this.distance = void 0 !== i ? i : 0,
  44913. this.angle = void 0 !== n ? n : Math.PI / 3,
  44914. this.penumbra = void 0 !== r ? r : 0,
  44915. this.decay = void 0 !== o ? o : 1,
  44916. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  44917. }
  44918. ,
  44919. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  44920. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  44921. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  44922. get: function() {
  44923. return this.intensity * Math.PI
  44924. },
  44925. set: function(e) {
  44926. this.intensity = e / Math.PI
  44927. }
  44928. }),
  44929. Ci.SpotLight.prototype.copy = function(e) {
  44930. return Ci.Light.prototype.copy.call(this, e),
  44931. this.distance = e.distance,
  44932. this.angle = e.angle,
  44933. this.penumbra = e.penumbra,
  44934. this.decay = e.decay,
  44935. this.target = e.target.clone(),
  44936. this.shadow = e.shadow.clone(),
  44937. this
  44938. }
  44939. ,
  44940. Ci.Cache = {
  44941. enabled: !1,
  44942. files: {},
  44943. add: function(e, t) {
  44944. !1 !== this.enabled && (this.files[e] = t)
  44945. },
  44946. get: function(e) {
  44947. if (!1 !== this.enabled)
  44948. return this.files[e]
  44949. },
  44950. remove: function(e) {
  44951. delete this.files[e]
  44952. },
  44953. clear: function() {
  44954. this.files = {}
  44955. }
  44956. },
  44957. Ci.Loader = function() {
  44958. this.onLoadStart = function() {}
  44959. ,
  44960. this.onLoadProgress = function() {}
  44961. ,
  44962. this.onLoadComplete = function() {}
  44963. }
  44964. ,
  44965. Ci.Loader.prototype = {
  44966. constructor: Ci.Loader,
  44967. crossOrigin: void 0,
  44968. extractUrlBase: function(e) {
  44969. var t = e.split("/");
  44970. return 1 === t.length ? "./" : (t.pop(),
  44971. t.join("/") + "/")
  44972. },
  44973. initMaterials: function(e, t, i) {
  44974. for (var n = [], r = 0; r < e.length; ++r)
  44975. n[r] = this.createMaterial(e[r], t, i);
  44976. return n
  44977. },
  44978. createMaterial: function(e, c, h) {
  44979. function t(e, t, i, n, r) {
  44980. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  44981. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  44982. He.load(a)),
  44983. void 0 !== t && (o.repeat.fromArray(t),
  44984. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  44985. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  44986. void 0 !== i && o.offset.fromArray(i),
  44987. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  44988. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  44989. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  44990. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  44991. void 0 !== r && (o.anisotropy = r);
  44992. var l = Ci.Math.generateUUID();
  44993. return u[l] = o,
  44994. l
  44995. }
  44996. void 0 === Ue && (Ue = new Ci.Color),
  44997. void 0 === He && (He = new Ci.TextureLoader),
  44998. void 0 === ze && (ze = new Ci.MaterialLoader);
  44999. var u = {}
  45000. , i = {
  45001. uuid: Ci.Math.generateUUID(),
  45002. type: "MeshLambertMaterial"
  45003. };
  45004. for (var n in e) {
  45005. var r = e[n];
  45006. switch (n) {
  45007. case "DbgColor":
  45008. case "DbgIndex":
  45009. case "opticalDensity":
  45010. case "illumination":
  45011. break;
  45012. case "DbgName":
  45013. i.name = r;
  45014. break;
  45015. case "blending":
  45016. i.blending = Ci[r];
  45017. break;
  45018. case "colorAmbient":
  45019. case "mapAmbient":
  45020. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45021. break;
  45022. case "colorDiffuse":
  45023. i.color = Ue.fromArray(r).getHex();
  45024. break;
  45025. case "colorSpecular":
  45026. i.specular = Ue.fromArray(r).getHex();
  45027. break;
  45028. case "colorEmissive":
  45029. i.emissive = Ue.fromArray(r).getHex();
  45030. break;
  45031. case "specularCoef":
  45032. i.shininess = r;
  45033. break;
  45034. case "shading":
  45035. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45036. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45037. break;
  45038. case "mapDiffuse":
  45039. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45040. break;
  45041. case "mapDiffuseRepeat":
  45042. case "mapDiffuseOffset":
  45043. case "mapDiffuseWrap":
  45044. case "mapDiffuseAnisotropy":
  45045. break;
  45046. case "mapLight":
  45047. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45048. break;
  45049. case "mapLightRepeat":
  45050. case "mapLightOffset":
  45051. case "mapLightWrap":
  45052. case "mapLightAnisotropy":
  45053. break;
  45054. case "mapAO":
  45055. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45056. break;
  45057. case "mapAORepeat":
  45058. case "mapAOOffset":
  45059. case "mapAOWrap":
  45060. case "mapAOAnisotropy":
  45061. break;
  45062. case "mapBump":
  45063. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45064. break;
  45065. case "mapBumpScale":
  45066. i.bumpScale = r;
  45067. break;
  45068. case "mapBumpRepeat":
  45069. case "mapBumpOffset":
  45070. case "mapBumpWrap":
  45071. case "mapBumpAnisotropy":
  45072. break;
  45073. case "mapNormal":
  45074. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45075. break;
  45076. case "mapNormalFactor":
  45077. i.normalScale = [r, r];
  45078. break;
  45079. case "mapNormalRepeat":
  45080. case "mapNormalOffset":
  45081. case "mapNormalWrap":
  45082. case "mapNormalAnisotropy":
  45083. break;
  45084. case "mapSpecular":
  45085. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45086. break;
  45087. case "mapSpecularRepeat":
  45088. case "mapSpecularOffset":
  45089. case "mapSpecularWrap":
  45090. case "mapSpecularAnisotropy":
  45091. break;
  45092. case "mapAlpha":
  45093. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45094. break;
  45095. case "mapAlphaRepeat":
  45096. case "mapAlphaOffset":
  45097. case "mapAlphaWrap":
  45098. case "mapAlphaAnisotropy":
  45099. break;
  45100. case "flipSided":
  45101. i.side = Ci.BackSide;
  45102. break;
  45103. case "doubleSided":
  45104. i.side = Ci.DoubleSide;
  45105. break;
  45106. case "transparency":
  45107. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45108. i.opacity = r;
  45109. break;
  45110. case "depthTest":
  45111. case "depthWrite":
  45112. case "colorWrite":
  45113. case "opacity":
  45114. case "reflectivity":
  45115. case "transparent":
  45116. case "visible":
  45117. case "wireframe":
  45118. i[n] = r;
  45119. break;
  45120. case "vertexColors":
  45121. !0 === r && (i.vertexColors = Ci.VertexColors),
  45122. "face" === r && (i.vertexColors = Ci.FaceColors);
  45123. break;
  45124. default:
  45125. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45126. }
  45127. }
  45128. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45129. "MeshPhongMaterial" !== i.type && delete i.specular,
  45130. i.opacity < 1 && (i.transparent = !0),
  45131. ze.setTextures(u),
  45132. ze.parse(i)
  45133. }
  45134. },
  45135. Ci.Loader.Handlers = {
  45136. handlers: [],
  45137. add: function(e, t) {
  45138. this.handlers.push(e, t)
  45139. },
  45140. get: function(e) {
  45141. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45142. var r = t[i]
  45143. , o = t[i + 1];
  45144. if (r.test(e))
  45145. return o
  45146. }
  45147. return null
  45148. }
  45149. },
  45150. Ci.XHRLoader = function(e) {
  45151. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45152. }
  45153. ,
  45154. Ci.XHRLoader.prototype = {
  45155. constructor: Ci.XHRLoader,
  45156. load: function(i, n, t, r) {
  45157. void 0 !== this.path && (i = this.path + i);
  45158. var o = this
  45159. , e = Ci.Cache.get(i);
  45160. if (void 0 !== e)
  45161. return n && setTimeout(function() {
  45162. n(e)
  45163. }, 0),
  45164. e;
  45165. var a = new XMLHttpRequest;
  45166. return a.overrideMimeType("text/plain"),
  45167. a.open("GET", i, !0),
  45168. a.addEventListener("load", function(e) {
  45169. var t = e.target.response;
  45170. Ci.Cache.add(i, t),
  45171. 200 === this.status ? (n && n(t),
  45172. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45173. n && n(t),
  45174. o.manager.itemEnd(i)) : (r && r(e),
  45175. o.manager.itemError(i))
  45176. }, !1),
  45177. void 0 !== t && a.addEventListener("progress", function(e) {
  45178. t(e)
  45179. }, !1),
  45180. a.addEventListener("error", function(e) {
  45181. r && r(e),
  45182. o.manager.itemError(i)
  45183. }, !1),
  45184. void 0 !== this.responseType && (a.responseType = this.responseType),
  45185. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45186. a.send(null),
  45187. o.manager.itemStart(i),
  45188. a
  45189. },
  45190. setPath: function(e) {
  45191. this.path = e
  45192. },
  45193. setResponseType: function(e) {
  45194. this.responseType = e
  45195. },
  45196. setWithCredentials: function(e) {
  45197. this.withCredentials = e
  45198. }
  45199. },
  45200. Ci.FontLoader = function(e) {
  45201. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45202. }
  45203. ,
  45204. Ci.FontLoader.prototype = {
  45205. constructor: Ci.FontLoader,
  45206. load: function(e, t, i, n) {
  45207. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45208. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45209. }, i, n)
  45210. }
  45211. },
  45212. Ci.ImageLoader = function(e) {
  45213. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45214. }
  45215. ,
  45216. Ci.ImageLoader.prototype = {
  45217. constructor: Ci.ImageLoader,
  45218. load: function(t, i, n, r) {
  45219. void 0 !== this.path && (t = this.path + t);
  45220. var o = this
  45221. , e = Ci.Cache.get(t);
  45222. if (void 0 !== e)
  45223. return o.manager.itemStart(t),
  45224. i ? setTimeout(function() {
  45225. i(e),
  45226. o.manager.itemEnd(t)
  45227. }, 0) : o.manager.itemEnd(t),
  45228. e;
  45229. var a = document.createElement("img");
  45230. return a.addEventListener("load", function(e) {
  45231. Ci.Cache.add(t, this),
  45232. i && i(this),
  45233. o.manager.itemEnd(t)
  45234. }, !1),
  45235. void 0 !== n && a.addEventListener("progress", function(e) {
  45236. n(e)
  45237. }, !1),
  45238. a.addEventListener("error", function(e) {
  45239. r && r(e),
  45240. o.manager.itemError(t)
  45241. }, !1),
  45242. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45243. o.manager.itemStart(t),
  45244. a.src = t,
  45245. a
  45246. },
  45247. setCrossOrigin: function(e) {
  45248. this.crossOrigin = e
  45249. },
  45250. setPath: function(e) {
  45251. this.path = e
  45252. }
  45253. },
  45254. Ci.JSONLoader = function(e) {
  45255. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45256. e = void 0),
  45257. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45258. this.withCredentials = !1
  45259. }
  45260. ,
  45261. Ci.JSONLoader.prototype = {
  45262. constructor: Ci.JSONLoader,
  45263. get statusDomElement() {
  45264. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45265. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45266. this._statusDomElement
  45267. },
  45268. load: function(o, a, e, t) {
  45269. var s = this
  45270. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45271. , i = new Ci.XHRLoader(this.manager);
  45272. i.setWithCredentials(this.withCredentials),
  45273. i.load(o, function(e) {
  45274. var t = JSON.parse(e)
  45275. , i = t.metadata;
  45276. if (void 0 !== i) {
  45277. var n = i.type;
  45278. if (void 0 !== n) {
  45279. if ("object" === n.toLowerCase())
  45280. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45281. if ("scene" === n.toLowerCase())
  45282. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45283. }
  45284. }
  45285. var r = s.parse(t, l);
  45286. a(r.geometry, r.materials)
  45287. }, e, t)
  45288. },
  45289. setTexturePath: function(e) {
  45290. this.texturePath = e
  45291. },
  45292. parse: function(D, e) {
  45293. var N = new Ci.Geometry
  45294. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45295. if (function(e) {
  45296. function t(e, t) {
  45297. return e & 1 << t
  45298. }
  45299. 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;
  45300. if (void 0 !== D.uvs) {
  45301. for (i = 0; i < D.uvs.length; i++)
  45302. D.uvs[i].length && L++;
  45303. for (i = 0; i < L; i++)
  45304. N.faceVertexUvs[i] = []
  45305. }
  45306. for (o = 0,
  45307. a = R.length; o < a; )
  45308. (A = new Ci.Vector3).x = R[o++] * e,
  45309. A.y = R[o++] * e,
  45310. A.z = R[o++] * e,
  45311. N.vertices.push(A);
  45312. for (o = 0,
  45313. a = M.length; o < a; )
  45314. if (d = t(u = M[o++], 0),
  45315. p = t(u, 1),
  45316. f = t(u, 3),
  45317. g = t(u, 4),
  45318. m = t(u, 5),
  45319. v = t(u, 6),
  45320. y = t(u, 7),
  45321. d) {
  45322. if ((I = new Ci.Face3).a = M[o],
  45323. I.b = M[o + 1],
  45324. I.c = M[o + 3],
  45325. (E = new Ci.Face3).a = M[o + 1],
  45326. E.b = M[o + 2],
  45327. E.c = M[o + 3],
  45328. o += 4,
  45329. p && (h = M[o++],
  45330. I.materialIndex = h,
  45331. E.materialIndex = h),
  45332. r = N.faces.length,
  45333. f)
  45334. for (i = 0; i < L; i++)
  45335. for (w = D.uvs[i],
  45336. N.faceVertexUvs[i][r] = [],
  45337. N.faceVertexUvs[i][r + 1] = [],
  45338. n = 0; n < 4; n++)
  45339. x = w[2 * (c = M[o++])],
  45340. S = w[2 * c + 1],
  45341. T = new Ci.Vector2(x,S),
  45342. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45343. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45344. if (g && (l = 3 * M[o++],
  45345. I.normal.set(P[l++], P[l++], P[l]),
  45346. E.normal.copy(I.normal)),
  45347. m)
  45348. for (i = 0; i < 4; i++)
  45349. l = 3 * M[o++],
  45350. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45351. 2 !== i && I.vertexNormals.push(b),
  45352. 0 !== i && E.vertexNormals.push(b);
  45353. if (v && (_ = O[s = M[o++]],
  45354. I.color.setHex(_),
  45355. E.color.setHex(_)),
  45356. y)
  45357. for (i = 0; i < 4; i++)
  45358. _ = O[s = M[o++]],
  45359. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45360. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45361. N.faces.push(I),
  45362. N.faces.push(E)
  45363. } else {
  45364. if ((C = new Ci.Face3).a = M[o++],
  45365. C.b = M[o++],
  45366. C.c = M[o++],
  45367. p && (h = M[o++],
  45368. C.materialIndex = h),
  45369. r = N.faces.length,
  45370. f)
  45371. for (i = 0; i < L; i++)
  45372. for (w = D.uvs[i],
  45373. N.faceVertexUvs[i][r] = [],
  45374. n = 0; n < 3; n++)
  45375. x = w[2 * (c = M[o++])],
  45376. S = w[2 * c + 1],
  45377. T = new Ci.Vector2(x,S),
  45378. N.faceVertexUvs[i][r].push(T);
  45379. if (g && (l = 3 * M[o++],
  45380. C.normal.set(P[l++], P[l++], P[l])),
  45381. m)
  45382. for (i = 0; i < 3; i++)
  45383. l = 3 * M[o++],
  45384. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45385. C.vertexNormals.push(b);
  45386. if (v && (s = M[o++],
  45387. C.color.setHex(O[s])),
  45388. y)
  45389. for (i = 0; i < 3; i++)
  45390. s = M[o++],
  45391. C.vertexColors.push(new Ci.Color(O[s]));
  45392. N.faces.push(C)
  45393. }
  45394. }(t),
  45395. function() {
  45396. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45397. if (D.skinWeights)
  45398. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45399. var n = D.skinWeights[t]
  45400. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45401. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45402. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45403. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45404. }
  45405. if (D.skinIndices)
  45406. for (t = 0,
  45407. i = D.skinIndices.length; t < i; t += e) {
  45408. var s = D.skinIndices[t]
  45409. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45410. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45411. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45412. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45413. }
  45414. N.bones = D.bones,
  45415. 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.")
  45416. }(),
  45417. function(e) {
  45418. if (void 0 !== D.morphTargets)
  45419. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45420. N.morphTargets[t] = {},
  45421. N.morphTargets[t].name = D.morphTargets[t].name,
  45422. N.morphTargets[t].vertices = [];
  45423. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45424. var s = new Ci.Vector3;
  45425. s.x = r[o] * e,
  45426. s.y = r[o + 1] * e,
  45427. s.z = r[o + 2] * e,
  45428. n.push(s)
  45429. }
  45430. }
  45431. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45432. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45433. var l = N.faces
  45434. , c = D.morphColors[0].colors;
  45435. for (t = 0,
  45436. i = l.length; t < i; t++)
  45437. l[t].color.fromArray(c, 3 * t)
  45438. }
  45439. }(t),
  45440. function() {
  45441. var e = []
  45442. , t = [];
  45443. void 0 !== D.animation && t.push(D.animation),
  45444. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45445. for (var i = 0; i < t.length; i++) {
  45446. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45447. n && e.push(n)
  45448. }
  45449. if (N.morphTargets) {
  45450. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45451. e = e.concat(r)
  45452. }
  45453. 0 < e.length && (N.animations = e)
  45454. }(),
  45455. N.computeFaceNormals(),
  45456. N.computeBoundingSphere(),
  45457. void 0 === D.materials || 0 === D.materials.length)
  45458. return {
  45459. geometry: N
  45460. };
  45461. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45462. return {
  45463. geometry: N,
  45464. materials: i
  45465. }
  45466. }
  45467. },
  45468. Ci.LoadingManager = function(e, t, i) {
  45469. var n = this
  45470. , r = !1
  45471. , o = 0
  45472. , a = 0;
  45473. this.onStart = void 0,
  45474. this.onLoad = e,
  45475. this.onProgress = t,
  45476. this.onError = i,
  45477. this.itemStart = function(e) {
  45478. a++,
  45479. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45480. r = !0
  45481. }
  45482. ,
  45483. this.itemEnd = function(e) {
  45484. o++,
  45485. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45486. o === a && (r = !1,
  45487. void 0 !== n.onLoad && n.onLoad())
  45488. }
  45489. ,
  45490. this.itemError = function(e) {
  45491. void 0 !== n.onError && n.onError(e)
  45492. }
  45493. }
  45494. ,
  45495. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45496. Ci.BufferGeometryLoader = function(e) {
  45497. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45498. }
  45499. ,
  45500. Ci.BufferGeometryLoader.prototype = {
  45501. constructor: Ci.BufferGeometryLoader,
  45502. load: function(e, t, i, n) {
  45503. var r = this;
  45504. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45505. t(r.parse(JSON.parse(e)))
  45506. }, i, n)
  45507. },
  45508. parse: function(e) {
  45509. var t = new Ci.BufferGeometry
  45510. , i = e.data.index
  45511. , n = {
  45512. Int8Array: Int8Array,
  45513. Uint8Array: Uint8Array,
  45514. Uint8ClampedArray: Uint8ClampedArray,
  45515. Int16Array: Int16Array,
  45516. Uint16Array: Uint16Array,
  45517. Int32Array: Int32Array,
  45518. Uint32Array: Uint32Array,
  45519. Float32Array: Float32Array,
  45520. Float64Array: Float64Array
  45521. };
  45522. if (void 0 !== i) {
  45523. var r = new n[i.type](i.array);
  45524. t.setIndex(new Ci.BufferAttribute(r,1))
  45525. }
  45526. var o = e.data.attributes;
  45527. for (var a in o) {
  45528. var s = o[a];
  45529. r = new n[s.type](s.array);
  45530. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45531. }
  45532. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45533. if (void 0 !== l)
  45534. for (var c = 0, h = l.length; c !== h; ++c) {
  45535. var u = l[c];
  45536. t.addGroup(u.start, u.count, u.materialIndex)
  45537. }
  45538. var d = e.data.boundingSphere;
  45539. if (void 0 !== d) {
  45540. var p = new Ci.Vector3;
  45541. void 0 !== d.center && p.fromArray(d.center),
  45542. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45543. }
  45544. return t
  45545. }
  45546. },
  45547. Ci.MaterialLoader = function(e) {
  45548. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45549. this.textures = {}
  45550. }
  45551. ,
  45552. Ci.MaterialLoader.prototype = {
  45553. constructor: Ci.MaterialLoader,
  45554. load: function(e, t, i, n) {
  45555. var r = this;
  45556. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45557. t(r.parse(JSON.parse(e)))
  45558. }, i, n)
  45559. },
  45560. setTextures: function(e) {
  45561. this.textures = e
  45562. },
  45563. getTexture: function(e) {
  45564. var t = this.textures;
  45565. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45566. t[e]
  45567. },
  45568. parse: function(e) {
  45569. var t = new Ci[e.type];
  45570. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45571. void 0 !== e.name && (t.name = e.name),
  45572. void 0 !== e.color && t.color.setHex(e.color),
  45573. void 0 !== e.roughness && (t.roughness = e.roughness),
  45574. void 0 !== e.metalness && (t.metalness = e.metalness),
  45575. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45576. void 0 !== e.specular && t.specular.setHex(e.specular),
  45577. void 0 !== e.shininess && (t.shininess = e.shininess),
  45578. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45579. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45580. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45581. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45582. void 0 !== e.shading && (t.shading = e.shading),
  45583. void 0 !== e.blending && (t.blending = e.blending),
  45584. void 0 !== e.side && (t.side = e.side),
  45585. void 0 !== e.opacity && (t.opacity = e.opacity),
  45586. void 0 !== e.transparent && (t.transparent = e.transparent),
  45587. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45588. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45589. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45590. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45591. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45592. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45593. void 0 !== e.size && (t.size = e.size),
  45594. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45595. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45596. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45597. t.transparent = !0),
  45598. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45599. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45600. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45601. void 0 !== e.normalScale) {
  45602. var i = e.normalScale;
  45603. !1 === Array.isArray(i) && (i = [i, i]),
  45604. t.normalScale = (new Ci.Vector2).fromArray(i)
  45605. }
  45606. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45607. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45608. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45609. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45610. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45611. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45612. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45613. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45614. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45615. t.combine = Ci.MultiplyOperation),
  45616. e.reflectivity && (t.reflectivity = e.reflectivity),
  45617. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45618. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45619. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45620. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45621. void 0 !== e.materials)
  45622. for (var n = 0, r = e.materials.length; n < r; n++)
  45623. t.materials.push(this.parse(e.materials[n]));
  45624. return t
  45625. }
  45626. },
  45627. Ci.ObjectLoader = function(e) {
  45628. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45629. this.texturePath = ""
  45630. }
  45631. ,
  45632. Ci.ObjectLoader.prototype = {
  45633. constructor: Ci.ObjectLoader,
  45634. load: function(e, t, i, n) {
  45635. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45636. var r = this;
  45637. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45638. r.parse(JSON.parse(e), t)
  45639. }, i, n)
  45640. },
  45641. setTexturePath: function(e) {
  45642. this.texturePath = e
  45643. },
  45644. setCrossOrigin: function(e) {
  45645. this.crossOrigin = e
  45646. },
  45647. parse: function(e, t) {
  45648. var i = this.parseGeometries(e.geometries)
  45649. , n = this.parseImages(e.images, function() {
  45650. void 0 !== t && t(a)
  45651. })
  45652. , r = this.parseTextures(e.textures, n)
  45653. , o = this.parseMaterials(e.materials, r)
  45654. , a = this.parseObject(e.object, i, o);
  45655. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45656. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45657. a
  45658. },
  45659. parseGeometries: function(e) {
  45660. var t = {};
  45661. if (void 0 !== e)
  45662. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45663. var a, s = e[r];
  45664. switch (s.type) {
  45665. case "PlaneGeometry":
  45666. case "PlaneBufferGeometry":
  45667. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45668. break;
  45669. case "BoxGeometry":
  45670. case "BoxBufferGeometry":
  45671. case "CubeGeometry":
  45672. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45673. break;
  45674. case "CircleGeometry":
  45675. case "CircleBufferGeometry":
  45676. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45677. break;
  45678. case "CylinderGeometry":
  45679. case "CylinderBufferGeometry":
  45680. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45681. break;
  45682. case "SphereGeometry":
  45683. case "SphereBufferGeometry":
  45684. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45685. break;
  45686. case "DodecahedronGeometry":
  45687. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45688. break;
  45689. case "IcosahedronGeometry":
  45690. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45691. break;
  45692. case "OctahedronGeometry":
  45693. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45694. break;
  45695. case "TetrahedronGeometry":
  45696. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45697. break;
  45698. case "RingGeometry":
  45699. case "RingBufferGeometry":
  45700. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45701. break;
  45702. case "TorusGeometry":
  45703. case "TorusBufferGeometry":
  45704. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45705. break;
  45706. case "TorusKnotGeometry":
  45707. case "TorusKnotBufferGeometry":
  45708. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45709. break;
  45710. case "LatheGeometry":
  45711. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45712. break;
  45713. case "BufferGeometry":
  45714. a = n.parse(s);
  45715. break;
  45716. case "Geometry":
  45717. a = i.parse(s.data, this.texturePath).geometry;
  45718. break;
  45719. default:
  45720. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45721. continue
  45722. }
  45723. a.uuid = s.uuid,
  45724. void 0 !== s.name && (a.name = s.name),
  45725. t[s.uuid] = a
  45726. }
  45727. return t
  45728. },
  45729. parseMaterials: function(e, t) {
  45730. var i = {};
  45731. if (void 0 !== e) {
  45732. var n = new Ci.MaterialLoader;
  45733. n.setTextures(t);
  45734. for (var r = 0, o = e.length; r < o; r++) {
  45735. var a = n.parse(e[r]);
  45736. i[a.uuid] = a
  45737. }
  45738. }
  45739. return i
  45740. },
  45741. parseAnimations: function(e) {
  45742. for (var t = [], i = 0; i < e.length; i++) {
  45743. var n = Ci.AnimationClip.parse(e[i]);
  45744. t.push(n)
  45745. }
  45746. return t
  45747. },
  45748. parseImages: function(e, t) {
  45749. function i(e) {
  45750. return n.manager.itemStart(e),
  45751. a.load(e, function() {
  45752. n.manager.itemEnd(e)
  45753. })
  45754. }
  45755. var n = this
  45756. , r = {};
  45757. if (void 0 !== e && 0 < e.length) {
  45758. var o = new Ci.LoadingManager(t)
  45759. , a = new Ci.ImageLoader(o);
  45760. a.setCrossOrigin(this.crossOrigin);
  45761. for (var s = 0, l = e.length; s < l; s++) {
  45762. var c = e[s]
  45763. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45764. r[c.uuid] = i(h)
  45765. }
  45766. }
  45767. return r
  45768. },
  45769. parseTextures: function(e, t) {
  45770. function i(e) {
  45771. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45772. Ci[e])
  45773. }
  45774. var n = {};
  45775. if (void 0 !== e)
  45776. for (var r = 0, o = e.length; r < o; r++) {
  45777. var a = e[r];
  45778. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  45779. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  45780. var s = new Ci.Texture(t[a.image]);
  45781. s.needsUpdate = !0,
  45782. s.uuid = a.uuid,
  45783. void 0 !== a.name && (s.name = a.name),
  45784. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  45785. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  45786. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  45787. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  45788. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  45789. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  45790. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  45791. s.wrapT = i(a.wrap[1])),
  45792. n[a.uuid] = s
  45793. }
  45794. return n
  45795. },
  45796. parseObject: (ke = new Ci.Matrix4,
  45797. function(e, t, i) {
  45798. function n(e) {
  45799. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  45800. t[e]
  45801. }
  45802. function r(e) {
  45803. if (void 0 !== e)
  45804. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  45805. i[e]
  45806. }
  45807. var o;
  45808. switch (e.type) {
  45809. case "Scene":
  45810. o = new Ci.Scene;
  45811. break;
  45812. case "PerspectiveCamera":
  45813. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  45814. break;
  45815. case "OrthographicCamera":
  45816. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  45817. break;
  45818. case "AmbientLight":
  45819. o = new Ci.AmbientLight(e.color,e.intensity);
  45820. break;
  45821. case "DirectionalLight":
  45822. o = new Ci.DirectionalLight(e.color,e.intensity);
  45823. break;
  45824. case "PointLight":
  45825. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  45826. break;
  45827. case "SpotLight":
  45828. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  45829. break;
  45830. case "HemisphereLight":
  45831. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  45832. break;
  45833. case "Mesh":
  45834. var a = n(e.geometry)
  45835. , s = r(e.material);
  45836. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  45837. break;
  45838. case "LOD":
  45839. o = new Ci.LOD;
  45840. break;
  45841. case "Line":
  45842. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  45843. break;
  45844. case "PointCloud":
  45845. case "Points":
  45846. o = new Ci.Points(n(e.geometry),r(e.material));
  45847. break;
  45848. case "Sprite":
  45849. o = new Ci.Sprite(r(e.material));
  45850. break;
  45851. case "Group":
  45852. o = new Ci.Group;
  45853. break;
  45854. default:
  45855. o = new Ci.Object3D
  45856. }
  45857. if (o.uuid = e.uuid,
  45858. void 0 !== e.name && (o.name = e.name),
  45859. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  45860. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  45861. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  45862. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  45863. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  45864. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  45865. void 0 !== e.visible && (o.visible = e.visible),
  45866. void 0 !== e.userData && (o.userData = e.userData),
  45867. void 0 !== e.children)
  45868. for (var l in e.children)
  45869. o.add(this.parseObject(e.children[l], t, i));
  45870. if ("LOD" === e.type)
  45871. for (var c = e.levels, h = 0; h < c.length; h++) {
  45872. var u = c[h];
  45873. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  45874. }
  45875. return o
  45876. }
  45877. )
  45878. },
  45879. Ci.TextureLoader = function(e) {
  45880. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45881. }
  45882. ,
  45883. Ci.TextureLoader.prototype = {
  45884. constructor: Ci.TextureLoader,
  45885. load: function(e, t, i, n) {
  45886. var r = new Ci.Texture
  45887. , o = new Ci.ImageLoader(this.manager);
  45888. return o.setCrossOrigin(this.crossOrigin),
  45889. o.setPath(this.path),
  45890. o.load(e, function(e) {
  45891. r.image = e,
  45892. r.needsUpdate = !0,
  45893. void 0 !== t && t(r)
  45894. }, i, n),
  45895. r
  45896. },
  45897. setCrossOrigin: function(e) {
  45898. this.crossOrigin = e
  45899. },
  45900. setPath: function(e) {
  45901. this.path = e
  45902. }
  45903. },
  45904. Ci.CubeTextureLoader = function(e) {
  45905. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45906. }
  45907. ,
  45908. Ci.CubeTextureLoader.prototype = {
  45909. constructor: Ci.CubeTextureLoader,
  45910. load: function(e, i, t, n) {
  45911. function r(t) {
  45912. a.load(e[t], function(e) {
  45913. o.images[t] = e,
  45914. 6 === ++s && (o.needsUpdate = !0,
  45915. i && i(o))
  45916. }, void 0, n)
  45917. }
  45918. var o = new Ci.CubeTexture
  45919. , a = new Ci.ImageLoader(this.manager);
  45920. a.setCrossOrigin(this.crossOrigin),
  45921. a.setPath(this.path);
  45922. for (var s = 0, l = 0; l < e.length; ++l)
  45923. r(l);
  45924. return o
  45925. },
  45926. setCrossOrigin: function(e) {
  45927. this.crossOrigin = e
  45928. },
  45929. setPath: function(e) {
  45930. this.path = e
  45931. }
  45932. },
  45933. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  45934. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45935. this._parser = null
  45936. }
  45937. ,
  45938. Ci.BinaryTextureLoader.prototype = {
  45939. constructor: Ci.BinaryTextureLoader,
  45940. load: function(e, i, t, n) {
  45941. var r = this
  45942. , o = new Ci.DataTexture
  45943. , a = new Ci.XHRLoader(this.manager);
  45944. return a.setResponseType("arraybuffer"),
  45945. a.load(e, function(e) {
  45946. var t = r._parser(e);
  45947. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  45948. o.image.height = t.height,
  45949. o.image.data = t.data),
  45950. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  45951. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  45952. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  45953. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  45954. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  45955. void 0 !== t.format && (o.format = t.format),
  45956. void 0 !== t.type && (o.type = t.type),
  45957. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  45958. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  45959. o.needsUpdate = !0,
  45960. i && i(o, t))
  45961. }, t, n),
  45962. o
  45963. }
  45964. },
  45965. Ci.CompressedTextureLoader = function(e) {
  45966. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45967. this._parser = null
  45968. }
  45969. ,
  45970. Ci.CompressedTextureLoader.prototype = {
  45971. constructor: Ci.CompressedTextureLoader,
  45972. load: function(e, o, t, n) {
  45973. function i(i) {
  45974. r.load(e[i], function(e) {
  45975. var t = a._parser(e, !0);
  45976. s[i] = {
  45977. width: t.width,
  45978. height: t.height,
  45979. format: t.format,
  45980. mipmaps: t.mipmaps
  45981. },
  45982. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45983. l.format = t.format,
  45984. l.needsUpdate = !0,
  45985. o && o(l))
  45986. }, t, n)
  45987. }
  45988. var a = this
  45989. , s = []
  45990. , l = new Ci.CompressedTexture;
  45991. l.image = s;
  45992. var r = new Ci.XHRLoader(this.manager);
  45993. if (r.setPath(this.path),
  45994. r.setResponseType("arraybuffer"),
  45995. Array.isArray(e))
  45996. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  45997. i(h);
  45998. else
  45999. r.load(e, function(e) {
  46000. var t = a._parser(e, !0);
  46001. if (t.isCubemap)
  46002. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46003. s[n] = {
  46004. mipmaps: []
  46005. };
  46006. for (var r = 0; r < t.mipmapCount; r++)
  46007. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46008. s[n].format = t.format,
  46009. s[n].width = t.width,
  46010. s[n].height = t.height
  46011. }
  46012. else
  46013. l.image.width = t.width,
  46014. l.image.height = t.height,
  46015. l.mipmaps = t.mipmaps;
  46016. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46017. l.format = t.format,
  46018. l.needsUpdate = !0,
  46019. o && o(l)
  46020. }, t, n);
  46021. return l
  46022. },
  46023. setPath: function(e) {
  46024. this.path = e
  46025. }
  46026. },
  46027. Ci.Material = function() {
  46028. Object.defineProperty(this, "id", {
  46029. value: Ci.MaterialIdCount++
  46030. }),
  46031. this.uuid = Ci.Math.generateUUID(),
  46032. this.name = "",
  46033. this.type = "Material",
  46034. this.side = Ci.FrontSide,
  46035. this.opacity = 1,
  46036. this.transparent = !1,
  46037. this.blending = Ci.NormalBlending,
  46038. this.blendSrc = Ci.SrcAlphaFactor,
  46039. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46040. this.blendEquation = Ci.AddEquation,
  46041. this.blendSrcAlpha = null,
  46042. this.blendDstAlpha = null,
  46043. this.blendEquationAlpha = null,
  46044. this.depthFunc = Ci.LessEqualDepth,
  46045. this.depthTest = !0,
  46046. this.depthWrite = !0,
  46047. this.colorWrite = !0,
  46048. this.precision = null,
  46049. this.polygonOffset = !1,
  46050. this.polygonOffsetFactor = 0,
  46051. this.polygonOffsetUnits = 0,
  46052. this.alphaTest = 0,
  46053. this.premultipliedAlpha = !1,
  46054. this.overdraw = 0,
  46055. this.visible = !0,
  46056. this._needsUpdate = !0
  46057. }
  46058. ,
  46059. Ci.Material.prototype = {
  46060. constructor: Ci.Material,
  46061. get needsUpdate() {
  46062. return this._needsUpdate
  46063. },
  46064. set needsUpdate(e) {
  46065. !0 === e && this.update(),
  46066. this._needsUpdate = e
  46067. },
  46068. setValues: function(e) {
  46069. if (void 0 !== e)
  46070. for (var t in e) {
  46071. var i = e[t];
  46072. if (void 0 !== i) {
  46073. var n = this[t];
  46074. 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.")
  46075. } else
  46076. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46077. }
  46078. },
  46079. toJSON: function(e) {
  46080. function t(e) {
  46081. var t = [];
  46082. for (var i in e) {
  46083. var n = e[i];
  46084. delete n.metadata,
  46085. t.push(n)
  46086. }
  46087. return t
  46088. }
  46089. var i = void 0 === e;
  46090. i && (e = {
  46091. textures: {},
  46092. images: {}
  46093. });
  46094. var n = {
  46095. metadata: {
  46096. version: 4.4,
  46097. type: "Material",
  46098. generator: "Material.toJSON"
  46099. }
  46100. };
  46101. if (n.uuid = this.uuid,
  46102. n.type = this.type,
  46103. "" !== this.name && (n.name = this.name),
  46104. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46105. .5 !== this.roughness && (n.roughness = this.roughness),
  46106. .5 !== this.metalness && (n.metalness = this.metalness),
  46107. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46108. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46109. void 0 !== this.shininess && (n.shininess = this.shininess),
  46110. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46111. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46112. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46113. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46114. n.bumpScale = this.bumpScale),
  46115. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46116. n.normalScale = this.normalScale.toArray()),
  46117. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46118. n.displacementScale = this.displacementScale,
  46119. n.displacementBias = this.displacementBias),
  46120. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46121. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46122. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46123. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46124. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46125. n.reflectivity = this.reflectivity),
  46126. void 0 !== this.size && (n.size = this.size),
  46127. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46128. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46129. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46130. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46131. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46132. this.opacity < 1 && (n.opacity = this.opacity),
  46133. !0 === this.transparent && (n.transparent = this.transparent),
  46134. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46135. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46136. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46137. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46138. i) {
  46139. var r = t(e.textures)
  46140. , o = t(e.images);
  46141. 0 < r.length && (n.textures = r),
  46142. 0 < o.length && (n.images = o)
  46143. }
  46144. return n
  46145. },
  46146. clone: function() {
  46147. return (new this.constructor).copy(this)
  46148. },
  46149. copy: function(e) {
  46150. return this.name = e.name,
  46151. this.side = e.side,
  46152. this.opacity = e.opacity,
  46153. this.transparent = e.transparent,
  46154. this.blending = e.blending,
  46155. this.blendSrc = e.blendSrc,
  46156. this.blendDst = e.blendDst,
  46157. this.blendEquation = e.blendEquation,
  46158. this.blendSrcAlpha = e.blendSrcAlpha,
  46159. this.blendDstAlpha = e.blendDstAlpha,
  46160. this.blendEquationAlpha = e.blendEquationAlpha,
  46161. this.depthFunc = e.depthFunc,
  46162. this.depthTest = e.depthTest,
  46163. this.depthWrite = e.depthWrite,
  46164. this.colorWrite = e.colorWrite,
  46165. this.precision = e.precision,
  46166. this.polygonOffset = e.polygonOffset,
  46167. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46168. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46169. this.alphaTest = e.alphaTest,
  46170. this.premultipliedAlpha = e.premultipliedAlpha,
  46171. this.overdraw = e.overdraw,
  46172. this.visible = e.visible,
  46173. this
  46174. },
  46175. update: function() {
  46176. this.dispatchEvent({
  46177. type: "update"
  46178. })
  46179. },
  46180. dispose: function() {
  46181. this.dispatchEvent({
  46182. type: "dispose"
  46183. })
  46184. }
  46185. },
  46186. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46187. Ci.MaterialIdCount = 0,
  46188. Ci.LineBasicMaterial = function(e) {
  46189. Ci.Material.call(this),
  46190. this.type = "LineBasicMaterial",
  46191. this.color = new Ci.Color(16777215),
  46192. this.linewidth = 1,
  46193. this.linecap = "round",
  46194. this.linejoin = "round",
  46195. this.blending = Ci.NormalBlending,
  46196. this.vertexColors = Ci.NoColors,
  46197. this.fog = !0,
  46198. this.setValues(e)
  46199. }
  46200. ,
  46201. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46202. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46203. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46204. return Ci.Material.prototype.copy.call(this, e),
  46205. this.color.copy(e.color),
  46206. this.linewidth = e.linewidth,
  46207. this.linecap = e.linecap,
  46208. this.linejoin = e.linejoin,
  46209. this.vertexColors = e.vertexColors,
  46210. this.fog = e.fog,
  46211. this
  46212. }
  46213. ,
  46214. Ci.LineDashedMaterial = function(e) {
  46215. Ci.Material.call(this),
  46216. this.type = "LineDashedMaterial",
  46217. this.color = new Ci.Color(16777215),
  46218. this.linewidth = 1,
  46219. this.scale = 1,
  46220. this.dashSize = 3,
  46221. this.gapSize = 1,
  46222. this.blending = Ci.NormalBlending,
  46223. this.vertexColors = Ci.NoColors,
  46224. this.fog = !0,
  46225. this.setValues(e)
  46226. }
  46227. ,
  46228. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46229. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46230. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46231. return Ci.Material.prototype.copy.call(this, e),
  46232. this.color.copy(e.color),
  46233. this.linewidth = e.linewidth,
  46234. this.scale = e.scale,
  46235. this.dashSize = e.dashSize,
  46236. this.gapSize = e.gapSize,
  46237. this.vertexColors = e.vertexColors,
  46238. this.fog = e.fog,
  46239. this
  46240. }
  46241. ,
  46242. Ci.MeshBasicMaterial = function(e) {
  46243. Ci.Material.call(this),
  46244. this.type = "MeshBasicMaterial",
  46245. this.color = new Ci.Color(16777215),
  46246. this.map = null,
  46247. this.aoMap = null,
  46248. this.aoMapIntensity = 1,
  46249. this.specularMap = null,
  46250. this.alphaMap = null,
  46251. this.envMap = null,
  46252. this.combine = Ci.MultiplyOperation,
  46253. this.reflectivity = 1,
  46254. this.refractionRatio = .98,
  46255. this.fog = !0,
  46256. this.shading = Ci.SmoothShading,
  46257. this.blending = Ci.NormalBlending,
  46258. this.wireframe = !1,
  46259. this.wireframeLinewidth = 1,
  46260. this.wireframeLinecap = "round",
  46261. this.wireframeLinejoin = "round",
  46262. this.vertexColors = Ci.NoColors,
  46263. this.skinning = !1,
  46264. this.morphTargets = !1,
  46265. this.setValues(e)
  46266. }
  46267. ,
  46268. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46269. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46270. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46271. return Ci.Material.prototype.copy.call(this, e),
  46272. this.color.copy(e.color),
  46273. this.map = e.map,
  46274. this.aoMap = e.aoMap,
  46275. this.aoMapIntensity = e.aoMapIntensity,
  46276. this.specularMap = e.specularMap,
  46277. this.alphaMap = e.alphaMap,
  46278. this.envMap = e.envMap,
  46279. this.combine = e.combine,
  46280. this.reflectivity = e.reflectivity,
  46281. this.refractionRatio = e.refractionRatio,
  46282. this.fog = e.fog,
  46283. this.shading = e.shading,
  46284. this.wireframe = e.wireframe,
  46285. this.wireframeLinewidth = e.wireframeLinewidth,
  46286. this.wireframeLinecap = e.wireframeLinecap,
  46287. this.wireframeLinejoin = e.wireframeLinejoin,
  46288. this.vertexColors = e.vertexColors,
  46289. this.skinning = e.skinning,
  46290. this.morphTargets = e.morphTargets,
  46291. this
  46292. }
  46293. ,
  46294. Ci.MeshLambertMaterial = function(e) {
  46295. Ci.Material.call(this),
  46296. this.type = "MeshLambertMaterial",
  46297. this.color = new Ci.Color(16777215),
  46298. this.map = null,
  46299. this.lightMap = null,
  46300. this.lightMapIntensity = 1,
  46301. this.aoMap = null,
  46302. this.aoMapIntensity = 1,
  46303. this.emissive = new Ci.Color(0),
  46304. this.emissiveIntensity = 1,
  46305. this.emissiveMap = null,
  46306. this.specularMap = null,
  46307. this.alphaMap = null,
  46308. this.envMap = null,
  46309. this.combine = Ci.MultiplyOperation,
  46310. this.reflectivity = 1,
  46311. this.refractionRatio = .98,
  46312. this.fog = !0,
  46313. this.blending = Ci.NormalBlending,
  46314. this.wireframe = !1,
  46315. this.wireframeLinewidth = 1,
  46316. this.wireframeLinecap = "round",
  46317. this.wireframeLinejoin = "round",
  46318. this.vertexColors = Ci.NoColors,
  46319. this.skinning = !1,
  46320. this.morphTargets = !1,
  46321. this.morphNormals = !1,
  46322. this.setValues(e)
  46323. }
  46324. ,
  46325. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46326. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46327. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46328. return Ci.Material.prototype.copy.call(this, e),
  46329. this.color.copy(e.color),
  46330. this.map = e.map,
  46331. this.lightMap = e.lightMap,
  46332. this.lightMapIntensity = e.lightMapIntensity,
  46333. this.aoMap = e.aoMap,
  46334. this.aoMapIntensity = e.aoMapIntensity,
  46335. this.emissive.copy(e.emissive),
  46336. this.emissiveMap = e.emissiveMap,
  46337. this.emissiveIntensity = e.emissiveIntensity,
  46338. this.specularMap = e.specularMap,
  46339. this.alphaMap = e.alphaMap,
  46340. this.envMap = e.envMap,
  46341. this.combine = e.combine,
  46342. this.reflectivity = e.reflectivity,
  46343. this.refractionRatio = e.refractionRatio,
  46344. this.fog = e.fog,
  46345. this.wireframe = e.wireframe,
  46346. this.wireframeLinewidth = e.wireframeLinewidth,
  46347. this.wireframeLinecap = e.wireframeLinecap,
  46348. this.wireframeLinejoin = e.wireframeLinejoin,
  46349. this.vertexColors = e.vertexColors,
  46350. this.skinning = e.skinning,
  46351. this.morphTargets = e.morphTargets,
  46352. this.morphNormals = e.morphNormals,
  46353. this
  46354. }
  46355. ,
  46356. Ci.MeshPhongMaterial = function(e) {
  46357. Ci.Material.call(this),
  46358. this.type = "MeshPhongMaterial",
  46359. this.color = new Ci.Color(16777215),
  46360. this.specular = new Ci.Color(1118481),
  46361. this.shininess = 30,
  46362. this.map = null,
  46363. this.lightMap = null,
  46364. this.lightMapIntensity = 1,
  46365. this.aoMap = null,
  46366. this.aoMapIntensity = 1,
  46367. this.emissive = new Ci.Color(0),
  46368. this.emissiveIntensity = 1,
  46369. this.emissiveMap = null,
  46370. this.bumpMap = null,
  46371. this.bumpScale = 1,
  46372. this.normalMap = null,
  46373. this.normalScale = new Ci.Vector2(1,1),
  46374. this.displacementMap = null,
  46375. this.displacementScale = 1,
  46376. this.displacementBias = 0,
  46377. this.specularMap = null,
  46378. this.alphaMap = null,
  46379. this.envMap = null,
  46380. this.combine = Ci.MultiplyOperation,
  46381. this.reflectivity = 1,
  46382. this.refractionRatio = .98,
  46383. this.fog = !0,
  46384. this.shading = Ci.SmoothShading,
  46385. this.blending = Ci.NormalBlending,
  46386. this.wireframe = !1,
  46387. this.wireframeLinewidth = 1,
  46388. this.wireframeLinecap = "round",
  46389. this.wireframeLinejoin = "round",
  46390. this.vertexColors = Ci.NoColors,
  46391. this.skinning = !1,
  46392. this.morphTargets = !1,
  46393. this.morphNormals = !1,
  46394. this.setValues(e)
  46395. }
  46396. ,
  46397. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46398. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46399. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46400. return Ci.Material.prototype.copy.call(this, e),
  46401. this.color.copy(e.color),
  46402. this.specular.copy(e.specular),
  46403. this.shininess = e.shininess,
  46404. this.map = e.map,
  46405. this.lightMap = e.lightMap,
  46406. this.lightMapIntensity = e.lightMapIntensity,
  46407. this.aoMap = e.aoMap,
  46408. this.aoMapIntensity = e.aoMapIntensity,
  46409. this.emissive.copy(e.emissive),
  46410. this.emissiveMap = e.emissiveMap,
  46411. this.emissiveIntensity = e.emissiveIntensity,
  46412. this.bumpMap = e.bumpMap,
  46413. this.bumpScale = e.bumpScale,
  46414. this.normalMap = e.normalMap,
  46415. this.normalScale.copy(e.normalScale),
  46416. this.displacementMap = e.displacementMap,
  46417. this.displacementScale = e.displacementScale,
  46418. this.displacementBias = e.displacementBias,
  46419. this.specularMap = e.specularMap,
  46420. this.alphaMap = e.alphaMap,
  46421. this.envMap = e.envMap,
  46422. this.combine = e.combine,
  46423. this.reflectivity = e.reflectivity,
  46424. this.refractionRatio = e.refractionRatio,
  46425. this.fog = e.fog,
  46426. this.shading = e.shading,
  46427. this.wireframe = e.wireframe,
  46428. this.wireframeLinewidth = e.wireframeLinewidth,
  46429. this.wireframeLinecap = e.wireframeLinecap,
  46430. this.wireframeLinejoin = e.wireframeLinejoin,
  46431. this.vertexColors = e.vertexColors,
  46432. this.skinning = e.skinning,
  46433. this.morphTargets = e.morphTargets,
  46434. this.morphNormals = e.morphNormals,
  46435. this
  46436. }
  46437. ,
  46438. Ci.MeshStandardMaterial = function(e) {
  46439. Ci.Material.call(this),
  46440. this.type = "MeshStandardMaterial",
  46441. this.color = new Ci.Color(16777215),
  46442. this.roughness = .5,
  46443. this.metalness = .5,
  46444. this.map = null,
  46445. this.lightMap = null,
  46446. this.lightMapIntensity = 1,
  46447. this.aoMap = null,
  46448. this.aoMapIntensity = 1,
  46449. this.emissive = new Ci.Color(0),
  46450. this.emissiveIntensity = 1,
  46451. this.emissiveMap = null,
  46452. this.bumpMap = null,
  46453. this.bumpScale = 1,
  46454. this.normalMap = null,
  46455. this.normalScale = new Ci.Vector2(1,1),
  46456. this.displacementMap = null,
  46457. this.displacementScale = 1,
  46458. this.displacementBias = 0,
  46459. this.roughnessMap = null,
  46460. this.metalnessMap = null,
  46461. this.alphaMap = null,
  46462. this.envMap = null,
  46463. this.envMapIntensity = 1,
  46464. this.refractionRatio = .98,
  46465. this.fog = !0,
  46466. this.shading = Ci.SmoothShading,
  46467. this.blending = Ci.NormalBlending,
  46468. this.wireframe = !1,
  46469. this.wireframeLinewidth = 1,
  46470. this.wireframeLinecap = "round",
  46471. this.wireframeLinejoin = "round",
  46472. this.vertexColors = Ci.NoColors,
  46473. this.skinning = !1,
  46474. this.morphTargets = !1,
  46475. this.morphNormals = !1,
  46476. this.setValues(e)
  46477. }
  46478. ,
  46479. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46480. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46481. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46482. return Ci.Material.prototype.copy.call(this, e),
  46483. this.color.copy(e.color),
  46484. this.roughness = e.roughness,
  46485. this.metalness = e.metalness,
  46486. this.map = e.map,
  46487. this.lightMap = e.lightMap,
  46488. this.lightMapIntensity = e.lightMapIntensity,
  46489. this.aoMap = e.aoMap,
  46490. this.aoMapIntensity = e.aoMapIntensity,
  46491. this.emissive.copy(e.emissive),
  46492. this.emissiveMap = e.emissiveMap,
  46493. this.emissiveIntensity = e.emissiveIntensity,
  46494. this.bumpMap = e.bumpMap,
  46495. this.bumpScale = e.bumpScale,
  46496. this.normalMap = e.normalMap,
  46497. this.normalScale.copy(e.normalScale),
  46498. this.displacementMap = e.displacementMap,
  46499. this.displacementScale = e.displacementScale,
  46500. this.displacementBias = e.displacementBias,
  46501. this.roughnessMap = e.roughnessMap,
  46502. this.metalnessMap = e.metalnessMap,
  46503. this.alphaMap = e.alphaMap,
  46504. this.envMap = e.envMap,
  46505. this.envMapIntensity = e.envMapIntensity,
  46506. this.refractionRatio = e.refractionRatio,
  46507. this.fog = e.fog,
  46508. this.shading = e.shading,
  46509. this.wireframe = e.wireframe,
  46510. this.wireframeLinewidth = e.wireframeLinewidth,
  46511. this.wireframeLinecap = e.wireframeLinecap,
  46512. this.wireframeLinejoin = e.wireframeLinejoin,
  46513. this.vertexColors = e.vertexColors,
  46514. this.skinning = e.skinning,
  46515. this.morphTargets = e.morphTargets,
  46516. this.morphNormals = e.morphNormals,
  46517. this
  46518. }
  46519. ,
  46520. Ci.MeshDepthMaterial = function(e) {
  46521. Ci.Material.call(this),
  46522. this.type = "MeshDepthMaterial",
  46523. this.morphTargets = !1,
  46524. this.wireframe = !1,
  46525. this.wireframeLinewidth = 1,
  46526. this.setValues(e)
  46527. }
  46528. ,
  46529. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46530. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46531. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46532. return Ci.Material.prototype.copy.call(this, e),
  46533. this.wireframe = e.wireframe,
  46534. this.wireframeLinewidth = e.wireframeLinewidth,
  46535. this
  46536. }
  46537. ,
  46538. Ci.MeshNormalMaterial = function(e) {
  46539. Ci.Material.call(this, e),
  46540. this.type = "MeshNormalMaterial",
  46541. this.wireframe = !1,
  46542. this.wireframeLinewidth = 1,
  46543. this.morphTargets = !1,
  46544. this.setValues(e)
  46545. }
  46546. ,
  46547. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46548. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46549. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46550. return Ci.Material.prototype.copy.call(this, e),
  46551. this.wireframe = e.wireframe,
  46552. this.wireframeLinewidth = e.wireframeLinewidth,
  46553. this
  46554. }
  46555. ,
  46556. Ci.MultiMaterial = function(e) {
  46557. this.uuid = Ci.Math.generateUUID(),
  46558. this.type = "MultiMaterial",
  46559. this.materials = e instanceof Array ? e : [],
  46560. this.visible = !0
  46561. }
  46562. ,
  46563. Ci.MultiMaterial.prototype = {
  46564. constructor: Ci.MultiMaterial,
  46565. toJSON: function(e) {
  46566. for (var t = {
  46567. metadata: {
  46568. version: 4.2,
  46569. type: "material",
  46570. generator: "MaterialExporter"
  46571. },
  46572. uuid: this.uuid,
  46573. type: this.type,
  46574. materials: []
  46575. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46576. var o = i[n].toJSON(e);
  46577. delete o.metadata,
  46578. t.materials.push(o)
  46579. }
  46580. return t.visible = this.visible,
  46581. t
  46582. },
  46583. clone: function() {
  46584. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46585. e.materials.push(this.materials[t].clone());
  46586. return e.visible = this.visible,
  46587. e
  46588. }
  46589. },
  46590. Ci.PointsMaterial = function(e) {
  46591. Ci.Material.call(this),
  46592. this.type = "PointsMaterial",
  46593. this.color = new Ci.Color(16777215),
  46594. this.map = null,
  46595. this.size = 1,
  46596. this.sizeAttenuation = !0,
  46597. this.blending = Ci.NormalBlending,
  46598. this.vertexColors = Ci.NoColors,
  46599. this.fog = !0,
  46600. this.setValues(e)
  46601. }
  46602. ,
  46603. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46604. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46605. Ci.PointsMaterial.prototype.copy = function(e) {
  46606. return Ci.Material.prototype.copy.call(this, e),
  46607. this.color.copy(e.color),
  46608. this.map = e.map,
  46609. this.size = e.size,
  46610. this.sizeAttenuation = e.sizeAttenuation,
  46611. this.vertexColors = e.vertexColors,
  46612. this.fog = e.fog,
  46613. this
  46614. }
  46615. ,
  46616. Ci.ShaderMaterial = function(e) {
  46617. Ci.Material.call(this),
  46618. this.type = "ShaderMaterial",
  46619. this.defines = {},
  46620. this.uniforms = {},
  46621. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46622. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46623. this.shading = Ci.SmoothShading,
  46624. this.linewidth = 1,
  46625. this.wireframe = !1,
  46626. this.wireframeLinewidth = 1,
  46627. this.fog = !1,
  46628. this.lights = !1,
  46629. this.vertexColors = Ci.NoColors,
  46630. this.skinning = !1,
  46631. this.morphTargets = !1,
  46632. this.morphNormals = !1,
  46633. this.extensions = {
  46634. derivatives: !1,
  46635. fragDepth: !1,
  46636. drawBuffers: !1,
  46637. shaderTextureLOD: !1
  46638. },
  46639. this.defaultAttributeValues = {
  46640. color: [1, 1, 1],
  46641. uv: [0, 0],
  46642. uv2: [0, 0]
  46643. },
  46644. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46645. this.setValues(e))
  46646. }
  46647. ,
  46648. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46649. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46650. Ci.ShaderMaterial.prototype.copy = function(e) {
  46651. return Ci.Material.prototype.copy.call(this, e),
  46652. this.fragmentShader = e.fragmentShader,
  46653. this.vertexShader = e.vertexShader,
  46654. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46655. this.defines = e.defines,
  46656. this.shading = e.shading,
  46657. this.wireframe = e.wireframe,
  46658. this.wireframeLinewidth = e.wireframeLinewidth,
  46659. this.fog = e.fog,
  46660. this.lights = e.lights,
  46661. this.vertexColors = e.vertexColors,
  46662. this.skinning = e.skinning,
  46663. this.morphTargets = e.morphTargets,
  46664. this.morphNormals = e.morphNormals,
  46665. this.extensions = e.extensions,
  46666. this
  46667. }
  46668. ,
  46669. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46670. var t = Ci.Material.prototype.toJSON.call(this, e);
  46671. return t.uniforms = this.uniforms,
  46672. t.vertexShader = this.vertexShader,
  46673. t.fragmentShader = this.fragmentShader,
  46674. t
  46675. }
  46676. ,
  46677. Ci.RawShaderMaterial = function(e) {
  46678. Ci.ShaderMaterial.call(this, e),
  46679. this.type = "RawShaderMaterial"
  46680. }
  46681. ,
  46682. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46683. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46684. Ci.SpriteMaterial = function(e) {
  46685. Ci.Material.call(this),
  46686. this.type = "SpriteMaterial",
  46687. this.color = new Ci.Color(16777215),
  46688. this.map = null,
  46689. this.rotation = 0,
  46690. this.fog = !1,
  46691. this.setValues(e)
  46692. }
  46693. ,
  46694. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46695. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46696. Ci.SpriteMaterial.prototype.copy = function(e) {
  46697. return Ci.Material.prototype.copy.call(this, e),
  46698. this.color.copy(e.color),
  46699. this.map = e.map,
  46700. this.rotation = e.rotation,
  46701. this.fog = e.fog,
  46702. this
  46703. }
  46704. ,
  46705. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46706. Object.defineProperty(this, "id", {
  46707. value: Ci.TextureIdCount++
  46708. }),
  46709. this.uuid = Ci.Math.generateUUID(),
  46710. this.name = "",
  46711. this.sourceFile = "",
  46712. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46713. this.mipmaps = [],
  46714. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46715. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46716. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46717. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46718. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46719. this.anisotropy = void 0 !== l ? l : 1,
  46720. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46721. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46722. this.offset = new Ci.Vector2(0,0),
  46723. this.repeat = new Ci.Vector2(1,1),
  46724. this.generateMipmaps = !0,
  46725. this.premultiplyAlpha = !1,
  46726. this.flipY = !0,
  46727. this.unpackAlignment = 4,
  46728. this.encoding = Ci.LinearEncoding,
  46729. this.version = 0,
  46730. this.onUpdate = null
  46731. }
  46732. ,
  46733. Ci.Texture.DEFAULT_IMAGE = void 0,
  46734. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46735. Ci.Texture.prototype = {
  46736. constructor: Ci.Texture,
  46737. set needsUpdate(e) {
  46738. !0 === e && this.version++
  46739. },
  46740. clone: function() {
  46741. return (new this.constructor).copy(this)
  46742. },
  46743. copy: function(e) {
  46744. return this.image = e.image,
  46745. this.mipmaps = e.mipmaps.slice(0),
  46746. this.mapping = e.mapping,
  46747. this.wrapS = e.wrapS,
  46748. this.wrapT = e.wrapT,
  46749. this.magFilter = e.magFilter,
  46750. this.minFilter = e.minFilter,
  46751. this.anisotropy = e.anisotropy,
  46752. this.format = e.format,
  46753. this.type = e.type,
  46754. this.offset.copy(e.offset),
  46755. this.repeat.copy(e.repeat),
  46756. this.generateMipmaps = e.generateMipmaps,
  46757. this.premultiplyAlpha = e.premultiplyAlpha,
  46758. this.flipY = e.flipY,
  46759. this.unpackAlignment = e.unpackAlignment,
  46760. this.encoding = e.encoding,
  46761. this
  46762. },
  46763. toJSON: function(e) {
  46764. if (void 0 !== e.textures[this.uuid])
  46765. return e.textures[this.uuid];
  46766. var t, i, n = {
  46767. metadata: {
  46768. version: 4.4,
  46769. type: "Texture",
  46770. generator: "Texture.toJSON"
  46771. },
  46772. uuid: this.uuid,
  46773. name: this.name,
  46774. mapping: this.mapping,
  46775. repeat: [this.repeat.x, this.repeat.y],
  46776. offset: [this.offset.x, this.offset.y],
  46777. wrap: [this.wrapS, this.wrapT],
  46778. minFilter: this.minFilter,
  46779. magFilter: this.magFilter,
  46780. anisotropy: this.anisotropy
  46781. };
  46782. if (void 0 !== this.image) {
  46783. var r = this.image;
  46784. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  46785. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46786. uuid: r.uuid,
  46787. url: (t = r,
  46788. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  46789. i.height = t.height,
  46790. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  46791. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  46792. }),
  46793. n.image = r.uuid
  46794. }
  46795. return e.textures[this.uuid] = n
  46796. },
  46797. dispose: function() {
  46798. this.dispatchEvent({
  46799. type: "dispose"
  46800. })
  46801. },
  46802. transformUv: function(e) {
  46803. if (this.mapping === Ci.UVMapping) {
  46804. if (e.multiply(this.repeat),
  46805. e.add(this.offset),
  46806. e.x < 0 || 1 < e.x)
  46807. switch (this.wrapS) {
  46808. case Ci.RepeatWrapping:
  46809. e.x = e.x - Math.floor(e.x);
  46810. break;
  46811. case Ci.ClampToEdgeWrapping:
  46812. e.x = e.x < 0 ? 0 : 1;
  46813. break;
  46814. case Ci.MirroredRepeatWrapping:
  46815. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  46816. }
  46817. if (e.y < 0 || 1 < e.y)
  46818. switch (this.wrapT) {
  46819. case Ci.RepeatWrapping:
  46820. e.y = e.y - Math.floor(e.y);
  46821. break;
  46822. case Ci.ClampToEdgeWrapping:
  46823. e.y = e.y < 0 ? 0 : 1;
  46824. break;
  46825. case Ci.MirroredRepeatWrapping:
  46826. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  46827. }
  46828. this.flipY && (e.y = 1 - e.y)
  46829. }
  46830. }
  46831. },
  46832. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  46833. Ci.TextureIdCount = 0,
  46834. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  46835. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46836. this.needsUpdate = !0
  46837. }
  46838. ,
  46839. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  46840. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  46841. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  46842. e = void 0 !== e ? e : [],
  46843. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  46844. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46845. this.flipY = !1
  46846. }
  46847. ,
  46848. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  46849. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  46850. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  46851. get: function() {
  46852. return this.image
  46853. },
  46854. set: function(e) {
  46855. this.image = e
  46856. }
  46857. }),
  46858. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46859. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46860. this.image = {
  46861. width: t,
  46862. height: i
  46863. },
  46864. this.mipmaps = e,
  46865. this.flipY = !1,
  46866. this.generateMipmaps = !1
  46867. }
  46868. ,
  46869. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  46870. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  46871. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46872. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46873. this.image = {
  46874. data: e,
  46875. width: t,
  46876. height: i
  46877. },
  46878. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  46879. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  46880. this.flipY = !1,
  46881. this.generateMipmaps = !1
  46882. }
  46883. ,
  46884. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  46885. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  46886. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  46887. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  46888. this.generateMipmaps = !1;
  46889. var c = this;
  46890. !function e() {
  46891. requestAnimationFrame(e),
  46892. t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  46893. }()
  46894. }
  46895. ,
  46896. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  46897. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  46898. Ci.Group = function() {
  46899. Ci.Object3D.call(this),
  46900. this.type = "Group"
  46901. }
  46902. ,
  46903. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  46904. Ci.Group.prototype.constructor = Ci.Group,
  46905. Ci.Points = function(e, t) {
  46906. Ci.Object3D.call(this),
  46907. this.type = "Points",
  46908. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46909. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  46910. color: 16777215 * Math.random()
  46911. })
  46912. }
  46913. ,
  46914. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  46915. Ci.Points.prototype.constructor = Ci.Points,
  46916. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  46917. jt = new Ci.Ray,
  46918. Yt = new Ci.Sphere,
  46919. function(o, a) {
  46920. function e(e, t) {
  46921. var i = jt.distanceSqToPoint(e);
  46922. if (i < c) {
  46923. var n = jt.closestPointToPoint(e);
  46924. n.applyMatrix4(l);
  46925. var r = o.ray.origin.distanceTo(n);
  46926. if (r < o.near || r > o.far)
  46927. return;
  46928. a.push({
  46929. distance: r,
  46930. distanceToRay: Math.sqrt(i),
  46931. point: n.clone(),
  46932. index: t,
  46933. face: null,
  46934. object: s
  46935. })
  46936. }
  46937. }
  46938. var s = this
  46939. , t = this.geometry
  46940. , l = this.matrixWorld
  46941. , i = o.params.Points.threshold;
  46942. if (null === t.boundingSphere && t.computeBoundingSphere(),
  46943. Yt.copy(t.boundingSphere),
  46944. Yt.applyMatrix4(l),
  46945. !1 !== o.ray.intersectsSphere(Yt)) {
  46946. Wt.getInverse(l),
  46947. jt.copy(o.ray).applyMatrix4(Wt);
  46948. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  46949. , c = n * n
  46950. , r = new Ci.Vector3;
  46951. if (t instanceof Ci.BufferGeometry) {
  46952. var h = t.index
  46953. , u = t.attributes.position.array;
  46954. if (null !== h)
  46955. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  46956. var g = d[p];
  46957. r.fromArray(u, 3 * g),
  46958. e(r, g)
  46959. }
  46960. else {
  46961. p = 0;
  46962. for (var m = u.length / 3; p < m; p++)
  46963. r.fromArray(u, 3 * p),
  46964. e(r, p)
  46965. }
  46966. } else {
  46967. var v = t.vertices;
  46968. for (p = 0,
  46969. m = v.length; p < m; p++)
  46970. e(v[p], p)
  46971. }
  46972. }
  46973. }
  46974. ),
  46975. Ci.Points.prototype.clone = function() {
  46976. return new this.constructor(this.geometry,this.material).copy(this)
  46977. }
  46978. ,
  46979. Ci.Line = function(e, t, i) {
  46980. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  46981. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  46982. this.type = "Line",
  46983. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46984. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  46985. color: 16777215 * Math.random()
  46986. })))
  46987. }
  46988. ,
  46989. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  46990. Ci.Line.prototype.constructor = Ci.Line,
  46991. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  46992. zt = new Ci.Ray,
  46993. Gt = new Ci.Sphere,
  46994. function(e, t) {
  46995. var i = e.linePrecision
  46996. , n = i * i
  46997. , r = this.geometry
  46998. , o = this.matrixWorld;
  46999. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47000. Gt.copy(r.boundingSphere),
  47001. Gt.applyMatrix4(o),
  47002. !1 !== e.ray.intersectsSphere(Gt)) {
  47003. Ht.getInverse(o),
  47004. zt.copy(e.ray).applyMatrix4(Ht);
  47005. var a = new Ci.Vector3
  47006. , s = new Ci.Vector3
  47007. , l = new Ci.Vector3
  47008. , c = new Ci.Vector3
  47009. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47010. if (r instanceof Ci.BufferGeometry) {
  47011. var u = r.index
  47012. , d = r.attributes.position.array;
  47013. if (null !== u)
  47014. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47015. var m = p[f]
  47016. , v = p[f + 1];
  47017. a.fromArray(d, 3 * m),
  47018. s.fromArray(d, 3 * v),
  47019. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47020. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47021. distance: C,
  47022. point: l.clone().applyMatrix4(this.matrixWorld),
  47023. index: f,
  47024. face: null,
  47025. faceIndex: null,
  47026. object: this
  47027. }))
  47028. }
  47029. else
  47030. for (f = 0,
  47031. g = d.length / 3 - 1; f < g; f += h)
  47032. a.fromArray(d, 3 * f),
  47033. s.fromArray(d, 3 * f + 3),
  47034. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47035. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47036. distance: C,
  47037. point: l.clone().applyMatrix4(this.matrixWorld),
  47038. index: f,
  47039. face: null,
  47040. faceIndex: null,
  47041. object: this
  47042. }))
  47043. } else if (r instanceof Ci.Geometry) {
  47044. var y = r.vertices
  47045. , A = y.length;
  47046. for (f = 0; f < A - 1; f += h) {
  47047. var C;
  47048. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47049. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47050. distance: C,
  47051. point: l.clone().applyMatrix4(this.matrixWorld),
  47052. index: f,
  47053. face: null,
  47054. faceIndex: null,
  47055. object: this
  47056. }))
  47057. }
  47058. }
  47059. }
  47060. }
  47061. ),
  47062. Ci.Line.prototype.clone = function() {
  47063. return new this.constructor(this.geometry,this.material).copy(this)
  47064. }
  47065. ,
  47066. Ci.LineStrip = 0,
  47067. Ci.LinePieces = 1,
  47068. Ci.LineSegments = function(e, t) {
  47069. Ci.Line.call(this, e, t),
  47070. this.type = "LineSegments"
  47071. }
  47072. ,
  47073. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47074. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47075. Ci.Mesh = function(e, t) {
  47076. Ci.Object3D.call(this),
  47077. this.type = "Mesh",
  47078. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47079. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47080. color: 16777215 * Math.random()
  47081. }),
  47082. this.drawMode = Ci.TrianglesDrawMode,
  47083. this.updateMorphTargets()
  47084. }
  47085. ,
  47086. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47087. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47088. Ci.Mesh.prototype.setDrawMode = function(e) {
  47089. this.drawMode = e
  47090. }
  47091. ,
  47092. Ci.Mesh.prototype.updateMorphTargets = function() {
  47093. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47094. this.morphTargetBase = -1,
  47095. this.morphTargetInfluences = [],
  47096. this.morphTargetDictionary = {};
  47097. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47098. this.morphTargetInfluences.push(0),
  47099. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47100. }
  47101. }
  47102. ,
  47103. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47104. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47105. 0)
  47106. }
  47107. ,
  47108. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47109. xt = new Ci.Ray,
  47110. St = new Ci.Sphere,
  47111. Mt = new Ci.Vector3,
  47112. Rt = new Ci.Vector3,
  47113. Pt = new Ci.Vector3,
  47114. Ot = new Ci.Vector3,
  47115. Lt = new Ci.Vector3,
  47116. Dt = new Ci.Vector3,
  47117. Nt = new Ci.Vector2,
  47118. Ft = new Ci.Vector2,
  47119. Bt = new Ci.Vector2,
  47120. Vt = new Ci.Vector3,
  47121. kt = new Ci.Vector3,
  47122. Ut = new Ci.Vector3,
  47123. function(e, t) {
  47124. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47125. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47126. St.copy(r.boundingSphere),
  47127. St.applyMatrix4(a),
  47128. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47129. xt.copy(e.ray).applyMatrix4(Tt),
  47130. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47131. if (r instanceof Ci.BufferGeometry) {
  47132. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47133. if (void 0 !== u.uv && (i = u.uv.array),
  47134. null !== h)
  47135. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47136. s = p[f],
  47137. l = p[f + 1],
  47138. c = p[f + 2],
  47139. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47140. t.push(n));
  47141. else
  47142. for (f = 0,
  47143. g = d.length; f < g; f += 9)
  47144. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47145. t.push(n))
  47146. } else if (r instanceof Ci.Geometry) {
  47147. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47148. 0 < _.length && (i = _);
  47149. for (var b = 0, w = E.length; b < w; b++) {
  47150. var T = E[b]
  47151. , x = 1 == A ? C[T.materialIndex] : o;
  47152. if (void 0 !== x) {
  47153. if (m = I[T.a],
  47154. v = I[T.b],
  47155. y = I[T.c],
  47156. !0 === x.morphTargets) {
  47157. var S = r.morphTargets
  47158. , M = this.morphTargetInfluences;
  47159. Mt.set(0, 0, 0),
  47160. Rt.set(0, 0, 0),
  47161. Pt.set(0, 0, 0);
  47162. for (var R = 0, P = S.length; R < P; R++) {
  47163. var O = M[R];
  47164. if (0 !== O) {
  47165. var L = S[R].vertices;
  47166. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47167. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47168. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47169. }
  47170. }
  47171. Mt.add(m),
  47172. Rt.add(v),
  47173. Pt.add(y),
  47174. m = Mt,
  47175. v = Rt,
  47176. y = Pt
  47177. }
  47178. if (n = wi(this, e, xt, m, v, y, kt)) {
  47179. if (i) {
  47180. var D = i[b];
  47181. Nt.copy(D[0]),
  47182. Ft.copy(D[1]),
  47183. Bt.copy(D[2]),
  47184. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47185. }
  47186. n.face = T,
  47187. n.faceIndex = b,
  47188. t.push(n)
  47189. }
  47190. }
  47191. }
  47192. }
  47193. }
  47194. ),
  47195. Ci.Mesh.prototype.clone = function() {
  47196. return new this.constructor(this.geometry,this.material).copy(this)
  47197. }
  47198. ,
  47199. Ci.Bone = function(e) {
  47200. Ci.Object3D.call(this),
  47201. this.type = "Bone",
  47202. this.skin = e
  47203. }
  47204. ,
  47205. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47206. Ci.Bone.prototype.constructor = Ci.Bone,
  47207. Ci.Bone.prototype.copy = function(e) {
  47208. return Ci.Object3D.prototype.copy.call(this, e),
  47209. this.skin = e.skin,
  47210. this
  47211. }
  47212. ,
  47213. Ci.Skeleton = function(e, t, i) {
  47214. if (this.useVertexTexture = void 0 === i || i,
  47215. this.identityMatrix = new Ci.Matrix4,
  47216. e = e || [],
  47217. this.bones = e.slice(0),
  47218. this.useVertexTexture) {
  47219. var n = Math.sqrt(4 * this.bones.length);
  47220. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47221. n = Math.max(n, 4),
  47222. this.boneTextureWidth = n,
  47223. this.boneTextureHeight = n,
  47224. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47225. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47226. } else
  47227. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47228. if (void 0 === t)
  47229. this.calculateInverses();
  47230. else if (this.bones.length === t.length)
  47231. this.boneInverses = t.slice(0);
  47232. else {
  47233. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47234. this.boneInverses = [];
  47235. for (var r = 0, o = this.bones.length; r < o; r++)
  47236. this.boneInverses.push(new Ci.Matrix4)
  47237. }
  47238. }
  47239. ,
  47240. Ci.Skeleton.prototype.calculateInverses = function() {
  47241. this.boneInverses = [];
  47242. for (var e = 0, t = this.bones.length; e < t; e++) {
  47243. var i = new Ci.Matrix4;
  47244. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47245. this.boneInverses.push(i)
  47246. }
  47247. }
  47248. ,
  47249. Ci.Skeleton.prototype.pose = function() {
  47250. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47251. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47252. for (t = 0,
  47253. i = this.bones.length; t < i; t++)
  47254. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47255. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47256. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47257. }
  47258. ,
  47259. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47260. function() {
  47261. for (var e = 0, t = this.bones.length; e < t; e++) {
  47262. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47263. wt.multiplyMatrices(i, this.boneInverses[e]),
  47264. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47265. }
  47266. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47267. }
  47268. ),
  47269. Ci.Skeleton.prototype.clone = function() {
  47270. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47271. }
  47272. ,
  47273. Ci.SkinnedMesh = function(e, t, i) {
  47274. Ci.Mesh.call(this, e, t),
  47275. this.type = "SkinnedMesh",
  47276. this.bindMode = "attached",
  47277. this.bindMatrix = new Ci.Matrix4,
  47278. this.bindMatrixInverse = new Ci.Matrix4;
  47279. var n = [];
  47280. if (this.geometry && void 0 !== this.geometry.bones) {
  47281. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47282. o = this.geometry.bones[a],
  47283. r = new Ci.Bone(this),
  47284. n.push(r),
  47285. r.name = o.name,
  47286. r.position.fromArray(o.pos),
  47287. r.quaternion.fromArray(o.rotq),
  47288. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47289. for (a = 0,
  47290. s = this.geometry.bones.length; a < s; ++a)
  47291. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47292. }
  47293. this.normalizeSkinWeights(),
  47294. this.updateMatrixWorld(!0),
  47295. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47296. }
  47297. ,
  47298. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47299. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47300. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47301. this.skeleton = e,
  47302. void 0 === t && (this.updateMatrixWorld(!0),
  47303. this.skeleton.calculateInverses(),
  47304. t = this.matrixWorld),
  47305. this.bindMatrix.copy(t),
  47306. this.bindMatrixInverse.getInverse(t)
  47307. }
  47308. ,
  47309. Ci.SkinnedMesh.prototype.pose = function() {
  47310. this.skeleton.pose()
  47311. }
  47312. ,
  47313. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47314. if (this.geometry instanceof Ci.Geometry)
  47315. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47316. var t = this.geometry.skinWeights[e];
  47317. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47318. }
  47319. else if (this.geometry instanceof Ci.BufferGeometry) {
  47320. var i = new Ci.Vector4
  47321. , n = this.geometry.attributes.skinWeight;
  47322. for (e = 0; e < n.count; e++) {
  47323. var r;
  47324. i.x = n.getX(e),
  47325. i.y = n.getY(e),
  47326. i.z = n.getZ(e),
  47327. i.w = n.getW(e),
  47328. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47329. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47330. }
  47331. }
  47332. }
  47333. ,
  47334. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47335. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47336. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47337. }
  47338. ,
  47339. Ci.SkinnedMesh.prototype.clone = function() {
  47340. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47341. }
  47342. ,
  47343. Ci.LOD = function() {
  47344. Ci.Object3D.call(this),
  47345. this.type = "LOD",
  47346. Object.defineProperties(this, {
  47347. levels: {
  47348. enumerable: !0,
  47349. value: []
  47350. },
  47351. objects: {
  47352. get: function() {
  47353. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47354. this.levels
  47355. }
  47356. }
  47357. })
  47358. }
  47359. ,
  47360. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47361. Ci.LOD.prototype.constructor = Ci.LOD,
  47362. Ci.LOD.prototype.addLevel = function(e, t) {
  47363. void 0 === t && (t = 0),
  47364. t = Math.abs(t);
  47365. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47366. ;
  47367. i.splice(n, 0, {
  47368. distance: t,
  47369. object: e
  47370. }),
  47371. this.add(e)
  47372. }
  47373. ,
  47374. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47375. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47376. ;
  47377. return t[i - 1].object
  47378. }
  47379. ,
  47380. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47381. function(e, t) {
  47382. bt.setFromMatrixPosition(this.matrixWorld);
  47383. var i = e.ray.origin.distanceTo(bt);
  47384. this.getObjectForDistance(i).raycast(e, t)
  47385. }
  47386. ),
  47387. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47388. _t = new Ci.Vector3,
  47389. function(e) {
  47390. var t = this.levels;
  47391. if (1 < t.length) {
  47392. Et.setFromMatrixPosition(e.matrixWorld),
  47393. _t.setFromMatrixPosition(this.matrixWorld);
  47394. var i = Et.distanceTo(_t);
  47395. t[0].object.visible = !0;
  47396. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47397. t[n - 1].object.visible = !1,
  47398. t[n].object.visible = !0;
  47399. for (; n < r; n++)
  47400. t[n].object.visible = !1
  47401. }
  47402. }
  47403. ),
  47404. Ci.LOD.prototype.copy = function(e) {
  47405. Ci.Object3D.prototype.copy.call(this, e, !1);
  47406. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47407. var r = t[i];
  47408. this.addLevel(r.object.clone(), r.distance)
  47409. }
  47410. return this
  47411. }
  47412. ,
  47413. Ci.LOD.prototype.toJSON = function(e) {
  47414. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47415. t.object.levels = [];
  47416. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47417. var o = i[n];
  47418. t.object.levels.push({
  47419. object: o.object.uuid,
  47420. distance: o.distance
  47421. })
  47422. }
  47423. return t
  47424. }
  47425. ,
  47426. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47427. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47428. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47429. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47430. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47431. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47432. function(e) {
  47433. Ci.Object3D.call(this),
  47434. this.type = "Sprite",
  47435. this.geometry = It,
  47436. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47437. }
  47438. ),
  47439. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47440. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47441. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47442. function(e, t) {
  47443. vt.setFromMatrixPosition(this.matrixWorld);
  47444. var i = e.ray.distanceSqToPoint(vt);
  47445. this.scale.x * this.scale.y < i || t.push({
  47446. distance: Math.sqrt(i),
  47447. point: this.position,
  47448. face: null,
  47449. object: this
  47450. })
  47451. }
  47452. ),
  47453. Ci.Sprite.prototype.clone = function() {
  47454. return new this.constructor(this.material).copy(this)
  47455. }
  47456. ,
  47457. Ci.Particle = Ci.Sprite,
  47458. Ci.LensFlare = function(e, t, i, n, r) {
  47459. Ci.Object3D.call(this),
  47460. this.lensFlares = [],
  47461. this.positionScreen = new Ci.Vector3,
  47462. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47463. }
  47464. ,
  47465. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47466. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47467. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47468. void 0 === t && (t = -1),
  47469. void 0 === i && (i = 0),
  47470. void 0 === o && (o = 1),
  47471. void 0 === r && (r = new Ci.Color(16777215)),
  47472. void 0 === n && (n = Ci.NormalBlending),
  47473. i = Math.min(i, Math.max(0, i)),
  47474. this.lensFlares.push({
  47475. texture: e,
  47476. size: t,
  47477. distance: i,
  47478. x: 0,
  47479. y: 0,
  47480. z: 0,
  47481. scale: 1,
  47482. rotation: 0,
  47483. opacity: o,
  47484. color: r,
  47485. blending: n
  47486. })
  47487. }
  47488. ,
  47489. Ci.LensFlare.prototype.updateLensFlares = function() {
  47490. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47491. for (e = 0; e < i; e++)
  47492. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47493. t.y = this.positionScreen.y + r * t.distance,
  47494. t.wantedRotation = t.x * Math.PI * .25,
  47495. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47496. }
  47497. ,
  47498. Ci.LensFlare.prototype.copy = function(e) {
  47499. Ci.Object3D.prototype.copy.call(this, e),
  47500. this.positionScreen.copy(e.positionScreen),
  47501. this.customUpdateCallback = e.customUpdateCallback;
  47502. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47503. this.lensFlares.push(e.lensFlares[t]);
  47504. return this
  47505. }
  47506. ,
  47507. Ci.Scene = function() {
  47508. Ci.Object3D.call(this),
  47509. this.type = "Scene",
  47510. this.fog = null,
  47511. this.overrideMaterial = null,
  47512. this.autoUpdate = !0
  47513. }
  47514. ,
  47515. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47516. Ci.Scene.prototype.constructor = Ci.Scene,
  47517. Ci.Scene.prototype.copy = function(e, t) {
  47518. return Ci.Object3D.prototype.copy.call(this, e, t),
  47519. null !== e.fog && (this.fog = e.fog.clone()),
  47520. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47521. this.autoUpdate = e.autoUpdate,
  47522. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47523. this
  47524. }
  47525. ,
  47526. Ci.Fog = function(e, t, i) {
  47527. this.name = "",
  47528. this.color = new Ci.Color(e),
  47529. this.near = void 0 !== t ? t : 1,
  47530. this.far = void 0 !== i ? i : 1e3
  47531. }
  47532. ,
  47533. Ci.Fog.prototype.clone = function() {
  47534. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47535. }
  47536. ,
  47537. Ci.FogExp2 = function(e, t) {
  47538. this.name = "",
  47539. this.color = new Ci.Color(e),
  47540. this.density = void 0 !== t ? t : 25e-5
  47541. }
  47542. ,
  47543. Ci.FogExp2.prototype.clone = function() {
  47544. return new Ci.FogExp2(this.color.getHex(),this.density)
  47545. }
  47546. ,
  47547. Ci.ShaderChunk = {},
  47548. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47549. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47550. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47551. 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",
  47552. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47553. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47554. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47555. 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",
  47556. 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",
  47557. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47558. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47559. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47560. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47561. 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",
  47562. 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",
  47563. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47564. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47565. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47566. 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",
  47567. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47568. 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",
  47569. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47570. 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",
  47571. 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",
  47572. 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",
  47573. 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",
  47574. 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",
  47575. 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",
  47576. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47577. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47578. 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",
  47579. 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",
  47580. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47581. 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",
  47582. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47583. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47584. 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",
  47585. 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",
  47586. 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",
  47587. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47588. 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",
  47589. 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",
  47590. 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",
  47591. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47592. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47593. 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",
  47594. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47595. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47596. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47597. 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",
  47598. 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",
  47599. 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",
  47600. 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",
  47601. 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",
  47602. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47603. 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",
  47604. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47605. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47606. 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",
  47607. 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",
  47608. 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",
  47609. 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",
  47610. 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",
  47611. 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",
  47612. 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",
  47613. 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",
  47614. 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",
  47615. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47616. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47617. 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",
  47618. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47619. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47620. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47621. 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",
  47622. 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",
  47623. 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",
  47624. 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",
  47625. Ci.UniformsUtils = {
  47626. merge: function(e) {
  47627. for (var t = {}, i = 0; i < e.length; i++) {
  47628. var n = this.clone(e[i]);
  47629. for (var r in n)
  47630. t[r] = n[r]
  47631. }
  47632. return t
  47633. },
  47634. clone: function(e) {
  47635. var t = {};
  47636. for (var i in e)
  47637. for (var n in t[i] = {},
  47638. e[i]) {
  47639. var r = e[i][n];
  47640. 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
  47641. }
  47642. return t
  47643. }
  47644. },
  47645. Ci.UniformsLib = {
  47646. common: {
  47647. diffuse: {
  47648. type: "c",
  47649. value: new Ci.Color(15658734)
  47650. },
  47651. opacity: {
  47652. type: "f",
  47653. value: 1
  47654. },
  47655. map: {
  47656. type: "t",
  47657. value: null
  47658. },
  47659. offsetRepeat: {
  47660. type: "v4",
  47661. value: new Ci.Vector4(0,0,1,1)
  47662. },
  47663. specularMap: {
  47664. type: "t",
  47665. value: null
  47666. },
  47667. alphaMap: {
  47668. type: "t",
  47669. value: null
  47670. },
  47671. envMap: {
  47672. type: "t",
  47673. value: null
  47674. },
  47675. flipEnvMap: {
  47676. type: "f",
  47677. value: -1
  47678. },
  47679. reflectivity: {
  47680. type: "f",
  47681. value: 1
  47682. },
  47683. refractionRatio: {
  47684. type: "f",
  47685. value: .98
  47686. }
  47687. },
  47688. aomap: {
  47689. aoMap: {
  47690. type: "t",
  47691. value: null
  47692. },
  47693. aoMapIntensity: {
  47694. type: "f",
  47695. value: 1
  47696. }
  47697. },
  47698. lightmap: {
  47699. lightMap: {
  47700. type: "t",
  47701. value: null
  47702. },
  47703. lightMapIntensity: {
  47704. type: "f",
  47705. value: 1
  47706. }
  47707. },
  47708. emissivemap: {
  47709. emissiveMap: {
  47710. type: "t",
  47711. value: null
  47712. }
  47713. },
  47714. bumpmap: {
  47715. bumpMap: {
  47716. type: "t",
  47717. value: null
  47718. },
  47719. bumpScale: {
  47720. type: "f",
  47721. value: 1
  47722. }
  47723. },
  47724. normalmap: {
  47725. normalMap: {
  47726. type: "t",
  47727. value: null
  47728. },
  47729. normalScale: {
  47730. type: "v2",
  47731. value: new Ci.Vector2(1,1)
  47732. }
  47733. },
  47734. displacementmap: {
  47735. displacementMap: {
  47736. type: "t",
  47737. value: null
  47738. },
  47739. displacementScale: {
  47740. type: "f",
  47741. value: 1
  47742. },
  47743. displacementBias: {
  47744. type: "f",
  47745. value: 0
  47746. }
  47747. },
  47748. roughnessmap: {
  47749. roughnessMap: {
  47750. type: "t",
  47751. value: null
  47752. }
  47753. },
  47754. metalnessmap: {
  47755. metalnessMap: {
  47756. type: "t",
  47757. value: null
  47758. }
  47759. },
  47760. fog: {
  47761. fogDensity: {
  47762. type: "f",
  47763. value: 25e-5
  47764. },
  47765. fogNear: {
  47766. type: "f",
  47767. value: 1
  47768. },
  47769. fogFar: {
  47770. type: "f",
  47771. value: 2e3
  47772. },
  47773. fogColor: {
  47774. type: "c",
  47775. value: new Ci.Color(16777215)
  47776. }
  47777. },
  47778. lights: {
  47779. ambientLightColor: {
  47780. type: "fv",
  47781. value: []
  47782. },
  47783. directionalLights: {
  47784. type: "sa",
  47785. value: [],
  47786. properties: {
  47787. direction: {
  47788. type: "v3"
  47789. },
  47790. color: {
  47791. type: "c"
  47792. },
  47793. shadow: {
  47794. type: "i"
  47795. },
  47796. shadowBias: {
  47797. type: "f"
  47798. },
  47799. shadowRadius: {
  47800. type: "f"
  47801. },
  47802. shadowMapSize: {
  47803. type: "v2"
  47804. }
  47805. }
  47806. },
  47807. directionalShadowMap: {
  47808. type: "tv",
  47809. value: []
  47810. },
  47811. directionalShadowMatrix: {
  47812. type: "m4v",
  47813. value: []
  47814. },
  47815. spotLights: {
  47816. type: "sa",
  47817. value: [],
  47818. properties: {
  47819. color: {
  47820. type: "c"
  47821. },
  47822. position: {
  47823. type: "v3"
  47824. },
  47825. direction: {
  47826. type: "v3"
  47827. },
  47828. distance: {
  47829. type: "f"
  47830. },
  47831. coneCos: {
  47832. type: "f"
  47833. },
  47834. penumbraCos: {
  47835. type: "f"
  47836. },
  47837. decay: {
  47838. type: "f"
  47839. },
  47840. shadow: {
  47841. type: "i"
  47842. },
  47843. shadowBias: {
  47844. type: "f"
  47845. },
  47846. shadowRadius: {
  47847. type: "f"
  47848. },
  47849. shadowMapSize: {
  47850. type: "v2"
  47851. }
  47852. }
  47853. },
  47854. spotShadowMap: {
  47855. type: "tv",
  47856. value: []
  47857. },
  47858. spotShadowMatrix: {
  47859. type: "m4v",
  47860. value: []
  47861. },
  47862. pointLights: {
  47863. type: "sa",
  47864. value: [],
  47865. properties: {
  47866. color: {
  47867. type: "c"
  47868. },
  47869. position: {
  47870. type: "v3"
  47871. },
  47872. decay: {
  47873. type: "f"
  47874. },
  47875. distance: {
  47876. type: "f"
  47877. },
  47878. shadow: {
  47879. type: "i"
  47880. },
  47881. shadowBias: {
  47882. type: "f"
  47883. },
  47884. shadowRadius: {
  47885. type: "f"
  47886. },
  47887. shadowMapSize: {
  47888. type: "v2"
  47889. }
  47890. }
  47891. },
  47892. pointShadowMap: {
  47893. type: "tv",
  47894. value: []
  47895. },
  47896. pointShadowMatrix: {
  47897. type: "m4v",
  47898. value: []
  47899. },
  47900. hemisphereLights: {
  47901. type: "sa",
  47902. value: [],
  47903. properties: {
  47904. direction: {
  47905. type: "v3"
  47906. },
  47907. skyColor: {
  47908. type: "c"
  47909. },
  47910. groundColor: {
  47911. type: "c"
  47912. }
  47913. }
  47914. }
  47915. },
  47916. points: {
  47917. diffuse: {
  47918. type: "c",
  47919. value: new Ci.Color(15658734)
  47920. },
  47921. opacity: {
  47922. type: "f",
  47923. value: 1
  47924. },
  47925. size: {
  47926. type: "f",
  47927. value: 1
  47928. },
  47929. scale: {
  47930. type: "f",
  47931. value: 1
  47932. },
  47933. map: {
  47934. type: "t",
  47935. value: null
  47936. },
  47937. offsetRepeat: {
  47938. type: "v4",
  47939. value: new Ci.Vector4(0,0,1,1)
  47940. }
  47941. }
  47942. },
  47943. 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",
  47944. 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",
  47945. 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",
  47946. 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",
  47947. 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",
  47948. 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",
  47949. 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",
  47950. 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",
  47951. 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",
  47952. 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",
  47953. 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",
  47954. 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",
  47955. 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",
  47956. 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",
  47957. 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",
  47958. 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",
  47959. 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",
  47960. 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",
  47961. 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",
  47962. 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",
  47963. 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",
  47964. 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",
  47965. 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",
  47966. 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",
  47967. Ci.ShaderLib = {
  47968. basic: {
  47969. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  47970. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  47971. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  47972. },
  47973. lambert: {
  47974. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47975. emissive: {
  47976. type: "c",
  47977. value: new Ci.Color(0)
  47978. }
  47979. }]),
  47980. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  47981. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  47982. },
  47983. phong: {
  47984. 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, {
  47985. emissive: {
  47986. type: "c",
  47987. value: new Ci.Color(0)
  47988. },
  47989. specular: {
  47990. type: "c",
  47991. value: new Ci.Color(1118481)
  47992. },
  47993. shininess: {
  47994. type: "f",
  47995. value: 30
  47996. }
  47997. }]),
  47998. vertexShader: Ci.ShaderChunk.meshphong_vert,
  47999. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48000. },
  48001. standard: {
  48002. 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, {
  48003. emissive: {
  48004. type: "c",
  48005. value: new Ci.Color(0)
  48006. },
  48007. roughness: {
  48008. type: "f",
  48009. value: .5
  48010. },
  48011. metalness: {
  48012. type: "f",
  48013. value: 0
  48014. },
  48015. envMapIntensity: {
  48016. type: "f",
  48017. value: 1
  48018. }
  48019. }]),
  48020. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48021. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48022. },
  48023. points: {
  48024. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48025. vertexShader: Ci.ShaderChunk.points_vert,
  48026. fragmentShader: Ci.ShaderChunk.points_frag
  48027. },
  48028. dashed: {
  48029. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48030. scale: {
  48031. type: "f",
  48032. value: 1
  48033. },
  48034. dashSize: {
  48035. type: "f",
  48036. value: 1
  48037. },
  48038. totalSize: {
  48039. type: "f",
  48040. value: 2
  48041. }
  48042. }]),
  48043. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48044. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48045. },
  48046. depth: {
  48047. uniforms: {
  48048. mNear: {
  48049. type: "f",
  48050. value: 1
  48051. },
  48052. mFar: {
  48053. type: "f",
  48054. value: 2e3
  48055. },
  48056. opacity: {
  48057. type: "f",
  48058. value: 1
  48059. }
  48060. },
  48061. vertexShader: Ci.ShaderChunk.depth_vert,
  48062. fragmentShader: Ci.ShaderChunk.depth_frag
  48063. },
  48064. normal: {
  48065. uniforms: {
  48066. opacity: {
  48067. type: "f",
  48068. value: 1
  48069. }
  48070. },
  48071. vertexShader: Ci.ShaderChunk.normal_vert,
  48072. fragmentShader: Ci.ShaderChunk.normal_frag
  48073. },
  48074. cube: {
  48075. uniforms: {
  48076. tCube: {
  48077. type: "t",
  48078. value: null
  48079. },
  48080. tFlip: {
  48081. type: "f",
  48082. value: -1
  48083. }
  48084. },
  48085. vertexShader: Ci.ShaderChunk.cube_vert,
  48086. fragmentShader: Ci.ShaderChunk.cube_frag
  48087. },
  48088. equirect: {
  48089. uniforms: {
  48090. tEquirect: {
  48091. type: "t",
  48092. value: null
  48093. },
  48094. tFlip: {
  48095. type: "f",
  48096. value: -1
  48097. }
  48098. },
  48099. vertexShader: Ci.ShaderChunk.equirect_vert,
  48100. fragmentShader: Ci.ShaderChunk.equirect_frag
  48101. },
  48102. depthRGBA: {
  48103. uniforms: {},
  48104. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48105. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48106. },
  48107. distanceRGBA: {
  48108. uniforms: {
  48109. lightPos: {
  48110. type: "v3",
  48111. value: new Ci.Vector3(0,0,0)
  48112. }
  48113. },
  48114. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48115. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48116. }
  48117. },
  48118. Ci.WebGLRenderer = function(e) {
  48119. function S() {
  48120. return null === Q ? he : 1
  48121. }
  48122. function i(e, t, i, n) {
  48123. !0 === V && (e *= n,
  48124. t *= n,
  48125. i *= n),
  48126. _e.clearColor(e, t, i, n)
  48127. }
  48128. function t() {
  48129. _e.init(),
  48130. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48131. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48132. i(ae.r, ae.g, ae.b, se)
  48133. }
  48134. function n() {
  48135. te = K = null,
  48136. ee = "",
  48137. $ = -1,
  48138. _e.reset()
  48139. }
  48140. function r(e) {
  48141. e.preventDefault(),
  48142. n(),
  48143. t(),
  48144. be.clear()
  48145. }
  48146. function f(e) {
  48147. var t = e.target;
  48148. t.removeEventListener("dispose", f),
  48149. function(e) {
  48150. var t = be.get(e);
  48151. if (e.image && t.__image__webglTextureCube)
  48152. X.deleteTexture(t.__image__webglTextureCube);
  48153. else {
  48154. if (void 0 === t.__webglInit)
  48155. return;
  48156. X.deleteTexture(t.__webglTexture)
  48157. }
  48158. be.delete(e)
  48159. }(t),
  48160. ye.textures--
  48161. }
  48162. function a(e) {
  48163. var t = e.target;
  48164. t.removeEventListener("dispose", a),
  48165. function(e) {
  48166. var t = be.get(e)
  48167. , i = be.get(e.texture);
  48168. if (e && void 0 !== i.__webglTexture) {
  48169. if (X.deleteTexture(i.__webglTexture),
  48170. e instanceof Ci.WebGLRenderTargetCube)
  48171. for (var n = 0; n < 6; n++)
  48172. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48173. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48174. else
  48175. X.deleteFramebuffer(t.__webglFramebuffer),
  48176. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48177. be.delete(e.texture),
  48178. be.delete(e)
  48179. }
  48180. }(t),
  48181. ye.textures--
  48182. }
  48183. function v(e) {
  48184. var t = e.target;
  48185. t.removeEventListener("dispose", v),
  48186. function(e) {
  48187. y(e),
  48188. be.delete(e)
  48189. }(t)
  48190. }
  48191. function y(e) {
  48192. var t = be.get(e).program;
  48193. (e.program = void 0) !== t && Te.releaseProgram(t)
  48194. }
  48195. function M(e, t) {
  48196. return Math.abs(t[0]) - Math.abs(e[0])
  48197. }
  48198. function s(e, t) {
  48199. 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
  48200. }
  48201. function l(e, t) {
  48202. 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
  48203. }
  48204. function d(e, t, i, n, r) {
  48205. var o, a;
  48206. a = i.transparent ? (o = G,
  48207. ++W) : (o = H,
  48208. ++z);
  48209. var s = o[a];
  48210. void 0 !== s ? (s.id = e.id,
  48211. s.object = e,
  48212. s.geometry = t,
  48213. s.material = i,
  48214. s.z = me.z,
  48215. s.group = r) : (s = {
  48216. id: e.id,
  48217. object: e,
  48218. geometry: t,
  48219. material: i,
  48220. z: me.z,
  48221. group: r
  48222. },
  48223. o.push(s))
  48224. }
  48225. function c(e, t, i, n) {
  48226. for (var r = 0, o = e.length; r < o; r++) {
  48227. var a = e[r]
  48228. , s = a.object
  48229. , l = a.geometry
  48230. , c = void 0 === n ? a.material : n
  48231. , h = a.group;
  48232. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48233. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48234. s instanceof Ci.ImmediateRenderObject) {
  48235. R(c);
  48236. var u = P(t, i, c, s);
  48237. ee = "",
  48238. s.render(function(e) {
  48239. Z.renderBufferImmediate(e, u, c)
  48240. })
  48241. } else
  48242. Z.renderBufferDirect(t, i, l, c, s, h)
  48243. }
  48244. }
  48245. function R(e) {
  48246. (function(e) {
  48247. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48248. _e.setFlipSided(e.side === Ci.BackSide)
  48249. }
  48250. )(e),
  48251. !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),
  48252. _e.setDepthFunc(e.depthFunc),
  48253. _e.setDepthTest(e.depthTest),
  48254. _e.setDepthWrite(e.depthWrite),
  48255. _e.setColorWrite(e.colorWrite),
  48256. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48257. }
  48258. function P(e, t, i, n) {
  48259. oe = 0;
  48260. var r = be.get(i);
  48261. void 0 === r.program && (i.needsUpdate = !0),
  48262. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48263. i.needsUpdate && (function(e, t, i) {
  48264. var n = be.get(e)
  48265. , r = Te.getParameters(e, ve, t, i)
  48266. , o = Te.getProgramCode(e, r)
  48267. , a = n.program
  48268. , s = !0;
  48269. if (void 0 === a)
  48270. e.addEventListener("dispose", v);
  48271. else if (a.code !== o)
  48272. y(e);
  48273. else {
  48274. if (void 0 !== r.shaderID)
  48275. return;
  48276. s = !1
  48277. }
  48278. if (s) {
  48279. if (r.shaderID) {
  48280. var l = Ci.ShaderLib[r.shaderID];
  48281. n.__webglShader = {
  48282. name: e.type,
  48283. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48284. vertexShader: l.vertexShader,
  48285. fragmentShader: l.fragmentShader
  48286. }
  48287. } else
  48288. n.__webglShader = {
  48289. name: e.type,
  48290. uniforms: e.uniforms,
  48291. vertexShader: e.vertexShader,
  48292. fragmentShader: e.fragmentShader
  48293. };
  48294. e.__webglShader = n.__webglShader,
  48295. a = Te.acquireProgram(e, r, o),
  48296. n.program = a,
  48297. e.program = a
  48298. }
  48299. var c = a.getAttributes();
  48300. if (e.morphTargets)
  48301. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48302. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48303. if (e.morphNormals)
  48304. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48305. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48306. n.uniformsList = [];
  48307. var u = n.__webglShader.uniforms
  48308. , d = n.program.getUniforms();
  48309. for (var p in u) {
  48310. var f = d[p];
  48311. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48312. }
  48313. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48314. u.ambientLightColor.value = ve.ambient,
  48315. u.directionalLights.value = ve.directional,
  48316. u.spotLights.value = ve.spot,
  48317. u.pointLights.value = ve.point,
  48318. u.hemisphereLights.value = ve.hemi,
  48319. u.directionalShadowMap.value = ve.directionalShadowMap,
  48320. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48321. u.spotShadowMap.value = ve.spotShadowMap,
  48322. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48323. u.pointShadowMap.value = ve.pointShadowMap,
  48324. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48325. n.hasDynamicUniforms = !1;
  48326. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48327. if (!0 === n.uniformsList[g][0].dynamic) {
  48328. n.hasDynamicUniforms = !0;
  48329. break
  48330. }
  48331. }
  48332. }(i, t, n),
  48333. i.needsUpdate = !1);
  48334. var o = !1
  48335. , a = !1
  48336. , s = !1
  48337. , l = r.program
  48338. , c = l.getUniforms()
  48339. , h = r.__webglShader.uniforms;
  48340. if (l.id !== K && (X.useProgram(l.program),
  48341. K = l.id,
  48342. s = a = o = !0),
  48343. i.id !== $ && ($ = i.id,
  48344. a = !0),
  48345. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48346. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48347. e !== te && (te = e,
  48348. s = a = !0),
  48349. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48350. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48351. (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),
  48352. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48353. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48354. i.skinning)
  48355. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48356. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48357. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48358. if (void 0 !== c.boneTexture) {
  48359. var u = A();
  48360. X.uniform1i(c.boneTexture, u),
  48361. Z.setTexture(n.skeleton.boneTexture, u)
  48362. }
  48363. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48364. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48365. } else
  48366. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48367. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48368. e.ambientLightColor.needsUpdate = t,
  48369. e.directionalLights.needsUpdate = t,
  48370. e.pointLights.needsUpdate = t,
  48371. e.spotLights.needsUpdate = t,
  48372. e.hemisphereLights.needsUpdate = t
  48373. }(h, s),
  48374. t && i.fog && function(e, t) {
  48375. e.fogColor.value = t.color,
  48376. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48377. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48378. }(h, t),
  48379. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48380. var i;
  48381. if (e.opacity.value = t.opacity,
  48382. e.diffuse.value = t.color,
  48383. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48384. e.map.value = t.map,
  48385. e.specularMap.value = t.specularMap,
  48386. e.alphaMap.value = t.alphaMap,
  48387. t.aoMap && (e.aoMap.value = t.aoMap,
  48388. e.aoMapIntensity.value = t.aoMapIntensity),
  48389. 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),
  48390. void 0 !== i) {
  48391. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48392. var n = i.offset
  48393. , r = i.repeat;
  48394. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48395. }
  48396. e.envMap.value = t.envMap,
  48397. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48398. e.reflectivity.value = t.reflectivity,
  48399. e.refractionRatio.value = t.refractionRatio
  48400. }(h, i),
  48401. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48402. function(e, t) {
  48403. e.dashSize.value = t.dashSize,
  48404. e.totalSize.value = t.dashSize + t.gapSize,
  48405. e.scale.value = t.scale
  48406. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48407. if (e.diffuse.value = t.color,
  48408. e.opacity.value = t.opacity,
  48409. e.size.value = t.size * he,
  48410. e.scale.value = O.clientHeight / 2,
  48411. e.map.value = t.map,
  48412. null !== t.map) {
  48413. var i = t.map.offset
  48414. , n = t.map.repeat;
  48415. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48416. }
  48417. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48418. t.lightMap && (e.lightMap.value = t.lightMap,
  48419. e.lightMapIntensity.value = t.lightMapIntensity),
  48420. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48421. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48422. e.specular.value = t.specular,
  48423. e.shininess.value = Math.max(t.shininess, 1e-4),
  48424. t.lightMap && (e.lightMap.value = t.lightMap,
  48425. e.lightMapIntensity.value = t.lightMapIntensity),
  48426. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48427. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48428. e.bumpScale.value = t.bumpScale),
  48429. t.normalMap && (e.normalMap.value = t.normalMap,
  48430. e.normalScale.value.copy(t.normalScale)),
  48431. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48432. e.displacementScale.value = t.displacementScale,
  48433. e.displacementBias.value = t.displacementBias)
  48434. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48435. e.roughness.value = t.roughness,
  48436. e.metalness.value = t.metalness,
  48437. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48438. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48439. t.lightMap && (e.lightMap.value = t.lightMap,
  48440. e.lightMapIntensity.value = t.lightMapIntensity),
  48441. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48442. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48443. e.bumpScale.value = t.bumpScale),
  48444. t.normalMap && (e.normalMap.value = t.normalMap,
  48445. e.normalScale.value.copy(t.normalScale)),
  48446. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48447. e.displacementScale.value = t.displacementScale,
  48448. e.displacementBias.value = t.displacementBias),
  48449. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48450. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48451. h.mFar.value = e.far,
  48452. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48453. g(r.uniformsList)),
  48454. function(e, t) {
  48455. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48456. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48457. }(c, n),
  48458. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48459. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48460. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48461. var a = e[r][0]
  48462. , s = a.onUpdateCallback;
  48463. void 0 !== s && (s.bind(a)(t, i),
  48464. n.push(e[r]))
  48465. }
  48466. g(n)
  48467. }(r.uniformsList, n, e),
  48468. l
  48469. }
  48470. function p(e, t) {
  48471. e.diffuse.value = t.color,
  48472. e.opacity.value = t.opacity
  48473. }
  48474. function A() {
  48475. var e = oe;
  48476. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48477. oe += 1,
  48478. e
  48479. }
  48480. function C(e, t, i, n) {
  48481. var r, o;
  48482. if ("1i" === t)
  48483. X.uniform1i(i, n);
  48484. else if ("1f" === t)
  48485. X.uniform1f(i, n);
  48486. else if ("2f" === t)
  48487. X.uniform2f(i, n[0], n[1]);
  48488. else if ("3f" === t)
  48489. X.uniform3f(i, n[0], n[1], n[2]);
  48490. else if ("4f" === t)
  48491. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48492. else if ("1iv" === t)
  48493. X.uniform1iv(i, n);
  48494. else if ("3iv" === t)
  48495. X.uniform3iv(i, n);
  48496. else if ("1fv" === t)
  48497. X.uniform1fv(i, n);
  48498. else if ("2fv" === t)
  48499. X.uniform2fv(i, n);
  48500. else if ("3fv" === t)
  48501. X.uniform3fv(i, n);
  48502. else if ("4fv" === t)
  48503. X.uniform4fv(i, n);
  48504. else if ("Matrix2fv" === t)
  48505. X.uniformMatrix2fv(i, !1, n);
  48506. else if ("Matrix3fv" === t)
  48507. X.uniformMatrix3fv(i, !1, n);
  48508. else if ("Matrix4fv" === t)
  48509. X.uniformMatrix4fv(i, !1, n);
  48510. else if ("i" === t)
  48511. X.uniform1i(i, n);
  48512. else if ("f" === t)
  48513. X.uniform1f(i, n);
  48514. else if ("v2" === t)
  48515. X.uniform2f(i, n.x, n.y);
  48516. else if ("v3" === t)
  48517. X.uniform3f(i, n.x, n.y, n.z);
  48518. else if ("v4" === t)
  48519. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48520. else if ("c" === t)
  48521. X.uniform3f(i, n.r, n.g, n.b);
  48522. else if ("s" === t) {
  48523. var a = e.properties;
  48524. for (var s in a) {
  48525. var l = a[s]
  48526. , c = i[s]
  48527. , h = n[s];
  48528. C(l, l.type, c, h)
  48529. }
  48530. } else if ("sa" === t) {
  48531. a = e.properties;
  48532. for (var u = 0, d = n.length; u < d; u++)
  48533. for (var s in a) {
  48534. l = a[s],
  48535. c = i[u][s],
  48536. h = n[u][s];
  48537. C(l, l.type, c, h)
  48538. }
  48539. } else if ("iv1" === t)
  48540. X.uniform1iv(i, n);
  48541. else if ("iv" === t)
  48542. X.uniform3iv(i, n);
  48543. else if ("fv1" === t)
  48544. X.uniform1fv(i, n);
  48545. else if ("fv" === t)
  48546. X.uniform3fv(i, n);
  48547. else if ("v2v" === t) {
  48548. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48549. u = 0;
  48550. for (var p = 0, f = n.length; u < f; u++,
  48551. p += 2)
  48552. e._array[p + 0] = n[u].x,
  48553. e._array[p + 1] = n[u].y;
  48554. X.uniform2fv(i, e._array)
  48555. } else if ("v3v" === t) {
  48556. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48557. u = 0;
  48558. var g = 0;
  48559. for (f = n.length; u < f; u++,
  48560. g += 3)
  48561. e._array[g + 0] = n[u].x,
  48562. e._array[g + 1] = n[u].y,
  48563. e._array[g + 2] = n[u].z;
  48564. X.uniform3fv(i, e._array)
  48565. } else if ("v4v" === t) {
  48566. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48567. u = 0;
  48568. var m = 0;
  48569. for (f = n.length; u < f; u++,
  48570. m += 4)
  48571. e._array[m + 0] = n[u].x,
  48572. e._array[m + 1] = n[u].y,
  48573. e._array[m + 2] = n[u].z,
  48574. e._array[m + 3] = n[u].w;
  48575. X.uniform4fv(i, e._array)
  48576. } else if ("m2" === t)
  48577. X.uniformMatrix2fv(i, !1, n.elements);
  48578. else if ("m3" === t)
  48579. X.uniformMatrix3fv(i, !1, n.elements);
  48580. else if ("m3v" === t) {
  48581. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48582. for (u = 0,
  48583. f = n.length; u < f; u++)
  48584. n[u].flattenToArrayOffset(e._array, 9 * u);
  48585. X.uniformMatrix3fv(i, !1, e._array)
  48586. } else if ("m4" === t)
  48587. X.uniformMatrix4fv(i, !1, n.elements);
  48588. else if ("m4v" === t) {
  48589. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48590. for (u = 0,
  48591. f = n.length; u < f; u++)
  48592. n[u].flattenToArrayOffset(e._array, 16 * u);
  48593. X.uniformMatrix4fv(i, !1, e._array)
  48594. } else if ("t" === t) {
  48595. if (r = n,
  48596. o = A(),
  48597. X.uniform1i(i, o),
  48598. !r)
  48599. return;
  48600. 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)
  48601. } else if ("tv" === t) {
  48602. void 0 === e._array && (e._array = []);
  48603. for (u = 0,
  48604. f = e.value.length; u < f; u++)
  48605. e._array[u] = A();
  48606. X.uniform1iv(i, e._array);
  48607. for (u = 0,
  48608. f = e.value.length; u < f; u++)
  48609. r = e.value[u],
  48610. o = e._array[u],
  48611. 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))
  48612. } else
  48613. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48614. }
  48615. function g(e) {
  48616. for (var t = 0, i = e.length; t < i; t++) {
  48617. var n = e[t][0];
  48618. if (!1 !== n.needsUpdate)
  48619. C(n, n.type, e[t][1], n.value)
  48620. }
  48621. }
  48622. function m(e, t, i) {
  48623. var n;
  48624. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48625. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48626. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48627. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48628. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48629. 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),
  48630. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48631. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48632. 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)),
  48633. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48634. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48635. return;
  48636. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48637. return;
  48638. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48639. be.get(t).__currentAnisotropy = t.anisotropy)
  48640. }
  48641. }
  48642. function o(e, t, i) {
  48643. void 0 === e.__webglInit && (e.__webglInit = !0,
  48644. t.addEventListener("dispose", f),
  48645. e.__webglTexture = X.createTexture(),
  48646. ye.textures++),
  48647. _e.activeTexture(X.TEXTURE0 + i),
  48648. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48649. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48650. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48651. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48652. var n = I(t.image, Ee.maxTextureSize);
  48653. !function(e) {
  48654. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48655. }(t) || !1 !== E(n) || (n = function(e) {
  48656. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48657. var t = document.createElement("canvas");
  48658. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48659. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48660. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48661. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48662. t
  48663. }
  48664. return e
  48665. }(n));
  48666. var r = E(n)
  48667. , o = x(t.format)
  48668. , a = x(t.type);
  48669. m(X.TEXTURE_2D, t, r);
  48670. var s, l = t.mipmaps;
  48671. if (t instanceof Ci.DataTexture)
  48672. if (0 < l.length && r) {
  48673. for (var c = 0, h = l.length; c < h; c++)
  48674. s = l[c],
  48675. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48676. t.generateMipmaps = !1
  48677. } else
  48678. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48679. else if (t instanceof Ci.CompressedTexture)
  48680. for (c = 0,
  48681. h = l.length; c < h; c++)
  48682. s = l[c],
  48683. 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);
  48684. else if (0 < l.length && r) {
  48685. for (c = 0,
  48686. h = l.length; c < h; c++)
  48687. s = l[c],
  48688. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48689. t.generateMipmaps = !1
  48690. } else
  48691. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48692. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48693. e.__version = t.version,
  48694. t.onUpdate && t.onUpdate(t)
  48695. }
  48696. function I(e, t) {
  48697. if (e.width > t || e.height > t) {
  48698. var i = t / Math.max(e.width, e.height)
  48699. , n = document.createElement("canvas");
  48700. return n.width = Math.floor(e.width * i),
  48701. n.height = Math.floor(e.height * i),
  48702. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48703. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48704. n
  48705. }
  48706. return e
  48707. }
  48708. function E(e) {
  48709. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48710. }
  48711. function _(e, t) {
  48712. var i = be.get(e);
  48713. if (6 === e.image.length)
  48714. if (0 < e.version && i.__version !== e.version) {
  48715. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48716. i.__image__webglTextureCube = X.createTexture(),
  48717. ye.textures++),
  48718. _e.activeTexture(X.TEXTURE0 + t),
  48719. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48720. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48721. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48722. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48723. var s = E(o[0])
  48724. , l = x(e.format)
  48725. , c = x(e.type);
  48726. m(X.TEXTURE_CUBE_MAP, e, s);
  48727. for (a = 0; a < 6; a++)
  48728. if (n)
  48729. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48730. h = u[d],
  48731. 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);
  48732. else
  48733. 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]);
  48734. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48735. i.__version = e.version,
  48736. e.onUpdate && e.onUpdate(e)
  48737. } else
  48738. _e.activeTexture(X.TEXTURE0 + t),
  48739. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48740. }
  48741. function b(e, t) {
  48742. _e.activeTexture(X.TEXTURE0 + t),
  48743. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48744. }
  48745. function h(e, t, i, n) {
  48746. var r = x(t.texture.format)
  48747. , o = x(t.texture.type);
  48748. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48749. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48750. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48751. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48752. }
  48753. function u(e, t) {
  48754. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48755. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48756. 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),
  48757. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48758. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48759. }
  48760. function w(e) {
  48761. var t = be.get(e)
  48762. , i = be.get(e.texture);
  48763. e.addEventListener("dispose", a),
  48764. i.__webglTexture = X.createTexture(),
  48765. ye.textures++;
  48766. var n = e instanceof Ci.WebGLRenderTargetCube
  48767. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48768. if (n) {
  48769. t.__webglFramebuffer = [];
  48770. for (var o = 0; o < 6; o++)
  48771. t.__webglFramebuffer[o] = X.createFramebuffer()
  48772. } else
  48773. t.__webglFramebuffer = X.createFramebuffer();
  48774. if (n) {
  48775. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  48776. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  48777. for (o = 0; o < 6; o++)
  48778. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  48779. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48780. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  48781. } else
  48782. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  48783. m(X.TEXTURE_2D, e.texture, r),
  48784. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  48785. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48786. _e.bindTexture(X.TEXTURE_2D, null);
  48787. e.depthBuffer && function(e) {
  48788. var t = be.get(e);
  48789. if (e instanceof Ci.WebGLRenderTargetCube) {
  48790. t.__webglDepthbuffer = [];
  48791. for (var i = 0; i < 6; i++)
  48792. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  48793. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  48794. u(t.__webglDepthbuffer[i], e)
  48795. } else
  48796. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  48797. t.__webglDepthbuffer = X.createRenderbuffer(),
  48798. u(t.__webglDepthbuffer, e);
  48799. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48800. }(e)
  48801. }
  48802. function T(e) {
  48803. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  48804. }
  48805. function x(e) {
  48806. var t;
  48807. if (e === Ci.RepeatWrapping)
  48808. return X.REPEAT;
  48809. if (e === Ci.ClampToEdgeWrapping)
  48810. return X.CLAMP_TO_EDGE;
  48811. if (e === Ci.MirroredRepeatWrapping)
  48812. return X.MIRRORED_REPEAT;
  48813. if (e === Ci.NearestFilter)
  48814. return X.NEAREST;
  48815. if (e === Ci.NearestMipMapNearestFilter)
  48816. return X.NEAREST_MIPMAP_NEAREST;
  48817. if (e === Ci.NearestMipMapLinearFilter)
  48818. return X.NEAREST_MIPMAP_LINEAR;
  48819. if (e === Ci.LinearFilter)
  48820. return X.LINEAR;
  48821. if (e === Ci.LinearMipMapNearestFilter)
  48822. return X.LINEAR_MIPMAP_NEAREST;
  48823. if (e === Ci.LinearMipMapLinearFilter)
  48824. return X.LINEAR_MIPMAP_LINEAR;
  48825. if (e === Ci.UnsignedByteType)
  48826. return X.UNSIGNED_BYTE;
  48827. if (e === Ci.UnsignedShort4444Type)
  48828. return X.UNSIGNED_SHORT_4_4_4_4;
  48829. if (e === Ci.UnsignedShort5551Type)
  48830. return X.UNSIGNED_SHORT_5_5_5_1;
  48831. if (e === Ci.UnsignedShort565Type)
  48832. return X.UNSIGNED_SHORT_5_6_5;
  48833. if (e === Ci.ByteType)
  48834. return X.BYTE;
  48835. if (e === Ci.ShortType)
  48836. return X.SHORT;
  48837. if (e === Ci.UnsignedShortType)
  48838. return X.UNSIGNED_SHORT;
  48839. if (e === Ci.IntType)
  48840. return X.INT;
  48841. if (e === Ci.UnsignedIntType)
  48842. return X.UNSIGNED_INT;
  48843. if (e === Ci.FloatType)
  48844. return X.FLOAT;
  48845. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  48846. return t.HALF_FLOAT_OES;
  48847. if (e === Ci.AlphaFormat)
  48848. return X.ALPHA;
  48849. if (e === Ci.RGBFormat)
  48850. return X.RGB;
  48851. if (e === Ci.RGBAFormat)
  48852. return X.RGBA;
  48853. if (e === Ci.LuminanceFormat)
  48854. return X.LUMINANCE;
  48855. if (e === Ci.LuminanceAlphaFormat)
  48856. return X.LUMINANCE_ALPHA;
  48857. if (e === Ci.AddEquation)
  48858. return X.FUNC_ADD;
  48859. if (e === Ci.SubtractEquation)
  48860. return X.FUNC_SUBTRACT;
  48861. if (e === Ci.ReverseSubtractEquation)
  48862. return X.FUNC_REVERSE_SUBTRACT;
  48863. if (e === Ci.ZeroFactor)
  48864. return X.ZERO;
  48865. if (e === Ci.OneFactor)
  48866. return X.ONE;
  48867. if (e === Ci.SrcColorFactor)
  48868. return X.SRC_COLOR;
  48869. if (e === Ci.OneMinusSrcColorFactor)
  48870. return X.ONE_MINUS_SRC_COLOR;
  48871. if (e === Ci.SrcAlphaFactor)
  48872. return X.SRC_ALPHA;
  48873. if (e === Ci.OneMinusSrcAlphaFactor)
  48874. return X.ONE_MINUS_SRC_ALPHA;
  48875. if (e === Ci.DstAlphaFactor)
  48876. return X.DST_ALPHA;
  48877. if (e === Ci.OneMinusDstAlphaFactor)
  48878. return X.ONE_MINUS_DST_ALPHA;
  48879. if (e === Ci.DstColorFactor)
  48880. return X.DST_COLOR;
  48881. if (e === Ci.OneMinusDstColorFactor)
  48882. return X.ONE_MINUS_DST_COLOR;
  48883. if (e === Ci.SrcAlphaSaturateFactor)
  48884. return X.SRC_ALPHA_SATURATE;
  48885. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  48886. if (e === Ci.RGB_S3TC_DXT1_Format)
  48887. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  48888. if (e === Ci.RGBA_S3TC_DXT1_Format)
  48889. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  48890. if (e === Ci.RGBA_S3TC_DXT3_Format)
  48891. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  48892. if (e === Ci.RGBA_S3TC_DXT5_Format)
  48893. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  48894. }
  48895. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  48896. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  48897. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  48898. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  48899. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  48900. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  48901. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  48902. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  48903. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  48904. }
  48905. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  48906. return t.COMPRESSED_RGB_ETC1_WEBGL;
  48907. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  48908. if (e === Ci.MinEquation)
  48909. return t.MIN_EXT;
  48910. if (e === Ci.MaxEquation)
  48911. return t.MAX_EXT
  48912. }
  48913. return 0
  48914. }
  48915. console.log("THREE.WebGLRenderer", Ci.REVISION);
  48916. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  48917. , L = void 0 !== e.context ? e.context : null
  48918. , D = void 0 !== e.alpha && e.alpha
  48919. , N = void 0 === e.depth || e.depth
  48920. , F = void 0 === e.stencil || e.stencil
  48921. , B = void 0 !== e.antialias && e.antialias
  48922. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  48923. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  48924. , U = []
  48925. , H = []
  48926. , z = -1
  48927. , G = []
  48928. , W = -1
  48929. , j = new Float32Array(8)
  48930. , Y = []
  48931. , q = [];
  48932. this.domElement = O,
  48933. this.context = null,
  48934. this.autoClear = !0,
  48935. this.autoClearColor = !0,
  48936. this.autoClearDepth = !0,
  48937. this.autoClearStencil = !0,
  48938. this.sortObjects = !0,
  48939. this.gammaFactor = 2,
  48940. this.gammaInput = !1,
  48941. this.gammaOutput = !1,
  48942. this.physicallyCorrectLights = !1,
  48943. this.toneMapping = Ci.LinearToneMapping,
  48944. this.toneMappingExposure = 1,
  48945. this.toneMappingWhitePoint = 1,
  48946. this.maxMorphTargets = 8,
  48947. this.maxMorphNormals = 4,
  48948. this.autoScaleCubemaps = !0;
  48949. 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 = {
  48950. hash: "",
  48951. ambient: [0, 0, 0],
  48952. directional: [],
  48953. directionalShadowMap: [],
  48954. directionalShadowMatrix: [],
  48955. spot: [],
  48956. spotShadowMap: [],
  48957. spotShadowMatrix: [],
  48958. point: [],
  48959. pointShadowMap: [],
  48960. pointShadowMatrix: [],
  48961. hemi: [],
  48962. shadows: [],
  48963. shadowsPointLight: 0
  48964. }, ye = {
  48965. geometries: 0,
  48966. textures: 0
  48967. }, Ae = {
  48968. calls: 0,
  48969. vertices: 0,
  48970. faces: 0,
  48971. points: 0
  48972. };
  48973. this.info = {
  48974. render: Ae,
  48975. memory: ye,
  48976. programs: null
  48977. };
  48978. try {
  48979. var Ce = {
  48980. alpha: D,
  48981. depth: N,
  48982. stencil: F,
  48983. antialias: B,
  48984. premultipliedAlpha: V,
  48985. preserveDrawingBuffer: k
  48986. };
  48987. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  48988. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  48989. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  48990. return {
  48991. rangeMin: 1,
  48992. rangeMax: 1,
  48993. precision: 1
  48994. }
  48995. }
  48996. ),
  48997. O.addEventListener("webglcontextlost", r, !1)
  48998. } catch (e) {
  48999. console.error("THREE.WebGLRenderer: " + e)
  49000. }
  49001. var Ie = new Ci.WebGLExtensions(X);
  49002. Ie.get("OES_texture_float"),
  49003. Ie.get("OES_texture_float_linear"),
  49004. Ie.get("OES_texture_half_float"),
  49005. Ie.get("OES_texture_half_float_linear"),
  49006. Ie.get("OES_standard_derivatives"),
  49007. Ie.get("ANGLE_instanced_arrays"),
  49008. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49009. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49010. , _e = new Ci.WebGLState(X,Ie,x)
  49011. , be = new Ci.WebGLProperties
  49012. , we = new Ci.WebGLObjects(X,be,this.info)
  49013. , Te = new Ci.WebGLPrograms(this,Ee)
  49014. , xe = new Ci.WebGLLights;
  49015. this.info.programs = Te.programs;
  49016. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49017. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49018. t(),
  49019. this.context = X,
  49020. this.capabilities = Ee,
  49021. this.extensions = Ie,
  49022. this.properties = be,
  49023. this.state = _e;
  49024. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49025. this.shadowMap = Re;
  49026. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49027. this.getContext = function() {
  49028. return X
  49029. }
  49030. ,
  49031. this.getContextAttributes = function() {
  49032. return X.getContextAttributes()
  49033. }
  49034. ,
  49035. this.forceContextLoss = function() {
  49036. Ie.get("WEBGL_lose_context").loseContext()
  49037. }
  49038. ,
  49039. this.getMaxAnisotropy = function() {
  49040. if (void 0 !== Pe)
  49041. return Pe;
  49042. var e = Ie.get("EXT_texture_filter_anisotropic");
  49043. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49044. }
  49045. ,
  49046. this.getPrecision = function() {
  49047. return Ee.precision
  49048. }
  49049. ,
  49050. this.getPixelRatio = function() {
  49051. return he
  49052. }
  49053. ,
  49054. this.setPixelRatio = function(e) {
  49055. void 0 !== e && (he = e,
  49056. this.setSize(pe.z, pe.w, !1))
  49057. }
  49058. ,
  49059. this.getSize = function() {
  49060. return {
  49061. width: le,
  49062. height: ce
  49063. }
  49064. }
  49065. ,
  49066. this.setSize = function(e, t, i, n) {
  49067. null != n && (he = n),
  49068. le = e,
  49069. ce = t,
  49070. O.width = e * he,
  49071. O.height = t * he,
  49072. !1 !== i && (O.style.width = e + "px",
  49073. O.style.height = t + "px"),
  49074. this.setViewport(0, 0, e, t)
  49075. }
  49076. ,
  49077. this.setViewport = function(e, t, i, n) {
  49078. _e.viewport(pe.set(e, t, i, n))
  49079. }
  49080. ,
  49081. this.setScissor = function(e, t, i, n) {
  49082. _e.scissor(ue.set(e, t, i, n))
  49083. }
  49084. ,
  49085. this.setScissorTest = function(e) {
  49086. _e.setScissorTest(de = e)
  49087. }
  49088. ,
  49089. this.getClearColor = function() {
  49090. return ae
  49091. }
  49092. ,
  49093. this.setClearColor = function(e, t) {
  49094. ae.set(e),
  49095. se = void 0 !== t ? t : 1,
  49096. i(ae.r, ae.g, ae.b, se)
  49097. }
  49098. ,
  49099. this.getClearAlpha = function() {
  49100. return se
  49101. }
  49102. ,
  49103. this.setClearAlpha = function(e) {
  49104. se = e,
  49105. i(ae.r, ae.g, ae.b, se)
  49106. }
  49107. ,
  49108. this.clear = function(e, t, i) {
  49109. var n = 0;
  49110. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49111. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49112. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49113. X.clear(n)
  49114. }
  49115. ,
  49116. this.clearColor = function() {
  49117. this.clear(!0, !1, !1)
  49118. }
  49119. ,
  49120. this.clearDepth = function() {
  49121. this.clear(!1, !0, !1)
  49122. }
  49123. ,
  49124. this.clearStencil = function() {
  49125. this.clear(!1, !1, !0)
  49126. }
  49127. ,
  49128. this.clearTarget = function(e, t, i, n) {
  49129. this.setRenderTarget(e),
  49130. this.clear(t, i, n)
  49131. }
  49132. ,
  49133. this.resetGLState = n,
  49134. this.dispose = function() {
  49135. O.removeEventListener("webglcontextlost", r, !1)
  49136. }
  49137. ,
  49138. this.renderBufferImmediate = function(e, t, i) {
  49139. _e.initAttributes();
  49140. var n = be.get(e);
  49141. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49142. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49143. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49144. e.hasColors && !n.color && (n.color = X.createBuffer());
  49145. var r = t.getAttributes();
  49146. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49147. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49148. _e.enableAttribute(r.position),
  49149. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49150. e.hasNormals) {
  49151. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49152. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49153. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49154. var s = e.normalArray
  49155. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49156. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49157. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49158. s[o + 0] = l,
  49159. s[o + 1] = c,
  49160. s[o + 2] = h,
  49161. s[o + 3] = l,
  49162. s[o + 4] = c,
  49163. s[o + 5] = h,
  49164. s[o + 6] = l,
  49165. s[o + 7] = c,
  49166. s[o + 8] = h
  49167. }
  49168. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49169. _e.enableAttribute(r.normal),
  49170. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49171. }
  49172. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49173. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49174. _e.enableAttribute(r.uv),
  49175. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49176. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49177. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49178. _e.enableAttribute(r.color),
  49179. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49180. _e.disableUnusedAttributes(),
  49181. X.drawArrays(X.TRIANGLES, 0, e.count),
  49182. e.count = 0
  49183. }
  49184. ,
  49185. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49186. R(n);
  49187. var a = P(e, t, n, r)
  49188. , s = !1
  49189. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49190. l !== ee && (ee = l,
  49191. s = !0);
  49192. var c = r.morphTargetInfluences;
  49193. if (void 0 !== c) {
  49194. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49195. var p = c[u];
  49196. h.push([p, u])
  49197. }
  49198. h.sort(M),
  49199. 8 < h.length && (h.length = 8);
  49200. var f = i.morphAttributes;
  49201. for (u = 0,
  49202. d = h.length; u < d; u++) {
  49203. p = h[u];
  49204. if (j[u] = p[0],
  49205. 0 !== p[0]) {
  49206. var g = p[1];
  49207. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49208. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49209. } else
  49210. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49211. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49212. }
  49213. var m = a.getUniforms();
  49214. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49215. s = !0
  49216. }
  49217. g = i.index;
  49218. var v, y = i.attributes.position;
  49219. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49220. null !== g ? (v = Me).setIndex(g) : v = Se,
  49221. s && (function(e, t, i, n) {
  49222. var r;
  49223. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49224. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49225. else {
  49226. void 0 === n && (n = 0),
  49227. _e.initAttributes();
  49228. var o = i.attributes
  49229. , a = t.getAttributes()
  49230. , s = e.defaultAttributeValues;
  49231. for (var l in a) {
  49232. var c = a[l];
  49233. if (0 <= c) {
  49234. var h = o[l];
  49235. if (void 0 !== h) {
  49236. var u = h.itemSize
  49237. , d = we.getAttributeBuffer(h);
  49238. if (h instanceof Ci.InterleavedBufferAttribute) {
  49239. var p = h.data
  49240. , f = p.stride
  49241. , g = h.offset;
  49242. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49243. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49244. X.bindBuffer(X.ARRAY_BUFFER, d),
  49245. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49246. } else
  49247. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49248. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49249. X.bindBuffer(X.ARRAY_BUFFER, d),
  49250. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49251. } else if (void 0 !== s) {
  49252. var m = s[l];
  49253. if (void 0 !== m)
  49254. switch (m.length) {
  49255. case 2:
  49256. X.vertexAttrib2fv(c, m);
  49257. break;
  49258. case 3:
  49259. X.vertexAttrib3fv(c, m);
  49260. break;
  49261. case 4:
  49262. X.vertexAttrib4fv(c, m);
  49263. break;
  49264. default:
  49265. X.vertexAttrib1fv(c, m)
  49266. }
  49267. }
  49268. }
  49269. }
  49270. _e.disableUnusedAttributes()
  49271. }
  49272. }(n, a, i),
  49273. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49274. var A = 1 / 0;
  49275. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49276. var C = i.drawRange.start
  49277. , I = i.drawRange.count
  49278. , E = null !== o ? o.start : 0
  49279. , _ = null !== o ? o.count : 1 / 0
  49280. , b = Math.max(0, C, E)
  49281. , w = Math.min(0 + A, C + I, E + _) - 1
  49282. , T = Math.max(0, w - b + 1);
  49283. if (r instanceof Ci.Mesh)
  49284. if (!0 === n.wireframe)
  49285. _e.setLineWidth(n.wireframeLinewidth * S()),
  49286. v.setMode(X.LINES);
  49287. else
  49288. switch (r.drawMode) {
  49289. case Ci.TrianglesDrawMode:
  49290. v.setMode(X.TRIANGLES);
  49291. break;
  49292. case Ci.TriangleStripDrawMode:
  49293. v.setMode(X.TRIANGLE_STRIP);
  49294. break;
  49295. case Ci.TriangleFanDrawMode:
  49296. v.setMode(X.TRIANGLE_FAN)
  49297. }
  49298. else if (r instanceof Ci.Line) {
  49299. var x = n.linewidth;
  49300. void 0 === x && (x = 1),
  49301. _e.setLineWidth(x * S()),
  49302. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49303. } else
  49304. r instanceof Ci.Points && v.setMode(X.POINTS);
  49305. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49306. }
  49307. ,
  49308. this.render = function(e, t, i, n) {
  49309. if (t instanceof Ci.Camera != 0) {
  49310. var r = e.fog;
  49311. if (ee = "",
  49312. $ = -1,
  49313. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49314. null === t.parent && t.updateMatrixWorld(),
  49315. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49316. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49317. fe.setFromMatrix(ge),
  49318. U.length = 0,
  49319. W = z = -1,
  49320. Y.length = 0,
  49321. q.length = 0,
  49322. function e(t, i) {
  49323. if (!1 !== t.visible) {
  49324. if (t.layers.test(i.layers))
  49325. if (t instanceof Ci.Light)
  49326. U.push(t);
  49327. else if (t instanceof Ci.Sprite)
  49328. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49329. else if (t instanceof Ci.LensFlare)
  49330. q.push(t);
  49331. else if (t instanceof Ci.ImmediateRenderObject)
  49332. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49333. me.applyProjection(ge)),
  49334. d(t, null, t.material, me.z, null);
  49335. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49336. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49337. var n = t.material;
  49338. if (!0 === n.visible) {
  49339. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49340. me.applyProjection(ge));
  49341. var r = we.update(t);
  49342. if (n instanceof Ci.MultiMaterial)
  49343. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49344. var c = o[s]
  49345. , h = a[c.materialIndex];
  49346. !0 === h.visible && d(t, r, h, me.z, c)
  49347. }
  49348. else
  49349. d(t, r, n, me.z, null)
  49350. }
  49351. }
  49352. var u = t.children;
  49353. for (s = 0,
  49354. l = u.length; s < l; s++)
  49355. e(u[s], i)
  49356. }
  49357. }(e, t),
  49358. H.length = z + 1,
  49359. G.length = W + 1,
  49360. !0 === Z.sortObjects && (H.sort(s),
  49361. G.sort(l)),
  49362. function(e, t) {
  49363. 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;
  49364. for (i = ve.shadowsPointLight = 0,
  49365. n = e.length; i < n; i++)
  49366. if (o = (r = e[i]).color,
  49367. a = r.intensity,
  49368. s = r.distance,
  49369. r instanceof Ci.AmbientLight)
  49370. l += o.r * a,
  49371. c += o.g * a,
  49372. h += o.b * a;
  49373. else if (r instanceof Ci.DirectionalLight) {
  49374. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49375. v.direction.setFromMatrixPosition(r.matrixWorld),
  49376. me.setFromMatrixPosition(r.target.matrixWorld),
  49377. v.direction.sub(me),
  49378. v.direction.transformDirection(u),
  49379. v.shadow = r.castShadow,
  49380. r.castShadow && (v.shadowBias = r.shadow.bias,
  49381. v.shadowRadius = r.shadow.radius,
  49382. v.shadowMapSize = r.shadow.mapSize,
  49383. ve.shadows[m++] = r),
  49384. ve.directionalShadowMap[d] = r.shadow.map,
  49385. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49386. ve.directional[d++] = v
  49387. } else if (r instanceof Ci.SpotLight) {
  49388. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49389. v.position.applyMatrix4(u),
  49390. v.color.copy(o).multiplyScalar(a),
  49391. v.distance = s,
  49392. v.direction.setFromMatrixPosition(r.matrixWorld),
  49393. me.setFromMatrixPosition(r.target.matrixWorld),
  49394. v.direction.sub(me),
  49395. v.direction.transformDirection(u),
  49396. v.coneCos = Math.cos(r.angle),
  49397. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49398. v.decay = 0 === r.distance ? 0 : r.decay,
  49399. v.shadow = r.castShadow,
  49400. r.castShadow && (v.shadowBias = r.shadow.bias,
  49401. v.shadowRadius = r.shadow.radius,
  49402. v.shadowMapSize = r.shadow.mapSize,
  49403. ve.shadows[m++] = r),
  49404. ve.spotShadowMap[f] = r.shadow.map,
  49405. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49406. ve.spot[f++] = v
  49407. } else if (r instanceof Ci.PointLight) {
  49408. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49409. v.position.applyMatrix4(u),
  49410. v.color.copy(r.color).multiplyScalar(r.intensity),
  49411. v.distance = r.distance,
  49412. v.decay = 0 === r.distance ? 0 : r.decay,
  49413. v.shadow = r.castShadow,
  49414. r.castShadow && (v.shadowBias = r.shadow.bias,
  49415. v.shadowRadius = r.shadow.radius,
  49416. v.shadowMapSize = r.shadow.mapSize,
  49417. ve.shadows[m++] = r),
  49418. ve.pointShadowMap[p] = r.shadow.map,
  49419. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49420. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49421. ve.pointShadowMatrix[p].identity().setPosition(me),
  49422. ve.point[p++] = v
  49423. } else if (r instanceof Ci.HemisphereLight) {
  49424. var v;
  49425. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49426. v.direction.transformDirection(u),
  49427. v.direction.normalize(),
  49428. v.skyColor.copy(r.color).multiplyScalar(a),
  49429. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49430. ve.hemi[g++] = v
  49431. }
  49432. ve.ambient[0] = l,
  49433. ve.ambient[1] = c,
  49434. ve.ambient[2] = h,
  49435. ve.directional.length = d,
  49436. ve.spot.length = f,
  49437. ve.point.length = p,
  49438. ve.hemi.length = g,
  49439. ve.shadows.length = m,
  49440. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49441. }(U, t),
  49442. Re.render(e, t),
  49443. Ae.calls = 0,
  49444. Ae.vertices = 0,
  49445. Ae.faces = 0,
  49446. void (Ae.points = 0) === i && (i = null),
  49447. this.setRenderTarget(i),
  49448. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49449. e.overrideMaterial) {
  49450. var o = e.overrideMaterial;
  49451. c(H, t, r, o),
  49452. c(G, t, r, o)
  49453. } else
  49454. _e.setBlending(Ci.NoBlending),
  49455. c(H, t, r),
  49456. c(G, t, r);
  49457. if (Oe.render(e, t),
  49458. Le.render(e, t, re),
  49459. i) {
  49460. var a = i.texture;
  49461. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49462. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49463. , i = be.get(e.texture).__webglTexture;
  49464. _e.bindTexture(t, i),
  49465. X.generateMipmap(t),
  49466. _e.bindTexture(t, null)
  49467. }(i)
  49468. }
  49469. _e.setDepthTest(!0),
  49470. _e.setDepthWrite(!0),
  49471. _e.setColorWrite(!0)
  49472. } else
  49473. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49474. }
  49475. ,
  49476. this.setFaceCulling = function(e, t) {
  49477. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49478. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49479. _e.enable(X.CULL_FACE))
  49480. }
  49481. ,
  49482. this.setTexture = function(e, t) {
  49483. var i = be.get(e);
  49484. if (0 < e.version && i.__version !== e.version) {
  49485. var n = e.image;
  49486. 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)
  49487. }
  49488. _e.activeTexture(X.TEXTURE0 + t),
  49489. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49490. }
  49491. ,
  49492. this.getCurrentRenderTarget = function() {
  49493. return Q
  49494. }
  49495. ,
  49496. this.setRenderTarget = function(e) {
  49497. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49498. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49499. if (e) {
  49500. var n = be.get(e);
  49501. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49502. ie.copy(e.scissor),
  49503. ne = e.scissorTest,
  49504. re.copy(e.viewport)
  49505. } else
  49506. t = null,
  49507. ie.copy(ue).multiplyScalar(he),
  49508. ne = de,
  49509. re.copy(pe).multiplyScalar(he);
  49510. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49511. J = t),
  49512. _e.scissor(ie),
  49513. _e.setScissorTest(ne),
  49514. _e.viewport(re),
  49515. i) {
  49516. var r = be.get(e.texture);
  49517. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49518. }
  49519. }
  49520. ,
  49521. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49522. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49523. var a = be.get(e).__webglFramebuffer;
  49524. if (a) {
  49525. var s = !1;
  49526. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49527. s = !0);
  49528. try {
  49529. var l = e.texture;
  49530. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49531. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49532. 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")))
  49533. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49534. 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.")
  49535. } finally {
  49536. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49537. }
  49538. }
  49539. } else
  49540. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49541. }
  49542. }
  49543. ,
  49544. Ci.WebGLRenderTarget = function(e, t, i) {
  49545. this.uuid = Ci.Math.generateUUID(),
  49546. this.width = e,
  49547. this.height = t,
  49548. this.scissor = new Ci.Vector4(0,0,e,t),
  49549. this.scissorTest = !1,
  49550. this.viewport = new Ci.Vector4(0,0,e,t),
  49551. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49552. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49553. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49554. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49555. }
  49556. ,
  49557. Ci.WebGLRenderTarget.prototype = {
  49558. constructor: Ci.WebGLRenderTarget,
  49559. setSize: function(e, t) {
  49560. this.width === e && this.height === t || (this.width = e,
  49561. this.height = t,
  49562. this.dispose()),
  49563. this.viewport.set(0, 0, e, t),
  49564. this.scissor.set(0, 0, e, t)
  49565. },
  49566. clone: function() {
  49567. return (new this.constructor).copy(this)
  49568. },
  49569. copy: function(e) {
  49570. return this.width = e.width,
  49571. this.height = e.height,
  49572. this.viewport.copy(e.viewport),
  49573. this.texture = e.texture.clone(),
  49574. this.depthBuffer = e.depthBuffer,
  49575. this.stencilBuffer = e.stencilBuffer,
  49576. this
  49577. },
  49578. dispose: function() {
  49579. this.dispatchEvent({
  49580. type: "dispose"
  49581. })
  49582. }
  49583. },
  49584. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49585. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49586. Ci.WebGLRenderTarget.call(this, e, t, i),
  49587. this.activeCubeFace = 0,
  49588. this.activeMipMapLevel = 0
  49589. }
  49590. ,
  49591. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49592. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49593. Ci.WebGLBufferRenderer = function(r, o, a) {
  49594. var s;
  49595. this.setMode = function(e) {
  49596. s = e
  49597. }
  49598. ,
  49599. this.render = function(e, t) {
  49600. r.drawArrays(s, e, t),
  49601. a.calls++,
  49602. a.vertices += t,
  49603. s === r.TRIANGLES && (a.faces += t / 3)
  49604. }
  49605. ,
  49606. this.renderInstances = function(e) {
  49607. var t = o.get("ANGLE_instanced_arrays");
  49608. if (null !== t) {
  49609. var i = e.attributes.position
  49610. , n = 0;
  49611. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49612. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49613. a.calls++,
  49614. a.vertices += n * e.maxInstancedCount,
  49615. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49616. } else
  49617. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49618. }
  49619. }
  49620. ,
  49621. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49622. var s, l, c;
  49623. this.setMode = function(e) {
  49624. s = e
  49625. }
  49626. ,
  49627. this.setIndex = function(e) {
  49628. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49629. 4) : (l = r.UNSIGNED_SHORT,
  49630. 2)
  49631. }
  49632. ,
  49633. this.render = function(e, t) {
  49634. r.drawElements(s, t, l, e * c),
  49635. a.calls++,
  49636. a.vertices += t,
  49637. s === r.TRIANGLES && (a.faces += t / 3)
  49638. }
  49639. ,
  49640. this.renderInstances = function(e, t, i) {
  49641. var n = o.get("ANGLE_instanced_arrays");
  49642. 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),
  49643. a.calls++,
  49644. a.vertices += i * e.maxInstancedCount,
  49645. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49646. }
  49647. }
  49648. ,
  49649. Ci.WebGLExtensions = function(i) {
  49650. var n = {};
  49651. this.get = function(e) {
  49652. if (void 0 !== n[e])
  49653. return n[e];
  49654. var t;
  49655. switch (e) {
  49656. case "EXT_texture_filter_anisotropic":
  49657. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49658. break;
  49659. case "WEBGL_compressed_texture_s3tc":
  49660. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49661. break;
  49662. case "WEBGL_compressed_texture_pvrtc":
  49663. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49664. break;
  49665. case "WEBGL_compressed_texture_etc1":
  49666. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49667. break;
  49668. default:
  49669. t = i.getExtension(e)
  49670. }
  49671. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49672. n[e] = t
  49673. }
  49674. }
  49675. ,
  49676. Ci.WebGLCapabilities = function(t, e, i) {
  49677. function n(e) {
  49678. if ("highp" === e) {
  49679. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49680. return "highp";
  49681. e = "mediump"
  49682. }
  49683. 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"
  49684. }
  49685. this.getMaxPrecision = n,
  49686. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49687. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49688. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49689. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49690. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49691. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49692. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49693. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49694. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49695. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49696. this.vertexTextures = 0 < this.maxVertexTextures,
  49697. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49698. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49699. var r = n(this.precision);
  49700. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49701. this.precision = r),
  49702. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49703. }
  49704. ,
  49705. Ci.WebGLGeometries = function(i, o, a) {
  49706. function s(e) {
  49707. var t = e.target
  49708. , i = c[t.id];
  49709. null !== i.index && l(i.index),
  49710. function(e) {
  49711. for (var t in e)
  49712. l(e[t])
  49713. }(i.attributes),
  49714. t.removeEventListener("dispose", s),
  49715. delete c[t.id];
  49716. var n = o.get(t);
  49717. n.wireframe && l(n.wireframe),
  49718. o.delete(t);
  49719. var r = o.get(i);
  49720. r.wireframe && l(r.wireframe),
  49721. o.delete(i),
  49722. a.memory.geometries--
  49723. }
  49724. function l(e) {
  49725. var t = function(e) {
  49726. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49727. }(e);
  49728. void 0 !== t && (i.deleteBuffer(t),
  49729. function(e) {
  49730. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49731. }(e))
  49732. }
  49733. var c = {};
  49734. this.get = function(e) {
  49735. var t, i = e.geometry;
  49736. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49737. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49738. t = i._bufferGeometry),
  49739. c[i.id] = t,
  49740. a.memory.geometries++,
  49741. t)
  49742. }
  49743. }
  49744. ,
  49745. Ci.WebGLLights = function() {
  49746. var i = {};
  49747. this.get = function(e) {
  49748. if (void 0 !== i[e.id])
  49749. return i[e.id];
  49750. var t;
  49751. switch (e.type) {
  49752. case "DirectionalLight":
  49753. t = {
  49754. direction: new Ci.Vector3,
  49755. color: new Ci.Color,
  49756. shadow: !1,
  49757. shadowBias: 0,
  49758. shadowRadius: 1,
  49759. shadowMapSize: new Ci.Vector2
  49760. };
  49761. break;
  49762. case "SpotLight":
  49763. t = {
  49764. position: new Ci.Vector3,
  49765. direction: new Ci.Vector3,
  49766. color: new Ci.Color,
  49767. distance: 0,
  49768. coneCos: 0,
  49769. penumbraCos: 0,
  49770. decay: 0,
  49771. shadow: !1,
  49772. shadowBias: 0,
  49773. shadowRadius: 1,
  49774. shadowMapSize: new Ci.Vector2
  49775. };
  49776. break;
  49777. case "PointLight":
  49778. t = {
  49779. position: new Ci.Vector3,
  49780. color: new Ci.Color,
  49781. distance: 0,
  49782. decay: 0,
  49783. shadow: !1,
  49784. shadowBias: 0,
  49785. shadowRadius: 1,
  49786. shadowMapSize: new Ci.Vector2
  49787. };
  49788. break;
  49789. case "HemisphereLight":
  49790. t = {
  49791. direction: new Ci.Vector3,
  49792. skyColor: new Ci.Color,
  49793. groundColor: new Ci.Color
  49794. }
  49795. }
  49796. return i[e.id] = t
  49797. }
  49798. }
  49799. ,
  49800. Ci.WebGLObjects = function(g, m, e) {
  49801. function v(e, t) {
  49802. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  49803. , n = m.get(i);
  49804. void 0 === n.__webglBuffer ? function(e, t, i) {
  49805. e.__webglBuffer = g.createBuffer(),
  49806. g.bindBuffer(i, e.__webglBuffer);
  49807. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  49808. g.bufferData(i, t.array, n),
  49809. e.version = t.version
  49810. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  49811. g.bindBuffer(i, e.__webglBuffer),
  49812. !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)),
  49813. t.updateRange.count = 0),
  49814. e.version = t.version
  49815. }(n, i, t)
  49816. }
  49817. function y(e, t, i) {
  49818. if (i < t) {
  49819. var n = t;
  49820. t = i,
  49821. i = n
  49822. }
  49823. var r = e[t];
  49824. return void 0 === r ? (e[t] = [i],
  49825. !0) : -1 === r.indexOf(i) && (r.push(i),
  49826. !0)
  49827. }
  49828. var c = new Ci.WebGLGeometries(g,m,e);
  49829. this.getAttributeBuffer = function(e) {
  49830. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  49831. }
  49832. ,
  49833. this.getWireframeAttribute = function(e) {
  49834. var t = m.get(e);
  49835. if (void 0 !== t.wireframe)
  49836. return t.wireframe;
  49837. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  49838. if (null !== r)
  49839. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  49840. var h = i[l + 0]
  49841. , u = i[l + 1]
  49842. , d = i[l + 2];
  49843. y(s, h, u) && n.push(h, u),
  49844. y(s, u, d) && n.push(u, d),
  49845. y(s, d, h) && n.push(d, h)
  49846. }
  49847. else
  49848. for (l = 0,
  49849. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  49850. h = l + 0,
  49851. u = l + 1,
  49852. d = l + 2;
  49853. n.push(h, u, u, d, d, h)
  49854. }
  49855. var p = 65535 < a.count ? Uint32Array : Uint16Array
  49856. , f = new Ci.BufferAttribute(new p(n),1);
  49857. return v(f, g.ELEMENT_ARRAY_BUFFER),
  49858. t.wireframe = f
  49859. }
  49860. ,
  49861. this.update = function(e) {
  49862. var t = c.get(e);
  49863. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  49864. var i = t.index
  49865. , n = t.attributes;
  49866. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  49867. n)
  49868. v(n[r], g.ARRAY_BUFFER);
  49869. var o = t.morphAttributes;
  49870. for (var r in o)
  49871. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  49872. v(a[s], g.ARRAY_BUFFER);
  49873. return t
  49874. }
  49875. }
  49876. ,
  49877. Ci.WebGLProgram = (Qt = 0,
  49878. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  49879. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  49880. ei = /^([\w\d_]+)\[0\]$/,
  49881. function(e, t, i, n) {
  49882. var r = e.context
  49883. , o = i.extensions
  49884. , a = i.defines
  49885. , s = i.__webglShader.vertexShader
  49886. , l = i.__webglShader.fragmentShader
  49887. , c = "SHADOWMAP_TYPE_BASIC";
  49888. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  49889. var h = "ENVMAP_TYPE_CUBE"
  49890. , u = "ENVMAP_MODE_REFLECTION"
  49891. , d = "ENVMAP_BLENDING_MULTIPLY";
  49892. if (n.envMap) {
  49893. switch (i.envMap.mapping) {
  49894. case Ci.CubeReflectionMapping:
  49895. case Ci.CubeRefractionMapping:
  49896. h = "ENVMAP_TYPE_CUBE";
  49897. break;
  49898. case Ci.CubeUVReflectionMapping:
  49899. case Ci.CubeUVRefractionMapping:
  49900. h = "ENVMAP_TYPE_CUBE_UV";
  49901. break;
  49902. case Ci.EquirectangularReflectionMapping:
  49903. case Ci.EquirectangularRefractionMapping:
  49904. h = "ENVMAP_TYPE_EQUIREC";
  49905. break;
  49906. case Ci.SphericalReflectionMapping:
  49907. h = "ENVMAP_TYPE_SPHERE"
  49908. }
  49909. switch (i.envMap.mapping) {
  49910. case Ci.CubeRefractionMapping:
  49911. case Ci.EquirectangularRefractionMapping:
  49912. u = "ENVMAP_MODE_REFRACTION"
  49913. }
  49914. switch (i.combine) {
  49915. case Ci.MultiplyOperation:
  49916. d = "ENVMAP_BLENDING_MULTIPLY";
  49917. break;
  49918. case Ci.MixOperation:
  49919. d = "ENVMAP_BLENDING_MIX";
  49920. break;
  49921. case Ci.AddOperation:
  49922. d = "ENVMAP_BLENDING_ADD"
  49923. }
  49924. }
  49925. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  49926. 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")
  49927. }(o, n, e.extensions), v = function(e) {
  49928. var t = [];
  49929. for (var i in e) {
  49930. var n = e[i];
  49931. !1 !== n && t.push("#define " + i + " " + n)
  49932. }
  49933. return t.join("\n")
  49934. }(a), y = r.createProgram();
  49935. 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"),
  49936. [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) {
  49937. var i;
  49938. switch (t) {
  49939. case Ci.LinearToneMapping:
  49940. i = "Linear";
  49941. break;
  49942. case Ci.ReinhardToneMapping:
  49943. i = "Reinhard";
  49944. break;
  49945. case Ci.Uncharted2ToneMapping:
  49946. i = "Uncharted2";
  49947. break;
  49948. case Ci.CineonToneMapping:
  49949. i = "OptimizedCineon";
  49950. break;
  49951. default:
  49952. throw new Error("unsupported toneMapping: " + t)
  49953. }
  49954. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  49955. }("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) {
  49956. var i = Mi(t);
  49957. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  49958. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  49959. s = Oi(s = Li(s), n),
  49960. l = Oi(l = Li(l), n),
  49961. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  49962. l = Di(l));
  49963. var A = p + s
  49964. , C = f + l
  49965. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  49966. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  49967. r.attachShader(y, I),
  49968. r.attachShader(y, E),
  49969. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  49970. r.linkProgram(y);
  49971. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  49972. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  49973. 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),
  49974. M && (this.diagnostics = {
  49975. runnable: S,
  49976. material: i,
  49977. programLog: w,
  49978. vertexShader: {
  49979. log: T,
  49980. prefix: p
  49981. },
  49982. fragmentShader: {
  49983. log: x,
  49984. prefix: f
  49985. }
  49986. }),
  49987. r.deleteShader(I),
  49988. r.deleteShader(E),
  49989. this.getUniforms = function() {
  49990. return void 0 === _ && (_ = function(e, t) {
  49991. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  49992. var o = e.getActiveUniform(t, r).name
  49993. , a = e.getUniformLocation(t, o)
  49994. , s = Jt.exec(o);
  49995. if (s) {
  49996. var l = s[1]
  49997. , c = s[2]
  49998. , h = i[l];
  49999. (h = h || (i[l] = {}))[c] = a
  50000. } else if (s = $t.exec(o)) {
  50001. var u = s[1]
  50002. , d = s[2]
  50003. , p = s[3]
  50004. , f = i[u]
  50005. , g = (f = f || (i[u] = []))[d];
  50006. (g = g || (f[d] = {}))[p] = a
  50007. } else
  50008. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50009. }
  50010. return i
  50011. }(r, y)),
  50012. _
  50013. }
  50014. ,
  50015. this.getAttributes = function() {
  50016. return void 0 === b && (b = function(e, t) {
  50017. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50018. var o = e.getActiveAttrib(t, r).name;
  50019. i[o] = e.getAttribLocation(t, o)
  50020. }
  50021. return i
  50022. }(r, y)),
  50023. b
  50024. }
  50025. ,
  50026. this.destroy = function() {
  50027. r.deleteProgram(y),
  50028. this.program = void 0
  50029. }
  50030. ,
  50031. Object.defineProperties(this, {
  50032. uniforms: {
  50033. get: function() {
  50034. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50035. this.getUniforms()
  50036. }
  50037. },
  50038. attributes: {
  50039. get: function() {
  50040. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50041. this.getAttributes()
  50042. }
  50043. }
  50044. }),
  50045. this.id = Qt++,
  50046. this.code = t,
  50047. this.usedTimes = 1,
  50048. this.program = y,
  50049. this.vertexShader = I,
  50050. this.fragmentShader = E,
  50051. this
  50052. }
  50053. ),
  50054. Ci.WebGLPrograms = function(s, l) {
  50055. function c(e, t) {
  50056. var i;
  50057. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50058. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50059. i
  50060. }
  50061. var h = []
  50062. , u = {
  50063. MeshDepthMaterial: "depth",
  50064. MeshNormalMaterial: "normal",
  50065. MeshBasicMaterial: "basic",
  50066. MeshLambertMaterial: "lambert",
  50067. MeshPhongMaterial: "phong",
  50068. MeshStandardMaterial: "standard",
  50069. LineBasicMaterial: "basic",
  50070. LineDashedMaterial: "dashed",
  50071. PointsMaterial: "points"
  50072. }
  50073. , 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"];
  50074. this.getParameters = function(e, t, i, n) {
  50075. var r = u[e.type]
  50076. , o = function(e) {
  50077. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50078. return 1024;
  50079. var t = l.maxVertexUniforms
  50080. , i = Math.floor((t - 20) / 4);
  50081. 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)")),
  50082. i
  50083. }(n)
  50084. , a = s.getPrecision();
  50085. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50086. {
  50087. shaderID: r,
  50088. precision: a,
  50089. supportsVertexTextures: l.vertexTextures,
  50090. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50091. map: !!e.map,
  50092. mapEncoding: c(e.map, s.gammaInput),
  50093. envMap: !!e.envMap,
  50094. envMapMode: e.envMap && e.envMap.mapping,
  50095. envMapEncoding: c(e.envMap, s.gammaInput),
  50096. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50097. lightMap: !!e.lightMap,
  50098. aoMap: !!e.aoMap,
  50099. emissiveMap: !!e.emissiveMap,
  50100. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50101. bumpMap: !!e.bumpMap,
  50102. normalMap: !!e.normalMap,
  50103. displacementMap: !!e.displacementMap,
  50104. roughnessMap: !!e.roughnessMap,
  50105. metalnessMap: !!e.metalnessMap,
  50106. specularMap: !!e.specularMap,
  50107. alphaMap: !!e.alphaMap,
  50108. combine: e.combine,
  50109. vertexColors: e.vertexColors,
  50110. fog: i,
  50111. useFog: e.fog,
  50112. fogExp: i instanceof Ci.FogExp2,
  50113. flatShading: e.shading === Ci.FlatShading,
  50114. sizeAttenuation: e.sizeAttenuation,
  50115. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50116. skinning: e.skinning,
  50117. maxBones: o,
  50118. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50119. morphTargets: e.morphTargets,
  50120. morphNormals: e.morphNormals,
  50121. maxMorphTargets: s.maxMorphTargets,
  50122. maxMorphNormals: s.maxMorphNormals,
  50123. numDirLights: t.directional.length,
  50124. numPointLights: t.point.length,
  50125. numSpotLights: t.spot.length,
  50126. numHemiLights: t.hemi.length,
  50127. pointLightShadows: t.shadowsPointLight,
  50128. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50129. shadowMapType: s.shadowMap.type,
  50130. toneMapping: s.toneMapping,
  50131. physicallyCorrectLights: s.physicallyCorrectLights,
  50132. premultipliedAlpha: e.premultipliedAlpha,
  50133. alphaTest: e.alphaTest,
  50134. doubleSided: e.side === Ci.DoubleSide,
  50135. flipSided: e.side === Ci.BackSide
  50136. }
  50137. }
  50138. ,
  50139. this.getProgramCode = function(e, t) {
  50140. var i = [];
  50141. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50142. i.push(e.vertexShader)),
  50143. void 0 !== e.defines)
  50144. for (var n in e.defines)
  50145. i.push(n),
  50146. i.push(e.defines[n]);
  50147. for (var r = 0; r < a.length; r++) {
  50148. var o = a[r];
  50149. i.push(o),
  50150. i.push(t[o])
  50151. }
  50152. return i.join()
  50153. }
  50154. ,
  50155. this.acquireProgram = function(e, t, i) {
  50156. for (var n, r = 0, o = h.length; r < o; r++) {
  50157. var a = h[r];
  50158. if (a.code === i) {
  50159. ++(n = a).usedTimes;
  50160. break
  50161. }
  50162. }
  50163. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50164. h.push(n)),
  50165. n
  50166. }
  50167. ,
  50168. this.releaseProgram = function(e) {
  50169. if (0 == --e.usedTimes) {
  50170. var t = h.indexOf(e);
  50171. h[t] = h[h.length - 1],
  50172. h.pop(),
  50173. e.destroy()
  50174. }
  50175. }
  50176. ,
  50177. this.programs = h
  50178. }
  50179. ,
  50180. Ci.WebGLProperties = function() {
  50181. var n = {};
  50182. this.get = function(e) {
  50183. var t = e.uuid
  50184. , i = n[t];
  50185. return void 0 === i && (i = {},
  50186. n[t] = i),
  50187. i
  50188. }
  50189. ,
  50190. this.delete = function(e) {
  50191. delete n[e.uuid]
  50192. }
  50193. ,
  50194. this.clear = function() {
  50195. n = {}
  50196. }
  50197. }
  50198. ,
  50199. Ci.WebGLShader = function(e, t, i) {
  50200. var n = e.createShader(t);
  50201. return e.shaderSource(n, i),
  50202. e.compileShader(n),
  50203. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50204. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50205. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50206. t[i] = i + 1 + ": " + t[i];
  50207. return t.join("\n")
  50208. }(i)),
  50209. n
  50210. }
  50211. ,
  50212. Ci.WebGLShadowMap = function(P, O, L) {
  50213. function D(e, t, i, n) {
  50214. var r = e.geometry
  50215. , o = null
  50216. , a = p
  50217. , s = e.customDepthMaterial;
  50218. if (i && (a = f,
  50219. s = e.customDistanceMaterial),
  50220. s)
  50221. o = s;
  50222. else {
  50223. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50224. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50225. , h = 0;
  50226. l && (h |= u),
  50227. c && (h |= d),
  50228. o = a[h]
  50229. }
  50230. return o.visible = t.visible,
  50231. o.wireframe = t.wireframe,
  50232. o.wireframeLinewidth = t.wireframeLinewidth,
  50233. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50234. o
  50235. }
  50236. function N(e, t, i) {
  50237. if (!1 !== e.visible) {
  50238. 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)))
  50239. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50240. G.push(e));
  50241. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50242. N(n[r], t, i)
  50243. }
  50244. }
  50245. 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) {
  50246. var a = 0 != (o & u)
  50247. , s = 0 != (o & d)
  50248. , l = new Ci.ShaderMaterial({
  50249. uniforms: i,
  50250. vertexShader: t.vertexShader,
  50251. fragmentShader: t.fragmentShader,
  50252. morphTargets: a,
  50253. skinning: s
  50254. });
  50255. p[o] = l;
  50256. var c = new Ci.ShaderMaterial({
  50257. defines: {
  50258. USE_SHADOWMAP: ""
  50259. },
  50260. uniforms: r,
  50261. vertexShader: n.vertexShader,
  50262. fragmentShader: n.fragmentShader,
  50263. morphTargets: a,
  50264. skinning: s
  50265. });
  50266. f[o] = c
  50267. }
  50268. var q = this;
  50269. this.enabled = !1,
  50270. this.autoUpdate = !0,
  50271. this.needsUpdate = !1,
  50272. this.type = Ci.PCFShadowMap,
  50273. this.cullFace = Ci.CullFaceFront,
  50274. this.render = function(e, t) {
  50275. var i, n, r = O.shadows;
  50276. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50277. B.clearColor(1, 1, 1, 1),
  50278. B.disable(F.BLEND),
  50279. B.enable(F.CULL_FACE),
  50280. F.frontFace(F.CCW),
  50281. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50282. B.setDepthTest(!0),
  50283. B.setScissorTest(!1);
  50284. for (var o = 0, a = r.length; o < a; o++) {
  50285. var s = r[o]
  50286. , l = s.shadow
  50287. , c = l.camera;
  50288. if (U.copy(l.mapSize),
  50289. s instanceof Ci.PointLight) {
  50290. i = 6,
  50291. n = !0;
  50292. var h = U.x
  50293. , u = U.y;
  50294. Y[0].set(2 * h, u, h, u),
  50295. Y[1].set(0, u, h, u),
  50296. Y[2].set(3 * h, u, h, u),
  50297. Y[3].set(h, u, h, u),
  50298. Y[4].set(3 * h, 0, h, u),
  50299. Y[5].set(h, 0, h, u),
  50300. U.x *= 4,
  50301. U.y *= 2
  50302. } else
  50303. n = !(i = 1);
  50304. if (null === l.map) {
  50305. var d = {
  50306. minFilter: Ci.NearestFilter,
  50307. magFilter: Ci.NearestFilter,
  50308. format: Ci.RGBAFormat
  50309. };
  50310. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50311. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50312. c.updateProjectionMatrix()
  50313. }
  50314. var p = l.map
  50315. , f = l.matrix;
  50316. z.setFromMatrixPosition(s.matrixWorld),
  50317. c.position.copy(z),
  50318. P.setRenderTarget(p),
  50319. P.clear();
  50320. for (var g = 0; g < i; g++) {
  50321. if (n) {
  50322. H.copy(c.position),
  50323. H.add(W[g]),
  50324. c.up.copy(j[g]),
  50325. c.lookAt(H);
  50326. var m = Y[g];
  50327. B.viewport(m)
  50328. } else
  50329. H.setFromMatrixPosition(s.target.matrixWorld),
  50330. c.lookAt(H);
  50331. c.updateMatrixWorld(),
  50332. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50333. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50334. f.multiply(c.projectionMatrix),
  50335. f.multiply(c.matrixWorldInverse),
  50336. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50337. V.setFromMatrix(k),
  50338. G.length = 0,
  50339. N(e, t, c);
  50340. for (var v = 0, y = G.length; v < y; v++) {
  50341. var A = G[v]
  50342. , C = L.update(A)
  50343. , I = A.material;
  50344. if (I instanceof Ci.MultiMaterial)
  50345. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50346. var T = E[b]
  50347. , x = _[T.materialIndex];
  50348. if (!0 === x.visible) {
  50349. var S = D(A, x, n, z);
  50350. P.renderBufferDirect(c, null, C, S, A, T)
  50351. }
  50352. }
  50353. else {
  50354. S = D(A, I, n, z);
  50355. P.renderBufferDirect(c, null, C, S, A, null)
  50356. }
  50357. }
  50358. }
  50359. }
  50360. var M = P.getClearColor()
  50361. , R = P.getClearAlpha();
  50362. P.setClearColor(M, R),
  50363. B.enable(F.BLEND),
  50364. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50365. q.needsUpdate = !1
  50366. }
  50367. }
  50368. }
  50369. ,
  50370. Ci.WebGLState = function(l, i, c) {
  50371. var n = this
  50372. , r = new Ci.Vector4
  50373. , o = new Uint8Array(16)
  50374. , a = new Uint8Array(16)
  50375. , s = new Uint8Array(16)
  50376. , t = {}
  50377. , h = null
  50378. , u = null
  50379. , d = null
  50380. , p = null
  50381. , f = null
  50382. , g = null
  50383. , m = null
  50384. , v = null
  50385. , y = !1
  50386. , A = null
  50387. , C = null
  50388. , I = null
  50389. , E = null
  50390. , _ = null
  50391. , b = null
  50392. , w = null
  50393. , T = null
  50394. , x = null
  50395. , S = null
  50396. , M = null
  50397. , R = null
  50398. , P = null
  50399. , O = null
  50400. , L = null
  50401. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50402. , N = void 0
  50403. , F = {}
  50404. , B = new Ci.Vector4
  50405. , V = null
  50406. , k = null
  50407. , U = new Ci.Vector4
  50408. , H = new Ci.Vector4
  50409. , z = l.createTexture();
  50410. l.bindTexture(l.TEXTURE_2D, z),
  50411. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50412. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50413. this.init = function() {
  50414. this.clearColor(0, 0, 0, 1),
  50415. this.clearDepth(1),
  50416. this.clearStencil(0),
  50417. this.enable(l.DEPTH_TEST),
  50418. l.depthFunc(l.LEQUAL),
  50419. l.frontFace(l.CCW),
  50420. l.cullFace(l.BACK),
  50421. this.enable(l.CULL_FACE),
  50422. this.enable(l.BLEND),
  50423. l.blendEquation(l.FUNC_ADD),
  50424. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50425. }
  50426. ,
  50427. this.initAttributes = function() {
  50428. for (var e = 0, t = o.length; e < t; e++)
  50429. o[e] = 0
  50430. }
  50431. ,
  50432. this.enableAttribute = function(e) {
  50433. o[e] = 1,
  50434. 0 === a[e] && (l.enableVertexAttribArray(e),
  50435. a[e] = 1),
  50436. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50437. s[e] = 0)
  50438. }
  50439. ,
  50440. this.enableAttributeAndDivisor = function(e, t, i) {
  50441. o[e] = 1,
  50442. 0 === a[e] && (l.enableVertexAttribArray(e),
  50443. a[e] = 1),
  50444. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50445. s[e] = t)
  50446. }
  50447. ,
  50448. this.disableUnusedAttributes = function() {
  50449. for (var e = 0, t = a.length; e < t; e++)
  50450. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50451. a[e] = 0)
  50452. }
  50453. ,
  50454. this.enable = function(e) {
  50455. !0 !== t[e] && (l.enable(e),
  50456. t[e] = !0)
  50457. }
  50458. ,
  50459. this.disable = function(e) {
  50460. !1 !== t[e] && (l.disable(e),
  50461. t[e] = !1)
  50462. }
  50463. ,
  50464. this.getCompressedTextureFormats = function() {
  50465. if (null === h && (h = [],
  50466. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50467. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50468. h.push(e[t]);
  50469. return h
  50470. }
  50471. ,
  50472. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50473. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50474. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50475. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50476. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50477. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50478. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50479. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50480. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50481. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50482. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50483. u = e,
  50484. y = s),
  50485. e === Ci.CustomBlending ? (r = r || t,
  50486. o = o || i,
  50487. a = a || n,
  50488. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50489. d = t,
  50490. g = r),
  50491. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50492. p = i,
  50493. f = n,
  50494. m = o,
  50495. v = a)) : v = m = g = f = p = d = null
  50496. }
  50497. ,
  50498. this.setDepthFunc = function(e) {
  50499. if (A !== e) {
  50500. if (e)
  50501. switch (e) {
  50502. case Ci.NeverDepth:
  50503. l.depthFunc(l.NEVER);
  50504. break;
  50505. case Ci.AlwaysDepth:
  50506. l.depthFunc(l.ALWAYS);
  50507. break;
  50508. case Ci.LessDepth:
  50509. l.depthFunc(l.LESS);
  50510. break;
  50511. case Ci.LessEqualDepth:
  50512. l.depthFunc(l.LEQUAL);
  50513. break;
  50514. case Ci.EqualDepth:
  50515. l.depthFunc(l.EQUAL);
  50516. break;
  50517. case Ci.GreaterEqualDepth:
  50518. l.depthFunc(l.GEQUAL);
  50519. break;
  50520. case Ci.GreaterDepth:
  50521. l.depthFunc(l.GREATER);
  50522. break;
  50523. case Ci.NotEqualDepth:
  50524. l.depthFunc(l.NOTEQUAL);
  50525. break;
  50526. default:
  50527. l.depthFunc(l.LEQUAL)
  50528. }
  50529. else
  50530. l.depthFunc(l.LEQUAL);
  50531. A = e
  50532. }
  50533. }
  50534. ,
  50535. this.setDepthTest = function(e) {
  50536. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50537. }
  50538. ,
  50539. this.setDepthWrite = function(e) {
  50540. C !== e && (l.depthMask(e),
  50541. C = e)
  50542. }
  50543. ,
  50544. this.setColorWrite = function(e) {
  50545. I !== e && (l.colorMask(e, e, e, e),
  50546. I = e)
  50547. }
  50548. ,
  50549. this.setStencilFunc = function(e, t, i) {
  50550. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50551. _ = e,
  50552. b = t,
  50553. w = i)
  50554. }
  50555. ,
  50556. this.setStencilOp = function(e, t, i) {
  50557. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50558. T = e,
  50559. x = t,
  50560. S = i)
  50561. }
  50562. ,
  50563. this.setStencilTest = function(e) {
  50564. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50565. }
  50566. ,
  50567. this.setStencilWrite = function(e) {
  50568. E !== e && (l.stencilMask(e),
  50569. E = e)
  50570. }
  50571. ,
  50572. this.setFlipSided = function(e) {
  50573. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50574. M = e)
  50575. }
  50576. ,
  50577. this.setLineWidth = function(e) {
  50578. e !== R && (l.lineWidth(e),
  50579. R = e)
  50580. }
  50581. ,
  50582. this.setPolygonOffset = function(e, t, i) {
  50583. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50584. !e || P === t && O === i || (l.polygonOffset(t, i),
  50585. P = t,
  50586. O = i)
  50587. }
  50588. ,
  50589. this.getScissorTest = function() {
  50590. return L
  50591. }
  50592. ,
  50593. this.setScissorTest = function(e) {
  50594. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50595. }
  50596. ,
  50597. this.activeTexture = function(e) {
  50598. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50599. N !== e && (l.activeTexture(e),
  50600. N = e)
  50601. }
  50602. ,
  50603. this.bindTexture = function(e, t) {
  50604. void 0 === N && n.activeTexture();
  50605. var i = F[N];
  50606. void 0 === i && (i = {
  50607. type: void 0,
  50608. texture: void 0
  50609. },
  50610. F[N] = i),
  50611. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50612. i.type = e,
  50613. i.texture = t)
  50614. }
  50615. ,
  50616. this.compressedTexImage2D = function() {
  50617. try {
  50618. l.compressedTexImage2D.apply(l, arguments)
  50619. } catch (e) {
  50620. console.error(e)
  50621. }
  50622. }
  50623. ,
  50624. this.texImage2D = function() {
  50625. try {
  50626. l.texImage2D.apply(l, arguments)
  50627. } catch (e) {
  50628. console.error(e)
  50629. }
  50630. }
  50631. ,
  50632. this.clearColor = function(e, t, i, n) {
  50633. r.set(e, t, i, n),
  50634. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50635. B.copy(r))
  50636. }
  50637. ,
  50638. this.clearDepth = function(e) {
  50639. V !== e && (l.clearDepth(e),
  50640. V = e)
  50641. }
  50642. ,
  50643. this.clearStencil = function(e) {
  50644. k !== e && (l.clearStencil(e),
  50645. k = e)
  50646. }
  50647. ,
  50648. this.scissor = function(e) {
  50649. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50650. U.copy(e))
  50651. }
  50652. ,
  50653. this.viewport = function(e) {
  50654. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50655. H.copy(e))
  50656. }
  50657. ,
  50658. this.reset = function() {
  50659. for (var e = 0; e < a.length; e++)
  50660. 1 === a[e] && (l.disableVertexAttribArray(e),
  50661. a[e] = 0);
  50662. t = {},
  50663. N = void 0,
  50664. F = {},
  50665. M = E = C = I = u = h = null
  50666. }
  50667. }
  50668. ,
  50669. Ci.LensFlarePlugin = function(v, y) {
  50670. function A() {
  50671. 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]);
  50672. C = S.createBuffer(),
  50673. I = S.createBuffer(),
  50674. S.bindBuffer(S.ARRAY_BUFFER, C),
  50675. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50676. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50677. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50678. T = S.createTexture(),
  50679. x = S.createTexture(),
  50680. M.bindTexture(S.TEXTURE_2D, T),
  50681. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50682. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50683. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50684. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50685. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50686. M.bindTexture(S.TEXTURE_2D, x),
  50687. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50688. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50689. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50690. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50691. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50692. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50693. 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"),
  50694. 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")
  50695. } : {
  50696. 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"),
  50697. 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")
  50698. },
  50699. E = function(e) {
  50700. var t = S.createProgram()
  50701. , i = S.createShader(S.FRAGMENT_SHADER)
  50702. , n = S.createShader(S.VERTEX_SHADER)
  50703. , r = "precision " + v.getPrecision() + " float;\n";
  50704. return S.shaderSource(i, r + e.fragmentShader),
  50705. S.shaderSource(n, r + e.vertexShader),
  50706. S.compileShader(i),
  50707. S.compileShader(n),
  50708. S.attachShader(t, i),
  50709. S.attachShader(t, n),
  50710. S.linkProgram(t),
  50711. t
  50712. }(e),
  50713. _ = {
  50714. vertex: S.getAttribLocation(E, "position"),
  50715. uv: S.getAttribLocation(E, "uv")
  50716. },
  50717. b = {
  50718. renderType: S.getUniformLocation(E, "renderType"),
  50719. map: S.getUniformLocation(E, "map"),
  50720. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50721. opacity: S.getUniformLocation(E, "opacity"),
  50722. color: S.getUniformLocation(E, "color"),
  50723. scale: S.getUniformLocation(E, "scale"),
  50724. rotation: S.getUniformLocation(E, "rotation"),
  50725. screenPosition: S.getUniformLocation(E, "screenPosition")
  50726. }
  50727. }
  50728. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50729. this.render = function(e, t, i) {
  50730. if (0 !== y.length) {
  50731. var n = new Ci.Vector3
  50732. , r = i.w / i.z
  50733. , o = .5 * i.z
  50734. , a = .5 * i.w
  50735. , s = 16 / i.w
  50736. , l = new Ci.Vector2(s * r,s)
  50737. , c = new Ci.Vector3(1,1,0)
  50738. , h = new Ci.Vector2(1,1);
  50739. void 0 === E && A(),
  50740. S.useProgram(E),
  50741. M.initAttributes(),
  50742. M.enableAttribute(_.vertex),
  50743. M.enableAttribute(_.uv),
  50744. M.disableUnusedAttributes(),
  50745. S.uniform1i(b.occlusionMap, 0),
  50746. S.uniform1i(b.map, 1),
  50747. S.bindBuffer(S.ARRAY_BUFFER, C),
  50748. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50749. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50750. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50751. M.disable(S.CULL_FACE),
  50752. M.setDepthWrite(!1);
  50753. for (var u = 0, d = y.length; u < d; u++) {
  50754. s = 16 / i.w,
  50755. l.set(s * r, s);
  50756. var p = y[u];
  50757. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50758. n.applyMatrix4(t.matrixWorldInverse),
  50759. n.applyProjection(t.projectionMatrix),
  50760. c.copy(n),
  50761. h.x = c.x * o + o,
  50762. h.y = c.y * a + a,
  50763. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50764. M.activeTexture(S.TEXTURE0),
  50765. M.bindTexture(S.TEXTURE_2D, null),
  50766. M.activeTexture(S.TEXTURE1),
  50767. M.bindTexture(S.TEXTURE_2D, T),
  50768. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50769. S.uniform1i(b.renderType, 0),
  50770. S.uniform2f(b.scale, l.x, l.y),
  50771. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50772. M.disable(S.BLEND),
  50773. M.enable(S.DEPTH_TEST),
  50774. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50775. M.activeTexture(S.TEXTURE0),
  50776. M.bindTexture(S.TEXTURE_2D, x),
  50777. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50778. S.uniform1i(b.renderType, 1),
  50779. M.disable(S.DEPTH_TEST),
  50780. M.activeTexture(S.TEXTURE1),
  50781. M.bindTexture(S.TEXTURE_2D, T),
  50782. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50783. p.positionScreen.copy(c),
  50784. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  50785. S.uniform1i(b.renderType, 2),
  50786. M.enable(S.BLEND);
  50787. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  50788. var m = p.lensFlares[f];
  50789. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  50790. c.y = m.y,
  50791. c.z = m.z,
  50792. s = m.size * m.scale / i.w,
  50793. l.x = s * r,
  50794. l.y = s,
  50795. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50796. S.uniform2f(b.scale, l.x, l.y),
  50797. S.uniform1f(b.rotation, m.rotation),
  50798. S.uniform1f(b.opacity, m.opacity),
  50799. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  50800. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  50801. v.setTexture(m.texture, 1),
  50802. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  50803. }
  50804. }
  50805. }
  50806. M.enable(S.CULL_FACE),
  50807. M.enable(S.DEPTH_TEST),
  50808. M.setDepthWrite(!0),
  50809. v.resetGLState()
  50810. }
  50811. }
  50812. }
  50813. ,
  50814. Ci.SpritePlugin = function(u, d) {
  50815. function p() {
  50816. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  50817. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50818. g = I.createBuffer(),
  50819. m = I.createBuffer(),
  50820. I.bindBuffer(I.ARRAY_BUFFER, g),
  50821. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  50822. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50823. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  50824. v = function() {
  50825. var e = I.createProgram()
  50826. , t = I.createShader(I.VERTEX_SHADER)
  50827. , i = I.createShader(I.FRAGMENT_SHADER);
  50828. 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")),
  50829. 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")),
  50830. I.compileShader(t),
  50831. I.compileShader(i),
  50832. I.attachShader(e, t),
  50833. I.attachShader(e, i),
  50834. I.linkProgram(e),
  50835. e
  50836. }(),
  50837. y = {
  50838. position: I.getAttribLocation(v, "position"),
  50839. uv: I.getAttribLocation(v, "uv")
  50840. },
  50841. A = {
  50842. uvOffset: I.getUniformLocation(v, "uvOffset"),
  50843. uvScale: I.getUniformLocation(v, "uvScale"),
  50844. rotation: I.getUniformLocation(v, "rotation"),
  50845. scale: I.getUniformLocation(v, "scale"),
  50846. color: I.getUniformLocation(v, "color"),
  50847. map: I.getUniformLocation(v, "map"),
  50848. opacity: I.getUniformLocation(v, "opacity"),
  50849. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  50850. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  50851. fogType: I.getUniformLocation(v, "fogType"),
  50852. fogDensity: I.getUniformLocation(v, "fogDensity"),
  50853. fogNear: I.getUniformLocation(v, "fogNear"),
  50854. fogFar: I.getUniformLocation(v, "fogFar"),
  50855. fogColor: I.getUniformLocation(v, "fogColor"),
  50856. alphaTest: I.getUniformLocation(v, "alphaTest")
  50857. };
  50858. var i = document.createElement("canvas");
  50859. i.width = 8,
  50860. i.height = 8;
  50861. var n = i.getContext("2d");
  50862. n.fillStyle = "white",
  50863. n.fillRect(0, 0, 8, 8),
  50864. (C = new Ci.Texture(i)).needsUpdate = !0
  50865. }
  50866. function f(e, t) {
  50867. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  50868. }
  50869. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  50870. this.render = function(e, t) {
  50871. if (0 !== d.length) {
  50872. void 0 === v && p(),
  50873. I.useProgram(v),
  50874. E.initAttributes(),
  50875. E.enableAttribute(y.position),
  50876. E.enableAttribute(y.uv),
  50877. E.disableUnusedAttributes(),
  50878. E.disable(I.CULL_FACE),
  50879. E.enable(I.BLEND),
  50880. I.bindBuffer(I.ARRAY_BUFFER, g),
  50881. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  50882. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  50883. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50884. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  50885. E.activeTexture(I.TEXTURE0),
  50886. I.uniform1i(A.map, 0);
  50887. var i = 0
  50888. , n = 0
  50889. , r = e.fog;
  50890. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  50891. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  50892. I.uniform1f(A.fogFar, r.far),
  50893. I.uniform1i(A.fogType, 1),
  50894. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  50895. I.uniform1i(A.fogType, 2),
  50896. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  50897. n = i = 0);
  50898. for (var o = 0, a = d.length; o < a; o++) {
  50899. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50900. l.z = -l.modelViewMatrix.elements[14]
  50901. }
  50902. d.sort(f);
  50903. var s = [];
  50904. for (o = 0,
  50905. a = d.length; o < a; o++) {
  50906. var l, c = (l = d[o]).material;
  50907. I.uniform1f(A.alphaTest, c.alphaTest),
  50908. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  50909. l.matrixWorld.decompose(_, b, w),
  50910. s[0] = w.x,
  50911. s[1] = w.y;
  50912. var h = 0;
  50913. e.fog && c.fog && (h = n),
  50914. i !== h && (I.uniform1i(A.fogType, h),
  50915. i = h),
  50916. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  50917. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  50918. I.uniform2f(A.uvScale, 1, 1)),
  50919. I.uniform1f(A.opacity, c.opacity),
  50920. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  50921. I.uniform1f(A.rotation, c.rotation),
  50922. I.uniform2fv(A.scale, s),
  50923. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  50924. E.setDepthTest(c.depthTest),
  50925. E.setDepthWrite(c.depthWrite),
  50926. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  50927. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  50928. }
  50929. E.enable(I.CULL_FACE),
  50930. u.resetGLState()
  50931. }
  50932. }
  50933. }
  50934. ,
  50935. Object.defineProperties(Ci.Box2.prototype, {
  50936. empty: {
  50937. value: function() {
  50938. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  50939. this.isEmpty()
  50940. }
  50941. },
  50942. isIntersectionBox: {
  50943. value: function(e) {
  50944. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50945. this.intersectsBox(e)
  50946. }
  50947. }
  50948. }),
  50949. Object.defineProperties(Ci.Box3.prototype, {
  50950. empty: {
  50951. value: function() {
  50952. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  50953. this.isEmpty()
  50954. }
  50955. },
  50956. isIntersectionBox: {
  50957. value: function(e) {
  50958. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50959. this.intersectsBox(e)
  50960. }
  50961. },
  50962. isIntersectionSphere: {
  50963. value: function(e) {
  50964. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50965. this.intersectsSphere(e)
  50966. }
  50967. }
  50968. }),
  50969. Object.defineProperties(Ci.Matrix3.prototype, {
  50970. multiplyVector3: {
  50971. value: function(e) {
  50972. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  50973. e.applyMatrix3(this)
  50974. }
  50975. },
  50976. multiplyVector3Array: {
  50977. value: function(e) {
  50978. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50979. this.applyToVector3Array(e)
  50980. }
  50981. }
  50982. }),
  50983. Object.defineProperties(Ci.Matrix4.prototype, {
  50984. extractPosition: {
  50985. value: function(e) {
  50986. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  50987. this.copyPosition(e)
  50988. }
  50989. },
  50990. setRotationFromQuaternion: {
  50991. value: function(e) {
  50992. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  50993. this.makeRotationFromQuaternion(e)
  50994. }
  50995. },
  50996. multiplyVector3: {
  50997. value: function(e) {
  50998. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  50999. e.applyProjection(this)
  51000. }
  51001. },
  51002. multiplyVector4: {
  51003. value: function(e) {
  51004. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51005. e.applyMatrix4(this)
  51006. }
  51007. },
  51008. multiplyVector3Array: {
  51009. value: function(e) {
  51010. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51011. this.applyToVector3Array(e)
  51012. }
  51013. },
  51014. rotateAxis: {
  51015. value: function(e) {
  51016. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51017. e.transformDirection(this)
  51018. }
  51019. },
  51020. crossVector: {
  51021. value: function(e) {
  51022. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51023. e.applyMatrix4(this)
  51024. }
  51025. },
  51026. translate: {
  51027. value: function(e) {
  51028. console.error("THREE.Matrix4: .translate() has been removed.")
  51029. }
  51030. },
  51031. rotateX: {
  51032. value: function(e) {
  51033. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51034. }
  51035. },
  51036. rotateY: {
  51037. value: function(e) {
  51038. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51039. }
  51040. },
  51041. rotateZ: {
  51042. value: function(e) {
  51043. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51044. }
  51045. },
  51046. rotateByAxis: {
  51047. value: function(e, t) {
  51048. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51049. }
  51050. }
  51051. }),
  51052. Object.defineProperties(Ci.Plane.prototype, {
  51053. isIntersectionLine: {
  51054. value: function(e) {
  51055. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51056. this.intersectsLine(e)
  51057. }
  51058. }
  51059. }),
  51060. Object.defineProperties(Ci.Quaternion.prototype, {
  51061. multiplyVector3: {
  51062. value: function(e) {
  51063. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51064. e.applyQuaternion(this)
  51065. }
  51066. }
  51067. }),
  51068. Object.defineProperties(Ci.Ray.prototype, {
  51069. isIntersectionBox: {
  51070. value: function(e) {
  51071. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51072. this.intersectsBox(e)
  51073. }
  51074. },
  51075. isIntersectionPlane: {
  51076. value: function(e) {
  51077. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51078. this.intersectsPlane(e)
  51079. }
  51080. },
  51081. isIntersectionSphere: {
  51082. value: function(e) {
  51083. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51084. this.intersectsSphere(e)
  51085. }
  51086. }
  51087. }),
  51088. Object.defineProperties(Ci.Vector3.prototype, {
  51089. setEulerFromRotationMatrix: {
  51090. value: function() {
  51091. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51092. }
  51093. },
  51094. setEulerFromQuaternion: {
  51095. value: function() {
  51096. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51097. }
  51098. },
  51099. getPositionFromMatrix: {
  51100. value: function(e) {
  51101. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51102. this.setFromMatrixPosition(e)
  51103. }
  51104. },
  51105. getScaleFromMatrix: {
  51106. value: function(e) {
  51107. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51108. this.setFromMatrixScale(e)
  51109. }
  51110. },
  51111. getColumnFromMatrix: {
  51112. value: function(e, t) {
  51113. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51114. this.setFromMatrixColumn(e, t)
  51115. }
  51116. }
  51117. }),
  51118. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51119. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51120. new Ci.Face3(e,t,i,r,o,a)
  51121. }
  51122. ,
  51123. Ci.Vertex = function(e, t, i) {
  51124. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51125. new Ci.Vector3(e,t,i)
  51126. }
  51127. ,
  51128. Object.defineProperties(Ci.Object3D.prototype, {
  51129. eulerOrder: {
  51130. get: function() {
  51131. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51132. this.rotation.order
  51133. },
  51134. set: function(e) {
  51135. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51136. this.rotation.order = e
  51137. }
  51138. },
  51139. getChildByName: {
  51140. value: function(e) {
  51141. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51142. this.getObjectByName(e)
  51143. }
  51144. },
  51145. renderDepth: {
  51146. set: function(e) {
  51147. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51148. }
  51149. },
  51150. translate: {
  51151. value: function(e, t) {
  51152. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51153. this.translateOnAxis(t, e)
  51154. }
  51155. },
  51156. useQuaternion: {
  51157. get: function() {
  51158. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51159. },
  51160. set: function(e) {
  51161. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51162. }
  51163. }
  51164. }),
  51165. Object.defineProperties(Ci, {
  51166. PointCloud: {
  51167. value: function(e, t) {
  51168. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51169. new Ci.Points(e,t)
  51170. }
  51171. },
  51172. ParticleSystem: {
  51173. value: function(e, t) {
  51174. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51175. new Ci.Points(e,t)
  51176. }
  51177. }
  51178. }),
  51179. Object.defineProperties(Ci.Light.prototype, {
  51180. onlyShadow: {
  51181. set: function(e) {
  51182. console.warn("THREE.Light: .onlyShadow has been removed.")
  51183. }
  51184. },
  51185. shadowCameraFov: {
  51186. set: function(e) {
  51187. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51188. this.shadow.camera.fov = e
  51189. }
  51190. },
  51191. shadowCameraLeft: {
  51192. set: function(e) {
  51193. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51194. this.shadow.camera.left = e
  51195. }
  51196. },
  51197. shadowCameraRight: {
  51198. set: function(e) {
  51199. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51200. this.shadow.camera.right = e
  51201. }
  51202. },
  51203. shadowCameraTop: {
  51204. set: function(e) {
  51205. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51206. this.shadow.camera.top = e
  51207. }
  51208. },
  51209. shadowCameraBottom: {
  51210. set: function(e) {
  51211. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51212. this.shadow.camera.bottom = e
  51213. }
  51214. },
  51215. shadowCameraNear: {
  51216. set: function(e) {
  51217. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51218. this.shadow.camera.near = e
  51219. }
  51220. },
  51221. shadowCameraFar: {
  51222. set: function(e) {
  51223. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51224. this.shadow.camera.far = e
  51225. }
  51226. },
  51227. shadowCameraVisible: {
  51228. set: function(e) {
  51229. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51230. }
  51231. },
  51232. shadowBias: {
  51233. set: function(e) {
  51234. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51235. this.shadow.bias = e
  51236. }
  51237. },
  51238. shadowDarkness: {
  51239. set: function(e) {
  51240. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51241. }
  51242. },
  51243. shadowMapWidth: {
  51244. set: function(e) {
  51245. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51246. this.shadow.mapSize.width = e
  51247. }
  51248. },
  51249. shadowMapHeight: {
  51250. set: function(e) {
  51251. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51252. this.shadow.mapSize.height = e
  51253. }
  51254. }
  51255. }),
  51256. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51257. length: {
  51258. get: function() {
  51259. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51260. this.array.length
  51261. }
  51262. }
  51263. }),
  51264. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51265. drawcalls: {
  51266. get: function() {
  51267. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51268. this.groups
  51269. }
  51270. },
  51271. offsets: {
  51272. get: function() {
  51273. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51274. this.groups
  51275. }
  51276. },
  51277. addIndex: {
  51278. value: function(e) {
  51279. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51280. this.setIndex(e)
  51281. }
  51282. },
  51283. addDrawCall: {
  51284. value: function(e, t, i) {
  51285. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51286. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51287. this.addGroup(e, t)
  51288. }
  51289. },
  51290. clearDrawCalls: {
  51291. value: function() {
  51292. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51293. this.clearGroups()
  51294. }
  51295. },
  51296. computeTangents: {
  51297. value: function() {
  51298. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51299. }
  51300. },
  51301. computeOffsets: {
  51302. value: function() {
  51303. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51304. }
  51305. }
  51306. }),
  51307. Object.defineProperties(Ci.Material.prototype, {
  51308. wrapAround: {
  51309. get: function() {
  51310. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51311. },
  51312. set: function(e) {
  51313. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51314. }
  51315. },
  51316. wrapRGB: {
  51317. get: function() {
  51318. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51319. new Ci.Color
  51320. }
  51321. }
  51322. }),
  51323. Object.defineProperties(Ci, {
  51324. PointCloudMaterial: {
  51325. value: function(e) {
  51326. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51327. new Ci.PointsMaterial(e)
  51328. }
  51329. },
  51330. ParticleBasicMaterial: {
  51331. value: function(e) {
  51332. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51333. new Ci.PointsMaterial(e)
  51334. }
  51335. },
  51336. ParticleSystemMaterial: {
  51337. value: function(e) {
  51338. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51339. new Ci.PointsMaterial(e)
  51340. }
  51341. }
  51342. }),
  51343. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51344. metal: {
  51345. get: function() {
  51346. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51347. !1
  51348. },
  51349. set: function(e) {
  51350. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51351. }
  51352. }
  51353. }),
  51354. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51355. derivatives: {
  51356. get: function() {
  51357. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51358. this.extensions.derivatives
  51359. },
  51360. set: function(e) {
  51361. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51362. this.extensions.derivatives = e
  51363. }
  51364. }
  51365. }),
  51366. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51367. supportsFloatTextures: {
  51368. value: function() {
  51369. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51370. this.extensions.get("OES_texture_float")
  51371. }
  51372. },
  51373. supportsHalfFloatTextures: {
  51374. value: function() {
  51375. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51376. this.extensions.get("OES_texture_half_float")
  51377. }
  51378. },
  51379. supportsStandardDerivatives: {
  51380. value: function() {
  51381. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51382. this.extensions.get("OES_standard_derivatives")
  51383. }
  51384. },
  51385. supportsCompressedTextureS3TC: {
  51386. value: function() {
  51387. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51388. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51389. }
  51390. },
  51391. supportsCompressedTexturePVRTC: {
  51392. value: function() {
  51393. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51394. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51395. }
  51396. },
  51397. supportsBlendMinMax: {
  51398. value: function() {
  51399. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51400. this.extensions.get("EXT_blend_minmax")
  51401. }
  51402. },
  51403. supportsVertexTextures: {
  51404. value: function() {
  51405. return this.capabilities.vertexTextures
  51406. }
  51407. },
  51408. supportsInstancedArrays: {
  51409. value: function() {
  51410. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51411. this.extensions.get("ANGLE_instanced_arrays")
  51412. }
  51413. },
  51414. enableScissorTest: {
  51415. value: function(e) {
  51416. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51417. this.setScissorTest(e)
  51418. }
  51419. },
  51420. initMaterial: {
  51421. value: function() {
  51422. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51423. }
  51424. },
  51425. addPrePlugin: {
  51426. value: function() {
  51427. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51428. }
  51429. },
  51430. addPostPlugin: {
  51431. value: function() {
  51432. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51433. }
  51434. },
  51435. updateShadowMap: {
  51436. value: function() {
  51437. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51438. }
  51439. },
  51440. shadowMapEnabled: {
  51441. get: function() {
  51442. return this.shadowMap.enabled
  51443. },
  51444. set: function(e) {
  51445. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51446. this.shadowMap.enabled = e
  51447. }
  51448. },
  51449. shadowMapType: {
  51450. get: function() {
  51451. return this.shadowMap.type
  51452. },
  51453. set: function(e) {
  51454. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51455. this.shadowMap.type = e
  51456. }
  51457. },
  51458. shadowMapCullFace: {
  51459. get: function() {
  51460. return this.shadowMap.cullFace
  51461. },
  51462. set: function(e) {
  51463. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51464. this.shadowMap.cullFace = e
  51465. }
  51466. }
  51467. }),
  51468. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51469. wrapS: {
  51470. get: function() {
  51471. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51472. this.texture.wrapS
  51473. },
  51474. set: function(e) {
  51475. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51476. this.texture.wrapS = e
  51477. }
  51478. },
  51479. wrapT: {
  51480. get: function() {
  51481. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51482. this.texture.wrapT
  51483. },
  51484. set: function(e) {
  51485. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51486. this.texture.wrapT = e
  51487. }
  51488. },
  51489. magFilter: {
  51490. get: function() {
  51491. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51492. this.texture.magFilter
  51493. },
  51494. set: function(e) {
  51495. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51496. this.texture.magFilter = e
  51497. }
  51498. },
  51499. minFilter: {
  51500. get: function() {
  51501. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51502. this.texture.minFilter
  51503. },
  51504. set: function(e) {
  51505. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51506. this.texture.minFilter = e
  51507. }
  51508. },
  51509. anisotropy: {
  51510. get: function() {
  51511. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51512. this.texture.anisotropy
  51513. },
  51514. set: function(e) {
  51515. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51516. this.texture.anisotropy = e
  51517. }
  51518. },
  51519. offset: {
  51520. get: function() {
  51521. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51522. this.texture.offset
  51523. },
  51524. set: function(e) {
  51525. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51526. this.texture.offset = e
  51527. }
  51528. },
  51529. repeat: {
  51530. get: function() {
  51531. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51532. this.texture.repeat
  51533. },
  51534. set: function(e) {
  51535. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51536. this.texture.repeat = e
  51537. }
  51538. },
  51539. format: {
  51540. get: function() {
  51541. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51542. this.texture.format
  51543. },
  51544. set: function(e) {
  51545. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51546. this.texture.format = e
  51547. }
  51548. },
  51549. type: {
  51550. get: function() {
  51551. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51552. this.texture.type
  51553. },
  51554. set: function(e) {
  51555. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51556. this.texture.type = e
  51557. }
  51558. },
  51559. generateMipmaps: {
  51560. get: function() {
  51561. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51562. this.texture.generateMipmaps
  51563. },
  51564. set: function(e) {
  51565. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51566. this.texture.generateMipmaps = e
  51567. }
  51568. }
  51569. }),
  51570. Ci.GeometryUtils = {
  51571. merge: function(e, t, i) {
  51572. var n;
  51573. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51574. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51575. n = t.matrix,
  51576. t = t.geometry),
  51577. e.merge(t, n, i)
  51578. },
  51579. center: function(e) {
  51580. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51581. e.center()
  51582. }
  51583. },
  51584. Ci.ImageUtils = {
  51585. crossOrigin: void 0,
  51586. loadTexture: function(e, t, i, n) {
  51587. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51588. var r = new Ci.TextureLoader;
  51589. r.setCrossOrigin(this.crossOrigin);
  51590. var o = r.load(e, i, void 0, n);
  51591. return t && (o.mapping = t),
  51592. o
  51593. },
  51594. loadTextureCube: function(e, t, i, n) {
  51595. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51596. var r = new Ci.CubeTextureLoader;
  51597. r.setCrossOrigin(this.crossOrigin);
  51598. var o = r.load(e, i, void 0, n);
  51599. return t && (o.mapping = t),
  51600. o
  51601. },
  51602. loadCompressedTexture: function() {
  51603. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51604. },
  51605. loadCompressedTextureCube: function() {
  51606. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51607. }
  51608. },
  51609. Ci.Projector = function() {
  51610. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51611. this.projectVector = function(e, t) {
  51612. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51613. e.project(t)
  51614. }
  51615. ,
  51616. this.unprojectVector = function(e, t) {
  51617. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51618. e.unproject(t)
  51619. }
  51620. ,
  51621. this.pickingRay = function(e, t) {
  51622. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51623. }
  51624. }
  51625. ,
  51626. Ci.CanvasRenderer = function() {
  51627. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51628. this.domElement = document.createElement("canvas"),
  51629. this.clear = function() {}
  51630. ,
  51631. this.render = function() {}
  51632. ,
  51633. this.setClearColor = function() {}
  51634. ,
  51635. this.setSize = function() {}
  51636. }
  51637. ,
  51638. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51639. Ci.CurveUtils = {
  51640. tangentQuadraticBezier: function(e, t, i, n) {
  51641. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51642. },
  51643. tangentCubicBezier: function(e, t, i, n, r) {
  51644. 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
  51645. },
  51646. tangentSpline: function(e, t, i, n, r) {
  51647. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51648. },
  51649. interpolate: function(e, t, i, n, r) {
  51650. var o = .5 * (i - e)
  51651. , a = .5 * (n - t)
  51652. , s = r * r;
  51653. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51654. }
  51655. },
  51656. Ci.SceneUtils = {
  51657. createMultiMaterialObject: function(e, t) {
  51658. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51659. i.add(new Ci.Mesh(e,t[n]));
  51660. return i
  51661. },
  51662. detach: function(e, t, i) {
  51663. e.applyMatrix(t.matrixWorld),
  51664. t.remove(e),
  51665. i.add(e)
  51666. },
  51667. attach: function(e, t, i) {
  51668. var n = new Ci.Matrix4;
  51669. n.getInverse(i.matrixWorld),
  51670. e.applyMatrix(n),
  51671. t.remove(e),
  51672. i.add(e)
  51673. }
  51674. },
  51675. Ci.ShapeUtils = {
  51676. area: function(e) {
  51677. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51678. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51679. return .5 * i
  51680. },
  51681. triangulate: function(e, t) {
  51682. var i = e.length;
  51683. if (i < 3)
  51684. return null;
  51685. var n, r, o, a = [], s = [], l = [];
  51686. if (0 < Ci.ShapeUtils.area(e))
  51687. for (r = 0; r < i; r++)
  51688. s[r] = r;
  51689. else
  51690. for (r = 0; r < i; r++)
  51691. s[r] = i - 1 - r;
  51692. var c = i
  51693. , h = 2 * c;
  51694. for (r = c - 1; 2 < c; ) {
  51695. if (h-- <= 0)
  51696. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51697. t ? l : a;
  51698. if (c <= (n = r) && (n = 0),
  51699. c <= (r = n + 1) && (r = 0),
  51700. c <= (o = r + 1) && (o = 0),
  51701. Si(e, n, r, o, c, s)) {
  51702. var u, d, p, f, g;
  51703. for (u = s[n],
  51704. d = s[r],
  51705. p = s[o],
  51706. a.push([e[u], e[d], e[p]]),
  51707. l.push([s[n], s[r], s[o]]),
  51708. g = (f = r) + 1; g < c; f++,
  51709. g++)
  51710. s[f] = s[g];
  51711. h = 2 * --c
  51712. }
  51713. }
  51714. return t ? l : a
  51715. },
  51716. triangulateShape: function(e, t) {
  51717. function w(e, t, i) {
  51718. 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
  51719. }
  51720. function b(e, t, i, n, r) {
  51721. var o = t.x - e.x
  51722. , a = t.y - e.y
  51723. , s = n.x - i.x
  51724. , l = n.y - i.y
  51725. , c = e.x - i.x
  51726. , h = e.y - i.y
  51727. , u = a * s - o * l
  51728. , d = a * c - o * h;
  51729. if (Math.abs(u) > Number.EPSILON) {
  51730. var p;
  51731. if (0 < u) {
  51732. if (d < 0 || u < d)
  51733. return [];
  51734. if ((p = l * c - s * h) < 0 || u < p)
  51735. return []
  51736. } else {
  51737. if (0 < d || d < u)
  51738. return [];
  51739. if (0 < (p = l * c - s * h) || p < u)
  51740. return []
  51741. }
  51742. if (0 === p)
  51743. return !r || 0 != d && d != u ? [e] : [];
  51744. if (p === u)
  51745. return !r || 0 != d && d != u ? [t] : [];
  51746. if (0 == d)
  51747. return [i];
  51748. if (d == u)
  51749. return [n];
  51750. var f = p / u;
  51751. return [{
  51752. x: e.x + f * o,
  51753. y: e.y + f * a
  51754. }]
  51755. }
  51756. if (0 != d || l * c != s * h)
  51757. return [];
  51758. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51759. 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,
  51760. (m = t).x) : (v = (g = t).x,
  51761. (m = e).x),
  51762. i.x < n.x ? (I = (A = i).x,
  51763. (C = n).x) : (I = (A = n).x,
  51764. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51765. (m = t).y) : (v = (g = t).y,
  51766. (m = e).y),
  51767. i.y < n.y ? (I = (A = i).y,
  51768. (C = n).y) : (I = (A = n).y,
  51769. (C = i).y)),
  51770. 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])
  51771. }
  51772. function T(e, t, i, n) {
  51773. var r = t.x - e.x
  51774. , o = t.y - e.y
  51775. , a = i.x - e.x
  51776. , s = i.y - e.y
  51777. , l = n.x - e.x
  51778. , c = n.y - e.y
  51779. , h = r * s - o * a
  51780. , u = r * c - o * l;
  51781. if (Math.abs(h) > Number.EPSILON) {
  51782. var d = l * s - c * a;
  51783. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  51784. }
  51785. return 0 < u
  51786. }
  51787. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  51788. Array.prototype.push.apply(c, t[h]);
  51789. for (i = 0,
  51790. n = c.length; i < n; i++)
  51791. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  51792. l[a] = i;
  51793. var d = function(e, a) {
  51794. function t(e, t) {
  51795. var i = m.length - 1
  51796. , n = e - 1;
  51797. n < 0 && (n = i);
  51798. var r = e + 1;
  51799. i < r && (r = 0);
  51800. var o = T(m[e], m[n], m[r], c[t]);
  51801. if (!o)
  51802. return !1;
  51803. var a = c.length - 1
  51804. , s = t - 1;
  51805. s < 0 && (s = a);
  51806. var l = t + 1;
  51807. return a < l && (l = 0),
  51808. !!(o = T(c[t], c[s], c[l], m[e]))
  51809. }
  51810. function i(e, t) {
  51811. var i, n;
  51812. for (i = 0; i < m.length; i++)
  51813. if (n = i + 1,
  51814. n %= m.length,
  51815. 0 < b(e, t, m[i], m[n], !0).length)
  51816. return !0;
  51817. return !1
  51818. }
  51819. function n(e, t) {
  51820. var i, n, r, o;
  51821. for (i = 0; i < v.length; i++)
  51822. for (n = a[v[i]],
  51823. r = 0; r < n.length; r++)
  51824. if (o = r + 1,
  51825. o %= n.length,
  51826. 0 < b(e, t, n[r], n[o], !0).length)
  51827. return !0;
  51828. return !1
  51829. }
  51830. 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++)
  51831. v.push(A);
  51832. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  51833. if (--E < 0) {
  51834. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  51835. break
  51836. }
  51837. for (o = I; o < m.length; o++) {
  51838. s = m[o],
  51839. r = -1;
  51840. for (A = 0; A < v.length; A++)
  51841. if (h = v[A],
  51842. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  51843. c = a[h];
  51844. for (var _ = 0; _ < c.length; _++)
  51845. if (l = c[_],
  51846. t(o, _) && !i(s, l) && !n(s, l)) {
  51847. r = _,
  51848. v.splice(A, 1),
  51849. d = m.slice(0, o + 1),
  51850. p = m.slice(o),
  51851. f = c.slice(r),
  51852. g = c.slice(0, r + 1),
  51853. m = d.concat(f).concat(g).concat(p),
  51854. I = o;
  51855. break
  51856. }
  51857. if (0 <= r)
  51858. break;
  51859. y[u] = !0
  51860. }
  51861. if (0 <= r)
  51862. break
  51863. }
  51864. }
  51865. return m
  51866. }(e, t)
  51867. , p = Ci.ShapeUtils.triangulate(d, !1);
  51868. for (i = 0,
  51869. n = p.length; i < n; i++)
  51870. for (o = p[i],
  51871. r = 0; r < 3; r++)
  51872. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  51873. return p.concat()
  51874. },
  51875. isClockWise: function(e) {
  51876. return Ci.ShapeUtils.area(e) < 0
  51877. },
  51878. b2: function(e, t, i, n) {
  51879. return function(e, t) {
  51880. var i = 1 - e;
  51881. return i * i * t
  51882. }(e, t) + function(e, t) {
  51883. return 2 * (1 - e) * e * t
  51884. }(e, i) + function(e, t) {
  51885. return e * e * t
  51886. }(e, n)
  51887. },
  51888. b3: function(e, t, i, n, r) {
  51889. return function(e, t) {
  51890. var i = 1 - e;
  51891. return i * i * i * t
  51892. }(e, t) + function(e, t) {
  51893. var i = 1 - e;
  51894. return 3 * i * i * e * t
  51895. }(e, i) + function(e, t) {
  51896. return 3 * (1 - e) * e * e * t
  51897. }(e, n) + function(e, t) {
  51898. return e * e * e * t
  51899. }(e, r)
  51900. }
  51901. },
  51902. Ci.Curve = function() {}
  51903. ,
  51904. Ci.Curve.prototype = {
  51905. constructor: Ci.Curve,
  51906. getPoint: function(e) {
  51907. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  51908. null
  51909. },
  51910. getPointAt: function(e) {
  51911. var t = this.getUtoTmapping(e);
  51912. return this.getPoint(t)
  51913. },
  51914. getPoints: function(e) {
  51915. e = e || 5;
  51916. var t, i = [];
  51917. for (t = 0; t <= e; t++)
  51918. i.push(this.getPoint(t / e));
  51919. return i
  51920. },
  51921. getSpacedPoints: function(e) {
  51922. e = e || 5;
  51923. var t, i = [];
  51924. for (t = 0; t <= e; t++)
  51925. i.push(this.getPointAt(t / e));
  51926. return i
  51927. },
  51928. getLength: function() {
  51929. var e = this.getLengths();
  51930. return e[e.length - 1]
  51931. },
  51932. getLengths: function(e) {
  51933. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  51934. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  51935. return this.cacheArcLengths;
  51936. this.needsUpdate = !1;
  51937. var t, i, n = [], r = this.getPoint(0), o = 0;
  51938. for (n.push(0),
  51939. i = 1; i <= e; i++)
  51940. o += (t = this.getPoint(i / e)).distanceTo(r),
  51941. n.push(o),
  51942. r = t;
  51943. return this.cacheArcLengths = n
  51944. },
  51945. updateArcLengths: function() {
  51946. this.needsUpdate = !0,
  51947. this.getLengths()
  51948. },
  51949. getUtoTmapping: function(e, t) {
  51950. var i, n = this.getLengths(), r = 0, o = n.length;
  51951. i = t || e * n[o - 1];
  51952. for (var a, s = 0, l = o - 1; s <= l; )
  51953. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  51954. s = r + 1;
  51955. else {
  51956. if (!(0 < a)) {
  51957. l = r;
  51958. break
  51959. }
  51960. l = r - 1
  51961. }
  51962. if (n[r = l] === i)
  51963. return r / (o - 1);
  51964. var c = n[r];
  51965. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  51966. },
  51967. getTangent: function(e) {
  51968. var t = e - 1e-4
  51969. , i = e + 1e-4;
  51970. t < 0 && (t = 0),
  51971. 1 < i && (i = 1);
  51972. var n = this.getPoint(t);
  51973. return this.getPoint(i).clone().sub(n).normalize()
  51974. },
  51975. getTangentAt: function(e) {
  51976. var t = this.getUtoTmapping(e);
  51977. return this.getTangent(t)
  51978. }
  51979. },
  51980. Ci.Curve.create = function(e, t) {
  51981. return e.prototype = Object.create(Ci.Curve.prototype),
  51982. (e.prototype.constructor = e).prototype.getPoint = t,
  51983. e
  51984. }
  51985. ,
  51986. Ci.CurvePath = function() {
  51987. this.curves = [],
  51988. this.autoClose = !1
  51989. }
  51990. ,
  51991. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  51992. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  51993. Ci.CurvePath.prototype.add = function(e) {
  51994. this.curves.push(e)
  51995. }
  51996. ,
  51997. Ci.CurvePath.prototype.closePath = function() {
  51998. var e = this.curves[0].getPoint(0)
  51999. , t = this.curves[this.curves.length - 1].getPoint(1);
  52000. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52001. }
  52002. ,
  52003. Ci.CurvePath.prototype.getPoint = function(e) {
  52004. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52005. if (i[n] >= t) {
  52006. var r = i[n] - t
  52007. , o = this.curves[n]
  52008. , a = 1 - r / o.getLength();
  52009. return o.getPointAt(a)
  52010. }
  52011. n++
  52012. }
  52013. return null
  52014. }
  52015. ,
  52016. Ci.CurvePath.prototype.getLength = function() {
  52017. var e = this.getCurveLengths();
  52018. return e[e.length - 1]
  52019. }
  52020. ,
  52021. Ci.CurvePath.prototype.getCurveLengths = function() {
  52022. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52023. return this.cacheLengths;
  52024. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52025. t += this.curves[i].getLength(),
  52026. e.push(t);
  52027. return this.cacheLengths = e
  52028. }
  52029. ,
  52030. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52031. var t = this.getPoints(e);
  52032. return this.createGeometry(t)
  52033. }
  52034. ,
  52035. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52036. var t = this.getSpacedPoints(e);
  52037. return this.createGeometry(t)
  52038. }
  52039. ,
  52040. Ci.CurvePath.prototype.createGeometry = function(e) {
  52041. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52042. var r = e[i];
  52043. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52044. }
  52045. return t
  52046. }
  52047. ,
  52048. Ci.Font = function(e) {
  52049. this.data = e
  52050. }
  52051. ,
  52052. Ci.Font.prototype = {
  52053. constructor: Ci.Font,
  52054. generateShapes: function(e, s, b) {
  52055. function l(e, t, i) {
  52056. var n = w.glyphs[e] || w.glyphs["?"];
  52057. if (n) {
  52058. 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;
  52059. if (n.o)
  52060. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52061. switch (A[C++]) {
  52062. case "m":
  52063. r = A[C++] * t + i,
  52064. o = A[C++] * t,
  52065. g.moveTo(r, o);
  52066. break;
  52067. case "l":
  52068. r = A[C++] * t + i,
  52069. o = A[C++] * t,
  52070. g.lineTo(r, o);
  52071. break;
  52072. case "q":
  52073. if (a = A[C++] * t + i,
  52074. s = A[C++] * t,
  52075. h = A[C++] * t + i,
  52076. u = A[C++] * t,
  52077. g.quadraticCurveTo(h, u, a, s),
  52078. f = m[m.length - 1]) {
  52079. l = f.x,
  52080. c = f.y;
  52081. for (var E = 1; E <= b; E++) {
  52082. v(_ = E / b, l, h, a),
  52083. v(_, c, u, s)
  52084. }
  52085. }
  52086. break;
  52087. case "b":
  52088. if (a = A[C++] * t + i,
  52089. s = A[C++] * t,
  52090. h = A[C++] * t + i,
  52091. u = A[C++] * t,
  52092. d = A[C++] * t + i,
  52093. p = A[C++] * t,
  52094. g.bezierCurveTo(h, u, d, p, a, s),
  52095. f = m[m.length - 1]) {
  52096. l = f.x,
  52097. c = f.y;
  52098. for (E = 1; E <= b; E++) {
  52099. var _;
  52100. y(_ = E / b, l, h, d, a),
  52101. y(_, c, u, p, s)
  52102. }
  52103. }
  52104. }
  52105. }
  52106. return {
  52107. offset: n.ha * t,
  52108. path: g
  52109. }
  52110. }
  52111. }
  52112. void 0 === s && (s = 100),
  52113. void 0 === b && (b = 4);
  52114. for (var w = this.data, t = function(e) {
  52115. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52116. var a = l(t[o], i, n);
  52117. n += a.offset,
  52118. r.push(a.path)
  52119. }
  52120. return r
  52121. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52122. Array.prototype.push.apply(i, t[n].toShapes());
  52123. return i
  52124. }
  52125. },
  52126. Ci.Path = function(e) {
  52127. Ci.CurvePath.call(this),
  52128. this.actions = [],
  52129. e && this.fromPoints(e)
  52130. }
  52131. ,
  52132. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52133. Ci.Path.prototype.constructor = Ci.Path,
  52134. Ci.Path.prototype.fromPoints = function(e) {
  52135. this.moveTo(e[0].x, e[0].y);
  52136. for (var t = 1, i = e.length; t < i; t++)
  52137. this.lineTo(e[t].x, e[t].y)
  52138. }
  52139. ,
  52140. Ci.Path.prototype.moveTo = function(e, t) {
  52141. this.actions.push({
  52142. action: "moveTo",
  52143. args: [e, t]
  52144. })
  52145. }
  52146. ,
  52147. Ci.Path.prototype.lineTo = function(e, t) {
  52148. var i = this.actions[this.actions.length - 1].args
  52149. , n = i[i.length - 2]
  52150. , r = i[i.length - 1]
  52151. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52152. this.curves.push(o),
  52153. this.actions.push({
  52154. action: "lineTo",
  52155. args: [e, t]
  52156. })
  52157. }
  52158. ,
  52159. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52160. var r = this.actions[this.actions.length - 1].args
  52161. , o = r[r.length - 2]
  52162. , a = r[r.length - 1]
  52163. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52164. this.curves.push(s),
  52165. this.actions.push({
  52166. action: "quadraticCurveTo",
  52167. args: [e, t, i, n]
  52168. })
  52169. }
  52170. ,
  52171. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52172. var a = this.actions[this.actions.length - 1].args
  52173. , s = a[a.length - 2]
  52174. , l = a[a.length - 1]
  52175. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52176. this.curves.push(c),
  52177. this.actions.push({
  52178. action: "bezierCurveTo",
  52179. args: [e, t, i, n, r, o]
  52180. })
  52181. }
  52182. ,
  52183. Ci.Path.prototype.splineThru = function(e) {
  52184. var t = Array.prototype.slice.call(arguments)
  52185. , i = this.actions[this.actions.length - 1].args
  52186. , n = i[i.length - 2]
  52187. , r = i[i.length - 1]
  52188. , o = [new Ci.Vector2(n,r)];
  52189. Array.prototype.push.apply(o, e);
  52190. var a = new Ci.SplineCurve(o);
  52191. this.curves.push(a),
  52192. this.actions.push({
  52193. action: "splineThru",
  52194. args: t
  52195. })
  52196. }
  52197. ,
  52198. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52199. var a = this.actions[this.actions.length - 1].args
  52200. , s = a[a.length - 2]
  52201. , l = a[a.length - 1];
  52202. this.absarc(e + s, t + l, i, n, r, o)
  52203. }
  52204. ,
  52205. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52206. this.absellipse(e, t, i, i, n, r, o)
  52207. }
  52208. ,
  52209. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52210. var l = this.actions[this.actions.length - 1].args
  52211. , c = l[l.length - 2]
  52212. , h = l[l.length - 1];
  52213. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52214. }
  52215. ,
  52216. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52217. var l = [e, t, i, n, r, o, a, s || 0]
  52218. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52219. this.curves.push(c);
  52220. var h = c.getPoint(1);
  52221. l.push(h.x),
  52222. l.push(h.y),
  52223. this.actions.push({
  52224. action: "ellipse",
  52225. args: l
  52226. })
  52227. }
  52228. ,
  52229. Ci.Path.prototype.getSpacedPoints = function(e) {
  52230. e = e || 40;
  52231. for (var t = [], i = 0; i < e; i++)
  52232. t.push(this.getPoint(i / e));
  52233. return this.autoClose && t.push(t[0]),
  52234. t
  52235. }
  52236. ,
  52237. Ci.Path.prototype.getPoints = function(e) {
  52238. e = e || 12;
  52239. 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++) {
  52240. var v = this.actions[g]
  52241. , y = v.action
  52242. , A = v.args;
  52243. switch (y) {
  52244. case "moveTo":
  52245. case "lineTo":
  52246. f.push(new Ci.Vector2(A[0],A[1]));
  52247. break;
  52248. case "quadraticCurveTo":
  52249. t = A[2],
  52250. i = A[3],
  52251. o = A[0],
  52252. a = A[1],
  52253. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52254. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52255. c[c.length - 1]);
  52256. for (var C = 1; C <= e; C++) {
  52257. h = d(O = C / e, s, o, t),
  52258. u = d(O, l, a, i),
  52259. f.push(new Ci.Vector2(h,u))
  52260. }
  52261. break;
  52262. case "bezierCurveTo":
  52263. t = A[4],
  52264. i = A[5],
  52265. o = A[0],
  52266. a = A[1],
  52267. n = A[2],
  52268. r = A[3],
  52269. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52270. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52271. c[c.length - 1]);
  52272. for (C = 1; C <= e; C++) {
  52273. h = p(O = C / e, s, o, n, t),
  52274. u = p(O, l, a, r, i),
  52275. f.push(new Ci.Vector2(h,u))
  52276. }
  52277. break;
  52278. case "splineThru":
  52279. c = this.actions[g - 1].args;
  52280. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52281. , E = e * A[0].length;
  52282. I = I.concat(A[0]);
  52283. var _ = new Ci.SplineCurve(I);
  52284. for (C = 1; C <= E; C++)
  52285. f.push(_.getPointAt(C / E));
  52286. break;
  52287. case "arc":
  52288. var b = A[0]
  52289. , w = A[1]
  52290. , T = A[2]
  52291. , x = A[3]
  52292. , S = A[4]
  52293. , M = !!A[5]
  52294. , R = S - x
  52295. , P = 2 * e;
  52296. for (C = 1; C <= P; C++) {
  52297. var O = C / P;
  52298. M || (O = 1 - O),
  52299. L = x + O * R,
  52300. h = b + T * Math.cos(L),
  52301. u = w + T * Math.sin(L),
  52302. f.push(new Ci.Vector2(h,u))
  52303. }
  52304. break;
  52305. case "ellipse":
  52306. b = A[0],
  52307. w = A[1];
  52308. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52309. S = A[5],
  52310. M = !!A[6],
  52311. A[7]);
  52312. R = S - x,
  52313. P = 2 * e;
  52314. 0 !== V && (D = Math.cos(V),
  52315. N = Math.sin(V));
  52316. for (C = 1; C <= P; C++) {
  52317. O = C / P;
  52318. if (M || (O = 1 - O),
  52319. L = x + O * R,
  52320. h = b + F * Math.cos(L),
  52321. u = w + B * Math.sin(L),
  52322. 0 !== V) {
  52323. var k = h;
  52324. h = (k - b) * D - (u - w) * N + b,
  52325. u = (k - b) * N + (u - w) * D + w
  52326. }
  52327. f.push(new Ci.Vector2(h,u))
  52328. }
  52329. }
  52330. }
  52331. var U = f[f.length - 1];
  52332. 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),
  52333. this.autoClose && f.push(f[0]),
  52334. f
  52335. }
  52336. ,
  52337. Ci.Path.prototype.toShapes = function(e, t) {
  52338. function i(e) {
  52339. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52340. var r = e[i]
  52341. , o = new Ci.Shape;
  52342. o.actions = r.actions,
  52343. o.curves = r.curves,
  52344. t.push(o)
  52345. }
  52346. return t
  52347. }
  52348. function n(e, t) {
  52349. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52350. var a = t[r]
  52351. , s = t[o]
  52352. , l = s.x - a.x
  52353. , c = s.y - a.y;
  52354. if (Math.abs(c) > Number.EPSILON) {
  52355. if (c < 0 && (a = t[o],
  52356. l = -l,
  52357. s = t[r],
  52358. c = -c),
  52359. e.y < a.y || e.y > s.y)
  52360. continue;
  52361. if (e.y === a.y) {
  52362. if (e.x === a.x)
  52363. return !0
  52364. } else {
  52365. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52366. if (0 == h)
  52367. return !0;
  52368. if (h < 0)
  52369. continue;
  52370. n = !n
  52371. }
  52372. } else {
  52373. if (e.y !== a.y)
  52374. continue;
  52375. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52376. return !0
  52377. }
  52378. }
  52379. return n
  52380. }
  52381. var r = Ci.ShapeUtils.isClockWise
  52382. , o = function(e) {
  52383. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52384. var o = e[n]
  52385. , a = o.args
  52386. , s = o.action;
  52387. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52388. i = new Ci.Path),
  52389. i[s].apply(i, a)
  52390. }
  52391. return 0 !== i.actions.length && t.push(i),
  52392. t
  52393. }(this.actions);
  52394. if (0 === o.length)
  52395. return [];
  52396. if (!0 === t)
  52397. return i(o);
  52398. var a, s, l, c = [];
  52399. if (1 === o.length)
  52400. return s = o[0],
  52401. (l = new Ci.Shape).actions = s.actions,
  52402. l.curves = s.curves,
  52403. c.push(l),
  52404. c;
  52405. var h = !r(o[0].getPoints());
  52406. h = e ? !h : h;
  52407. var u, d = [], p = [], f = [], g = 0;
  52408. p[g] = void 0,
  52409. f[g] = [];
  52410. for (var m = 0, v = o.length; m < v; m++)
  52411. a = r(u = (s = o[m]).getPoints()),
  52412. (a = e ? !a : a) ? (!h && p[g] && g++,
  52413. p[g] = {
  52414. s: new Ci.Shape,
  52415. p: u
  52416. },
  52417. p[g].s.actions = s.actions,
  52418. p[g].s.curves = s.curves,
  52419. h && g++,
  52420. f[g] = []) : f[g].push({
  52421. h: s,
  52422. p: u[0]
  52423. });
  52424. if (!p[0])
  52425. return i(o);
  52426. if (1 < p.length) {
  52427. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52428. d[C] = [];
  52429. for (C = 0,
  52430. I = p.length; C < I; C++)
  52431. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52432. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52433. n(b.p, p[T].p) && (C !== T && A.push({
  52434. froms: C,
  52435. tos: T,
  52436. hole: _
  52437. }),
  52438. w ? (w = !1,
  52439. d[T].push(b)) : y = !0);
  52440. w && d[C].push(b)
  52441. }
  52442. 0 < A.length && (y || (f = d))
  52443. }
  52444. m = 0;
  52445. for (var x, S = p.length; m < S; m++) {
  52446. l = p[m].s,
  52447. c.push(l);
  52448. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52449. l.holes.push(x[M].h)
  52450. }
  52451. return c
  52452. }
  52453. ,
  52454. Ci.Shape = function() {
  52455. Ci.Path.apply(this, arguments),
  52456. this.holes = []
  52457. }
  52458. ,
  52459. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52460. Ci.Shape.prototype.constructor = Ci.Shape,
  52461. Ci.Shape.prototype.extrude = function(e) {
  52462. return new Ci.ExtrudeGeometry(this,e)
  52463. }
  52464. ,
  52465. Ci.Shape.prototype.makeGeometry = function(e) {
  52466. return new Ci.ShapeGeometry(this,e)
  52467. }
  52468. ,
  52469. Ci.Shape.prototype.getPointsHoles = function(e) {
  52470. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52471. t[i] = this.holes[i].getPoints(e);
  52472. return t
  52473. }
  52474. ,
  52475. Ci.Shape.prototype.extractAllPoints = function(e) {
  52476. return {
  52477. shape: this.getPoints(e),
  52478. holes: this.getPointsHoles(e)
  52479. }
  52480. }
  52481. ,
  52482. Ci.Shape.prototype.extractPoints = function(e) {
  52483. return this.extractAllPoints(e)
  52484. }
  52485. ,
  52486. Ci.LineCurve = function(e, t) {
  52487. this.v1 = e,
  52488. this.v2 = t
  52489. }
  52490. ,
  52491. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52492. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52493. Ci.LineCurve.prototype.getPoint = function(e) {
  52494. var t = this.v2.clone().sub(this.v1);
  52495. return t.multiplyScalar(e).add(this.v1),
  52496. t
  52497. }
  52498. ,
  52499. Ci.LineCurve.prototype.getPointAt = function(e) {
  52500. return this.getPoint(e)
  52501. }
  52502. ,
  52503. Ci.LineCurve.prototype.getTangent = function(e) {
  52504. return this.v2.clone().sub(this.v1).normalize()
  52505. }
  52506. ,
  52507. Ci.QuadraticBezierCurve = function(e, t, i) {
  52508. this.v0 = e,
  52509. this.v1 = t,
  52510. this.v2 = i
  52511. }
  52512. ,
  52513. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52514. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52515. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52516. var t = Ci.ShapeUtils.b2;
  52517. 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))
  52518. }
  52519. ,
  52520. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52521. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52522. 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()
  52523. }
  52524. ,
  52525. Ci.CubicBezierCurve = function(e, t, i, n) {
  52526. this.v0 = e,
  52527. this.v1 = t,
  52528. this.v2 = i,
  52529. this.v3 = n
  52530. }
  52531. ,
  52532. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52533. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52534. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52535. var t = Ci.ShapeUtils.b3;
  52536. 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))
  52537. }
  52538. ,
  52539. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52540. var t = Ci.CurveUtils.tangentCubicBezier;
  52541. 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()
  52542. }
  52543. ,
  52544. Ci.SplineCurve = function(e) {
  52545. this.points = null == e ? [] : e
  52546. }
  52547. ,
  52548. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52549. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52550. Ci.SplineCurve.prototype.getPoint = function(e) {
  52551. var t = this.points
  52552. , i = (t.length - 1) * e
  52553. , n = Math.floor(i)
  52554. , r = i - n
  52555. , o = t[0 === n ? n : n - 1]
  52556. , a = t[n]
  52557. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52558. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52559. , c = Ci.CurveUtils.interpolate;
  52560. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52561. }
  52562. ,
  52563. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52564. this.aX = e,
  52565. this.aY = t,
  52566. this.xRadius = i,
  52567. this.yRadius = n,
  52568. this.aStartAngle = r,
  52569. this.aEndAngle = o,
  52570. this.aClockwise = a,
  52571. this.aRotation = s || 0
  52572. }
  52573. ,
  52574. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52575. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52576. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52577. var t, i = this.aEndAngle - this.aStartAngle;
  52578. i < 0 && (i += 2 * Math.PI),
  52579. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52580. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52581. var n = this.aX + this.xRadius * Math.cos(t)
  52582. , r = this.aY + this.yRadius * Math.sin(t);
  52583. if (0 !== this.aRotation) {
  52584. var o = Math.cos(this.aRotation)
  52585. , a = Math.sin(this.aRotation)
  52586. , s = n
  52587. , l = r;
  52588. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52589. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52590. }
  52591. return new Ci.Vector2(n,r)
  52592. }
  52593. ,
  52594. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52595. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52596. }
  52597. ,
  52598. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52599. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52600. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52601. this.v1 = e,
  52602. this.v2 = t
  52603. }, function(e) {
  52604. var t = new Ci.Vector3;
  52605. return t.subVectors(this.v2, this.v1),
  52606. t.multiplyScalar(e),
  52607. t.add(this.v1),
  52608. t
  52609. }),
  52610. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52611. this.v0 = e,
  52612. this.v1 = t,
  52613. this.v2 = i
  52614. }, function(e) {
  52615. var t = Ci.ShapeUtils.b2;
  52616. 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))
  52617. }),
  52618. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52619. this.v0 = e,
  52620. this.v1 = t,
  52621. this.v2 = i,
  52622. this.v3 = n
  52623. }, function(e) {
  52624. var t = Ci.ShapeUtils.b3;
  52625. 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))
  52626. }),
  52627. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52628. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52629. this.points = null == e ? [] : e
  52630. }, function(e) {
  52631. var t = this.points
  52632. , i = (t.length - 1) * e
  52633. , n = Math.floor(i)
  52634. , r = i - n
  52635. , o = t[0 == n ? n : n - 1]
  52636. , a = t[n]
  52637. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52638. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52639. , c = Ci.CurveUtils.interpolate;
  52640. 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))
  52641. }),
  52642. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52643. Xt = new xi,
  52644. Zt = new xi,
  52645. Kt = new xi,
  52646. xi.prototype.init = function(e, t, i, n) {
  52647. this.c0 = e,
  52648. this.c1 = i,
  52649. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52650. this.c3 = 2 * e - 2 * t + i + n
  52651. }
  52652. ,
  52653. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52654. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52655. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52656. s *= o,
  52657. l *= o,
  52658. this.init(t, i, s, l)
  52659. }
  52660. ,
  52661. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52662. this.init(t, i, r * (i - e), r * (n - t))
  52663. }
  52664. ,
  52665. xi.prototype.calc = function(e) {
  52666. var t = e * e
  52667. , i = t * e;
  52668. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52669. }
  52670. ,
  52671. Ci.Curve.create(function(e) {
  52672. this.points = e || [],
  52673. this.closed = !1
  52674. }, function(e) {
  52675. var t, i, n, r, o, a, s, l, c = this.points;
  52676. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52677. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52678. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52679. n = 1),
  52680. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52681. qt),
  52682. a = c[i % r],
  52683. s = c[(i + 1) % r],
  52684. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52685. qt),
  52686. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52687. var h = "chordal" === this.type ? .5 : .25
  52688. , u = Math.pow(o.distanceToSquared(a), h)
  52689. , d = Math.pow(a.distanceToSquared(s), h)
  52690. , p = Math.pow(s.distanceToSquared(l), h);
  52691. d < 1e-4 && (d = 1),
  52692. u < 1e-4 && (u = d),
  52693. p < 1e-4 && (p = d),
  52694. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52695. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52696. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52697. } else if ("catmullrom" === this.type) {
  52698. var f = void 0 !== this.tension ? this.tension : .5;
  52699. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52700. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52701. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52702. }
  52703. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52704. })),
  52705. Ci.ClosedSplineCurve3 = function(e) {
  52706. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52707. Ci.CatmullRomCurve3.call(this, e),
  52708. this.type = "catmullrom",
  52709. this.closed = !0
  52710. }
  52711. ,
  52712. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52713. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52714. Ci.Geometry.call(this),
  52715. this.type = "BoxGeometry",
  52716. this.parameters = {
  52717. width: e,
  52718. height: t,
  52719. depth: i,
  52720. widthSegments: n,
  52721. heightSegments: r,
  52722. depthSegments: o
  52723. },
  52724. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52725. this.mergeVertices()
  52726. }
  52727. ,
  52728. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52729. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52730. Ci.CubeGeometry = Ci.BoxGeometry,
  52731. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52732. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52733. 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++)
  52734. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52735. var b = _ * u - p;
  52736. C[e] = b * n,
  52737. C[t] = E * r,
  52738. C[i] = g,
  52739. P[D] = C.x,
  52740. P[D + 1] = C.y,
  52741. P[D + 2] = C.z,
  52742. C[e] = 0,
  52743. C[t] = 0,
  52744. C[i] = 0 < s ? 1 : -1,
  52745. O[D] = C.x,
  52746. O[D + 1] = C.y,
  52747. O[D + 2] = C.z,
  52748. L[N] = _ / l,
  52749. L[N + 1] = 1 - I / c,
  52750. D += 3,
  52751. N += 2,
  52752. y += 1
  52753. }
  52754. for (I = 0; I < c; I++)
  52755. for (_ = 0; _ < l; _++) {
  52756. var w = B + _ + m * I
  52757. , T = B + _ + m * (I + 1)
  52758. , x = B + (_ + 1) + m * (I + 1)
  52759. , S = B + (_ + 1) + m * I;
  52760. R[F] = w,
  52761. R[F + 1] = T,
  52762. R[F + 2] = S,
  52763. R[F + 3] = T,
  52764. R[F + 4] = x,
  52765. R[F + 5] = S,
  52766. F += 6,
  52767. A += 6
  52768. }
  52769. M.addGroup(V, A, h),
  52770. V += A,
  52771. B += y
  52772. }
  52773. Ci.BufferGeometry.call(this),
  52774. this.type = "BoxBufferGeometry",
  52775. this.parameters = {
  52776. width: e,
  52777. height: t,
  52778. depth: i,
  52779. widthSegments: n,
  52780. heightSegments: r,
  52781. depthSegments: o
  52782. };
  52783. var M = this;
  52784. n = Math.floor(n) || 1,
  52785. r = Math.floor(r) || 1,
  52786. o = Math.floor(o) || 1;
  52787. var s, l, c, h, u = (h = 0,
  52788. h += (s = n) * (l = r) * 2,
  52789. h += s * (c = o) * 2,
  52790. 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;
  52791. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  52792. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  52793. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  52794. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  52795. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  52796. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  52797. this.setIndex(new Ci.BufferAttribute(R,1)),
  52798. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  52799. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  52800. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  52801. }
  52802. ,
  52803. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52804. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  52805. Ci.CircleGeometry = function(e, t, i, n) {
  52806. Ci.Geometry.call(this),
  52807. this.type = "CircleGeometry",
  52808. this.parameters = {
  52809. radius: e,
  52810. segments: t,
  52811. thetaStart: i,
  52812. thetaLength: n
  52813. },
  52814. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  52815. }
  52816. ,
  52817. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52818. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  52819. Ci.CircleBufferGeometry = function(e, t, i, n) {
  52820. Ci.BufferGeometry.call(this),
  52821. this.type = "CircleBufferGeometry",
  52822. this.parameters = {
  52823. radius: e,
  52824. segments: t,
  52825. thetaStart: i,
  52826. thetaLength: n
  52827. },
  52828. e = e || 50,
  52829. t = void 0 !== t ? Math.max(3, t) : 8,
  52830. i = void 0 !== i ? i : 0,
  52831. n = void 0 !== n ? n : 2 * Math.PI;
  52832. var r = t + 2
  52833. , o = new Float32Array(3 * r)
  52834. , a = new Float32Array(3 * r)
  52835. , s = new Float32Array(2 * r);
  52836. a[2] = 1,
  52837. s[0] = .5,
  52838. s[1] = .5;
  52839. for (var l = 0, c = 3, h = 2; l <= t; l++,
  52840. c += 3,
  52841. h += 2) {
  52842. var u = i + l / t * n;
  52843. o[c] = e * Math.cos(u),
  52844. o[c + 1] = e * Math.sin(u),
  52845. a[c + 2] = 1,
  52846. s[h] = (o[c] / e + 1) / 2,
  52847. s[h + 1] = (o[c + 1] / e + 1) / 2
  52848. }
  52849. var d = [];
  52850. for (c = 1; c <= t; c++)
  52851. d.push(c, c + 1, 0);
  52852. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  52853. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  52854. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  52855. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  52856. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  52857. }
  52858. ,
  52859. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52860. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  52861. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  52862. function t(e) {
  52863. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  52864. for (i = b,
  52865. t = 1; t <= m; t++)
  52866. I.setXYZ(b, 0, x * s, 0),
  52867. E.setXYZ(b, 0, s, 0),
  52868. !0 === e ? (r.x = t / m,
  52869. r.y = 0) : (r.x = (t - 1) / m,
  52870. r.y = 1),
  52871. _.setXY(b, r.x, r.y),
  52872. b++;
  52873. for (n = b,
  52874. t = 0; t <= m; t++) {
  52875. var l = t / m;
  52876. o.x = a * Math.sin(l * A + y),
  52877. o.y = x * s,
  52878. o.z = a * Math.cos(l * A + y),
  52879. I.setXYZ(b, o.x, o.y, o.z),
  52880. E.setXYZ(b, 0, s, 0),
  52881. _.setXY(b, l, !0 === e ? 1 : 0),
  52882. b++
  52883. }
  52884. for (t = 0; t < m; t++) {
  52885. var c = i + t
  52886. , h = n + t;
  52887. !0 === e ? (C.setX(w, h),
  52888. w++,
  52889. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  52890. w++,
  52891. C.setX(w, h)),
  52892. w++,
  52893. C.setX(w, c),
  52894. w++
  52895. }
  52896. }
  52897. Ci.BufferGeometry.call(this),
  52898. this.type = "CylinderBufferGeometry",
  52899. this.parameters = {
  52900. radiusTop: p,
  52901. radiusBottom: f,
  52902. height: g,
  52903. radialSegments: m,
  52904. heightSegments: v,
  52905. openEnded: e,
  52906. thetaStart: y,
  52907. thetaLength: A
  52908. },
  52909. p = void 0 !== p ? p : 20,
  52910. f = void 0 !== f ? f : 20,
  52911. g = void 0 !== g ? g : 100,
  52912. m = Math.floor(m) || 8,
  52913. v = Math.floor(v) || 1,
  52914. e = void 0 !== e && e,
  52915. y = void 0 !== y ? y : 0,
  52916. A = void 0 !== A ? A : 2 * Math.PI;
  52917. var i, n, r = (n = (m + 1) * (v + 1),
  52918. !1 === e && (n += 2 * (m + 1) + 2 * m),
  52919. n), o = (i = m * v * 2 * 3,
  52920. !1 === e && (i += 2 * m * 3),
  52921. 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;
  52922. (function() {
  52923. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  52924. for (t = 0; t <= v; t++) {
  52925. var o = []
  52926. , a = t / v
  52927. , s = a * (f - p) + p;
  52928. for (e = 0; e <= m; e++) {
  52929. var l = e / m;
  52930. n.x = s * Math.sin(l * A + y),
  52931. n.y = -a * g + x,
  52932. n.z = s * Math.cos(l * A + y),
  52933. I.setXYZ(b, n.x, n.y, n.z),
  52934. i.copy(n),
  52935. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  52936. i.z = Math.cos(l * A + y)),
  52937. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  52938. E.setXYZ(b, i.x, i.y, i.z),
  52939. _.setXY(b, l, 1 - a),
  52940. o.push(b),
  52941. b++
  52942. }
  52943. T.push(o)
  52944. }
  52945. for (e = 0; e < m; e++)
  52946. for (t = 0; t < v; t++) {
  52947. var c = T[t][e]
  52948. , h = T[t + 1][e]
  52949. , u = T[t + 1][e + 1]
  52950. , d = T[t][e + 1];
  52951. C.setX(w, c),
  52952. w++,
  52953. C.setX(w, h),
  52954. w++,
  52955. C.setX(w, d),
  52956. w++,
  52957. C.setX(w, h),
  52958. w++,
  52959. C.setX(w, u),
  52960. w++,
  52961. C.setX(w, d),
  52962. w++
  52963. }
  52964. }
  52965. )(),
  52966. !1 === e && (0 < p && t(!0),
  52967. 0 < f && t(!1)),
  52968. this.setIndex(C),
  52969. this.addAttribute("position", I),
  52970. this.addAttribute("normal", E),
  52971. this.addAttribute("uv", _)
  52972. }
  52973. ,
  52974. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52975. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  52976. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  52977. Ci.Geometry.call(this),
  52978. this.type = "CylinderGeometry",
  52979. this.parameters = {
  52980. radiusTop: e,
  52981. radiusBottom: t,
  52982. height: i,
  52983. radialSegments: n,
  52984. heightSegments: r,
  52985. openEnded: o,
  52986. thetaStart: a,
  52987. thetaLength: s
  52988. },
  52989. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  52990. this.mergeVertices()
  52991. }
  52992. ,
  52993. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52994. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  52995. Ci.EdgesGeometry = function(e, t) {
  52996. function i(e, t) {
  52997. return e - t
  52998. }
  52999. Ci.BufferGeometry.call(this),
  53000. t = void 0 !== t ? t : 1;
  53001. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53002. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53003. n.mergeVertices(),
  53004. n.computeFaceNormals();
  53005. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53006. for (var d = c[h], p = 0; p < 3; p++) {
  53007. o[0] = d[s[p]],
  53008. o[1] = d[s[(p + 1) % 3]],
  53009. o.sort(i),
  53010. void 0 === a[g = o.toString()] ? a[g] = {
  53011. vert1: o[0],
  53012. vert2: o[1],
  53013. face1: h,
  53014. face2: void 0
  53015. } : a[g].face2 = h
  53016. }
  53017. var f = [];
  53018. for (var g in a) {
  53019. var m = a[g];
  53020. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53021. var v = l[m.vert1];
  53022. f.push(v.x),
  53023. f.push(v.y),
  53024. f.push(v.z),
  53025. v = l[m.vert2],
  53026. f.push(v.x),
  53027. f.push(v.y),
  53028. f.push(v.z)
  53029. }
  53030. }
  53031. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53032. }
  53033. ,
  53034. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53035. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53036. Ci.ExtrudeGeometry = function(e, t) {
  53037. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53038. this.type = "ExtrudeGeometry",
  53039. e = Array.isArray(e) ? e : [e],
  53040. this.addShapeList(e, t),
  53041. void this.computeFaceNormals())
  53042. }
  53043. ;
  53044. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53045. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53046. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53047. for (var i = e.length, n = 0; n < i; n++) {
  53048. var r = e[n];
  53049. this.addShape(r, t)
  53050. }
  53051. }
  53052. ,
  53053. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53054. function i(e, t, i) {
  53055. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53056. t.clone().multiplyScalar(i).add(e)
  53057. }
  53058. function n(e, t, i) {
  53059. 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;
  53060. if (Math.abs(u) > Number.EPSILON) {
  53061. var d = Math.sqrt(h)
  53062. , p = Math.sqrt(l * l + c * c)
  53063. , f = t.x - s / d
  53064. , g = t.y + a / d
  53065. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53066. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53067. if (v <= 2)
  53068. return new Ci.Vector2(n,r);
  53069. o = Math.sqrt(v / 2)
  53070. } else {
  53071. var y = !1;
  53072. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53073. o = y ? (n = -s,
  53074. r = a,
  53075. Math.sqrt(h)) : (n = a,
  53076. r = s,
  53077. Math.sqrt(h / 2))
  53078. }
  53079. return new Ci.Vector2(n / o,r / o)
  53080. }
  53081. function r(e, t) {
  53082. var i, n;
  53083. for (G = e.length; 0 <= --G; ) {
  53084. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53085. var r = 0
  53086. , o = A + 2 * m;
  53087. for (r = 0; r < o; r++) {
  53088. var a = U * r
  53089. , s = U * (r + 1);
  53090. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53091. }
  53092. }
  53093. }
  53094. function o(e, t, i) {
  53095. T.vertices.push(new Ci.Vector3(e,t,i))
  53096. }
  53097. function a(e, t, i) {
  53098. e += x,
  53099. t += x,
  53100. i += x,
  53101. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53102. var n = E.generateTopUV(T, e, t, i);
  53103. T.faceVertexUvs[0].push(n)
  53104. }
  53105. function l(e, t, i, n) {
  53106. e += x,
  53107. t += x,
  53108. i += x,
  53109. n += x,
  53110. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53111. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53112. var r = E.generateSideWallUV(T, e, t, i, n);
  53113. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53114. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53115. }
  53116. 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;
  53117. C && (s = C.getSpacedPoints(A),
  53118. v = !(I = !0),
  53119. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53120. h = new Ci.Vector3,
  53121. u = new Ci.Vector3,
  53122. d = new Ci.Vector3),
  53123. v || (g = f = m = 0);
  53124. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53125. if (P) {
  53126. for (M = M.reverse(),
  53127. b = 0,
  53128. w = R.length; b < w; b++)
  53129. _ = R[b],
  53130. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53131. P = !1
  53132. }
  53133. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53134. , L = M;
  53135. for (b = 0,
  53136. w = R.length; b < w; b++)
  53137. _ = R[b],
  53138. M = M.concat(_);
  53139. 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++,
  53140. j++,
  53141. Y++)
  53142. j === W && (j = 0),
  53143. Y === W && (Y = 0),
  53144. z[G] = n(L[G], L[j], L[Y]);
  53145. var q, X, Z = [], K = z.concat();
  53146. for (b = 0,
  53147. w = R.length; b < w; b++) {
  53148. for (_ = R[b],
  53149. q = [],
  53150. G = 0,
  53151. j = (W = _.length) - 1,
  53152. Y = G + 1; G < W; G++,
  53153. j++,
  53154. Y++)
  53155. j === W && (j = 0),
  53156. Y === W && (Y = 0),
  53157. q[G] = n(_[G], _[j], _[Y]);
  53158. Z.push(q),
  53159. K = K.concat(q)
  53160. }
  53161. for (D = 0; D < m; D++) {
  53162. for (B = f * (1 - (F = D / m)),
  53163. N = g * Math.sin(F * Math.PI / 2),
  53164. G = 0,
  53165. W = L.length; G < W; G++)
  53166. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53167. for (b = 0,
  53168. w = R.length; b < w; b++)
  53169. for (_ = R[b],
  53170. q = Z[b],
  53171. G = 0,
  53172. W = _.length; G < W; G++)
  53173. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53174. }
  53175. for (N = g,
  53176. G = 0; G < U; G++)
  53177. V = v ? i(M[G], K[G], N) : M[G],
  53178. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53179. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53180. d.copy(s[0]).add(u).add(h),
  53181. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53182. for (X = 1; X <= A; X++)
  53183. for (G = 0; G < U; G++)
  53184. V = v ? i(M[G], K[G], N) : M[G],
  53185. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53186. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53187. d.copy(s[X]).add(u).add(h),
  53188. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53189. for (D = m - 1; 0 <= D; D--) {
  53190. for (B = f * (1 - (F = D / m)),
  53191. N = g * Math.sin(F * Math.PI / 2),
  53192. G = 0,
  53193. W = L.length; G < W; G++)
  53194. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53195. for (b = 0,
  53196. w = R.length; b < w; b++)
  53197. for (_ = R[b],
  53198. q = Z[b],
  53199. G = 0,
  53200. W = _.length; G < W; G++)
  53201. V = i(_[G], q[G], N),
  53202. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53203. }
  53204. (function() {
  53205. if (v) {
  53206. var e = 0
  53207. , t = U * e;
  53208. for (G = 0; G < H; G++)
  53209. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53210. for (t = U * (e = A + 2 * m),
  53211. G = 0; G < H; G++)
  53212. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53213. } else {
  53214. for (G = 0; G < H; G++)
  53215. a((k = O[G])[2], k[1], k[0]);
  53216. for (G = 0; G < H; G++)
  53217. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53218. }
  53219. }
  53220. )(),
  53221. function() {
  53222. var e = 0;
  53223. for (r(L, e),
  53224. e += L.length,
  53225. b = 0,
  53226. w = R.length; b < w; b++)
  53227. r(_ = R[b], e),
  53228. e += _.length
  53229. }()
  53230. }
  53231. ,
  53232. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53233. generateTopUV: function(e, t, i, n) {
  53234. var r = e.vertices
  53235. , o = r[t]
  53236. , a = r[i]
  53237. , s = r[n];
  53238. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53239. },
  53240. generateSideWallUV: function(e, t, i, n, r) {
  53241. var o = e.vertices
  53242. , a = o[t]
  53243. , s = o[i]
  53244. , l = o[n]
  53245. , c = o[r];
  53246. 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)]
  53247. }
  53248. },
  53249. Ci.ShapeGeometry = function(e, t) {
  53250. Ci.Geometry.call(this),
  53251. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53252. this.addShapeList(e, t),
  53253. this.computeFaceNormals()
  53254. }
  53255. ,
  53256. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53257. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53258. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53259. for (var i = 0, n = e.length; i < n; i++)
  53260. this.addShape(e[i], t);
  53261. return this
  53262. }
  53263. ,
  53264. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53265. void 0 === t && (t = {});
  53266. 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);
  53267. if (d) {
  53268. for (h = h.reverse(),
  53269. i = 0,
  53270. n = u.length; i < n; i++)
  53271. r = u[i],
  53272. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53273. d = !1
  53274. }
  53275. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53276. for (i = 0,
  53277. n = u.length; i < n; i++)
  53278. r = u[i],
  53279. h = h.concat(r);
  53280. var f, g, m = h.length, v = p.length;
  53281. for (i = 0; i < m; i++)
  53282. f = h[i],
  53283. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53284. for (i = 0; i < v; i++) {
  53285. var y = (g = p[i])[0] + l
  53286. , A = g[1] + l
  53287. , C = g[2] + l;
  53288. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53289. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53290. }
  53291. }
  53292. ,
  53293. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53294. Ci.BufferGeometry.call(this),
  53295. this.type = "LatheBufferGeometry",
  53296. this.parameters = {
  53297. points: e,
  53298. segments: t,
  53299. phiStart: i,
  53300. phiLength: n
  53301. },
  53302. t = Math.floor(t) || 12,
  53303. i = i || 0,
  53304. n = n || 2 * Math.PI,
  53305. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53306. 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,
  53307. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53308. for (o = 0; o <= t; o++) {
  53309. var v = i + o * f * n
  53310. , y = Math.sin(v)
  53311. , A = Math.cos(v);
  53312. for (a = 0; a <= e.length - 1; a++)
  53313. g.x = e[a].x * y,
  53314. g.y = e[a].y,
  53315. g.z = e[a].x * A,
  53316. h.setXYZ(d, g.x, g.y, g.z),
  53317. m.x = o / t,
  53318. m.y = a / (e.length - 1),
  53319. u.setXY(d, m.x, m.y),
  53320. d++
  53321. }
  53322. for (o = 0; o < t; o++)
  53323. for (a = 0; a < e.length - 1; a++) {
  53324. var C = r = a + o * e.length
  53325. , I = r + e.length
  53326. , E = r + e.length + 1
  53327. , _ = r + 1;
  53328. c.setX(p, C),
  53329. p++,
  53330. c.setX(p, I),
  53331. p++,
  53332. c.setX(p, _),
  53333. p++,
  53334. c.setX(p, I),
  53335. p++,
  53336. c.setX(p, E),
  53337. p++,
  53338. c.setX(p, _),
  53339. p++
  53340. }
  53341. if (this.setIndex(c),
  53342. this.addAttribute("position", h),
  53343. this.addAttribute("uv", u),
  53344. this.computeVertexNormals(),
  53345. n === 2 * Math.PI) {
  53346. var b = this.attributes.normal.array
  53347. , w = new Ci.Vector3
  53348. , T = new Ci.Vector3
  53349. , x = new Ci.Vector3;
  53350. for (r = t * e.length * 3,
  53351. a = o = 0; o < e.length; o++,
  53352. a += 3)
  53353. w.x = b[a + 0],
  53354. w.y = b[a + 1],
  53355. w.z = b[a + 2],
  53356. T.x = b[r + a + 0],
  53357. T.y = b[r + a + 1],
  53358. T.z = b[r + a + 2],
  53359. x.addVectors(w, T).normalize(),
  53360. b[a + 0] = b[r + a + 0] = x.x,
  53361. b[a + 1] = b[r + a + 1] = x.y,
  53362. b[a + 2] = b[r + a + 2] = x.z
  53363. }
  53364. }
  53365. ,
  53366. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53367. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53368. Ci.LatheGeometry = function(e, t, i, n) {
  53369. Ci.Geometry.call(this),
  53370. this.type = "LatheGeometry",
  53371. this.parameters = {
  53372. points: e,
  53373. segments: t,
  53374. phiStart: i,
  53375. phiLength: n
  53376. },
  53377. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53378. this.mergeVertices()
  53379. }
  53380. ,
  53381. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53382. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53383. Ci.PlaneGeometry = function(e, t, i, n) {
  53384. Ci.Geometry.call(this),
  53385. this.type = "PlaneGeometry",
  53386. this.parameters = {
  53387. width: e,
  53388. height: t,
  53389. widthSegments: i,
  53390. heightSegments: n
  53391. },
  53392. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53393. }
  53394. ,
  53395. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53396. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53397. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53398. Ci.BufferGeometry.call(this),
  53399. this.type = "PlaneBufferGeometry",
  53400. this.parameters = {
  53401. width: e,
  53402. height: t,
  53403. widthSegments: i,
  53404. heightSegments: n
  53405. };
  53406. 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++)
  53407. for (var y = v * u - o, A = 0; A < l; A++) {
  53408. var C = A * h - r;
  53409. d[g] = C,
  53410. d[g + 1] = -y,
  53411. p[g + 2] = 1,
  53412. f[m] = A / a,
  53413. f[m + 1] = 1 - v / s,
  53414. g += 3,
  53415. m += 2
  53416. }
  53417. g = 0;
  53418. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53419. for (v = 0; v < s; v++)
  53420. for (A = 0; A < a; A++) {
  53421. var E = A + l * v
  53422. , _ = A + l * (v + 1)
  53423. , b = A + 1 + l * (v + 1)
  53424. , w = A + 1 + l * v;
  53425. I[g] = E,
  53426. I[g + 1] = _,
  53427. I[g + 2] = w,
  53428. I[g + 3] = _,
  53429. I[g + 4] = b,
  53430. I[g + 5] = w,
  53431. g += 6
  53432. }
  53433. this.setIndex(new Ci.BufferAttribute(I,1)),
  53434. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53435. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53436. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53437. }
  53438. ,
  53439. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53440. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53441. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53442. Ci.BufferGeometry.call(this),
  53443. this.type = "RingBufferGeometry",
  53444. this.parameters = {
  53445. innerRadius: e,
  53446. outerRadius: t,
  53447. thetaSegments: i,
  53448. phiSegments: n,
  53449. thetaStart: r,
  53450. thetaLength: o
  53451. },
  53452. e = e || 20,
  53453. t = t || 50,
  53454. r = void 0 !== r ? r : 0,
  53455. o = void 0 !== o ? o : 2 * Math.PI;
  53456. 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;
  53457. for (s = 0; s <= n; s++) {
  53458. for (l = 0; l <= i; l++)
  53459. a = r + l / i * o,
  53460. A.x = v * Math.cos(a),
  53461. A.y = v * Math.sin(a),
  53462. d.setXYZ(g, A.x, A.y, A.z),
  53463. p.setXYZ(g, 0, 0, 1),
  53464. C.x = (A.x / t + 1) / 2,
  53465. C.y = (A.y / t + 1) / 2,
  53466. f.setXY(g, C.x, C.y),
  53467. g++;
  53468. v += y
  53469. }
  53470. for (s = 0; s < n; s++) {
  53471. var I = s * (i + 1);
  53472. for (l = 0; l < i; l++) {
  53473. var E = a = l + I
  53474. , _ = a + i + 1
  53475. , b = a + i + 2
  53476. , w = a + 1;
  53477. u.setX(m, E),
  53478. m++,
  53479. u.setX(m, _),
  53480. m++,
  53481. u.setX(m, b),
  53482. m++,
  53483. u.setX(m, E),
  53484. m++,
  53485. u.setX(m, b),
  53486. m++,
  53487. u.setX(m, w),
  53488. m++
  53489. }
  53490. }
  53491. this.setIndex(u),
  53492. this.addAttribute("position", d),
  53493. this.addAttribute("normal", p),
  53494. this.addAttribute("uv", f)
  53495. }
  53496. ,
  53497. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53498. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53499. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53500. Ci.Geometry.call(this),
  53501. this.type = "RingGeometry",
  53502. this.parameters = {
  53503. innerRadius: e,
  53504. outerRadius: t,
  53505. thetaSegments: i,
  53506. phiSegments: n,
  53507. thetaStart: r,
  53508. thetaLength: o
  53509. },
  53510. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53511. }
  53512. ,
  53513. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53514. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53515. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53516. Ci.Geometry.call(this),
  53517. this.type = "SphereGeometry",
  53518. this.parameters = {
  53519. radius: e,
  53520. widthSegments: t,
  53521. heightSegments: i,
  53522. phiStart: n,
  53523. phiLength: r,
  53524. thetaStart: o,
  53525. thetaLength: a
  53526. },
  53527. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53528. }
  53529. ,
  53530. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53531. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53532. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53533. Ci.BufferGeometry.call(this),
  53534. this.type = "SphereBufferGeometry",
  53535. this.parameters = {
  53536. radius: e,
  53537. widthSegments: t,
  53538. heightSegments: i,
  53539. phiStart: n,
  53540. phiLength: r,
  53541. thetaStart: o,
  53542. thetaLength: a
  53543. },
  53544. e = e || 50,
  53545. t = Math.max(3, Math.floor(t) || 8),
  53546. i = Math.max(2, Math.floor(i) || 6),
  53547. n = void 0 !== n ? n : 0,
  53548. r = void 0 !== r ? r : 2 * Math.PI;
  53549. 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++) {
  53550. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53551. var A = y / t
  53552. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53553. , I = e * Math.cos(o + v * a)
  53554. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53555. f.set(C, I, E).normalize(),
  53556. c.setXYZ(d, C, I, E),
  53557. h.setXYZ(d, f.x, f.y, f.z),
  53558. u.setXY(d, A, 1 - v),
  53559. m.push(d),
  53560. d++
  53561. }
  53562. p.push(m)
  53563. }
  53564. var _ = [];
  53565. for (g = 0; g < i; g++)
  53566. for (y = 0; y < t; y++) {
  53567. var b = p[g][y + 1]
  53568. , w = p[g][y]
  53569. , T = p[g + 1][y]
  53570. , x = p[g + 1][y + 1];
  53571. (0 !== g || 0 < o) && _.push(b, w, x),
  53572. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53573. }
  53574. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53575. this.addAttribute("position", c),
  53576. this.addAttribute("normal", h),
  53577. this.addAttribute("uv", u),
  53578. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53579. }
  53580. ,
  53581. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53582. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53583. Ci.TextGeometry = function(e, t) {
  53584. var i = (t = t || {}).font;
  53585. if (i instanceof Ci.Font == 0)
  53586. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53587. new Ci.Geometry;
  53588. var n = i.generateShapes(e, t.size, t.curveSegments);
  53589. t.amount = void 0 !== t.height ? t.height : 50,
  53590. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53591. void 0 === t.bevelSize && (t.bevelSize = 8),
  53592. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53593. Ci.ExtrudeGeometry.call(this, n, t),
  53594. this.type = "TextGeometry"
  53595. }
  53596. ,
  53597. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53598. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53599. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53600. Ci.BufferGeometry.call(this),
  53601. this.type = "TorusBufferGeometry",
  53602. this.parameters = {
  53603. radius: e,
  53604. tube: t,
  53605. radialSegments: i,
  53606. tubularSegments: n,
  53607. arc: r
  53608. },
  53609. e = e || 100,
  53610. t = t || 40,
  53611. i = Math.floor(i) || 8,
  53612. n = Math.floor(n) || 6,
  53613. r = r || 2 * Math.PI;
  53614. 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;
  53615. for (o = 0; o <= i; o++)
  53616. for (a = 0; a <= n; a++) {
  53617. var A = a / n * r
  53618. , C = o / i * Math.PI * 2;
  53619. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53620. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53621. v.z = t * Math.sin(C),
  53622. h[p] = v.x,
  53623. h[p + 1] = v.y,
  53624. h[p + 2] = v.z,
  53625. m.x = e * Math.cos(A),
  53626. m.y = e * Math.sin(A),
  53627. y.subVectors(v, m).normalize(),
  53628. u[p] = y.x,
  53629. u[p + 1] = y.y,
  53630. u[p + 2] = y.z,
  53631. d[f] = a / n,
  53632. d[f + 1] = o / i,
  53633. p += 3,
  53634. f += 2
  53635. }
  53636. for (o = 1; o <= i; o++)
  53637. for (a = 1; a <= n; a++) {
  53638. var I = (n + 1) * o + a - 1
  53639. , E = (n + 1) * (o - 1) + a - 1
  53640. , _ = (n + 1) * (o - 1) + a
  53641. , b = (n + 1) * o + a;
  53642. c[g] = I,
  53643. c[g + 1] = E,
  53644. c[g + 2] = b,
  53645. c[g + 3] = E,
  53646. c[g + 4] = _,
  53647. c[g + 5] = b,
  53648. g += 6
  53649. }
  53650. this.setIndex(new Ci.BufferAttribute(c,1)),
  53651. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53652. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53653. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53654. }
  53655. ,
  53656. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53657. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53658. Ci.TorusGeometry = function(e, t, i, n, r) {
  53659. Ci.Geometry.call(this),
  53660. this.type = "TorusGeometry",
  53661. this.parameters = {
  53662. radius: e,
  53663. tube: t,
  53664. radialSegments: i,
  53665. tubularSegments: n,
  53666. arc: r
  53667. },
  53668. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53669. }
  53670. ,
  53671. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53672. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53673. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53674. function a(e, t, i, n, r) {
  53675. var o = Math.cos(e)
  53676. , a = Math.sin(e)
  53677. , s = i / t * e
  53678. , l = Math.cos(s);
  53679. r.x = n * (2 + l) * .5 * o,
  53680. r.y = n * (2 + l) * a * .5,
  53681. r.z = n * Math.sin(s) * .5
  53682. }
  53683. Ci.BufferGeometry.call(this),
  53684. this.type = "TorusKnotBufferGeometry",
  53685. this.parameters = {
  53686. radius: e,
  53687. tube: t,
  53688. tubularSegments: i,
  53689. radialSegments: n,
  53690. p: r,
  53691. q: o
  53692. },
  53693. e = e || 100,
  53694. t = t || 40,
  53695. i = Math.floor(i) || 64,
  53696. r = r || 2,
  53697. o = o || 3;
  53698. 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;
  53699. for (s = 0; s <= i; ++s) {
  53700. var w = s / i * r * Math.PI * 2;
  53701. for (a(w, r, o, e, C),
  53702. a(.01 + w, r, o, e, I),
  53703. _.subVectors(I, C),
  53704. b.addVectors(I, C),
  53705. E.crossVectors(_, b),
  53706. b.crossVectors(E, _),
  53707. E.normalize(),
  53708. b.normalize(),
  53709. l = 0; l <= n; ++l) {
  53710. var T = l / n * Math.PI * 2
  53711. , x = -t * Math.cos(T)
  53712. , S = t * Math.sin(T);
  53713. v.x = C.x + (x * b.x + S * E.x),
  53714. v.y = C.y + (x * b.y + S * E.y),
  53715. v.z = C.z + (x * b.z + S * E.z),
  53716. d.setXYZ(g, v.x, v.y, v.z),
  53717. y.subVectors(v, C).normalize(),
  53718. p.setXYZ(g, y.x, y.y, y.z),
  53719. A.x = s / i,
  53720. A.y = l / n,
  53721. f.setXY(g, A.x, A.y),
  53722. g++
  53723. }
  53724. }
  53725. for (l = 1; l <= i; l++)
  53726. for (s = 1; s <= n; s++) {
  53727. var M = (n + 1) * (l - 1) + (s - 1)
  53728. , R = (n + 1) * l + (s - 1)
  53729. , P = (n + 1) * l + s
  53730. , O = (n + 1) * (l - 1) + s;
  53731. u.setX(m, M),
  53732. m++,
  53733. u.setX(m, R),
  53734. m++,
  53735. u.setX(m, O),
  53736. m++,
  53737. u.setX(m, R),
  53738. m++,
  53739. u.setX(m, P),
  53740. m++,
  53741. u.setX(m, O),
  53742. m++
  53743. }
  53744. this.setIndex(u),
  53745. this.addAttribute("position", d),
  53746. this.addAttribute("normal", p),
  53747. this.addAttribute("uv", f)
  53748. }
  53749. ,
  53750. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53751. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53752. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53753. Ci.Geometry.call(this),
  53754. this.type = "TorusKnotGeometry",
  53755. this.parameters = {
  53756. radius: e,
  53757. tube: t,
  53758. tubularSegments: i,
  53759. radialSegments: n,
  53760. p: r,
  53761. q: o
  53762. },
  53763. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53764. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53765. this.mergeVertices()
  53766. }
  53767. ,
  53768. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53769. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53770. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53771. Ci.Geometry.call(this),
  53772. this.type = "TubeGeometry",
  53773. this.parameters = {
  53774. path: e,
  53775. segments: t,
  53776. radius: i,
  53777. radialSegments: n,
  53778. closed: r,
  53779. taper: o
  53780. },
  53781. t = t || 64,
  53782. i = i || 1,
  53783. n = n || 8,
  53784. r = r || !1,
  53785. o = o || Ci.TubeGeometry.NoTaper;
  53786. 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;
  53787. for (this.tangents = D,
  53788. this.normals = N,
  53789. this.binormals = F,
  53790. f = 0; f < P; f++)
  53791. for (M[f] = [],
  53792. l = f / (P - 1),
  53793. p = e.getPointAt(l),
  53794. D[f],
  53795. a = N[f],
  53796. s = F[f],
  53797. h = i * o(l),
  53798. g = 0; g < n; g++)
  53799. c = g / n * 2 * Math.PI,
  53800. u = -h * Math.cos(c),
  53801. d = h * Math.sin(c),
  53802. O.copy(p),
  53803. O.x += u * a.x + d * s.x,
  53804. O.y += u * a.y + d * s.y,
  53805. O.z += u * a.z + d * s.z,
  53806. M[f][g] = (T = O.x,
  53807. x = O.y,
  53808. S = O.z,
  53809. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  53810. for (f = 0; f < t; f++)
  53811. for (g = 0; g < n; g++)
  53812. m = r ? (f + 1) % t : f + 1,
  53813. v = (g + 1) % n,
  53814. y = M[f][g],
  53815. A = M[m][g],
  53816. C = M[m][v],
  53817. I = M[f][v],
  53818. E = new Ci.Vector2(f / t,g / n),
  53819. _ = new Ci.Vector2((f + 1) / t,g / n),
  53820. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  53821. w = new Ci.Vector2(f / t,(g + 1) / n),
  53822. this.faces.push(new Ci.Face3(y,A,I)),
  53823. this.faceVertexUvs[0].push([E, _, w]),
  53824. this.faces.push(new Ci.Face3(A,C,I)),
  53825. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  53826. this.computeFaceNormals(),
  53827. this.computeVertexNormals()
  53828. }
  53829. ,
  53830. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53831. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  53832. Ci.TubeGeometry.NoTaper = function(e) {
  53833. return 1
  53834. }
  53835. ,
  53836. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  53837. return Math.sin(Math.PI * e)
  53838. }
  53839. ,
  53840. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  53841. 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;
  53842. for (this.tangents = u,
  53843. this.normals = d,
  53844. this.binormals = p,
  53845. l = 0; l < m; l++)
  53846. c = l / (m - 1),
  53847. u[l] = e.getTangentAt(c),
  53848. u[l].normalize();
  53849. for (d[0] = new Ci.Vector3,
  53850. p[0] = new Ci.Vector3,
  53851. r = Number.MAX_VALUE,
  53852. o = Math.abs(u[0].x),
  53853. a = Math.abs(u[0].y),
  53854. s = Math.abs(u[0].z),
  53855. o <= r && (r = o,
  53856. h.set(1, 0, 0)),
  53857. a <= r && (r = a,
  53858. h.set(0, 1, 0)),
  53859. s <= r && h.set(0, 0, 1),
  53860. f.crossVectors(u[0], h).normalize(),
  53861. d[0].crossVectors(u[0], f),
  53862. p[0].crossVectors(u[0], d[0]),
  53863. l = 1; l < m; l++)
  53864. d[l] = d[l - 1].clone(),
  53865. p[l] = p[l - 1].clone(),
  53866. f.crossVectors(u[l - 1], u[l]),
  53867. f.length() > Number.EPSILON && (f.normalize(),
  53868. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  53869. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  53870. p[l].crossVectors(u[l], d[l]);
  53871. if (i)
  53872. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  53873. n /= m - 1,
  53874. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  53875. l = 1; l < m; l++)
  53876. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  53877. p[l].crossVectors(u[l], d[l])
  53878. }
  53879. ,
  53880. Ci.PolyhedronGeometry = function(e, t, i, n) {
  53881. function f(e) {
  53882. var t = e.normalize().clone();
  53883. t.index = m.vertices.push(t) - 1;
  53884. var i = a(e) / 2 / Math.PI + .5
  53885. , n = function(e) {
  53886. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  53887. }(e) / Math.PI + .5;
  53888. return t.uv = new Ci.Vector2(i,1 - n),
  53889. t
  53890. }
  53891. function g(e, t, i, n) {
  53892. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  53893. m.faces.push(r),
  53894. y.copy(e).add(t).add(i).divideScalar(3);
  53895. var o = a(y);
  53896. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  53897. }
  53898. function r(e, t) {
  53899. 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++) {
  53900. a[l] = [];
  53901. 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++)
  53902. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  53903. }
  53904. for (l = 0; l < i; l++)
  53905. for (d = 0; d < 2 * (i - l) - 1; d++) {
  53906. var p = Math.floor(d / 2);
  53907. 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)
  53908. }
  53909. }
  53910. function a(e) {
  53911. return Math.atan2(e.z, -e.x)
  53912. }
  53913. function s(e, t, i) {
  53914. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  53915. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  53916. e.clone()
  53917. }
  53918. Ci.Geometry.call(this),
  53919. this.type = "PolyhedronGeometry",
  53920. this.parameters = {
  53921. vertices: e,
  53922. indices: t,
  53923. radius: i,
  53924. detail: n
  53925. },
  53926. i = i || 1,
  53927. n = n || 0;
  53928. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  53929. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  53930. var c = this.vertices
  53931. , h = []
  53932. , u = (o = 0,
  53933. 0);
  53934. for (l = t.length; o < l; o += 3,
  53935. u++) {
  53936. var d = c[t[o]]
  53937. , p = c[t[o + 1]]
  53938. , v = c[t[o + 2]];
  53939. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  53940. }
  53941. var y = new Ci.Vector3;
  53942. for (o = 0,
  53943. l = h.length; o < l; o++)
  53944. r(h[o], n);
  53945. for (o = 0,
  53946. l = this.faceVertexUvs[0].length; o < l; o++) {
  53947. var A = this.faceVertexUvs[0][o]
  53948. , C = A[0].x
  53949. , I = A[1].x
  53950. , E = A[2].x
  53951. , _ = Math.max(C, I, E)
  53952. , b = Math.min(C, I, E);
  53953. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  53954. I < .2 && (A[1].x += 1),
  53955. E < .2 && (A[2].x += 1))
  53956. }
  53957. for (o = 0,
  53958. l = this.vertices.length; o < l; o++)
  53959. this.vertices[o].multiplyScalar(i);
  53960. this.mergeVertices(),
  53961. this.computeFaceNormals(),
  53962. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  53963. }
  53964. ,
  53965. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53966. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  53967. Ci.DodecahedronGeometry = function(e, t) {
  53968. var i = (1 + Math.sqrt(5)) / 2
  53969. , n = 1 / i
  53970. , 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];
  53971. 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),
  53972. this.type = "DodecahedronGeometry",
  53973. this.parameters = {
  53974. radius: e,
  53975. detail: t
  53976. }
  53977. }
  53978. ,
  53979. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53980. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  53981. Ci.IcosahedronGeometry = function(e, t) {
  53982. var i = (1 + Math.sqrt(5)) / 2
  53983. , 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];
  53984. 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),
  53985. this.type = "IcosahedronGeometry",
  53986. this.parameters = {
  53987. radius: e,
  53988. detail: t
  53989. }
  53990. }
  53991. ,
  53992. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53993. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  53994. Ci.OctahedronGeometry = function(e, t) {
  53995. 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),
  53996. this.type = "OctahedronGeometry",
  53997. this.parameters = {
  53998. radius: e,
  53999. detail: t
  54000. }
  54001. }
  54002. ,
  54003. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54004. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54005. Ci.TetrahedronGeometry = function(e, t) {
  54006. 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),
  54007. this.type = "TetrahedronGeometry",
  54008. this.parameters = {
  54009. radius: e,
  54010. detail: t
  54011. }
  54012. }
  54013. ,
  54014. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54015. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54016. Ci.ParametricGeometry = function(e, t, i) {
  54017. Ci.Geometry.call(this),
  54018. this.type = "ParametricGeometry",
  54019. this.parameters = {
  54020. func: e,
  54021. slices: t,
  54022. stacks: i
  54023. };
  54024. 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;
  54025. for (n = 0; n <= i; n++)
  54026. for (a = n / i,
  54027. r = 0; r <= t; r++)
  54028. o = e(r / t, a),
  54029. g.push(o);
  54030. for (n = 0; n < i; n++)
  54031. for (r = 0; r < t; r++)
  54032. l = (s = n * y + r) + 1,
  54033. c = (n + 1) * y + r + 1,
  54034. h = (n + 1) * y + r,
  54035. u = new Ci.Vector2(r / t,n / i),
  54036. d = new Ci.Vector2((r + 1) / t,n / i),
  54037. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54038. f = new Ci.Vector2(r / t,(n + 1) / i),
  54039. m.push(new Ci.Face3(s,l,h)),
  54040. v.push([u, d, f]),
  54041. m.push(new Ci.Face3(l,c,h)),
  54042. v.push([d.clone(), p, f.clone()]);
  54043. this.computeFaceNormals(),
  54044. this.computeVertexNormals()
  54045. }
  54046. ,
  54047. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54048. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54049. Ci.WireframeGeometry = function(e) {
  54050. function t(e, t) {
  54051. return e - t
  54052. }
  54053. Ci.BufferGeometry.call(this);
  54054. var i = [0, 0]
  54055. , n = {}
  54056. , r = ["a", "b", "c"];
  54057. if (e instanceof Ci.Geometry) {
  54058. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54059. for (var u = a[c], d = 0; d < 3; d++) {
  54060. i[0] = u[r[d]],
  54061. i[1] = u[r[(d + 1) % 3]],
  54062. i.sort(t),
  54063. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54064. l[2 * s + 1] = i[1],
  54065. n[E] = !0,
  54066. s++)
  54067. }
  54068. var p = new Float32Array(2 * s * 3);
  54069. for (c = 0,
  54070. h = s; c < h; c++)
  54071. for (d = 0; d < 2; d++) {
  54072. var f = o[l[2 * c + d]];
  54073. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54074. p[_ + 1] = f.y,
  54075. p[_ + 2] = f.z
  54076. }
  54077. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54078. } else if (e instanceof Ci.BufferGeometry)
  54079. if (null !== e.index) {
  54080. var g = e.index.array
  54081. , m = (o = e.attributes.position,
  54082. e.groups);
  54083. s = 0;
  54084. 0 === m.length && e.addGroup(0, g.length);
  54085. l = new Uint32Array(2 * g.length);
  54086. for (var v = 0, y = m.length; v < y; ++v)
  54087. for (var A = m[v], C = A.start, I = (c = C,
  54088. C + A.count); c < I; c += 3)
  54089. for (d = 0; d < 3; d++) {
  54090. var E;
  54091. i[0] = g[c + d],
  54092. i[1] = g[c + (d + 1) % 3],
  54093. i.sort(t),
  54094. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54095. l[2 * s + 1] = i[1],
  54096. n[E] = !0,
  54097. s++)
  54098. }
  54099. for (p = new Float32Array(2 * s * 3),
  54100. c = 0,
  54101. h = s; c < h; c++)
  54102. for (d = 0; d < 2; d++) {
  54103. var _ = 6 * c + 3 * d
  54104. , b = l[2 * c + d];
  54105. p[_ + 0] = o.getX(b),
  54106. p[_ + 1] = o.getY(b),
  54107. p[_ + 2] = o.getZ(b)
  54108. }
  54109. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54110. } else {
  54111. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54112. for (p = new Float32Array(2 * s * 3),
  54113. c = 0,
  54114. h = w; c < h; c++)
  54115. for (d = 0; d < 3; d++) {
  54116. var T = 9 * c + 3 * d;
  54117. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54118. p[_ + 1] = o[1 + T],
  54119. p[_ + 2] = o[2 + T];
  54120. b = 9 * c + (d + 1) % 3 * 3;
  54121. p[_ + 3] = o[b],
  54122. p[_ + 4] = o[b + 1],
  54123. p[_ + 5] = o[b + 2]
  54124. }
  54125. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54126. }
  54127. }
  54128. ,
  54129. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54130. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54131. Ci.AxisHelper = function(e) {
  54132. e = e || 1;
  54133. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54134. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54135. , n = new Ci.BufferGeometry;
  54136. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54137. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54138. var r = new Ci.LineBasicMaterial({
  54139. vertexColors: Ci.VertexColors
  54140. });
  54141. Ci.LineSegments.call(this, n, r)
  54142. }
  54143. ,
  54144. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54145. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54146. Ci.ArrowHelper = function() {
  54147. var a = new Ci.Geometry;
  54148. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54149. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54150. return s.translate(0, -.5, 0),
  54151. function(e, t, i, n, r, o) {
  54152. Ci.Object3D.call(this),
  54153. void 0 === n && (n = 16776960),
  54154. void 0 === i && (i = 1),
  54155. void 0 === r && (r = .2 * i),
  54156. void 0 === o && (o = .2 * r),
  54157. this.position.copy(t),
  54158. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54159. color: n
  54160. })),
  54161. this.line.matrixAutoUpdate = !1,
  54162. this.add(this.line),
  54163. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54164. color: n
  54165. })),
  54166. this.cone.matrixAutoUpdate = !1,
  54167. this.add(this.cone),
  54168. this.setDirection(e),
  54169. this.setLength(i, r, o)
  54170. }
  54171. }(),
  54172. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54173. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54174. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54175. function(e) {
  54176. .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(),
  54177. yi = Math.acos(e.y),
  54178. this.quaternion.setFromAxisAngle(Ai, yi))
  54179. }
  54180. ),
  54181. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54182. void 0 === t && (t = .2 * e),
  54183. void 0 === i && (i = .2 * t),
  54184. this.line.scale.set(1, Math.max(0, e - t), 1),
  54185. this.line.updateMatrix(),
  54186. this.cone.scale.set(i, t, i),
  54187. this.cone.position.y = e,
  54188. this.cone.updateMatrix()
  54189. }
  54190. ,
  54191. Ci.ArrowHelper.prototype.setColor = function(e) {
  54192. this.line.material.color.set(e),
  54193. this.cone.material.color.set(e)
  54194. }
  54195. ,
  54196. Ci.BoxHelper = function(e) {
  54197. 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])
  54198. , i = new Float32Array(24)
  54199. , n = new Ci.BufferGeometry;
  54200. n.setIndex(new Ci.BufferAttribute(t,1)),
  54201. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54202. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54203. color: 16776960
  54204. })),
  54205. void 0 !== e && this.update(e)
  54206. }
  54207. ,
  54208. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54209. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54210. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54211. function(e) {
  54212. if (vi.setFromObject(e),
  54213. !vi.isEmpty()) {
  54214. var t = vi.min
  54215. , i = vi.max
  54216. , n = this.geometry.attributes.position
  54217. , r = n.array;
  54218. r[0] = i.x,
  54219. r[1] = i.y,
  54220. r[2] = i.z,
  54221. r[3] = t.x,
  54222. r[4] = i.y,
  54223. r[5] = i.z,
  54224. r[6] = t.x,
  54225. r[7] = t.y,
  54226. r[8] = i.z,
  54227. r[9] = i.x,
  54228. r[10] = t.y,
  54229. r[11] = i.z,
  54230. r[12] = i.x,
  54231. r[13] = i.y,
  54232. r[14] = t.z,
  54233. r[15] = t.x,
  54234. r[16] = i.y,
  54235. r[17] = t.z,
  54236. r[18] = t.x,
  54237. r[19] = t.y,
  54238. r[20] = t.z,
  54239. r[21] = i.x,
  54240. r[22] = t.y,
  54241. r[23] = t.z,
  54242. n.needsUpdate = !0,
  54243. this.geometry.computeBoundingSphere()
  54244. }
  54245. }
  54246. ),
  54247. Ci.BoundingBoxHelper = function(e, t) {
  54248. var i = void 0 !== t ? t : 8947848;
  54249. this.object = e,
  54250. this.box = new Ci.Box3,
  54251. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54252. color: i,
  54253. wireframe: !0
  54254. }))
  54255. }
  54256. ,
  54257. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54258. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54259. Ci.BoundingBoxHelper.prototype.update = function() {
  54260. this.box.setFromObject(this.object),
  54261. this.box.size(this.scale),
  54262. this.box.center(this.position)
  54263. }
  54264. ,
  54265. Ci.CameraHelper = function(e) {
  54266. function t(e, t, i) {
  54267. n(e, i),
  54268. n(t, i)
  54269. }
  54270. function n(e, t) {
  54271. i.vertices.push(new Ci.Vector3),
  54272. i.colors.push(new Ci.Color(t)),
  54273. void 0 === o[e] && (o[e] = []),
  54274. o[e].push(i.vertices.length - 1)
  54275. }
  54276. var i = new Ci.Geometry
  54277. , r = new Ci.LineBasicMaterial({
  54278. color: 16777215,
  54279. vertexColors: Ci.FaceColors
  54280. })
  54281. , o = {}
  54282. , a = 16755200
  54283. , s = 16711680
  54284. , l = 3355443;
  54285. t("n1", "n2", a),
  54286. t("n2", "n4", a),
  54287. t("n4", "n3", a),
  54288. t("n3", "n1", a),
  54289. t("f1", "f2", a),
  54290. t("f2", "f4", a),
  54291. t("f4", "f3", a),
  54292. t("f3", "f1", a),
  54293. t("n1", "f1", a),
  54294. t("n2", "f2", a),
  54295. t("n3", "f3", a),
  54296. t("n4", "f4", a),
  54297. t("p", "n1", s),
  54298. t("p", "n2", s),
  54299. t("p", "n3", s),
  54300. t("p", "n4", s),
  54301. t("u1", "u2", 43775),
  54302. t("u2", "u3", 43775),
  54303. t("u3", "u1", 43775),
  54304. t("c", "t", 16777215),
  54305. t("p", "c", l),
  54306. t("cn1", "cn2", l),
  54307. t("cn3", "cn4", l),
  54308. t("cf1", "cf2", l),
  54309. t("cf3", "cf4", l),
  54310. Ci.LineSegments.call(this, i, r),
  54311. this.camera = e,
  54312. this.camera.updateProjectionMatrix(),
  54313. this.matrix = e.matrixWorld,
  54314. this.matrixAutoUpdate = !1,
  54315. this.pointMap = o,
  54316. this.update()
  54317. }
  54318. ,
  54319. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54320. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54321. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54322. mi = new Ci.Camera,
  54323. function() {
  54324. pi = this.geometry,
  54325. fi = this.pointMap,
  54326. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54327. Ni("c", 0, 0, -1),
  54328. Ni("t", 0, 0, 1),
  54329. Ni("n1", -1, -1, -1),
  54330. Ni("n2", 1, -1, -1),
  54331. Ni("n3", -1, 1, -1),
  54332. Ni("n4", 1, 1, -1),
  54333. Ni("f1", -1, -1, 1),
  54334. Ni("f2", 1, -1, 1),
  54335. Ni("f3", -1, 1, 1),
  54336. Ni("f4", 1, 1, 1),
  54337. Ni("u1", .7, 1.1, -1),
  54338. Ni("u2", -.7, 1.1, -1),
  54339. Ni("u3", 0, 2, -1),
  54340. Ni("cf1", -1, 0, 1),
  54341. Ni("cf2", 1, 0, 1),
  54342. Ni("cf3", 0, -1, 1),
  54343. Ni("cf4", 0, 1, 1),
  54344. Ni("cn1", -1, 0, -1),
  54345. Ni("cn2", 1, 0, -1),
  54346. Ni("cn3", 0, -1, -1),
  54347. Ni("cn4", 0, 1, -1),
  54348. pi.verticesNeedUpdate = !0
  54349. }
  54350. ),
  54351. Ci.DirectionalLightHelper = function(e, t) {
  54352. Ci.Object3D.call(this),
  54353. this.light = e,
  54354. this.light.updateMatrixWorld(),
  54355. this.matrix = e.matrixWorld,
  54356. this.matrixAutoUpdate = !1,
  54357. t = t || 1;
  54358. var i = new Ci.Geometry;
  54359. 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));
  54360. var n = new Ci.LineBasicMaterial({
  54361. fog: !1
  54362. });
  54363. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54364. this.lightPlane = new Ci.Line(i,n),
  54365. this.add(this.lightPlane),
  54366. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54367. (n = new Ci.LineBasicMaterial({
  54368. fog: !1
  54369. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54370. this.targetLine = new Ci.Line(i,n),
  54371. this.add(this.targetLine),
  54372. this.update()
  54373. }
  54374. ,
  54375. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54376. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54377. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54378. this.lightPlane.geometry.dispose(),
  54379. this.lightPlane.material.dispose(),
  54380. this.targetLine.geometry.dispose(),
  54381. this.targetLine.material.dispose()
  54382. }
  54383. ,
  54384. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54385. ui = new Ci.Vector3,
  54386. di = new Ci.Vector3,
  54387. function() {
  54388. hi.setFromMatrixPosition(this.light.matrixWorld),
  54389. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54390. di.subVectors(ui, hi),
  54391. this.lightPlane.lookAt(di),
  54392. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54393. this.targetLine.geometry.vertices[1].copy(di),
  54394. this.targetLine.geometry.verticesNeedUpdate = !0,
  54395. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54396. }
  54397. ),
  54398. Ci.EdgesHelper = function(e, t, i) {
  54399. var n = void 0 !== t ? t : 16777215;
  54400. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54401. color: n
  54402. })),
  54403. this.matrix = e.matrixWorld,
  54404. this.matrixAutoUpdate = !1
  54405. }
  54406. ,
  54407. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54408. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54409. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54410. this.object = e,
  54411. this.size = void 0 !== t ? t : 1;
  54412. var r = void 0 !== i ? i : 16776960
  54413. , o = void 0 !== n ? n : 1
  54414. , a = 0
  54415. , s = this.object.geometry;
  54416. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54417. var l = new Ci.BufferGeometry
  54418. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54419. l.addAttribute("position", c),
  54420. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54421. color: r,
  54422. linewidth: o
  54423. })),
  54424. this.matrixAutoUpdate = !1,
  54425. this.update()
  54426. }
  54427. ,
  54428. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54429. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54430. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54431. li = new Ci.Vector3,
  54432. ci = new Ci.Matrix3,
  54433. function() {
  54434. this.object.updateMatrixWorld(!0),
  54435. ci.getNormalMatrix(this.object.matrixWorld);
  54436. 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++) {
  54437. var l = r[a]
  54438. , c = l.normal;
  54439. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54440. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54441. t.setXYZ(o, si.x, si.y, si.z),
  54442. o += 1,
  54443. t.setXYZ(o, li.x, li.y, li.z),
  54444. o += 1
  54445. }
  54446. return t.needsUpdate = !0,
  54447. this
  54448. }
  54449. ),
  54450. Ci.GridHelper = function(e, t) {
  54451. var i = new Ci.Geometry
  54452. , n = new Ci.LineBasicMaterial({
  54453. vertexColors: Ci.VertexColors
  54454. });
  54455. this.color1 = new Ci.Color(4473924),
  54456. this.color2 = new Ci.Color(8947848);
  54457. for (var r = -e; r <= e; r += t) {
  54458. 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));
  54459. var o = 0 === r ? this.color1 : this.color2;
  54460. i.colors.push(o, o, o, o)
  54461. }
  54462. Ci.LineSegments.call(this, i, n)
  54463. }
  54464. ,
  54465. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54466. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54467. Ci.GridHelper.prototype.setColors = function(e, t) {
  54468. this.color1.set(e),
  54469. this.color2.set(t),
  54470. this.geometry.colorsNeedUpdate = !0
  54471. }
  54472. ,
  54473. Ci.HemisphereLightHelper = function(e, t) {
  54474. Ci.Object3D.call(this),
  54475. this.light = e,
  54476. this.light.updateMatrixWorld(),
  54477. this.matrix = e.matrixWorld,
  54478. this.matrixAutoUpdate = !1,
  54479. this.colors = [new Ci.Color, new Ci.Color];
  54480. var i = new Ci.SphereGeometry(t,4,2);
  54481. i.rotateX(-Math.PI / 2);
  54482. for (var n = 0; n < 8; n++)
  54483. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54484. var r = new Ci.MeshBasicMaterial({
  54485. vertexColors: Ci.FaceColors,
  54486. wireframe: !0
  54487. });
  54488. this.lightSphere = new Ci.Mesh(i,r),
  54489. this.add(this.lightSphere),
  54490. this.update()
  54491. }
  54492. ,
  54493. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54494. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54495. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54496. this.lightSphere.geometry.dispose(),
  54497. this.lightSphere.material.dispose()
  54498. }
  54499. ,
  54500. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54501. function() {
  54502. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54503. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54504. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54505. this.lightSphere.geometry.colorsNeedUpdate = !0
  54506. }
  54507. ),
  54508. Ci.PointLightHelper = function(e, t) {
  54509. this.light = e,
  54510. this.light.updateMatrixWorld();
  54511. var i = new Ci.SphereGeometry(t,4,2)
  54512. , n = new Ci.MeshBasicMaterial({
  54513. wireframe: !0,
  54514. fog: !1
  54515. });
  54516. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54517. Ci.Mesh.call(this, i, n),
  54518. this.matrix = this.light.matrixWorld,
  54519. this.matrixAutoUpdate = !1
  54520. }
  54521. ,
  54522. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54523. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54524. Ci.PointLightHelper.prototype.dispose = function() {
  54525. this.geometry.dispose(),
  54526. this.material.dispose()
  54527. }
  54528. ,
  54529. Ci.PointLightHelper.prototype.update = function() {
  54530. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54531. }
  54532. ,
  54533. Ci.SkeletonHelper = function(e) {
  54534. this.bones = this.getBoneList(e);
  54535. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54536. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54537. t.vertices.push(new Ci.Vector3),
  54538. t.colors.push(new Ci.Color(0,0,1)),
  54539. t.colors.push(new Ci.Color(0,1,0)))
  54540. }
  54541. t.dynamic = !0;
  54542. var n = new Ci.LineBasicMaterial({
  54543. vertexColors: Ci.VertexColors,
  54544. depthTest: !1,
  54545. depthWrite: !1,
  54546. transparent: !0
  54547. });
  54548. Ci.LineSegments.call(this, t, n),
  54549. this.root = e,
  54550. this.matrix = e.matrixWorld,
  54551. this.matrixAutoUpdate = !1,
  54552. this.update()
  54553. }
  54554. ,
  54555. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54556. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54557. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54558. var t = [];
  54559. e instanceof Ci.Bone && t.push(e);
  54560. for (var i = 0; i < e.children.length; i++)
  54561. t.push.apply(t, this.getBoneList(e.children[i]));
  54562. return t
  54563. }
  54564. ,
  54565. Ci.SkeletonHelper.prototype.update = function() {
  54566. 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++) {
  54567. var o = this.bones[r];
  54568. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54569. e.vertices[n].setFromMatrixPosition(i),
  54570. i.multiplyMatrices(t, o.parent.matrixWorld),
  54571. e.vertices[n + 1].setFromMatrixPosition(i),
  54572. n += 2)
  54573. }
  54574. e.verticesNeedUpdate = !0,
  54575. e.computeBoundingSphere()
  54576. }
  54577. ,
  54578. Ci.SpotLightHelper = function(e) {
  54579. Ci.Object3D.call(this),
  54580. this.light = e,
  54581. this.light.updateMatrixWorld(),
  54582. this.matrix = e.matrixWorld,
  54583. this.matrixAutoUpdate = !1;
  54584. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54585. t.translate(0, -.5, 0),
  54586. t.rotateX(-Math.PI / 2);
  54587. var i = new Ci.MeshBasicMaterial({
  54588. wireframe: !0,
  54589. fog: !1
  54590. });
  54591. this.cone = new Ci.Mesh(t,i),
  54592. this.add(this.cone),
  54593. this.update()
  54594. }
  54595. ,
  54596. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54597. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54598. Ci.SpotLightHelper.prototype.dispose = function() {
  54599. this.cone.geometry.dispose(),
  54600. this.cone.material.dispose()
  54601. }
  54602. ,
  54603. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54604. oi = new Ci.Vector3,
  54605. function() {
  54606. var e = this.light.distance ? this.light.distance : 1e4
  54607. , t = e * Math.tan(this.light.angle);
  54608. this.cone.scale.set(t, t, e),
  54609. ri.setFromMatrixPosition(this.light.matrixWorld),
  54610. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54611. this.cone.lookAt(oi.sub(ri)),
  54612. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54613. }
  54614. ),
  54615. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54616. this.object = e,
  54617. this.size = void 0 !== t ? t : 1;
  54618. var r = void 0 !== i ? i : 16711680
  54619. , o = void 0 !== n ? n : 1
  54620. , a = 0
  54621. , s = this.object.geometry;
  54622. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54623. var l = new Ci.BufferGeometry
  54624. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54625. l.addAttribute("position", c),
  54626. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54627. color: r,
  54628. linewidth: o
  54629. })),
  54630. this.matrixAutoUpdate = !1,
  54631. this.update()
  54632. }
  54633. ,
  54634. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54635. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54636. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54637. ii = new Ci.Vector3,
  54638. ni = new Ci.Matrix3,
  54639. function() {
  54640. var e = ["a", "b", "c"];
  54641. this.object.updateMatrixWorld(!0),
  54642. ni.getNormalMatrix(this.object.matrixWorld);
  54643. var t = this.object.matrixWorld
  54644. , i = this.geometry.attributes.position
  54645. , n = this.object.geometry;
  54646. if (n instanceof Ci.Geometry)
  54647. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54648. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54649. var d = r[c[e[h]]]
  54650. , p = c.vertexNormals[h];
  54651. ti.copy(d).applyMatrix4(t),
  54652. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54653. i.setXYZ(a, ti.x, ti.y, ti.z),
  54654. a += 1,
  54655. i.setXYZ(a, ii.x, ii.y, ii.z),
  54656. a += 1
  54657. }
  54658. else if (n instanceof Ci.BufferGeometry) {
  54659. var f = n.attributes.position
  54660. , g = n.attributes.normal;
  54661. for (h = a = 0,
  54662. u = f.count; h < u; h++)
  54663. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54664. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54665. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54666. i.setXYZ(a, ti.x, ti.y, ti.z),
  54667. a += 1,
  54668. i.setXYZ(a, ii.x, ii.y, ii.z),
  54669. a += 1
  54670. }
  54671. return i.needsUpdate = !0,
  54672. this
  54673. }
  54674. ),
  54675. Ci.WireframeHelper = function(e, t) {
  54676. var i = void 0 !== t ? t : 16777215;
  54677. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54678. color: i
  54679. })),
  54680. this.matrix = e.matrixWorld,
  54681. this.matrixAutoUpdate = !1
  54682. }
  54683. ,
  54684. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54685. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54686. Ci.ImmediateRenderObject = function(e) {
  54687. Ci.Object3D.call(this),
  54688. this.material = e,
  54689. this.render = function(e) {}
  54690. }
  54691. ,
  54692. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54693. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54694. Ci.MorphBlendMesh = function(e, t) {
  54695. Ci.Mesh.call(this, e, t),
  54696. this.animationsMap = {},
  54697. this.animationsList = [];
  54698. var i = this.geometry.morphTargets.length
  54699. , n = i - 1
  54700. , r = i / 1;
  54701. this.createAnimation("__default", 0, n, r),
  54702. this.setAnimationWeight("__default", 1)
  54703. }
  54704. ,
  54705. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54706. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54707. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54708. var r = {
  54709. start: t,
  54710. end: i,
  54711. length: i - t + 1,
  54712. fps: n,
  54713. duration: (i - t) / n,
  54714. lastFrame: 0,
  54715. currentFrame: 0,
  54716. active: !1,
  54717. time: 0,
  54718. direction: 1,
  54719. weight: 1,
  54720. directionBackwards: !1,
  54721. mirroredLoop: !1
  54722. };
  54723. this.animationsMap[e] = r,
  54724. this.animationsList.push(r)
  54725. }
  54726. ,
  54727. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54728. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54729. var s = r.morphTargets[o].name.match(i);
  54730. if (s && 1 < s.length)
  54731. n[l = s[1]] || (n[l] = {
  54732. start: 1 / 0,
  54733. end: -1 / 0
  54734. }),
  54735. o < (c = n[l]).start && (c.start = o),
  54736. o > c.end && (c.end = o),
  54737. t = t || l
  54738. }
  54739. for (var l in n) {
  54740. var c = n[l];
  54741. this.createAnimation(l, c.start, c.end, e)
  54742. }
  54743. this.firstAnimation = t
  54744. }
  54745. ,
  54746. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54747. var t = this.animationsMap[e];
  54748. t && (t.direction = 1,
  54749. t.directionBackwards = !1)
  54750. }
  54751. ,
  54752. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54753. var t = this.animationsMap[e];
  54754. t && (t.direction = -1,
  54755. t.directionBackwards = !0)
  54756. }
  54757. ,
  54758. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54759. var i = this.animationsMap[e];
  54760. i && (i.fps = t,
  54761. i.duration = (i.end - i.start) / i.fps)
  54762. }
  54763. ,
  54764. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54765. var i = this.animationsMap[e];
  54766. i && (i.duration = t,
  54767. i.fps = (i.end - i.start) / i.duration)
  54768. }
  54769. ,
  54770. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54771. var i = this.animationsMap[e];
  54772. i && (i.weight = t)
  54773. }
  54774. ,
  54775. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  54776. var i = this.animationsMap[e];
  54777. i && (i.time = t)
  54778. }
  54779. ,
  54780. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  54781. var t = 0
  54782. , i = this.animationsMap[e];
  54783. return i && (t = i.time),
  54784. t
  54785. }
  54786. ,
  54787. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  54788. var t = -1
  54789. , i = this.animationsMap[e];
  54790. return i && (t = i.duration),
  54791. t
  54792. }
  54793. ,
  54794. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  54795. var t = this.animationsMap[e];
  54796. t ? (t.time = 0,
  54797. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  54798. }
  54799. ,
  54800. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  54801. var t = this.animationsMap[e];
  54802. t && (t.active = !1)
  54803. }
  54804. ,
  54805. Ci.MorphBlendMesh.prototype.update = function(e) {
  54806. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  54807. var n = this.animationsList[t];
  54808. if (n.active) {
  54809. var r = n.duration / n.length;
  54810. n.time += n.direction * e,
  54811. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  54812. n.time > n.duration && (n.time = n.duration,
  54813. n.directionBackwards = !0),
  54814. n.time < 0 && (n.time = 0,
  54815. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  54816. n.time < 0 && (n.time += n.duration));
  54817. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  54818. , a = n.weight;
  54819. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  54820. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  54821. this.morphTargetInfluences[o] = 0,
  54822. n.lastFrame = n.currentFrame,
  54823. n.currentFrame = o);
  54824. var s = n.time % r / r;
  54825. n.directionBackwards && (s = 1 - s),
  54826. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  54827. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  54828. }
  54829. }
  54830. }
  54831. ,
  54832. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  54833. i.THREE = Ci) : this.THREE = Ci
  54834. }
  54835. , {}]
  54836. }, {}, [116]);