main_2020_edit.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069
  1. window.common = null;
  2. window.MathLight = null;
  3. window.math = null
  4. g_playAudio = null
  5. g_tourAudio = new Audio
  6. g_tourAudio.loop = !1
  7. g_tourAudio.crossOrigin = "anonymous"
  8. g_tourAudio.addEventListener("ended", function() {
  9. var e = document.createEvent("MouseEvent");
  10. e.initEvent("tourAudioEnded", !0, !0),
  11. window.dispatchEvent(e)
  12. })
  13. g_tourAudio.oncanplaythrough = function() {
  14. g_tourAudio.play();
  15. /* if(g_bgAudio && !g_bgAudio.paused){
  16. manage.switchBgmState(false);
  17. g_bgAudio.pauseByTour = true
  18. } */
  19. g_playAudio = g_tourAudio;
  20. }
  21. var dealMap = (map)=>{//使不resize when image is not power of two
  22. map.wrapS = map.wrapT = THREE.ClampToEdgeWrapping;
  23. map.minFilter = THREE.LinearFilter;
  24. map.magFilter = THREE.LinearFilter;
  25. map.generateMipmaps = true;
  26. }
  27. var sortByScore = function(list, request, rank) {
  28. var i = common.filterAll(list, request);
  29. return 0 === i.length ? null : i = i.map(function(e) {
  30. return {
  31. item: e,
  32. score: rank.reduce(function(t, i) {
  33. return t + i(e);
  34. }, 0)
  35. };
  36. }).sort(function(e, t) {
  37. return t.score - e.score;
  38. });
  39. };
  40. var getTransformSid = function(){
  41. var name
  42. if(player.mode == 'panorama'){
  43. name = player.currentPano ? player.currentPano.id : 'outside'
  44. }else{
  45. name = 'outside'
  46. }
  47. return name
  48. }
  49. var convertTool = {
  50. getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
  51. var camera = camera || player.camera;
  52. var dom = dom || player.domElement;
  53. 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);
  54. var x,y;
  55. x = (pos.x + 1) / 2 * dom.clientWidth;
  56. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  57. var inSight = x <= dom.clientWidth && x >= 0 //是否在屏幕中
  58. && y <= dom.clientHeight && y >= 0
  59. return {
  60. pos: new THREE.Vector2(x,y), // 屏幕像素坐标
  61. vector: pos, //(范围 -1 ~ 1)
  62. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  63. inSight : inSight //在屏幕范围内可见
  64. };
  65. },
  66. ifShelter: function(pos3d){//检测某点在视线中是否被mesh遮挡
  67. var ori = player.position
  68. var dir = pos3d.clone().sub(ori).normalize()
  69. var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
  70. /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
  71. var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
  72. }else{ */
  73. var o = ray.intersectObjects(player.model.colliders);
  74. //}
  75. var len = pos3d.distanceTo(ori);
  76. if (o && o.length) {
  77. for(var i=0;i<o.length;i++){
  78. if(o[i].distance < len){ return true; }//有遮挡
  79. }
  80. }
  81. },
  82. /*
  83. 拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
  84. 但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
  85. */
  86. getPosAtPlane : function(pos, info/* , mouse, camera */){ //pos:与intersectPlane的交点 见笔记
  87. var A = pos;
  88. var player = player;
  89. var mouse = player.mouse;
  90. var O = new THREE.Vector3(mouse.x, mouse.y, -1).unproject(player.camera);
  91. if(info.y != void 0){//地面线的
  92. var y = info.y;
  93. if(player.mode == "floorplan"/* || Math.abs(O.x-pos.x)<0.0001 && Math.abs(O.z-pos.z)<0.0001) */){
  94. //intersectPlane和地面平行,无交点
  95. var x = pos.x, z = pos.z;
  96. }else{
  97. if(y<player.camera.position.y && O.y <= A.y /* || y>player.camera.position.y && O.y >= A.y */)return null; //鼠标射线向上。因为相机一定位于地面以上(地面不会抬高到相机上吧?),所以无交点。
  98. if(O.y == A.y){console.log('一样??');return;}
  99. if(A.y == y){console.log('一样2??');return;}
  100. var r = (O.y-y)/(A.y-y);
  101. var x = (r*A.x-O.x)/(r-1);
  102. var z = (r*A.z-O.z)/(r-1);
  103. }
  104. }else{//垂直的也有越过消失点以后反向变化的情况,但使用时影响不大
  105. var N = info.normalVec;
  106. var P = info.pullPos;
  107. if(N.y != 0 ){console.log('N.y != 0');return;} //仅仅支持垂直于地面的的墙壁,目前都是
  108. if(O.z==A.z){console.log('O.z==A.z?');return;}
  109. if(N.z!=0 && N.x != 0){//直接用这个通用的也可以,支持斜线的墙
  110. //console.log('N.z==0 && N.x == 0?');
  111. var c = ( N.x*(A.x-O.x) + N.y*(A.y-O.y) + N.z*(A.z-O.z));
  112. if(c == 0){console.log("分母为0?? return;");return;}
  113. var t = -((N.x*O.x + N.y*O.y + N.z*O.z) - (P.x*N.x + P.y*N.y + P.z*N.z) ) / c
  114. var x = t * (A.x - O.x) + O.x;
  115. var y = t * (A.y - O.y) + O.y;
  116. var z = t * (A.z - O.z) + O.z;
  117. /*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
  118. 求直线L与平面π的交点的坐标。
  119. 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
  120. 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
  121. A(mt+a)+B(nt+b)+C(pt+c)+D=0
  122. 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
  123. 再代入参数方程即得交点的坐标(x,y,z). */
  124. }else if(N.x ==0 ){ //z与pullPos相等
  125. var z = P.z;
  126. if(O.y == A.y){console.log('一样??');return;}
  127. if(A.y == y){console.log('一样2??');return;}
  128. if(A.z == z){console.log('一样3??');return;}
  129. var r = (O.z-z)/(A.z-z);
  130. var x = (r*A.x-O.x)/(r-1);
  131. var y = (r*A.y-O.y)/(r-1);
  132. }else if(N.z == 0){//x与pullPos相等
  133. var x = P.x;
  134. if(O.y == A.y){console.log('一样??');return;}
  135. if(A.y == y){console.log('一样2??');return;}
  136. if(A.x == x){console.log('一样3??');return;}
  137. var r = (O.x-x)/(A.x-x);
  138. var y = (r*A.y-O.y)/(r-1);
  139. var z = (r*A.z-O.z)/(r-1);
  140. }
  141. }
  142. return new THREE.Vector3(x,y,z);
  143. },
  144. getMouseIntersect : function(camera, meshes, mouse){//获取鼠标和meshes交点
  145. var raycaster = new THREE.Raycaster;
  146. camera.updateMatrixWorld();
  147. var origin = new THREE.Vector3(mouse.x,mouse.y,-1).unproject(camera)
  148. , end = new THREE.Vector3(mouse.x,mouse.y,1).unproject(camera);
  149. var dir = end.sub(origin).normalize()
  150. raycaster.set(origin, dir);
  151. var n = raycaster.intersectObjects(meshes);
  152. if (0 === n.length)
  153. return null;
  154. return n[0];
  155. },
  156. ifIntersectChunks : function(A,B,options={}){//获取某个线段/射线和meshes的交点
  157. var dir = B.clone().sub(A).normalize();
  158. var len = options.InfinityLen ? Infinity : A.distanceTo(B) + (options.extLen||0);
  159. var ray = new THREE.Raycaster(A.clone(), dir, 0, len);
  160. var o = ray.intersectObjects(options.model || player.model.colliders);
  161. if (o && o.length)return o;
  162. if(options.throughWidth){ //允许最小宽度,防止穿过极小的缝隙导致撞墙感
  163. var normal = math.getNormal({points:[{x:A.x, y:A.z},{x:B.x, y:B.z}]});//线段法线
  164. normal.multiplyScalar(options.throughWidth)
  165. var normalVec3 = new THREE.Vector3(normal.x, 0, normal.y);
  166. var A2 = A.clone().add(normalVec3)
  167. ray.set(A2, dir);
  168. var o2 = ray.intersectObjects(options.model || player.model.colliders);
  169. ray.set(A.clone().add(normalVec3.negate()), dir);
  170. if (o2 && o2.length)return o2;
  171. var o3 = ray.intersectObjects(options.model || player.model.colliders);
  172. if (o3 && o3.length)return o3;
  173. }
  174. return null;
  175. },
  176. getPosAtSphere : function(pos3d, toPanoPos){
  177. var dir = pos3d.clone().sub(toPanoPos);
  178. dir.normalize();//然后计算在球中
  179. dir.multiplyScalar(Constants.skyRadius);
  180. dir.add(toPanoPos);
  181. return dir;
  182. }
  183. }
  184. var dom = {
  185. getOffset: function(e, t, i) {
  186. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  187. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  188. left += "left" == e ? t.offsetLeft : t.offsetTop;
  189. return left
  190. }
  191. };
  192. if (function() {
  193. "use strict";
  194. function o(e, t) {
  195. return typeof e === t
  196. }
  197. function a(e, t) {
  198. return e instanceof t
  199. }
  200. function s(e) {
  201. return e && e.nodeType
  202. }
  203. function l(e) {
  204. return s(e) ? e : a(e, y) ? e[0] : void 0
  205. }
  206. function e(e, i, n) {
  207. return y.each(e, function(e, t) {
  208. n = i.call(t, n, e, t)
  209. }),
  210. n
  211. }
  212. function t(e, t, i) {
  213. var n, r, o;
  214. if (e === t)
  215. return !0;
  216. if (!e || !t || e.constructor !== t.constructor)
  217. return !1;
  218. for (n = 0,
  219. r = i.length; n < r; n += 1) {
  220. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  221. return !1;
  222. if (e[o] !== t[o])
  223. return !1
  224. }
  225. return !0
  226. }
  227. function c(e, t, i, n) {
  228. this.left = w(e),
  229. this.top = w(t),
  230. this.width = w(i),
  231. this.height = w(n),
  232. this.right = this.left + this.width,
  233. this.bottom = this.top + this.height
  234. }
  235. function h(e, t, i, n) {
  236. this.visible = e || 0,
  237. this.viewport = t || 0,
  238. this.possible = i || 0,
  239. this.rects = n && I({}, n) || null
  240. }
  241. function r(e, t) {
  242. this.els = e,
  243. this.viewport = t
  244. }
  245. function n(e, t) {
  246. return e.val - t.val
  247. }
  248. function u(e, t) {
  249. return t.val - e.val
  250. }
  251. function d(e) {
  252. var t = c.ofContent(e, !0)
  253. , i = c.ofViewport(e, !0)
  254. , n = t.width - i.width
  255. , r = t.height - i.height;
  256. this.content = t,
  257. this.viewport = i,
  258. this.width = n <= 0 ? null : i.left / n,
  259. this.height = r <= 0 ? null : i.top / r,
  260. this.left = i.left,
  261. this.top = i.top,
  262. this.right = t.right - i.right,
  263. this.bottom = t.bottom - i.bottom
  264. }
  265. function p(e) {
  266. this.el = e || window
  267. }
  268. function f(e, t) {
  269. this.context = e,
  270. this.viewport = t,
  271. this.init()
  272. }
  273. function g(e, t, i, n) {
  274. this.context = new r(e,t),
  275. this.property = i,
  276. this.descending = n,
  277. this.init()
  278. }
  279. function m(e) {
  280. e && e !== window && e !== document ? (this.context = e,
  281. this.$autoTarget = y(e)) : this.context = window,
  282. this.init()
  283. }
  284. 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 = {},
  285. v = 1,
  286. function(e) {
  287. return e ? (i[e] || (i[e] = v,
  288. v += 1),
  289. i[e]) : 0
  290. }
  291. );
  292. I(c.prototype, {
  293. equals: function(e) {
  294. return t(this, e, ["left", "top", "width", "height"])
  295. },
  296. area: function() {
  297. return this.width * this.height
  298. },
  299. relativeTo: function(e) {
  300. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  301. },
  302. intersection: function(e) {
  303. if (!a(e, c))
  304. return null;
  305. var t = _(this.left, e.left)
  306. , i = b(this.right, e.right)
  307. , n = _(this.top, e.top)
  308. , r = i - t
  309. , o = b(this.bottom, e.bottom) - n;
  310. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  311. },
  312. envelope: function(e) {
  313. if (!a(e, c))
  314. return this;
  315. var t = b(this.left, e.left)
  316. , i = _(this.right, e.right)
  317. , n = b(this.top, e.top);
  318. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  319. }
  320. }),
  321. I(c, {
  322. ofContent: function(e, t) {
  323. 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())
  324. },
  325. ofViewport: function(e, t) {
  326. 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())
  327. },
  328. ofElement: function(e) {
  329. var t = y(e);
  330. if (!t.is(":visible"))
  331. return null;
  332. var i = t.offset();
  333. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  334. }
  335. }),
  336. I(h.prototype, {
  337. equals: function(e) {
  338. return this.fracsEqual(e) && this.rectsEqual(e)
  339. },
  340. fracsEqual: function(e) {
  341. return t(this, e, ["visible", "viewport", "possible"])
  342. },
  343. rectsEqual: function(e) {
  344. return t(this.rects, e.rects, ["document", "element", "viewport"])
  345. }
  346. }),
  347. I(h, {
  348. of: function(e, t) {
  349. var i, n, r;
  350. return e = s(e) && c.ofElement(e) || e,
  351. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  352. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  353. r = b(e.width, t.width) * b(e.height, t.height),
  354. new h(n / e.area(),n / t.area(),n / r,{
  355. document: i,
  356. element: i.relativeTo(e),
  357. viewport: i.relativeTo(t)
  358. })) : new h
  359. }
  360. });
  361. var x = ["width", "height", "left", "right", "top", "bottom"]
  362. , S = ["possible", "visible", "viewport"];
  363. I(r.prototype, {
  364. sorted: function(t, e) {
  365. var i = this.viewport;
  366. return y.map(this.els, function(e) {
  367. return {
  368. el: e,
  369. val: function(e, t, i) {
  370. var n;
  371. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  372. n ? n[i] : 0
  373. }(e, i, t)
  374. }
  375. }).sort(e ? u : n)
  376. },
  377. best: function(e, t) {
  378. return this.els.length ? this.sorted(e, t)[0] : null
  379. }
  380. }),
  381. I(d.prototype, {
  382. equals: function(e) {
  383. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  384. }
  385. }),
  386. I(p.prototype, {
  387. equals: function(e) {
  388. return t(this, e, ["el"])
  389. },
  390. scrollState: function() {
  391. return new d(this.el)
  392. },
  393. scrollTo: function(e, t, i) {
  394. var n = y(this.el === window ? "html,body" : this.el);
  395. e = e || 0,
  396. t = t || 0,
  397. i = isNaN(i) ? 1e3 : i,
  398. n.stop(!0).animate({
  399. scrollLeft: e,
  400. scrollTop: t
  401. }, i)
  402. },
  403. scroll: function(e, t, i) {
  404. var n = this.el === window ? A : y(this.el);
  405. e = e || 0,
  406. t = t || 0,
  407. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  408. },
  409. scrollToRect: function(e, t, i, n) {
  410. t = t || 0,
  411. i = i || 0,
  412. this.scrollTo(e.left - t, e.top - i, n)
  413. },
  414. scrollToElement: function(e, t, i, n) {
  415. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  416. this.scrollToRect(r, t, i, n)
  417. }
  418. });
  419. var M = {
  420. init: function() {
  421. this.callbacks = y.Callbacks("memory unique"),
  422. this.currVal = null,
  423. this.prevVal = null,
  424. this.checkProxy = y.proxy(this.check, this),
  425. this.autoCheck()
  426. },
  427. bind: function(e) {
  428. this.callbacks.add(e)
  429. },
  430. unbind: function(e) {
  431. e ? this.callbacks.remove(e) : this.callbacks.empty()
  432. },
  433. trigger: function() {
  434. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  435. },
  436. check: function(e) {
  437. var t = this.updatedValue(e);
  438. return void 0 !== t && (this.prevVal = this.currVal,
  439. this.currVal = t,
  440. this.trigger(),
  441. !0)
  442. },
  443. $autoTarget: A,
  444. autoEvents: "load resize scroll",
  445. autoCheck: function(e) {
  446. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  447. }
  448. };
  449. I(f.prototype, M, {
  450. updatedValue: function() {
  451. var e = h.of(this.context, this.viewport);
  452. return this.currVal && this.currVal.equals(e) ? void 0 : e
  453. }
  454. }),
  455. I(g.prototype, M, {
  456. updatedValue: function() {
  457. var e = this.context.best(this.property, this.descending);
  458. return e && (e = 0 < e.val ? e.el : null,
  459. this.currVal !== e) ? e : void 0
  460. }
  461. }),
  462. I(m.prototype, M, {
  463. updatedValue: function() {
  464. var e = new d(this.context);
  465. return this.currVal && this.currVal.equals(e) ? void 0 : e
  466. }
  467. });
  468. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  469. function H(e, t, i, n) {
  470. return i = N(i) ? i.apply(e, t) : i,
  471. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  472. }
  473. R = U,
  474. P = {
  475. statics: {
  476. version: "0.15.0",
  477. Rect: c,
  478. Fractions: h,
  479. Group: r,
  480. ScrollState: d,
  481. Viewport: p,
  482. FracsCallbacks: f,
  483. GroupCallbacks: g,
  484. ScrollStateCallbacks: m,
  485. fracs: function(e, t) {
  486. return h.of(e, t)
  487. }
  488. },
  489. methods: {
  490. content: function(e) {
  491. return this.length ? c.ofContent(this[0], e) : null
  492. },
  493. envelope: function() {
  494. return e(this, function(e) {
  495. var t = c.ofElement(this);
  496. return e ? e.envelope(t) : t
  497. })
  498. },
  499. fracs: function(e, i, n) {
  500. o(e, "string") || (n = i,
  501. i = e,
  502. e = null),
  503. E(i) || (n = i,
  504. i = null),
  505. n = l(n);
  506. var r = U + ".fracs." + T(n);
  507. return "unbind" === e ? this.each(function() {
  508. var e = y(this).data(r);
  509. e && e.unbind(i)
  510. }) : "check" === e ? this.each(function() {
  511. var e = y(this).data(r);
  512. e && e.check()
  513. }) : E(i) ? this.each(function() {
  514. var e = y(this)
  515. , t = e.data(r);
  516. t || (t = new f(this,n),
  517. e.data(r, t)),
  518. t.bind(i)
  519. }) : this.length ? h.of(this[0], n) : null
  520. },
  521. intersection: function() {
  522. return e(this, function(e) {
  523. var t = c.ofElement(this);
  524. return e ? e.intersection(t) : t
  525. })
  526. },
  527. max: function(e, t, i) {
  528. return E(t) || (i = t,
  529. t = null),
  530. i = l(i),
  531. t ? (new g(this,i,e,!0).bind(t),
  532. this) : this.pushStack(new r(this,i).best(e, !0).el)
  533. },
  534. min: function(e, t, i) {
  535. return E(t) || (i = t,
  536. t = null),
  537. i = l(i),
  538. t ? (new g(this,i,e).bind(t),
  539. this) : this.pushStack(new r(this,i).best(e).el)
  540. },
  541. rect: function() {
  542. return this.length ? c.ofElement(this[0]) : null
  543. },
  544. scrollState: function(e, i) {
  545. var n = U + ".scrollState";
  546. return o(e, "string") || (i = e,
  547. e = null),
  548. "unbind" === e ? this.each(function() {
  549. var e = y(this).data(n);
  550. e && e.unbind(i)
  551. }) : "check" === e ? this.each(function() {
  552. var e = y(this).data(n);
  553. e && e.check()
  554. }) : E(i) ? this.each(function() {
  555. var e = y(this)
  556. , t = e.data(n);
  557. t || (t = new m(this),
  558. e.data(n, t)),
  559. t.bind(i)
  560. }) : this.length ? new d(this[0]) : null
  561. },
  562. scroll: function(e, t, i) {
  563. return this.each(function() {
  564. new p(this).scroll(e, t, i)
  565. })
  566. },
  567. scrollTo: function(e, t, i, n) {
  568. return y.isNumeric(e) && (n = i,
  569. i = t,
  570. t = e,
  571. e = null),
  572. e = l(e),
  573. this.each(function() {
  574. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  575. })
  576. },
  577. scrollToThis: function(e, t, i, n) {
  578. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  579. this
  580. },
  581. softLink: function(t, i, n, r) {
  582. return r = new p(l(r)),
  583. this.filter("a[href^=#]").each(function() {
  584. var e = y(this);
  585. e.on("click", function() {
  586. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  587. })
  588. })
  589. },
  590. sort: function(e, t, i) {
  591. return o(t, "boolean") || (i = t,
  592. t = null),
  593. i = l(i),
  594. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  595. return e.el
  596. }))
  597. },
  598. viewport: function(e) {
  599. return this.length ? c.ofViewport(this[0], e) : null
  600. }
  601. },
  602. defaultStatic: "fracs",
  603. defaultMethod: "fracs"
  604. },
  605. O = [].slice,
  606. L = jQuery,
  607. D = L.extend,
  608. N = L.isFunction,
  609. F = D({}, P),
  610. B = function() {
  611. return H(this, O.call(arguments), F.defaultStatic, B)
  612. }
  613. ,
  614. V = function(e) {
  615. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  616. }
  617. ,
  618. (k = function(e) {
  619. e && (D(B, e.statics),
  620. D(V, e.methods)),
  621. B.modplug = k
  622. }
  623. ).prev = {
  624. statics: L[R],
  625. methods: L.fn[R]
  626. },
  627. k(P),
  628. L[R] = B,
  629. L.fn[R] = V
  630. }(),
  631. "undefined" == typeof jQuery)
  632. throw new Error("Bootstrap's JavaScript requires jQuery");
  633. !function(m) {
  634. "use strict";
  635. function r(e, t) {
  636. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  637. this.init("tooltip", e, t)
  638. }
  639. r.VERSION = "3.2.0",
  640. r.DEFAULTS = {
  641. animation: !0,
  642. placement: "top",
  643. selector: !1,
  644. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  645. trigger: "hover focus",
  646. title: "",
  647. delay: 0,
  648. html: !1,
  649. container: !1,
  650. viewport: {
  651. selector: "body",
  652. padding: 0
  653. }
  654. },
  655. r.prototype.init = function(e, t, i) {
  656. this.enabled = !0,
  657. this.type = e,
  658. this.$element = m(t),
  659. this.options = this.getOptions(i),
  660. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  661. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  662. var o = n[r];
  663. if ("click" == o)
  664. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  665. else if ("manual" != o) {
  666. var a = "hover" == o ? "mouseenter" : "focusin"
  667. , s = "hover" == o ? "mouseleave" : "focusout";
  668. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  669. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  670. }
  671. }
  672. this.options.selector ? this._options = m.extend({}, this.options, {
  673. trigger: "manual",
  674. selector: ""
  675. }) : this.fixTitle()
  676. }
  677. ,
  678. r.prototype.getDefaults = function() {
  679. return r.DEFAULTS
  680. }
  681. ,
  682. r.prototype.getOptions = function(e) {
  683. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  684. show: e.delay,
  685. hide: e.delay
  686. }),
  687. e
  688. }
  689. ,
  690. r.prototype.getDelegateOptions = function() {
  691. var i = {}
  692. , n = this.getDefaults();
  693. return this._options && m.each(this._options, function(e, t) {
  694. n[e] != t && (i[e] = t)
  695. }),
  696. i
  697. }
  698. ,
  699. r.prototype.enter = function(e) {
  700. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  701. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  702. m(e.currentTarget).data("bs." + this.type, t)),
  703. clearTimeout(t.timeout),
  704. t.hoverState = "in",
  705. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  706. }
  707. ,
  708. r.prototype.leave = function(e) {
  709. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  710. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  711. m(e.currentTarget).data("bs." + this.type, t)),
  712. clearTimeout(t.timeout),
  713. t.hoverState = "out",
  714. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  715. "out" == t.hoverState && t.hide()
  716. }, t.options.delay.hide)) : t.hide()
  717. }
  718. ,
  719. r.prototype.show = function() {
  720. var e = m.Event("show.bs." + this.type);
  721. if (this.hasContent() && this.enabled) {
  722. this.$element.trigger(e);
  723. var t = m.contains(document.documentElement, this.$element[0]);
  724. if (e.isDefaultPrevented() || !t)
  725. return;
  726. var i = this
  727. , n = this.tip()
  728. , r = this.getUID(this.type);
  729. this.setContent(),
  730. n.attr("id", r),
  731. this.$element.attr("aria-describedby", r),
  732. this.options.animation && n.addClass("fade");
  733. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  734. , a = /\s?auto?\s?/i
  735. , s = a.test(o);
  736. s && (o = o.replace(a, "") || "top"),
  737. n.detach().css({
  738. top: 0,
  739. left: 0,
  740. display: "block"
  741. }).addClass(o).data("bs." + this.type, this),
  742. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  743. var l = this.getPosition()
  744. , c = n[0].offsetWidth
  745. , h = n[0].offsetHeight;
  746. if (s) {
  747. var u = o
  748. , d = this.$element.parent()
  749. , p = this.getPosition(d);
  750. 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,
  751. n.removeClass(u).addClass(o)
  752. }
  753. var f = this.getCalculatedOffset(o, l, c, h);
  754. this.applyPlacement(f, o);
  755. var g = function() {
  756. i.$element.trigger("shown.bs." + i.type),
  757. i.hoverState = null
  758. };
  759. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  760. }
  761. }
  762. ,
  763. r.prototype.applyPlacement = function(e, t) {
  764. var i = this.tip()
  765. , n = i[0].offsetWidth
  766. , r = i[0].offsetHeight
  767. , o = parseInt(i.css("margin-top"), 10)
  768. , a = parseInt(i.css("margin-left"), 10);
  769. isNaN(o) && (o = 0),
  770. isNaN(a) && (a = 0),
  771. e.top = e.top + o,
  772. e.left = e.left + a,
  773. m.offset.setOffset(i[0], m.extend({
  774. using: function(e) {
  775. i.css({
  776. top: Math.round(e.top),
  777. left: Math.round(e.left)
  778. })
  779. }
  780. }, e), 0),
  781. i.addClass("in");
  782. var s = i[0].offsetWidth
  783. , l = i[0].offsetHeight;
  784. "top" == t && l != r && (e.top = e.top + r - l);
  785. var c = this.getViewportAdjustedDelta(t, e, s, l);
  786. c.left ? e.left += c.left : e.top += c.top;
  787. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  788. , u = c.left ? "left" : "top"
  789. , d = c.left ? "offsetWidth" : "offsetHeight";
  790. i.offset(e),
  791. this.replaceArrow(h, i[0][d], u)
  792. }
  793. ,
  794. r.prototype.replaceArrow = function(e, t, i) {
  795. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  796. }
  797. ,
  798. r.prototype.setContent = function() {
  799. var e = this.tip()
  800. , t = this.getTitle();
  801. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  802. e.removeClass("fade in top bottom left right")
  803. }
  804. ,
  805. r.prototype.hide = function() {
  806. function e() {
  807. "in" != t.hoverState && i.detach(),
  808. t.$element.trigger("hidden.bs." + t.type)
  809. }
  810. var t = this
  811. , i = this.tip()
  812. , n = m.Event("hide.bs." + this.type);
  813. if (this.$element.removeAttr("aria-describedby"),
  814. this.$element.trigger(n),
  815. !n.isDefaultPrevented())
  816. return i.removeClass("in"),
  817. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  818. this.hoverState = null,
  819. this
  820. }
  821. ,
  822. r.prototype.fixTitle = function() {
  823. var e = this.$element;
  824. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  825. }
  826. ,
  827. r.prototype.hasContent = function() {
  828. return this.getTitle()
  829. }
  830. ,
  831. r.prototype.getPosition = function(e) {
  832. var t = (e = e || this.$element)[0]
  833. , i = "BODY" == t.tagName;
  834. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  835. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  836. width: i ? m(window).width() : e.outerWidth(),
  837. height: i ? m(window).height() : e.outerHeight()
  838. }, i ? {
  839. top: 0,
  840. left: 0
  841. } : e.offset())
  842. }
  843. ,
  844. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  845. return "bottom" == e ? {
  846. top: t.top + t.height,
  847. left: t.left + t.width / 2 - i / 2
  848. } : "top" == e ? {
  849. top: t.top - n,
  850. left: t.left + t.width / 2 - i / 2
  851. } : "left" == e ? {
  852. top: t.top + t.height / 2 - n / 2,
  853. left: t.left - i
  854. } : {
  855. top: t.top + t.height / 2 - n / 2,
  856. left: t.left + t.width
  857. }
  858. }
  859. ,
  860. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  861. var r = {
  862. top: 0,
  863. left: 0
  864. };
  865. if (!this.$viewport)
  866. return r;
  867. var o = this.options.viewport && this.options.viewport.padding || 0
  868. , a = this.getPosition(this.$viewport);
  869. if (/right|left/.test(e)) {
  870. var s = t.top - o - a.scroll
  871. , l = t.top + o - a.scroll + n;
  872. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  873. } else {
  874. var c = t.left - o
  875. , h = t.left + o + i;
  876. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  877. }
  878. return r
  879. }
  880. ,
  881. r.prototype.getTitle = function() {
  882. var e = this.$element
  883. , t = this.options;
  884. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  885. }
  886. ,
  887. r.prototype.getUID = function(e) {
  888. for (; e += ~~(1e6 * Math.random()),
  889. document.getElementById(e); )
  890. ;
  891. return e
  892. }
  893. ,
  894. r.prototype.tip = function() {
  895. return this.$tip = this.$tip || m(this.options.template)
  896. }
  897. ,
  898. r.prototype.arrow = function() {
  899. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  900. }
  901. ,
  902. r.prototype.validate = function() {
  903. this.$element[0].parentNode || (this.hide(),
  904. this.$element = null,
  905. this.options = null)
  906. }
  907. ,
  908. r.prototype.enable = function() {
  909. this.enabled = !0
  910. }
  911. ,
  912. r.prototype.disable = function() {
  913. this.enabled = !1
  914. }
  915. ,
  916. r.prototype.toggleEnabled = function() {
  917. this.enabled = !this.enabled
  918. }
  919. ,
  920. r.prototype.toggle = function(e) {
  921. var t = this;
  922. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  923. m(e.currentTarget).data("bs." + this.type, t))),
  924. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  925. }
  926. ,
  927. r.prototype.destroy = function() {
  928. clearTimeout(this.timeout),
  929. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  930. }
  931. ;
  932. var e = m.fn.tooltip;
  933. m.fn.tooltip = function(n) {
  934. return this.each(function() {
  935. var e = m(this)
  936. , t = e.data("bs.tooltip")
  937. , i = "object" == typeof n && n;
  938. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  939. "string" == typeof n && t[n]())
  940. })
  941. }
  942. ,
  943. m.fn.tooltip.Constructor = r,
  944. m.fn.tooltip.noConflict = function() {
  945. return m.fn.tooltip = e,
  946. this
  947. }
  948. }(jQuery),
  949. function(e, t, i) {
  950. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  951. }(0, this, function() {
  952. "use strict";
  953. function Keen() {
  954. return _init.apply(this, arguments)
  955. }
  956. function _init(e) {
  957. if (_isUndefined(e))
  958. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  959. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  960. throw new Error("Please provide a projectId");
  961. this.configure(e)
  962. }
  963. function _extend(e) {
  964. for (var t = 1; t < arguments.length; t++)
  965. for (var i in arguments[t])
  966. e[i] = arguments[t][i];
  967. return e
  968. }
  969. function _isUndefined(e) {
  970. return void 0 === e
  971. }
  972. function _type(e) {
  973. var t = e && e.constructor ? e.constructor.toString() : void 0;
  974. return t ? t.match(/function (.*)\(/)[1] : "Null"
  975. }
  976. function _each(e, t, i) {
  977. var n;
  978. if (!e)
  979. return 0;
  980. if (i = i || e,
  981. "array" === _type(e)) {
  982. for (n = 0; n < e.length; n++)
  983. if (!1 === t.call(i, e[n], n, e))
  984. return 0
  985. } else
  986. for (n in e)
  987. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  988. return 0;
  989. return 1
  990. }
  991. function _parse_params(e) {
  992. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  993. return decodeURIComponent(e.replace(n, " "))
  994. }, a = e.split("?")[1]; t = r.exec(a); )
  995. i[o(t[1])] = o(t[2]);
  996. return i
  997. }
  998. function _set_protocol(e) {
  999. switch (e) {
  1000. case "http":
  1001. return "http";
  1002. case "auto":
  1003. return location.protocol.replace(/:/g, "");
  1004. case "https":
  1005. case void 0:
  1006. default:
  1007. return "https"
  1008. }
  1009. }
  1010. function _set_request_type(e) {
  1011. var t = e || "jsonp"
  1012. , i = !1;
  1013. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  1014. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  1015. }
  1016. function _build_url(e) {
  1017. return this.client.endpoint + "/projects/" + this.client.projectId + e
  1018. }
  1019. function _uploadEvent(e, t, i, n, r) {
  1020. var o = _build_url.apply(this, ["/events/" + e])
  1021. , a = {};
  1022. for (var s in i = !1 !== i,
  1023. this.client.globalProperties && (a = this.client.globalProperties(e)),
  1024. t)
  1025. t.hasOwnProperty(s) && (a[s] = t[s]);
  1026. switch (this.client.requestType) {
  1027. case "xhr":
  1028. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  1029. break;
  1030. case "jsonp":
  1031. var l = JSON.stringify(a)
  1032. , c = Keen.Base64.encode(l);
  1033. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  1034. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  1035. break;
  1036. case "beacon":
  1037. l = JSON.stringify(a),
  1038. c = Keen.Base64.encode(l);
  1039. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  1040. o += "&c=clv1",
  1041. _request.beacon.apply(this, [o, null, n, r])
  1042. }
  1043. }
  1044. Keen.prototype.configure = function(e) {
  1045. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  1046. e.protocol = _set_protocol(e.protocol),
  1047. e.requestType = _set_request_type(e.requestType),
  1048. this.client = {
  1049. projectId: e.projectId,
  1050. writeKey: e.writeKey,
  1051. readKey: e.readKey,
  1052. globalProperties: null,
  1053. endpoint: e.protocol + "://" + e.host,
  1054. requestType: e.requestType
  1055. },
  1056. Keen.trigger("client", this, e),
  1057. this.trigger("ready"),
  1058. this
  1059. }
  1060. ;
  1061. var _request = {
  1062. xhr: function(e, t, i, n, r, o, a, s) {
  1063. if (!r)
  1064. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1065. var l = new XMLHttpRequest;
  1066. if (l.onreadystatechange = function() {
  1067. if (4 == l.readyState)
  1068. if (200 <= l.status && l.status < 300) {
  1069. var e;
  1070. try {
  1071. e = JSON.parse(l.responseText)
  1072. } catch (e) {
  1073. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  1074. s && s(l, e)
  1075. }
  1076. a && e && a(e)
  1077. } else
  1078. Keen.log("HTTP request failed."),
  1079. s && s(l, null)
  1080. }
  1081. ,
  1082. l.open(e, t, o),
  1083. r && l.setRequestHeader("Authorization", r),
  1084. n && l.setRequestHeader("Content-Type", "application/json"),
  1085. i)
  1086. for (var c in i)
  1087. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  1088. var h = n ? JSON.stringify(n) : null;
  1089. l.send(h)
  1090. },
  1091. jsonp: function(e, t, i, n) {
  1092. if (!t)
  1093. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1094. if (t && e.indexOf("api_key") < 0) {
  1095. var r = 0 < e.indexOf("?") ? "&" : "?";
  1096. e = e + r + "api_key=" + t
  1097. }
  1098. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  1099. o += "a";
  1100. var a = !1;
  1101. window[o] = function(e) {
  1102. a = !0,
  1103. i && e && i(e),
  1104. window[o] = void 0
  1105. }
  1106. ,
  1107. e = e + "&jsonp=" + o;
  1108. var s = document.createElement("script");
  1109. s.id = "keen-jsonp",
  1110. s.src = e,
  1111. document.getElementsByTagName("head")[0].appendChild(s),
  1112. s.onreadystatechange = function() {
  1113. !1 === a && "loaded" === this.readyState && (a = !0,
  1114. n && n())
  1115. }
  1116. ,
  1117. s.onerror = function() {
  1118. !1 === a && (a = !0,
  1119. n && n())
  1120. }
  1121. },
  1122. beacon: function(e, t, i, n) {
  1123. if (t && e.indexOf("api_key") < 0) {
  1124. var r = 0 < e.indexOf("?") ? "&" : "?";
  1125. e = e + r + "api_key=" + t
  1126. }
  1127. var o = document.createElement("img");
  1128. o.onload = function() {
  1129. if (!0,
  1130. "naturalHeight"in this) {
  1131. if (this.naturalHeight + this.naturalWidth === 0)
  1132. return void this.onerror()
  1133. } else if (this.width + this.height === 0)
  1134. return void this.onerror();
  1135. i && i({
  1136. created: !0
  1137. })
  1138. }
  1139. ,
  1140. o.onerror = function() {
  1141. !0,
  1142. n && n()
  1143. }
  1144. ,
  1145. o.src = e
  1146. }
  1147. }
  1148. , Events = Keen.Events = {
  1149. on: function(e, t) {
  1150. return this.listeners || (this.listeners = {}),
  1151. (this.listeners[e] || (this.listeners[e] = [])).push({
  1152. callback: t
  1153. }),
  1154. this
  1155. },
  1156. off: function(e, t) {
  1157. if (!e && !t)
  1158. return this.listeners = void 0,
  1159. delete this.listeners,
  1160. this;
  1161. for (var i = this.listeners[e] || [], n = i.length; n--; )
  1162. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  1163. t && 0 != i.length || (this.listeners[e] = void 0,
  1164. delete this.listeners[e]);
  1165. return this
  1166. },
  1167. trigger: function(e) {
  1168. if (!this.listeners)
  1169. return this;
  1170. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  1171. i[n].callback.apply(this, t);
  1172. return this
  1173. }
  1174. };
  1175. _extend(Keen.prototype, Events),
  1176. _extend(Keen, Events),
  1177. Keen.loaded = !0,
  1178. Keen.utils = {
  1179. each: _each,
  1180. extend: _extend,
  1181. parseParams: _parse_params
  1182. },
  1183. Keen.ready = function(e) {
  1184. Keen.loaded ? e() : Keen.on("ready", e)
  1185. }
  1186. ,
  1187. Keen.log = function(e) {
  1188. "object" == typeof console && console.log("[Keen IO]", e)
  1189. }
  1190. ;
  1191. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1192. Keen.prototype.addEvent = function() {
  1193. _uploadEvent.apply(this, arguments)
  1194. }
  1195. ,
  1196. Keen.prototype.addEventSync = function(e, t, i, n) {
  1197. _uploadEvent.apply(this, [e, t, !1, i, n])
  1198. }
  1199. ,
  1200. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1201. var o = e
  1202. , a = o.metaKey
  1203. , s = o.target
  1204. , l = !1
  1205. , c = function() {};
  1206. return void 0 === n && (n = 500),
  1207. "A" === s.nodeName ? c = function() {
  1208. a || l || (l = !0,
  1209. window.location = s.href)
  1210. }
  1211. : "FORM" === s.nodeName && (c = function() {
  1212. l || (l = !0,
  1213. s.submit())
  1214. }
  1215. ),
  1216. r && (c = function() {
  1217. l || (l = !0,
  1218. r())
  1219. }
  1220. ),
  1221. _uploadEvent.call(this, t, i, c, c),
  1222. setTimeout(function() {
  1223. c()
  1224. }, n),
  1225. !!a && void 0
  1226. }
  1227. ,
  1228. Keen.prototype.setGlobalProperties = function(e) {
  1229. if (!this.client)
  1230. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1231. if (!e || "function" != typeof e)
  1232. throw new Error("Invalid value for global properties: " + e);
  1233. this.client.globalProperties = e
  1234. }
  1235. ,
  1236. Keen.Base64 = {
  1237. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1238. encode: function(e) {
  1239. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1240. for (e = this.utf8.encode(e); c < e.length; )
  1241. t = e.charCodeAt(c++),
  1242. i = e.charCodeAt(c++),
  1243. n = e.charCodeAt(c++),
  1244. r = t >> 2,
  1245. o = (3 & t) << 4 | i >> 4,
  1246. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1247. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1248. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1249. return l
  1250. },
  1251. decode: function(e) {
  1252. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1253. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1254. t = c.indexOf(e.charAt(l++)),
  1255. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1256. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1257. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1258. return this.utf8.decode(s)
  1259. },
  1260. utf8: {
  1261. encode: function(e) {
  1262. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1263. 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);
  1264. return i
  1265. },
  1266. decode: function(e) {
  1267. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1268. 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];
  1269. return i
  1270. }
  1271. }
  1272. },
  1273. "object" != typeof JSON && (JSON = {}),
  1274. function() {
  1275. function f(e) {
  1276. return e < 10 ? "0" + e : e
  1277. }
  1278. function quote(e) {
  1279. return escapable.lastIndex = 0,
  1280. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1281. var t = meta[e];
  1282. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1283. }) + '"' : '"' + e + '"'
  1284. }
  1285. function str(e, t) {
  1286. var i, n, r, o, a, s = gap, l = t[e];
  1287. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1288. "function" == typeof rep && (l = rep.call(t, e, l)),
  1289. typeof l) {
  1290. case "string":
  1291. return quote(l);
  1292. case "number":
  1293. return isFinite(l) ? String(l) : "null";
  1294. case "boolean":
  1295. case "null":
  1296. return String(l);
  1297. case "object":
  1298. if (!l)
  1299. return "null";
  1300. if (gap += indent,
  1301. a = [],
  1302. "[object Array]" === Object.prototype.toString.apply(l)) {
  1303. for (o = l.length,
  1304. i = 0; i < o; i += 1)
  1305. a[i] = str(i, l) || "null";
  1306. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1307. gap = s,
  1308. r
  1309. }
  1310. if (rep && "object" == typeof rep)
  1311. for (o = rep.length,
  1312. i = 0; i < o; i += 1)
  1313. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1314. else
  1315. for (n in l)
  1316. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1317. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1318. gap = s,
  1319. r
  1320. }
  1321. }
  1322. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1323. 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
  1324. }
  1325. ,
  1326. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1327. return this.valueOf()
  1328. }
  1329. );
  1330. 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 = {
  1331. "\b": "\\b",
  1332. "\t": "\\t",
  1333. "\n": "\\n",
  1334. "\f": "\\f",
  1335. "\r": "\\r",
  1336. '"': '\\"',
  1337. "\\": "\\\\"
  1338. }, rep;
  1339. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1340. var n;
  1341. if (indent = gap = "",
  1342. "number" == typeof i)
  1343. for (n = 0; n < i; n += 1)
  1344. indent += " ";
  1345. else
  1346. "string" == typeof i && (indent = i);
  1347. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1348. throw new Error("JSON.stringify");
  1349. return str("", {
  1350. "": e
  1351. })
  1352. }
  1353. ),
  1354. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1355. function walk(e, t) {
  1356. var i, n, r = e[t];
  1357. if (r && "object" == typeof r)
  1358. for (i in r)
  1359. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1360. return reviver.call(e, t, r)
  1361. }
  1362. var j;
  1363. if (text = String(text),
  1364. cx.lastIndex = 0,
  1365. cx.test(text) && (text = text.replace(cx, function(e) {
  1366. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1367. })),
  1368. /^[\],:{}\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, "")))
  1369. return j = eval("(" + text + ")"),
  1370. "function" == typeof reviver ? walk({
  1371. "": j
  1372. }, "") : j;
  1373. throw new SyntaxError("JSON.parse")
  1374. }
  1375. )
  1376. }(),
  1377. Hh = Keen.utils,
  1378. Ih = function(i) {
  1379. function e(e) {
  1380. for (u = 1; e = n.shift(); )
  1381. e()
  1382. }
  1383. 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]);
  1384. return r[l] && r[l](s, t = function() {
  1385. r.removeEventListener(s, t, !1),
  1386. e()
  1387. }
  1388. , !1),
  1389. a && r.attachEvent(c, t = function() {
  1390. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1391. e())
  1392. }
  1393. ),
  1394. i = a ? function(t) {
  1395. self != top ? u ? t() : n.push(t) : function() {
  1396. try {
  1397. o.doScroll("left")
  1398. } catch (e) {
  1399. return setTimeout(function() {
  1400. i(t)
  1401. }, 50)
  1402. }
  1403. t()
  1404. }()
  1405. }
  1406. : function(e) {
  1407. u ? e() : n.push(e)
  1408. }
  1409. }
  1410. ,
  1411. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1412. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1413. if (loaded && cached) {
  1414. for (var instance in clients = cached.clients || {},
  1415. ready = cached.ready || [],
  1416. clients)
  1417. if (clients.hasOwnProperty(instance)) {
  1418. var client = clients[instance];
  1419. for (var method in Keen.prototype)
  1420. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1421. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1422. ,
  1423. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1424. ,
  1425. client._config && (client.configure.call(client, client._config),
  1426. delete client._config),
  1427. client._setGlobalProperties) {
  1428. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1429. client.setGlobalProperties.apply(client, globals[i]);
  1430. delete client._setGlobalProperties
  1431. }
  1432. if (client._addEvent) {
  1433. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1434. client.addEvent.apply(client, queue[i]);
  1435. delete client._addEvent
  1436. }
  1437. var callback = client._on || [];
  1438. if (client._on) {
  1439. for (var i = 0; i < callback.length; i++)
  1440. client.on.apply(client, callback[i]);
  1441. client.trigger("ready"),
  1442. delete client._on
  1443. }
  1444. }
  1445. for (var i = 0; i < ready.length; i++) {
  1446. var callback = ready[i];
  1447. Keen.on("ready", function() {
  1448. callback()
  1449. })
  1450. }
  1451. }
  1452. return Keen.loaded && setTimeout(function() {
  1453. Keen.utils.domready(function() {
  1454. Keen.trigger("ready")
  1455. })
  1456. }, 0),
  1457. Keen
  1458. }),
  1459. function() {
  1460. var i = window.analytics = window.analytics || [];
  1461. if (!i.initialize) {
  1462. if (i.invoked)
  1463. return window.console && console.error && console.error("Segment snippet included twice.");
  1464. i.invoked = !0,
  1465. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1466. i.factory = function(t) {
  1467. return function() {
  1468. var e = Array.prototype.slice.call(arguments);
  1469. return e.unshift(t),
  1470. i.push(e),
  1471. i
  1472. }
  1473. }
  1474. ;
  1475. for (var e = 0; e < i.methods.length; e++) {
  1476. var t = i.methods[e];
  1477. i[t] = i.factory(t)
  1478. }
  1479. i.load = function(e) {
  1480. var t = document.createElement("script");
  1481. t.type = "text/javascript",
  1482. t.async = !0,
  1483. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1484. var i = document.getElementsByTagName("script")[0];
  1485. i.parentNode.insertBefore(t, i)
  1486. }
  1487. ,
  1488. i.SNIPPET_VERSION = "4.0.0"
  1489. }
  1490. }(),
  1491. function(i, u) {
  1492. "use strict";
  1493. var d = "function"
  1494. , p = "undefined"
  1495. , f = "object"
  1496. , e = "major"
  1497. , t = "model"
  1498. , n = "name"
  1499. , r = "type"
  1500. , o = "vendor"
  1501. , a = "version"
  1502. , s = "architecture"
  1503. , l = "console"
  1504. , c = "mobile"
  1505. , h = "tablet"
  1506. , g = {
  1507. has: function(e, t) {
  1508. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1509. },
  1510. lowerize: function(e) {
  1511. return e.toLowerCase()
  1512. }
  1513. }
  1514. , m = {
  1515. rgx: function() {
  1516. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1517. var c = l[s]
  1518. , h = l[s + 1];
  1519. if (typeof e == p)
  1520. for (n in e = {},
  1521. h)
  1522. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1523. for (t = i = 0; t < c.length; t++)
  1524. if (o = c[t].exec(this.getUA())) {
  1525. for (n = 0; n < h.length; n++)
  1526. a = o[++i],
  1527. 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;
  1528. break
  1529. }
  1530. if (o)
  1531. break
  1532. }
  1533. return e
  1534. },
  1535. str: function(e, t) {
  1536. for (var i in t)
  1537. if (typeof t[i] == f && 0 < t[i].length) {
  1538. for (var n = 0; n < t[i].length; n++)
  1539. if (g.has(t[i][n], e))
  1540. return "?" === i ? u : i
  1541. } else if (g.has(t[i], e))
  1542. return "?" === i ? u : i;
  1543. return e
  1544. }
  1545. }
  1546. , v = {
  1547. browser: {
  1548. oldsafari: {
  1549. major: {
  1550. 1: ["/8", "/1", "/3"],
  1551. 2: "/4",
  1552. "?": "/"
  1553. },
  1554. version: {
  1555. "1.0": "/8",
  1556. 1.2: "/1",
  1557. 1.3: "/3",
  1558. "2.0": "/412",
  1559. "2.0.2": "/416",
  1560. "2.0.3": "/417",
  1561. "2.0.4": "/419",
  1562. "?": "/"
  1563. }
  1564. }
  1565. },
  1566. device: {
  1567. sprint: {
  1568. model: {
  1569. "Evo Shift 4G": "7373KT"
  1570. },
  1571. vendor: {
  1572. HTC: "APA",
  1573. Sprint: "Sprint"
  1574. }
  1575. }
  1576. },
  1577. os: {
  1578. windows: {
  1579. version: {
  1580. ME: "4.90",
  1581. "NT 3.11": "NT3.51",
  1582. "NT 4.0": "NT4.0",
  1583. 2e3: "NT 5.0",
  1584. XP: ["NT 5.1", "NT 5.2"],
  1585. Vista: "NT 6.0",
  1586. 7: "NT 6.1",
  1587. 8: "NT 6.2",
  1588. 8.1: "NT 6.3",
  1589. RT: "ARM"
  1590. }
  1591. }
  1592. }
  1593. }
  1594. , y = {
  1595. 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]],
  1596. 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]],
  1597. 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]],
  1598. 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]],
  1599. 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]]
  1600. }
  1601. , A = function(e) {
  1602. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1603. return this instanceof A ? (this.getBrowser = function() {
  1604. return m.rgx.apply(this, y.browser)
  1605. }
  1606. ,
  1607. this.getCPU = function() {
  1608. return m.rgx.apply(this, y.cpu)
  1609. }
  1610. ,
  1611. this.getDevice = function() {
  1612. return m.rgx.apply(this, y.device)
  1613. }
  1614. ,
  1615. this.getEngine = function() {
  1616. return m.rgx.apply(this, y.engine)
  1617. }
  1618. ,
  1619. this.getOS = function() {
  1620. return m.rgx.apply(this, y.os)
  1621. }
  1622. ,
  1623. this.getResult = function() {
  1624. return {
  1625. ua: this.getUA(),
  1626. browser: this.getBrowser(),
  1627. engine: this.getEngine(),
  1628. os: this.getOS(),
  1629. device: this.getDevice(),
  1630. cpu: this.getCPU()
  1631. }
  1632. }
  1633. ,
  1634. this.getUA = function() {
  1635. return t
  1636. }
  1637. ,
  1638. this.setUA = function(e) {
  1639. return t = e,
  1640. this
  1641. }
  1642. ,
  1643. void this.setUA(t)) : new A(e).getResult()
  1644. };
  1645. if (typeof exports != p)
  1646. typeof module != p && module.exports && (exports = module.exports = A),
  1647. exports.UAParser = A;
  1648. else if (i.UAParser = A,
  1649. typeof define == d && define.amd && define(function() {
  1650. return A
  1651. }),
  1652. typeof i.jQuery != p) {
  1653. var C = i.jQuery
  1654. , I = new A;
  1655. C.ua = I.getResult(),
  1656. C.ua.get = function() {
  1657. return I.getUA()
  1658. }
  1659. ,
  1660. C.ua.set = function(e) {
  1661. I.setUA(e);
  1662. var t = I.getResult();
  1663. for (var i in t)
  1664. C.ua[i] = t[i]
  1665. }
  1666. }
  1667. }(this),
  1668. window.Modernizr = function(e, t) {
  1669. function i(e, t) {
  1670. return typeof e === t
  1671. }
  1672. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1673. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1674. return t in e && i(e.constructor.prototype[t], "undefined")
  1675. }
  1676. : function(e, t) {
  1677. return p.call(e, t)
  1678. }
  1679. ,
  1680. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1681. var r = this;
  1682. if ("function" != typeof r)
  1683. throw new TypeError;
  1684. var o = d.call(arguments, 1)
  1685. , a = function() {
  1686. if (this instanceof a) {
  1687. function e() {}
  1688. e.prototype = r.prototype;
  1689. var t = new e
  1690. , i = r.apply(t, o.concat(d.call(arguments)));
  1691. return Object(i) === i ? i : t
  1692. }
  1693. return r.apply(n, o.concat(d.call(arguments)))
  1694. };
  1695. return a
  1696. }
  1697. ),
  1698. h.webgl = function() {
  1699. return !!e.WebGLRenderingContext
  1700. }
  1701. ,
  1702. h)
  1703. r(h, f) && (n = f.toLowerCase(),
  1704. a[n] = h[f](),
  1705. u.push((a[n] ? "" : "no-") + n));
  1706. return a.addTest = function(e, t) {
  1707. if ("object" == typeof e)
  1708. for (var i in e)
  1709. r(e, i) && a.addTest(i, e[i]);
  1710. else {
  1711. if (e = e.toLowerCase(),
  1712. void 0 !== a[e])
  1713. return a;
  1714. t = "function" == typeof t ? t() : t,
  1715. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1716. a[e] = t
  1717. }
  1718. return a
  1719. }
  1720. ,
  1721. o = "",
  1722. c.cssText = o,
  1723. l = null,
  1724. a._version = "2.8.2",
  1725. a
  1726. }(this, this.document),
  1727. function(xe, e, Se) {
  1728. "use strict";
  1729. function Me(s, e, n) {
  1730. function a(e) {
  1731. var t = Q.length;
  1732. if (G.old = xe.extend({}, G),
  1733. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1734. Y = W[F.horizontal ? "width" : "height"](),
  1735. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1736. Q.length = 0,
  1737. G.start = 0,
  1738. G.end = nt(z - H, 0),
  1739. le) {
  1740. $.length,
  1741. J = U.children(F.itemSelector),
  1742. $.length = 0;
  1743. 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;
  1744. z = 0,
  1745. J.each(function(e, t) {
  1746. var i = xe(t)
  1747. , n = t.getBoundingClientRect()
  1748. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1749. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1750. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1751. , s = r + o + a
  1752. , l = !o || !a
  1753. , c = {};
  1754. c.el = t,
  1755. c.size = l ? r : s,
  1756. c.half = c.size / 2,
  1757. c.start = z + (l ? o : 0),
  1758. c.center = c.start - it(H / 2 - c.size / 2),
  1759. c.end = c.start - H + c.size,
  1760. e || (z += u),
  1761. z += s,
  1762. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1763. e === g && (c.end += d,
  1764. z += d,
  1765. f = l ? a : 0),
  1766. $.push(c),
  1767. h = c
  1768. }),
  1769. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1770. z -= f,
  1771. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1772. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1773. }
  1774. if (G.center = it(G.end / 2 + G.start / 2),
  1775. v(),
  1776. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1777. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1778. X.end = Y - q,
  1779. _e || c()),
  1780. !V && 0 < H) {
  1781. var n = G.start
  1782. , r = "";
  1783. if (le)
  1784. xe.each($, function(e, t) {
  1785. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1786. Q.push(n),
  1787. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1788. });
  1789. else
  1790. for (; n - H < G.end; )
  1791. Q.push(n),
  1792. n += H;
  1793. if (Z[0] && t !== Q.length) {
  1794. for (var o = 0; o < Q.length; o++)
  1795. r += F.pageBuilder.call(B, o);
  1796. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1797. }
  1798. }
  1799. if (ee.slideeSize = z,
  1800. ee.frameSize = H,
  1801. ee.sbSize = Y,
  1802. ee.handleSize = q,
  1803. le) {
  1804. e && null != F.startAt && (m(F.startAt),
  1805. B[se ? "toCenter" : "toStart"](F.startAt));
  1806. var a = $[ee.activeItem];
  1807. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1808. } else
  1809. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1810. L("load")
  1811. }
  1812. function l(e, t, i) {
  1813. if (le && Ie.released && !i) {
  1814. var n = d(e)
  1815. , r = e > G.start && e < G.end;
  1816. se ? (r && (e = $[n.centerItem].center),
  1817. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1818. }
  1819. 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),
  1820. Ae.start = +new Date,
  1821. Ae.time = 0,
  1822. Ae.from = G.cur,
  1823. Ae.to = e,
  1824. Ae.delta = e - G.cur,
  1825. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1826. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1827. Ie.tweese = 0,
  1828. e !== G.dest && (G.dest = e,
  1829. L("change"),
  1830. _e || o()),
  1831. g(),
  1832. v(),
  1833. p(),
  1834. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1835. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1836. L("activePage", ye.page))
  1837. }
  1838. function o() {
  1839. if (B.initialized) {
  1840. if (!_e)
  1841. return _e = Ge(o),
  1842. void (Ie.released && L("moveStart"));
  1843. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1844. $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),
  1845. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1846. Ae.to === G.cur ? (G.cur = Ae.to,
  1847. Ie.tweese = _e = 0) : _e = Ge(o),
  1848. L("move"),
  1849. 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"),
  1850. !_e && Ie.released && L("moveEnd"),
  1851. c()
  1852. }
  1853. }
  1854. function c() {
  1855. 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,
  1856. X.cur = Fe(it(X.cur), X.start, X.end),
  1857. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1858. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1859. }
  1860. function t() {
  1861. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1862. Te = Ie.init ? Ge(t) : 0,
  1863. Ce.now = +new Date,
  1864. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1865. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1866. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1867. Ce.lastTime = Ce.now
  1868. }
  1869. function i(e, t, i) {
  1870. if ("boolean" === Re(t) && (i = t,
  1871. t = Se),
  1872. t === Se)
  1873. l(G[e], i);
  1874. else {
  1875. if (se && "center" !== e)
  1876. return;
  1877. var n = B.getPos(t);
  1878. n && l(n[e], i, !se)
  1879. }
  1880. }
  1881. function h(e) {
  1882. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1883. }
  1884. function u(e) {
  1885. return h(De(e) && e < 0 ? e + $.length : e)
  1886. }
  1887. function m(e, t) {
  1888. var i = h(e);
  1889. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1890. J.eq(i).addClass(F.activeClass),
  1891. ye.active = ee.activeItem = i,
  1892. p(),
  1893. L("active", i)),
  1894. i)
  1895. }
  1896. function d(e) {
  1897. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1898. var t = {}
  1899. , i = ae ? 0 : H / 2;
  1900. if (!V)
  1901. for (var n = 0, r = Q.length; n < r; n++) {
  1902. if (e >= G.end || n === Q.length - 1) {
  1903. t.activePage = Q.length - 1;
  1904. break
  1905. }
  1906. if (e <= Q[n] + i) {
  1907. t.activePage = n;
  1908. break
  1909. }
  1910. }
  1911. if (le) {
  1912. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1913. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1914. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1915. l === c - 1 || e <= $[l].end + $[l].half) {
  1916. a = l;
  1917. break
  1918. }
  1919. t.firstItem = De(o) ? o : 0,
  1920. t.centerItem = De(s) ? s : t.firstItem,
  1921. t.lastItem = De(a) ? a : t.centerItem
  1922. }
  1923. return t
  1924. }
  1925. function v(e) {
  1926. xe.extend(ee, d(e))
  1927. }
  1928. function p() {
  1929. var e = G.dest <= G.start
  1930. , t = G.dest >= G.end
  1931. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1932. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1933. ge.is("button,input") && ge.prop("disabled", e),
  1934. me.is("button,input") && me.prop("disabled", t),
  1935. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1936. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1937. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1938. de.is("button,input") && de.prop("disabled", e),
  1939. ue.is("button,input") && ue.prop("disabled", t)),
  1940. le && null != ee.activeItem) {
  1941. var n = 0 === ee.activeItem
  1942. , r = ee.activeItem >= $.length - 1
  1943. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1944. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1945. pe.is("button,input") && pe.prop("disabled", n),
  1946. fe.is("button,input") && fe.prop("disabled", r),
  1947. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1948. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1949. }
  1950. }
  1951. function r(e, t, i) {
  1952. if (e = u(e),
  1953. t = u(t),
  1954. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1955. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1956. var n = e < t ? e : i ? t : t - 1
  1957. , r = t < e ? e : i ? t + 1 : t
  1958. , o = t < e;
  1959. 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)),
  1960. a()
  1961. }
  1962. }
  1963. function f(e, t) {
  1964. for (var i = 0, n = ve[e].length; i < n; i++)
  1965. if (ve[e][i] === t)
  1966. return i;
  1967. return -1
  1968. }
  1969. function g() {
  1970. Ie.released && !B.isPaused && B.resume()
  1971. }
  1972. function y(e) {
  1973. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1974. }
  1975. function A() {
  1976. Ie.history[0] = Ie.history[1],
  1977. Ie.history[1] = Ie.history[2],
  1978. Ie.history[2] = Ie.history[3],
  1979. Ie.history[3] = Ie.delta
  1980. }
  1981. function C(e) {
  1982. Ie.released = 0,
  1983. Ie.source = e,
  1984. Ie.slidee = "slidee" === e
  1985. }
  1986. function I(e) {
  1987. var t = "touchstart" === e.type
  1988. , i = e.data.source
  1989. , n = "slidee" === i;
  1990. 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),
  1991. C(i),
  1992. Ie.init = 0,
  1993. Ie.$source = xe(e.target),
  1994. Ie.touch = t,
  1995. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1996. Ie.initX = Ie.pointer.pageX,
  1997. Ie.initY = Ie.pointer.pageY,
  1998. Ie.initPos = n ? G.cur : X.cur,
  1999. Ie.start = +new Date,
  2000. Ie.time = 0,
  2001. Ie.path = 0,
  2002. Ie.delta = 0,
  2003. Ie.locked = 0,
  2004. Ie.history = [0, 0, 0, 0],
  2005. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  2006. We.on(t ? qe : Ye, E),
  2007. B.pause(1),
  2008. (n ? U : j).addClass(F.draggedClass),
  2009. L("moveStart"),
  2010. n && (be = setInterval(A, 10)))
  2011. }
  2012. function E(e) {
  2013. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  2014. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  2015. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  2016. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  2017. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  2018. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  2019. Ie.released || !(Ie.path < 1)) {
  2020. if (!Ie.init) {
  2021. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  2022. return _();
  2023. Ie.init = 1
  2024. }
  2025. Pe(e),
  2026. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  2027. Ie.$source.on(Ze, Oe)),
  2028. Ie.released && (_(),
  2029. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  2030. Ie.delta += Ie.swing,
  2031. Ie.tweese = 10 < $e(Ie.swing))),
  2032. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  2033. }
  2034. }
  2035. function _() {
  2036. clearInterval(be),
  2037. Ie.released = !0,
  2038. We.off(Ie.touch ? qe : Ye, E),
  2039. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  2040. setTimeout(function() {
  2041. Ie.$source.off(Ze, Oe)
  2042. }),
  2043. G.cur === G.dest && Ie.init && L("moveEnd"),
  2044. B.resume(1),
  2045. Ie.init = 0
  2046. }
  2047. function b(e) {
  2048. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  2049. }
  2050. function w() {
  2051. B.stop(),
  2052. We.off("mouseup", w)
  2053. }
  2054. function T(e) {
  2055. switch (Pe(e),
  2056. this) {
  2057. case ue[0]:
  2058. case de[0]:
  2059. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  2060. We.on("mouseup", w);
  2061. break;
  2062. case pe[0]:
  2063. B.prev();
  2064. break;
  2065. case fe[0]:
  2066. B.next();
  2067. break;
  2068. case ge[0]:
  2069. B.prevPage();
  2070. break;
  2071. case me[0]:
  2072. B.nextPage()
  2073. }
  2074. }
  2075. function x(e) {
  2076. e.originalEvent[He] = B;
  2077. var t = +new Date;
  2078. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  2079. ot = t;
  2080. else if (F.scrollBy && G.start !== G.end) {
  2081. var i = function(e) {
  2082. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  2083. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  2084. le ? (Ue = +new Date,
  2085. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  2086. Ee.last = Ue,
  2087. Ee.delta += Ee.curDelta,
  2088. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  2089. Ee.delta %= 1),
  2090. Ee.finalDelta) : Ee.curDelta
  2091. }(e.originalEvent);
  2092. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  2093. B.slideBy(F.scrollBy * i)
  2094. }
  2095. }
  2096. function S(e) {
  2097. F.clickBar && e.target === W[0] && (Pe(e),
  2098. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  2099. }
  2100. function M(e) {
  2101. if (F.keyboardNavBy)
  2102. switch (e.which) {
  2103. case F.horizontal ? 37 : 38:
  2104. Pe(e),
  2105. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  2106. break;
  2107. case F.horizontal ? 39 : 40:
  2108. Pe(e),
  2109. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  2110. }
  2111. }
  2112. function R(e) {
  2113. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  2114. }
  2115. function P() {
  2116. this.parentNode === Z[0] && B.activatePage(K.index(this))
  2117. }
  2118. function O(e) {
  2119. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  2120. }
  2121. function L(e, t) {
  2122. if (ve[e]) {
  2123. for (N = ve[e].length,
  2124. Je.length = 0,
  2125. D = 0; D < N; D++)
  2126. Je.push(ve[e][D]);
  2127. for (D = 0; D < N; D++)
  2128. Je[D].call(B, e, t)
  2129. }
  2130. }
  2131. 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 = {
  2132. start: 0,
  2133. center: 0,
  2134. end: 0,
  2135. cur: 0,
  2136. dest: 0
  2137. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  2138. start: 0,
  2139. end: 0,
  2140. cur: 0
  2141. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  2142. firstItem: 0,
  2143. lastItem: 0,
  2144. centerItem: 0,
  2145. activeItem: null,
  2146. activePage: 0
  2147. }, 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 = {
  2148. released: 1
  2149. }, Ee = {
  2150. last: 0,
  2151. delta: 0,
  2152. resetTime: 200
  2153. }, _e = 0, be = 0, we = 0, Te = 0;
  2154. V || (s = k[0]),
  2155. B.initialized = 0,
  2156. B.frame = s,
  2157. B.slidee = U[0],
  2158. B.pos = G,
  2159. B.rel = ee,
  2160. B.items = $,
  2161. B.pages = Q,
  2162. B.isPaused = 0,
  2163. B.options = F,
  2164. B.dragging = Ie,
  2165. B.reload = function() {
  2166. a()
  2167. }
  2168. ,
  2169. B.getPos = function(e) {
  2170. if (le) {
  2171. var t = h(e);
  2172. return -1 !== t && $[t]
  2173. }
  2174. var i = U.find(e).eq(0);
  2175. if (i[0]) {
  2176. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  2177. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  2178. return {
  2179. start: n,
  2180. center: n - H / 2 + r / 2,
  2181. end: n - H + r,
  2182. size: r
  2183. }
  2184. }
  2185. return !1
  2186. }
  2187. ,
  2188. B.moveBy = function(e) {
  2189. Ce.speed = e,
  2190. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2191. Ce.startPos = G.cur,
  2192. C("button"),
  2193. Ie.init = 1,
  2194. L("moveStart"),
  2195. ze(Te),
  2196. t())
  2197. }
  2198. ,
  2199. B.stop = function() {
  2200. "button" === Ie.source && (Ie.init = 0,
  2201. Ie.released = 1)
  2202. }
  2203. ,
  2204. B.prev = function() {
  2205. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2206. }
  2207. ,
  2208. B.next = function() {
  2209. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2210. }
  2211. ,
  2212. B.prevPage = function() {
  2213. B.activatePage(ee.activePage - 1)
  2214. }
  2215. ,
  2216. B.nextPage = function() {
  2217. B.activatePage(ee.activePage + 1)
  2218. }
  2219. ,
  2220. B.slideBy = function(e, t) {
  2221. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2222. }
  2223. ,
  2224. B.slideTo = function(e, t) {
  2225. l(e, t)
  2226. }
  2227. ,
  2228. B.toStart = function(e, t) {
  2229. i("start", e, t)
  2230. }
  2231. ,
  2232. B.toEnd = function(e, t) {
  2233. i("end", e, t)
  2234. }
  2235. ,
  2236. B.toCenter = function(e, t) {
  2237. i("center", e, t)
  2238. }
  2239. ,
  2240. B.getIndex = h,
  2241. B.activate = function(e, t) {
  2242. var i = m(e);
  2243. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2244. }
  2245. ,
  2246. B.activatePage = function(e, t) {
  2247. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2248. }
  2249. ,
  2250. B.resume = function(e) {
  2251. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2252. we ? we = clearTimeout(we) : L("resume"),
  2253. we = setTimeout(function() {
  2254. switch (L("cycle"),
  2255. F.cycleBy) {
  2256. case "items":
  2257. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2258. break;
  2259. case "pages":
  2260. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2261. }
  2262. }, F.cycleInterval))
  2263. }
  2264. ,
  2265. B.pause = function(e) {
  2266. e < B.isPaused || (B.isPaused = e || 100,
  2267. we && (we = clearTimeout(we),
  2268. L("pause")))
  2269. }
  2270. ,
  2271. B.toggle = function() {
  2272. B[we ? "pause" : "resume"]()
  2273. }
  2274. ,
  2275. B.set = function(e, t) {
  2276. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2277. }
  2278. ,
  2279. B.add = function(e, t) {
  2280. var i = xe(e);
  2281. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2282. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2283. a()
  2284. }
  2285. ,
  2286. B.remove = function(e) {
  2287. if (le) {
  2288. var t = u(e);
  2289. if (-1 < t) {
  2290. J.eq(t).remove();
  2291. var i = t === ee.activeItem;
  2292. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2293. a(),
  2294. i && (ye.active = null,
  2295. B.activate(ee.activeItem))
  2296. }
  2297. } else
  2298. xe(e).remove(),
  2299. a()
  2300. }
  2301. ,
  2302. B.moveAfter = function(e, t) {
  2303. r(e, t, 1)
  2304. }
  2305. ,
  2306. B.moveBefore = function(e, t) {
  2307. r(e, t)
  2308. }
  2309. ,
  2310. B.on = function(e, t) {
  2311. if ("object" === Re(e))
  2312. for (var i in e)
  2313. e.hasOwnProperty(i) && B.on(i, e[i]);
  2314. else if ("function" === Re(t))
  2315. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2316. ve[n[r]] = ve[n[r]] || [],
  2317. -1 === f(n[r], t) && ve[n[r]].push(t);
  2318. else if ("array" === Re(t))
  2319. for (var a = 0, s = t.length; a < s; a++)
  2320. B.on(e, t[a])
  2321. }
  2322. ,
  2323. B.one = function(t, i) {
  2324. B.on(t, function e() {
  2325. i.apply(B, arguments),
  2326. B.off(t, e)
  2327. })
  2328. }
  2329. ,
  2330. B.off = function(e, t) {
  2331. if (t instanceof Array)
  2332. for (var i = 0, n = t.length; i < n; i++)
  2333. B.off(e, t[i]);
  2334. else
  2335. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2336. if (ve[r[o]] = ve[r[o]] || [],
  2337. null == t)
  2338. ve[r[o]].length = 0;
  2339. else {
  2340. var s = f(r[o], t);
  2341. -1 !== s && ve[r[o]].splice(s, 1)
  2342. }
  2343. }
  2344. ,
  2345. B.destroy = function() {
  2346. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2347. We.off("keydown", M),
  2348. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2349. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2350. Z.empty(),
  2351. V || (k.off("." + He),
  2352. te.restore(),
  2353. ie.restore(),
  2354. ne.restore(),
  2355. re.restore(),
  2356. xe.removeData(s, He)),
  2357. $.length = Q.length = 0,
  2358. ye = {},
  2359. B.initialized = 0,
  2360. B
  2361. }
  2362. ,
  2363. B.init = function() {
  2364. if (!B.initialized) {
  2365. B.on(n);
  2366. var e = ["overflow", "position"]
  2367. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2368. te.save.apply(te, e),
  2369. ne.save.apply(ne, e),
  2370. ie.save.apply(ie, t),
  2371. re.save.apply(re, t);
  2372. var i = j;
  2373. return V || (i = i.add(U),
  2374. k.css("overflow", "hidden"),
  2375. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2376. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2377. i.css({
  2378. position: "absolute"
  2379. })),
  2380. F.forward && ue.on(Ke, T),
  2381. F.backward && de.on(Ke, T),
  2382. F.prev && pe.on(Ze, T),
  2383. F.next && fe.on(Ze, T),
  2384. F.prevPage && ge.on(Ze, T),
  2385. F.nextPage && me.on(Ze, T),
  2386. ce.on(Xe, x),
  2387. W[0] && W.on(Ze, S),
  2388. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2389. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2390. he.on(je, {
  2391. source: "slidee"
  2392. }, I),
  2393. j && j.on(je, {
  2394. source: "handle"
  2395. }, I),
  2396. We.on("keydown", M),
  2397. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2398. k.on("scroll." + He, Le)),
  2399. B.initialized = 1,
  2400. a(!0),
  2401. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2402. B
  2403. }
  2404. }
  2405. }
  2406. function Re(e) {
  2407. 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
  2408. }
  2409. function Pe(e, t) {
  2410. e.preventDefault(),
  2411. t && e.stopPropagation()
  2412. }
  2413. function Oe(e) {
  2414. Pe(e, 1),
  2415. xe(this).off(e.type, Oe)
  2416. }
  2417. function Le() {
  2418. this.scrollLeft = 0,
  2419. this.scrollTop = 0
  2420. }
  2421. function De(e) {
  2422. return !isNaN(parseFloat(e)) && isFinite(e)
  2423. }
  2424. function Ne(e, t) {
  2425. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2426. }
  2427. function Fe(e, t, i) {
  2428. return e < t ? t : i < e ? i : e
  2429. }
  2430. function Be(t) {
  2431. var i = {
  2432. style: {},
  2433. save: function() {
  2434. if (t && t.nodeType) {
  2435. for (var e = 0; e < arguments.length; e++)
  2436. i.style[arguments[e]] = t.style[arguments[e]];
  2437. return i
  2438. }
  2439. },
  2440. restore: function() {
  2441. if (t && t.nodeType) {
  2442. for (var e in i.style)
  2443. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2444. return i
  2445. }
  2446. }
  2447. };
  2448. return i
  2449. }
  2450. 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;
  2451. function t(e) {
  2452. for (var t = 0, i = r.length; t < i; t++) {
  2453. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2454. if (null != o.style[n])
  2455. return n
  2456. }
  2457. }
  2458. We.on(Xe, function(e) {
  2459. var t = e.originalEvent[He]
  2460. , i = +new Date;
  2461. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2462. }),
  2463. function(t) {
  2464. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2465. var t = (new Date).getTime()
  2466. , i = Math.max(0, 16 - (t - r))
  2467. , n = setTimeout(e, i);
  2468. return r = t,
  2469. n
  2470. }
  2471. ;
  2472. var r = (new Date).getTime()
  2473. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2474. ze = function(e) {
  2475. i.call(t, e)
  2476. }
  2477. }(window),
  2478. r = ["", "webkit", "moz", "ms", "o"],
  2479. o = document.createElement("div"),
  2480. Ve = t("transform"),
  2481. ke = t("perspective") ? "translateZ(0) " : "",
  2482. e.Sly = Me,
  2483. xe.fn.sly = function(n, r) {
  2484. var o, a;
  2485. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2486. a = Array.prototype.slice.call(arguments, 1)),
  2487. n = {}),
  2488. this.each(function(e, t) {
  2489. var i = xe.data(t, He);
  2490. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2491. })
  2492. }
  2493. ,
  2494. Me.defaults = {
  2495. slidee: null,
  2496. horizontal: !1,
  2497. itemNav: null,
  2498. itemSelector: null,
  2499. smart: !1,
  2500. activateOn: null,
  2501. activateMiddle: !1,
  2502. scrollSource: null,
  2503. scrollBy: 0,
  2504. scrollHijack: 300,
  2505. scrollTrap: !1,
  2506. dragSource: null,
  2507. mouseDragging: !1,
  2508. touchDragging: !1,
  2509. releaseSwing: !1,
  2510. swingSpeed: .2,
  2511. elasticBounds: !1,
  2512. interactive: null,
  2513. scrollBar: null,
  2514. dragHandle: !1,
  2515. dynamicHandle: !1,
  2516. minHandleSize: 50,
  2517. clickBar: !1,
  2518. syncSpeed: .5,
  2519. pagesBar: null,
  2520. activatePageOn: null,
  2521. pageBuilder: function(e) {
  2522. return "<li>" + (e + 1) + "</li>"
  2523. },
  2524. forward: null,
  2525. backward: null,
  2526. prev: null,
  2527. next: null,
  2528. prevPage: null,
  2529. nextPage: null,
  2530. cycleBy: null,
  2531. cycleInterval: 5e3,
  2532. pauseOnHover: !1,
  2533. startPaused: !1,
  2534. moveBy: 300,
  2535. speed: 0,
  2536. easing: "swing",
  2537. startAt: null,
  2538. keyboardNavBy: null,
  2539. draggedClass: "dragged",
  2540. activeClass: "active",
  2541. disabledClass: "disabled"
  2542. }
  2543. }(jQuery, window),
  2544. function o(a, s, l) {
  2545. function c(i, e) {
  2546. if (!s[i]) {
  2547. if (!a[i]) {
  2548. var t = "function" == typeof require && require;
  2549. if (!e && t)
  2550. return t(i, !0);
  2551. if (h)
  2552. return h(i, !0);
  2553. var n = new Error("Cannot find module '" + i + "'");
  2554. throw n.code = "MODULE_NOT_FOUND",
  2555. n
  2556. }
  2557. var r = s[i] = {
  2558. exports: {}
  2559. };
  2560. a[i][0].call(r.exports, function(e) {
  2561. var t = a[i][1][e];
  2562. return c(t || e)
  2563. }, r, r.exports, o, a, s, l)
  2564. }
  2565. return s[i].exports
  2566. }
  2567. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2568. c(l[e]);
  2569. return c
  2570. }({
  2571. 1: [function(p, f, e) {
  2572. (function(e) {
  2573. "use strict";
  2574. function t(e) {
  2575. this.player = null,
  2576. this.director = null,
  2577. this.modelManager = null,
  2578. this.container = null,
  2579. this.tagManager = null,
  2580. this.fadeInSpeed = e,
  2581. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2582. }
  2583. var r = p("three")
  2584. , i = p("./util/logger")
  2585. , n = (p("./util/common"),
  2586. p("./enum/PlayerEvents"))
  2587. , o = p("./enum/DirectorEvents")
  2588. , a = p("./settings")
  2589. , s = p("./enum/Viewmode")
  2590. , l = (p("./enum/WarpStyle"),
  2591. p("./enum/BlackoutStyle"),
  2592. p("./enum/ModelManagerEvents"))
  2593. , c = p("./enum/tagEvents")
  2594. , h = p("./util/transitions")
  2595. , u = p("./util/lerp")
  2596. , d = new i(e);
  2597. t.prototype.init = function(e, t, i, n, r) {
  2598. (window.app = this).player = t,
  2599. this.director = e,
  2600. this.modelManager = i,
  2601. this.tagManager = n,
  2602. this.container = r,
  2603. this.updateModel(),
  2604. this.bindEvents()
  2605. }
  2606. ,
  2607. t.prototype.bindEvents = function() {
  2608. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2609. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2610. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2611. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2612. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2613. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2614. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2615. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2616. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2617. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2618. }
  2619. ,
  2620. t.prototype.updateModel = function() {
  2621. this.model = this.modelManager.getActiveModel()
  2622. }
  2623. ,
  2624. t.prototype.handleWarpStarted = function() {
  2625. this.hidePlayerReticule()
  2626. }
  2627. ,
  2628. t.prototype.ontagActivated = function() {
  2629. this.hidePlayerReticule()
  2630. }
  2631. ,
  2632. t.prototype.onNavigationTotag = function() {
  2633. this.hidePlayerReticule()
  2634. }
  2635. ,
  2636. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2637. var n = this.modelManager.getActiveModel()
  2638. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2639. n.fadePanoMarkers(r),
  2640. n.setMode(t)
  2641. }
  2642. ,
  2643. t.prototype.handlePlayerModeChanged = function(e, t) {
  2644. var i = this.modelManager.getActiveModel()
  2645. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2646. i.setSide(n),
  2647. i.setMode(t)
  2648. }
  2649. ,
  2650. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2651. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2652. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2653. }
  2654. ,
  2655. t.prototype.handleActionInterruption = function() {}
  2656. ,
  2657. t.prototype.handleStartInside = function(e) {
  2658. var t = a[this.player.mode]
  2659. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2660. this.fadeIn(this.fadeInSpeed),
  2661. this.model.alpha = 0,
  2662. this.model.skybox.material.uniforms.opacity.value = 1,
  2663. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2664. var n = this.player.reticule;
  2665. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2666. }
  2667. ,
  2668. t.prototype.handleStartOutside = function(e) {
  2669. this.fadeIn(e)
  2670. }
  2671. ,
  2672. t.prototype.fadeIn = function(e) {
  2673. null != e || (e = 2e3,
  2674. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2675. $(this.container).fadeIn(e)
  2676. }
  2677. ,
  2678. t.prototype.hidePlayerReticule = function() {
  2679. this.player.reticule.hide()
  2680. }
  2681. ,
  2682. f.exports = t
  2683. }
  2684. ).call(this, "/js/DisplayController.js")
  2685. }
  2686. , {
  2687. "./enum/BlackoutStyle": 18,
  2688. "./enum/DirectorEvents": 23,
  2689. "./enum/tagEvents": 32,
  2690. "./enum/ModelManagerEvents": 33,
  2691. "./enum/PlayerEvents": 40,
  2692. "./enum/Viewmode": 51,
  2693. "./enum/WarpStyle": 52,
  2694. "./settings": 166,
  2695. "./util/common": 185,
  2696. "./util/lerp": 188,
  2697. "./util/logger": 189,
  2698. "./util/transitions": 195,
  2699. three: 217
  2700. }],
  2701. 2: [function(e, t, i) {
  2702. "use strict";
  2703. function n() {
  2704. this.baseStartTime = performance.timing.navigationStart,
  2705. this.loadingStartTime = null,
  2706. this.waitingStartTime = null,
  2707. this.appReadyTime = null
  2708. }
  2709. n.prototype.setBaseStartTime = function(e) {
  2710. this.baseStartTime = e || Date.now()
  2711. }
  2712. ,
  2713. n.prototype.setWaitingStartTime = function(e) {
  2714. this.waitingStartTime = e || Date.now()
  2715. }
  2716. ,
  2717. n.prototype.setLoadingStartTime = function(e) {
  2718. this.loadingStartTime = e || Date.now()
  2719. }
  2720. ,
  2721. n.prototype.setAppReadyTime = function(e) {
  2722. this.appReadyTime = e || Date.now()
  2723. }
  2724. ,
  2725. n.prototype.calcFullLoadingTime = function() {
  2726. var e = this.appReadyTime - this.baseStartTime;
  2727. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2728. e
  2729. }
  2730. ,
  2731. t.exports = n
  2732. }
  2733. , {}],
  2734. 3: [function(i, n, e) {
  2735. (function(e) {
  2736. "use strict";
  2737. function a() {
  2738. return 100 * Math.random()
  2739. }
  2740. var t = i("./util/logger")
  2741. , s = i("./util/browser")
  2742. , l = new t(e)
  2743. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2744. initialized: !1,
  2745. init: function(e, t) {
  2746. if (t = t || {},
  2747. !this.initialized) {
  2748. for (var i in this.initialized = !0,
  2749. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2750. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2751. e) {
  2752. var n = i.match("^sc_tilegen_([0-9]+)$");
  2753. n && (c.tilegen = a() < parseInt(n[1]));
  2754. var r = i.match("^sc_imgopt_([0-9]+)$");
  2755. r && (c.imgopt = a() < parseInt(r[1]))
  2756. }
  2757. for (var o in t)
  2758. c[o] = t[o],
  2759. l.debug("A/B override:", o, c[o])
  2760. }
  2761. },
  2762. changeIfTileGenerating: function(e) {
  2763. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2764. e += ""),
  2765. e
  2766. },
  2767. changeIfImageOptimzing: function(e) {
  2768. if(e.includes("blob:http"))return e;//add
  2769. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2770. e += ""),
  2771. e
  2772. },
  2773. tilegen: !1,
  2774. imgopt: !1
  2775. };
  2776. n.exports = c
  2777. }
  2778. ).call(this, "/js/ab.js")
  2779. }
  2780. , {
  2781. "./util/browser": 182,
  2782. "./util/logger": 189
  2783. }],
  2784. 4: [function(u, d, e) {
  2785. (function(e) {
  2786. "use strict";
  2787. function r(n, e, t, i) {
  2788. function r(e) {
  2789. a[e.sid] = !0;
  2790. var t = e.billboard.media && e.billboard.media.type
  2791. , i = {
  2792. tag_id: e.sid,
  2793. tags_visited: Object.keys(a).length,
  2794. tag_count: Object.keys(n.tags).length,
  2795. tag_view_count: ++d,
  2796. has_media: !!t
  2797. };
  2798. t && (i.media_type = t),
  2799. g("tag_opened", i)
  2800. }
  2801. var o, a = {}, s = Date.now() - P, l = null;
  2802. i && (l = Date.now() - window.navigationStart);
  2803. try {
  2804. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2805. } catch (n) {
  2806. o = !1
  2807. }
  2808. var c, h = n.supportsVR;
  2809. h || (c = "VR disabled at the model/account level",
  2810. 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"))),
  2811. g("model_loaded", {
  2812. duration: s,
  2813. duration_from_navigation_start: l,
  2814. has_hlr: o,
  2815. has_vr: h,
  2816. vr_reason: c
  2817. });
  2818. var u = 0;
  2819. n.panos.forEach(function(e) {
  2820. e.on("enter", function() {
  2821. f("pano_viewed", {
  2822. pano_id: e.id,
  2823. pano_view_count: ++u,
  2824. alignment_type: e.alignmentType,
  2825. interaction_source: R,
  2826. navigation_source: v
  2827. })
  2828. })
  2829. });
  2830. var d = 0;
  2831. for (var p in n.tags)
  2832. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2833. e.on("tour_auto", function(e) {
  2834. v = "tour_" + e
  2835. }),
  2836. e.on("tour_manual", function(e) {
  2837. R = "gui-" + e,
  2838. v = "tour_manual"
  2839. }),
  2840. t.on(C.InteractionKey, function() {
  2841. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2842. }),
  2843. t.on(C.InteractionDirect, function() {
  2844. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2845. }),
  2846. function(t) {
  2847. I.on(T.OPENED, function() {
  2848. f("showcase_share_intent", {
  2849. pano_id: t.currentPano && t.currentPano.id
  2850. })
  2851. }),
  2852. I.on(T.LINK_CLICKED, function(e) {
  2853. f("showcase_share_action", {
  2854. channel: e.channel,
  2855. pano_id: t.currentPano && t.currentPano.id
  2856. })
  2857. }),
  2858. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2859. f("showcase_share_origin_link_clicked")
  2860. })
  2861. }(e),
  2862. function() {
  2863. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2864. gui_action: "click_vr_button"
  2865. })),
  2866. _.on(S.LAUNCH, function(e) {
  2867. f("showcase_gui", {
  2868. gui_action: "launch_vr",
  2869. vr_platform: e.vr_platform,
  2870. vr_app: e.vr_app
  2871. })
  2872. }),
  2873. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2874. gui_action: "vr_modal_prev"
  2875. })),
  2876. _.on(S.NEXT, function(e) {
  2877. f("showcase_gui", {
  2878. gui_action: e.nextAction
  2879. })
  2880. }),
  2881. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2882. gui_action: "vr_modal_close"
  2883. })),
  2884. _.on(S.falseICECHOSEN, function(e) {
  2885. f("showcase_gui", {
  2886. gui_action: e.name + " "
  2887. })
  2888. }),
  2889. _.on(S.STORE, function(e) {
  2890. f("showcase_gui", {
  2891. gui_action: "launch_store",
  2892. store: e
  2893. })
  2894. })
  2895. }()
  2896. }
  2897. function f(e, t) {
  2898. if (t = t || {},
  2899. i)
  2900. try {
  2901. window.analytics.track(e, s.extendObject(t, c), {
  2902. context: {
  2903. app: {
  2904. name: "showcase",
  2905. version: "2.25.6-0-gd87e5b1"
  2906. },
  2907. screen: {
  2908. width: window.screen.width,
  2909. height: window.screen.height,
  2910. density: window.devicePixelRatio
  2911. }
  2912. }
  2913. })
  2914. } catch (t) {
  2915. console.warn("Failed to send data to segment for " + e)
  2916. }
  2917. }
  2918. function g(e, t) {
  2919. f(e, t = t || {})
  2920. }
  2921. function m(e, t) {
  2922. R = e === C.InteractionGui ? "gui-" + t : e,
  2923. v = "self_guided"
  2924. }
  2925. var v, o, a = (u("three"),
  2926. u("./util/ajax"),
  2927. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2928. 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"),
  2929. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2930. d.exports = {
  2931. report: function(e, t, i, n) {
  2932. !function(e, t) {
  2933. if (o)
  2934. try {
  2935. o.addEvent(e, s.extendObject({
  2936. host: window.location.host,
  2937. keen: {
  2938. addons: [{
  2939. name: "keen:ua_parser",
  2940. input: {
  2941. ua_string: "user_agent"
  2942. },
  2943. output: "parsed_user_agent"
  2944. }]
  2945. },
  2946. user_agent: "${keen.user_agent}",
  2947. referrer: {
  2948. url: s.normalizeUrl(document.referrer),
  2949. domain: s.domainFromUrl(document.referrer),
  2950. url_original: document.referrer
  2951. },
  2952. embedded: y.inIframe(),
  2953. is_mobile: y.isMobile(),
  2954. version: "2.25.6-0-gd87e5b1"
  2955. }, t))
  2956. } catch (e) {
  2957. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2958. }
  2959. }("Session starts", {
  2960. model: e,
  2961. status: t,
  2962. loadtime: Date.now() - (P || Date.now()),
  2963. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2964. autoplay: i,
  2965. quickstart: n,
  2966. ab_tilegen: a.tilegen,
  2967. ab_imgopt: a.imgopt
  2968. })
  2969. },
  2970. impression: function(e) {
  2971. g("impression", {
  2972. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2973. url_params: (void 0 !== e.immediate && e.immediate,
  2974. window.location.search.substr(1).split("&"))
  2975. })
  2976. },
  2977. initKeen: function(e) {
  2978. return e.token && e.appId ? void (o = new Keen({
  2979. projectId: e.appId,
  2980. writeKey: e.token,
  2981. readKey: "",
  2982. requestType: "xhr"
  2983. })) : void l.warn("no keen token/appId")
  2984. },
  2985. initSegment: function(e) {
  2986. return e.token ? (i = e.token,
  2987. window.analytics.load(e.token),
  2988. c = {
  2989. model_id: e.model,
  2990. start_source: e.startSource,
  2991. autoplay: e.autoplay,
  2992. quickstart: e.quickstart,
  2993. language_tag: t.languageTag,
  2994. is_mobile: y.isMobile(),
  2995. iframe: y.inIframe(),
  2996. aspect_ratio: y.aspectRatio(),
  2997. session_id: h,
  2998. window: {
  2999. width: $("#player").width(),
  3000. height: $("#player").height()
  3001. },
  3002. platform: {
  3003. browser: {
  3004. name: $.ua.browser.name,
  3005. major: $.ua.browser.major,
  3006. version: $.ua.browser.version
  3007. },
  3008. os: {
  3009. name: $.ua.os.name,
  3010. version: $.ua.os.version
  3011. },
  3012. device: {
  3013. vendor: $.ua.device.vendor,
  3014. model: $.ua.device.model,
  3015. type: $.ua.device.type
  3016. }
  3017. }
  3018. },
  3019. n = Math.random() < t.analytics.sessionTrackingRate,
  3020. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  3021. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  3022. },
  3023. sessionStart: function(e) {
  3024. l.debug("analytics user_session_start"),
  3025. f("session_started"),
  3026. P = Date.now(),
  3027. window.addEventListener("unload", function() {
  3028. !function(e, t) {
  3029. if (t = t || {},
  3030. navigator.sendBeacon && i)
  3031. try {
  3032. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  3033. event: e,
  3034. anonymousId: window.analytics.user().anonymousId(),
  3035. properties: s.extendObject(t, c),
  3036. writeKey: i,
  3037. sentAt: Date.now(),
  3038. type: "track",
  3039. context: {
  3040. userAgent: y.userAgent(),
  3041. library: {
  3042. name: "showcase-beacon",
  3043. version: "2.25.6-0-gd87e5b1"
  3044. },
  3045. app: {
  3046. name: "showcase",
  3047. version: "2.25.6-0-gd87e5b1"
  3048. }
  3049. }
  3050. }))
  3051. } catch (e) {
  3052. console.warn("Failed to send async segment request")
  3053. }
  3054. }("session_ended", {
  3055. duration: Date.now() - P
  3056. })
  3057. })
  3058. },
  3059. modelLoaded: function(e, t, i, n) {
  3060. r(e, t, i, n)
  3061. },
  3062. loadComplete: function(e) {
  3063. f("load_times", {
  3064. time_to_app_start: e
  3065. })
  3066. },
  3067. track: function(e, t) {
  3068. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  3069. f(e, t))
  3070. },
  3071. trackAlways: function(e, t) {
  3072. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  3073. f(e, t)
  3074. },
  3075. getSessionId: function() {
  3076. return h
  3077. },
  3078. updateInteraction: m
  3079. }
  3080. }
  3081. ).call(this, "/js/analytics.js")
  3082. }
  3083. , {
  3084. "./ab": 3,
  3085. "./enum/ControlEvents": 21,
  3086. "./enum/PlayerEvents": 40,
  3087. "./enum/VROption": 47,
  3088. "./enum/VRPlatforms": 49,
  3089. "./enum/Viewmode": 51,
  3090. "./gui/sharing/ShareEvents": 76,
  3091. "./gui/sharing/modal": 77,
  3092. "./gui/title/TitleEvents": 80,
  3093. "./gui/title/titleBar": 82,
  3094. "./gui/vr/vrEvent": 85,
  3095. "./gui/vr/vrModal": 87,
  3096. "./localization/localize": 108,
  3097. "./tag/Billboard/BillboardEvent": 120,
  3098. "./settings": 166,
  3099. "./util/ajax": 181,
  3100. "./util/browser": 182,
  3101. "./util/common": 185,
  3102. "./util/logger": 189,
  3103. three: 217
  3104. }],
  3105. 5: [function(e, t, i) {
  3106. "use strict";
  3107. function n() {
  3108. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3109. this.controls = null
  3110. }
  3111. var r = e("three")
  3112. , o = e("../constants")
  3113. , a = e("../util/cameraLight");
  3114. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3115. this.aspect = e,
  3116. this.updateProjectionMatrix()
  3117. }
  3118. ,
  3119. t.exports = n
  3120. }
  3121. , {
  3122. "../constants": 8,
  3123. "../util/cameraLight": 184,
  3124. three: 217
  3125. }],
  3126. 6: [function(e, t, i) {
  3127. "use strict";
  3128. function n() {
  3129. var e = $("#player").width() / $("#player").height();
  3130. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3131. this.controls = null,
  3132. this.updateAspect(e)
  3133. }
  3134. var r = e("three")
  3135. , o = e("../constants");
  3136. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  3137. this.aspect = e,
  3138. this.top = o.orthoBase / e,
  3139. this.bottom = -o.orthoBase / e,
  3140. this.updateProjectionMatrix()
  3141. }
  3142. ,
  3143. t.exports = n
  3144. }
  3145. , {
  3146. "../constants": 8,
  3147. three: 217
  3148. }],
  3149. 7: [function(e, t, i) {
  3150. "use strict";
  3151. function n() {
  3152. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3153. this.controls = null
  3154. }
  3155. var r = e("three")
  3156. , o = e("../settings")
  3157. , a = e("../util/cameraLight");
  3158. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3159. this.aspect = e,
  3160. this.updateProjectionMatrix()
  3161. }
  3162. ,
  3163. t.exports = n
  3164. }
  3165. , {
  3166. "../settings": 166,
  3167. "../util/cameraLight": 184,
  3168. three: 217
  3169. }],
  3170. 8: [function(e, t, i) {
  3171. "use strict";
  3172. t.exports = {
  3173. signedUrlDefaultExpireTime: 24e4,
  3174. signedUrlCheckInterval: 1e4,
  3175. signedUrlRefreshBuffer: 15e3,
  3176. dollhouseFOV: 70,
  3177. dollhouseNear: .1,//1,
  3178. dollhouseFar: 5e3,
  3179. insideFOV: 70,
  3180. insideFOVMax: 120,
  3181. insideNear: .1,
  3182. insideFar: 5e3,
  3183. insideLookSpeed: .12,
  3184. insideLookLimitUp: 40,
  3185. insideLookLimitDown: -40,
  3186. orthoNear: 1,
  3187. orthoFar: 5e3,
  3188. orthoBase: 10,
  3189. narrowLandscapeHeight: 290,
  3190. reallyNarrowLandscapeHeight: 250,
  3191. visionTilingStartDate: new Date("8/26/2016"),
  3192. visionTilingStartVersion: "1.1.407.13667",
  3193. windowHeightHighQualityThreshold: 900,
  3194. tourStepDelayDefault: 3500,
  3195. tourStepDelaySlideShow: 5e3,
  3196. workshopApsect: 9 / 16,
  3197. highQualityMaxZoom: 2,
  3198. ultraHighQualityMaxZoom: 3
  3199. }
  3200. }
  3201. , {}],
  3202. 9: [function(e, t, i) {
  3203. "use strict";
  3204. function n() {
  3205. this.activeControl = null,
  3206. this.controls = {},
  3207. this.cameras = {}
  3208. }
  3209. var a = e("./PanoramaControls")
  3210. , s = e("./DollhouseControls")
  3211. , l = e("./FloorplanControls")
  3212. , c = e("../cameras/PanoramaCamera")
  3213. , h = e("../cameras/DollhouseCamera")
  3214. , u = e("../cameras/FloorplanCamera")
  3215. , r = e("events").EventEmitter
  3216. , d = e("../enum/ControlEvents")
  3217. , o = e("../enum/ModelManagerEvents")
  3218. , p = e("../enum/Viewmode")
  3219. , f = e("../settings");
  3220. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3221. this.setUpControls(),
  3222. this.bindEvents(e, t)
  3223. }
  3224. ,
  3225. n.prototype.activateControls = function(e) {
  3226. this.activeControl && (this.activeControl.reset(),
  3227. this.activeControl.enabled = !1),
  3228. this.controls[e] && (this.controls[e].enabled = !0),
  3229. this.activeControl = this.controls[e]
  3230. }
  3231. ,
  3232. n.prototype.setUpControls = function() {
  3233. var i = {}
  3234. , n = {}
  3235. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3236. , r = [c, h, u]
  3237. , o = [a, s, l];
  3238. e.forEach(function(e, t) {
  3239. i[e] = new r[t],
  3240. n[e] = new o[t](i[e]),
  3241. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3242. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3243. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3244. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3245. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3246. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3247. }
  3248. .bind(this)),
  3249. this.controls = n,
  3250. this.cameras = i
  3251. }
  3252. ,
  3253. n.prototype.bindEvents = function(e, t) {
  3254. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3255. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3256. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3257. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3258. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3259. passive: !1
  3260. }),
  3261. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3262. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3263. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3264. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3265. e.addEventListener("contextmenu", function(e) {
  3266. e.preventDefault()
  3267. }),
  3268. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3269. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3270. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3271. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3272. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3273. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3274. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3275. t.on(o.ActiveModelChanged, function(e) {
  3276. this.setModelForControls(e.model)
  3277. }
  3278. .bind(this))
  3279. }
  3280. ,
  3281. n.prototype.setModelForControls = function(e) {
  3282. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3283. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3284. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3285. this.controls[e].setBounds(t)
  3286. }
  3287. .bind(this))
  3288. }
  3289. ,
  3290. n.prototype.onMouseDown = function(e) {
  3291. e.preventDefault(),
  3292. this.activeControl && this.activeControl.onMouseDown(e)
  3293. }
  3294. ,
  3295. n.prototype.onMouseMove = function(e) {
  3296. e.preventDefault(),
  3297. this.activeControl && this.activeControl.onMouseMove(e)
  3298. }
  3299. ,
  3300. n.prototype.onMouseUp = function(e) {
  3301. e.preventDefault(),
  3302. this.activeControl && this.activeControl.onMouseUp(e)
  3303. }
  3304. ,
  3305. n.prototype.onMouseOver = function(e) {
  3306. e.preventDefault(),
  3307. this.activeControl && this.activeControl.onMouseOver(e)
  3308. }
  3309. ,
  3310. n.prototype.onMouseWheel = function(e) {
  3311. e.preventDefault(),
  3312. this.activeControl && this.activeControl.onMouseWheel(e)
  3313. }
  3314. ,
  3315. n.prototype.onTouchStart = function(e) {
  3316. e.preventDefault(),
  3317. this.activeControl && this.activeControl.onTouchStart(e),
  3318. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3319. $("#hotListContent ul .active").removeClass("active"),
  3320. $("#hotList")[0].classList.remove("active")
  3321. }
  3322. ,
  3323. n.prototype.onTouchMove = function(e) {
  3324. e.preventDefault(),
  3325. this.activeControl && this.activeControl.onTouchMove(e)
  3326. }
  3327. ,
  3328. n.prototype.onTouchEnd = function(e) {
  3329. e.preventDefault(),
  3330. this.activeControl && this.activeControl.onTouchEnd(e)
  3331. }
  3332. ,
  3333. n.prototype.onPointerDown = function(e) {
  3334. if (e.preventDefault(),
  3335. this.activeControl)
  3336. switch (e.pointerType) {
  3337. case "mouse":
  3338. this.activeControl.onMouseDown(e);
  3339. break;
  3340. default:
  3341. this.activeControl.onPointerDown(e)
  3342. }
  3343. }
  3344. ,
  3345. n.prototype.onPointerMove = function(e) {
  3346. if (e.preventDefault(),
  3347. this.activeControl)
  3348. switch (e.pointerType) {
  3349. case "mouse":
  3350. this.activeControl.onMouseMove(e);
  3351. break;
  3352. default:
  3353. this.activeControl.onPointerMove(e)
  3354. }
  3355. }
  3356. ,
  3357. n.prototype.onPointerUp = function(e) {
  3358. if (e.preventDefault(),
  3359. this.activeControl)
  3360. switch (e.pointerType) {
  3361. case "mouse":
  3362. this.activeControl.onMouseUp(e);
  3363. break;
  3364. default:
  3365. this.activeControl.onPointerUp(e)
  3366. }
  3367. }
  3368. ,
  3369. n.prototype.onPointerCancel = function(e) {
  3370. e.preventDefault(),
  3371. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3372. }
  3373. ,
  3374. n.prototype.onKeyDown = function(e) {
  3375. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3376. this.activeControl && this.activeControl.onKeyDown(e))
  3377. }
  3378. ,
  3379. n.prototype.onKeyUp = function(e) {
  3380. e.preventDefault(),
  3381. this.activeControl && this.activeControl.onKeyUp(e)
  3382. }
  3383. ,
  3384. t.exports = n
  3385. }
  3386. , {
  3387. "../cameras/DollhouseCamera": 5,
  3388. "../cameras/FloorplanCamera": 6,
  3389. "../cameras/PanoramaCamera": 7,
  3390. "../enum/ControlEvents": 21,
  3391. "../enum/ModelManagerEvents": 33,
  3392. "../enum/Viewmode": 51,
  3393. "../settings": 166,
  3394. "./DollhouseControls": 10,
  3395. "./FloorplanControls": 11,
  3396. "./PanoramaControls": 13,
  3397. events: 202
  3398. }],
  3399. 10: [function(e, t, i) {
  3400. "use strict";
  3401. function n(e) {
  3402. a.call(this, e),
  3403. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3404. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3405. this.minDistance = o.dollhouseDefault.minDistance,
  3406. this.maxDistance = o.dollhouseDefault.maxDistance,
  3407. this.adjustedMinDistance = this.minDistance,
  3408. this.adjustedMaxDistance = this.maxDistance
  3409. }
  3410. var r = e("three")
  3411. , o = e("../settings")
  3412. , a = e("./OutsideControls");
  3413. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3414. this.camera.updateMatrix();
  3415. var i = this.camera.position.clone().sub(this.target).length();
  3416. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3417. this.panLeft(2 * e * i / $("#player").height()),
  3418. this.panUp(-2 * t * i / $("#player").height())
  3419. }
  3420. ,
  3421. n.prototype.updateZoom = function() {
  3422. return this.offset.length() * this.scale
  3423. }
  3424. ,
  3425. n.prototype.setZoomBounds = function(e) {
  3426. var t = e.min.distanceTo(e.max);
  3427. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3428. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3429. this.minDistance = this.adjustedMinDistance,
  3430. this.maxDistance = this.adjustedMaxDistance
  3431. }
  3432. ,
  3433. n.prototype.resetRanges = function(e, t) {
  3434. e ? (this.minDistance = Math.min(e, this.minDistance),
  3435. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3436. this.maxDistance = this.adjustedMaxDistance),
  3437. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3438. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3439. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3440. }
  3441. ,
  3442. n.prototype.toJSON = function() {
  3443. return a.prototype.toJSON.call(this)
  3444. }
  3445. ,
  3446. t.exports = n
  3447. }
  3448. , {
  3449. "../settings": 166,
  3450. "./OutsideControls": 12,
  3451. three: 217
  3452. }],
  3453. 11: [function(e, t, i) {
  3454. "use strict";
  3455. function n(e) {
  3456. c.call(this, e),
  3457. this.minDistance = 15,
  3458. this.maxDistance = 50,
  3459. this.noRotateUpDown = !0,
  3460. this.minPolarAngle = 0,
  3461. this.maxPolarAngle = 0,
  3462. this.mouseActions[u.LEFT] = h.PAN,
  3463. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3464. this.mouseActions[u.RIGHT] = h.ROTATE,
  3465. this.touchActions[1] = h.PAN,
  3466. this.touchActions[2] = h.ROTATE_DOLLY,
  3467. this.absoluteScale = 1,
  3468. this.currentScale = 1
  3469. }
  3470. 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");
  3471. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3472. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3473. this.currentScale = this.absoluteScale
  3474. }
  3475. ,
  3476. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3477. var t = Math.max(modelSize.x, modelSize.z)
  3478. , i = Math.min(modelSize.x, modelSize.z)
  3479. , n = Math.max(t, i * this.camera.aspect)
  3480. , r = Math.max(i, t * this.camera.aspect);
  3481. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3482. return absoluteScale
  3483. },
  3484. n.prototype.rotateToView = function(e, t) {
  3485. var i = 0;
  3486. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3487. this.rotateLeft(i),
  3488. this.update(0)
  3489. }
  3490. ,
  3491. n.prototype.pan = function(e, t) {
  3492. this.camera.updateMatrix(),
  3493. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3494. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3495. }
  3496. ,
  3497. n.prototype.updateZoom = function() {
  3498. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3499. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3500. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3501. this.camera.left = -l.orthoBase * this.currentScale,
  3502. this.camera.right = l.orthoBase * this.currentScale,
  3503. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3504. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3505. this.camera.updateProjectionMatrix(),
  3506. this.offset.length()
  3507. }
  3508. ,
  3509. n.prototype.toJSON = (r = new s.Quaternion,
  3510. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3511. a = new s.Quaternion,
  3512. function() {
  3513. var e = c.prototype.toJSON.call(this);
  3514. return r.copy(e.camera_quaternion),
  3515. a.copy(o),
  3516. a.multiply(r),
  3517. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3518. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3519. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3520. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3521. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3522. e
  3523. }
  3524. ),
  3525. t.exports = n
  3526. }
  3527. , {
  3528. "../enum/ControlActions": 20,
  3529. "../enum/MouseButton": 34,
  3530. "../settings": 166,
  3531. "../util/browser": 182,
  3532. "../util/math": 190,
  3533. "./OutsideControls": 12,
  3534. three: 217
  3535. }],
  3536. 12: [function(e, t, i) {
  3537. "use strict";
  3538. function n(e) {
  3539. this.camera = e,
  3540. (this.camera.controls = this).enabled = !1,
  3541. this.target = new a.Vector3,
  3542. this.targetBounds = new a.Box3,
  3543. this.zoomSpeed = 2,//编辑时缩放快一些
  3544. this.minDistance = 0,
  3545. this.maxDistance = 1 / 0,
  3546. this.noRotateUpDown = !1,
  3547. this.rotateSpeed = 1,
  3548. this.keyboardZoomSpeed = 0,
  3549. this.keyPanSpeed = 7,
  3550. this.autoRotate = !1,
  3551. this.autoRotateSpeed = 2,
  3552. this.autoPan = !1,
  3553. this.autoPanPosition = new a.Vector3,
  3554. this.minPolarAngle = a.Math.degToRad(25),
  3555. this.maxPolarAngle = a.Math.degToRad(65),
  3556. this.rotationAcceleration = new a.Vector2,
  3557. this.rotationSpeed = new a.Vector2,
  3558. this.panAcceleration = new a.Vector2,
  3559. this.panSpeed = new a.Vector2,
  3560. this.rotateStart = new a.Vector2,
  3561. this.rotateEnd = new a.Vector2,
  3562. this.rotateDelta = new a.Vector2,
  3563. this.panStart = new a.Vector2,
  3564. this.panEnd = new a.Vector2,
  3565. this.panDelta = new a.Vector2,
  3566. this.panOffset = new a.Vector3,
  3567. this.offset = new a.Vector3,
  3568. this.dollyStart = new a.Vector2,
  3569. this.dollyEnd = new a.Vector2,
  3570. this.dollyDelta = new a.Vector2,
  3571. this.phiDelta = 0,
  3572. this.thetaDelta = 0,
  3573. this.scale = 1,
  3574. this.panVector = new a.Vector3,
  3575. this.lastPosition = new a.Vector3,
  3576. this.state = u.NONE,
  3577. this.mouseActions = {},
  3578. this.mouseActions[d.LEFT] = u.ROTATE,
  3579. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3580. this.mouseActions[d.RIGHT] = u.PAN,
  3581. this.touchActions = {},
  3582. this.touchActions[1] = u.ROTATE,
  3583. this.touchActions[2] = u.PAN_DOLLY,
  3584. this.lastMoveTime = 0,
  3585. this.pointersLimit = 2,
  3586. this.pointers = []
  3587. }
  3588. 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;
  3589. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3590. this.targetBounds = e
  3591. }
  3592. ,
  3593. n.prototype.isEngaged = function() {
  3594. return this.state !== u.NONE
  3595. }
  3596. ,
  3597. n.prototype.rotateLeft = function(e) {
  3598. void 0 === e && (e = this.getAutoRotationAngle()),
  3599. this.thetaDelta -= e
  3600. }
  3601. ,
  3602. n.prototype.rotateUp = function(e) {
  3603. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3604. this.phiDelta -= e)
  3605. }
  3606. ,
  3607. n.prototype.panLeft = function(e) {
  3608. var t = this.camera.matrix.elements;
  3609. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3610. this.panOffset.multiplyScalar(-e),
  3611. this.panVector.add(this.panOffset)
  3612. }
  3613. ,
  3614. n.prototype.panUp = function(e) {
  3615. var t = this.camera.matrix.elements;
  3616. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3617. this.panOffset.multiplyScalar(-e),
  3618. this.panVector.add(this.panOffset)
  3619. }
  3620. ,
  3621. n.prototype.startRotating = function(e, t) {
  3622. e && this.navRotationAcc("x", e),
  3623. t && this.navRotationAcc("y", t)
  3624. }
  3625. ,
  3626. n.prototype.stopRotating = function(e) {
  3627. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3628. this.navRotationAcc("x", 0),
  3629. this.navRotationAcc("y", 0)
  3630. }
  3631. ,
  3632. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3633. o = new a.Vector3,
  3634. function(e, t) {
  3635. r.copy(this.camera.position),
  3636. void 0 === e && null === e || r.setX(e),
  3637. void 0 === t && null === t || r.setZ(t);
  3638. var i = this.camera.position.distanceTo(this.target)
  3639. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3640. this.targetClamped = !1,
  3641. o.copy(r).addScaledVector(n, i),
  3642. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3643. r.copy(o).addScaledVector(n, -i),
  3644. this.targetClamped = !0),
  3645. this.autoPanPosition.x = r.x,
  3646. this.autoPanPosition.z = r.z,
  3647. this.autoPan && this.stopAutoPanning()
  3648. }
  3649. ),
  3650. n.prototype.stopAutoPanning = function() {
  3651. var e = this.autoPan;
  3652. this.autoPan = !1,
  3653. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3654. }
  3655. ,
  3656. n.prototype.dollyIn = function(e) {
  3657. void 0 === e && (e = this.getZoomScale()),
  3658. this.scale /= e
  3659. }
  3660. ,
  3661. n.prototype.dollyOut = function(e) {
  3662. void 0 === e && (e = this.getZoomScale()),
  3663. this.scale *= e
  3664. }
  3665. ,
  3666. n.prototype.updatePan = function(e) {
  3667. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3668. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3669. this.autoPan) {
  3670. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3671. t.setY(0).clampLength(0, 50 * e),
  3672. this.target.add(t),
  3673. this.camera.position.add(t),
  3674. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3675. this.stopAutoPanning())
  3676. }
  3677. }
  3678. ,
  3679. n.prototype.update = function(e) {
  3680. e = e || 1 / 60,
  3681. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3682. this.rotateLeft(-this.rotationSpeed.x),
  3683. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3684. this.updatePan(e);
  3685. var t = this.camera.position;
  3686. this.offset.copy(t).sub(this.target);
  3687. var i = Math.atan2(this.offset.x, this.offset.z)
  3688. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3689. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3690. i += this.thetaDelta,
  3691. n += this.phiDelta,
  3692. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3693. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3694. var r = this.updateZoom();
  3695. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3696. this.target.add(this.panVector),
  3697. this.targetBounds.clampPoint(this.target, this.target),
  3698. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3699. this.offset.y = r * Math.cos(n),
  3700. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3701. t.copy(this.target).add(this.offset),
  3702. this.camera.lookAt(this.target),
  3703. this.thetaDelta = 0,
  3704. this.phiDelta = 0,
  3705. this.scale = 1,
  3706. this.panVector.set(0, 0, 0),
  3707. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3708. }
  3709. ,
  3710. n.prototype.getAutoRotationAngle = function() {
  3711. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3712. }
  3713. ,
  3714. n.prototype.getZoomScale = function() {
  3715. return Math.pow(.95, this.zoomSpeed)
  3716. }
  3717. ,
  3718. n.prototype.onMouseDown = function(e) {
  3719. if (this.enabled) {
  3720. switch (e.preventDefault(),
  3721. this.stopAutoPanning(),
  3722. this.mouseDown = !0,
  3723. this.state = this.mouseActions[e.button],
  3724. this.state) {
  3725. case u.ROTATE:
  3726. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3727. this.rotationSpeed.set(0, 0);
  3728. break;
  3729. case u.DOLLY:
  3730. this.dollyStart.set(e.clientX, e.clientY);
  3731. break;
  3732. case u.PAN:
  3733. this.panStart.set(e.clientX, e.clientY)
  3734. }
  3735. this.emit(f.InputStart, "mouse")
  3736. }
  3737. }
  3738. ,
  3739. n.prototype.onMouseMove = function(e) {
  3740. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3741. switch (e.preventDefault(),
  3742. this.state) {
  3743. case u.ROTATE:
  3744. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3745. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3746. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3747. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3748. this.rotateStart.copy(this.rotateEnd);
  3749. break;
  3750. case u.DOLLY:
  3751. this.dollyEnd.set(e.clientX, e.clientY),
  3752. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3753. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3754. this.dollyStart.copy(this.dollyEnd);
  3755. break;
  3756. case u.PAN:
  3757. this.panEnd.set(e.clientX, e.clientY),
  3758. this.panDelta.subVectors(this.panEnd, this.panStart),
  3759. this.pan(this.panDelta.x, this.panDelta.y),
  3760. this.panStart.copy(this.panEnd)
  3761. }
  3762. this.emit(f.Move, "mouse"),
  3763. this.lastMoveTime = e.timeStamp,
  3764. this.update()
  3765. }
  3766. }
  3767. ,
  3768. n.prototype.onMouseUp = function(e) {
  3769. this.enabled && (this.mouseDown = !1,
  3770. this.state = u.NONE,
  3771. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3772. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3773. this.update(),
  3774. this.rotationAcceleration.set(0, 0),
  3775. this.rotateDelta.set(0, 0)))
  3776. }
  3777. ,
  3778. n.prototype.onMouseOver = function(e) {
  3779. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3780. }
  3781. ,
  3782. n.prototype.onMouseWheel = function(e) {
  3783. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3784. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3785. this.update())
  3786. }
  3787. ,
  3788. n.prototype.onKeyDown = function(e) {
  3789. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3790. this.handleKeyDown(e.which)))
  3791. }
  3792. ,
  3793. n.prototype.navRotationAcc = function(e, t) {
  3794. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3795. }
  3796. ,
  3797. n.prototype.navPanAcc = function(e, t) {
  3798. this.stopAutoPanning(),
  3799. this.panAcceleration[e] = t
  3800. }
  3801. ,
  3802. n.prototype.handleKeyDown = function(e) {
  3803. var t = !0;
  3804. switch (e) {
  3805. case p.UPARROW:
  3806. case p.I:
  3807. this.navRotationAcc("y", 1);
  3808. break;
  3809. case p.DOWNARROW:
  3810. case p.K:
  3811. this.navRotationAcc("y", -1);
  3812. break;
  3813. case p.LEFTARROW:
  3814. case p.J:
  3815. this.navRotationAcc("x", -1);
  3816. break;
  3817. case p.RIGHTARROW:
  3818. case p.L:
  3819. this.navRotationAcc("x", 1);
  3820. break;
  3821. case p.W:
  3822. this.navPanAcc("y", 1);
  3823. break;
  3824. case p.S:
  3825. this.navPanAcc("y", -1);
  3826. break;
  3827. case p.A:
  3828. this.navPanAcc("x", -1);
  3829. break;
  3830. case p.D:
  3831. this.navPanAcc("x", 1);
  3832. break;
  3833. default:
  3834. t = !1
  3835. }
  3836. t && this.emit(f.Move, "key")
  3837. }
  3838. ,
  3839. n.prototype.onKeyUp = function(e) {
  3840. this.enabled && (e.preventDefault(),
  3841. e.stopPropagation(),
  3842. this.handleKeyUp(e.which))
  3843. }
  3844. ,
  3845. n.prototype.handleKeyUp = function(e) {
  3846. switch (e) {
  3847. case p.I:
  3848. case p.K:
  3849. case p.UPARROW:
  3850. case p.DOWNARROW:
  3851. this.keyboardZoomSpeed = 0,
  3852. this.rotationAcceleration.y = 0;
  3853. break;
  3854. case p.J:
  3855. case p.L:
  3856. case p.LEFTARROW:
  3857. case p.RIGHTARROW:
  3858. this.rotationAcceleration.x = 0;
  3859. break;
  3860. case p.S:
  3861. case p.W:
  3862. this.panAcceleration.y = 0;
  3863. break;
  3864. case p.A:
  3865. case p.D:
  3866. this.panAcceleration.x = 0
  3867. }
  3868. }
  3869. ,
  3870. n.prototype.onTouchStart = function(i) {
  3871. if (this.enabled || this.state === u.NONE) {
  3872. i.preventDefault(),
  3873. i.stopPropagation(),
  3874. this.stopAutoPanning();
  3875. var e = function() {
  3876. if (2 === i.touches.length) {
  3877. var e = i.touches[0].pageX - i.touches[1].pageX
  3878. , t = i.touches[0].pageY - i.touches[1].pageY;
  3879. this.dollyStart.set(e, t)
  3880. }
  3881. }
  3882. .bind(this)
  3883. , t = function() {
  3884. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3885. }
  3886. .bind(this)
  3887. , n = function() {
  3888. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3889. }
  3890. .bind(this);
  3891. switch (this.state = this.touchActions[i.touches.length],
  3892. this.state) {
  3893. case u.PAN_DOLLY:
  3894. e();
  3895. case u.PAN:
  3896. t();
  3897. break;
  3898. case u.ROTATE_DOLLY:
  3899. e();
  3900. case u.ROTATE:
  3901. n()
  3902. }
  3903. this.rotationSpeed.set(0, 0),
  3904. this.emit(f.InputStart, "touch")
  3905. }
  3906. }
  3907. ,
  3908. n.prototype.onTouchMove = function(a) {
  3909. if (this.enabled && this.state !== u.NONE) {
  3910. a.preventDefault(),
  3911. a.stopPropagation();
  3912. var s = function() {
  3913. var e = a.touches[0].pageX - a.touches[1].pageX
  3914. , t = a.touches[0].pageY - a.touches[1].pageY;
  3915. this.dollyEnd.set(e, t);
  3916. var i = this.dollyStart.length() - this.dollyEnd.length();
  3917. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3918. this.dollyStart.copy(this.dollyEnd)
  3919. }
  3920. .bind(this)
  3921. , e = function() {
  3922. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3923. this.panDelta.subVectors(this.panEnd, this.panStart),
  3924. this.pan(this.panDelta.x, this.panDelta.y),
  3925. this.panStart.copy(this.panEnd),
  3926. this.rotateDelta.set(0, 0)
  3927. }
  3928. .bind(this)
  3929. , l = function() {
  3930. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3931. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3932. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3933. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3934. this.rotateStart.copy(this.rotateEnd)
  3935. }
  3936. .bind(this)
  3937. , t = function() {
  3938. if (2 === a.touches.length) {
  3939. var e = window.devicePixelRatio || 1
  3940. , t = a.touches[1].pageX - a.touches[0].pageX
  3941. , i = a.touches[1].pageY - a.touches[0].pageY
  3942. , n = Math.sqrt(t * t + i * i);
  3943. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3944. this.state = u.DOLLY,
  3945. s();
  3946. else {
  3947. var r = h.average(a.touches, "pageX")
  3948. , o = h.average(a.touches, "pageY");
  3949. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3950. this.rotateStart.set(r, o),
  3951. l())
  3952. }
  3953. }
  3954. }
  3955. .bind(this);
  3956. switch (this.state) {
  3957. case u.PAN_DOLLY:
  3958. s();
  3959. case u.PAN:
  3960. e();
  3961. break;
  3962. case u.ROTATE_DOLLY:
  3963. t();
  3964. break;
  3965. case u.DOLLY:
  3966. s();
  3967. break;
  3968. case u.ROTATE:
  3969. l();
  3970. break;
  3971. default:
  3972. this.state = u.NONE
  3973. }
  3974. this.lastMoveTime = a.timeStamp,
  3975. this.emit(f.Move, "touch")
  3976. }
  3977. }
  3978. ,
  3979. n.prototype.onTouchEnd = function(e) {
  3980. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3981. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3982. this.state = u.NONE,
  3983. this.update(),
  3984. this.rotationAcceleration.set(0, 0),
  3985. this.rotateDelta.set(0, 0))
  3986. }
  3987. ,
  3988. n.prototype.onPointerDown = function(e) {
  3989. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3990. id: e.pointerId,
  3991. pageX: e.pageX,
  3992. pageY: e.pageY
  3993. }),
  3994. e.touches = this.pointers,
  3995. this.onTouchStart(e)),
  3996. this.emit(f.InputStart, "pointer"))
  3997. }
  3998. ,
  3999. n.prototype.onPointerMove = function(t) {
  4000. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4001. t.pointerId === e.id && (e.pageX = t.pageX,
  4002. e.pageY = t.pageY)
  4003. }),
  4004. t.touches = this.pointers,
  4005. this.onTouchMove(t))
  4006. }
  4007. ,
  4008. n.prototype.onPointerUp = function(i) {
  4009. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4010. i.pointerId === e.id && this.pointers.splice(t, 1)
  4011. }
  4012. .bind(this)),
  4013. i.touches = this.pointers,
  4014. this.onTouchEnd(i))
  4015. }
  4016. ,
  4017. n.prototype.reset = function() {
  4018. this.state = u.NONE,
  4019. this.stopAutoPanning(),
  4020. this.rotationSpeed.set(0, 0),
  4021. this.rotationAcceleration.set(0, 0),
  4022. this.panSpeed.set(0, 0),
  4023. this.panAcceleration.set(0, 0)
  4024. }
  4025. ,
  4026. n.prototype.toJSON = function() {
  4027. return {
  4028. camera_position: {
  4029. x: s.toPrecision(this.camera.position.x, 4),
  4030. y: s.toPrecision(this.camera.position.y, 4),
  4031. z: s.toPrecision(this.camera.position.z, 4)
  4032. },
  4033. camera_quaternion: {
  4034. x: s.toPrecision(this.camera.quaternion.x, 4),
  4035. y: s.toPrecision(this.camera.quaternion.y, 4),
  4036. z: s.toPrecision(this.camera.quaternion.z, 4),
  4037. w: s.toPrecision(this.camera.quaternion.w, 4)
  4038. }
  4039. }
  4040. }
  4041. ,
  4042. t.exports = n
  4043. }
  4044. , {
  4045. "../enum/ControlActions": 20,
  4046. "../enum/ControlEvents": 21,
  4047. "../enum/Keys": 30,
  4048. "../enum/MouseButton": 34,
  4049. "../enum/Vectors": 50,
  4050. "../settings": 166,
  4051. "../util/common": 185,
  4052. "../util/math": 190,
  4053. events: 202,
  4054. three: 217
  4055. }],
  4056. 13: [function(u, d, e) {
  4057. (function(e) {
  4058. "use strict";
  4059. function t(e) {
  4060. this.camera = e,
  4061. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  4062. this.lookVector = new s.Vector3,
  4063. this.lookSpeed = .05,
  4064. this.rotationAcc = new s.Vector2,
  4065. this.rotationSpeed = new s.Vector2,
  4066. this.lat = 0,
  4067. this.lon = 0,
  4068. this.phi = 0,
  4069. this.theta = 0,
  4070. this.enabled = !1,
  4071. this.locked = !1,
  4072. this.pointer = new s.Vector2(0,0),
  4073. this.rotationHistory = [],
  4074. this.rotationDifference = new s.Vector2,
  4075. this.pointerDragOn = !1,
  4076. this.pointerDragStart = new s.Vector2(0,0),
  4077. this.pinchDistance = 0,
  4078. this.moveStart = new s.Vector2,
  4079. this.moveTolerance = .01,
  4080. this.pointersLimit = 2,
  4081. this.pointers = []
  4082. }
  4083. var s = u("three")
  4084. , i = u("../util/logger")
  4085. , n = u("../settings")
  4086. , r = u("../util/common")
  4087. , o = u("../util/math")
  4088. , a = (u("../enum/Vectors"),
  4089. u("../enum/MouseButton"))
  4090. , l = u("../enum/Keys")
  4091. , c = u("../enum/ControlEvents")
  4092. , h = u("events").EventEmitter;
  4093. new i(e),
  4094. (t.prototype = Object.create(h.prototype)).usable = function() {
  4095. return this.enabled && !this.locked
  4096. }
  4097. ,
  4098. /* t.prototype.lookAt = function(e) {
  4099. var t = this.camera.position.clone().sub(e)
  4100. , i = Math.atan(t.z / t.x);
  4101. i += t.x < 0 ? Math.PI : 0,
  4102. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  4103. this.lon = s.Math.radToDeg(i) + 180;
  4104. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4105. , r = Math.atan(t.y / n);
  4106. this.lat = -s.Math.radToDeg(r)
  4107. } */
  4108. t.prototype.lookAt = function(aim, dir) {
  4109. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4110. var i = Math.atan(t.z / t.x);
  4111. i += t.x < 0 ? Math.PI : 0;
  4112. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4113. this.lon = s.Math.radToDeg(i) + 180;
  4114. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4115. o = Math.atan(t.y / n);
  4116. this.lat = -s.Math.radToDeg(o);
  4117. }
  4118. ,
  4119. t.prototype.startRotationFrom = function(e, t) {
  4120. o.convertScreenPositionToNDC(e, t, this.pointer),
  4121. this.pointerDragOn = !0,
  4122. this.pointerDragStart.copy(this.pointer),
  4123. this.moveStart.copy(this.pointer),
  4124. this.rotationHistory = [],
  4125. this.rotationSpeed.set(0, 0)
  4126. }
  4127. ,
  4128. t.prototype.onMouseOver = function(e) {
  4129. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4130. }
  4131. ,
  4132. t.prototype.onTouchStart = function(e) {
  4133. if (this.usable()) {
  4134. switch (e.preventDefault(),
  4135. e.stopPropagation(),
  4136. e.touches.length) {
  4137. case 1:
  4138. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4139. break;
  4140. case 2:
  4141. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4142. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4143. this.pinchDistance = Math.sqrt(t * t + i * i)
  4144. }
  4145. this.emit(c.InputStart, "touch")
  4146. }
  4147. }
  4148. ,
  4149. t.prototype.onPointerDown = function(e) {
  4150. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4151. id: e.pointerId,
  4152. clientX: e.clientX,
  4153. clientY: e.clientY
  4154. }),
  4155. e.touches = this.pointers,
  4156. this.onTouchStart(e),
  4157. this.emit(c.InputStart, "pointer"))
  4158. }
  4159. ,
  4160. t.prototype.onMouseDown = function(e) {
  4161. if (this.usable()) {
  4162. switch (e.preventDefault(),
  4163. e.stopPropagation(),
  4164. e.button) {
  4165. case a.LEFT:
  4166. this.startRotationFrom(e.clientX, e.clientY)
  4167. }
  4168. this.emit(c.InputStart, "mouse")
  4169. }
  4170. }
  4171. ,
  4172. t.prototype.updateRotation = function() {
  4173. if (this.usable() && this.pointerDragOn) {
  4174. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4175. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4176. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4177. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4178. , r = Math.atan2(e.y, i)
  4179. , o = Math.atan2(t.y, n);
  4180. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4181. e.y = 0,
  4182. t.y = 0;
  4183. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4184. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4185. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4186. this.pointerDragStart.copy(this.pointer)
  4187. }
  4188. }
  4189. ,
  4190. t.prototype.onMouseMove = function(e) {
  4191. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4192. 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"))
  4193. }
  4194. ,
  4195. t.prototype.onTouchMove = function(e) {
  4196. if (this.usable())
  4197. switch (this.emit(c.Move, "touch"),
  4198. e.touches.length) {
  4199. case 1:
  4200. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4201. break;
  4202. case 2:
  4203. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4204. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4205. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4206. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4207. this.emit(c.Pinch, n),
  4208. this.pinchDistance -= n)
  4209. }
  4210. }
  4211. ,
  4212. t.prototype.onPointerMove = function(t) {
  4213. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4214. t.pointerId === e.id && (e.clientX = t.clientX,
  4215. e.clientY = t.clientY)
  4216. }),
  4217. t.touches = this.pointers,
  4218. this.onTouchMove(t))
  4219. }
  4220. ,
  4221. t.prototype.endRotation = function() {
  4222. this.pointerDragOn = !1;
  4223. var e = r.averageVectors(this.rotationHistory);
  4224. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4225. }
  4226. ,
  4227. t.prototype.onTouchEnd = function(e) {
  4228. this.usable() && (e.preventDefault(),
  4229. e.stopPropagation(),
  4230. this.endRotation())
  4231. }
  4232. ,
  4233. t.prototype.onMouseUp = function(e) {
  4234. this.usable() && (e.preventDefault(),
  4235. e.stopPropagation(),
  4236. this.endRotation())
  4237. }
  4238. ,
  4239. t.prototype.onPointerUp = function(i) {
  4240. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4241. i.pointerId === e.id && this.pointers.splice(t, 1)
  4242. }
  4243. .bind(this)),
  4244. i.touches = this.pointers,
  4245. this.onTouchEnd(i))
  4246. }
  4247. ,
  4248. t.prototype.update = function(e) {
  4249. for (this.lon,
  4250. this.lat,
  4251. this.updateRotation(),
  4252. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4253. this.rotationHistory.shift();
  4254. this.lon += this.rotationDifference.x,
  4255. this.lat += this.rotationDifference.y,
  4256. this.rotationDifference.set(0, 0),
  4257. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4258. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4259. this.lon += this.rotationSpeed.x * e,
  4260. this.lat += this.rotationSpeed.y * e
  4261. var insideLookLimitDown = n.insideLookLimitDown - n.insideFOV/2 + this.camera.fov / 2
  4262. var insideLookLimitUp = n.insideLookLimitUp + n.insideFOV/2 - this.camera.fov / 2
  4263. this.lat = Math.max(insideLookLimitDown, Math.min(insideLookLimitUp, this.lat)); //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
  4264. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4265. this.phi = s.Math.degToRad(90 - this.lat),
  4266. this.theta = s.Math.degToRad(this.lon),
  4267. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4268. this.lookVector.y = Math.cos(this.phi),
  4269. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4270. this.target.copy(this.lookVector).add(this.camera.position),
  4271. this.camera.lookAt(this.target)
  4272. }
  4273. ,
  4274. t.prototype.onMouseWheel = function(e) {
  4275. if (this.usable()) {
  4276. var t = e.wheelDelta || -e.detail;
  4277. this.emit(c.InteractionDirect),
  4278. this.emit(c.Scroll, t)
  4279. }
  4280. }
  4281. ,
  4282. t.prototype.onKeyDown = function(e) {
  4283. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4284. this.handleKeyDown(e.which)))
  4285. }
  4286. ,
  4287. t.prototype.handleKeyDown = function(e) {
  4288. var t = function(e, t) {
  4289. this.rotationAcc[e] = t
  4290. }
  4291. .bind(this);
  4292. this.emit(c.InteractionKey);
  4293. var i = !0;
  4294. switch (e) {
  4295. case l.LEFTARROW:
  4296. case l.J:
  4297. t("x", -1);
  4298. break;
  4299. case l.RIGHTARROW:
  4300. case l.L:
  4301. t("x", 1);
  4302. break;
  4303. case l.I:
  4304. t("y", 1);
  4305. break;
  4306. case l.K:
  4307. t("y", -1);
  4308. break;
  4309. default:
  4310. i = !1
  4311. }
  4312. i && this.emit(c.Move, "key")
  4313. }
  4314. ,
  4315. t.prototype.onKeyUp = function(e) {
  4316. this.usable() && (e.preventDefault(),
  4317. e.stopPropagation(),
  4318. this.handleKeyUp(e.which))
  4319. }
  4320. ,
  4321. t.prototype.handleKeyUp = function(e) {
  4322. switch (e) {
  4323. case l.LEFTARROW:
  4324. case l.J:
  4325. case l.RIGHTARROW:
  4326. case l.L:
  4327. this.rotationAcc.x = 0;
  4328. break;
  4329. case l.I:
  4330. case l.K:
  4331. this.rotationAcc.y = 0
  4332. }
  4333. }
  4334. ,
  4335. t.prototype.startRotating = function(e, t) {
  4336. e && (this.rotationAcc.x = e),
  4337. t && (this.rotationAcc.y = t)
  4338. }
  4339. ,
  4340. t.prototype.stopRotating = function(e) {
  4341. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4342. this.rotationAcc.set(0, 0)
  4343. }
  4344. ,
  4345. t.prototype.reset = function() {
  4346. this.pointerDragOn = !1,
  4347. this.rotationAcc.set(0, 0),
  4348. this.rotationSpeed.set(0, 0),
  4349. this.pointers = []
  4350. }
  4351. ,
  4352. t.prototype.toJSON = function() {
  4353. return {
  4354. camera_position: {
  4355. x: o.toPrecision(this.camera.position.x, 4),
  4356. y: o.toPrecision(this.camera.position.y, 4),
  4357. z: o.toPrecision(this.camera.position.z, 4)
  4358. },
  4359. camera_quaternion: {
  4360. x: o.toPrecision(this.camera.quaternion.x, 4),
  4361. y: o.toPrecision(this.camera.quaternion.y, 4),
  4362. z: o.toPrecision(this.camera.quaternion.z, 4),
  4363. w: o.toPrecision(this.camera.quaternion.w, 4)
  4364. }
  4365. }
  4366. }
  4367. ,
  4368. t.prototype.setStateFromJSON = function(e) {
  4369. this.camera.position.copy(e.camera_position),
  4370. this.camera.quaternion.copy(e.camera_quaternion)
  4371. }
  4372. ,
  4373. d.exports = t
  4374. }
  4375. ).call(this, "/js/controls/PanoramaControls.js")
  4376. }
  4377. , {
  4378. "../enum/ControlEvents": 21,
  4379. "../enum/Keys": 30,
  4380. "../enum/MouseButton": 34,
  4381. "../enum/Vectors": 50,
  4382. "../settings": 166,
  4383. "../util/common": 185,
  4384. "../util/logger": 189,
  4385. "../util/math": 190,
  4386. events: 202,
  4387. three: 217
  4388. }],
  4389. 14: [function(t, i, e) {
  4390. (function(e) {
  4391. "use strict";
  4392. var c = t("three")
  4393. , h = t("../enum/Viewmode")
  4394. , u = new (t("../util/logger"))(e);
  4395. i.exports = {
  4396. serialize: function(e) {
  4397. return encodeURI(JSON.stringify(e))
  4398. },
  4399. deserialize: function(e) {
  4400. function t(e) {
  4401. return e.reduce(function(e, t) {
  4402. return e && "number" == typeof t && !isNaN(t)
  4403. }, !0)
  4404. }
  4405. try {
  4406. var i = JSON.parse(decodeURI(e))
  4407. , n = {
  4408. mode: h.fromInt(i.camera_mode),
  4409. panoId: i.scan_id,
  4410. position: (new c.Vector3).copy(i.camera_position),
  4411. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4412. zoom: i.ortho_zoom,
  4413. floorVisibility: i.floor_visibility
  4414. }
  4415. , r = n.position;
  4416. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4417. var o = n.quaternion;
  4418. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4419. n
  4420. } catch (i) {
  4421. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4422. try {
  4423. var a = e.split(",")
  4424. , s = {
  4425. x: parseFloat(a[2]),
  4426. y: parseFloat(a[3]),
  4427. z: parseFloat(a[4])
  4428. }
  4429. , l = {
  4430. x: parseFloat(a[5]),
  4431. y: parseFloat(a[6]),
  4432. z: parseFloat(a[7]),
  4433. w: parseFloat(a[8])
  4434. };
  4435. return t([s.x, s.y, s.z]) || (s.x = 0,
  4436. s.y = 0,
  4437. s.z = 0),
  4438. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4439. l.y = 0,
  4440. l.z = 0,
  4441. l.w = 1),
  4442. {
  4443. mode: h.fromInt(a[0]),
  4444. panoId: a[1],
  4445. position: (new c.Vector3).copy(s),
  4446. quaternion: (new c.Quaternion).copy(l)
  4447. }
  4448. } catch (t) {
  4449. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4450. }
  4451. }
  4452. return null
  4453. }
  4454. }
  4455. }
  4456. ).call(this, "/js/controls/serializer.js")
  4457. }
  4458. , {
  4459. "../enum/Viewmode": 51,
  4460. "../util/logger": 189,
  4461. three: 217
  4462. }],
  4463. 15: [function(C, I, e) {
  4464. (function(e) {
  4465. "use strict";
  4466. function t() {
  4467. this.endlessLoop = r.warp.loop,
  4468. this.clock = new i.Clock(!0),
  4469. this.model = null,
  4470. this.player = null,
  4471. this.currentItem = null,
  4472. this.destinationItem = null,
  4473. this.tourIsPlaying = !1,
  4474. this.transitionStage = v.None,
  4475. this.nextFunc = null,
  4476. this.onTheBus = !1,
  4477. this.tourInProgress = !1,
  4478. this.reachSource = null,
  4479. this.interrupted = !1,
  4480. this.nItems = 0,
  4481. this.walkingSectionPaused = !1
  4482. }
  4483. var i = C("three")
  4484. , n = C("./util/logger")
  4485. , r = C("./settings")
  4486. , o = C("./util/transitions")
  4487. , a = C("events").EventEmitter
  4488. , s = C("./enum/Viewmode")
  4489. , l = C("./analytics")
  4490. , c = C("./enum/WarpStyle")
  4491. , h = (o = C("./util/transitions"),
  4492. C("./model/ModelManager"),
  4493. C("./enum/ModelManagerEvents"))
  4494. , u = C("./enum/DirectorEvents")
  4495. , d = C("./enum/PlayerEvents")
  4496. , p = (C("./enum/ControlEvents"),
  4497. C("./enum/BlackoutStyle"))
  4498. , f = C("./enum/PathDiscardMode")
  4499. , g = C("./enum/PathDisplayMode")
  4500. , m = (C("./player"),
  4501. new n(e))
  4502. , v = Object.freeze({
  4503. None: 0,
  4504. Moving: 1,
  4505. Aiming: 2,
  4506. Interlude: 3
  4507. })
  4508. , y = Object.freeze({
  4509. Forward: 1,
  4510. NoChange: 0,
  4511. Backwards: -1
  4512. })
  4513. , A = o.getUniqueId();
  4514. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4515. this.player = e,
  4516. this.modelManager = t,
  4517. this.updateModel(),
  4518. this.resetAll(),
  4519. this.bindEvents()
  4520. }
  4521. ,
  4522. t.prototype.resetAll = function() {
  4523. if (this.currentItem = null,
  4524. this.destinationItem = null,
  4525. this.tourIsPlaying = !1,
  4526. this.bgmReplay(),
  4527. this.transitionStage = v.None,
  4528. this.nextFunc = null,
  4529. this.onTheBus = !1,
  4530. this.reachSource = null,
  4531. this.interrupted = !1,
  4532. this.model) {
  4533. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4534. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4535. } else
  4536. this.defaultWarpStyle = c.BLACK,
  4537. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4538. this.resetSpecialTransition()
  4539. }
  4540. ,
  4541. t.prototype.updateModel = function() {
  4542. this.model = this.modelManager.getActiveModel(),
  4543. this.nItems = this.model.heroLocations.length
  4544. }
  4545. ,
  4546. t.prototype.bindEvents = function() {
  4547. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4548. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4549. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4550. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4551. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4552. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4553. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4554. this.player.once(d.Move, function() {
  4555. o.cancelById(A)
  4556. })
  4557. }
  4558. ,
  4559. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4560. return e === c.WALK && (this.interrupt(p.NONE),
  4561. this.pauseWalkingSection(),
  4562. this.player.fastForwardActivePanoFlight(),
  4563. !0)
  4564. }
  4565. ,
  4566. t.prototype.handlePlayerMove = function(e) {
  4567. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4568. this.emit("update.controls")
  4569. }
  4570. ,
  4571. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4572. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4573. this.emit("update.controls"))
  4574. }
  4575. ,
  4576. t.prototype.handlePlayerModeChanged = function(e, t) {
  4577. this.intermediateState() || e === t || (this.onTheBus = !1,
  4578. this.emit("update.controls"))
  4579. }
  4580. ,
  4581. t.prototype.handlePlayerInputStart = function(e) {
  4582. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4583. }
  4584. ,
  4585. t.prototype.handlePlayerFlyingStarted = function() {
  4586. this.clearWalkingSectionPaused()
  4587. }
  4588. ,
  4589. t.prototype.describe = function() {
  4590. return {
  4591. nItems: this.nItems,
  4592. currentItem: this.currentItem,
  4593. destinationItem: this.destinationItem,
  4594. tourIsPlaying: this.tourIsPlaying,
  4595. onTheBus: this.onTheBus,
  4596. endlessLoop: this.endlessLoop,
  4597. viewMode: this.player.mode,
  4598. inTransition: this._inTransition(),
  4599. transitionStage: this.transitionStage,
  4600. tourInProgress: this.tourInProgress
  4601. }
  4602. }
  4603. ,
  4604. t.prototype._inTransition = function() {
  4605. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4606. }
  4607. ,
  4608. t.prototype.bounceable = function() {
  4609. var e = this.clock.getDelta();
  4610. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4611. }
  4612. ,
  4613. t.prototype.itemCompare = function(item1, item2, type){//add
  4614. if(type == 'equal'){//==
  4615. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4616. }else if(type == 'less'){//<
  4617. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4618. }
  4619. }
  4620. t.prototype.currentMoveDirection = function() {
  4621. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4622. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.itemCompare(this.destinationItem, this.currentItem,'equal') ? y.NoChange : this.itemCompare(this.currentItem, this.destinationItem,'less') ? y.Forward : y.Backwards
  4623. }
  4624. ,
  4625. t.prototype.clearPath = function() {
  4626. this._inTransition() || this.player.path.discardPathObject()
  4627. }
  4628. ,
  4629. t.prototype.allFloors = function() {
  4630. this.model.toggleAllFloors()
  4631. }
  4632. ,
  4633. t.prototype.actionComplete = function(e) {
  4634. if (this.interrupted = !1,
  4635. this.transitionStage = v.None,
  4636. this.resetSpecialTransition(),
  4637. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4638. this.tourIsPlaying || (this.player.disablePreRendering(),
  4639. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4640. this.emit("update.controls"),
  4641. this.nextFunc) {
  4642. var t = this.nextFunc;
  4643. this.nextFunc = null,
  4644. t()
  4645. }
  4646. }
  4647. ,
  4648. t.prototype.awaitCompletion = function(e, t) {
  4649. this.nextFunc = t,
  4650. e()
  4651. }
  4652. ,
  4653. t.prototype.updateSuccessFunction = function(e) {
  4654. this.nextFunc = e
  4655. }
  4656. ,
  4657. t.prototype.interrupt = function(e, t) {
  4658. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4659. this.tourIsPlaying = !1,
  4660. this.bgmReplay(),
  4661. this.interrupted = !0,
  4662. this.nextFunc = null,
  4663. this.emit(u.ActionInterrupted),
  4664. null != e || (e = p.BEGINNING),
  4665. this.player.interruptAndFastForward(e, t),
  4666. !0)
  4667. }
  4668. ,
  4669. t.prototype.wouldInterrupt = function() {
  4670. return this.transitionStage !== v.None
  4671. }
  4672. ,
  4673. t.prototype.intermediateState = function() {
  4674. return this.transitionStage !== v.None
  4675. }
  4676. ,
  4677. t.prototype.isInterrupted = function() {
  4678. return this.interrupted
  4679. }
  4680. ,
  4681. t.prototype.pauseWalkingSection = function() {
  4682. this.walkingSectionPaused = !0
  4683. }
  4684. ,
  4685. t.prototype.clearWalkingSectionPaused = function() {
  4686. this.walkingSectionPaused = !1
  4687. }
  4688. ,
  4689. t.prototype.autoTour = function() {
  4690. var i = Date.now();
  4691. this.model.auxDataPromise.then(function() {
  4692. i = Date.now() - i;
  4693. var e = r.warp.auto
  4694. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4695. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4696. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4697. done: function() {
  4698. this.playTour()
  4699. }
  4700. .bind(this),
  4701. name: "_atr",
  4702. id: A
  4703. })
  4704. }
  4705. .bind(this))
  4706. }
  4707. ,
  4708. t.prototype.atDestinationPano = function() {
  4709. if (!this.player.currentPano || null === this.destinationItem)
  4710. return !1;
  4711. var e = this.player.currentPano.id;
  4712. if (void 0 === e)
  4713. return !1;
  4714. var t = this.model.heroLocations;
  4715. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4716. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4717. return destination && destination.panoId == e
  4718. }
  4719. ,
  4720. t.prototype.redirectToItem = function(e, t) {
  4721. if (null != e)
  4722. if (this.wouldInterrupt())
  4723. if (this.player.mode !== s.TRANSITIONING) {
  4724. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4725. var i = function() {
  4726. o.setTimeout(function() {
  4727. this.setDestinationItem(e),
  4728. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4729. }
  4730. .bind(this), 0)
  4731. }
  4732. .bind(this);
  4733. this.interrupt(p.END, 0),
  4734. this.updateSuccessFunction(i)
  4735. } else
  4736. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4737. else
  4738. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4739. else
  4740. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4741. }
  4742. ,
  4743. t.prototype.useSpecialTransition = function(e) {
  4744. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4745. this.nextWarpStyle = c.BLACK
  4746. }
  4747. ,
  4748. t.prototype.resetSpecialTransition = function() {
  4749. this.nextWarpStyle = this.defaultWarpStyle
  4750. }
  4751. ,
  4752. t.prototype.arrivedAtDestination = function(e) {
  4753. if (this.player.flying || this.player.isWarping())
  4754. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4755. else {
  4756. this.transitionStage = v.Aiming;
  4757. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4758. this.player.model.fadePanoMarkers(0),
  4759. this.awaitCompletion(function() {
  4760. this.resetSpecialTransition(),
  4761. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4762. }
  4763. .bind(this), t)
  4764. }
  4765. }
  4766. ,
  4767. t.prototype.goToDestination = function(e, t, i, n) {
  4768. //音频
  4769. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4770. if(musicInfo && musicInfo.music){
  4771. var o1 = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4772. let audioSrc1 = g_tourAudio.src.split('/').pop();
  4773. let audioSrc2 = o1.split('/').pop();
  4774. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4775. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4776. g_tourAudio.currentTime = 0; g_tourAudio.play();
  4777. }else if(g_tourAudio.paused && g_tourAudio.currentTime < g_tourAudio.duration){//未播完
  4778. g_tourAudio.play()
  4779. }
  4780. }else{//很可能是该folder的起始
  4781. g_tourAudio.src = manage.dealURL(o1);
  4782. g_tourAudio.load()
  4783. }
  4784. if(g_bgAudio && !g_bgAudio.paused){
  4785. manage.switchBgmState(false);
  4786. g_bgAudio.pauseByTour = true
  4787. }
  4788. }
  4789. if (this.onTheBus = !0,
  4790. this.emit("update.controls"),
  4791. this.player.updateLastView(),
  4792. n || !this.atDestinationPano()){
  4793. if (this.player.flying || this.player.isWarping())
  4794. m.warn("Cannot go to new destination while player is flying or warping.");
  4795. else {
  4796. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4797. , s = null
  4798. , l = null;
  4799. if (a.isPano()) {
  4800. o1 = this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4801. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this)),
  4802. s = this.arrivedAtDestination.bind(this, !0)
  4803. //add
  4804. if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
  4805. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4806. }
  4807. } else{
  4808. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4809. s = this.arrivedAtDestination.bind(this, !1);
  4810. }
  4811. this.transitionStage = v.Moving,
  4812. this.model.fadePanoMarkers(0),
  4813. this.awaitCompletion(function() {
  4814. l()
  4815. }
  4816. .bind(this), s),
  4817. this.emit("update.controls")
  4818. }
  4819. }else{
  4820. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4821. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4822. if(a.zoom && a.zoom != this.player.zoomLevel){
  4823. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4824. } */
  4825. this.arrivedAtDestination(!0)
  4826. }
  4827. }
  4828. ,
  4829. t.prototype.tourInterlude = function() {
  4830. if (l.trackAlways("reach_highlight", {
  4831. reach_source: this.reachSource
  4832. }),
  4833. this.model.fadePanoMarkers(0),
  4834. this.emit("update.controls"),
  4835. this.tourIsPlaying)
  4836. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4837. this.stopTour(),
  4838. this.emit(u.TourEnd),
  4839. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4840. this.transitionStage = v.Interlude,
  4841. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4842. }
  4843. .bind(this), this.goNext.bind(this))
  4844. }
  4845. ,
  4846. t.prototype.playTour = function() {
  4847. if (!this.bounceable())
  4848. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4849. this.tourInProgress = !0,
  4850. this.reachSource = "play",
  4851. this.tourIsPlaying = !0,
  4852. this.wasZoomEnabled = this.player.zoomEnabled,
  4853. this.player.zoomEnabled = !1,
  4854. this.resetSpecialTransition(),
  4855. this.emit("update.controls"),
  4856. this.emit(u.TourStart),
  4857. this.player.enablePreRendering(),
  4858. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4859. this.goToDestination()) : this.goNext()))
  4860. }
  4861. ,
  4862. t.prototype.bgmReplay = function() {
  4863. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4864. g_playAudio = g_bgAudio;
  4865. g_tourAudio && g_tourAudio.pause();
  4866. //window.tourAudio && window.tourAudio.pause();
  4867. manage.switchBgmState(true);
  4868. }
  4869. }
  4870. ,
  4871. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4872. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4873. this.tourIsPlaying = !1,
  4874. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4875. this.interrupt(),
  4876. this.clearWalkingSectionPaused(),
  4877. this.resetSpecialTransition(),
  4878. this.emit("update.controls"))
  4879. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4880. {
  4881. g_tourAudio.pause();
  4882. g_tourAudio.src = ""
  4883. }
  4884. }
  4885. ,
  4886. t.prototype.endTourProgress = function() {
  4887. this.tourInProgress = !1,
  4888. this.emit("update.controls"),
  4889. this.emit(u.TourEnd)
  4890. }
  4891. ,
  4892. t.prototype.goToHighlight = function(e) {
  4893. if (this.wouldInterrupt())
  4894. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4895. else {
  4896. if (m.debug("<tour.goto " + e + ">"),
  4897. this.isInterrupted())
  4898. return;
  4899. this.clearWalkingSectionPaused(),
  4900. this.setDestinationItem(e),
  4901. this.useSpecialTransition("Hilight"),
  4902. this.goToDestination(),
  4903. l.trackAlways("reach_highlight", {
  4904. reach_source: "thumb"
  4905. })
  4906. }
  4907. }
  4908. ,
  4909. t.prototype.prevHighlight = function() {
  4910. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4911. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4912. this.reachSource = "prev",
  4913. this.goPrev()))
  4914. }
  4915. ,
  4916. t.prototype.nextHighlight = function() {
  4917. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4918. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4919. this.reachSource = "next",
  4920. this.goNext()))
  4921. }
  4922. ,
  4923. t.prototype.changeMode = function(e) {
  4924. var t = $.Deferred()
  4925. , i = t.resolve.bind(t)
  4926. , n = t.reject.bind(t);
  4927. if (this.emit(u.StartModeChange),
  4928. !function() {
  4929. return this.clearWalkingSectionPaused(),
  4930. !!this.wouldInterrupt() && (this.interrupt(),
  4931. !0)
  4932. }
  4933. .bind(this)()) {
  4934. switch (e) {
  4935. case s.PANORAMA:
  4936. 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);
  4937. break;
  4938. case s.DOLLHOUSE:
  4939. case s.FLOORPLAN:
  4940. this.player.flyToNewMode({
  4941. mode: e
  4942. }).done(i).fail(n);
  4943. break;
  4944. case s.OUTDOOR:
  4945. 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)
  4946. }
  4947. return t.promise()
  4948. }
  4949. }
  4950. ,
  4951. t.prototype.atEndOfTour = function(item) {
  4952. //return this.currentItem >= this.nItems - 1
  4953. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4954. if(end){
  4955. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4956. if(heroLocations){
  4957. end = this.currentItem[1] >= heroLocations.length - 1
  4958. }
  4959. }
  4960. return end;
  4961. }
  4962. ,
  4963. t.prototype.firstDestination = function() {
  4964. //return 0 < this.nItems ? 0 : null
  4965. return 0 < this.nItems ? [0,0]: null
  4966. }
  4967. ,
  4968. t.prototype.finalDestination = function() {
  4969. //return 0 < this.nItems ? this.nItems - 1 : null
  4970. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4971. }
  4972. ,
  4973. t.prototype.goPrev = function() {
  4974. this.tourAdvance(-1)
  4975. }
  4976. ,
  4977. t.prototype.goNext = function() {
  4978. this.tourAdvance(1)
  4979. }
  4980. ,
  4981. t.prototype.setDestinationItem = function(e) {
  4982. this.destinationItem = e,
  4983. this.emit("update.controls")
  4984. }
  4985. ,
  4986. t.prototype.setCurrentItem = function(e) {
  4987. this.currentItem = e,
  4988. this.emit("update.controls")
  4989. }
  4990. ,
  4991. t.prototype.nextItem = function(currentItem) {
  4992. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4993. if(currentItem == void 0)return this.firstDestination()
  4994. var currentLocation = this.model.heroLocations[currentItem[0]];
  4995. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4996. var item;
  4997. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4998. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4999. }else{
  5000. item = [currentItem[0] , currentItem[1]+1]
  5001. }
  5002. if(item[0] >= this.nItems ){
  5003. item = this.firstDestination()
  5004. }
  5005. return item;
  5006. //暂时不理会endlessLoop,默认为false
  5007. }
  5008. ,
  5009. t.prototype.prevItem = function(currentItem) {
  5010. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5011. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  5012. var item;
  5013. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5014. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5015. else{
  5016. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5017. if(this.currentItem[1] == 0){//子目录中第一个
  5018. return [currentItem[0] - 1, lastChildNum-1]
  5019. }else{
  5020. return [currentItem[0], currentItem[1]-1]
  5021. }
  5022. }
  5023. }
  5024. ,
  5025. t.prototype.tourAdvance = function(e) {//e是1或-1
  5026. m.debug("tourAdvance(" + e + ")")
  5027. if(null === this.currentItem || void 0 === this.currentItem){
  5028. this.setDestinationItem(this.firstDestination())
  5029. }else{
  5030. var item
  5031. if(e == 1){
  5032. item = this.nextItem(this.currentItem)
  5033. /* var currentLocation = this.model.heroLocations[this.currentItem[0]];
  5034. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5035. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5036. this.setDestinationItem([this.currentItem[0] + 1, 0]) //结果可能超出nItems
  5037. }else{
  5038. this.setDestinationItem([this.currentItem[0] , this.currentItem[1]+1])
  5039. } */
  5040. }else if(e == -1){
  5041. item = this.prevItem(this.currentItem)
  5042. /* var lastLocation = this.model.heroLocations[this.currentItem[0]-1];
  5043. if(!lastLocation) this.setDestinationItem([-1, 0]) //结果小于0
  5044. else{
  5045. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5046. if(this.currentItem[1] == 0){//子目录中第一个
  5047. this.setDestinationItem([this.currentItem[0] - 1, lastChildNum-1])
  5048. }else{
  5049. this.setDestinationItem([this.currentItem[0], this.currentItem[1]-1])
  5050. }
  5051. } */
  5052. }
  5053. //this.setDestinationItem(this.currentItem + e)
  5054. this.setDestinationItem(item)
  5055. }
  5056. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  5057. this.useSpecialTransition("reverse-looping to end")
  5058. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5059. this.useSpecialTransition("looping back to start")
  5060. }
  5061. /* if(this.destinationItem[0] < 0 ){
  5062. this.setDestinationItem(this.finalDestination())
  5063. this.useSpecialTransition("reverse-looping to end")
  5064. }else{
  5065. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  5066. this.useSpecialTransition("looping back to start"))
  5067. } */
  5068. /* var momentTour = this.getMomentTour(this.destinationItem);
  5069. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5070. var i = this.player.zoomLevel;
  5071. this.player.zoomEnabled = !0;
  5072. var t = function(e, t) {
  5073. this.player.zoomTo((1 - e) * i, !0)
  5074. }
  5075. .bind(this);
  5076. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  5077. } */
  5078. this.goToDestination()
  5079. }
  5080. ,
  5081. t.prototype.getMomentTour = function(destinationItem) {//add
  5082. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  5083. if(!destinationItem) return wholeMomentTour
  5084. else{
  5085. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5086. if(currentLocation.momentTour)return currentLocation.momentTour;
  5087. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5088. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5089. }
  5090. }
  5091. ,
  5092. I.exports = t
  5093. }
  5094. ).call(this, "/js/director.js")
  5095. }
  5096. , {
  5097. "./analytics": 4,
  5098. "./enum/BlackoutStyle": 18,
  5099. "./enum/ControlEvents": 21,
  5100. "./enum/DirectorEvents": 23,
  5101. "./enum/ModelManagerEvents": 33,
  5102. "./enum/PathDiscardMode": 38,
  5103. "./enum/PathDisplayMode": 39,
  5104. "./enum/PlayerEvents": 40,
  5105. "./enum/Viewmode": 51,
  5106. "./enum/WarpStyle": 52,
  5107. "./model/ModelManager": 140,
  5108. "./player": 155,
  5109. "./settings": 166,
  5110. "./util/logger": 189,
  5111. "./util/transitions": 195,
  5112. events: 202,
  5113. three: 217
  5114. }],
  5115. 16: [function(e, t, i) {
  5116. "use strict";
  5117. var n = e("three")
  5118. , r = e("./enum/Viewmode")
  5119. , o = (e("./settings"),
  5120. e("./util/transitions"))
  5121. , a = e("./enum/PlayerEvents")
  5122. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5123. , l = new n.ShaderPass(n.VerticalBlurShader);
  5124. l.renderToScreen = !0;
  5125. var c = $("#player").width() / $("#player").height();
  5126. isNaN(c) && (c = 1);
  5127. var h = {
  5128. currentBlur: 0,
  5129. aspect: c,
  5130. blurStrength: 1,
  5131. hblurPass: s,
  5132. vblurPass: l,
  5133. bindEvents: function(e) {
  5134. e.on(a.ModeChanged, function(e, t) {
  5135. e === r.PANORAMA && (o.cancel(h.blur),
  5136. o.cancel(h.addBlur),
  5137. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5138. })
  5139. },
  5140. blur: function(e) {
  5141. var t = (h.currentBlur = e) * h.blurStrength;
  5142. l.uniforms.v.value = t / 512 * h.aspect,
  5143. s.uniforms.h.value = t / 512
  5144. },
  5145. addBlur: function(e) {
  5146. e = Math.max(e, h.currentBlur),
  5147. h.blur(e)
  5148. },
  5149. removeBlur: function(e) {
  5150. e = Math.min(1 - e, h.currentBlur),
  5151. h.blur(e)
  5152. }
  5153. };
  5154. h.blur(0),
  5155. t.exports = h
  5156. }
  5157. , {
  5158. "./enum/PlayerEvents": 40,
  5159. "./enum/Viewmode": 51,
  5160. "./settings": 166,
  5161. "./util/transitions": 195,
  5162. three: 217
  5163. }],
  5164. 17: [function(e, t, i) {
  5165. "use strict";
  5166. t.exports = {
  5167. UNKNOWN: 0,
  5168. ALIGNED: 1,
  5169. UNALIGNED: 2,
  5170. PLACED: 3
  5171. }
  5172. }
  5173. , {}],
  5174. 18: [function(e, t, i) {
  5175. "use strict";
  5176. t.exports = {
  5177. NONE: 0,
  5178. MIDDLE: 1,
  5179. END: 2,
  5180. BEGINNING: 3,
  5181. FADEIN: 4
  5182. }
  5183. }
  5184. , {}],
  5185. 19: [function(e, t, i) {
  5186. "use strict";
  5187. var r = e("three");
  5188. t.exports = {
  5189. newBlue: new r.Color(4967932),
  5190. altBlue: new r.Color(47355),
  5191. tagDefault: new r.Color(223357),
  5192. classicBlue: new r.Color(53759),
  5193. mpYellow: new r.Color(16502016),
  5194. mpOrange: new r.Color(16428055),
  5195. mpBlue: new r.Color(12096),
  5196. mpLtGrey: new r.Color(13751252),
  5197. mpDkGrey: new r.Color(10000019),
  5198. mpRed: new r.Color(12525854),
  5199. mpOrangeDesat: new r.Color(16764529),
  5200. mpBlueDesat: new r.Color(4034734),
  5201. mpRedDesat: new r.Color(14705505),
  5202. white: new r.Color(16777215),
  5203. black: new r.Color(0),
  5204. _desat: function(e, t) {
  5205. var i = t || .3
  5206. , n = (new r.Color).copy(e).getHSL();
  5207. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5208. },
  5209. _darken: function(e, t) {
  5210. var i = t || .2
  5211. , n = e.getHSL();
  5212. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5213. }
  5214. }
  5215. }
  5216. , {
  5217. three: 217
  5218. }],
  5219. 20: [function(e, t, i) {
  5220. "use strict";
  5221. t.exports = {
  5222. NONE: -1,
  5223. ROTATE: 0,
  5224. DOLLY: 1,
  5225. PAN: 2,
  5226. ROTATE_DOLLY: 3,
  5227. PAN_DOLLY: 4
  5228. }
  5229. }
  5230. , {}],
  5231. 21: [function(e, t, i) {
  5232. "use strict";
  5233. t.exports = {
  5234. Move: "move",
  5235. InteractionDirect: "interaction.direct",
  5236. InteractionKey: "interaction.key",
  5237. InteractionGui: "interaction.gui",
  5238. FlyInDirection: "fly.direction",
  5239. InputStart: "input.start",
  5240. Pinch: "input.pinch",
  5241. Scroll: "input.scroll",
  5242. AutoPanInterrupt: "autopan.interrupt",
  5243. AutoPanComplete: "autopan.complete",
  5244. AutoPanClamped: "autopan.clamped",
  5245. LongTap: "longtap"
  5246. }
  5247. }
  5248. , {}],
  5249. 22: [function(e, t, i) {
  5250. "use strict";
  5251. t.exports = Object.freeze({
  5252. FORWARD: "FORWARD",
  5253. LEFT: "LEFT",
  5254. RIGHT: "RIGHT",
  5255. BACK: "BACK",
  5256. UP: "UP",
  5257. DOWN: "DOWN"
  5258. })
  5259. }
  5260. , {}],
  5261. 23: [function(e, t, i) {
  5262. "use strict";
  5263. t.exports = {
  5264. ActionInterrupted: "action.interrupted",
  5265. TourStart: "tour.start",
  5266. TourEnd: "tour.end",
  5267. StartModeChange: "mode.startChange"
  5268. }
  5269. }
  5270. , {}],
  5271. 24: [function(e, t, i) {
  5272. "use strict";
  5273. t.exports = Object.freeze({
  5274. None: 0,
  5275. Queued: 1,
  5276. ForceQueued: 2,
  5277. Downloading: 3,
  5278. Downloaded: 4,
  5279. DownloadFailed: 5
  5280. })
  5281. }
  5282. , {}],
  5283. 25: [function(e, t, i) {
  5284. "use strict";
  5285. t.exports = {
  5286. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5287. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5288. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5289. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5290. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5291. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5292. }
  5293. }
  5294. , {}],
  5295. 26: [function(e, t, i) {
  5296. "use strict";
  5297. t.exports = {
  5298. Texture2D: 0,
  5299. TextureCube: 1
  5300. }
  5301. }
  5302. , {}],
  5303. 27: [function(e, t, i) {
  5304. "use strict";
  5305. t.exports = {
  5306. SMALL: "small",
  5307. LARGE: "large"
  5308. }
  5309. }
  5310. , {}],
  5311. 28: [function(e, t, i) {
  5312. "use strict";
  5313. var n = e("./Viewmode")
  5314. , r = {
  5315. LANDING: {},
  5316. NAVIGATION: "navigation",
  5317. MORE_HELP: "moreHelp",
  5318. TOUR_INTERACTION: {}
  5319. };
  5320. r.LANDING[n.PANORAMA] = "panorama.landing",
  5321. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5322. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5323. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5324. r.TOUR_INTERACTION.standard = "standard.tour",
  5325. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5326. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5327. t.exports = r
  5328. }
  5329. , {
  5330. "./Viewmode": 51
  5331. }],
  5332. 29: [function(e, t, i) {
  5333. "use strict";
  5334. var n = {
  5335. UP: 1,
  5336. DOWN: -1,
  5337. LEFT: "L",
  5338. RIGHT: "R",
  5339. FORWARD: "F",
  5340. BACK: "B",
  5341. reverse: {},
  5342. opposite: function(e) {
  5343. return this.reverse[e.toString()]
  5344. }
  5345. };
  5346. n.reverse[n.UP] = n.DOWN,
  5347. n.reverse[n.DOWN] = n.UP,
  5348. n.reverse[n.LEFT] = n.RIGHT,
  5349. n.reverse[n.RIGHT] = n.LEFT,
  5350. n.reverse[n.FORWARD] = n.BACK,
  5351. n.reverse[n.BACK] = n.FORWARD,
  5352. t.exports = n
  5353. }
  5354. , {}],
  5355. 30: [function(e, t, i) {
  5356. "use strict";
  5357. var n = {
  5358. ZERO: 48,
  5359. ONE: 49,
  5360. TWO: 50,
  5361. THREE: 51,
  5362. FOUR: 52,
  5363. FIVE: 53,
  5364. SIX: 54,
  5365. SEVEN: 55,
  5366. EIGHT: 56,
  5367. NINE: 57,
  5368. LEFTARROW: 37,
  5369. UPARROW: 38,
  5370. RIGHTARROW: 39,
  5371. DOWNARROW: 40,
  5372. A: 65,
  5373. B: 66,
  5374. C: 67,
  5375. D: 68,
  5376. E: 69,
  5377. F: 70,
  5378. G: 71,
  5379. H: 72,
  5380. I: 73,
  5381. J: 74,
  5382. K: 75,
  5383. L: 76,
  5384. M: 77,
  5385. N: 78,
  5386. O: 79,
  5387. P: 80,
  5388. Q: 81,
  5389. R: 82,
  5390. S: 83,
  5391. T: 84,
  5392. U: 85,
  5393. V: 86,
  5394. W: 87,
  5395. X: 88,
  5396. Y: 89,
  5397. Z: 90,
  5398. SPACE: 32,
  5399. RETURN: 13,
  5400. SEMICOLON: 186,
  5401. PLUSEQUALS: 187,
  5402. DASHUNDERSCORE: 189,
  5403. OPENBRACKET: 219
  5404. };
  5405. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5406. n.PLUSEQUALS = 61,
  5407. n.DASHUNDERSCORE = 173),
  5408. t.exports = n
  5409. }
  5410. , {
  5411. "../util/browser": 182
  5412. }],
  5413. 31: [function(e, t, i) {
  5414. "use strict";
  5415. t.exports = {
  5416. EN_US: "en-US",
  5417. ES_MX: "es-MX",
  5418. FR_FR: "fr-FR",
  5419. DE_DE: "de-DE",
  5420. RU_RU: "ru-RU",
  5421. CN_CN: "cn-CN",
  5422. JP_JP: "jp-JP"
  5423. }
  5424. }
  5425. , {}],
  5426. 32: [function(e, t, i) {
  5427. "use strict";
  5428. t.exports = {
  5429. TagActivated: "tag.activated",
  5430. TagDismissed: "tag.dismissed",
  5431. TagNavigation: "tag.navigation"
  5432. }
  5433. }
  5434. , {}],
  5435. 33: [function(e, t, i) {
  5436. "use strict";
  5437. t.exports = {
  5438. ModelAdded: "model-added",
  5439. ActiveModelChanged: "active-model-changed"
  5440. }
  5441. }
  5442. , {}],
  5443. 34: [function(e, t, i) {
  5444. "use strict";
  5445. t.exports = {
  5446. LEFT: 0,
  5447. MIDDLE: 1,
  5448. RIGHT: 2
  5449. }
  5450. }
  5451. , {}],
  5452. 35: [function(e, t, i) {
  5453. "use strict";
  5454. t.exports = {
  5455. PanoRenderComplete: "panorama.render.complete",
  5456. TileRenderFailure: "panorama.tile.render.failed",
  5457. TileRenderSuccess: "panorama.tile.render.success",
  5458. TileUploadAttempted: "panorama.tile.upload.attempted",
  5459. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5460. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5461. }
  5462. }
  5463. , {}],
  5464. 36: [function(e, t, i) {
  5465. "use strict";
  5466. t.exports = {
  5467. BASE: 1,
  5468. STANDARD: 2,
  5469. HIGH: 3,
  5470. ULTRAHIGH: 4
  5471. }
  5472. }
  5473. , {}],
  5474. 37: [function(e, t, i) {
  5475. "use strict";
  5476. t.exports = {
  5477. LoadComplete: "panorama.load.complete",
  5478. LoadFailed: "panorama.load.failed",
  5479. TileLoaded: "panorama.tile.loaded"
  5480. }
  5481. }
  5482. , {}],
  5483. 38: [function(e, t, i) {
  5484. "use strict";
  5485. t.exports = Object.freeze({
  5486. Standard: 0,
  5487. Slow: 1,
  5488. Retain: 2
  5489. })
  5490. }
  5491. , {}],
  5492. 39: [function(e, t, i) {
  5493. "use strict";
  5494. t.exports = Object.freeze({
  5495. Show: 0,
  5496. Hide: 1,
  5497. Retain: 2
  5498. })
  5499. }
  5500. , {}],
  5501. 40: [function(e, t, i) {
  5502. "use strict";
  5503. t.exports = {
  5504. Move: "move",
  5505. MoveComplete: "move.complete",
  5506. ModeChanged: "mode.changed",
  5507. ModeChanging: "mode.changing",
  5508. PanoChosen: "pano.chosen",
  5509. ClosestPanoChanging: "closest.pano.changing",
  5510. WarpStarted: "warp.started",
  5511. WarpInterrupted: "warp.interrupted",
  5512. WarpEnded: "warp.ended",
  5513. FlyinFinished: "flyin.finished",
  5514. FlyingStarted: "flying.started",
  5515. FlyingInterrupted: "flying.interrupted",
  5516. FlyingEnded: "flying.ended",
  5517. Ready: "ready",
  5518. StartInside: "start.inside",
  5519. StartOutside: "start.outside",
  5520. ViewChanged: "view.changed",
  5521. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5522. InputStart: "input.start"
  5523. }
  5524. }
  5525. , {}],
  5526. 41: [function(e, t, i) {
  5527. "use strict";
  5528. t.exports = Object.freeze({
  5529. DEFAULT: 0,
  5530. PANOMARKERS: 1,
  5531. RETICULE: 2,
  5532. TAG: 3
  5533. })
  5534. }
  5535. , {}],
  5536. 42: [function(e, t, i) {
  5537. "use strict";
  5538. t.exports = {
  5539. visibleFloor: 1,
  5540. ghostFloor: 3,
  5541. boundingSkybox: 1,
  5542. panoMarker: 2,
  5543. reticule: 3,
  5544. tagStem: 4,
  5545. tagDisc: 5,
  5546. ribbon: 100
  5547. }
  5548. }
  5549. , {}],
  5550. 43: [function(e, t, i) {
  5551. "use strict";
  5552. t.exports = {
  5553. ContextCreated: "scene-renderer-context-created",
  5554. AfterRender: "after-render",
  5555. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5556. }
  5557. }
  5558. , {}],
  5559. 44: [function(e, t, i) {
  5560. "use strict";
  5561. t.exports = {
  5562. IDLE: "idle",
  5563. BROWSE: "browse",
  5564. EXAMINE: "examine"
  5565. }
  5566. }
  5567. , {}],
  5568. 45: [function(e, t, i) {
  5569. "use strict";
  5570. t.exports = {
  5571. TileDownloadSuccess: "tiledownloader.download.success",
  5572. TileDownloadFailure: "tiledownloader.download.failure",
  5573. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5574. }
  5575. }
  5576. , {}],
  5577. 46: [function(e, t, i) {
  5578. "use strict";
  5579. t.exports = {
  5580. CardboardAndroid: "googlevr",
  5581. GearVR: "gearvr",
  5582. CardboardIOS: "googlevrios",
  5583. Cardboard: "googlevr"
  5584. }
  5585. }
  5586. , {}],
  5587. 47: [function(e, t, i) {
  5588. "use strict";
  5589. t.exports = {
  5590. NONE: 0,
  5591. CONTEXTUAL: 1,
  5592. ANDROID: 2
  5593. }
  5594. }
  5595. , {}],
  5596. 48: [function(e, t, i) {
  5597. "use strict";
  5598. var n = {
  5599. Title: 0,
  5600. Cardboard: 1
  5601. }
  5602. , r = {
  5603. Title: 0,
  5604. Cardboard: 1,
  5605. Gear: 2
  5606. };
  5607. [n, r].forEach(function(e) {
  5608. e.pageCount = Object.keys(e).length
  5609. }),
  5610. t.exports.ios = n,
  5611. t.exports.standard = r
  5612. }
  5613. , {}],
  5614. 49: [function(e, t, i) {
  5615. "use strict";
  5616. t.exports = {
  5617. Android: "android",
  5618. IOS: "ios",
  5619. Desktop: "desktop",
  5620. UnsupportedAndroid: "android-unsupported"
  5621. }
  5622. }
  5623. , {}],
  5624. 50: [function(e, t, i) {
  5625. "use strict";
  5626. var n = e("three");
  5627. t.exports = {
  5628. UP: new n.Vector3(0,1,0),
  5629. DOWN: new n.Vector3(0,-1,0),
  5630. LEFT: new n.Vector3(-1,0,0),
  5631. RIGHT: new n.Vector3(1,0,0),
  5632. FORWARD: new n.Vector3(0,0,-1),
  5633. BACK: new n.Vector3(0,0,1)
  5634. }
  5635. }
  5636. , {
  5637. three: 217
  5638. }],
  5639. 51: [function(e, t, i) {
  5640. "use strict";
  5641. var n = e("../exception/ViewmodeConvertException")
  5642. , r = e("./coreViewmodes")
  5643. , o = {
  5644. MESH: "mesh",
  5645. OUTDOOR: "outdoor",
  5646. TRANSITIONING: "transitioning",
  5647. toInt: function(e) {
  5648. switch (e) {
  5649. case this.PANORAMA:
  5650. return 1;
  5651. case this.DOLLHOUSE:
  5652. return 2;
  5653. case this.FLOORPLAN:
  5654. return 3;
  5655. case this.OUTDOOR:
  5656. return 4;
  5657. case this.TRANSITIONING:
  5658. return -1
  5659. }
  5660. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5661. },
  5662. fromInt: function(e) {
  5663. switch (e) {
  5664. case "1":
  5665. case 1:
  5666. return this.PANORAMA;
  5667. case "2":
  5668. case 2:
  5669. return this.DOLLHOUSE;
  5670. case "3":
  5671. case 3:
  5672. return this.FLOORPLAN;
  5673. case "4":
  5674. case 4:
  5675. return this.OUTDOOR
  5676. }
  5677. throw new n("No known conversion for int to viewmode for int: " + e)
  5678. },
  5679. convertWorkshopModeInt: function(e) {
  5680. switch (e) {
  5681. case "0":
  5682. case 0:
  5683. case void 0:
  5684. return this.PANORAMA;
  5685. case "1":
  5686. case 1:
  5687. return this.FLOORPLAN;
  5688. case "2":
  5689. case 2:
  5690. return this.DOLLHOUSE;
  5691. case "3":
  5692. case 3:
  5693. return this.MESH
  5694. }
  5695. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5696. }
  5697. };
  5698. e("../util/common").extendObject(o, r),
  5699. t.exports = o
  5700. }
  5701. , {
  5702. "../exception/ViewmodeConvertException": 58,
  5703. "../util/common": 185,
  5704. "./coreViewmodes": 54
  5705. }],
  5706. 52: [function(e, t, i) {
  5707. "use strict";
  5708. t.exports = {
  5709. BLACK: "black",
  5710. STD: "std",
  5711. WALK: "walk"
  5712. }
  5713. }
  5714. , {}],
  5715. 53: [function(e, t, i) {
  5716. "use strict";
  5717. t.exports = {
  5718. ZoomIn: "zoom.in",
  5719. ZoomOut: "zoom.out",
  5720. ZoomMax: "zoom.max",
  5721. ZoomMin: "zoom.min"
  5722. }
  5723. }
  5724. , {}],
  5725. 54: [function(e, t, i) {
  5726. "use strict";
  5727. t.exports = {
  5728. PANORAMA: "panorama",
  5729. DOLLHOUSE: "dollhouse",
  5730. FLOORPLAN: "floorplan"
  5731. }
  5732. }
  5733. , {}],
  5734. 55: [function(e, t, i) {
  5735. "use strict";
  5736. t.exports = function(e) {
  5737. this.message = e
  5738. }
  5739. }
  5740. , {}],
  5741. 56: [function(e, t, i) {
  5742. "use strict";
  5743. function n(e) {
  5744. r.call(this, e)
  5745. }
  5746. var r = e("./BasicException");
  5747. n.prototype = Object.create(r.prototype),
  5748. t.exports = n
  5749. }
  5750. , {
  5751. "./BasicException": 55
  5752. }],
  5753. 57: [function(e, t, i) {
  5754. "use strict";
  5755. function n(e) {
  5756. r.call(this, e)
  5757. }
  5758. var r = e("./BasicException");
  5759. n.prototype = Object.create(r.prototype),
  5760. t.exports = n
  5761. }
  5762. , {
  5763. "./BasicException": 55
  5764. }],
  5765. 58: [function(e, t, i) {
  5766. "use strict";
  5767. function n(e) {
  5768. r.call(this, e)
  5769. }
  5770. var r = e("./BasicException");
  5771. n.prototype = Object.create(r.prototype),
  5772. t.exports = n
  5773. }
  5774. , {
  5775. "./BasicException": 55
  5776. }],
  5777. 59: [function(a, s, e) {
  5778. (function(e) {
  5779. "use strict";
  5780. var i = a("./util/ajax")
  5781. , n = a("./util/showcase")
  5782. , t = a("./util/logger")
  5783. , r = new t(e)
  5784. , o = {};
  5785. s.exports = {
  5786. loadFeatureFlags: function(e) {
  5787. var t = $.Deferred();
  5788. return i.get(e.urlBase + "", {
  5789. responseType: "json",
  5790. prefetchFrom: "user",
  5791. auth: n.getAuthorizationHeader()
  5792. }).done(function(e) {
  5793. (o = function(e) {
  5794. var t = {};
  5795. if (e) {
  5796. var i = e.flags;
  5797. if (i)
  5798. for (var n in i)
  5799. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5800. return t
  5801. }
  5802. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5803. null
  5804. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5805. }).fail(function() {
  5806. r.debug("Retrieval of feature flags failed."),
  5807. t.reject("loading-failed")
  5808. }),
  5809. t.promise()
  5810. },
  5811. getFlags: function() {
  5812. return o
  5813. },
  5814. updateDependentSettings: function(e, t) {
  5815. (e = e || o).labels && (t.labels.enabled = !0),
  5816. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5817. e.showcase_sdk && (t.sdkInit = !0),
  5818. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5819. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5820. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5821. e.hide_sc_sharing && (t.share.enabled = !1)
  5822. }
  5823. }
  5824. }
  5825. ).call(this, "/js/featureflags.js")
  5826. }
  5827. , {
  5828. "./util/ajax": 181,
  5829. "./util/logger": 189,
  5830. "./util/showcase": 193
  5831. }],
  5832. 60: [function(e, t, i) {
  5833. "use strict";
  5834. var n = (e("../util/common"),
  5835. {
  5836. status: 0,
  5837. set: function(e) {
  5838. if (isNaN(e))
  5839. return !1;
  5840. var t = $(".progressbar");
  5841. e < 0 && (e = 0),
  5842. 100 < e && (e = 100);
  5843. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5844. , n = Math.round(e)
  5845. , r = parseInt(i) - 15;
  5846. t.find(".bar").css("width", i),
  5847. t.find(".label").css("left", r),
  5848. t.find(".perc").text(n + "%"),
  5849. this.status = e
  5850. },
  5851. done: function(e) {
  5852. return e || this.status ? (this.status = null,
  5853. this.set(100)) : this
  5854. }
  5855. });
  5856. t.exports.circleLoader = n
  5857. }
  5858. , {
  5859. "../util/common": 185
  5860. }],
  5861. 61: [function(e, t, i) {
  5862. "use strict";
  5863. t.exports = Object.freeze({
  5864. CLOSE: "modal.closer.close"
  5865. })
  5866. }
  5867. , {}],
  5868. 62: [function(e, t, i) {
  5869. "use strict";
  5870. function n(t, e) {
  5871. function i() {
  5872. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5873. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5874. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5875. c.classList.remove("closeByFooter")))
  5876. }
  5877. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5878. }
  5879. var r = e("../../settings")
  5880. , o = (e("../../tag/Media/MediaEvent"),
  5881. e("../../util/browser"))
  5882. , a = e("../../util/common")
  5883. , s = e("./ModalCloserEvent")
  5884. , l = e("events").EventEmitter
  5885. , c = document.getElementsByClassName("footer")[0]
  5886. , h = c.querySelectorAll(".close")[0]
  5887. , u = null
  5888. , d = null
  5889. , p = null
  5890. , f = (o.isMobile(),
  5891. {
  5892. open: function(e) {
  5893. e && (n(e),
  5894. u && h.removeEventListener("click", u, !0),
  5895. u = function(e, t) {
  5896. t && (t.stopPropagation(),
  5897. t.preventDefault()),
  5898. e && this.emit(s.CLOSE, e),
  5899. f.reset()
  5900. }
  5901. .bind(this, e.id),
  5902. h.addEventListener("click", u, !0),
  5903. d && window.removeEventListener("resize", d, !0),
  5904. d = n.bind(this, e),
  5905. window.addEventListener("resize", d, !0))
  5906. },
  5907. reset: function() {
  5908. c.classList.remove("closeByFooter"),
  5909. h.removeEventListener("click", u, !0),
  5910. window.removeEventListener("resize", d, !0),
  5911. u = d = p = null
  5912. }
  5913. });
  5914. a.extendObject(f, l.prototype),
  5915. t.exports = f
  5916. }
  5917. , {
  5918. "../../tag/Media/MediaEvent": 131,
  5919. "../../settings": 166,
  5920. "../../util/browser": 182,
  5921. "../../util/common": 185,
  5922. "./ModalCloserEvent": 61,
  5923. events: 202
  5924. }],
  5925. 63: [function(e, t, i) {
  5926. "use strict";
  5927. var A = e("../lib/dat.gui")
  5928. , C = e("three")
  5929. , I = e("../util/easing")
  5930. , E = e("../enum/Viewmode")
  5931. , _ = e("../enum/Colors")
  5932. , b = e("../enum/WarpStyle")
  5933. , w = e("../settings");
  5934. e("../tag/tag"),
  5935. A.GUI.prototype.removeFolder = function(e) {
  5936. var t = this.__folders[e];
  5937. t && (t.close(),
  5938. this.__ul.removeChild(t.domElement.parentNode),
  5939. delete this.__folders[e],
  5940. this.onResize())
  5941. }
  5942. ,
  5943. t.exports.toggle = function(t, e, i) {
  5944. var n = new A.GUI({
  5945. width: 400
  5946. })
  5947. , r = n.addFolder("Flydown from Dollhouse");
  5948. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5949. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5950. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5951. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5952. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5953. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5954. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5955. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5956. var o = n.addFolder("Transition between panos");
  5957. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5958. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5959. w.transition.flyTime = 0,
  5960. o.__controllers.forEach(function(e) {
  5961. e.updateDisplay()
  5962. })
  5963. }),
  5964. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5965. w.transition.flySpeed = 0,
  5966. o.__controllers.forEach(function(e) {
  5967. e.updateDisplay()
  5968. })
  5969. }),
  5970. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5971. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5972. o.add(w.transition, "movementEasing", Object.keys(I));
  5973. var a = n.addFolder("Path Display");
  5974. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5975. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5976. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5977. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5978. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5979. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5980. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5981. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5982. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5983. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5984. w.path.color = _[w.path.color],
  5985. w.path.colorUp = _._desat(w.path.color),
  5986. w.path.colorDown = _.darken(w.path.color)
  5987. }),
  5988. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5989. w.reticuleColor = _[w.reticuleColor]
  5990. });
  5991. var s = n.addFolder("Warping")
  5992. , l = s.addFolder("Warp/Teleport");
  5993. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5994. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5995. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5996. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5997. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5998. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5999. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  6000. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  6001. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6002. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6003. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  6004. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6005. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6006. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  6007. w.path.typ = b[w.path.typ]
  6008. }),
  6009. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6010. e.endlessLoop = w.warp.loop
  6011. }),
  6012. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6013. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6014. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6015. var c = s.addFolder("Long Warp Only");
  6016. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6017. w.warp.flySpeed = 0,
  6018. c.__controllers.forEach(function(e) {
  6019. e.updateDisplay()
  6020. })
  6021. }),
  6022. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6023. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6024. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6025. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6026. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6027. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6028. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6029. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6030. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6031. var h = n.addFolder("Warp Esoterica");
  6032. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6033. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  6034. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6035. w.warp.minWarpTime = 0,
  6036. h.__controllers.forEach(function(e) {
  6037. e.updateDisplay()
  6038. })
  6039. }),
  6040. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  6041. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6042. h.add(w.warp, "movementEasing", Object.keys(I));
  6043. var u = n.addFolder("Misc");
  6044. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  6045. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  6046. }),
  6047. u.add(w, "insideFOV", 10, 180).onChange(function() {
  6048. i.cameras[E.PANORAMA].fov = w.insideFOV
  6049. }),
  6050. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6051. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6052. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6053. var d = n.addFolder("Navigation");
  6054. d.add(w.navigation, "panoScores").onFinishChange(function() {
  6055. w.navigation.panoScores || t.panos.forEach(function(e) {
  6056. e.floor.remove(e.text3d),
  6057. e.text3d = null
  6058. })
  6059. }),
  6060. d.add(w.navigation, "mouseDirection"),
  6061. d.add(w.navigation, "filterStrictness", 0, 1),
  6062. d.add(w.navigation, "angleFactor", -60, 0),
  6063. d.add(w.navigation, "directionFactor", 1, 20),
  6064. d.add(w.navigation, "distanceFactor", -5, 5),
  6065. d.add(w.navigation, "optionalityFactor", .1, 10);
  6066. var p = n.addFolder("tags")
  6067. , f = p.addFolder("Tag Creation");
  6068. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  6069. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6070. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6071. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6072. var g = p.addFolder("Visibility");
  6073. g.add(w.tags.visibility, "anyDistance"),
  6074. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6075. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6076. g.add(w.tags.visibility, "hideViaFloor"),
  6077. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6078. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6079. var m = p.addFolder("Disc Parameters");
  6080. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6081. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6082. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6083. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  6084. }),
  6085. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6086. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  6087. }),
  6088. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  6089. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  6090. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6091. var v = p.addFolder("Navigate");
  6092. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  6093. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  6094. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  6095. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6096. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6097. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6098. var y = n.addFolder("Debug");
  6099. y.add(w, "wireframe").onFinishChange(function() {
  6100. t.chunks.forEach(function(e) {
  6101. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  6102. e.wireframeTwin.material.depthWrite = !1,
  6103. e.wireframeTwin.material.depthTest = !1,
  6104. e.wireframeTwin.material.opacity = .5,
  6105. e.wireframeTwin.material.transparent = !0),
  6106. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  6107. })
  6108. }),
  6109. y.add(w, "skyboxWireframe").onFinishChange(function() {
  6110. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  6111. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  6112. t.skybox.wireframe = null)
  6113. }),
  6114. y.add(w, "showSweeps").onFinishChange(function() {
  6115. t.setSweepVisibility(w.showSweeps)
  6116. }),
  6117. y.add(w, "showMesh").onFinishChange(function() {
  6118. t.chunks.forEach(function(e) {
  6119. e.visible = w.showMesh
  6120. })
  6121. }),
  6122. y.add(w, "showFloors").onFinishChange(function() {
  6123. t.floors.forEach(function(e) {
  6124. e.collider.children.forEach(function(e) {
  6125. e.material.visible = w.showFloors
  6126. })
  6127. })
  6128. }),
  6129. y.add(w, "showSkyboxes").onFinishChange(function() {
  6130. t.panos.forEach(function(e) {
  6131. e.skyboxMesh.visible = w.showSkyboxes
  6132. })
  6133. }),
  6134. y.add(w, "showNeighbors").onChange(function() {}),
  6135. y.add(t, "alpha", 0, 1)
  6136. }
  6137. }
  6138. , {
  6139. "../enum/Colors": 19,
  6140. "../enum/Viewmode": 51,
  6141. "../enum/WarpStyle": 52,
  6142. "../lib/dat.gui": 93,
  6143. "../tag/tag": 123,
  6144. "../settings": 166,
  6145. "../util/easing": 186,
  6146. three: 217
  6147. }],
  6148. 64: [function(c, h, e) {
  6149. (function(e) {
  6150. "use strict";
  6151. function i(e, t, i, n) {
  6152. $(".gui-error .error-problem-text").text(e),
  6153. $(".gui-error .error-solution-text").text(t),
  6154. $(".gui-error .error-explanation").text(i),
  6155. $(".gui-error .error-actions").html(n),
  6156. $(window).resize(),
  6157. $(".gui-error").fadeIn(),
  6158. $("#bottom-logo").fadeIn()
  6159. }
  6160. function n(e) {
  6161. 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("");
  6162. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  6163. r.isMobile() || $("[rel=tiletip]").tooltip({
  6164. placement: "bottom",
  6165. delay: {
  6166. show: 50,
  6167. hide: 0
  6168. },
  6169. trigger: "hover",
  6170. viewport: {
  6171. selector: "body",
  6172. padding: 10
  6173. }
  6174. })
  6175. }
  6176. function t() {
  6177. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  6178. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  6179. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  6180. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6181. e.preventDefault(),
  6182. e.stopPropagation(),
  6183. n(" ")
  6184. })
  6185. }
  6186. var r = c("./../util/browser")
  6187. , o = c("./../analytics")
  6188. , a = c("./../settings")
  6189. , s = c("../localization/localize")
  6190. , l = new (c("./../util/logger"))(e);
  6191. h.exports.error = function(e) {
  6192. if ($("head title").text(a.pageTitle),
  6193. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6194. $("#gui-loading").fadeOut(250),
  6195. $("#quick-blackout").hide(),
  6196. o.track("showcase_error", {
  6197. error_key: e
  6198. }),
  6199. s.locale || s.init(),
  6200. "webgl-unsupported" === e)
  6201. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6202. else if ("webgl-ios" === e)
  6203. 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>.");
  6204. else if ("webgl-safari" === e)
  6205. 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>.");
  6206. else if ("webgl-generic" === e)
  6207. t();
  6208. else if ("missing-urls" === e)
  6209. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6210. else if ("loading-failed" === e)
  6211. 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>.");
  6212. else {
  6213. if ("loading-failed-maintenance" !== e)
  6214. return void l.error("Unhandled error: " + e);
  6215. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6216. }
  6217. }
  6218. }
  6219. ).call(this, "/js/gui/error.js")
  6220. }
  6221. , {
  6222. "../localization/localize": 108,
  6223. "./../analytics": 4,
  6224. "./../settings": 166,
  6225. "./../util/browser": 182,
  6226. "./../util/logger": 189
  6227. }],
  6228. 65: [function(Oe, Le, e) {
  6229. (function(e) {
  6230. "use strict";
  6231. function c() {
  6232. for (var e in Ce)
  6233. if (Ce.hasOwnProperty(e)) {
  6234. var t = Ce[e];
  6235. if (!t.visible)
  6236. for (var i = 0; i < t.elements.length; i++)
  6237. $(t.elements[i]).hide()
  6238. }
  6239. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6240. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6241. ge = [],
  6242. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6243. ge.push(".hideTarget", ".pinTop.right")
  6244. }
  6245. function v(e, t) {
  6246. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6247. $("#gui-zoomin").toggle(i),
  6248. $("#gui-zoomout").toggle(i)
  6249. }
  6250. function l() {
  6251. n(),
  6252. $(".pinBottom").toggleClass("open"),
  6253. $("#drawer").toggleClass("open"),
  6254. $(".footer").toggleClass("open"),
  6255. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6256. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6257. O.resetDrawer()),
  6258. setTimeout(function() {
  6259. $("#pullTab").toggleClass("opened")
  6260. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6261. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6262. }
  6263. function t(e) {
  6264. var t;
  6265. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6266. t = e.position().top + e.outerHeight(),
  6267. e.attr("style", "display: none")),
  6268. $("#player").outerHeight() - 130 < t + 25
  6269. }
  6270. function y(e) {
  6271. "touchstart" === e.type && e.preventDefault(),
  6272. e.stopPropagation()
  6273. }
  6274. function n() {
  6275. w && (w.reload(),
  6276. w.init())
  6277. }
  6278. function r() {
  6279. $("#gui-spinner").stop(!0, !0),
  6280. $("#gui-spinner").fadeOut(1e3),
  6281. !(Ae = !0)
  6282. }
  6283. function A(e, t) {
  6284. var i = e.mode
  6285. , n = t || e.currentPano;
  6286. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6287. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6288. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6289. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6290. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6291. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6292. $("#gui-modes-outside").removeClass("desktop-only")),
  6293. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6294. pe = i,
  6295. $("#gui-modes-outside").addClass("hidden"),
  6296. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6297. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6298. }
  6299. function C(t, i) {
  6300. function e() {
  6301. document.getElementById("vr").classList.remove("hidden"),
  6302. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6303. S.supportsFullscreen() ? function(e) {
  6304. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6305. Q.init(t.data, i, e, x),
  6306. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6307. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6308. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6309. $(".improper-embed").toggleClass("hidden", !1),
  6310. n())
  6311. }, function(e) {
  6312. n()
  6313. }) : n()
  6314. }
  6315. function n() {
  6316. var e;
  6317. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6318. X.init(t.data, x),
  6319. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6320. function() {
  6321. _e("vr"),
  6322. V.open(e)
  6323. }
  6324. )),
  6325. X.on(Z.CLOSED, V.reset)
  6326. }
  6327. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6328. switch (M.vr.option) {
  6329. case le.CONTEXTUAL:
  6330. e();
  6331. break;
  6332. case le.ANDROID:
  6333. S.detectAndroid() && e();
  6334. break;
  6335. case le.NONE:
  6336. }
  6337. }
  6338. function h(e, i) {
  6339. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6340. if ("372" !== getQueryVariable("m")) {
  6341. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6342. $(".gui-floor").find(".container").prepend(r)
  6343. }
  6344. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6345. n.on("click", function(e) {
  6346. y(e),
  6347. _e("floor"),
  6348. n.toggleClass("open")
  6349. }),
  6350. $(".floorChoice").on("click", function(e) {
  6351. y(e);
  6352. var t = $(this).data("index");
  6353. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6354. i.player.gotoFloor(t),
  6355. R.track("showcase_gui", {
  6356. gui_action: "click_floor_select_button",
  6357. interaction_source: "gui"
  6358. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6359. _e("move"),
  6360. i.allFloors(),
  6361. R.track("showcase_gui", {
  6362. gui_action: "click_toggle_all_floors_button",
  6363. interaction_source: "gui"
  6364. })),
  6365. n.removeClass("open")
  6366. })
  6367. }
  6368. function I(e, t) {
  6369. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6370. $(".gui-floor-icon").hide(),
  6371. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6372. $(".gui-floor-icon").show(),
  6373. $(".gui-floor-title").hide()),
  6374. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6375. $(".gui-floor-number").text(se.FLOOR_ALL),
  6376. $(".floorChoice").removeClass("active"),
  6377. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6378. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6379. $(".floorChoice").removeClass("active"),
  6380. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6381. }
  6382. function E() {
  6383. var e = $("#player").width() - 20
  6384. , t = $("#scroller")
  6385. , i = $("#drawer")
  6386. , n = $(".pinBottom");
  6387. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6388. i.addClass("noScroll"),
  6389. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6390. i.toggleClass("noScroll"),
  6391. n.toggleClass("noScroll"))
  6392. }
  6393. function _(e) {
  6394. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6395. e = e || 0,
  6396. Ae = !1,
  6397. window.setTimeout(function() {
  6398. Ae || (!0,
  6399. $("#gui-spinner").stop(!0, !0).show())
  6400. }
  6401. .bind(this), e)
  6402. }(M.modelComponentLoadSpinnerDelay)
  6403. }
  6404. function b(e, t) {
  6405. for (var i = []; e; )
  6406. i.push(e),
  6407. e = e.parentNode;
  6408. for (; t && -1 === i.indexOf(t); )
  6409. t = t.parentNode;
  6410. return t
  6411. }
  6412. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6413. Oe("../util/ajax"),
  6414. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6415. Oe("../util/camera"),
  6416. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6417. 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"),
  6418. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6419. Oe("../enum/PathDisplayMode"),
  6420. Oe("../enum/DirectorEvents"),
  6421. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6422. Oe("../enum/WarpStyle"),
  6423. Oe("../enum/AlignmentType"),
  6424. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6425. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6426. coBrand: {
  6427. visible: !0,
  6428. elements: [".co-brand", "#loaderCoBrand"]
  6429. },
  6430. help: {
  6431. visible: !0,
  6432. elements: [".nav-help", "#nav-help"]
  6433. },
  6434. tourControls: {
  6435. visible: !0,
  6436. elements: [".next", ".previous", "#play"]
  6437. },
  6438. highlight: {
  6439. visible: !0,
  6440. elements: ["#drawer", "#pullTab"]
  6441. },
  6442. share: {
  6443. visible: !0,
  6444. elements: [".socialButton", "#share"]
  6445. },
  6446. fullScreen: {
  6447. visible: !0,
  6448. elements: ["#gui-fullscreen"]
  6449. },
  6450. floors: {
  6451. visible: !0,
  6452. elements: [".gui-floor"]
  6453. }
  6454. }, Ie = (g = document.getElementById("drawer"),
  6455. function() {
  6456. $("#player").height() < 400 && g.classList.contains("open") && l()
  6457. }
  6458. ), Ee = (f = document.getElementById("meta-info"),
  6459. function() {
  6460. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6461. }
  6462. ), _e = (i = document.getElementById("meta-info"),
  6463. s = document.getElementById("interaction-modal"),
  6464. u = $("#drawer").eq(0),
  6465. d = $(".gui-floor").eq(0),
  6466. p = $(".vr-popup").eq(0),
  6467. function(e) {
  6468. switch (e) {
  6469. case "info":
  6470. we(),
  6471. Te(),
  6472. Ie(),
  6473. Me(),
  6474. Re(),
  6475. xe(),
  6476. Pe();
  6477. break;
  6478. case "terms":
  6479. be(),
  6480. Te(),
  6481. Se(),
  6482. Me(),
  6483. Re(),
  6484. xe(),
  6485. Pe();
  6486. break;
  6487. case "help":
  6488. be(),
  6489. we(),
  6490. Me(),
  6491. Re(),
  6492. xe(),
  6493. Pe();
  6494. break;
  6495. case "vr":
  6496. be(),
  6497. we(),
  6498. Me(),
  6499. Re(),
  6500. Te(),
  6501. Pe(),
  6502. t(p) && Se();
  6503. break;
  6504. case "highlights":
  6505. Ee(),
  6506. we(),
  6507. Me(),
  6508. Re();
  6509. break;
  6510. case "share":
  6511. be(),
  6512. we(),
  6513. Te(),
  6514. Re(),
  6515. xe(),
  6516. Pe();
  6517. break;
  6518. case "floor":
  6519. we(),
  6520. Me(),
  6521. xe();
  6522. break;
  6523. case "view":
  6524. Re(),
  6525. Me(),
  6526. we(),
  6527. xe();
  6528. break;
  6529. case "tour":
  6530. case "move":
  6531. we(),
  6532. Me(),
  6533. Re(),
  6534. xe();
  6535. break;
  6536. case "resize":
  6537. be(),
  6538. Ie(),
  6539. Re();
  6540. break;
  6541. case "tag":
  6542. we(),
  6543. Te(),
  6544. Me(),
  6545. Re(),
  6546. xe()
  6547. }
  6548. }
  6549. );
  6550. function be() {
  6551. i.classList.contains("expand") && z.toggleMeta(!0)
  6552. }
  6553. function we() {
  6554. W.hide()
  6555. }
  6556. function Te() {
  6557. U.close()
  6558. }
  6559. function xe() {
  6560. X.dismiss()
  6561. }
  6562. function Se() {
  6563. u.hasClass("open") && l()
  6564. }
  6565. function Me() {
  6566. K.hide()
  6567. }
  6568. function Re() {
  6569. d.hasClass("open") && d.removeClass("open")
  6570. }
  6571. function Pe() {
  6572. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6573. }
  6574. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6575. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6576. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6577. setTimeout(function() {
  6578. $(".icon:visible").hide().show(0)
  6579. }, 100)
  6580. }),
  6581. $("#gui-fullscreen").find("a").on("click", function(e) {
  6582. y(e),
  6583. S.requestFullscreen($("body")[0]),
  6584. R.track("showcase_gui", {
  6585. gui_action: "click_enter_fullscreen",
  6586. interaction_source: "gui"
  6587. })
  6588. }),
  6589. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6590. y(e),
  6591. S.exitFullscreen(),
  6592. R.track("showcase_gui", {
  6593. gui_action: "click_exit_fullscreen",
  6594. interaction_source: "gui"
  6595. })
  6596. }),
  6597. $(window).on("resize", function(e) {
  6598. var t = e.target.innerHeight
  6599. , i = e.target.innerWidth;
  6600. t === o && i === a || (Ce.highlight.visible && E(),
  6601. _e("resize"),
  6602. $(".pinTop.right").removeClass("hideUnderMeta"),
  6603. n(),
  6604. o = t,
  6605. a = i)
  6606. }).resize(),
  6607. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6608. $("#pullTab").on("click", function(e) {
  6609. y(e),
  6610. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6611. gui_action: "hide_highlight_reel"
  6612. }),
  6613. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6614. gui_action: "show_highlight_reel"
  6615. }),
  6616. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6617. l()
  6618. }),
  6619. window.DATA.showHotListSta && ($("#hotList").css("display", ""),
  6620. $("#hotList").on("click", function(e) {
  6621. y(e);
  6622. var t = $("#hotListWrap")[0];
  6623. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6624. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6625. this.classList.add("active"))
  6626. }),
  6627. $("#hotListContent ul").on("mouseover", function(e) {
  6628. y(e);
  6629. var t = e.target
  6630. , i = document.getElementById("hotListWrap");
  6631. if ("SPAN" === t.tagName) {
  6632. var n = t.parentElement.parentElement;
  6633. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6634. } else if ("LI" === t.tagName) {
  6635. n = t.parentElement;
  6636. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6637. } else
  6638. i.style.width = ""
  6639. }),
  6640. $("#hotListContent ul").on("click", function(e) {
  6641. y(e),
  6642. this.preElem && this.preElem.classList.remove("active"),
  6643. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6644. e.target.parentElement.hot && e.target.parentElement.hot.examine(!0),
  6645. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6646. e.target.hot && e.target.hot.examine(!0),
  6647. this.preElem = e.target)
  6648. }),
  6649. $("#hotListClose").on("click", function(e) {
  6650. y(e),
  6651. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6652. $("#hotListContent ul .active").removeClass("active"),
  6653. $("#hotList")[0].classList.remove("active")
  6654. })),
  6655. "true" === window.DATA.supportsVR && $("#vr").css("display", ""),
  6656. $("#more-menu-button").on("click", function(e) {
  6657. y(e),
  6658. $("#more-menu").toggleClass("open")
  6659. }),
  6660. Le.exports.init = function(s, l, c, e, t, i, n) {
  6661. var r;
  6662. x = n,
  6663. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6664. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6665. F.init(),
  6666. D.init(s, i),
  6667. ce.init(s, l, e),
  6668. $(".icon").on("mouseover", function() {
  6669. l.player && l.player.reticule.hide()
  6670. }),
  6671. function(e, t) {
  6672. var i = t.player;
  6673. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6674. y(e),
  6675. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6676. R.track("USER", {
  6677. event_type: "showcase_gui",
  6678. gui_action: "click_inside_mode_button"
  6679. }),
  6680. t.changeMode(ie.PANORAMA)
  6681. }),
  6682. $("#gui-modes-outside").find("a").on("click", function(e) {
  6683. y(e),
  6684. R.track("showcase_gui", {
  6685. gui_action: "click_outside_mode_button"
  6686. }),
  6687. t.changeMode(pe)
  6688. }),
  6689. $("#gui-modes-floorplan").on("click", function(e) {
  6690. y(e),
  6691. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6692. gui_action: "click_floorplan_mode_button"
  6693. }),
  6694. t.changeMode(ie.FLOORPLAN))
  6695. }),
  6696. $("#gui-modes-dollhouse").on("click", function(e) {
  6697. y(e),
  6698. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6699. gui_action: "click_dollhouse_mode_button"
  6700. }),
  6701. t.changeMode(ie.DOLLHOUSE))
  6702. })
  6703. }(0, l),
  6704. function(e, t) {
  6705. $("#play").on("mousedown touchstart", function(e) {
  6706. y(e),
  6707. _e("tour"),
  6708. q.play(),
  6709. R.trackAlways("showcase_gui", {
  6710. gui_action: "play_highlights"
  6711. })
  6712. }),
  6713. window.startAndPlay = function(e) {
  6714. _e("tour"),
  6715. q.play(),
  6716. R.trackAlways("showcase_gui", {
  6717. gui_action: "play_highlights"
  6718. })
  6719. }
  6720. ,
  6721. $("#pause").on("mousedown touchstart", function(e) {
  6722. y(e),
  6723. q.pause(),
  6724. R.trackAlways("showcase_gui", {
  6725. gui_action: "pause_highlights"
  6726. })
  6727. }),
  6728. $("#gui-zoomin").find("a").on("click", function(e) {
  6729. y(e),
  6730. t.player.zoomInIncrementally()
  6731. }),
  6732. $("#gui-zoomout").find("a").on("click", function(e) {
  6733. y(e),
  6734. t.player.zoomOutIncrementally()
  6735. })
  6736. }(0, l),
  6737. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(DATA.name/* s.data.name */),
  6738. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6739. function() {
  6740. _e("share"),
  6741. V.open(r)
  6742. }
  6743. )),
  6744. K.on(ae.CLOSED, V.reset)),
  6745. 0 < s.heroLocations.length ? function(e, i, t) {
  6746. var n = 100 / (fe = e.heroLocations.length) + "%"
  6747. , r = $("#thumb-container")
  6748. , o = $("#progressBar");
  6749. $("#status").find(".totalSteps").text(fe);
  6750. for (var a = 0; a < fe; a++) {
  6751. var s = e.heroLocations[a]
  6752. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6753. if(s.heroLocations){//有子项,选第一张截图
  6754. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6755. }else{
  6756. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6757. }
  6758. if (l.attr("data-index", a),
  6759. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6760. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6761. s.name) {
  6762. var c = $('<div class="overlay"></div>').text(s.name);
  6763. l.prepend(c)
  6764. }
  6765. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6766. var h = e.panos.get(s.panoId)
  6767. , 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>';
  6768. l.prepend(u)
  6769. }
  6770. r.append(l),
  6771. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6772. }
  6773. T = 144 * fe,
  6774. 111 * fe,
  6775. $(".thumbImg").on("mouseover", function() {
  6776. !function(e) {
  6777. return e.describe().inTransition
  6778. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6779. }),
  6780. $(".thumbImg").on("mouseout", function() {
  6781. i.clearPath()
  6782. }),
  6783. $(".thumbImg").on("click", function(e) {
  6784. y(e);
  6785. var t = $(this);
  6786. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6787. R.trackAlways("showcase_gui", {
  6788. gui_action: "click_highlight"
  6789. }),
  6790. i.goToHighlight([t.data("index"),0])//改
  6791. }),
  6792. $(".previous").find("a").on("click", function(e) {
  6793. y(e),
  6794. R.trackAlways("showcase_gui", {
  6795. gui_action: "prev_highlight"
  6796. }),
  6797. i.prevHighlight()
  6798. }),
  6799. $(".next").find("a").on("click", function(e) {
  6800. y(e),
  6801. R.trackAlways("showcase_gui", {
  6802. gui_action: "next_highlight"
  6803. }),
  6804. i.nextHighlight()
  6805. }),
  6806. $("#drawer").on("mouseleave", function(t) {
  6807. var i;
  6808. y(t);
  6809. try {
  6810. i = new MouseEvent("mouseup",{
  6811. clientX: t.clientX,
  6812. clientY: t.clientY,
  6813. screenX: t.screenX,
  6814. screenY: t.screenY
  6815. })
  6816. } catch (e) {
  6817. (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)
  6818. }
  6819. document.dispatchEvent(i)
  6820. }),
  6821. (w = new Sly($("#scrollFrame"),{
  6822. horizontal: !0,
  6823. itemNav: "centered",
  6824. smart: !0,
  6825. scrollTrap: !0,
  6826. scrollBy: 1,
  6827. mouseDragging: !0,
  6828. touchDragging: !0,
  6829. speed: 300,
  6830. dragHandle: !0,
  6831. dynamicHandle: !0,
  6832. clickBar: !0,
  6833. scrollBar: $("#scroller"),
  6834. activateOn: null
  6835. }).init()).on("active", function(e, t) {
  6836. t,
  6837. _e("tour"),
  6838. $(".step").removeClass("active"),
  6839. $("#status").find(".curIdx").text(t + 1);
  6840. for (var i = 0; i <= t; i++)
  6841. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6842. }),
  6843. E()
  6844. }(s, l, c) : (Ce.highlight.visible = !1,
  6845. Ce.tourControls.visible = !1),
  6846. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6847. function() {
  6848. var n;
  6849. document.body.addEventListener("mousedown", function(e) {
  6850. n = 0 === e.button || 1 === e.which ? e.target : null
  6851. }, !0),
  6852. document.body.addEventListener("mouseup", function(t) {
  6853. n !== t.target && (n = b(n, t.target));
  6854. var e = document.getElementById("gui-parent");
  6855. if (b(e, n) !== e && (n = null),
  6856. n) {
  6857. var i;
  6858. try {
  6859. i = new MouseEvent("click",t)
  6860. } catch (e) {
  6861. (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)
  6862. }
  6863. i.syntheticClick = !0,
  6864. n.dispatchEvent(i),
  6865. n = null
  6866. }
  6867. }, !0),
  6868. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6869. e.syntheticClick || (e.stopPropagation(),
  6870. "A" === e.target.nodeName && e.preventDefault())
  6871. }, !0)
  6872. }(),
  6873. A(c),
  6874. C(s, t),
  6875. s.on("floor.changed", I),
  6876. s.on("waiting", function(e) {
  6877. _(e)
  6878. }
  6879. .bind(this, s)),
  6880. s.on("waiting-done", function(e) {
  6881. _(e)
  6882. }
  6883. .bind(this, s)),
  6884. c.on(re.ModeChanged, function(e, t) {
  6885. A(c),
  6886. v(l, c),
  6887. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6888. U.updateMode(t)
  6889. }),
  6890. e.on(oe.Move, _e.bind(this, "move")),
  6891. c.on(re.Ready, function() {
  6892. O.init(e, c, c.tagManager, l),
  6893. c.on(re.ModeChanged, function(e, t) {
  6894. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6895. })
  6896. }),
  6897. c.on(re.PanoChosen, function(e, t) {
  6898. A(c, t),
  6899. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6900. }),
  6901. V.on(k.CLOSE, function(e) {
  6902. switch (e) {
  6903. case "vr-modal":
  6904. X.dismiss();
  6905. break;
  6906. case "share-modal":
  6907. K.hide();
  6908. break;
  6909. case "terms-modal":
  6910. W.hide()
  6911. }
  6912. });
  6913. 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();
  6914. l.on("update.controls", function() {
  6915. var e, t, i, n = l.describe();
  6916. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6917. u.show()),
  6918. n.tourInProgress && (d.forEach(function(e) {
  6919. e.classList.add("playing")
  6920. }),
  6921. p.addClass("playing"),
  6922. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6923. u.hide()),
  6924. n.tourInProgress || (q.stopTour(),
  6925. d.forEach(function(e) {
  6926. e.classList.remove("playing")
  6927. }),
  6928. p.removeClass("playing"),
  6929. f.removeClass("playing"))),
  6930. null !== n.currentItem) {
  6931. var r, o;
  6932. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6933. n.onTheBus ? (r = "active",
  6934. o = "recent") : (o = "active",
  6935. r = "recent");
  6936. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6937. for (e = 0; e < s.heroLocations.length; e += 1)
  6938. i = g.eq(e),
  6939. t = m.eq(e),
  6940. i.removeClass(o),
  6941. t.removeClass(o),
  6942. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6943. t.addClass(r),
  6944. w.activate(e)) : n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6945. t.addClass(r)) : (i.removeClass(r),
  6946. t.removeClass(r))
  6947. } else
  6948. for (e = 0; e < s.heroLocations.length; e += 1)
  6949. i = g.eq(e),
  6950. t = m.eq(e),
  6951. i.removeClass("active recent"),
  6952. t.removeClass("active recent");
  6953. v(l, c)
  6954. }),
  6955. document.addEventListener("keydown", function(e) {
  6956. switch (R.updateInteraction(oe.InteractionKey),
  6957. e.which) {
  6958. case te.ZERO:
  6959. M.debug && s.toggleAlpha();
  6960. break;
  6961. case te.NINE:
  6962. M.debug && B.toggle();
  6963. break;
  6964. case te.ONE:
  6965. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6966. break;
  6967. case te.TWO:
  6968. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6969. break;
  6970. case te.THREE:
  6971. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6972. break;
  6973. case te.FOUR:
  6974. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6975. break;
  6976. case te.SPACE:
  6977. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6978. break;
  6979. case te.RETURN:
  6980. M.debug && s.toggleExplodeUp();
  6981. break;
  6982. case te.P:
  6983. !function(e) {
  6984. me.gui || (me.gui = function(e) {
  6985. var t = new he.GUI;
  6986. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6987. e.setSweepVisibility(M.showSweeps)
  6988. }),
  6989. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6990. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6991. M.transition.flySpeed = 0,
  6992. t.__controllers.forEach(function(e) {
  6993. e.updateDisplay()
  6994. })
  6995. }),
  6996. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6997. $(t.__closeButton).hide(),
  6998. t
  6999. }(me.model)),
  7000. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  7001. }(!me.visible);
  7002. break;
  7003. case te.U:
  7004. !function(e) {
  7005. ve.gui || (ve.gui = function(t, i) {
  7006. function e() {
  7007. var e = i.toJSON();
  7008. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  7009. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  7010. }
  7011. var n = {}
  7012. , r = new he.GUI({
  7013. autoPlace: !0,
  7014. width: "60%"
  7015. });
  7016. return e(),
  7017. i.on(re.ViewChanged, e),
  7018. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  7019. r.domElement.id = "datLinks",
  7020. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  7021. if (!S.detectSafari()) {
  7022. var t = document.createElement("button");
  7023. t.classList.add("btn-deep-link"),
  7024. t.innerText = se.MENU_COPY,
  7025. e.nextSibling.appendChild(t);
  7026. var n = function() {
  7027. alert(se.LINK_ALERT_COPY),
  7028. t.hide()
  7029. };
  7030. t.addEventListener("click", function(e) {
  7031. try {
  7032. var t = e.target.parentNode.childNodes[0];
  7033. t.select();
  7034. var i = document.execCommand("copy");
  7035. t.blur(),
  7036. i || n()
  7037. } catch (e) {
  7038. n()
  7039. }
  7040. })
  7041. }
  7042. }),
  7043. $(r.__closeButton).hide(),
  7044. r
  7045. }(ve.model, ve.player)),
  7046. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  7047. }(!ve.visible);
  7048. break;
  7049. case te.X:
  7050. M.debug && s.toggleExplode();
  7051. break;
  7052. case te.PLUSEQUALS:
  7053. l.player.activatePersistentZooming(!0),
  7054. O.hideUi();
  7055. break;
  7056. case te.DASHUNDERSCORE:
  7057. l.player.activatePersistentZooming(!1),
  7058. O.hideUi();
  7059. break;
  7060. case te.SEVEN:
  7061. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  7062. break;
  7063. case te.EIGHT:
  7064. l.player.decreaseZoomSpeed();
  7065. break;
  7066. case te.NINE:
  7067. l.player.increaseZoomSpeed()
  7068. }
  7069. return c && c.reticule.hide(),
  7070. !0
  7071. }
  7072. .bind(this)),
  7073. document.addEventListener("keyup", function(e) {
  7074. switch (e.which) {
  7075. case te.PLUSEQUALS:
  7076. l.player.deactivatePersistentZooming();
  7077. break;
  7078. case te.DASHUNDERSCORE:
  7079. l.player.deactivatePersistentZooming()
  7080. }
  7081. }
  7082. .bind(this)),
  7083. function(e) {
  7084. me = {
  7085. gui: null,
  7086. visible: !1,
  7087. model: e
  7088. }
  7089. }(s),
  7090. function(e, t) {
  7091. ve = {
  7092. gui: null,
  7093. visible: !1,
  7094. model: e,
  7095. player: t
  7096. }
  7097. }(s, l.player),
  7098. function(e) {
  7099. function t(e, i) {
  7100. $(e).find("a").each(function(e, t) {
  7101. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7102. t.style.pointerEvents = i ? "auto" : "none"
  7103. })
  7104. }
  7105. e.on(de.ZoomMax, function() {
  7106. t("#gui-zoomin", !1),
  7107. t("#gui-zoomout", !0)
  7108. }),
  7109. e.on(de.ZoomMin, function() {
  7110. t("#gui-zoomin", !0),
  7111. t("#gui-zoomout", !1)
  7112. }),
  7113. e.on(de.ZoomIn, function() {
  7114. t("#gui-zoomout", !0)
  7115. }),
  7116. e.on(de.ZoomOut, function() {
  7117. t("#gui-zoomin", !0)
  7118. }),
  7119. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7120. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7121. }(c),
  7122. P.setAutoPlay(s.heroCount()),
  7123. U.init(c, i.mode),
  7124. U.on(H.OPENED, _e.bind(this, "help")),
  7125. W.init(),
  7126. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  7127. function() {
  7128. _e("terms"),
  7129. V.open(o)
  7130. }
  7131. )),
  7132. W.on(j.CLOSED, V.reset),
  7133. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  7134. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  7135. M.profiling.enabled && B.show(),
  7136. q.init(l)
  7137. }
  7138. ,
  7139. Le.exports.startLoading = function(e, t, i, n, r, o) {
  7140. function a() {
  7141. o.setLoadingStartTime(),
  7142. function() {
  7143. function e(e) {
  7144. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7145. }
  7146. $("body").css("touch-action", "none"),
  7147. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  7148. var t = document.getElementById("terms-text")
  7149. , i = document.getElementById("more-help-wrapper")
  7150. , n = (document.getElementById("navigation-help-wrapper"),
  7151. document.getElementById("help-dialog"),
  7152. document.getElementById("tag-billboards"));
  7153. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  7154. passive: !1
  7155. }),
  7156. document.body.addEventListener("DOMMouseScroll", e)),
  7157. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7158. e.stopPropagation()
  7159. })
  7160. }(),
  7161. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  7162. l()) : function(e) {
  7163. L.show(e),
  7164. c()
  7165. }(l)
  7166. }
  7167. var s = $.Deferred()
  7168. , l = s.resolve.bind(s);
  7169. ye = !0,
  7170. _(e);
  7171. e.data.player_options && function(e) {
  7172. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  7173. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  7174. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7175. }(e.data.player_options),
  7176. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7177. se.localizeGUI();
  7178. !function(i) {
  7179. function e(e, t) {
  7180. return !!i.player_options[e] && i[t || e]
  7181. }
  7182. $(".model-title").text(i.name);
  7183. var t = M.pageTitle;
  7184. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7185. document.title = t,
  7186. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7187. delay: {
  7188. show: 50,
  7189. hide: 0
  7190. },
  7191. trigger: "hover",
  7192. html: !1,
  7193. viewport: {
  7194. selector: "body",
  7195. padding: 10
  7196. }
  7197. }),
  7198. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7199. z.populate({
  7200. name: e("model_name", "name"),
  7201. coBrand: e("presented_by"),
  7202. description: e("model_summary", "summary") || "暂无内容",
  7203. contactName: e("contact_name"),
  7204. address: e("address"),
  7205. phone: e("contact_phone"),
  7206. formattedPhone: i.formatted_contact_phone,
  7207. email: e("contact_email"),
  7208. url: e("external_url"),
  7209. socialSharing: i.enable_social_sharing && i.is_public
  7210. })
  7211. }(e.data);
  7212. r || $(".quick").addClass("hidden");
  7213. n ? (R.impression(),
  7214. a()) : (o.setWaitingStartTime(),
  7215. N.show(r, a))
  7216. return s
  7217. }
  7218. ,
  7219. Le.exports.endLoading = function(e, t, i) {
  7220. var n = t.player;
  7221. function r() {
  7222. i.dismissExaminedTag(),
  7223. i.disableHovering()
  7224. }
  7225. $("#gui-thumb").fadeOut(2500),
  7226. L.hide(function() {
  7227. ye = !1
  7228. }),
  7229. Y.init(e, i),
  7230. z.finishSetup(Object.keys(e.tags).length),
  7231. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7232. X.on(Z.OPENED, r),
  7233. K.on(ae.OPENED, r),
  7234. U.on(H.OPENED, r),
  7235. W.on(j.OPENED, r);
  7236. var o = i.enableHovering.bind(i);
  7237. if (X.on(Z.CLOSED, o),
  7238. K.on(ae.CLOSED, o),
  7239. U.on(H.CLOSED, o),
  7240. W.on(j.CLOSED, o),
  7241. M.labels.enabled && Object.keys(e.labels).length,
  7242. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7243. I(e.currentFloor, n.mode)),
  7244. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7245. h(e, t)),
  7246. c(),
  7247. v(t, t.player),
  7248. $("#gui").fadeIn(1500),
  7249. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7250. l(),
  7251. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7252. }, 2e3),
  7253. !S.isMobile())
  7254. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7255. $(a[s]).addClass("hasHover");
  7256. _(e),
  7257. z.setupToggling(),
  7258. window.editHotPanel && editHotPanel(),
  7259. function() {
  7260. var i = $("#pullTab")
  7261. , e = {
  7262. bottom: {
  7263. "border-bottom-left-radius": "10px",
  7264. "border-bottom-right-radius": "10px"
  7265. },
  7266. top: {
  7267. "border-top-left-radius": "10px",
  7268. "border-top-right-radius": "10px"
  7269. }
  7270. }
  7271. , t = {
  7272. bottom: {
  7273. "border-top-right-radius": "10px",
  7274. "border-bottom-right-radius": "10px"
  7275. },
  7276. top: {
  7277. "border-bottom-left-radius": "10px",
  7278. "border-top-left-radius": "10px"
  7279. }
  7280. };
  7281. function n(e, t) {
  7282. $("#gui-modes-map > div:visible:last").css(e),
  7283. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7284. }
  7285. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7286. (window.DATA.model.special || "true" === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7287. }()
  7288. $(".toolRight a").removeClass('hasHover')
  7289. }
  7290. ,
  7291. Le.exports.onProgress = function(e) {
  7292. L.progress(e)
  7293. }
  7294. }
  7295. ).call(this, "/js/gui/gui.js")
  7296. }
  7297. , {
  7298. "../analytics": 4,
  7299. "../controls/serializer": 14,
  7300. "../enum/AlignmentType": 17,
  7301. "../enum/BlackoutStyle": 18,
  7302. "../enum/ControlEvents": 21,
  7303. "../enum/DirectorEvents": 23,
  7304. "../enum/Keys": 30,
  7305. "../enum/PathDiscardMode": 38,
  7306. "../enum/PathDisplayMode": 39,
  7307. "../enum/PlayerEvents": 40,
  7308. "../enum/VROption": 47,
  7309. "../enum/Vectors": 50,
  7310. "../enum/Viewmode": 51,
  7311. "../enum/WarpStyle": 52,
  7312. "../enum/ZoomEvents": 53,
  7313. "../lib/dat.gui": 93,
  7314. "../localization/localize": 108,
  7315. "../tag/Media/MediaEvent": 131,
  7316. "../objects/Snapshot": 153,
  7317. "../settings": 166,
  7318. "../util/ajax": 181,
  7319. "../util/browser": 182,
  7320. "../util/camera": 183,
  7321. "../util/logger": 189,
  7322. "../util/showcase": 193,
  7323. "../util/transitions": 195,
  7324. "./closer/ModalCloserEvent": 61,
  7325. "./closer/modalCloser": 62,
  7326. "./help/HelpEvent": 66,
  7327. "./help/help": 67,
  7328. "./helpManager": 68,
  7329. "./immersiveMode": 69,
  7330. "./konami": 70,
  7331. "./landingScreen": 71,
  7332. "./loadingScreen": 72,
  7333. "./memoryUsage": 73,
  7334. "./playButton": 74,
  7335. "./populateModal": 75,
  7336. "./sharing/ShareEvents": 76,
  7337. "./sharing/modal": 77,
  7338. "./terms/TermsEvent": 78,
  7339. "./terms/terms": 79,
  7340. "./title/TitleEvents": 80,
  7341. "./title/tagToggle": 81,
  7342. "./title/titleBar": 82,
  7343. "./tourInteraction": 84,
  7344. "./vr/vrEvent": 85,
  7345. "./vr/vrModal": 87,
  7346. "./webvr/WebVrEvent": 88,
  7347. "./webvr/webVRgui": 89,
  7348. three: 217
  7349. }],
  7350. 66: [function(e, t, i) {
  7351. "use strict";
  7352. t.exports = Object.freeze({
  7353. OPENED: "help.opened",
  7354. CLOSED: "help.closed"
  7355. })
  7356. }
  7357. , {}],
  7358. 67: [function(e, t, i) {
  7359. "use strict";
  7360. function n() {
  7361. p.on("click", function(e) {
  7362. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7363. setTimeout(function() {
  7364. x = !1
  7365. }, h.help.modalStayDuration),
  7366. S.emit(l.OPENED),
  7367. f.addClass("open " + T),
  7368. p.addClass("open"),
  7369. o(),
  7370. r(),
  7371. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7372. v.classList.add("fadeIn")))
  7373. }),
  7374. E.on("click", function(e) {
  7375. S.close()
  7376. }),
  7377. C.on("click", function(e) {
  7378. T && T !== a.TRANSITIONING && (o(),
  7379. r())
  7380. }),
  7381. I.on("click", function(e) {
  7382. o(),
  7383. I.addClass("underline-tab"),
  7384. c.fill(b, s.MORE_HELP),
  7385. f.addClass("more-help")
  7386. })
  7387. }
  7388. function r() {
  7389. C.addClass("underline-tab"),
  7390. c.fill(_, s.NAVIGATION, T),
  7391. f.addClass(T)
  7392. }
  7393. function o() {
  7394. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7395. A.forEach(function(e) {
  7396. e.classList.remove("underline-tab")
  7397. })
  7398. }
  7399. var a = e("../../enum/Viewmode")
  7400. , s = e("../../enum/HelpModalType")
  7401. , l = e("./HelpEvent")
  7402. , c = (e("../helpManager"),
  7403. e("./../populateModal"))
  7404. , h = e("../../settings")
  7405. , u = e("../../util/common")
  7406. , d = e("events").EventEmitter
  7407. , p = $(".footer-help").eq(0)
  7408. , f = $("#help-dialog").eq(0)
  7409. , g = document.querySelector("#quick-logo")
  7410. , m = document.querySelector("#loaderCoBrand")
  7411. , v = document.querySelector("#help-dialog")
  7412. , y = document.querySelector(".footer")
  7413. , A = $(".help-tabs").children().toArray()
  7414. , C = $(".navigation-tab").eq(0)
  7415. , I = $(".more-help-tab").eq(0)
  7416. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7417. f.find(".close").eq(0))
  7418. , _ = f.find(".interactions").toArray()
  7419. , b = f.find(".ui-instructions").toArray()
  7420. , w = a.PANORAMA
  7421. , T = a.PANORAMA
  7422. , x = !1
  7423. , S = {
  7424. init: function(e, t) {
  7425. w = T = t,
  7426. [v, m, g, y].forEach(function(e) {
  7427. e.classList.add(c.deviceType)
  7428. }),
  7429. n()
  7430. },
  7431. close: function() {
  7432. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7433. p.removeClass("open"),
  7434. f.removeClass("open"),
  7435. v.classList.contains("fadeIn"))) {
  7436. v.classList.remove("fadeIn");
  7437. var e = T === a.TRANSITIONING ? w : T;
  7438. c.clear(_, s.NAVIGATION, e)
  7439. }
  7440. },
  7441. updateMode: function(e) {
  7442. w = T,
  7443. T = e
  7444. }
  7445. };
  7446. u.extendObject(S, d.prototype),
  7447. t.exports = S
  7448. }
  7449. , {
  7450. "../../enum/HelpModalType": 28,
  7451. "../../enum/Viewmode": 51,
  7452. "../../settings": 166,
  7453. "../../util/common": 185,
  7454. "../helpManager": 68,
  7455. "./../populateModal": 75,
  7456. "./HelpEvent": 66,
  7457. events: 202
  7458. }],
  7459. 68: [function(s, l, e) {
  7460. (function(e) {
  7461. "use strict";
  7462. var t = s("../util/browser")
  7463. , i = s("./../util/logger")
  7464. , n = s("./../settings")
  7465. , r = new i(e)
  7466. , o = function() {
  7467. var t;
  7468. try {
  7469. return t = window.localStorage.getItem("visitCount") || "0",
  7470. t = (parseFloat(t) + 1).toString(),
  7471. window.localStorage.setItem("visitCount", t),
  7472. r.debug("visitCount = " + t),
  7473. t
  7474. } catch (e) {
  7475. t = "1",
  7476. r.debug("couldn't set local storage")
  7477. }
  7478. }()
  7479. , a = !1;
  7480. l.exports = {
  7481. isHelpDisabled: function() {
  7482. return "0" === t.valueFromHash("help", null) || a
  7483. },
  7484. isLargeHelpEnabled: function() {
  7485. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7486. },
  7487. isSmallHelpEnabled: function() {
  7488. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7489. },
  7490. isHelpEnabled: function() {
  7491. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7492. },
  7493. setAutoPlay: function(e) {
  7494. a = 0 <= n.warp.auto && 1 < e
  7495. }
  7496. }
  7497. }
  7498. ).call(this, "/js/gui/helpManager.js")
  7499. }
  7500. , {
  7501. "../util/browser": 182,
  7502. "./../settings": 166,
  7503. "./../util/logger": 189
  7504. }],
  7505. 69: [function(e, t, i) {
  7506. "use strict";
  7507. function r(e) {
  7508. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7509. T = !0,
  7510. h.close(),
  7511. function(e) {
  7512. !n(e) && S ? v.forEach(function(e) {
  7513. e.classList.remove("drawerOpen"),
  7514. e.classList.add("duringTour")
  7515. }) : C.hasClass("open") ? v.forEach(function(e) {
  7516. e.classList.remove("duringTour"),
  7517. e.classList.add("drawerOpen")
  7518. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7519. e.classList.add("fadeOut")
  7520. })
  7521. }(e),
  7522. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7523. C.hasClass("playing") || (y.forEach(function(e) {
  7524. e.classList.add("detectHover")
  7525. }),
  7526. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7527. }
  7528. function o() {
  7529. C.hasClass("playing") || (clearTimeout(x),
  7530. x = setTimeout(a, c.immersive.timeToShowAgain))
  7531. }
  7532. function a() {
  7533. clearTimeout(x),
  7534. T = !1,
  7535. m.forEach(function(e) {
  7536. e.classList.remove("drawerOpen")
  7537. }),
  7538. S || v.forEach(function(e) {
  7539. e.classList.remove("duringTour")
  7540. }),
  7541. y.forEach(function(e) {
  7542. e.classList.remove("detectHover")
  7543. })
  7544. }
  7545. function s() {
  7546. T ? a() : r(),
  7547. M = !0,
  7548. setTimeout(function() {
  7549. M = !1
  7550. }, c.immersive.uiStayDuration)
  7551. }
  7552. function n(e) {
  7553. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7554. }
  7555. var l = e("../util/browser")
  7556. , c = e("../settings")
  7557. , h = e("./help/help")
  7558. , u = e("../enum/tagEvents")
  7559. , d = e("../enum/ControlEvents")
  7560. , p = e("../enum/PlayerEvents")
  7561. , f = e("../enum/DirectorEvents")
  7562. , g = (p = e("../enum/PlayerEvents"),
  7563. e("../enum/Viewmode"))
  7564. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7565. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7566. , y = $("#hover-bottom, #hover-top").toArray()
  7567. , A = ($("#pullTab").eq(0),
  7568. $("#playHead").eq(0),
  7569. $(".pinBottom-container").eq(0))
  7570. , C = $("#drawer").eq(0)
  7571. , I = $("#drawer-container").eq(0)
  7572. , E = $("#meta-info").eq(0)
  7573. , _ = $(".pinTop.left").eq(0)
  7574. , b = $("#player").eq(0)
  7575. , w = document.getElementById("pullTab")
  7576. , T = !1
  7577. , x = null
  7578. , S = !1
  7579. , M = !1
  7580. , R = null
  7581. , P = !1;
  7582. t.exports.init = function(e, t, i, n) {
  7583. (function(t, i, e, n) {
  7584. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7585. t.controls[e].on(d.Move, r),
  7586. t.controls[e].on(d.LongTap, s)
  7587. }),
  7588. b.on("mousewheel DOMMouseScroll", r),
  7589. e.on(u.TagActivated, r),
  7590. e.on(u.TagNavigation, r),
  7591. i.on(p.FlyingEnded, o),
  7592. i.on(p.ModeChanging, function(e, t) {
  7593. P = t !== g.PANORAMA && e !== g.PANORAMA
  7594. }),
  7595. i.on(p.ModeChanged, function(e, t) {
  7596. R = i.mode,
  7597. t !== g.TRANSITIONING ? a() : r("modeChange")
  7598. }),
  7599. n.on(f.TourStart, function() {
  7600. S = !0,
  7601. r()
  7602. }),
  7603. n.on(f.TourEnd, function() {
  7604. S = !1,
  7605. a()
  7606. }),
  7607. n.on(f.ActionInterrupted, function() {
  7608. S = !1
  7609. }),
  7610. w.addEventListener("touchend", function() {
  7611. $("#pullTab").hasClass("opened") && !S && a()
  7612. }, !0)
  7613. }
  7614. )(e, t, i, n),
  7615. l.isMobile() ? (y.forEach(function(e) {
  7616. e.classList.add("mobile")
  7617. }),
  7618. A.click(a)) : (y.forEach(function(e) {
  7619. e.addEventListener("mouseleave", function() {
  7620. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7621. }, !0)
  7622. }),
  7623. b.mouseleave(function() {
  7624. y[0].classList.contains("detectHover") && a()
  7625. })),
  7626. R = t.mode
  7627. }
  7628. ,
  7629. t.exports.hideUi = r,
  7630. t.exports.resetDrawer = function() {
  7631. I.hasClass("duringTour") || (S = !1,
  7632. r("gui"),
  7633. a())
  7634. }
  7635. }
  7636. , {
  7637. "../enum/ControlEvents": 21,
  7638. "../enum/DirectorEvents": 23,
  7639. "../enum/tagEvents": 32,
  7640. "../enum/PlayerEvents": 40,
  7641. "../enum/Viewmode": 51,
  7642. "../settings": 166,
  7643. "../util/browser": 182,
  7644. "./help/help": 67
  7645. }],
  7646. 70: [function(i, n, e) {
  7647. (function(e) {
  7648. "use strict";
  7649. var t = i("./../util/logger")
  7650. , o = i("./../settings")
  7651. , a = i("./debug")
  7652. , s = i("./../util/common")
  7653. , l = (i("./gui"),
  7654. new t(e));
  7655. o.console && $("body").append('<div id="debug-console"></div>'),
  7656. n.exports.init = function(i, n, r) {
  7657. l.debug("konami has the modelInstance");
  7658. var t = [];
  7659. $(window).on("keydown", function(e) {
  7660. t.push(e.which),
  7661. t.length > o.secretPanelWord.length && t.shift(),
  7662. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7663. o.debug = !0)
  7664. }),
  7665. $(window).on("keydown", function e(t) {
  7666. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7667. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7668. })
  7669. }
  7670. }
  7671. ).call(this, "/js/gui/konami.js")
  7672. }
  7673. , {
  7674. "./../settings": 166,
  7675. "./../util/common": 185,
  7676. "./../util/logger": 189,
  7677. "./debug": 63,
  7678. "./gui": 65
  7679. }],
  7680. 71: [function(e, t, i) {
  7681. "use strict";
  7682. function r() {
  7683. s.clear(m, l.LANDING[v]),
  7684. g.removeClass("fadeIn")
  7685. }
  7686. var o = e("../settings")
  7687. , a = (e("./help/help"),
  7688. e("./helpManager"))
  7689. , s = e("./populateModal")
  7690. , l = e("../enum/HelpModalType")
  7691. , n = e("../enum/Viewmode")
  7692. , c = e("../enum/DirectorEvents")
  7693. , h = e("../enum/PlayerEvents")
  7694. , u = $("#quick-blackout").eq(0)
  7695. , d = $("#quick-logo").eq(0)
  7696. , p = $(".quick-brand").toArray()
  7697. , f = $("#loaderCoBrand").eq(0)
  7698. , g = $("#interaction-modal").eq(0)
  7699. , m = g.find(".interaction").toArray()
  7700. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7701. "");
  7702. t.exports.delayLanding = function(e) {
  7703. var t = $.Deferred();
  7704. e || t.resolve();
  7705. var i = o.startupFlyinDelay;
  7706. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7707. setTimeout(t.resolve.bind(t), i),
  7708. t
  7709. }
  7710. ,
  7711. t.exports.showMessage = function(e, t, i) {
  7712. var n = 0;
  7713. o.quickstart.enabled && (function(e) {
  7714. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7715. d.before(f),
  7716. p = $(".quick-brand").toArray()), */
  7717. u.addClass("fadeOut")
  7718. /* setTimeout(function() {
  7719. p.forEach(function(e) {
  7720. e.classList.add("fadeIn")
  7721. })
  7722. }, o.quickstart.showTextDelay),
  7723. setTimeout(function() {
  7724. p.forEach(function(e) {
  7725. e.classList.add("fadeOut")
  7726. })
  7727. }, o.quickstart.fadeOutDelay) */
  7728. }(i),
  7729. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7730. function(e, t) {
  7731. setTimeout(function() {
  7732. if (a.isHelpEnabled()) {
  7733. if (t(),
  7734. s.init(),
  7735. g.addClass("fadeIn landing " + s.deviceType),
  7736. a.isSmallHelpEnabled())
  7737. return void g.addClass("small");
  7738. s.fill(m, l.LANDING[v]),
  7739. g.addClass(v)
  7740. }
  7741. }, e);
  7742. var i = {
  7743. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7744. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7745. }
  7746. , n = $(".nav-icon .icon");
  7747. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7748. function r(e) {
  7749. e.on("click", function() {
  7750. var e = null;
  7751. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7752. i.length < e || e < 1)
  7753. return !1;
  7754. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7755. "data-page": e,
  7756. src: i.mobile[e - 1]
  7757. }) : n.attr({
  7758. "data-page": e,
  7759. src: i.pc[e - 1]
  7760. })
  7761. })
  7762. }
  7763. r($(".next-button")),
  7764. r($(".prev-button"))
  7765. }(n, function() {
  7766. e.once(h.Move, r),
  7767. t.once(c.TourStart, r)
  7768. })
  7769. }
  7770. ,
  7771. t.exports.init = function(e, t) {
  7772. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7773. }
  7774. ,
  7775. t.exports.dismissModal = r
  7776. }
  7777. , {
  7778. "../enum/DirectorEvents": 23,
  7779. "../enum/HelpModalType": 28,
  7780. "../enum/PlayerEvents": 40,
  7781. "../enum/Viewmode": 51,
  7782. "../settings": 166,
  7783. "./help/help": 67,
  7784. "./helpManager": 68,
  7785. "./populateModal": 75
  7786. }],
  7787. 72: [function(e, t, i) {
  7788. "use strict";
  7789. var n = e("./circleLoader").circleLoader;
  7790. t.exports = {
  7791. element: $("#gui-loading"),
  7792. hide: function(e) {
  7793. n.done(),
  7794. this.element.fadeOut(1500, e)
  7795. },
  7796. show: function(e) {
  7797. this.element.fadeIn(500, function() {
  7798. this.element.css("display", "table"),
  7799. e && e()
  7800. }
  7801. .bind(this))
  7802. },
  7803. progress: function(e) {
  7804. n.set(e)
  7805. }
  7806. }
  7807. }
  7808. , {
  7809. "./circleLoader": 60
  7810. }],
  7811. 73: [function(e, t, i) {
  7812. "use strict";
  7813. var n = e("../settings")
  7814. , r = $("#memory-info")
  7815. , o = r.find("#memory-gpu")
  7816. , a = !1;
  7817. t.exports = {
  7818. show: function() {
  7819. n.profiling.enabled && (r.show(),
  7820. a = !0)
  7821. },
  7822. hide: function() {
  7823. r.hide(),
  7824. a = !1
  7825. },
  7826. toggle: function() {
  7827. a ? this.hide() : this.show()
  7828. },
  7829. update: function(e) {
  7830. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7831. }
  7832. }
  7833. }
  7834. , {
  7835. "../settings": 166
  7836. }],
  7837. 74: [function(e, t, i) {
  7838. "use strict";
  7839. e("../util/browser"),
  7840. e("../analytics");
  7841. e("../settings"),
  7842. t.exports = {
  7843. show: function(e, t) {
  7844. $("#gui-message").fadeOut(500, function() {
  7845. t()
  7846. })
  7847. }
  7848. }
  7849. }
  7850. , {
  7851. "../analytics": 4,
  7852. "../settings": 166,
  7853. "../util/browser": 182
  7854. }],
  7855. 75: [function(e, t, i) {
  7856. "use strict";
  7857. function n(e, t, i, n) {
  7858. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7859. }
  7860. var r = e("../util/browser")
  7861. , o = e("../localization/localize")
  7862. , a = e("../enum/HelpModalType")
  7863. , s = (e("../enum/HelpModalSize"),
  7864. e("../enum/Viewmode"));
  7865. t.exports = {
  7866. init: function() {
  7867. if (!this.hasInitialized) {
  7868. this.hasInitialized = !0,
  7869. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7870. this.assets = {},
  7871. this.assets[a.LANDING[s.PANORAMA]] = {
  7872. desktop: {
  7873. left: {
  7874. "top-info": o.ROTATE,
  7875. "big-image": "images/nav_help_mouse_drag_left.png",
  7876. keyboard: "images/nav_help_keyboard_left_right.png"
  7877. },
  7878. middle: {
  7879. "top-info": o.MOVE,
  7880. "big-image": "images/nav_help_mouse_click.png",
  7881. keyboard: "images/nav_help_keyboard_up_down.png"
  7882. },
  7883. right: {
  7884. "top-info": o.ZOOM,
  7885. "big-image": "images/nav_help_mouse_zoom.png",
  7886. keyboard: "images/nav_help_zoom_keys.png"
  7887. }
  7888. },
  7889. mobile: {
  7890. left: {
  7891. "top-info": o.ROTATE,
  7892. "big-image": "images/nav_help_gesture_drag.png"
  7893. },
  7894. middle: {
  7895. "top-info": o.MOVE,
  7896. "big-image": "images/nav_help_gesture_tap.png"
  7897. },
  7898. right: {
  7899. "top-info": o.ZOOM,
  7900. "big-image": "images/nav_help_gesture_pinch.png"
  7901. }
  7902. }
  7903. },
  7904. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7905. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7906. desktop: {
  7907. left: {
  7908. "top-info": o.ROTATE,
  7909. "big-image": "images/nav_help_mouse_drag_left.png",
  7910. keyboard: "images/nav_help_keyboard_left_right.png"
  7911. },
  7912. middle: {
  7913. "top-info": o.MOVE,
  7914. "big-image": "images/nav_help_mouse_position_right.png"
  7915. }
  7916. },
  7917. mobile: {
  7918. left: {
  7919. "top-info": o.ROTATE,
  7920. "big-image": "images/nav_help_gesture_drag.png"
  7921. },
  7922. middle: {
  7923. "top-info": o.MOVE,
  7924. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7925. }
  7926. }
  7927. },
  7928. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7929. desktop: {
  7930. left: {
  7931. "top-info": o.MOVE,
  7932. "big-image": "images/nav_help_mouse_position_left.png"
  7933. },
  7934. middle: {
  7935. "top-info": o.ROTATE,
  7936. "big-image": "images/nav_help_mouse_drag_right.png",
  7937. keyboard: "images/nav_help_keyboard_left_right.png"
  7938. }
  7939. },
  7940. mobile: {
  7941. left: {
  7942. "top-info": o.MOVE,
  7943. "big-image": "images/nav_help_gesture_position.png"
  7944. },
  7945. middle: {
  7946. "top-info": o.ROTATE,
  7947. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7948. }
  7949. }
  7950. };
  7951. var e = {
  7952. "top-info": o.INSIDE,
  7953. "big-image": "images/nav_help_click_inside.png",
  7954. keyboard: "images/nav_help_inside_key.png"
  7955. };
  7956. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7957. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7958. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7959. var t = {
  7960. "top-info": o.INSIDE,
  7961. "big-image": "images/nav_help_tap_inside.png"
  7962. };
  7963. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7964. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7965. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7966. this.assets[a.NAVIGATION] = {},
  7967. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7968. desktop: {
  7969. left: {
  7970. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7971. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7972. "big-image": "images/nav_help_mouse_drag_left.png",
  7973. keyboard: "images/nav_help_keyboard_left_right.png"
  7974. },
  7975. middle: {
  7976. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7977. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7978. "big-image": "images/nav_help_mouse_click.png",
  7979. keyboard: "images/nav_help_keyboard_up_down.png"
  7980. },
  7981. right: {
  7982. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7983. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7984. "big-image": "images/nav_help_mouse_zoom.png",
  7985. keyboard: "images/nav_help_zoom_keys.png"
  7986. }
  7987. },
  7988. mobile: {
  7989. left: {
  7990. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7991. "big-image": "images/nav_help_gesture_drag.png"
  7992. },
  7993. middle: {
  7994. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7995. "big-image": "images/nav_help_gesture_tap.png"
  7996. },
  7997. right: {
  7998. "top-info": o.HELP_MOBILE_3,
  7999. "big-image": "images/nav_help_gesture_pinch.png"
  8000. }
  8001. }
  8002. },
  8003. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8004. desktop: {
  8005. left: {
  8006. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8007. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8008. "big-image": "images/nav_help_mouse_drag_left.png",
  8009. keyboard: "images/nav_help_keyboard_all.png"
  8010. },
  8011. middle: {
  8012. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8013. "big-image": "images/nav_help_mouse_position_right.png"
  8014. },
  8015. right: {
  8016. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8017. "big-image": "images/nav_help_mouse_zoom.png"
  8018. }
  8019. },
  8020. mobile: {
  8021. left: {
  8022. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8023. "big-image": "images/nav_help_gesture_drag.png"
  8024. },
  8025. middle: {
  8026. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8027. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8028. },
  8029. right: {
  8030. "top-info": o.HELP_MOBILE_3,
  8031. "big-image": "images/nav_help_gesture_pinch.png"
  8032. }
  8033. }
  8034. },
  8035. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8036. desktop: {
  8037. left: {
  8038. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8039. "big-image": "images/nav_help_mouse_position_left.png"
  8040. },
  8041. middle: {
  8042. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8043. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8044. "big-image": "images/nav_help_mouse_drag_right.png",
  8045. keyboard: "images/nav_help_keyboard_left_right.png"
  8046. },
  8047. right: {
  8048. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8049. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8050. "big-image": "images/nav_help_mouse_zoom.png",
  8051. keyboard: "images/nav_help_keyboard_up_down.png"
  8052. }
  8053. },
  8054. mobile: {
  8055. left: {
  8056. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8057. "big-image": "images/nav_help_gesture_position.png"
  8058. },
  8059. middle: {
  8060. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8061. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8062. },
  8063. right: {
  8064. "top-info": o.HELP_MOBILE_3,
  8065. "big-image": "images/nav_help_gesture_pinch.png"
  8066. }
  8067. }
  8068. },
  8069. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8070. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8071. "top-info": o.HELP_DESKTOP_360_2A,
  8072. "bottom-info": o.HELP_DESKTOP_360_2B,
  8073. "big-image": "images/nav_help_click_inside.png",
  8074. keyboard: "images/nav_help_inside_key.png"
  8075. },
  8076. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8077. "top-info": o.HELP_MOBILE_360_2,
  8078. "big-image": "images/nav_help_tap_inside.png"
  8079. },
  8080. this.assets[a.MORE_HELP] = {
  8081. desktop: {
  8082. "more-help-hlr": {
  8083. "top-info": o.HELP_MORE_HLR_A,
  8084. "big-image": "images/nav_help_expand.svg",
  8085. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8086. },
  8087. "more-help-dollhouse": {
  8088. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8089. "big-image": "images/nav_help_dollhouse.svg",
  8090. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8091. },
  8092. "more-help-floors": {
  8093. "top-info": o.HELP_MORE_FLOORS_A,
  8094. "big-image": "images/nav_help_floor picker.svg",
  8095. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8096. },
  8097. "more-help-tag": {
  8098. "top-info": o.HELP_MORE_TAG_A,
  8099. "big-image": "images/nav_help_tag.svg",
  8100. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8101. },
  8102. "more-help-zoom": {
  8103. "top-info": o.HELP_MORE_ZOOM_A,
  8104. "big-image": "images/nav_help_zoom.svg",
  8105. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8106. },
  8107. "more-help-tour": {
  8108. "top-info": o.HELP_MORE_TOUR_A,
  8109. "big-image": "images/nav_help_play.png",
  8110. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8111. },
  8112. "more-help-inside": {
  8113. "top-info": o.HELP_MORE_INSIDE_A,
  8114. "big-image": "images/nav_help_inside.svg",
  8115. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8116. },
  8117. "more-help-vr": {
  8118. "top-info": o.HELP_MORE_VR_A,
  8119. "big-image": "images/nav_help_vr.svg",
  8120. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8121. },
  8122. "more-help-360": {
  8123. "top-info": o.HELP_MORE_360_A,
  8124. "big-image": "images/nav_help_360.svg",
  8125. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8126. },
  8127. "more-help-fullscreen": {
  8128. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8129. "big-image": "images/nav_help_fullscreen.svg",
  8130. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8131. }
  8132. },
  8133. mobile: {
  8134. "more-help-hlr": {
  8135. "top-info": o.HELP_MORE_HLR_A,
  8136. "big-image": "images/nav_help_expand.svg",
  8137. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8138. },
  8139. "more-help-dollhouse": {
  8140. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8141. "big-image": "images/nav_help_dollhouse.svg",
  8142. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8143. },
  8144. "more-help-floors": {
  8145. "top-info": o.HELP_MORE_FLOORS_A,
  8146. "big-image": "images/nav_help_floor picker.svg",
  8147. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8148. },
  8149. "more-help-tag": {
  8150. "top-info": o.HELP_MORE_TAG_A,
  8151. "big-image": "images/nav_help_tag.svg",
  8152. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8153. },
  8154. "more-help-tour": {
  8155. "top-info": o.HELP_MORE_TOUR_A,
  8156. "big-image": "images/nav_help_play.png",
  8157. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8158. },
  8159. "more-help-inside": {
  8160. "top-info": o.HELP_MORE_INSIDE_A,
  8161. "big-image": "images/nav_help_inside.svg",
  8162. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8163. },
  8164. "more-help-vr": {
  8165. "top-info": o.HELP_MORE_VR_A,
  8166. "big-image": "images/webvr.svg",
  8167. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8168. },
  8169. "more-help-360": {
  8170. "top-info": o.HELP_MORE_360_A,
  8171. "big-image": "images/nav_help_360.svg",
  8172. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8173. }
  8174. }
  8175. },
  8176. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8177. desktop: {
  8178. left: {
  8179. "top-info": o.ROTATE,
  8180. "big-image": "images/nav_help_mouse_drag_left.png",
  8181. keyboard: "images/nav_help_keyboard_left_right.png"
  8182. },
  8183. middle: {
  8184. "top-info": o.MOVE,
  8185. "big-image": "images/nav_help_mouse_click.png",
  8186. keyboard: "images/nav_help_keyboard_up_down.png"
  8187. },
  8188. right: {
  8189. "top-info": o.PLAY,
  8190. "big-image": "images/Desktop-help-play-button.svg",
  8191. keyboard: "images/Desktop-help-spacebar-2.svg"
  8192. }
  8193. },
  8194. mobile: {
  8195. left: {
  8196. "top-info": o.ROTATE,
  8197. "big-image": "images/nav_help_gesture_drag.png"
  8198. },
  8199. middle: {
  8200. "top-info": o.MOVE,
  8201. "big-image": "images/nav_help_gesture_tap.png"
  8202. },
  8203. right: {
  8204. "top-info": o.PLAY,
  8205. "big-image": "images/mobile-help-play-button.svg"
  8206. }
  8207. }
  8208. },
  8209. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8210. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8211. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8212. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8213. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8214. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8215. }
  8216. },
  8217. fill: function(e, t, i) {
  8218. n.call(this, e, t, i, !0)
  8219. },
  8220. clear: function(e, t, i) {
  8221. n.call(this, e, t, i, !1)
  8222. }
  8223. }
  8224. }
  8225. , {
  8226. "../enum/HelpModalSize": 27,
  8227. "../enum/HelpModalType": 28,
  8228. "../enum/Viewmode": 51,
  8229. "../localization/localize": 108,
  8230. "../util/browser": 182
  8231. }],
  8232. 76: [function(e, t, i) {
  8233. "use strict";
  8234. t.exports = Object.freeze({
  8235. OPENED: "share.open",
  8236. CLOSED: "share.closed",
  8237. LINK_CLICKED: "share.linked"
  8238. })
  8239. }
  8240. , {}],
  8241. 77: [function(e, t, i) {
  8242. "use strict";
  8243. function n(n) {
  8244. function e(e, t) {
  8245. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8246. I.emit(l.LINK_CLICKED, {
  8247. channel: n
  8248. }),
  8249. window.open(C[n], "shareWindow", i)
  8250. }
  8251. switch (n) {
  8252. case A.FACEBOOK:
  8253. e(580, 420);
  8254. break;
  8255. case A.TWITTER:
  8256. e(550, 440);
  8257. break;
  8258. case A.MAIL:
  8259. I.emit(l.LINK_CLICKED, {
  8260. channel: "email"
  8261. }),
  8262. window.open(C[n], "_blank");
  8263. break;
  8264. case A.LINKEDIN:
  8265. }
  8266. }
  8267. function r(e) {
  8268. I.emit(l.LINK_CLICKED, {
  8269. channel: "copylink"
  8270. });
  8271. var t = document.createRange();
  8272. t.selectNodeContents(v);
  8273. var i = window.getSelection();
  8274. i.removeAllRanges(),
  8275. i.addRange(t),
  8276. document.execCommand("copy"),
  8277. y.classList.remove("hidden"),
  8278. v.classList.add("highlighted")
  8279. }
  8280. function o(e) {
  8281. e && (e.stopPropagation(),
  8282. e.target === v) || (window.getSelection().removeAllRanges(),
  8283. v.classList.remove("highlighted"),
  8284. y.classList.add("hidden"))
  8285. }
  8286. var a = e("../../util/browser")
  8287. , s = e("../../localization/localize")
  8288. , l = e("./ShareEvents")
  8289. , c = e("../../util/common")
  8290. , h = e("events").EventEmitter
  8291. , u = document.getElementById("sharing")
  8292. , d = document.getElementById("share-modal")
  8293. , p = document.getElementById("share-close")
  8294. , f = document.getElementById("facebook-share")
  8295. , g = document.getElementById("twitter-share")
  8296. , m = document.getElementById("mail-share")
  8297. , v = document.getElementById("share-url-text")
  8298. , y = document.getElementById("copy-success")
  8299. , A = Object.freeze({
  8300. FACEBOOK: "facebook",
  8301. TWITTER: "twitter",
  8302. MAIL: "mail",
  8303. LINKEDIN: "linkedin"
  8304. })
  8305. , C = {};
  8306. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8307. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8308. C[A.MAIL] = "mailto:?subject=";
  8309. var I = {
  8310. init: function(e) {
  8311. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8312. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8313. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8314. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8315. u.addEventListener("click", this.toggle.bind(this)),
  8316. p.addEventListener("click", this.hide.bind(this)),
  8317. v.addEventListener("click", r),
  8318. d.addEventListener("click", o),
  8319. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8320. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8321. m.addEventListener("click", n.bind(this, A.MAIL)),
  8322. v.textContent = window.location.href + "&utm_source=4",
  8323. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8324. u.classList.remove("hidden")
  8325. },
  8326. show: function() {
  8327. this.emit(l.OPENED),
  8328. d.classList.add("fadeIn")
  8329. },
  8330. hide: function() {
  8331. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8332. document.selection && document.selection.empty(),
  8333. window.getSelection().removeAllRanges(),
  8334. o(),
  8335. d.classList.remove("fadeIn"))
  8336. },
  8337. toggle: function() {
  8338. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8339. }
  8340. };
  8341. c.extendObject(I, h.prototype),
  8342. t.exports = I
  8343. }
  8344. , {
  8345. "../../localization/localize": 108,
  8346. "../../util/browser": 182,
  8347. "../../util/common": 185,
  8348. "./ShareEvents": 76,
  8349. events: 202
  8350. }],
  8351. 78: [function(e, t, i) {
  8352. "use strict";
  8353. t.exports = Object.freeze({
  8354. OPENED: "terms.opened",
  8355. CLOSED: "terms.closed"
  8356. })
  8357. }
  8358. , {}],
  8359. 79: [function(e, t, i) {
  8360. "use strict";
  8361. var n = e("./TermsEvent")
  8362. , r = e("../../localization/localize")
  8363. , o = e("../../analytics")
  8364. , a = e("../../util/ajax")
  8365. , s = e("../../util/common")
  8366. , l = e("events").EventEmitter
  8367. , c = document.getElementById("terms-modal")
  8368. , h = {
  8369. init: function() {
  8370. $(".footer-terms").on("click", function(e) {
  8371. e.preventDefault(),
  8372. this.show()
  8373. }
  8374. .bind(this)),
  8375. $("#terms-modal .close").on("click", this.hide.bind(this))
  8376. },
  8377. show: function() {
  8378. this.emit(n.OPENED),
  8379. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8380. var t = $("#terms-text").html(e);
  8381. o.track("showcase_gui", {
  8382. gui_action: "click_terms_button",
  8383. interaction_source: "gui"
  8384. }),
  8385. t.find("a").attr("target", "_blank")
  8386. }).fail(function() {
  8387. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8388. }),
  8389. c.classList.add("fadeIn")
  8390. },
  8391. hide: function(e) {
  8392. e && e.preventDefault(),
  8393. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8394. c.classList.remove("fadeIn")
  8395. }
  8396. };
  8397. s.extendObject(h, l.prototype),
  8398. t.exports = h
  8399. }
  8400. , {
  8401. "../../analytics": 4,
  8402. "../../localization/localize": 108,
  8403. "../../util/ajax": 181,
  8404. "../../util/common": 185,
  8405. "./TermsEvent": 78,
  8406. events: 202
  8407. }],
  8408. 80: [function(e, t, i) {
  8409. "use strict";
  8410. t.exports = Object.freeze({
  8411. OPEN_INFO: "title.open.info",
  8412. CLOSE_INFO: "title.close.info",
  8413. SHOW_INFO: "title.show.info",
  8414. HIDE_INFO: "title.hide.info",
  8415. LINK_CLICKED: "title.link.click",
  8416. CONTACT_LINK_CLICKED: "title.contact.click",
  8417. ORIGIN_LINK_CLICKED: "title.origin.click"
  8418. })
  8419. }
  8420. , {}],
  8421. 81: [function(e, t, i) {
  8422. "use strict";
  8423. var o = e("../../settings");
  8424. t.exports.init = function(e, t) {
  8425. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8426. function e(e) {
  8427. t.shouldShowtags = "show" === this.value,
  8428. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8429. }
  8430. document.getElementById("tag-toggles").classList.remove("hidden"),
  8431. document.getElementById("radio-tag-show").checked = !0;
  8432. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8433. n[r].addEventListener("change", e)
  8434. }(e, t)
  8435. }
  8436. }
  8437. , {
  8438. "../../settings": 166
  8439. }],
  8440. 82: [function(S, M, e) {
  8441. (function(e) {
  8442. "use strict";
  8443. function i(e) {
  8444. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8445. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8446. _.appendChild(function(e) {
  8447. var t = document.createElement("a");
  8448. return t.id = "url",
  8449. t.target = "_blank",
  8450. t.href = e,
  8451. t.innerText = e,
  8452. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8453. t
  8454. }(e)),
  8455. b.forEach(function(e) {
  8456. e.classList.add("share-link")
  8457. }),
  8458. 0))
  8459. }
  8460. function s(e, t) {
  8461. var i = e
  8462. , n = t;
  8463. return function(e, t) {
  8464. i.push(t || n, e)
  8465. }
  8466. }
  8467. var l = S("../../util/browser")
  8468. , t = S("../../util/common")
  8469. , n = S("../../util/logger")
  8470. , r = S("../../localization/localize")
  8471. , o = S("./titleBarSettings")
  8472. , c = S("../../settings")
  8473. , a = S("./TitleEvents")
  8474. , h = S("events").EventEmitter
  8475. , u = new n(e)
  8476. , d = document.querySelector(".pinTop.left")
  8477. , p = document.getElementsByClassName("title-container")[0]
  8478. , f = document.getElementById("title-toggle").querySelector("i")
  8479. , g = document.getElementById("meta-info-wrapper")
  8480. , m = document.getElementById("meta-info")
  8481. , v = document.getElementById("meta-description")
  8482. , y = document.getElementsByClassName("contact-info")[0]
  8483. , A = document.getElementById("contact-data")
  8484. , C = document.getElementById("addressTxt")
  8485. , I = document.getElementById("tag-toggles")
  8486. , E = document.getElementById("share-origin")
  8487. , _ = document.getElementById("share-link-wrapper")
  8488. , b = [m, g, p]
  8489. , w = !1
  8490. , T = !1
  8491. , x = {
  8492. populate: function(e) {
  8493. if (function(e, t) {
  8494. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8495. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8496. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8497. document.getElementById("gui-name").classList.add("noCoBrand"),
  8498. document.getElementById("cobrandTitle").classList.add("hidden")),
  8499. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8500. !1)
  8501. }(DATA.name, e.coBrand)) {
  8502. if (function(e) {
  8503. e ? (w = !0,
  8504. v.innerHTML = e) : v.classList.add("hidden")
  8505. }(e.description),
  8506. function(e, t, i, n) {
  8507. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8508. w = !0;
  8509. var r = []
  8510. , o = s(r, "<br>");
  8511. if (e && o('<span id="contactName">' + e + "</span>"),
  8512. t) {
  8513. var a = n || t;
  8514. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8515. }
  8516. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8517. r[0] = "",
  8518. A.innerHTML = r.join("")
  8519. } else
  8520. y.classList.add("hidden")
  8521. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8522. function(e) {
  8523. if ("string" == typeof e)
  8524. try {
  8525. e = JSON.parse(e)
  8526. } catch (e) {
  8527. return u.warn("Unable to parse address data"),
  8528. C.parentElement.classList.add("hidden")
  8529. }
  8530. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8531. w = !0;
  8532. var t = []
  8533. , i = s(t, " ");
  8534. e.address_1 && i(e.address_1),
  8535. e.address_2 && i(e.address_2),
  8536. e.city && i(e.city, ", "),
  8537. e.state && i(e.state, ", "),
  8538. e.zip && i(e.zip, e.state ? " " : ", "),
  8539. t[0] = "",
  8540. C.innerText = t.join("")
  8541. } else
  8542. C.parentElement.classList.add("hidden")
  8543. }(e.address),
  8544. w) {
  8545. var t = document.createElement("br");
  8546. I.insertBefore(t, I.firstElementChild)
  8547. }
  8548. e.socialSharing && c.share.enabled && (T = i(e.url))
  8549. }
  8550. },
  8551. finishSetup: function(e) {
  8552. w = w || !!e,
  8553. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8554. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8555. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8556. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8557. }),
  8558. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8559. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8560. contact_type: e.getAttribute("id")
  8561. }))
  8562. }),
  8563. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8564. },
  8565. toggleMeta: function(e, t) {
  8566. var i = document.getElementById("model-title");
  8567. t && t.preventDefault();
  8568. var n = m.classList.contains("expand");
  8569. e && !n || (n ? (b.forEach(function(e) {
  8570. e.classList.remove("expand")
  8571. }),
  8572. this.emit(a.CLOSE_INFO),
  8573. i.classList.remove("expand")) : (b.forEach(function(e) {
  8574. e.classList.add("expand")
  8575. }),
  8576. i.classList.add("expand"),
  8577. this.emit(a.OPEN_INFO)))
  8578. },
  8579. setupToggling: function() {
  8580. g.style.height = m.offsetHeight + "px",
  8581. m.addEventListener("transitionend", function() {
  8582. g.style.height = m.offsetHeight + "px"
  8583. })
  8584. },
  8585. toggleTitle: function(e) {
  8586. e && e.preventDefault(),
  8587. d.classList.contains("closed") ? (d.classList.add("open"),
  8588. f.classList.remove("icon-dpad-right"),
  8589. f.classList.add("icon-dpad-left"),
  8590. this.emit(a.SHOW_INFO),
  8591. setTimeout(function() {
  8592. d.classList.remove("closed"),
  8593. d.classList.remove("open")
  8594. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8595. f.classList.remove("icon-dpad-left"),
  8596. f.classList.add("icon-dpad-right"),
  8597. this.emit(a.HIDE_INFO))
  8598. }
  8599. };
  8600. t.extendObject(x, h.prototype),
  8601. M.exports = x
  8602. }
  8603. ).call(this, "/js/gui/title/titleBar.js")
  8604. }
  8605. , {
  8606. "../../localization/localize": 108,
  8607. "../../settings": 166,
  8608. "../../util/browser": 182,
  8609. "../../util/common": 185,
  8610. "../../util/logger": 189,
  8611. "./TitleEvents": 80,
  8612. "./titleBarSettings": 83,
  8613. events: 202
  8614. }],
  8615. 83: [function(e, t, i) {
  8616. "use strict";
  8617. t.exports = Object.freeze({
  8618. minTooltipCharacters: 19,
  8619. removeAnimationClasses: 500
  8620. })
  8621. }
  8622. , {}],
  8623. 84: [function(e, t, i) {
  8624. "use strict";
  8625. function n() {
  8626. v.playTour(),
  8627. y && clearTimeout(y),
  8628. c(),
  8629. E.removeClass("fadeIn")
  8630. }
  8631. function r() {
  8632. A.classList.contains("playing") && (v.stopTour(),
  8633. E.addClass("fadeIn"),
  8634. setTimeout(function() {
  8635. E.removeClass("fadeIn")
  8636. }, h.tourInteraction.showPauseButton),
  8637. M || (clearTimeout(y),
  8638. y = setTimeout(s, h.tourInteraction.showModal)),
  8639. setTimeout(function() {
  8640. A.classList.remove("playing")
  8641. }, h.tourInteraction.allowNextClick))
  8642. }
  8643. function o() {
  8644. v.tourInProgress && (v.stopTour(),
  8645. v.endTourProgress(),
  8646. A.classList.remove("playing"))
  8647. }
  8648. function a() {
  8649. _.is(":visible") ? n() : r()
  8650. }
  8651. function s() {//去掉导览结束时的提示
  8652. /* if (!h.tourInteraction.disabled) {
  8653. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8654. T.addClass("fadeIn tour " + p.deviceType);
  8655. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8656. if (!h.tourInteraction.smallModal)
  8657. 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,
  8658. p.fill(x, g.TOUR_INTERACTION[e]),
  8659. T.addClass(e);
  8660. T.addClass(t)
  8661. } */
  8662. }
  8663. function l(e, t) {
  8664. if (t) {
  8665. var i = "keydown" === t.type
  8666. , n = t.which === u.SPACE || v.tourIsPlaying;
  8667. i && n || e || (M = !0),
  8668. v.atEndOfTour() && c(),
  8669. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8670. c(),
  8671. t.which !== u.SPACE && o()),
  8672. i && n && a()
  8673. }
  8674. }
  8675. function c() {
  8676. T.removeClass("fadeIn")
  8677. }
  8678. var h = (e("../util/browser"),
  8679. e("../settings"))
  8680. , u = e("../enum/Keys")
  8681. , d = e("../enum/Viewmode")
  8682. , p = (e("./helpManager"),
  8683. e("./populateModal"))
  8684. , f = e("../enum/DirectorEvents")
  8685. , g = e("../enum/HelpModalType")
  8686. , m = e("../enum/HelpModalSize")
  8687. , v = null
  8688. , y = null
  8689. , A = document.getElementById("pause-overlay")
  8690. , C = document.getElementById("player")
  8691. , I = document.getElementById("gui")
  8692. , E = $("#pause-icon").eq(0)
  8693. , _ = $("#play").eq(0)
  8694. , b = $("#playHead").eq(0)
  8695. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8696. , T = $("#interaction-modal").eq(0)
  8697. , x = $("#interaction-modal .interaction").toArray()
  8698. , S = ["touchstart", "mousedown", "pointerdown"]
  8699. , M = !1;
  8700. t.exports.init = function(e) {
  8701. v = e,
  8702. S.forEach(function(t) {
  8703. C.addEventListener(t, l.bind(this, !1), !0),
  8704. I.addEventListener(t, l.bind(this, !0), !0),
  8705. A.addEventListener(t, r, !0),
  8706. w.forEach(function(e) {
  8707. e.addEventListener(t, o, !0)
  8708. }),
  8709. $("#drawer img").on(t, o)
  8710. }),
  8711. document.addEventListener("keydown", l.bind(this, !1), !0),
  8712. v.on(f.TourStart, function() {
  8713. A.classList.add("playing")
  8714. })
  8715. }
  8716. ,
  8717. t.exports.play = n,
  8718. t.exports.pause = r,
  8719. t.exports.pauseWithoutCTA = o,
  8720. t.exports.togglePlay = a,
  8721. t.exports.stopTour = function() {
  8722. b.hasClass("playing") && (clearTimeout(y),
  8723. v.atEndOfTour() ? (A.classList.remove("playing"),
  8724. s()) : E.removeClass("fadeIn"))
  8725. }
  8726. ,
  8727. t.exports.dismissModal = c
  8728. }
  8729. , {
  8730. "../enum/DirectorEvents": 23,
  8731. "../enum/HelpModalSize": 27,
  8732. "../enum/HelpModalType": 28,
  8733. "../enum/Keys": 30,
  8734. "../enum/Viewmode": 51,
  8735. "../settings": 166,
  8736. "../util/browser": 182,
  8737. "./helpManager": 68,
  8738. "./populateModal": 75
  8739. }],
  8740. 85: [function(e, t, i) {
  8741. "use strict";
  8742. t.exports = Object.freeze({
  8743. OPENED: "vr.modal.opened",
  8744. LAUNCH: "vr.modal.launch",
  8745. CLOSED: "vr.modal.closed",
  8746. NEXT: "vr.modal.next",
  8747. PREV: "vr.modal.prev",
  8748. STORE: "vr.modal.store",
  8749. falseICECHOSEN: "vr.modal.device"
  8750. })
  8751. }
  8752. , {}],
  8753. 86: [function(e, t, i) {
  8754. "use strict";
  8755. var h = e("../../util/browser")
  8756. , u = e("../../enum/VRApps")
  8757. , n = e("../../enum/VRPlatforms")
  8758. , d = e("../../util/ajax")
  8759. , p = e("../../settings")
  8760. , r = {};
  8761. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8762. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8763. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8764. u) {
  8765. var a = u[o];
  8766. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8767. }
  8768. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8769. "https://" + s);
  8770. t.exports.init = function(e, t, o) {
  8771. function a(e, t, i, n) {
  8772. function r() {
  8773. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8774. }
  8775. 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()
  8776. }
  8777. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8778. , l = g + "/vr/dlist/?ret=" + s
  8779. , c = g + "/vr/show/?ret=" + s;
  8780. switch (e) {
  8781. case n.IOS:
  8782. !function(t, e, i, n) {
  8783. var r = a(t, e, i, n)
  8784. , o = {
  8785. responseType: "json",
  8786. data: {
  8787. branch_key: p.appConfig.branch_key,
  8788. data: {
  8789. m: e,
  8790. full_url: r,
  8791. $desktop_url: "",
  8792. $og_app_id: "331853976762864119",
  8793. $og_title: i,
  8794. $og_description: n,
  8795. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8796. $canonical_url: window.location.href
  8797. }
  8798. }
  8799. };
  8800. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8801. f[t] = e.url
  8802. }).fail(function(e) {
  8803. f[t] = e
  8804. }
  8805. .bind(this, r))
  8806. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8807. break;
  8808. default:
  8809. !function(e, t, i) {
  8810. for (var n in u) {
  8811. var r = u[n]
  8812. , o = a(r, e, t, i);
  8813. f[r] = o
  8814. }
  8815. }(t.sid, t.name, t.summary)
  8816. }
  8817. }
  8818. ,
  8819. t.exports.launch = function(e) {
  8820. var t = f[e];
  8821. window.open(t, "_blank")
  8822. }
  8823. ,
  8824. t.exports.launchStore = function(e) {
  8825. var t = r[e];
  8826. window.open(t, "_blank")
  8827. }
  8828. }
  8829. , {
  8830. "../../enum/VRApps": 46,
  8831. "../../enum/VRPlatforms": 49,
  8832. "../../settings": 166,
  8833. "../../util/ajax": 181,
  8834. "../../util/browser": 182
  8835. }],
  8836. 87: [function(e, t, i) {
  8837. "use strict";
  8838. function c(e) {
  8839. var t;
  8840. switch (e) {
  8841. case y.IOS:
  8842. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8843. case y.Android:
  8844. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8845. }
  8846. return !1
  8847. }
  8848. function h(e) {
  8849. switch (e) {
  8850. case y.Android:
  8851. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8852. x.filter(".gearvr").off().on("click", q.gear),
  8853. n(k, U, "logo-button", "same-line");
  8854. break;
  8855. case y.UnsupportedAndroid:
  8856. n("", H, "", "");
  8857. break;
  8858. case y.IOS:
  8859. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8860. n(k, "", "logo-button", "");
  8861. break;
  8862. case y.Desktop:
  8863. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8864. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8865. n(k, U, "logo-button", "same-line"),
  8866. Q.cardboard()
  8867. }
  8868. }
  8869. function u(e) {
  8870. $(".p1, .p2, .p3").hide(),
  8871. l.insertAfter(T),
  8872. w.removeClass("front-page"),
  8873. w.removeClass("details-page"),
  8874. w.removeClass("lastPage"),
  8875. x.removeClass("logo-button"),
  8876. x.removeClass("same-line"),
  8877. T.removeClass("headsetOptions"),
  8878. S.attr("src", ""),
  8879. S.filter(".second").removeClass("gear"),
  8880. S.css("display", "inline-block"),
  8881. S.off(),
  8882. M.filter(".second").css("display", ""),
  8883. O.css("display", "none"),
  8884. $(".p" + (e + 1) + _).show(),
  8885. S.filter(".third").insertBefore(M.filter(".third"))
  8886. }
  8887. function n(e, t, i, n) {
  8888. w.addClass("front-page"),
  8889. S.filter(".first").attr("src", e),
  8890. S.filter(".second").attr("src", t),
  8891. x.filter(".first").addClass(i),
  8892. x.filter(".second").addClass(i),
  8893. x.addClass(n),
  8894. ".show-desktop" === _ && T.insertAfter(l)
  8895. }
  8896. function r(e, t, i) {
  8897. T.addClass("headsetOptions"),
  8898. x.off(),
  8899. S.filter(".second").attr("src", t),
  8900. O.css("display", "block"),
  8901. M.filter(".second").css("display", "none"),
  8902. O.on("click", function() {
  8903. u(b.Title),
  8904. h(y.Desktop)
  8905. }),
  8906. e && (X.emit(C.falseICECHOSEN, {
  8907. name: v.GearVR
  8908. }),
  8909. S.filter(".first").attr("src", e),
  8910. S.filter(".second").addClass("gear"),
  8911. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8912. Q.gearvr()),
  8913. i && (X.emit(C.falseICECHOSEN, {
  8914. name: v.Cardboard
  8915. }),
  8916. S.filter(".third").attr("src", i),
  8917. S.filter(".third").show(),
  8918. S.filter(".third").insertAfter(S.filter(".second")),
  8919. S.filter(".third").addClass("link"),
  8920. S.filter(".second").addClass("link"),
  8921. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8922. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8923. Q.cardboard())
  8924. }
  8925. function d(e, t) {
  8926. switch (t) {
  8927. case y.IOS:
  8928. j = W,
  8929. Y = G;
  8930. break;
  8931. case y.Desktop:
  8932. e === b.Cardboard ? (j = N,
  8933. Y = B,
  8934. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8935. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8936. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8937. Y = "");
  8938. break;
  8939. default:
  8940. Y = e === b.Cardboard ? (j = H,
  8941. G) : (j = V,
  8942. z)
  8943. }
  8944. }
  8945. function p(e, t, i) {
  8946. w.find(".inner").addClass("details-page"),
  8947. w.addClass("details-page"),
  8948. S.filter(".first").attr("src", e),
  8949. S.filter(".second").attr("src", t),
  8950. S.filter(".third").attr("src", i)
  8951. }
  8952. function f() {
  8953. var e = 1 < g.aspectRatio() && g.isMobile();
  8954. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8955. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8956. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8957. }
  8958. var g = e("../../util/browser")
  8959. , m = e("./vrLink")
  8960. , v = e("../../enum/VRApps")
  8961. , y = e("../../enum/VRPlatforms")
  8962. , A = e("../../enum/VRPages")
  8963. , C = e("./vrEvent")
  8964. , o = (e("../../settings"),
  8965. e("../../constants"))
  8966. , I = e("../../localization/localize")
  8967. , a = e("../../util/common")
  8968. , s = e("events").EventEmitter
  8969. , E = 0
  8970. , _ = null
  8971. , b = A.standard
  8972. , w = $(".vr-popup")
  8973. , l = w.find(".vr-popup-body")
  8974. , T = w.find(".vr-images")
  8975. , x = w.find(".img-container")
  8976. , S = w.find(".vr-sm-image")
  8977. , M = x.find(".vr-img-caption")
  8978. , R = $(".vr-buttons").find(".prev-button")
  8979. , P = $(".vr-buttons").find(".next-button")
  8980. , O = T.find(".front-close")
  8981. , L = $(".vr-page")
  8982. , D = w.find("img")
  8983. , N = "images/apple-store.png"
  8984. , F = "images/badge-oculus.png"
  8985. , B = "images/badge-cardboard.png"
  8986. , V = "images/logo-samsung.png"
  8987. , k = "images/headset-cardboard.png"
  8988. , U = "images/headset-gearvr.png"
  8989. , H = "images/ico-android-robot.png"
  8990. , z = "images/ico-gearvr.png"
  8991. , G = "images/ico-vr.png"
  8992. , W = "images/apple-logo-white.svg"
  8993. , j = null
  8994. , Y = null
  8995. , q = {}
  8996. , X = {
  8997. init: function(e, t) {
  8998. function i(e) {
  8999. X.emit(C.STORE, {
  9000. type: e
  9001. }),
  9002. m.launchStore(e)
  9003. }
  9004. function n(e) {
  9005. switch (e !== b.pageCount && (u(e),
  9006. L.text(e + 1 + " / " + b.pageCount)),
  9007. e) {
  9008. case b.Title:
  9009. R.css("display", "none"),
  9010. P.text(a[e]),
  9011. h(r);
  9012. break;
  9013. case b.Cardboard:
  9014. R.css("display", "block"),
  9015. P.text(a[e]),
  9016. x.filter(".cardboard").off(),
  9017. x.filter(".gearvr").off(),
  9018. d(e, r),
  9019. p(k, j, Y);
  9020. break;
  9021. case b.Gear:
  9022. P.text(a[e]),
  9023. d(e, r),
  9024. w.addClass("lastPage"),
  9025. p(U, j, Y);
  9026. break;
  9027. case b.pageCount:
  9028. w.removeClass("fadeIn"),
  9029. X.emit(C.CLOSED)
  9030. }
  9031. D.filter("[src='']").hide()
  9032. }
  9033. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  9034. _ = ".show-supported",
  9035. y.Android) : (w.addClass("unsupported"),
  9036. _ = ".show-unsupported",
  9037. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  9038. _ = ".show-ios",
  9039. b = A.ios,
  9040. y.IOS) : (w.addClass("desktop"),
  9041. _ = ".show-desktop",
  9042. y.Desktop);
  9043. function o(e) {
  9044. X.emit(C.LAUNCH, {
  9045. vr_platform: r,
  9046. vr_app: e
  9047. }),
  9048. m.launch(e)
  9049. }
  9050. m.init(r, e, t),
  9051. r !== y.Desktop && w.addClass("mobile"),
  9052. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  9053. q.gear = o.bind(this, v.GearVR),
  9054. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  9055. f(),
  9056. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9057. $(_).show();
  9058. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  9059. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9060. r === y.IOS && (a.splice(1, 1),
  9061. s.splice(1, 1)),
  9062. $("#vr").on("click", function(e) {
  9063. e.preventDefault(),
  9064. window.vrEnabled || (window.vrEnabled = !0,
  9065. this.classList.add("active"),
  9066. $("#gui div").not("#vrOff").addClass("vrHide"),
  9067. $("#vrOffImg").css({
  9068. display: "inline-block"
  9069. }))
  9070. }),
  9071. $("#vrOff").on("click", function() {
  9072. window.vrEnabled = !1,
  9073. $("#gui div").not("#vrOff").removeClass("vrHide"),
  9074. $("#vrOffImg").css({
  9075. display: "none"
  9076. }),
  9077. $("#player canvas").css({
  9078. width: "",
  9079. height: ""
  9080. }),
  9081. $("#vr").removeClass("active")
  9082. });
  9083. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  9084. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  9085. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  9086. $("span.modelLink").text(l),
  9087. R.on("click", function(e) {
  9088. X.emit(C.PREV),
  9089. n(--E)
  9090. }),
  9091. P.on("click", function(e) {
  9092. P.text(),
  9093. X.emit(C.NEXT, {
  9094. nextAction: s[E]
  9095. }),
  9096. n(++E)
  9097. }),
  9098. w.find(".close").on("click", X.dismiss)
  9099. },
  9100. dismiss: function() {
  9101. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  9102. X.emit(C.CLOSED))
  9103. },
  9104. isDeviceSupported: c
  9105. };
  9106. a.extendObject(X, s.prototype),
  9107. $(window).resize(f);
  9108. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  9109. K = M.filter(".first").find(".gearvr"),
  9110. {
  9111. cardboard: function() {
  9112. K.addClass("hidden"),
  9113. Z.removeClass("hidden")
  9114. },
  9115. gearvr: function() {
  9116. Z.addClass("hidden"),
  9117. K.removeClass("hidden")
  9118. }
  9119. });
  9120. t.exports = X
  9121. }
  9122. , {
  9123. "../../constants": 8,
  9124. "../../enum/VRApps": 46,
  9125. "../../enum/VRPages": 48,
  9126. "../../enum/VRPlatforms": 49,
  9127. "../../localization/localize": 108,
  9128. "../../settings": 166,
  9129. "../../util/browser": 182,
  9130. "../../util/common": 185,
  9131. "./vrEvent": 85,
  9132. "./vrLink": 86,
  9133. events: 202
  9134. }],
  9135. 88: [function(e, t, i) {
  9136. "use strict";
  9137. t.exports = Object.freeze({
  9138. OPENED: "webvr.modal.opened",
  9139. SHOW_TERMS: "webvr.footer.show.terms"
  9140. })
  9141. }
  9142. , {}],
  9143. 89: [function(B, V, e) {
  9144. (function(e) {
  9145. "use strict";
  9146. function a() {
  9147. function t() {
  9148. p.isPresenting || (r.info("exiting webVR"),
  9149. c("webvr_exit_app"),
  9150. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  9151. window.removeEventListener("vrdisplaypresentchange", t))
  9152. }
  9153. r.info("Headset mounted"),
  9154. u.suspend();
  9155. var e = document.createElement("canvas");
  9156. for (e.getContext("webgl"),
  9157. e.className = "webvr-canvas",
  9158. document.bgColor = "#000",
  9159. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9160. document.body.removeChild(document.body.firstChild);
  9161. document.body.appendChild(e),
  9162. c("webvr_enter_app"),
  9163. p.requestPresent([{
  9164. source: e,
  9165. predistorted: !0
  9166. }]).catch(function(e) {
  9167. r.error("Failed to present: " + e),
  9168. c("webvr_exit_calibrate"),
  9169. t()
  9170. }),
  9171. d.then(function() {
  9172. window.dispatchEvent(new Event("vrapp-start"))
  9173. }),
  9174. window.addEventListener("vrdisplaypresentchange", t)
  9175. }
  9176. function s() {
  9177. c("webvr_modal_close"),
  9178. _.find(".enter-button").off("click", a),
  9179. E.fadeOut(g.guiAnimationSpeed, function() {
  9180. _.toggleClass("hidden", !1),
  9181. b.toggleClass("hidden", !0),
  9182. f.exitFullscreen()
  9183. }),
  9184. I.fadeIn(g.guiAnimationSpeed)
  9185. }
  9186. function t() {
  9187. M.toggleClass("hidden", !0),
  9188. S.toggleClass("hidden", !1)
  9189. }
  9190. function l() {
  9191. _.toggleClass("hidden"),
  9192. b.toggleClass("hidden")
  9193. }
  9194. function c(e) {
  9195. var t = f.isLandscape() ? "landscape" : "portrait";
  9196. i.trackAlways("showcase_gui", {
  9197. gui_action: e,
  9198. orientation: t
  9199. })
  9200. }
  9201. function h() {
  9202. var e = f.isLandscape();
  9203. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9204. }
  9205. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9206. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9207. 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 = {
  9208. init: function(e, t, i, n) {
  9209. function r(e) {
  9210. e.preventDefault(),
  9211. o(e.currentTarget.id)
  9212. }
  9213. function o(i) {
  9214. F[i](),
  9215. Object.keys(F).map(function(e, t) {
  9216. $("#" + e).toggleClass("tabs-underlined", e === i)
  9217. })
  9218. }
  9219. p = i,
  9220. u = t,
  9221. y.init(m.Android, e, n),
  9222. h(),
  9223. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9224. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9225. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9226. w.filter(".device-headset-side").attr("src", R),
  9227. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9228. $("#vr").on("click", function(e) {
  9229. e.preventDefault(),
  9230. c("click_webvr_button"),
  9231. E.is(":hidden") && (N.emit(A.OPENED),
  9232. I.fadeOut(g.guiAnimationSpeed),
  9233. E.fadeIn(g.guiAnimationSpeed),
  9234. function() {
  9235. if (!d) {
  9236. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9237. d = new Promise(function(e, t) {
  9238. var i = document.createElement("script");
  9239. i.type = "text/javascript",
  9240. i.src = n,
  9241. i.onload = e,
  9242. document.head.appendChild(i)
  9243. }
  9244. )
  9245. }
  9246. _.find(".enter-button").on("click", a)
  9247. }())
  9248. }),
  9249. $(".webvr-popup .close").on("click", function(e) {
  9250. e.preventDefault(),
  9251. _.hasClass("hidden") ? (c("webvr_help_close"),
  9252. l()) : s()
  9253. }),
  9254. $("#tabcardboard").on("click", r),
  9255. $("#tabdaydream").on("click", r),
  9256. $("#tabnative").on("click", r),
  9257. $(".webvr-popup .open-with-app").on("click", function(e) {
  9258. e.preventDefault(),
  9259. c("webvr_learn_more"),
  9260. o("tabnative"),
  9261. l()
  9262. }),
  9263. $(".webvr-popup .help").on("click", function(e) {
  9264. e.preventDefault(),
  9265. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9266. l()
  9267. }),
  9268. $(".webvr-popup .terms").on("click", function(e) {
  9269. e.preventDefault(),
  9270. c("webvr_click_terms"),
  9271. s(),
  9272. N.emit(A.SHOW_TERMS)
  9273. }),
  9274. T.on("click", function(e) {
  9275. e.preventDefault(),
  9276. c(D),
  9277. window.open(L, "_blank")
  9278. }),
  9279. x.on("click", function(e) {
  9280. e.preventDefault(),
  9281. c("webvr_phone_link"),
  9282. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9283. }),
  9284. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9285. e.preventDefault(),
  9286. c("webvr_cardboard_link"),
  9287. y.launch(v.CardboardAndroid)
  9288. }),
  9289. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9290. e.preventDefault(),
  9291. c("webvr_oculus_link"),
  9292. y.launch(v.GearVR)
  9293. })
  9294. }
  9295. }, F = {
  9296. tabcardboard: function() {
  9297. w.filter(".device-headset").attr("src", R),
  9298. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9299. L = "https://vr.google.com/cardboard/get-cardboard/",
  9300. D = "webvr_cardboard_link",
  9301. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9302. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9303. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9304. t()
  9305. },
  9306. tabdaydream: function() {
  9307. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9308. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9309. L = P,
  9310. D = O,
  9311. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9312. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9313. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9314. t()
  9315. },
  9316. tabnative: function() {
  9317. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9318. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9319. M.toggleClass("hidden", !1),
  9320. S.toggleClass("hidden", !0)
  9321. }
  9322. };
  9323. n.extendObject(N, o.prototype),
  9324. $(window).resize(h),
  9325. V.exports = N
  9326. }
  9327. ).call(this, "/js/gui/webvr/webVRgui.js")
  9328. }
  9329. , {
  9330. "../../analytics": 4,
  9331. "../../constants": 8,
  9332. "../../enum/VRApps": 46,
  9333. "../../enum/VRPlatforms": 49,
  9334. "../../localization/localize": 108,
  9335. "../../settings": 166,
  9336. "../../util/browser": 182,
  9337. "../../util/common": 185,
  9338. "../../util/logger": 189,
  9339. "./../gui": 65,
  9340. "./../vr/vrLink": 86,
  9341. "./WebVrEvent": 88,
  9342. events: 202
  9343. }],
  9344. 90: [function(e, t, i) {
  9345. "use strict";
  9346. function n(e, t, i, n, r) {
  9347. this.floorId = n || 0 === n ? n : -1,
  9348. this.roomId = r || "",
  9349. this.labelId = e,
  9350. this.position = (new o.Vector3).copy(t),
  9351. this.text = i
  9352. }
  9353. var o = e("three")
  9354. , r = e("../util/browser");
  9355. n.prototype.build = function() {
  9356. var e = window.document.createElement("div");
  9357. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9358. var t = window.document.createElement("div");
  9359. t.setAttribute("class", "gui-floorplan-label-text");
  9360. var i = window.document.createTextNode(this.text);
  9361. t.appendChild(i),
  9362. e.appendChild(t),
  9363. window.document.body.appendChild(e),
  9364. this.labelGui = e,
  9365. this.textBlock = t,
  9366. $(this.labelGui).hide();
  9367. var n = window.getComputedStyle(this.labelGui);
  9368. this.initialTransform = n.transform || n.webkitTransform
  9369. }
  9370. ,
  9371. t.exports = n
  9372. }
  9373. , {
  9374. "../util/browser": 182,
  9375. three: 217
  9376. }],
  9377. 91: [function(e, t, i) {
  9378. "use strict";
  9379. function n() {
  9380. this.player = null,
  9381. this.modelManager = null,
  9382. this.container = null
  9383. }
  9384. var c, o, r = e("three"), a = (e("../util/common"),
  9385. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9386. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9387. e("../util/transitions"),
  9388. e("../util/lerp"),
  9389. e("../util/browser"));
  9390. n.prototype.init = function(e, t, i) {
  9391. this.player = e,
  9392. this.modelManager = t,
  9393. this.container = i,
  9394. this.updateModel(),
  9395. this.bindEvents()
  9396. }
  9397. ,
  9398. n.prototype.bindEvents = function() {
  9399. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9400. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9401. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9402. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9403. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9404. }
  9405. ,
  9406. n.prototype.updateModel = function() {
  9407. this.model = this.modelManager.getActiveModel()
  9408. }
  9409. ,
  9410. n.prototype.handlePlayerViewChanged = function() {
  9411. this.updateLabelVisibility(),
  9412. this.updateLabelDisplay()
  9413. }
  9414. ,
  9415. n.prototype.getLabelsForFloor = function(t, i) {
  9416. return (i = i || []).length = 0,
  9417. this.model.labels.forEach(function(e) {
  9418. this.labelVisibleForFloor(e, t) && i.push(e)
  9419. }
  9420. .bind(this)),
  9421. i
  9422. }
  9423. ,
  9424. n.prototype.getLabelsForCurrentFloor = function(e) {
  9425. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9426. }
  9427. ,
  9428. n.prototype.labelVisibleForFloor = function(e, t) {
  9429. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9430. if (!this.model.showingLabels || !e.labelGui || !i)
  9431. return !1;
  9432. var n = e.floorId === this.model.floors.size() - 1;
  9433. return this.model.allFloorsVisible ? n : e.floorId === t
  9434. }
  9435. ,
  9436. n.prototype.updateLabelVisibility = function(e) {
  9437. this.model.labels.forEach(function(e) {
  9438. 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)
  9439. }
  9440. .bind(this))
  9441. }
  9442. ,
  9443. n.prototype.showAllLabels = function(t, i) {
  9444. this.model.labels.forEach(function(e) {
  9445. this.showLabel(e, t, i)
  9446. }
  9447. .bind(this))
  9448. }
  9449. ,
  9450. n.prototype.hideAllLabels = function(t, i) {
  9451. this.model.labels.forEach(function(e) {
  9452. this.hideLabel(e, t, i)
  9453. }
  9454. .bind(this))
  9455. }
  9456. ,
  9457. n.prototype.showLabel = function(e, t, i) {
  9458. this.model.showingLabels && (e.visible || (e.visible = !0,
  9459. e.labelGui.style.display = "block",
  9460. e.labelGui.style.opacity = 0,
  9461. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9462. }
  9463. ,
  9464. n.prototype.hideLabel = function(e, t, i) {
  9465. e.visible && (e.visible = !1,
  9466. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9467. }
  9468. ,
  9469. n.prototype.supportedMode = function() {
  9470. return this.player.mode === h.FLOORPLAN
  9471. }
  9472. ,
  9473. n.prototype.updateLabelDisplay = (new r.Vector3,
  9474. new r.Vector3,
  9475. o = [],
  9476. function() {
  9477. var e = this.player.getLabelScaleFactor()
  9478. , t = 1.2 * (1 - e) + .6
  9479. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9480. this.getLabelsForCurrentFloor(o);
  9481. for (var n = 0; n < o.length; n++) {
  9482. var r = o[n];
  9483. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9484. 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)
  9485. }
  9486. }
  9487. ),
  9488. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9489. new r.Vector3,
  9490. function(e, t, i, n, r) {
  9491. t.style.fontSize = 100 * r + "%";
  9492. var o = .5 * $("#player").width()
  9493. , a = .5 * $("#player").height();
  9494. c.copy(i),
  9495. c.project(this.player.camera);
  9496. var s = c.x * o + o
  9497. , l = -c.y * a + a;
  9498. s -= e.offsetWidth / 2,
  9499. l -= e.offsetHeight / 2,
  9500. e.style.left = s + "px",
  9501. e.style.top = l + "px"
  9502. }
  9503. ),
  9504. n.prototype.handleStartInside = function(e) {
  9505. this.updateLabelVisibility()
  9506. }
  9507. ,
  9508. n.prototype.handleStartOutside = function() {
  9509. this.updateLabelVisibility()
  9510. }
  9511. ,
  9512. t.exports = n
  9513. }
  9514. , {
  9515. "../enum/DirectorEvents": 23,
  9516. "../enum/ModelManagerEvents": 33,
  9517. "../enum/PlayerEvents": 40,
  9518. "../enum/Viewmode": 51,
  9519. "../enum/WarpStyle": 52,
  9520. "../settings": 166,
  9521. "../util/browser": 182,
  9522. "../util/common": 185,
  9523. "../util/lerp": 188,
  9524. "../util/transitions": 195,
  9525. three: 217
  9526. }],
  9527. 92: [function(e, t, i) {
  9528. "use strict";
  9529. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9530. if (null == this)
  9531. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9532. if ("function" != typeof e)
  9533. throw new TypeError("predicate must be a function");
  9534. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9535. if (t = i[o],
  9536. e.call(r, t, o, i))
  9537. return o;
  9538. return -1
  9539. }
  9540. ),
  9541. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9542. value: function(e) {
  9543. if (null == this)
  9544. throw new TypeError('"this" is null or not defined');
  9545. var t = Object(this)
  9546. , i = t.length >>> 0;
  9547. if ("function" != typeof e)
  9548. throw new TypeError("predicate must be a function");
  9549. for (var n = arguments[1], r = 0; r < i; ) {
  9550. var o = t[r];
  9551. if (e.call(n, o, r, t))
  9552. return o;
  9553. r++
  9554. }
  9555. }
  9556. })
  9557. }
  9558. , {}],
  9559. 93: [function(e, t, i) {
  9560. "use strict";
  9561. 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 || {};
  9562. function te() {
  9563. this.backgroundElement = document.createElement("div"),
  9564. r.extend(this.backgroundElement.style, {
  9565. backgroundColor: "rgba(0,0,0,0.8)",
  9566. top: 0,
  9567. left: 0,
  9568. display: "none",
  9569. zIndex: "1000",
  9570. opacity: 0,
  9571. WebkitTransition: "opacity 0.2s linear"
  9572. }),
  9573. n.makeFullscreen(this.backgroundElement),
  9574. this.backgroundElement.style.position = "fixed",
  9575. this.domElement = document.createElement("div"),
  9576. r.extend(this.domElement.style, {
  9577. position: "fixed",
  9578. display: "none",
  9579. zIndex: "1001",
  9580. opacity: 0,
  9581. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9582. }),
  9583. document.body.appendChild(this.backgroundElement),
  9584. document.body.appendChild(this.domElement);
  9585. var e = this;
  9586. n.bind(this.backgroundElement, "click", function() {
  9587. e.hide()
  9588. })
  9589. }
  9590. function ie(e, t, i) {
  9591. Object.defineProperty(e, t, {
  9592. get: function() {
  9593. return "RGB" === this.__state.space || re(this, t, i),
  9594. this.__state[t]
  9595. },
  9596. set: function(e) {
  9597. "RGB" !== this.__state.space && (re(this, t, i),
  9598. this.__state.space = "RGB"),
  9599. this.__state[t] = e
  9600. }
  9601. })
  9602. }
  9603. function ne(e, t) {
  9604. Object.defineProperty(e, t, {
  9605. get: function() {
  9606. return "HSV" === this.__state.space || oe(this),
  9607. this.__state[t]
  9608. },
  9609. set: function(e) {
  9610. "HSV" !== this.__state.space && (oe(this),
  9611. this.__state.space = "HSV"),
  9612. this.__state[t] = e
  9613. }
  9614. })
  9615. }
  9616. function re(e, t, i) {
  9617. if ("HEX" === e.__state.space)
  9618. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9619. else {
  9620. if ("HSV" !== e.__state.space)
  9621. throw "Corrupted color state";
  9622. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9623. }
  9624. }
  9625. function oe(e) {
  9626. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9627. l.extend(e.__state, {
  9628. s: t.s,
  9629. v: t.v
  9630. }),
  9631. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9632. }
  9633. function ae() {
  9634. if (this.__state = o.apply(this, arguments),
  9635. !1 === this.__state)
  9636. throw "Failed to interpret color arguments";
  9637. this.__state.a = this.__state.a || 1
  9638. }
  9639. function se(e) {
  9640. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9641. }
  9642. function le(e, t) {
  9643. this.initialValue = e[t],
  9644. this.domElement = document.createElement("div"),
  9645. this.object = e,
  9646. this.property = t,
  9647. this.__onChange = void 0,
  9648. this.__onFinishChange = void 0
  9649. }
  9650. (t.exports = ee).gui = ee.gui || {},
  9651. ee.utils = ee.utils || {},
  9652. ee.controllers = ee.controllers || {},
  9653. ee.dom = ee.dom || {},
  9654. ee.color = ee.color || {},
  9655. ee.utils.css = {
  9656. load: function(e, t) {
  9657. var i = (t = t || document).createElement("link");
  9658. i.type = "text/css",
  9659. i.rel = "stylesheet",
  9660. i.href = e,
  9661. t.getElementsByTagName("head")[0].appendChild(i)
  9662. },
  9663. inject: function(e, t) {
  9664. t = t || document;
  9665. var i = document.createElement("style");
  9666. i.type = "text/css",
  9667. i.innerHTML = e,
  9668. t.getElementsByTagName("head")[0].appendChild(i)
  9669. }
  9670. },
  9671. ee.utils.common = (Q = Array.prototype.forEach,
  9672. J = Array.prototype.slice,
  9673. {
  9674. BREAK: {},
  9675. extend: function(i) {
  9676. return this.each(J.call(arguments, 1), function(e) {
  9677. for (var t in e)
  9678. this.isUndefined(e[t]) || (i[t] = e[t])
  9679. }, this),
  9680. i
  9681. },
  9682. defaults: function(i) {
  9683. return this.each(J.call(arguments, 1), function(e) {
  9684. for (var t in e)
  9685. this.isUndefined(i[t]) && (i[t] = e[t])
  9686. }, this),
  9687. i
  9688. },
  9689. compose: function() {
  9690. var i = J.call(arguments);
  9691. return function() {
  9692. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9693. e = [i[t].apply(this, e)];
  9694. return e[0]
  9695. }
  9696. },
  9697. each: function(e, t, i) {
  9698. if (e)
  9699. if (Q && e.forEach && e.forEach === Q)
  9700. e.forEach(t, i);
  9701. else if (e.length === e.length + 0) {
  9702. for (var n = 0, r = e.length; n < r; n++)
  9703. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9704. return
  9705. } else
  9706. for (var n in e)
  9707. if (t.call(i, e[n], n) === this.BREAK)
  9708. return
  9709. },
  9710. defer: function(e) {
  9711. setTimeout(e, 0)
  9712. },
  9713. toArray: function(e) {
  9714. return e.toArray ? e.toArray() : J.call(e)
  9715. },
  9716. isUndefined: function(e) {
  9717. return void 0 === e
  9718. },
  9719. isNull: function(e) {
  9720. return null === e
  9721. },
  9722. isNaN: function(e) {
  9723. return e != e
  9724. },
  9725. isArray: Array.isArray || function(e) {
  9726. return e.constructor === Array
  9727. }
  9728. ,
  9729. isObject: function(e) {
  9730. return e === Object(e)
  9731. },
  9732. isNumber: function(e) {
  9733. return e === e + 0
  9734. },
  9735. isString: function(e) {
  9736. return e === e + ""
  9737. },
  9738. isBoolean: function(e) {
  9739. return !1 === e || !0 === e
  9740. },
  9741. isFunction: function(e) {
  9742. return "[object Function]" === Object.prototype.toString.call(e)
  9743. }
  9744. }),
  9745. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9746. onChange: function(e) {
  9747. return this.__onChange = e,
  9748. this
  9749. },
  9750. onFinishChange: function(e) {
  9751. return this.__onFinishChange = e,
  9752. this
  9753. },
  9754. setValue: function(e) {
  9755. return this.object[this.property] = e,
  9756. this.__onChange && this.__onChange.call(this, e),
  9757. this.updateDisplay(),
  9758. this
  9759. },
  9760. getValue: function() {
  9761. return this.object[this.property]
  9762. },
  9763. updateDisplay: function() {
  9764. return this
  9765. },
  9766. isModified: function() {
  9767. return this.initialValue !== this.getValue()
  9768. }
  9769. }),
  9770. le),
  9771. ee.dom.dom = function(c) {
  9772. function i(e) {
  9773. if ("0" === e || c.isUndefined(e))
  9774. return 0;
  9775. var t = e.match(n);
  9776. return c.isNull(t) ? 0 : parseFloat(t[1])
  9777. }
  9778. var h = {};
  9779. c.each({
  9780. HTMLEvents: ["change"],
  9781. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9782. KeyboardEvents: ["keydown"]
  9783. }, function(e, t) {
  9784. c.each(e, function(e) {
  9785. h[e] = t
  9786. })
  9787. });
  9788. var n = /(\d+(\.\d+)?)px/
  9789. , r = {
  9790. makeSelectable: function(e, t) {
  9791. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9792. return !1
  9793. }
  9794. : function() {}
  9795. ,
  9796. e.style.MozUserSelect = t ? "auto" : "none",
  9797. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9798. e.unselectable = t ? "on" : "off")
  9799. },
  9800. makeFullscreen: function(e, t, i) {
  9801. c.isUndefined(t) && (t = !0),
  9802. c.isUndefined(i) && (i = !0),
  9803. e.style.position = "absolute",
  9804. t && (e.style.left = 0,
  9805. e.style.right = 0),
  9806. i && (e.style.top = 0,
  9807. e.style.bottom = 0)
  9808. },
  9809. fakeEvent: function(e, t, i, n) {
  9810. i = i || {};
  9811. var r = h[t];
  9812. if (!r)
  9813. throw new Error("Event type " + t + " not supported.");
  9814. var o = document.createEvent(r);
  9815. switch (r) {
  9816. case "MouseEvents":
  9817. var a = i.x || i.clientX || 0
  9818. , s = i.y || i.clientY || 0;
  9819. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9820. break;
  9821. case "KeyboardEvents":
  9822. var l = o.initKeyboardEvent || o.initKeyEvent;
  9823. c.defaults(i, {
  9824. cancelable: !0,
  9825. ctrlKey: !1,
  9826. altKey: !1,
  9827. shiftKey: !1,
  9828. metaKey: !1,
  9829. keyCode: void 0,
  9830. charCode: void 0
  9831. }),
  9832. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9833. break;
  9834. default:
  9835. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9836. }
  9837. c.defaults(o, n),
  9838. e.dispatchEvent(o)
  9839. },
  9840. bind: function(e, t, i, n) {
  9841. return n = n || !1,
  9842. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9843. r
  9844. },
  9845. unbind: function(e, t, i, n) {
  9846. return n = n || !1,
  9847. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9848. r
  9849. },
  9850. addClass: function(e, t) {
  9851. if (void 0 === e.className)
  9852. e.className = t;
  9853. else if (e.className !== t) {
  9854. var i = e.className.split(/ +/);
  9855. -1 == i.indexOf(t) && (i.push(t),
  9856. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9857. }
  9858. return r
  9859. },
  9860. removeClass: function(e, t) {
  9861. if (t)
  9862. if (void 0 === e.className)
  9863. ;
  9864. else if (e.className === t)
  9865. e.removeAttribute("class");
  9866. else {
  9867. var i = e.className.split(/ +/)
  9868. , n = i.indexOf(t);
  9869. -1 != n && (i.splice(n, 1),
  9870. e.className = i.join(" "))
  9871. }
  9872. else
  9873. e.className = void 0;
  9874. return r
  9875. },
  9876. hasClass: function(e, t) {
  9877. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9878. },
  9879. getWidth: function(e) {
  9880. var t = getComputedStyle(e);
  9881. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9882. },
  9883. getHeight: function(e) {
  9884. var t = getComputedStyle(e);
  9885. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9886. },
  9887. getOffset: function(e) {
  9888. var t = {
  9889. left: 0,
  9890. top: 0
  9891. };
  9892. if (e.offsetParent)
  9893. for (; t.left += e.offsetLeft,
  9894. t.top += e.offsetTop,
  9895. e = e.offsetParent; )
  9896. ;
  9897. return t
  9898. },
  9899. isActive: function(e) {
  9900. return e === document.activeElement && (e.type || e.href)
  9901. }
  9902. };
  9903. return r
  9904. }(ee.utils.common),
  9905. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9906. X = ee.dom.dom,
  9907. Z = ee.utils.common,
  9908. (K = function(e, t, i) {
  9909. K.superclass.call(this, e, t);
  9910. var n = this;
  9911. if (this.__select = document.createElement("select"),
  9912. Z.isArray(i)) {
  9913. var r = {};
  9914. Z.each(i, function(e) {
  9915. r[e] = e
  9916. }),
  9917. i = r
  9918. }
  9919. Z.each(i, function(e, t) {
  9920. var i = document.createElement("option");
  9921. i.innerHTML = t,
  9922. i.setAttribute("value", e),
  9923. n.__select.appendChild(i)
  9924. }),
  9925. this.updateDisplay(),
  9926. X.bind(this.__select, "change", function() {
  9927. var e = this.options[this.selectedIndex].value;
  9928. n.setValue(e)
  9929. }),
  9930. this.domElement.appendChild(this.__select)
  9931. }
  9932. ).superclass = q,
  9933. Z.extend(K.prototype, q.prototype, {
  9934. setValue: function(e) {
  9935. var t = K.superclass.prototype.setValue.call(this, e);
  9936. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9937. t
  9938. },
  9939. updateDisplay: function() {
  9940. return this.__select.value = this.getValue(),
  9941. K.superclass.prototype.updateDisplay.call(this)
  9942. }
  9943. }),
  9944. K),
  9945. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9946. j = ee.utils.common,
  9947. (Y = function(e, t, i) {
  9948. Y.superclass.call(this, e, t),
  9949. i = i || {},
  9950. this.__min = i.min,
  9951. this.__max = i.max,
  9952. this.__step = i.step,
  9953. 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,
  9954. this.__precision = se(this.__impliedStep)
  9955. }
  9956. ).superclass = W,
  9957. j.extend(Y.prototype, W.prototype, {
  9958. setValue: function(e) {
  9959. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9960. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9961. Y.superclass.prototype.setValue.call(this, e)
  9962. },
  9963. min: function(e) {
  9964. return this.__min = e,
  9965. this
  9966. },
  9967. max: function(e) {
  9968. return this.__max = e,
  9969. this
  9970. },
  9971. step: function(e) {
  9972. return this.__step = e,
  9973. this.__impliedStep = e,
  9974. this.__precision = se(e),
  9975. this
  9976. }
  9977. }),
  9978. Y),
  9979. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9980. H = ee.dom.dom,
  9981. z = ee.utils.common,
  9982. (G = function(e, t, i) {
  9983. function n() {
  9984. var e = parseFloat(s.__input.value);
  9985. z.isNaN(e) || s.setValue(e)
  9986. }
  9987. function r(e) {
  9988. var t = a - e.clientY;
  9989. s.setValue(s.getValue() + t * s.__impliedStep),
  9990. a = e.clientY
  9991. }
  9992. function o() {
  9993. H.unbind(window, "mousemove", r),
  9994. H.unbind(window, "mouseup", o)
  9995. }
  9996. this.__truncationSuspended = !1,
  9997. G.superclass.call(this, e, t, i);
  9998. var a, s = this;
  9999. this.__input = document.createElement("input"),
  10000. this.__input.setAttribute("type", "text"),
  10001. H.bind(this.__input, "change", n),
  10002. H.bind(this.__input, "blur", function() {
  10003. n(),
  10004. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10005. }),
  10006. H.bind(this.__input, "mousedown", function(e) {
  10007. H.bind(window, "mousemove", r),
  10008. H.bind(window, "mouseup", o),
  10009. a = e.clientY
  10010. }),
  10011. H.bind(this.__input, "keydown", function(e) {
  10012. 13 === e.keyCode && (s.__truncationSuspended = !0,
  10013. this.blur(),
  10014. s.__truncationSuspended = !1)
  10015. }),
  10016. this.updateDisplay(),
  10017. this.domElement.appendChild(this.__input)
  10018. }
  10019. ).superclass = U,
  10020. z.extend(G.prototype, U.prototype, {
  10021. updateDisplay: function() {
  10022. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  10023. var i = Math.pow(10, t);
  10024. return Math.round(e * i) / i
  10025. }(this.getValue(), this.__precision),
  10026. G.superclass.prototype.updateDisplay.call(this)
  10027. }
  10028. }),
  10029. G),
  10030. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  10031. F = ee.dom.dom,
  10032. B = ee.utils.css,
  10033. V = ee.utils.common,
  10034. (k = function(e, t, i, n, r) {
  10035. function o(e) {
  10036. e.preventDefault();
  10037. var t = F.getOffset(s.__background)
  10038. , i = F.getWidth(s.__background);
  10039. return s.setValue(function(e, t, i, n, r) {
  10040. return n + (e - t) / (i - t) * (r - n)
  10041. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  10042. !1
  10043. }
  10044. function a() {
  10045. F.unbind(window, "mousemove", o),
  10046. F.unbind(window, "mouseup", a),
  10047. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10048. }
  10049. k.superclass.call(this, e, t, {
  10050. min: i,
  10051. max: n,
  10052. step: r
  10053. });
  10054. var s = this;
  10055. this.__background = document.createElement("div"),
  10056. this.__foreground = document.createElement("div"),
  10057. F.bind(this.__background, "mousedown", function(e) {
  10058. F.bind(window, "mousemove", o),
  10059. F.bind(window, "mouseup", a),
  10060. o(e)
  10061. }),
  10062. F.addClass(this.__background, "slider"),
  10063. F.addClass(this.__foreground, "slider-fg"),
  10064. this.updateDisplay(),
  10065. this.__background.appendChild(this.__foreground),
  10066. this.domElement.appendChild(this.__background)
  10067. }
  10068. ).superclass = N,
  10069. k.useDefaultStyles = function() {
  10070. 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}")
  10071. }
  10072. ,
  10073. V.extend(k.prototype, N.prototype, {
  10074. updateDisplay: function() {
  10075. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10076. return this.__foreground.style.width = 100 * e + "%",
  10077. k.superclass.prototype.updateDisplay.call(this)
  10078. }
  10079. }),
  10080. k),
  10081. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  10082. O = ee.dom.dom,
  10083. L = ee.utils.common,
  10084. (D = function(e, t, i) {
  10085. D.superclass.call(this, e, t);
  10086. var n = this;
  10087. this.__button = document.createElement("div"),
  10088. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  10089. O.bind(this.__button, "click", function(e) {
  10090. return e.preventDefault(),
  10091. n.fire(),
  10092. !1
  10093. }),
  10094. O.addClass(this.__button, "button"),
  10095. this.domElement.appendChild(this.__button)
  10096. }
  10097. ).superclass = P,
  10098. L.extend(D.prototype, P.prototype, {
  10099. fire: function() {
  10100. this.__onChange && this.__onChange.call(this),
  10101. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10102. this.getValue().call(this.object)
  10103. }
  10104. }),
  10105. D),
  10106. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  10107. S = ee.dom.dom,
  10108. M = ee.utils.common,
  10109. (R = function(e, t) {
  10110. R.superclass.call(this, e, t);
  10111. var i = this;
  10112. this.__prev = this.getValue(),
  10113. this.__checkbox = document.createElement("input"),
  10114. this.__checkbox.setAttribute("type", "checkbox"),
  10115. S.bind(this.__checkbox, "change", function() {
  10116. i.setValue(!i.__prev)
  10117. }, !1),
  10118. this.domElement.appendChild(this.__checkbox),
  10119. this.updateDisplay()
  10120. }
  10121. ).superclass = x,
  10122. M.extend(R.prototype, x.prototype, {
  10123. setValue: function(e) {
  10124. var t = R.superclass.prototype.setValue.call(this, e);
  10125. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10126. this.__prev = this.getValue(),
  10127. t
  10128. },
  10129. updateDisplay: function() {
  10130. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  10131. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10132. R.superclass.prototype.updateDisplay.call(this)
  10133. }
  10134. }),
  10135. R),
  10136. ee.color.toString = (T = ee.utils.common,
  10137. function(e) {
  10138. if (1 == e.a || T.isUndefined(e.a)) {
  10139. for (var t = e.hex.toString(16); t.length < 6; )
  10140. t = "0" + t;
  10141. return "#" + t
  10142. }
  10143. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  10144. }
  10145. ),
  10146. ee.color.interpret = (I = ee.color.toString,
  10147. E = ee.utils.common,
  10148. w = [{
  10149. litmus: E.isString,
  10150. conversions: {
  10151. THREE_CHAR_HEX: {
  10152. read: function(e) {
  10153. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10154. return null !== t && {
  10155. space: "HEX",
  10156. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10157. }
  10158. },
  10159. write: I
  10160. },
  10161. SIX_CHAR_HEX: {
  10162. read: function(e) {
  10163. var t = e.match(/^#([A-F0-9]{6})$/i);
  10164. return null !== t && {
  10165. space: "HEX",
  10166. hex: parseInt("0x" + t[1].toString())
  10167. }
  10168. },
  10169. write: I
  10170. },
  10171. CSS_RGB: {
  10172. read: function(e) {
  10173. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10174. return null !== t && {
  10175. space: "RGB",
  10176. r: parseFloat(t[1]),
  10177. g: parseFloat(t[2]),
  10178. b: parseFloat(t[3])
  10179. }
  10180. },
  10181. write: I
  10182. },
  10183. CSS_RGBA: {
  10184. read: function(e) {
  10185. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10186. return null !== t && {
  10187. space: "RGB",
  10188. r: parseFloat(t[1]),
  10189. g: parseFloat(t[2]),
  10190. b: parseFloat(t[3]),
  10191. a: parseFloat(t[4])
  10192. }
  10193. },
  10194. write: I
  10195. }
  10196. }
  10197. }, {
  10198. litmus: E.isNumber,
  10199. conversions: {
  10200. HEX: {
  10201. read: function(e) {
  10202. return {
  10203. space: "HEX",
  10204. hex: e,
  10205. conversionName: "HEX"
  10206. }
  10207. },
  10208. write: function(e) {
  10209. return e.hex
  10210. }
  10211. }
  10212. }
  10213. }, {
  10214. litmus: E.isArray,
  10215. conversions: {
  10216. RGB_ARRAY: {
  10217. read: function(e) {
  10218. return 3 == e.length && {
  10219. space: "RGB",
  10220. r: e[0],
  10221. g: e[1],
  10222. b: e[2]
  10223. }
  10224. },
  10225. write: function(e) {
  10226. return [e.r, e.g, e.b]
  10227. }
  10228. },
  10229. RGBA_ARRAY: {
  10230. read: function(e) {
  10231. return 4 == e.length && {
  10232. space: "RGB",
  10233. r: e[0],
  10234. g: e[1],
  10235. b: e[2],
  10236. a: e[3]
  10237. }
  10238. },
  10239. write: function(e) {
  10240. return [e.r, e.g, e.b, e.a]
  10241. }
  10242. }
  10243. }
  10244. }, {
  10245. litmus: E.isObject,
  10246. conversions: {
  10247. RGBA_OBJ: {
  10248. read: function(e) {
  10249. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10250. space: "RGB",
  10251. r: e.r,
  10252. g: e.g,
  10253. b: e.b,
  10254. a: e.a
  10255. }
  10256. },
  10257. write: function(e) {
  10258. return {
  10259. r: e.r,
  10260. g: e.g,
  10261. b: e.b,
  10262. a: e.a
  10263. }
  10264. }
  10265. },
  10266. RGB_OBJ: {
  10267. read: function(e) {
  10268. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10269. space: "RGB",
  10270. r: e.r,
  10271. g: e.g,
  10272. b: e.b
  10273. }
  10274. },
  10275. write: function(e) {
  10276. return {
  10277. r: e.r,
  10278. g: e.g,
  10279. b: e.b
  10280. }
  10281. }
  10282. },
  10283. HSVA_OBJ: {
  10284. read: function(e) {
  10285. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10286. space: "HSV",
  10287. h: e.h,
  10288. s: e.s,
  10289. v: e.v,
  10290. a: e.a
  10291. }
  10292. },
  10293. write: function(e) {
  10294. return {
  10295. h: e.h,
  10296. s: e.s,
  10297. v: e.v,
  10298. a: e.a
  10299. }
  10300. }
  10301. },
  10302. HSV_OBJ: {
  10303. read: function(e) {
  10304. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10305. space: "HSV",
  10306. h: e.h,
  10307. s: e.s,
  10308. v: e.v
  10309. }
  10310. },
  10311. write: function(e) {
  10312. return {
  10313. h: e.h,
  10314. s: e.s,
  10315. v: e.v
  10316. }
  10317. }
  10318. }
  10319. }
  10320. }],
  10321. function() {
  10322. b = !1;
  10323. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10324. return E.each(w, function(e) {
  10325. if (e.litmus(i))
  10326. return E.each(e.conversions, function(e, t) {
  10327. if (_ = e.read(i),
  10328. !1 === b && !1 !== _)
  10329. return (b = _).conversionName = t,
  10330. _.conversion = e,
  10331. E.BREAK
  10332. }),
  10333. E.BREAK
  10334. }),
  10335. b
  10336. }
  10337. ),
  10338. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10339. function y(e, t, i, n) {
  10340. if (void 0 === t[i])
  10341. throw new Error("Object " + t + ' has no property "' + i + '"');
  10342. var r;
  10343. if (n.color)
  10344. r = new g(t,i);
  10345. else {
  10346. var o = [t, i].concat(n.factoryArgs);
  10347. r = c.apply(e, o)
  10348. }
  10349. n.before instanceof h && (n.before = n.before.__li),
  10350. C(e, r),
  10351. m.addClass(r.domElement, "c");
  10352. var a = document.createElement("span");
  10353. m.addClass(a, "property-name"),
  10354. a.innerHTML = r.property;
  10355. var s = document.createElement("div");
  10356. s.appendChild(a),
  10357. s.appendChild(r.domElement);
  10358. var l = A(e, s, n.before);
  10359. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10360. m.addClass(l, typeof r.getValue()),
  10361. function(t, i, n) {
  10362. if (n.__li = i,
  10363. n.__gui = t,
  10364. v.extend(n, {
  10365. options: function(e) {
  10366. return 1 < arguments.length ? (n.remove(),
  10367. y(t, n.object, n.property, {
  10368. before: n.__li.nextElementSibling,
  10369. factoryArgs: [v.toArray(arguments)]
  10370. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10371. y(t, n.object, n.property, {
  10372. before: n.__li.nextElementSibling,
  10373. factoryArgs: [e]
  10374. })) : void 0
  10375. },
  10376. name: function(e) {
  10377. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10378. n
  10379. },
  10380. listen: function() {
  10381. return n.__gui.listen(n),
  10382. n
  10383. },
  10384. remove: function() {
  10385. return n.__gui.remove(n),
  10386. n
  10387. }
  10388. }),
  10389. n instanceof f) {
  10390. var r = new p(n.object,n.property,{
  10391. min: n.__min,
  10392. max: n.__max,
  10393. step: n.__step
  10394. });
  10395. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10396. var t = n[e]
  10397. , i = r[e];
  10398. n[e] = r[e] = function() {
  10399. var e = Array.prototype.slice.call(arguments);
  10400. return t.apply(n, e),
  10401. i.apply(r, e)
  10402. }
  10403. }),
  10404. m.addClass(i, "has-slider"),
  10405. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10406. } else if (n instanceof p) {
  10407. var e = function(e) {
  10408. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10409. y(t, n.object, n.property, {
  10410. before: n.__li.nextElementSibling,
  10411. factoryArgs: [n.__min, n.__max, n.__step]
  10412. })) : e
  10413. };
  10414. n.min = v.compose(e, n.min),
  10415. n.max = v.compose(e, n.max)
  10416. } else
  10417. n instanceof u ? (m.bind(i, "click", function() {
  10418. m.fakeEvent(n.__checkbox, "click")
  10419. }),
  10420. m.bind(n.__checkbox, "click", function(e) {
  10421. e.stopPropagation()
  10422. })) : n instanceof d ? (m.bind(i, "click", function() {
  10423. m.fakeEvent(n.__button, "click")
  10424. }),
  10425. m.bind(i, "mouseover", function() {
  10426. m.addClass(n.__button, "hover")
  10427. }),
  10428. m.bind(i, "mouseout", function() {
  10429. m.removeClass(n.__button, "hover")
  10430. })) : n instanceof g && (m.addClass(i, "color"),
  10431. n.updateDisplay = v.compose(function(e) {
  10432. return i.style.borderLeftColor = n.__color.toString(),
  10433. e
  10434. }, n.updateDisplay),
  10435. n.updateDisplay());
  10436. n.setValue = v.compose(function(e) {
  10437. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10438. e
  10439. }, n.setValue)
  10440. }(e, l, r),
  10441. e.__controllers.push(r),
  10442. r
  10443. }
  10444. function A(e, t, i) {
  10445. var n = document.createElement("li");
  10446. return t && n.appendChild(t),
  10447. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10448. e.onResize(),
  10449. n
  10450. }
  10451. function C(e, t) {
  10452. var i = e.getRoot()
  10453. , n = i.__rememberedObjects.indexOf(t.object);
  10454. if (-1 != n) {
  10455. var r = i.__rememberedObjectIndecesToControllers[n];
  10456. if (void 0 === r && (r = {},
  10457. i.__rememberedObjectIndecesToControllers[n] = r),
  10458. r[t.property] = t,
  10459. i.load && i.load.remembered) {
  10460. var o, a = i.load.remembered;
  10461. if (a[e.preset])
  10462. o = a[e.preset];
  10463. else {
  10464. if (!a[T])
  10465. return;
  10466. o = a[T]
  10467. }
  10468. if (o[n] && void 0 !== o[n][t.property]) {
  10469. var s = o[n][t.property];
  10470. t.initialValue = s,
  10471. t.setValue(s)
  10472. }
  10473. }
  10474. }
  10475. }
  10476. function I(e, t) {
  10477. return document.location.href + "." + t
  10478. }
  10479. function l(e, t) {
  10480. e.domElement.style.width = t + "px",
  10481. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10482. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10483. }
  10484. function a(r, o) {
  10485. var a = {};
  10486. return v.each(r.__rememberedObjects, function(e, t) {
  10487. var i = {}
  10488. , n = r.__rememberedObjectIndecesToControllers[t];
  10489. v.each(n, function(e, t) {
  10490. i[t] = o ? e.initialValue : e.getValue()
  10491. }),
  10492. a[t] = i
  10493. }),
  10494. a
  10495. }
  10496. function E(e, t, i) {
  10497. var n = document.createElement("option");
  10498. n.innerHTML = t,
  10499. n.value = t,
  10500. e.__preset_select.appendChild(n),
  10501. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10502. }
  10503. function _(e, t) {
  10504. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10505. i.innerHTML = t ? i.value + "*" : i.value
  10506. }
  10507. 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");
  10508. var b, w, T = "Default", x = function() {
  10509. try {
  10510. return "localStorage"in window && null !== window.localStorage
  10511. } catch (e) {
  10512. return !1
  10513. }
  10514. }(), S = !0, s = !1, M = [], R = function(t) {
  10515. var i = this;
  10516. this.domElement = document.createElement("div"),
  10517. this.__ul = document.createElement("ul"),
  10518. this.domElement.appendChild(this.__ul),
  10519. m.addClass(this.domElement, "dg"),
  10520. this.__folders = {},
  10521. this.__controllers = [],
  10522. this.__rememberedObjects = [],
  10523. this.__rememberedObjectIndecesToControllers = [],
  10524. this.__listening = [],
  10525. t = t || {},
  10526. t = v.defaults(t, {
  10527. autoPlace: !0,
  10528. width: R.DEFAULT_WIDTH
  10529. }),
  10530. t = v.defaults(t, {
  10531. resizable: t.autoPlace,
  10532. hideable: t.autoPlace
  10533. }),
  10534. v.isUndefined(t.load) ? t.load = {
  10535. preset: T
  10536. } : t.preset && (t.load.preset = t.preset),
  10537. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10538. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10539. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10540. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10541. if (Object.defineProperties(this, {
  10542. parent: {
  10543. get: function() {
  10544. return t.parent
  10545. }
  10546. },
  10547. scrollable: {
  10548. get: function() {
  10549. return t.scrollable
  10550. }
  10551. },
  10552. autoPlace: {
  10553. get: function() {
  10554. return t.autoPlace
  10555. }
  10556. },
  10557. preset: {
  10558. get: function() {
  10559. return i.parent ? i.getRoot().preset : t.load.preset
  10560. },
  10561. set: function(e) {
  10562. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10563. function(e) {
  10564. for (var t = 0; t < e.__preset_select.length; t++)
  10565. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10566. }(this),
  10567. i.revert()
  10568. }
  10569. },
  10570. width: {
  10571. get: function() {
  10572. return t.width
  10573. },
  10574. set: function(e) {
  10575. t.width = e,
  10576. l(i, e)
  10577. }
  10578. },
  10579. name: {
  10580. get: function() {
  10581. return t.name
  10582. },
  10583. set: function(e) {
  10584. t.name = e,
  10585. a && (a.innerHTML = t.name)
  10586. }
  10587. },
  10588. closed: {
  10589. get: function() {
  10590. return t.closed
  10591. },
  10592. set: function(e) {
  10593. t.closed = e,
  10594. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10595. this.onResize(),
  10596. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10597. }
  10598. },
  10599. load: {
  10600. get: function() {
  10601. return t.load
  10602. }
  10603. },
  10604. useLocalStorage: {
  10605. get: function() {
  10606. return r
  10607. },
  10608. set: function(e) {
  10609. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10610. localStorage.setItem(I(0, "isLocal"), e))
  10611. }
  10612. }
  10613. }),
  10614. v.isUndefined(t.parent)) {
  10615. if (t.closed = !1,
  10616. m.addClass(this.domElement, R.CLASS_MAIN),
  10617. m.makeSelectable(this.domElement, !1),
  10618. x && r) {
  10619. i.useLocalStorage = !0;
  10620. var o = localStorage.getItem(I(0, "gui"));
  10621. o && (t.load = JSON.parse(o))
  10622. }
  10623. this.__closeButton = document.createElement("div"),
  10624. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10625. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10626. this.domElement.appendChild(this.__closeButton),
  10627. m.bind(this.__closeButton, "click", function() {
  10628. i.closed = !i.closed
  10629. })
  10630. } else {
  10631. void 0 === t.closed && (t.closed = !0);
  10632. var a = document.createTextNode(t.name);
  10633. m.addClass(a, "controller-name");
  10634. var s = A(i, a);
  10635. m.addClass(this.__ul, R.CLASS_CLOSED),
  10636. m.addClass(s, "title"),
  10637. m.bind(s, "click", function(e) {
  10638. return e.preventDefault(),
  10639. i.closed = !i.closed,
  10640. !1
  10641. }),
  10642. t.closed || (this.closed = !1)
  10643. }
  10644. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10645. m.addClass(w, "dg"),
  10646. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10647. document.body.appendChild(w),
  10648. S = !1),
  10649. w.appendChild(this.domElement),
  10650. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10651. this.parent || l(i, t.width)),
  10652. m.bind(window, "resize", function() {
  10653. i.onResize()
  10654. }),
  10655. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10656. i.onResize()
  10657. }),
  10658. m.bind(this.__ul, "transitionend", function() {
  10659. i.onResize()
  10660. }),
  10661. m.bind(this.__ul, "oTransitionEnd", function() {
  10662. i.onResize()
  10663. }),
  10664. this.onResize(),
  10665. t.resizable && function(t) {
  10666. function e(e) {
  10667. return e.preventDefault(),
  10668. r = e.clientX,
  10669. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10670. m.bind(window, "mousemove", i),
  10671. m.bind(window, "mouseup", n),
  10672. !1
  10673. }
  10674. function i(e) {
  10675. return e.preventDefault(),
  10676. t.width += r - e.clientX,
  10677. t.onResize(),
  10678. r = e.clientX,
  10679. !1
  10680. }
  10681. function n() {
  10682. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10683. m.unbind(window, "mousemove", i),
  10684. m.unbind(window, "mouseup", n)
  10685. }
  10686. var r;
  10687. t.__resize_handle = document.createElement("div"),
  10688. v.extend(t.__resize_handle.style, {
  10689. width: "6px",
  10690. marginLeft: "-3px",
  10691. height: "200px",
  10692. cursor: "ew-resize",
  10693. position: "absolute"
  10694. }),
  10695. m.bind(t.__resize_handle, "mousedown", e),
  10696. m.bind(t.__closeButton, "mousedown", e),
  10697. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10698. }(this),
  10699. n = function() {
  10700. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10701. }
  10702. ,
  10703. this.saveToLocalStorageIfPossible = n,
  10704. i.getRoot(),
  10705. t.parent || ((e = i.getRoot()).width += 1,
  10706. v.defer(function() {
  10707. e.width -= 1
  10708. }))
  10709. };
  10710. return R.toggleHide = function() {
  10711. s = !s,
  10712. v.each(M, function(e) {
  10713. e.domElement.style.zIndex = s ? -999 : 999,
  10714. e.domElement.style.opacity = s ? 0 : 1
  10715. })
  10716. }
  10717. ,
  10718. R.CLASS_AUTO_PLACE = "a",
  10719. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10720. R.CLASS_MAIN = "main",
  10721. R.CLASS_CONTROLLER_ROW = "cr",
  10722. R.CLASS_TOO_TALL = "taller-than-window",
  10723. R.CLASS_CLOSED = "closed",
  10724. R.CLASS_CLOSE_BUTTON = "close-button",
  10725. R.CLASS_DRAG = "drag",
  10726. R.DEFAULT_WIDTH = 245,
  10727. R.TEXT_CLOSED = "Close Controls",
  10728. R.TEXT_OPEN = "Open Controls",
  10729. m.bind(window, "keydown", function(e) {
  10730. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10731. }, !1),
  10732. v.extend(R.prototype, {
  10733. add: function(e, t) {
  10734. return y(this, e, t, {
  10735. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10736. })
  10737. },
  10738. addColor: function(e, t) {
  10739. return y(this, e, t, {
  10740. color: !0
  10741. })
  10742. },
  10743. remove: function(e) {
  10744. this.__ul.removeChild(e.__li),
  10745. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10746. var t = this;
  10747. v.defer(function() {
  10748. t.onResize()
  10749. })
  10750. },
  10751. destroy: function() {
  10752. this.autoPlace && w.removeChild(this.domElement)
  10753. },
  10754. addFolder: function(e) {
  10755. if (void 0 !== this.__folders[e])
  10756. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10757. var t = {
  10758. name: e,
  10759. parent: this
  10760. };
  10761. t.autoPlace = this.autoPlace,
  10762. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10763. t.load = this.load.folders[e]);
  10764. var i = new R(t);
  10765. this.__folders[e] = i;
  10766. var n = A(this, i.domElement);
  10767. return m.addClass(n, "folder"),
  10768. i
  10769. },
  10770. open: function() {
  10771. this.closed = !1
  10772. },
  10773. close: function() {
  10774. this.closed = !0
  10775. },
  10776. onResize: function() {
  10777. var t = this.getRoot();
  10778. if (t.scrollable) {
  10779. var e = m.getOffset(t.__ul).top
  10780. , i = 0;
  10781. v.each(t.__ul.childNodes, function(e) {
  10782. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10783. }),
  10784. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10785. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10786. t.__ul.style.height = "auto")
  10787. }
  10788. t.__resize_handle && v.defer(function() {
  10789. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10790. }),
  10791. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10792. },
  10793. remember: function() {
  10794. 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>'),
  10795. this.parent)
  10796. throw new Error("You can only call remember on a top level GUI.");
  10797. var t = this;
  10798. v.each(Array.prototype.slice.call(arguments), function(e) {
  10799. 0 == t.__rememberedObjects.length && function(i) {
  10800. var e = i.__save_row = document.createElement("li");
  10801. m.addClass(i.domElement, "has-save"),
  10802. i.__ul.insertBefore(e, i.__ul.firstChild),
  10803. m.addClass(e, "save-row");
  10804. var t = document.createElement("span");
  10805. t.innerHTML = "&nbsp;",
  10806. m.addClass(t, "button gears");
  10807. var n = document.createElement("span");
  10808. n.innerHTML = "Save",
  10809. m.addClass(n, "button"),
  10810. m.addClass(n, "save");
  10811. var r = document.createElement("span");
  10812. r.innerHTML = "New",
  10813. m.addClass(r, "button"),
  10814. m.addClass(r, "save-as");
  10815. var o = document.createElement("span");
  10816. o.innerHTML = "Revert",
  10817. m.addClass(o, "button"),
  10818. m.addClass(o, "revert");
  10819. var a = i.__preset_select = document.createElement("select");
  10820. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10821. E(i, t, t == i.preset)
  10822. }) : E(i, T, !1),
  10823. m.bind(a, "change", function() {
  10824. for (var e = 0; e < i.__preset_select.length; e++)
  10825. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10826. i.preset = this.value
  10827. }),
  10828. e.appendChild(a),
  10829. e.appendChild(t),
  10830. e.appendChild(n),
  10831. e.appendChild(r),
  10832. e.appendChild(o),
  10833. x) {
  10834. var s = document.getElementById("dg-save-locally")
  10835. , l = document.getElementById("dg-local-explain");
  10836. s.style.display = "block";
  10837. var c = document.getElementById("dg-local-storage");
  10838. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10839. var h = function() {
  10840. l.style.display = i.useLocalStorage ? "block" : "none"
  10841. };
  10842. h(),
  10843. m.bind(c, "change", function() {
  10844. i.useLocalStorage = !i.useLocalStorage,
  10845. h()
  10846. })
  10847. }
  10848. var u = document.getElementById("dg-new-constructor");
  10849. m.bind(u, "keydown", function(e) {
  10850. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10851. }),
  10852. m.bind(t, "click", function() {
  10853. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10854. b.show(),
  10855. u.focus(),
  10856. u.select()
  10857. }),
  10858. m.bind(n, "click", function() {
  10859. i.save()
  10860. }),
  10861. m.bind(r, "click", function() {
  10862. var e = prompt("Enter a new preset name.");
  10863. e && i.saveAs(e)
  10864. }),
  10865. m.bind(o, "click", function() {
  10866. i.revert()
  10867. })
  10868. }(t),
  10869. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10870. }),
  10871. this.autoPlace && l(this, this.width)
  10872. },
  10873. getRoot: function() {
  10874. for (var e = this; e.parent; )
  10875. e = e.parent;
  10876. return e
  10877. },
  10878. getSaveObject: function() {
  10879. var i = this.load;
  10880. return i.closed = this.closed,
  10881. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10882. i.remembered || (i.remembered = {}),
  10883. i.remembered[this.preset] = a(this)),
  10884. i.folders = {},
  10885. v.each(this.__folders, function(e, t) {
  10886. i.folders[t] = e.getSaveObject()
  10887. }),
  10888. i
  10889. },
  10890. save: function() {
  10891. this.load.remembered || (this.load.remembered = {}),
  10892. this.load.remembered[this.preset] = a(this),
  10893. _(this, !1),
  10894. this.saveToLocalStorageIfPossible()
  10895. },
  10896. saveAs: function(e) {
  10897. this.load.remembered || (this.load.remembered = {},
  10898. this.load.remembered[T] = a(this, !0)),
  10899. this.load.remembered[e] = a(this),
  10900. this.preset = e,
  10901. E(this, e, !0),
  10902. this.saveToLocalStorageIfPossible()
  10903. },
  10904. revert: function(t) {
  10905. v.each(this.__controllers, function(e) {
  10906. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10907. }, this),
  10908. v.each(this.__folders, function(e) {
  10909. e.revert(e)
  10910. }),
  10911. t || _(this.getRoot(), !1)
  10912. },
  10913. listen: function(e) {
  10914. var t = 0 == this.__listening.length;
  10915. this.__listening.push(e),
  10916. t && function e(t) {
  10917. 0 != t.length && r(function() {
  10918. e(t)
  10919. }),
  10920. v.each(t, function(e) {
  10921. e.updateDisplay()
  10922. })
  10923. }(this.__listening)
  10924. }
  10925. }),
  10926. R
  10927. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10928. u = ee.controllers.NumberControllerBox,
  10929. d = ee.controllers.NumberControllerSlider,
  10930. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10931. y = ee.dom.dom,
  10932. A = ee.utils.common,
  10933. (C = function(e, t) {
  10934. function i() {
  10935. n.setValue(n.__input.value)
  10936. }
  10937. C.superclass.call(this, e, t);
  10938. var n = this;
  10939. this.__input = document.createElement("input"),
  10940. this.__input.setAttribute("type", "text"),
  10941. y.bind(this.__input, "keyup", i),
  10942. y.bind(this.__input, "change", i),
  10943. y.bind(this.__input, "blur", function() {
  10944. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10945. }),
  10946. y.bind(this.__input, "keydown", function(e) {
  10947. 13 === e.keyCode && this.blur()
  10948. }),
  10949. this.updateDisplay(),
  10950. this.domElement.appendChild(this.__input)
  10951. }
  10952. ).superclass = v,
  10953. A.extend(C.prototype, v.prototype, {
  10954. updateDisplay: function() {
  10955. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10956. C.superclass.prototype.updateDisplay.call(this)
  10957. }
  10958. }),
  10959. C),
  10960. f = ee.controllers.FunctionController,
  10961. g = ee.controllers.BooleanController,
  10962. m = ee.utils.common,
  10963. function(e, t) {
  10964. var i = e[t];
  10965. 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,{
  10966. min: arguments[2],
  10967. max: arguments[3]
  10968. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10969. }
  10970. ), 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) {
  10971. function f(t, i, n, r) {
  10972. t.style.background = "",
  10973. p.each(o, function(e) {
  10974. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10975. })
  10976. }
  10977. var g = function(e, t) {
  10978. function i(e) {
  10979. a(e),
  10980. h.bind(window, "mousemove", a),
  10981. h.bind(window, "mouseup", n)
  10982. }
  10983. function n() {
  10984. h.unbind(window, "mousemove", a),
  10985. h.unbind(window, "mouseup", n)
  10986. }
  10987. function r() {
  10988. var e = d(this.value);
  10989. !1 !== e ? (l.__color.__state = e,
  10990. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10991. }
  10992. function o() {
  10993. h.unbind(window, "mousemove", s),
  10994. h.unbind(window, "mouseup", o)
  10995. }
  10996. function a(e) {
  10997. e.preventDefault();
  10998. var t = h.getWidth(l.__saturation_field)
  10999. , i = h.getOffset(l.__saturation_field)
  11000. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  11001. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  11002. return 1 < r ? r = 1 : r < 0 && (r = 0),
  11003. 1 < n ? n = 1 : n < 0 && (n = 0),
  11004. l.__color.v = r,
  11005. l.__color.s = n,
  11006. l.setValue(l.__color.toOriginal()),
  11007. !1
  11008. }
  11009. function s(e) {
  11010. e.preventDefault();
  11011. var t = h.getHeight(l.__hue_field)
  11012. , i = h.getOffset(l.__hue_field)
  11013. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  11014. return 1 < n ? n = 1 : n < 0 && (n = 0),
  11015. l.__color.h = 360 * n,
  11016. l.setValue(l.__color.toOriginal()),
  11017. !1
  11018. }
  11019. g.superclass.call(this, e, t),
  11020. this.__color = new u(this.getValue()),
  11021. this.__temp = new u(0);
  11022. var l = this;
  11023. this.domElement = document.createElement("div"),
  11024. h.makeSelectable(this.domElement, !1),
  11025. this.__selector = document.createElement("div"),
  11026. this.__selector.className = "selector",
  11027. this.__saturation_field = document.createElement("div"),
  11028. this.__saturation_field.className = "saturation-field",
  11029. this.__field_knob = document.createElement("div"),
  11030. this.__field_knob.className = "field-knob",
  11031. this.__field_knob_border = "2px solid ",
  11032. this.__hue_knob = document.createElement("div"),
  11033. this.__hue_knob.className = "hue-knob",
  11034. this.__hue_field = document.createElement("div"),
  11035. this.__hue_field.className = "hue-field",
  11036. this.__input = document.createElement("input"),
  11037. this.__input.type = "text",
  11038. this.__input_textShadow = "0 1px 1px ",
  11039. h.bind(this.__input, "keydown", function(e) {
  11040. 13 === e.keyCode && r.call(this)
  11041. }),
  11042. h.bind(this.__input, "blur", r),
  11043. h.bind(this.__selector, "mousedown", function(e) {
  11044. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11045. h.removeClass(l.__selector, "drag")
  11046. })
  11047. });
  11048. var c = document.createElement("div");
  11049. p.extend(this.__selector.style, {
  11050. width: "122px",
  11051. height: "102px",
  11052. padding: "3px",
  11053. backgroundColor: "#222",
  11054. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11055. }),
  11056. p.extend(this.__field_knob.style, {
  11057. position: "absolute",
  11058. width: "12px",
  11059. height: "12px",
  11060. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11061. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11062. borderRadius: "12px",
  11063. zIndex: 1
  11064. }),
  11065. p.extend(this.__hue_knob.style, {
  11066. position: "absolute",
  11067. width: "15px",
  11068. height: "2px",
  11069. borderRight: "4px solid #fff",
  11070. zIndex: 1
  11071. }),
  11072. p.extend(this.__saturation_field.style, {
  11073. width: "100px",
  11074. height: "100px",
  11075. border: "1px solid #555",
  11076. marginRight: "3px",
  11077. display: "inline-block",
  11078. cursor: "pointer"
  11079. }),
  11080. p.extend(c.style, {
  11081. width: "100%",
  11082. height: "100%",
  11083. background: "none"
  11084. }),
  11085. f(c, "top", "rgba(0,0,0,0)", "#000"),
  11086. p.extend(this.__hue_field.style, {
  11087. width: "15px",
  11088. height: "100px",
  11089. display: "inline-block",
  11090. border: "1px solid #555",
  11091. cursor: "ns-resize"
  11092. }),
  11093. function(e) {
  11094. e.style.background = "",
  11095. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11096. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11097. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11098. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11099. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11100. }(this.__hue_field),
  11101. p.extend(this.__input.style, {
  11102. outline: "none",
  11103. textAlign: "center",
  11104. color: "#fff",
  11105. border: 0,
  11106. fontWeight: "bold",
  11107. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11108. }),
  11109. h.bind(this.__saturation_field, "mousedown", i),
  11110. h.bind(this.__field_knob, "mousedown", i),
  11111. h.bind(this.__hue_field, "mousedown", function(e) {
  11112. s(e),
  11113. h.bind(window, "mousemove", s),
  11114. h.bind(window, "mouseup", o)
  11115. }),
  11116. this.__saturation_field.appendChild(c),
  11117. this.__selector.appendChild(this.__field_knob),
  11118. this.__selector.appendChild(this.__saturation_field),
  11119. this.__selector.appendChild(this.__hue_field),
  11120. this.__hue_field.appendChild(this.__hue_knob),
  11121. this.domElement.appendChild(this.__input),
  11122. this.domElement.appendChild(this.__selector),
  11123. this.updateDisplay()
  11124. };
  11125. g.superclass = e,
  11126. p.extend(g.prototype, e.prototype, {
  11127. updateDisplay: function() {
  11128. var t = d(this.getValue());
  11129. if (!1 !== t) {
  11130. var i = !1;
  11131. p.each(u.COMPONENTS, function(e) {
  11132. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  11133. return i = !0,
  11134. {}
  11135. }, this),
  11136. i && p.extend(this.__color.__state, t)
  11137. }
  11138. p.extend(this.__temp.__state, this.__color.__state),
  11139. this.__temp.a = 1;
  11140. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  11141. , n = 255 - e;
  11142. p.extend(this.__field_knob.style, {
  11143. marginLeft: 100 * this.__color.s - 7 + "px",
  11144. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11145. backgroundColor: this.__temp.toString(),
  11146. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  11147. }),
  11148. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11149. this.__temp.s = 1,
  11150. this.__temp.v = 1,
  11151. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11152. p.extend(this.__input.style, {
  11153. backgroundColor: this.__input.value = this.__color.toString(),
  11154. color: "rgb(" + e + "," + e + "," + e + ")",
  11155. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  11156. })
  11157. }
  11158. });
  11159. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11160. return g
  11161. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  11162. a = ee.color.math = {
  11163. hsv_to_rgb: function(e, t, i) {
  11164. var n = Math.floor(e / 60) % 6
  11165. , r = e / 60 - Math.floor(e / 60)
  11166. , o = i * (1 - t)
  11167. , a = i * (1 - r * t)
  11168. , s = i * (1 - (1 - r) * t)
  11169. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11170. return {
  11171. r: 255 * l[0],
  11172. g: 255 * l[1],
  11173. b: 255 * l[2]
  11174. }
  11175. },
  11176. rgb_to_hsv: function(e, t, i) {
  11177. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11178. return 0 == o ? {
  11179. h: NaN,
  11180. s: 0,
  11181. v: 0
  11182. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11183. (n /= 6) < 0 && (n += 1),
  11184. {
  11185. h: 360 * n,
  11186. s: a / o,
  11187. v: o / 255
  11188. })
  11189. },
  11190. rgb_to_hex: function(e, t, i) {
  11191. var n = this.hex_with_component(0, 2, e);
  11192. return n = this.hex_with_component(n, 1, t),
  11193. this.hex_with_component(n, 0, i)
  11194. },
  11195. component_from_hex: function(e, t) {
  11196. return e >> 8 * t & 255
  11197. },
  11198. hex_with_component: function(e, t, i) {
  11199. return i << (c = 8 * t) | e & ~(255 << c)
  11200. }
  11201. },
  11202. s = ee.color.toString,
  11203. l = ee.utils.common,
  11204. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11205. l.extend(ae.prototype, {
  11206. toString: function() {
  11207. return s(this)
  11208. },
  11209. toOriginal: function() {
  11210. return this.__state.conversion.write(this)
  11211. }
  11212. }),
  11213. ie(ae.prototype, "r", 2),
  11214. ie(ae.prototype, "g", 1),
  11215. ie(ae.prototype, "b", 0),
  11216. ne(ae.prototype, "h"),
  11217. ne(ae.prototype, "s"),
  11218. ne(ae.prototype, "v"),
  11219. Object.defineProperty(ae.prototype, "a", {
  11220. get: function() {
  11221. return this.__state.a
  11222. },
  11223. set: function(e) {
  11224. this.__state.a = e
  11225. }
  11226. }),
  11227. Object.defineProperty(ae.prototype, "hex", {
  11228. get: function() {
  11229. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11230. this.__state.hex
  11231. },
  11232. set: function(e) {
  11233. this.__state.space = "HEX",
  11234. this.__state.hex = e
  11235. }
  11236. }),
  11237. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11238. window.setTimeout(e, 1e3 / 60)
  11239. }
  11240. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11241. r = ee.utils.common,
  11242. te.prototype.show = function() {
  11243. var e = this;
  11244. this.backgroundElement.style.display = "block",
  11245. this.domElement.style.display = "block",
  11246. this.domElement.style.opacity = 0,
  11247. this.domElement.style.webkitTransform = "scale(1.1)",
  11248. this.layout(),
  11249. r.defer(function() {
  11250. e.backgroundElement.style.opacity = 1,
  11251. e.domElement.style.opacity = 1,
  11252. e.domElement.style.webkitTransform = "scale(1)"
  11253. })
  11254. }
  11255. ,
  11256. te.prototype.hide = function() {
  11257. var e = this
  11258. , t = function() {
  11259. e.domElement.style.display = "none",
  11260. e.backgroundElement.style.display = "none",
  11261. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11262. n.unbind(e.domElement, "transitionend", t),
  11263. n.unbind(e.domElement, "oTransitionEnd", t)
  11264. };
  11265. n.bind(this.domElement, "webkitTransitionEnd", t),
  11266. n.bind(this.domElement, "transitionend", t),
  11267. n.bind(this.domElement, "oTransitionEnd", t),
  11268. this.backgroundElement.style.opacity = 0,
  11269. this.domElement.style.opacity = 0,
  11270. this.domElement.style.webkitTransform = "scale(1.1)"
  11271. }
  11272. ,
  11273. te.prototype.layout = function() {
  11274. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11275. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11276. }
  11277. ,
  11278. te), ee.dom.dom, ee.utils.common)
  11279. }
  11280. , {}],
  11281. 94: [function(e, t, i) {
  11282. (function(J) {
  11283. "use strict";
  11284. function i(e) {
  11285. function t(e, t) {
  11286. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11287. for (var a = 1; a <= e[o]; a++)
  11288. r[t[n]] = [],
  11289. r[t[n]][0] = i,
  11290. r[t[n]][1] = o,
  11291. n++,
  11292. i++;
  11293. i *= 2
  11294. }
  11295. return r
  11296. }
  11297. function _(e) {
  11298. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11299. t & 1 << i && (B |= 1 << V),
  11300. i--,
  11301. --V < 0 && (255 == B ? (b(255),
  11302. b(0)) : b(B),
  11303. V = 7,
  11304. B = 0)
  11305. }
  11306. function b(e) {
  11307. F.push(e)
  11308. }
  11309. function w(e) {
  11310. b(e >> 8 & 255),
  11311. b(255 & e)
  11312. }
  11313. function T(e, t, i, n, r) {
  11314. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11315. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11316. for (h = 0; h < 8; ++h) {
  11317. i = e[d],
  11318. n = e[d + 1],
  11319. r = e[d + 2],
  11320. o = e[d + 3],
  11321. a = e[d + 4],
  11322. s = e[d + 5],
  11323. l = e[d + 6];
  11324. var p = i + (c = e[d + 7])
  11325. , f = i - c
  11326. , g = n + l
  11327. , m = n - l
  11328. , v = r + s
  11329. , y = r - s
  11330. , A = o + a
  11331. , C = o - a
  11332. , I = p + A
  11333. , E = p - A
  11334. , _ = g + v
  11335. , b = g - v;
  11336. e[d] = I + _,
  11337. e[d + 4] = I - _;
  11338. var w = .707106781 * (b + E);
  11339. e[d + 2] = E + w,
  11340. e[d + 6] = E - w;
  11341. var T = .382683433 * ((I = C + y) - (b = m + f))
  11342. , x = .5411961 * I + T
  11343. , S = 1.306562965 * b + T
  11344. , M = .707106781 * (_ = y + m)
  11345. , R = f + M
  11346. , P = f - M;
  11347. e[d + 5] = P + x,
  11348. e[d + 3] = P - x,
  11349. e[d + 1] = R + S,
  11350. e[d + 7] = R - S,
  11351. d += 8
  11352. }
  11353. for (h = d = 0; h < 8; ++h) {
  11354. i = e[d],
  11355. n = e[d + 8],
  11356. r = e[d + 16],
  11357. o = e[d + 24],
  11358. a = e[d + 32],
  11359. s = e[d + 40],
  11360. l = e[d + 48];
  11361. var O = i + (c = e[d + 56])
  11362. , L = i - c
  11363. , D = n + l
  11364. , N = n - l
  11365. , F = r + s
  11366. , B = r - s
  11367. , V = o + a
  11368. , k = o - a
  11369. , U = O + V
  11370. , H = O - V
  11371. , z = D + F
  11372. , G = D - F;
  11373. e[d] = U + z,
  11374. e[d + 32] = U - z;
  11375. var W = .707106781 * (G + H);
  11376. e[d + 16] = H + W,
  11377. e[d + 48] = H - W;
  11378. var j = .382683433 * ((U = k + B) - (G = N + L))
  11379. , Y = .5411961 * U + j
  11380. , q = 1.306562965 * G + j
  11381. , X = .707106781 * (z = B + N)
  11382. , Z = L + X
  11383. , K = L - X;
  11384. e[d + 40] = K + Y,
  11385. e[d + 24] = K - Y,
  11386. e[d + 8] = Z + q,
  11387. e[d + 56] = Z - q,
  11388. d++
  11389. }
  11390. for (h = 0; h < 64; ++h)
  11391. u = e[h] * t[h],
  11392. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11393. return Q
  11394. }(e, t), c = 0; c < 64; ++c)
  11395. A[C[c]] = l[c];
  11396. var h = A[0] - i;
  11397. i = A[0],
  11398. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11399. _(v[o]));
  11400. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11401. ;
  11402. if (0 == u)
  11403. return _(a),
  11404. i;
  11405. for (var d, p = 1; p <= u; ) {
  11406. for (var f = p; 0 == A[p] && p <= u; ++p)
  11407. ;
  11408. var g = p - f;
  11409. if (16 <= g) {
  11410. d = g >> 4;
  11411. for (var m = 1; m <= d; ++m)
  11412. _(s);
  11413. g &= 15
  11414. }
  11415. o = 32767 + A[p],
  11416. _(r[(g << 4) + y[o]]),
  11417. _(v[o]),
  11418. p++
  11419. }
  11420. return 63 != u && _(a),
  11421. i
  11422. }
  11423. function x(e) {
  11424. if (e <= 0 && (e = 1),
  11425. 100 < e && (e = 100),
  11426. i != e) {
  11427. (function(e) {
  11428. 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++) {
  11429. var n = u((t[i] * e + 50) / 100);
  11430. n < 1 ? n = 1 : 255 < n && (n = 255),
  11431. O[C[i]] = n
  11432. }
  11433. 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++) {
  11434. var a = u((r[o] * e + 50) / 100);
  11435. a < 1 ? a = 1 : 255 < a && (a = 255),
  11436. L[C[o]] = a
  11437. }
  11438. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11439. for (var h = 0; h < 8; h++)
  11440. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11441. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11442. l++
  11443. }
  11444. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11445. i = e
  11446. }
  11447. }
  11448. var S, M, R, P, i, u = (Math.round,
  11449. 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];
  11450. this.encode = function(e, t) {
  11451. var i = ((new Date).getTime(),
  11452. t.quality);
  11453. i && x(i),
  11454. F = new Array,
  11455. B = 0,
  11456. V = 7,
  11457. w(65496),
  11458. w(65504),
  11459. w(16),
  11460. b(74),
  11461. b(70),
  11462. b(73),
  11463. b(70),
  11464. b(0),
  11465. b(1),
  11466. b(1),
  11467. b(0),
  11468. w(1),
  11469. w(1),
  11470. b(0),
  11471. b(0),
  11472. function() {
  11473. w(65499),
  11474. w(132),
  11475. b(0);
  11476. for (var e = 0; e < 64; e++)
  11477. b(O[e]);
  11478. b(1);
  11479. for (var t = 0; t < 64; t++)
  11480. b(L[t])
  11481. }(),
  11482. function(e, t) {
  11483. w(65472),
  11484. w(17),
  11485. b(8),
  11486. w(t),
  11487. w(e),
  11488. b(3),
  11489. b(1),
  11490. b(17),
  11491. b(0),
  11492. b(2),
  11493. b(17),
  11494. b(1),
  11495. b(3),
  11496. b(17),
  11497. b(1)
  11498. }(e.width, e.height),
  11499. function() {
  11500. w(65476),
  11501. w(418),
  11502. b(0);
  11503. for (var e = 0; e < 16; e++)
  11504. b(G[e + 1]);
  11505. for (var t = 0; t <= 11; t++)
  11506. b(W[t]);
  11507. b(16);
  11508. for (var i = 0; i < 16; i++)
  11509. b(j[i + 1]);
  11510. for (var n = 0; n <= 161; n++)
  11511. b(Y[n]);
  11512. b(1);
  11513. for (var r = 0; r < 16; r++)
  11514. b(q[r + 1]);
  11515. for (var o = 0; o <= 11; o++)
  11516. b(X[o]);
  11517. b(17);
  11518. for (var a = 0; a < 16; a++)
  11519. b(Z[a + 1]);
  11520. for (var s = 0; s <= 161; s++)
  11521. b(K[s])
  11522. }(),
  11523. w(65498),
  11524. w(12),
  11525. b(3),
  11526. b(1),
  11527. b(0),
  11528. b(2),
  11529. b(17),
  11530. b(3),
  11531. b(17),
  11532. b(0),
  11533. b(63),
  11534. b(0);
  11535. var n = 0
  11536. , r = 0
  11537. , o = 0;
  11538. B = 0,
  11539. V = 7,
  11540. this.encode.displayName = "_encode_";
  11541. 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; ) {
  11542. for (a = 0; a < A; ) {
  11543. for (u = h = A * C + a,
  11544. d = -1,
  11545. f = p = 0; f < 64; f++)
  11546. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11547. v <= C + p && (u -= A * (C + 1 + p - v)),
  11548. A <= a + d && (u -= a + d - A + 4),
  11549. s = g[u++],
  11550. l = g[u++],
  11551. c = g[u++],
  11552. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11553. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11554. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11555. n = T(k, D, n, S, R),
  11556. r = T(U, N, r, M, P),
  11557. o = T(H, N, o, M, P),
  11558. a += 32
  11559. }
  11560. C += I
  11561. }
  11562. if (0 <= V) {
  11563. var E = [];
  11564. E[1] = V + 1,
  11565. E[0] = (1 << V + 1) - 1,
  11566. _(E)
  11567. }
  11568. return w(65497),
  11569. new J(F)
  11570. }
  11571. ,
  11572. (new Date).getTime(),
  11573. e = e || 50,
  11574. function() {
  11575. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11576. n[t] = e(t)
  11577. }(),
  11578. S = t(G, W),
  11579. M = t(q, X),
  11580. R = t(j, Y),
  11581. P = t(Z, K),
  11582. function() {
  11583. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11584. for (var n = e; n < t; n++)
  11585. y[32767 + n] = i,
  11586. v[32767 + n] = [],
  11587. v[32767 + n][1] = i,
  11588. v[32767 + n][0] = n;
  11589. for (var r = -(t - 1); r <= -e; r++)
  11590. y[32767 + r] = i,
  11591. v[32767 + r] = [],
  11592. v[32767 + r][1] = i,
  11593. v[32767 + r][0] = t - 1 + r;
  11594. e <<= 1,
  11595. t <<= 1
  11596. }
  11597. }(),
  11598. function() {
  11599. for (var e = 0; e < 256; e++)
  11600. z[e] = 19595 * e,
  11601. z[e + 256 >> 0] = 38470 * e,
  11602. z[e + 512 >> 0] = 7471 * e + 32768,
  11603. z[e + 768 >> 0] = -11059 * e,
  11604. z[e + 1024 >> 0] = -21709 * e,
  11605. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11606. z[e + 1536 >> 0] = -27439 * e,
  11607. z[e + 1792 >> 0] = -5329 * e
  11608. }(),
  11609. x(e),
  11610. (new Date).getTime()
  11611. }
  11612. t.exports.encode = function(e, t) {
  11613. return (t = t || {}).quality = t.quality || 50,
  11614. {
  11615. data: new i(t.quality).encode(e, t),
  11616. width: e.width,
  11617. height: e.height
  11618. }
  11619. }
  11620. }
  11621. ).call(this, e("buffer").Buffer)
  11622. }
  11623. , {
  11624. buffer: 198
  11625. }],
  11626. 95: [function(e, t, i) {
  11627. "use strict";
  11628. !function() {
  11629. if ("performance"in window == 0 && (window.performance = {}),
  11630. Date.now = Date.now || function() {
  11631. return (new Date).getTime()
  11632. }
  11633. ,
  11634. "now"in window.performance == 0) {
  11635. var e = Date.now();
  11636. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11637. window.performance.now = function() {
  11638. return Date.now() - e
  11639. }
  11640. }
  11641. }()
  11642. }
  11643. , {}],
  11644. 96: [function(e, t, i) {
  11645. "use strict";
  11646. var a = e("three");
  11647. a.EffectComposer = function(e, t) {
  11648. if (this.renderer = e,
  11649. void 0 === t) {
  11650. var i = {
  11651. minFilter: a.LinearFilter,
  11652. magFilter: a.LinearFilter,
  11653. format: a.RGBAFormat,
  11654. stencilBuffer: !1
  11655. }
  11656. , n = e.getSize();
  11657. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11658. }
  11659. this.renderTarget1 = t,
  11660. this.renderTarget2 = t.clone(),
  11661. this.writeBuffer = this.renderTarget1,
  11662. this.readBuffer = this.renderTarget2,
  11663. this.passes = [],
  11664. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11665. this.copyPass = new a.ShaderPass(a.CopyShader)
  11666. }
  11667. ,
  11668. a.EffectComposer.prototype = {
  11669. swapBuffers: function() {
  11670. var e = this.readBuffer;
  11671. this.readBuffer = this.writeBuffer,
  11672. this.writeBuffer = e
  11673. },
  11674. addPass: function(e) {
  11675. this.passes.push(e)
  11676. },
  11677. insertPass: function(e, t) {
  11678. this.passes.splice(t, 0, e)
  11679. },
  11680. render: function(e) {
  11681. this.writeBuffer = this.renderTarget1,
  11682. this.readBuffer = this.renderTarget2;
  11683. var t, i, n = !1, r = this.passes.length;
  11684. for (i = 0; i < r; i++)
  11685. if ((t = this.passes[i]).enabled) {
  11686. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11687. t.needsSwap) {
  11688. if (n) {
  11689. var o = this.renderer.context;
  11690. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11691. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11692. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11693. }
  11694. this.swapBuffers()
  11695. }
  11696. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11697. }
  11698. },
  11699. reset: function(e) {
  11700. if (void 0 === e) {
  11701. var t = this.renderer.getSize();
  11702. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11703. }
  11704. this.renderTarget1.dispose(),
  11705. this.renderTarget2.dispose(),
  11706. this.renderTarget1 = e,
  11707. this.renderTarget2 = e.clone(),
  11708. this.writeBuffer = this.renderTarget1,
  11709. this.readBuffer = this.renderTarget2
  11710. },
  11711. setSize: function(e, t) {
  11712. this.renderTarget1.setSize(e, t),
  11713. this.renderTarget2.setSize(e, t)
  11714. }
  11715. }
  11716. }
  11717. , {
  11718. three: 217
  11719. }],
  11720. 97: [function(e, t, i) {
  11721. "use strict";
  11722. var n = e("three");
  11723. n.MaskPass = function(e, t) {
  11724. this.scene = e,
  11725. this.camera = t,
  11726. this.enabled = !0,
  11727. this.clear = !0,
  11728. this.needsSwap = !1,
  11729. this.inverse = !1
  11730. }
  11731. ,
  11732. n.MaskPass.prototype = {
  11733. render: function(e, t, i, n) {
  11734. var r, o, a = e.context;
  11735. a.colorMask(!1, !1, !1, !1),
  11736. a.depthMask(!1),
  11737. o = this.inverse ? (r = 0,
  11738. 1) : (r = 1,
  11739. 0),
  11740. a.enable(a.STENCIL_TEST),
  11741. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11742. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11743. a.clearStencil(o),
  11744. e.render(this.scene, this.camera, i, this.clear),
  11745. e.render(this.scene, this.camera, t, this.clear),
  11746. a.colorMask(!0, !0, !0, !0),
  11747. a.depthMask(!0),
  11748. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11749. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11750. }
  11751. },
  11752. n.ClearMaskPass = function() {
  11753. this.enabled = !0
  11754. }
  11755. ,
  11756. n.ClearMaskPass.prototype = {
  11757. render: function(e, t, i, n) {
  11758. var r = e.context;
  11759. r.disable(r.STENCIL_TEST)
  11760. }
  11761. }
  11762. }
  11763. , {
  11764. three: 217
  11765. }],
  11766. 98: [function(e, t, i) {
  11767. "use strict";
  11768. var o = e("three");
  11769. o.RenderPass = function(e, t, i, n, r) {
  11770. this.scene = e,
  11771. this.camera = t,
  11772. this.overrideMaterial = i,
  11773. this.clearColor = n,
  11774. this.clearAlpha = void 0 !== r ? r : 1,
  11775. this.oldClearColor = new o.Color,
  11776. this.oldClearAlpha = 1,
  11777. this.enabled = !0,
  11778. this.clear = !0,
  11779. this.needsSwap = !1
  11780. }
  11781. ,
  11782. o.RenderPass.prototype = {
  11783. render: function(e, t, i, n) {
  11784. this.scene.overrideMaterial = this.overrideMaterial,
  11785. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11786. this.oldClearAlpha = e.getClearAlpha(),
  11787. e.setClearColor(this.clearColor, this.clearAlpha)),
  11788. e.render(this.scene, this.camera, i, this.clear),
  11789. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11790. this.scene.overrideMaterial = null
  11791. }
  11792. }
  11793. }
  11794. , {
  11795. three: 217
  11796. }],
  11797. 99: [function(e, t, i) {
  11798. "use strict";
  11799. var n = e("three");
  11800. n.ShaderPass = function(e, t) {
  11801. this.textureID = void 0 !== t ? t : "tDiffuse",
  11802. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11803. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11804. this.material = new n.ShaderMaterial({
  11805. defines: e.defines || {},
  11806. uniforms: this.uniforms,
  11807. vertexShader: e.vertexShader,
  11808. fragmentShader: e.fragmentShader
  11809. })),
  11810. this.renderToScreen = !1,
  11811. this.enabled = !0,
  11812. this.needsSwap = !0,
  11813. this.clear = !1,
  11814. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11815. this.scene = new n.Scene,
  11816. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11817. this.scene.add(this.quad)
  11818. }
  11819. ,
  11820. n.ShaderPass.prototype = {
  11821. render: function(e, t, i, n) {
  11822. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11823. this.quad.material = this.material,
  11824. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11825. }
  11826. }
  11827. }
  11828. , {
  11829. three: 217
  11830. }],
  11831. 100: [function(e, t, i) {
  11832. "use strict";
  11833. e("three").CopyShader = {
  11834. uniforms: {
  11835. tDiffuse: {
  11836. type: "t",
  11837. value: null
  11838. },
  11839. opacity: {
  11840. type: "f",
  11841. value: 1
  11842. }
  11843. },
  11844. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11845. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11846. }
  11847. }
  11848. , {
  11849. three: 217
  11850. }],
  11851. 101: [function(e, t, i) {
  11852. "use strict";
  11853. e("three").HorizontalBlurShader = {
  11854. uniforms: {
  11855. tDiffuse: {
  11856. type: "t",
  11857. value: null
  11858. },
  11859. h: {
  11860. type: "f",
  11861. value: 1 / 512
  11862. }
  11863. },
  11864. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11865. 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")
  11866. }
  11867. }
  11868. , {
  11869. three: 217
  11870. }],
  11871. 102: [function(e, t, i) {
  11872. "use strict";
  11873. e("three").VerticalBlurShader = {
  11874. uniforms: {
  11875. tDiffuse: {
  11876. type: "t",
  11877. value: null
  11878. },
  11879. v: {
  11880. type: "f",
  11881. value: 1 / 512
  11882. }
  11883. },
  11884. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11885. 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")
  11886. }
  11887. }
  11888. , {
  11889. three: 217
  11890. }],
  11891. 103: [function(e, t, i) {
  11892. "use strict";
  11893. var z = e("three");
  11894. !function() {
  11895. if ("performance"in window == 0 && (window.performance = {}),
  11896. "now"in window.performance == 0) {
  11897. var e = Date.now();
  11898. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11899. window.performance.now = function() {
  11900. return Date.now() - e
  11901. }
  11902. }
  11903. }(),
  11904. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11905. var t, i = this.extensions, n = this.context;
  11906. if (e === z.RepeatWrapping)
  11907. return n.REPEAT;
  11908. if (e === z.ClampToEdgeWrapping)
  11909. return n.CLAMP_TO_EDGE;
  11910. if (e === z.MirroredRepeatWrapping)
  11911. return n.MIRRORED_REPEAT;
  11912. if (e === z.NearestFilter)
  11913. return n.NEAREST;
  11914. if (e === z.NearestMipMapNearestFilter)
  11915. return n.NEAREST_MIPMAP_NEAREST;
  11916. if (e === z.NearestMipMapLinearFilter)
  11917. return n.NEAREST_MIPMAP_LINEAR;
  11918. if (e === z.LinearFilter)
  11919. return n.LINEAR;
  11920. if (e === z.LinearMipMapNearestFilter)
  11921. return n.LINEAR_MIPMAP_NEAREST;
  11922. if (e === z.LinearMipMapLinearFilter)
  11923. return n.LINEAR_MIPMAP_LINEAR;
  11924. if (e === z.UnsignedByteType)
  11925. return n.UNSIGNED_BYTE;
  11926. if (e === z.UnsignedShort4444Type)
  11927. return n.UNSIGNED_SHORT_4_4_4_4;
  11928. if (e === z.UnsignedShort5551Type)
  11929. return n.UNSIGNED_SHORT_5_5_5_1;
  11930. if (e === z.UnsignedShort565Type)
  11931. return n.UNSIGNED_SHORT_5_6_5;
  11932. if (e === z.ByteType)
  11933. return n.BYTE;
  11934. if (e === z.ShortType)
  11935. return n.SHORT;
  11936. if (e === z.UnsignedShortType)
  11937. return n.UNSIGNED_SHORT;
  11938. if (e === z.IntType)
  11939. return n.INT;
  11940. if (e === z.UnsignedIntType)
  11941. return n.UNSIGNED_INT;
  11942. if (e === z.FloatType)
  11943. return n.FLOAT;
  11944. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11945. return t.HALF_FLOAT_OES;
  11946. if (e === z.AlphaFormat)
  11947. return n.ALPHA;
  11948. if (e === z.RGBFormat)
  11949. return n.RGB;
  11950. if (e === z.RGBAFormat)
  11951. return n.RGBA;
  11952. if (e === z.LuminanceFormat)
  11953. return n.LUMINANCE;
  11954. if (e === z.LuminanceAlphaFormat)
  11955. return n.LUMINANCE_ALPHA;
  11956. if (e === z.AddEquation)
  11957. return n.FUNC_ADD;
  11958. if (e === z.SubtractEquation)
  11959. return n.FUNC_SUBTRACT;
  11960. if (e === z.ReverseSubtractEquation)
  11961. return n.FUNC_REVERSE_SUBTRACT;
  11962. if (e === z.ZeroFactor)
  11963. return n.ZERO;
  11964. if (e === z.OneFactor)
  11965. return n.ONE;
  11966. if (e === z.SrcColorFactor)
  11967. return n.SRC_COLOR;
  11968. if (e === z.OneMinusSrcColorFactor)
  11969. return n.ONE_MINUS_SRC_COLOR;
  11970. if (e === z.SrcAlphaFactor)
  11971. return n.SRC_ALPHA;
  11972. if (e === z.OneMinusSrcAlphaFactor)
  11973. return n.ONE_MINUS_SRC_ALPHA;
  11974. if (e === z.DstAlphaFactor)
  11975. return n.DST_ALPHA;
  11976. if (e === z.OneMinusDstAlphaFactor)
  11977. return n.ONE_MINUS_DST_ALPHA;
  11978. if (e === z.DstColorFactor)
  11979. return n.DST_COLOR;
  11980. if (e === z.OneMinusDstColorFactor)
  11981. return n.ONE_MINUS_DST_COLOR;
  11982. if (e === z.SrcAlphaSaturateFactor)
  11983. return n.SRC_ALPHA_SATURATE;
  11984. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11985. if (e === z.RGB_S3TC_DXT1_Format)
  11986. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11987. if (e === z.RGBA_S3TC_DXT1_Format)
  11988. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11989. if (e === z.RGBA_S3TC_DXT3_Format)
  11990. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11991. if (e === z.RGBA_S3TC_DXT5_Format)
  11992. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11993. }
  11994. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11995. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11996. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11997. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11998. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11999. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  12000. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12001. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  12002. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12003. }
  12004. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  12005. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12006. if (null !== (t = i.get("EXT_blend_minmax"))) {
  12007. if (e === z.MinEquation)
  12008. return t.MIN_EXT;
  12009. if (e === z.MaxEquation)
  12010. return t.MAX_EXT
  12011. }
  12012. return 0
  12013. }
  12014. ,
  12015. z.WebGLState = function(l, i, c) {
  12016. var n = this
  12017. , r = new z.Vector4
  12018. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  12019. , o = new Uint8Array(e)
  12020. , a = new Uint8Array(e)
  12021. , s = new Uint8Array(e)
  12022. , t = {}
  12023. , h = null
  12024. , u = null
  12025. , d = null
  12026. , p = null
  12027. , f = null
  12028. , g = null
  12029. , m = null
  12030. , v = null
  12031. , y = !1
  12032. , A = null
  12033. , C = null
  12034. , I = null
  12035. , E = null
  12036. , _ = null
  12037. , b = null
  12038. , w = null
  12039. , T = null
  12040. , x = null
  12041. , S = null
  12042. , M = null
  12043. , R = null
  12044. , P = null
  12045. , O = null
  12046. , L = null
  12047. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  12048. , N = void 0
  12049. , F = {}
  12050. , B = new z.Vector4
  12051. , V = null
  12052. , k = null
  12053. , U = new z.Vector4
  12054. , H = new z.Vector4;
  12055. this.init = function() {
  12056. this.clearColor(0, 0, 0, 1),
  12057. this.clearDepth(1),
  12058. this.clearStencil(0),
  12059. this.enable(l.DEPTH_TEST),
  12060. l.depthFunc(l.LEQUAL),
  12061. l.frontFace(l.CCW),
  12062. l.cullFace(l.BACK),
  12063. this.enable(l.CULL_FACE),
  12064. this.enable(l.BLEND),
  12065. l.blendEquation(l.FUNC_ADD),
  12066. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  12067. }
  12068. ,
  12069. this.initAttributes = function() {
  12070. for (var e = 0, t = o.length; e < t; e++)
  12071. o[e] = 0
  12072. }
  12073. ,
  12074. this.enableAttribute = function(e) {
  12075. o[e] = 1,
  12076. 0 === a[e] && (l.enableVertexAttribArray(e),
  12077. a[e] = 1),
  12078. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  12079. s[e] = 0)
  12080. }
  12081. ,
  12082. this.enableAttributeAndDivisor = function(e, t, i) {
  12083. o[e] = 1,
  12084. 0 === a[e] && (l.enableVertexAttribArray(e),
  12085. a[e] = 1),
  12086. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  12087. s[e] = t)
  12088. }
  12089. ,
  12090. this.disableUnusedAttributes = function() {
  12091. for (var e = 0, t = a.length; e < t; e++)
  12092. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  12093. a[e] = 0)
  12094. }
  12095. ,
  12096. this.enable = function(e) {
  12097. !0 !== t[e] && (l.enable(e),
  12098. t[e] = !0)
  12099. }
  12100. ,
  12101. this.disable = function(e) {
  12102. !1 !== t[e] && (l.disable(e),
  12103. t[e] = !1)
  12104. }
  12105. ,
  12106. this.getCompressedTextureFormats = function() {
  12107. if (null === h && (h = [],
  12108. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  12109. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  12110. h.push(e[t]);
  12111. return h
  12112. }
  12113. ,
  12114. this.setBlending = function(e, t, i, n, r, o, a, s) {
  12115. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  12116. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12117. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  12118. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12119. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12120. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12121. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12122. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12123. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12124. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  12125. u = e,
  12126. y = s),
  12127. e === z.CustomBlending ? (r = r || t,
  12128. o = o || i,
  12129. a = a || n,
  12130. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  12131. d = t,
  12132. g = r),
  12133. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  12134. p = i,
  12135. f = n,
  12136. m = o,
  12137. v = a)) : v = m = g = f = p = d = null
  12138. }
  12139. ,
  12140. this.setDepthFunc = function(e) {
  12141. if (A !== e) {
  12142. if (e)
  12143. switch (e) {
  12144. case z.NeverDepth:
  12145. l.depthFunc(l.NEVER);
  12146. break;
  12147. case z.AlwaysDepth:
  12148. l.depthFunc(l.ALWAYS);
  12149. break;
  12150. case z.LessDepth:
  12151. l.depthFunc(l.LESS);
  12152. break;
  12153. case z.LessEqualDepth:
  12154. l.depthFunc(l.LEQUAL);
  12155. break;
  12156. case z.EqualDepth:
  12157. l.depthFunc(l.EQUAL);
  12158. break;
  12159. case z.GreaterEqualDepth:
  12160. l.depthFunc(l.GEQUAL);
  12161. break;
  12162. case z.GreaterDepth:
  12163. l.depthFunc(l.GREATER);
  12164. break;
  12165. case z.NotEqualDepth:
  12166. l.depthFunc(l.NOTEQUAL);
  12167. break;
  12168. default:
  12169. l.depthFunc(l.LEQUAL)
  12170. }
  12171. else
  12172. l.depthFunc(l.LEQUAL);
  12173. A = e
  12174. }
  12175. }
  12176. ,
  12177. this.setDepthTest = function(e) {
  12178. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12179. }
  12180. ,
  12181. this.setDepthWrite = function(e) {
  12182. C !== e && (l.depthMask(e),
  12183. C = e)
  12184. }
  12185. ,
  12186. this.setColorWrite = function(e) {
  12187. I !== e && (l.colorMask(e, e, e, e),
  12188. I = e)
  12189. }
  12190. ,
  12191. this.setStencilFunc = function(e, t, i) {
  12192. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12193. _ = e,
  12194. b = t,
  12195. w = i)
  12196. }
  12197. ,
  12198. this.setStencilOp = function(e, t, i) {
  12199. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12200. T = e,
  12201. x = t,
  12202. S = i)
  12203. }
  12204. ,
  12205. this.setStencilTest = function(e) {
  12206. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12207. }
  12208. ,
  12209. this.setStencilWrite = function(e) {
  12210. E !== e && (l.stencilMask(e),
  12211. E = e)
  12212. }
  12213. ,
  12214. this.setFlipSided = function(e) {
  12215. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12216. M = e)
  12217. }
  12218. ,
  12219. this.setLineWidth = function(e) {
  12220. e !== R && (l.lineWidth(e),
  12221. R = e)
  12222. }
  12223. ,
  12224. this.setPolygonOffset = function(e, t, i) {
  12225. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12226. !e || P === t && O === i || (l.polygonOffset(t, i),
  12227. P = t,
  12228. O = i)
  12229. }
  12230. ,
  12231. this.getScissorTest = function() {
  12232. return L
  12233. }
  12234. ,
  12235. this.setScissorTest = function(e) {
  12236. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12237. }
  12238. ,
  12239. this.activeTexture = function(e) {
  12240. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12241. N !== e && (l.activeTexture(e),
  12242. N = e)
  12243. }
  12244. ,
  12245. this.bindTexture = function(e, t) {
  12246. void 0 === N && n.activeTexture();
  12247. var i = F[N];
  12248. void 0 === i && (i = {
  12249. type: void 0,
  12250. texture: void 0
  12251. },
  12252. F[N] = i),
  12253. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12254. i.type = e,
  12255. i.texture = t)
  12256. }
  12257. ,
  12258. this.compressedTexImage2D = function() {
  12259. try {
  12260. l.compressedTexImage2D.apply(l, arguments)
  12261. } catch (e) {
  12262. console.error(e)
  12263. }
  12264. }
  12265. ,
  12266. this.texImage2D = function() {
  12267. try {
  12268. l.texImage2D.apply(l, arguments)
  12269. } catch (e) {
  12270. console.error(e)
  12271. }
  12272. }
  12273. ,
  12274. this.clearColor = function(e, t, i, n) {
  12275. r.set(e, t, i, n),
  12276. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12277. B.copy(r))
  12278. }
  12279. ,
  12280. this.clearDepth = function(e) {
  12281. V !== e && (l.clearDepth(e),
  12282. V = e)
  12283. }
  12284. ,
  12285. this.clearStencil = function(e) {
  12286. k !== e && (l.clearStencil(e),
  12287. k = e)
  12288. }
  12289. ,
  12290. this.scissor = function(e) {
  12291. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12292. U.copy(e))
  12293. }
  12294. ,
  12295. this.viewport = function(e) {
  12296. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12297. H.copy(e))
  12298. }
  12299. ,
  12300. this.reset = function() {
  12301. for (var e = 0; e < a.length; e++)
  12302. 1 === a[e] && (l.disableVertexAttribArray(e),
  12303. a[e] = 0);
  12304. t = {},
  12305. N = void 0,
  12306. F = {},
  12307. M = E = C = I = u = h = null
  12308. }
  12309. }
  12310. }
  12311. , {
  12312. three: 217
  12313. }],
  12314. 104: [function(a, h, e) {
  12315. (function(i, e) {
  12316. "use strict";
  12317. function t(e) {
  12318. this.urls = e;
  12319. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12320. this.builder = n.loadProto(t),
  12321. this.decoder = this.builder.build("binary_mesh")
  12322. }
  12323. var s = a("three")
  12324. , n = a("protobufjs")
  12325. , r = a("../util/logger")
  12326. , o = (a("../util/common"),
  12327. a("../util/ajax"))
  12328. , l = a("../objects/Chunk")
  12329. , c = new r(e);
  12330. t.prototype = {
  12331. constructor: t,
  12332. load: function(t, i, n, r) {
  12333. return c.time("download"),
  12334. o.get(t, {
  12335. responseType: "arraybuffer"
  12336. }).done(function(e) {
  12337. c.timeEnd("download"),
  12338. this.parse(e, t, i, n, r)
  12339. }
  12340. .bind(this)).fail(r)
  12341. },
  12342. parse: function(e, t, i, n, r) {
  12343. var o = this.readProtobuf(e);
  12344. if (!o)
  12345. return r();
  12346. try {
  12347. c.time("convert to webgl"),
  12348. this.convertProtobufToSceneObject(o, t, i, n, r),
  12349. c.timeEnd("convert to webgl")
  12350. } catch (e) {
  12351. return c.error("failed parsing .dam"),
  12352. c.error(e.message),
  12353. r()
  12354. }
  12355. },
  12356. readProtobuf: function(e) {
  12357. var t;
  12358. try {
  12359. c.time("parse proto"),
  12360. t = this.decoder.decode(e),
  12361. c.timeEnd("parse proto")
  12362. } catch (e) {
  12363. return c.error("failed parsing proto for .dam"),
  12364. c.error(e.message),
  12365. null
  12366. }
  12367. return t
  12368. },
  12369. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12370. if (0 === e.chunk.length)
  12371. return c.warn("No chunks in damfile..."),
  12372. t([]);
  12373. var o = new s.Matrix4;
  12374. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12375. var a = e.chunk.map(function(e) {
  12376. var t = new s.BufferGeometry;
  12377. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12378. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12379. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12380. t.applyMatrix(o),
  12381. t.computeBoundingBox(),
  12382. new l({
  12383. geometry: t,
  12384. textureName: e.material_name,
  12385. name: e.chunk_name,
  12386. meshUrl: i
  12387. })
  12388. });
  12389. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12390. r())
  12391. }
  12392. },
  12393. h.exports = t
  12394. }
  12395. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12396. }
  12397. , {
  12398. "../objects/Chunk": 144,
  12399. "../util/ajax": 181,
  12400. "../util/common": 185,
  12401. "../util/logger": 189,
  12402. buffer: 198,
  12403. protobufjs: 214,
  12404. three: 217
  12405. }],
  12406. 105: [function(n, r, e) {
  12407. (function(e) {
  12408. "use strict";
  12409. var t = (n("three"),
  12410. n("../settings"),
  12411. n("../util/browser"),
  12412. n("./DamLoader"))
  12413. , i = n("../util/logger")
  12414. , u = (n("../ab"),
  12415. new i(e));
  12416. r.exports = {
  12417. getLoaders: function() {
  12418. return [["_50k", ".dam", t], ["", ".dam", t]]
  12419. },
  12420. load: function(e, t, i, n, r, o) {
  12421. var a = this.getLoaders()[o = o || 0];
  12422. if (a) {
  12423. var s = a[0]
  12424. , l = a[1]
  12425. , c = new a[2](t)
  12426. , h = t.get(e + s + l);
  12427. h ? (u.debug("Trying " + s + l),
  12428. c.load(h, i, n, function() {
  12429. this.load(e, t, i, n, r, ++o)
  12430. }
  12431. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12432. this.load(e, t, i, n, r, ++o))
  12433. } else
  12434. r && r("No suitable model file found...")
  12435. }
  12436. }
  12437. }
  12438. ).call(this, "/js/loaders/ModelLoader.js")
  12439. }
  12440. , {
  12441. "../ab": 3,
  12442. "../settings": 166,
  12443. "../util/browser": 182,
  12444. "../util/logger": 189,
  12445. "./DamLoader": 104,
  12446. three: 217
  12447. }],
  12448. 106: [function(i, n, e) {
  12449. (function(e) {
  12450. "use strict";
  12451. var l = i("../util/common")
  12452. , c = i("../util/texture")
  12453. , h = i("../util/browser")
  12454. , t = i("../util/logger")
  12455. , u = i("../settings")
  12456. , d = new t(e);
  12457. n.exports = {
  12458. load: function(i, n) {
  12459. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12460. return $.when();
  12461. var r = l.countUnique(i.chunks.map(function(e) {
  12462. return e.textureName
  12463. }))
  12464. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12465. , t = "_50k" == e ? "high" : "low";
  12466. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12467. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12468. t = "low"));
  12469. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12470. , a = $.Deferred()
  12471. , s = 0;
  12472. return i.chunks.forEach(function(e) {
  12473. if (!e.material.map && e.textureName) {
  12474. var t = i.urls.get(o + e.textureName);
  12475. e.setTextureMap(c.load(t, function(e, t) {
  12476. e || (n.push(t),
  12477. s++,
  12478. a.notify(s, r),
  12479. s === r && a.resolve())
  12480. }
  12481. .bind(this, c.isLoaded(t))))
  12482. }
  12483. }),
  12484. a.promise()
  12485. }
  12486. }
  12487. }
  12488. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12489. }
  12490. , {
  12491. "../settings": 166,
  12492. "../util/browser": 182,
  12493. "../util/common": 185,
  12494. "../util/logger": 189,
  12495. "../util/texture": 194
  12496. }],
  12497. 107: [function(s, l, e) {
  12498. (function(n, e) {
  12499. "use strict";
  12500. function t(e) {
  12501. this.model = e,
  12502. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12503. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12504. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12505. , i = r.loadProto(t);
  12506. this.decoder = i.build("VisionModeldata")
  12507. }
  12508. var r = s("protobufjs")
  12509. , i = s("../util/ajax")
  12510. , o = (s("../util/common"),
  12511. s("../util/math"))
  12512. , a = new (s("../util/logger"))(e);
  12513. t.prototype.load = function() {
  12514. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12515. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12516. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12517. $.when([]))
  12518. }
  12519. ,
  12520. t.prototype.loadVisionModelData = function() {
  12521. return i.get(this.modelDataPath, {
  12522. responseType: "arraybuffer"
  12523. }).then(function(e) {
  12524. var t;
  12525. try {
  12526. t = this.decoder.decode(e)
  12527. } catch (e) {
  12528. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12529. this.loadSweepLocationsCSV()
  12530. }
  12531. var i = t.sweepLocations.map(function(e) {
  12532. return {
  12533. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12534. position: {
  12535. x: e.pose.translation.x,
  12536. y: e.pose.translation.y,
  12537. z: e.pose.translation.z
  12538. },
  12539. quaternion: {
  12540. x: e.pose.rotation.x,
  12541. y: e.pose.rotation.y,
  12542. z: e.pose.rotation.z,
  12543. w: e.pose.rotation.w
  12544. },
  12545. puck: {
  12546. x: e.puck.x,
  12547. y: e.puck.y,
  12548. z: e.puck.z
  12549. },
  12550. floor: e.group,
  12551. neighbours: e.visibles,
  12552. alignmentType: e.alignment_type
  12553. }
  12554. }).map(function(e) {
  12555. return e.position = o.convertVisionVector(e.position),
  12556. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12557. e.puck = o.convertVisionVector(e.puck),
  12558. e
  12559. });
  12560. return i.forEach(function(e) {
  12561. if(e.neighbours.find(a=>a==-1)){
  12562. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12563. }
  12564. e.neighbours = e.neighbours.filter(e=>i[e])
  12565. e.neighbours = e.neighbours.map(function(e) {
  12566. return i[e].uuid
  12567. })
  12568. }),
  12569. i
  12570. }
  12571. .bind(this), function() {
  12572. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12573. this.loadSweepLocationsCSV()
  12574. }
  12575. .bind(this))
  12576. }
  12577. ,
  12578. t.prototype.loadSweepLocationsCSV = function() {
  12579. return i.get(this.sweepLocationsPath).then(function(e) {
  12580. return e.split("\n").map(function(e) {
  12581. return e.split(", ")
  12582. }).filter(function(e) {
  12583. return 1 < e.length
  12584. }).map(function(e) {
  12585. return {
  12586. uuid: e[0],
  12587. position: {
  12588. x: parseFloat(e[1]),
  12589. y: parseFloat(e[2]),
  12590. z: parseFloat(e[3])
  12591. },
  12592. quaternion: {
  12593. x: parseFloat(e[4]),
  12594. y: parseFloat(e[5]),
  12595. z: parseFloat(e[6]),
  12596. w: parseFloat(e[7])
  12597. }
  12598. }
  12599. }).map(function(e) {
  12600. return e.position = o.convertVisionVector(e.position),
  12601. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12602. e
  12603. })
  12604. }).fail(function() {
  12605. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12606. })
  12607. }
  12608. ,
  12609. l.exports = t
  12610. }
  12611. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12612. }
  12613. , {
  12614. "../util/ajax": 181,
  12615. "../util/common": 185,
  12616. "../util/logger": 189,
  12617. "../util/math": 190,
  12618. buffer: 198,
  12619. protobufjs: 214
  12620. }],
  12621. 108: [function(s, l, e) {
  12622. (function(e) {
  12623. "use strict";
  12624. function t() {
  12625. this.locale = null
  12626. }
  12627. var i = s("../settings")
  12628. , n = s("../util/common")
  12629. , r = s("../util/logger")
  12630. , o = s("../enum/Locale")
  12631. , a = new r(e);
  12632. t.prototype.init = function() {
  12633. var e;
  12634. switch (i.languageTag) {
  12635. case null:
  12636. case "en":
  12637. case o.EN_US:
  12638. this.locale = o.EN_US,
  12639. e = s("./strings-en-US");
  12640. break;
  12641. case "es":
  12642. case o.ES_MX:
  12643. this.locale = o.ES_MX,
  12644. e = s("./strings-es-MX");
  12645. break;
  12646. case "fr":
  12647. case o.FR_FR:
  12648. this.locale = o.FR_FR,
  12649. e = s("./strings-fr-FR");
  12650. break;
  12651. case "de":
  12652. case o.DE_DE:
  12653. this.locale = o.DE_DE,
  12654. e = s("./strings-de-DE");
  12655. break;
  12656. case "ru":
  12657. case o.RU_RU:
  12658. this.locale = o.RU_RU,
  12659. e = s("./strings-ru-RU");
  12660. break;
  12661. case "cn":
  12662. case o.CN_CN:
  12663. this.locale = o.CN_CN,
  12664. e = s("./strings-cn-CN");
  12665. break;
  12666. case "jp":
  12667. case o.JP_JP:
  12668. this.locale = o.JP_JP,
  12669. e = s("./strings-jp-JP");
  12670. break;
  12671. default:
  12672. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12673. this.locale = o.EN_US,
  12674. e = s("./strings-en-US")
  12675. }
  12676. a.info("Using locale '" + this.locale + "'"),
  12677. n.extendObject(this, e)
  12678. }
  12679. ,
  12680. t.prototype.localizeGUI = function() {
  12681. var e = document.querySelector("#gui-parent");
  12682. this.localizeTree(e),
  12683. this.localizeLoadingText()
  12684. }
  12685. ,
  12686. t.prototype.localizeLoadingText = function() {
  12687. document.querySelector("#help-dialog").classList.add(this.locale),
  12688. document.querySelector("#interaction-modal").classList.add(this.locale),
  12689. document.querySelector("#gui").classList.add(this.locale)
  12690. }
  12691. ,
  12692. t.prototype.localizeTree = function(e) {
  12693. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12694. if (e.nodeType === Node.TEXT_NODE)
  12695. (t = e.data.match(n)) && (i = t[1],
  12696. e.data = this.localizeText(i) || i);
  12697. else if (e.nodeType === Node.ELEMENT_NODE) {
  12698. var r = e.getAttribute("title");
  12699. r && ((t = r.match(n)) && (i = t[1],
  12700. e.setAttribute("title", this.localizeText(i) || i)))
  12701. }
  12702. for (e = e.firstChild; e; )
  12703. this.localizeTree(e),
  12704. e = e.nextSibling
  12705. }
  12706. ,
  12707. t.prototype.localizeText = function(e) {
  12708. var t = this[e];
  12709. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12710. t = s("./strings-en-US")[e]),
  12711. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12712. t
  12713. }
  12714. ,
  12715. l.exports = new t
  12716. }
  12717. ).call(this, "/js/localization/localize.js")
  12718. }
  12719. , {
  12720. "../enum/Locale": 31,
  12721. "../settings": 166,
  12722. "../util/common": 185,
  12723. "../util/logger": 189,
  12724. "./strings-cn-CN": 109,
  12725. "./strings-de-DE": 110,
  12726. "./strings-en-US": 111,
  12727. "./strings-es-MX": 112,
  12728. "./strings-fr-FR": 113,
  12729. "./strings-jp-JP": 114,
  12730. "./strings-ru-RU": 115
  12731. }],
  12732. 109: [function(e, t, i) {
  12733. "use strict";
  12734. t.exports = {
  12735. PAGE_TITLE: "",
  12736. LOADING: "正在加载",
  12737. PRESENTED_BY_CAPS: "呈现者:",
  12738. POWERED_BY: "技术支持:",
  12739. POWERED_BY_CAPS: "技术支持:",
  12740. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12741. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12742. PRESENTED_BY: "呈现者:",
  12743. MORE: "更多 ",
  12744. LESS: "更少 ",
  12745. TAG_CONTENT: "tag™ 内容",
  12746. SHOW: "显示",
  12747. HIDE: "隐藏",
  12748. DOLLHOUSE: "场景屋",
  12749. FLOOR_PLAN: "楼层平面图",
  12750. OPEN_HIGHLIGHTS: "打开精彩片段",
  12751. CLOSE_HIGHLIGHTS: "关闭",
  12752. PREVIOUS: "上一个",
  12753. PLAY: "播放",
  12754. PAUSE: "暂停",
  12755. NEXT: "下一个",
  12756. EXPLORE_3D_SPACE: "探索 3D 空间",
  12757. VIEW_DOLLHOUSE: "观看场景屋",
  12758. SOCIAL_SHARING: "分享这个空间",
  12759. VIEW_IN_VR: "以 VR 观看",
  12760. VIEW_FULLSCREEN: "全屏观看",
  12761. EXIT_FULLSCREEN: " 退出全屏",
  12762. ZOOM_IN: "放大",
  12763. ZOOM_OUT: "缩小",
  12764. FLOOR_NAME: "楼层",
  12765. FLOOR_ALL: "ALL",
  12766. FLOOR_Lang: ["Floor", ""],
  12767. TERMS: "条款",
  12768. PORT_TERMS: "port 条款",
  12769. TERMS_OF_USE: "使用条款",
  12770. CLOSE_TERMS: "关闭",
  12771. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12772. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12773. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12774. WEBVR_ENTER_WEBVR: "进入 VR",
  12775. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12776. WEBVR_LEARN_MORE: "了解更多",
  12777. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12778. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12779. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12780. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12781. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12782. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12783. VR_LEARN_MORE_CAPS: "了解更多",
  12784. VR_PREVIOUS_CAPS: "上一个’,",
  12785. VR_NEXT_CAPS: "下一个",
  12786. VR_GOT_IT_CAPS: "明白了",
  12787. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12788. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12789. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12790. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12791. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12792. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12793. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12794. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12795. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12796. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12797. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12798. VR_APP: "port VR 应用程序",
  12799. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12800. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12801. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12802. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12803. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12804. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12805. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12806. VR_ANDROID_DVICES: "Android 设备",
  12807. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12808. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12809. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12810. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12811. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12812. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12813. VR_DOWNLOAD_HERE: "在此下载",
  12814. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12815. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12816. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12817. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12818. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12819. SHARE_TO: "分享到",
  12820. SHARE_LINK: "直接链接",
  12821. SHARE_EXPLORE: "探索",
  12822. SHARE_AT: "在",
  12823. SHARE_WITH: "使用",
  12824. SHARE_3D: "以 3D",
  12825. SHARE_COPIED: "已复制!",
  12826. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12827. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12828. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12829. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12830. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12831. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12832. ERROR_GENERIC_ACTIONS_3: " 或",
  12833. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12834. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12835. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12836. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12837. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12838. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12839. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12840. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12841. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12842. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12843. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12844. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12845. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12846. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12847. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12848. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12849. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12850. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12851. LINK_TO_LOCATION: "地点链接",
  12852. MENU_COPY: "复制",
  12853. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12854. ROTATE: "旋转",
  12855. MOVE: "移动",
  12856. INSIDE: "内部",
  12857. ZOOM: "缩放",
  12858. HELP: "小帮手",
  12859. HELP_NAVIGATION_TAB: "导航",
  12860. HELP_MORE_HELP_TAB: "更多帮助",
  12861. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12862. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12863. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12864. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12865. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12866. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12867. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12868. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12869. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12870. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12871. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12872. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12873. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12874. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12875. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12876. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12877. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12878. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12879. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12880. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12881. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12882. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12883. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12884. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12885. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12886. HELP_MORE_HLR_A: "精彩片段集锦",
  12887. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12888. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12889. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12890. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12891. HELP_MORE_FLOORS_A: "楼层选择器",
  12892. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12893. HELP_MORE_TAG_A: "tag™ 贴文",
  12894. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12895. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12896. HELP_MORE_ZOOM_A: "缩放控件",
  12897. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12898. HELP_MORE_TOUR_A: "导览控件",
  12899. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12900. HELP_MORE_INSIDE_A: "内部视图",
  12901. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12902. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12903. HELP_MORE_VR_A: "VR 模式",
  12904. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12905. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12906. HELP_MORE_360_A: "360° 视图",
  12907. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12908. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12909. HELP_MORE_FULLSCREEN_A: "全屏",
  12910. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12911. CLOSE: "关闭"
  12912. }
  12913. }
  12914. , {}],
  12915. 110: [function(e, t, i) {
  12916. "use strict";
  12917. t.exports = {
  12918. PAGE_TITLE: "",
  12919. LOADING: "Lädt",
  12920. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12921. POWERED_BY: "Angetrieben von",
  12922. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12923. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12924. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12925. PRESENTED_BY: "Präsentiert von ",
  12926. MORE: "Mehr ",
  12927. LESS: "Weniger ",
  12928. TAG_CONTENT: "tag™ Inhalt",
  12929. SHOW: "Anzeigen",
  12930. HIDE: "Verbergen",
  12931. DOLLHOUSE: "Puppenhaus",
  12932. FLOOR_PLAN: "Grundriss",
  12933. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12934. CLOSE_HIGHLIGHTS: "Schließen",
  12935. PREVIOUS: "Vorheriges",
  12936. PLAY: "Abspielen",
  12937. PAUSE: "Pausieren",
  12938. NEXT: "Nächstes",
  12939. EXPLORE_3D_SPACE: "Innenraum betreten",
  12940. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12941. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12942. VIEW_IN_VR: "In VR ansehen",
  12943. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12944. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12945. ZOOM_IN: "Vergrößern",
  12946. ZOOM_OUT: "Verkleinern",
  12947. FLOOR_NAME: "Etage ",
  12948. FLOOR_ALL: "Alle",
  12949. TERMS: "Bedingungen",
  12950. PORT_TERMS: "port Bedingungen",
  12951. TERMS_OF_USE: "Nutzungsbedingungen",
  12952. TERMS_TEXT_FILE: "terms-de-DE.html",
  12953. CLOSE_TERMS: "Schließen",
  12954. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12955. HELP: "Hilfe",
  12956. HELP_NAVIGATION_TAB: "Navigation",
  12957. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12958. CLOSE: "Schließen",
  12959. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12960. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12961. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12962. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12963. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12964. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12965. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12966. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12967. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12968. 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.",
  12969. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12970. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12971. 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.",
  12972. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12973. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12974. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12975. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12976. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12977. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12978. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12979. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12980. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12981. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12982. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12983. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12984. HELP_MORE_HLR_A: "Liste das Highlight",
  12985. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12986. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12987. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12988. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12989. HELP_MORE_FLOORS_A: "Etage auswählen",
  12990. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12991. HELP_MORE_TAG_A: "tag™ Posts",
  12992. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12993. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12994. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12995. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12996. HELP_MORE_TOUR_A: "Tour Steuerung",
  12997. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12998. HELP_MORE_INSIDE_A: "Innenansicht",
  12999. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13000. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13001. HELP_MORE_VR_A: "VR Modus",
  13002. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13003. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13004. HELP_MORE_360_A: "360° Views Ansicht ",
  13005. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13006. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13007. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13008. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13009. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13010. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13011. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13012. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13013. WEBVR_LEARN_MORE: "Mehr Infos",
  13014. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13015. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13016. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13017. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13018. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13019. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13020. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13021. VR_APP: "port VR App",
  13022. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13023. 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",
  13024. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13025. VR_APP_FOR_ANDROID: "port VR app für Android",
  13026. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13027. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13028. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13029. VR_PREVIOUS_CAPS: "ZURÜCK",
  13030. VR_NEXT_CAPS: "WEITER",
  13031. VR_GOT_IT_CAPS: "VERSTANDEN",
  13032. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13033. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13034. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13035. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13036. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13037. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13038. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13039. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13040. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13041. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13042. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13043. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13044. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13045. VR_ANDROID_DVICES: "Android Geräte",
  13046. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13047. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13048. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13049. VR_DOWNLOAD_HERE: "Hier runterladen",
  13050. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13051. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13052. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13053. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13054. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13055. SHARE_TO: "Teilen auf",
  13056. SHARE_LINK: "Direkter Link",
  13057. SHARE_EXPLORE: "Umsehen",
  13058. SHARE_AT: "auf",
  13059. SHARE_WITH: "mit",
  13060. SHARE_3D: "in 3D",
  13061. SHARE_COPIED: "Kopiert!",
  13062. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13063. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13064. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13065. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13066. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13067. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13068. ERROR_GENERIC_ACTIONS_3: " oder ",
  13069. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13070. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13071. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13072. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13073. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13074. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13075. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13076. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13077. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13078. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13079. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13080. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13081. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13082. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13083. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13084. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13085. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13086. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13087. LINK_TO_LOCATION: "Link zu",
  13088. MENU_COPY: "Kopieren",
  13089. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13090. ROTATE: "Drehen",
  13091. INSIDE: "Drinnen",
  13092. MOVE: "Bewegen",
  13093. ZOOM: "Vergrößern"
  13094. }
  13095. }
  13096. , {}],
  13097. 111: [function(e, t, i) {
  13098. "use strict";
  13099. t.exports = {
  13100. PAGE_TITLE: "",
  13101. LOADING: "Loading",
  13102. PRESENTED_BY_CAPS: "PRESENTED BY",
  13103. POWERED_BY: "powered by ",
  13104. POWERED_BY_CAPS: "POWERED BY",
  13105. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13106. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13107. PRESENTED_BY: "Presented by ",
  13108. MORE: "More ",
  13109. LESS: "Less ",
  13110. TAG_CONTENT: "tag™ Content",
  13111. SHOW: "Show",
  13112. HIDE: "Hide",
  13113. DOLLHOUSE: "Dollhouse",
  13114. FLOOR_PLAN: "Floor plan",
  13115. OPEN_HIGHLIGHTS: "Open Highlights",
  13116. CLOSE_HIGHLIGHTS: "Close",
  13117. PREVIOUS: "Previous",
  13118. PLAY: "Play",
  13119. PAUSE: "Pause",
  13120. NEXT: "Next",
  13121. EXPLORE_3D_SPACE: "Explore 3D Space",
  13122. VIEW_DOLLHOUSE: "View dollhouse",
  13123. SOCIAL_SHARING: "Share this Space",
  13124. VIEW_IN_VR: "View in VR",
  13125. VIEW_FULLSCREEN: "全屏",
  13126. EXIT_FULLSCREEN: "退出全屏",
  13127. ZOOM_IN: "Zoom in",
  13128. ZOOM_OUT: "Zoom out",
  13129. FLOOR_NAME: "Floor ",
  13130. FLOOR_ALL: "全部",
  13131. TERMS: "Terms",
  13132. PORT_TERMS: "port terms",
  13133. TERMS_OF_USE: "Terms of Use",
  13134. TERMS_TEXT_FILE: "terms-en-US.html",
  13135. CLOSE_TERMS: "Close",
  13136. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13137. HELP: "Help",
  13138. HELP_NAVIGATION_TAB: "Navigation",
  13139. HELP_MORE_HELP_TAB: "More Help",
  13140. CLOSE: "Close",
  13141. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13142. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13143. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13144. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13145. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13146. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13147. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13148. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13149. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13150. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13151. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13152. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13153. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13154. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13155. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13156. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13157. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13158. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13159. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13160. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13161. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13162. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13163. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13164. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13165. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13166. HELP_MORE_HLR_A: "Highlight Reel",
  13167. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13168. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13169. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13170. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13171. HELP_MORE_FLOORS_A: "Floor Selector",
  13172. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13173. HELP_MORE_TAG_A: "tag™ Posts",
  13174. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13175. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13176. HELP_MORE_ZOOM_A: "Zoom Controls",
  13177. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13178. HELP_MORE_TOUR_A: "Tour Controls",
  13179. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13180. HELP_MORE_INSIDE_A: "Inside View",
  13181. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13182. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13183. HELP_MORE_VR_A: "VR Mode",
  13184. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13185. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13186. HELP_MORE_360_A: "360° Views",
  13187. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13188. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13189. HELP_MORE_FULLSCREEN_A: "Full screen",
  13190. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13191. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13192. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13193. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13194. WEBVR_ENTER_WEBVR: "ENTER VR",
  13195. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13196. WEBVR_LEARN_MORE: "Learn more",
  13197. WEBVR_VIEW_SPACE: "View Space in VR",
  13198. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13199. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13200. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13201. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13202. VR_PREVIOUS_CAPS: "PREVIOUS",
  13203. VR_NEXT_CAPS: "NEXT",
  13204. VR_GOT_IT_CAPS: "GOT IT",
  13205. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13206. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13207. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13208. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13209. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13210. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13211. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13212. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13213. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13214. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13215. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13216. VR_APP: "port VR App",
  13217. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13218. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13219. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13220. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13221. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13222. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13223. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13224. VR_ANDROID_DVICES: "Android Devices",
  13225. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13226. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13227. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13228. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13229. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13230. VR_APP_OPEN: "Open with the port VR app instead",
  13231. VR_DOWNLOAD_HERE: "Download here",
  13232. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13233. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13234. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13235. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13236. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13237. SHARE_TO: "Share to",
  13238. SHARE_LINK: "Direct Link",
  13239. SHARE_EXPLORE: "Explore ",
  13240. SHARE_AT: "at",
  13241. SHARE_WITH: "with",
  13242. SHARE_3D: " in 3D",
  13243. SHARE_COPIED: "Copied!",
  13244. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13245. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13246. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13247. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13248. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13249. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13250. ERROR_GENERIC_ACTIONS_3: " or ",
  13251. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13252. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13253. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13254. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13255. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13256. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13257. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13258. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13259. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13260. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13261. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13262. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13263. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13264. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13265. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13266. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13267. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13268. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13269. LINK_TO_LOCATION: "Link to location",
  13270. MENU_COPY: "Copy",
  13271. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13272. ROTATE: "Rotate",
  13273. INSIDE: "Inside",
  13274. MOVE: "Move",
  13275. ZOOM: "Zoom"
  13276. }
  13277. }
  13278. , {}],
  13279. 112: [function(e, t, i) {
  13280. "use strict";
  13281. t.exports = {
  13282. PAGE_TITLE: "",
  13283. LOADING: "Cargando",
  13284. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13285. POWERED_BY: "potenciando por ",
  13286. POWERED_BY_CAPS: "POTENCIADO POR ",
  13287. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13288. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13289. PRESENTED_BY: "Presentado por ",
  13290. MORE: "Más ",
  13291. LESS: "Menos ",
  13292. TAG_CONTENT: "Contenido de tag™",
  13293. SHOW: "Mostrar",
  13294. HIDE: "Ocultar",
  13295. DOLLHOUSE: "Dollhouse",
  13296. FLOOR_PLAN: "Planos",
  13297. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13298. CLOSE_HIGHLIGHTS: "Cerrar",
  13299. PREVIOUS: "Anterior",
  13300. PLAY: "Play",
  13301. PAUSE: "Pausa",
  13302. NEXT: "Siguiente",
  13303. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13304. VIEW_DOLLHOUSE: "Ver dollhouse",
  13305. SOCIAL_SHARING: "Compartir este espacio",
  13306. VIEW_IN_VR: "Ver en realidad virtual",
  13307. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13308. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13309. ZOOM_IN: "Acercar",
  13310. ZOOM_OUT: "Alejar",
  13311. FLOOR_NAME: "Piso ",
  13312. FLOOR_ALL: "Todas",
  13313. TERMS: "Condiciones",
  13314. PORT_TERMS: "port términos de uso",
  13315. TERMS_OF_USE: "Términos de uso",
  13316. TERMS_TEXT_FILE: "terms-es-MX.html",
  13317. CLOSE_TERMS: "Cerrar",
  13318. 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.",
  13319. HELP: "Ayuda",
  13320. HELP_NAVIGATION_TAB: "Navegación",
  13321. HELP_MORE_HELP_TAB: "Más Ayuda",
  13322. CLOSE: "Cerrar",
  13323. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13324. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13325. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13326. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13327. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13328. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13329. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13330. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13331. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13332. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13333. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13334. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13335. 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.",
  13336. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13337. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13338. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13339. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13340. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13341. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13342. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13343. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13344. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13345. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13346. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13347. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13348. HELP_MORE_HLR_A: "Galería destacada",
  13349. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13350. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13351. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13352. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13353. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13354. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13355. HELP_MORE_TAG_A: "tag™ Posts",
  13356. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13357. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13358. HELP_MORE_ZOOM_A: "Controles de zoom",
  13359. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13360. HELP_MORE_TOUR_A: "Controles de recorrido",
  13361. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13362. HELP_MORE_INSIDE_A: "Vista interior",
  13363. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13364. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13365. HELP_MORE_VR_A: "Modo de realidad virtual",
  13366. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13367. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13368. HELP_MORE_360_A: "360° Views",
  13369. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13370. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13371. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13372. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13373. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13374. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13375. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13376. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13377. WEBVR_LEARN_MORE: "Más información",
  13378. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13379. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13380. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13381. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13382. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13383. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13384. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13385. VR_APP: "port VR App",
  13386. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13387. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13388. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13389. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13390. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13391. VR_PREVIOUS_CAPS: "ANTERIOR",
  13392. VR_NEXT_CAPS: "SIGUIENTE",
  13393. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13394. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13395. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13396. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13397. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13398. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13399. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13400. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13401. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13402. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13403. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13404. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13405. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13406. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13407. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13408. VR_ANDROID_DVICES: "Dispositivos Android",
  13409. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13410. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13411. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13412. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13413. VR_DOWNLOAD_HERE: "Descargar aquí",
  13414. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13415. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13416. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13417. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13418. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13419. SHARE_TO: "Compartir en",
  13420. SHARE_LINK: "Enlace directo",
  13421. SHARE_EXPLORE: "Explorar ",
  13422. SHARE_AT: "en",
  13423. SHARE_WITH: "con",
  13424. SHARE_3D: " en 3D",
  13425. SHARE_COPIED: "¡Copiado!",
  13426. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13427. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13428. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13429. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13430. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13431. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13432. ERROR_GENERIC_ACTIONS_3: " o ",
  13433. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13434. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13435. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13436. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13437. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13438. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13439. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13440. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13441. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13442. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13443. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13444. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13445. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13446. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13447. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13448. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13449. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13450. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13451. LINK_TO_LOCATION: "Enlace a la ubicación",
  13452. MENU_COPY: "Copiar",
  13453. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13454. ROTATE: "Girar",
  13455. INSIDE: "Interior",
  13456. MOVE: "Moverse",
  13457. ZOOM: "Acercar o alejar"
  13458. }
  13459. }
  13460. , {}],
  13461. 113: [function(e, t, i) {
  13462. "use strict";
  13463. t.exports = {
  13464. PAGE_TITLE: "",
  13465. LOADING: "Chargement",
  13466. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13467. POWERED_BY: "alimenté par ",
  13468. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13469. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13470. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13471. PRESENTED_BY: "Présenté par ",
  13472. MORE: "Plus ",
  13473. LESS: "Moins ",
  13474. TAG_CONTENT: "Contenu tag™",
  13475. SHOW: "Montrer",
  13476. HIDE: "Cacher",
  13477. DOLLHOUSE: "Dollhouse",
  13478. FLOOR_PLAN: "Plan de sol",
  13479. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13480. CLOSE_HIGHLIGHTS: "Fermer",
  13481. PREVIOUS: "Précédent",
  13482. PLAY: "Lecture",
  13483. PAUSE: "Pause",
  13484. NEXT: "Suivant",
  13485. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13486. VIEW_DOLLHOUSE: "Voir dollhouse",
  13487. SOCIAL_SHARING: "Partager cet espace",
  13488. VIEW_IN_VR: "Voir en VR",
  13489. VIEW_FULLSCREEN: "Plein écran",
  13490. EXIT_FULLSCREEN: "Fermer plein écran",
  13491. ZOOM_IN: "Zoom avant",
  13492. ZOOM_OUT: "Zoom arrière",
  13493. FLOOR_NAME: "Étage ",
  13494. FLOOR_ALL: "Tous",
  13495. TERMS: "Mentions légales",
  13496. PORT_TERMS: "port mentions légales",
  13497. TERMS_OF_USE: "Conditions d'utilisation",
  13498. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13499. CLOSE_TERMS: "Fermer",
  13500. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13501. HELP: "Aide",
  13502. HELP_NAVIGATION_TAB: "Navigation",
  13503. HELP_MORE_HELP_TAB: "Aide",
  13504. CLOSE: "Fermer",
  13505. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13506. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13507. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13508. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13509. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13510. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13511. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13512. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13513. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13514. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13515. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13516. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13517. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13518. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13519. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13520. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13521. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13522. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13523. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13524. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13525. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13526. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13527. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13528. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13529. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13530. HELP_MORE_HLR_A: "Carrousel",
  13531. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13532. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13533. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13534. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13535. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13536. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13537. HELP_MORE_TAG_A: "tag™ Posts",
  13538. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13539. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13540. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13541. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13542. HELP_MORE_TOUR_A: "Commandes de la visite",
  13543. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13544. HELP_MORE_INSIDE_A: "Vue intérieure",
  13545. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13546. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13547. HELP_MORE_VR_A: "Mode RV",
  13548. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13549. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13550. HELP_MORE_360_A: "Vues 360°",
  13551. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13552. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13553. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13554. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13555. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13556. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13557. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13558. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13559. WEBVR_LEARN_MORE: "En savoir plus",
  13560. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13561. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13562. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13563. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13564. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13565. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13566. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13567. VR_NEXT_CAPS: "SUIVANT",
  13568. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13569. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13570. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13571. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13572. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13573. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13574. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13575. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13576. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13577. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13578. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13579. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13580. VR_APP: "port VR App",
  13581. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13582. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13583. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13584. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13585. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13586. 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",
  13587. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13588. VR_ANDROID_DVICES: "Appareils Android",
  13589. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13590. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13591. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13592. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13593. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13594. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13595. VR_DOWNLOAD_HERE: "Télécharger ici",
  13596. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13597. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13598. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13599. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13600. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13601. SHARE_TO: "Partager sur",
  13602. SHARE_LINK: "Lien direct",
  13603. SHARE_EXPLORE: "Explorer ",
  13604. SHARE_AT: "à",
  13605. SHARE_WITH: "avec",
  13606. SHARE_3D: " en 3D",
  13607. SHARE_COPIED: "Copié!",
  13608. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13609. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13610. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13611. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13612. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13613. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13614. ERROR_GENERIC_ACTIONS_3: " ou ",
  13615. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13616. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13617. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13618. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13619. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13620. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13621. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13622. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13623. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13624. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13625. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13626. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13627. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13628. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13629. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13630. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13631. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13632. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13633. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13634. MENU_COPY: "Copie",
  13635. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13636. ROTATE: "Faire pivoter",
  13637. INSIDE: "Intérieure",
  13638. MOVE: "Se déplacer",
  13639. ZOOM: "Zoom"
  13640. }
  13641. }
  13642. , {}],
  13643. 114: [function(e, t, i) {
  13644. "use strict";
  13645. t.exports = {
  13646. PAGE_TITLE: "",
  13647. LOADING: "読み込み中",
  13648. PRESENTED_BY_CAPS: "PRESENTED BY",
  13649. POWERED_BY: "powered by",
  13650. POWERED_BY_CAPS: "POWERED BY",
  13651. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13652. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13653. PRESENTED_BY: "Presented by ",
  13654. MORE: "全て表示 ",
  13655. LESS: "閉じる ",
  13656. TAG_CONTENT: "tag™コンテンツ ",
  13657. SHOW: "表示",
  13658. HIDE: "非表示",
  13659. DOLLHOUSE: "ドールハウス",
  13660. FLOOR_PLAN: "フロアプラン",
  13661. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13662. CLOSE_HIGHLIGHTS: "閉じる",
  13663. PREVIOUS: "前へ",
  13664. PLAY: "再生",
  13665. PAUSE: "一時停止",
  13666. NEXT: "次へ",
  13667. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13668. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13669. SOCIAL_SHARING: "このSpaceを共有する",
  13670. VIEW_IN_VR: "VRで表示",
  13671. VIEW_FULLSCREEN: "フルスクリーン表示",
  13672. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13673. ZOOM_IN: "ズームイン",
  13674. ZOOM_OUT: "ズームアウト",
  13675. FLOOR_NAME: "フロア ",
  13676. FLOOR_ALL: "すべて",
  13677. TERMS: "規約",
  13678. PORT_TERMS: "port規約",
  13679. TERMS_OF_USE: "利用規約",
  13680. CLOSE_TERMS: "閉じる",
  13681. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13682. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13683. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13684. WEBVR_ENTER_WEBVR: "VRに入る",
  13685. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13686. WEBVR_LEARN_MORE: "もっと詳しく",
  13687. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13688. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13689. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13690. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13691. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13692. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13693. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13694. VR_PREVIOUS_CAPS: "前へ",
  13695. VR_NEXT_CAPS: "次へ",
  13696. VR_GOT_IT_CAPS: "了解",
  13697. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13698. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13699. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13700. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13701. VR_WHAT_YOU_NEED: "必要なもの",
  13702. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13703. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13704. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13705. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13706. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13707. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13708. VR_APP: "port VRアプリ",
  13709. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13710. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13711. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13712. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13713. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13714. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13715. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13716. VR_ANDROID_DVICES: "Androidデバイス",
  13717. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13718. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13719. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13720. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13721. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13722. VR_APP_OPEN: "port VRアプリで開く",
  13723. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13724. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13725. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13726. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13727. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13728. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13729. SHARE_TO: "共有先",
  13730. SHARE_LINK: "ダイレクトリンク",
  13731. SHARE_EXPLORE: "探索",
  13732. SHARE_AT: "場所",
  13733. SHARE_WITH: "使用アプリ",
  13734. SHARE_3D: "3Dで",
  13735. SHARE_COPIED: "コピーされました!",
  13736. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13737. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13738. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13739. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13740. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13741. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13742. ERROR_GENERIC_ACTIONS_3: "または",
  13743. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13744. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13745. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13746. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13747. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13748. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13749. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13750. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13751. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13752. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13753. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13754. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13755. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13756. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13757. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13758. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13759. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13760. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13761. LINK_TO_LOCATION: "ロケーションへのリンク",
  13762. MENU_COPY: "コピー",
  13763. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13764. ROTATE: "回転",
  13765. MOVE: "移動",
  13766. INSIDE: "内側",
  13767. ZOOM: "ズーム",
  13768. HELP: "ヘルプ",
  13769. HELP_NAVIGATION_TAB: "ナビゲーション",
  13770. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13771. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13772. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13773. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13774. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13775. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13776. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13777. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13778. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13779. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13780. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13781. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13782. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13783. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13784. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13785. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13786. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13787. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13788. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13789. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13790. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13791. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13792. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13793. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13794. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13795. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13796. HELP_MORE_HLR_A: "ハイライト",
  13797. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13798. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13799. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13800. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13801. HELP_MORE_FLOORS_A: "フロアセレクター",
  13802. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13803. HELP_MORE_TAG_A: "tag™ Posts",
  13804. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13805. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13806. HELP_MORE_ZOOM_A: "ズームコントロール",
  13807. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13808. HELP_MORE_TOUR_A: "ツアーコントロール",
  13809. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13810. HELP_MORE_INSIDE_A: "内側ビュー",
  13811. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13812. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13813. HELP_MORE_VR_A: "VRモード",
  13814. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13815. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13816. HELP_MORE_360_A: "360° Views",
  13817. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13818. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13819. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13820. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13821. CLOSE: "閉じる"
  13822. }
  13823. }
  13824. , {}],
  13825. 115: [function(e, t, i) {
  13826. "use strict";
  13827. t.exports = {
  13828. PAGE_TITLE: "",
  13829. LOADING: "Загрузка",
  13830. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13831. POWERED_BY: "разработано на платформе ",
  13832. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13833. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13834. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13835. PRESENTED_BY: "Представлено ",
  13836. MORE: "Больше ",
  13837. LESS: "Меньше ",
  13838. TAG_CONTENT: "tag™ Контент",
  13839. SHOW: "Показать",
  13840. HIDE: "Скрыть",
  13841. DOLLHOUSE: "Dollhouse",
  13842. FLOOR_PLAN: "Планировка",
  13843. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13844. CLOSE_HIGHLIGHTS: "Закрыть",
  13845. PREVIOUS: "Предыдущий",
  13846. PLAY: "Воспроизвести",
  13847. PAUSE: "Пауза",
  13848. NEXT: "Следующий",
  13849. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13850. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13851. SOCIAL_SHARING: "Поделиться этой моделью",
  13852. VIEW_IN_VR: "Посмотреть в VR",
  13853. VIEW_FULLSCREEN: "Полный экран",
  13854. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13855. ZOOM_IN: "Увеличить",
  13856. ZOOM_OUT: "Уменьшить",
  13857. FLOOR_NAME: "Этаж ",
  13858. FLOOR_ALL: "Все",
  13859. TERMS: "Условия",
  13860. PORT_TERMS: "Правила пользования",
  13861. TERMS_OF_USE: "Условия использования",
  13862. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13863. CLOSE_TERMS: "Закрыть",
  13864. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13865. HELP: "Помощь",
  13866. HELP_NAVIGATION_TAB: "Навигация",
  13867. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13868. CLOSE: "Закрыть",
  13869. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13870. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13871. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13872. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13873. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13874. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13875. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13876. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13877. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13878. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13879. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13880. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13881. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13882. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13883. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13884. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13885. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13886. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13887. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13888. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13889. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13890. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13891. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13892. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13893. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13894. HELP_MORE_HLR_A: "Фотоколлаж",
  13895. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13896. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13897. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13898. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13899. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13900. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13901. HELP_MORE_TAG_A: "tag™ Posts",
  13902. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13903. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13904. HELP_MORE_ZOOM_A: "Масштаб",
  13905. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13906. HELP_MORE_TOUR_A: "Управление Туром",
  13907. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13908. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13909. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13910. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13911. HELP_MORE_VR_A: "Режим VR",
  13912. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13913. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13914. HELP_MORE_360_A: "360° Views",
  13915. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13916. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13917. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13918. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13919. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13920. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13921. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13922. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13923. WEBVR_LEARN_MORE: "Узнать больше",
  13924. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13925. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13926. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13927. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13928. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13929. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13930. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13931. VR_APP: "port VR App",
  13932. VR_APP_OPEN: "Или открыть через приложение port VR",
  13933. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13934. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13935. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13936. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13937. VR_VIEW_SPACE: "Запустить модель в VR",
  13938. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13939. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13940. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13941. VR_GOT_IT_CAPS: "ЯСНО",
  13942. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13943. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13944. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13945. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13946. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13947. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13948. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13949. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13950. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13951. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13952. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13953. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13954. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13955. VR_ANDROID_DVICES: "Android устройства",
  13956. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13957. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13958. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13959. VR_DOWNLOAD_HERE: "Скачать здесь",
  13960. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13961. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13962. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13963. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13964. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13965. SHARE_TO: "Поделиться",
  13966. SHARE_LINK: "Прямая ссылка",
  13967. SHARE_EXPLORE: "просмотреть",
  13968. SHARE_AT: "на",
  13969. SHARE_WITH: "с",
  13970. SHARE_3D: "в 3D",
  13971. SHARE_COPIED: "Скопировано!",
  13972. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13973. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13974. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13975. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13976. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13977. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13978. ERROR_GENERIC_ACTIONS_3: " или ",
  13979. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13980. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13981. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13982. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13983. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13984. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13985. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13986. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13987. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13988. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13989. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13990. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13991. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13992. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13993. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13994. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13995. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13996. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13997. LINK_TO_LOCATION: "Ссылка на местоположение",
  13998. MENU_COPY: "Копировать",
  13999. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14000. ROTATE: "Вращать",
  14001. MOVE: "Передвигаться",
  14002. INSIDE: "Вид изнутри",
  14003. ZOOM: "Масштаб"
  14004. }
  14005. }
  14006. , {}],
  14007. 116: [function(r, e, t) {
  14008. (function(i) {
  14009. "use strict";
  14010. function re(e) {
  14011. console.log("e1:" + e),
  14012. e = Math.round(.4 * e * 100),
  14013. console.log("e2:" + e);
  14014. var t = $(".progressbar");
  14015. t.find(".bar").css("width", e + "%"),
  14016. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  14017. t.find(".perc").text(e + "%")
  14018. }
  14019. $("#gui-loading").fadeIn(200),
  14020. re(.1);
  14021. var e = g_version ? "modeldata.js" : "someData.json";
  14022. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  14023. dataType: "json"
  14024. }).done(function(e) {
  14025. var t = matcher(e);
  14026. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  14027. t.user = {
  14028. is_authenticated: !1,
  14029. 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"]
  14030. }
  14031. /* t.model.images = [
  14032. {
  14033. "metadata": "{\"camera_position\":{\"x\":0.8559,\"y\":-0.1097,\"z\":0.6656},\"camera_quaternion\":{\"x\":-0.1975,\"y\":-0.0952,\"z\":-0.0193,\"w\":0.9755},\"scan_id\":\"11\",\"zoom\":1}",
  14034. "name": "1",
  14035. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175837426.",
  14036. "sid": "20201210_175837426"
  14037. },
  14038. {
  14039. "metadata": "{\"camera_position\":{\"x\":1.1559,\"y\":-0.1083,\"z\":1.9191},\"camera_quaternion\":{\"x\":-0.0396,\"y\":0.1251,\"z\":0.005,\"w\":0.9913},\"scan_id\":\"12\",\"zoom\":1}",
  14040. "name": "2",
  14041. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175835333.",
  14042. "sid": "20201210_175835333"
  14043. },
  14044. {
  14045. "name": "区域1 hasmusic",
  14046. "momentTour": "black",
  14047. "musicInfo": {
  14048. "name": "一段音乐.mp3",
  14049. "music": "///super.4dage.com/data/LYW/edit/20210425_152844547.mp3",
  14050. "time": 7818
  14051. },
  14052. "locations": [
  14053. {
  14054. "metadata": "{\"camera_position\":{\"x\":-2.4032,\"y\":-0.1215,\"z\":-0.882},\"camera_quaternion\":{\"x\":-0.0898,\"y\":0.9081,\"z\":0.2552,\"w\":0.3196},\"scan_id\":\"5\",\"zoom\":1}",
  14055. "sid": "20210425_152818526",
  14056. "name": "20210425_152818526",
  14057. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152818526."
  14058. }
  14059. ]
  14060. },
  14061. {
  14062. "name": "区域2",
  14063. "momentTour": "black",
  14064. "locations": [
  14065. {
  14066. "metadata": "{\"camera_position\":{\"x\":-1.2063,\"y\":-0.1163,\"z\":0.4791},\"camera_quaternion\":{\"x\":0.0326,\"y\":0.9667,\"z\":0.1605,\"w\":-0.1966},\"scan_id\":\"2\",\"zoom\":1}",
  14067. "sid": "20210425_152857293",
  14068. "name": "20210425_152857293",
  14069. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152857293."
  14070. },
  14071. {
  14072. "metadata": "{\"camera_position\":{\"x\":-0.2906,\"y\":-0.1122,\"z\":-0.2226},\"camera_quaternion\":{\"x\":-0.258,\"y\":-0.3481,\"z\":-0.1003,\"w\":0.8956},\"scan_id\":\"1\",\"zoom\":1}",
  14073. "sid": "20210425_152900502",
  14074. "name": "20210425_152900502",
  14075. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152900502."
  14076. }
  14077. ]
  14078. },
  14079. {
  14080. "metadata": "{\"camera_position\":{\"x\":-1.2063,\"y\":-0.1163,\"z\":0.4791},\"camera_quaternion\":{\"x\":-0.0023,\"y\":-0.8326,\"z\":-0.0034,\"w\":0.5539},\"scan_id\":\"2\",\"zoom\":1}",
  14081. "sid": "20210425_152929593",
  14082. "name": "5",
  14083. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152929593."
  14084. }
  14085. ] */
  14086. try{//处理一下导览数据
  14087. t.model.images = t.model.images.filter(e=>{
  14088. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14089. if(e.locations)e.locations = e.locations.filter(e=>e)
  14090. if(e.locations && e.locations.length == 0)return;
  14091. return e
  14092. })
  14093. }catch(e){console.log(e) }
  14094. window.editTool = new EditTools()
  14095. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  14096. window.DATA = t
  14097. t.model.summary = t.summary
  14098. t.model.name = t.name
  14099. for(let i in t){
  14100. t[i] == "false" && (t[i] = false)
  14101. }
  14102. re(.7),
  14103. function() {
  14104. function y(e) {
  14105. t.update(e)
  14106. }
  14107. function A(e, t) {
  14108. ne.error(t),
  14109. n.error(t),
  14110. N.report(e, "error-" + t)
  14111. }
  14112. function C(e, t, i) {
  14113. try {
  14114. e.start(t)
  14115. } catch (e) {
  14116. throw ne.warn(e.message),
  14117. function(e) {
  14118. var t = O.details();
  14119. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  14120. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  14121. N.report(e, "error-webgl-generic"))
  14122. }(i.sid),
  14123. e
  14124. }
  14125. }
  14126. function I(e) {
  14127. e.stopPropagation(),
  14128. e.preventDefault()
  14129. }
  14130. window.DATA.hoticon && (g_HotImage = {
  14131. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14132. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14133. });
  14134. /* window.DATA.backgroundMusic ? (g_bgAudio.src = window.DATA.backgroundMusic,
  14135. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  14136. */
  14137. if (window.DATA.backgroundMusic) {
  14138. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.DATA.backgroundMusic) ;
  14139. else g_bgAudio.src = window.DATA.backgroundMusic
  14140. $("#volume").show();
  14141. }else if (g_version === "one"){
  14142. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  14143. //g_bgAudio.src = manage.dealURL(src) ;
  14144. }
  14145. //隐藏公司logo
  14146. window.DATA.loadlogo && showLogo();
  14147. r("./lib/three75-shim"),
  14148. r("./lib/array-polyfill"),
  14149. r("./lib/performance-polyfill"),
  14150. r("./lib/shaders/CopyShader.js"),
  14151. r("./lib/shaders/HorizontalBlurShader.js"),
  14152. r("./lib/shaders/VerticalBlurShader.js"),
  14153. r("./lib/postprocessing/EffectComposer.js"),
  14154. r("./lib/postprocessing/RenderPass.js"),
  14155. r("./lib/postprocessing/MaskPass.js"),
  14156. r("./lib/postprocessing/ShaderPass.js"),
  14157. window.Promise || (window.Promise = r("promise-polyfill"));
  14158. var E = r("three")
  14159. , _ = r("three")
  14160. , b = (r("./util/sentry"),
  14161. r("./player"))
  14162. , w = r("./director")
  14163. , T = r("./controls/CameraControls")
  14164. , x = r("./model/ModelManager")
  14165. , S = r("./DisplayController")
  14166. , M = r("./label/LabelDisplayController")
  14167. , R = r("./enum/Viewmode")
  14168. , e = r("./util/logger")
  14169. , P = r("./showcase")
  14170. , O = r("./util/browser")
  14171. , L = r("./settings")
  14172. , D = r("./gui/gui")
  14173. , n = r("./gui/error")
  14174. , N = r("./analytics")
  14175. , F = r("./util/transitions")
  14176. , B = r("./effects")
  14177. , V = r("./objects/Skybox")
  14178. , k = (r("./util/common"),
  14179. r("./util/PanoramaCollection"),
  14180. r("./util/math"),
  14181. r("./util/showcase"))
  14182. , U = r("./util/camera")
  14183. , H = (r("./objects/Panorama"),
  14184. r("./cameras/PanoramaCamera"),
  14185. r("./preloaders"))
  14186. , z = r("events").EventEmitter
  14187. , G = r("./featureflags")
  14188. , W = (r("./util/lerp"),
  14189. r("./util/ajax"),
  14190. r("./ab"))
  14191. , j = r("./sdk/automation.js")
  14192. , Y = r("./scene/SceneRenderer")
  14193. , q = r("./scene/QuickstartManager")
  14194. , X = r("./tile/QualityManager.js")
  14195. , Z = r("./localization/localize")
  14196. , K = r("./tag/tagManager")
  14197. , Q = r("./tile/TileDownloader")
  14198. , J = r("./tile/PanoRenderer")
  14199. , ee = (r("./enum/PanoSizeClass"),
  14200. r("./enum/PanoramaEvents"),
  14201. r("./enum/SceneRendererEvents"))
  14202. , t = r("./gui/memoryUsage")
  14203. , te = r("./enum/RenderLayers")
  14204. , ie = r("./TimingData")
  14205. , ne = new e(i);
  14206. e.level = L.logLevel,
  14207. e.consoleEnabled = L.console,
  14208. function() {
  14209. var e = k.getModelIDFromQueryString();
  14210. if (!e)
  14211. return A(null, "loading-failed");
  14212. var t = k.parseSidUrl(e)
  14213. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14214. , n = {
  14215. panoElementsToLoad: 6,
  14216. modelElementsToLoad: 0,
  14217. totalElementsLoaded: 0,
  14218. totalElementsToLoad: 0,
  14219. totalPercentageLoaded: 0,
  14220. progressCallback: null
  14221. }
  14222. , r = document.getElementById("player")
  14223. , o = L.quickstart.enabled
  14224. , a = null
  14225. , s = null
  14226. , l = null
  14227. , c = null
  14228. , h = null
  14229. , u = null
  14230. , d = null
  14231. , p = null
  14232. , f = null
  14233. , g = null
  14234. , m = null
  14235. , v = new ie;
  14236. !function(e) {
  14237. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14238. z.defaultMaxListeners = 1e3,
  14239. function(e) {
  14240. e.addEventListener("dragenter", I, !1),
  14241. e.addEventListener("dragover", I, !1)
  14242. }(e),
  14243. O.valueFromHash("title", !0) || $(document).ready(function() {
  14244. $(".model-title").hide()
  14245. })
  14246. }(r),
  14247. function(e) {
  14248. return G.loadFeatureFlags(e).done(function(e) {
  14249. G.updateDependentSettings(e, L)
  14250. })
  14251. }({
  14252. urlBase: t.urlBase
  14253. }).then(function() {
  14254. return Z.init(),
  14255. function(e, t) {
  14256. var i = P.getModel({
  14257. url: t,
  14258. floors: O.valueFromHash("f", !0),
  14259. autoload: !1
  14260. });
  14261. return $.when(i, y).then(null, function(e) {
  14262. return this
  14263. })
  14264. }(0, e)
  14265. }).then(function(e) {
  14266. return re(.9),
  14267. function(e, t, i, n, r) {
  14268. ne.info("Model data loaded"),
  14269. ne.debug("UUID: " + e.data.job.uuid),
  14270. W.init(G.getFlags()),
  14271. i && N.initKeen({
  14272. token: i,
  14273. appId: n
  14274. }),
  14275. N.initSegment({
  14276. model: e.sid,
  14277. version: "2.25.6-0-gd87e5b1",
  14278. startSource: r.startSource,
  14279. token: t,
  14280. autoplay: r.autoplay,
  14281. quickstart: r.quickstart
  14282. })
  14283. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14284. startSource: i,
  14285. autoplay: L.autoplay,
  14286. quickstart: o
  14287. }),
  14288. g.urls.init()
  14289. }).then(function() {
  14290. return g.loadPanos()
  14291. }).then(function() {
  14292. s = U.getStartCameraOptions(g, g.panos);
  14293. //初始画面
  14294. window.DATA.camera_start && window.DATA.camera_start.thumbImg && function(e) {
  14295. $("<img/>").attr("src", e).on("load", function() {
  14296. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14297. $(this).remove()
  14298. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14299. })
  14300. }(window.DATA.camera_start.thumbImg);
  14301. d = function(e) {
  14302. var t = new E.PerspectiveCamera;
  14303. t.layers.enable(te.PANOMARKERS),
  14304. t.layers.enable(te.RETICULE),
  14305. t.layers.enable(te.TAG);
  14306. var o = new E.Scene
  14307. , i = new E.AmbientLight(16777215);
  14308. return o.add(i),
  14309. o.skybox = new V,
  14310. o.add(o.skybox),
  14311. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14312. side: E.DoubleSide
  14313. })),
  14314. o.plane.position.y = 0,
  14315. o.plane.rotateX(-Math.PI / 2),
  14316. o.plane.material.visible = !1,
  14317. o.add(o.plane),
  14318. o.updateMatrixWorld(),
  14319. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14320. if (e.metadata && e.metadata.camera_position) {
  14321. var t = e.metadata.camera_position
  14322. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14323. i.position = t.clone(),
  14324. o.add(i);
  14325. var n = e.metadata.camera_quaternion
  14326. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14327. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14328. }
  14329. }),
  14330. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14331. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14332. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14333. new Y(o,t,B)
  14334. }(g),
  14335. m = function(e, t) {
  14336. var i = e ? 1 : 1e3
  14337. , n = W.tilegen || W.imgopt ? 6 : 2;
  14338. n = O.valueFromHash("tileconc", n);
  14339. var r = new X
  14340. , o = new Q({
  14341. concurrentDownloads: n
  14342. })
  14343. , a = new J
  14344. , s = new x
  14345. , l = new w
  14346. , c = new b(t)
  14347. , h = new T
  14348. , u = new S(i)
  14349. , d = new M
  14350. , p = new K;
  14351. return {
  14352. qualityManager: r,
  14353. panoRenderer: a,
  14354. tileDownloader: o,
  14355. player: c,
  14356. director: l,
  14357. modelManager: s,
  14358. tagManager: p,
  14359. displayController: u,
  14360. labelDisplayController: d,
  14361. controls: h
  14362. }
  14363. }(o, s.mode),
  14364. l = m.controls,
  14365. c = m.player,
  14366. h = m.director,
  14367. u = m.tagManager,
  14368. p = m.tileDownloader,
  14369. f = m.qualityManager,
  14370. m.panoRenderer,
  14371. function(e, t, i, n) {
  14372. var r = i.controls
  14373. , o = i.qualityManager
  14374. , a = i.panoRenderer
  14375. , s = i.tileDownloader
  14376. , l = i.modelManager;
  14377. r.init(n, l),
  14378. j.init(i.director, r, i.player, l, t),
  14379. o.init(l),
  14380. s.init(o),
  14381. a.init(t, s, o),
  14382. l.init(s, a, o),
  14383. l.addModel(e),
  14384. t.addComponent(F)
  14385. }(g, d, m, r),
  14386. c.director = h,
  14387. g.supportsTiles && p.start(),
  14388. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14389. o = !1);
  14390. var e = null;
  14391. if (o) {
  14392. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14393. var t = l.controls[R.PANORAMA];
  14394. a = new q(f,d.scene,d.camera,t,r),
  14395. C(d, r, g),
  14396. e = a.load(s).then(function() {
  14397. d.addComponent(a),
  14398. d.once(ee.AfterRender, function() {
  14399. ne.warn("First render after quickstart load finished.")
  14400. })
  14401. })
  14402. }
  14403. return window.flyToFirst = function() {
  14404. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14405. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14406. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14407. c.flyToPano({
  14408. pano: e,
  14409. lookAtPoint: i
  14410. })
  14411. }
  14412. ,
  14413. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14414. }).then(function() {
  14415. return function(e, t, i, n, r) {
  14416. return r.progressCallback = t,
  14417. N.sessionStart(),
  14418. e.load(n).progress(function(e, t) {
  14419. e.modelElementsToLoad = t[1],
  14420. function(e) {
  14421. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14422. }(e),
  14423. function(e) {
  14424. e.totalElementsLoaded++,
  14425. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14426. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14427. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14428. console.log("pro:" + e.totalPercentageLoaded),
  14429. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14430. }(e)
  14431. }
  14432. .bind(this, r))
  14433. }(g, D.onProgress, 0, !o, n)
  14434. }).then(function() {
  14435. s.quickstart = o,
  14436. function(e, t, i, n) {
  14437. var r = i.qualityManager
  14438. , o = i.panoRenderer
  14439. , a = i.tileDownloader
  14440. , s = i.modelManager
  14441. , l = i.player
  14442. , c = i.director
  14443. , h = i.tagManager
  14444. , u = i.displayController
  14445. , d = i.labelDisplayController
  14446. , p = i.controls;
  14447. t.scene.add(e),
  14448. t.qualityManager = r;
  14449. var f = {
  14450. camera: t.camera,
  14451. director: c,
  14452. modelManager: s,
  14453. tileDownloader: a,
  14454. panoRenderer: o,
  14455. qualityManager: r,
  14456. tagManager: h,
  14457. container: n,
  14458. controls: p
  14459. };
  14460. l.init(f),
  14461. l.setScene(t.scene),
  14462. h.init(s, l),
  14463. c.init(l, s),
  14464. u.init(c, l, s, h, n),
  14465. d.init(l, s, n),
  14466. B.bindEvents(l),
  14467. t.addComponent(h),
  14468. t.addComponent(l),
  14469. t.addComponent(o),
  14470. l.sceneRenderer = t
  14471. }(g, d, m, r),
  14472. d.started || C(d, r, g),
  14473. N.modelLoaded(g, c, l, L.autoplay),
  14474. function(e, t, i, n) {
  14475. return ne.info("Starting player in " + i.mode),
  14476. N.report(t.sid, "started-playing", n, i.quickstart),
  14477. e.start(i)
  14478. }(c, g, s, L.autoplay).done(function() {
  14479. h.autoTour()
  14480. }),
  14481. g.supportsTiles || new H(g,c).start();
  14482. o && (d.removeComponent(a),
  14483. a.destroy(),
  14484. s.pano.enter()),
  14485. D.init(g, h, c, l, d, s, N.getSessionId()),
  14486. D.endLoading(g, h, u),
  14487. d.once(ee.AfterRender, function() {
  14488. v.setAppReadyTime();
  14489. var e = v.calcFullLoadingTime();
  14490. ne.warn("Total load time: " + e / 1e3),
  14491. N.loadComplete(e),
  14492. ne.warn("First render after model load finished.");
  14493. editTool.loadDone('data', window.DATA)
  14494. }),
  14495. d.on(ee.MemoryUsageUpdated, y)
  14496. }).fail(A.bind(this, e))
  14497. }()
  14498. }()
  14499. })
  14500. }
  14501. ).call(this, "/js/main.js")
  14502. }
  14503. , {
  14504. "./DisplayController": 1,
  14505. "./TimingData": 2,
  14506. "./ab": 3,
  14507. "./analytics": 4,
  14508. "./cameras/PanoramaCamera": 7,
  14509. "./controls/CameraControls": 9,
  14510. "./director": 15,
  14511. "./effects": 16,
  14512. "./enum/PanoSizeClass": 36,
  14513. "./enum/PanoramaEvents": 37,
  14514. "./enum/RenderLayers": 41,
  14515. "./enum/SceneRendererEvents": 43,
  14516. "./enum/Viewmode": 51,
  14517. "./featureflags": 59,
  14518. "./gui/error": 64,
  14519. "./gui/gui": 65,
  14520. "./gui/memoryUsage": 73,
  14521. "./label/LabelDisplayController": 91,
  14522. "./lib/array-polyfill": 92,
  14523. "./lib/performance-polyfill": 95,
  14524. "./lib/postprocessing/EffectComposer.js": 96,
  14525. "./lib/postprocessing/MaskPass.js": 97,
  14526. "./lib/postprocessing/RenderPass.js": 98,
  14527. "./lib/postprocessing/ShaderPass.js": 99,
  14528. "./lib/shaders/CopyShader.js": 100,
  14529. "./lib/shaders/HorizontalBlurShader.js": 101,
  14530. "./lib/shaders/VerticalBlurShader.js": 102,
  14531. "./lib/three75-shim": 103,
  14532. "./localization/localize": 108,
  14533. "./tag/tagManager": 124,
  14534. "./model/ModelManager": 140,
  14535. "./objects/Panorama": 148,
  14536. "./objects/Skybox": 152,
  14537. "./player": 155,
  14538. "./preloaders": 156,
  14539. "./scene/QuickstartManager": 157,
  14540. "./scene/SceneRenderer": 158,
  14541. "./sdk/automation.js": 164,
  14542. "./settings": 166,
  14543. "./showcase": 168,
  14544. "./tile/PanoRenderer": 169,
  14545. "./tile/QualityManager.js": 170,
  14546. "./tile/TileDownloader": 171,
  14547. "./util/PanoramaCollection": 178,
  14548. "./util/ajax": 181,
  14549. "./util/browser": 182,
  14550. "./util/camera": 183,
  14551. "./util/common": 185,
  14552. "./util/lerp": 188,
  14553. "./util/logger": 189,
  14554. "./util/math": 190,
  14555. "./util/sentry": 192,
  14556. "./util/showcase": 193,
  14557. "./util/transitions": 195,
  14558. events: 202,
  14559. "promise-polyfill": 213,
  14560. three: 217
  14561. }],
  14562. 117: [function(e, t, i) {
  14563. "use strict";
  14564. function n(e) {
  14565. e = e || {},
  14566. r.RawShaderMaterial.call(this, a.extendObject({
  14567. fragmentShader: o.cube.fragmentShader,
  14568. vertexShader: o.cube.vertexShader,
  14569. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14570. name: "CubemapMaterial"
  14571. }, e))
  14572. }
  14573. var r = e("three")
  14574. , o = e("../shaders")
  14575. , a = e("../util/common");
  14576. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14577. t.exports = n
  14578. }
  14579. , {
  14580. "../shaders": 167,
  14581. "../util/common": 185,
  14582. three: 217
  14583. }],
  14584. 118: [function(e, t, i) {
  14585. "use strict";
  14586. function n(e) {
  14587. e = e || {},
  14588. r.RawShaderMaterial.call(this, a.extendObject({
  14589. fragmentShader: o.model.fragmentShader,
  14590. vertexShader: o.model.vertexShader,
  14591. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14592. name: "ModelTextureMaterial"
  14593. }, e))
  14594. }
  14595. var r = e("three")
  14596. , o = e("../shaders")
  14597. , a = e("../util/common");
  14598. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14599. i && (this.uniforms.progress.value = 0),
  14600. e.ensureSkyboxReadyForRender(),
  14601. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14602. this.uniforms.pano0Position.value.copy(e.position),
  14603. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14604. t.ensureSkyboxReadyForRender(),
  14605. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14606. this.uniforms.pano1Position.value.copy(t.position),
  14607. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14608. }
  14609. ,
  14610. t.exports = n
  14611. }
  14612. , {
  14613. "../shaders": 167,
  14614. "../util/common": 185,
  14615. three: 217
  14616. }],
  14617. 119: [function(m, v, e) {
  14618. (function(e) {
  14619. "use strict";
  14620. function t(e, t, i, n) {
  14621. this.div = null,
  14622. this.body = null,
  14623. this.label = e,
  14624. this.description = t,
  14625. this.parsedDescription = [],
  14626. this.media = i || {
  14627. type: null
  14628. },
  14629. this.loadingSpinner = null,
  14630. this.parser = new r({
  14631. supportLinks: !c.valueFromHash("mls"),
  14632. keepLinkLabels: !0
  14633. }),
  14634. this.state = g.CLOSED,
  14635. this.orientation = "",
  14636. this.initialTransform = "",
  14637. this.hovering = !1,
  14638. this.openTransition = null,
  14639. this.closeTransition = null,
  14640. this.openPromise = null,
  14641. this.closePromise = null,
  14642. this.animationTransition = null,
  14643. this.animationScale = 0
  14644. }
  14645. var r = m("../Parser/DescriptionParser")
  14646. , i = m("../Media/Link")
  14647. , n = m("../Media/Image")
  14648. , o = m("../Media/EmbedlyPlayer")
  14649. , a = m("../Media/EmbedlyEmbed")
  14650. , s = m("../../util/transitions")
  14651. , l = m("../../util/lerp")
  14652. , c = m("../../util/browser")
  14653. , b = m("./BillboardEvent")
  14654. , w = m("../Media/MediaEvent")
  14655. , h = m("../Parser/DescriptionChunkType")
  14656. , u = m("events").EventEmitter
  14657. , d = m("./billboardSettings")
  14658. , T = m("./overlaySettings")
  14659. , p = new (m("../../util/logger"))(e)
  14660. , f = document.getElementById("tag-billboards");
  14661. f.addEventListener("touchend", function(e) {
  14662. f.style.pointerEvents = "none"
  14663. }),
  14664. f.addEventListener("touchcancel", function(e) {
  14665. f.style.pointerEvents = "none"
  14666. });
  14667. var g = {
  14668. CLOSED: "closed",
  14669. OPENING: "opening",
  14670. OPEN: "open",
  14671. CLOSING: "closing",
  14672. ACTIVE: "active"
  14673. };
  14674. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14675. this.parsedDescription = this.parser.parse(this.description);
  14676. var t = document.createElement("div");
  14677. t.className = "tag-container has-hotzone",
  14678. this.div = t,
  14679. this.body = document.createElement("div"),
  14680. this.body.className = "tag-body";
  14681. var i = document.createElement("div");
  14682. i.classList.add("tag-content");
  14683. var n = document.createElement("div");
  14684. n.classList.add("tag-text-content");
  14685. var r = document.createElement("div");
  14686. r.className = "tag-label",
  14687. r.textContent = this.label,
  14688. n.appendChild(r);
  14689. var o = document.createElement("div");
  14690. o.className = "tag-desc",
  14691. n.appendChild(o),
  14692. i.appendChild(n),
  14693. this.body.appendChild(i),
  14694. this.appendDescriptionElements(this.parsedDescription, o),
  14695. this.appendMedia(),
  14696. t.appendChild(this.body),
  14697. f.appendChild(t),
  14698. this.bindEvents(t, this.body)
  14699. }
  14700. ,
  14701. t.prototype.bindEvents = function(i, e) {
  14702. function t(n) {
  14703. return function(e) {
  14704. if (!this.div.classList.contains("overlay")) {
  14705. var t, i = document.getElementById("player");
  14706. try {
  14707. t = new MouseEvent(n,e)
  14708. } catch (i) {
  14709. (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)
  14710. }
  14711. i.dispatchEvent(t)
  14712. }
  14713. }
  14714. }
  14715. e.addEventListener("mousedown", function(e) {
  14716. e.stopPropagation()
  14717. }),
  14718. e.addEventListener("mouseup", function(e) {
  14719. e.stopPropagation()
  14720. }),
  14721. i.addEventListener("touchstart", function(e) {
  14722. f.style.pointerEvents = "auto"
  14723. }),
  14724. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14725. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14726. e.addEventListener("mouseover", function(e) {
  14727. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14728. }
  14729. .bind(this)),
  14730. i.addEventListener("mouseenter", function(e) {
  14731. this.state !== g.CLOSING && (this.hovering = !0,
  14732. this.emit(b.ENTER))
  14733. }
  14734. .bind(this)),
  14735. i.addEventListener("mouseleave", function(e) {
  14736. this.hovering = !1,
  14737. this.emit(b.LEAVE)
  14738. }
  14739. .bind(this)),
  14740. i.addEventListener("gesturestart", function(e) {
  14741. e.preventDefault()
  14742. });
  14743. var n = i.querySelector(".tag-text-content")
  14744. , r = 0;
  14745. n.addEventListener("touchstart", function(e) {
  14746. r = e.changedTouches[0].clientY
  14747. }),
  14748. n.addEventListener("touchmove", function(t) {
  14749. function e(e) {
  14750. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14751. }
  14752. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14753. }),
  14754. i.addEventListener("touchmove", function(e) {
  14755. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14756. })
  14757. }
  14758. ,
  14759. t.prototype.appendDescriptionElements = function(e, i) {
  14760. 0 < e.length && this.div.classList.add("has-text"),
  14761. e.forEach(function(e, t) {
  14762. switch (e.type) {
  14763. case h.TEXT:
  14764. i.appendChild(this.createTextElement(e.text));
  14765. break;
  14766. case h.LINK:
  14767. i.appendChild(this.createLinkElement(e.link))
  14768. }
  14769. }
  14770. .bind(this))
  14771. }
  14772. ,
  14773. t.prototype.appendLoadingSpinner = function() {
  14774. this.loadingSpinner = document.createElement("div"),
  14775. this.loadingSpinner.classList.add("loading-spinner");
  14776. var e = document.createElement("div");
  14777. e.classList.add("gui-spinner-icon"),
  14778. this.loadingSpinner.appendChild(e),
  14779. this.body.appendChild(this.loadingSpinner)
  14780. }
  14781. ,
  14782. t.prototype.onMediaLoadFinished = function() {
  14783. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14784. this.applyOrientation(this.orientation),
  14785. this.loadingSpinner = null)
  14786. }
  14787. ,
  14788. t.prototype.appendMedia = function() {
  14789. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14790. this.appendLoadingSpinner();
  14791. var e = document.createElement("div");
  14792. e.classList.add("tag-media-content");
  14793. var t = document.createElement("i");
  14794. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14795. t.classList.add(e)
  14796. }),
  14797. this.body.appendChild(t),
  14798. this.body.appendChild(e),
  14799. this.media.type) {
  14800. case h.IMAGE:
  14801. e.appendChild(this.createImageElement(this.media, this.body));
  14802. break;
  14803. case h.VIDEO:
  14804. e.appendChild(this.createVideoElement(this.media, this.body));
  14805. break;
  14806. case h.RICH:
  14807. e.appendChild(this.createEmbedElement(this.media, this.body))
  14808. }
  14809. }
  14810. }
  14811. ,
  14812. t.prototype.createTextElement = function(e) {
  14813. var t = document.createElement("span");
  14814. return t.textContent = e,
  14815. t
  14816. }
  14817. ,
  14818. t.prototype.createLinkElement = function(e) {
  14819. var t = new i(e);
  14820. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14821. t.createDomElement()
  14822. }
  14823. ,
  14824. t.prototype.createImageElement = function(t, C) {
  14825. function e() {
  14826. function e() {
  14827. p || (E.classList.remove("view-image"),
  14828. a.classList.add("overlay"),
  14829. t(),
  14830. window.addEventListener("resize", A),
  14831. a.addEventListener("click", i),
  14832. c.addEventListener("click", r),
  14833. o.addEventListener("click", n),
  14834. p = !0,
  14835. _.emit(w.IMAGE_OPENED))
  14836. }
  14837. function t() {
  14838. C.classList.add("show-info"),
  14839. s.classList.remove("collapsible"),
  14840. s.style.height = "";
  14841. var e = parseFloat(getComputedStyle(v).lineHeight)
  14842. , t = g + e
  14843. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14844. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14845. , r = n
  14846. , o = r * I.aspect;
  14847. i < o && (r = (o = i) / I.aspect),
  14848. n < r && (o = (r = n) * I.aspect),
  14849. o += m,
  14850. r += m + t,
  14851. C.style.width = o + "px",
  14852. C.style.height = r + "px",
  14853. l.style.paddingTop = e + m + "px",
  14854. 0 < _.description.length && (s.classList.add("collapsible"),
  14855. s.style.height = s.clientHeight + 12 + "px",
  14856. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14857. }
  14858. function i(e) {
  14859. e.target === a && n()
  14860. }
  14861. function n() {
  14862. p && (p = !1,
  14863. E.classList.add("view-image"),
  14864. a.classList.remove("overlay"),
  14865. s.style.height = "",
  14866. l.style.paddingTop = "",
  14867. C.style.width = "",
  14868. C.style.height = "",
  14869. window.removeEventListener("resize", A),
  14870. a.removeEventListener("click", i),
  14871. c.removeEventListener("click", r),
  14872. o.removeEventListener("click", n),
  14873. _.emit(w.IMAGE_CLOSED),
  14874. _.close(!0))
  14875. }
  14876. function r(e) {
  14877. C.classList.toggle("show-info")
  14878. }
  14879. var a = _.div
  14880. , s = a.getElementsByClassName("tag-content")[0]
  14881. , l = a.getElementsByClassName("tag-media-content")[0]
  14882. , o = C.getElementsByClassName("close")[0]
  14883. , c = s.getElementsByClassName("tag-label")[0];
  14884. a.classList.add("has-image"),
  14885. E.classList.add("view-image"),
  14886. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14887. _.applyOrientation(_.orientation);
  14888. 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,
  14889. function() {
  14890. clearInterval(h),
  14891. clearTimeout(u),
  14892. h = setInterval(function() {
  14893. var e = a.clientHeight;
  14894. d !== e && (t(),
  14895. d = e)
  14896. }, 100),
  14897. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14898. }
  14899. );
  14900. I.on(w.IMAGE_OPENING, e),
  14901. _.on(b.ACTIVATE, e),
  14902. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14903. _.on(b.CLOSING, n)
  14904. }
  14905. var I = new n
  14906. , E = I.createDomElement();
  14907. this.once(b.OPENED, function() {
  14908. I.load(t.src).then(e).catch(function(e) {
  14909. p.warn("Failed to load image:", t.src),
  14910. p.warn("with error:", e)
  14911. }).then(this.onMediaLoadFinished.bind(this))
  14912. });
  14913. var _ = this;
  14914. return E
  14915. }
  14916. ,
  14917. t.prototype.createVideoElement = function(t, e) {
  14918. var i = new o({
  14919. autoPlay: !0,
  14920. autoResume: !0,
  14921. startMuted: !1,
  14922. loop: !1
  14923. })
  14924. , n = i.createDomElement();
  14925. return this.once(b.OPENED, function() {
  14926. i.load(t.src).then(function() {
  14927. this.div.classList.add("has-video"),
  14928. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14929. i.play()),
  14930. this.on(b.OPENING, i.show.bind(i)),
  14931. this.on(b.OPENED, i.play.bind(i)),
  14932. this.on(b.CLOSING, i.pause.bind(i)),
  14933. this.on(b.CLOSED, i.hide.bind(i))
  14934. }
  14935. .bind(this)).catch(function(e) {
  14936. p.warn("Failed to embed video:", t.src),
  14937. p.warn("with error:", e)
  14938. }).then(this.onMediaLoadFinished.bind(this))
  14939. }
  14940. .bind(this)),
  14941. n
  14942. }
  14943. ,
  14944. t.prototype.createEmbedElement = function(t, e) {
  14945. var i = new a
  14946. , n = i.createDomElement();
  14947. return this.once(b.OPENED, function() {
  14948. i.load(t.src).then(function() {
  14949. this.div.classList.add("has-embed"),
  14950. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14951. this.applyOrientation(this.orientation),
  14952. this.on(b.OPENING, i.show.bind(i)),
  14953. this.on(b.CLOSED, i.hide.bind(i))
  14954. }
  14955. .bind(this)).catch(function(e) {
  14956. p.warn("Failed to embed:", t.src),
  14957. p.warn("with error:", e)
  14958. }).then(this.onMediaLoadFinished.bind(this))
  14959. }
  14960. .bind(this)),
  14961. n
  14962. }
  14963. ,
  14964. t.prototype.open = function(e) {
  14965. return this.openPromise = $.Deferred(),
  14966. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14967. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14968. this.state !== g.OPEN && (this.emit(b.OPENING),
  14969. e && this.emit(b.ACTIVATING),
  14970. this.state = g.OPENING,
  14971. this.animateOpen(function() {
  14972. e && this.setActiveState(),
  14973. this.openPromise.resolve()
  14974. }
  14975. .bind(this)))
  14976. }
  14977. .bind(this), d.animation.openDelay),
  14978. s.cancel(this.closeTransition),
  14979. this.closePromise && this.closePromise.reject(),
  14980. this.closeTransition = void 0,
  14981. this.openPromise.promise())
  14982. }
  14983. ,
  14984. t.prototype.close = function(e) {
  14985. return this.closePromise = $.Deferred(),
  14986. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14987. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14988. this.state = g.CLOSING,
  14989. this.animateClose())
  14990. }
  14991. .bind(this), d.animation.closeDelay)),
  14992. s.cancel(this.openTransition),
  14993. this.openPromise && this.openPromise.reject(),
  14994. this.openTransition = void 0,
  14995. this.closePromise.resolve(),
  14996. this.closePromise.promise())
  14997. }
  14998. ,
  14999. t.prototype.setActiveState = function() {
  15000. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  15001. this.emit(b.ACTIVATE),
  15002. this.div.classList.remove("has-hotzone"))
  15003. }
  15004. ,
  15005. t.prototype.animateOpen = function(e) {
  15006. if (this.state === g.OPENING) {
  15007. if (s.cancel(this.animationTransition),
  15008. c.detectSamsungNative())
  15009. return this.boardOrientation = null,
  15010. this.div.style.visibility = "visible",
  15011. this.emit(b.OPENED),
  15012. this.state = g.OPEN,
  15013. void (e && e());
  15014. this.div.style.webkitTransform = "scale(0)",
  15015. this.div.style.transform = "scale(0)",
  15016. this.div.style.visibility = "visible",
  15017. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  15018. this.emit(b.OPENED),
  15019. this.state = g.OPEN,
  15020. e && e()
  15021. }
  15022. .bind(this))
  15023. }
  15024. }
  15025. ,
  15026. t.prototype.animateClose = function(e) {
  15027. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  15028. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  15029. this.emit(b.CLOSED),
  15030. this.state = g.CLOSED,
  15031. this.div.style.visibility = "hidden",
  15032. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15033. e && e()
  15034. }
  15035. .bind(this)))
  15036. }
  15037. ,
  15038. t.prototype.needsUpdate = function() {
  15039. return this.state !== g.CLOSED
  15040. }
  15041. ,
  15042. t.prototype.update = function(e, t) {
  15043. if (this.needsUpdate()) {
  15044. var i = (this.updateOrientation(e),
  15045. this.calcScale(t))
  15046. , n = {
  15047. x: (e.x + 1) * $("#player").width() / 2,
  15048. y: (e.y + 1) * $("#player").height() / 2
  15049. };
  15050. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15051. this.div.style.webkitTransform = this.div.screenTransform,
  15052. this.div.style.transform = this.div.screenTransform
  15053. }
  15054. }
  15055. ,
  15056. t.prototype.getDimensions = function() {
  15057. return this.div.getBoundingClientRect()
  15058. }
  15059. ,
  15060. t.prototype.calcScale = function(e) {
  15061. return Math.sqrt(e / 40) * d.boardToDiscRatio
  15062. }
  15063. ,
  15064. t.prototype.updateOrientation = function(e) {
  15065. if (this.state !== g.ACTIVE) {
  15066. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  15067. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  15068. , n = "";
  15069. n += 0 == i ? "right" : 2 == i ? "left" : "",
  15070. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  15071. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  15072. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15073. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  15074. }
  15075. }
  15076. ,
  15077. t.prototype.applyOrientation = function(e) {
  15078. this.div.style.transform = this.div.style.webkitTransform = "",
  15079. this.div.classList.remove("tag-container-" + this.orientation),
  15080. this.div.classList.add("tag-container-" + e);
  15081. var t = window.getComputedStyle(this.div);
  15082. this.initialTransform = t.transform || t.webkitTransform,
  15083. "none" === this.initialTransform && (this.initialTransform = "");
  15084. var i = t.transform.slice(7, -1).split(",")
  15085. , n = -i[4]
  15086. , r = -i[5];
  15087. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15088. this.div.style.transformOrigin = n + "px " + r + "px",
  15089. this.orientation = e
  15090. }
  15091. ,
  15092. v.exports = t
  15093. }
  15094. ).call(this, "/js/tag/Billboard/Billboard.js")
  15095. }
  15096. , {
  15097. "../../util/browser": 182,
  15098. "../../util/lerp": 188,
  15099. "../../util/logger": 189,
  15100. "../../util/transitions": 195,
  15101. "../Media/EmbedlyEmbed": 125,
  15102. "../Media/EmbedlyPlayer": 126,
  15103. "../Media/Image": 128,
  15104. "../Media/Link": 129,
  15105. "../Media/MediaEvent": 131,
  15106. "../Parser/DescriptionChunkType": 133,
  15107. "../Parser/DescriptionParser": 134,
  15108. "./BillboardEvent": 120,
  15109. "./billboardSettings": 121,
  15110. "./overlaySettings": 122,
  15111. events: 202
  15112. }],
  15113. 120: [function(e, t, i) {
  15114. "use strict";
  15115. t.exports = Object.freeze({
  15116. ENTER: "billboard.enter",
  15117. LEAVE: "billboard.leave",
  15118. OPENING: "billboard.opening",
  15119. OPENED: "billboard.open",
  15120. CLOSING: "billboard.closing",
  15121. CLOSED: "billboard.closed",
  15122. ACTIVATING: "billboard.activating",
  15123. ACTIVATE: "billboard.activate"
  15124. })
  15125. }
  15126. , {}],
  15127. 121: [function(e, t, i) {
  15128. "use strict";
  15129. t.exports = Object.freeze({
  15130. animation: Object.freeze({
  15131. hoverOnClosing: !1,
  15132. openDelay: 100,
  15133. closeDelay: 50,
  15134. openDuration: 200,
  15135. closeDuration: 100
  15136. }),
  15137. boardToDiscRatio: 1.2
  15138. })
  15139. }
  15140. , {}],
  15141. 122: [function(e, t, i) {
  15142. "use strict";
  15143. t.exports = Object.freeze({
  15144. boundaryWidth: 30,
  15145. boundaryHeight: 0
  15146. })
  15147. }
  15148. , {}],
  15149. hot: [function(e, t, i) {
  15150. "use strict";
  15151. function n(e, t, i) {
  15152. this.sid = e,
  15153. this.position = this.convertValue(t.position, g.Vector3)
  15154. if(t.quaternion){
  15155. this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
  15156. }else{
  15157. this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
  15158. }
  15159. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  15160. this.isSprite = t.isSprite || 0
  15161. this.actionType = (t.noAction ? 'noAction' : t.actionType ) || "common"
  15162. this.linkType = t.linkType || "common"
  15163. this.link = t.link,
  15164. this.model = i,
  15165. this.size = t.size;
  15166. this.styleImg = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img,会经常改变
  15167. this.infoAttribute = t.infoAttribute || {};
  15168. this.transformAtPanos = t.transformAtPanos || {}
  15169. for (let i in this.transformAtPanos) {
  15170. this.transformAtPanos[i].pos = new THREE.Vector3().fromArray(this.transformAtPanos[i].pos)
  15171. this.transformAtPanos[i].qua && (this.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(this.transformAtPanos[i].qua))
  15172. }
  15173. this.build()
  15174. this.setFromInfo()
  15175. this.changeTex()
  15176. this.visibleData = t.visiblePanos
  15177. //this.setVisiblePanos(t.visiblePanos );
  15178. }
  15179. var g = e("three")
  15180. , r = e("../shaders")
  15181. , m = e("../settings")
  15182. , v = e("../enum/Viewmode")
  15183. , d = e("../objects/Panorama")
  15184. , o = e("../util/texture")
  15185. , math = e("../util/math")
  15186. , p = new g.Raycaster
  15187. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  15188. var defaultTex1 = o.load(g_HotImage.point);
  15189. var defaultTex2 = o.load(g_HotImage.point2)
  15190. //dealMap(defaultTex1)
  15191. //dealMap(defaultTex2)
  15192. n.prototype.setFromInfo = function(){ //初始化或恢复
  15193. var info = this.infoAttribute
  15194. this.setTitleElem(info.title)
  15195. this.transformAtPanos = info.transformAtPanos || this.transformAtPanos
  15196. var curPanoTransform = this.transformAtPanos[ getTransformSid()] || {}
  15197. var pos = curPanoTransform.pos || info.position
  15198. pos && this.mesh.position.copy(pos)
  15199. info.position && this.position.copy(info.position) //this.position记录全局position
  15200. var isSprite = info.isSprite != void 0 ? info.isSprite : this.isSprite
  15201. if(!isSprite){
  15202. var qua = curPanoTransform.qua || info.quaternion
  15203. qua && this.mesh.quaternion.copy(qua)
  15204. }
  15205. info.quaternion && this.quaternion.copy(info.quaternion) //this.quaternion记录全局quaternion
  15206. var s = parseFloat(info.hotIconScale || window.DATA.hotIconScale )
  15207. s && this.mesh.scale.set(s, s, s)
  15208. this.isSprite = isSprite
  15209. this.actionType = info.actionType != void 0 ? info.actionType : this.actionType
  15210. this.linkType = info.linkType != void 0 ? info.linkType : this.linkType
  15211. this.initStyleImg()
  15212. }
  15213. n.prototype.changeTex = function(styleImg){
  15214. var u = this.mesh.material.uniforms
  15215. var styleImg = styleImg || this.styleImg
  15216. if(styleImg.length){
  15217. u.texture1.value = o.load(styleImg[0].src);
  15218. u.texture2.value = o.load(styleImg[1]&&styleImg[1].src || styleImg[0].src);
  15219. }else{
  15220. u.texture1.value = defaultTex1;
  15221. u.texture2.value = defaultTex2;
  15222. }
  15223. this.styleImg = styleImg
  15224. }
  15225. n.prototype.initStyleImg = function(){
  15226. var t = this.infoAttribute;
  15227. this.styleImg = []
  15228. t.styleImg = t.styleImg || [];
  15229. t.styleImg.forEach((src)=>{
  15230. //src = src.src || src
  15231. this.styleImg.push({src:manage.dealURL(src)})
  15232. })
  15233. this.changeTex()
  15234. }
  15235. n.prototype.update = function(camera) {
  15236. if(this.isSprite){
  15237. this.mesh.quaternion.copy(camera.quaternion)
  15238. }
  15239. }
  15240. n.prototype.setVisiblePanos = function(visibleData ){
  15241. if(visibleData == "get"){
  15242. this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
  15243. }else if(visibleData){
  15244. this.visiblePanos = visibleData;
  15245. }
  15246. /* this.visiblePanos = [];
  15247. this.model.panos.list.forEach((pano)=>{//考虑到热点可以移动,不好重新设置,还是不根据模型遮挡来初始化了,默认全部可见
  15248. if(visibleData && !visibleData.includes(pano.id))return;
  15249. var isShelter = convertTool.ifIntersectChunks(pano.position, this.position, {model: this.model.colliders});
  15250. if(!isShelter){
  15251. this.visiblePanos.push(pano.id)
  15252. }
  15253. }) */
  15254. }
  15255. n.prototype.build = function() {
  15256. var t = g.UniformsUtils.clone(r.hot.uniforms);
  15257. var e = new g.Mesh(a, new g.ShaderMaterial({
  15258. uniforms: t,
  15259. vertexShader: r.hot.vertexShader,
  15260. fragmentShader: r.hot.fragmentShader,
  15261. transparent: !0
  15262. }))
  15263. e.dynamic = !0, //?
  15264. e.position.copy(this.position);
  15265. e.quaternion.copy(this.quaternion)
  15266. e.name = this.sid,
  15267. e.type = "hotSprite",
  15268. (e.belongHot = this).link && (e.hotLink = this.link),
  15269. this.mesh = e,
  15270. this.model.add(e),
  15271. g_HotMeshes.push(e);
  15272. }
  15273. n.prototype.setTitleElem = function(){
  15274. var root = $("#hot");
  15275. var title = this.infoAttribute.title;
  15276. if(title){
  15277. if(!this.titleElem){
  15278. var elem = $(`<div></div>`)
  15279. root.append(elem);
  15280. this.titleElem = elem;
  15281. }
  15282. this.titleElem.text(title)
  15283. }else{
  15284. if(this.titleElem){
  15285. this.titleElem.remove()
  15286. this.titleElem = null;
  15287. }
  15288. }
  15289. }
  15290. n.prototype.showTitle = function(){
  15291. if(!this.titleElem)return;
  15292. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15293. if(pos.trueSide){//inSight
  15294. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15295. this.titleElem.css("display","block");
  15296. }else{
  15297. this.titleElem.css("display","none");
  15298. }
  15299. }
  15300. n.prototype.hideTitle = function(){
  15301. if(!this.titleElem)return;
  15302. this.titleElem.css("display","none");
  15303. }
  15304. ,
  15305. n.prototype.closestPanoTowardTag = function(e, t) {
  15306. var i = []
  15307. , n = []
  15308. , r = this.mesh.position;
  15309. if (e === v.PANORAMA) {
  15310. var o = t.position.clone().sub(r).normalize();
  15311. n.push(d.scoreFunctions.direction(r, o))
  15312. }
  15313. var a = new g.Vector3;
  15314. i.push(function(e) {
  15315. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  15316. }, function(e) {
  15317. a.copy(r).sub(e.position);
  15318. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15319. , i = m.tags.navigate.tiltTolerance;
  15320. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  15321. },
  15322. (pano)=>{ // add
  15323. return player.checkHasNeighbor(pano)
  15324. }
  15325. ),
  15326. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  15327. var s = t.model.panos.sortByScore(i, n);
  15328. if (s && m.tags.navigate.lineOfSight) {
  15329. for (var l = 0; l < s.length; l++) {
  15330. var c = s[l].pano
  15331. , h = c.position.distanceTo(r);
  15332. p.set(c.position, r.clone().sub(c.position).normalize());
  15333. var u = p.intersectObjects(t.model.colliders);
  15334. if (0 === u.length || u[0].distance > h)
  15335. return console.log(l),
  15336. c
  15337. }
  15338. return null
  15339. }
  15340. return s && 0 < s.length && s[0].pano
  15341. }
  15342. var getLink = function(link){
  15343. var src = '';
  15344. var r = link.substring(link.indexOf("html") + 4)
  15345. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  15346. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  15347. return src
  15348. }
  15349. n.prototype.examine = function(e, options) {
  15350. options = options || {}
  15351. if(this.actionType == 'noAction')return
  15352. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  15353. var src = getLink(this.infoAttribute.iframe[0]);
  15354. if(this.linkType=="jumpLink"){
  15355. var newPage = window.open(src, "_blank" );
  15356. newPage.focus();
  15357. }else if(this.linkType=="iframeDiv"){
  15358. var div = document.createElement("div");
  15359. $("body").append(div);
  15360. div.style.position = 'fixed';
  15361. div.style.width = div.style.height = "100%";
  15362. div.style.left = div.style.top = '0';
  15363. div.style["z-index"] = "999"
  15364. var exit = document.createElement("div");
  15365. exit.style["background-image"] = "url(images/vrOffImg.png)";
  15366. exit.style.position = 'absolute';
  15367. exit.style.width = exit.style.height = "50px";
  15368. exit.style.left = '17px'; exit.style.top = "20px"
  15369. exit.style.cursor = "pointer";
  15370. exit.style["background-repeat"] = "no-repeat";
  15371. exit.style["background-size"] = "25%";
  15372. exit.style["background-position"] = "center center";
  15373. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  15374. exit.style["border-radius"] = "50%";
  15375. exit.style["z-index"] = "3"
  15376. exit.onclick = ()=>{
  15377. $(div).remove()
  15378. if(g_bgAudio && g_bgAudio.pauseByHot){
  15379. manage.switchBgmState(true)
  15380. }
  15381. }
  15382. var myElement = document.createElement("iframe");
  15383. myElement.style.position = 'absolute';
  15384. myElement.style.width = myElement.style.height = "100%";
  15385. myElement.style.left = myElement.style.top = '0';
  15386. myElement.src = src
  15387. div.appendChild(exit);
  15388. div.appendChild(myElement)
  15389. if(g_bgAudio && !g_bgAudio.paused){
  15390. manage.switchBgmState(false);
  15391. g_bgAudio.pauseByHot = true
  15392. }
  15393. if(g_tourAudio)g_tourAudio.pause()
  15394. }
  15395. return;
  15396. }
  15397. if(settings.dontExamHot || this.actionType == 'dontExam'){
  15398. o();
  15399. return;
  15400. }
  15401. if(!player.currentPano)return;
  15402. var i = document.getElementById("popup");
  15403. if (this.link && !options.dontOpen) {
  15404. g_currentHot = this,
  15405. i.style.display = "block",
  15406. i.classList.add("wait");
  15407. var n = document.createElement("iframe");
  15408. if(g_bgAudio && !g_bgAudio.paused){
  15409. manage.switchBgmState(false);
  15410. g_bgAudio.pauseByHot = true
  15411. }
  15412. if(g_tourAudio)g_tourAudio.pause()
  15413. var src = getLink(this.link )
  15414. n.src = src;
  15415. n.id = "id1",
  15416. n.allowTransparency = "true";
  15417. var a = document.getElementById("id1");
  15418. if (void 0 === a || null == a) {
  15419. document.querySelector(".popup-content").appendChild(n);
  15420. var s = !1;
  15421. window.loaddingSuccess = function() {
  15422. s = !0
  15423. }
  15424. ,
  15425. setTimeout(function e() {
  15426. if (s) {
  15427. var t = document.querySelector("#id1").contentWindow.document;
  15428. t.querySelector("video") && (t.querySelector("video").play(),
  15429. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  15430. t.querySelector("audio") && t.querySelector("audio").play()
  15431. } else
  15432. setTimeout(e, 300)
  15433. }, 800)
  15434. }
  15435. }
  15436. var l = e.mode
  15437. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  15438. , h = this.mesh.position;
  15439. e.flyingToTag = !0;
  15440. var u = function() {
  15441. e.flyingToTag = !1;
  15442. options.dontOpen || this.link && i.classList.remove("wait")
  15443. }
  15444. .bind(this);
  15445. if (l === v.PANORAMA) {
  15446. var d = {
  15447. pano: c,
  15448. lookAtPoint: h,
  15449. duration: options.duration,
  15450. maxDistanceOverride: null,
  15451. skipWarpingCheck: !1,
  15452. aimDuration: options.aimDuration,
  15453. };
  15454. e.flyToPano(d, u)
  15455. } else {
  15456. var p = {
  15457. pano: c
  15458. };
  15459. if (h) {
  15460. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  15461. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  15462. }
  15463. p.callback = u,
  15464. p.duration = options.duration || 1500,
  15465. p.mode = v.PANORAMA,
  15466. p.aimDuration = options.aimDuration
  15467. e.flyToNewMode(p)
  15468. }
  15469. }
  15470. ,
  15471. n.prototype.dispose = function(){
  15472. this.mesh.parent.remove(this.mesh);
  15473. var index = g_HotMeshes.indexOf(this.mesh);
  15474. g_HotMeshes.splice(index,1)
  15475. }
  15476. /* n.prototype.conversionArray = function(e) {
  15477. if ("[object Array]" == Object.prototype.toString.call(e))
  15478. return e;
  15479. var t = [];
  15480. for (var i in e)
  15481. t.push(parseFloat(e[i]));
  15482. return t
  15483. } */
  15484. n.prototype.convertValue = function(v ,Type){
  15485. var value;
  15486. if(v instanceof Array){
  15487. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15488. value = new Type().fromArray(v);
  15489. }else{
  15490. for(let i in v){v[i] = parseFloat(v[i])}
  15491. value = new Type().copy(v);
  15492. }
  15493. return value
  15494. }
  15495. ,
  15496. t.exports = n
  15497. }
  15498. , {
  15499. three: 217,
  15500. "../shaders": 167,
  15501. "../enum/Viewmode": 51,
  15502. "../objects/Panorama": 148,
  15503. "../util/texture": 194,
  15504. "../settings": 166,
  15505. "../util/math": 190,
  15506. }],
  15507. 123: [function(M, R, e) {
  15508. (function(e) {
  15509. "use strict";
  15510. function d(e, t, i) {
  15511. var n = i.version || "0";
  15512. "0" !== n && w.info("tag defined using version " + n),
  15513. this.model = e,
  15514. this.sid = t,
  15515. this.color = (new f.Color).set(i.color || o.tagDefault),
  15516. this.hoverColor = o._darken(this.color, .2),
  15517. this.floor = null,
  15518. this.floorIndex = i.floor,
  15519. this.mode = m.PANORAMA,
  15520. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15521. this.obj3d = null,
  15522. this.disc = null,
  15523. this.materials = {
  15524. disc: null,
  15525. pole: null
  15526. },
  15527. this.position = (new f.Vector3).copy(i.position),
  15528. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15529. this.discWorldPosition = null,
  15530. this.discScale = .05,
  15531. this.poleEnabled = i.stem.enabled,
  15532. this.billboard = new r(i.label,i.description,i.media,this),
  15533. this.visibleTransition = null,
  15534. this.hoveringDisc = !1
  15535. }
  15536. 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"),
  15537. 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);
  15538. d.prototype = Object.create(b.prototype),
  15539. d.raycaster = new f.Raycaster,
  15540. d.prototype.bindEvents = function() {
  15541. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15542. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15543. }
  15544. ,
  15545. d.prototype.build = function() {
  15546. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15547. this.floor && (this.billboard.build(this.model.sid),
  15548. this.obj3d = this.buildObject3D(),
  15549. this.floor.add(this.obj3d)),
  15550. this
  15551. }
  15552. ,
  15553. d.prototype.buildObject3D = function() {
  15554. var e = new f.Object3D;
  15555. e.position.copy(this.position);
  15556. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15557. t.bg.value = x,
  15558. t.mask.value = T,
  15559. t.color.value.copy(this.color),
  15560. this.materials.disc = new f.RawShaderMaterial({
  15561. transparent: !0,
  15562. vertexShader: A.tagDisc.vertexShader,
  15563. fragmentShader: A.tagDisc.fragmentShader,
  15564. uniforms: t
  15565. }),
  15566. this.disc = new f.Mesh(S,this.materials.disc),
  15567. this.disc.layers.set(a.TAG),
  15568. this.disc.position.copy(this.discPosition),
  15569. this.disc.renderOrder = s.tagDisc;
  15570. var i = (this.disc.tag = this).buildPole();
  15571. return i.layers.set(a.TAG),
  15572. i.renderOrder = s.tagStem,
  15573. e.add(i),
  15574. e.layers.set(a.TAG),
  15575. e.add(this.disc)
  15576. }
  15577. ,
  15578. d.prototype.buildPole = function() {
  15579. var e = new f.BufferGeometry
  15580. , t = new Float32Array(6);
  15581. return t[0] = t[1] = t[2] = 0,
  15582. t[3] = this.discPosition.x,
  15583. t[4] = this.discPosition.y,
  15584. t[5] = this.discPosition.z,
  15585. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15586. this.materials.pole = new f.LineBasicMaterial({
  15587. linewidth: g.tags.pole.width,
  15588. color: g.tags.pole.color,
  15589. opacity: 0,
  15590. visible: this.poleEnabled,
  15591. transparent: !0,
  15592. depthWrite: !1
  15593. }),
  15594. new f.Line(e,this.materials.pole)
  15595. }
  15596. ,
  15597. d.prototype.setFreeState = function(e) {
  15598. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15599. this.materials.disc.uniforms.color.value = this.color
  15600. }
  15601. .bind(this))
  15602. }
  15603. ,
  15604. d.prototype.setHoverState = function(e) {
  15605. this.billboard.open(e),
  15606. this.materials.disc.uniforms.color.value = this.hoverColor
  15607. }
  15608. ,
  15609. d.prototype.hide = function(e, t) {
  15610. var i = $.Deferred();
  15611. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15612. return i.resolve().promise();
  15613. e = e || 0,
  15614. t = t || 0,
  15615. C.cancel(this.visibleTransition);
  15616. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15617. return this.visibleTransition = C.start((n = this,
  15618. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15619. o = I.property(n.materials.pole, "opacity", 0),
  15620. function(e) {
  15621. r(e),
  15622. n.materials.pole && o(e)
  15623. }
  15624. ), s * a, function() {
  15625. i.resolve()
  15626. }, l, E[g.warp.blendEasing]),
  15627. i.promise()
  15628. }
  15629. ,
  15630. d.prototype.show = function(e, t) {
  15631. var i = $.Deferred();
  15632. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15633. return i.resolve().promise();
  15634. e = e || 0,
  15635. t = t || 0,
  15636. C.cancel(this.visibleTransition);
  15637. 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;
  15638. return this.visibleTransition = C.start((n = this,
  15639. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15640. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15641. function(e) {
  15642. r(e),
  15643. n.materials.pole && o(e)
  15644. }
  15645. ), s * a, function() {
  15646. i.resolve()
  15647. }, l, E[g.warp.blendEasing]),
  15648. i.promise()
  15649. }
  15650. ,
  15651. d.prototype.closestPanoTowardTag = function(e, t) {
  15652. var i = []
  15653. , n = []
  15654. , r = this.disc.getWorldPosition();
  15655. if (e === m.PANORAMA) {
  15656. var o = t.position.clone().sub(r).normalize();
  15657. i.push(y.filters.isPanoAligned()),
  15658. i.push(y.filters.inPanoDirection(r, o, .5)),
  15659. i.push(y.filters.isNeighbourPanoTo(t)),
  15660. n.push(y.scoreFunctions.direction(r, o))
  15661. }
  15662. var a = new f.Vector3;
  15663. i.push(function(e) {
  15664. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15665. }, function(e) {
  15666. a.copy(r).sub(e.position);
  15667. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15668. , i = g.tags.navigate.tiltTolerance;
  15669. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15670. }),
  15671. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15672. var s = this.model.panos.sortByScore(i, n);
  15673. if (g.tags.navigate.lineOfSight) {
  15674. for (var l = 0; l < s.length; l++) {
  15675. var c = s[l].pano
  15676. , h = c.position.distanceTo(r);
  15677. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15678. return null;
  15679. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15680. var u = d.raycaster.intersectObjects(this.model.colliders);
  15681. if (0 === u.length || u[0].distance > h)
  15682. return c
  15683. }
  15684. return null
  15685. }
  15686. return 0 < s.length && s[0].pano
  15687. }
  15688. ,
  15689. d.prototype.examine = function(i) {
  15690. if(!player.currentPano)return;
  15691. var e = i.mode
  15692. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15693. , t = this.disc.getWorldPosition();
  15694. this.billboard.setActiveState();
  15695. var r = function() {
  15696. var e = this.billboard.getDimensions()
  15697. , t = new f.Vector3;
  15698. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15699. t.unproject(i.camera),
  15700. i.flyToPano({
  15701. pano: n,
  15702. lookAtPoint: t
  15703. })
  15704. }
  15705. .bind(this);
  15706. if (e === m.PANORAMA)
  15707. if (n !== i.currentPano) {
  15708. var o = {
  15709. pano: n,
  15710. lookAtPoint: t,
  15711. duration: null,
  15712. maxDistanceOverride: null,
  15713. skipWarpingCheck: !1
  15714. };
  15715. i.flyToPano(o, r)
  15716. } else
  15717. setTimeout(function() {
  15718. this.billboard.open().then(function() {
  15719. r()
  15720. })
  15721. }
  15722. .bind(this), 0);
  15723. else {
  15724. var a = {
  15725. pano: n
  15726. };
  15727. if (t) {
  15728. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15729. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15730. }
  15731. a.callback = r,
  15732. a.duration = 1500,
  15733. a.mode = m.PANORAMA,
  15734. i.flyToNewMode(a)
  15735. }
  15736. }
  15737. ,
  15738. d.prototype.update = (n = new f.Vector3,
  15739. function(e, t) {
  15740. this.discWorldPosition = this.disc.getWorldPosition(),
  15741. this.updateDisc(e, t),
  15742. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15743. n.z < 1 && (n.y *= -1,
  15744. this.billboard.update(n, this.getDiscRadius(n, t))))
  15745. }
  15746. ),
  15747. d.prototype.updateDisc = (l = new f.Vector3,
  15748. c = new f.Vector3,
  15749. h = new f.Vector3,
  15750. u = new f.Vector3,
  15751. p = new f.Vector3,
  15752. function(e, t) {
  15753. var i = g.tags.visibility
  15754. , n = g.tags.disc.scale
  15755. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15756. 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)),
  15757. this.obj3d.visible) {
  15758. this.disc.quaternion.copy(t.quaternion);
  15759. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15760. l.copy(this.discWorldPosition).project(t),
  15761. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15762. h.set(o / 2, 0, 0).add(c),
  15763. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15764. p.copy(u).unproject(t);
  15765. var a = p.distanceTo(this.discWorldPosition)
  15766. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15767. this.discScale = a * s,
  15768. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15769. }
  15770. }
  15771. ),
  15772. d.prototype.getDiscRadius = (i = new f.Vector3,
  15773. function(e, t) {
  15774. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15775. Math.abs(e.x - i.x) * $("#player").width()
  15776. }
  15777. ),
  15778. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15779. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15780. }
  15781. ,
  15782. d.prototype.offScreen = function(e, t) {
  15783. var i = e.getWorldPosition().project(t);
  15784. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15785. }
  15786. ,
  15787. d.viewportScale = function() {
  15788. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15789. d.viewportHeight = $("#player").height(),
  15790. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15791. d.currentViewportScale
  15792. }
  15793. ,
  15794. R.exports = d
  15795. }
  15796. ).call(this, "/js/tag/tag.js")
  15797. }
  15798. , {
  15799. "../enum/Colors": 19,
  15800. "../enum/RenderLayers": 41,
  15801. "../enum/RenderOrder": 42,
  15802. "../enum/Viewmode": 51,
  15803. "../objects/Panorama": 148,
  15804. "../settings": 166,
  15805. "../shaders": 167,
  15806. "../util/common": 185,
  15807. "../util/easing": 186,
  15808. "../util/lerp": 188,
  15809. "../util/logger": 189,
  15810. "../util/math": 190,
  15811. "../util/texture": 194,
  15812. "../util/transitions": 195,
  15813. "./Billboard/Billboard": 119,
  15814. "./Billboard/BillboardEvent": 120,
  15815. events: 202,
  15816. three: 217
  15817. }],
  15818. 124: [function(M, R, e) {
  15819. (function(e) {
  15820. "use strict";
  15821. function t() {
  15822. this.tagState = T.IDLE,
  15823. this.intersectTag = null,
  15824. this.hoveredTag = null,
  15825. this.activeTag = null,
  15826. this.tagDiscs = [],
  15827. this.raycaster = new i.Raycaster,
  15828. this.modelManager = null,
  15829. this.player = null,
  15830. this.totaltags = 0,
  15831. this.navigatingViaTag = !1,
  15832. this.enabled = !1
  15833. }
  15834. 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"),
  15835. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15836. r.extend(t, x),
  15837. t.prototype.init = function(e, t) {
  15838. this.modelManager = e,
  15839. this.player = t,
  15840. this.updateModel(),
  15841. this.bindEvents()
  15842. }
  15843. ,
  15844. t.prototype.update = function(e) {
  15845. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15846. }
  15847. ,
  15848. t.prototype.updateTags = function(e, t, i, n) {
  15849. for (var r in this.model.tags)
  15850. this.model.tags[r].update(e, t, i, n)
  15851. }
  15852. ,
  15853. t.prototype.updateModel = function() {
  15854. this.model = this.modelManager.getActiveModel(),
  15855. this.gettagsFromModel(),
  15856. this.totaltags = Object.keys(this.model.tags).length
  15857. }
  15858. ,
  15859. t.prototype.gettagsFromModel = function() {
  15860. for (var e in this.tagDiscs = [],
  15861. this.model.tags) {
  15862. var t = this.model.tags[e].disc;
  15863. t && this.tagDiscs.push(t)
  15864. }
  15865. }
  15866. ,
  15867. t.prototype.bindEvents = function() {
  15868. function e() {
  15869. Object.keys(this.model.tags).forEach(function(e) {
  15870. var t = this.model.tags[e];
  15871. t.bindEvents(),
  15872. t.billboard.on(y.LINK_CLICK, function(e) {
  15873. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15874. }
  15875. .bind(this)),
  15876. t.billboard.on(y.IMAGE_OPENED, function() {
  15877. this.tagState = T.EXAMINE,
  15878. this.emit(y.IMAGE_OPENED)
  15879. }
  15880. .bind(this)),
  15881. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15882. }
  15883. .bind(this))
  15884. }
  15885. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15886. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15887. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15888. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15889. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15890. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15891. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15892. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15893. e.call(this)
  15894. }
  15895. ,
  15896. t.prototype.navigateViaLink = function(e) {
  15897. var t = a.deserialize(e);
  15898. if (t)
  15899. if (t.mode === C.PANORAMA) {
  15900. try {
  15901. this.player.model.panos.get(t.panoId)
  15902. } catch (e) {
  15903. return void S.warn("Unable to find panorama location", t.panoId)
  15904. }
  15905. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15906. } else {
  15907. var i = {
  15908. cameraMode: t.mode,
  15909. position: t.position,
  15910. quaternion: t.quaternion,
  15911. scanId: t.panoId,
  15912. orthoZoom: t.zoom,
  15913. floorVisibility: t.floorVisibility,
  15914. thumbUrl: null,
  15915. name: null
  15916. };
  15917. this.player.flyToNewMode({
  15918. mode: t.mode,
  15919. duration: m.warp.outsideTime,
  15920. warpDest: new g(i),
  15921. force: !0
  15922. })
  15923. }
  15924. }
  15925. ,
  15926. t.prototype.handleWarpStart = function(e, t, i, n) {
  15927. this.dismissExaminedTag(),
  15928. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15929. e && (i = E.END),
  15930. this.hideShowTagsForBlackoutStyle(i, n))
  15931. }
  15932. ,
  15933. t.prototype.handleWarpInterruption = function(e, t, i) {
  15934. null != i || (i = m.warp.teleportTime),
  15935. this.hideShowTagsForBlackoutStyle(t, i)
  15936. }
  15937. ,
  15938. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15939. var i = 0
  15940. , n = 0
  15941. , r = t / 2;
  15942. switch (null != e || (e = E.MIDDLE),
  15943. e) {
  15944. case E.END:
  15945. this.hideAlltags(r);
  15946. break;
  15947. case E.BEGINNING:
  15948. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15949. break;
  15950. case E.NONE:
  15951. break;
  15952. case E.MIDDLE:
  15953. n = i = r,
  15954. this.hideAlltags(n),
  15955. setTimeout(function() {
  15956. this.showAlltags(i)
  15957. }
  15958. .bind(this), n);
  15959. break;
  15960. case E.FADEIN:
  15961. setTimeout(function() {
  15962. this.showAlltags(r)
  15963. }
  15964. .bind(this), r)
  15965. }
  15966. }
  15967. ,
  15968. t.prototype.onPlayerModeChanging = function(e, t) {
  15969. t !== C.PANORAMA && this.dismissExaminedTag(),
  15970. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15971. var i = t !== C.OUTDOOR;
  15972. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15973. }
  15974. ,
  15975. t.prototype.onPanoChange = function(e, t) {
  15976. var i = this.navigatingViaTag;
  15977. if (this.navigatingViaTag = !1,
  15978. !i) {
  15979. this.dismissExaminedTag();
  15980. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15981. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15982. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15983. }
  15984. }
  15985. ,
  15986. t.prototype.onPlayerReady = function(e, t, i) {
  15987. this.startAlltags(e, t ? i : null)
  15988. }
  15989. ,
  15990. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15991. this.updateClosestTags(e)
  15992. }
  15993. ,
  15994. t.prototype.dismissExaminedTag = function() {
  15995. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15996. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15997. this.hoveredTag = null)
  15998. }
  15999. ,
  16000. t.prototype.startAlltags = function(e, t) {
  16001. this.model.shouldShowtags = m.tags.enabled,
  16002. this.enabled = !0,
  16003. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  16004. t && setTimeout(function() {
  16005. this.activateTag(this.model.getTagBySid(t))
  16006. }
  16007. .bind(this), m.tags.startup.fadeInDuration / 2))
  16008. }
  16009. ,
  16010. t.prototype.showAlltags = function(e, t, i) {
  16011. function n() {
  16012. ++o === this.totaltags && (this.model.tagsShown = !0,
  16013. r.resolve())
  16014. }
  16015. var r = $.Deferred();
  16016. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16017. return r.resolve().promise();
  16018. var o = 0;
  16019. for (var a in this.model.tags) {
  16020. this.model.tags[a].show(e, t).done(n.bind(this))
  16021. }
  16022. return r.promise()
  16023. }
  16024. ,
  16025. t.prototype.hideAlltags = function(e, t) {
  16026. function i() {
  16027. ++r === this.totaltags && (this.model.tagsShown = !1,
  16028. n.resolve())
  16029. }
  16030. var n = $.Deferred()
  16031. , r = 0;
  16032. for (var o in this.model.tags) {
  16033. var a = this.model.tags[o];
  16034. a.hide(e, t).done(i.bind(this)),
  16035. a === this.activeTag && this.dismissActiveTag()
  16036. }
  16037. return n.promise()
  16038. }
  16039. ,
  16040. t.prototype.enableHovering = function() {
  16041. this.enabled = !0
  16042. }
  16043. ,
  16044. t.prototype.disableHovering = function() {
  16045. this.enabled = !1
  16046. }
  16047. ,
  16048. t.prototype.activateTag = function(e, t) {
  16049. t = t || T.EXAMINE,
  16050. this.activeTag = e,
  16051. this.activeTag.hoveringDisc = !0,
  16052. this.activeTag.setHoverState(t === T.EXAMINE),
  16053. this.tagState = t,
  16054. this.emit(b.TagActivated, e)
  16055. }
  16056. ,
  16057. t.prototype.dismissActiveTag = function() {
  16058. this.activeTag.hoveringDisc = !1,
  16059. this.activeTag.setFreeState(!0);
  16060. var e = this.activeTag;
  16061. this.activeTag = null,
  16062. this.tagState = T.IDLE,
  16063. this.emit(b.TagDismissed, e)
  16064. }
  16065. ,
  16066. t.prototype.clickedOnTag = function(e) {
  16067. var t = function() {
  16068. this.navigatingViaTag = !0,
  16069. this.activeTag.examine(this.player),
  16070. this.emit(b.TagNavigation, this.activeTag)
  16071. }
  16072. .bind(this);
  16073. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  16074. this.activeTag = this.intersectTag,
  16075. t(),
  16076. !0) : (this.dismissActiveTag(),
  16077. !1)
  16078. }
  16079. ,
  16080. t.prototype.intersecttag = (s = new i.Vector3,
  16081. l = new i.Vector3,
  16082. c = new i.Vector3,
  16083. function(e, t, i) {
  16084. if (!this.enabled)
  16085. return null;
  16086. var n = null
  16087. , r = this.tagDiscs.filter(function(e) {
  16088. return e.parent.visible
  16089. });
  16090. if (0 < r.length) {
  16091. var o = this.model.floors.reduce(function(e, t) {
  16092. return t.hidden ? e : e.concat(t.collider.children)
  16093. }, r);
  16094. s.set(e.x, e.y, -1).unproject(i),
  16095. l.set(e.x, e.y, 1).unproject(i),
  16096. c.copy(l).sub(s).normalize(),
  16097. this.raycaster.set(s, c);
  16098. var a = this.raycaster.intersectObjects(o);
  16099. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  16100. }
  16101. return this.intersectTag = n,
  16102. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  16103. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  16104. this.hoveredTag = n
  16105. }
  16106. .bind(this)),
  16107. n.billboard.on(v.LEAVE, function() {
  16108. this.hoveredTag = null
  16109. }
  16110. .bind(this))),
  16111. this.activateTag(n, T.BROWSE))),
  16112. n
  16113. }
  16114. ),
  16115. t.prototype.rankedtagInDirection = (h = [],
  16116. u = [],
  16117. d = new i.Vector3,
  16118. p = new i.Vector3,
  16119. f = new i.Vector3,
  16120. function(e, t, i, n) {
  16121. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  16122. var a = this.closesttags[o];
  16123. p.copy(a.position),
  16124. p.add(a.discPosition),
  16125. d.copy(t),
  16126. d.sub(p).negate(),
  16127. d.normalize();
  16128. var s = d.dot(n);
  16129. if (0 <= s && (f.copy(p),
  16130. f.project(i),
  16131. this.intersecttag(f, !1, i))) {
  16132. if (r >= h.length)
  16133. for (var l = 0; l < 64; l++)
  16134. h.push({
  16135. tag: a,
  16136. dot: s
  16137. });
  16138. var c = h[r];
  16139. c.tag = a,
  16140. c.dot = s,
  16141. c.position = math.projectPositionToCanvas(p, i),
  16142. u.push(c),
  16143. r++
  16144. }
  16145. }
  16146. return u.sort(function(e, t) {
  16147. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16148. }),
  16149. e < u.length ? u[e].tag : null
  16150. }
  16151. ),
  16152. t.prototype.updateClosestTags = (o = new i.Vector3,
  16153. function(e) {
  16154. this.closesttags || (this.closesttags = []),
  16155. this.closesttags.length = 0;
  16156. var t = this.model.tags;
  16157. if (t)
  16158. for (var i in t)
  16159. if (t.hasOwnProperty(i)) {
  16160. var n = t[i]
  16161. , r = n.position;
  16162. o.copy(e),
  16163. o.sub(r).negate(),
  16164. o.lengthSq() < 30 && this.closesttags.push(n)
  16165. }
  16166. }
  16167. ),
  16168. R.exports = t
  16169. }
  16170. ).call(this, "/js/tag/tagManager.js")
  16171. }
  16172. , {
  16173. "../controls/serializer": 14,
  16174. "../enum/BlackoutStyle": 18,
  16175. "../enum/tagEvents": 32,
  16176. "../enum/ModelManagerEvents": 33,
  16177. "../enum/PlayerEvents": 40,
  16178. "../enum/TagStates": 44,
  16179. "../enum/Viewmode": 51,
  16180. "../enum/WarpStyle": 52,
  16181. "../objects/Snapshot": 153,
  16182. "../settings": 166,
  16183. "../util/common": 185,
  16184. "../util/lerp": 188,
  16185. "../util/logger": 189,
  16186. "./Billboard/BillboardEvent": 120,
  16187. "./Media/LinkType": 130,
  16188. "./Media/MediaEvent": 131,
  16189. events: 202,
  16190. three: 217
  16191. }],
  16192. 125: [function(r, o, e) {
  16193. (function(e) {
  16194. "use strict";
  16195. function t() {
  16196. this.embedWrapper = null,
  16197. this.embedElement = null
  16198. }
  16199. var i = r("../../util/ajax")
  16200. , a = r("./mediaSettings")
  16201. , n = r("../../settings")
  16202. , s = new (r("../../util/logger"))(e);
  16203. t.prototype.createDomElement = function() {
  16204. return this.embedWrapper = document.createElement("div"),
  16205. this.embedWrapper.classList.add("tag-embed"),
  16206. this.embedWrapper.classList.add("hidden"),
  16207. this.embedWrapper
  16208. }
  16209. ,
  16210. t.prototype.load = function(e) {
  16211. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  16212. return new Promise(function(r, o) {
  16213. i.get(t).then(function(e) {
  16214. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  16215. this.embedWrapper.innerHTML = e.html;
  16216. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  16217. if (this.embedWrapper.style.width = t + "px",
  16218. e.height) {
  16219. var i = e.height / e.width;
  16220. this.embedWrapper.style.height = t * i + "px"
  16221. }
  16222. this.embedElement = this.embedWrapper.firstChild;
  16223. var n = [];
  16224. try {
  16225. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  16226. } catch (e) {
  16227. s.debug("Error getting `a` elements for embed; was it an iframe?")
  16228. }
  16229. n.forEach(function(e) {
  16230. e.setAttribute("target", "_blank")
  16231. }),
  16232. this.embedElement.classList.add("hidden"),
  16233. this.embedWrapper.classList.remove("hidden"),
  16234. r()
  16235. } else
  16236. o("Not a valid embed")
  16237. }
  16238. .bind(this), function(e) {
  16239. o(e.response)
  16240. })
  16241. }
  16242. .bind(this))
  16243. }
  16244. ,
  16245. t.prototype.show = function() {
  16246. this.embedElement && this.embedElement.classList.remove("hidden")
  16247. }
  16248. ,
  16249. t.prototype.hide = function() {
  16250. this.embedElement && this.embedElement.classList.add("hidden")
  16251. }
  16252. ,
  16253. o.exports = t
  16254. }
  16255. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16256. }
  16257. , {
  16258. "../../settings": 166,
  16259. "../../util/ajax": 181,
  16260. "../../util/logger": 189,
  16261. "./mediaSettings": 132
  16262. }],
  16263. 126: [function(a, s, e) {
  16264. (function(e) {
  16265. "use strict";
  16266. function t(e) {
  16267. r.call(this),
  16268. this.options = e,
  16269. this.playerControls = null,
  16270. this.state = o.NOT_READY
  16271. }
  16272. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  16273. Object.freeze({
  16274. NOT_READY: "player.not.ready",
  16275. CUED: "player.cued",
  16276. PLAYING: "player.playing",
  16277. PAUSED: "player.paused"
  16278. }));
  16279. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16280. return this.embedWrapper = document.createElement("div"),
  16281. this.embedWrapper.classList.add("tag-video"),
  16282. this.embedWrapper.classList.add("hidden"),
  16283. this.embedWrapper
  16284. }
  16285. ,
  16286. t.prototype.load = function(e) {
  16287. var t = function() {
  16288. function e(e) {
  16289. this.playerState = e
  16290. }
  16291. this.playerControls = new playerjs.Player(this.embedElement),
  16292. this.playerControls.on("ready", function(e) {
  16293. this.playerState = o.CUED,
  16294. this.options.startMuted && this.playerControls.mute()
  16295. }
  16296. .bind(this)),
  16297. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  16298. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  16299. this.playerControls.on("ended", function(e) {
  16300. this.playerControls.setCurrentTime(0),
  16301. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16302. }
  16303. .bind(this))
  16304. }
  16305. .bind(this);
  16306. return r.prototype.load.call(this, e).then(t.bind(this))
  16307. }
  16308. ,
  16309. t.prototype.play = (i = n.isMobile(),
  16310. function() {
  16311. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16312. }
  16313. ),
  16314. t.prototype.pause = function() {
  16315. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  16316. }
  16317. ,
  16318. s.exports = t
  16319. }
  16320. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16321. }
  16322. , {
  16323. "../../util/browser": 182,
  16324. "../../util/logger": 189,
  16325. "./EmbedlyEmbed": 125
  16326. }],
  16327. 127: [function(t, i, e) {
  16328. (function(e) {
  16329. "use strict";
  16330. var r = t("../../util/ajax")
  16331. , o = new (t("./mediaSettings"),
  16332. t("../../util/logger"))(e)
  16333. , a = Promise.resolve();
  16334. i.exports.enqueue = function(i) {
  16335. function n() {}
  16336. return a = new Promise(function(e, t) {
  16337. a.catch(n).then(function() {
  16338. (o.debug("requesting file from embedly:", i.href),
  16339. r.get(i.href, {
  16340. responseType: i.responseType
  16341. }).then(function(e) {
  16342. return o.debug("requesting file finished:", i.href),
  16343. e
  16344. })).then(e, t)
  16345. })
  16346. }
  16347. )
  16348. }
  16349. }
  16350. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16351. }
  16352. , {
  16353. "../../util/ajax": 181,
  16354. "../../util/logger": 189,
  16355. "./mediaSettings": 132
  16356. }],
  16357. 128: [function(s, l, e) {
  16358. (function(e) {
  16359. "use strict";
  16360. function t() {
  16361. this.imageWrapper = null,
  16362. this.width = 0,
  16363. this.height = 0,
  16364. this.aspect = 1
  16365. }
  16366. var i = s("./MediaEvent")
  16367. , n = s("./EmbedlyQueue")
  16368. , r = s("events").EventEmitter
  16369. , o = s("../../util/logger")
  16370. , a = s("../../settings");
  16371. new o(e),
  16372. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16373. return this.imageWrapper = document.createElement("div"),
  16374. this.imageWrapper.classList.add("tag-image"),
  16375. this.imageWrapper.classList.add("hidden"),
  16376. this.imageWrapper.addEventListener("click", function(e) {
  16377. e.stopPropagation(),
  16378. this.emit(i.IMAGE_OPENING),
  16379. this.imageWrapper.style.pointerEvents = "none"
  16380. }
  16381. .bind(this)),
  16382. this.imageWrapper
  16383. }
  16384. ,
  16385. t.prototype.onClosed = function() {
  16386. this.imageWrapper.style.pointerEvents = "auto"
  16387. }
  16388. ,
  16389. t.prototype.load = function(e) {
  16390. var t = Math.max(window.screen.height, window.screen.width)
  16391. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16392. return new Promise(function(o, e) {
  16393. n.enqueue({
  16394. href: i,
  16395. responseType: "arraybuffer"
  16396. }).then(function(e) {
  16397. var t = new Uint8Array(e)
  16398. , i = new Blob([t])
  16399. , n = new window.Image;
  16400. n.addEventListener("load", function(e) {
  16401. var t = e.target;
  16402. this.width = t.naturalWidth,
  16403. this.height = t.naturalHeight,
  16404. this.aspect = this.width / this.height;
  16405. var i = e.target.src;
  16406. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  16407. this.imageWrapper.style.width = this.width + "px",
  16408. this.imageWrapper.style.height = this.height + "px",
  16409. this.imageWrapper.classList.remove("hidden"),
  16410. o()
  16411. }
  16412. .bind(this));
  16413. var r = URL.createObjectURL(i);
  16414. n.src = r
  16415. }
  16416. .bind(this), e)
  16417. }
  16418. .bind(this))
  16419. }
  16420. ,
  16421. l.exports = t
  16422. }
  16423. ).call(this, "/js/tag/Media/Image.js")
  16424. }
  16425. , {
  16426. "../../settings": 166,
  16427. "../../util/logger": 189,
  16428. "./EmbedlyQueue": 127,
  16429. "./MediaEvent": 131,
  16430. events: 202
  16431. }],
  16432. 129: [function(e, t, i) {
  16433. "use strict";
  16434. function n(e) {
  16435. this.label = e.label,
  16436. this.href = e.url,
  16437. this.type = this.updateLinkForType(),
  16438. this.domElement = null,
  16439. this.id = c++
  16440. }
  16441. var r = e("./LinkType")
  16442. , o = e("./MediaEvent")
  16443. , a = e("../../util/browser")
  16444. , s = e("../../analytics")
  16445. , l = e("events").EventEmitter
  16446. , c = 0;
  16447. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16448. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16449. 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,
  16450. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16451. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16452. r.MODEL) : r.EXT_LINK
  16453. }
  16454. ;
  16455. var h = {};
  16456. n.prototype.createDomElement = function() {
  16457. if (this.domElement = document.createElement("a"),
  16458. this.domElement.classList.add("tag-link"),
  16459. this.domElement.textContent = this.label,
  16460. this.type === r.EXT_LINK) {
  16461. this.domElement.textContent += " ";
  16462. var e = document.createElement("i");
  16463. e.classList.add("icon-ext-link"),
  16464. e.title = "Link to external web site",
  16465. this.domElement.appendChild(e)
  16466. }
  16467. return this.domElement.addEventListener("click", function(e) {
  16468. switch (e.stopPropagation(),
  16469. h[this.id] = !0,
  16470. s.trackAlways("click_tag_link", {
  16471. link_type: this.type,
  16472. link_count: c,
  16473. links_clicked: Object.keys(h).length
  16474. }),
  16475. this.type) {
  16476. case r.MODEL:
  16477. window.location.replace(this.href);
  16478. break;
  16479. case r.EXT_LINK:
  16480. window.open(this.href, "_blank")
  16481. }
  16482. this.emit(o.LINK_CLICK, {
  16483. type: this.type,
  16484. url: this.href
  16485. })
  16486. }
  16487. .bind(this)),
  16488. this.domElement
  16489. }
  16490. ,
  16491. t.exports = n
  16492. }
  16493. , {
  16494. "../../analytics": 4,
  16495. "../../util/browser": 182,
  16496. "./LinkType": 130,
  16497. "./MediaEvent": 131,
  16498. events: 202
  16499. }],
  16500. 130: [function(e, t, i) {
  16501. "use strict";
  16502. t.exports = {
  16503. NAVIGATION: "navigation",
  16504. MODEL: "model",
  16505. EXT_LINK: "ext-link"
  16506. }
  16507. }
  16508. , {}],
  16509. 131: [function(e, t, i) {
  16510. "use strict";
  16511. t.exports = Object.freeze({
  16512. LINK_CLICK: "mtmedia.link",
  16513. IMAGE_LOADED: "mtmedia.image.loaded",
  16514. IMAGE_OPENING: "mtmedia.image.opening",
  16515. IMAGE_OPENED: "mtmedia.image.opened",
  16516. IMAGE_CLOSING: "mtmedia.image.closing",
  16517. IMAGE_CLOSED: "mtmedia.image.closed",
  16518. VIDEO_START: "mtmedia.video.start",
  16519. VIDEO_PAUSE: "mtmedia.video.pause",
  16520. VIDEO_ENDED: "mtmedia.video.end"
  16521. })
  16522. }
  16523. , {}],
  16524. 132: [function(e, t, i) {
  16525. "use strict";
  16526. t.exports = Object.freeze({
  16527. maxEmbedWidth: 350,
  16528. defaultAspectRatio: .75
  16529. })
  16530. }
  16531. , {}],
  16532. 133: [function(e, t, i) {
  16533. "use strict";
  16534. t.exports = Object.freeze({
  16535. TEXT: "text",
  16536. LINK: "link",
  16537. IMAGE: "photo",
  16538. VIDEO: "video",
  16539. RICH: "rich"
  16540. })
  16541. }
  16542. , {}],
  16543. 134: [function(e, t, i) {
  16544. "use strict";
  16545. function n(e) {
  16546. this.capabilities = {
  16547. links: {
  16548. enable: e.supportLinks,
  16549. keepLabels: e.keepLinkLabels
  16550. }
  16551. }
  16552. }
  16553. var r = e("./DescriptionChunkType");
  16554. n.prototype.parse = function(e, i) {
  16555. var n = [];
  16556. return e.split("[").map(function(e, t) {
  16557. return 0 === t ? e : "[" + e
  16558. }).forEach(function(e) {
  16559. var t = this.findMarkdown(e);
  16560. if (t) {
  16561. if (-1 !== t.url.indexOf("javascript:"))
  16562. return;
  16563. this.addLinkChunk(n, t, i),
  16564. this.addTextChunk(n, e.slice(t.markdown.length))
  16565. } else
  16566. this.addTextChunk(n, e)
  16567. }
  16568. .bind(this)),
  16569. n
  16570. }
  16571. ,
  16572. n.prototype.findMarkdown = function(e) {
  16573. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16574. if (t) {
  16575. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16576. 0 !== n); )
  16577. r++;
  16578. var o = i.length - r;
  16579. return {
  16580. markdown: t[0].substring(0, t[0].length - o),
  16581. label: t[1],
  16582. url: t[2].substring(0, r)
  16583. }
  16584. }
  16585. }
  16586. ,
  16587. n.prototype.addTextChunk = function(e, t) {
  16588. 0 !== t.length && e.push({
  16589. type: r.TEXT,
  16590. text: t
  16591. })
  16592. }
  16593. ,
  16594. n.prototype.addLinkChunk = function(e, t) {
  16595. if (this.capabilities.links.enable) {
  16596. var i = {
  16597. label: t.label,
  16598. url: t.url
  16599. };
  16600. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16601. e.push({
  16602. type: r.LINK,
  16603. link: i
  16604. })
  16605. } else
  16606. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16607. }
  16608. ,
  16609. t.exports = n
  16610. }
  16611. , {
  16612. "./DescriptionChunkType": 133
  16613. }],
  16614. 135: [function(t, r, e) {
  16615. (function(e) {
  16616. "use strict";
  16617. var i = new (t("../util/logger"))(e)
  16618. , n = {
  16619. parseIdsFromChunkName: function(e, t) {
  16620. t.floorId = n.parseFloor(e),
  16621. t.roomId = n.parseRoom(e)
  16622. },
  16623. parseFloor: function(e) {
  16624. var t = e.match(/_group([0-9]+)/);
  16625. if (!t)
  16626. return 0;
  16627. try {
  16628. return parseInt(t[1], 10)
  16629. } catch (e) {
  16630. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16631. 0
  16632. }
  16633. },
  16634. parseRoom: function(e) {
  16635. var t = e.match(/_sub([0-9]+)/);
  16636. if (!t)
  16637. return -1;
  16638. try {
  16639. return parseInt(t[1], 10)
  16640. } catch (e) {
  16641. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16642. 0
  16643. }
  16644. }
  16645. };
  16646. r.exports = n
  16647. }
  16648. ).call(this, "/js/model/Chunks.js")
  16649. }
  16650. , {
  16651. "../util/logger": 189
  16652. }],
  16653. 136: [function(a, c, e) {
  16654. (function(e) {
  16655. "use strict";
  16656. function t(e) {
  16657. r.call(this),
  16658. this.model = e,
  16659. this.exploded = !1
  16660. }
  16661. var i = a("../objects/Floor")
  16662. , n = (a("../settings"),
  16663. a("../util/logger"))
  16664. , s = a("../util/transitions")
  16665. , r = a("../util/IndexedCollection")
  16666. , o = a("../util/common")
  16667. , l = a("../util/easing");
  16668. new n(e),
  16669. o.inherit(t, r),
  16670. t.prototype.add = function(e) {
  16671. r.prototype.add.call(this, e),
  16672. this.model.add(e)
  16673. }
  16674. ,
  16675. t.prototype.getIndex = function(e) {
  16676. return e.floorIndex
  16677. }
  16678. ,
  16679. t.prototype.build = function() {
  16680. this.list.forEach(function(e) {
  16681. e.build()
  16682. })
  16683. }
  16684. ,
  16685. t.prototype.size = function() {
  16686. return this.length
  16687. }
  16688. ,
  16689. t.prototype.sort = function() {
  16690. r.prototype.sort.call(this, function(e, t) {
  16691. return e.floorIndex - t.floorIndex
  16692. })
  16693. }
  16694. ,
  16695. t.prototype.nextFloor = function(e, t) {
  16696. return this.index[e.floorIndex + t] || null
  16697. }
  16698. ,
  16699. t.prototype.getFloorAtPoint = function(e) {
  16700. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16701. var r = this.list[n]
  16702. , o = r.distanceToPoint(e);
  16703. (!t || o < i) && (i = o,
  16704. t = r)
  16705. }
  16706. return t
  16707. }
  16708. ,
  16709. t.prototype.getOrMakeFloor = function(e) {
  16710. var t = this.index[e];
  16711. return t || (t = new i(this.model,e),
  16712. this.add(t)),
  16713. t
  16714. }
  16715. ,
  16716. t.prototype.hide = function() {
  16717. this.list.forEach(function(e) {
  16718. e.hide()
  16719. })
  16720. }
  16721. ,
  16722. t.prototype.show = function() {
  16723. this.list.forEach(function(e) {
  16724. e.show()
  16725. })
  16726. }
  16727. ,
  16728. t.prototype.names = function() {
  16729. return this.list.reduce(function(e, t) {
  16730. return e.concat(t.name)
  16731. }, [])
  16732. }
  16733. ,
  16734. t.prototype.toggleExplodeHorizontal = function() {
  16735. function i(e, t) {
  16736. a.copy(e.position),
  16737. e.position.x = r[e.floorIndex] * t,
  16738. e.position.y = 1 * e.floorIndex * t,
  16739. a.sub(e.position).multiplyScalar(-1),
  16740. e.panos.forEach(function(e) {
  16741. e.translate(a)
  16742. })
  16743. }
  16744. var n, r = [], o = 0;
  16745. this.list.forEach(function(e, t, i) {
  16746. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16747. o += n,
  16748. r[t] = o
  16749. }),
  16750. r = r.map(function(e) {
  16751. return e - o / 2
  16752. });
  16753. var a = this.list[0].position.clone();
  16754. this.exploded ? this.list.forEach(function(t) {
  16755. s.start(function(e) {
  16756. i(t, 1 - e)
  16757. }, 1500, null, 0, l.easeOutExpo)
  16758. }) : this.list.forEach(function(t) {
  16759. s.start(function(e) {
  16760. i(t, e)
  16761. }, 1500, null, 0, l.easeOutExpo)
  16762. }),
  16763. this.exploded = !this.exploded
  16764. }
  16765. ,
  16766. t.prototype.toggleExplodeVertical = function() {
  16767. function i(e, t) {
  16768. var i = i.copy(e.position);
  16769. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16770. i.sub(e.position).multiplyScalar(-1),
  16771. e.panos.forEach(function(e) {
  16772. e.translate(i)
  16773. })
  16774. }
  16775. var n = this.model.size;
  16776. this.list[0].position.clone(),
  16777. this.exploded ? this.list.forEach(function(t) {
  16778. s.start(function(e) {
  16779. i(t, 1 - e)
  16780. }, 1500, null, 0, l.easeOutExpo)
  16781. }) : this.list.forEach(function(t) {
  16782. s.start(function(e) {
  16783. i(t, e)
  16784. }, 1500, null, 0, l.easeOutExpo)
  16785. }),
  16786. this.exploded = !this.exploded
  16787. }
  16788. ,
  16789. c.exports = t
  16790. }
  16791. ).call(this, "/js/model/FloorCollection.js")
  16792. }
  16793. , {
  16794. "../objects/Floor": 146,
  16795. "../settings": 166,
  16796. "../util/IndexedCollection": 175,
  16797. "../util/common": 185,
  16798. "../util/easing": 186,
  16799. "../util/logger": 189,
  16800. "../util/transitions": 195
  16801. }],
  16802. 137: [function(r, o, e) {
  16803. (function(e) {
  16804. "use strict";
  16805. function h() {
  16806. n.call(this)
  16807. }
  16808. var u = r("../settings")
  16809. , t = r("../util/logger")
  16810. , d = r("../enum/Viewmode")
  16811. , p = r("../objects/Snapshot")
  16812. , i = (r("../util/math"),
  16813. r("../util/common"))
  16814. , n = r("../util/IndexedCollection")
  16815. , l = new t(e);
  16816. i.inherit(h, n),
  16817. h.prototype.getImage = function(e) {
  16818. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16819. }
  16820. ,
  16821. h.prototype.filterByModesAndReel = function(e, t) {
  16822. for (var i = [], n = 0; n < t.length; n += 1) {
  16823. var r = t[n]
  16824. , o = this.index[r.sid];
  16825. o && i.push(o)
  16826. }
  16827. var a = e[d.DOLLHOUSE]
  16828. , s = e[d.FLOORPLAN];
  16829. (i = i.filter(function(e) {
  16830. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16831. return !0;
  16832. var t;
  16833. try {
  16834. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16835. } catch (e) {
  16836. return l.debug(e.message),
  16837. !1
  16838. }
  16839. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16840. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16841. this.list = i,
  16842. this.reIndex()
  16843. }
  16844. ,
  16845. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16846. if (0 === this.list.length)
  16847. return [];
  16848. var locations = [];
  16849. var deal = (n, container)=>{
  16850. var r = n.thumbnail_signed_src,
  16851. o = n.name || "";
  16852. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16853. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16854. var a = panos.get(n.metadata.scan_id);
  16855. if (a && !a.isAligned()) return
  16856. }
  16857. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16858. if (s === d.MESH) return
  16859. if(window.isLocal)var src = manage.dealURL(r)
  16860. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16861. var l = {
  16862. cameraMode: s,
  16863. position: n.metadata.camera_position,
  16864. quaternion: n.metadata.camera_quaternion,
  16865. zoom: n.metadata.zoom,
  16866. panoId: n.metadata.scan_id,
  16867. orthoZoom: n.metadata.ortho_zoom,
  16868. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16869. thumbUrl: src,
  16870. name: h.filterImageName(o),
  16871. sid: n.sid
  16872. }
  16873. var item = new p(l);
  16874. item.momentTour = n.momentTour
  16875. item.dontRot = n.dontRot
  16876. item.rotTime = n.rotTime
  16877. container.push(item)
  16878. return item
  16879. }
  16880. }
  16881. this.list.forEach(image=>{
  16882. if(image.images){
  16883. var folder = $.extend({}, image )
  16884. folder.heroLocations = [];
  16885. image.images.list.forEach(child=>{
  16886. deal(child, folder.heroLocations);
  16887. })
  16888. folder.musicInfo = folder.musicInfo || {}
  16889. locations.push(folder)
  16890. delete folder.images;
  16891. delete folder.locations;
  16892. }else{
  16893. var item = deal(image, locations);
  16894. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16895. }
  16896. })
  16897. return locations
  16898. }
  16899. ,
  16900. h.prototype.getIndex = function(e) {
  16901. return e.sid
  16902. }
  16903. ,
  16904. h.filterImageName = function(e) {
  16905. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16906. }
  16907. ,
  16908. o.exports = h
  16909. }
  16910. ).call(this, "/js/model/ImageCollection.js")
  16911. }
  16912. , {
  16913. "../enum/Viewmode": 51,
  16914. "../objects/Snapshot": 153,
  16915. "../settings": 166,
  16916. "../util/IndexedCollection": 175,
  16917. "../util/common": 185,
  16918. "../util/logger": 189,
  16919. "../util/math": 190
  16920. }],
  16921. 138: [function(h, u, e) {
  16922. (function(e) {
  16923. "use strict";
  16924. function n() {
  16925. c.call(this)
  16926. }
  16927. var r = h("../label/Label")
  16928. , i = h("../settings")
  16929. , t = h("../util/logger")
  16930. , o = h("../util/math")
  16931. , a = h("../util/ajax")
  16932. , s = h("./RoomCollection")
  16933. , l = h("../util/common")
  16934. , c = h("../util/IndexedCollection");
  16935. new t(e),
  16936. l.inherit(n, c),
  16937. n.prototype.getIndex = function(e) {
  16938. return e.labelId
  16939. }
  16940. ,
  16941. n.prototype.associateWithRooms = function(e) {
  16942. this.forEach(function(t) {
  16943. e.forEach(function(e) {
  16944. e.roomId === t.roomId && (t.room = e)
  16945. })
  16946. })
  16947. }
  16948. ,
  16949. n.prototype.createFromLabelData = function(e) {
  16950. e.forEach(function(e) {
  16951. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16952. t = s.generateRoomId(e.floorId, t);
  16953. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16954. i.position = o.convertWorkshopVector(i.position),
  16955. this.add(i),
  16956. i.build()
  16957. }
  16958. .bind(this))
  16959. }
  16960. ,
  16961. n.prototype.load = function(e, t) {
  16962. return a.get(e, {
  16963. responseType: "json",
  16964. auth: t ? i.authorizationHeader : null
  16965. }).done(function(e) {
  16966. var t = [];
  16967. for (var i in e) {
  16968. var n = e[i];
  16969. t.push(n)
  16970. }
  16971. this.createFromLabelData(t)
  16972. }
  16973. .bind(this))
  16974. }
  16975. ,
  16976. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16977. var t = -1;
  16978. if (e) {
  16979. if(typeof e == 'number'){
  16980. t = parseInt(e)
  16981. }else{
  16982. var i = e.split("_");
  16983. t = parseInt(i[0])
  16984. }
  16985. }
  16986. return t
  16987. }
  16988. ,
  16989. u.exports = n
  16990. }
  16991. ).call(this, "/js/model/LabelCollection.js")
  16992. }
  16993. , {
  16994. "../label/Label": 90,
  16995. "../settings": 166,
  16996. "../util/IndexedCollection": 175,
  16997. "../util/ajax": 181,
  16998. "../util/common": 185,
  16999. "../util/logger": 189,
  17000. "../util/math": 190,
  17001. "./RoomCollection": 141
  17002. }],
  17003. 139: [function(P, O, e) {
  17004. (function(e) {
  17005. "use strict";
  17006. function t(e, t) {
  17007. o.Object3D.call(this),
  17008. this.sid = window.number;//t.sid,
  17009. this.data = t,
  17010. this.options = e,
  17011. this.urls = new i(e.urlFiles),
  17012. this.isPublic = void 0 !== t.is_public && t.is_public,
  17013. //创建heroLocations
  17014. this.images = new E(this),
  17015. this.images.extend(t.images),
  17016. this.images.forEach((info)=>{
  17017. if(info.locations){
  17018. info.images = new E(this);
  17019. info.images.extend(info.locations)
  17020. }
  17021. })
  17022. this.heroLocations = []
  17023. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17024. this.outdoorPanoLocations = [],
  17025. this.floors = new c(this),
  17026. this.floorsEnabled = void 0 === e.floors || e.floors,
  17027. this.changingFloor = !1,
  17028. this.chunks = [],
  17029. this.panos = new g,
  17030. this.colliders = [],
  17031. this.loadPanosPromise = null,
  17032. this.loadMeshTexturesPromise = null,
  17033. this.auxDataPromise = null,
  17034. this.meshTexturesLoaded = !1,
  17035. this.meshTextures = [],
  17036. this.tags = {},
  17037. this.tagsShown = !1,
  17038. this.shouldShowtags = !1,
  17039. this.has360Views = !1,
  17040. this.showingLabels = u.labels.enabled && t.player_options.labels,
  17041. this.supportedModes = {},
  17042. this.supportedModes[s.PANORAMA] = !0,
  17043. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  17044. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  17045. this.supportedModes[s.TRANSITIONING] = !0,
  17046. this.supportsTiles = this.configureTiling(),
  17047. this.supportsVR = window.DATA.supportsVR || false//!0,
  17048. this.mode = s.DOLLHOUSE,
  17049. this.size = null,
  17050. this.center = null,
  17051. this.boundingBox = new o.Box3,
  17052. this.currentFloor = null,
  17053. this.allFloorsVisible = !0,
  17054. this.projectedPano0 = null,
  17055. this.projectedPano1 = null,
  17056. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  17057. this.addFloor(new r(this,t,e.trim()))
  17058. }
  17059. .bind(this)),
  17060. this.waitQueue = [],
  17061. this.on("load", function(e) {
  17062. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17063. return !e.isLoadedCallback()
  17064. }),
  17065. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17066. }
  17067. .bind(this)),
  17068. this.setupCustomProperties(),
  17069. this.hots = {}
  17070. }
  17071. var o = P("three")
  17072. , a = P("../util/ajax")
  17073. , i = P("../util/ModelUrls")
  17074. , n = P("../objects/BoundingTextureSkybox")
  17075. , s = P("../enum/Viewmode")
  17076. , l = P("../enum/RenderOrder")
  17077. , r = (P("../enum/AlignmentType"),
  17078. P("../objects/Floor"))
  17079. , c = P("./FloorCollection")
  17080. , h = P("../objects/Chunk")
  17081. , u = (P("../objects/Room"),
  17082. P("../objects/Snapshot"),
  17083. P("../label/Label"),
  17084. P("../util/math"),
  17085. P("../settings"))
  17086. , d = P("../shaders")
  17087. , p = P("../util/logger")
  17088. , f = (P("../tag/tag"),
  17089. P("../tag/tagManager"),
  17090. P("../objects/Panorama"))
  17091. , g = P("../util/PanoramaCollection")
  17092. , m = P("../loaders/ModelLoader")
  17093. , v = P("../loaders/ModelTextureLoader")
  17094. , y = P("../loaders/SweepDataLoader")
  17095. , A = P("../util/transitions")
  17096. , C = (P("../util/easing"),
  17097. P("../util/lerp"),
  17098. P("../util/common"))
  17099. , I = (P("../util/texture"),
  17100. P("./../util/browser"))
  17101. , E = P("./ImageCollection")
  17102. , _ = P("./RoomCollection")
  17103. , b = P("./LabelCollection")
  17104. , w = P("./Chunks")
  17105. , T = P("./../util/showcase")
  17106. , x = P("../exception/BasicException")
  17107. , S = (P("../constants"),
  17108. P("events").EventEmitter)
  17109. , M = P("hot")
  17110. , R = new p(e);
  17111. t.prototype = Object.create(o.Object3D.prototype),
  17112. C.extend(t, S),
  17113. t.prototype.setupCustomProperties = function() {
  17114. var t = u.modelAlpha;
  17115. Object.defineProperty(this, "alpha", {
  17116. get: function() {
  17117. return t
  17118. },
  17119. set: function(e) {
  17120. t = e,
  17121. this.chunks.forEach(function(e) {
  17122. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  17123. })
  17124. }
  17125. })
  17126. }
  17127. ,
  17128. t.prototype.configureTiling = function() {
  17129. var e = function() {
  17130. try {
  17131. var e = document.createElement("canvas")
  17132. , t = e.getContext("webgl");
  17133. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  17134. } catch (e) {
  17135. return 0
  17136. }
  17137. }();
  17138. if (e < 2048)
  17139. return !1;
  17140. R.warn("Max cube texture size: " + e);
  17141. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  17142. var i = u.tiling.tilingFlagNames[t];
  17143. if ("1" === I.valueFromHash(i, null))
  17144. return !0;
  17145. if ("0" === I.valueFromHash(i, null))
  17146. return !1
  17147. }
  17148. return !!T.modelDataPromisesTiles(this.data)
  17149. }
  17150. ,
  17151. t.prototype.toggleAlpha = function() {
  17152. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17153. }
  17154. ,
  17155. t.prototype.load = function(e) {
  17156. var t = this.urls.init().then(function() {
  17157. return $.when(this.loadPanos(), this.loadMesh())
  17158. }
  17159. .bind(this));
  17160. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  17161. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  17162. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  17163. }
  17164. ,
  17165. t.prototype.loadMesh = function() {
  17166. var n = $.Deferred()
  17167. , r = this;
  17168. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  17169. if (0 === e.length) {
  17170. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17171. r.supportedModes[s.DOLLHOUSE] = !1,
  17172. r.supportedModes[s.FLOORPLAN] = !1;
  17173. var i = new h({
  17174. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17175. });
  17176. i.material.visible = !1,
  17177. i.rotateX(-Math.PI / 2),
  17178. i.geometry.computeBoundingBox(),
  17179. e = [i]
  17180. }
  17181. e.forEach(function(e) {
  17182. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  17183. r.addChunk(t, e)
  17184. }),
  17185. r.floors.sort(),
  17186. n.resolve(r)
  17187. }, function(e, t) {
  17188. n.notify(e, t)
  17189. }, function(e) {
  17190. R.error(e),
  17191. n.reject("loading-failed")
  17192. }),
  17193. n.promise()
  17194. }
  17195. ,
  17196. t.prototype.loadMeshTextures = function() {
  17197. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  17198. this.meshTexturesLoaded = !0
  17199. }
  17200. .bind(this))),
  17201. this.loadTexturesPromise
  17202. }
  17203. /* t.prototype.shineHots = function() {
  17204. A.trigger({
  17205. func: function(e) {
  17206. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17207. for(var i in this.hots){
  17208. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17209. }
  17210. }
  17211. .bind(this),
  17212. cycling: !0,
  17213. duration: 3e3,
  17214. name: "hotShine"
  17215. })
  17216. } */
  17217. ,
  17218. /* t.prototype.createHotItem = function(e, t) {
  17219. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  17220. var o = document.createElement("li")
  17221. , a = document.createElement("span");
  17222. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute && e[n[r]].infoAttribute.title || "热点",
  17223. o.hot = t[n[r]],
  17224. o.appendChild(a),
  17225. i.appendChild(o)
  17226. }
  17227. document.querySelector("#hotListContent ul").appendChild(i),
  17228. console.log(i)
  17229. } */
  17230. t.prototype.createHotItem = function() {
  17231. var docFragment = document.createDocumentFragment();
  17232. this.hotGroup.children.forEach(hot=>{
  17233. if(hot.info.actionType.openHot){
  17234. var li = document.createElement('li');
  17235. var span = document.createElement('span');
  17236. span.innerHTML = hot.info.title || '热点';
  17237. // console.log(span.innerHTML);
  17238. li.hot = hot; // 列表每一项对应一个热点
  17239. li.appendChild(span);
  17240. docFragment.appendChild(li);
  17241. }
  17242. })
  17243. var ul = document.querySelector('#hotListContent ul');
  17244. ul.appendChild(docFragment);
  17245. }
  17246. ,
  17247. /* t.prototype.loadOverlays = function(overlays){
  17248. var overlays = window.data2 && window.data2.overlays
  17249. overlays && overlays.forEach((info)=>{
  17250. new Overlay(info)
  17251. })
  17252. Overlay.load()
  17253. }
  17254. */
  17255. t.prototype.loadhots = function() {
  17256. initHot(this)
  17257. var r = $.Deferred()
  17258. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  17259. return a.get(e, {
  17260. responseType: "json",
  17261. auth: this.isPublic ? null : u.authorizationHeader
  17262. }).done(function(e) {
  17263. window.data2 = e;
  17264. editTool.loadDone('data2', e)
  17265. if(!e){
  17266. console.error("data2 is null")
  17267. }else{
  17268. g_data2 = hotMatcher(e)
  17269. this.hotsCount = 0;
  17270. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17271. //window.hotData = {}
  17272. /* if(e.hots){
  17273. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17274. sids.forEach((sid)=>{
  17275. this.hotsCount++,
  17276. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  17277. //e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  17278. //this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  17279. window.hotData[sid] = e.hots[sid];
  17280. })
  17281. }*/
  17282. if(e.hots){
  17283. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17284. sids.forEach((sid)=>{
  17285. e.hots[sid].sid = sid
  17286. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  17287. })
  17288. }
  17289. if(e.overlays){
  17290. e.overlays.forEach((info)=>{
  17291. new Hot(info, 'byOverlay')
  17292. })
  17293. }
  17294. this.createHotItem();
  17295. /* if(e.multiOverlays){
  17296. e.multiOverlays.forEach((info)=>{
  17297. new Hot(info)
  17298. })
  17299. }) */
  17300. Hot.startLoad()
  17301. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  17302. }
  17303. r.resolve()
  17304. }
  17305. .bind(this)).fail(function() {
  17306. console.log("没有热点"),
  17307. editTool.loadDone('data2', null)
  17308. r.resolve()
  17309. }),
  17310. r
  17311. }
  17312. ,
  17313. t.prototype.loadPanos = function() {
  17314. if (this.loadPanosPromise)
  17315. return this.loadPanosPromise;
  17316. var e = new y(this);
  17317. return this.loadPanosPromise = e.load().then(function(e) {
  17318. window.panoListOriData = e.map(a=>a.uuid) //包括!enabled的点
  17319. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  17320. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17321. else console.log(e.uuid)
  17322. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  17323. }
  17324. .bind(this))),
  17325. this.panos.extend(e.map(function(e) {
  17326. return new f(this,e.uuid,e,this.supportsTiles)
  17327. }
  17328. .bind(this))),
  17329. this.panos.forEach(function(i) {
  17330. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  17331. var t = this.panos.get(e);
  17332. t && this.panos.setNeighbour(i, t, !0)
  17333. }
  17334. .bind(this)),
  17335. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  17336. }
  17337. .bind(this)),
  17338. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  17339. this.supportedModes[s.PANORAMA] = !1),
  17340. $.when(this)
  17341. }
  17342. .bind(this)),
  17343. this.loadPanosPromise
  17344. }
  17345. ,
  17346. t.prototype.loadHighlightReel = function() {
  17347. var t = $.Deferred()
  17348. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17349. return a.get(e, {
  17350. responseType: "json",
  17351. auth: this.isPublic ? null : u.authorizationHeader
  17352. }).done(function(e) {
  17353. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  17354. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  17355. t.resolve()
  17356. }
  17357. .bind(this)).fail(function() {
  17358. R.warn("Getting highlight reel failed, no highlights available"),
  17359. t.resolve()
  17360. }),
  17361. t
  17362. }
  17363. ,
  17364. t.prototype.waitForLoad = function(e, t) {
  17365. t() || (this.waitQueue.push({
  17366. object: e,
  17367. isLoadedCallback: t
  17368. }),
  17369. 1 === this.waitQueue.length && this.emit("waiting"))
  17370. }
  17371. ,
  17372. t.prototype.hide = function() {
  17373. this.floors.hide()
  17374. }
  17375. ,
  17376. t.prototype.show = function() {
  17377. this.floors.show()
  17378. }
  17379. ,
  17380. t.prototype.floorNames = function() {
  17381. return this.floors.names()
  17382. }
  17383. ,
  17384. t.prototype.warpDestFloors = function(e, t) {
  17385. if (e && this.floors.length === e.length) {
  17386. var i = e.findIndex(function(e) {
  17387. return e
  17388. }
  17389. .bind(this));
  17390. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  17391. } else
  17392. this.toggleAllFloors(!0)
  17393. }
  17394. ,
  17395. t.prototype.setFloor = function(e, t, i) {
  17396. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17397. this.allFloorsVisible = !1,
  17398. this._setFloor(e, t, i)
  17399. }
  17400. ,
  17401. t.prototype.toggleAllFloors = function(e) {
  17402. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17403. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17404. this._setFloor(this.currentFloor)
  17405. }
  17406. ,
  17407. t.prototype._setFloor = function(e, t, i) {
  17408. var n;
  17409. if (t = t || this.mode,
  17410. this.emit("floor.changed", e, t, this.currentFloor),
  17411. this.currentFloor = e,
  17412. t === s.PANORAMA) {
  17413. if (this.show(),
  17414. this.shouldShowtags && this.tagsShown)
  17415. for (n in this.tags)
  17416. this.tags[n].show(u.showFloorDuration)
  17417. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17418. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17419. }
  17420. .bind(this)),
  17421. this.shouldShowtags && this.tagsShown))
  17422. for (n in this.tags) {
  17423. var r = this.tags[n];
  17424. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  17425. }
  17426. var o = this
  17427. , a = e;
  17428. A.start(function() {}, u.showFloorDelay, function() {
  17429. o.floors.forEach(function(t) {
  17430. t.chunks.forEach(function(e) {
  17431. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  17432. })
  17433. })
  17434. }
  17435. .bind(this))
  17436. }
  17437. ,
  17438. t.prototype.toggleExplode = function() {
  17439. this.floors.toggleExplodeHorizontal()
  17440. }
  17441. ,
  17442. t.prototype.toggleExplodeUp = function() {
  17443. this.floors.toggleExplodeVertical()
  17444. }
  17445. ,
  17446. t.prototype.nextFloor = function(e) {
  17447. return this.floors.nextFloor(this.currentFloor, e)
  17448. }
  17449. ,
  17450. t.prototype.addFloor = function(e) {
  17451. this.floors.add(e)
  17452. }
  17453. ,
  17454. t.prototype.getFloorAtPoint = function(e) {
  17455. return this.floors.getFloorAtPoint(e)
  17456. }
  17457. ,
  17458. t.prototype.getTagBySid = function(e) {
  17459. return this.tags[e]
  17460. }
  17461. ,
  17462. t.prototype.addChunk = function(e, t) {
  17463. this.floors.getOrMakeFloor(e).addChunk(t),
  17464. this.chunks.push(t)
  17465. }
  17466. ,
  17467. t.prototype.setMode = function(t) {
  17468. if (!this.supportedModes[t])
  17469. throw new x("Mode not supported for this model: " + t);
  17470. this.mode = t
  17471. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17472. this.chunks.forEach(function(e) {
  17473. e.setMode(t)
  17474. })
  17475. }
  17476. ,
  17477. t.prototype.build = function() {
  17478. this.heroLocations = this.images.getHeroLocations(this.panos);
  17479. var e = function() {
  17480. 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()
  17481. }
  17482. .bind(this)();
  17483. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17484. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17485. }
  17486. .bind(this)) || e,
  17487. null === this.heroImage && R.warn("No hero image defined."),
  17488. this.currentFloor = this.floors.last(),
  17489. this.floors.build(),
  17490. this.colliders = this.floors.reduce(function(e, t) {
  17491. return e.concat(t.collider.children)
  17492. }, []),
  17493. this.panos.forEach(function(e) {
  17494. e.build1(),
  17495. e.on("enter", function() {
  17496. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17497. }
  17498. .bind(this))
  17499. }
  17500. .bind(this)),
  17501. this.panos.forEach(function(e) {
  17502. e.build2()
  17503. }),
  17504. this.floors.forEach(function(e) {
  17505. this.boundingBox.union(e.boundingBox)
  17506. }
  17507. .bind(this)),
  17508. this.size = this.boundingBox.size(),
  17509. this.center = this.boundingBox.center(),
  17510. this.floors.forEach(function(e) {
  17511. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17512. }
  17513. .bind(this)),
  17514. this.panos.populate_path_graph(),
  17515. this.skybox = new n(this.boundingBox),
  17516. this.skybox.matrixWorldNeedsUpdate = !0,
  17517. this.add(this.skybox),
  17518. setTimeout(function() {
  17519. //this.hotsCount && this.shineHots()
  17520. Hot.beginShineHot()
  17521. }
  17522. .bind(this), 1300),
  17523. this.tags)
  17524. this.tags[t].build();
  17525. //add-----
  17526. console.log('计算visiblePanos开始,可能需要一段时间')
  17527. for(let i in this.hots){
  17528. this.hots[i].setVisiblePanos(this.hots[i].info.visiblePanos);
  17529. }
  17530. console.log('计算visiblePanos完毕')
  17531. //---------
  17532. return R.debug("Done building model"),
  17533. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17534. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17535. this.buildRooms(),
  17536. this.labels.associateWithRooms(this.rooms),
  17537. $.when(this)
  17538. }
  17539. ,
  17540. t.prototype.loadLabels = function() {
  17541. this.labels = new b(this);
  17542. var e = $.Deferred();
  17543. window.DATA.showingLabels ? this.showingLabels = true : '';
  17544. if (!this.showingLabels)
  17545. return e.resolve();
  17546. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17547. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17548. R.warn("Getting labels failed, not displaying labels."),
  17549. e.resolve()
  17550. }),
  17551. e
  17552. }
  17553. ,
  17554. t.prototype.buildRooms = function() {
  17555. this.rooms = new _(this),
  17556. this.rooms.createFromChunks(this.chunks),
  17557. this.rooms.calcRoomBoundaries()
  17558. }
  17559. ,
  17560. t.prototype.updateProjectedPanos = function() {
  17561. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17562. }
  17563. ,
  17564. t.prototype.setProjectedPanos = function(t, i, n) {
  17565. null != n || (n = !0),
  17566. n = !!n,
  17567. this.projectedPano0 = t,
  17568. this.projectedPano1 = i,
  17569. this.skybox.material.setProjectedPanos(t, i, n),
  17570. this.chunks.forEach(function(e) {
  17571. e.materialInside.setProjectedPanos(t, i, n)
  17572. })
  17573. }
  17574. ,
  17575. t.prototype.setSide = function(t) {
  17576. this.floors.forEach(function(e) {
  17577. e.collider.material.side = t
  17578. })
  17579. }
  17580. ,
  17581. t.prototype.heroCount = function() {
  17582. return this.heroLocations ? this.heroLocations.length : 0
  17583. }
  17584. ,
  17585. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17586. if (e[0] < 0)
  17587. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17588. null;
  17589. if (this.heroCount() < 1)
  17590. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17591. null;
  17592. var t = this.heroLocations[e[0]];
  17593. if(t.heroLocations && e[1]!=void 0){
  17594. t = t.heroLocations[e[1]];
  17595. }
  17596. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17597. null) : t
  17598. }
  17599. ,
  17600. t.prototype.findPanoramicHero = function() {
  17601. for (var e in this.heroLocations)
  17602. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17603. return this.heroLocations[e];
  17604. return null
  17605. }
  17606. ,
  17607. t.prototype.listImagePanos = function() {
  17608. var i = []
  17609. , n = this;
  17610. return this.images.forEach(function(e) {
  17611. if (e.metadata && e.metadata.scan_id) {
  17612. var t = n.panos.get(e.metadata.scan_id);
  17613. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17614. }
  17615. }),
  17616. i
  17617. }
  17618. ,
  17619. t.prototype.fadePanoMarkers = function(e, t) {
  17620. this.panos.fadeMarkerOpacity(e, t)
  17621. }
  17622. ,
  17623. t.prototype.setSweepVisibility = function(t) {
  17624. this.panos.forEach(function(e) {
  17625. e.marker && (e.marker.visible = t)
  17626. })
  17627. }
  17628. ,
  17629. t.prototype.outsideAllowed = function() {
  17630. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17631. }
  17632. ,
  17633. O.exports = t
  17634. }
  17635. ).call(this, "/js/model/Model.js")
  17636. }
  17637. , {
  17638. "../constants": 8,
  17639. "../enum/AlignmentType": 17,
  17640. "../enum/RenderOrder": 42,
  17641. "../enum/Viewmode": 51,
  17642. "../exception/BasicException": 55,
  17643. "../label/Label": 90,
  17644. "../loaders/ModelLoader": 105,
  17645. "../loaders/ModelTextureLoader": 106,
  17646. "../loaders/SweepDataLoader": 107,
  17647. "../tag/tag": 123,
  17648. "../tag/tagManager": 124,
  17649. "../objects/BoundingTextureSkybox": 143,
  17650. "../objects/Chunk": 144,
  17651. "../objects/Floor": 146,
  17652. "../objects/Panorama": 148,
  17653. "../objects/Room": 150,
  17654. "../objects/Snapshot": 153,
  17655. "../settings": 166,
  17656. "../shaders": 167,
  17657. "../util/ModelUrls": 177,
  17658. "../util/PanoramaCollection": 178,
  17659. "../util/ajax": 181,
  17660. "../util/common": 185,
  17661. "../util/easing": 186,
  17662. "../util/lerp": 188,
  17663. "../util/logger": 189,
  17664. "../util/math": 190,
  17665. "../util/texture": 194,
  17666. "../util/transitions": 195,
  17667. "./../util/browser": 182,
  17668. "./../util/showcase": 193,
  17669. "./Chunks": 135,
  17670. "./FloorCollection": 136,
  17671. "./ImageCollection": 137,
  17672. "./LabelCollection": 138,
  17673. "./RoomCollection": 141,
  17674. events: 202,
  17675. three: 217,
  17676. hot: "hot"
  17677. }],
  17678. 140: [function(e, t, i) {
  17679. "use strict";
  17680. function n() {
  17681. this.modelMap = {},
  17682. this.activeModel = null,
  17683. this.modelCount = 0,
  17684. this.tileDownloader = null,
  17685. this.panoRenderer = null
  17686. }
  17687. var r = (e("three"),
  17688. e("../util/common"))
  17689. , o = e("../exception/BasicException")
  17690. , a = e("../enum/ModelManagerEvents")
  17691. , s = e("../enum/PanoRendererEvents")
  17692. , l = e("events").EventEmitter;
  17693. n.prototype.init = function(e, t, i) {
  17694. this.tileDownloader = e,
  17695. this.panoRenderer = t,
  17696. this.qualityManager = i,
  17697. this.bindEvents()
  17698. }
  17699. ,
  17700. n.prototype.bindEvents = function() {
  17701. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17702. }
  17703. ,
  17704. n.prototype.onTileRendered = function(e, t, i, n) {}
  17705. ,
  17706. n.prototype.addModel = function(e) {
  17707. this.modelMap[e.sid] = e,
  17708. 0 === this.modelCount && this.activateModel(e.sid),
  17709. this.modelCount++,
  17710. this.emit(a.ModelAdded)
  17711. }
  17712. ,
  17713. n.prototype.getModel = function(e) {
  17714. return this.modelMap[e]
  17715. }
  17716. ,
  17717. n.prototype.activateModel = function(e) {
  17718. var t = this.modelMap[e];
  17719. if (!t)
  17720. throw new o("Tried to activate invalid model!");
  17721. var i = this.activeModel;
  17722. this.activeModel = t,
  17723. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17724. this.tileDownloader.setUrls(t.urls),
  17725. t.panos.forEach(function(e) {
  17726. e.attachToPanoRenderer(this.panoRenderer),
  17727. e.tileDownloader = this.tileDownloader,
  17728. e.qualityManager = this.qualityManager
  17729. }
  17730. .bind(this)),
  17731. this.emit(a.ActiveModelChanged, {
  17732. oldModel: i,
  17733. model: t
  17734. })
  17735. }
  17736. ,
  17737. n.prototype.getActiveModel = function() {
  17738. return this.activeModel
  17739. }
  17740. ,
  17741. r.extend(n, l),
  17742. t.exports = n
  17743. }
  17744. , {
  17745. "../enum/ModelManagerEvents": 33,
  17746. "../enum/PanoRendererEvents": 35,
  17747. "../exception/BasicException": 55,
  17748. "../util/common": 185,
  17749. events: 202,
  17750. three: 217
  17751. }],
  17752. 141: [function(r, l, e) {
  17753. (function(e) {
  17754. "use strict";
  17755. function o() {
  17756. n.call(this)
  17757. }
  17758. var a = r("../objects/Room")
  17759. , t = (r("../settings"),
  17760. r("../util/logger"))
  17761. , i = (r("../util/transitions"),
  17762. r("../util/easing"),
  17763. r("../util/common"))
  17764. , n = r("../util/IndexedCollection")
  17765. , s = r("./Chunks");
  17766. new t(e),
  17767. i.inherit(o, n),
  17768. o.prototype.getIndex = function(e) {
  17769. return e.roomId
  17770. }
  17771. ,
  17772. o.prototype.calcRoomBoundaries = function() {
  17773. this.forEach(function(e) {
  17774. e.calcBoundaries()
  17775. })
  17776. }
  17777. ,
  17778. o.prototype.createFromChunks = function(e) {
  17779. var n = {
  17780. floorId: -1,
  17781. roomId: -1
  17782. }
  17783. , r = {};
  17784. e.forEach(function(e) {
  17785. s.parseIdsFromChunkName(e.name, n);
  17786. var t = r[n.roomId];
  17787. if (!t) {
  17788. var i = o.generateRoomId(n.floorId, n.roomId);
  17789. t = new a(n.floorId,i),
  17790. this.add(t),
  17791. r[n.roomId] = t
  17792. }
  17793. t.addChunk(e)
  17794. }
  17795. .bind(this)),
  17796. this.calcRoomBoundaries()
  17797. }
  17798. ,
  17799. o.generateRoomId = function(e, t) {
  17800. return e + "_" + t
  17801. }
  17802. ,
  17803. l.exports = o
  17804. }
  17805. ).call(this, "/js/model/RoomCollection.js")
  17806. }
  17807. , {
  17808. "../objects/Room": 150,
  17809. "../settings": 166,
  17810. "../util/IndexedCollection": 175,
  17811. "../util/common": 185,
  17812. "../util/easing": 186,
  17813. "../util/logger": 189,
  17814. "../util/transitions": 195,
  17815. "./Chunks": 135
  17816. }],
  17817. 142: [function(e, t, i) {
  17818. "use strict";
  17819. function n(e, t, i) {
  17820. var n = (e = e.clone().expandByScalar(0.01)).size()
  17821. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17822. r.boundingBox = e,
  17823. o.Mesh.call(this, r, t),
  17824. this.position.copy(e.center()),
  17825. this.frustumCulled = !1,
  17826. i && this.add(new o.WireframeHelper(this))
  17827. }
  17828. var o = e("three");
  17829. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17830. t.exports = n
  17831. }
  17832. , {
  17833. three: 217
  17834. }],
  17835. 143: [function(l, c, e) {
  17836. (function(e) {
  17837. "use strict";
  17838. function t(e) {
  17839. s.time("Computing a nice bounding cubemap");
  17840. var t = new r({
  17841. side: i.BackSide,
  17842. transparent: !0
  17843. });
  17844. t.uniforms.modelAlpha.value = 0,
  17845. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17846. this.renderOrder = a.boundingSkybox,
  17847. n.call(this, e, t),
  17848. s.timeEnd("Computing a nice bounding cubemap")
  17849. }
  17850. var i = l("three")
  17851. , n = (l("../enum/Viewmode"),
  17852. l("../shaders"),
  17853. l("./BoundingMesh"))
  17854. , r = l("../materials/ModelTextureMaterial")
  17855. , o = l("../settings")
  17856. , a = l("../enum/RenderOrder")
  17857. , s = new (l("../util/logger"))(e);
  17858. (t.prototype = Object.create(n.prototype)).constructor = t,
  17859. c.exports = t
  17860. }
  17861. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17862. }
  17863. , {
  17864. "../enum/RenderOrder": 42,
  17865. "../enum/Viewmode": 51,
  17866. "../materials/ModelTextureMaterial": 118,
  17867. "../settings": 166,
  17868. "../shaders": 167,
  17869. "../util/logger": 189,
  17870. "./BoundingMesh": 142,
  17871. three: 217
  17872. }],
  17873. 144: [function(e, t, i) {
  17874. "use strict";
  17875. function n(e) {
  17876. this.materialInside = new s({
  17877. side: r.DoubleSide
  17878. });
  17879. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17880. this.materialOutside = new r.RawShaderMaterial({
  17881. fragmentShader: o.modelOutside.fragmentShader,
  17882. vertexShader: o.modelOutside.vertexShader,
  17883. uniforms: t,
  17884. side: r.FrontSide,
  17885. name: "chunkOut"
  17886. }),
  17887. r.Mesh.call(this, e.geometry, this.materialInside),
  17888. this.name = e.name || "",
  17889. this.textureName = e.textureName,
  17890. this.meshUrl = e.meshUrl
  17891. }
  17892. var r = e("three")
  17893. , o = e("../shaders")
  17894. , a = e("../enum/Viewmode")
  17895. , s = e("../materials/ModelTextureMaterial");
  17896. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17897. this.materialInside.uniforms.map.value = e,
  17898. this.materialOutside.uniforms.map.value = e
  17899. }
  17900. ,
  17901. n.prototype.setMode = function(e) {
  17902. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17903. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17904. t.transparent = this.material.transparent,
  17905. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17906. this.material = t
  17907. }
  17908. ,
  17909. t.exports = n
  17910. }
  17911. , {
  17912. "../enum/Viewmode": 51,
  17913. "../materials/ModelTextureMaterial": 118,
  17914. "../shaders": 167,
  17915. three: 217
  17916. }],
  17917. 145: [function(e, t, i) {
  17918. "use strict";
  17919. function n(e) {
  17920. this.chunksize = e || 10,
  17921. this.chunks = {},
  17922. this.boundingBoxes = {},
  17923. this.children = [],
  17924. this.offset = new m.Vector3(0,.5,0),
  17925. this.material = new m.MeshBasicMaterial({
  17926. color: 16777215 * Math.random(),
  17927. side: m.DoubleSide
  17928. })
  17929. }
  17930. var m = e("three");
  17931. e("../enum/Viewmode"),
  17932. n.prototype.add = function(e) {
  17933. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17934. u ? (t = u.position.array,
  17935. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17936. e.faces);
  17937. var d = new m.Vector3;
  17938. if (i)
  17939. for (n = 0,
  17940. r = i.length; n < r; n += 3) {
  17941. var p = 3 * i[n]
  17942. , f = 3 * i[n + 1]
  17943. , g = 3 * i[n + 2];
  17944. o = (t[p] + t[f] + t[g]) / 3,
  17945. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17946. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17947. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17948. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17949. this.boundingBoxes[l] = new m.Box3),
  17950. 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]),
  17951. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17952. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17953. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17954. }
  17955. else
  17956. for (n = 0,
  17957. r = t.length; n < r; n += 9)
  17958. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17959. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17960. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17961. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17962. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17963. this.boundingBoxes[l] = new m.Box3),
  17964. 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]),
  17965. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17966. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17967. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17968. }
  17969. ,
  17970. n.prototype.build = function() {
  17971. var e = new m.Object3D;
  17972. for (var t in e.material = this.material,
  17973. this.chunks) {
  17974. var i = this.chunks[t]
  17975. , n = new m.BufferGeometry;
  17976. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17977. n.boundingBox = this.boundingBoxes[t];
  17978. var r = new m.Mesh(n,this.material);
  17979. r.material.visible = !1,
  17980. e.add(r),
  17981. this.chunks[t] = []
  17982. }
  17983. return e
  17984. }
  17985. ,
  17986. t.exports = n
  17987. }
  17988. , {
  17989. "../enum/Viewmode": 51,
  17990. three: 217
  17991. }],
  17992. 146: [function(e, t, i) {
  17993. "use strict";
  17994. var n = e("three")
  17995. , r = e("../settings")
  17996. , o = e("../util/common")
  17997. , a = e("../util/lerp")
  17998. , s = e("./ChunkedCollider")
  17999. , l = e("../util/transitions")
  18000. , c = e("../util/easing")
  18001. , h = (e("../objects/Panorama"),
  18002. e("../enum/RenderOrder"));
  18003. e("../localization/localize");
  18004. function u(e, t, i) {
  18005. n.Object3D.call(this),
  18006. this.model = e,
  18007. this.floorIndex = t,
  18008. this.lang = r.languageTag,
  18009. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  18010. this.panos = [],
  18011. this.chunks = [],
  18012. this.colliderBuilder = new s(3),
  18013. this.collider = null,
  18014. this.center = null,
  18015. this.boundingBox = new n.Box3,
  18016. this.size = null,
  18017. this.hidden = !1,
  18018. this.conservativeBoundingBox = new n.Box3,
  18019. this.debugColor = 16777215 * Math.random(),
  18020. this.transition = null
  18021. }
  18022. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  18023. this.model.setFloor(this, e)
  18024. }
  18025. ,
  18026. u.prototype.hide = function(e) {
  18027. if (!this.hidden || this.transition) {
  18028. this.chunks.forEach(function(e) {
  18029. e.material.transparent = !0
  18030. }),
  18031. l.cancel(this.transition);
  18032. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  18033. , i = e ? 0 : r.hideFloorDelay / t;
  18034. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  18035. this.hidden = !0
  18036. }
  18037. .bind(this), i, c.easeInOutQuad)
  18038. }
  18039. }
  18040. ,
  18041. u.prototype.show = function(e) {
  18042. if (this.hidden || this.transition) {
  18043. this.hidden = !1,
  18044. l.cancel(this.transition);
  18045. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  18046. , i = e ? 0 : r.showFloorDelay / t;
  18047. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  18048. this.hidden || this.chunks.forEach(function(e) {
  18049. e.material.transparent = !1
  18050. })
  18051. }
  18052. .bind(this), i, c.easeInOutQuad)
  18053. }
  18054. }
  18055. ,
  18056. u.prototype.toggle = function(e, t) {
  18057. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  18058. }
  18059. ,
  18060. u.prototype.containsPoint = function(t) {
  18061. return this.collider.children.some(function(e) {
  18062. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  18063. e.geometry.boundingBox.containsPoint(t)
  18064. })
  18065. }
  18066. ,
  18067. u.prototype.distanceToPoint = function(i) {
  18068. var n = null
  18069. , r = 1 / 0;
  18070. return this.collider.children.forEach(function(e) {
  18071. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  18072. var t = e.geometry.boundingBox.distanceToPoint(i);
  18073. (!n || t < r) && (r = t,
  18074. n = e)
  18075. }),
  18076. r
  18077. }
  18078. ,
  18079. u.prototype.addChunk = function(e) {
  18080. e.renderOrder = h.ghostFloor,
  18081. this.add(e),
  18082. this.chunks.push(e),
  18083. this.boundingBox.union(e.geometry.boundingBox),
  18084. this.size = this.boundingBox.size(),
  18085. this.colliderBuilder.add(e.geometry)
  18086. }
  18087. ,
  18088. u.prototype.addPano = function(e) {
  18089. this.panos.push(e),
  18090. this.add(e.skyboxMesh),
  18091. e.marker && this.add(e.marker);
  18092. var t = new n.Vector3(1,1,1)
  18093. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  18094. this.boundingBox.union(i)
  18095. }
  18096. ,
  18097. u.prototype.build = function() {
  18098. this.collider = this.colliderBuilder.build(!0),
  18099. this.add(this.collider),
  18100. this.center = this.boundingBox.center(),
  18101. this.conservativeBoundingBox.copy(this.boundingBox),
  18102. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  18103. return e.geometry.boundingBox.min.y
  18104. }), 5),
  18105. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  18106. return e.geometry.boundingBox.max.y
  18107. }), 5),
  18108. this.colliderBuilder = null
  18109. }
  18110. ,
  18111. u.prototype.toShortString = function() {
  18112. return o.nth(this.floorIndex + 1)
  18113. }
  18114. ,
  18115. u.prototype.toString = function() {
  18116. return this.name
  18117. }
  18118. ,
  18119. t.exports = u
  18120. }
  18121. , {
  18122. "../enum/RenderOrder": 42,
  18123. "../localization/localize": 108,
  18124. "./strings-cn-CN": 109,
  18125. "../objects/Panorama": 148,
  18126. "../settings": 166,
  18127. "../util/common": 185,
  18128. "../util/easing": 186,
  18129. "../util/lerp": 188,
  18130. "../util/transitions": 195,
  18131. "./ChunkedCollider": 145,
  18132. three: 217
  18133. }],
  18134. 147: [function(e, t, i) {
  18135. "use strict";
  18136. function n(e) {
  18137. this.player = e,
  18138. this.obj3d = null,
  18139. this.UP = new u.Vector3(0,1,0)
  18140. }
  18141. var u = e("three")
  18142. , d = e("../settings");
  18143. n.prototype.prefs = {
  18144. linewidth: 3,
  18145. height: .07,
  18146. opacity: .45,
  18147. endScale: .05
  18148. },
  18149. n.prototype.discard = function() {
  18150. if (this.obj3d) {
  18151. var e = this.obj3d.parent;
  18152. e && e.remove(this.obj3d)
  18153. }
  18154. this.obj3d = null
  18155. }
  18156. ,
  18157. n.prototype.draw = function() {
  18158. if (this.discard(),
  18159. d.showNeighbors) {
  18160. var e = this.player.currentPano.floor;
  18161. this.obj3d = new u.Object3D;
  18162. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18163. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18164. i.y += this.prefs.height;
  18165. var n = .1525
  18166. , r = new u.Matrix4;
  18167. for (var o in t)
  18168. if (t[o]) {
  18169. var a = this.player.model.panos.get(o)
  18170. , s = (a.position.clone().sub(this.player.model.position),
  18171. a.position.clone().sub(a.floorPosition))
  18172. , l = a.floorPosition.clone().sub(this.player.model.position);
  18173. l.y += this.prefs.height;
  18174. var c = new u.Geometry;
  18175. 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)),
  18176. 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)),
  18177. r.identity().setPosition(s),
  18178. c.applyMatrix(r),
  18179. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  18180. 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)),
  18181. r.lookAt(l, i, this.UP).setPosition(l),
  18182. c.applyMatrix(r),
  18183. c.vertices.push(l, i);
  18184. var h = new u.Line(c,new u.LineBasicMaterial({
  18185. color: a.debugColor.getHex(),
  18186. transparent: !0,
  18187. opacity: this.prefs.opacity,
  18188. depthWrite: !1,
  18189. name: "sLine" + o,
  18190. linewidth: this.prefs.linewidth
  18191. }));
  18192. this.obj3d.add(h)
  18193. }
  18194. e.add(this.obj3d)
  18195. }
  18196. }
  18197. ,
  18198. n.prototype.update = function() {
  18199. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18200. }
  18201. ,
  18202. t.exports = n
  18203. }
  18204. , {
  18205. "../settings": 166,
  18206. three: 217
  18207. }],
  18208. 148: [function(S, M, e) {
  18209. (function(e) {
  18210. "use strict";
  18211. function r(e, t, i, n) {
  18212. this.model = e,
  18213. this.id = t,
  18214. this.alignmentType = i.alignmentType || c.ALIGNED,
  18215. this.neighbourUUIDs = i.neighbours,
  18216. this.neighbourPanos = null,
  18217. this.floor = null,
  18218. this.floorIndex = i.floor,
  18219. this.failedLoadingAt = 0,
  18220. this.maxLoadRetries = 4,
  18221. this.origin = i.position.clone(),
  18222. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  18223. this.quaternion = i.quaternion.clone(),
  18224. this.skyboxMesh = new s.Mesh(E),
  18225. this.skyboxMesh.position.copy(this.position),
  18226. this.skyboxMesh.quaternion.copy(this.quaternion),
  18227. this.skyboxMesh.name = "skybox",
  18228. this.skyboxMesh.visible = !1,
  18229. this.skyboxMesh.updateMatrix(),
  18230. this.skyboxMesh.updateMatrixWorld(),
  18231. this.marker = null,
  18232. this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker,
  18233. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  18234. map: b,
  18235. side: s.DoubleSide,
  18236. opacity: 0,
  18237. transparent: !0,
  18238. depthWrite: !1
  18239. })),
  18240. this.marker.visible = this.showFloorMarker,
  18241. this.marker.renderOrder = l.panoMarker,
  18242. this.marker.name = "marker",
  18243. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  18244. this.marker.updateMatrixWorld(),
  18245. a.colorMarkerOnLoad && this.on("load", function() {
  18246. this.marker.material.color.set(65280)
  18247. })),
  18248. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18249. this.floorPosition = i.puck ? i.puck.clone() : null,
  18250. this.tiled = n,
  18251. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  18252. this.solidSkybox.flipY = !1,
  18253. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  18254. this.solidSkybox.magFilter = s.LinearFilter,
  18255. this.solidSkybox.generateMipmaps = !1)),
  18256. this.zoomed = !1,
  18257. this.panoRenderer = null,
  18258. this.qualityManager = null,
  18259. this.tileDownloader = null,
  18260. this.tiledPanoRenderTarget = null,
  18261. this.minimumTiledPanoLoaded = !1,
  18262. this.highestPartialTileRenderOpCompleted = 0,
  18263. this.highestFullTileRenderOpCompleted = 0,
  18264. this.shouldRedrawOnBaseLoaded = !1,
  18265. this.lockUntilRenderingComplete = !1,
  18266. a.colorMarkerOnLoad && this.on("load", function() {
  18267. this.marker.material.color.set(65280)
  18268. }),
  18269. (e = new s.TextureLoader).setCrossOrigin(!0);
  18270. var r = e.load("images/texture.jpg");
  18271. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  18272. color: 16777215,
  18273. transparent: !0,
  18274. opacity: .75,
  18275. map: r
  18276. })),
  18277. this.vrMarker.boluoType = "vr",
  18278. this.vrMarker.position.z = 1,
  18279. this.vrMarker.enabled = !0,
  18280. this.vrMarker.visible = !1,
  18281. window.vrMarkers = window.vrMarkers || [],
  18282. window.vrMarkers.push(this.vrMarker),
  18283. this.marker && this.marker.add(this.vrMarker),
  18284. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  18285. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  18286. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  18287. this.adjustAngleEnable) {
  18288. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  18289. this.skyboxMesh.quaternion.multiply(i);
  18290. var o = new s.Quaternion;
  18291. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  18292. this.skyboxMesh.quaternion.multiply(o),
  18293. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  18294. this.skyboxMesh.quaternion.multiply(n),
  18295. this.skyboxMesh.updateMatrix(),
  18296. this.skyboxMesh.updateMatrixWorld(),
  18297. this.model.updateProjectedPanos()
  18298. }
  18299. }
  18300. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  18301. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  18302. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  18303. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  18304. S("../enum/GLCubeFaces"),
  18305. 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");
  18306. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  18307. function() {
  18308. this.setZoomed(!1),
  18309. this.emit("enter", {
  18310. oldPano: t,
  18311. newPano: this
  18312. }),
  18313. t = this
  18314. }
  18315. ),
  18316. r.prototype.exit = function() {
  18317. this.tiled ? (this.clearWaitDeferreds(),
  18318. this.minimumTiledPanoLoaded = !1,
  18319. this.tiledPanoRenderTarget = null,
  18320. this.setZoomed(!1),
  18321. this.panoRenderer.deactivateTiledPano(this),
  18322. this.highestPartialTileRenderOpCompleted = 0,
  18323. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18324. this.solidSkybox.loaded = !1,
  18325. this.solidSkybox.version = 0),
  18326. this.emit("exit")
  18327. }
  18328. ,
  18329. r.prototype.hoverOn = function(e) {
  18330. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18331. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18332. }
  18333. ,
  18334. r.prototype.hoverOff = function(e) {
  18335. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18336. }
  18337. ,
  18338. r.prototype.build1 = function() {
  18339. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18340. this.floor.addPano(this),
  18341. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18342. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18343. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18344. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  18345. }
  18346. ,
  18347. r.prototype.build2 = function() {
  18348. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18349. this.height = this.position.distanceTo(this.floorPosition),
  18350. this.placeMarker()
  18351. }
  18352. ,
  18353. r.prototype.interpolateFloorPosition = function() {
  18354. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18355. return !!e.floorPosition
  18356. }).sort(function(e, t) {
  18357. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18358. }
  18359. .bind(this))
  18360. , t = this.position.clone();
  18361. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18362. t
  18363. }
  18364. ,
  18365. r.prototype.raycastFloorPosition = function() {
  18366. I.warn("Performance warning: Raycasting to find floor position");
  18367. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  18368. return e.length ? e[0].point : null
  18369. }
  18370. ,
  18371. 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)],
  18372. function() {
  18373. I.warn("Performance warning: Raycasting to find floor index");
  18374. for (var e = 0; e < i.length; e++) {
  18375. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  18376. if (t.length)
  18377. return t[0].object.parent.parent
  18378. }
  18379. return null
  18380. }
  18381. ),
  18382. r.prototype.placeMarker = function() {
  18383. this.marker && (this.marker.position.copy(this.floorPosition),
  18384. this.marker.position.y += .05,
  18385. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  18386. }
  18387. ,
  18388. r.prototype.translate = function(e) {
  18389. this.position.add(e),
  18390. this.floorPosition.add(e)
  18391. }
  18392. ,
  18393. r.prototype.findClosestMidtpointPanoTo = function(e) {
  18394. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  18395. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  18396. }
  18397. ,
  18398. r.prototype.attachToPanoRenderer = function(e) {
  18399. this.panoRenderer = e,
  18400. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18401. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18402. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18403. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18404. }
  18405. ;
  18406. var w, T, x = {};
  18407. r.prototype.getWaitDeferred = function(e) {
  18408. var t = x[this.id];
  18409. t || (t = {},
  18410. x[this.id] = t);
  18411. var i = t[e];
  18412. return i || (i = {
  18413. deferred: $.Deferred(),
  18414. active: !1
  18415. },
  18416. t[e] = i),
  18417. i
  18418. }
  18419. ,
  18420. r.prototype.resetWaitDeferred = function(e) {
  18421. var t = this.getWaitDeferred(e);
  18422. t.active = !1,
  18423. t.deferred = $.Deferred()
  18424. }
  18425. ,
  18426. r.prototype.clearWaitDeferreds = function() {
  18427. var e = x[this.id];
  18428. for (var t in e || (e = {},
  18429. x[this.id] = e),
  18430. e)
  18431. if (e.hasOwnProperty(t)) {
  18432. var i = e[t];
  18433. i.active = !1,
  18434. i.deferred = $.Deferred()
  18435. }
  18436. }
  18437. ,
  18438. r.prototype.loadTiledPano = (new s.Vector3,
  18439. w = [],
  18440. T = [],
  18441. function(e, t, i, n, r, o) {
  18442. null != n || (n = !0),
  18443. null != r || (r = !0);
  18444. var a = this.getWaitDeferred(e)
  18445. , s = a.deferred
  18446. , l = null
  18447. , c = null;
  18448. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  18449. c = i.vFov)),
  18450. !this.isLoaded(e)) {
  18451. if (!a.active) {
  18452. if (a.active = !0,
  18453. i) {
  18454. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18455. w[this.id + ":" + e] = {
  18456. tileCount: 0,
  18457. targetTileCount: h
  18458. },
  18459. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18460. }
  18461. T[this.id] || (T[this.id] = !0,
  18462. this.on(f.LoadComplete, function(e, t) {
  18463. var i = this.getWaitDeferred(e).deferred;
  18464. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18465. this.resetWaitDeferred(e))
  18466. }
  18467. .bind(this)),
  18468. this.on(f.LoadFailed, function(e) {
  18469. var t = this.getWaitDeferred(e).deferred;
  18470. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18471. this.resetWaitDeferred(e))
  18472. }
  18473. .bind(this)),
  18474. this.on(f.TileLoaded, function(e, t, i) {
  18475. var n = this.getWaitDeferred(e).deferred;
  18476. if (n && "pending" === n.state()) {
  18477. n.notify(e, t, i);
  18478. var r = w[this.id + ":" + e];
  18479. r && (r.tileCount++,
  18480. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18481. n.resolve(e, i),
  18482. this.resetWaitDeferred(e)))
  18483. }
  18484. }
  18485. .bind(this)))
  18486. }
  18487. this.tileDownloader.clearForceQueue(),
  18488. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18489. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18490. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18491. }
  18492. return s.promise()
  18493. }
  18494. ),
  18495. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18496. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18497. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18498. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18499. }
  18500. ,
  18501. r.prototype.onTileRendered = function(e, t, i, n) {
  18502. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18503. }
  18504. ,
  18505. r.prototype.onPanoRendered = function(e, t, i, n) {
  18506. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18507. this.updateSkyboxForZoomLevel(),
  18508. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18509. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18510. this.emit("load", t),
  18511. this.model.emit("load", this),
  18512. this.emit(f.LoadComplete, t, i))
  18513. }
  18514. ,
  18515. r.prototype.setZoomed = function(e) {
  18516. this.zoomed = e,
  18517. this.updateSkyboxForZoomLevel()
  18518. }
  18519. ,
  18520. r.prototype.ensureSkyboxReadyForRender = function() {
  18521. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18522. this.solidSkybox.loaded = !0)
  18523. }
  18524. ,
  18525. r.prototype.updateSkyboxForZoomLevel = function() {
  18526. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18527. }
  18528. ,
  18529. r.prototype.getSkyboxTexture = function() {
  18530. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18531. }
  18532. ,
  18533. r.prototype.onTileRenderFail = function(e, t, i) {
  18534. e === this.id && this.emit(f.LoadFailed, t)
  18535. }
  18536. ,
  18537. r.prototype.isLoaded = function(e) {
  18538. if (this.tiled) {
  18539. if (e && "string" == typeof e)
  18540. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18541. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18542. }
  18543. if (e && "number" == typeof e)
  18544. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18545. return !!this.solidSkybox.high || e in this.solidSkybox
  18546. }
  18547. ,
  18548. r.prototype.loadCube = function(a) {
  18549. if (this.isLoaded(a))
  18550. return I.info("Skipping load of pano, already loaded"),
  18551. $.when();
  18552. this.emit("loading", a),
  18553. this.model.emit("loading", this);
  18554. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18555. , e = n.filter(function(e) {
  18556. return !e
  18557. });
  18558. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18559. a = "high",
  18560. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18561. var t = 0
  18562. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18563. return u.getImage(n[t])
  18564. }
  18565. .bind(this));
  18566. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18567. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18568. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18569. this.solidSkybox.low = null),
  18570. this.solidSkybox.needsUpdate = !0,
  18571. this.emit("load", a),
  18572. this.model.emit("load", this),
  18573. this
  18574. }
  18575. .bind(this), function() {
  18576. I.error("Downloading cubemap for pano", this.id, "failed"),
  18577. this.failedLoadingAt = Date.now()
  18578. }
  18579. .bind(this), function() {
  18580. return $.when(++t, 6)
  18581. })
  18582. }
  18583. ,
  18584. r.raycastsSkipped = 0,
  18585. r.raycastsDone = 0,
  18586. r.prototype.findNeighourPanos = function() {
  18587. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18588. this.model.panos.forEach(function(e) {
  18589. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18590. var t = this.position.distanceTo(e.position);
  18591. if (t > a.panoramaNeighbourMaxDistance)
  18592. return this.model.panos.setNeighbour(this, e, !1),
  18593. void r.raycastsSkipped++;
  18594. var i = e.position.clone().sub(this.position).normalize()
  18595. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18596. r.raycastsDone++,
  18597. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18598. 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)))
  18599. }
  18600. }
  18601. .bind(this)),
  18602. this.model.panos.neighbourMap[this.id]
  18603. }
  18604. ,
  18605. r.prototype.worldPosition = function() {
  18606. return this.position
  18607. }
  18608. ,
  18609. r.prototype.addTextSprite = function(e, color, parent) {
  18610. this.removeTextSprite();
  18611. var ratio = 16;
  18612. var i = document.createElement("canvas")
  18613. , n = i.getContext("2d");
  18614. i.width = 1024,
  18615. i.height = i.width / ratio;
  18616. n.font = " 30px Arial",
  18617. n.fillStyle = "white";
  18618. var r = n.measureText(e).width;
  18619. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18620. var o = new s.Texture(i);
  18621. o.needsUpdate = !0;
  18622. var a = new s.SpriteMaterial({
  18623. map: o,
  18624. color: color || 16428055,
  18625. depthTest:false
  18626. });
  18627. this.text3d = new s.Sprite(a)
  18628. if(parent){
  18629. parent.add(this.text3d)
  18630. }else{
  18631. this.text3d.position.copy(this.skyboxMesh.position)
  18632. this.floor.add(this.text3d)
  18633. }
  18634. var scale = 5
  18635. this.text3d.scale.y = scale/ratio
  18636. this.text3d.scale.x = scale
  18637. }
  18638. ,
  18639. r.prototype.removeTextSprite = function() {
  18640. this.text3d && (this.text3d.parent.remove(this.text3d),
  18641. this.text3d.material.map.dispose(),
  18642. this.text3d = null)
  18643. }
  18644. ,
  18645. r.prototype.isAligned = function() {
  18646. return this.alignmentType === c.ALIGNED
  18647. }
  18648. ,
  18649. r.filters = {
  18650. inDirection: function(t, i, n) {
  18651. return function(e) {
  18652. return e.position.clone().sub(t).normalize().dot(i) > n
  18653. }
  18654. },
  18655. inFloorDirection: function(t, i, n) {
  18656. return function(e) {
  18657. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18658. }
  18659. },
  18660. inPanoDirection: function(n, r, o) {
  18661. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18662. function(e) {
  18663. var t = e.floorPosition.clone().sub(n).normalize()
  18664. , i = e.position.clone().sub(n).normalize();
  18665. return t.dot(r) > o || i.dot(r) > o
  18666. }
  18667. },
  18668. atFloor: function(t) {
  18669. return function(e) {
  18670. return !t || e.floor === t
  18671. }
  18672. },
  18673. not: function(t) {
  18674. return function(e) {
  18675. return e !== t
  18676. }
  18677. },
  18678. notIn: function(t) {
  18679. return function(e) {
  18680. return -1 === t.indexOf(e)
  18681. }
  18682. },
  18683. isLoaded: function() {
  18684. return function(e) {
  18685. return e.isLoaded()
  18686. }
  18687. },
  18688. isNotLoaded: function() {
  18689. return function(e) {
  18690. return !e.isLoaded()
  18691. }
  18692. },
  18693. isCloseEnoughTo: function(t, i) {
  18694. return function(e) {
  18695. return t.distanceTo(e.floorPosition) < i
  18696. }
  18697. },
  18698. hasMinimumHeightDifferenceTo: function(t, i) {
  18699. return function(e) {
  18700. return Math.abs(e.position.y - t.y) > i
  18701. }
  18702. },
  18703. isNotBehindNormal: function(t, i) {
  18704. var n = new s.Vector3;
  18705. return i = i.clone(),
  18706. function(e) {
  18707. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18708. }
  18709. },
  18710. isNeighbourPanoTo: function(t) {
  18711. return function(e) {
  18712. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18713. }
  18714. },
  18715. isNeighbourOfNeighbourTo: function(n) {
  18716. return function(i) {
  18717. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18718. var t = n.model.panos.get(e);
  18719. return !!t && t.neighbourPanos[i.id]
  18720. })
  18721. }
  18722. },
  18723. isNotRecentlyFailed: function(t) {
  18724. return function(e) {
  18725. return Date.now() - e.failedLoadingAt > t
  18726. }
  18727. },
  18728. isOnVisibleFloor: function() {
  18729. return function(e) {
  18730. return !e.floor.hidden
  18731. }
  18732. },
  18733. isPanoAligned: function() {
  18734. return function(e) {
  18735. return e.isAligned()
  18736. }
  18737. }
  18738. },
  18739. r.sortFunctions = {
  18740. distanceToPoint: function(i) {
  18741. return function(e, t) {
  18742. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18743. }
  18744. },
  18745. floorDistanceToPoint: function(i) {
  18746. return function(e, t) {
  18747. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18748. }
  18749. },
  18750. choose: function(i) {
  18751. return function(e, t) {
  18752. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18753. }
  18754. }
  18755. },
  18756. r.scoreFunctions = {
  18757. distance: function(t, i) {
  18758. return i = i || a.navigation.distanceFactor,
  18759. function(e) {
  18760. return t ? t.position.distanceTo(e.position) * i : 0
  18761. }
  18762. },
  18763. distanceSquared: function(t, i) {
  18764. return i = i || a.navigation.distanceFactor,
  18765. function(e) {
  18766. return t ? t.position.distanceToSquared(e.position) * i : 0
  18767. }
  18768. },
  18769. direction: function(t, i) {
  18770. return function(e) {
  18771. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18772. }
  18773. },
  18774. angle: function(t, i) {
  18775. return function(e) {
  18776. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18777. }
  18778. },
  18779. inFieldOfView: function(t, i) {
  18780. return function(e) {
  18781. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18782. }
  18783. },
  18784. optionality: function(t) {
  18785. return function(e) {
  18786. return e.neighbourUUIDs.filter(function(e) {
  18787. return !(e in t.neighbourUUIDs) && e !== t.id
  18788. }).length * a.navigation.optionalityFactor
  18789. }
  18790. },
  18791. penalizeHeightDifferenceUnder: function(t, i) {
  18792. return function(e) {
  18793. return t.y - e.position.y < i ? -20 : 0
  18794. }
  18795. }
  18796. },
  18797. M.exports = r
  18798. }
  18799. ).call(this, "/js/objects/Panorama.js")
  18800. }
  18801. , {
  18802. "../enum/AlignmentType": 17,
  18803. "../enum/GLCubeFaces": 25,
  18804. "../enum/PanoRendererEvents": 35,
  18805. "../enum/PanoSizeClass": 36,
  18806. "../enum/PanoramaEvents": 37,
  18807. "../enum/RenderLayers": 41,
  18808. "../enum/RenderOrder": 42,
  18809. "../enum/TileDownloaderEvents": 45,
  18810. "../enum/Viewmode": 51,
  18811. "../exception/BasicException": 55,
  18812. "../scene/SceneRenderer": 158,
  18813. "../settings": 166,
  18814. "../tile/TileUtils": 174,
  18815. "../util/ajax": 181,
  18816. "../util/common": 185,
  18817. "../util/lerp": 188,
  18818. "../util/logger": 189,
  18819. "../util/panorama": 191,
  18820. "../util/texture": 194,
  18821. "../util/transitions": 195,
  18822. events: 202,
  18823. three: 217
  18824. }],
  18825. 149: [function(e, t, i) {
  18826. "use strict";
  18827. function n(e) {
  18828. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18829. t.map.value = d,
  18830. t.opacity.value = 0,
  18831. t.color.value.set(o.reticuleColor),
  18832. t.showMouseMarker = !window.DATA.hideMouseMarker;
  18833. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18834. side: r.DoubleSide,
  18835. depthWrite: !1,
  18836. depthTest: !1,
  18837. transparent: !0,
  18838. vertexShader: c.waypoint.vertexShader,
  18839. fragmentShader: c.waypoint.fragmentShader,
  18840. uniforms: t,
  18841. name: "waypoint",
  18842. opacity: 0,
  18843. visible: t.showMouseMarker
  18844. })),
  18845. this.layers.set(h.RETICULE),
  18846. this.renderOrder = u.reticule,
  18847. this.player = e,
  18848. this.direction = new r.Vector3,
  18849. this.hidden = !0,
  18850. this.mouseLastMoveTime = Date.now()
  18851. }
  18852. var r = e("three")
  18853. , o = e("../settings")
  18854. , a = e("../util/transitions")
  18855. , s = e("../util/texture")
  18856. , l = e("../util/lerp")
  18857. , c = e("../shaders")
  18858. , h = e("../enum/RenderLayers")
  18859. , u = e("../enum/RenderOrder")
  18860. , d = s.load("images/reticule-256x256.png");
  18861. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18862. this.hidden = i,
  18863. this.mouseLastMoveTime = Date.now()
  18864. }
  18865. ,
  18866. n.prototype.hide = function() {
  18867. this.hidden || (this.hidden = !0,
  18868. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18869. }
  18870. ,
  18871. n.prototype.show = function() {
  18872. this.hidden = !1,
  18873. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18874. }
  18875. ,
  18876. n.prototype.update = function() {
  18877. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18878. }
  18879. ,
  18880. n.prototype.updatePosition = function(e, t) {
  18881. if (!this.hidden) {
  18882. if (!t)
  18883. return this.hide();
  18884. var i = t.point
  18885. , n = e.distanceTo(i)
  18886. , r = 1 + .01 * n;
  18887. n < 1 && (r -= 1 - n),
  18888. this.show(),
  18889. this.scale.set(r, r, r),
  18890. this.direction = this.direction.multiplyScalar(.8),
  18891. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18892. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18893. this.lookAt(this.position.clone().add(this.direction))
  18894. }
  18895. }
  18896. ,
  18897. n.prototype.writeAstag = function() {
  18898. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18899. , t = new Date;
  18900. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18901. var i = {
  18902. enabled: !0,
  18903. version: "0",
  18904. created: t.toISOString(),
  18905. created_by: "APITest",
  18906. position: this.position.clone(),
  18907. stem: {
  18908. enabled: o.tags.pole.enabled,
  18909. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18910. },
  18911. label: "tag " + this.tagCount,
  18912. description: "Description " + e,
  18913. floor: function(e) {
  18914. if (e.currentFloor) {
  18915. var t = e.floors.indexOf(e.currentFloor);
  18916. return -1 < t ? t : void 0
  18917. }
  18918. }(this.player.model),
  18919. type: "info",
  18920. metadata: {
  18921. preferred_camera: {
  18922. mode: this.player.mode
  18923. }
  18924. }
  18925. };
  18926. console.log("--------------------------"),
  18927. console.log(JSON.stringify(i));
  18928. var n = this.player.model.addtag(e, i).build();
  18929. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18930. n.visible || n.show(o.tags.startup.fadeInDuration))
  18931. }
  18932. ,
  18933. t.exports = n
  18934. }
  18935. , {
  18936. "../enum/RenderLayers": 41,
  18937. "../enum/RenderOrder": 42,
  18938. "../settings": 166,
  18939. "../shaders": 167,
  18940. "../util/lerp": 188,
  18941. "../util/texture": 194,
  18942. "../util/transitions": 195,
  18943. three: 217
  18944. }],
  18945. 150: [function(e, t, i) {
  18946. "use strict";
  18947. function n(e, t) {
  18948. this.chunks = [],
  18949. this.floorId = e,
  18950. this.roomId = t,
  18951. this.position = new l.Vector3
  18952. }
  18953. var l = e("three");
  18954. n.prototype.addChunk = function(e) {
  18955. this.chunks.push(e)
  18956. }
  18957. ,
  18958. n.prototype.calcBoundaries = function() {
  18959. 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++) {
  18960. var a = this.chunks[o].geometry.attributes.position;
  18961. if (a)
  18962. for (var s = 0; s < a.array.length; s += 3)
  18963. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18964. t.add(e),
  18965. 0 === s ? (i.copy(e),
  18966. n.copy(e)) : (i.max(e),
  18967. n.min(e)),
  18968. r++
  18969. }
  18970. 0 < r ? (t.multiplyScalar(1 / r),
  18971. this.average = t) : this.average = null,
  18972. this.boundsMax = i,
  18973. this.boundsMin = n,
  18974. this.center = new l.Vector3,
  18975. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18976. }
  18977. ,
  18978. t.exports = n
  18979. }
  18980. , {
  18981. three: 217
  18982. }],
  18983. 151: [function(o, v, e) {
  18984. (function(e) {
  18985. "use strict";
  18986. function t(e, t, i) {
  18987. this.obj3d = null,
  18988. this.nodes = [],
  18989. this.colorHull = [],
  18990. this.shortPaths = {},
  18991. this.floorHull = null,
  18992. this.cameraHull = null,
  18993. this.floorPathDistance = 0,
  18994. this.floorCurvePoints = null,
  18995. this.floorCurveColors = null,
  18996. this.camCurvePoints = null,
  18997. this.warpDestHeroLoc = null,
  18998. this.warpDestPano = null,
  18999. this.warpPathPoints = null,
  19000. this.warpPathLengths = [0],
  19001. this.warpLength = 0,
  19002. this.closeWarpDistance = 4,
  19003. this.UP = U.UP.clone(),
  19004. this.longestStep = 0,
  19005. this.upcomingTransType = null,
  19006. this.burnsDir = 1,
  19007. this.prevNextDist = 0,
  19008. this.nextI = 0,
  19009. this.activeTransType = null,
  19010. this.lastTransType = null,
  19011. this.bunnyObj = null,
  19012. this.director = e,
  19013. this.player = t,
  19014. this.playerControls = i,
  19015. this.modelManager = t.modelManager,
  19016. this.updateModel(),
  19017. this.updateDefaultsFromModelData(),
  19018. this.bindEvents(),
  19019. this.warping = !1,
  19020. this.waitingToWarp = !1,
  19021. this.warpInterrupted = !1,
  19022. this.warpInterruptionBlackoutStyle = null,
  19023. this.warpInterruptionTravelTime = null
  19024. }
  19025. 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"),
  19026. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  19027. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  19028. 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"),
  19029. pathEnd: n.load("images/End.png"),
  19030. 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==")
  19031. };
  19032. t.prototype.setScene = function(e) {
  19033. this.createCpm(e),
  19034. this.createBunnyObj(e)
  19035. }
  19036. ,
  19037. t.prototype.updateModel = function() {
  19038. this.model = this.modelManager.getActiveModel()
  19039. }
  19040. ,
  19041. t.prototype.bindEvents = function() {
  19042. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  19043. }
  19044. ,
  19045. t.prototype.updateDefaultsFromModelData = function() {
  19046. this.model.data
  19047. }
  19048. ,
  19049. t.prototype.pointPathDistance = function(e) {
  19050. for (var t = 0, i = 1; i < e.length; i += 1)
  19051. t += e[i - 1].distanceTo(e[i]);
  19052. return t
  19053. }
  19054. ,
  19055. t.prototype.pointPathLengths = function(e) {
  19056. for (var t = [0], i = 1; i < e.length; i += 1)
  19057. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19058. return t
  19059. }
  19060. ,
  19061. t.prototype.interpAlongPath = function(e, t, i) {
  19062. var n, r = new P.Vector3, o = t[t.length - 1];
  19063. if (i < 1) {
  19064. n = i * o;
  19065. for (var a = 1; a < t.length; a += 1)
  19066. if (t[a] > n) {
  19067. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  19068. return r.copy(e[a]),
  19069. r.sub(e[a - 1]),
  19070. r.multiplyScalar(s),
  19071. r.add(e[a - 1]),
  19072. r
  19073. }
  19074. } else
  19075. r.copy(e[e.length - 1]);
  19076. return r
  19077. }
  19078. ,
  19079. t.prototype.pathHeight = function() {
  19080. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  19081. }
  19082. ,
  19083. t.prototype.createBunnyObj = function(e) {
  19084. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  19085. this.bunnyObj.visible = D.warp.showBunny),
  19086. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19087. e.add(this.bunnyObj)
  19088. }
  19089. ,
  19090. t.prototype.createCpm = function(e) {
  19091. if (!this.currentPanoMarker) {
  19092. var t = this.makeWaypointObj(I.pathEnd, "Current");
  19093. t.material.uniforms.opacity.value = 0,
  19094. this.currentPanoMarker = {
  19095. mesh: t,
  19096. placed: !1
  19097. }
  19098. }
  19099. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19100. this.placeCpm(),
  19101. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19102. }
  19103. ,
  19104. t.prototype.placeCpm = function() {
  19105. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19106. var e = this.player.currentPano.floor;
  19107. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19108. e.add(this.currentPanoMarker.mesh)),
  19109. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19110. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  19111. this.currentPanoMarker.placed = !0
  19112. } else
  19113. this.popOutCpm()
  19114. }
  19115. ,
  19116. t.prototype.fadeInCpm = function(e) {
  19117. 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)
  19118. }
  19119. ,
  19120. t.prototype.fadeOutCpm = function(e) {
  19121. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19122. }
  19123. ,
  19124. t.prototype.popInCpm = function() {
  19125. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19126. }
  19127. ,
  19128. t.prototype.popOutCpm = function() {
  19129. this.fadeOutCpm(2)
  19130. }
  19131. ,
  19132. t.prototype.brushPrefs = {
  19133. linewidth: 7,
  19134. strokeWidth: 15,
  19135. cvSegments: 48,
  19136. paveStep: .1,
  19137. paveWidth: .2,
  19138. lookBlendDist: 3,
  19139. maxTurn: P.Math.degToRad(2)
  19140. },
  19141. t.prototype.panoPathDistance = function(e) {
  19142. var t = this.model.panos;
  19143. if (!e || e.length < 2)
  19144. return 0;
  19145. for (var i = [], n = 0; n < e.length; n += 1)
  19146. i.push(t.get(e[n]).floorPosition);
  19147. return this.pointPathDistance(i)
  19148. }
  19149. ,
  19150. t.prototype.loadTileTexture = function(t) {
  19151. var e = n.load(t, function(e) {
  19152. e.wrapS = P.RepeatWrapping,
  19153. e.wrapT = P.RepeatWrapping,
  19154. e.needsUpdate = !0,
  19155. H.debug('path texture "' + t + '" is ready')
  19156. }, function() {
  19157. H.error('path texture "' + t + '" failed')
  19158. });
  19159. return e.mapping = P.UVMapping,
  19160. e
  19161. }
  19162. ,
  19163. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19164. return new l({
  19165. cameraMode: n,
  19166. position: e,
  19167. quaternion: t,
  19168. panoId: i,
  19169. orthoZoom: o,
  19170. floorVisibility: r,
  19171. thumbUrl: null,
  19172. name: null
  19173. })
  19174. }
  19175. ,
  19176. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19177. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19178. }
  19179. ,
  19180. t.prototype.setWarpDestination = function(e) {
  19181. this.warpDestHeroLoc = e
  19182. }
  19183. ,
  19184. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  19185. var t = this.getHeroDescriptorByHeroIndex(e);
  19186. return null !== t && (this.setWarpDestination(t),
  19187. !0)
  19188. }
  19189. ,
  19190. t.prototype.setWarpDestinationByPano = function(e, t) {
  19191. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  19192. }
  19193. ,
  19194. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  19195. var i = this.model.panos.get(e);
  19196. if (i) {
  19197. t = t || new P.Quaternion;
  19198. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19199. return this.setWarpDestination(n),
  19200. !0
  19201. }
  19202. return !1
  19203. }
  19204. ,
  19205. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19206. var t = this.model.heroCount();
  19207. if (null !== this.warpDestHeroLoc && t < 1)
  19208. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19209. this.model.getHeroDescriptorByIndex(0);
  19210. var i = this.model.getHeroDescriptorByIndex(e);
  19211. if (i) {
  19212. var n = i.isPano() ? i.panoId : i.cameraMode;
  19213. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19214. }
  19215. return i
  19216. }
  19217. ,
  19218. t.prototype.getHeroDescriptorByPano = function(e) {
  19219. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  19220. }
  19221. ,
  19222. t.prototype.getHeroDescriptorByPanoId = function(e) {
  19223. var t = this.getHeroIndexFromPanoId(e);
  19224. return this.getHeroDescriptorByHeroIndex(t)
  19225. }
  19226. ,
  19227. t.prototype.getHeroIndexFromPanoId = function(e) {
  19228. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19229. var i = this.model.heroLocations[t]
  19230. , n = this.getHeroId(i);
  19231. if (n && n === e)
  19232. return t
  19233. }
  19234. return -1
  19235. }
  19236. ,
  19237. t.prototype.getHeroPano = function(e) {
  19238. if (null === e)
  19239. return H.warn("getHeroPano(): no destination"),
  19240. null;
  19241. var t = this.getHeroId(e)
  19242. , i = this.model.panos.get(t);
  19243. return void 0 === i && (i = null,
  19244. "" !== t && H.debug('unable to find pano "' + t + '"')),
  19245. i
  19246. }
  19247. ,
  19248. t.prototype.getHeroId = function(e) {
  19249. return e.panoId
  19250. }
  19251. ,
  19252. t.prototype.setWarpDestPano = function() {
  19253. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19254. this.warpDestPano
  19255. }
  19256. ,
  19257. t.prototype.brushToWarpPano = function(e, t) {
  19258. if (this.discardPathObject(),
  19259. !this.setWarpDestPano())
  19260. return !1;
  19261. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  19262. !this.warpDestPano)
  19263. return H.info("No brush"),
  19264. !1;
  19265. if (!this.player.currentPano)
  19266. return H.debug("No current pano, visibility undefined"),
  19267. !1;
  19268. if (!this.warpDestPano)
  19269. return H.info("No wPano, visibility undefined"),
  19270. !1;
  19271. if (!this.warpDestPano.isAligned())
  19272. return H.debug("Cannot brush to unaligned pano"),
  19273. !1;
  19274. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  19275. , n = !0;
  19276. if (this.player.currentPano.id === this.warpDestPano.id)
  19277. H.debug("Already at destination pano");
  19278. else {
  19279. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19280. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19281. this.obj3d = new P.Object3D,
  19282. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19283. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  19284. e = t) : (this.setPathHulls(this.nodes),
  19285. this.setFloorCurves(),
  19286. 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)))),
  19287. this.player.currentPano.floor.add(this.obj3d);
  19288. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  19289. , o = e === L.STD;
  19290. if (!n && (i || o)) {
  19291. if (r) {
  19292. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19293. this.obj3d.add(a)
  19294. }
  19295. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19296. this.obj3d.add(s)
  19297. }
  19298. this.appearSlow()
  19299. }
  19300. return this.upcomingTransType = e,
  19301. !n
  19302. }
  19303. ,
  19304. t.prototype.findShortestPath = function(e, t) {
  19305. if (!e || !t)
  19306. return null;
  19307. var i = D.warp.walkExtraPanosDistance
  19308. , n = e.id + ":" + t.id + ":" + i;
  19309. if (this.shortPaths.hasOwnProperty(n))
  19310. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19311. var r = t.id + ":" + e.id + ":" + i;
  19312. if (this.shortPaths.hasOwnProperty(r))
  19313. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19314. var o = this.model.panos.aStarSearch(e, t);
  19315. return this.model.panos.includeNodesNearPath(o, i),
  19316. this.shortPaths[n] = o ? o.slice() : null,
  19317. o
  19318. }
  19319. ,
  19320. t.prototype.makePathHulls = function(e) {
  19321. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  19322. r = (t = h.get(e[0])).floor.floorIndex;
  19323. for (var u = 0; u < e.length; u += 1)
  19324. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  19325. s.push(i),
  19326. l.push(t.position.clone()),
  19327. n = t.floor.floorIndex,
  19328. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  19329. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  19330. return a > this.longestStep && (this.longestStep = a,
  19331. H.debug("path contains " + a + " meter segment")),
  19332. {
  19333. floor: s,
  19334. camera: l,
  19335. color: c
  19336. }
  19337. }
  19338. ,
  19339. t.prototype.makeFloorCurves = function(e, t, i) {
  19340. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19341. , r = this.pointPathDistance(e) - 2 * n
  19342. , o = e.slice(0)
  19343. , a = o[1].clone().sub(o[0]);
  19344. a.y = 0,
  19345. a.normalize().multiplyScalar(n),
  19346. o[0] = (new P.Vector3).copy(o[0]).add(a),
  19347. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  19348. a.normalize().multiplyScalar(n),
  19349. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  19350. var s = new P.CatmullRomCurve3(o)
  19351. , l = Math.floor(r / i);
  19352. l = 4 * Math.floor(l / 4),
  19353. l = Math.max(4, l);
  19354. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  19355. h = 0,
  19356. c = u[f].distanceTo(e[0]);
  19357. for (var g = 1; g < e.length; g += 1)
  19358. p.copy(u[f]).sub(e[g]),
  19359. p.y *= 4,
  19360. p.length() < c && (h = g);
  19361. d.push(t[h])
  19362. }
  19363. return {
  19364. distance: r,
  19365. points: u,
  19366. colors: d
  19367. }
  19368. }
  19369. ,
  19370. t.prototype.makeCameraCurvePoints = function(e, t) {
  19371. var i = this.pointPathDistance(e);
  19372. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19373. }
  19374. ,
  19375. t.prototype.makeCameraCurveTangents = function(e, t) {
  19376. var i = this.pointPathDistance(e)
  19377. , n = new P.CatmullRomCurve3(e)
  19378. , r = Math.max(2, Math.floor(i / t));
  19379. r = r || 5;
  19380. for (var o = [], a = 0; a <= r; a++)
  19381. o.push(n.getTangentAt(a / r));
  19382. return o
  19383. }
  19384. ,
  19385. t.prototype.setPathHulls = function(e) {
  19386. var t = this.makePathHulls(e);
  19387. this.floorHull = t.floor,
  19388. this.cameraHull = t.camera,
  19389. this.colorHull = t.color
  19390. }
  19391. ,
  19392. t.prototype.setFloorCurves = function() {
  19393. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19394. this.floorPathDistance = e.distance,
  19395. this.floorCurvePoints = e.points,
  19396. this.floorCurveColors = e.colors
  19397. }
  19398. ,
  19399. t.prototype.setCameraCurvePoints = function() {
  19400. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  19401. }
  19402. ,
  19403. t.prototype.chooseWarpPath = function(e) {
  19404. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  19405. if (this.player.currentPano === this.warpDestPano || !e)
  19406. return this.warpPathPoints = null,
  19407. this.warpLength = 0,
  19408. !1;
  19409. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19410. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  19411. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  19412. t.multiplyScalar(.15).add(r.position),
  19413. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19414. t.y = r.position.y,
  19415. i.y = this.warpDestPano.position.y,
  19416. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  19417. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19418. this.setCameraCurvePoints(),
  19419. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19420. this.warpLength = 0,
  19421. this.warpPathLengths = [0];
  19422. 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) {
  19423. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  19424. var h = o.length();
  19425. o.y *= D.warp.climbEffort;
  19426. var u = o.length() / h;
  19427. if (1 < c) {
  19428. o.setY(0).normalize(),
  19429. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  19430. var d = Math.min(1, o.dot(a))
  19431. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  19432. u = Math.max(p, u)
  19433. }
  19434. this.warpLength += h * u,
  19435. this.warpPathLengths[c] = this.warpLength
  19436. }
  19437. return !0
  19438. }
  19439. ,
  19440. t.prototype.drawPathRibbon = function(e, t) {
  19441. this.bunnyObj.visible = D.warp.showBunny;
  19442. 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) {
  19443. a.copy(e[s]),
  19444. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19445. a.normalize(),
  19446. n.crossVectors(a, U.UP),
  19447. n.multiplyScalar(i);
  19448. var l = (new P.Vector3).copy(e[s]).add(r);
  19449. l.sub(n),
  19450. o.vertices.push(l),
  19451. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19452. o.vertices.push(l)
  19453. }
  19454. var c, h, u, d = 0;
  19455. for (s = 0; s < e.length - 1; s += 1) {
  19456. var p = 2 * s
  19457. , f = d
  19458. , g = d += e[s + 1].distanceTo(e[s])
  19459. , m = t[s]
  19460. , v = t[s + 1];
  19461. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19462. o.faces.push(c),
  19463. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19464. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19465. o.faces.push(c),
  19466. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19467. }
  19468. o.computeFaceNormals(),
  19469. o.computeVertexNormals(),
  19470. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19471. u.opacity.value = 0,
  19472. u.color.value.set(D.path.color),
  19473. new P.RawShaderMaterial({
  19474. side: P.DoubleSide,
  19475. depthWrite: !1,
  19476. transparent: !0,
  19477. vertexShader: C.ribbon.vertexShader,
  19478. fragmentShader: C.ribbon.fragmentShader,
  19479. uniforms: u,
  19480. name: "ribbonT",
  19481. opacity: 0
  19482. })) : new P.MeshBasicMaterial({
  19483. color: 16777215,
  19484. side: P.DoubleSide,
  19485. name: "ribbonOut",
  19486. vertexColors: P.VertexColors
  19487. });
  19488. var y = new P.Mesh(o,h);
  19489. return y.name = "ribbon",
  19490. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19491. y
  19492. }
  19493. ,
  19494. t.prototype.drawPathPavement = function(e) {
  19495. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19496. r.copy(e[o]),
  19497. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19498. r.normalize(),
  19499. i.crossVectors(r, U.UP),
  19500. i.multiplyScalar(this.brushPrefs.paveWidth),
  19501. (t = (new P.Vector3).copy(e[o])).sub(i),
  19502. n.vertices.push(t),
  19503. n.vertices.push((new P.Vector3).copy(e[o])),
  19504. (t = (new P.Vector3).copy(e[o])).add(i),
  19505. n.vertices.push(t);
  19506. var a, s, l;
  19507. for (o = 0; o < e.length - 1; o += 1)
  19508. a = 3 * o + 1,
  19509. l = .25 + (s = .25 * o),
  19510. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19511. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19512. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19513. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19514. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19515. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19516. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19517. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19518. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19519. color: D.path.color,
  19520. side: P.DoubleSide,
  19521. transparent: !0,
  19522. depthWrite: !1,
  19523. opacity: 0,
  19524. name: "paveT",
  19525. map: I.path
  19526. }) : new P.MeshBasicMaterial({
  19527. color: D.path.color,
  19528. side: P.DoubleSide,
  19529. transparent: !0,
  19530. depthWrite: !1,
  19531. opacity: 1,
  19532. name: "paveO",
  19533. map: I.path
  19534. });
  19535. return new P.Mesh(n,c)
  19536. }
  19537. ,
  19538. t.prototype.hintPrefs = {
  19539. rad: .18,
  19540. width: .0125,
  19541. depth: .0625,
  19542. setBack: -.04,
  19543. markRad: .25,
  19544. markInnerRad: .16
  19545. },
  19546. t.prototype.makeWaypointObj = function(e, t) {
  19547. var i = new P.Geometry
  19548. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19549. , r = this.pathHeight();
  19550. 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)),
  19551. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19552. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19553. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19554. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19555. o.map.value = e,
  19556. o.opacity.value = 0,
  19557. o.color.value.set(D.path.color);
  19558. var a = {
  19559. side: P.DoubleSide,
  19560. depthWrite: !1,
  19561. transparent: !0,
  19562. vertexShader: C.waypoint.vertexShader,
  19563. fragmentShader: C.waypoint.fragmentShader,
  19564. uniforms: o,
  19565. name: "waypoint",
  19566. opacity: 0
  19567. };
  19568. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19569. a.name = "wayPtOut");
  19570. var s = new P.RawShaderMaterial(a)
  19571. , l = new P.Mesh(i,s);
  19572. return l.name = t,
  19573. l
  19574. }
  19575. ,
  19576. t.prototype.makeStartMarker = function(e, t) {
  19577. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19578. i.y = 0,
  19579. i.normalize();
  19580. var n = Math.acos(i.x)
  19581. , r = this.makeWaypointObj(I.pathStart, "Start");
  19582. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19583. r.position.copy(e),
  19584. r
  19585. }
  19586. ,
  19587. t.prototype.makeEndMarker = function(e) {
  19588. var t = this.makeWaypointObj(I.pathEnd, "End")
  19589. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19590. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19591. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19592. t.position.copy(e),
  19593. t
  19594. }
  19595. ,
  19596. t.prototype.pathClean = function(e) {
  19597. if (e) {
  19598. for (var t in e.children)
  19599. this.pathClean(e.children[t]);
  19600. e.geometry && e.geometry.dispose(),
  19601. e.material && e.material.dispose()
  19602. }
  19603. }
  19604. ,
  19605. t.prototype.discardPathObject = function() {
  19606. if (this.obj3d) {
  19607. var e = this.obj3d.parent;
  19608. e && e.remove(this.obj3d),
  19609. this.pathClean(this.obj3d)
  19610. }
  19611. this.obj3d = null,
  19612. this.popInCpm()
  19613. }
  19614. ,
  19615. t.prototype.discardSlow = function() {
  19616. if (this.obj3d) {
  19617. if (this.player.mode !== O.PANORAMA)
  19618. return void this.discardPathObject();
  19619. for (var e, t = 0, i = function() {
  19620. this.discardPathObject()
  19621. }
  19622. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19623. 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]),
  19624. t += 1,
  19625. i = null);
  19626. 0 === t && this.discardPathObject(),
  19627. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19628. }
  19629. }
  19630. ,
  19631. t.prototype.appearSlow = function() {
  19632. var e;
  19633. this.fadeOutCpm(D.path.fadeInTime);
  19634. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19635. 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]))
  19636. }
  19637. ,
  19638. t.prototype.update = function() {
  19639. this.obj3d && this.obj3d.updateMatrixWorld()
  19640. }
  19641. ,
  19642. t.prototype.calcBurnsAmount = function(e) {
  19643. var n = P.Math.degToRad(D.warp.burnsAngle);
  19644. if (this.player.mode !== O.PANORAMA)
  19645. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19646. var t = this.burnsDir * n;
  19647. if (this.upcomingTransType === L.BLACK)
  19648. return t;
  19649. var i = e;
  19650. if (null === i)
  19651. return H.warn("Transition request for non-highlight"),
  19652. t;
  19653. var r = this.getHeroDescriptorByHeroIndex(i);
  19654. if (null === r)
  19655. return t;
  19656. if (!r.isPano())
  19657. return t;
  19658. function o(e) {
  19659. var t = Math.acos(Math.min(1, e.dot(l)))
  19660. , i = (new P.Vector3).crossVectors(l, e);
  19661. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19662. }
  19663. var a = this.getHeroPano(r)
  19664. , s = this.playerControls.cameras[O.PANORAMA]
  19665. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19666. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19667. if (a === this.player.currentPano)
  19668. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19669. var h = this.findShortestPath(this.player.currentPano, a);
  19670. if (null == h || h.length < 1)
  19671. return H.debug("Empty path ahead..."),
  19672. t;
  19673. var u = this.makePathHulls(h)
  19674. , d = new P.CatmullRomCurve3(u.camera)
  19675. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19676. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19677. }
  19678. ,
  19679. t.prototype.waitNextStep = function(e, t, i) {
  19680. var o = null == i ? D.warp.tourStepDelay : i;
  19681. o = o != void 0? o: (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19682. var a = new P.Euler
  19683. , s = new P.Vector3;
  19684. H.debug("Starting wait: " + (void 0 !== t));
  19685. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  19686. var l = currentLocation.dontRot || this.calcBurnsAmount(e)
  19687. , c = function() {
  19688. this.endWarpState(),
  19689. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19690. t && t()
  19691. }
  19692. .bind(this)
  19693. , n = function(e, t) {
  19694. if (this.warpInterrupted)
  19695. return c(),
  19696. !0;
  19697. var i = t || 1e3 / 60;
  19698. if (D.warp.doBurns && !currentLocation.dontRot )
  19699. if (this.player.mode === O.PANORAMA) {
  19700. var n = this.playerControls.cameras[O.PANORAMA];
  19701. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19702. var r = o == 0 ? l : i * l / o;
  19703. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19704. a.y += r,
  19705. s.set(0, 0, -1),
  19706. s.applyEuler(a),
  19707. s.add(n.position),
  19708. n.controls.lookAt(s),
  19709. n.controls.lookVector.copy(s),
  19710. n.lookAt(s)
  19711. } else
  19712. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19713. }
  19714. .bind(this);
  19715. this.startWarpState(),
  19716. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19717. }
  19718. ,
  19719. t.prototype.warpToNonPano = function(e) {
  19720. if (this.discardPathObject(),
  19721. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19722. var t = function() {
  19723. e && e()
  19724. }
  19725. .bind(this);
  19726. this.player.flyToNewMode({
  19727. mode: this.warpDestHeroLoc.cameraMode,
  19728. duration: D.warp.outsideTime,
  19729. warpDest: this.warpDestHeroLoc,
  19730. callback: t,
  19731. force: !0
  19732. })
  19733. } else
  19734. H.warn("no warp destination!!!"),
  19735. e && e()
  19736. }
  19737. ,
  19738. t.prototype._resetWarpShaderParams = function(e) {
  19739. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19740. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19741. }
  19742. ,
  19743. t.prototype._clearWarpShading = function() {
  19744. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19745. this._resetWarpShaderParams(e[t]),
  19746. e[t].visible = !0;
  19747. this._resetWarpShaderParams(this.model.skybox)
  19748. }
  19749. ,
  19750. t.prototype._warpStopFlying = function() {
  19751. this.activeTransType = null,
  19752. this.placeCpm()
  19753. }
  19754. ,
  19755. t.prototype._wrapupTravelOnlyBits = function() {
  19756. this._warpStopFlying(),
  19757. this.warpPathPoints && (this.player.currentPano.exit(),
  19758. this.warpDestPano.enter(),
  19759. this.player.currentPano = this.warpDestPano),
  19760. this.player.spider.draw(),
  19761. this.placeCpm()
  19762. }
  19763. ,
  19764. t.prototype._wrapupTravel = function(e) {
  19765. this._wrapupTravelOnlyBits(),
  19766. this.warpCameraAim(e)
  19767. }
  19768. ,
  19769. t.prototype._wrapupWarpShading = function(e) {
  19770. this._clearWarpShading(),
  19771. this._wrapupTravel(e)
  19772. }
  19773. ,
  19774. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19775. t !== z.END && this._clearWarpShading(),
  19776. this._wrapupTravelOnlyBits(),
  19777. this.upcomingTransType = null,
  19778. e && e()
  19779. }
  19780. ,
  19781. t.prototype._warpCameraAim = function(e, t) {
  19782. var i = this.warpDestHeroLoc.quaternion
  19783. , n = this.playerControls.cameras[O.PANORAMA]
  19784. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19785. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19786. , a = P.Math.radToDeg(Math.acos(o))
  19787. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19788. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19789. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19790. c.y = N.constrainedTurn(c.y),
  19791. this.burnsDir = Math.sign(c.y);
  19792. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19793. , u = new P.Vector3
  19794. , d = function(e, t) {
  19795. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19796. h.y = l.y + e * c.y,
  19797. h.z = l.z + e * c.z,
  19798. u.set(0, 0, -1),
  19799. u.applyEuler(h),
  19800. u.add(n.position),
  19801. n.controls.lookAt(u),
  19802. n.controls.lookVector.copy(u),
  19803. void n.lookAt(u))
  19804. }
  19805. .bind(this);
  19806. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19807. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19808. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19809. )
  19810. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19811. void (t && t())) */
  19812. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19813. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19814. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19815. : (/* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
  19816. void (t && t()))
  19817. }
  19818. ,
  19819. t.prototype._warpBendAim = function(e, t, i, n) {
  19820. var r = n || 0
  19821. , o = this.playerControls.cameras[O.PANORAMA]
  19822. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19823. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19824. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19825. l.y = N.constrainedTurn(l.y);
  19826. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19827. l.x = c * Math.sign(l.x),
  19828. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19829. this.burnsDir = Math.sign(l.y),
  19830. c *= Math.sign(l.y),
  19831. l.y = c;
  19832. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19833. , u = new P.Vector3
  19834. , d = function(e, t) {
  19835. if (e < .5)
  19836. h.x = s.x + e * l.x,
  19837. h.y = s.y + e * l.y,
  19838. h.z = s.z + e * l.z;
  19839. else {
  19840. var i = (1 - e) * D.warp.softBendEnd;
  19841. h.x = a.x - i * l.x,
  19842. h.y = a.y - i * l.y,
  19843. h.z = a.z - i * l.z
  19844. }
  19845. u.set(0, 0, -1),
  19846. u.applyEuler(h),
  19847. u.add(o.position),
  19848. o.controls.lookAt(u),
  19849. o.controls.lookVector.copy(u),
  19850. o.lookAt(u)
  19851. }
  19852. .bind(this);
  19853. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19854. }
  19855. ,
  19856. t.prototype._warpStepCameraAim = function(e, t, i) {
  19857. var n = this.playerControls.cameras[O.PANORAMA]
  19858. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19859. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19860. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19861. a.y = N.constrainedTurn(a.y),
  19862. this.burnsDir = Math.sign(a.y);
  19863. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19864. , l = new P.Vector3
  19865. , c = function(e, t) {
  19866. e < .5 ? s.copy(o) : s.copy(r),
  19867. l.set(0, 0, -1),
  19868. l.applyEuler(s),
  19869. l.add(n.position),
  19870. n.controls.lookAt(l),
  19871. n.controls.lookVector.copy(l),
  19872. n.lookAt(l)
  19873. }
  19874. .bind(this);
  19875. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19876. }
  19877. ,
  19878. t.prototype.setBurnsDir = function() {
  19879. var e = this.playerControls.cameras[O.PANORAMA]
  19880. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19881. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19882. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19883. n.y = N.constrainedTurn(n.y),
  19884. this.burnsDir = Math.sign(n.y)
  19885. }
  19886. ,
  19887. t.prototype.stepWarpPath = function(firstPos, e ) {
  19888. var i = this.playerControls.cameras[O.PANORAMA];
  19889. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19890. if (!n){
  19891. return i.position.copy(this.warpDestPano.position),
  19892. !0;
  19893. }
  19894. /* if (!this.warpPathPoints)
  19895. return i.position.copy(this.warpDestPano.position),
  19896. !0;
  19897. var n = this.warpPathPoints[0] */
  19898. var r = this.warpDestPano.position;
  19899. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19900. var o = new P.Vector3;
  19901. 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),
  19902. i.position.copy(o)
  19903. } else
  19904. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19905. }
  19906. ,
  19907. t.prototype.interruptAndFastForward = function(e, t) {
  19908. this.warping && (this.warpInterrupted = !0,
  19909. this.warpInterruptionBlackoutStyle = e,
  19910. this.warpInterruptionTravelTime = t,
  19911. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19912. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19913. }
  19914. ,
  19915. t.prototype.warpCameraAim = function(e) {
  19916. var t = D.warp.minWarpTime;
  19917. if (this.upcomingTransType === L.BLACK)
  19918. t = D.warp.teleportTime;
  19919. else {
  19920. var i = this.playerControls.cameras[O.PANORAMA]
  19921. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19922. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19923. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19924. o.y = N.constrainedTurn(o.y);
  19925. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19926. t = Math.max(t, a)
  19927. }
  19928. var s = function() {
  19929. this._warpStopFlying(),
  19930. this.discardSlow(),
  19931. e && e()
  19932. }
  19933. .bind(this);
  19934. this._warpCameraAim(t, s)
  19935. }
  19936. ,
  19937. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19938. this.model.skybox.material.uniforms.blackout.value = n;
  19939. var r = F.uniform(this.model.skybox, "progress", 1)
  19940. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19941. , a = !1
  19942. , s = function() {
  19943. if (this.warpInterrupted)
  19944. return a = !0
  19945. }
  19946. .bind(this)
  19947. , l = function(e, t) {
  19948. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19949. }
  19950. .bind(this)
  19951. , c = function(e, t) {
  19952. return i && a ? (o(0),
  19953. !0) : void o(e, t)
  19954. }
  19955. .bind(this);
  19956. V.start(s, e, null, t, null, "safeHaltWatch"),
  19957. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19958. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19959. }
  19960. ,
  19961. t.prototype.warpTravel_STD = function(e) {
  19962. 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),
  19963. 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;
  19964. t += this.warpLength * D.warp.timePerMeter,
  19965. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19966. function n(e) {
  19967. var t = i;
  19968. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19969. }
  19970. var y = !1
  19971. , r = this.warpDestHeroLoc.quaternion
  19972. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19973. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19974. , a = A.dot(o)
  19975. , C = P.Math.radToDeg(Math.acos(a))
  19976. , s = function() {
  19977. return m.lookAt(g, l, U.UP),
  19978. u.setFromRotationMatrix(m, D.warp.eOrder),
  19979. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19980. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19981. N.constrainedTurn(v.y)
  19982. }
  19983. .bind(this)
  19984. , I = function(e, t) {
  19985. if (this.warpInterrupted)
  19986. return y = !0
  19987. }
  19988. .bind(this)
  19989. , E = function(e, t) {
  19990. return y || !this.warpPathPoints ? (k.blur(0),
  19991. !0) : void k.blur(e)
  19992. }
  19993. .bind(this)
  19994. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19995. , b = function(e, t) {
  19996. return y || !this.warpPathPoints ? (_(0),
  19997. !0) : void _(e, t)
  19998. }
  19999. .bind(this)
  20000. , w = function(e, t) {
  20001. if (!this.warpPathPoints)
  20002. return h.position.copy(this.warpDestPano.position),
  20003. !0;
  20004. if (y)
  20005. return !0;
  20006. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20007. h.position.copy(i),
  20008. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20009. }
  20010. .bind(this)
  20011. , T = function(e, t) {
  20012. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  20013. !0)
  20014. }
  20015. .bind(this)
  20016. , x = function(e, t) {
  20017. if (y)
  20018. return H.debug(">>>> Walkthrough interupted at t=" + e),
  20019. !0;
  20020. if (!this.warpPathPoints)
  20021. return !0;
  20022. var i = this.warpLength * e
  20023. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  20024. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20025. D.warp.matchCam && (n *= 1 - r),
  20026. m.lookAt(g, l, U.UP),
  20027. u.setFromRotationMatrix(m, D.warp.eOrder),
  20028. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  20029. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  20030. v.y = N.constrainedTurn(v.y),
  20031. u.x = p.x + n * v.x,
  20032. u.y = p.y + n * v.y,
  20033. u.z = p.z + n * v.z,
  20034. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  20035. v.y = N.constrainedTurn(v.y);
  20036. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  20037. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  20038. f.x = f.x + v.x * D.warp.turnFriction,
  20039. f.y = f.y + v.y * D.warp.turnFriction,
  20040. f.z = f.z + v.z * D.warp.turnFriction,
  20041. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  20042. var a = l.clone().sub(g).normalize();
  20043. if (C < D.warp.maxAimRotation && 0 < r) {
  20044. var s = 1 - r;
  20045. a.x = a.x * s + r * A.x,
  20046. a.y = a.y * s + r * A.y,
  20047. a.z = a.z * s + r * A.z,
  20048. a.normalize()
  20049. }
  20050. this.bunnyObj.position.copy(h.position).add(a),
  20051. d.set(0, 0, -1).applyEuler(f).normalize(),
  20052. d.multiplyScalar(8),
  20053. d.add(h.position),
  20054. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  20055. h.controls.lookVector.copy(d),
  20056. h.lookAt(d))
  20057. }
  20058. .bind(this)
  20059. , S = function() {
  20060. y ? (this.discardSlow(),
  20061. this.upcomingTransType = L.BLACK,
  20062. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  20063. }
  20064. .bind(this);
  20065. T(0);
  20066. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  20067. , R = M / (t += M);
  20068. this.warpCommonParameters(t, R, !0, z.NONE),
  20069. V.start(I, t, null, 0, null, "_haltWatcher"),
  20070. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  20071. V.start(E, t, null, R, n, "blurring")),
  20072. V.start(b, t, null, R, n, "modelAlpha"),
  20073. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  20074. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  20075. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  20076. }
  20077. ,
  20078. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  20079. var r = e || 0;
  20080. null != t || (t = D.warp.teleportTime),
  20081. this.warpCommonParameters(t, r, !1, i),
  20082. this.model.chunks.forEach(function(e) {
  20083. e.material.uniforms.blackout.value = i
  20084. }),
  20085. this._warpBendAim(null, t, null, r);
  20086. //add
  20087. var done = ()=>{
  20088. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  20089. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  20090. //Overlay.updateVisibles([this.player.currentPano])
  20091. }
  20092. var o = function() {
  20093. this.wrapupWarpShadingOnly(n, i)
  20094. done()
  20095. }
  20096. .bind(this);
  20097. var firstPos = this.player.position.clone()//add
  20098. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  20099. }
  20100. ,
  20101. t.prototype.flightStepWalk = (a = new P.Vector3,
  20102. s = new P.Vector3,
  20103. function(e, t, i) {
  20104. if (this.warpInterrupted)
  20105. i && i();
  20106. else if (this.activeTransType !== L.WALK)
  20107. this._clearWarpShading(),
  20108. this._warpStopFlying(),
  20109. this.player.spider.draw(),
  20110. this.placeCpm(),
  20111. i && i();
  20112. else if (this.player.currentPano !== e) {
  20113. var n = {
  20114. pano: e,
  20115. lookAtPoint: t,
  20116. duration: null,
  20117. maxDistanceOverride: D.warp.walkMaxDist,
  20118. skipWarpingCheck: !1,
  20119. constantMoveSpeed: !0
  20120. };
  20121. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  20122. n.zoomLevel = this.warpDestHeroLoc.zoom
  20123. }
  20124. n.duration = function(e, t) {
  20125. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  20126. s.copy(U.FORWARD),
  20127. this.player.getDirection(s),
  20128. a.copy(t).sub(e.position).normalize();
  20129. var n = a.dot(s)
  20130. , r = Math.acos(n)
  20131. , o = r / i;
  20132. return .001 < o && (i *= o / .001,
  20133. r < 1 && (i *= 1.2)),
  20134. i
  20135. }
  20136. .call(this, e, t),
  20137. this.player.nonInterruptingFlyToPano(n, i)
  20138. } else
  20139. i && i()
  20140. }
  20141. ),
  20142. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  20143. return this.flightStepWalk.bind(this, e, t, i)
  20144. }
  20145. ,
  20146. t.prototype.warpTravel_WALK = (f = [],
  20147. function(e) {
  20148. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  20149. var o = this.nodes[r]
  20150. , a = t.get(o);
  20151. this.nodes.length,
  20152. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  20153. i && n || (f.push(o),
  20154. i = a)
  20155. }
  20156. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  20157. var s = f.length
  20158. , l = t.get(f[s - 1])
  20159. , c = new Array(s + 1);
  20160. c[c.length - 1] = function() {
  20161. e && e()
  20162. }
  20163. .bind(this);
  20164. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  20165. var d = f[h];
  20166. l = t.get(d);
  20167. var p = new P.Vector3;
  20168. this.getLookAtForWalkingTourNode(f, h, p),
  20169. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  20170. h--
  20171. }
  20172. c[0]()
  20173. }
  20174. ),
  20175. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  20176. h = new P.Vector3,
  20177. u = new P.Vector3,
  20178. d = new P.Vector3,
  20179. p = new P.Vector3,
  20180. function(e, t, i) {
  20181. var n = e.length;
  20182. if (n <= t)
  20183. return !1;
  20184. var r = 1
  20185. , o = 1;
  20186. h.set(0, 0, 0),
  20187. p.set(0, 0, 0);
  20188. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  20189. if (a = this.player.model.panos.get(e[s]),
  20190. this.getOrientationForWalkingTourNode(e, s, u),
  20191. s === t && c.copy(u),
  20192. d.copy(u),
  20193. t < s) {
  20194. var l = d.dot(c) < .65;
  20195. r *= l ? .2 : .75,
  20196. o *= l ? .2 : .4
  20197. }
  20198. u.multiplyScalar(r),
  20199. h.add(u),
  20200. p.lerp(a.position, o)
  20201. }
  20202. return h.normalize(),
  20203. i.copy(p),
  20204. i.add(h),
  20205. !0
  20206. }
  20207. ),
  20208. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20209. var n = e.length;
  20210. if (n <= t)
  20211. return !1;
  20212. if (t === n - 1)
  20213. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20214. else {
  20215. var r = this.player.model.panos.get(e[t])
  20216. , o = this.player.model.panos.get(e[t + 1]);
  20217. i.copy(o.position).sub(r.position)
  20218. }
  20219. return i.normalize(),
  20220. !0
  20221. }
  20222. ,
  20223. t.prototype.warpCameraTravel = function(e, t, i, n) {
  20224. if (this.activeTransType = this.upcomingTransType,
  20225. this.lastTransType = this.activeTransType,
  20226. this.upcomingTransType = null,
  20227. e)
  20228. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  20229. this._clearWarpShading(),
  20230. this._warpStopFlying(),
  20231. this.player.spider.draw(),
  20232. this.placeCpm(),
  20233. n && n()
  20234. }
  20235. .bind(this)) : this.warpTravel_STD(n);
  20236. else {
  20237. var r = function() {
  20238. this._wrapupTravel(n)
  20239. }
  20240. .bind(this)
  20241. , o = {
  20242. pano: this.warpDestPano,
  20243. lookAtPoint: null,
  20244. duration: null,
  20245. maxDistanceOverride: null,
  20246. skipWarpingCheck: !1
  20247. };
  20248. this.player.flyToPano(o, r)
  20249. }
  20250. }
  20251. ,
  20252. t.prototype.startWarpState = function() {
  20253. this.warping = !0,
  20254. this.warpInterrupted = !1,
  20255. this.warpInterruptionBlackoutStyle = null,
  20256. this.warpInterruptionTravelTime = null
  20257. }
  20258. ,
  20259. t.prototype.endWarpState = function() {
  20260. this.warping = !1
  20261. }
  20262. ,
  20263. t.prototype.warpToPano = function(e, t, i, n) {
  20264. if (this.warping)
  20265. H.warn("Cannot warp when already warping");
  20266. else {
  20267. if (this.upcomingTransType = e,
  20268. this.activeTransType = null,
  20269. !this.setWarpDestPano())
  20270. return this.upcomingTransType = null,
  20271. void this.warpToNonPano(n);
  20272. if (this.player.mode !== O.PANORAMA)
  20273. return this.upcomingTransType = null,
  20274. this.discardSlow(),
  20275. void this.player.flyToNewMode({
  20276. mode: O.PANORAMA,
  20277. pano: this.warpDestPano,
  20278. duration: D.warp.outsideTime,
  20279. warpDest: this.warpDestHeroLoc,
  20280. callback: n,
  20281. force: !0
  20282. });
  20283. if (!this.warpDestPano)
  20284. return H.warn("no warp destination, callback dropped"),
  20285. void (this.upcomingTransType = null);
  20286. 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)
  20287. , o = this.chooseWarpPath(r);
  20288. if (o && this.upcomingTransType !== L.WALK) {
  20289. var a = function() {
  20290. this.waitingToWarp = !1,
  20291. this.warpToPano(e, t, i, n)
  20292. }
  20293. .bind(this);
  20294. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  20295. return void (this.waitingToWarp = !0)
  20296. }
  20297. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  20298. this.player.currentPano = this.warpDestPano,
  20299. this.placeCpm(),
  20300. this.fadeOutCpm(D.path.fadeOutTime),
  20301. this.player.spider.draw()),
  20302. H.debug("Warping to pano ", this.warpDestPano.position),
  20303. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  20304. this.startWarpState();
  20305. var s = function() {
  20306. this.endWarpState(),
  20307. n && n()
  20308. }
  20309. .bind(this);
  20310. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  20311. }
  20312. }
  20313. ,
  20314. v.exports = t
  20315. }
  20316. ).call(this, "/js/objects/ShowPath.js")
  20317. }
  20318. , {
  20319. "../constants": 8,
  20320. "../effects": 16,
  20321. "../enum/BlackoutStyle": 18,
  20322. "../enum/ModelManagerEvents": 33,
  20323. "../enum/PlayerEvents": 40,
  20324. "../enum/RenderOrder": 42,
  20325. "../enum/Vectors": 50,
  20326. "../enum/Viewmode": 51,
  20327. "../enum/WarpStyle": 52,
  20328. "../gui/gui": 65,
  20329. "../model/ModelManager": 140,
  20330. "../objects/Snapshot": 153,
  20331. "../settings": 166,
  20332. "../shaders": 167,
  20333. "../util/easing": 186,
  20334. "../util/lerp": 188,
  20335. "../util/logger": 189,
  20336. "../util/math": 190,
  20337. "../util/texture": 194,
  20338. "../util/transitions": 195,
  20339. three: 217
  20340. }],
  20341. 152: [function(e, t, i) {
  20342. "use strict";
  20343. function n() {
  20344. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20345. , t = new r.RawShaderMaterial({
  20346. fragmentShader: o.skysphere.fragmentShader,
  20347. vertexShader: o.skysphere.vertexShader,
  20348. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20349. side: r.BackSide,
  20350. name: "skysphere"
  20351. });
  20352. t.uniforms.radius.value = e.parameters.radius,
  20353. r.Mesh.call(this, e, t)
  20354. }
  20355. var r = e("three")
  20356. , o = e("../shaders")
  20357. , a = e("../settings");
  20358. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  20359. t.exports = n
  20360. }
  20361. , {
  20362. "../settings": 166,
  20363. "../shaders": 167,
  20364. three: 217
  20365. }],
  20366. 153: [function(r, o, e) {
  20367. (function(e) {
  20368. "use strict";
  20369. function t(e) {
  20370. n.call(this, e),
  20371. this.sid = e.sid,
  20372. this.panoId = e.panoId,
  20373. this.orthoZoom = e.orthoZoom,
  20374. this.floorVisibility = e.floorVisibility,
  20375. this.thumbUrl = e.thumbUrl,
  20376. this.name = e.name,
  20377. this.zoom = e.zoom
  20378. }
  20379. var i = (r("three"),
  20380. r("../util/logger"))
  20381. , n = (r("../settings"),
  20382. r("../enum/Viewmode"),
  20383. r("../util/common"),
  20384. r("../util/transitions"),
  20385. r("../util/lerp"),
  20386. r("../util/ajax"),
  20387. r("../util/texture"),
  20388. r("./View"));
  20389. r("events").EventEmitter,
  20390. new i(e),
  20391. (t.prototype = Object.create(n.prototype)).isPano = function() {
  20392. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20393. }
  20394. ,
  20395. o.exports = t
  20396. }
  20397. ).call(this, "/js/objects/Snapshot.js")
  20398. }
  20399. , {
  20400. "../enum/Viewmode": 51,
  20401. "../settings": 166,
  20402. "../util/ajax": 181,
  20403. "../util/common": 185,
  20404. "../util/lerp": 188,
  20405. "../util/logger": 189,
  20406. "../util/texture": 194,
  20407. "../util/transitions": 195,
  20408. "./View": 154,
  20409. events: 202,
  20410. three: 217
  20411. }],
  20412. 154: [function(o, a, e) {
  20413. (function(e) {
  20414. "use strict";
  20415. function t(e) {
  20416. e = e || {},
  20417. this.position = new i.Vector3,
  20418. this.quaternion = new i.Quaternion,
  20419. this.update(e)
  20420. }
  20421. var i = o("three")
  20422. , n = o("../util/logger")
  20423. , r = (o("../settings"),
  20424. o("../enum/Viewmode"),
  20425. o("../util/common"),
  20426. o("../util/transitions"),
  20427. o("../util/lerp"),
  20428. o("../util/ajax"),
  20429. o("../util/texture"),
  20430. o("events").EventEmitter);
  20431. new n(e),
  20432. (t.prototype = Object.create(r.prototype)).isValid = function() {
  20433. return !!this.cameraMode
  20434. }
  20435. ,
  20436. t.prototype.update = function(e) {
  20437. return this.cameraMode = e.cameraMode || this.cameraMode,
  20438. this.pano = e.pano || this.pano,
  20439. e.position && this.position.copy(e.position),
  20440. e.quaternion && this.quaternion.copy(e.quaternion),
  20441. this
  20442. }
  20443. ,
  20444. a.exports = t
  20445. }
  20446. ).call(this, "/js/objects/View.js")
  20447. }
  20448. , {
  20449. "../enum/Viewmode": 51,
  20450. "../settings": 166,
  20451. "../util/ajax": 181,
  20452. "../util/common": 185,
  20453. "../util/lerp": 188,
  20454. "../util/logger": 189,
  20455. "../util/texture": 194,
  20456. "../util/transitions": 195,
  20457. events: 202,
  20458. three: 217
  20459. }],
  20460. 155: [function(J, ee, e) {
  20461. (function(e) {
  20462. "use strict";
  20463. function t(e) {
  20464. this.currentPano = null,
  20465. this.nextPano = null,
  20466. this.camera = null,
  20467. this.paused = !1,
  20468. this.flying = !1,
  20469. this.sceneIntersectionPlane = null,
  20470. this.target = new B.Vector3,
  20471. this.mouse = new B.Vector3(1.1,1.1,.5),
  20472. this.mouseAtMouseDown = new B.Vector2,
  20473. this.mouseCouldBeClickToMove = !1,
  20474. this.mouseLastMoveTime = Date.now(),
  20475. this.mouseDown = !1,
  20476. this.mouseDownTimer = null,
  20477. this.couldBeLongTap = !1,
  20478. this.containsMouse = !0,
  20479. this.isTouchEvent = !1,
  20480. this.isPanoHover = !1,
  20481. this.reticule = new n(this),
  20482. this.panoMarkers = [],
  20483. this.spider = new s(this),
  20484. this.quaternion = new B.Quaternion,
  20485. this.position = new B.Vector3(15,10,15),
  20486. this.previousState = null,
  20487. this.lastInsideView = new o,
  20488. this.last360View = new o,
  20489. this.raycaster = new B.Raycaster,
  20490. this.intersect = null,
  20491. this.lastChangeTime = Date.now(),
  20492. this.history = new h,
  20493. this.cameraControls = null,
  20494. this.path = null,
  20495. this.model = null,
  20496. this.domElement = null,
  20497. this.cachedPanoCandidates = null,
  20498. this.basePanoSize = 0,
  20499. this.standardPanoSize = 0,
  20500. this.highPanoSize = 0,
  20501. this.ultraHighPanoSize = 0,
  20502. this.zoomLevel = 1,
  20503. this.zooming = 0,
  20504. this.zoomSpeed = .5,
  20505. this.scrollZoomSpeed = .06,
  20506. this.zoomSpeedAdjust = .05,
  20507. this.defaultZoomIncrement = .2,
  20508. this.baseFov = k.insideFOV,
  20509. this.zoomFov = this.baseFov,
  20510. this.zoomEnabled = !0,
  20511. this.preRenderingEnabled = !1,
  20512. this.setupCustomProperties(e),
  20513. this.zoomStats = new v,
  20514. this.modeTran = 'dollhouse-panorama'
  20515. this.currentCursor = '';
  20516. window.player = this
  20517. }
  20518. var B = J("three")
  20519. , i = J("./util/logger")
  20520. , n = J("./objects/Reticule")
  20521. , a = J("./objects/Panorama")
  20522. , r = J("./objects/ShowPath")
  20523. , o = J("./objects/View")
  20524. , s = (J("./objects/Snapshot"),
  20525. J("./objects/NSpider"))
  20526. , V = J("./enum/Viewmode")
  20527. , T = (J("./enum/TagStates"),
  20528. J("./enum/Vectors"))
  20529. , l = J("./enum/Keys")
  20530. , k = (J("./enum/AlignmentType"),
  20531. J("./settings"))
  20532. , x = J("./util/common")
  20533. , U = (J("./util/browser"),
  20534. J("./util/math"))
  20535. , H = J("./util/lerp")
  20536. , z = J("./util/easing")
  20537. , G = J("./util/transitions")
  20538. , c = J("events").EventEmitter
  20539. , h = (J("./shaders"),
  20540. J("./util/history"))
  20541. , S = (J("./util/camera"),
  20542. J("./model/ModelManager"),
  20543. J("./enum/PathDiscardMode"))
  20544. , M = J("./enum/PathDisplayMode")
  20545. , W = J("./enum/PlayerEvents")
  20546. , u = J("./enum/ControlEvents")
  20547. , d = J("./enum/ModelManagerEvents")
  20548. , R = J("./enum/WarpStyle")
  20549. , P = J("./enum/BlackoutStyle")
  20550. , p = J("./exception/BasicException")
  20551. , f = J("./enum/PanoSizeClass")
  20552. , g = (J("./tile/TileDownloader"),
  20553. J("./tile/TilePrioritizer"))
  20554. , m = (J("./enum/PanoramaEvents"),
  20555. J("./enum/ZoomEvents"))
  20556. , v = J("./util/ZoomStats")
  20557. , y = J("./constants")
  20558. , j = J("./util/common")
  20559. , A = J("./util/cameraLight")
  20560. , C = J("hot")
  20561. , Y = new i(e)
  20562. , q = Object.freeze({
  20563. FlyToPano: G.getUniqueId(),
  20564. FlyToNewMode: G.getUniqueId(),
  20565. FlyToSameMode: G.getUniqueId(),
  20566. FlyToViewFloor: G.getUniqueId(),
  20567. LookTransition: G.getUniqueId(),
  20568. ZoomTransition: G.getUniqueId()
  20569. });
  20570. function I(e) {
  20571. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20572. o[r] = n.charCodeAt(r);
  20573. return new Blob([o],{
  20574. type: i
  20575. })
  20576. }
  20577. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20578. this.modelManager = e.modelManager,
  20579. this.tileDownloader = e.tileDownloader,
  20580. this.panoRenderer = e.panoRenderer,
  20581. this.qualityManager = e.qualityManager,
  20582. this.domElement = e.container,
  20583. this.camera = e.camera,
  20584. this.tagManager = e.tagManager,
  20585. this.cameraControls = e.controls,
  20586. this.path = new r(e.director,this,e.controls),
  20587. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20588. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20589. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20590. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20591. this.tileDownloader.processPriorityQueue = !1,
  20592. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20593. this.bindEvents(e.container),
  20594. this.updateModel()
  20595. }
  20596. ,
  20597. t.prototype.screenShot = function(i) {
  20598. if (!this.flying && !this.flyingToTag) {
  20599. var n = this.sceneRenderer;
  20600. n.updateScreenSize(i)
  20601. this.model.panos.forEach(e=>{
  20602. if(e.marker){
  20603. e.marker.forceHide = e.marker.visible
  20604. e.marker.visible = !1;
  20605. }
  20606. })
  20607. /* for (var e in this.model.hots)
  20608. this.model.hots[e].mesh.visible = !1; */
  20609. player.model.hotGroup.visible = false
  20610. this.reticule.visible = !1,
  20611. this.reticule.forceUnvisible = !0,
  20612. this.path.currentPanoMarker.mesh.visible = !1,
  20613. setTimeout(function() {
  20614. n.renderer.clear(!0, !0, !0),
  20615. n.renderer.render(n.scene, n.camera);
  20616. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20617. i.f && i.f(e)
  20618. n.updateScreenSize({
  20619. resize: !0
  20620. })
  20621. this.reticule.visible = !0
  20622. player.model.hotGroup.visible = true
  20623. this.model.panos.forEach(e=>{
  20624. e.marker && (e.marker.visible = e.marker.forceHide);
  20625. })
  20626. this.path.currentPanoMarker.mesh.visible = !0,
  20627. n.renderer.render(n.scene, n.camera)
  20628. }
  20629. .bind(this), 30)
  20630. }
  20631. }
  20632. ;
  20633. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20634. t.prototype.getWrapShot = function() {
  20635. var i = this.getSnapAngleInfo()
  20636. , n = ",{\r\t" + i
  20637. , r = arguments[0];
  20638. this.screenShot({
  20639. width: g_snapShotWidth,
  20640. height: g_snapShotHeight,
  20641. type: "image/jpeg",
  20642. f: function(e) {
  20643. if (r && r.__callback)
  20644. return r.__callback(e, i);
  20645. var t = new Image;
  20646. t.src = e,
  20647. t.onload = function() {
  20648. var e = function(r, i) {
  20649. function n(e, t) {
  20650. var i = o || r
  20651. , n = document.createElement("canvas");
  20652. n.width = i.width,
  20653. n.height = i.height,
  20654. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20655. o = Q(e, n, t)
  20656. }
  20657. function e() {
  20658. var e = o || r
  20659. , t = I(e.src);
  20660. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20661. t = I(e.src)),
  20662. (o = o || new Image).base64Src = e.src,
  20663. o.src = window.URL.createObjectURL(t)
  20664. }
  20665. var o, t = Math.max(r.width, r.height);
  20666. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20667. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20668. e())),
  20669. o || r
  20670. }(this, {
  20671. maxSize: g_snapShotWidth,
  20672. oldType: "jpeg"
  20673. });
  20674. e.src.replace(function(e) {
  20675. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20676. }("image/jpeg"), "image/octet-stream");
  20677. var t = "snap" + (new Date).getTime();
  20678. !function(e, t) {
  20679. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20680. i.href = e,
  20681. i.download = t;
  20682. var n = document.createEvent("MouseEvents");
  20683. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20684. i.dispatchEvent(n)
  20685. }(e.src, t + ".jpg"),
  20686. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20687. n += '\r\t"sid":"' + t + '",',
  20688. n += '\r\t"name":"' + t + '"\r}',
  20689. logData(n)
  20690. }
  20691. }
  20692. })
  20693. }
  20694. /* ,
  20695. t.prototype.getSnapAngleInfo = function() {
  20696. var e = {}
  20697. , t = '"metadata":{'
  20698. , i = this.camera.quaternion.clone();
  20699. switch (this.mode) {
  20700. case "panorama":
  20701. e.scan_id = this.currentPano.id,
  20702. t += '"scan_id":"' + this.currentPano.id + '",';
  20703. break;
  20704. case "floorplan":
  20705. e.camera_mode = 1,
  20706. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20707. t += '"camera_mode":1,',
  20708. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20709. break;
  20710. case "dollhouse":
  20711. e.camera_mode = 2,
  20712. t += '"camera_mode":2,'
  20713. }
  20714. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20715. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20716. n.x *= -1,
  20717. n.w *= -1,
  20718. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20719. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20720. e.zoom = this.zoomLevel,
  20721. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20722. }
  20723. , */
  20724. t.prototype.getSnapAngleInfo = function(){
  20725. var info = {};
  20726. var str = '"metadata":{';
  20727. var q = this.camera.quaternion.clone();
  20728. switch (this.mode) {
  20729. case "panorama":
  20730. info.scan_id = this.currentPano.id;
  20731. str += ('"scan_id":"'+this.currentPano.id+'",');
  20732. break;
  20733. case "floorplan":
  20734. info.camera_mode = 1;
  20735. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20736. q.multiply(this.camera.quaternion);
  20737. str += ('"camera_mode":1,');
  20738. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20739. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20740. break;
  20741. case "dollhouse":
  20742. info.camera_mode = 2;
  20743. str += ('"camera_mode":2,');
  20744. break;
  20745. }
  20746. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20747. //console.log(info.camera_position)
  20748. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20749. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20750. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20751. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20752. out.x *= -1;
  20753. out.w *= -1;
  20754. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20755. }else{
  20756. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20757. } */
  20758. info.zoom = this.zoomLevel;
  20759. //console.log(info.camera_quaternion)
  20760. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20761. // fyz 扩展编辑页面, 加上导览点缩放值
  20762. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20763. console.log(str)
  20764. return str;
  20765. }
  20766. //------end
  20767. t.prototype.closePopup = function() {
  20768. if (g_currentHot) {
  20769. g_currentHot = null,
  20770. document.getElementById("popup").style.display = "none",
  20771. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20772. $("#popup iframe:last").remove();
  20773. document.getElementById("bgaudio");
  20774. if(g_bgAudio && g_bgAudio.pauseByHot){
  20775. manage.switchBgmState(true)
  20776. }
  20777. return false
  20778. }
  20779. }
  20780. ,
  20781. t.prototype.setupCustomProperties = function(e) {
  20782. var i = e || V.PANORAMA;
  20783. Object.defineProperty(this, "mode", {
  20784. get: function() {
  20785. return i
  20786. },
  20787. set: function(e) {
  20788. var t = i;
  20789. i = e,
  20790. this.onModeUpdated(t, i)
  20791. }
  20792. })
  20793. }
  20794. ,
  20795. t.prototype.isInMode = function() {
  20796. for (var e = 0; e < arguments.length; e++)
  20797. if (this.mode === arguments[e])
  20798. return !0;
  20799. return !1
  20800. }
  20801. ,
  20802. t.prototype.isOutsideMode = function(e) {
  20803. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20804. }
  20805. ,
  20806. t.prototype.is360View = function(e, t) {
  20807. return e === V.PANORAMA && t && !t.isAligned()
  20808. }
  20809. ,
  20810. t.prototype.setScene = function(e) {
  20811. this.sceneIntersectionPlane = e.plane,
  20812. this.path.setScene(e),
  20813. this.moveReticuleToScene(e)
  20814. }
  20815. ,
  20816. t.prototype.moveReticuleToScene = function(e) {
  20817. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20818. e.add(this.reticule)
  20819. }
  20820. ,
  20821. t.prototype.updateModel = function() {
  20822. function n(e) {
  20823. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20824. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20825. , n = t.position.y + (e - i.target.y)
  20826. , r = k.showFloorDuration + k.showFloorDelay;
  20827. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20828. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20829. }
  20830. this.model = this.modelManager.getActiveModel(),
  20831. this.model.on("floor.changed", function(e, t, i) {
  20832. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20833. }
  20834. .bind(this)),
  20835. this.model.on("allfloors.toggled", function(e, t) {
  20836. if (this.mode === V.DOLLHOUSE) {
  20837. var i = e ? this.model.center.y : i = t.center.y;
  20838. n.call(this, i)
  20839. }
  20840. }
  20841. .bind(this)),
  20842. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20843. var t = this;
  20844. this.model.panos.list.forEach(function(e) {
  20845. e.vrMarker.addEventListener("click", function() {
  20846. t.flyToPano({
  20847. pano: e
  20848. })
  20849. })
  20850. })
  20851. }
  20852. ,
  20853. t.prototype.updateModelDependentData = function() {
  20854. this.cameraControls.setModelForControls(this.model),
  20855. this.getPanoMarkersFromModel(this.model)
  20856. }
  20857. ,
  20858. t.prototype.onModelChanged = function() {
  20859. this.updateModel(),
  20860. this.updateModelDependentData()
  20861. }
  20862. ,
  20863. t.prototype.getPanoMarkersFromModel = function(e) {
  20864. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20865. return t.marker ? e.concat(t.marker) : e
  20866. }, [])
  20867. }
  20868. ,
  20869. t.prototype.handleControlMove = function(e) {
  20870. this.emit(W.Move, e)
  20871. }
  20872. ,
  20873. t.prototype.handleControlInputStart = function(e) {
  20874. this.emit(W.InputStart, e)
  20875. }
  20876. ,
  20877. t.prototype.onModeUpdated = function(e, t) {
  20878. this.cameraControls.activateControls(t),
  20879. this.emit(W.ModeChanged, e, t)
  20880. }
  20881. ,
  20882. t.prototype.isWarping = function() {
  20883. return this.path.warping
  20884. }
  20885. ,
  20886. t.prototype.isWaitingToWarp = function() {
  20887. return this.path.waitingToWarp
  20888. }
  20889. ,
  20890. t.prototype.getLabelScaleFactor = function() {
  20891. if (this.isOutsideMode()) {
  20892. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20893. }
  20894. return .5
  20895. }
  20896. ,
  20897. t.prototype.changeMusic = function() {
  20898. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20899. }
  20900. ,
  20901. t.prototype.bindEvents = function(e) {
  20902. e !== document && e.setAttribute("tabindex", -1),
  20903. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20904. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20905. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20906. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20907. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20908. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20909. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20910. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20911. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20912. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20913. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20914. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20915. document.addEventListener("pointerup", ()=>{//add
  20916. window.transformControls && transformControls.onPointerUp()
  20917. }),
  20918. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20919. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20920. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20921. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20922. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20923. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20924. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20925. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20926. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20927. window.getSeft && getSeft(this),
  20928. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20929. }
  20930. ,
  20931. t.prototype.onMouseDown = function(e) {
  20932. e.currentTarget !== document && e.currentTarget.focus(),
  20933. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20934. this.updateIntersect())
  20935. }
  20936. ,
  20937. t.prototype.onMouseMove = function(e) {
  20938. this.isTouchEvent = !1,
  20939. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20940. }
  20941. ,
  20942. t.prototype.onMouseOver = function(e) {
  20943. this.containsMouse = !0,
  20944. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20945. }
  20946. ,
  20947. t.prototype.onMouseOut = function(e) {
  20948. this.containsMouse = !1
  20949. }
  20950. ,
  20951. t.prototype.onMouseUp = function(e) {
  20952. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20953. }
  20954. ,
  20955. t.prototype.onTouchStart = function(e) {
  20956. if (e.currentTarget !== document && e.currentTarget.focus(),
  20957. !this.mouseDown) {
  20958. this.couldBeLongTap = !0;
  20959. var t = x.average(e.changedTouches, "clientX")
  20960. , i = x.average(e.changedTouches, "clientY");
  20961. this.handleInputStart.call(this, t, i, !0),
  20962. this.mouseDownTimer = setTimeout(function() {
  20963. this.updateIntersect(),
  20964. this.handleInputEnd.call(this, t, i, !0)
  20965. }
  20966. .bind(this), k.input.longTapThreshold)
  20967. }
  20968. }
  20969. ,
  20970. t.prototype.onTouchMove = function(e) {
  20971. var t = x.average(e.changedTouches, "clientX")
  20972. , i = x.average(e.changedTouches, "clientY");
  20973. this.handleInputMove.call(this, t, i, !0)
  20974. }
  20975. ,
  20976. t.prototype.onTouchEnd = function(e) {
  20977. if (clearTimeout(this.mouseDownTimer),
  20978. this.mouseDown) {
  20979. this.couldBeLongTap = !1,
  20980. this.updateIntersect();
  20981. var t = x.average(e.changedTouches, "clientX")
  20982. , i = x.average(e.changedTouches, "clientY");
  20983. this.handleInputEnd.call(this, t, i, !0)
  20984. }
  20985. }
  20986. ,
  20987. t.prototype.onPointerDown = function(e) {
  20988. return e.currentTarget !== document && e.currentTarget.focus(),
  20989. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20990. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20991. void (this.mouseDownTimer = setTimeout(function() {
  20992. this.updateIntersect(),
  20993. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20994. }
  20995. .bind(this), k.input.longTapThreshold)))
  20996. }
  20997. ,
  20998. t.prototype.onPointerMove = function(e) {
  20999. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21000. }
  21001. ,
  21002. t.prototype.onPointerUp = function(e) {
  21003. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21004. this.couldBeLongTap = !1,
  21005. this.updateIntersect(),
  21006. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21007. }
  21008. ,
  21009. t.prototype.onPointerOut = function(e) {
  21010. this.mouseDown = !1
  21011. }
  21012. ,
  21013. t.prototype.onPointerCancel = function(e) {
  21014. this.mouseDown = !1
  21015. }
  21016. ,
  21017. t.prototype.onKeyDown = function(e) {
  21018. var t = function() {
  21019. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  21020. }
  21021. .bind(this)
  21022. , i = e.which;
  21023. switch (i) {
  21024. case l.F:
  21025. t(),
  21026. this.changeFloor(-1);
  21027. break;
  21028. case l.R:
  21029. t(),
  21030. this.changeFloor(1)
  21031. }
  21032. if (this.mode === V.PANORAMA)
  21033. switch (i) {
  21034. case l.UPARROW:
  21035. case l.W:
  21036. this.flyLocalDirection(T.FORWARD.clone());
  21037. break;
  21038. case l.DOWNARROW:
  21039. case l.S:
  21040. this.flyLocalDirection(T.BACK.clone());
  21041. break;
  21042. case l.A:
  21043. this.flyLocalDirection(T.LEFT.clone());
  21044. break;
  21045. case l.D:
  21046. this.flyLocalDirection(T.RIGHT.clone())
  21047. }
  21048. }
  21049. ,
  21050. t.prototype.handleScrollPinchZoom = function(e) {
  21051. var t = e
  21052. , i = this.zoomLevel;
  21053. this.zoomBy(t),
  21054. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21055. }
  21056. ,
  21057. t.prototype.handleControlPinch = function(e) {
  21058. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  21059. }
  21060. ,
  21061. t.prototype.handleControlScroll = function(e) {
  21062. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  21063. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  21064. }
  21065. ,
  21066. t.prototype.handleInputStart = function(e, t, i) {
  21067. var n = this.handelPadding(e, t);
  21068. e = n.x,
  21069. t = n.y,
  21070. this.isTouchEvent = i,
  21071. U.convertScreenPositionToNDC(e, t, this.mouse),
  21072. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21073. this.mouseCouldBeClickToMove = !0,
  21074. this.mouseDown = !0
  21075. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  21076. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  21077. window.transformControls && transformControls.onPointerDown()
  21078. }
  21079. ,
  21080. t.prototype.handelPadding = function(e, t) {
  21081. return this.pad || (this.pad = {
  21082. x: dom.getOffset("left", $("#player")[0]),
  21083. y: dom.getOffset("top", $("#player")[0])
  21084. }),
  21085. {
  21086. x: e - this.pad.x,
  21087. y: t - this.pad.y
  21088. }
  21089. }
  21090. ,
  21091. t.prototype.handleInputMove = function(e, t, i) {
  21092. var n = this.handelPadding(e, t);
  21093. e = n.x,
  21094. t = n.y,
  21095. this.isTouchEvent = i,
  21096. U.convertScreenPositionToNDC(e, t, this.mouse);
  21097. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  21098. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  21099. this.couldBeLongTap = !1,
  21100. clearTimeout(this.mouseDownTimer)),
  21101. this.mouseLastMoveTime = Date.now(),
  21102. this.reticule.move(e, t, i)
  21103. window.transformControls && transformControls.onPointerMove()
  21104. }
  21105. ,
  21106. t.prototype.handleInputEnd = function(e, t, i) {
  21107. if (this.isTouchEvent = i,
  21108. this.mouseDown = !1,
  21109. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  21110. !i && this.couldBeLongTap)
  21111. return !0;
  21112. if (this.handleLongTap())
  21113. return !0;
  21114. window.transformControls && transformControls.onPointerUp()
  21115. if (this.mouseCouldBeClickToMove) {
  21116. if (this.flying)
  21117. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  21118. !0;
  21119. //add----
  21120. if (this.checkHotClick())
  21121. return !0;
  21122. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  21123. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  21124. return;
  21125. }
  21126. if (window.VisiSet && VisiSet.setTagVisible ) {
  21127. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  21128. return;
  21129. }
  21130. if (window.VisiSet && VisiSet.setPanoLog ) {
  21131. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick( this.intersect.object);
  21132. return;
  21133. }
  21134. if(this.hoveringPlane){
  21135. this.clickOverlay(this.hoveringPlane)
  21136. return;
  21137. }
  21138. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  21139. return EditOverlay.addPlane({intersect:this.intersect});
  21140. }
  21141. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  21142. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  21143. else if(objects.mainDesign.editType == "addOverlay")return !0;
  21144. } */
  21145. //----------
  21146. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  21147. this.history.invalidate(),
  21148. this.intersect)
  21149. return this.flyToPanoClosestToMouse();
  21150. if (this.mode === V.PANORAMA) {
  21151. var n = this.closestPanoInDirection(this.getMouseDirection());
  21152. return n ? this.flyToPano({
  21153. pano: n
  21154. }) : this.bump(this.getMouseDirection())
  21155. }
  21156. }
  21157. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21158. }
  21159. ,
  21160. t.prototype.handleLongTap = function() {
  21161. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  21162. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  21163. !0
  21164. }
  21165. ,
  21166. t.prototype.checktagClick = function() {
  21167. if (this.tagManager.intersectTag) {
  21168. var e = this.isTouchEvent
  21169. , t = this.tagManager.clickedOnTag(e, this);
  21170. return e || t || G.cancelById(q.LookTransition),
  21171. !0
  21172. }
  21173. if (this.tagManager.activeTag)
  21174. return this.tagManager.dismissActiveTag(),
  21175. !1
  21176. }
  21177. ,
  21178. t.prototype.rankedtagInDirection = function(e, t) {
  21179. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21180. }
  21181. ,
  21182. t.prototype.start = function(e) {
  21183. $(".toolLeft").removeClass("unable");
  21184. $(".toolTop").removeClass("unable");
  21185. //-------------------
  21186. window.initTransformCtl(B)
  21187. //this.model.loadOverlays()
  21188. //window.EditOverlay && window.EditOverlay.init(B);
  21189. window.VisiSet && VisiSet.init()
  21190. //-------------------
  21191. var t = e.mode
  21192. , i = e.pano
  21193. , n = e.position
  21194. , r = e.quaternion
  21195. , o = e.tag
  21196. , a = e.quickstart
  21197. , s = $.Deferred();
  21198. this.updateModelDependentData(),
  21199. this.updateFromControls(),
  21200. this.findDefaultViews();
  21201. var l = this.is360View(t, i);
  21202. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  21203. s.done(function(e) {
  21204. this.emit(W.Ready, l, e, o)
  21205. }
  21206. .bind(this)),
  21207. s.promise()
  21208. }
  21209. ,
  21210. t.prototype.startOutside = function(e, t) {
  21211. var i = e.mode
  21212. , n = e.pano
  21213. , r = e.position
  21214. , o = e.quaternion
  21215. , a = e.zoom
  21216. , s = e.floorVisibility
  21217. , l = e.tag;
  21218. this.emit(W.StartOutside, k[i].transitionTime),
  21219. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21220. G.cancelById(q.FlyToViewFloor),
  21221. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21222. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21223. }
  21224. ,
  21225. t.prototype.startInside = function(e, t, i, n, r) {
  21226. r = r || $.Deferred();
  21227. var o = (this.currentPano = e) && !e.isAligned();
  21228. if (t = o ? e.position : t || e.position,
  21229. i = i || e.quaternion,
  21230. e) {
  21231. var a = this.startInside.bind(this, e, t, i, n, r);
  21232. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21233. return
  21234. }
  21235. //add
  21236. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  21237. //this.updateHotVisible()
  21238. //EditOverlay.updatePano()
  21239. editTool.hotpoint.updatePano()
  21240. Hot.updateVisibles([this.currentPano])
  21241. return this.mode = V.PANORAMA,
  21242. e.floor.enter(this.mode),
  21243. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  21244. this.switchCameraMode(this.mode, i),
  21245. this.emit(W.StartInside, o),
  21246. r.resolve(!0),
  21247. r
  21248. }
  21249. ,
  21250. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  21251. if (r = r || $.Deferred(),
  21252. this.dollhouseMode(),
  21253. !i)
  21254. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21255. r.resolve(!1),
  21256. r;
  21257. e = e || i.position;
  21258. var o = n || this.cameraControls.activeControl.camera.quaternion
  21259. , a = i.position;
  21260. return this.fitDollhouse(a, e, o),
  21261. setTimeout(function(e) {
  21262. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  21263. var t = {
  21264. mode: V.PANORAMA,
  21265. pano: i,
  21266. quaternion: n,
  21267. callback: function() {
  21268. this.emit(W.FlyinFinished),
  21269. r.resolve(!0)
  21270. }
  21271. .bind(this)
  21272. };
  21273. this.flyToNewMode(t)
  21274. }
  21275. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  21276. r
  21277. }
  21278. ,
  21279. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  21280. K = {},
  21281. function(t, e, i, n, r, o, a, s, l, c) {
  21282. if (function() {
  21283. for (var e in Z)
  21284. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  21285. return !0;
  21286. return !1
  21287. }())
  21288. return !0;
  21289. var h = function(e, t, i) {
  21290. j.delayOneFrame(function() {
  21291. Z[e] = !1,
  21292. r && r(t, i)
  21293. }
  21294. .bind(this))
  21295. }
  21296. .bind(this, t.id)
  21297. , u = function(e, t) {
  21298. j.delayOneFrame(function() {
  21299. Z[e] = !1,
  21300. o && o(t)
  21301. }
  21302. .bind(this))
  21303. }
  21304. .bind(this, t.id);
  21305. try {
  21306. return null != s || (s = !0),
  21307. 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),
  21308. Z[t.id] && (K[t.id] = performance.now()),
  21309. Z[t.id]
  21310. } catch (e) {
  21311. throw Z[t.id] = !1,
  21312. K[t.id] = performance.now() - 5e3,
  21313. e
  21314. }
  21315. }
  21316. ),
  21317. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21318. if (!e)
  21319. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21320. return r && this.model.waitForLoad(e, function() {
  21321. return e.isLoaded(i)
  21322. }),
  21323. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21324. !0)
  21325. }
  21326. ,
  21327. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  21328. function(e, t, i, n, r, o, a, s) {
  21329. if (!e)
  21330. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21331. return X.copy(T.FORWARD),
  21332. this.getDirection(X),
  21333. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  21334. return e.isLoaded(t)
  21335. }),
  21336. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  21337. i && i(e, t)
  21338. }
  21339. .bind(this)).fail(function(e) {
  21340. n && n(e)
  21341. }
  21342. .bind(this)).progress(function(e, t, i) {
  21343. r && r(e, t, i)
  21344. }
  21345. .bind(this)),
  21346. !0)
  21347. }
  21348. ),
  21349. t.prototype.switchCameraMode = function(e, t) {
  21350. var i = this.cameraControls.controls[e]
  21351. , n = i.camera;
  21352. switch (e) {
  21353. case V.PANORAMA:
  21354. n.position.copy(this.currentPano.position);
  21355. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21356. i.lookAt(r.add(n.position));
  21357. break;
  21358. case V.DOLLHOUSE:
  21359. var o = this.position.clone();
  21360. 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),
  21361. n.position.copy(o),
  21362. i.target.copy(this.target.clone().setY(this.model.center.y));
  21363. break;
  21364. //for多楼层 且 让模型刚好适应屏幕
  21365. /* var box = this.model.boundingBox.clone();
  21366. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21367. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21368. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  21369. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21370. console.log(boxSize.x,distance, boxSize.length() / 2)
  21371. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21372. if(this.mode === V.PANORAMA){
  21373. i.target.copy(this.model.center);
  21374. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21375. }else{
  21376. i.target.copy(this.target.clone().setY(this.model.center.y))
  21377. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21378. }
  21379. vec.multiplyScalar(distance )
  21380. n.position.copy(i.target.clone().add(vec)) */
  21381. break
  21382. case V.FLOORPLAN:
  21383. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  21384. i.target.copy(this.model.center).setY(0),
  21385. i.zoomToContain(this.model.size),
  21386. i.rotateToView(this.model.size, this.getDirection())
  21387. }
  21388. i.update(0)
  21389. }
  21390. ,
  21391. t.prototype.update = (new B.Vector3,
  21392. N = {},
  21393. F = [],
  21394. function(e) {
  21395. this.updatePersistentZooming(e),
  21396. this.updateFromControls(e),
  21397. this.getCurrentNodePanos(F)
  21398. if(this.hasChanged(N)){
  21399. this.lastChangeTime = Date.now(),
  21400. !this.mouseDown && this.containsMouse && this.updateIntersect()
  21401. this.emit(W.ViewChanged)
  21402. //add:
  21403. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) VisiSet.updateFootIconSize();
  21404. this.intersectHot && this.intersectHot.showTitle()
  21405. editTool.hotpoint.showTitileSpots && editTool.hotpoint.showTitileSpots.forEach(e=>e.showTitle())
  21406. for(var i in this.model.hots){
  21407. this.model.hots[i].update(this)
  21408. }
  21409. /* if(this.mode == 'panorama')this.model.hotGroup&&this.model.hotGroup.children.forEach(overlay=>{
  21410. overlay.update()
  21411. }) */
  21412. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  21413. }
  21414. this.model.supportsTiles && (this.updateTileDownloader(F),
  21415. this.updatePanoRenderer(F)),
  21416. this.updatePreRendering(F),
  21417. this.reticule.update(),
  21418. this.path.update(),
  21419. this.spider.update(),
  21420. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21421. this.updateControlLocks(),
  21422. this.model.supportsTiles && this.updateZoomPano()
  21423. }
  21424. ),
  21425. t.prototype.updatePersistentZooming = function(e) {
  21426. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  21427. }
  21428. ,
  21429. t.prototype.updateControlLocks = function() {
  21430. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21431. }
  21432. ,
  21433. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  21434. function(e) {
  21435. var t = this.nextPano || this.currentPano;
  21436. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  21437. this.getDirection(D),
  21438. this.panoRenderer.updateDirection(D))
  21439. }
  21440. ),
  21441. t.prototype.cleanupInactivePanos = (O = [],
  21442. L = [],
  21443. function() {
  21444. O.length = 0,
  21445. O.push(this.currentPano),
  21446. this.nextPano && O.push(this.nextPano);
  21447. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  21448. L.push(this.panoRenderer.activePanos[e]);
  21449. for (var t = 0; t < L.length; t++) {
  21450. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  21451. i.id === O[r].id && (n = !1);
  21452. n && i.exit()
  21453. }
  21454. }
  21455. ),
  21456. t.prototype.updatePreRendering = (w = {},
  21457. function(e) {
  21458. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21459. var t = this.nextPano || this.currentPano;
  21460. if (t && e && 1 < e.length) {
  21461. var i = e.findIndex(function(e) {
  21462. if (e.id === t.id)
  21463. return !0
  21464. });
  21465. if (0 <= i && i + 1 < e.length) {
  21466. var n = e[i + 1];
  21467. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  21468. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21469. window.setTimeout(function(e) {
  21470. w[e.id] = !1
  21471. }
  21472. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21473. }
  21474. .bind(this, n), k.tiling.panoPreRenderDelay),
  21475. w[n.id] = !0)
  21476. }
  21477. }
  21478. }
  21479. }
  21480. ),
  21481. t.prototype.enablePreRendering = function() {
  21482. this.preRenderingEnabled = !0
  21483. }
  21484. ,
  21485. t.prototype.disablePreRendering = function() {
  21486. this.preRenderingEnabled = !1,
  21487. this.cleanupInactivePanos()
  21488. }
  21489. ,
  21490. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21491. function(e) {
  21492. var t = this.nextPano || this.currentPano;
  21493. t && (b.copy(T.FORWARD),
  21494. this.getDirection(b),
  21495. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21496. this.tileDownloader.processPriorityQueue = !0)
  21497. }
  21498. ),
  21499. t.prototype.updateFromControls = function(e) {
  21500. null != e || (e = 0),
  21501. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21502. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21503. this.position.copy(this.cameraControls.activeControl.camera.position),
  21504. this.target.copy(this.cameraControls.activeControl.target),
  21505. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21506. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21507. this.camera.position.copy(this.position),
  21508. this.camera.quaternion.copy(this.quaternion),
  21509. this.camera.updateMatrix(),
  21510. this.camera.updateMatrixWorld()
  21511. }
  21512. ,
  21513. t.prototype.hasChanged = function(e) {
  21514. if (!this.previousState)
  21515. return this.previousState = {
  21516. allFloorsVisible: this.model.allFloorsVisible,
  21517. position: this.position.clone(),
  21518. quaternion: this.quaternion.clone(),
  21519. mouse: this.mouse.clone(),
  21520. labelScaleFactor: this.getLabelScaleFactor(),
  21521. currentFloor: this.model.currentFloor,
  21522. projectionMatrix: this.camera.projectionMatrix.clone(),
  21523. worldMatrix: this.camera.matrixWorld.clone(),
  21524. mode: this.mode,
  21525. modelPosition: this.model.position.clone(),
  21526. modelCenter: this.model.center.clone(),
  21527. zoomLevel: this.zoomLevel
  21528. },
  21529. !0;
  21530. 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;
  21531. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21532. e.moved = !this.position.equals(this.previousState.position),
  21533. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21534. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21535. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21536. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21537. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21538. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21539. e.modeChanged = this.mode !== this.previousState.mode,
  21540. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21541. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21542. e.nextPanoActive = null !== this.nextPano,
  21543. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21544. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21545. this.previousState.position.copy(this.position),
  21546. this.previousState.quaternion.copy(this.quaternion),
  21547. this.previousState.mouse.copy(this.mouse),
  21548. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21549. this.previousState.currentFloor = this.model.currentFloor,
  21550. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21551. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21552. this.previousState.mode = this.mode,
  21553. this.previousState.modelPosition.copy(this.model.position),
  21554. this.previousState.modelCenter.copy(this.model.center),
  21555. this.previousState.zoomLevel = this.zoomLevel,
  21556. !t
  21557. }
  21558. ,
  21559. t.prototype.updateIntersect = function() {
  21560. var e = this.flying || this.isWarping()
  21561. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21562. , i = G.getById(q.LookTransition);
  21563. e || t || this.isTouchEvent || i.length && i[0].running;
  21564. {//clear:
  21565. if(this.intersectHot) this.intersectHot.hideTitle()
  21566. this.intersectHot = null
  21567. $("#player").css("cursor", "")
  21568. $(".toolRight .spotList ul li").removeClass("active")
  21569. }
  21570. var deal = ()=>{
  21571. if(this.intersect && this.intersect.object.visible ){
  21572. if("hotSprite" == this.intersect.object.type){
  21573. this.intersectHot = this.intersect.object
  21574. while(!(this.intersectHot instanceof Hot)){
  21575. this.intersectHot = this.intersectHot.parent
  21576. }
  21577. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21578. this.intersectHot.showTitle()
  21579. }
  21580. }
  21581. }
  21582. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) {
  21583. this.intersect = this.getMouseIntersect(null, this.model.hotGroup.children.concat(VisiSet.footIcons||[]) );
  21584. deal()
  21585. if(this.intersect){
  21586. $("#player").css("cursor", "pointer");
  21587. }
  21588. if(this.intersectHot){
  21589. this.intersect = null
  21590. }
  21591. return
  21592. }else if (g_HotStatus) {//加热点
  21593. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox));
  21594. if(this.intersect){
  21595. $("#player").css("cursor", "cell")
  21596. }else{
  21597. $("#player").css("cursor", "not-allowed")
  21598. }
  21599. return;
  21600. }else{
  21601. if(this.model.hotGroup){
  21602. if(editTool.atPanel == 'hotpoint'){
  21603. var hots = this.model.hotGroup.children
  21604. }else{
  21605. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21606. }
  21607. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  21608. if(this.intersect){
  21609. deal()
  21610. this.intersectHot && $("#player").css("cursor", "pointer");
  21611. }
  21612. }
  21613. }
  21614. this.intersect = this.getMouseIntersect(),
  21615. this.intersect && this.updateClosestPano(this.intersect),
  21616. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21617. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21618. }
  21619. ,
  21620. t.prototype.checkHotClick = function() {
  21621. if (this.intersectHot){
  21622. if (window.VisiSet && VisiSet.setTagVisible ) {
  21623. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21624. return;
  21625. }else if(editTool.atPanel == 'hotpoint'){
  21626. if(editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot){
  21627. var sure = confirm("是否保存当前热点?")
  21628. if(sure){
  21629. editTool.hotpoint.saveHot().then(()=>{
  21630. editTool.hotpoint.editHot(this.intersectHot)
  21631. })
  21632. }else{
  21633. editTool.hotpoint.editHot(this.intersectHot)
  21634. }
  21635. }else{
  21636. editTool.hotpoint.editHot(this.intersectHot)
  21637. }
  21638. }else{
  21639. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  21640. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21641. }
  21642. this.intersectHot.examine()
  21643. }
  21644. return !0
  21645. }
  21646. }
  21647. ,
  21648. t.prototype.getMouseDirection = function(e) {
  21649. e = e || this.mouse;
  21650. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21651. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21652. }
  21653. ,
  21654. t.prototype.hoverOverlay = function(mesh){
  21655. if(!mesh){
  21656. this.hoveringPlane = null;
  21657. $("#player").css("cursor",this.currentCursor || "" );
  21658. }else{
  21659. var overlay = mesh.parent;
  21660. $("#player").css("cursor","pointer");
  21661. this.hoveringPlane = overlay;
  21662. return true;
  21663. }
  21664. },
  21665. t.prototype.clickOverlay = function(overlay){
  21666. if(this.openOverlay && !overlay)return;
  21667. var plane = overlay.plane;
  21668. if(overlay.texType == "video"){
  21669. overlay.switchPlay(!!overlay.pausedByUser)
  21670. }
  21671. if(window.EditOverlay && EditOverlay.editing){
  21672. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane){
  21673. var sure = confirm("是否保存当前展览?")
  21674. if(sure){
  21675. $("#overlayProp button.submit").click()
  21676. }else{
  21677. EditOverlay.closeOverlayPanel('cancel')
  21678. }
  21679. }
  21680. EditOverlay.beginEdit(overlay);
  21681. return;
  21682. }
  21683. },
  21684. t.prototype.getMouseIntersect = function(e, t1) {
  21685. e = e || this.mouse.clone()
  21686. var t = t1 || this.model.floors.reduce(function(e, t) {
  21687. return t.hidden ? e : e.concat(t.collider.children)
  21688. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21689. t = t.slice(0)
  21690. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21691. this.raycaster.set(i, this.getMouseDirection(e));
  21692. var n = this.raycaster.intersectObjects(t , true );//add true
  21693. var o = n[0];
  21694. if(o){
  21695. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21696. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21697. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21698. o.horizontal = .8 < o.normal.y);
  21699. return o
  21700. }
  21701. }
  21702. ,
  21703. t.prototype.updateClosestPano = function(e) {
  21704. var t = [a.filters.isPanoAligned()];
  21705. if (this.mode === V.PANORAMA) {
  21706. if (!this.currentPano)
  21707. return;
  21708. t.push(a.filters.not(this.currentPano)),
  21709. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21710. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21711. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21712. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21713. } else{
  21714. t.push((pano)=>{ // add
  21715. return this.checkHasNeighbor(pano)
  21716. })
  21717. t.push(a.filters.isOnVisibleFloor()),
  21718. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21719. }
  21720. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21721. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21722. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21723. this.closestPano = i) : this.isPanoHover = !1
  21724. }
  21725. ,
  21726. t.prototype.dollhouseMode = function(e, t) {
  21727. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21728. this.mode = V.DOLLHOUSE,
  21729. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21730. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21731. , n = new B.Vector3(15,10,15);
  21732. if (e && t) {
  21733. var r = T.FORWARD.clone().applyQuaternion(t)
  21734. , o = this.model.center.clone().sub(e).dot(r);
  21735. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21736. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21737. }
  21738. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21739. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21740. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21741. this.updateFromControls(),
  21742. this.model.alpha = 1,
  21743. this.model.skybox.material.uniforms.opacity.value = 0
  21744. }
  21745. ,
  21746. t.prototype.insideMode = function(e, t) {
  21747. var i = $.Deferred()
  21748. , n = t || null;
  21749. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21750. var r = [a.filters.isPanoAligned()];
  21751. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21752. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21753. this.flyToNewMode({
  21754. mode: V.PANORAMA,
  21755. pano: e,
  21756. callback: n
  21757. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21758. } else {
  21759. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21760. i.reject(o)
  21761. }
  21762. return i.promise()
  21763. }
  21764. ,
  21765. t.prototype.fitDollhouse = function(e, t, i) {
  21766. var maxY = this.model.boundingBox.max.y;//add
  21767. var n = T.FORWARD.clone().applyQuaternion(i);
  21768. i = n.clone().add(e);
  21769. this.cameraControls.activeControl.target.copy(i),
  21770. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21771. }
  21772. ,
  21773. t.prototype.floorplanMode = function(e, t, i) {
  21774. this.mode = V.FLOORPLAN;
  21775. var n = this.cameraControls.controls[V.FLOORPLAN];
  21776. n.reset();
  21777. var r = e || this.model.center;
  21778. if (n.target.copy(r).setY(0),
  21779. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21780. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21781. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21782. t) {
  21783. var o = T.LEFT.clone().applyQuaternion(t);
  21784. n.rotateLeft(-Math.atan2(o.x, o.z))
  21785. } else
  21786. n.rotateToView(this.model.size, this.getDirection());
  21787. n.update(0)
  21788. }
  21789. ,
  21790. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21791. return e.skipWarpingCheck = !0,
  21792. this.flyToPano(e, t)
  21793. }
  21794. ,
  21795. t.prototype.updateMarkerVisi = function() {//加
  21796. if(this.mode != "panorama")return;
  21797. this.model.panos.list.forEach((pano)=>{
  21798. if(!pano.marker)return;
  21799. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21800. })
  21801. }
  21802. ,
  21803. /* t.prototype.updateHotVisible = function(pano){
  21804. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21805. var hots = this.model.hots;
  21806. pano = pano || this.currentPano;
  21807. for (var index in hots){
  21808. var visible;
  21809. if(this.mode != "panorama"){
  21810. visible = true;
  21811. }else{
  21812. //hots[index].mesh.material.depthTest = false;
  21813. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21814. }
  21815. hots[index].mesh.visible = visible;
  21816. }
  21817. }
  21818. */
  21819. t.prototype.flyToPano = function(e, t) {
  21820. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21821. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21822. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21823. if (aim){
  21824. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21825. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21826. }
  21827. else aimQua = aimQua
  21828. var zoomLevel = e.zoomLevel || 1 //add
  21829. if(this.flying) return t && t(e)
  21830. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21831. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21832. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21833. t && t(),
  21834. !1;
  21835. this.updateLastView()
  21836. if (this.mode !== V.PANORAMA)
  21837. return void this.flyToNewMode({
  21838. mode: V.PANORAMA,
  21839. pano: n,
  21840. duration: o,
  21841. quaternion: aimQua,
  21842. callback: t
  21843. });
  21844. if (!n || (h = x.deepExtend(e), u = function() {
  21845. j.delayOneFrame(function() {
  21846. this.flyToPano(h, t)
  21847. }.bind(this))
  21848. }.bind(this),
  21849. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21850. var d = function(e) {
  21851. t && t(e)
  21852. }
  21853. .bind(this);
  21854. this.currentPano || (this.currentPano = n,
  21855. this.path.placeCpm(),
  21856. this.path.fadeOutCpm(k.path.fadeOutTime),
  21857. this.spider.draw());
  21858. var p = o;
  21859. if ("number" != typeof o) {
  21860. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21861. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21862. }
  21863. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21864. zoomLevel !== this.zoomLevel)
  21865. switch (k.zoom.transitionStyle) {
  21866. case 1:
  21867. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21868. break;
  21869. case 2:
  21870. return h = x.deepExtend(e),
  21871. u = this.flyToPano.bind(this, h, t),
  21872. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21873. }
  21874. if (aimQua) {
  21875. G.cancelById(q.LookTransition),
  21876. p *= k.transition.aimSlowFactor;
  21877. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21878. , y = g.clone()
  21879. , A = new B.Vector3;
  21880. if (n === this.currentPano) {
  21881. var C = T.FORWARD.clone().applyQuaternion(g)
  21882. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21883. , E = C.angleTo(I);
  21884. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21885. void G.start(function(e) {
  21886. y.copy(g),
  21887. H.quaternion(y, aimQua)(e),
  21888. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21889. this.cameraControls.activeControl.lookAt(A)
  21890. }
  21891. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21892. }
  21893. }
  21894. if (n === this.currentPano )
  21895. return void d();
  21896. this.flying = !0;
  21897. var _ = this.position.clone()
  21898. , b = this.currentPano;
  21899. Y.debug("Flying to pano ", n.position);
  21900. this.emit(W.PanoChosen, this.currentPano, n);
  21901. this.emit(W.FlyingStarted, n.position, _, n, b);
  21902. //this.updateHotVisible(n); //更新热点显示
  21903. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21904. Hot.updateVisibles([this.currentPano, n])
  21905. aimQua && G.start(function(e) {
  21906. y.copy(g),
  21907. H.quaternion(y, aimQua)(e),
  21908. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21909. this.cameraControls.activeControl.lookAt(A)
  21910. }
  21911. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21912. var w = c ? null : z[k.transition.movementEasing];
  21913. this.nextPano = n;
  21914. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21915. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21916. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21917. this.flying = !1,
  21918. this.currentPano !== n && this.currentPano.exit(),
  21919. n.enter(),
  21920. this.currentPano = n,
  21921. this.nextPano = null,
  21922. this.path.placeCpm(),
  21923. this.path.fadeOutCpm(k.path.fadeOutTime),
  21924. this.spider.draw(),
  21925. this.emit(W.FlyingEnded, n.position, _, n, b),
  21926. this.updateMarkerVisi();//add
  21927. d(e)
  21928. if(this.mode == "panorama" ){
  21929. //EditOverlay.updatePano()
  21930. editTool.hotpoint.updatePano()
  21931. Hot.updateVisibles([this.currentPano])
  21932. }
  21933. }
  21934. .bind(this), 0, w, "camFly", q.FlyToPano)
  21935. }
  21936. }
  21937. ,
  21938. window._transitionPosId = 9999
  21939. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21940. G.cancelById(_transitionPosId)
  21941. var begin = function(object, pos, qua, scale){
  21942. if(pos){
  21943. if(!same(object.position, pos, 0.01)){
  21944. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21945. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21946. }
  21947. if(qua && !same(object.quaternion, qua, 1e-6)){
  21948. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21949. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21950. }
  21951. if(scale && !same(object.scale, scale, 0.001)){
  21952. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21953. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21954. }
  21955. }
  21956. }
  21957. var same = function(vec1, vec2, diff){
  21958. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21959. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21960. return s
  21961. }
  21962. var sid = o.pano != void 0 ? o.pano.id : "outside";
  21963. /* this.model.hotGroup.children.forEach(overlay=>{
  21964. var panoData = overlay.transformAtPanos[sid]
  21965. var useCustom = !panoData
  21966. //if(overlay.usingTransformData || !useCustom){
  21967. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21968. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21969. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21970. overlay.getScaleBySize(panoData.width , panoData.height)
  21971. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21972. begin(overlay, pos, qua, scale )
  21973. //}
  21974. overlay.usingTransformData = !useCustom
  21975. }) */
  21976. for(let i in this.model.hots){//是否判断visible?
  21977. var hot = this.model.hots[i];
  21978. var panoData = hot.info.transformAtPanos[sid];
  21979. var useCustom = !panoData
  21980. //if(hot.usingTransformData || !useCustom){
  21981. var pos = useCustom ? hot.info.position : panoData.pos;
  21982. //var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  21983. begin(hot, pos/* , qua */ )
  21984. //}
  21985. //hot.usingTransformData = !useCustom;
  21986. }
  21987. }
  21988. window._tranOutsideFocus = 4399
  21989. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21990. console.log("focusPoint")
  21991. if(this.mode == "floorplan"){
  21992. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21993. var control = player.cameraControls.controls.floorplan;
  21994. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21995. var currentScale = control.absoluteScale;
  21996. var currentTarget = control.target.clone()
  21997. G.cancelById(window._tranOutsideFocus, true);
  21998. G.start(function(progress){
  21999. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  22000. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22001. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  22002. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22003. }else if(player.mode == "dollhouse"){
  22004. var control = player.cameraControls.controls.dollhouse;
  22005. var radius = o.radius || 8;
  22006. var currentTarget = control.target.clone()
  22007. var dir = control.offset.clone().normalize()
  22008. var currentRadius = control.offset.length();
  22009. G.cancelById(window._tranOutsideFocus, true);
  22010. G.start(function(progress){
  22011. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22012. let radius_ = radius*progress+currentRadius*(1-progress)
  22013. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  22014. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22015. }else if(this.mode == 'panorama'){
  22016. this.flyToPano({
  22017. lookAtPoint: o.aim.clone() ,
  22018. pano: this.currentPano,
  22019. aimDuration: o.dur || 600
  22020. })
  22021. }
  22022. }
  22023. t.prototype.fastForwardActivePanoFlight = function(e) {
  22024. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  22025. G.adjustSpeed(q.FlyToPano, e),
  22026. G.adjustSpeed(q.LookTransition, e)
  22027. }
  22028. ,
  22029. t.prototype.flyToPanoClosestToMouse = function() {
  22030. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  22031. this.intersect && this.updateClosestPano(this.intersect)),
  22032. this.closestPano)
  22033. return this.flyToPano({
  22034. pano: this.closestPano
  22035. });
  22036. var e = this.getMouseDirection();
  22037. this.flyDirection(e) || this.flyToPano({
  22038. pano: this.currentPano
  22039. })
  22040. }
  22041. ,
  22042. t.prototype.flyLocalDirection = function(e) {
  22043. var t = this.getDirection(e)
  22044. , i = 1 === e.z ? .4 : .75
  22045. , n = 1 === Math.abs(e.x);
  22046. return this.flyDirection(t, i, n)
  22047. }
  22048. ,
  22049. t.prototype.flyDirection = function(e, t, i) {
  22050. this.closePopup();
  22051. var n = $.Deferred();
  22052. this.history.invalidate();
  22053. var r = this.closestPanoInDirection(e, t, i);
  22054. return r ? this.flyToPano({
  22055. pano: r
  22056. }, n.resolve.bind(n, !0)) : (this.bump(e),
  22057. n.resolve(!1)),
  22058. n.promise()
  22059. }
  22060. ,
  22061. t.prototype.closestPanoInDirection = function(e, t, i) {
  22062. return this.rankedPanoInDirection(0, e, t, i)
  22063. }
  22064. ,
  22065. t.prototype.rankedPanoInDirection = (_ = {
  22066. pano: null,
  22067. candidates: []
  22068. },
  22069. function(e, t, i, n) {
  22070. e = e || 0,
  22071. i = void 0 !== i ? i : .75;
  22072. var r = n ? "angle" : "direction";
  22073. 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)], _),
  22074. this.cachedPanoCandidates = _.candidates,
  22075. _.pano
  22076. }
  22077. ),
  22078. t.prototype.bump = function(e) {
  22079. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  22080. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  22081. if (.5 < Math.abs(a))
  22082. t = function() {
  22083. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  22084. }
  22085. .bind(this),
  22086. i = function() {
  22087. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  22088. }
  22089. .bind(this);
  22090. else {
  22091. var s = this.camera.position.clone()
  22092. , l = e.clone();
  22093. this.raycaster.set(s, l);
  22094. var c = this.model.floors.reduce(function(e, t) {
  22095. return e.concat(t.collider.children)
  22096. }, [])
  22097. , h = this.raycaster.intersectObjects(c)
  22098. , u = 0 < h.length ? h[0].distance / 25 : .04
  22099. , d = s.clone().add(l.multiplyScalar(u));
  22100. t = function() {
  22101. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  22102. }
  22103. .bind(this),
  22104. i = function() {
  22105. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  22106. }
  22107. .bind(this)
  22108. }
  22109. n = function() {
  22110. this.flying = !1
  22111. }
  22112. .bind(this),
  22113. this.flying = !0,
  22114. t()
  22115. }
  22116. }
  22117. ,
  22118. t.prototype.changeFloor = function(e) {
  22119. if (!this.is360View(this.mode, this.currentPano))
  22120. if (this.mode === V.PANORAMA) {
  22121. var t = this.history.reversePano(e);
  22122. t && t.isAligned() ? this.flyToPano({
  22123. pano: t
  22124. }) : this.changeFloorByScore(e)
  22125. } else
  22126. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  22127. }
  22128. ,
  22129. t.prototype.changeFloorByScore = (E = {
  22130. pano: null,
  22131. candidates: []
  22132. },
  22133. function(e) {
  22134. var t = this.model.nextFloor(e);
  22135. 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),
  22136. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  22137. this.history.push(e, this.currentPano),
  22138. this.flyToPano({
  22139. pano: E.pano
  22140. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  22141. }
  22142. ),
  22143. t.prototype.gotoFloor = function(e) {
  22144. var t = e - this.model.currentFloor.floorIndex;
  22145. this.changeFloor(t)
  22146. }
  22147. ,
  22148. t.prototype.getDirection = function(e) {
  22149. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  22150. }
  22151. ,
  22152. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  22153. if (r = r || $.Deferred(),
  22154. this.mode === V.TRANSITIONING)
  22155. return Y.warn("should not be transitioning here"),
  22156. n && n(!1),
  22157. r.reject().promise();
  22158. var o = i || !1
  22159. , a = i ? i.position : this.position
  22160. , s = this.position.clone()
  22161. , l = this.currentPano;
  22162. if (Y.debug("New pose in mode " + this.mode),
  22163. !e || (retryCallback = function() {
  22164. j.delayOneFrame(function() {
  22165. this.flyToSameMode(e, t, i, n, r)
  22166. }
  22167. .bind(this))
  22168. }
  22169. .bind(this),
  22170. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  22171. var c = function() {
  22172. this.emit(W.FlyingEnded, a, s, e, l),
  22173. n && n(!0)
  22174. }
  22175. .bind(this)
  22176. , h = k[this.mode]
  22177. , u = void 0 !== t ? t : h.transitionTime
  22178. , d = new B.Vector3
  22179. , p = new B.Vector3;
  22180. if (this.emit(W.FlyingStarted, a, s, e, l),
  22181. this.mode === V.PANORAMA)
  22182. Y.warn("we should not be here for panorama views");
  22183. else if (this.mode === V.DOLLHOUSE)
  22184. if (o) {
  22185. var f = new B.Vector3(0,1,0);
  22186. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  22187. this.model.warpDestFloors(i.floorVisibility),
  22188. p.copy(i.position);
  22189. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  22190. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  22191. , v = 3;
  22192. m.length ? (d.copy(m[0].point),
  22193. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  22194. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  22195. var y = (new B.Matrix4).lookAt(p, d, f)
  22196. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  22197. , C = d.distanceTo(p)
  22198. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  22199. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  22200. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  22201. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  22202. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  22203. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  22204. this.path.burnsDir = Math.sign(b.y);
  22205. var w = new B.Euler(0,0,0,k.warp.eOrder)
  22206. , T = new B.Vector3;
  22207. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  22208. G.start(function(e, t) {
  22209. w.x = E.x + e * b.x,
  22210. w.y = E.y + e * b.y,
  22211. w.z = E.z + e * b.z;
  22212. var i = _ + e * (C - _);
  22213. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  22214. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  22215. }
  22216. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  22217. G.start(function(e, t) {
  22218. this.cameraControls.controls[V.DOLLHOUSE].update(),
  22219. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  22220. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  22221. }
  22222. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  22223. } else
  22224. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  22225. else if (this.path.placeCpm(),
  22226. this.path.fadeInCpm(k.path.fadeInTime),
  22227. i) {
  22228. this.model.warpDestFloors(i.floorVisibility);
  22229. var x = this.cameraControls.cameras[V.FLOORPLAN]
  22230. , S = this.cameraControls.controls[V.FLOORPLAN]
  22231. , M = S.target.clone()
  22232. , R = i.position.clone().sub(M)
  22233. , P = x.position.clone().sub(S.target).length()
  22234. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  22235. , L = Math.atan2(S.offset.x, S.offset.z)
  22236. , D = Math.atan2(O.x, O.z)
  22237. , N = S.absoluteScale
  22238. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  22239. G.start(function(e, t) {
  22240. S.target.copy(R).multiplyScalar(e).add(M);
  22241. var i = L + (D - L) * e;
  22242. S.offset.x = P * Math.sin(i),
  22243. S.offset.z = P * Math.cos(i),
  22244. x.position.copy(S.target).add(S.offset),
  22245. S.absoluteScale = N + e * (F - N),
  22246. S.update(),
  22247. this.quaternion.copy(x.quaternion),
  22248. this.position.copy(x.position),
  22249. this.target.copy(S.target),
  22250. this.camera.projectionMatrix.copy(x.projectionMatrix)
  22251. }
  22252. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  22253. } else
  22254. Y.info("flyToSameMode() funny floorplan view? skipping");
  22255. return G.setTimeout(function(e) {
  22256. this.mode = e,
  22257. c(),
  22258. r.resolve(!0)
  22259. }
  22260. .bind(this, this.mode), u, q.FlyToSameMode),
  22261. this.mode = V.TRANSITIONING,
  22262. r.promise()
  22263. }
  22264. }
  22265. ,
  22266. t.prototype.flyToNewMode = function(e, t) {
  22267. var i = (e = e || {}).mode
  22268. , n = e.pano
  22269. , r = e.duration
  22270. , o = e.warpDest
  22271. , a = e.callback
  22272. , s = e.force
  22273. , l = e.quaternion;
  22274. if (t = t || $.Deferred(),
  22275. this.isWarping())
  22276. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  22277. a && a(!1),
  22278. t.reject("Cannot change mode during tour transition").promise();
  22279. if (this.mode === V.TRANSITIONING)
  22280. return a && a(!1),
  22281. t.reject("Cannot change mode during mode transition").promise();
  22282. if (i === this.mode)
  22283. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  22284. t.promise()) : (a && a(!1),
  22285. t.reject("Already in " + i + " mode").promise());
  22286. var c = o || !1;
  22287. Y.debug("Switching mode to " + i);
  22288. var h = function() {
  22289. j.delayOneFrame(function() {
  22290. this.flyToNewMode(e, t)
  22291. }
  22292. .bind(this))
  22293. }
  22294. .bind(this);
  22295. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  22296. return t.promise();
  22297. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  22298. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  22299. this.model.waitForLoad(this.model, function() {
  22300. return this.model.meshTexturesLoaded
  22301. }
  22302. .bind(this)),
  22303. this.model.loadMeshTextures().done(h),
  22304. t.promise();
  22305. this.history.invalidate(),
  22306. this.updateLastView();
  22307. var u = this.mode
  22308. , d = this.cameraControls.cameras[i];
  22309. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  22310. var p = void 0 !== r ? r : e.transitionTime;
  22311. this.emit(W.ModeChanging, u, i, n),
  22312. n && (this.currentPano = n),
  22313. this.switchCameraMode(i, l),
  22314. G.cancelById(q.LookTransition);
  22315. var f = (new B.Vector3).copy(this.position);
  22316. this.modeTran = this.mode + "-" + i;
  22317. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)){
  22318. VisiSet.finishSetPanoVisible()
  22319. VisiSet.finishSetTagVisible()
  22320. VisiSet.finishSetPanoLog()
  22321. }
  22322. if(editTool.atPanel == "screen"){
  22323. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  22324. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  22325. }
  22326. if(i == "panorama"){
  22327. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  22328. }else{
  22329. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  22330. }
  22331. if (i === V.PANORAMA)
  22332. this.emit(W.PanoChosen, n, n),
  22333. setTimeout(function() {
  22334. n.floor.enter(i)
  22335. }
  22336. .bind(this), p / 2),
  22337. this.path.fadeOutCpm(k.path.fadeOutTime);
  22338. else if (i === V.DOLLHOUSE) {
  22339. if (c && (this.model.stayPut = !0),
  22340. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  22341. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  22342. this.path.placeCpm(),
  22343. this.path.fadeInCpm(k.path.fadeInTime),
  22344. c) {
  22345. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  22346. f.set(15, 10, 15);
  22347. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  22348. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  22349. v.length ? (g.copy(v[0].point),
  22350. f.copy(o.position),
  22351. 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),
  22352. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  22353. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  22354. f.add(this.model.position),
  22355. d.position.copy(f),
  22356. this.cameraControls.controls[V.DOLLHOUSE].update()
  22357. }
  22358. } else if (this.path.placeCpm(),
  22359. this.path.fadeInCpm(k.path.fadeInTime),
  22360. o) {
  22361. this.model.warpDestFloors(o.floorVisibility);
  22362. var y = this.cameraControls.cameras[V.FLOORPLAN]
  22363. , A = this.cameraControls.controls[V.FLOORPLAN]
  22364. , C = y.position.clone().sub(A.target)
  22365. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  22366. , E = Math.atan2(I.x, I.z);
  22367. A.target.copy(o.position);
  22368. var _ = C.length();
  22369. A.offset.x = _ * Math.sin(E),
  22370. A.offset.y = 0,
  22371. A.offset.z = _ * Math.cos(E),
  22372. y.position.copy(A.target).add(A.offset),
  22373. A.target.clone().sub(d.position),
  22374. d.quaternion.copy(o.quaternion),
  22375. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  22376. A.absoluteScale = A.currentScale,
  22377. A.update()
  22378. } else
  22379. this.model.currentFloor.enter(i);
  22380. var b = this.currentPano
  22381. , w = this.position.clone();
  22382. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  22383. this.flying = !0,
  22384. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  22385. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22386. d.controls.update()),
  22387. e.blackoutStyle = P.FADEIN,
  22388. p = k.show360Views.transitionTime,
  22389. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  22390. this.mode = i,
  22391. this.path && this.path.popOutCpm(),
  22392. e.blackoutStyle = P.END,
  22393. p = k.show360Views.transitionTime,
  22394. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  22395. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  22396. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  22397. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  22398. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  22399. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  22400. G.setTimeout(function() {
  22401. this.flying = !1,
  22402. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  22403. this.currentPano.enter(),
  22404. this.path.placeCpm(),
  22405. this.path.fadeOutCpm(k.path.fadeOutTime),
  22406. this.spider.draw()),
  22407. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  22408. this.mode = i,
  22409. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  22410. if (this.afterCModeFuc) {
  22411. //手动加的函数
  22412. var cf = this.afterCModeFuc;
  22413. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22414. cf();
  22415. }
  22416. this.updateMarkerVisi();//add
  22417. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  22418. if(this.mode == "panorama" ){
  22419. //EditOverlay.updatePano()
  22420. editTool.hotpoint.updatePano()
  22421. }
  22422. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  22423. if(this.mode == V.PANORAMA){
  22424. Hot.updateVisibles([this.currentPano])
  22425. }else{
  22426. Hot.updateVisibles(true)
  22427. this.model.hotGroup.children.forEach(overlay=>{
  22428. if(overlay.animateInfo){
  22429. GifTexDeal.start(overlay.animation)
  22430. }
  22431. })
  22432. }
  22433. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  22434. t.resolve())
  22435. }
  22436. .bind(this), p, q.FlyToNewMode),
  22437. this.mode = V.TRANSITIONING,
  22438. //EditOverlay.updatePano(),//add
  22439. editTool.hotpoint.updatePano(),//add
  22440. //u == "panorama" && this.updateHotVisible(),
  22441. t.promise()
  22442. }
  22443. ,
  22444. t.prototype.fade360View = function(e, t, i) {
  22445. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22446. $(this.domElement).fadeOut(.5 * e, function() {
  22447. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22448. this.model.alpha = i.modelAlpha,
  22449. this.position.copy(t.position),
  22450. this.quaternion.copy(t.quaternion),
  22451. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22452. $(this.domElement).fadeIn(.5 * e)
  22453. }
  22454. .bind(this))
  22455. }
  22456. ,
  22457. t.prototype.findDefaultViews = function() {
  22458. this.findDefaultView(this.lastInsideView, !0),
  22459. this.findDefaultView(this.last360View, !1)
  22460. }
  22461. ,
  22462. t.prototype.findDefaultView = function(e, i) {
  22463. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22464. if (e.cameraMode !== V.PANORAMA)
  22465. return !1;
  22466. var t = r.get(e.panoId);
  22467. return t && t.isAligned() === i
  22468. });
  22469. 0 <= o ? (t = r.get(n[o].panoId),
  22470. e.update({
  22471. cameraMode: V.PANORAMA,
  22472. pano: t,
  22473. position: n[o].position,
  22474. quaternion: n[o].quaternion
  22475. })) : 0 <= (o = r.list.findIndex(function(e) {
  22476. return e.isAligned() === i
  22477. })) ? (t = r.list[o],
  22478. e.update({
  22479. cameraMode: V.PANORAMA,
  22480. pano: t,
  22481. position: t.position
  22482. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  22483. }
  22484. ,
  22485. t.prototype.updateLastView = function() {
  22486. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22487. pano: this.currentPano,
  22488. position: this.position,
  22489. quaternion: this.quaternion
  22490. })
  22491. }
  22492. ,
  22493. t.prototype.goToLastView = function(e, t) {
  22494. var i = $.Deferred()
  22495. , n = i.resolve.bind(i)
  22496. , r = i.reject.bind(i)
  22497. , o = e ? this.lastInsideView : this.last360View;
  22498. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22499. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22500. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22501. mode: o.cameraMode,
  22502. pano: o.pano,
  22503. quaternion: o.quaternion,
  22504. callback: t
  22505. }).done(n).fail(r),
  22506. i.promise()
  22507. }
  22508. ,
  22509. t.prototype.fadeToView = function(e, t, i, n) {
  22510. var r = $.Deferred()
  22511. , o = r.resolve.bind(r)
  22512. , a = r.reject.bind(r);
  22513. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22514. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22515. a("Cannot go to illegal view"),
  22516. r.promise();
  22517. var s = (k[t.cameraMode],
  22518. function() {
  22519. $(this.domElement).fadeIn(.5 * i),
  22520. n && n(),
  22521. o()
  22522. }
  22523. .bind(this))
  22524. , l = e ? P.FADEIN : P.END;
  22525. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22526. $(this.domElement).fadeOut(.5 * i, function() {
  22527. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22528. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22529. pano: t.pano,
  22530. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22531. duration: 0
  22532. }, s) : this.flyToNewMode({
  22533. mode: t.cameraMode,
  22534. quaternion: t.quaternion,
  22535. duration: 0,
  22536. callback: s
  22537. })
  22538. }
  22539. .bind(this)),
  22540. r.promise()
  22541. }
  22542. ,
  22543. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22544. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22545. this.flying)
  22546. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22547. o && o(),
  22548. !1;
  22549. null != e || (e = M.Show),
  22550. this.history.invalidate(),
  22551. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22552. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22553. return this.emit(W.WarpStarted, a, i, n, r),
  22554. n = n || P.MIDDLE,
  22555. this.path.warpToPano(i, n, r, function() {
  22556. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22557. this.emit(W.WarpEnded, i),
  22558. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22559. o && o()
  22560. }
  22561. .bind(this)),
  22562. e === M.Hide && this.path.discardPathObject(),
  22563. !0
  22564. }
  22565. ,
  22566. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22567. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22568. s && s(),
  22569. !1)
  22570. }
  22571. ,
  22572. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22573. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22574. a && a(),
  22575. !1)
  22576. }
  22577. ,
  22578. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22579. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22580. }
  22581. ,
  22582. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22583. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22584. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22585. t && t(),
  22586. !1)
  22587. }
  22588. ,
  22589. t.prototype.aimTourCamera = function(e, t, i, n) {
  22590. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22591. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22592. }
  22593. ,
  22594. t.prototype.showPathToHeroLocation = function(e) {
  22595. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22596. }
  22597. ,
  22598. t.prototype.tourInterlude = function(e, t) {
  22599. this.history.invalidate(),
  22600. this.path.discardSlow();
  22601. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  22602. var rotTime
  22603. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  22604. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  22605. var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22606. rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
  22607. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22608. var timeEachItem = 2000;//假设每个item飞的时间
  22609. var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  22610. }
  22611. rotTime = Math.max(0, rotTime)
  22612. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  22613. }else{
  22614. rotTime = currentLocation.rotTime * 1000
  22615. console.log("rotTime "+rotTime +" at item "+this.director.currentItem)
  22616. }
  22617. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22618. t && t()
  22619. }
  22620. .bind(this), rotTime)
  22621. }
  22622. ,
  22623. t.prototype.stopInterlude = function() {
  22624. this.interruptAndFastForward(null, 0)
  22625. }
  22626. ,
  22627. t.prototype.interruptAndFastForward = function(e, t) {
  22628. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22629. this.flying && this.emit(W.FlyingInterrupted),
  22630. this.path.interruptAndFastForward(e, t)
  22631. }
  22632. ,
  22633. t.prototype.setSize = function(e, t) {
  22634. var i = e / t;
  22635. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22636. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22637. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22638. this.cameraControls.cameras) {
  22639. var o = this.cameraControls.cameras[r];
  22640. o.fov = this.baseFov * (1 / this.zoomLevel),
  22641. o.updateAspect(i)
  22642. }
  22643. }
  22644. ,
  22645. t.prototype.toJSON = function() {
  22646. var e = {};
  22647. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22648. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22649. return e.hidden ? 0 : 1
  22650. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22651. e
  22652. }
  22653. ,
  22654. t.prototype.getCurrentNodePanos = function(e) {
  22655. if (this.model.panos.map,
  22656. e.length = 0,
  22657. this.path.nodes)
  22658. for (var t = 0; t < this.path.nodes.length; t++) {
  22659. var i = this.path.nodes[t];
  22660. e.push(this.model.panos.get(i))
  22661. }
  22662. }
  22663. ,
  22664. t.prototype.zoomIncrementally = function(e) {
  22665. var t = this.zoomLevel;
  22666. this.zoomTo(this.zoomLevel + e),
  22667. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22668. }
  22669. ,
  22670. t.prototype.zoomInIncrementally = function(e) {
  22671. e = e || this.defaultZoomIncrement,
  22672. this.zoomIncrementally(e)
  22673. }
  22674. ,
  22675. t.prototype.zoomOutIncrementally = function(e) {
  22676. e = e || -this.defaultZoomIncrement,
  22677. this.zoomIncrementally(e)
  22678. }
  22679. ,
  22680. t.prototype.zoomBy = function(e) {
  22681. this.zoomTo(this.zoomLevel * e)
  22682. }
  22683. ,
  22684. t.prototype.zoomIn = function() {
  22685. this.zoomBy(1 + this.zoomSpeed)
  22686. }
  22687. ,
  22688. t.prototype.zoomOut = function() {
  22689. this.zoomBy(1 - this.zoomSpeed)
  22690. }
  22691. ,
  22692. t.prototype.zoomTo = function(e, t) {
  22693. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22694. e > k.zoom.max && (e = k.zoom.max),
  22695. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22696. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22697. e === k.zoom.min && this.emit(m.ZoomMin)),
  22698. this.cameraControls.activeControl)) {
  22699. var i = this.cameraControls.activeControl.camera;
  22700. this.zoomLevel = e,
  22701. i.fov = this.baseFov * (1 / this.zoomLevel),
  22702. i.updateProjectionMatrix(),
  22703. this.zoomFov = i.fov
  22704. }
  22705. }
  22706. ,
  22707. t.prototype.increaseZoomSpeed = function() {
  22708. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22709. }
  22710. ,
  22711. t.prototype.decreaseZoomSpeed = function() {
  22712. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22713. }
  22714. ,
  22715. t.prototype.clampZoomSpeed = function(e) {
  22716. return e < 0 ? 0 : e
  22717. }
  22718. ,
  22719. t.prototype.activatePersistentZooming = function(e) {
  22720. this.zooming = e ? 1 : -1
  22721. }
  22722. ,
  22723. t.prototype.deactivatePersistentZooming = function() {
  22724. this.zooming = 0
  22725. }
  22726. ,
  22727. t.prototype.zoomDefault = function() {
  22728. this.zoomTo(1, !0)
  22729. }
  22730. window.fovTranId = 333;//add
  22731. t.prototype.smoothZoomToDefault = function(e, t) {
  22732. G.cancelById(window.fovTranId)
  22733. var i, n = this.zoomLevel, r = function(e) {
  22734. 1 < e && (e = 1),
  22735. i = n * (1 - e) + e,
  22736. this.zoomTo(i, !0)
  22737. }
  22738. .bind(this), o = function() {
  22739. this.zoomDefault(),
  22740. t && window.setTimeout(t, 50)
  22741. }
  22742. .bind(this);
  22743. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22744. }
  22745. ,
  22746. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22747. G.cancelById(window.fovTranId)
  22748. var i,
  22749. n = this.zoomLevel,
  22750. aimLevel = zoomLevel || this.baseFov / fov
  22751. if (n == aimLevel) return
  22752. var fun = function (e) {
  22753. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22754. }.bind(this)
  22755. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22756. }
  22757. ,
  22758. t.prototype.updateZoomPano = function() {
  22759. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22760. var e = this.currentPano;
  22761. if (e) {
  22762. var t = this.zoomLevel > k.zoom.activationThreshold
  22763. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22764. t);
  22765. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22766. this.panoRenderer.setZoomingActive(i, e, !0);
  22767. var n = function(e, t) {
  22768. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22769. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22770. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22771. e.setZoomed(t)
  22772. }
  22773. .bind(this);
  22774. i && !e.zoomed ? (n(e, !0),
  22775. this.panoRenderer.enableUltraHighQualityMode(function() {
  22776. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22777. i && n(e, !0)
  22778. }
  22779. .bind(this))) : !t && e.zoomed && n(e, !1)
  22780. }
  22781. }
  22782. },
  22783. //--------
  22784. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22785. var f2;
  22786. if (this.mode == mode) {
  22787. f1 && f1()
  22788. } else {
  22789. f2 = f1;
  22790. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22791. this.afterCModeFuc = function() {
  22792. this.afterCModeFuc = f2
  22793. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22794. }.bind(this)
  22795. } else {
  22796. this.afterCModeFuc = f2;//飞入后执行
  22797. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22798. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22799. }catch(e){}
  22800. }
  22801. }
  22802. }
  22803. ,
  22804. t.prototype.checkHasNeighbor = function(pano){//add
  22805. for(var i in pano.neighbourPanos ){
  22806. if(i == pano.id)continue;
  22807. if(pano.neighbourPanos[i]){
  22808. return true;
  22809. }
  22810. }
  22811. }
  22812. ,
  22813. ee.exports = t
  22814. }
  22815. ).call(this, "/js/player.js")
  22816. }
  22817. , {
  22818. "./constants": 8,
  22819. "./enum/AlignmentType": 17,
  22820. "./enum/BlackoutStyle": 18,
  22821. "./enum/ControlEvents": 21,
  22822. "./enum/Keys": 30,
  22823. "./enum/ModelManagerEvents": 33,
  22824. "./enum/PanoSizeClass": 36,
  22825. "./enum/PanoramaEvents": 37,
  22826. "./enum/PathDiscardMode": 38,
  22827. "./enum/PathDisplayMode": 39,
  22828. "./enum/PlayerEvents": 40,
  22829. "./enum/TagStates": 44,
  22830. "./enum/Vectors": 50,
  22831. "./enum/Viewmode": 51,
  22832. "./enum/WarpStyle": 52,
  22833. "./enum/ZoomEvents": 53,
  22834. "./exception/BasicException": 55,
  22835. "./model/ModelManager": 140,
  22836. "./objects/NSpider": 147,
  22837. "./objects/Panorama": 148,
  22838. "./objects/Reticule": 149,
  22839. "./objects/ShowPath": 151,
  22840. "./objects/Snapshot": 153,
  22841. "./objects/View": 154,
  22842. "./settings": 166,
  22843. "./shaders": 167,
  22844. "./tile/TileDownloader": 171,
  22845. "./tile/TilePrioritizer": 172,
  22846. "./util/ZoomStats": 179,
  22847. "./util/browser": 182,
  22848. "./util/camera": 183,
  22849. "./util/cameraLight": 184,
  22850. "./util/common": 185,
  22851. "./util/easing": 186,
  22852. "./util/history": 187,
  22853. "./util/lerp": 188,
  22854. "./util/logger": 189,
  22855. "./util/math": 190,
  22856. "./util/transitions": 195,
  22857. hot: "hot",
  22858. scaleImg: "scaleImg",
  22859. events: 202,
  22860. three: 217
  22861. }],
  22862. scaleImg: [function(e, t) {
  22863. var i = t;
  22864. (function() {
  22865. function e(e, t, i, n) {
  22866. function r() {
  22867. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22868. U.height = p,
  22869. H = U.getContext("2d")
  22870. }
  22871. function o(e) {
  22872. if (e) {
  22873. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22874. for (t = 0; t < ie; t += 4)
  22875. n[t] = e[t] * ne | 0,
  22876. n[t + 1] = e[t + 1] * ne | 0,
  22877. n[t + 2] = e[t + 2] * ne | 0,
  22878. n[t + 3] = e[t + 3] * ne | 0;
  22879. return delete e,
  22880. i
  22881. }
  22882. return H.getImageData(0, 0, d, p)
  22883. }
  22884. function a(e, t, i, n, r) {
  22885. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22886. }
  22887. var s, l;
  22888. if (t || (t = e.input,
  22889. i = e.output,
  22890. n = e.inputRemovable,
  22891. e.scale && (e = e.scale)),
  22892. t.src)
  22893. if (s = document.createElement("canvas"),
  22894. null != t.naturalWidth)
  22895. s.width = t.naturalWidth,
  22896. s.height = t.naturalHeight;
  22897. else if (null != t.runtimeStyle) {
  22898. var c = t.runtimeStyle
  22899. , h = c.width
  22900. , u = c.height;
  22901. c.width = "auto",
  22902. c.height = "auto",
  22903. s.width = t.width,
  22904. s.height = t.height,
  22905. c.width = h,
  22906. c.height = u
  22907. } else {
  22908. h = t.width,
  22909. u = t.height;
  22910. t.removeAttribute && (t.removeAttribute("width"),
  22911. t.removeAttribute("height")),
  22912. s.width = t.width,
  22913. s.height = t.height,
  22914. t.width = h,
  22915. t.height = u
  22916. }
  22917. else
  22918. s = t;
  22919. l = s.getContext("2d"),
  22920. t.src && l.drawImage(t, 0, 0);
  22921. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22922. if (!f || !g)
  22923. return !1;
  22924. (t.src || n) && s.clearRect(0, 0, f, g),
  22925. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22926. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22927. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22928. e * g + .5 | 0);
  22929. 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;
  22930. if (1 < re || 1 < oe)
  22931. for (r(),
  22932. G = (z = o()).data,
  22933. C = 0; C < p; C++)
  22934. for (V = (y = C / oe) - (w = 0 | y),
  22935. j = w * $,
  22936. W = w < 1 ? j : j - $,
  22937. w < g - 2 ? (Y = j + $,
  22938. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22939. A = 0; A < d; A++,
  22940. te += 4)
  22941. Z = (b = 0 | (v = A / re)) << 2,
  22942. b < f - 2 ? (K = Z + 4,
  22943. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22944. 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,
  22945. ++Z,
  22946. ++K,
  22947. ++Q,
  22948. 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,
  22949. ++Z,
  22950. ++K,
  22951. ++Q,
  22952. 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,
  22953. ++Z,
  22954. ++K,
  22955. ++Q,
  22956. 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,
  22957. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22958. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22959. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22960. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22961. else {
  22962. if (le.Float32Array)
  22963. L = new Float32Array(ie);
  22964. else
  22965. for (L = [],
  22966. te = 0; te < ie; ++te)
  22967. L[te] = 0;
  22968. for (y = 0; y < g; y++)
  22969. for (I = (_ = 0 | (C = y * oe)) * J,
  22970. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22971. R = C + oe - _ - 1),
  22972. v = 0; v < f; v++,
  22973. ee += 4)
  22974. switch (A = v * re,
  22975. E = 0 | A,
  22976. te = I + (E << 2),
  22977. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22978. P && (x = 1 + E - A,
  22979. S = A + re - E - 1),
  22980. D = m[ee],
  22981. F = m[ee + 1],
  22982. B = m[ee + 2],
  22983. N = m[ee + 3],
  22984. P + O) {
  22985. case 0:
  22986. L[te] += D * ae,
  22987. L[te + 1] += F * ae,
  22988. L[te + 2] += B * ae,
  22989. L[te + 3] += N * ae;
  22990. break;
  22991. case 1:
  22992. T = x * oe,
  22993. L[te] += D * T,
  22994. L[te + 1] += F * T,
  22995. L[te + 2] += B * T,
  22996. L[te + 3] += N * T,
  22997. T = S * oe,
  22998. L[te + 4] += D * T,
  22999. L[te + 5] += F * T,
  23000. L[te + 6] += B * T,
  23001. L[te + 7] += N * T;
  23002. break;
  23003. case 2:
  23004. T = re * M,
  23005. L[te] += D * T,
  23006. L[te + 1] += F * T,
  23007. L[te + 2] += B * T,
  23008. L[te + 3] += N * T,
  23009. T = re * R,
  23010. L[te += J] += D * T,
  23011. L[te + 1] += F * T,
  23012. L[te + 2] += B * T,
  23013. L[te + 3] += N * T;
  23014. break;
  23015. default:
  23016. T = x * M,
  23017. L[te] += D * T,
  23018. L[te + 1] += F * T,
  23019. L[te + 2] += B * T,
  23020. L[te + 3] += N * T,
  23021. T = S * M,
  23022. L[te + 4] += D * T,
  23023. L[te + 5] += F * T,
  23024. L[te + 6] += B * T,
  23025. L[te + 7] += N * T,
  23026. T = x * R,
  23027. L[te += J] += D * T,
  23028. L[te + 1] += F * T,
  23029. L[te + 2] += B * T,
  23030. L[te + 3] += N * T,
  23031. T = S * R,
  23032. L[te + 4] += D * T,
  23033. L[te + 5] += F * T,
  23034. L[te + 6] += B * T,
  23035. L[te + 7] += N * T
  23036. }
  23037. delete m,
  23038. r(),
  23039. z = o(L)
  23040. }
  23041. if (H.putImageData(z, 0, 0),
  23042. "string" == typeof i) {
  23043. var se;
  23044. if ("png" === i || "jpeg" === i)
  23045. return (se = n && t.src ? t : new Image).width = d,
  23046. se.height = p,
  23047. se.src = U.toDataURL("image/" + i, .85),
  23048. se;
  23049. if ("png-src" === i || "jpeg-src" === i)
  23050. return U.toDataURL("image/" + i.split("-")[0], .85)
  23051. }
  23052. return U
  23053. }
  23054. var le = this;
  23055. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  23056. exports.scale = e) : c = e
  23057. }
  23058. ).call(this),
  23059. i.exports = c
  23060. }
  23061. , {}],
  23062. 156: [function(i, n, e) {
  23063. (function(e) {
  23064. "use strict";
  23065. function t(e, t) {
  23066. this.model = e,
  23067. this.panos = e.panos,
  23068. this.player = t,
  23069. this.imagePanos = this.listImagePanos(),
  23070. this.retryMinimumTime = 1e4
  23071. }
  23072. var r = (i("three"),
  23073. i("./enum/Viewmode"))
  23074. , o = (i("./settings"),
  23075. i("./objects/Panorama"))
  23076. , a = new (i("./util/logger"))(e);
  23077. t.prototype.start = function() {
  23078. this.loadNextPano(function(e) {
  23079. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  23080. setTimeout(function() {
  23081. this.start()
  23082. }
  23083. .bind(this), 1e3))
  23084. }
  23085. .bind(this))
  23086. }
  23087. ,
  23088. t.prototype.validLoadTarget = function(e) {
  23089. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  23090. }
  23091. ,
  23092. t.prototype.listImagePanos = function() {
  23093. var i = []
  23094. , n = this;
  23095. return this.model.images.forEach(function(e) {
  23096. if (e.metadata && e.metadata.scan_id) {
  23097. var t = n.model.panos.get(e.metadata.scan_id);
  23098. t && !t.isLoaded("high") && i.push(t)
  23099. }
  23100. }),
  23101. i
  23102. }
  23103. ,
  23104. t.prototype.nextNotLoadedImage = function() {
  23105. for (; 0 < this.imagePanos.length; ) {
  23106. var e = this.imagePanos[0];
  23107. if (!e.isLoaded("high"))
  23108. return e;
  23109. this.imagePanos.shift()
  23110. }
  23111. return null
  23112. }
  23113. ,
  23114. t.prototype.loadNextPano = function(e) {
  23115. var t, i, n = this.model.waitQueue.filter(function(e) {
  23116. return e.object instanceof o
  23117. });
  23118. 0 < n.length ? (t = n[0].object,
  23119. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  23120. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  23121. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  23122. t = this.imagePanos[0],
  23123. 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),
  23124. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  23125. a.debug("Preloading " + i + "-res pano " + t.id),
  23126. t.loadCube(i).done(e).fail(function() {
  23127. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  23128. e()
  23129. })) : e && e(null)
  23130. }
  23131. ,
  23132. n.exports = t
  23133. }
  23134. ).call(this, "/js/preloaders.js")
  23135. }
  23136. , {
  23137. "./enum/Viewmode": 51,
  23138. "./objects/Panorama": 148,
  23139. "./settings": 166,
  23140. "./util/logger": 189,
  23141. three: 217
  23142. }],
  23143. 157: [function(a, s, e) {
  23144. (function(e) {
  23145. "use strict";
  23146. function t(e, t, i, n, r) {
  23147. this.qualityManager = e,
  23148. this.scene = t,
  23149. this.camera = i,
  23150. this.container = r,
  23151. this.controls = n,
  23152. this.controls.enabled = !0,
  23153. this.controls.locked = !0,
  23154. this.quickstartCamera = n.camera,
  23155. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  23156. this.skybox = null
  23157. }
  23158. var i = a("three")
  23159. , n = a("../util/logger")
  23160. , o = a("../constants")
  23161. , h = (a("../util/transitions"),
  23162. a("../util/lerp"),
  23163. a("../util/easing"),
  23164. a("../enum/Vectors"))
  23165. , u = a("../enum/PanoSizeClass")
  23166. , r = (a("../materials/ModelTextureMaterial"),
  23167. a("../materials/CubemapMaterial"))
  23168. , d = (a("../cameras/PanoramaCamera"),
  23169. a("../controls/PanoramaControls"),
  23170. a("../tile/TileUtils"),
  23171. a("../util/camera"),
  23172. a("../util/cameraLight"))
  23173. , p = (a("../util/browser"),
  23174. a("../settings"),
  23175. a("../gui/helpManager"),
  23176. new n(e));
  23177. t.prototype.load = function(e) {
  23178. e.pano.shouldRedrawOnBaseLoaded = !0;
  23179. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  23180. this.controls.lookAt(r.add(this.quickstartCamera.position));
  23181. var a = this.qualityManager.getPanoSize(u.BASE)
  23182. , s = this.qualityManager.getPanoSize(u.STANDARD);
  23183. if (e.pano.tiled) {
  23184. p.warn("Loading startPano, TILED", e.pano.id);
  23185. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  23186. , c = this.quickstartCamera.fov;
  23187. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  23188. t = e.pano.loadTiledPano(s, r, {
  23189. hFov: l,
  23190. vFov: c
  23191. }, !1, !1, !0),
  23192. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  23193. } else
  23194. p.warn("Loading startPano", e.pano.id),
  23195. t = e.pano.loadCube("high");
  23196. return $.when(t).then(function() {
  23197. n.init(e.pano, e.quaternion),
  23198. e.pano.tiled ? i.done(function() {
  23199. e.pano.lockUntilRenderingComplete = !1,
  23200. this.controls.locked = !1
  23201. }
  23202. .bind(this)) : this.controls.locked = !1
  23203. }
  23204. .bind(this))
  23205. }
  23206. ,
  23207. t.prototype.init = function(e, t) {
  23208. p.info("Quickstart done loading, adding scene objects"),
  23209. e.lockUntilRenderingComplete = !0,
  23210. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  23211. side: i.BackSide
  23212. })),
  23213. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  23214. this.skybox.quaternion.copy(e.quaternion),
  23215. this.scene.add(this.skybox),
  23216. $(this.container).show()
  23217. }
  23218. ,
  23219. t.prototype.update = function(e) {
  23220. this.controls.update(e),
  23221. this.camera.copy(this.quickstartCamera)
  23222. }
  23223. ,
  23224. t.prototype.setSize = function(e, t) {
  23225. this.quickstartCamera.updateAspect(e / t)
  23226. }
  23227. ,
  23228. t.prototype.destroy = function() {
  23229. this.scene.remove(this.skybox)
  23230. }
  23231. ,
  23232. s.exports = t
  23233. }
  23234. ).call(this, "/js/scene/QuickstartManager.js")
  23235. }
  23236. , {
  23237. "../cameras/PanoramaCamera": 7,
  23238. "../constants": 8,
  23239. "../controls/PanoramaControls": 13,
  23240. "../enum/PanoSizeClass": 36,
  23241. "../enum/Vectors": 50,
  23242. "../gui/helpManager": 68,
  23243. "../materials/CubemapMaterial": 117,
  23244. "../materials/ModelTextureMaterial": 118,
  23245. "../settings": 166,
  23246. "../tile/TileUtils": 174,
  23247. "../util/browser": 182,
  23248. "../util/camera": 183,
  23249. "../util/cameraLight": 184,
  23250. "../util/easing": 186,
  23251. "../util/lerp": 188,
  23252. "../util/logger": 189,
  23253. "../util/transitions": 195,
  23254. three: 217
  23255. }],
  23256. 158: [function(e, t, i) {
  23257. "use strict";
  23258. function h(e, t, i) {
  23259. this.scene = e,
  23260. this.camera = t,
  23261. this.renderer = null,
  23262. this.effects = i,
  23263. this.animateCallback = null,
  23264. this.composer = null,
  23265. this.qualityManager = null,
  23266. e.renderWidth = 0,
  23267. e.renderHeight = 0,
  23268. this.updateClock = new M.Clock,
  23269. this.components = [],
  23270. this.updateListeners = [],
  23271. this.resizeListeners = [],
  23272. this.forceUpdateSize = !1,
  23273. this.started = !1,
  23274. this.textures = {},
  23275. this.suspendedObjects = []
  23276. }
  23277. 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;
  23278. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  23279. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  23280. this.components.push(e),
  23281. e.update && this.updateListeners.push(e),
  23282. e.setSize && (this.resizeListeners.push(e),
  23283. this.forceUpdateSize = !0)
  23284. }
  23285. ,
  23286. h.prototype.removeComponent = function(t) {
  23287. function e(e) {
  23288. return e !== t
  23289. }
  23290. this.components = this.components.filter(e),
  23291. this.updateListeners = this.updateListeners.filter(e),
  23292. this.resizeListeners = this.resizeListeners.filter(e)
  23293. }
  23294. ,
  23295. h.prototype.start = function(e) {
  23296. if (this.started)
  23297. throw new l("Can't start SceneRenderer, already started");
  23298. this.createContext(e),
  23299. //u.isMobile() && this.boluoVrInit(),
  23300. this.initComposer(),
  23301. this.started = !0,
  23302. (b = b.bind(this))()
  23303. }
  23304. ,
  23305. h.prototype.createContext = function(e) {
  23306. try {
  23307. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  23308. this.renderer.autoClear = !0,
  23309. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23310. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  23311. this.emit(r.ContextCreated)
  23312. } catch (e) {
  23313. throw new c("Unable to create a WebGL rendering context")
  23314. }
  23315. d.profiling.enabled && this.overrideTextures(),
  23316. e.appendChild(this.renderer.domElement)
  23317. }
  23318. ,
  23319. h.prototype.overrideTextures = function() {
  23320. var d = this.renderer.context
  23321. , t = 0
  23322. , i = d.createTexture;
  23323. d.createTexture = function() {
  23324. var e = i.call(d);
  23325. return e.id = t++,
  23326. this.textures[e.id] = e
  23327. }
  23328. .bind(this);
  23329. var p = d.texImage2D;
  23330. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  23331. var c, h = this.getTextureTypeFromTarget(d, e);
  23332. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  23333. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  23334. s = r,
  23335. n = (l = o).naturalWidth,
  23336. r = l.naturalHeight,
  23337. p.call(d, e, t, i, a, s, l));
  23338. var u = this.textures[c.id];
  23339. u.width = h === f.TextureCube ? 6 * n : n,
  23340. u.height = r
  23341. }
  23342. .bind(this);
  23343. var n = d.deleteTexture;
  23344. d.deleteTexture = function(e) {
  23345. delete this.textures[e.id],
  23346. n.call(d, e)
  23347. }
  23348. .bind(this)
  23349. }
  23350. ,
  23351. h.prototype.updateTextureMemory = (n = null,
  23352. function() {
  23353. var e = 0;
  23354. for (var t in this.textures) {
  23355. var i = this.textures[t];
  23356. i.width && i.height && (e += i.width * i.height * 4)
  23357. }
  23358. e !== n && this.emit(r.MemoryUsageUpdated, e),
  23359. n = e
  23360. }
  23361. ),
  23362. h.prototype.getTextureTypeFromTarget = function(e, t) {
  23363. switch (t) {
  23364. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23365. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23366. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23367. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23368. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23369. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23370. return f.TextureCube;
  23371. case e.TEXTURE_2D:
  23372. return f.Texture2D;
  23373. default:
  23374. return null
  23375. }
  23376. }
  23377. ,
  23378. h.prototype.initComposer = function() {
  23379. this.composer = new M.EffectComposer(this.renderer),
  23380. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  23381. this.composer.addPass(this.effects.hblurPass),
  23382. this.composer.addPass(this.effects.vblurPass)
  23383. }
  23384. ,
  23385. h.prototype.setSize = function(e, t, i) {
  23386. this.renderWidth = e,
  23387. this.renderHeight = t,
  23388. this.effects.aspect = e / t,
  23389. this.renderer.setSize(e, t, !1, i),
  23390. this.composer.setSize(e, t);
  23391. for (var n = 0; n < this.resizeListeners.length; n++)
  23392. this.resizeListeners[n].setSize(e, t)
  23393. }
  23394. ,
  23395. h.prototype.render = function() {
  23396. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23397. }
  23398. ,
  23399. h.prototype.boluoVrInit = function() {
  23400. console.log("boluoVrInit"),
  23401. this.isHuawei5X = u.detectHUAWEI5X(),
  23402. this.oldRenderer = this.renderer,
  23403. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  23404. window.panoCamera = this.camera;
  23405. var i = this;
  23406. window._vrEnabled = !1,
  23407. Object.defineProperty(window, "vrEnabled", {
  23408. get: function() {
  23409. return window._vrEnabled
  23410. },
  23411. set: function(e) {
  23412. (e = !!e) ? (i.renderer = i.newRenderer,
  23413. window.vrMarkers.forEach(function(e) {
  23414. e.visible = !0
  23415. })) : (i.renderer = i.oldRenderer,
  23416. window.vrMarkers.forEach(function(e) {
  23417. e.visible = !1
  23418. })),
  23419. i.cursor.visible = e,
  23420. i.setSize($("#player").width(), $("#player").height()),
  23421. window._vrEnabled = e,
  23422. setTimeout(function() {
  23423. console.log(player.cameraControls.activeControl.camera.fov)
  23424. }, 500)
  23425. }
  23426. }),
  23427. this.createCursor(.5, !1, 1, 16777215, 0);
  23428. var e = {
  23429. setSize: function(e, t) {
  23430. i.camera.aspect = e / t
  23431. }
  23432. };
  23433. this.resizeListeners.push(e),
  23434. this.vrLoadingInit()
  23435. }
  23436. ,
  23437. h.prototype.vrLoadingInit = function() {
  23438. var e = new (e = function(camera) {
  23439. var t = this
  23440. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23441. , i = new M.MeshBasicMaterial({
  23442. color: 4967932,
  23443. side: M.DoubleSide
  23444. })
  23445. , n = new M.Mesh(e,i);
  23446. (this.mesh = n).position.z = -2,
  23447. n.scale.set(.08, .08, .08),
  23448. n.visible = !1,
  23449. //window.player.camera.add(n),
  23450. camera.add(n),
  23451. t.enabled = !1,
  23452. this.update = function(e) {
  23453. 1 == t.enabled && (n.rotation.z += 15 * e)
  23454. }
  23455. }
  23456. )(this.camera);
  23457. window.Loading = e,
  23458. this.updateListeners.push(e)
  23459. }
  23460. ,
  23461. h.prototype.createCursor = function(e, t, i, n, r) {
  23462. var o, a = new M.SpriteMaterial({
  23463. opacity: i,
  23464. color: n,
  23465. transparent: t,
  23466. map: this.boluoGetTexture("images/cursor.png"),
  23467. needsUpdate: !0,
  23468. side: M.DoubleSide
  23469. });
  23470. a.map.offset = new M.Vector2(1 / 17 * r,0),
  23471. a.map.repeat = new M.Vector2(1 / 17,1),
  23472. a.depthTest = !1,
  23473. a.blending = M.AdditiveBlending,
  23474. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  23475. o.position.z = -2,
  23476. o.visible = !1,
  23477. o.name = "cursor",
  23478. this.camera.add(o),
  23479. this.scene.add(this.camera),
  23480. this.cursor = o;
  23481. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23482. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23483. this.updateListeners.push(s)
  23484. }
  23485. ,
  23486. h.prototype.CursorAnimation = function(e, t, o) {
  23487. this.cursor = t,
  23488. this.raycaster = new M.Raycaster,
  23489. this.targetEventObj = {},
  23490. this.type = 1,
  23491. this.tweenFlag = !0;
  23492. var s = this;
  23493. this.target = o,
  23494. console.log(o.uuid),
  23495. this.euler = new M.Euler,
  23496. this.q0 = new M.Quaternion,
  23497. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23498. this.zee = new M.Vector3(0,0,1),
  23499. this.alpha = -1e3,
  23500. this.beta = -1e3,
  23501. this.gamma = -1e3,
  23502. this.orient = M.Math.degToRad(window.orientation || 0),
  23503. window.addEventListener("orientationchange", function() {
  23504. s.orient = M.Math.degToRad(window.orientation || 0)
  23505. }),
  23506. window.addEventListener("deviceorientation", function(e) {
  23507. var t = M.Math.degToRad(e.alpha)
  23508. , i = M.Math.degToRad(e.beta)
  23509. , n = M.Math.degToRad(e.gamma);
  23510. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23511. -1e3 === s.beta && (s.beta = i),
  23512. -1e3 === s.gamma && (s.gamma = n),
  23513. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23514. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23515. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23516. s.beta = i,
  23517. s.gamma = n),
  23518. h.vrDebug) {
  23519. $("#info-device-orientation").css("display", "block");
  23520. var r = "";
  23521. r += "alpha=(" + s.alpha + ")<BR/>",
  23522. r += "beta=(" + s.beta + ")<BR/>",
  23523. r += "gamma=" + s.gamma + "<BR/>",
  23524. document.getElementById("info-device-orientation").innerHTML = r
  23525. }
  23526. }),
  23527. this.setObjectQuaternion = function(e, t, i, n, r) {
  23528. s.euler.set(i, t, -n, "YXZ"),
  23529. e.setFromEuler(s.euler),
  23530. e.multiply(s.q1),
  23531. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23532. o.updateMatrixWorld()
  23533. }
  23534. ,
  23535. parent !== window && window.addEventListener("message", function(e) {
  23536. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23537. o && o.alpha && o.beta && o.gamma && (t = a,
  23538. i = M.Math.degToRad(o.alpha),
  23539. n = M.Math.degToRad(o.beta),
  23540. r = M.Math.degToRad(o.gamma),
  23541. t ? (-1e3 === s.alpha && (s.alpha = i),
  23542. -1e3 === s.beta && (s.beta = n),
  23543. -1e3 === s.gamma && (s.gamma = r),
  23544. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23545. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23546. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23547. s.beta = n,
  23548. s.gamma = r))
  23549. }),
  23550. this.update = function(e) {
  23551. TWEEN.update(),
  23552. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23553. this.triggerTargetEvent())
  23554. }
  23555. ,
  23556. this.triggerTargetEvent = function() {
  23557. var e = this.choseObj()
  23558. , t = e ? e.object : void 0;
  23559. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23560. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23561. t && t.enabled && this.startAnimate(function() {
  23562. this.clickCallback(t)
  23563. }
  23564. .bind(this))) : this.type,
  23565. this.targetEventObj.lastObj = t)
  23566. }
  23567. ,
  23568. this.choseObj = function() {
  23569. this.raycaster.setFromCamera({
  23570. x: 0,
  23571. y: 0
  23572. }, o);
  23573. var e = (this.raycaster.ray,
  23574. window.vrMarkers)
  23575. , t = this.raycaster.intersectObjects(e);
  23576. if (0 < t.length)
  23577. return t[0]
  23578. }
  23579. ,
  23580. this.clickCallback = function(e) {
  23581. this.runTHREEAction(e, "onclick")
  23582. }
  23583. ,
  23584. this.runTHREEAction = function(e, t) {
  23585. switch (t) {
  23586. case "onclick":
  23587. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23588. e()
  23589. });
  23590. break;
  23591. case "onhover":
  23592. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23593. e()
  23594. });
  23595. break;
  23596. case "onout":
  23597. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23598. e()
  23599. })
  23600. }
  23601. }
  23602. ,
  23603. this.startAnimate = function(e) {
  23604. this.tweenFlag && this.initAnimation(e)
  23605. }
  23606. ,
  23607. this.initAnimation = function(e) {
  23608. var t = this
  23609. , i = this.cursor.material.map.offset;
  23610. t.tweenFlag = !1,
  23611. this.cursorAnimate = new TWEEN.Tween(i).to({
  23612. x: 1
  23613. }, 1e3).onStart(function() {
  23614. t.tweenFlag = !1
  23615. }).onStop(function() {
  23616. t.tweenFlag = !0,
  23617. this.x = 0,
  23618. i.x = 0
  23619. }).onUpdate(function() {}).onComplete(function() {
  23620. e(),
  23621. i.x = 0,
  23622. setTimeout(function() {
  23623. t.tweenFlag = !0
  23624. }, 1500)
  23625. }),
  23626. this.cursorAnimate.easing(function(e) {
  23627. return Math.floor(17 * e) / 17
  23628. }),
  23629. this.cursorAnimate.start()
  23630. }
  23631. ,
  23632. this.autoCursorPosition = function(e) {
  23633. this.cursor.scale.set(.3, .3, .3)
  23634. }
  23635. }
  23636. ,
  23637. h.prototype.vrRenderer = function(a, i, e) {
  23638. var s = new i.vrCamera(e);
  23639. s.bananaAspect = .8,
  23640. this.width,
  23641. this.height;
  23642. i = this;
  23643. this.setSize = function(e, t) {
  23644. a.setSize.call(this, e, t),
  23645. i.width = e,
  23646. i.height = t
  23647. }
  23648. ,
  23649. this.render = function(e, t, i, n) {
  23650. var r, o;
  23651. if (window.cameraQua = t.quaternion.clone(),
  23652. t.__RESS__SKIP__STEREO__)
  23653. return a.render(e, t, i, n);
  23654. if ("PerspectiveCamera" === t.type)
  23655. r = s.cameraL,
  23656. o = s.cameraR,
  23657. e.updateMatrixWorld(),
  23658. null === t.parent && t.updateMatrixWorld(),
  23659. s.vrCameraUpdate(t);
  23660. else {
  23661. if ("OrthographicCamera" !== t.type)
  23662. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23663. r = o = t
  23664. }
  23665. a.setScissorTest(!0),
  23666. a.setScissor(0, 0, this.width / 2, this.height),
  23667. a.setViewport(0, 0, this.width / 2, this.height),
  23668. a.render.call(this, e, r, i, n),
  23669. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23670. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23671. a.render.call(this, e, o, i, n),
  23672. a.setScissorTest(!1)
  23673. }
  23674. ,
  23675. this.__proto__ = {
  23676. __proto__: a
  23677. }
  23678. }
  23679. ,
  23680. h.prototype.vrCamera = function(e) {
  23681. this.type = "StereoCamera",
  23682. this._aspect = 1,
  23683. this._overlap = .064,
  23684. this.cameraL = new M.PerspectiveCamera,
  23685. this.cameraL.layers.enable(1),
  23686. this.cameraL.matrixAutoUpdate = !1,
  23687. this.cameraR = new M.PerspectiveCamera,
  23688. this.cameraR.layers.enable(2),
  23689. this.cameraR.matrixAutoUpdate = !1,
  23690. this.eyeRight = new M.Matrix4,
  23691. this.eyeLeft = new M.Matrix4,
  23692. this.vrCameraNeedsUpdate = !0,
  23693. window.vrCameraL = this.cameraL,
  23694. Object.defineProperty(this, "bananaAspect", {
  23695. get: function() {
  23696. return this._aspect
  23697. },
  23698. set: function(e) {
  23699. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23700. this._aspect = e
  23701. }
  23702. }),
  23703. Object.defineProperty(this, "overlap", {
  23704. get: function() {
  23705. return this._overlap
  23706. },
  23707. set: function(e) {
  23708. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23709. this._overlap = e
  23710. }
  23711. }),
  23712. this.vrCameraUpdate = function(e) {
  23713. if (this.vrCameraNeedsUpdate = !0,
  23714. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23715. this.vrCameraNeedsUpdate) {
  23716. this.vrCameraNeedsUpdate = !1,
  23717. console.debug("vrCameraUpdate"),
  23718. this.bananaFocus = e.focus,
  23719. this.bananaFov = e.fov,
  23720. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23721. this.bananaNear = e.near,
  23722. this.bananaFar = e.far,
  23723. console.debug(e.aspect),
  23724. this.bananaFocus = 10;
  23725. 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);
  23726. this.eyeLeft.elements[12] = -r,
  23727. this.eyeRight.elements[12] = r,
  23728. t = -a * this.bananaReal_aspect + o,
  23729. i = a * this.bananaReal_aspect + o,
  23730. n.elements[0] = 2 * this.bananaNear / (i - t),
  23731. n.elements[8] = (i + t) / (i - t),
  23732. this.cameraL.projectionMatrix.copy(n),
  23733. t = -a * this.bananaReal_aspect - o,
  23734. i = a * this.bananaReal_aspect - o,
  23735. n.elements[0] = 2 * this.bananaNear / (i - t),
  23736. n.elements[8] = (i + t) / (i - t),
  23737. this.cameraR.projectionMatrix.copy(n)
  23738. }
  23739. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23740. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23741. }
  23742. }
  23743. ,
  23744. h.prototype.boluoGetTexture = function(e) {
  23745. var t = new M.TextureLoader;
  23746. return t.crossOrigin = "anonymous",
  23747. t.load(e)
  23748. }
  23749. ,
  23750. h.prototype.updateScreenSize = function(e) {
  23751. var t, i, n, r = !1;
  23752. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23753. n = e.height,
  23754. r = !0,
  23755. t = 1) : (i = $("#player").width(),
  23756. n = $("#player").height(),
  23757. e && e.resize && (o = this.renderWidth,
  23758. a = this.renderHeight),
  23759. i === o && n === a && !this.forceUpdateSize || (o = i,
  23760. a = n,
  23761. r = !0,
  23762. t = window.devicePixelRatio)),
  23763. r && (this.setSize(i, n, t),
  23764. this.forceUpdateSize = !1)
  23765. }
  23766. ,
  23767. h.prototype.updateComponents = function() {
  23768. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23769. this.updateListeners[t].update(e)
  23770. }
  23771. ,
  23772. h.prototype.suspend = function() {
  23773. this.started = !1,
  23774. this.suspendedObjects = this.scene.children.map(function(e) {
  23775. return this.scene.remove(e),
  23776. e
  23777. }
  23778. .bind(this)),
  23779. this.render()
  23780. }
  23781. ,
  23782. h.prototype.resume = function() {
  23783. this.suspendedObjects.forEach(function(e) {
  23784. this.scene.add(e)
  23785. }
  23786. .bind(this)),
  23787. this.suspendedObjects = [],
  23788. this.started = !0,
  23789. b()
  23790. }
  23791. ;
  23792. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23793. this.started && (window.requestAnimationFrame(b),
  23794. this.updateScreenSize(),
  23795. this.updateComponents(),
  23796. this.updateTextureMemory(),
  23797. this.render(),
  23798. this.emit(r.AfterRender))
  23799. };
  23800. h.prototype.getImageData = (E = document.createElement("canvas"),
  23801. _ = E.getContext("2d"),
  23802. function(e, t, i) {
  23803. return E.width === t && E.height === i || (E.width = t,
  23804. E.height = i),
  23805. _.drawImage(e, 0, 0, t, i),
  23806. _.getImageData(0, 0, t, i)
  23807. }
  23808. ),
  23809. h.prototype.initSizedTexture2D = function(e, t, i) {
  23810. var n = this.renderer
  23811. , r = n.context
  23812. , o = n.state
  23813. , a = new M.Texture(null);
  23814. !(a.flipY = !1) !== i && (i = !1),
  23815. a.generateMipmaps = i;
  23816. var s = n.paramThreeToGL(a.format)
  23817. , l = n.paramThreeToGL(a.type)
  23818. , c = n.properties.get(a)
  23819. , h = r.createTexture();
  23820. o.bindTexture(r.TEXTURE_2D, h),
  23821. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23822. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23823. a.wrapS = t,
  23824. a.wrapT = t;
  23825. var u = n.paramThreeToGL(t);
  23826. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23827. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23828. i ? (a.magFilter = M.LinearFilter,
  23829. a.minFilter = M.LinearMipMapLinearFilter,
  23830. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23831. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23832. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23833. a.minFilter = M.LinearFilter,
  23834. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23835. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23836. o.bindTexture(r.TEXTURE_2D, null),
  23837. c.__webglTexture = h,
  23838. a
  23839. }
  23840. ,
  23841. h.prototype.initSizedCubeMap = function(e, t) {
  23842. var i = this.renderer
  23843. , n = i.context
  23844. , r = i.state
  23845. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23846. o.flipY = !1,
  23847. o.generateMipmaps = t;
  23848. var a = i.paramThreeToGL(o.format)
  23849. , s = i.paramThreeToGL(o.type)
  23850. , l = i.properties.get(o)
  23851. , c = n.createTexture();
  23852. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23853. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23854. for (var h = 0; h < 6; h++)
  23855. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23856. return t ? (o.magFilter = M.LinearFilter,
  23857. o.minFilter = M.LinearMipMapLinearFilter,
  23858. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23859. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23860. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23861. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23862. o.minFilter = M.LinearFilter,
  23863. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23864. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23865. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23866. l.__image__webglTextureCube = c,
  23867. o
  23868. }
  23869. ,
  23870. h.prototype.deallocateCubeTexture = function(e) {
  23871. var t = this.renderer
  23872. , i = t.context
  23873. , n = t.properties.get(e);
  23874. i.deleteTexture(n.__image__webglTextureCube)
  23875. }
  23876. ,
  23877. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23878. var a = this.renderer
  23879. , s = a.context
  23880. , l = a.state
  23881. , c = a.properties.get(t);
  23882. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23883. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23884. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23885. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23886. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23887. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23888. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23889. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23890. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23891. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23892. l.bindTexture(s.TEXTURE_2D, null)
  23893. }
  23894. ,
  23895. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23896. var s = this.renderer
  23897. , l = s.context
  23898. , c = s.state
  23899. , h = s.properties.get(t);
  23900. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23901. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23902. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23903. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23904. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23905. }
  23906. ,
  23907. h.prototype.rebuildMipMaps2D = function(e) {
  23908. var t = this.renderer
  23909. , i = t.context
  23910. , n = t.state;
  23911. t.properties.get(e),
  23912. i.generateMipmap(i.TEXTURE_2D),
  23913. n.bindTexture(i.TEXTURE_2D, null)
  23914. }
  23915. ,
  23916. h.prototype.rebuildMipMaps3D = function(e) {
  23917. var t = this.renderer
  23918. , i = t.context
  23919. , n = t.state
  23920. , r = t.properties.get(e);
  23921. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23922. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23923. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23924. }
  23925. ,
  23926. h.prototype.renderToCubeMap = (P = !1,
  23927. F = N = D = L = O = null,
  23928. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23929. this.renderer.context,
  23930. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23931. (O = new M.Scene).add(L),
  23932. D = new M.ShaderMaterial({
  23933. uniforms: {
  23934. tDiffuse: {
  23935. type: "t",
  23936. value: null
  23937. },
  23938. alpha: {
  23939. type: "f",
  23940. value: 1
  23941. }
  23942. },
  23943. vertexShader: R.basicTextured.vertexShader,
  23944. fragmentShader: R.basicTextured.fragmentShader,
  23945. depthWrite: !1,
  23946. depthTest: !1,
  23947. side: M.DoubleSide
  23948. }),
  23949. N = new M.PlaneBufferGeometry(1,1),
  23950. (F = new M.Mesh(N,D)).position.z = 0,
  23951. O.add(F),
  23952. P = !0);
  23953. var m = N.getAttribute("uv");
  23954. m.setDynamic(!0),
  23955. m.needsUpdate = !0;
  23956. var v = m.array
  23957. , y = r / i
  23958. , A = o / n
  23959. , C = a / i
  23960. , I = s / n;
  23961. v[0] = y,
  23962. v[1] = A + I,
  23963. v[2] = y + C,
  23964. v[3] = A + I,
  23965. v[4] = y,
  23966. v[5] = A,
  23967. v[6] = y + C,
  23968. v[7] = A;
  23969. var E = N.getAttribute("position");
  23970. E.setDynamic(!0),
  23971. E.needsUpdate = !0;
  23972. var _ = E.array
  23973. , b = l / t.width - .5
  23974. , w = c / t.height - .5
  23975. , T = h / t.width
  23976. , x = u / t.height;
  23977. _[0] = b,
  23978. _[1] = w + x,
  23979. _[3] = b + T,
  23980. _[4] = w + x,
  23981. _[6] = b,
  23982. _[7] = w,
  23983. _[9] = b + T,
  23984. _[10] = w,
  23985. this.renderer.properties.get(e),
  23986. D.uniforms.tDiffuse.value = e,
  23987. D.blending = p || M.NoBlending,
  23988. D.transparent = !!f,
  23989. null != g || (g = 1),
  23990. D.uniforms.alpha.value = g,
  23991. D.needUpdate = !0,
  23992. t.activeCubeFace = d,
  23993. t.viewport.set(0, 0, t.width, t.height);
  23994. var S = this.renderer.autoClear;
  23995. this.renderer.autoClear = !1,
  23996. this.renderer.render(O, L, t, !1),
  23997. this.renderer.autoClear = S
  23998. }
  23999. ),
  24000. h.prototype.copyCubeMap = (g = !1,
  24001. C = A = y = v = m = null,
  24002. I = new M.Euler,
  24003. new M.Vector3,
  24004. function(e, t, i, n, r, o, a, s, l) {
  24005. this.renderer,
  24006. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  24007. (m = new M.Scene).add(v),
  24008. y = new M.ShaderMaterial({
  24009. uniforms: {
  24010. tDiffuse: {
  24011. type: "t",
  24012. value: null
  24013. },
  24014. alpha: {
  24015. type: "f",
  24016. value: 1
  24017. }
  24018. },
  24019. vertexShader: R.copyCubeMap.vertexShader,
  24020. fragmentShader: R.copyCubeMap.fragmentShader,
  24021. depthWrite: !1,
  24022. depthTest: !1,
  24023. side: M.DoubleSide
  24024. }),
  24025. A = new M.BoxGeometry(2,2,2),
  24026. C = new M.Mesh(A,y),
  24027. m.add(C),
  24028. g = !0);
  24029. for (var c = 0; c < 6; c++)
  24030. h.getCubeOrientationForCubeFace(c, I),
  24031. C.rotation.copy(I),
  24032. C.matrixWorldNeedsUpdate = !0,
  24033. C.updateMatrixWorld(),
  24034. y.uniforms.tDiffuse.value = e,
  24035. y.blending = a || M.NoBlending,
  24036. y.transparent = !!s,
  24037. null != l || (l = 1),
  24038. y.uniforms.alpha.value = l,
  24039. y.needUpdate = !0,
  24040. t.activeCubeFace = c,
  24041. t.viewport.set(0, 0, r, o),
  24042. this.renderer.render(m, v, t, !1)
  24043. }
  24044. ),
  24045. h.getLookAtForCubeFace = function(e, t) {
  24046. switch (e) {
  24047. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24048. t.set(1, 0, 0);
  24049. break;
  24050. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24051. t.set(-1, 0, 0);
  24052. break;
  24053. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24054. t.set(0, 1, 0);
  24055. break;
  24056. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24057. t.set(0, -1, 0);
  24058. break;
  24059. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24060. t.set(0, 0, 1);
  24061. break;
  24062. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24063. t.set(0, 0, -1)
  24064. }
  24065. }
  24066. ,
  24067. h.getCubeOrientationForCubeFace = function(e, t) {
  24068. switch (e) {
  24069. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24070. t.set(0, -Math.PI / 2, 0);
  24071. break;
  24072. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24073. t.set(0, Math.PI / 2, 0);
  24074. break;
  24075. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24076. t.set(Math.PI / 2, Math.PI, 0);
  24077. break;
  24078. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24079. t.set(-Math.PI / 2, Math.PI, 0);
  24080. break;
  24081. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24082. t.set(0, -Math.PI, 0);
  24083. break;
  24084. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24085. t.set(0, 0, 0)
  24086. }
  24087. }
  24088. ,
  24089. t.exports = h
  24090. }
  24091. , {
  24092. "../enum/GLCubeFaces": 25,
  24093. "../enum/GLTextureType": 26,
  24094. "../enum/SceneRendererEvents": 43,
  24095. "../exception/BasicException": 55,
  24096. "../exception/RendererCreationException": 57,
  24097. "../settings": 166,
  24098. "../shaders": 167,
  24099. "../util/browser": 182,
  24100. events: 202,
  24101. three: 217
  24102. }],
  24103. 159: [function(e, t, i) {
  24104. "use strict";
  24105. function n(e) {
  24106. this.messenger = new a(e),
  24107. this.clientKey = null
  24108. }
  24109. var o = e("../util/ajax")
  24110. , r = e("./PostMessageType")
  24111. , a = e("./postmessage")
  24112. , s = e("./VersionInfo")
  24113. , l = e("events").EventEmitter
  24114. , c = window.location.origin + "/api/v1/user/";
  24115. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  24116. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  24117. }
  24118. ,
  24119. n.prototype.waitForConnection = function() {
  24120. return new Promise(function(t, i) {
  24121. this.messenger.on(r.CONNECT, function(e) {
  24122. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  24123. }
  24124. .bind(this))
  24125. }
  24126. .bind(this))
  24127. }
  24128. ,
  24129. n.prototype.onConnectionReceived = function(i) {
  24130. return this.messenger.setTarget(i.source, i.origin),
  24131. this.verifyConnection(i).then(function(e, t) {
  24132. this.messenger.send({
  24133. type: r.ACCEPT,
  24134. toId: i.fromId,
  24135. warning: t
  24136. }),
  24137. this.clientKey = e,
  24138. this.messenger.removeAllListeners(r.CONNECT),
  24139. this.bindEvents()
  24140. }
  24141. .bind(this), function(e) {
  24142. this.messenger.send({
  24143. type: r.REJECT,
  24144. toId: i.fromId,
  24145. reason: e
  24146. }),
  24147. this.messenger.setTarget()
  24148. }
  24149. .bind(this))
  24150. }
  24151. ,
  24152. n.prototype.verifyConnection = function(r) {
  24153. return new Promise(function(e, t) {
  24154. var i;
  24155. if (s.isDeprecated(r.sdkVersion))
  24156. i = "这个版本正在被弃用";
  24157. else if (!s.isSupported(r.sdkVersion))
  24158. return t("不支持此版本的SDK");
  24159. var n = {
  24160. cache: !1,
  24161. headers: {
  24162. "X-port-Application-Key": r.applicationKey,
  24163. "X-port-Referrer": r.origin
  24164. }
  24165. };
  24166. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  24167. }
  24168. )
  24169. }
  24170. ,
  24171. n.prototype.onMessageReceived = function(t) {
  24172. if (this.validateClientApplicationKey(t.applicationKey)) {
  24173. var i = this;
  24174. t.onDone = function(e) {
  24175. e.toId = t.fromId,
  24176. e.uid = t.uid,
  24177. e.type = r.RESPONSE,
  24178. i.messenger.send(e)
  24179. }
  24180. ,
  24181. this.emit(r.ACTION, t)
  24182. }
  24183. }
  24184. ,
  24185. n.prototype.validateClientApplicationKey = function(e) {
  24186. return this.clientKey === e
  24187. }
  24188. ,
  24189. n.prototype.sendEvent = function(e, t) {
  24190. this.messenger.send({
  24191. type: r.EVENT,
  24192. eventType: e,
  24193. eventData: t
  24194. })
  24195. }
  24196. ,
  24197. t.exports = n
  24198. }
  24199. , {
  24200. "../util/ajax": 181,
  24201. "./PostMessageType": 160,
  24202. "./VersionInfo": 163,
  24203. "./postmessage": 165,
  24204. events: 202
  24205. }],
  24206. 160: [function(e, t, i) {
  24207. "use strict";
  24208. t.exports = Object.freeze({
  24209. CONNECT: "postmessage.connect",
  24210. ACCEPT: "postmessage.accept",
  24211. REJECT: "postmessage.reject",
  24212. ACTION: "postmessage.action",
  24213. RESPONSE: "postmessage.response",
  24214. EVENT: "postmessage.event"
  24215. })
  24216. }
  24217. , {}],
  24218. 161: [function(e, t, i) {
  24219. "use strict";
  24220. t.exports = Object.freeze({
  24221. MOVE: "sdk.move",
  24222. ENTER_PANO: "sdk.enterpano",
  24223. MODEL_LOADED: "sdk.modelloaded"
  24224. })
  24225. }
  24226. , {}],
  24227. 162: [function(e, t, i) {
  24228. "use strict";
  24229. t.exports = Object.freeze({
  24230. FLY: "transition.fly",
  24231. FADEOUT: "transition.fade",
  24232. INSTANT: "transition.instant"
  24233. })
  24234. }
  24235. , {}],
  24236. 163: [function(e, t, i) {
  24237. "use strict";
  24238. t.exports = {
  24239. current: "1.0",
  24240. supported: ["1.0"],
  24241. deprecated: [],
  24242. isSupported: function(e) {
  24243. return -1 !== this.supported.indexOf(e)
  24244. },
  24245. isDeprecated: function(e) {
  24246. return -1 !== this.deprecated.indexOf(e)
  24247. },
  24248. isValid: function(e) {
  24249. return this.isSupported(e) || this.isDeprecated(e)
  24250. }
  24251. }
  24252. }
  24253. , {}],
  24254. 164: [function(q, X, e) {
  24255. (function(e) {
  24256. "use strict";
  24257. function r(e, t, i) {
  24258. e = e && e.toLowerCase().trim();
  24259. var n = new C.UP.clone
  24260. , r = Math.PI / 3
  24261. , o = Math.PI / 2;
  24262. switch (e) {
  24263. case "left":
  24264. i.copy(t),
  24265. i.applyAxisAngle(n, o);
  24266. break;
  24267. case "right":
  24268. i.copy(t),
  24269. i.applyAxisAngle(n, -o);
  24270. break;
  24271. case "forwardleft":
  24272. i.copy(t),
  24273. i.applyAxisAngle(n, r);
  24274. break;
  24275. case "forwardright":
  24276. i.copy(t),
  24277. i.applyAxisAngle(n, -r);
  24278. break;
  24279. case "forward":
  24280. default:
  24281. i.copy(t)
  24282. }
  24283. return i
  24284. }
  24285. function o(e, t) {
  24286. if (e) {
  24287. var i = {
  24288. pano: e,
  24289. lookAtPoint: null,
  24290. duration: null,
  24291. maxDistanceOverride: null,
  24292. skipWarpingCheck: !1
  24293. };
  24294. this.player.flyToPano(i, function() {
  24295. t && t({
  24296. success: !0,
  24297. message: "Transition complete."
  24298. })
  24299. })
  24300. } else
  24301. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  24302. t && t({
  24303. success: !1,
  24304. error: "Unable to find pano."
  24305. })
  24306. }
  24307. function a(e, t) {
  24308. t.copy(C.FORWARD),
  24309. e.getDirection(t)
  24310. }
  24311. function c(i) {
  24312. return {
  24313. panos: i.panos.list.map(function(e) {
  24314. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  24315. return {
  24316. uuid: e.id,
  24317. aligned: e.alignmentType === g.ALIGNED,
  24318. neighbourUUIDs: e.neighbourUUIDs.slice(),
  24319. position: function(e) {
  24320. return e.alignmentType !== g.ALIGNED ? null : {
  24321. x: e.position.x,
  24322. y: e.position.y,
  24323. z: e.position.z
  24324. }
  24325. }(e),
  24326. rotation: function(e) {
  24327. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  24328. return {
  24329. x: h.Math.radToDeg(t._x),
  24330. y: h.Math.radToDeg(t._y),
  24331. z: h.Math.radToDeg(t._z)
  24332. }
  24333. }(e),
  24334. thumbnail: t
  24335. }
  24336. })
  24337. }
  24338. }
  24339. 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"),
  24340. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  24341. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  24342. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  24343. N.angle = 0,
  24344. N.angleTravelled = 0,
  24345. N.playerDirection = new h.Vector3,
  24346. N.lastFacingDirection = new h.Vector3,
  24347. N.onDone = null,
  24348. N.player = null,
  24349. N.start = function(e, t, i, n) {
  24350. N.active = !0,
  24351. e && t && (t = 0),
  24352. N.angle = e || t,
  24353. N.xAngle = e,
  24354. N.yAngle = t,
  24355. N.angleTravelled = 0,
  24356. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24357. i.getDirection(N.playerDirection),
  24358. N.lastFacingDirection.copy(N.playerDirection),
  24359. N.projectVectors(),
  24360. N.onDone = n,
  24361. N.player = i,
  24362. N()
  24363. }
  24364. ,
  24365. N.projectVectors = function() {
  24366. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  24367. N.lastFacingDirection.projectOnPlane(C.UP))
  24368. }
  24369. ,
  24370. N), P = (i = new h.Vector3,
  24371. function(e) {
  24372. e ? (i.copy(e.position),
  24373. i.add(e.discPosition),
  24374. s.projectPositionToCanvas(i, this.player.camera, i),
  24375. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  24376. }
  24377. ), O = (l = new h.Vector3,
  24378. function(e) {
  24379. var t = this.player.getDirection();
  24380. l.copy(t);
  24381. var i = l.y;
  24382. l.y = 0,
  24383. l.normalize();
  24384. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  24385. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  24386. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  24387. 0;
  24388. this.player.mode === I.DOLLHOUSE && (n = -n);
  24389. var r = function() {
  24390. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  24391. }
  24392. .call(this) - .1
  24393. , o = function() {
  24394. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  24395. }
  24396. .call(this) + .1
  24397. , a = n + e;
  24398. r < a ? a = r : a < o && (a = o);
  24399. var s = a - n;
  24400. return 0 < e && s < .01 && (s = 0),
  24401. e < 0 && -.01 < s && (s = 0),
  24402. s
  24403. }
  24404. ), L = (t = new h.Euler,
  24405. function(e) {
  24406. return t.setFromQuaternion(e.quaternion, "YXZ"),
  24407. {
  24408. position: {
  24409. x: e.position.x,
  24410. y: e.position.y,
  24411. z: e.position.z
  24412. },
  24413. rotation: {
  24414. x: h.Math.radToDeg(t.x),
  24415. y: h.Math.radToDeg(t.y),
  24416. z: 0
  24417. },
  24418. pano: e.currentPano ? e.currentPano.id : null,
  24419. mode: e.mode
  24420. }
  24421. }
  24422. ), D = null;
  24423. function N() {
  24424. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24425. N.player.getDirection(N.playerDirection),
  24426. N.projectVectors();
  24427. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  24428. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  24429. N.onDone && (0,
  24430. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  24431. window.setTimeout(N, 4))
  24432. }
  24433. X.exports = {
  24434. init: function(e, t, i, n, r) {
  24435. Y.init(e, t, i, r),
  24436. D = new Promise(function(e, t) {
  24437. i.on(_.Ready, function() {
  24438. e()
  24439. })
  24440. }
  24441. .bind(this));
  24442. var o = new u(window)
  24443. , a = o.waitForConnection();
  24444. a.then(function(e) {
  24445. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24446. });
  24447. var s, l = (s = Date.now(),
  24448. function() {
  24449. if (!(Date.now() - s < 100)) {
  24450. var e = L(i);
  24451. o.sendEvent(b.MOVE, {
  24452. state: e
  24453. }),
  24454. s = Date.now()
  24455. }
  24456. }
  24457. );
  24458. i.on(_.Move, l),
  24459. i.on(_.ViewChanged, l),
  24460. n.on(p.ActiveModelChanged, function(e) {
  24461. function t(e) {
  24462. var t, i = e.newPano.id;
  24463. e.oldPano && (t = e.oldPano.id),
  24464. i !== t && o.sendEvent(b.ENTER_PANO, {
  24465. oldPano: t,
  24466. newPano: i
  24467. })
  24468. }
  24469. var i = e.model
  24470. , n = e.oldModel;
  24471. Y.model = i,
  24472. a.then(function() {
  24473. o.sendEvent(b.MODEL_LOADED, {
  24474. metadata: c(i)
  24475. })
  24476. }),
  24477. n && n.panos.forEach(function(e) {
  24478. e.removeEventListener("enter", t)
  24479. }),
  24480. i.panos.forEach(function(e) {
  24481. e.on("enter", t)
  24482. })
  24483. })
  24484. }
  24485. };
  24486. var F, B, V, k, U, H, z, G, W, j, Y = {
  24487. director: null,
  24488. player: null,
  24489. controls: null,
  24490. sceneRenderer: null,
  24491. model: null,
  24492. init: function(e, t, i, n) {
  24493. this.director = e,
  24494. this.player = i,
  24495. this.controls = t,
  24496. this.sceneRenderer = n
  24497. },
  24498. handleToObject: {},
  24499. objectToHandle: {},
  24500. handleCount: 0,
  24501. onMessageReceive: function(e) {
  24502. if (e) {
  24503. var t = e.targetFunction
  24504. , i = e.params
  24505. , n = e.onDone;
  24506. t && this[t] && this[t](i, n)
  24507. }
  24508. },
  24509. waitForInit: function(e, t) {
  24510. D.then(t.bind({
  24511. success: !0,
  24512. message: "Init complete."
  24513. }))
  24514. },
  24515. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24516. j = new h.Quaternion,
  24517. function(e, t) {
  24518. var i = e.pano
  24519. , n = e.rotation
  24520. , r = e.transition;
  24521. if (!this.model)
  24522. return t({
  24523. success: !1,
  24524. error: "The model has not been loaded yet"
  24525. });
  24526. var o = this.model.panos.get(i);
  24527. if (!o)
  24528. return t({
  24529. success: !1,
  24530. error: i + " does not exist in this model"
  24531. });
  24532. if (!n)
  24533. return t({
  24534. sucess: !1,
  24535. erorr: n + " is not a valid rotation"
  24536. });
  24537. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24538. console.log(n.z);
  24539. var a = {
  24540. success: !0,
  24541. message: i
  24542. };
  24543. if (r === v.FADEOUT)
  24544. j.setFromEuler(W),
  24545. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24546. else {
  24547. var s, l;
  24548. r === v.INSTANT && (l = s = 0);
  24549. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24550. this.player.flyToPano({
  24551. pano: o,
  24552. lookAtPoint: c,
  24553. duration: s,
  24554. aimDuration: l
  24555. }, t.bind(this, a))
  24556. }
  24557. }
  24558. ),
  24559. moveInDirection: function(e, t) {
  24560. var i = e.direction;
  24561. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24562. void (t && t({
  24563. success: !1,
  24564. error: "Invalid direction."
  24565. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24566. t(e ? {
  24567. success: !0,
  24568. message: "moved " + i
  24569. } : {
  24570. success: !1,
  24571. error: "Cannot move in direction: " + i
  24572. })
  24573. })
  24574. },
  24575. getPose: function(e, t) {
  24576. return this.player.camera.position,
  24577. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24578. t({
  24579. success: !0,
  24580. message: L(this.player)
  24581. })
  24582. },
  24583. takeScreenShot: (z = new h.PerspectiveCamera,
  24584. G = new h.WebGLRenderTarget,
  24585. function(e, t) {
  24586. if (!e.resolution)
  24587. return t({
  24588. success: !1,
  24589. error: "An invalid resolution was specified"
  24590. });
  24591. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24592. var i = this.sceneRenderer.renderer.getSize();
  24593. e.resolution.width = i.width,
  24594. e.resolution.height = i.height
  24595. }
  24596. z.layers.set(T.DEFAULT),
  24597. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24598. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24599. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24600. var n = e.resolution.width
  24601. , r = e.resolution.height
  24602. , o = n / r;
  24603. z.position.copy(this.sceneRenderer.camera.position),
  24604. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24605. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24606. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24607. G.setSize(n, r),
  24608. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24609. var a = new Uint8Array(n * r * 4);
  24610. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24611. var s = S.encode({
  24612. data: a,
  24613. width: n,
  24614. height: r,
  24615. heading: 180,
  24616. pitch: 0
  24617. }, {
  24618. quality: 75,
  24619. flipY: !0
  24620. });
  24621. t({
  24622. success: !0,
  24623. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24624. })
  24625. }
  24626. ),
  24627. findRankedPano: (U = new h.Vector3,
  24628. H = new h.Vector3,
  24629. function(e, t) {
  24630. a(this.player, H),
  24631. r(t, H, U);
  24632. var i = this.player.rankedPanoInDirection(e, U);
  24633. if (i) {
  24634. var n = this.objectToHandle[i.id];
  24635. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24636. this.handleToObject[n] = i),
  24637. n
  24638. }
  24639. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24640. -1
  24641. }
  24642. ),
  24643. findRankedtag: (V = new h.Vector3,
  24644. k = new h.Vector3,
  24645. function(e, t) {
  24646. a(this.player, k),
  24647. r(t, k, V);
  24648. var i = this.player.rankedtagInDirection(e, V);
  24649. if (i) {
  24650. var n = this.objectToHandle[i.sid];
  24651. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24652. this.handleToObject[n] = i),
  24653. n
  24654. }
  24655. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24656. -1
  24657. }
  24658. ),
  24659. clickNearesttag: function(e) {
  24660. this.clickRankedtag(0, e)
  24661. },
  24662. clickRankedtag: function(e, t) {
  24663. var i = function(e, t) {
  24664. var i = this.findRankedtag(e, t);
  24665. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24666. null)
  24667. }
  24668. .call(this, e, t);
  24669. i && P.call(this, i)
  24670. },
  24671. clickNearestPano: function(e, t) {
  24672. this.clickRankedPano(0, e, t)
  24673. },
  24674. clickRankedPano: function(e, t, i) {
  24675. var n = function(e, t) {
  24676. var i = this.findRankedPano(e, t);
  24677. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24678. null)
  24679. }
  24680. .call(this, e, t);
  24681. n ? o.call(this, n, i) : i(null)
  24682. },
  24683. clickPano: function(e, t) {
  24684. var i = this.handleTable[e];
  24685. i ? o.call(this, i, t) : t(null)
  24686. },
  24687. rotateDirection: function(e, t) {
  24688. var i = e.direction
  24689. , n = e.angle;
  24690. if (!R.active) {
  24691. var r = 0
  24692. , o = 0
  24693. , a = 0
  24694. , s = 0;
  24695. if (!n || isNaN(n))
  24696. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24697. void (t && t({
  24698. success: !1,
  24699. error: "Invalid rotation angle."
  24700. }));
  24701. if (this.player.mode === I.TRANSITIONING)
  24702. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24703. void (t && t({
  24704. success: !1,
  24705. error: "Cannot rotate while transitioning"
  24706. }));
  24707. if (i === m.RIGHT || i === m.LEFT)
  24708. i === m.RIGHT && (n = -n),
  24709. r = 0 < n ? -1 : 1,
  24710. a = n;
  24711. else {
  24712. if (i !== m.UP && i !== m.DOWN)
  24713. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24714. void (t && t({
  24715. success: !1,
  24716. error: "Invalid direction for rotation."
  24717. }));
  24718. if (this.player.mode === I.FLOORPLAN)
  24719. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24720. void (t && t({
  24721. success: !1,
  24722. error: "Cannot rotate " + i + " in floorplan mode"
  24723. }));
  24724. if (i === m.DOWN && (n = -n),
  24725. 0 === (n = O.call(this, n)))
  24726. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24727. void (t && t({
  24728. success: !1,
  24729. error: "Already at maximum rotation in direction: " + i
  24730. }));
  24731. o = 0 < n ? 1 : -1,
  24732. s = n
  24733. }
  24734. var l = n;
  24735. n = h.Math.degToRad(n),
  24736. a = h.Math.degToRad(a),
  24737. s = h.Math.degToRad(s);
  24738. var c = this.controls.activeControl;
  24739. c.startRotating(r, o),
  24740. R.start(a, s, this.player, function() {
  24741. c.stopRotating(!0),
  24742. t && t({
  24743. success: !0,
  24744. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24745. })
  24746. })
  24747. }
  24748. },
  24749. rotate: (F = new h.Vector3,
  24750. B = new h.Vector3,
  24751. function(e, t) {
  24752. var i = e.xAngle
  24753. , n = e.yAngle;
  24754. if (!R.active) {
  24755. if (i = i || 0,
  24756. n = n || 0,
  24757. isNaN(i) || isNaN(n))
  24758. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24759. void (t && t({
  24760. success: !1,
  24761. error: "Invalid rotation angle."
  24762. }));
  24763. if (this.player.mode === I.TRANSITIONING)
  24764. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24765. void (t && t({
  24766. success: !1,
  24767. error: "Cannot rotate while transitioning"
  24768. }));
  24769. Math.abs(i) < .01 && (i = 0),
  24770. Math.abs(n) < .01 && (n = 0);
  24771. var r = n;
  24772. n = O.call(this, n);
  24773. var o = 0 < r ? "UP" : "DOWN";
  24774. if (!(i = -i) && r && !n)
  24775. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24776. void (t && t({
  24777. success: !1,
  24778. error: "Already at maximum rotation in direction: " + o
  24779. }));
  24780. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24781. var a = n;
  24782. n = h.Math.degToRad(n),
  24783. i = h.Math.degToRad(i),
  24784. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24785. this.player.getDirection(F),
  24786. B.copy(F).applyAxisAngle(C.UP, i),
  24787. B.applyAxisAngle(C.RIGHT, n);
  24788. var s = (F.angleTo(B),
  24789. 0 < i ? -1 : i < 0 ? 1 : 0)
  24790. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24791. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24792. var c = this.controls.activeControl;
  24793. c.startRotating(s, l),
  24794. R.start(i, n, this.player, function() {
  24795. c.stopRotating(!0),
  24796. t && t({
  24797. success: !0,
  24798. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24799. })
  24800. })
  24801. }
  24802. }
  24803. ),
  24804. panCamera: function(e, i) {
  24805. function t(e) {
  24806. switch (r.removeAllListeners(w.AutoPanComplete),
  24807. r.removeAllListeners(w.AutoPanInterrupt),
  24808. r.removeAllListeners(w.AutoPanClamped),
  24809. e) {
  24810. case w.AutoPanInterrupt:
  24811. i({
  24812. success: !0,
  24813. message: "Camera panning interrupted."
  24814. });
  24815. break;
  24816. case w.AutoPanClamped:
  24817. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24818. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24819. return void i({
  24820. success: !1,
  24821. error: "Already at edge of current model bounds."
  24822. });
  24823. var t = "The view point is outside the bounds for the current model. ";
  24824. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24825. console.warn(t)
  24826. }
  24827. case w.AutoPanComplete:
  24828. i({
  24829. success: !0,
  24830. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24831. })
  24832. }
  24833. }
  24834. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24835. return i({
  24836. success: !1,
  24837. error: "Camera panning is not available in the current mode: " + this.player.mode
  24838. });
  24839. var n = e.position
  24840. , r = this.player.control;
  24841. r.setAutoPanPosition(n.x, n.z),
  24842. r.autoPan = !0;
  24843. var o = function(e, t) {
  24844. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24845. };
  24846. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24847. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24848. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24849. },
  24850. click: function(e, t) {
  24851. var i = e.x
  24852. , n = e.y;
  24853. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24854. n = n / 100 * $("#player").height()),
  24855. this.player.handleInputStart(i, n),
  24856. this.player.updateIntersect(),
  24857. this.player.handleInputEnd(i, n)
  24858. },
  24859. mouseOver: function(e, t) {
  24860. var i = e.x
  24861. , n = e.y;
  24862. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24863. n = n / 100 * $("#player").height()),
  24864. this.player.handleInputMove(i, n),
  24865. this.player.updateIntersect()
  24866. },
  24867. moveToMode: function(e, t) {
  24868. function i(e) {
  24869. t(e ? {
  24870. success: !1,
  24871. error: "Failed to load new mode: " + e
  24872. } : {
  24873. success: !0,
  24874. message: "Moved to new mode: " + n
  24875. })
  24876. }
  24877. var n = e.mode;
  24878. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24879. i()
  24880. }, function(e) {
  24881. i(e)
  24882. }) : t({
  24883. success: !1,
  24884. error: "Invalid mode selection"
  24885. })
  24886. }
  24887. }
  24888. }
  24889. ).call(this, "/js/sdk/automation.js")
  24890. }
  24891. , {
  24892. "../constants": 8,
  24893. "../enum/AlignmentType": 17,
  24894. "../enum/ControlEvents": 21,
  24895. "../enum/Direction": 22,
  24896. "../enum/GLCubeFaces": 25,
  24897. "../enum/Keys": 30,
  24898. "../enum/ModelManagerEvents": 33,
  24899. "../enum/PlayerEvents": 40,
  24900. "../enum/RenderLayers": 41,
  24901. "../enum/Vectors": 50,
  24902. "../enum/Viewmode": 51,
  24903. "../enum/WarpStyle": 52,
  24904. "../lib/jpeg_encoder": 94,
  24905. "../sdk/SdkEvents": 161,
  24906. "../settings": 166,
  24907. "../util/common": 185,
  24908. "../util/logger": 189,
  24909. "../util/math": 190,
  24910. "../util/panorama": 191,
  24911. "./ApiHost": 159,
  24912. "./PostMessageType": 160,
  24913. "./TransitionStyles": 162,
  24914. three: 217
  24915. }],
  24916. 165: [function(e, t, i) {
  24917. "use strict";
  24918. function n(e) {
  24919. this.sourceWindow = e,
  24920. this.targetWindow = null,
  24921. this.targetOrigin = null,
  24922. this.id = Math.floor(1e5 * Math.random()),
  24923. this.bindEvents()
  24924. }
  24925. var r = e("./PostMessageType")
  24926. , o = e("events").EventEmitter;
  24927. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24928. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24929. }
  24930. ,
  24931. n.prototype.setTarget = function(e, t) {
  24932. this.targetWindow = e,
  24933. this.targetOrigin = t
  24934. }
  24935. ,
  24936. n.prototype.onPostmessageReceived = function(e) {
  24937. var t = e.origin || e.originalEvent.origin
  24938. , i = e.source;
  24939. switch (e.data.type) {
  24940. case r.CONNECT:
  24941. break;
  24942. case r.RESPONSE:
  24943. if (this.id !== e.data.toId)
  24944. return;
  24945. default:
  24946. if (!this.validateMessageOrigin(t))
  24947. return
  24948. }
  24949. var n = e.data;
  24950. n.source = i,
  24951. n.origin = t,
  24952. n.timestamp = Date.now(),
  24953. this.emit(e.data.type, n)
  24954. }
  24955. ,
  24956. n.prototype.validateMessageOrigin = function(e) {
  24957. return "*" === this.targetOrigin || e === this.targetOrigin
  24958. }
  24959. ,
  24960. n.prototype.send = function(e) {
  24961. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24962. this.targetWindow.postMessage(e, this.targetOrigin))
  24963. }
  24964. ,
  24965. t.exports = n
  24966. }
  24967. , {
  24968. "./PostMessageType": 160,
  24969. events: 202
  24970. }],
  24971. 166: [function(e, t, i) {
  24972. "use strict";
  24973. var n = e("three")
  24974. , r = e("./util/browser")
  24975. , o = e("./enum/Viewmode")
  24976. , a = e("./enum/VROption")
  24977. , s = e("./enum/Colors")
  24978. , l = e("./enum/WarpStyle")
  24979. , c = e("./util/easing")
  24980. , h = e("./util/common")
  24981. , u = e("./util/showcase")
  24982. , d = e("./constants")
  24983. , p = {
  24984. debug: !1,
  24985. version: "2.25.6-0-gd87e5b1",
  24986. languageTag: r.valueFromHash("lang", null),
  24987. pageTitle: "四维虚拟漫游",
  24988. authorizationHeader: u.getAuthorizationHeader(),
  24989. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24990. logLevel: r.valueFromHash("log", 2),
  24991. skyboxRadius: 2500,
  24992. modelBoundsPadding: 5,
  24993. showNeighbors: !1,
  24994. brand: r.valueFromHash("brand", !0),
  24995. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24996. startHighlights: r.valueFromHash("hl", -1),
  24997. specialEdition: r.valueFromHash("bn", 0),
  24998. useWheel: r.valueFromHash("wh", !0),
  24999. crossOrigin: "anonymous",
  25000. fancierTransition: !1,
  25001. wireframe: !1,
  25002. skyboxWireframe: !1,
  25003. modelAlpha: 1,
  25004. highlightPanoSelection: !1,
  25005. showSweeps: !0,
  25006. showSkyboxes: !1,
  25007. showMesh: !0,
  25008. showFloors: !1,
  25009. showFloorDuration: 300,
  25010. showFloorDelay: 300,
  25011. hideFloorDuration: 300,
  25012. hideFloorDelay: 0,
  25013. reticuleOpacityTransitionTime: 250,
  25014. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  25015. markerOpacityTransitionTime: 500,
  25016. guiAnimationSpeed: 250,
  25017. highlightAnimationDuration: 500,
  25018. modelComponentLoadSpinnerDelay: 150,
  25019. captureErrors: !1,
  25020. maxMobileTextures: 6,
  25021. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  25022. startupFlyinDelay: 3e3,
  25023. dollhouseDefault: {
  25024. minDistance: 1,//15, //编辑页面给近一些
  25025. maxDistance: 50,
  25026. minPolarAngle: n.Math.degToRad(10),
  25027. maxPolarAngle: n.Math.degToRad(90)
  25028. },
  25029. hideReticuleTimeout: 1e3,
  25030. analytics: {
  25031. inactivityThreshold: 30,
  25032. sessionTrackingRate: .15,
  25033. maxTrackedErrors: 20,
  25034. sessionDurationPingFrequency: 10,
  25035. sessionDurationTimeout: 15
  25036. },
  25037. flydown: {
  25038. movementEasing: "easeInOutQuad",
  25039. movementDelay: .001,
  25040. rotationEasing: "easeInOutQuad",
  25041. rotationDelay: .5,
  25042. modelTextureDelay: .75,
  25043. skyboxDelay: .75
  25044. },
  25045. transition: {
  25046. flySpeed: .001,
  25047. flyTime: 750,
  25048. flytimeMaxDistanceThreshold: 5,
  25049. flytimeDistanceMultiplier: 150,
  25050. aimTime: 1500,
  25051. aimSlowFactor: 1.5,
  25052. blur: .8,
  25053. movementEasing: "easeInOutQuad",
  25054. blendEasing: "easeInOutQuad",
  25055. fastForwardFactor: 3
  25056. },
  25057. show360Views: {
  25058. enabled: !0,
  25059. transitionTime: 1e3
  25060. },
  25061. quickstart: {
  25062. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  25063. animation: 1400,
  25064. showTextDelay: 500,
  25065. fadeOutDelay: 3e3,
  25066. fovChange: 10
  25067. },
  25068. appConfig: {
  25069. webvr_version: null,
  25070. segment_key: null,
  25071. embedly_key: null,
  25072. branch_key: null,
  25073. keen_write_key: null,
  25074. keen_project_id: null
  25075. },
  25076. vr: {
  25077. enabled: !0,
  25078. allowWebVR: !1,
  25079. option: r.valueFromHash("vr", a.CONTEXTUAL)
  25080. },
  25081. share: {
  25082. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  25083. },
  25084. input: {
  25085. longTapThreshold: 200,
  25086. moveToleranceNDC: .08,
  25087. touchMoveThreshold: 25
  25088. },
  25089. help: {
  25090. modalStayDuration: 600
  25091. },
  25092. immersive: {
  25093. timeToShowAgain: 1250,
  25094. uiStayDuration: 600
  25095. },
  25096. tourInteraction: {
  25097. disabled: "0" === r.valueFromHash("tourcta", null),
  25098. showPauseButton: 1e3,
  25099. showModal: 1500,
  25100. allowNextClick: 200,
  25101. largeModal: "1" === r.valueFromHash("tourcta", null),
  25102. smallModal: "2" === r.valueFromHash("tourcta", null)
  25103. },
  25104. labels: {
  25105. enabled: !1,
  25106. hideUntilStart: !0,
  25107. fadeInDuration: 250,
  25108. fadeInDelay: 250,
  25109. fadeOutDuration: 250,
  25110. fadeOutDelay: 0,
  25111. zoomHideThreshhold: {
  25112. mobile: r.isSmallScreen() ? .45 : .6,
  25113. desktop: 2
  25114. },
  25115. zoomTruncateThreshhold: {
  25116. mobile: r.isSmallScreen() ? .35 : .45,
  25117. desktop: .85
  25118. },
  25119. minLengthForTruncate: 16,
  25120. truncateLength: 12,
  25121. truncateSuffix: "..."
  25122. },
  25123. tags: {
  25124. enabled: r.valueFromHash("mt", 1),
  25125. startup: {
  25126. hideUntilStart: !0,
  25127. fadeInDuration: 500,
  25128. fadeInDelay: 100
  25129. },
  25130. visibility: {
  25131. anyDistance: !0,
  25132. visibleDistance: 8,
  25133. cameraClearance: .1,
  25134. alphaTestLevel: .05,
  25135. hideViaFloor: !0,
  25136. hideOffScreenDisc: !1,
  25137. hideOffScreenObject: !1
  25138. },
  25139. disc: {
  25140. opacity: 1,
  25141. disabledOpacity: .5,
  25142. scale: {
  25143. nearBound: 1.5,
  25144. farBound: 4.8,
  25145. linkFarBound: !1,
  25146. linkPercent: 40,
  25147. maxSize: 80,
  25148. minSize: 40,
  25149. baseViewportSize: 800,
  25150. responsiveness: 100
  25151. }
  25152. },
  25153. pole: {
  25154. enabled: !0,
  25155. height: .5,
  25156. width: 2,
  25157. opacity: .5,
  25158. color: "white"
  25159. },
  25160. navigate: {
  25161. nearestPano: !0,
  25162. lineOfSight: !0,
  25163. reactivate: !0,
  25164. aimAt: "disc",
  25165. tiltTolerance: 25,
  25166. rotateSpeedFactor: .6
  25167. }
  25168. },
  25169. path: {
  25170. color: window.DATA.floorMarkerColor || s.newBlue,
  25171. colorUp: s._desat(s.newBlue, .5),
  25172. colorDown: s._darken(s.newBlue, .35),
  25173. opacity: .5,
  25174. style: "ribbon",
  25175. height: .025,
  25176. ribbonWidth: .24,
  25177. outsideHeight: .5,
  25178. waypointRadius: .5,
  25179. waypointIndoorRadius: .24,
  25180. waypointPulse: 1e3,
  25181. typ: l.BLACK,
  25182. meshFree: r.valueFromHash("mf", 1),
  25183. mapGuides: r.valueFromHash("guides", !0),
  25184. fadeInTime: 400,
  25185. fadeOutTime: 300
  25186. },
  25187. warp: {
  25188. nearPanoDist: .1,
  25189. matchCam: !1,
  25190. blur: .33,
  25191. fastTime: 1500,
  25192. teleportTime: 1500,
  25193. outsideTime: 2e3,
  25194. lookAheadMax: .3,
  25195. lookAheadDist: 2.5,
  25196. softPushDist: .37,
  25197. softPushEnd: .3,
  25198. softBendAngle: 8,
  25199. softBendTilt: 4,
  25200. softBendEnd: .3,
  25201. doBurns: !0,
  25202. burnsAngle: 8,
  25203. minBurnsAngle: 35,
  25204. minDownAngle: -35,
  25205. maxTurnPerSec: 280,
  25206. maxAimPerSec: 35,
  25207. minRotation: 12,
  25208. maxAimRotation: 33.2,
  25209. turnFriction: .2,
  25210. flySpeed: .01,
  25211. minWarpTime: 1200,
  25212. warpInterruptionRedirectTime: 500,
  25213. tourStepDelay: r.valueFromHash("st", 0),
  25214. walkDelay: 0,
  25215. walkMaxDist: 50,
  25216. walkMinDist: .8,
  25217. walkSlideShowThreshhold: 3e3,
  25218. walkExtraPanosDistance: .4,
  25219. timePerMeter: 1200,
  25220. motionLeadTime: 5e3,
  25221. movementEasing: "easeInOutQuad",
  25222. blendEasing: "easeInOutQuad",
  25223. showBunny: !1,
  25224. loop: r.valueFromHash("lp", !1),
  25225. auto: r.valueFromHash("ts", -1),
  25226. eOrder: "YXZ",
  25227. stepFactor: .25,
  25228. brakeStrength: 2,
  25229. minBrakeAngle: .1,
  25230. maxBrakeAngle: 1.8,
  25231. climbEffort: 4
  25232. },
  25233. rotationFriction: .05,
  25234. rotationAccelerationInside: 4.5,
  25235. rotationAccelerationOutside: .15,
  25236. rotationAfterMoveMultiplier: 40,
  25237. rotationAfterMoveHistoryCount: 5,
  25238. panFriction: .09,
  25239. panAccelerationOutside: 60,
  25240. onload: r.valueFromHash("onload", o.PANORAMA),
  25241. zoomNearLimit: .1,
  25242. zoomFarLimit: 50,
  25243. navigation: {
  25244. panoScores: !1,
  25245. mouseDirection: !0,
  25246. filterStrictness: .75,
  25247. angleFactor: -30,
  25248. directionFactor: 10,
  25249. distanceFactor: -1,
  25250. optionalityFactor: 3
  25251. },
  25252. sdkInit: !1,
  25253. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  25254. console: r.valueFromHash("console", !1),
  25255. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  25256. panoramaNeighbourMaxDistance: 5,
  25257. panoFloorClickRadius: .35,
  25258. showScreenshotLocations: !1,
  25259. showAxis: !1,
  25260. showNeighbourRaycasts: !1,
  25261. colorMarkerOnLoad: !1,
  25262. colorMarkerByFloor: !1,
  25263. tiling: {
  25264. panoPreRenderRepeatDelay: 2500,
  25265. panoPreRenderDelay: 500,
  25266. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  25267. tilingFlagNames: ["usetiles", "tiles"],
  25268. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  25269. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  25270. overlayStyle: r.valueFromHash("tileoverlay", 0),
  25271. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  25272. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  25273. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  25274. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  25275. customCompression: r.valueFromHash("tilecustcomp", 0),
  25276. mobileHighQualityOverride: 1,
  25277. allowUltraHighResolution: !0
  25278. },
  25279. zoom: {
  25280. enabled: !0,
  25281. forceOff: r.valueFromHash("nozoom", 0),
  25282. overridemax: r.valueFromHash("maxzoom", null),
  25283. overridemin: r.valueFromHash("minzoom", null),
  25284. max: d.highQualityMaxZoom,
  25285. min: 1,
  25286. transitionStyle: r.valueFromHash("zoomtrans", 1),
  25287. activationThreshold: 1.1,
  25288. restoreTime: 500
  25289. },
  25290. profiling: {
  25291. enabled: r.valueFromHash("mem", !1)
  25292. }
  25293. };
  25294. (p = h.deepExtend(p, d, {
  25295. insideFOV: r.valueFromHash("fov", d.insideFOV),
  25296. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  25297. panorama: {
  25298. transitionTime: 1e3,
  25299. modelAlpha: 0,
  25300. modelAlphaDelay: p.flydown.modelTextureDelay,
  25301. modelAlphaLength: 1,
  25302. skyboxOpacity: 1,
  25303. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25304. skyboxOpacityLength: .9,
  25305. fovLength: 1,
  25306. fovDelay: 0,
  25307. cameraMatrixDuration: .8,
  25308. cameraMatrixDelay: 0,
  25309. cameraMatrixEase: c.easeInCubic,
  25310. reticuleOpacity: 1,
  25311. markerOpacity: .3,
  25312. markerOpacityOnHover: 1
  25313. },
  25314. dollhouse: {
  25315. transitionTime: 1e3,
  25316. modelAlpha: 1,
  25317. modelAlphaDelay: 0,
  25318. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25319. skyboxOpacity: 0,
  25320. skyboxOpacityDelay: 0,
  25321. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25322. fovLength: 1,
  25323. fovDelay: 0,
  25324. cameraMatrixDuration: .8,
  25325. cameraMatrixDelay: .3,
  25326. cameraMatrixEase: c.easeInCubic,
  25327. reticuleOpacity: 1,
  25328. markerOpacity: 0,
  25329. markerOpacityOnHover: 0
  25330. },
  25331. floorplan: {
  25332. transitionTime: 1e3,
  25333. modelAlpha: 1,
  25334. modelAlphaDelay: 0,
  25335. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25336. skyboxOpacity: 0,
  25337. skyboxOpacityDelay: 0,
  25338. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25339. fovLength: 1,
  25340. fovDelay: 0,
  25341. cameraMatrixDuration: .5,
  25342. cameraMatrixDelay: 0,
  25343. cameraMatrixEase: c.easeOutCubic,
  25344. reticuleOpacity: 1,
  25345. markerOpacity: 0,
  25346. markerOpacityOnHover: 0,
  25347. cameraHeight: 50
  25348. },
  25349. transitioning: {
  25350. reticuleOpacity: 0,
  25351. markerOpacity: .3,
  25352. markerOpacityOnHover: 1
  25353. },
  25354. "floorplan-dollhouse": {
  25355. rotationDelay: 0,
  25356. rotationDuration: 1
  25357. },
  25358. "floorplan-panorama": {
  25359. rotationDelay: .5,
  25360. rotationDuration: 1
  25361. },
  25362. "dollhouse-panorama": {
  25363. rotationDelay: .5,
  25364. rotationDuration: 1
  25365. },
  25366. "dollhouse-floorplan": {
  25367. rotationDelay: 0,
  25368. rotationDuration: 1,
  25369. cameraMatrixDuration: 1.05,
  25370. cameraMatrixDelay: .5
  25371. },
  25372. "panorama-dollhouse": {
  25373. rotationDelay: 0,
  25374. rotationDuration: .5
  25375. },
  25376. "panorama-floorplan": {
  25377. transitionTime: 1500,
  25378. rotationDelay: 0,
  25379. rotationDuration: .5
  25380. }
  25381. })).path.meshFree && (p.path.typ = l.WALK),
  25382. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  25383. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  25384. window._settings = t.exports = p
  25385. }
  25386. , {
  25387. "./constants": 8,
  25388. "./enum/Colors": 19,
  25389. "./enum/VROption": 47,
  25390. "./enum/Viewmode": 51,
  25391. "./enum/WarpStyle": 52,
  25392. "./util/browser": 182,
  25393. "./util/common": 185,
  25394. "./util/easing": 186,
  25395. "./util/showcase": 193,
  25396. three: 217
  25397. }],
  25398. 167: [function(e, t, i) {
  25399. "use strict";
  25400. var n = e("three")
  25401. , r = e("./settings")
  25402. , 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"
  25403. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  25404. t.exports = {
  25405. basicTextured: {
  25406. uniforms: {
  25407. tDiffuse: {
  25408. type: "t",
  25409. value: null
  25410. },
  25411. alpha: {
  25412. type: "f",
  25413. value: 1
  25414. }
  25415. },
  25416. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25417. 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}"
  25418. },
  25419. copyCubeMap: {
  25420. uniforms: {
  25421. tDiffuse: {
  25422. type: "t",
  25423. value: null
  25424. },
  25425. alpha: {
  25426. type: "f",
  25427. value: 1
  25428. }
  25429. },
  25430. 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}",
  25431. 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}"
  25432. },
  25433. cube: {
  25434. uniforms: {
  25435. map: {
  25436. type: "t",
  25437. value: null
  25438. },
  25439. opacity: {
  25440. type: "f",
  25441. value: 1
  25442. }
  25443. },
  25444. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25445. 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"
  25446. },
  25447. model: {
  25448. uniforms: {
  25449. map: {
  25450. type: "t",
  25451. value: null
  25452. },
  25453. modelAlpha: {
  25454. type: "f",
  25455. value: r.modelAlpha
  25456. },
  25457. opacity: {
  25458. type: "f",
  25459. value: 1
  25460. },
  25461. progress: {
  25462. type: "f",
  25463. value: 0
  25464. },
  25465. blackout: {
  25466. type: "i",
  25467. value: 0
  25468. },
  25469. pano0Map: {
  25470. type: "t",
  25471. value: null
  25472. },
  25473. pano0Position: {
  25474. type: "v3",
  25475. value: new n.Vector3
  25476. },
  25477. pano0Matrix: {
  25478. type: "m4",
  25479. value: new n.Matrix4
  25480. },
  25481. pano1Map: {
  25482. type: "t",
  25483. value: null
  25484. },
  25485. pano1Position: {
  25486. type: "v3",
  25487. value: new n.Vector3
  25488. },
  25489. pano1Matrix: {
  25490. type: "m4",
  25491. value: new n.Matrix4
  25492. }
  25493. },
  25494. 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",
  25495. 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"
  25496. },
  25497. hot: {
  25498. uniforms: {
  25499. color: {
  25500. type: "c",
  25501. value: new n.Color(16720384)
  25502. },
  25503. opac: {
  25504. type: "f",
  25505. value: 0
  25506. },
  25507. texture1: {
  25508. type: "t",
  25509. value: null
  25510. },
  25511. texture2: {
  25512. type: "t",
  25513. value: null
  25514. }
  25515. },
  25516. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25517. 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"
  25518. },
  25519. modelOutside: {
  25520. uniforms: {
  25521. map: {
  25522. type: "t",
  25523. value: null
  25524. },
  25525. opacity: {
  25526. type: "f",
  25527. value: 1
  25528. }
  25529. },
  25530. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25531. 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"
  25532. },
  25533. ribbon: {
  25534. uniforms: {
  25535. map: {
  25536. type: "t",
  25537. value: null
  25538. },
  25539. opacity: {
  25540. type: "f",
  25541. value: 1
  25542. },
  25543. color: {
  25544. type: "c",
  25545. value: new n.Color(r.path.color)
  25546. }
  25547. },
  25548. 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",
  25549. 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"
  25550. },
  25551. waypoint: {
  25552. uniforms: {
  25553. map: {
  25554. type: "t",
  25555. value: null
  25556. },
  25557. opacity: {
  25558. type: "f",
  25559. value: 1
  25560. },
  25561. pulse: {
  25562. type: "f",
  25563. value: 1
  25564. },
  25565. nearFade: {
  25566. type: "v2",
  25567. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25568. },
  25569. color: {
  25570. type: "c",
  25571. value: new n.Color(r.reticuleColor)
  25572. }
  25573. },
  25574. 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",
  25575. 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"
  25576. },
  25577. modelDebug: {
  25578. uniforms: {
  25579. map: {
  25580. type: "t",
  25581. value: null
  25582. },
  25583. modelAlpha: {
  25584. type: "f",
  25585. value: r.modelAlpha
  25586. },
  25587. depthmapRatio: {
  25588. type: "f",
  25589. value: 0
  25590. },
  25591. opacity: {
  25592. type: "f",
  25593. value: 1
  25594. },
  25595. progress: {
  25596. type: "f",
  25597. value: 0
  25598. },
  25599. considerOcclusion: {
  25600. type: "i",
  25601. value: r.fancierTransition
  25602. },
  25603. highlightPanoSelection: {
  25604. type: "i",
  25605. value: 0
  25606. },
  25607. useThirdPano: {
  25608. type: "i",
  25609. value: r.useThirdPano
  25610. },
  25611. pano0Map: {
  25612. type: "t",
  25613. value: null
  25614. },
  25615. pano0Depth: {
  25616. type: "t",
  25617. value: null
  25618. },
  25619. pano0Position: {
  25620. type: "v3",
  25621. value: new n.Vector3
  25622. },
  25623. pano0Matrix: {
  25624. type: "m4",
  25625. value: new n.Matrix4
  25626. },
  25627. pano0Weight: {
  25628. type: "f",
  25629. value: r.transition.pano0Weight
  25630. },
  25631. pano1Map: {
  25632. type: "t",
  25633. value: null
  25634. },
  25635. pano1Depth: {
  25636. type: "t",
  25637. value: null
  25638. },
  25639. pano1Position: {
  25640. type: "v3",
  25641. value: new n.Vector3
  25642. },
  25643. pano1Matrix: {
  25644. type: "m4",
  25645. value: new n.Matrix4
  25646. },
  25647. pano1Weight: {
  25648. type: "f",
  25649. value: r.transition.pano1Weight
  25650. },
  25651. pano2Map: {
  25652. type: "t",
  25653. value: null
  25654. },
  25655. pano2Depth: {
  25656. type: "t",
  25657. value: null
  25658. },
  25659. pano2Position: {
  25660. type: "v3",
  25661. value: new n.Vector3
  25662. },
  25663. pano2Matrix: {
  25664. type: "m4",
  25665. value: new n.Matrix4
  25666. },
  25667. pano2Weight: {
  25668. type: "f",
  25669. value: r.transition.pano2Weight
  25670. }
  25671. },
  25672. 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",
  25673. 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"
  25674. },
  25675. customDepth: {
  25676. uniforms: {
  25677. panoPosition: {
  25678. type: "v3",
  25679. value: new n.Vector3
  25680. }
  25681. },
  25682. 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",
  25683. 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"
  25684. },
  25685. skysphere: {
  25686. uniforms: {
  25687. radius: {
  25688. type: "f",
  25689. value: 0
  25690. }
  25691. },
  25692. 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",
  25693. 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"
  25694. },
  25695. tagDisc: {
  25696. uniforms: {
  25697. opacity: {
  25698. type: "f",
  25699. value: 0
  25700. },
  25701. color: {
  25702. type: "c",
  25703. value: new n.Color
  25704. },
  25705. bg: {
  25706. type: "t",
  25707. value: null
  25708. },
  25709. mask: {
  25710. type: "t",
  25711. value: null
  25712. }
  25713. },
  25714. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25715. 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"
  25716. }
  25717. }
  25718. window.shaders = t.exports;
  25719. }
  25720. , {
  25721. "./settings": 166,
  25722. three: 217
  25723. }],
  25724. 168: [function(E, _, e) {
  25725. (function(e) {
  25726. "use strict";
  25727. var t = E("three")
  25728. , i = (E("url"),
  25729. E("./util/ajax"))
  25730. , n = E("./settings")
  25731. , r = E("./util/logger")
  25732. , o = E("./util/math")
  25733. , a = E("./util/showcase")
  25734. , s = E("./objects/Panorama")
  25735. , l = new r(e)
  25736. , c = E("./model/Model")
  25737. , h = E("./shaders")
  25738. , u = E("./util/transitions")
  25739. , d = E("./objects/Chunk")
  25740. , p = E("./objects/Reticule")
  25741. , f = E("./objects/Skybox")
  25742. , g = E("./objects/Floor")
  25743. , m = E("./cameras/DollhouseCamera")
  25744. , v = E("./cameras/FloorplanCamera")
  25745. , y = E("./cameras/PanoramaCamera")
  25746. , A = E("./controls/DollhouseControls")
  25747. , C = E("./controls/FloorplanControls")
  25748. , I = E("./controls/PanoramaControls");
  25749. t.ImageUtils.crossOrigin = n.crossOrigin,
  25750. _.exports = {
  25751. shaders: h,
  25752. transitions: u,
  25753. Model: c,
  25754. Chunk: d,
  25755. Floor: g,
  25756. Skybox: f,
  25757. Reticule: p,
  25758. Panorama: s,
  25759. DollhouseCamera: m,
  25760. FloorplanCamera: v,
  25761. PanoramaCamera: y,
  25762. DollhouseControls: A,
  25763. FloorplanControls: C,
  25764. PanoramaControls: I,
  25765. getModel: function(e) {
  25766. if (!e.url)
  25767. throw 'getModel(): missing parameter "url"';
  25768. e.autoload = void 0 === e.autoload || e.autoload;
  25769. var t = a.parseSidUrl(e.url);
  25770. e.urlBase = t.urlBase,
  25771. e.urlModel = t.urlModel,
  25772. e.urlFiles = t.urlFiles;
  25773. var i = this._getPlatformError();
  25774. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25775. this._loadModel().then(this._buildModel.bind(this)))
  25776. },
  25777. _getPlatformError: function() {
  25778. 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"
  25779. },
  25780. _loadModel: function() {
  25781. return i.get(this.options.urlModel, {
  25782. responseType: "json",
  25783. prefetchFrom: "model",
  25784. auth: a.getAuthorizationHeader()
  25785. }).then(null, function() {
  25786. return l.warn("Model loading failed at initial metadata load"),
  25787. "loading-failed"
  25788. })
  25789. },
  25790. _buildModel: function(e) {
  25791. e = a.normalizeModeldata(e, o);
  25792. var t = new c(this.options,e);
  25793. return this.options.autoload ? t.load(!0) : $.when(t)
  25794. }
  25795. }
  25796. }
  25797. ).call(this, "/js/showcase.js")
  25798. }
  25799. , {
  25800. "./cameras/DollhouseCamera": 5,
  25801. "./cameras/FloorplanCamera": 6,
  25802. "./cameras/PanoramaCamera": 7,
  25803. "./controls/DollhouseControls": 10,
  25804. "./controls/FloorplanControls": 11,
  25805. "./controls/PanoramaControls": 13,
  25806. "./model/Model": 139,
  25807. "./objects/Chunk": 144,
  25808. "./objects/Floor": 146,
  25809. "./objects/Panorama": 148,
  25810. "./objects/Reticule": 149,
  25811. "./objects/Skybox": 152,
  25812. "./settings": 166,
  25813. "./shaders": 167,
  25814. "./util/ajax": 181,
  25815. "./util/logger": 189,
  25816. "./util/math": 190,
  25817. "./util/showcase": 193,
  25818. "./util/transitions": 195,
  25819. three: 217,
  25820. url: 208
  25821. }],
  25822. 169: [function(e, t, i) {
  25823. "use strict";
  25824. function l(e) {
  25825. var t = {
  25826. renderTarget: null,
  25827. inUse: !1,
  25828. size: -1,
  25829. pano: null
  25830. };
  25831. return t.inUse = !0,
  25832. t.size = e,
  25833. function(e) {
  25834. O.push(e)
  25835. }(t),
  25836. t
  25837. }
  25838. function c(e) {
  25839. for (var t = 0; t < O.length; t++) {
  25840. var i = O[t];
  25841. if (i.renderTarget === e)
  25842. return !(i.inUse = !1)
  25843. }
  25844. return !1
  25845. }
  25846. function n() {
  25847. this.tileDirectory = {},
  25848. this.activeRenderTargetDescriptors = {},
  25849. this.activePanos = [],
  25850. this.panoLODDescriptors = {},
  25851. this.panoDescriptors = {},
  25852. this.tileTrees = {},
  25853. this.sceneRenderer = null,
  25854. this.tileDownloader = null,
  25855. this.forceQueue = [],
  25856. this.uploadQueues = {},
  25857. this.uploadInterval = null,
  25858. this.uploadIntervalCancelled = !1,
  25859. this.usingTileOverlay = !1,
  25860. this.overlayTilesLoaded = !1,
  25861. this.overlayTileBase = null,
  25862. this.overlayTilesBasic = {},
  25863. this.overlayTilesEnhanced = {},
  25864. this.zoomRenderTarget = null,
  25865. this.zoomPano = null,
  25866. this.zoomingActive = !1,
  25867. this.zoomPanoId = null,
  25868. this.zoomPanoRenderingDisabled = !1,
  25869. this.direction = new _.Vector3,
  25870. this.initTime = -1,
  25871. this.maxBaseUploadsPerFrame = R,
  25872. this.maxNonBaseUploadsPerFrame = M
  25873. }
  25874. 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"),
  25875. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25876. e("../objects/Panorama"),
  25877. e("./TileTree")), y = (e("./TileDownloader"),
  25878. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25879. e("../util/browser"),
  25880. 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 = {
  25881. Base: 0,
  25882. Remaining: 1
  25883. }, O = [];
  25884. function L(e) {
  25885. var t = e.shift();
  25886. return t.uploadQueued = !1,
  25887. t
  25888. }
  25889. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25890. this.sceneRenderer = e,
  25891. this.tileDownloader = t,
  25892. this.qualityManager = i,
  25893. this.bindEvents(),
  25894. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25895. this.initTime = performance.now()
  25896. }
  25897. ,
  25898. n.prototype.getActivePanoTextures = function(e) {
  25899. e = e || [];
  25900. for (var t = 0; t < O.length; t++) {
  25901. var i = O[t];
  25902. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25903. }
  25904. }
  25905. ,
  25906. n.prototype.hasQueuedTiles = function() {
  25907. var e = this.peekNextFromUploadQueue();
  25908. return null != e
  25909. }
  25910. ,
  25911. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25912. return this.activeRenderTargetDescriptors[e]
  25913. }
  25914. ,
  25915. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25916. this.activeRenderTargetDescriptors[e] = t
  25917. }
  25918. ,
  25919. n.prototype.loadOverlayTiles = function() {
  25920. if (0 !== d.tiling.overlayStyle) {
  25921. var n = 0
  25922. , e = function(e, t, i) {
  25923. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25924. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25925. ++n === r.length && (this.overlayTilesLoaded = !0)
  25926. }
  25927. .bind(this)
  25928. , 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)]];
  25929. r.forEach(function(e) {
  25930. this.tileDownloader.loadImage(e[0], 0, e[1])
  25931. }
  25932. .bind(this)),
  25933. this.usingTileOverlay = !0
  25934. } else
  25935. this.usingTileOverlay = !1
  25936. }
  25937. ,
  25938. n.prototype.bindEvents = function() {
  25939. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25940. }
  25941. ,
  25942. n.prototype.setupZoomRenderTarget = function() {
  25943. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25944. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25945. return;
  25946. var e = this.zoomRenderTarget;
  25947. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25948. e) {
  25949. var t = e.width
  25950. , i = this.zoomRenderTarget.width;
  25951. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25952. e.texture.dispose(),
  25953. e.texture.loaded = !1,
  25954. e.texture.version = 0,
  25955. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25956. e.texture = null
  25957. }
  25958. this.zoomPanoRenderingDisabled = !1
  25959. } else
  25960. this.zoomPanoRenderingDisabled = !0
  25961. }
  25962. ,
  25963. n.prototype.enableUltraHighQualityMode = function(t) {
  25964. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25965. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25966. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25967. e && (this.qualityManager.enableUltraHighQualityMode(),
  25968. this.setupZoomRenderTarget(),
  25969. t())
  25970. }
  25971. .bind(this))
  25972. }
  25973. }
  25974. ,
  25975. n.prototype.activateTiledPano = function(e, t, i) {
  25976. i && this.clearAllQueuedUploads();
  25977. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25978. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25979. this.linkAllTilesAndNodes(e);
  25980. var r = this.getActiveRenderTargetDescriptor(e.id)
  25981. , o = t;
  25982. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25983. !r || o !== r.size) {
  25984. if (r && c(r.renderTarget),
  25985. !(r = function(e) {
  25986. for (var t = 0; t < O.length; t++) {
  25987. var i = O[t];
  25988. if (!i.inUse && i.size === e)
  25989. return i.inUse = !0,
  25990. i
  25991. }
  25992. return null
  25993. }(o))) {
  25994. var a = this.initTiledPano(o, !1);
  25995. (r = l(a.width)).renderTarget = a
  25996. }
  25997. r.pano = e,
  25998. this.resetPanoDescriptor(e.id),
  25999. this.resetPanoLODDescriptors(e.id),
  26000. this.resetRenderStatus(e.id, !0, !0)
  26001. }
  26002. this.setActiveRenderTargetDescriptor(e.id, r);
  26003. var s = i ? 0 : 1;
  26004. return this.updateActivePanos(e, s),
  26005. r.renderTarget
  26006. }
  26007. ,
  26008. n.prototype.deactivateTiledPano = function(e) {
  26009. var t = this.getActiveRenderTargetDescriptor(e.id);
  26010. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  26011. this.setActiveRenderTargetDescriptor(e.id, null);
  26012. var i = this.getUploadQueueForPano(e.id);
  26013. this.clearUploadQueue(i),
  26014. this.updateActivePanos()
  26015. }
  26016. ,
  26017. n.prototype.updateActivePanos = (s = [],
  26018. function(e, t) {
  26019. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  26020. e && s.length === t && s.push(e);
  26021. var n = this.activePanos[i]
  26022. , r = this.getActiveRenderTargetDescriptor(n.id);
  26023. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  26024. }
  26025. e && t >= s.length && s.push(e),
  26026. this.activePanos.length = 0,
  26027. this.activePanos.push.apply(this.activePanos, s)
  26028. }
  26029. ),
  26030. n.prototype.getActivePanoCount = function() {
  26031. return this.activePanos.length
  26032. }
  26033. ,
  26034. n.prototype.resetRenderStatus = function(e, r, o, t) {
  26035. var i = null;
  26036. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  26037. for (var n = function(e, t, i, n) {
  26038. o && (t.tile.zoomUploaded = !1),
  26039. r && (t.tile.uploaded = !1)
  26040. }, a = 0; a < A.FACES_PER_PANO; a++) {
  26041. this.getTileTree(e, a).breadthFirst({
  26042. callback: n.bind(this, a),
  26043. minLevel: i
  26044. })
  26045. }
  26046. }
  26047. ,
  26048. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  26049. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  26050. t.tile.zoomUploaded = t.tile.uploaded,
  26051. t.zoomCovered = t.covered
  26052. }, n = 0; n < A.FACES_PER_PANO; n++) {
  26053. this.getTileTree(e, n).breadthFirst({
  26054. callback: i.bind(this, n),
  26055. maxLevel: t
  26056. })
  26057. }
  26058. }
  26059. ,
  26060. n.prototype.renderPanoTiles = (h = [],
  26061. function(e, t, i, n) {
  26062. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  26063. t = t || this.direction || m.FORWARD;
  26064. var r = this.getActiveRenderTargetDescriptor(e);
  26065. if (!this.isRenderTargetDescriptorValid(r))
  26066. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  26067. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  26068. var a = this.getTileTree(e, o);
  26069. h.length = 0,
  26070. a.breadthFirst({
  26071. saveVisited: h
  26072. });
  26073. for (var s = 0; s < h.length; s++) {
  26074. var l = h[s];
  26075. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  26076. }
  26077. }
  26078. this.updateDirection(t)
  26079. }
  26080. ),
  26081. n.prototype.isRenderTargetDescriptorValid = function(e) {
  26082. return e && e.renderTarget
  26083. }
  26084. ,
  26085. n.prototype.isPanoActive = function(e) {
  26086. var t = this.getActiveRenderTargetDescriptor(e);
  26087. return this.isRenderTargetDescriptorValid(t)
  26088. }
  26089. ,
  26090. n.prototype.isPanoZoomed = function(e) {
  26091. return this.zoomingActive && this.zoomPanoId === e
  26092. }
  26093. ,
  26094. n.prototype.initTileTree = function(e, t, i) {
  26095. var n = this.tileTrees[e];
  26096. n || (n = [],
  26097. this.tileTrees[e] = n);
  26098. var r = n[t];
  26099. if (!r) {
  26100. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  26101. r = new v(A.TILE_SIZE,o),
  26102. n[t] = r
  26103. }
  26104. }
  26105. ,
  26106. n.prototype.getTileTree = function(e, t) {
  26107. var i = this.tileTrees[e];
  26108. if (!i)
  26109. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  26110. var n = i[t];
  26111. if (!n)
  26112. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  26113. return n
  26114. }
  26115. ,
  26116. n.prototype.initTiledPano = function(e, t) {
  26117. var i = this.sceneRenderer.renderer
  26118. , n = (i.context,
  26119. new _.WebGLRenderTargetCube(e,e,{
  26120. stencilBuffer: !1
  26121. }))
  26122. , r = new _.CubeTexture([]);
  26123. (n.texture = r).image = [null, null, null, null, null, null],
  26124. r.flipY = !0,
  26125. t ? (r.generateMipmaps = !0,
  26126. r.magFilter = _.LinearFilter,
  26127. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  26128. r.magFilter = _.LinearFilter,
  26129. r.minFilter = _.LinearFilter),
  26130. r.format = _.RGBAFormat,
  26131. i.setRenderTarget(n),
  26132. i.setRenderTarget(null);
  26133. var o = i.properties.get(r);
  26134. return o.__image__webglTextureCube = o.__webglTexture,
  26135. n
  26136. }
  26137. ,
  26138. n.prototype.getUploadQueueForPano = function(e) {
  26139. var t = this.uploadQueues[e];
  26140. return t || (t = [],
  26141. this.uploadQueues[e] = t),
  26142. t
  26143. }
  26144. ,
  26145. n.prototype.isTileUploaded = function(e) {
  26146. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  26147. }
  26148. ,
  26149. n.prototype.setUploaded = function(e, t) {
  26150. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  26151. }
  26152. ,
  26153. n.prototype.queueTileUpload = function(e, t, i) {
  26154. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  26155. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  26156. var r = this.getUploadQueueForPano(e.panoId);
  26157. 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),
  26158. e.uploadQueued = !0,
  26159. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  26160. }
  26161. }
  26162. ,
  26163. n.prototype.shoulPushToFrontOfQueue = function(e) {
  26164. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26165. }
  26166. ,
  26167. n.prototype.getTopUploadQueue = function() {
  26168. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  26169. for (var n = 0; n < this.activePanos.length; n++)
  26170. if (e = this.activePanos[n],
  26171. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  26172. switch (i) {
  26173. case P.Base:
  26174. if (0 === t[0].level)
  26175. return t;
  26176. break;
  26177. case P.Remaining:
  26178. return t
  26179. }
  26180. return null
  26181. }
  26182. ,
  26183. n.prototype.getNextFromUploadQueue = function() {
  26184. if (0 < this.forceQueue.length)
  26185. return L(this.forceQueue);
  26186. var e = this.getTopUploadQueue();
  26187. return e && 0 < e.length ? L(e) : null
  26188. }
  26189. ,
  26190. n.prototype.peekNextFromUploadQueue = function() {
  26191. if (0 < this.forceQueue.length)
  26192. return this.forceQueue[0];
  26193. var e = this.getTopUploadQueue();
  26194. return e && 0 < e.length ? e[0] : null
  26195. }
  26196. ,
  26197. n.prototype.clearAllQueuedUploads = function() {
  26198. this.clearAllUploadQueues(null, 0)
  26199. }
  26200. ,
  26201. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  26202. this.clearAllUploadQueues(e, 0)
  26203. }
  26204. ,
  26205. n.prototype.clearAllUploadQueues = function(e, t) {
  26206. if (e)
  26207. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  26208. this.clearUploadQueue(this.forceQueue, t, e);
  26209. else {
  26210. for (var i = 0; i < this.activePanos.length; i++) {
  26211. var n = this.activePanos[i];
  26212. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  26213. }
  26214. this.clearUploadQueue(this.forceQueue, t)
  26215. }
  26216. }
  26217. ,
  26218. n.prototype.clearUploadQueue = function(e, t, i) {
  26219. null != t || (t = 0);
  26220. for (var n = 0; n < e.length; ) {
  26221. var r = e[n];
  26222. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  26223. e.splice(n, 1)) : n++
  26224. }
  26225. }
  26226. ,
  26227. n.prototype.refreshUploadInterval = (a = null,
  26228. function(e) {
  26229. this.uploadIntervalCancelled || (a = a || function() {
  26230. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  26231. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26232. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26233. }
  26234. .bind(this),
  26235. null != e || (e = x),
  26236. T || (e = S),
  26237. this.uploadInterval = window.setTimeout(a, e),
  26238. this.uploadIntervalDelay = e)
  26239. }
  26240. ),
  26241. n.prototype.update = (r = performance.now(),
  26242. o = 0,
  26243. function() {
  26244. this.uploadIntervalCancelled = !0,
  26245. window.clearTimeout(this.uploadInterval),
  26246. this.uploadInterval = null;
  26247. var e = performance.now() - r;
  26248. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26249. r = performance.now()),
  26250. o++
  26251. }
  26252. ),
  26253. n.prototype.updateUploadQueue = function(e, t) {
  26254. e = e || 1;
  26255. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  26256. var r = this.getNextFromUploadQueue();
  26257. if (!r)
  26258. break;
  26259. if (0 !== r.level ? i++ : n++,
  26260. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  26261. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  26262. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26263. }
  26264. }
  26265. }
  26266. ,
  26267. n.prototype.updateDirection = function(e) {
  26268. if (e = e || this.direction) {
  26269. this.direction = e;
  26270. for (var t = 0; t < this.activePanos.length; t++) {
  26271. var i = this.activePanos[t]
  26272. , n = this.getUploadQueueForPano(i.id);
  26273. y.sortPanoTiles(n, i, this.direction)
  26274. }
  26275. }
  26276. }
  26277. ,
  26278. n.prototype.uploadTile = (I = {},
  26279. new _.Vector4,
  26280. E = d.tiling.overlayStyle,
  26281. function(e, t) {
  26282. var i = e.panoId
  26283. , n = e.image
  26284. , r = e.tileSize
  26285. , o = e.panoSize
  26286. , a = e.tileIndex
  26287. , s = (e.faceTileIndex,
  26288. e.totalTiles)
  26289. , l = (e.face,
  26290. e.tileX)
  26291. , c = e.tileY
  26292. , h = !0
  26293. , u = !1
  26294. , d = (this.getPanoDescriptor(i),
  26295. this.getPanoLODDescriptor(i, o))
  26296. , p = this.getActiveRenderTargetDescriptor(i)
  26297. , f = p.renderTarget
  26298. , g = p.size;
  26299. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  26300. g = this.qualityManager.getMaxZoomPanoSize()),
  26301. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  26302. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  26303. this.isTileUploaded(e) && (u = h = !1)),
  26304. h) {
  26305. var m = r / o * g
  26306. , v = l * r / o * g
  26307. , y = c * r / o * g;
  26308. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  26309. var A = I[r];
  26310. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  26311. 1 === E || 2 === E) {
  26312. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  26313. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  26314. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  26315. } else
  26316. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  26317. d.uploadCount++,
  26318. this.emit(b.TileRenderSuccess, i, o, a, s),
  26319. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  26320. this.setUploaded(e, !0),
  26321. this.addCoverageForNode(e.node)
  26322. } else
  26323. this.setUploaded(e, !1);
  26324. return e.uploadAttempted || (d.uploadAttempts++,
  26325. this.emit(b.TileUploadAttempted, i, o, a, s)),
  26326. e.uploadAttempted = !0,
  26327. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  26328. u
  26329. }
  26330. ),
  26331. n.prototype.linkTileAndNode = function(e, t) {
  26332. (t.tile = e).node = t
  26333. }
  26334. ,
  26335. n.prototype.linkAllTilesAndNodes = function(a) {
  26336. for (var e = function(e, t, i, n, r) {
  26337. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  26338. this.linkTileAndNode(o, i)
  26339. }, t = 0; t < A.FACES_PER_PANO; t++) {
  26340. var i = this.getTileTree(a.id, t);
  26341. i.breadthFirst({
  26342. callback: e.bind(this, i, t)
  26343. })
  26344. }
  26345. }
  26346. ,
  26347. n.prototype.anyUploaded = function(e) {
  26348. if (!e)
  26349. return !1;
  26350. if (e.tile && this.isTileUploaded(e.tile))
  26351. return !0;
  26352. if (e.children)
  26353. for (var t = 0; t < e.children.length; t++) {
  26354. var i = e.children[t];
  26355. if (this.anyUploaded(i))
  26356. return !0
  26357. }
  26358. return !1
  26359. }
  26360. ,
  26361. n.prototype.setNodeCovered = function(e, t) {
  26362. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  26363. }
  26364. ,
  26365. n.prototype.isNodeCovered = function(e) {
  26366. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26367. }
  26368. ,
  26369. n.prototype.addCoverageForNode = function(e) {
  26370. if (this.setNodeCovered(e, !0),
  26371. e.parent && e.covered) {
  26372. var t = e.parent;
  26373. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26374. }
  26375. }
  26376. ,
  26377. n.prototype.calcFullCoverage = function(e) {
  26378. var t = !1;
  26379. if (e.children)
  26380. for (var i = 0; i < e.children.length; i++) {
  26381. var n = e.children[i];
  26382. t = t || this.calcFullCoverage(n)
  26383. }
  26384. e.covered = e.tile.uploaded || t
  26385. }
  26386. ,
  26387. n.prototype.nodeSubcovered = function(e) {
  26388. if (!e.children)
  26389. return !1;
  26390. for (var t = 0; t < e.children.length; t++)
  26391. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  26392. return !1;
  26393. return !0
  26394. }
  26395. ,
  26396. n.prototype.resetPanoDescriptor = function(e) {
  26397. this.getPanoDescriptor(e)
  26398. }
  26399. ,
  26400. n.prototype.getPanoDescriptor = function(e) {
  26401. var t = this.panoDescriptors[e];
  26402. return t || (t = {},
  26403. this.panoDescriptors[e] = t),
  26404. t
  26405. }
  26406. ,
  26407. n.prototype.resetPanoLODDescriptors = function(e) {
  26408. var t = this.getPanoLODDescriptors(e);
  26409. for (var i in t)
  26410. if (t.hasOwnProperty(i)) {
  26411. var n = t[i];
  26412. n.uploadCount = 0,
  26413. n.uploadAttempts = 0
  26414. }
  26415. }
  26416. ,
  26417. n.prototype.getPanoLODDescriptor = function(e, t) {
  26418. var i = this.getPanoLODDescriptors(e)
  26419. , n = i[t];
  26420. return n || (n = {
  26421. uploadCount: 0,
  26422. uploadAttempts: 0
  26423. },
  26424. i[t] = n),
  26425. n
  26426. }
  26427. ,
  26428. n.prototype.getPanoLODDescriptors = function(e) {
  26429. var t = this.panoLODDescriptors[e];
  26430. return t || (t = {},
  26431. this.panoLODDescriptors[e] = t),
  26432. t
  26433. }
  26434. ,
  26435. n.prototype.onTileDownloaded = function(e) {
  26436. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26437. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  26438. if (i.downloaded = !0,
  26439. i.image = e.image,
  26440. i.panoSize = e.panoSize,
  26441. i.tileX = e.tileX,
  26442. i.tileY = e.tileY,
  26443. i.totalTiles = e.totalTiles,
  26444. i.tileIndex = e.tileIndex,
  26445. i.faceTileIndex = e.faceTileIndex,
  26446. i.face = e.face,
  26447. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26448. i.panoId = e.panoId,
  26449. i.tileSize = e.tileSize,
  26450. i.direction = (new _.Vector3).copy(e.direction),
  26451. i.node = null,
  26452. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26453. this.isPanoActive(i.panoId)) {
  26454. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26455. this.linkTileAndNode(i, n),
  26456. this.queueTileUpload(i, !0)
  26457. }
  26458. }
  26459. ,
  26460. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26461. var r = this.tileDirectory[e];
  26462. r || (r = {},
  26463. this.tileDirectory[e] = r);
  26464. var o = 16384 * t + 1024 * i + n
  26465. , a = r[o];
  26466. return a || (a = {
  26467. downloaded: !1,
  26468. uploaded: !1,
  26469. zoomUploaded: !1
  26470. },
  26471. r[o] = a),
  26472. a._key = e + ":" + t + ":" + i + ":" + n,
  26473. a._tileKey = o,
  26474. a
  26475. }
  26476. ,
  26477. n.prototype.setZoomingActive = function(e, t, i) {
  26478. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26479. this.zoomPanoId = t.id,
  26480. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26481. }
  26482. ,
  26483. n.prototype.updateZoomedPanoFromBase = function(e) {
  26484. if (!this.zoomPanoRenderingDisabled) {
  26485. var t = this.getActiveRenderTargetDescriptor(e.id);
  26486. if (t && t.renderTarget) {
  26487. var i = this.qualityManager.getMaxZoomPanoSize()
  26488. , n = t.renderTarget
  26489. , r = t.size;
  26490. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26491. this.copyBaseRenderStatusToZoomed(e.id)
  26492. }
  26493. }
  26494. }
  26495. ,
  26496. t.exports = n
  26497. }
  26498. , {
  26499. "../enum/GLCubeFaces": 25,
  26500. "../enum/PanoRendererEvents": 35,
  26501. "../enum/PanoSizeClass": 36,
  26502. "../enum/SceneRendererEvents": 43,
  26503. "../enum/TileDownloaderEvents": 45,
  26504. "../enum/Vectors": 50,
  26505. "../exception/BasicException": 55,
  26506. "../objects/Panorama": 148,
  26507. "../settings": 166,
  26508. "../util/browser": 182,
  26509. "../util/panorama": 191,
  26510. "./TileDownloader": 171,
  26511. "./TilePrioritizer": 172,
  26512. "./TileTree": 173,
  26513. "./TileUtils": 174,
  26514. events: 202,
  26515. three: 217
  26516. }],
  26517. 170: [function(e, t, i) {
  26518. "use strict";
  26519. function n(e, t, i) {
  26520. this.maxNavPanoSize = -1,
  26521. this.maxZoomPanoSize = -1,
  26522. this.devicePixelDensity = e,
  26523. this.deviceScreenSize = t,
  26524. this.clientBandwidth = i,
  26525. this.panoSizeClassMap = {},
  26526. this.useHighResolutionPanos = !0,
  26527. this.useUltraHighResolutionPanos = !1,
  26528. this.modelHasUltraHighPanos = !1
  26529. }
  26530. var r = e("../enum/PanoSizeClass")
  26531. , o = e("../settings")
  26532. , a = e("../util/browser")
  26533. , s = e("../constants")
  26534. , l = e("../util/showcase")
  26535. , c = e("../enum/ModelManagerEvents");
  26536. n.prototype.init = function(e) {
  26537. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26538. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26539. this.highSize = this.getPanoSize(r.HIGH),
  26540. this.standardSize = this.getPanoSize(r.STANDARD),
  26541. this.baseSize = this.getPanoSize(r.BASE),
  26542. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26543. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26544. this.updateMaximums(),
  26545. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26546. }
  26547. ,
  26548. n.prototype.updateFromModel = function(e) {
  26549. this.updateHighResolutionSettings(e),
  26550. this.updateUltraHighResolutionSettings(e)
  26551. }
  26552. ,
  26553. n.prototype.updateHighResolutionSettings = function(e) {
  26554. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26555. this.updateMaximums()
  26556. }
  26557. ,
  26558. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26559. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26560. this.updateMaximums()
  26561. }
  26562. ,
  26563. n.prototype.enableUltraHighQualityMode = function() {
  26564. this.modelHasUltraHighPanos = !0,
  26565. this.updateUltraHighResolutionSettings(null)
  26566. }
  26567. ,
  26568. n.prototype.ultraHighQualityModeEnabled = function() {
  26569. return this.modelHasUltraHighPanos
  26570. }
  26571. ,
  26572. n.prototype.onModelChanged = function(e) {
  26573. this.updateFromModel(e.model),
  26574. this.updateMaximums()
  26575. }
  26576. ,
  26577. n.prototype.updateMaximums = function() {
  26578. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26579. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26580. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26581. }
  26582. ,
  26583. n.prototype.buildPanoSizeClassMap = function() {
  26584. this.panoSizeClassMap[r.BASE] = 512,
  26585. this.panoSizeClassMap[r.STANDARD] = 1024,
  26586. this.panoSizeClassMap[r.HIGH] = 2048,
  26587. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26588. }
  26589. ,
  26590. n.prototype.getPanoSize = function(e) {
  26591. return this.panoSizeClassMap[e]
  26592. }
  26593. ,
  26594. n.prototype.getMaxPossiblePanoSize = function() {
  26595. return this.getPanoSize(r.ULTRAHIGH)
  26596. }
  26597. ,
  26598. n.prototype.getMaxPanoSize = function() {
  26599. return this.maxZoomPanoSize
  26600. }
  26601. ,
  26602. n.prototype.getMaxNavPanoSize = function() {
  26603. return this.maxNavPanoSize
  26604. }
  26605. ,
  26606. n.prototype.getMaxZoomPanoSize = function() {
  26607. return this.maxZoomPanoSize
  26608. }
  26609. ,
  26610. n.prototype.detectMaxNavPanoSizeClass = function() {
  26611. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26612. }
  26613. ,
  26614. n.prototype.detectMaxNavPanoSize = function() {
  26615. var e = this.detectMaxNavPanoSizeClass();
  26616. return this.getPanoSize(e)
  26617. }
  26618. ,
  26619. n.prototype.detectMaxZoomPanoSize = function() {
  26620. 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)
  26621. }
  26622. ,
  26623. t.exports = n
  26624. }
  26625. , {
  26626. "../constants": 8,
  26627. "../enum/ModelManagerEvents": 33,
  26628. "../enum/PanoSizeClass": 36,
  26629. "../settings": 166,
  26630. "../util/browser": 182,
  26631. "../util/showcase": 193
  26632. }],
  26633. 171: [function(A, C, e) {
  26634. (function(e) {
  26635. "use strict";
  26636. function i(e) {
  26637. this.panos = null,
  26638. this.retryMinimumTime = 1e4,
  26639. this.urls = null,
  26640. this.panoLoadCallbacks = {},
  26641. this.downloadDescriptors = {},
  26642. this.priorityQueue = [],
  26643. this.forceQueue = [],
  26644. this.activeDownloads = [],
  26645. this.qualityManager = null,
  26646. this.tilePrioritizer = null,
  26647. this.refreshInterval = null,
  26648. this.processPriorityQueue = !1,
  26649. this.concurrentDownloads = e.concurrentDownloads || 1,
  26650. this.downloadTestResults = {}
  26651. }
  26652. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26653. A("../settings")), r = (A("../objects/Panorama"),
  26654. A("../util/logger")), o = (A("../enum/Vectors"),
  26655. A("../enum/PanoSizeClass"),
  26656. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26657. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26658. Object.freeze({
  26659. Testing: 1,
  26660. Success: 2,
  26661. Fail: 3
  26662. }));
  26663. i.prototype = Object.create(l.prototype),
  26664. i.IDLE_REFRESH_DELAY = 500,
  26665. i.ACTIVE_REFRESH_DELAY = 16,
  26666. i.DOWNLOAD_RETRIES = 4,
  26667. i.prototype.init = function(e) {
  26668. this.qualityManager = e
  26669. }
  26670. ,
  26671. i.prototype.setUrls = function(e) {
  26672. this.urls = e
  26673. }
  26674. ,
  26675. i.prototype.setPanoData = function(e, t, i) {
  26676. this.panos = e,
  26677. this.imagePanos = t,
  26678. this.panoGroupId = i
  26679. }
  26680. ,
  26681. i.prototype.start = function() {
  26682. this.refreshUpdateInterval(0)
  26683. }
  26684. ,
  26685. i.prototype.stop = function() {
  26686. window.cancel(this.refreshInterval)
  26687. }
  26688. ,
  26689. i.prototype.refreshUpdateInterval = function(e) {
  26690. e = e || 0,
  26691. this.refreshInterval = window.setTimeout(function() {
  26692. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26693. }
  26694. .bind(this), e)
  26695. }
  26696. ,
  26697. i.prototype.update = function() {
  26698. var e = 0 < this.forceQueue.length;
  26699. return this.processQueueForDownloading(this.forceQueue),
  26700. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26701. 0 < this.priorityQueue.length && (e = !0),
  26702. this.processQueueForDownloading(this.priorityQueue)),
  26703. e
  26704. }
  26705. ,
  26706. i.prototype.forceQueueTilesForPano = (p = [],
  26707. f = [],
  26708. function(e, t, i, n, r, o) {
  26709. p.length = 0;
  26710. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26711. var l = a[s];
  26712. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26713. }
  26714. if (i && 0 < p.length) {
  26715. g.sortPanoTiles(p, e, i),
  26716. f.length = 0,
  26717. m.matchingTilesInDirection(e, t, i, n, r, f);
  26718. for (var c = 0, h = function(e) {
  26719. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26720. }; c < p.length; ) {
  26721. var u = p[c];
  26722. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26723. }
  26724. }
  26725. for (var d = 0; d < p.length; d++)
  26726. this.forceQueue.push(p[d]);
  26727. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26728. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26729. o && this.processQueueForDownloading(this.forceQueue, !0)
  26730. }
  26731. ),
  26732. i.prototype.clearForceQueue = function() {
  26733. this.clearQueue(this.forceQueue)
  26734. }
  26735. ,
  26736. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26737. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26738. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26739. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26740. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26741. }
  26742. ,
  26743. i.prototype.clearQueue = function(e) {
  26744. this.setStatusForAllDescriptors(e, v.None),
  26745. e.length = 0
  26746. }
  26747. ,
  26748. i.prototype.clearFromQueue = function(e, t, i) {
  26749. for (var n = 0; n < e.length; n++) {
  26750. var r = e[n];
  26751. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26752. }
  26753. }
  26754. ,
  26755. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26756. for (var i = 0; i < e.length; i++) {
  26757. var n = e[i];
  26758. n && (n.status = t)
  26759. }
  26760. }
  26761. ,
  26762. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26763. for (var i = 0; i < e.length; i++) {
  26764. var n = e[i];
  26765. n && (n.status !== t ? n.status = t : e[i] = null)
  26766. }
  26767. }
  26768. ,
  26769. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26770. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26771. , n = i[t];
  26772. return n || (n = this.buildDownloadDescriptorArray(t),
  26773. i[t] = n,
  26774. this.initTileDownloadDescriptors(n, e, t)),
  26775. n
  26776. }
  26777. ,
  26778. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26779. var t = this.downloadDescriptors[e.id];
  26780. return t || (t = {},
  26781. this.downloadDescriptors[e.id] = t),
  26782. t
  26783. }
  26784. ,
  26785. i.prototype.processQueueForDownloading = function(e, t) {
  26786. if (this.cleanupActiveDownloads(),
  26787. this.activeDownloads.length < this.concurrentDownloads || t)
  26788. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26789. var r = e.shift();
  26790. r && (this.startDownload(r),
  26791. n++)
  26792. }
  26793. }
  26794. ,
  26795. i.prototype.testDownload = function(t, e, i) {
  26796. var n = this.downloadTestResults[t];
  26797. if (n)
  26798. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26799. else {
  26800. this.downloadTestResults[t] = y.Testing;
  26801. var r = this.panos.list[0]
  26802. , o = this.getTileUrl(r.id, t, e, 0)
  26803. , a = function(e) {
  26804. this.downloadTestResults[t] = y.Success,
  26805. i(!0)
  26806. }
  26807. .bind(this)
  26808. , s = function() {
  26809. this.downloadTestResults[t] = y.Fail,
  26810. i(!1)
  26811. }
  26812. .bind(this);
  26813. this.loadImage(o, 0, a, s)
  26814. }
  26815. }
  26816. ,
  26817. i.prototype.startDownload = function(e) {
  26818. e.status = v.Downloading;
  26819. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26820. this.activeDownloads.push(e),
  26821. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26822. }
  26823. ,
  26824. i.prototype.downloadFailed = function(e, t) {}
  26825. ,
  26826. i.prototype.downloadComplete = function(e, t) {
  26827. if (e.panoGroupId === this.panoGroupId) {
  26828. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26829. e.status = v.Downloaded,
  26830. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26831. var n = {
  26832. panoId: e.pano.id,
  26833. image: t,
  26834. tileSize: e.tileSize,
  26835. panoSize: e.panoSize,
  26836. tileIndex: e.tileIndex,
  26837. faceTileIndex: e.faceTileIndex,
  26838. totalTiles: e.totalTiles,
  26839. face: e.face,
  26840. tileX: e.tileX,
  26841. tileY: e.tileY,
  26842. direction: e.direction
  26843. };
  26844. e.image = t,
  26845. this.emit(o.TileDownloadSuccess, n),
  26846. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26847. panoId: e.pano.id,
  26848. tileSize: e.tileSize,
  26849. panoSize: e.panoSize
  26850. },
  26851. this.emit(o.PanoDownloadComplete, n),
  26852. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26853. }
  26854. }
  26855. ,
  26856. i.prototype.cleanupActiveDownloads = (n = [],
  26857. function() {
  26858. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26859. var t = this.activeDownloads[e];
  26860. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26861. }
  26862. this.activeDownloads.length = 0,
  26863. this.activeDownloads.push.apply(this.activeDownloads, n)
  26864. }
  26865. ),
  26866. i.prototype.isPanoDownloaded = function(e, t) {
  26867. var i = this.getTileDownloadDescriptors(e, t);
  26868. if (i.length <= 0)
  26869. return !1;
  26870. for (var n = 0; n < i.length; n++) {
  26871. if (i[n].status !== v.Downloaded)
  26872. return !1
  26873. }
  26874. return !0
  26875. }
  26876. ,
  26877. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26878. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26879. this.panoLoadCallbacks[o] = {
  26880. onLoad: i,
  26881. onFail: n,
  26882. onProgress: r
  26883. }
  26884. }
  26885. ,
  26886. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26887. var i = e.id + ":" + t;
  26888. return this.panoLoadCallbacks[i]
  26889. }
  26890. ,
  26891. i.prototype.buildDownloadDescriptorArray = function(e) {
  26892. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26893. var r = this.buildDownloadDescriptor();
  26894. i.push(r)
  26895. }
  26896. return i
  26897. }
  26898. ,
  26899. i.prototype.buildDownloadDescriptor = function() {
  26900. return {
  26901. panoGroupId: null,
  26902. pano: null,
  26903. panoSize: -1,
  26904. tileSize: -1,
  26905. tileIndex: -1,
  26906. totalTiles: -1,
  26907. faceTileIndex: -1,
  26908. status: v.None,
  26909. url: null,
  26910. image: null,
  26911. direction: new t.Vector3,
  26912. face: -1,
  26913. cubeFace: -1,
  26914. tileX: -1,
  26915. tileY: -1
  26916. }
  26917. }
  26918. ,
  26919. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26920. for (var n = 0; n < e.length; n++) {
  26921. var r = e[n];
  26922. this.initTileDownloadDescriptor(r, t, i, n)
  26923. }
  26924. }
  26925. ,
  26926. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26927. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26928. e.face = m.getFaceForTile(i, n),
  26929. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26930. e.panoGroupId = this.panoGroupId,
  26931. e.pano = t,
  26932. e.panoSize = i,
  26933. e.tileSize = r,
  26934. e.tileIndex = n,
  26935. e.totalTiles = m.getTileCountForSize(i),
  26936. e.status = v.None,
  26937. e.image = null,
  26938. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26939. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26940. }
  26941. ,
  26942. i.prototype.getTileUrl = (c = {
  26943. 256: "256",
  26944. 512: "512",
  26945. 1024: "1k",
  26946. 2048: "2k",
  26947. 4096: "4k"
  26948. },
  26949. h = {
  26950. face: -1,
  26951. faceTileIndex: -1,
  26952. tileX: -1,
  26953. tileY: -1
  26954. },
  26955. function(e, t, i, n) {
  26956. m.getTileLocation(t, n, h);
  26957. var r = Math.floor(t / i)
  26958. , o = r * r
  26959. , a = Math.floor(n / o)
  26960. , s = "";
  26961. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26962. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26963. return d.changeIfTileGenerating(l)
  26964. }
  26965. ),
  26966. i.prototype.loadImage = function(e, t, i, n) {
  26967. s.getImage(e, t).then(function(e) {
  26968. i(e)
  26969. }).fail(n)
  26970. }
  26971. ,
  26972. C.exports = i
  26973. }
  26974. ).call(this, "/js/tile/TileDownloader.js")
  26975. }
  26976. , {
  26977. "../ab": 3,
  26978. "../enum/DownloadStatus": 24,
  26979. "../enum/GLCubeFaces": 25,
  26980. "../enum/PanoSizeClass": 36,
  26981. "../enum/TileDownloaderEvents": 45,
  26982. "../enum/Vectors": 50,
  26983. "../enum/Viewmode": 51,
  26984. "../objects/Panorama": 148,
  26985. "../settings": 166,
  26986. "../util/ajax": 181,
  26987. "../util/logger": 189,
  26988. "../util/panorama": 191,
  26989. "./TilePrioritizer": 172,
  26990. "./TileUtils": 174,
  26991. events: 202,
  26992. three: 217
  26993. }],
  26994. 172: [function(n, C, e) {
  26995. (function(e) {
  26996. "use strict";
  26997. function h(e, t, i, n, r) {
  26998. this.qualityManager = e,
  26999. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27000. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  27001. this.baseSize = t,
  27002. this.standardSize = i,
  27003. this.highSize = n,
  27004. this.ultraHighSize = r,
  27005. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  27006. }
  27007. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  27008. n("../settings"),
  27009. n("../settings"),
  27010. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  27011. n("../enum/PanoSizeClass"),
  27012. n("../enum/ModelManagerEvents"),
  27013. n("../enum/GLCubeFaces"),
  27014. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  27015. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  27016. new t(e),
  27017. Object.freeze({
  27018. None: 0,
  27019. DirectionalFOV: 1
  27020. }));
  27021. h.PriorityCriteria = function(e, t, i, n, r) {
  27022. this.pano = e,
  27023. this.cameraPosition = (new o.Vector3).copy(t),
  27024. this.cameraDir = (new o.Vector3).copy(i),
  27025. this.panoSpaceDir = (new o.Vector3).copy(n),
  27026. this.upcomingPanos = r,
  27027. this.copy = function(e) {
  27028. this.pano = e.pano,
  27029. this.cameraPosition.copy(e.cameraPosition),
  27030. this.cameraDir.copy(e.cameraDir),
  27031. this.panoSpaceDir.copy(e.panoSpaceDir),
  27032. this.upcomingPanos = r
  27033. }
  27034. ,
  27035. this.zoomingActive = !1
  27036. }
  27037. ,
  27038. h.DIRECTIONAL_FOV = 180,
  27039. h.DIRECTIONAL_FOV_NARROW = 120,
  27040. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  27041. h.MAX_SCORED_PANOS_TOADD = 2,
  27042. h.MAX_UPCOMING_PANOS_TOADD = 3,
  27043. h.DIRECTION_SCORE_STRICTNESS = .75,
  27044. h.appendQueue = function(e, t) {
  27045. if (e && t)
  27046. for (var i = 0; i < t.length; i++)
  27047. e.push(t[i])
  27048. }
  27049. ,
  27050. h.prototype.updateCriteria = function(e, t, i, n) {
  27051. this.priorityCriteria.pano = e,
  27052. this.priorityCriteria.cameraPosition.copy(t),
  27053. this.priorityCriteria.cameraDir.copy(i),
  27054. this.priorityCriteria.upcomingPanos = n,
  27055. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27056. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  27057. }
  27058. ,
  27059. h.prototype.filterAndPrioritize = (u = [],
  27060. p = [],
  27061. f = [],
  27062. function(e, t, i) {
  27063. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  27064. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  27065. var n = this.baseSize
  27066. , r = this.standardSize
  27067. , o = this.highSize
  27068. , a = this.ultraHighSize;
  27069. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  27070. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  27071. f.length = 0,
  27072. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  27073. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27074. h.appendQueue(e, f),
  27075. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  27076. f.length = 0,
  27077. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  27078. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  27079. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27080. h.appendQueue(e, f),
  27081. f.length = 0,
  27082. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27083. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27084. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27085. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27086. h.appendQueue(e, f),
  27087. this.queueTilesForPanos(e, u, i, n)
  27088. }
  27089. ),
  27090. h.prototype.canDownloadSize = function(e) {
  27091. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  27092. }
  27093. ,
  27094. h.prototype.populateNeighborPanos = function(e, t, i) {
  27095. (i = i || []).length = 0;
  27096. var n = t.getNeighbours(e);
  27097. for (var r in n)
  27098. if (n.hasOwnProperty(r)) {
  27099. var o = t.get(r);
  27100. i.push(o)
  27101. }
  27102. return i
  27103. }
  27104. ,
  27105. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  27106. (i = i || []).length = 0;
  27107. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  27108. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  27109. , s = t.sortByScore(o, a);
  27110. if (s)
  27111. for (var l = 0; l < s.length && l < r; l++) {
  27112. var c = s[l].pano;
  27113. i.push(c)
  27114. }
  27115. return i
  27116. }
  27117. ,
  27118. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  27119. for (var o = 0, a = 0; a < t.length; a++) {
  27120. var s = t[a];
  27121. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  27122. r && r <= o)
  27123. break
  27124. }
  27125. return o
  27126. }
  27127. ,
  27128. h.prototype.queueTilesForPano = (r = {
  27129. filter: a.None
  27130. },
  27131. function(e, t, i, n) {
  27132. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  27133. }
  27134. ),
  27135. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  27136. function(e, t, i, n, r, o, a, s) {
  27137. for (var l = 0, c = 0; c < i.length; c++) {
  27138. var h = i[c];
  27139. d.copy(h.position),
  27140. d.sub(r),
  27141. d.normalize();
  27142. var u = Math.max(Math.min(o.dot(d), 1), -1);
  27143. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  27144. s && s <= l))
  27145. break
  27146. }
  27147. return l
  27148. }
  27149. ),
  27150. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  27151. for (var l = 0, c = 0; c < i.length; c++) {
  27152. var h = i[c];
  27153. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  27154. s && s <= l)
  27155. break
  27156. }
  27157. return l
  27158. }
  27159. ,
  27160. h.prototype.queueTilesInDirectionForPano = (s = {
  27161. filter: a.DirectionalFOV,
  27162. direction: new o.Vector3,
  27163. fov: 60
  27164. },
  27165. l = new o.Vector3,
  27166. function(e, t, i, n, r, o, a) {
  27167. return l.copy(o),
  27168. m.getRelativeDirection(i.quaternion, l),
  27169. s.direction.copy(l),
  27170. s.fov = a,
  27171. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  27172. }
  27173. ),
  27174. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  27175. function(e, t, i, n, r) {
  27176. var o = t.getTileDownloadDescriptors(i, n);
  27177. c.length = 0,
  27178. this.filterTileDownloadDescriptors(i, o, c, r);
  27179. for (var a = 0, s = 0; s < c.length; s++) {
  27180. var l = c[s];
  27181. l && (e.push(l),
  27182. a++)
  27183. }
  27184. return a
  27185. }
  27186. ),
  27187. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  27188. function(e, t, i, n) {
  27189. var r, o;
  27190. switch (n.filter) {
  27191. case a.DirectionalFOV:
  27192. for (r = 0; r < t.length; r++)
  27193. o = t[r],
  27194. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  27195. break;
  27196. default:
  27197. for (r = 0; r < t.length; r++)
  27198. o = t[r],
  27199. i.push(o)
  27200. }
  27201. for (r = 0; r < i.length; r++)
  27202. o = i[r],
  27203. this.canIncludeDescriptor(o) || (i[r] = null)
  27204. }
  27205. ),
  27206. h.prototype.canIncludeDescriptor = function(e) {
  27207. return e.status !== i.Downloading && e.status !== i.Downloaded
  27208. }
  27209. ,
  27210. h.prototype.canIncludePano = function(e, t) {
  27211. return !e.isLoaded(t)
  27212. }
  27213. ,
  27214. h.getFOVDotThreshold = function(e) {
  27215. return Math.cos(o.Math.degToRad(e / 2))
  27216. }
  27217. ;
  27218. var y = (A._panoSpaceDir = new o.Vector3,
  27219. A._fovThreshold = -1,
  27220. A._fovThresholdNarrow = -1,
  27221. A);
  27222. function A(e, t) {
  27223. var i = A._panoSpaceDir
  27224. , n = A._fovThreshold
  27225. , r = A._fovThresholdNarrow
  27226. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  27227. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  27228. return e._dot = o,
  27229. t._dot = a,
  27230. 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)
  27231. }
  27232. h.sortPanoTiles = function(e, t, i) {
  27233. y._panoSpaceDir.copy(i),
  27234. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  27235. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27236. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  27237. e.sort(y)
  27238. }
  27239. ,
  27240. h.insertSortedPanoTile = function(e, t, i, n) {
  27241. y._panoSpaceDir.copy(n),
  27242. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  27243. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27244. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  27245. for (var r = -1, o = 0; o < e.length; o++) {
  27246. if (y(t, e[o]) <= 0) {
  27247. r = o;
  27248. break
  27249. }
  27250. }
  27251. if (-1 === r)
  27252. e[e.length] = t;
  27253. else {
  27254. for (var a = e.length; r < a; a--)
  27255. e[a] = e[a - 1];
  27256. e[r] = t
  27257. }
  27258. }
  27259. ,
  27260. h.prototype.setZoomingActive = function(e) {
  27261. e !== this.zoomingActive && (this.zoomingActive = e)
  27262. }
  27263. ,
  27264. C.exports = h
  27265. }
  27266. ).call(this, "/js/tile/TilePrioritizer.js")
  27267. }
  27268. , {
  27269. "../enum/DownloadStatus": 24,
  27270. "../enum/GLCubeFaces": 25,
  27271. "../enum/ModelManagerEvents": 33,
  27272. "../enum/PanoSizeClass": 36,
  27273. "../enum/Vectors": 50,
  27274. "../enum/Viewmode": 51,
  27275. "../objects/Panorama": 148,
  27276. "../settings": 166,
  27277. "../util/browser": 182,
  27278. "../util/logger": 189,
  27279. "../util/math": 190,
  27280. "./TileUtils": 174,
  27281. events: 202,
  27282. three: 217
  27283. }],
  27284. 173: [function(e, t, i) {
  27285. "use strict";
  27286. function f(e, t) {
  27287. this.levels = t,
  27288. this.tileSize = e,
  27289. this.root = null,
  27290. this.allNodes = [],
  27291. function(e) {
  27292. e.root = function e(t, i, n) {
  27293. if (n > t.levels)
  27294. return null;
  27295. var r = new a(t,i);
  27296. t.allNodes.push(r);
  27297. for (var o = 0; o < s; o++)
  27298. r.children[o] = e(t, r, n + 1);
  27299. return r
  27300. }(e, null, 0)
  27301. }(this)
  27302. }
  27303. function a(e, t) {
  27304. this.tree = e,
  27305. this.parent = t,
  27306. this.children = [],
  27307. this.id = ++n
  27308. }
  27309. var g = (e("three"),
  27310. e("./TileUtils"),
  27311. e("../objects/Panorama"),
  27312. e("../util/panorama"),
  27313. e("events").EventEmitter,
  27314. 2)
  27315. , s = g * g;
  27316. f.TraversalType = Object.freeze({
  27317. PreOrder: 0,
  27318. PostOrder: 1
  27319. });
  27320. var n = 0;
  27321. f.getLevelCountForSize = function(e, t) {
  27322. var i = 0;
  27323. for (t < e && (t = e); !((t /= g) < e); )
  27324. i++;
  27325. return i
  27326. }
  27327. ,
  27328. f.getSizeForLevel = function(e, t) {
  27329. return Math.pow(g, t) * e
  27330. }
  27331. ,
  27332. f.prototype.getSubNode = function(e, t, i) {
  27333. (!t || e < this.tileSize) && (t = 0),
  27334. (!i || e < this.tileSize) && (i = 0),
  27335. e < this.tileSize && (e = this.tileSize);
  27336. var n = f.getLevelCountForSize(this.tileSize, e);
  27337. return function e(t, i, n, r, o) {
  27338. if (!t)
  27339. return null;
  27340. if (0 === n)
  27341. return t;
  27342. if (!t.children || 0 === t.children.length)
  27343. return null;
  27344. var a = Math.pow(g, n) / g
  27345. , s = r % a
  27346. , l = o % a
  27347. , c = Math.floor(o / a)
  27348. , h = Math.floor(r / a)
  27349. , u = c * g + h;
  27350. return e(t.children[u], i + 1, n - 1, s, l)
  27351. }(this.root, 0, n, t, i)
  27352. }
  27353. ,
  27354. f.prototype.breadthFirst = function(e) {
  27355. var t = !!(e = e || {}).nullLevelEnd
  27356. , i = e.maxLevel
  27357. , n = e.minLevel
  27358. , r = e.callback
  27359. , o = e.saveVisited
  27360. , a = []
  27361. , s = {}
  27362. , l = 0;
  27363. for (a.push(this.root),
  27364. a.push(s); 0 < a.length && !(i && i < l); ) {
  27365. var c = a.shift();
  27366. if (c === s)
  27367. (!n || n <= l) && (r && t && r(null),
  27368. o && t && o.push(null)),
  27369. 0 < a.length && a.push(s),
  27370. l++,
  27371. 0;
  27372. else {
  27373. if (c.children)
  27374. for (var h = 0; h < c.children.length; h++) {
  27375. c.children[h] && a.push(c.children[h])
  27376. }
  27377. var u = this.getFaceIndexFromNode(c);
  27378. (!n || n <= l) && (r && r(c, l, u),
  27379. o && o.push(c)),
  27380. 0
  27381. }
  27382. }
  27383. }
  27384. ,
  27385. f.prototype.getFaceIndexFromNode = function(e) {
  27386. if (!e)
  27387. return -1;
  27388. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  27389. var o = i.parent;
  27390. if (!o)
  27391. break;
  27392. for (var a = -1, s = 0; s < o.children.length; s++)
  27393. o.children[s] === i && (a = s);
  27394. n = a % g * t + n,
  27395. r = Math.floor(a / g) * t + r,
  27396. t *= g,
  27397. i = o
  27398. }
  27399. return r * t + n
  27400. }
  27401. ,
  27402. f.prototype.depthFirst = function(e, t, i) {
  27403. !function e(t, i, n, r, o, a, s, l) {
  27404. if (t) {
  27405. s = s || f.TraversalType.PreOrder;
  27406. var c = r * g + n;
  27407. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  27408. a && a.push(t)),
  27409. t.children && 0 !== t.children.length) {
  27410. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  27411. for (var p = 0; p < g; p++)
  27412. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  27413. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  27414. a && a.push(t))
  27415. }
  27416. }
  27417. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27418. }
  27419. ,
  27420. t.exports = f
  27421. }
  27422. , {
  27423. "../objects/Panorama": 148,
  27424. "../util/panorama": 191,
  27425. "./TileUtils": 174,
  27426. events: 202,
  27427. three: 217
  27428. }],
  27429. 174: [function(e, t, i) {
  27430. "use strict";
  27431. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  27432. b.TILE_SIZE = 512,
  27433. b.FACES_PER_PANO = 6,
  27434. b.LocationOnTile = {
  27435. Center: 0,
  27436. UpperLeft: 1,
  27437. UpperRight: 2,
  27438. LowerRight: 3,
  27439. LowerLeft: 4
  27440. },
  27441. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  27442. var l = e / t
  27443. , c = t / e * 2
  27444. , h = c / 2
  27445. , u = n / l * 2 - 1 + h
  27446. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27447. switch (o = o || b.LocationOnTile.Center) {
  27448. case b.LocationOnTile.UpperLeft:
  27449. u -= h,
  27450. d += h,
  27451. u += a * c;
  27452. break;
  27453. case b.LocationOnTile.UpperRight:
  27454. u += h,
  27455. d += h,
  27456. d -= a * c;
  27457. break;
  27458. case b.LocationOnTile.LowerRight:
  27459. u += h,
  27460. d -= h,
  27461. u -= a * c;
  27462. break;
  27463. case b.LocationOnTile.LowerLeft:
  27464. u -= h,
  27465. d -= h,
  27466. d += a * c;
  27467. break;
  27468. case b.LocationOnTile.Center:
  27469. }
  27470. switch (i) {
  27471. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27472. _.setVector(s, -1, d, -u);
  27473. break;
  27474. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27475. _.setVector(s, 1, d, u);
  27476. break;
  27477. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27478. _.setVector(s, -u, 1, -d);
  27479. break;
  27480. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27481. _.setVector(s, -u, -1, d);
  27482. break;
  27483. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27484. _.setVector(s, -u, d, 1);
  27485. break;
  27486. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27487. _.setVector(s, u, d, -1)
  27488. }
  27489. _.normalize(s)
  27490. }
  27491. ,
  27492. b.getFaceForTile = function(e, t) {
  27493. var i = b.TILE_SIZE;
  27494. e < b.TILE_SIZE && (i = e);
  27495. var n = Math.floor(e / i)
  27496. , r = n * n;
  27497. return Math.floor(t / r)
  27498. }
  27499. ,
  27500. b.getTileLocation = function(e, t, i) {
  27501. var n = b.TILE_SIZE;
  27502. e < b.TILE_SIZE && (n = e);
  27503. var r = b.getFaceForTile(e, t)
  27504. , o = Math.floor(e / n)
  27505. , a = t - r * (o * o);
  27506. i.tileX = a % o,
  27507. i.tileY = Math.floor(a / o),
  27508. i.face = r,
  27509. i.faceTileIndex = a
  27510. }
  27511. ,
  27512. b.getTileCountForSize = function(e) {
  27513. if (e <= b.TILE_SIZE)
  27514. return b.FACES_PER_PANO;
  27515. var t = Math.floor(e / b.TILE_SIZE);
  27516. return t * t * b.FACES_PER_PANO
  27517. }
  27518. ,
  27519. b.getRelativeDirection = (r = new _.Matrix4,
  27520. o = new _.Quaternion,
  27521. function(e, t) {
  27522. o.copy(e),
  27523. o.inverse(),
  27524. r.makeRotationFromQuaternion(o),
  27525. r.applyToVector3(t),
  27526. _.normalize(t)
  27527. }
  27528. ),
  27529. b.matchingTilesInDirection = (c = new _.Vector3,
  27530. h = new _.Vector3(0,0,-1),
  27531. u = new _.Quaternion,
  27532. l = {
  27533. face: -1,
  27534. faceTileIndex: -1,
  27535. tileX: -1,
  27536. tileY: -1
  27537. },
  27538. d = function(e, t, i) {
  27539. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27540. b.getTileLocation(e, o, l),
  27541. t && !t(l) || (r++,
  27542. i && (a = l,
  27543. i.push({
  27544. face: a.face,
  27545. faceTileIndex: a.faceTileIndex,
  27546. tileX: a.tileX,
  27547. tileY: a.tileY
  27548. })));
  27549. var a;
  27550. return r
  27551. }
  27552. ,
  27553. function(e, t, i, n, r, o) {
  27554. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27555. if (b.getTileCountForSize(t),
  27556. !n && !r)
  27557. return d(t, null, o);
  27558. var s = !!r;
  27559. return r = r || n,
  27560. r = Math.max(0, Math.min(r, 360)),
  27561. n = Math.max(0, Math.min(n, 360)),
  27562. _.copyVector(i, c),
  27563. b.getRelativeDirection(e.quaternion, c),
  27564. s ? (u.setFromUnitVectors(c, h),
  27565. d(t, function(e) {
  27566. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27567. }, o)) : d(t, function(e) {
  27568. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27569. }, o)
  27570. }
  27571. ),
  27572. b.isTileWithinFrustum = (E = new _.Vector3,
  27573. function(e, t, i, n, r, o, a, s) {
  27574. 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++)
  27575. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27576. _.applyQuaternionToVector(o, E),
  27577. -1e-5 <= E.z)
  27578. ;
  27579. else {
  27580. var A = -1 / E.z
  27581. , C = E.x * A
  27582. , I = E.y * A;
  27583. l < I ? p++ : I < c && f++,
  27584. h < C ? g++ : C < u && m++,
  27585. v++
  27586. }
  27587. return f !== v && p !== v && g !== v && m !== v
  27588. }
  27589. ),
  27590. b.isTileWithinFOV = (p = new _.Vector3,
  27591. f = new _.Vector3(0,1,0),
  27592. g = new _.Vector3(1,0,0),
  27593. function(e, t, i, n, r, o, a) {
  27594. var s = b.mapFaceToCubemapFace(i);
  27595. if (_.cross(o, f, g),
  27596. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27597. b.isWithinFOV(p, o, a, null))
  27598. return !0;
  27599. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27600. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27601. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27602. b.isWithinFOV(p, o, a, null))
  27603. return !0;
  27604. h += l
  27605. }
  27606. return !1
  27607. }
  27608. ),
  27609. b.isWithinFOV = (a = new _.Vector3,
  27610. s = new _.Vector3,
  27611. function(e, t, i, n) {
  27612. if (_.copyVector(e, s),
  27613. n) {
  27614. _.copyVector(n, a),
  27615. _.normalize(a);
  27616. var r = _.dot(a, e);
  27617. a.x *= r,
  27618. a.y *= r,
  27619. a.z *= r,
  27620. _.subVector(s, a)
  27621. }
  27622. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27623. return Math.cos(o) <= _.dot(s, t)
  27624. }
  27625. ),
  27626. b.mapFaceToCubemapFace = (n = {
  27627. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27628. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27629. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27630. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27631. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27632. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27633. },
  27634. function(e) {
  27635. return n[e]
  27636. }
  27637. ),
  27638. t.exports = b
  27639. }
  27640. , {
  27641. "../enum/GLCubeFaces": 25,
  27642. "../util/MathLight": 176
  27643. }],
  27644. 175: [function(i, n, e) {
  27645. (function(e) {
  27646. "use strict";
  27647. function t() {
  27648. this.list = [],
  27649. this.index = {},
  27650. Object.defineProperty(this, "length", {
  27651. get: function() {
  27652. return this.list.length
  27653. }
  27654. })
  27655. }
  27656. new (i("./common"),
  27657. i("./logger"))(e),
  27658. t.prototype.forEach = function(e) {
  27659. this.list.forEach(e)
  27660. }
  27661. ,
  27662. t.prototype.add = function(e) {
  27663. this.list.push(e),
  27664. this.index[this.getIndex(e)] = e
  27665. }
  27666. ,
  27667. t.prototype.getIndex = function(e) {
  27668. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27669. }
  27670. ,
  27671. t.prototype.extend = function(e) {
  27672. for (var t = 0; t < e.length; t++)
  27673. this.add(e[t])
  27674. }
  27675. ,
  27676. t.prototype.get = function(e) {
  27677. return this.index[e]
  27678. }
  27679. ,
  27680. t.prototype.first = function() {
  27681. return this.list[0]
  27682. }
  27683. ,
  27684. t.prototype.last = function() {
  27685. return this.list[this.list.length - 1]
  27686. }
  27687. ,
  27688. t.prototype.reIndex = function() {
  27689. this.index = {};
  27690. var t = this;
  27691. this.forEach(function(e) {
  27692. t.index[t.getIndex(e)] = e
  27693. })
  27694. }
  27695. ,
  27696. t.prototype.filter = function(e) {
  27697. var t = this.list.filter(e);
  27698. return this.reIndex(),
  27699. t
  27700. }
  27701. ,
  27702. t.prototype.reduce = function(e, t) {
  27703. return this.list.reduce(e, t)
  27704. }
  27705. ,
  27706. t.prototype.sort = function(e) {
  27707. return this.list.sort(e)
  27708. }
  27709. ,
  27710. t.prototype.indexOf = function(e) {
  27711. for (var t = 0; t < this.list.length; ++t)
  27712. if (this.list[t] === e)
  27713. return t;
  27714. return -1
  27715. }
  27716. ,
  27717. n.exports = t
  27718. }
  27719. ).call(this, "/js/util/IndexedCollection.js")
  27720. }
  27721. , {
  27722. "./common": 185,
  27723. "./logger": 189
  27724. }],
  27725. 176: [function(e, t, i) {
  27726. "use strict";
  27727. e("../constants");
  27728. var n, r, o = {};
  27729. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27730. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27731. o.Vector3 = function(e, t, i) {
  27732. this.x = e || 0,
  27733. this.y = t || 0,
  27734. this.z = i || 0
  27735. }
  27736. ,
  27737. o.Matrix4 = function() {
  27738. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27739. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27740. }
  27741. ,
  27742. o.Matrix4.prototype = {
  27743. identity: function() {
  27744. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27745. this
  27746. },
  27747. copy: function(e) {
  27748. return this.elements.set(e.elements),
  27749. this
  27750. },
  27751. applyToVector3: function(e) {
  27752. var t = e.x
  27753. , i = e.y
  27754. , n = e.z
  27755. , r = this.elements;
  27756. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27757. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27758. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27759. this
  27760. },
  27761. getInverse: function(e, t) {
  27762. var i = this.elements
  27763. , n = e.elements
  27764. , r = n[0]
  27765. , o = n[1]
  27766. , a = n[2]
  27767. , s = n[3]
  27768. , l = n[4]
  27769. , c = n[5]
  27770. , h = n[6]
  27771. , u = n[7]
  27772. , d = n[8]
  27773. , p = n[9]
  27774. , f = n[10]
  27775. , g = n[11]
  27776. , m = n[12]
  27777. , v = n[13]
  27778. , y = n[14]
  27779. , A = n[15]
  27780. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27781. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27782. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27783. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27784. , b = r * C + o * I + a * E + s * _;
  27785. if (0 == b) {
  27786. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27787. if (t)
  27788. throw new Error(w);
  27789. return console.warn(w),
  27790. this.identity()
  27791. }
  27792. var T = 1 / b;
  27793. return i[0] = C * T,
  27794. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27795. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27796. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27797. i[4] = I * T,
  27798. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27799. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27800. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27801. i[8] = E * T,
  27802. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27803. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27804. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27805. i[12] = _ * T,
  27806. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27807. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27808. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27809. this
  27810. },
  27811. makeRotationFromQuaternion: function(e) {
  27812. var t = this.elements
  27813. , i = e.x
  27814. , n = e.y
  27815. , r = e.z
  27816. , o = e.w
  27817. , a = i + i
  27818. , s = n + n
  27819. , l = r + r
  27820. , c = i * a
  27821. , h = i * s
  27822. , u = i * l
  27823. , d = n * s
  27824. , p = n * l
  27825. , f = r * l
  27826. , g = o * a
  27827. , m = o * s
  27828. , v = o * l;
  27829. return t[0] = 1 - (d + f),
  27830. t[4] = h - v,
  27831. t[8] = u + m,
  27832. t[1] = h + v,
  27833. t[5] = 1 - (c + f),
  27834. t[9] = p - g,
  27835. t[2] = u - m,
  27836. t[6] = p + g,
  27837. t[10] = 1 - (c + d),
  27838. t[3] = 0,
  27839. t[7] = 0,
  27840. t[11] = 0,
  27841. t[12] = 0,
  27842. t[13] = 0,
  27843. t[14] = 0,
  27844. t[15] = 1,
  27845. this
  27846. }
  27847. },
  27848. o.Quaternion = function(e, t, i, n) {
  27849. this._x = e || 0,
  27850. this._y = t || 0,
  27851. this._z = i || 0,
  27852. this._w = void 0 !== n ? n : 1
  27853. }
  27854. ,
  27855. o.Quaternion.prototype = {
  27856. get x() {
  27857. return this._x
  27858. },
  27859. set x(e) {
  27860. this._x = e
  27861. },
  27862. get y() {
  27863. return this._y
  27864. },
  27865. set y(e) {
  27866. this._y = e
  27867. },
  27868. get z() {
  27869. return this._z
  27870. },
  27871. set z(e) {
  27872. this._z = e
  27873. },
  27874. get w() {
  27875. return this._w
  27876. },
  27877. set w(e) {
  27878. this._w = e
  27879. },
  27880. copy: function(e) {
  27881. this._x = e.x,
  27882. this._y = e.y,
  27883. this._z = e.z,
  27884. this._w = e.w
  27885. },
  27886. inverse: function() {
  27887. return this.conjugate().normalize()
  27888. },
  27889. conjugate: function() {
  27890. return this._x *= -1,
  27891. this._y *= -1,
  27892. this._z *= -1,
  27893. this
  27894. },
  27895. length: function() {
  27896. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27897. },
  27898. normalize: function() {
  27899. var e = this.length();
  27900. return 0 === e ? (this._x = 0,
  27901. this._y = 0,
  27902. this._z = 0,
  27903. this._w = 1) : (e = 1 / e,
  27904. this._x = this._x * e,
  27905. this._y = this._y * e,
  27906. this._z = this._z * e,
  27907. this._w = this._w * e),
  27908. this
  27909. },
  27910. setFromAxisAngle: function(e, t) {
  27911. var i = t / 2
  27912. , n = Math.sin(i);
  27913. return this._x = e.x * n,
  27914. this._y = e.y * n,
  27915. this._z = e.z * n,
  27916. this._w = Math.cos(i),
  27917. this
  27918. },
  27919. setFromUnitVectors: function(e, t) {
  27920. return void 0 === n && (n = new o.Vector3),
  27921. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27922. 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),
  27923. this._x = n.x,
  27924. this._y = n.y,
  27925. this._z = n.z,
  27926. this._w = r,
  27927. this.normalize()
  27928. },
  27929. multiply: function(e) {
  27930. return this.multiplyQuaternions(this, e)
  27931. },
  27932. premultiply: function(e) {
  27933. return this.multiplyQuaternions(e, this)
  27934. },
  27935. multiplyQuaternions: function(e, t) {
  27936. var i = e._x
  27937. , n = e._y
  27938. , r = e._z
  27939. , o = e._w
  27940. , a = t._x
  27941. , s = t._y
  27942. , l = t._z
  27943. , c = t._w;
  27944. return this._x = i * c + o * a + n * l - r * s,
  27945. this._y = n * c + o * s + r * a - i * l,
  27946. this._z = r * c + o * l + i * s - n * a,
  27947. this._w = o * c - i * a - n * s - r * l,
  27948. this
  27949. }
  27950. },
  27951. o.convertWorkshopVector = function(e) {
  27952. return new o.Vector3(-e.x,e.y,e.z)
  27953. }
  27954. ,
  27955. o.convertWorkshopQuaternion = function(e) {
  27956. 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))
  27957. }
  27958. ,
  27959. o.convertWorkshopOrthoZoom = function(e) {
  27960. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27961. }
  27962. ,
  27963. o.convertWorkshopPanoramaQuaternion = function(e) {
  27964. 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))
  27965. }
  27966. ,
  27967. o.normalize = function(e) {
  27968. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27969. , i = Math.sqrt(t);
  27970. e.x /= i,
  27971. e.y /= i,
  27972. e.z /= i
  27973. }
  27974. ,
  27975. o.dot = function(e, t) {
  27976. return e.x * t.x + e.y * t.y + e.z * t.z
  27977. }
  27978. ,
  27979. o.cross = function(e, t, i) {
  27980. var n = e.x
  27981. , r = e.y
  27982. , o = e.z;
  27983. i.x = r * t.z - o * t.y,
  27984. i.y = o * t.x - n * t.z,
  27985. i.z = n * t.y - r * t.x
  27986. }
  27987. ,
  27988. o.setVector = function(e, t, i, n) {
  27989. e.x = t,
  27990. e.y = i,
  27991. e.z = n
  27992. }
  27993. ,
  27994. o.copyVector = function(e, t) {
  27995. t.x = e.x,
  27996. t.y = e.y,
  27997. t.z = e.z
  27998. }
  27999. ,
  28000. o.addVector = function(e, t) {
  28001. e.x += t.x,
  28002. e.y += t.y,
  28003. e.z += t.z
  28004. }
  28005. ,
  28006. o.subVector = function(e, t) {
  28007. e.x -= t.x,
  28008. e.y -= t.y,
  28009. e.z -= t.z
  28010. }
  28011. ,
  28012. o.applyQuaternionToVector = function(e, t) {
  28013. var i = t.x
  28014. , n = t.y
  28015. , r = t.z
  28016. , o = e.x
  28017. , a = e.y
  28018. , s = e.z
  28019. , l = e.w
  28020. , c = l * i + a * r - s * n
  28021. , h = l * n + s * i - o * r
  28022. , u = l * r + o * n - a * i
  28023. , d = -o * i - a * n - s * r;
  28024. t.x = c * l + d * -o + h * -s - u * -a,
  28025. t.y = h * l + d * -a + u * -o - c * -s,
  28026. t.z = u * l + d * -s + c * -a - h * -o
  28027. }
  28028. ,
  28029. o.angleBetweenVectors = function(e, t) {
  28030. return Math.acos(o.dot(e, t))
  28031. }
  28032. ,
  28033. t.exports = o
  28034. }
  28035. , {
  28036. "../constants": 8
  28037. }],
  28038. 177: [function(c, h, e) {
  28039. (function(e) {
  28040. "use strict";
  28041. function t(e) {
  28042. this.cache = null,
  28043. this.expires = 0
  28044. }
  28045. function i() {
  28046. this.baseUrl = null,
  28047. this.cache = null,
  28048. this.expires = 0
  28049. }
  28050. function n() {
  28051. this.baseUrl = null,
  28052. this.expires = 0
  28053. }
  28054. function r(e) {
  28055. this.initialLoadingPromise = null,
  28056. this.endpoint = e + "?type=3",
  28057. this.urlContainer = null,
  28058. this.authorizationHeader = s.getAuthorizationHeader(),
  28059. this.containerClasses = [n, i, t]
  28060. }
  28061. c("./ajax");
  28062. var o = c("./logger")
  28063. , a = c("../constants")
  28064. , s = c("./showcase")
  28065. , l = (c("../ab"),
  28066. new o(e));
  28067. t.prototype = {
  28068. version: 1,
  28069. validate: function(e) {
  28070. return "catalog.json"in e && 0 < Object.keys(e).length
  28071. },
  28072. update: function(e) {
  28073. return this.cache = e,
  28074. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  28075. $.when()
  28076. },
  28077. get: function(e) {
  28078. return this.cache[e]
  28079. }
  28080. },
  28081. i.prototype = {
  28082. version: 2,
  28083. validate: function(e) {
  28084. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  28085. },
  28086. update: function(e) {
  28087. return this.baseUrl = e["base.url"],
  28088. this.cache = e,
  28089. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  28090. $.when()
  28091. },
  28092. get: function(e) {
  28093. var t = this.cache[e];
  28094. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  28095. }
  28096. },
  28097. n.prototype = {
  28098. version: 3,
  28099. validate: function(e) {
  28100. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  28101. },
  28102. update: function(e) {
  28103. return this.baseUrl = e.templates[0],
  28104. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  28105. $.when()
  28106. },
  28107. get: function(e) {
  28108. return this.baseUrl.replace("{{filename}}", e)
  28109. }
  28110. },
  28111. r.prototype = {
  28112. init: function() {
  28113. return this.initialLoadingPromise || (setInterval(function() {
  28114. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  28115. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  28116. this.refresh().done(function() {
  28117. l.debug("Refreshed")
  28118. }).fail(function() {
  28119. l.error("Failed url refresh, urls might go stale soon")
  28120. }))
  28121. }
  28122. .bind(this), a.signedUrlCheckInterval),
  28123. this.initialLoadingPromise = this.refresh()),
  28124. this.initialLoadingPromise
  28125. },
  28126. refresh: function(e) {
  28127. return {},
  28128. $.Deferred().resolve()
  28129. },
  28130. get: function(e) {
  28131. return window.DATA.files.templates[0].replace("{{filename}}", e)
  28132. }
  28133. },
  28134. h.exports = r
  28135. }
  28136. ).call(this, "/js/util/ModelUrls.js")
  28137. }
  28138. , {
  28139. "../ab": 3,
  28140. "../constants": 8,
  28141. "./ajax": 181,
  28142. "./logger": 189,
  28143. "./showcase": 193
  28144. }],
  28145. 178: [function(l, c, e) {
  28146. (function(e) {
  28147. "use strict";
  28148. function t() {
  28149. i.call(this),
  28150. this.neighbourMap = {},
  28151. this.map = null
  28152. }
  28153. 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"),
  28154. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  28155. n.inherit(t, i),
  28156. t.prototype.getIndex = function(e) {
  28157. return e.id
  28158. }
  28159. ,
  28160. t.prototype.find = function(e, t) {
  28161. var i = n.filterAll(this.list, e);
  28162. return 0 === i.length ? null : (t && t.forEach(function(e) {
  28163. i = n.stableSort(i, e)
  28164. }),
  28165. i[0])
  28166. }
  28167. ,
  28168. t.prototype.sortByScore = function(e, t) {
  28169. var i = n.filterAll(this.list, e);
  28170. return 0 === i.length ? null : i = i.map(function(i) {
  28171. return {
  28172. pano: i,
  28173. score: t.reduce(function(e, t) {
  28174. return e + t(i)
  28175. }, 0)
  28176. }
  28177. }).sort(function(e, t) {
  28178. return t.score - e.score
  28179. })
  28180. }
  28181. ,
  28182. t.prototype.lowestByScore = function(e, t, i) {
  28183. return this.findRankedByScore(0, e, t, i)
  28184. }
  28185. ,
  28186. t.prototype.findRankedByScore = function(e, t, i, n) {
  28187. n && (n.candidates = null,
  28188. n.pano = null),
  28189. e = e || 0;
  28190. var r = this.sortByScore(t, i);
  28191. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  28192. n.pano = r[e].pano),
  28193. r[e].pano)
  28194. }
  28195. ,
  28196. t.prototype.showPanoScores = function(e) {
  28197. this.list.forEach(function(e) {
  28198. e.removeTextSprite()
  28199. });
  28200. var t = 6344768;
  28201. e.forEach(function(e) {
  28202. e.pano.addTextSprite(e.score.toFixed(2), t),
  28203. t = 16428055
  28204. })
  28205. }
  28206. ,
  28207. t.prototype.isNeighbour = function(e, t) {
  28208. return this.neighbourMap[e.id][t.id]
  28209. }
  28210. ,
  28211. t.prototype.getNeighbours = function(e) {
  28212. return this.neighbourMap[e.id]
  28213. }
  28214. ,
  28215. t.prototype.setNeighbour = function(e, t, i) {
  28216. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  28217. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  28218. this.neighbourMap[e.id][e.id] = !0,
  28219. this.neighbourMap[t.id][t.id] = !0,
  28220. this.neighbourMap[e.id][t.id] = i,
  28221. this.neighbourMap[t.id][e.id] = i,
  28222. this.neighbourMap[e.id]
  28223. }
  28224. ,
  28225. t.prototype.findClosest = function(e, t) {
  28226. var i = [r.filters.isPanoAligned()];
  28227. return t && i.push(r.filters.inDirection(e, t, .75)),
  28228. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  28229. }
  28230. ,
  28231. t.prototype.dualNeighbors = function(e, t) {
  28232. var i, n = [];
  28233. for (i in this.neighbourMap[e.id])
  28234. this.neighbourMap[t.id][i] && n.push(i);
  28235. return n
  28236. }
  28237. ,
  28238. t.prototype.populate_path_graph = function() {
  28239. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  28240. for (e = 0; e < this.list.length; e += 1) {
  28241. for (t in s = !(a = {}),
  28242. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  28243. if (i[t]) {
  28244. o = this.index[t],
  28245. u.copy(r.floorPosition),
  28246. u.sub(o.floorPosition);
  28247. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  28248. , p = (Math.abs(u.y),
  28249. Math.max(d, .01),
  28250. Math.max(0, Math.abs(u.y) - .2));
  28251. n = 0 < p ? (1,
  28252. p = Math.pow(4 * p, 2),
  28253. d = Math.pow(d, 2),
  28254. Math.sqrt(p * p + d * d)) : (1,
  28255. u.length()),
  28256. a[o.id] = n,
  28257. s = !0
  28258. }
  28259. s ? c[r.id] = a : h += 1
  28260. }
  28261. this.map = c,
  28262. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  28263. }
  28264. ,
  28265. t.prototype.aStarSearch = function(e, t) {
  28266. var i = Date.now()
  28267. , n = new o({
  28268. start: e,
  28269. isEnd: function(e) {
  28270. return e === t
  28271. },
  28272. neighbor: function(e) {
  28273. var t = e.neighbourPanos || e.findNeighourPanos()
  28274. , i = [];
  28275. for (var n in t)
  28276. t[n] && i.push(this.index[n]); //add: t[n] &&
  28277. return i
  28278. }
  28279. .bind(this),
  28280. distance: function(e, t) {
  28281. return this.map[e.id][t.id]
  28282. }
  28283. .bind(this),
  28284. heuristic: function(e, t) {
  28285. return 1
  28286. }
  28287. .bind(this),
  28288. hash: function(e) {
  28289. return e.id
  28290. },
  28291. timeout: 5e3
  28292. });
  28293. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  28294. "success" !== n.status)
  28295. return T.debug("Did not find A* path from " + e + " to " + t),
  28296. null;
  28297. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  28298. var r = [];
  28299. return n.path.forEach(function(e) {
  28300. r.push(e.id)
  28301. }),
  28302. r
  28303. }
  28304. ,
  28305. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  28306. g = new w.Vector3,
  28307. m = new w.Vector3,
  28308. v = new w.Vector3,
  28309. y = new w.Vector3,
  28310. A = new w.Vector3,
  28311. C = new w.Vector3,
  28312. I = new w.Vector3,
  28313. E = [],
  28314. _ = new w.Vector3,
  28315. b = new w.Vector3,
  28316. function(e, t) {
  28317. if (e)
  28318. for (var i = function(e, t, i) {
  28319. return y.copy(t).sub(e),
  28320. y.dot(i)
  28321. }, n = function(e, t) {
  28322. return i(_, e.position, m) - i(_, t.position, m)
  28323. }, r = 0; r < e.length - 1; ) {
  28324. var o = e[r]
  28325. , a = e[r + 1]
  28326. , s = this.index[o]
  28327. , l = this.index[a];
  28328. _.copy(s.position),
  28329. b.copy(l.position),
  28330. E.length = 0,
  28331. f.copy(b).sub(_),
  28332. m.copy(f).normalize();
  28333. for (var c = 0; c < this.list.length; c++) {
  28334. var h = this.list[c];
  28335. y.copy(h.position).sub(_);
  28336. var u = y.dot(m);
  28337. 0 < u && (C.copy(m),
  28338. C.multiplyScalar(u),
  28339. A.copy(y),
  28340. A.sub(C),
  28341. A.length() < t && (g.copy(f).negate(),
  28342. v.copy(g).normalize(),
  28343. I.copy(h.position).sub(b),
  28344. 0 < I.dot(v) && E.push(h)))
  28345. }
  28346. if (0 < E.length) {
  28347. E.sort(n);
  28348. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  28349. e[d] = e[d - E.length];
  28350. for (var p = 0; p < E.length; p++)
  28351. e[p + r + 1] = E[p].id
  28352. }
  28353. r += E.length + 1
  28354. }
  28355. }
  28356. ),
  28357. t.prototype.fadeMarkerOpacity = function(e, t) {
  28358. var i = void 0 === e ? a.panorama.markerOpacity : e
  28359. , n = this.list.findIndex(function(e) {
  28360. return e.marker
  28361. });
  28362. if (!(n < 0)) {
  28363. var r = this.list[n].marker.material.opacity;
  28364. if (r !== e) {
  28365. var o = i - r;
  28366. s.trigger({
  28367. func: function(e, t) {
  28368. var i = r + e * o;
  28369. this.forEach(function(e) {
  28370. e.marker && (e.marker.material.opacity = i)
  28371. })
  28372. }
  28373. .bind(this),
  28374. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  28375. name: "_fpm"
  28376. })
  28377. }
  28378. }
  28379. }
  28380. ,
  28381. c.exports = t
  28382. }
  28383. ).call(this, "/js/util/PanoramaCollection.js")
  28384. }
  28385. , {
  28386. "../objects/Panorama": 148,
  28387. "../settings": 166,
  28388. "./IndexedCollection": 175,
  28389. "./aStar": 180,
  28390. "./common": 185,
  28391. "./logger": 189,
  28392. "./transitions": 195,
  28393. three: 217
  28394. }],
  28395. 179: [function(e, t, i) {
  28396. "use strict";
  28397. function n() {
  28398. this.actionSequence = [],
  28399. this.actionSequenceInProgress = !1
  28400. }
  28401. function r(e, t, i, n) {
  28402. c.trackAlways("zoom_" + e, {
  28403. from: t,
  28404. to: i,
  28405. pano: n
  28406. })
  28407. }
  28408. var o, a, s, l, c = e("../analytics");
  28409. n.prototype.reset = function(e) {
  28410. this.actionSequenceInProgress = !1,
  28411. this.actionSequence.length = 0
  28412. }
  28413. ,
  28414. n.prototype.addZoomAction = (a = o = null,
  28415. s = !1,
  28416. l = function() {
  28417. if (o = null,
  28418. 0 < this.actionSequence.length) {
  28419. var e = this.actionSequence[0].start
  28420. , t = this.actionSequence[this.actionSequence.length - 1].end;
  28421. 1 === e ? function(e, t) {
  28422. r("initial", 1, e, t)
  28423. }(t, a) : function(e, t, i) {
  28424. r("followup", e, t, i)
  28425. }(e, t, a)
  28426. }
  28427. this.reset()
  28428. }
  28429. ,
  28430. function(e, t, i) {
  28431. if (e !== t) {
  28432. s || (l = l.bind(this),
  28433. s = !0),
  28434. o && (window.clearTimeout(o),
  28435. o = null),
  28436. i === a && this.actionSequenceInProgress || (this.reset(),
  28437. a = i),
  28438. this.actionSequenceInProgress = !0;
  28439. var n = {
  28440. start: e,
  28441. end: t
  28442. };
  28443. this.actionSequence.push(n),
  28444. o = window.setTimeout(l, 150)
  28445. }
  28446. }
  28447. ),
  28448. t.exports = n
  28449. }
  28450. , {
  28451. "../analytics": 4
  28452. }],
  28453. 180: [function(e, t, i) {
  28454. "use strict";
  28455. function g(e) {
  28456. if (void 0 === e.parent)
  28457. return [e.data];
  28458. var t = g(e.parent);
  28459. return t.push(e.data),
  28460. t
  28461. }
  28462. function m(e) {
  28463. return e.toString()
  28464. }
  28465. function v(e, t) {
  28466. return e.f - t.f
  28467. }
  28468. var y = e("Set")
  28469. , A = e("heap")
  28470. , C = e("dict");
  28471. t.exports = function(e) {
  28472. void 0 === e.timeout && (e.timeout = 1 / 0);
  28473. var t = e.hash || m
  28474. , i = {
  28475. data: e.start,
  28476. g: 0,
  28477. h: e.heuristic(e.start)
  28478. }
  28479. , n = i;
  28480. i.f = i.h;
  28481. var r = new y
  28482. , o = new A(v)
  28483. , a = C();
  28484. o.push(i),
  28485. a.set(t(i.data), i);
  28486. for (var s = new Date; o.size(); ) {
  28487. if (new Date - s > e.timeout)
  28488. return {
  28489. status: "timeout",
  28490. cost: n.g,
  28491. path: g(n)
  28492. };
  28493. var l = o.pop();
  28494. if (a.delete(t(l.data)),
  28495. e.isEnd(l.data))
  28496. return {
  28497. status: "success",
  28498. cost: l.g,
  28499. path: g(l)
  28500. };
  28501. r.add(t(l.data));
  28502. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28503. var u = c[h];
  28504. if (!r.contains(t(u))) {
  28505. var d = l.g + e.distance(l.data, u)
  28506. , p = a.get(t(u))
  28507. , f = !1;
  28508. if (void 0 === p)
  28509. p = {
  28510. data: u
  28511. },
  28512. a.set(t(u), p);
  28513. else {
  28514. if (p.g < d)
  28515. continue;
  28516. f = !0
  28517. }
  28518. p.parent = l,
  28519. p.g = d,
  28520. p.h = e.heuristic(u),
  28521. p.f = d + p.h,
  28522. p.h < n.h && (n = p),
  28523. f ? o.heapify() : o.push(p)
  28524. }
  28525. }
  28526. }
  28527. return {
  28528. status: "noPath",
  28529. cost: n.g,
  28530. path: g(n)
  28531. }
  28532. }
  28533. }
  28534. , {
  28535. Set: 196,
  28536. dict: 210,
  28537. heap: 211
  28538. }],
  28539. 181: [function(i, n, e) {
  28540. (function(e) {
  28541. "use strict";
  28542. function s(e, t, i) {
  28543. function n() {
  28544. l.warn("Retrying ", t),
  28545. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28546. }
  28547. var r = function(e, t, i) {
  28548. var n = new XMLHttpRequest;
  28549. if (i && "withCredentials"in n)
  28550. n.open(e, t, i);
  28551. else if ("undefined" != typeof XDomainRequest)
  28552. (n = new XDomainRequest).open(e, t);
  28553. else {
  28554. if (i)
  28555. throw "Browser does not support CORS!";
  28556. n.open(e, t)
  28557. }
  28558. return n
  28559. }(e, t, !1);
  28560. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28561. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28562. i.responseType)
  28563. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28564. r.responseType = i.responseType;
  28565. else {
  28566. if ("image/jpeg" !== i.responseType)
  28567. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28568. r.responseType = "arraybuffer"
  28569. }
  28570. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28571. i.auth && r.setRequestHeader("Authorization", i.auth),
  28572. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28573. r.setRequestHeader("Content-Type", "application/json")),
  28574. "object" == typeof i.headers)
  28575. for (var o in i.headers)
  28576. r.setRequestHeader(o, i.headers[o]);
  28577. var a = $.Deferred();
  28578. return r.onreadystatechange = function(e) {
  28579. if (4 === this.readyState)
  28580. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28581. i.retries++,
  28582. setTimeout(n, 1e3);
  28583. else if (200 === this.status) {
  28584. var t = function(e, t) {
  28585. var i = e.response;
  28586. if ("json" === t && "object" != typeof i)
  28587. try {
  28588. i = JSON.parse(e.responseText)
  28589. } catch (e) {
  28590. return void a.reject({
  28591. error: "Failed parsing JSON"
  28592. })
  28593. }
  28594. else if ("image/jpeg" === t) {
  28595. var n = new Uint8Array(e.response)
  28596. , r = new Blob([n],{
  28597. type: "image/jpeg"
  28598. })
  28599. , o = URL.createObjectURL(r);
  28600. (i = new Image).src = o,
  28601. i.crossOrigin = "Anonymous",
  28602. i.onload = function() {
  28603. URL.revokeObjectURL(o)
  28604. }
  28605. }
  28606. return i
  28607. }(this, i.responseType);
  28608. a.resolve(t)
  28609. } else
  28610. a.reject(this)
  28611. }
  28612. ,
  28613. r.onprogress = function(e) {
  28614. a.notify(e)
  28615. }
  28616. ,
  28617. r.send(i.data),
  28618. a.promise()
  28619. }
  28620. function o(e, t) {
  28621. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28622. return t.headers && function(t) {
  28623. return Object.keys(t).sort().map(function(e) {
  28624. return {
  28625. key: e,
  28626. value: t[e]
  28627. }
  28628. })
  28629. }(t.headers).forEach(function(e) {
  28630. i += "__" + e.key + ":" + e.value
  28631. }),
  28632. i
  28633. }
  28634. var t = i("./logger")
  28635. , a = i("../ab")
  28636. , l = new t(e);
  28637. window.URL = window.URL || window.webkitURL,
  28638. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28639. window.DATA = window.DATA || {},
  28640. n.exports = {
  28641. get: function(e, t) {
  28642. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28643. if (n) {
  28644. var r = function(e, t) {
  28645. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28646. }(e, t);
  28647. if (r)
  28648. return r
  28649. }
  28650. return i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s("GET", e, t),
  28651. n && function(e, t, i) {
  28652. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28653. }(e, t, i),
  28654. i
  28655. },
  28656. post: function(e, t) {
  28657. return s("POST", e, t)
  28658. },
  28659. patch: function(e, t) {
  28660. return s("PATCH", e, t)
  28661. },
  28662. getImage: function(e, t) {
  28663. function i() {
  28664. l.warn("Retrying ", e),
  28665. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28666. }
  28667. var n = $.Deferred()
  28668. , r = new Image
  28669. , o = this;
  28670. return e = a.changeIfImageOptimzing(e),
  28671. null != t || (t = 3),
  28672. r.onerror = function() {
  28673. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28674. }
  28675. ,
  28676. r.onload = function() {
  28677. n.resolve(r)
  28678. }
  28679. ,
  28680. r.crossOrigin = "anonymous",
  28681. r.src = e,
  28682. n
  28683. }
  28684. }
  28685. }
  28686. ).call(this, "/js/util/ajax.js")
  28687. }
  28688. , {
  28689. "../ab": 3,
  28690. "./logger": 189
  28691. }],
  28692. 182: [function(e, t, i) {
  28693. "use strict";
  28694. function n(e, t) {
  28695. var i = window.navigator.userAgent.match(e);
  28696. return i = i ? i[1].split(t) : [],
  28697. {
  28698. major: parseInt(i[0]) || 0,
  28699. minor: parseInt(i[1]) || 0,
  28700. patch: parseInt(i[2]) || 0
  28701. }
  28702. }
  28703. var r = e("../exception/DeviceMismatchException");
  28704. window.browser = t.exports = {
  28705. isFullscreen: function() {
  28706. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28707. },
  28708. supportsFullscreen: function() {
  28709. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28710. },
  28711. isPointerLocked: function() {
  28712. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28713. },
  28714. requestFullscreen: function(e, t) {
  28715. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28716. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28717. },
  28718. requestPointerLock: function() {
  28719. var e;
  28720. if (document.fullscreenElement)
  28721. e = document.fullscreenElement();
  28722. else if (document.mozFullscreenElement)
  28723. e = document.mozFullscreenElement();
  28724. else if (document.mozFullScreenElement)
  28725. e = document.mozFullScreenElement();
  28726. else {
  28727. if (!document.webkitFullscreenElement)
  28728. return;
  28729. e = document.webkitFullscreenElement()
  28730. }
  28731. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28732. e.requestPointerLock(),
  28733. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28734. },
  28735. exitPointerLock: function() {
  28736. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28737. document.exitPointerLock()
  28738. },
  28739. exitFullscreen: function() {
  28740. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28741. },
  28742. details: function() {
  28743. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28744. return e ? {
  28745. name: e[1],
  28746. version: parseInt(e[2]),
  28747. platform: navigator.platform
  28748. } : {}
  28749. },
  28750. is: function(e) {
  28751. return this.details() && this.details().name === e
  28752. },
  28753. inIframe: function() {
  28754. return window.parent !== window
  28755. },
  28756. aspectRatio: function() {
  28757. var e = $("#player").width() / $("#player").height();
  28758. return isFinite(e) ? e : 0
  28759. },
  28760. userAgent: function() {
  28761. return window.navigator.userAgent
  28762. },
  28763. isMobile: function() {
  28764. var e = navigator.userAgent || navigator.vendor || window.opera;
  28765. 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))
  28766. },
  28767. isLandscape: function() {
  28768. return this.isMobile && 1 < this.aspectRatio()
  28769. },
  28770. isSmallScreen: function() {
  28771. return screen.width / window.devicePixelRatio < 240
  28772. },
  28773. detectIE: function() {
  28774. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28775. },
  28776. detectSafari: function() {
  28777. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28778. },
  28779. detectFirefox: function() {
  28780. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28781. },
  28782. detectChrome: function() {
  28783. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28784. },
  28785. detectOpera: function() {
  28786. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28787. },
  28788. detectIOS: function() {
  28789. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28790. },
  28791. detectIPad: function() {
  28792. var e = window.navigator.userAgent;
  28793. return /iPad/.test(e)
  28794. },
  28795. detectIPod: function() {
  28796. var e = window.navigator.userAgent;
  28797. return /iPod/.test(e)
  28798. },
  28799. detectIPhone: function() {
  28800. var e = window.navigator.userAgent;
  28801. return /iPhone/.test(e)
  28802. },
  28803. detectAndroid: function() {
  28804. return -1 !== window.navigator.userAgent.indexOf("Android")
  28805. },
  28806. detectAndroidMobile: function() {
  28807. var e = window.navigator.userAgent;
  28808. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28809. },
  28810. detectSamsungNative: function() {
  28811. var e = window.navigator.userAgent;
  28812. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28813. },
  28814. detectSamsungS6: function() {
  28815. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28816. },
  28817. detectHUAWEI5X: function() {
  28818. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28819. },
  28820. detectWebVR: function() {
  28821. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28822. },
  28823. getVRDisplay: function() {
  28824. var t = $.Deferred();
  28825. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28826. 1 <= e.length && t.resolve(e[0]),
  28827. t.reject(null)
  28828. }),
  28829. t) : t.reject(null)
  28830. },
  28831. iosVersion: function() {
  28832. if (!this.detectIOS())
  28833. throw new r("Did not detect an iDevice");
  28834. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28835. },
  28836. androidVersion: function() {
  28837. if (!this.detectAndroid())
  28838. throw new r("Did not detect an Android based device");
  28839. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28840. },
  28841. valueFromCookie: function(e, t) {
  28842. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28843. if (!i)
  28844. return t;
  28845. var n = i[1];
  28846. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28847. },
  28848. valueFromHash: function(e, t) {
  28849. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28850. if (!i)
  28851. return t;
  28852. var n = i[1];
  28853. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28854. }
  28855. }
  28856. }
  28857. , {
  28858. "../exception/DeviceMismatchException": 56
  28859. }],
  28860. 183: [function(i, n, e) {
  28861. (function(e) {
  28862. "use strict";
  28863. var o = i("../controls/serializer")
  28864. , a = i("../util/math")
  28865. , s = i("./browser")
  28866. , l = i("../enum/Viewmode")
  28867. , t = i("../util/logger")
  28868. , c = i("three")
  28869. , h = new t(e);
  28870. n.exports = {
  28871. getStartCameraOptions: function(e, t) {
  28872. var i = function(e) {
  28873. var t = s.valueFromHash("start", "")
  28874. , i = {};
  28875. if ("" !== t) {
  28876. h.debug("Start override found in parameters, trying to parse..."),
  28877. i = function(e) {
  28878. return o.deserialize(e)
  28879. }(t) || {};
  28880. var n = s.valueFromHash("tag", null);
  28881. n && (i.tag = n),
  28882. i.panoId && (i.pano = e.get(i.panoId))
  28883. }
  28884. return i
  28885. }(t);
  28886. if (0 < Object.keys(i).length)
  28887. return i;
  28888. if (e.heroImage)
  28889. i = function(e, t) {
  28890. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28891. return {};
  28892. var i = {}
  28893. , n = e.heroImage.metadata;
  28894. h.debug("Using start position from thumbnail image"),
  28895. i.position = n.camera_position,
  28896. i.quaternion = n.camera_quaternion;
  28897. try {
  28898. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28899. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28900. } catch (e) {
  28901. h.debug(e.message)
  28902. }
  28903. return i
  28904. }(e, t);
  28905. else if (window.DATA.camera_start) {
  28906. var n = window.DATA.camera_start;
  28907. try {
  28908. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28909. i.position = (new c.Vector3).fromArray(n.camera.position),
  28910. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28911. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28912. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28913. h.debug("Using camera_start"),
  28914. h.debug("Modeldata pano: ", i.pano.quaternion),
  28915. h.debug("Camera start pano: ", n.pano.quaternion)),
  28916. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28917. } catch (e) {
  28918. h.warn(e.message)
  28919. if(i.mode == "panorama" && !i.pano){
  28920. i.pano = t.list[0]
  28921. }
  28922. }
  28923. }
  28924. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28925. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28926. i.pano = t.findClosest(i.position) ,
  28927. i.quaternion = i.pano.quaternion),
  28928. 0 === Object.keys(i).length) {
  28929. var r = t.list[0];
  28930. r && (i.mode = l.PANORAMA,
  28931. i.pano = r,
  28932. i.position = r.position,
  28933. i.quaternion = r.quaternion,
  28934. h.info("Starting at 1st pano " + r.id))
  28935. }
  28936. return i.mode = i.mode || l.DOLLHOUSE,
  28937. i
  28938. }
  28939. }
  28940. }
  28941. ).call(this, "/js/util/camera.js")
  28942. }
  28943. , {
  28944. "../controls/serializer": 14,
  28945. "../enum/Viewmode": 51,
  28946. "../util/logger": 189,
  28947. "../util/math": 190,
  28948. "./browser": 182,
  28949. three: 217
  28950. }],
  28951. 184: [function(e, t, i) {
  28952. "use strict";
  28953. function r(e, t, i) {
  28954. var n = t
  28955. , r = i;
  28956. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28957. }
  28958. function o(e, t, i) {
  28959. var n = t
  28960. , r = i;
  28961. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28962. }
  28963. var a = e("./MathLight");
  28964. t.exports = {
  28965. clampVFOV: function(e, t, i, n) {
  28966. return t < r(e, i, n) ? o(t, i, n) : e
  28967. },
  28968. getHFOVForCamera: function(e, t, i) {
  28969. return r(e.fov, t, i)
  28970. },
  28971. getHFOVFromVFOV: r,
  28972. getVFOVFromHFOV: o
  28973. }
  28974. window.MathLight = t.exports
  28975. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  28976. var prec = Math.pow(10, - (precision || 4));
  28977. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28978. if(e1.w){
  28979. return s1 && Math.abs(e1.w - e2.w) < prec
  28980. }else return s1
  28981. }
  28982. }
  28983. , {
  28984. "./MathLight": 176
  28985. }],
  28986. 185: [function(e, t, i) {
  28987. "use strict";
  28988. var a = e("three");
  28989. t.exports = {
  28990. delayOneFrame: function(e) {
  28991. window.setTimeout(e, 1)
  28992. },
  28993. normalizeUrl: function(e) {
  28994. return e.replace("https://", "http://")
  28995. },
  28996. domainFromUrl: function(e) {
  28997. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28998. return t ? t[3] : e
  28999. },
  29000. average: function(e, t) {
  29001. if (0 === e.length)
  29002. return null;
  29003. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  29004. i += t ? e[r][t] : e[r],
  29005. n++
  29006. }
  29007. return i / n
  29008. },
  29009. countUnique: function(e) {
  29010. for (var t = {}, i = 0; i < e.length; i++)
  29011. t[e[i]] = 1 + (t[e[i]] || 0);
  29012. return Object.keys(t).length
  29013. },
  29014. averageVectors: function(e, t) {
  29015. var i = new a.Vector3;
  29016. if (0 === e.length)
  29017. return i;
  29018. for (var n = 0, r = 0; r < e.length; r++) {
  29019. var o = t ? e[r][t] : e[r];
  29020. i.add(o),
  29021. n++
  29022. }
  29023. return i.divideScalar(n)
  29024. },
  29025. equalLists: function(e, t) {
  29026. if (e.length !== t.length)
  29027. return !1;
  29028. for (var i = 0; i < e.length; i++)
  29029. if (e[i] !== t[i])
  29030. return !1;
  29031. return !0
  29032. },
  29033. lowerMedian: function(e, t) {
  29034. return 0 === e.length ? null : (t = t || 2,
  29035. e.sort(function(e, t) {
  29036. return e - t
  29037. }),
  29038. e[Math.floor(e.length / t)])
  29039. },
  29040. stableSort: function(e, n) {
  29041. return e.map(function(e, t) {
  29042. return {
  29043. value: e,
  29044. index: t
  29045. }
  29046. }).sort(function(e, t) {
  29047. var i = n(e.value, t.value);
  29048. return 0 !== i ? i : e.index - t.index
  29049. }).map(function(e) {
  29050. return e.value
  29051. })
  29052. },
  29053. filterAll: function(e, i) {
  29054. return e.filter(function(t) {
  29055. return i.every(function(e) {
  29056. return e(t)
  29057. })
  29058. })
  29059. },
  29060. formatDate: function(e) {
  29061. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  29062. },
  29063. formatDatetime: function(e) {
  29064. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  29065. },
  29066. randomString: function(e) {
  29067. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  29068. t += i.charAt(Math.floor(Math.random() * i.length));
  29069. return t
  29070. },
  29071. uint8ToBase64: function(e, t) {
  29072. t && "number" == typeof t || (t = 8192);
  29073. for (var i = [], n = 0; n < e.length; n += t)
  29074. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  29075. return btoa(i.join(""))
  29076. },
  29077. uuid4: function e(t) {
  29078. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  29079. },
  29080. nth: function(e) {
  29081. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  29082. },
  29083. extendObject: function(t, i) {
  29084. return Object.keys(i).forEach(function(e) {
  29085. t[e] = i[e]
  29086. }),
  29087. t
  29088. },
  29089. deepExtend: function e(t) {
  29090. t = t || {};
  29091. for (var i = 1; i < arguments.length; i++) {
  29092. var n = arguments[i];
  29093. if (n)
  29094. for (var r in n)
  29095. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  29096. }
  29097. return t
  29098. },
  29099. inherit: function(e, t) {
  29100. e.prototype = Object.create(t.prototype),
  29101. e.prototype.constructor = e
  29102. },
  29103. extend: function(e, t) {
  29104. for (var i in t.prototype)
  29105. e.prototype[i] = t.prototype[i]
  29106. },
  29107. getVisiblePano : function(positions = [], panos, options={}){//add
  29108. var visiblePanos = [];
  29109. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  29110. panos.forEach((pano)=>{
  29111. if(!pano.isAligned())return;
  29112. var A = pano.position.clone();
  29113. var posB = options.posAtPanos[pano.id] || positions;
  29114. var posLength = posB.length
  29115. for(let i=0;i<posLength;i++){
  29116. var B = posB[i];
  29117. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  29118. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  29119. if (!o || !o.length){ //只要有一点可见,就算整体可见
  29120. visiblePanos.push(pano.id);
  29121. break;
  29122. }
  29123. }
  29124. })
  29125. return visiblePanos
  29126. }
  29127. ,
  29128. sortByScore : function(list, request, rank) {
  29129. var i = this.filterAll(list, request);
  29130. return 0 === i.length ? null : i = i.map(function(e) {
  29131. return {
  29132. item: e,
  29133. score: rank.reduce(function(t, i) {
  29134. return t + i(e);
  29135. }, 0)
  29136. };
  29137. }).sort(function(e, t) {
  29138. return t.score - e.score;
  29139. });
  29140. }
  29141. },
  29142. Math.sign = function(e) {
  29143. return e < 0 ? -1 : 1
  29144. }
  29145. window.common = t.exports
  29146. }
  29147. , {
  29148. three: 217
  29149. }],
  29150. 186: [function(e, t, i) {
  29151. "use strict";
  29152. var r = {
  29153. linearTween: function(e, t, i, n) {
  29154. return i * e / n + t
  29155. },
  29156. easeInQuad: function(e, t, i, n) {
  29157. return i * (e /= n) * e + t
  29158. },
  29159. easeOutQuad: function(e, t, i, n) {
  29160. return -i * (e /= n) * (e - 2) + t
  29161. },
  29162. easeInOutQuad: function(e, t, i, n) {
  29163. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  29164. },
  29165. easeInCubic: function(e, t, i, n) {
  29166. return i * (e /= n) * e * e + t
  29167. },
  29168. easeOutCubic: function(e, t, i, n) {
  29169. return e /= n,
  29170. i * (--e * e * e + 1) + t
  29171. },
  29172. easeInOutCubic: function(e, t, i, n) {
  29173. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  29174. },
  29175. easeInQuart: function(e, t, i, n) {
  29176. return i * (e /= n) * e * e * e + t
  29177. },
  29178. easeOutQuart: function(e, t, i, n) {
  29179. return e /= n,
  29180. -i * (--e * e * e * e - 1) + t
  29181. },
  29182. easeInOutQuart: function(e, t, i, n) {
  29183. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  29184. },
  29185. easeInQuint: function(e, t, i, n) {
  29186. return i * (e /= n) * e * e * e * e + t
  29187. },
  29188. easeOutQuint: function(e, t, i, n) {
  29189. return e /= n,
  29190. i * (--e * e * e * e * e + 1) + t
  29191. },
  29192. easeInOutQuint: function(e, t, i, n) {
  29193. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  29194. },
  29195. easeInSine: function(e, t, i, n) {
  29196. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  29197. },
  29198. easeOutSine: function(e, t, i, n) {
  29199. return i * Math.sin(e / n * (Math.PI / 2)) + t
  29200. },
  29201. easeInOutSine: function(e, t, i, n) {
  29202. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  29203. },
  29204. easeInExpo: function(e, t, i, n) {
  29205. return i * Math.pow(2, 10 * (e / n - 1)) + t
  29206. },
  29207. easeOutExpo: function(e, t, i, n) {
  29208. return i * (1 - Math.pow(2, -10 * e / n)) + t
  29209. },
  29210. easeInOutExpo: function(e, t, i, n) {
  29211. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  29212. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  29213. },
  29214. easeInCirc: function(e, t, i, n) {
  29215. return e /= n,
  29216. -i * (Math.sqrt(1 - e * e) - 1) + t
  29217. },
  29218. easeOutCirc: function(e, t, i, n) {
  29219. return e /= n,
  29220. e--,
  29221. i * Math.sqrt(1 - e * e) + t
  29222. },
  29223. easeInOutCirc: function(e, t, i, n) {
  29224. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  29225. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  29226. },
  29227. easeInElastic: function(e, t, i, n) {
  29228. var r = 1.70158
  29229. , o = 0
  29230. , a = i;
  29231. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29232. r = a < Math.abs(i) ? (a = i,
  29233. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29234. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  29235. },
  29236. easeOutElastic: function(e, t, i, n) {
  29237. var r = 1.70158
  29238. , o = 0
  29239. , a = i;
  29240. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29241. r = a < Math.abs(i) ? (a = i,
  29242. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29243. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  29244. },
  29245. easeInOutElastic: function(e, t, i, n) {
  29246. var r = 1.70158
  29247. , o = 0
  29248. , a = i;
  29249. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  29250. r = a < Math.abs(i) ? (a = i,
  29251. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29252. 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)
  29253. },
  29254. easeInBack: function(e, t, i, n, r) {
  29255. return void 0 === r && (r = 1.70158),
  29256. i * (e /= n) * e * ((r + 1) * e - r) + t
  29257. },
  29258. easeOutBack: function(e, t, i, n, r) {
  29259. return void 0 === r && (r = 1.70158),
  29260. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  29261. },
  29262. easeInOutBack: function(e, t, i, n, r) {
  29263. return void 0 === r && (r = 1.70158),
  29264. (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
  29265. },
  29266. easeOutBounce: function(e, t, i, n) {
  29267. 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
  29268. },
  29269. easeInBounce: function(e, t, i, n) {
  29270. return i - r.easeOutBounce(n - e, 0, i, n) + t
  29271. },
  29272. easeInOutBounce: function(e, t, i, n) {
  29273. 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
  29274. }
  29275. };
  29276. window.easing = t.exports = r
  29277. }
  29278. , {}],
  29279. 187: [function(e, t, i) {
  29280. "use strict";
  29281. function n() {
  29282. this.events = [],
  29283. this.valid = !1
  29284. }
  29285. var r = e("../enum/Joystick");
  29286. n.prototype.push = function(e, t) {
  29287. this.events.push({
  29288. direction: e,
  29289. pano: t
  29290. }),
  29291. this.valid = !0
  29292. }
  29293. ,
  29294. n.prototype.pop = function(e) {
  29295. var t = this.events.pop();
  29296. return this.events.length < 1 && (this.valid = !1),
  29297. t
  29298. }
  29299. ,
  29300. n.prototype.peek = function() {
  29301. return this.events.length ? this.events[this.events.length - 1] : {
  29302. direction: null,
  29303. pano: null
  29304. }
  29305. }
  29306. ,
  29307. n.prototype.invalidate = function() {
  29308. this.events = [],
  29309. this.valid = !1
  29310. }
  29311. ,
  29312. n.prototype.reversePano = function(e) {
  29313. if (!this.valid)
  29314. return null;
  29315. var t = this.peek();
  29316. return r.opposite(e) === t.direction ? (this.pop(),
  29317. t.pano) : null
  29318. }
  29319. ,
  29320. t.exports = n
  29321. }
  29322. , {
  29323. "../enum/Joystick": 29
  29324. }],
  29325. 188: [function(e, t, i) {
  29326. "use strict";
  29327. t.exports = {
  29328. vector: function(t, i) {
  29329. var n = t.clone();
  29330. return i = i.clone(),
  29331. function(e) {
  29332. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  29333. }
  29334. },
  29335. quaternion: function(t, i) {
  29336. var n = t.clone();
  29337. return function(e) {
  29338. t.copy(n).slerp(i, e)
  29339. }
  29340. },
  29341. property: function(t, i, n, r) {
  29342. var o = t[i];
  29343. return function(e) {
  29344. t[i] = o * (1 - e) + n * e,
  29345. r && r(t[i])
  29346. }
  29347. },
  29348. uniform: function(t, i, n) {
  29349. var r = t.material.uniforms[i].value;
  29350. return function(e) {
  29351. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  29352. }
  29353. },
  29354. matrix4: function(o, a) {
  29355. var s = o.clone();
  29356. return function(e) {
  29357. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  29358. t[r] = i[r] * (1 - e) + n[r] * e
  29359. }
  29360. },
  29361. allUniforms: function(e, t, i) {
  29362. var n = e.map(function(e) {
  29363. return this.uniform(e, t, i)
  29364. }
  29365. .bind(this));
  29366. return function(t) {
  29367. n.forEach(function(e) {
  29368. e(t)
  29369. })
  29370. }
  29371. }
  29372. }
  29373. }
  29374. , {}],
  29375. 189: [function(e, t, i) {
  29376. "use strict";
  29377. function h(n) {
  29378. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  29379. if (h.consoleEnabled) {
  29380. var l = function(e) {
  29381. $("#debug-console").append("<p>" + e + "</p>"),
  29382. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  29383. };
  29384. e = function(e) {
  29385. l(Array.prototype.slice.call(arguments).join(" "))
  29386. }
  29387. ,
  29388. t = function(e) {
  29389. l(Array.prototype.slice.call(arguments).join(" "))
  29390. }
  29391. ,
  29392. i = function(e) {
  29393. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  29394. }
  29395. ,
  29396. r = function(e) {
  29397. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  29398. }
  29399. } else
  29400. console.log ? (e = console.log,
  29401. t = console.info ? console.info : console.log,
  29402. i = console.warn ? console.warn : console.log,
  29403. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  29404. ;
  29405. function c(e) {
  29406. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  29407. }
  29408. return {
  29409. debug: function() {
  29410. h.level >= h.levels.debug && e.apply(console, c(arguments))
  29411. },
  29412. info: function() {
  29413. h.level >= h.levels.info && t.apply(console, c(arguments))
  29414. },
  29415. warn: function() {
  29416. (function(e, t) {
  29417. if (u) {
  29418. var i = Array.prototype.slice.call(e).join(" ");
  29419. u.captureMessage(i, {
  29420. level: t,
  29421. path: n,
  29422. timestamp: h.timestamp()
  29423. })
  29424. }
  29425. }
  29426. )(arguments, "warn"),
  29427. h.level >= h.levels.warn && i.apply(console, c(arguments))
  29428. },
  29429. error: function() {
  29430. (function(e, t) {
  29431. if (u) {
  29432. var i = Array.prototype.slice.call(e).join(" ");
  29433. u.captureException(new Error(i), {
  29434. level: t,
  29435. path: n,
  29436. timestamp: h.timestamp()
  29437. })
  29438. }
  29439. }
  29440. )(arguments, "error"),
  29441. h.level >= h.levels.error && r.apply(console, c(arguments))
  29442. },
  29443. v3str: function(e, t) {
  29444. var i = void 0 === t ? 2 : t;
  29445. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29446. },
  29447. eulstr: function(e, t) {
  29448. var i = void 0 === t ? 2 : t;
  29449. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29450. },
  29451. time: function(e) {
  29452. h.level >= h.levels.debug && (s[e] = Date.now())
  29453. },
  29454. timeEnd: function(e) {
  29455. if (h.level >= h.levels.debug) {
  29456. var t = s[e];
  29457. if (!t)
  29458. return;
  29459. var i = (Date.now() - t) / 1e3;
  29460. this.debug(e, i + "s")
  29461. }
  29462. }
  29463. }
  29464. }
  29465. var u = window.Raven;
  29466. h.timestamp = function() {
  29467. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29468. }
  29469. ,
  29470. h.level = (h.levels = {
  29471. debug: 3,
  29472. info: 2,
  29473. warn: 1,
  29474. error: 0
  29475. }).info,
  29476. t.exports = h
  29477. }
  29478. , {}],
  29479. 190: [function(e, t, i) {
  29480. "use strict";
  29481. var o = e("three")
  29482. , r = e("../enum/GLCubeFaces");
  29483. e("../constants");
  29484. t.exports = {
  29485. convertVisionVector: function(e) {
  29486. return new o.Vector3(e.x,e.z,-e.y)
  29487. },
  29488. convertVisionQuaternion: function(e) {
  29489. 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)))
  29490. },
  29491. convertWorkshopVector: function(e) {
  29492. return new o.Vector3(-e.x,e.y,e.z)
  29493. },
  29494. convertWorkshopQuaternion: function(e) {
  29495. 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))
  29496. },
  29497. convertWorkshopPanoramaQuaternion: function(e) {
  29498. 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)))
  29499. },
  29500. convertWorkshopOrthoZoom: function(e) {
  29501. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29502. },
  29503. toPrecision: function(e, t) {
  29504. function i(e, t) {
  29505. var i = Math.pow(10, t);
  29506. return Math.round(e * i) / i
  29507. }
  29508. if (e instanceof Array) {
  29509. for (var n = 0; n < e.length; n++)
  29510. e[n] = i(e[n], t);
  29511. return e
  29512. }
  29513. return i(e, t)
  29514. },
  29515. isEmptyQuaternion: function(e) {
  29516. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29517. },
  29518. projectPositionToCanvas: function(e, t, i) {
  29519. (i = i || new o.Vector3).copy(e);
  29520. var n = .5 * $("#player").width()
  29521. , r = .5 * $("#player").height();
  29522. return i.project(t),
  29523. i.x = i.x * n + n,
  29524. i.y = -i.y * r + r,
  29525. i
  29526. },
  29527. convertScreenPositionToNDC: function(e, t, i) {
  29528. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29529. i.y = -t / $("#player").height() * 2 + 1,
  29530. i
  29531. },
  29532. constrainedTurn: function(e) {
  29533. var t = e % (2 * Math.PI);
  29534. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29535. },
  29536. getFOVDotThreshold: function(e) {
  29537. return Math.cos(o.Math.degToRad(e / 2))
  29538. },
  29539. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29540. switch (e) {
  29541. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29542. i.set(1, t.y, t.x);
  29543. break;
  29544. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29545. i.set(-1, t.y, -t.x);
  29546. break;
  29547. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29548. i.set(-t.x, 1, -t.y);
  29549. break;
  29550. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29551. i.set(-t.x, -1, t.y);
  29552. break;
  29553. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29554. i.set(-t.x, t.y, 1);
  29555. break;
  29556. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29557. i.set(t.x, t.y, -1)
  29558. }
  29559. n && i.normalize()
  29560. },
  29561. //add:
  29562. getPos2d : function(point, camera, dom){
  29563. var camera = camera ;
  29564. var dom = dom;
  29565. 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);
  29566. var x,y;
  29567. x = (pos.x + 1) / 2 * dom.clientWidth;
  29568. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29569. var inSight = x <= dom.clientWidth && x >= 0
  29570. && y <= dom.clientHeight && y >= 0
  29571. return {
  29572. pos: new THREE.Vector2(x,y),
  29573. vector: pos,
  29574. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29575. inSight : inSight //在屏幕范围内可见
  29576. };
  29577. },
  29578. getDirByLonLat: function(lon, lat) {
  29579. var dir = new THREE.Vector3();
  29580. var phi = THREE.Math.degToRad(90 - lat);
  29581. var theta = THREE.Math.degToRad(lon);
  29582. dir.x = Math.sin(phi) * Math.cos(theta);
  29583. dir.y = Math.cos(phi);
  29584. dir.z = Math.sin(phi) * Math.sin(theta);
  29585. return dir.negate();
  29586. }
  29587. }
  29588. window.math = t.exports
  29589. }
  29590. , {
  29591. "../constants": 8,
  29592. "../enum/GLCubeFaces": 25,
  29593. three: 217
  29594. }],
  29595. 191: [function(e, t, i) {
  29596. "use strict";
  29597. function o(e) {
  29598. return r[e]
  29599. }
  29600. var n = e("../enum/GLCubeFaces")
  29601. , a = [0, 1, 2, 3, 4, 5]
  29602. , r = {
  29603. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29604. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29605. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29606. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29607. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29608. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29609. };
  29610. t.exports = {
  29611. mapFaceToCubemapFace: o,
  29612. getCubemapUrls: function(i, n, r) {
  29613. return a.map(function(e, t) {
  29614. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29615. }
  29616. .bind(this))
  29617. }
  29618. }
  29619. }
  29620. , {
  29621. "../enum/GLCubeFaces": 25
  29622. }],
  29623. 192: [function(e, t, i) {
  29624. "use strict";
  29625. t.exports = {
  29626. captureErrors: function(e, t, i) {
  29627. if ("Raven"in window) {
  29628. Raven.config(e, t).install(),
  29629. i && Raven.setTagsContext(i);
  29630. var n = console.warn
  29631. , r = console.error;
  29632. console.warn = function() {
  29633. var e = Array.prototype.slice.call(arguments);
  29634. Raven.captureMessage(e.join(" "), {
  29635. level: "warning"
  29636. }),
  29637. n.apply(console, e)
  29638. }
  29639. ,
  29640. console.error = function() {
  29641. var e = Array.prototype.slice.call(arguments);
  29642. Raven.captureException(new Error(e.join(" ")), {
  29643. level: "error"
  29644. }),
  29645. r.apply(console, e)
  29646. }
  29647. } else
  29648. console.error("Raven not found, not capturing errors.")
  29649. }
  29650. }
  29651. }
  29652. , {}],
  29653. 193: [function(c, h, e) {
  29654. (function(e) {
  29655. "use strict";
  29656. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29657. getAuthorizationHeader: function() {
  29658. var e = n.valueFromHash("auth");
  29659. if (e)
  29660. return e.replace(",", " ");
  29661. var t = n.valueFromCookie("token");
  29662. return t ? "Token " + t : null
  29663. },
  29664. parseSidUrl: function(e) {
  29665. var t, i;
  29666. if (t = g_Prefix,
  29667. (e = e || "").match(/^https?/)) {
  29668. o.parse(e);
  29669. t = g_Prefix,
  29670. i = e
  29671. } else
  29672. i = (t = g_Prefix) + "data/" + e;
  29673. return {
  29674. urlBase: t,
  29675. urlModel: i,
  29676. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29677. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29678. }
  29679. },
  29680. getModelIDFromQueryString: function() {
  29681. return n.valueFromHash("model") || n.valueFromHash("m")
  29682. },
  29683. /* normalizeModeldata: function(e, i) {
  29684. e = JSON.parse(JSON.stringify(e));
  29685. var n = null;
  29686. if (e.images.forEach(function(t) {
  29687. if (t.metadata) {
  29688. if ("string" == typeof t.metadata)
  29689. try {
  29690. t.metadata = JSON.parse(t.metadata)
  29691. } catch (e) {
  29692. s.warn("Unable to parse image metadata"),
  29693. t.metadata = null
  29694. }
  29695. else
  29696. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29697. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29698. 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)),
  29699. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29700. t.metadata.zoom = t.metadata.zoom || 1),
  29701. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29702. }
  29703. }),
  29704. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29705. var t = {};
  29706. t.pano = {
  29707. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29708. position: i.convertWorkshopVector(n.scan_position),
  29709. uuid: n.scan_id
  29710. },
  29711. t.camera = {
  29712. quaternion: n.camera_quaternion,
  29713. position: n.camera_position
  29714. },
  29715. e.startPano = t
  29716. }
  29717. return e
  29718. }, */
  29719. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29720. e = JSON.parse(JSON.stringify(e));
  29721. var i = null;
  29722. var deal = function(n) {
  29723. if(!n.metadata) return;
  29724. if ("string" == typeof n.metadata)
  29725. try {
  29726. n.metadata = JSON.parse(n.metadata)
  29727. } catch (e) {
  29728. s.warn("Unable to parse image metadata"),
  29729. n.metadata = null
  29730. }
  29731. else{
  29732. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29733. }
  29734. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29735. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29736. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29737. }else{
  29738. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29739. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29740. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29741. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29742. }
  29743. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29744. }
  29745. //改
  29746. e.images.forEach(info=>{
  29747. if(info.locations){
  29748. info.locations.forEach(a=>deal(a))
  29749. }else{
  29750. deal(info)
  29751. }
  29752. })
  29753. //icon初始视角的:
  29754. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29755. var n = {};
  29756. n.pano = {
  29757. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29758. position: t.convertWorkshopVector(i.scan_position),
  29759. uuid: i.scan_id
  29760. },
  29761. n.camera = {
  29762. quaternion: i.camera_quaternion,
  29763. position: i.camera_position
  29764. },
  29765. e.startPano = n
  29766. }
  29767. return e
  29768. },
  29769. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29770. function(e) {
  29771. if (!e)
  29772. throw new Error("Vision version is required");
  29773. var t = i.exec(e);
  29774. if (null === t)
  29775. throw new Error("String is not a vision version: " + e);
  29776. return parseInt(t[1])
  29777. }
  29778. ),
  29779. modelDataPromisesTiles: function(e) {
  29780. var t = e.vision_version || window.DATA.vision_version;
  29781. if (t)
  29782. try {
  29783. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29784. } catch (e) {
  29785. s.warn("Invalid vision version: " + t)
  29786. }
  29787. return !1
  29788. }
  29789. };
  29790. h.exports = l
  29791. }
  29792. ).call(this, "/js/util/showcase.js")
  29793. }
  29794. , {
  29795. "../constants": 8,
  29796. "./browser": 182,
  29797. "./logger": 189,
  29798. three: 217,
  29799. url: 208
  29800. }],
  29801. 194: [function(e, t, i) {
  29802. "use strict";
  29803. var r = e("../util/ajax")
  29804. , o = e("three")
  29805. , a = e("../settings")
  29806. , s = {};
  29807. t.exports = {
  29808. load: function(e, t, i) {
  29809. var n = s[e];
  29810. return n ? t && setTimeout(function() {
  29811. t(n)
  29812. }, 1) : (n = new o.Texture,
  29813. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29814. n.magFilter = o.LinearFilter,
  29815. n.generateMipmaps = !1),
  29816. n.sourceFile = e,
  29817. s[e] = n,
  29818. r.getImage(e).then(function(e) {
  29819. n.image = e,
  29820. n.needsUpdate = !0,
  29821. t && t(n)
  29822. }).fail(i)),
  29823. n
  29824. },
  29825. loadBase64: function(e, t) {
  29826. t = t || "png";
  29827. var i = new o.Texture;
  29828. return i.image = document.createElement("img"),
  29829. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29830. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29831. i.magFilter = o.LinearFilter,
  29832. i.generateMipmaps = !1),
  29833. i.needsUpdate = !0,
  29834. i
  29835. },
  29836. isLoaded: function(e) {
  29837. return !!s[e]
  29838. }
  29839. }
  29840. window.Texture = t.exports
  29841. }
  29842. , {
  29843. "../settings": 166,
  29844. "../util/ajax": 181,
  29845. three: 217
  29846. }],
  29847. 195: [function(e, t, i) {
  29848. "use strict";
  29849. var l = e("./easing");
  29850. window.transitions = t.exports = {
  29851. globalDone: null,
  29852. funcs: [],
  29853. counter: 0,
  29854. uniqueID: 0,
  29855. start: function(e, t, i, n, r, o, a) {
  29856. return n = n || 0,
  29857. this.funcs.push({
  29858. func: e,
  29859. current: -n * Math.abs(t),
  29860. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29861. done: i,
  29862. easing: r || l.linearTween,
  29863. cycling: t < 0,
  29864. running: !0,
  29865. debug: n < 0,
  29866. name: o || "T" + this.counter,
  29867. id: void 0 === a ? this.counter : a,
  29868. paused: !1
  29869. }),
  29870. e(0, 16),
  29871. this.counter += 1,
  29872. e
  29873. },
  29874. trigger: function(e) {
  29875. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29876. , i = e.func || function() {}
  29877. , n = void 0 === e.duration ? 0 : e.duration;
  29878. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29879. var r = e.done || null
  29880. , o = e.easing || l.linearTween
  29881. , a = e.name || "R" + this.counter
  29882. , s = void 0 === e.id ? this.counter : e.id;
  29883. return this.start(i, n, r, t, o, a, s)
  29884. },
  29885. setTimeout: function(e, t, i) {
  29886. var n = void 0 === i ? this.counter : i;
  29887. return this.trigger({
  29888. done: e,
  29889. duration: void 0 === t ? 0 : t,
  29890. name: "O" + this.counter,
  29891. id: n
  29892. })
  29893. },
  29894. pause: function() {
  29895. this.paused = !0
  29896. },
  29897. resume: function() {
  29898. this.paused = !1
  29899. },
  29900. update: function(n) {
  29901. this.funcs.forEach(function(e) {
  29902. if (!(e.paused || (e.current += 1e3 * n,
  29903. e.current < 0)))
  29904. if (e.current >= e.duration && !e.cycling) {
  29905. var t = e.easing(1, 0, 1, 1);
  29906. e.func(t, 1e3 * n),
  29907. e.done && e.done(),
  29908. e.running = !1
  29909. } else {
  29910. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29911. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29912. e.running = !1)
  29913. }
  29914. });
  29915. var e = this.funcs.length;
  29916. this.funcs = this.funcs.filter(function(e) {
  29917. return e.running
  29918. });
  29919. var t = this.funcs.length;
  29920. if (0 < e && 0 === t && this.globalDone) {
  29921. var i = this.globalDone;
  29922. this.globalDone = null,
  29923. i()
  29924. }
  29925. },
  29926. adjustSpeed: function(e, t) {
  29927. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29928. var r = i[n];
  29929. r.duration /= t,
  29930. r.current /= t
  29931. }
  29932. },
  29933. getById: function(t) {
  29934. return this.funcs.filter(function(e) {
  29935. return t === e.id
  29936. })
  29937. },
  29938. get: function(e) {
  29939. for (var t = 0; t < this.funcs.length; t += 1)
  29940. if (this.funcs[t].func === e)
  29941. return this.funcs[t];
  29942. return null
  29943. },
  29944. isRunning: function(e) {
  29945. var t = this.get(e);
  29946. return null !== t && t.running
  29947. },
  29948. countActive: function() {
  29949. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29950. e += this.funcs[t].running;
  29951. return e
  29952. },
  29953. listActive: function() {
  29954. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29955. this.funcs[t].running && e.push(this.funcs[t].name);
  29956. return e
  29957. },
  29958. done: function(e) {
  29959. this.globalDone = e
  29960. },
  29961. cancelById: function(e) {
  29962. var t = void 0 === e ? 0 : e;
  29963. this.funcs = this.funcs.filter(function(e) {
  29964. return e.id !== t
  29965. })
  29966. },
  29967. cancel: function(t) {
  29968. this.funcs = this.funcs.filter(function(e) {
  29969. return e.func !== t
  29970. })
  29971. },
  29972. getUniqueId: function() {
  29973. return this.uniqueID -= 1,
  29974. this.uniqueID
  29975. }
  29976. }
  29977. }
  29978. , {
  29979. "./easing": 186
  29980. }],
  29981. 196: [function(e, t, i) {
  29982. function n(e) {
  29983. if (this.set = {},
  29984. this.infContains = function() {
  29985. return !0
  29986. }
  29987. ,
  29988. "object" == typeof e)
  29989. if (e instanceof Array)
  29990. for (var t = 0; t < e.length; t++)
  29991. this.set[e[t]] = !0;
  29992. else
  29993. this.set = e;
  29994. else if ("function" == typeof e)
  29995. this.infContains = e;
  29996. else if (void 0 !== e)
  29997. throw new Error("set must be either an array or an object.")
  29998. }
  29999. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  30000. return !!this.set[e]
  30001. }
  30002. ,
  30003. n.prototype.add = function(e) {
  30004. if (1 == arguments.length)
  30005. this.set[e] = !0;
  30006. else
  30007. for (var t = 0; t < arguments.length; t++)
  30008. this.set[arguments[t]] = !0
  30009. }
  30010. ,
  30011. n.prototype.addAll = function(e) {
  30012. if ("object" != typeof e && !(e instanceof Array))
  30013. throw new Error("arr must be an array.");
  30014. for (var t = 0; t < e.length; t++)
  30015. this.add(e[t])
  30016. }
  30017. ,
  30018. n.prototype.delete = n.prototype.remove = function(e) {
  30019. if (1 == arguments.length)
  30020. delete this.set[e];
  30021. else
  30022. for (var t = 0; t < arguments.length; t++)
  30023. delete this.set[arguments[t]]
  30024. }
  30025. ,
  30026. n.prototype.clear = function() {
  30027. this.set = {}
  30028. }
  30029. ,
  30030. n.prototype.size = function() {
  30031. return Object.keys(this.set).length
  30032. }
  30033. ,
  30034. n.prototype.toString = function() {
  30035. return "{" + Object.keys(this.set).toString() + "}"
  30036. }
  30037. ,
  30038. n.prototype["*values"] = n.prototype.toArray = function() {
  30039. return void 0 === this.set ? [] : Object.keys(this.set)
  30040. }
  30041. }
  30042. , {}],
  30043. 197: [function(e, t, i) {}
  30044. , {}],
  30045. 198: [function(N, e, F) {
  30046. (function(e) {
  30047. "use strict";
  30048. function i() {
  30049. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  30050. }
  30051. function o(e, t) {
  30052. if (i() < t)
  30053. throw new RangeError("Invalid typed array length");
  30054. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  30055. e.length = t),
  30056. e
  30057. }
  30058. function u(e, t, i) {
  30059. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  30060. return new u(e,t,i);
  30061. if ("number" != typeof e)
  30062. return n(this, e, t, i);
  30063. if ("string" == typeof t)
  30064. throw new Error("If encoding is specified then the first argument must be a string");
  30065. return a(this, e)
  30066. }
  30067. function n(e, t, i, n) {
  30068. if ("number" == typeof t)
  30069. throw new TypeError('"value" argument must not be a number');
  30070. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  30071. if (t.byteLength,
  30072. i < 0 || t.byteLength < i)
  30073. throw new RangeError("'offset' is out of bounds");
  30074. if (t.byteLength < i + (n || 0))
  30075. throw new RangeError("'length' is out of bounds");
  30076. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  30077. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  30078. e
  30079. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  30080. if ("string" == typeof i && "" !== i || (i = "utf8"),
  30081. !u.isEncoding(i))
  30082. throw new TypeError('"encoding" must be a valid string encoding');
  30083. var n = 0 | c(t, i)
  30084. , r = (e = o(e, n)).write(t, i);
  30085. return r !== n && (e = e.slice(0, r)),
  30086. e
  30087. }(e, t, i) : function(e, t) {
  30088. if (u.isBuffer(t)) {
  30089. var i = 0 | l(t.length);
  30090. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  30091. e
  30092. }
  30093. if (t) {
  30094. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  30095. return "number" != typeof t.length || function(e) {
  30096. return e != e
  30097. }(t.length) ? o(e, 0) : s(e, t);
  30098. if ("Buffer" === t.type && L(t.data))
  30099. return s(e, t.data)
  30100. }
  30101. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  30102. }(e, t)
  30103. }
  30104. function r(e) {
  30105. if ("number" != typeof e)
  30106. throw new TypeError('"size" argument must be a number');
  30107. if (e < 0)
  30108. throw new RangeError('"size" argument must not be negative')
  30109. }
  30110. function a(e, t) {
  30111. if (r(t),
  30112. e = o(e, t < 0 ? 0 : 0 | l(t)),
  30113. !u.TYPED_ARRAY_SUPPORT)
  30114. for (var i = 0; i < t; ++i)
  30115. e[i] = 0;
  30116. return e
  30117. }
  30118. function s(e, t) {
  30119. var i = t.length < 0 ? 0 : 0 | l(t.length);
  30120. e = o(e, i);
  30121. for (var n = 0; n < i; n += 1)
  30122. e[n] = 255 & t[n];
  30123. return e
  30124. }
  30125. function l(e) {
  30126. if (e >= i())
  30127. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  30128. return 0 | e
  30129. }
  30130. function c(e, t) {
  30131. if (u.isBuffer(e))
  30132. return e.length;
  30133. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  30134. return e.byteLength;
  30135. "string" != typeof e && (e = "" + e);
  30136. var i = e.length;
  30137. if (0 === i)
  30138. return 0;
  30139. for (var n = !1; ; )
  30140. switch (t) {
  30141. case "ascii":
  30142. case "latin1":
  30143. case "binary":
  30144. return i;
  30145. case "utf8":
  30146. case "utf-8":
  30147. case void 0:
  30148. return S(e).length;
  30149. case "ucs2":
  30150. case "ucs-2":
  30151. case "utf16le":
  30152. case "utf-16le":
  30153. return 2 * i;
  30154. case "hex":
  30155. return i >>> 1;
  30156. case "base64":
  30157. return M(e).length;
  30158. default:
  30159. if (n)
  30160. return S(e).length;
  30161. t = ("" + t).toLowerCase(),
  30162. n = !0
  30163. }
  30164. }
  30165. function h(e, t, i) {
  30166. var n = e[t];
  30167. e[t] = e[i],
  30168. e[i] = n
  30169. }
  30170. function d(e, t, i, n, r) {
  30171. if (0 === e.length)
  30172. return -1;
  30173. if ("string" == typeof i ? (n = i,
  30174. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  30175. i = +i,
  30176. isNaN(i) && (i = r ? 0 : e.length - 1),
  30177. i < 0 && (i = e.length + i),
  30178. i >= e.length) {
  30179. if (r)
  30180. return -1;
  30181. i = e.length - 1
  30182. } else if (i < 0) {
  30183. if (!r)
  30184. return -1;
  30185. i = 0
  30186. }
  30187. if ("string" == typeof t && (t = u.from(t, n)),
  30188. u.isBuffer(t))
  30189. return 0 === t.length ? -1 : p(e, t, i, n, r);
  30190. if ("number" == typeof t)
  30191. return t &= 255,
  30192. 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);
  30193. throw new TypeError("val must be string, number or Buffer")
  30194. }
  30195. function p(e, t, i, n, r) {
  30196. function o(e, t) {
  30197. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  30198. }
  30199. var a, s = 1, l = e.length, c = t.length;
  30200. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  30201. if (e.length < 2 || t.length < 2)
  30202. return -1;
  30203. l /= s = 2,
  30204. c /= 2,
  30205. i /= 2
  30206. }
  30207. if (r) {
  30208. var h = -1;
  30209. for (a = i; a < l; a++)
  30210. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  30211. if (-1 === h && (h = a),
  30212. a - h + 1 === c)
  30213. return h * s
  30214. } else
  30215. -1 !== h && (a -= a - h),
  30216. h = -1
  30217. } else
  30218. for (l < i + c && (i = l - c),
  30219. a = i; 0 <= a; a--) {
  30220. for (var u = !0, d = 0; d < c; d++)
  30221. if (o(e, a + d) !== o(t, d)) {
  30222. u = !1;
  30223. break
  30224. }
  30225. if (u)
  30226. return a
  30227. }
  30228. return -1
  30229. }
  30230. function g(e, t, i, n) {
  30231. i = Number(i) || 0;
  30232. var r = e.length - i;
  30233. n ? r < (n = Number(n)) && (n = r) : n = r;
  30234. var o = t.length;
  30235. if (o % 2 != 0)
  30236. throw new TypeError("Invalid hex string");
  30237. o / 2 < n && (n = o / 2);
  30238. for (var a = 0; a < n; ++a) {
  30239. var s = parseInt(t.substr(2 * a, 2), 16);
  30240. if (isNaN(s))
  30241. return a;
  30242. e[i + a] = s
  30243. }
  30244. return a
  30245. }
  30246. function m(e, t, i, n) {
  30247. return R(function(e) {
  30248. for (var t = [], i = 0; i < e.length; ++i)
  30249. t.push(255 & e.charCodeAt(i));
  30250. return t
  30251. }(t), e, i, n)
  30252. }
  30253. function f(e, t, i) {
  30254. i = Math.min(e.length, i);
  30255. for (var n = [], r = t; r < i; ) {
  30256. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  30257. if (r + u <= i)
  30258. switch (u) {
  30259. case 1:
  30260. c < 128 && (h = c);
  30261. break;
  30262. case 2:
  30263. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  30264. break;
  30265. case 3:
  30266. o = e[r + 1],
  30267. a = e[r + 2],
  30268. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  30269. break;
  30270. case 4:
  30271. o = e[r + 1],
  30272. a = e[r + 2],
  30273. s = e[r + 3],
  30274. 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))
  30275. }
  30276. null === h ? (h = 65533,
  30277. u = 1) : 65535 < h && (h -= 65536,
  30278. n.push(h >>> 10 & 1023 | 55296),
  30279. h = 56320 | 1023 & h),
  30280. n.push(h),
  30281. r += u
  30282. }
  30283. return function(e) {
  30284. var t = e.length;
  30285. if (t <= D)
  30286. return String.fromCharCode.apply(String, e);
  30287. for (var i = "", n = 0; n < t; )
  30288. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  30289. return i
  30290. }(n)
  30291. }
  30292. function v(e, t, i) {
  30293. var n = "";
  30294. i = Math.min(e.length, i);
  30295. for (var r = t; r < i; ++r)
  30296. n += String.fromCharCode(127 & e[r]);
  30297. return n
  30298. }
  30299. function y(e, t, i) {
  30300. var n = "";
  30301. i = Math.min(e.length, i);
  30302. for (var r = t; r < i; ++r)
  30303. n += String.fromCharCode(e[r]);
  30304. return n
  30305. }
  30306. function A(e, t, i) {
  30307. var n, r = e.length;
  30308. (!t || t < 0) && (t = 0),
  30309. (!i || i < 0 || r < i) && (i = r);
  30310. for (var o = "", a = t; a < i; ++a)
  30311. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  30312. return o
  30313. }
  30314. function C(e, t, i) {
  30315. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  30316. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  30317. return r
  30318. }
  30319. function I(e, t, i) {
  30320. if (e % 1 != 0 || e < 0)
  30321. throw new RangeError("offset is not uint");
  30322. if (i < e + t)
  30323. throw new RangeError("Trying to access beyond buffer length")
  30324. }
  30325. function E(e, t, i, n, r, o) {
  30326. if (!u.isBuffer(e))
  30327. throw new TypeError('"buffer" argument must be a Buffer instance');
  30328. if (r < t || t < o)
  30329. throw new RangeError('"value" argument is out of bounds');
  30330. if (i + n > e.length)
  30331. throw new RangeError("Index out of range")
  30332. }
  30333. function _(e, t, i, n) {
  30334. t < 0 && (t = 65535 + t + 1);
  30335. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  30336. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  30337. }
  30338. function b(e, t, i, n) {
  30339. t < 0 && (t = 4294967295 + t + 1);
  30340. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  30341. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  30342. }
  30343. function w(e, t, i, n) {
  30344. if (i + n > e.length)
  30345. throw new RangeError("Index out of range");
  30346. if (i < 0)
  30347. throw new RangeError("Index out of range")
  30348. }
  30349. function T(e, t, i, n, r) {
  30350. return r || w(e, 0, i, 4),
  30351. O.write(e, t, i, n, 23, 4),
  30352. i + 4
  30353. }
  30354. function x(e, t, i, n, r) {
  30355. return r || w(e, 0, i, 8),
  30356. O.write(e, t, i, n, 52, 8),
  30357. i + 8
  30358. }
  30359. function S(e, t) {
  30360. t = t || 1 / 0;
  30361. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  30362. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  30363. if (!r) {
  30364. if (56319 < i) {
  30365. -1 < (t -= 3) && o.push(239, 191, 189);
  30366. continue
  30367. }
  30368. if (a + 1 === n) {
  30369. -1 < (t -= 3) && o.push(239, 191, 189);
  30370. continue
  30371. }
  30372. r = i;
  30373. continue
  30374. }
  30375. if (i < 56320) {
  30376. -1 < (t -= 3) && o.push(239, 191, 189),
  30377. r = i;
  30378. continue
  30379. }
  30380. i = 65536 + (r - 55296 << 10 | i - 56320)
  30381. } else
  30382. r && -1 < (t -= 3) && o.push(239, 191, 189);
  30383. if (r = null,
  30384. i < 128) {
  30385. if ((t -= 1) < 0)
  30386. break;
  30387. o.push(i)
  30388. } else if (i < 2048) {
  30389. if ((t -= 2) < 0)
  30390. break;
  30391. o.push(i >> 6 | 192, 63 & i | 128)
  30392. } else if (i < 65536) {
  30393. if ((t -= 3) < 0)
  30394. break;
  30395. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  30396. } else {
  30397. if (!(i < 1114112))
  30398. throw new Error("Invalid code point");
  30399. if ((t -= 4) < 0)
  30400. break;
  30401. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  30402. }
  30403. }
  30404. return o
  30405. }
  30406. function M(e) {
  30407. return P.toByteArray(function(e) {
  30408. if ((e = function(e) {
  30409. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  30410. }(e).replace(t, "")).length < 2)
  30411. return "";
  30412. for (; e.length % 4 != 0; )
  30413. e += "=";
  30414. return e
  30415. }(e))
  30416. }
  30417. function R(e, t, i, n) {
  30418. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  30419. t[r + i] = e[r];
  30420. return r
  30421. }
  30422. var P = N("base64-js")
  30423. , O = N("ieee754")
  30424. , L = N("isarray");
  30425. F.Buffer = u,
  30426. F.SlowBuffer = function(e) {
  30427. return +e != e && (e = 0),
  30428. u.alloc(+e)
  30429. }
  30430. ,
  30431. F.INSPECT_MAX_BYTES = 50,
  30432. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  30433. try {
  30434. var e = new Uint8Array(1);
  30435. return e.__proto__ = {
  30436. __proto__: Uint8Array.prototype,
  30437. foo: function() {
  30438. return 42
  30439. }
  30440. },
  30441. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30442. } catch (e) {
  30443. return !1
  30444. }
  30445. }(),
  30446. F.kMaxLength = i(),
  30447. u.poolSize = 8192,
  30448. u._augment = function(e) {
  30449. return e.__proto__ = u.prototype,
  30450. e
  30451. }
  30452. ,
  30453. u.from = function(e, t, i) {
  30454. return n(null, e, t, i)
  30455. }
  30456. ,
  30457. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  30458. u.__proto__ = Uint8Array,
  30459. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  30460. value: null,
  30461. configurable: !0
  30462. })),
  30463. u.alloc = function(e, t, i) {
  30464. return function(e, t, i, n) {
  30465. return r(t),
  30466. 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)
  30467. }(null, e, t, i)
  30468. }
  30469. ,
  30470. u.allocUnsafe = function(e) {
  30471. return a(null, e)
  30472. }
  30473. ,
  30474. u.allocUnsafeSlow = function(e) {
  30475. return a(null, e)
  30476. }
  30477. ,
  30478. u.isBuffer = function(e) {
  30479. return !(null == e || !e._isBuffer)
  30480. }
  30481. ,
  30482. u.compare = function(e, t) {
  30483. if (!u.isBuffer(e) || !u.isBuffer(t))
  30484. throw new TypeError("Arguments must be Buffers");
  30485. if (e === t)
  30486. return 0;
  30487. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30488. if (e[r] !== t[r]) {
  30489. i = e[r],
  30490. n = t[r];
  30491. break
  30492. }
  30493. return i < n ? -1 : n < i ? 1 : 0
  30494. }
  30495. ,
  30496. u.isEncoding = function(e) {
  30497. switch (String(e).toLowerCase()) {
  30498. case "hex":
  30499. case "utf8":
  30500. case "utf-8":
  30501. case "ascii":
  30502. case "latin1":
  30503. case "binary":
  30504. case "base64":
  30505. case "ucs2":
  30506. case "ucs-2":
  30507. case "utf16le":
  30508. case "utf-16le":
  30509. return !0;
  30510. default:
  30511. return !1
  30512. }
  30513. }
  30514. ,
  30515. u.concat = function(e, t) {
  30516. if (!L(e))
  30517. throw new TypeError('"list" argument must be an Array of Buffers');
  30518. if (0 === e.length)
  30519. return u.alloc(0);
  30520. var i;
  30521. if (void 0 === t)
  30522. for (i = t = 0; i < e.length; ++i)
  30523. t += e[i].length;
  30524. var n = u.allocUnsafe(t)
  30525. , r = 0;
  30526. for (i = 0; i < e.length; ++i) {
  30527. var o = e[i];
  30528. if (!u.isBuffer(o))
  30529. throw new TypeError('"list" argument must be an Array of Buffers');
  30530. o.copy(n, r),
  30531. r += o.length
  30532. }
  30533. return n
  30534. }
  30535. ,
  30536. u.byteLength = c,
  30537. u.prototype._isBuffer = !0,
  30538. u.prototype.swap16 = function() {
  30539. var e = this.length;
  30540. if (e % 2 != 0)
  30541. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30542. for (var t = 0; t < e; t += 2)
  30543. h(this, t, t + 1);
  30544. return this
  30545. }
  30546. ,
  30547. u.prototype.swap32 = function() {
  30548. var e = this.length;
  30549. if (e % 4 != 0)
  30550. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30551. for (var t = 0; t < e; t += 4)
  30552. h(this, t, t + 3),
  30553. h(this, t + 1, t + 2);
  30554. return this
  30555. }
  30556. ,
  30557. u.prototype.swap64 = function() {
  30558. var e = this.length;
  30559. if (e % 8 != 0)
  30560. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30561. for (var t = 0; t < e; t += 8)
  30562. h(this, t, t + 7),
  30563. h(this, t + 1, t + 6),
  30564. h(this, t + 2, t + 5),
  30565. h(this, t + 3, t + 4);
  30566. return this
  30567. }
  30568. ,
  30569. u.prototype.toString = function() {
  30570. var e = 0 | this.length;
  30571. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30572. var n, r, o, a = !1;
  30573. if ((void 0 === t || t < 0) && (t = 0),
  30574. t > this.length)
  30575. return "";
  30576. if ((void 0 === i || i > this.length) && (i = this.length),
  30577. i <= 0)
  30578. return "";
  30579. if ((i >>>= 0) <= (t >>>= 0))
  30580. return "";
  30581. for (e = e || "utf8"; ; )
  30582. switch (e) {
  30583. case "hex":
  30584. return A(this, t, i);
  30585. case "utf8":
  30586. case "utf-8":
  30587. return f(this, t, i);
  30588. case "ascii":
  30589. return v(this, t, i);
  30590. case "latin1":
  30591. case "binary":
  30592. return y(this, t, i);
  30593. case "base64":
  30594. return n = this,
  30595. o = i,
  30596. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30597. case "ucs2":
  30598. case "ucs-2":
  30599. case "utf16le":
  30600. case "utf-16le":
  30601. return C(this, t, i);
  30602. default:
  30603. if (a)
  30604. throw new TypeError("Unknown encoding: " + e);
  30605. e = (e + "").toLowerCase(),
  30606. a = !0
  30607. }
  30608. }
  30609. .apply(this, arguments)
  30610. }
  30611. ,
  30612. u.prototype.equals = function(e) {
  30613. if (!u.isBuffer(e))
  30614. throw new TypeError("Argument must be a Buffer");
  30615. return this === e || 0 === u.compare(this, e)
  30616. }
  30617. ,
  30618. u.prototype.inspect = function() {
  30619. var e = ""
  30620. , t = F.INSPECT_MAX_BYTES;
  30621. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30622. this.length > t && (e += " ... ")),
  30623. "<Buffer " + e + ">"
  30624. }
  30625. ,
  30626. u.prototype.compare = function(e, t, i, n, r) {
  30627. if (!u.isBuffer(e))
  30628. throw new TypeError("Argument must be a Buffer");
  30629. if (void 0 === t && (t = 0),
  30630. void 0 === i && (i = e ? e.length : 0),
  30631. void 0 === n && (n = 0),
  30632. void 0 === r && (r = this.length),
  30633. t < 0 || i > e.length || n < 0 || r > this.length)
  30634. throw new RangeError("out of range index");
  30635. if (r <= n && i <= t)
  30636. return 0;
  30637. if (r <= n)
  30638. return -1;
  30639. if (i <= t)
  30640. return 1;
  30641. if (this === e)
  30642. return 0;
  30643. 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)
  30644. if (l[h] !== c[h]) {
  30645. o = l[h],
  30646. a = c[h];
  30647. break
  30648. }
  30649. return o < a ? -1 : a < o ? 1 : 0
  30650. }
  30651. ,
  30652. u.prototype.includes = function(e, t, i) {
  30653. return -1 !== this.indexOf(e, t, i)
  30654. }
  30655. ,
  30656. u.prototype.indexOf = function(e, t, i) {
  30657. return d(this, e, t, i, !0)
  30658. }
  30659. ,
  30660. u.prototype.lastIndexOf = function(e, t, i) {
  30661. return d(this, e, t, i, !1)
  30662. }
  30663. ,
  30664. u.prototype.write = function(e, t, i, n) {
  30665. if (void 0 === t)
  30666. n = "utf8",
  30667. i = this.length,
  30668. t = 0;
  30669. else if (void 0 === i && "string" == typeof t)
  30670. n = t,
  30671. i = this.length,
  30672. t = 0;
  30673. else {
  30674. if (!isFinite(t))
  30675. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30676. t |= 0,
  30677. isFinite(i) ? (i |= 0,
  30678. void 0 === n && (n = "utf8")) : (n = i,
  30679. i = void 0)
  30680. }
  30681. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30682. if ((void 0 === i || p < i) && (i = p),
  30683. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30684. throw new RangeError("Attempt to write outside buffer bounds");
  30685. n = n || "utf8";
  30686. for (var f = !1; ; )
  30687. switch (n) {
  30688. case "hex":
  30689. return g(this, e, t, i);
  30690. case "utf8":
  30691. case "utf-8":
  30692. return u = t,
  30693. d = i,
  30694. R(S(e, (h = this).length - u), h, u, d);
  30695. case "ascii":
  30696. return m(this, e, t, i);
  30697. case "latin1":
  30698. case "binary":
  30699. return m(this, e, t, i);
  30700. case "base64":
  30701. return s = this,
  30702. l = t,
  30703. c = i,
  30704. R(M(e), s, l, c);
  30705. case "ucs2":
  30706. case "ucs-2":
  30707. case "utf16le":
  30708. case "utf-16le":
  30709. return o = t,
  30710. a = i,
  30711. R(function(e, t) {
  30712. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30713. i = e.charCodeAt(a),
  30714. n = i >> 8,
  30715. r = i % 256,
  30716. o.push(r),
  30717. o.push(n);
  30718. return o
  30719. }(e, (r = this).length - o), r, o, a);
  30720. default:
  30721. if (f)
  30722. throw new TypeError("Unknown encoding: " + n);
  30723. n = ("" + n).toLowerCase(),
  30724. f = !0
  30725. }
  30726. }
  30727. ,
  30728. u.prototype.toJSON = function() {
  30729. return {
  30730. type: "Buffer",
  30731. data: Array.prototype.slice.call(this._arr || this, 0)
  30732. }
  30733. }
  30734. ;
  30735. var D = 4096;
  30736. u.prototype.slice = function(e, t) {
  30737. var i, n = this.length;
  30738. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30739. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30740. t < e && (t = e),
  30741. u.TYPED_ARRAY_SUPPORT)
  30742. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30743. else {
  30744. var r = t - e;
  30745. i = new u(r,void 0);
  30746. for (var o = 0; o < r; ++o)
  30747. i[o] = this[o + e]
  30748. }
  30749. return i
  30750. }
  30751. ,
  30752. u.prototype.readUIntLE = function(e, t, i) {
  30753. e |= 0,
  30754. t |= 0,
  30755. i || I(e, t, this.length);
  30756. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30757. n += this[e + o] * r;
  30758. return n
  30759. }
  30760. ,
  30761. u.prototype.readUIntBE = function(e, t, i) {
  30762. e |= 0,
  30763. t |= 0,
  30764. i || I(e, t, this.length);
  30765. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30766. n += this[e + --t] * r;
  30767. return n
  30768. }
  30769. ,
  30770. u.prototype.readUInt8 = function(e, t) {
  30771. return t || I(e, 1, this.length),
  30772. this[e]
  30773. }
  30774. ,
  30775. u.prototype.readUInt16LE = function(e, t) {
  30776. return t || I(e, 2, this.length),
  30777. this[e] | this[e + 1] << 8
  30778. }
  30779. ,
  30780. u.prototype.readUInt16BE = function(e, t) {
  30781. return t || I(e, 2, this.length),
  30782. this[e] << 8 | this[e + 1]
  30783. }
  30784. ,
  30785. u.prototype.readUInt32LE = function(e, t) {
  30786. return t || I(e, 4, this.length),
  30787. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30788. }
  30789. ,
  30790. u.prototype.readUInt32BE = function(e, t) {
  30791. return t || I(e, 4, this.length),
  30792. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30793. }
  30794. ,
  30795. u.prototype.readIntLE = function(e, t, i) {
  30796. e |= 0,
  30797. t |= 0,
  30798. i || I(e, t, this.length);
  30799. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30800. n += this[e + o] * r;
  30801. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30802. n
  30803. }
  30804. ,
  30805. u.prototype.readIntBE = function(e, t, i) {
  30806. e |= 0,
  30807. t |= 0,
  30808. i || I(e, t, this.length);
  30809. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30810. o += this[e + --n] * r;
  30811. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30812. o
  30813. }
  30814. ,
  30815. u.prototype.readInt8 = function(e, t) {
  30816. return t || I(e, 1, this.length),
  30817. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30818. }
  30819. ,
  30820. u.prototype.readInt16LE = function(e, t) {
  30821. t || I(e, 2, this.length);
  30822. var i = this[e] | this[e + 1] << 8;
  30823. return 32768 & i ? 4294901760 | i : i
  30824. }
  30825. ,
  30826. u.prototype.readInt16BE = function(e, t) {
  30827. t || I(e, 2, this.length);
  30828. var i = this[e + 1] | this[e] << 8;
  30829. return 32768 & i ? 4294901760 | i : i
  30830. }
  30831. ,
  30832. u.prototype.readInt32LE = function(e, t) {
  30833. return t || I(e, 4, this.length),
  30834. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30835. }
  30836. ,
  30837. u.prototype.readInt32BE = function(e, t) {
  30838. return t || I(e, 4, this.length),
  30839. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30840. }
  30841. ,
  30842. u.prototype.readFloatLE = function(e, t) {
  30843. return t || I(e, 4, this.length),
  30844. O.read(this, e, !0, 23, 4)
  30845. }
  30846. ,
  30847. u.prototype.readFloatBE = function(e, t) {
  30848. return t || I(e, 4, this.length),
  30849. O.read(this, e, !1, 23, 4)
  30850. }
  30851. ,
  30852. u.prototype.readDoubleLE = function(e, t) {
  30853. return t || I(e, 8, this.length),
  30854. O.read(this, e, !0, 52, 8)
  30855. }
  30856. ,
  30857. u.prototype.readDoubleBE = function(e, t) {
  30858. return t || I(e, 8, this.length),
  30859. O.read(this, e, !1, 52, 8)
  30860. }
  30861. ,
  30862. u.prototype.writeUIntLE = function(e, t, i, n) {
  30863. e = +e,
  30864. t |= 0,
  30865. i |= 0,
  30866. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30867. var r = 1
  30868. , o = 0;
  30869. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30870. this[t + o] = e / r & 255;
  30871. return t + i
  30872. }
  30873. ,
  30874. u.prototype.writeUIntBE = function(e, t, i, n) {
  30875. e = +e,
  30876. t |= 0,
  30877. i |= 0,
  30878. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30879. var r = i - 1
  30880. , o = 1;
  30881. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30882. this[t + r] = e / o & 255;
  30883. return t + i
  30884. }
  30885. ,
  30886. u.prototype.writeUInt8 = function(e, t, i) {
  30887. return e = +e,
  30888. t |= 0,
  30889. i || E(this, e, t, 1, 255, 0),
  30890. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30891. this[t] = 255 & e,
  30892. t + 1
  30893. }
  30894. ,
  30895. u.prototype.writeUInt16LE = function(e, t, i) {
  30896. return e = +e,
  30897. t |= 0,
  30898. i || E(this, e, t, 2, 65535, 0),
  30899. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30900. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30901. t + 2
  30902. }
  30903. ,
  30904. u.prototype.writeUInt16BE = function(e, t, i) {
  30905. return e = +e,
  30906. t |= 0,
  30907. i || E(this, e, t, 2, 65535, 0),
  30908. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30909. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30910. t + 2
  30911. }
  30912. ,
  30913. u.prototype.writeUInt32LE = function(e, t, i) {
  30914. return e = +e,
  30915. t |= 0,
  30916. i || E(this, e, t, 4, 4294967295, 0),
  30917. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30918. this[t + 2] = e >>> 16,
  30919. this[t + 1] = e >>> 8,
  30920. this[t] = 255 & e) : b(this, e, t, !0),
  30921. t + 4
  30922. }
  30923. ,
  30924. u.prototype.writeUInt32BE = function(e, t, i) {
  30925. return e = +e,
  30926. t |= 0,
  30927. i || E(this, e, t, 4, 4294967295, 0),
  30928. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30929. this[t + 1] = e >>> 16,
  30930. this[t + 2] = e >>> 8,
  30931. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30932. t + 4
  30933. }
  30934. ,
  30935. u.prototype.writeIntLE = function(e, t, i, n) {
  30936. if (e = +e,
  30937. t |= 0,
  30938. !n) {
  30939. var r = Math.pow(2, 8 * i - 1);
  30940. E(this, e, t, i, r - 1, -r)
  30941. }
  30942. var o = 0
  30943. , a = 1
  30944. , s = 0;
  30945. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30946. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30947. this[t + o] = (e / a >> 0) - s & 255;
  30948. return t + i
  30949. }
  30950. ,
  30951. u.prototype.writeIntBE = function(e, t, i, n) {
  30952. if (e = +e,
  30953. t |= 0,
  30954. !n) {
  30955. var r = Math.pow(2, 8 * i - 1);
  30956. E(this, e, t, i, r - 1, -r)
  30957. }
  30958. var o = i - 1
  30959. , a = 1
  30960. , s = 0;
  30961. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30962. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30963. this[t + o] = (e / a >> 0) - s & 255;
  30964. return t + i
  30965. }
  30966. ,
  30967. u.prototype.writeInt8 = function(e, t, i) {
  30968. return e = +e,
  30969. t |= 0,
  30970. i || E(this, e, t, 1, 127, -128),
  30971. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30972. e < 0 && (e = 255 + e + 1),
  30973. this[t] = 255 & e,
  30974. t + 1
  30975. }
  30976. ,
  30977. u.prototype.writeInt16LE = function(e, t, i) {
  30978. return e = +e,
  30979. t |= 0,
  30980. i || E(this, e, t, 2, 32767, -32768),
  30981. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30982. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30983. t + 2
  30984. }
  30985. ,
  30986. u.prototype.writeInt16BE = function(e, t, i) {
  30987. return e = +e,
  30988. t |= 0,
  30989. i || E(this, e, t, 2, 32767, -32768),
  30990. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30991. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30992. t + 2
  30993. }
  30994. ,
  30995. u.prototype.writeInt32LE = function(e, t, i) {
  30996. return e = +e,
  30997. t |= 0,
  30998. i || E(this, e, t, 4, 2147483647, -2147483648),
  30999. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31000. this[t + 1] = e >>> 8,
  31001. this[t + 2] = e >>> 16,
  31002. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  31003. t + 4
  31004. }
  31005. ,
  31006. u.prototype.writeInt32BE = function(e, t, i) {
  31007. return e = +e,
  31008. t |= 0,
  31009. i || E(this, e, t, 4, 2147483647, -2147483648),
  31010. e < 0 && (e = 4294967295 + e + 1),
  31011. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  31012. this[t + 1] = e >>> 16,
  31013. this[t + 2] = e >>> 8,
  31014. this[t + 3] = 255 & e) : b(this, e, t, !1),
  31015. t + 4
  31016. }
  31017. ,
  31018. u.prototype.writeFloatLE = function(e, t, i) {
  31019. return T(this, e, t, !0, i)
  31020. }
  31021. ,
  31022. u.prototype.writeFloatBE = function(e, t, i) {
  31023. return T(this, e, t, !1, i)
  31024. }
  31025. ,
  31026. u.prototype.writeDoubleLE = function(e, t, i) {
  31027. return x(this, e, t, !0, i)
  31028. }
  31029. ,
  31030. u.prototype.writeDoubleBE = function(e, t, i) {
  31031. return x(this, e, t, !1, i)
  31032. }
  31033. ,
  31034. u.prototype.copy = function(e, t, i, n) {
  31035. if (i = i || 0,
  31036. n || 0 === n || (n = this.length),
  31037. t >= e.length && (t = e.length),
  31038. t = t || 0,
  31039. 0 < n && n < i && (n = i),
  31040. n === i)
  31041. return 0;
  31042. if (0 === e.length || 0 === this.length)
  31043. return 0;
  31044. if (t < 0)
  31045. throw new RangeError("targetStart out of bounds");
  31046. if (i < 0 || i >= this.length)
  31047. throw new RangeError("sourceStart out of bounds");
  31048. if (n < 0)
  31049. throw new RangeError("sourceEnd out of bounds");
  31050. n > this.length && (n = this.length),
  31051. e.length - t < n - i && (n = e.length - t + i);
  31052. var r, o = n - i;
  31053. if (this === e && i < t && t < n)
  31054. for (r = o - 1; 0 <= r; --r)
  31055. e[r + t] = this[r + i];
  31056. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  31057. for (r = 0; r < o; ++r)
  31058. e[r + t] = this[r + i];
  31059. else
  31060. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  31061. return o
  31062. }
  31063. ,
  31064. u.prototype.fill = function(e, t, i, n) {
  31065. if ("string" == typeof e) {
  31066. if ("string" == typeof t ? (n = t,
  31067. t = 0,
  31068. i = this.length) : "string" == typeof i && (n = i,
  31069. i = this.length),
  31070. 1 === e.length) {
  31071. var r = e.charCodeAt(0);
  31072. r < 256 && (e = r)
  31073. }
  31074. if (void 0 !== n && "string" != typeof n)
  31075. throw new TypeError("encoding must be a string");
  31076. if ("string" == typeof n && !u.isEncoding(n))
  31077. throw new TypeError("Unknown encoding: " + n)
  31078. } else
  31079. "number" == typeof e && (e &= 255);
  31080. if (t < 0 || this.length < t || this.length < i)
  31081. throw new RangeError("Out of range index");
  31082. if (i <= t)
  31083. return this;
  31084. var o;
  31085. if (t >>>= 0,
  31086. i = void 0 === i ? this.length : i >>> 0,
  31087. "number" == typeof (e = e || 0))
  31088. for (o = t; o < i; ++o)
  31089. this[o] = e;
  31090. else {
  31091. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  31092. , s = a.length;
  31093. for (o = 0; o < i - t; ++o)
  31094. this[o + t] = a[o % s]
  31095. }
  31096. return this
  31097. }
  31098. ;
  31099. var t = /[^+\/0-9A-Za-z-_]/g
  31100. }
  31101. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31102. }
  31103. , {
  31104. "base64-js": 199,
  31105. ieee754: 200,
  31106. isarray: 201
  31107. }],
  31108. 199: [function(e, t, i) {
  31109. "use strict";
  31110. function l(e) {
  31111. var t = e.length;
  31112. if (0 < t % 4)
  31113. throw new Error("Invalid string. Length must be a multiple of 4");
  31114. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  31115. }
  31116. function c(e, t, i) {
  31117. for (var n, r = [], o = t; o < i; o += 3)
  31118. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  31119. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  31120. var a;
  31121. return r.join("")
  31122. }
  31123. i.byteLength = function(e) {
  31124. return 3 * e.length / 4 - l(e)
  31125. }
  31126. ,
  31127. i.toByteArray = function(e) {
  31128. var t, i, n, r, o, a = e.length;
  31129. r = l(e),
  31130. o = new d(3 * a / 4 - r),
  31131. i = 0 < r ? a - 4 : a;
  31132. var s = 0;
  31133. for (t = 0; t < i; t += 4,
  31134. 3)
  31135. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  31136. o[s++] = n >> 16 & 255,
  31137. o[s++] = n >> 8 & 255,
  31138. o[s++] = 255 & n;
  31139. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  31140. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  31141. o[s++] = n >> 8 & 255,
  31142. o[s++] = 255 & n),
  31143. o
  31144. }
  31145. ,
  31146. i.fromByteArray = function(e) {
  31147. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  31148. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  31149. return 1 == n ? (t = e[i - 1],
  31150. r += h[t >> 2],
  31151. r += h[t << 4 & 63],
  31152. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  31153. r += h[t >> 10],
  31154. r += h[t >> 4 & 63],
  31155. r += h[t << 2 & 63],
  31156. r += "="),
  31157. o.push(r),
  31158. o.join("")
  31159. }
  31160. ;
  31161. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  31162. h[r] = n[r],
  31163. u[n.charCodeAt(r)] = r;
  31164. u["-".charCodeAt(0)] = 62,
  31165. u["_".charCodeAt(0)] = 63
  31166. }
  31167. , {}],
  31168. 200: [function(e, t, i) {
  31169. i.read = function(e, t, i, n, r) {
  31170. 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];
  31171. for (u += d,
  31172. o = p & (1 << -h) - 1,
  31173. p >>= -h,
  31174. h += s; 0 < h; o = 256 * o + e[t + u],
  31175. u += d,
  31176. h -= 8)
  31177. ;
  31178. for (a = o & (1 << -h) - 1,
  31179. o >>= -h,
  31180. h += n; 0 < h; a = 256 * a + e[t + u],
  31181. u += d,
  31182. h -= 8)
  31183. ;
  31184. if (0 === o)
  31185. o = 1 - c;
  31186. else {
  31187. if (o === l)
  31188. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  31189. a += Math.pow(2, n),
  31190. o -= c
  31191. }
  31192. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  31193. }
  31194. ,
  31195. i.write = function(e, t, i, n, r, o) {
  31196. 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;
  31197. for (t = Math.abs(t),
  31198. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  31199. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  31200. t * (l = Math.pow(2, -a)) < 1 && (a--,
  31201. l *= 2),
  31202. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  31203. l /= 2),
  31204. h <= a + u ? (s = 0,
  31205. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  31206. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  31207. a = 0)); 8 <= r; e[i + p] = 255 & s,
  31208. p += f,
  31209. s /= 256,
  31210. r -= 8)
  31211. ;
  31212. for (a = a << r | s,
  31213. c += r; 0 < c; e[i + p] = 255 & a,
  31214. p += f,
  31215. a /= 256,
  31216. c -= 8)
  31217. ;
  31218. e[i + p - f] |= 128 * g
  31219. }
  31220. }
  31221. , {}],
  31222. 201: [function(e, t, i) {
  31223. var n = {}.toString;
  31224. t.exports = Array.isArray || function(e) {
  31225. return "[object Array]" == n.call(e)
  31226. }
  31227. }
  31228. , {}],
  31229. 202: [function(e, t, i) {
  31230. function n() {
  31231. this._events = this._events || {},
  31232. this._maxListeners = this._maxListeners || void 0
  31233. }
  31234. function l(e) {
  31235. return "function" == typeof e
  31236. }
  31237. function c(e) {
  31238. return "object" == typeof e && null !== e
  31239. }
  31240. function h(e) {
  31241. return void 0 === e
  31242. }
  31243. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  31244. n.prototype._maxListeners = void 0,
  31245. n.defaultMaxListeners = 10,
  31246. n.prototype.setMaxListeners = function(e) {
  31247. if (!function(e) {
  31248. return "number" == typeof e
  31249. }(e) || e < 0 || isNaN(e))
  31250. throw TypeError("n must be a positive number");
  31251. return this._maxListeners = e,
  31252. this
  31253. }
  31254. ,
  31255. n.prototype.emit = function(e) {
  31256. var t, i, n, r, o, a;
  31257. if (this._events || (this._events = {}),
  31258. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  31259. if ((t = arguments[1])instanceof Error)
  31260. throw t;
  31261. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  31262. throw s.context = t,
  31263. s
  31264. }
  31265. if (h(i = this._events[e]))
  31266. return !1;
  31267. if (l(i))
  31268. switch (arguments.length) {
  31269. case 1:
  31270. i.call(this);
  31271. break;
  31272. case 2:
  31273. i.call(this, arguments[1]);
  31274. break;
  31275. case 3:
  31276. i.call(this, arguments[1], arguments[2]);
  31277. break;
  31278. default:
  31279. r = Array.prototype.slice.call(arguments, 1),
  31280. i.apply(this, r)
  31281. }
  31282. else if (c(i))
  31283. for (r = Array.prototype.slice.call(arguments, 1),
  31284. n = (a = i.slice()).length,
  31285. o = 0; o < n; o++)
  31286. a[o].apply(this, r);
  31287. return !0
  31288. }
  31289. ,
  31290. n.prototype.on = n.prototype.addListener = function(e, t) {
  31291. var i;
  31292. if (!l(t))
  31293. throw TypeError("listener must be a function");
  31294. return this._events || (this._events = {}),
  31295. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  31296. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  31297. 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,
  31298. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  31299. "function" == typeof console.trace && console.trace())),
  31300. this
  31301. }
  31302. ,
  31303. n.prototype.once = function(e, t) {
  31304. function i() {
  31305. this.removeListener(e, i),
  31306. n || (n = !0,
  31307. t.apply(this, arguments))
  31308. }
  31309. if (!l(t))
  31310. throw TypeError("listener must be a function");
  31311. var n = !1;
  31312. return i.listener = t,
  31313. this.on(e, i),
  31314. this
  31315. }
  31316. ,
  31317. n.prototype.removeListener = function(e, t) {
  31318. var i, n, r, o;
  31319. if (!l(t))
  31320. throw TypeError("listener must be a function");
  31321. if (!this._events || !this._events[e])
  31322. return this;
  31323. if (r = (i = this._events[e]).length,
  31324. n = -1,
  31325. i === t || l(i.listener) && i.listener === t)
  31326. delete this._events[e],
  31327. this._events.removeListener && this.emit("removeListener", e, t);
  31328. else if (c(i)) {
  31329. for (o = r; 0 < o--; )
  31330. if (i[o] === t || i[o].listener && i[o].listener === t) {
  31331. n = o;
  31332. break
  31333. }
  31334. if (n < 0)
  31335. return this;
  31336. 1 === i.length ? (i.length = 0,
  31337. delete this._events[e]) : i.splice(n, 1),
  31338. this._events.removeListener && this.emit("removeListener", e, t)
  31339. }
  31340. return this
  31341. }
  31342. ,
  31343. n.prototype.removeAllListeners = function(e) {
  31344. var t, i;
  31345. if (!this._events)
  31346. return this;
  31347. if (!this._events.removeListener)
  31348. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  31349. this;
  31350. if (0 === arguments.length) {
  31351. for (t in this._events)
  31352. "removeListener" !== t && this.removeAllListeners(t);
  31353. return this.removeAllListeners("removeListener"),
  31354. this._events = {},
  31355. this
  31356. }
  31357. if (l(i = this._events[e]))
  31358. this.removeListener(e, i);
  31359. else if (i)
  31360. for (; i.length; )
  31361. this.removeListener(e, i[i.length - 1]);
  31362. return delete this._events[e],
  31363. this
  31364. }
  31365. ,
  31366. n.prototype.listeners = function(e) {
  31367. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  31368. }
  31369. ,
  31370. n.prototype.listenerCount = function(e) {
  31371. if (this._events) {
  31372. var t = this._events[e];
  31373. if (l(t))
  31374. return 1;
  31375. if (t)
  31376. return t.length
  31377. }
  31378. return 0
  31379. }
  31380. ,
  31381. n.listenerCount = function(e, t) {
  31382. return e.listenerCount(t)
  31383. }
  31384. }
  31385. , {}],
  31386. 203: [function(e, t, i) {
  31387. function n() {
  31388. throw new Error("setTimeout has not been defined")
  31389. }
  31390. function r() {
  31391. throw new Error("clearTimeout has not been defined")
  31392. }
  31393. function o(t) {
  31394. if (h === setTimeout)
  31395. return setTimeout(t, 0);
  31396. if ((h === n || !h) && setTimeout)
  31397. return h = setTimeout,
  31398. setTimeout(t, 0);
  31399. try {
  31400. return h(t, 0)
  31401. } catch (e) {
  31402. try {
  31403. return h.call(null, t, 0)
  31404. } catch (e) {
  31405. return h.call(this, t, 0)
  31406. }
  31407. }
  31408. }
  31409. function a() {
  31410. g && p && (g = !1,
  31411. p.length ? f = p.concat(f) : m = -1,
  31412. f.length && s())
  31413. }
  31414. function s() {
  31415. if (!g) {
  31416. var e = o(a);
  31417. g = !0;
  31418. for (var t = f.length; t; ) {
  31419. for (p = f,
  31420. f = []; ++m < t; )
  31421. p && p[m].run();
  31422. m = -1,
  31423. t = f.length
  31424. }
  31425. p = null,
  31426. g = !1,
  31427. function(t) {
  31428. if (u === clearTimeout)
  31429. return clearTimeout(t);
  31430. if ((u === r || !u) && clearTimeout)
  31431. return u = clearTimeout,
  31432. clearTimeout(t);
  31433. try {
  31434. u(t)
  31435. } catch (e) {
  31436. try {
  31437. return u.call(null, t)
  31438. } catch (e) {
  31439. return u.call(this, t)
  31440. }
  31441. }
  31442. }(e)
  31443. }
  31444. }
  31445. function l(e, t) {
  31446. this.fun = e,
  31447. this.array = t
  31448. }
  31449. function c() {}
  31450. var h, u, d = t.exports = {};
  31451. !function() {
  31452. try {
  31453. h = "function" == typeof setTimeout ? setTimeout : n
  31454. } catch (e) {
  31455. h = n
  31456. }
  31457. try {
  31458. u = "function" == typeof clearTimeout ? clearTimeout : r
  31459. } catch (e) {
  31460. u = r
  31461. }
  31462. }();
  31463. var p, f = [], g = !1, m = -1;
  31464. d.nextTick = function(e) {
  31465. var t = new Array(arguments.length - 1);
  31466. if (1 < arguments.length)
  31467. for (var i = 1; i < arguments.length; i++)
  31468. t[i - 1] = arguments[i];
  31469. f.push(new l(e,t)),
  31470. 1 !== f.length || g || o(s)
  31471. }
  31472. ,
  31473. l.prototype.run = function() {
  31474. this.fun.apply(null, this.array)
  31475. }
  31476. ,
  31477. d.title = "browser",
  31478. d.browser = !0,
  31479. d.env = {},
  31480. d.argv = [],
  31481. d.version = "",
  31482. d.versions = {},
  31483. d.on = c,
  31484. d.addListener = c,
  31485. d.once = c,
  31486. d.off = c,
  31487. d.removeListener = c,
  31488. d.removeAllListeners = c,
  31489. d.emit = c,
  31490. d.binding = function(e) {
  31491. throw new Error("process.binding is not supported")
  31492. }
  31493. ,
  31494. d.cwd = function() {
  31495. return "/"
  31496. }
  31497. ,
  31498. d.chdir = function(e) {
  31499. throw new Error("process.chdir is not supported")
  31500. }
  31501. ,
  31502. d.umask = function() {
  31503. return 0
  31504. }
  31505. }
  31506. , {}],
  31507. 204: [function(e, O, L) {
  31508. (function(P) {
  31509. !function(e) {
  31510. function v(e) {
  31511. throw new RangeError(g[e])
  31512. }
  31513. function r(e, t) {
  31514. for (var i = e.length, n = []; i--; )
  31515. n[i] = t(e[i]);
  31516. return n
  31517. }
  31518. function t(e, t) {
  31519. var i = e.split("@")
  31520. , n = "";
  31521. return 1 < i.length && (n = i[0] + "@",
  31522. e = i[1]),
  31523. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31524. }
  31525. function y(e) {
  31526. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31527. 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),
  31528. r--) : n.push(t);
  31529. return n
  31530. }
  31531. function A(e) {
  31532. return r(e, function(e) {
  31533. var t = "";
  31534. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31535. e = 56320 | 1023 & e),
  31536. t + R(e)
  31537. }).join("")
  31538. }
  31539. function C(e, t) {
  31540. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31541. }
  31542. function I(e, t, i) {
  31543. var n = 0;
  31544. for (e = i ? M(e / u) : e >> 1,
  31545. e += M(e / t); m * w >> 1 < e; n += _)
  31546. e = M(e / m);
  31547. return M(n + (m + 1) * e / (e + h))
  31548. }
  31549. function i(e) {
  31550. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31551. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31552. n = 0; n < i; ++n)
  31553. 128 <= e.charCodeAt(n) && v("not-basic"),
  31554. d.push(e.charCodeAt(n));
  31555. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31556. for (o = f,
  31557. a = 1,
  31558. s = _; p <= r && v("invalid-input"),
  31559. u = e.charCodeAt(r++),
  31560. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31561. f += l * a,
  31562. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31563. a > M(E / (h = _ - c)) && v("overflow"),
  31564. a *= h;
  31565. m = I(f - o, t = d.length + 1, 0 == o),
  31566. M(f / t) > E - g && v("overflow"),
  31567. g += M(f / t),
  31568. f %= t,
  31569. d.splice(f++, 0, g)
  31570. }
  31571. return A(d)
  31572. }
  31573. function n(e) {
  31574. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31575. for (d = (e = y(e)).length,
  31576. t = x,
  31577. o = T,
  31578. a = i = 0; a < d; ++a)
  31579. (u = e[a]) < 128 && m.push(R(u));
  31580. for (n = r = m.length,
  31581. r && m.push(S); n < d; ) {
  31582. for (s = E,
  31583. a = 0; a < d; ++a)
  31584. t <= (u = e[a]) && u < s && (s = u);
  31585. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31586. i += (s - t) * p,
  31587. t = s,
  31588. a = 0; a < d; ++a)
  31589. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31590. u == t) {
  31591. for (l = i,
  31592. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31593. g = l - h,
  31594. f = _ - h,
  31595. m.push(R(C(h + g % f, 0))),
  31596. l = M(g / f);
  31597. m.push(R(C(l, 0))),
  31598. o = I(i, p, n == r),
  31599. i = 0,
  31600. ++n
  31601. }
  31602. ++i,
  31603. ++t
  31604. }
  31605. return m.join("")
  31606. }
  31607. var o = "object" == typeof L && L && !L.nodeType && L
  31608. , a = "object" == typeof O && O && !O.nodeType && O
  31609. , s = "object" == typeof P && P;
  31610. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31611. 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 = {
  31612. overflow: "Overflow: input needs wider integers to process",
  31613. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31614. "invalid-input": "Invalid input"
  31615. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31616. if (l = {
  31617. version: "1.4.1",
  31618. ucs2: {
  31619. decode: y,
  31620. encode: A
  31621. },
  31622. decode: i,
  31623. encode: n,
  31624. toASCII: function(e) {
  31625. return t(e, function(e) {
  31626. return p.test(e) ? "xn--" + n(e) : e
  31627. })
  31628. },
  31629. toUnicode: function(e) {
  31630. return t(e, function(e) {
  31631. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31632. })
  31633. }
  31634. },
  31635. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31636. define("punycode", function() {
  31637. return l
  31638. });
  31639. else if (o && a)
  31640. if (O.exports == o)
  31641. a.exports = l;
  31642. else
  31643. for (c in l)
  31644. l.hasOwnProperty(c) && (o[c] = l[c]);
  31645. else
  31646. e.punycode = l
  31647. }(this)
  31648. }
  31649. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31650. }
  31651. , {}],
  31652. 205: [function(e, t, i) {
  31653. "use strict";
  31654. t.exports = function(e, t, i, n) {
  31655. t = t || "&",
  31656. i = i || "=";
  31657. var r = {};
  31658. if ("string" != typeof e || 0 === e.length)
  31659. return r;
  31660. var o = /\+/g;
  31661. e = e.split(t);
  31662. var a = 1e3;
  31663. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31664. var s, l, c = e.length;
  31665. 0 < a && a < c && (c = a);
  31666. for (var h = 0; h < c; ++h) {
  31667. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31668. d = 0 <= m ? (u = g.substr(0, m),
  31669. g.substr(m + 1)) : (u = g,
  31670. ""),
  31671. p = decodeURIComponent(u),
  31672. f = decodeURIComponent(d),
  31673. s = r,
  31674. l = p,
  31675. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31676. }
  31677. return r
  31678. }
  31679. ;
  31680. var v = Array.isArray || function(e) {
  31681. return "[object Array]" === Object.prototype.toString.call(e)
  31682. }
  31683. }
  31684. , {}],
  31685. 206: [function(e, t, i) {
  31686. "use strict";
  31687. function o(e, t) {
  31688. if (e.map)
  31689. return e.map(t);
  31690. for (var i = [], n = 0; n < e.length; n++)
  31691. i.push(t(e[n], n));
  31692. return i
  31693. }
  31694. function a(e) {
  31695. switch (typeof e) {
  31696. case "string":
  31697. return e;
  31698. case "boolean":
  31699. return e ? "true" : "false";
  31700. case "number":
  31701. return isFinite(e) ? e : "";
  31702. default:
  31703. return ""
  31704. }
  31705. }
  31706. t.exports = function(i, n, r, e) {
  31707. return n = n || "&",
  31708. r = r || "=",
  31709. null === i && (i = void 0),
  31710. "object" == typeof i ? o(l(i), function(e) {
  31711. var t = encodeURIComponent(a(e)) + r;
  31712. return s(i[e]) ? o(i[e], function(e) {
  31713. return t + encodeURIComponent(a(e))
  31714. }).join(n) : t + encodeURIComponent(a(i[e]))
  31715. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31716. }
  31717. ;
  31718. var s = Array.isArray || function(e) {
  31719. return "[object Array]" === Object.prototype.toString.call(e)
  31720. }
  31721. , l = Object.keys || function(e) {
  31722. var t = [];
  31723. for (var i in e)
  31724. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31725. return t
  31726. }
  31727. }
  31728. , {}],
  31729. 207: [function(e, t, i) {
  31730. "use strict";
  31731. i.decode = i.parse = e("./decode"),
  31732. i.encode = i.stringify = e("./encode")
  31733. }
  31734. , {
  31735. "./decode": 205,
  31736. "./encode": 206
  31737. }],
  31738. 208: [function(e, t, i) {
  31739. "use strict";
  31740. function x() {
  31741. this.protocol = null,
  31742. this.slashes = null,
  31743. this.auth = null,
  31744. this.host = null,
  31745. this.port = null,
  31746. this.hostname = null,
  31747. this.hash = null,
  31748. this.search = null,
  31749. this.query = null,
  31750. this.pathname = null,
  31751. this.path = null,
  31752. this.href = null
  31753. }
  31754. function n(e, t, i) {
  31755. if (e && D.isObject(e) && e instanceof x)
  31756. return e;
  31757. var n = new x;
  31758. return n.parse(e, t, i),
  31759. n
  31760. }
  31761. var L = e("punycode")
  31762. , D = e("./util");
  31763. i.parse = n,
  31764. i.resolve = function(e, t) {
  31765. return n(e, !1, !0).resolve(t)
  31766. }
  31767. ,
  31768. i.resolveObject = function(e, t) {
  31769. return e ? n(e, !1, !0).resolveObject(t) : t
  31770. }
  31771. ,
  31772. i.format = function(e) {
  31773. return D.isString(e) && (e = n(e)),
  31774. e instanceof x ? e.format() : x.prototype.format.call(e)
  31775. }
  31776. ,
  31777. i.Url = x;
  31778. var N = /^([a-z0-9.+-]+:)/i
  31779. , r = /:[0-9]*$/
  31780. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31781. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31782. , B = ["'"].concat(o)
  31783. , V = ["%", "/", "?", ";", "#"].concat(B)
  31784. , k = ["/", "?", "#"]
  31785. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31786. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31787. , z = {
  31788. javascript: !0,
  31789. "javascript:": !0
  31790. }
  31791. , G = {
  31792. javascript: !0,
  31793. "javascript:": !0
  31794. }
  31795. , W = {
  31796. http: !0,
  31797. https: !0,
  31798. ftp: !0,
  31799. gopher: !0,
  31800. file: !0,
  31801. "http:": !0,
  31802. "https:": !0,
  31803. "ftp:": !0,
  31804. "gopher:": !0,
  31805. "file:": !0
  31806. }
  31807. , j = e("querystring");
  31808. x.prototype.parse = function(e, t, i) {
  31809. if (!D.isString(e))
  31810. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31811. var n = e.indexOf("?")
  31812. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31813. , o = e.split(r);
  31814. o[0] = o[0].replace(/\\/g, "/");
  31815. var a = e = o.join(r);
  31816. if (a = a.trim(),
  31817. !i && 1 === e.split("#").length) {
  31818. var s = F.exec(a);
  31819. if (s)
  31820. return this.path = a,
  31821. this.href = a,
  31822. this.pathname = s[1],
  31823. s[2] ? (this.search = s[2],
  31824. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31825. this.query = {}),
  31826. this
  31827. }
  31828. var l = N.exec(a);
  31829. if (l) {
  31830. var c = (l = l[0]).toLowerCase();
  31831. this.protocol = c,
  31832. a = a.substr(l.length)
  31833. }
  31834. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31835. var h = "//" === a.substr(0, 2);
  31836. !h || l && G[l] || (a = a.substr(2),
  31837. this.slashes = !0)
  31838. }
  31839. if (!G[l] && (h || l && !W[l])) {
  31840. for (var u = -1, d = 0; d < k.length; d++) {
  31841. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31842. }
  31843. var p, f;
  31844. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31845. a = a.slice(f + 1),
  31846. this.auth = decodeURIComponent(p)),
  31847. u = -1;
  31848. for (d = 0; d < V.length; d++) {
  31849. var g;
  31850. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31851. }
  31852. -1 === u && (u = a.length),
  31853. this.host = a.slice(0, u),
  31854. a = a.slice(u),
  31855. this.parseHost(),
  31856. this.hostname = this.hostname || "";
  31857. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31858. if (!m)
  31859. for (var v = this.hostname.split(/\./), y = (d = 0,
  31860. v.length); d < y; d++) {
  31861. var A = v[d];
  31862. if (A && !A.match(U)) {
  31863. for (var C = "", I = 0, E = A.length; I < E; I++)
  31864. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31865. if (!C.match(U)) {
  31866. var _ = v.slice(0, d)
  31867. , b = v.slice(d + 1)
  31868. , w = A.match(H);
  31869. w && (_.push(w[1]),
  31870. b.unshift(w[2])),
  31871. b.length && (a = "/" + b.join(".") + a),
  31872. this.hostname = _.join(".");
  31873. break
  31874. }
  31875. }
  31876. }
  31877. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31878. m || (this.hostname = L.toASCII(this.hostname));
  31879. var T = this.port ? ":" + this.port : ""
  31880. , x = this.hostname || "";
  31881. this.host = x + T,
  31882. this.href += this.host,
  31883. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31884. "/" !== a[0] && (a = "/" + a))
  31885. }
  31886. if (!z[c])
  31887. for (d = 0,
  31888. y = B.length; d < y; d++) {
  31889. var S = B[d];
  31890. if (-1 !== a.indexOf(S)) {
  31891. var M = encodeURIComponent(S);
  31892. M === S && (M = escape(S)),
  31893. a = a.split(S).join(M)
  31894. }
  31895. }
  31896. var R = a.indexOf("#");
  31897. -1 !== R && (this.hash = a.substr(R),
  31898. a = a.slice(0, R));
  31899. var P = a.indexOf("?");
  31900. if (-1 !== P ? (this.search = a.substr(P),
  31901. this.query = a.substr(P + 1),
  31902. t && (this.query = j.parse(this.query)),
  31903. a = a.slice(0, P)) : t && (this.search = "",
  31904. this.query = {}),
  31905. a && (this.pathname = a),
  31906. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31907. this.pathname || this.search) {
  31908. T = this.pathname || "";
  31909. var O = this.search || "";
  31910. this.path = T + O
  31911. }
  31912. return this.href = this.format(),
  31913. this
  31914. }
  31915. ,
  31916. x.prototype.format = function() {
  31917. var e = this.auth || "";
  31918. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31919. e += "@");
  31920. var t = this.protocol || ""
  31921. , i = this.pathname || ""
  31922. , n = this.hash || ""
  31923. , r = !1
  31924. , o = "";
  31925. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31926. this.port && (r += ":" + this.port)),
  31927. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31928. var a = this.search || o && "?" + o || "";
  31929. return t && ":" !== t.substr(-1) && (t += ":"),
  31930. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31931. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31932. n && "#" !== n.charAt(0) && (n = "#" + n),
  31933. a && "?" !== a.charAt(0) && (a = "?" + a),
  31934. t + r + (i = i.replace(/[?#]/g, function(e) {
  31935. return encodeURIComponent(e)
  31936. })) + (a = a.replace("#", "%23")) + n
  31937. }
  31938. ,
  31939. x.prototype.resolve = function(e) {
  31940. return this.resolveObject(n(e, !1, !0)).format()
  31941. }
  31942. ,
  31943. x.prototype.resolveObject = function(e) {
  31944. if (D.isString(e)) {
  31945. var t = new x;
  31946. t.parse(e, !1, !0),
  31947. e = t
  31948. }
  31949. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31950. var o = n[r];
  31951. i[o] = this[o]
  31952. }
  31953. if (i.hash = e.hash,
  31954. "" === e.href)
  31955. return i.href = i.format(),
  31956. i;
  31957. if (e.slashes && !e.protocol) {
  31958. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31959. var l = a[s];
  31960. "protocol" !== l && (i[l] = e[l])
  31961. }
  31962. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31963. i.href = i.format(),
  31964. i
  31965. }
  31966. if (e.protocol && e.protocol !== i.protocol) {
  31967. if (!W[e.protocol]) {
  31968. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31969. var u = c[h];
  31970. i[u] = e[u]
  31971. }
  31972. return i.href = i.format(),
  31973. i
  31974. }
  31975. if (i.protocol = e.protocol,
  31976. e.host || G[e.protocol])
  31977. i.pathname = e.pathname;
  31978. else {
  31979. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31980. ;
  31981. e.host || (e.host = ""),
  31982. e.hostname || (e.hostname = ""),
  31983. "" !== d[0] && d.unshift(""),
  31984. d.length < 2 && d.unshift(""),
  31985. i.pathname = d.join("/")
  31986. }
  31987. if (i.search = e.search,
  31988. i.query = e.query,
  31989. i.host = e.host || "",
  31990. i.auth = e.auth,
  31991. i.hostname = e.hostname || e.host,
  31992. i.port = e.port,
  31993. i.pathname || i.search) {
  31994. var p = i.pathname || ""
  31995. , f = i.search || "";
  31996. i.path = p + f
  31997. }
  31998. return i.slashes = i.slashes || e.slashes,
  31999. i.href = i.format(),
  32000. i
  32001. }
  32002. var g = i.pathname && "/" === i.pathname.charAt(0)
  32003. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  32004. , v = m || g || i.host && e.pathname
  32005. , y = v
  32006. , A = i.pathname && i.pathname.split("/") || []
  32007. , C = (d = e.pathname && e.pathname.split("/") || [],
  32008. i.protocol && !W[i.protocol]);
  32009. if (C && (i.hostname = "",
  32010. i.port = null,
  32011. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  32012. i.host = "",
  32013. e.protocol && (e.hostname = null,
  32014. e.port = null,
  32015. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  32016. e.host = null),
  32017. v = v && ("" === d[0] || "" === A[0])),
  32018. m)
  32019. i.host = e.host || "" === e.host ? e.host : i.host,
  32020. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  32021. i.search = e.search,
  32022. i.query = e.query,
  32023. A = d;
  32024. else if (d.length)
  32025. (A = A || []).pop(),
  32026. A = A.concat(d),
  32027. i.search = e.search,
  32028. i.query = e.query;
  32029. else if (!D.isNullOrUndefined(e.search)) {
  32030. if (C)
  32031. i.hostname = i.host = A.shift(),
  32032. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  32033. i.host = i.hostname = w.shift());
  32034. return i.search = e.search,
  32035. i.query = e.query,
  32036. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  32037. i.href = i.format(),
  32038. i
  32039. }
  32040. if (!A.length)
  32041. return i.pathname = null,
  32042. i.search ? i.path = "/" + i.search : i.path = null,
  32043. i.href = i.format(),
  32044. i;
  32045. 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--)
  32046. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  32047. _++) : _ && (A.splice(b, 1),
  32048. _--);
  32049. if (!v && !y)
  32050. for (; _--; )
  32051. A.unshift("..");
  32052. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  32053. E && "/" !== A.join("/").substr(-1) && A.push("");
  32054. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  32055. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  32056. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  32057. i.host = i.hostname = w.shift()));
  32058. return (v = v || i.host && A.length) && !T && A.unshift(""),
  32059. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  32060. i.path = null),
  32061. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  32062. i.auth = e.auth || i.auth,
  32063. i.slashes = i.slashes || e.slashes,
  32064. i.href = i.format(),
  32065. i
  32066. }
  32067. ,
  32068. x.prototype.parseHost = function() {
  32069. var e = this.host
  32070. , t = r.exec(e);
  32071. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  32072. e = e.substr(0, e.length - t.length)),
  32073. e && (this.hostname = e)
  32074. }
  32075. }
  32076. , {
  32077. "./util": 209,
  32078. punycode: 204,
  32079. querystring: 207
  32080. }],
  32081. 209: [function(e, t, i) {
  32082. "use strict";
  32083. t.exports = {
  32084. isString: function(e) {
  32085. return "string" == typeof e
  32086. },
  32087. isObject: function(e) {
  32088. return "object" == typeof e && null !== e
  32089. },
  32090. isNull: function(e) {
  32091. return null === e
  32092. },
  32093. isNullOrUndefined: function(e) {
  32094. return null == e
  32095. }
  32096. }
  32097. }
  32098. , {}],
  32099. 210: [function(e, t, i) {
  32100. "use strict";
  32101. function r(e) {
  32102. return c + e
  32103. }
  32104. function s(e) {
  32105. if ("string" != typeof e)
  32106. throw new TypeError("key must be a string.")
  32107. }
  32108. var l = Object.prototype.hasOwnProperty
  32109. , c = "~";
  32110. t.exports = function(t) {
  32111. var o = Object.create(null)
  32112. , n = 0
  32113. , a = {};
  32114. return function(e, t) {
  32115. for (var i in t)
  32116. Object.defineProperty(e, i, {
  32117. value: t[i],
  32118. configurable: !0,
  32119. writable: !0
  32120. })
  32121. }(a, {
  32122. get: function(e, t) {
  32123. s(e);
  32124. var i = r(e);
  32125. return i in o ? o[i] : t
  32126. },
  32127. set: function(e, t) {
  32128. s(e);
  32129. var i = r(e);
  32130. return i in o || ++n,
  32131. o[i] = t
  32132. },
  32133. has: function(e) {
  32134. return s(e),
  32135. r(e)in o
  32136. },
  32137. delete: function(e) {
  32138. s(e);
  32139. var t = r(e);
  32140. return t in o && (--n,
  32141. delete o[t],
  32142. !0)
  32143. },
  32144. clear: function() {
  32145. o = Object.create(null),
  32146. n = 0
  32147. },
  32148. forEach: function(e, t) {
  32149. if ("function" != typeof e)
  32150. throw new TypeError("`callback` must be a function");
  32151. for (var i in o)
  32152. if (l.call(o, i)) {
  32153. var n = i.substring(c.length)
  32154. , r = o[i];
  32155. e.call(t, r, n, a)
  32156. }
  32157. }
  32158. }),
  32159. Object.defineProperty(a, "size", {
  32160. get: function() {
  32161. return n
  32162. },
  32163. configurable: !0
  32164. }),
  32165. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  32166. a.set(e, t[e])
  32167. }),
  32168. a
  32169. }
  32170. }
  32171. , {}],
  32172. 211: [function(e, t, i) {
  32173. t.exports = e("./lib/heap")
  32174. }
  32175. , {
  32176. "./lib/heap": 212
  32177. }],
  32178. 212: [function(e, y, A) {
  32179. (function() {
  32180. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  32181. function v(e) {
  32182. this.cmp = null != e ? e : d,
  32183. this.nodes = []
  32184. }
  32185. l = Math.floor,
  32186. m = Math.min,
  32187. d = function(e, t) {
  32188. return e < t ? -1 : t < e ? 1 : 0
  32189. }
  32190. ,
  32191. g = function(e, t, i, n, r) {
  32192. var o;
  32193. if (null == i && (i = 0),
  32194. null == r && (r = d),
  32195. i < 0)
  32196. throw new Error("lo must be non-negative");
  32197. for (null == n && (n = e.length); i < n; )
  32198. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  32199. return [].splice.apply(e, [i, i - i].concat(t)),
  32200. t
  32201. }
  32202. ,
  32203. t = function(e, t, i) {
  32204. return null == i && (i = d),
  32205. e.push(t),
  32206. h(e, 0, e.length - 1, i)
  32207. }
  32208. ,
  32209. f = function(e, t) {
  32210. var i, n;
  32211. return null == t && (t = d),
  32212. i = e.pop(),
  32213. e.length ? (n = e[0],
  32214. e[0] = i,
  32215. u(e, 0, t)) : n = i,
  32216. n
  32217. }
  32218. ,
  32219. i = function(e, t, i) {
  32220. var n;
  32221. return null == i && (i = d),
  32222. n = e[0],
  32223. e[0] = t,
  32224. u(e, 0, i),
  32225. n
  32226. }
  32227. ,
  32228. c = function(e, t, i) {
  32229. var n;
  32230. return null == i && (i = d),
  32231. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  32232. e[0] = n[1],
  32233. u(e, 0, i)),
  32234. t
  32235. }
  32236. ,
  32237. p = function(i, e) {
  32238. var t, n, r, o, a, s;
  32239. for (null == e && (e = d),
  32240. a = [],
  32241. n = 0,
  32242. r = (o = function() {
  32243. s = [];
  32244. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  32245. s.push(e);
  32246. return s
  32247. }
  32248. .apply(this).reverse()).length; n < r; n++)
  32249. t = o[n],
  32250. a.push(u(i, t, e));
  32251. return a
  32252. }
  32253. ,
  32254. o = function(e, t, i) {
  32255. var n;
  32256. if (null == i && (i = d),
  32257. -1 !== (n = e.indexOf(t)))
  32258. return h(e, 0, n, i),
  32259. u(e, n, i)
  32260. }
  32261. ,
  32262. n = function(e, t, i) {
  32263. var n, r, o, a, s;
  32264. if (null == i && (i = d),
  32265. !(r = e.slice(0, t)).length)
  32266. return r;
  32267. for (p(r, i),
  32268. o = 0,
  32269. a = (s = e.slice(t)).length; o < a; o++)
  32270. n = s[o],
  32271. c(r, n, i);
  32272. return r.sort(i).reverse()
  32273. }
  32274. ,
  32275. r = function(e, t, i) {
  32276. var n, r, o, a, s, l, c, h, u;
  32277. if (null == i && (i = d),
  32278. 10 * t <= e.length) {
  32279. if (!(o = e.slice(0, t).sort(i)).length)
  32280. return o;
  32281. for (r = o[o.length - 1],
  32282. a = 0,
  32283. l = (c = e.slice(t)).length; a < l; a++)
  32284. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  32285. o.pop(),
  32286. r = o[o.length - 1]);
  32287. return o
  32288. }
  32289. for (p(e, i),
  32290. u = [],
  32291. s = 0,
  32292. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  32293. u.push(f(e, i));
  32294. return u
  32295. }
  32296. ,
  32297. h = function(e, t, i, n) {
  32298. var r, o, a;
  32299. for (null == n && (n = d),
  32300. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  32301. e[i] = o,
  32302. i = a;
  32303. return e[i] = r
  32304. }
  32305. ,
  32306. u = function(e, t, i) {
  32307. var n, r, o, a, s;
  32308. for (null == i && (i = d),
  32309. r = e.length,
  32310. o = e[s = t],
  32311. n = 2 * t + 1; n < r; )
  32312. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  32313. e[t] = e[n],
  32314. n = 2 * (t = n) + 1;
  32315. return e[t] = o,
  32316. h(e, s, t, i)
  32317. }
  32318. ,
  32319. v.push = t,
  32320. v.pop = f,
  32321. v.replace = i,
  32322. v.pushpop = c,
  32323. v.heapify = p,
  32324. v.updateItem = o,
  32325. v.nlargest = n,
  32326. v.nsmallest = r,
  32327. v.prototype.push = function(e) {
  32328. return t(this.nodes, e, this.cmp)
  32329. }
  32330. ,
  32331. v.prototype.pop = function() {
  32332. return f(this.nodes, this.cmp)
  32333. }
  32334. ,
  32335. v.prototype.peek = function() {
  32336. return this.nodes[0]
  32337. }
  32338. ,
  32339. v.prototype.contains = function(e) {
  32340. return -1 !== this.nodes.indexOf(e)
  32341. }
  32342. ,
  32343. v.prototype.replace = function(e) {
  32344. return i(this.nodes, e, this.cmp)
  32345. }
  32346. ,
  32347. v.prototype.pushpop = function(e) {
  32348. return c(this.nodes, e, this.cmp)
  32349. }
  32350. ,
  32351. v.prototype.heapify = function() {
  32352. return p(this.nodes, this.cmp)
  32353. }
  32354. ,
  32355. v.prototype.updateItem = function(e) {
  32356. return o(this.nodes, e, this.cmp)
  32357. }
  32358. ,
  32359. v.prototype.clear = function() {
  32360. return this.nodes = []
  32361. }
  32362. ,
  32363. v.prototype.empty = function() {
  32364. return 0 === this.nodes.length
  32365. }
  32366. ,
  32367. v.prototype.size = function() {
  32368. return this.nodes.length
  32369. }
  32370. ,
  32371. v.prototype.clone = function() {
  32372. var e;
  32373. return (e = new v).nodes = this.nodes.slice(0),
  32374. e
  32375. }
  32376. ,
  32377. v.prototype.toArray = function() {
  32378. return this.nodes.slice(0)
  32379. }
  32380. ,
  32381. v.prototype.insert = v.prototype.push,
  32382. v.prototype.top = v.prototype.peek,
  32383. v.prototype.front = v.prototype.peek,
  32384. v.prototype.has = v.prototype.contains,
  32385. v.prototype.copy = v.prototype.clone,
  32386. e = v,
  32387. a = this,
  32388. s = function() {
  32389. return e
  32390. }
  32391. ,
  32392. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  32393. }
  32394. ).call(this)
  32395. }
  32396. , {}],
  32397. 213: [function(e, t, i) {
  32398. function n() {}
  32399. function o(e) {
  32400. if ("object" != typeof this)
  32401. throw new TypeError("Promises must be constructed via new");
  32402. if ("function" != typeof e)
  32403. throw new TypeError("not a function");
  32404. this._state = 0,
  32405. this._handled = !1,
  32406. this._value = void 0,
  32407. this._deferreds = [],
  32408. h(e, this)
  32409. }
  32410. function r(i, n) {
  32411. for (; 3 === i._state; )
  32412. i = i._value;
  32413. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  32414. void o._immediateFn(function() {
  32415. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  32416. if (null !== e) {
  32417. var t;
  32418. try {
  32419. t = e(i._value)
  32420. } catch (e) {
  32421. return void s(n.promise, e)
  32422. }
  32423. a(n.promise, t)
  32424. } else
  32425. (1 === i._state ? a : s)(n.promise, i._value)
  32426. }))
  32427. }
  32428. function a(e, t) {
  32429. try {
  32430. if (t === e)
  32431. throw new TypeError("A promise cannot be resolved with itself.");
  32432. if (t && ("object" == typeof t || "function" == typeof t)) {
  32433. var i = t.then;
  32434. if (t instanceof o)
  32435. return e._state = 3,
  32436. e._value = t,
  32437. void l(e);
  32438. if ("function" == typeof i)
  32439. return void h(function(e, t) {
  32440. return function() {
  32441. e.apply(t, arguments)
  32442. }
  32443. }(i, t), e)
  32444. }
  32445. e._state = 1,
  32446. e._value = t,
  32447. l(e)
  32448. } catch (t) {
  32449. s(e, t)
  32450. }
  32451. }
  32452. function s(e, t) {
  32453. e._state = 2,
  32454. e._value = t,
  32455. l(e)
  32456. }
  32457. function l(e) {
  32458. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  32459. e._handled || o._unhandledRejectionFn(e._value)
  32460. });
  32461. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32462. r(e, e._deferreds[t]);
  32463. e._deferreds = null
  32464. }
  32465. function c(e, t, i) {
  32466. this.onFulfilled = "function" == typeof e ? e : null,
  32467. this.onRejected = "function" == typeof t ? t : null,
  32468. this.promise = i
  32469. }
  32470. function h(e, t) {
  32471. var i = !1;
  32472. try {
  32473. e(function(e) {
  32474. i || (i = !0,
  32475. a(t, e))
  32476. }, function(e) {
  32477. i || (i = !0,
  32478. s(t, e))
  32479. })
  32480. } catch (e) {
  32481. if (i)
  32482. return;
  32483. i = !0,
  32484. s(t, e)
  32485. }
  32486. }
  32487. var u, d;
  32488. u = this,
  32489. d = setTimeout,
  32490. o.prototype.catch = function(e) {
  32491. return this.then(null, e)
  32492. }
  32493. ,
  32494. o.prototype.then = function(e, t) {
  32495. var i = new this.constructor(n);
  32496. return r(this, new c(e,t,i)),
  32497. i
  32498. }
  32499. ,
  32500. o.all = function(e) {
  32501. var s = Array.prototype.slice.call(e);
  32502. return new o(function(n, r) {
  32503. function o(t, e) {
  32504. try {
  32505. if (e && ("object" == typeof e || "function" == typeof e)) {
  32506. var i = e.then;
  32507. if ("function" == typeof i)
  32508. return void i.call(e, function(e) {
  32509. o(t, e)
  32510. }, r)
  32511. }
  32512. s[t] = e,
  32513. 0 == --a && n(s)
  32514. } catch (e) {
  32515. r(e)
  32516. }
  32517. }
  32518. if (0 === s.length)
  32519. return n([]);
  32520. for (var a = s.length, e = 0; e < s.length; e++)
  32521. o(e, s[e])
  32522. }
  32523. )
  32524. }
  32525. ,
  32526. o.resolve = function(t) {
  32527. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32528. e(t)
  32529. }
  32530. )
  32531. }
  32532. ,
  32533. o.reject = function(i) {
  32534. return new o(function(e, t) {
  32535. t(i)
  32536. }
  32537. )
  32538. }
  32539. ,
  32540. o.race = function(r) {
  32541. return new o(function(e, t) {
  32542. for (var i = 0, n = r.length; i < n; i++)
  32543. r[i].then(e, t)
  32544. }
  32545. )
  32546. }
  32547. ,
  32548. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32549. setImmediate(e)
  32550. }
  32551. || function(e) {
  32552. d(e, 0)
  32553. }
  32554. ,
  32555. o._unhandledRejectionFn = function(e) {
  32556. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32557. }
  32558. ,
  32559. o._setImmediateFn = function(e) {
  32560. o._immediateFn = e
  32561. }
  32562. ,
  32563. o._setUnhandledRejectionFn = function(e) {
  32564. o._unhandledRejectionFn = e
  32565. }
  32566. ,
  32567. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32568. }
  32569. , {}],
  32570. 214: [function(p, i, e) {
  32571. (function(d) {
  32572. var e, t;
  32573. e = this,
  32574. t = function(I, e) {
  32575. "use strict";
  32576. var a, t, u, i, s, n, r, o = {};
  32577. return o.ByteBuffer = I,
  32578. o.Long = I.Long || null,
  32579. o.VERSION = "5.0.1",
  32580. o.WIRE_TYPES = {},
  32581. o.WIRE_TYPES.VARINT = 0,
  32582. o.WIRE_TYPES.BITS64 = 1,
  32583. o.WIRE_TYPES.LDELIM = 2,
  32584. o.WIRE_TYPES.STARTGROUP = 3,
  32585. o.WIRE_TYPES.ENDGROUP = 4,
  32586. o.WIRE_TYPES.BITS32 = 5,
  32587. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32588. o.TYPES = {
  32589. int32: {
  32590. name: "int32",
  32591. wireType: o.WIRE_TYPES.VARINT,
  32592. defaultValue: 0
  32593. },
  32594. uint32: {
  32595. name: "uint32",
  32596. wireType: o.WIRE_TYPES.VARINT,
  32597. defaultValue: 0
  32598. },
  32599. sint32: {
  32600. name: "sint32",
  32601. wireType: o.WIRE_TYPES.VARINT,
  32602. defaultValue: 0
  32603. },
  32604. int64: {
  32605. name: "int64",
  32606. wireType: o.WIRE_TYPES.VARINT,
  32607. defaultValue: o.Long ? o.Long.ZERO : void 0
  32608. },
  32609. uint64: {
  32610. name: "uint64",
  32611. wireType: o.WIRE_TYPES.VARINT,
  32612. defaultValue: o.Long ? o.Long.UZERO : void 0
  32613. },
  32614. sint64: {
  32615. name: "sint64",
  32616. wireType: o.WIRE_TYPES.VARINT,
  32617. defaultValue: o.Long ? o.Long.ZERO : void 0
  32618. },
  32619. bool: {
  32620. name: "bool",
  32621. wireType: o.WIRE_TYPES.VARINT,
  32622. defaultValue: !1
  32623. },
  32624. double: {
  32625. name: "double",
  32626. wireType: o.WIRE_TYPES.BITS64,
  32627. defaultValue: 0
  32628. },
  32629. string: {
  32630. name: "string",
  32631. wireType: o.WIRE_TYPES.LDELIM,
  32632. defaultValue: ""
  32633. },
  32634. bytes: {
  32635. name: "bytes",
  32636. wireType: o.WIRE_TYPES.LDELIM,
  32637. defaultValue: null
  32638. },
  32639. fixed32: {
  32640. name: "fixed32",
  32641. wireType: o.WIRE_TYPES.BITS32,
  32642. defaultValue: 0
  32643. },
  32644. sfixed32: {
  32645. name: "sfixed32",
  32646. wireType: o.WIRE_TYPES.BITS32,
  32647. defaultValue: 0
  32648. },
  32649. fixed64: {
  32650. name: "fixed64",
  32651. wireType: o.WIRE_TYPES.BITS64,
  32652. defaultValue: o.Long ? o.Long.UZERO : void 0
  32653. },
  32654. sfixed64: {
  32655. name: "sfixed64",
  32656. wireType: o.WIRE_TYPES.BITS64,
  32657. defaultValue: o.Long ? o.Long.ZERO : void 0
  32658. },
  32659. float: {
  32660. name: "float",
  32661. wireType: o.WIRE_TYPES.BITS32,
  32662. defaultValue: 0
  32663. },
  32664. enum: {
  32665. name: "enum",
  32666. wireType: o.WIRE_TYPES.VARINT,
  32667. defaultValue: 0
  32668. },
  32669. message: {
  32670. name: "message",
  32671. wireType: o.WIRE_TYPES.LDELIM,
  32672. defaultValue: null
  32673. },
  32674. group: {
  32675. name: "group",
  32676. wireType: o.WIRE_TYPES.STARTGROUP,
  32677. defaultValue: null
  32678. }
  32679. },
  32680. 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],
  32681. o.ID_MIN = 1,
  32682. o.ID_MAX = 536870911,
  32683. o.convertFieldsToCamelCase = !1,
  32684. o.populateAccessors = !0,
  32685. o.populateDefaults = !0,
  32686. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32687. r.XHR = function() {
  32688. for (var e = [function() {
  32689. return new XMLHttpRequest
  32690. }
  32691. , function() {
  32692. return new ActiveXObject("Msxml2.XMLHTTP")
  32693. }
  32694. , function() {
  32695. return new ActiveXObject("Msxml3.XMLHTTP")
  32696. }
  32697. , function() {
  32698. return new ActiveXObject("Microsoft.XMLHTTP")
  32699. }
  32700. ], t = null, i = 0; i < e.length; i++) {
  32701. try {
  32702. t = e[i]()
  32703. } catch (e) {
  32704. continue
  32705. }
  32706. break
  32707. }
  32708. if (!t)
  32709. throw Error("XMLHttpRequest is not supported");
  32710. return t
  32711. }
  32712. ,
  32713. r.fetch = function(e, i) {
  32714. if (i && "function" != typeof i && (i = null),
  32715. r.IS_NODE) {
  32716. var t = p("fs");
  32717. if (i)
  32718. t.readFile(e, function(e, t) {
  32719. i(e ? null : "" + t)
  32720. });
  32721. else
  32722. try {
  32723. return t.readFileSync(e)
  32724. } catch (e) {
  32725. return null
  32726. }
  32727. } else {
  32728. var n = r.XHR();
  32729. if (n.open("GET", e, !!i),
  32730. n.setRequestHeader("Accept", "text/plain"),
  32731. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32732. !i)
  32733. return n.send(null),
  32734. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32735. if (n.onreadystatechange = function() {
  32736. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32737. }
  32738. ,
  32739. 4 == n.readyState)
  32740. return;
  32741. n.send(null)
  32742. }
  32743. }
  32744. ,
  32745. r.toCamelCase = function(e) {
  32746. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32747. return t.toUpperCase()
  32748. })
  32749. }
  32750. ,
  32751. r),
  32752. o.Lang = {
  32753. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32754. RULE: /^(?:required|optional|repeated|map)$/,
  32755. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32756. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32757. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32758. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32759. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32760. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32761. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32762. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32763. NUMBER_OCT: /^0[0-7]+$/,
  32764. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32765. BOOL: /^(?:true|false)$/i,
  32766. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32767. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32768. WHITESPACE: /\s/,
  32769. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32770. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32771. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32772. },
  32773. o.DotProto = function(r, a) {
  32774. function s(e, t) {
  32775. var i = -1
  32776. , n = 1;
  32777. if ("-" == e.charAt(0) && (n = -1,
  32778. e = e.substring(1)),
  32779. a.NUMBER_DEC.test(e))
  32780. i = parseInt(e);
  32781. else if (a.NUMBER_HEX.test(e))
  32782. i = parseInt(e.substring(2), 16);
  32783. else {
  32784. if (!a.NUMBER_OCT.test(e))
  32785. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32786. i = parseInt(e.substring(1), 8)
  32787. }
  32788. if (i = n * i | 0,
  32789. !t && i < 0)
  32790. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32791. return i
  32792. }
  32793. function o(e) {
  32794. var t = 1;
  32795. if ("-" == e.charAt(0) && (t = -1,
  32796. e = e.substring(1)),
  32797. a.NUMBER_DEC.test(e))
  32798. return t * parseInt(e, 10);
  32799. if (a.NUMBER_HEX.test(e))
  32800. return t * parseInt(e.substring(2), 16);
  32801. if (a.NUMBER_OCT.test(e))
  32802. return t * parseInt(e.substring(1), 8);
  32803. if ("inf" === e)
  32804. return t * (1 / 0);
  32805. if ("nan" === e)
  32806. return NaN;
  32807. if (a.NUMBER_FLT.test(e))
  32808. return t * parseFloat(e);
  32809. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32810. }
  32811. function n(e, t, i) {
  32812. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32813. e[t].push(i))
  32814. }
  32815. function t(e) {
  32816. this.source = e + "",
  32817. this.index = 0,
  32818. this.line = 1,
  32819. this.stack = [],
  32820. this._stringOpen = null
  32821. }
  32822. var e = {}
  32823. , i = t.prototype;
  32824. i._readString = function() {
  32825. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32826. e.lastIndex = this.index - 1;
  32827. var t = e.exec(this.source);
  32828. if (!t)
  32829. throw Error("unterminated string");
  32830. return this.index = e.lastIndex,
  32831. this.stack.push(this._stringOpen),
  32832. this._stringOpen = null,
  32833. t[1]
  32834. }
  32835. ,
  32836. i.next = function() {
  32837. if (0 < this.stack.length)
  32838. return this.stack.shift();
  32839. if (this.index >= this.source.length)
  32840. return null;
  32841. if (null !== this._stringOpen)
  32842. return this._readString();
  32843. var e, t, i;
  32844. do {
  32845. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32846. if ("\n" === i && ++this.line,
  32847. ++this.index === this.source.length)
  32848. return null;
  32849. if ("/" === this.source.charAt(this.index))
  32850. if (++this.index,
  32851. "/" === this.source.charAt(this.index)) {
  32852. for (; "\n" !== this.source.charAt(++this.index); )
  32853. if (this.index == this.source.length)
  32854. return null;
  32855. ++this.index,
  32856. ++this.line,
  32857. e = !0
  32858. } else {
  32859. if ("*" !== (i = this.source.charAt(this.index)))
  32860. return "/";
  32861. do {
  32862. if ("\n" === i && ++this.line,
  32863. ++this.index === this.source.length)
  32864. return null;
  32865. t = i,
  32866. i = this.source.charAt(this.index)
  32867. } while ("*" !== t || "/" !== i);++this.index,
  32868. e = !0
  32869. }
  32870. } while (e);if (this.index === this.source.length)
  32871. return null;
  32872. var n = this.index;
  32873. if (a.DELIM.lastIndex = 0,
  32874. !a.DELIM.test(this.source.charAt(n++)))
  32875. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32876. ++n;
  32877. var r = this.source.substring(this.index, this.index = n);
  32878. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32879. r
  32880. }
  32881. ,
  32882. i.peek = function() {
  32883. if (0 === this.stack.length) {
  32884. var e = this.next();
  32885. if (null === e)
  32886. return null;
  32887. this.stack.push(e)
  32888. }
  32889. return this.stack[0]
  32890. }
  32891. ,
  32892. i.skip = function(e) {
  32893. var t = this.next();
  32894. if (t !== e)
  32895. throw Error("illegal '" + t + "', '" + e + "' expected")
  32896. }
  32897. ,
  32898. i.omit = function(e) {
  32899. return this.peek() === e && (this.next(),
  32900. !0)
  32901. }
  32902. ,
  32903. i.toString = function() {
  32904. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32905. }
  32906. ,
  32907. e.Tokenizer = t;
  32908. function l(e) {
  32909. this.tn = new t(e),
  32910. this.proto3 = !1
  32911. }
  32912. var c = l.prototype;
  32913. return c.parse = function() {
  32914. var e, t, i = {
  32915. name: "[ROOT]",
  32916. package: null,
  32917. messages: [],
  32918. enums: [],
  32919. imports: [],
  32920. options: {},
  32921. services: []
  32922. }, n = !0;
  32923. try {
  32924. for (; e = this.tn.next(); )
  32925. switch (e) {
  32926. case "package":
  32927. if (!n || null !== i.package)
  32928. throw Error("unexpected 'package'");
  32929. if (e = this.tn.next(),
  32930. !a.TYPEREF.test(e))
  32931. throw Error("illegal package name: " + e);
  32932. this.tn.skip(";"),
  32933. i.package = e;
  32934. break;
  32935. case "import":
  32936. if (!n)
  32937. throw Error("unexpected 'import'");
  32938. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32939. e = this._readString(),
  32940. this.tn.skip(";"),
  32941. t || i.imports.push(e);
  32942. break;
  32943. case "syntax":
  32944. if (!n)
  32945. throw Error("unexpected 'syntax'");
  32946. this.tn.skip("="),
  32947. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32948. this.tn.skip(";");
  32949. break;
  32950. case "message":
  32951. this._parseMessage(i, null),
  32952. n = !1;
  32953. break;
  32954. case "enum":
  32955. this._parseEnum(i),
  32956. n = !1;
  32957. break;
  32958. case "option":
  32959. this._parseOption(i);
  32960. break;
  32961. case "service":
  32962. this._parseService(i);
  32963. break;
  32964. case "extend":
  32965. this._parseExtend(i);
  32966. break;
  32967. default:
  32968. throw Error("unexpected '" + e + "'")
  32969. }
  32970. } catch (e) {
  32971. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32972. e
  32973. }
  32974. return delete i.name,
  32975. i
  32976. }
  32977. ,
  32978. l.parse = function(e) {
  32979. return new l(e).parse()
  32980. }
  32981. ,
  32982. c._readString = function() {
  32983. var e, t, i = "";
  32984. do {
  32985. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32986. throw Error("illegal string delimiter: " + t);
  32987. i += this.tn.next(),
  32988. this.tn.skip(t),
  32989. e = this.tn.peek()
  32990. } while ('"' === e || '"' === e);return i
  32991. }
  32992. ,
  32993. c._readValue = function(e) {
  32994. var t = this.tn.peek();
  32995. if ('"' === t || "'" === t)
  32996. return this._readString();
  32997. if (this.tn.next(),
  32998. a.NUMBER.test(t))
  32999. return o(t);
  33000. if (a.BOOL.test(t))
  33001. return "true" === t.toLowerCase();
  33002. if (e && a.TYPEREF.test(t))
  33003. return t;
  33004. throw Error("illegal value: " + t)
  33005. }
  33006. ,
  33007. c._parseOption = function(e, t) {
  33008. var i = this.tn.next()
  33009. , n = !1;
  33010. if ("(" === i && (n = !0,
  33011. i = this.tn.next()),
  33012. !a.TYPEREF.test(i))
  33013. throw Error("illegal option name: " + i);
  33014. var r = i;
  33015. n && (this.tn.skip(")"),
  33016. r = "(" + r + ")",
  33017. i = this.tn.peek(),
  33018. a.FQTYPEREF.test(i) && (r += i,
  33019. this.tn.next())),
  33020. this.tn.skip("="),
  33021. this._parseOptionValue(e, r),
  33022. t || this.tn.skip(";")
  33023. }
  33024. ,
  33025. c._parseOptionValue = function(e, t) {
  33026. var i = this.tn.peek();
  33027. if ("{" !== i)
  33028. n(e.options, t, this._readValue(!0));
  33029. else
  33030. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  33031. if (!a.NAME.test(i))
  33032. throw Error("illegal option name: " + t + "." + i);
  33033. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  33034. }
  33035. }
  33036. ,
  33037. c._parseService = function(e) {
  33038. var t = this.tn.next();
  33039. if (!a.NAME.test(t))
  33040. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  33041. var i = {
  33042. name: t,
  33043. rpc: {},
  33044. options: {}
  33045. };
  33046. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33047. if ("option" === t)
  33048. this._parseOption(i);
  33049. else {
  33050. if ("rpc" !== t)
  33051. throw Error("illegal service token: " + t);
  33052. this._parseServiceRPC(i)
  33053. }
  33054. this.tn.omit(";"),
  33055. e.services.push(i)
  33056. }
  33057. ,
  33058. c._parseServiceRPC = function(e) {
  33059. var t = this.tn.next();
  33060. if (!a.NAME.test(t))
  33061. throw Error("illegal rpc service method name: " + t);
  33062. var i = t
  33063. , n = {
  33064. request: null,
  33065. response: null,
  33066. request_stream: !1,
  33067. response_stream: !1,
  33068. options: {}
  33069. };
  33070. if (this.tn.skip("("),
  33071. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  33072. t = this.tn.next()),
  33073. !a.TYPEREF.test(t))
  33074. throw Error("illegal rpc service request type: " + t);
  33075. if (n.request = t,
  33076. this.tn.skip(")"),
  33077. "returns" !== (t = this.tn.next()).toLowerCase())
  33078. throw Error("illegal rpc service request type delimiter: " + t);
  33079. if (this.tn.skip("("),
  33080. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  33081. t = this.tn.next()),
  33082. n.response = t,
  33083. this.tn.skip(")"),
  33084. "{" === (t = this.tn.peek())) {
  33085. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  33086. if ("option" !== t)
  33087. throw Error("illegal rpc service token: " + t);
  33088. this._parseOption(n)
  33089. }
  33090. this.tn.omit(";")
  33091. } else
  33092. this.tn.skip(";");
  33093. void 0 === e.rpc && (e.rpc = {}),
  33094. e.rpc[i] = n
  33095. }
  33096. ,
  33097. c._parseMessage = function(e, t) {
  33098. var i = !!t
  33099. , n = this.tn.next()
  33100. , r = {
  33101. name: "",
  33102. fields: [],
  33103. enums: [],
  33104. messages: [],
  33105. options: {},
  33106. services: [],
  33107. oneofs: {}
  33108. };
  33109. if (!a.NAME.test(n))
  33110. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  33111. for (r.name = n,
  33112. i && (this.tn.skip("="),
  33113. t.id = s(this.tn.next()),
  33114. r.isGroup = !0),
  33115. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  33116. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  33117. if (a.RULE.test(n))
  33118. this._parseMessageField(r, n);
  33119. else if ("oneof" === n)
  33120. this._parseMessageOneOf(r);
  33121. else if ("enum" === n)
  33122. this._parseEnum(r);
  33123. else if ("message" === n)
  33124. this._parseMessage(r);
  33125. else if ("option" === n)
  33126. this._parseOption(r);
  33127. else if ("service" === n)
  33128. this._parseService(r);
  33129. else if ("extensions" === n)
  33130. r.extensions = this._parseExtensionRanges();
  33131. else if ("reserved" === n)
  33132. this._parseIgnored();
  33133. else if ("extend" === n)
  33134. this._parseExtend(r);
  33135. else {
  33136. if (!a.TYPEREF.test(n))
  33137. throw Error("illegal message token: " + n);
  33138. if (!this.proto3)
  33139. throw Error("illegal field rule: " + n);
  33140. this._parseMessageField(r, "optional", n)
  33141. }
  33142. return this.tn.omit(";"),
  33143. e.messages.push(r),
  33144. r
  33145. }
  33146. ,
  33147. c._parseIgnored = function() {
  33148. for (; ";" !== this.tn.peek(); )
  33149. this.tn.next();
  33150. this.tn.skip(";")
  33151. }
  33152. ,
  33153. c._parseMessageField = function(e, t, i) {
  33154. if (!a.RULE.test(t))
  33155. throw Error("illegal message field rule: " + t);
  33156. var n, r = {
  33157. rule: t,
  33158. type: "",
  33159. name: "",
  33160. options: {},
  33161. id: 0
  33162. };
  33163. if ("map" === t) {
  33164. if (i)
  33165. throw Error("illegal type: " + i);
  33166. if (this.tn.skip("<"),
  33167. n = this.tn.next(),
  33168. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  33169. throw Error("illegal message field type: " + n);
  33170. if (r.keytype = n,
  33171. this.tn.skip(","),
  33172. n = this.tn.next(),
  33173. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  33174. throw Error("illegal message field: " + n);
  33175. if (r.type = n,
  33176. this.tn.skip(">"),
  33177. n = this.tn.next(),
  33178. !a.NAME.test(n))
  33179. throw Error("illegal message field name: " + n);
  33180. r.name = n,
  33181. this.tn.skip("="),
  33182. r.id = s(this.tn.next()),
  33183. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  33184. this.tn.skip(";")
  33185. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  33186. var o = this._parseMessage(e, r);
  33187. if (!/^[A-Z]/.test(o.name))
  33188. throw Error("illegal group name: " + o.name);
  33189. r.type = o.name,
  33190. r.name = o.name.toLowerCase(),
  33191. this.tn.omit(";")
  33192. } else {
  33193. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  33194. throw Error("illegal message field type: " + i);
  33195. if (r.type = i,
  33196. n = this.tn.next(),
  33197. !a.NAME.test(n))
  33198. throw Error("illegal message field name: " + n);
  33199. r.name = n,
  33200. this.tn.skip("="),
  33201. r.id = s(this.tn.next()),
  33202. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  33203. this.tn.skip(";")
  33204. }
  33205. return e.fields.push(r),
  33206. r
  33207. }
  33208. ,
  33209. c._parseMessageOneOf = function(e) {
  33210. var t = this.tn.next();
  33211. if (!a.NAME.test(t))
  33212. throw Error("illegal oneof name: " + t);
  33213. var i, n = t, r = [];
  33214. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33215. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  33216. r.push(i.id);
  33217. this.tn.omit(";"),
  33218. e.oneofs[n] = r
  33219. }
  33220. ,
  33221. c._parseFieldOptions = function(e) {
  33222. this.tn.skip("[");
  33223. for (var t = !0; "]" !== this.tn.peek(); )
  33224. t || this.tn.skip(","),
  33225. this._parseOption(e, !0),
  33226. t = !1;
  33227. this.tn.next()
  33228. }
  33229. ,
  33230. c._parseEnum = function(e) {
  33231. var t = {
  33232. name: "",
  33233. values: [],
  33234. options: {}
  33235. }
  33236. , i = this.tn.next();
  33237. if (!a.NAME.test(i))
  33238. throw Error("illegal name: " + i);
  33239. for (t.name = i,
  33240. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  33241. if ("option" === i)
  33242. this._parseOption(t);
  33243. else {
  33244. if (!a.NAME.test(i))
  33245. throw Error("illegal name: " + i);
  33246. this.tn.skip("=");
  33247. var n = {
  33248. name: i,
  33249. id: s(this.tn.next(), !0)
  33250. };
  33251. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  33252. options: {}
  33253. }),
  33254. this.tn.skip(";"),
  33255. t.values.push(n)
  33256. }
  33257. this.tn.omit(";"),
  33258. e.enums.push(t)
  33259. }
  33260. ,
  33261. c._parseExtensionRanges = function() {
  33262. var e, t, i, n = [];
  33263. do {
  33264. for (t = []; ; ) {
  33265. switch (e = this.tn.next()) {
  33266. case "min":
  33267. i = r.ID_MIN;
  33268. break;
  33269. case "max":
  33270. i = r.ID_MAX;
  33271. break;
  33272. default:
  33273. i = o(e)
  33274. }
  33275. if (t.push(i),
  33276. 2 === t.length)
  33277. break;
  33278. if ("to" !== this.tn.peek()) {
  33279. t.push(i);
  33280. break
  33281. }
  33282. this.tn.next()
  33283. }
  33284. n.push(t)
  33285. } while (this.tn.omit(","));return this.tn.skip(";"),
  33286. n
  33287. }
  33288. ,
  33289. c._parseExtend = function(e) {
  33290. var t = this.tn.next();
  33291. if (!a.TYPEREF.test(t))
  33292. throw Error("illegal extend reference: " + t);
  33293. var i = {
  33294. ref: t,
  33295. fields: []
  33296. };
  33297. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33298. if (a.RULE.test(t))
  33299. this._parseMessageField(i, t);
  33300. else {
  33301. if (!a.TYPEREF.test(t))
  33302. throw Error("illegal extend token: " + t);
  33303. if (!this.proto3)
  33304. throw Error("illegal field rule: " + t);
  33305. this._parseMessageField(i, "optional", t)
  33306. }
  33307. return this.tn.omit(";"),
  33308. e.messages.push(i),
  33309. i
  33310. }
  33311. ,
  33312. c.toString = function() {
  33313. return "Parser at line " + this.tn.line
  33314. }
  33315. ,
  33316. e.Parser = l,
  33317. e
  33318. }(o, o.Lang),
  33319. o.Reflect = function(g) {
  33320. function a(e, t) {
  33321. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  33322. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  33323. if ("string" == typeof e)
  33324. return g.Long.fromString(e, t || !1, 10);
  33325. if ("number" == typeof e)
  33326. return g.Long.fromNumber(e, t || !1);
  33327. throw Error("not convertible to Long")
  33328. }
  33329. function m(e, t) {
  33330. var i = t.readVarint32()
  33331. , n = 7 & i
  33332. , r = i >>> 3;
  33333. switch (n) {
  33334. case g.WIRE_TYPES.VARINT:
  33335. for (; 128 == (128 & (i = t.readUint8())); )
  33336. ;
  33337. break;
  33338. case g.WIRE_TYPES.BITS64:
  33339. t.offset += 8;
  33340. break;
  33341. case g.WIRE_TYPES.LDELIM:
  33342. i = t.readVarint32(),
  33343. t.offset += i;
  33344. break;
  33345. case g.WIRE_TYPES.STARTGROUP:
  33346. m(r, t);
  33347. break;
  33348. case g.WIRE_TYPES.ENDGROUP:
  33349. if (r === e)
  33350. return !1;
  33351. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  33352. case g.WIRE_TYPES.BITS32:
  33353. t.offset += 4;
  33354. break;
  33355. default:
  33356. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  33357. }
  33358. return !0
  33359. }
  33360. function h(e, t, i) {
  33361. this.builder = e,
  33362. this.parent = t,
  33363. this.name = i,
  33364. this.className
  33365. }
  33366. var s = {}
  33367. , e = h.prototype;
  33368. e.fqn = function() {
  33369. for (var e = this.name, t = this; null != (t = t.parent); )
  33370. e = t.name + "." + e;
  33371. return e
  33372. }
  33373. ,
  33374. e.toString = function(e) {
  33375. return (e ? this.className + " " : "") + this.fqn()
  33376. }
  33377. ,
  33378. e.build = function() {
  33379. throw Error(this.toString(!0) + " cannot be built directly")
  33380. }
  33381. ,
  33382. s.T = h;
  33383. function l(e, t, i, n, r) {
  33384. h.call(this, e, t, i),
  33385. this.className = "Namespace",
  33386. this.children = [],
  33387. this.options = n || {},
  33388. this.syntax = r || "proto2"
  33389. }
  33390. var t = l.prototype = Object.create(h.prototype);
  33391. t.getChildren = function(e) {
  33392. if (null == (e = e || null))
  33393. return this.children.slice();
  33394. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  33395. this.children[i]instanceof e && t.push(this.children[i]);
  33396. return t
  33397. }
  33398. ,
  33399. t.addChild = function(e) {
  33400. var t;
  33401. if (t = this.getChild(e.name))
  33402. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  33403. t.name = t.originalName;
  33404. else {
  33405. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  33406. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  33407. e.name = e.originalName
  33408. }
  33409. this.children.push(e)
  33410. }
  33411. ,
  33412. t.getChild = function(e) {
  33413. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  33414. if (this.children[i][t] === e)
  33415. return this.children[i];
  33416. return null
  33417. }
  33418. ,
  33419. t.resolve = function(e, t) {
  33420. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  33421. if ("" === n[o]) {
  33422. for (; null !== r.parent; )
  33423. r = r.parent;
  33424. o++
  33425. }
  33426. do {
  33427. do {
  33428. if (!(r instanceof s.Namespace)) {
  33429. r = null;
  33430. break
  33431. }
  33432. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  33433. r = null;
  33434. break
  33435. }
  33436. r = i,
  33437. o++
  33438. } while (o < n.length);if (null != r)
  33439. break;
  33440. if (null !== this.parent)
  33441. return this.parent.resolve(e, t)
  33442. } while (null != r);return r
  33443. }
  33444. ,
  33445. t.qn = function(e) {
  33446. for (var t = [], i = e; t.unshift(i.name),
  33447. null !== (i = i.parent); )
  33448. ;
  33449. for (var n = 1; n <= t.length; n++) {
  33450. var r = t.slice(t.length - n);
  33451. if (e === this.resolve(r, e instanceof s.Namespace))
  33452. return r.join(".")
  33453. }
  33454. return e.fqn()
  33455. }
  33456. ,
  33457. t.build = function() {
  33458. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33459. (e = i[n])instanceof l && (t[e.name] = e.build());
  33460. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33461. value: this.buildOpt()
  33462. }),
  33463. t
  33464. }
  33465. ,
  33466. t.buildOpt = function() {
  33467. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33468. var r = t[i]
  33469. , o = this.options[t[i]];
  33470. e[r] = o
  33471. }
  33472. return e
  33473. }
  33474. ,
  33475. t.getOption = function(e) {
  33476. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  33477. }
  33478. ,
  33479. s.Namespace = l;
  33480. function u(e, t, i, n) {
  33481. if (this.type = e,
  33482. this.resolvedType = t,
  33483. this.isMapKey = i,
  33484. this.syntax = n,
  33485. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  33486. throw Error("Invalid map key type: " + e.name)
  33487. }
  33488. var i = u.prototype;
  33489. u.defaultFieldValue = function(e) {
  33490. if ("string" == typeof e && (e = g.TYPES[e]),
  33491. void 0 === e.defaultValue)
  33492. throw Error("default value for type " + e.name + " is not supported");
  33493. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33494. }
  33495. ,
  33496. i.verifyValue = function(t) {
  33497. function i(e, t) {
  33498. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33499. }
  33500. var n = this;
  33501. switch (this.type) {
  33502. case g.TYPES.int32:
  33503. case g.TYPES.sint32:
  33504. case g.TYPES.sfixed32:
  33505. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33506. 4294967295 < t ? 0 | t : t;
  33507. case g.TYPES.uint32:
  33508. case g.TYPES.fixed32:
  33509. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33510. t < 0 ? t >>> 0 : t;
  33511. case g.TYPES.int64:
  33512. case g.TYPES.sint64:
  33513. case g.TYPES.sfixed64:
  33514. if (g.Long)
  33515. try {
  33516. return a(t, !1)
  33517. } catch (e) {
  33518. i(typeof t, e.message)
  33519. }
  33520. else
  33521. i(typeof t, "requires Long.js");
  33522. case g.TYPES.uint64:
  33523. case g.TYPES.fixed64:
  33524. if (g.Long)
  33525. try {
  33526. return a(t, !0)
  33527. } catch (e) {
  33528. i(typeof t, e.message)
  33529. }
  33530. else
  33531. i(typeof t, "requires Long.js");
  33532. case g.TYPES.bool:
  33533. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33534. t;
  33535. case g.TYPES.float:
  33536. case g.TYPES.double:
  33537. return "number" != typeof t && i(typeof t, "not a number"),
  33538. t;
  33539. case g.TYPES.string:
  33540. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33541. "" + t;
  33542. case g.TYPES.bytes:
  33543. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33544. case g.TYPES.enum:
  33545. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33546. for (o = 0; o < e.length; o++) {
  33547. if (e[o].name == t)
  33548. return e[o].id;
  33549. if (e[o].id == t)
  33550. return e[o].id
  33551. }
  33552. if ("proto3" === this.syntax)
  33553. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33554. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33555. t;
  33556. i(t, "not a valid enum value");
  33557. case g.TYPES.group:
  33558. case g.TYPES.message:
  33559. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33560. t instanceof this.resolvedType.clazz)
  33561. return t;
  33562. if (t instanceof g.Builder.Message) {
  33563. var r = {};
  33564. for (var o in t)
  33565. t.hasOwnProperty(o) && (r[o] = t[o]);
  33566. t = r
  33567. }
  33568. return new this.resolvedType.clazz(t)
  33569. }
  33570. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33571. }
  33572. ,
  33573. i.calculateLength = function(e, t) {
  33574. if (null === t)
  33575. return 0;
  33576. var i;
  33577. switch (this.type) {
  33578. case g.TYPES.int32:
  33579. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33580. case g.TYPES.uint32:
  33581. return I.calculateVarint32(t);
  33582. case g.TYPES.sint32:
  33583. return I.calculateVarint32(I.zigZagEncode32(t));
  33584. case g.TYPES.fixed32:
  33585. case g.TYPES.sfixed32:
  33586. case g.TYPES.float:
  33587. return 4;
  33588. case g.TYPES.int64:
  33589. case g.TYPES.uint64:
  33590. return I.calculateVarint64(t);
  33591. case g.TYPES.sint64:
  33592. return I.calculateVarint64(I.zigZagEncode64(t));
  33593. case g.TYPES.fixed64:
  33594. case g.TYPES.sfixed64:
  33595. return 8;
  33596. case g.TYPES.bool:
  33597. return 1;
  33598. case g.TYPES.enum:
  33599. return I.calculateVarint32(t);
  33600. case g.TYPES.double:
  33601. return 8;
  33602. case g.TYPES.string:
  33603. return i = I.calculateUTF8Bytes(t),
  33604. I.calculateVarint32(i) + i;
  33605. case g.TYPES.bytes:
  33606. if (t.remaining() < 0)
  33607. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33608. return I.calculateVarint32(t.remaining()) + t.remaining();
  33609. case g.TYPES.message:
  33610. return i = this.resolvedType.calculate(t),
  33611. I.calculateVarint32(i) + i;
  33612. case g.TYPES.group:
  33613. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33614. }
  33615. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33616. }
  33617. ,
  33618. i.encodeValue = function(e, t, i) {
  33619. if (null === t)
  33620. return i;
  33621. switch (this.type) {
  33622. case g.TYPES.int32:
  33623. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33624. break;
  33625. case g.TYPES.uint32:
  33626. i.writeVarint32(t);
  33627. break;
  33628. case g.TYPES.sint32:
  33629. i.writeVarint32ZigZag(t);
  33630. break;
  33631. case g.TYPES.fixed32:
  33632. i.writeUint32(t);
  33633. break;
  33634. case g.TYPES.sfixed32:
  33635. i.writeInt32(t);
  33636. break;
  33637. case g.TYPES.int64:
  33638. case g.TYPES.uint64:
  33639. i.writeVarint64(t);
  33640. break;
  33641. case g.TYPES.sint64:
  33642. i.writeVarint64ZigZag(t);
  33643. break;
  33644. case g.TYPES.fixed64:
  33645. i.writeUint64(t);
  33646. break;
  33647. case g.TYPES.sfixed64:
  33648. i.writeInt64(t);
  33649. break;
  33650. case g.TYPES.bool:
  33651. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33652. break;
  33653. case g.TYPES.enum:
  33654. i.writeVarint32(t);
  33655. break;
  33656. case g.TYPES.float:
  33657. i.writeFloat32(t);
  33658. break;
  33659. case g.TYPES.double:
  33660. i.writeFloat64(t);
  33661. break;
  33662. case g.TYPES.string:
  33663. i.writeVString(t);
  33664. break;
  33665. case g.TYPES.bytes:
  33666. if (t.remaining() < 0)
  33667. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33668. var n = t.offset;
  33669. i.writeVarint32(t.remaining()),
  33670. i.append(t),
  33671. t.offset = n;
  33672. break;
  33673. case g.TYPES.message:
  33674. var r = (new I).LE();
  33675. this.resolvedType.encode(t, r),
  33676. i.writeVarint32(r.offset),
  33677. i.append(r.flip());
  33678. break;
  33679. case g.TYPES.group:
  33680. this.resolvedType.encode(t, i),
  33681. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33682. break;
  33683. default:
  33684. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33685. }
  33686. return i
  33687. }
  33688. ,
  33689. i.decode = function(e, t, i) {
  33690. if (t != this.type.wireType)
  33691. throw Error("Unexpected wire type for element");
  33692. var n, r;
  33693. switch (this.type) {
  33694. case g.TYPES.int32:
  33695. return 0 | e.readVarint32();
  33696. case g.TYPES.uint32:
  33697. return e.readVarint32() >>> 0;
  33698. case g.TYPES.sint32:
  33699. return 0 | e.readVarint32ZigZag();
  33700. case g.TYPES.fixed32:
  33701. return e.readUint32() >>> 0;
  33702. case g.TYPES.sfixed32:
  33703. return 0 | e.readInt32();
  33704. case g.TYPES.int64:
  33705. return e.readVarint64();
  33706. case g.TYPES.uint64:
  33707. return e.readVarint64().toUnsigned();
  33708. case g.TYPES.sint64:
  33709. return e.readVarint64ZigZag();
  33710. case g.TYPES.fixed64:
  33711. return e.readUint64();
  33712. case g.TYPES.sfixed64:
  33713. return e.readInt64();
  33714. case g.TYPES.bool:
  33715. return !!e.readVarint32();
  33716. case g.TYPES.enum:
  33717. return e.readVarint32();
  33718. case g.TYPES.float:
  33719. return e.readFloat();
  33720. case g.TYPES.double:
  33721. return e.readDouble();
  33722. case g.TYPES.string:
  33723. return e.readVString();
  33724. case g.TYPES.bytes:
  33725. if (r = e.readVarint32(),
  33726. e.remaining() < r)
  33727. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33728. return (n = e.clone()).limit = n.offset + r,
  33729. e.offset += r,
  33730. n;
  33731. case g.TYPES.message:
  33732. return r = e.readVarint32(),
  33733. this.resolvedType.decode(e, r);
  33734. case g.TYPES.group:
  33735. return this.resolvedType.decode(e, -1, i)
  33736. }
  33737. throw Error("[INTERNAL] Illegal decode type")
  33738. }
  33739. ,
  33740. i.valueFromString = function(e) {
  33741. if (!this.isMapKey)
  33742. throw Error("valueFromString() called on non-map-key element");
  33743. switch (this.type) {
  33744. case g.TYPES.int32:
  33745. case g.TYPES.sint32:
  33746. case g.TYPES.sfixed32:
  33747. case g.TYPES.uint32:
  33748. case g.TYPES.fixed32:
  33749. return this.verifyValue(parseInt(e));
  33750. case g.TYPES.int64:
  33751. case g.TYPES.sint64:
  33752. case g.TYPES.sfixed64:
  33753. case g.TYPES.uint64:
  33754. case g.TYPES.fixed64:
  33755. return this.verifyValue(e);
  33756. case g.TYPES.bool:
  33757. return "true" === e;
  33758. case g.TYPES.string:
  33759. return this.verifyValue(e);
  33760. case g.TYPES.bytes:
  33761. return I.fromBinary(e)
  33762. }
  33763. }
  33764. ,
  33765. i.valueToString = function(e) {
  33766. if (!this.isMapKey)
  33767. throw Error("valueToString() called on non-map-key element");
  33768. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33769. }
  33770. ,
  33771. s.Element = u;
  33772. var d = function(e, t, i, n, r, o) {
  33773. l.call(this, e, t, i, n, o),
  33774. this.className = "Message",
  33775. this.extensions = void 0,
  33776. this.clazz = null,
  33777. this.isGroup = !!r,
  33778. this._fields = null,
  33779. this._fieldsById = null,
  33780. this._fieldsByName = null
  33781. }
  33782. , n = d.prototype = Object.create(l.prototype);
  33783. n.build = function(e) {
  33784. if (this.clazz && !e)
  33785. return this.clazz;
  33786. var t = function(u, a) {
  33787. function d(e, i, n, r) {
  33788. if (null === e || "object" != typeof e) {
  33789. if (r && r instanceof u.Reflect.Enum) {
  33790. var t = u.Reflect.Enum.getName(r.object, e);
  33791. if (null !== t)
  33792. return t
  33793. }
  33794. return e
  33795. }
  33796. if (I.isByteBuffer(e))
  33797. return i ? e.toBase64() : e.toBuffer();
  33798. if (u.Long.isLong(e))
  33799. return n ? e.toString() : u.Long.fromValue(e);
  33800. var o;
  33801. if (Array.isArray(e))
  33802. return o = [],
  33803. e.forEach(function(e, t) {
  33804. o[t] = d(e, i, n, r)
  33805. }),
  33806. o;
  33807. if (o = {},
  33808. e instanceof u.Map) {
  33809. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33810. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33811. return o
  33812. }
  33813. var l = e.$type
  33814. , c = void 0;
  33815. for (var h in e)
  33816. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33817. return o
  33818. }
  33819. var s = a.getChildren(u.Reflect.Message.Field)
  33820. , l = a.getChildren(u.Reflect.Message.OneOf)
  33821. , c = function(e, t) {
  33822. u.Builder.Message.call(this);
  33823. for (var i = 0, n = l.length; i < n; ++i)
  33824. this[l[i].name] = null;
  33825. for (i = 0,
  33826. n = s.length; i < n; ++i) {
  33827. var r = s[i];
  33828. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33829. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33830. }
  33831. var o;
  33832. if (0 < arguments.length)
  33833. 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)
  33834. for (i = 0,
  33835. n = arguments.length; i < n; ++i)
  33836. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33837. else
  33838. this.$set(e)
  33839. }
  33840. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33841. o.add = function(e, t, i) {
  33842. var n = a._fieldsByName[e];
  33843. if (!i) {
  33844. if (!n)
  33845. throw Error(this + "#" + e + " is undefined");
  33846. if (!(n instanceof u.Reflect.Message.Field))
  33847. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33848. if (!n.repeated)
  33849. throw Error(this + "#" + e + " is not a repeated field");
  33850. t = n.verifyValue(t, !0)
  33851. }
  33852. return null === this[e] && (this[e] = []),
  33853. this[e].push(t),
  33854. this
  33855. }
  33856. ,
  33857. o.$add = o.add,
  33858. o.set = function(e, t, i) {
  33859. if (e && "object" == typeof e) {
  33860. for (var n in i = t,
  33861. e)
  33862. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33863. return this
  33864. }
  33865. var r = a._fieldsByName[e];
  33866. if (i)
  33867. this[e] = t;
  33868. else {
  33869. if (!r)
  33870. throw Error(this + "#" + e + " is not a field: undefined");
  33871. if (!(r instanceof u.Reflect.Message.Field))
  33872. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33873. this[r.name] = t = r.verifyValue(t)
  33874. }
  33875. if (r && r.oneof) {
  33876. var o = this[r.oneof.name];
  33877. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33878. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33879. }
  33880. return this
  33881. }
  33882. ,
  33883. o.$set = o.set,
  33884. o.get = function(e, t) {
  33885. if (t)
  33886. return this[e];
  33887. var i = a._fieldsByName[e];
  33888. if (!(i && i instanceof u.Reflect.Message.Field))
  33889. throw Error(this + "#" + e + " is not a field: undefined");
  33890. if (!(i instanceof u.Reflect.Message.Field))
  33891. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33892. return this[i.name]
  33893. }
  33894. ,
  33895. o.$get = o.get;
  33896. for (var e = 0; e < s.length; e++) {
  33897. var t = s[e];
  33898. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33899. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33900. return e.toUpperCase().replace("_", "")
  33901. });
  33902. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33903. function t(e, t) {
  33904. return this[i.name] = t ? e : i.verifyValue(e),
  33905. this
  33906. }
  33907. function n() {
  33908. return this[i.name]
  33909. }
  33910. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33911. return "_" + e
  33912. });
  33913. null === a.getChild("set" + e) && (o["set" + e] = t),
  33914. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33915. null === a.getChild("get" + e) && (o["get" + e] = n),
  33916. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33917. }(t)
  33918. }
  33919. return o.encode = function(t, e) {
  33920. "boolean" == typeof t && (e = t,
  33921. t = void 0);
  33922. var i = !1;
  33923. t || (t = new I,
  33924. i = !0);
  33925. var n = t.littleEndian;
  33926. try {
  33927. return a.encode(this, t.LE(), e),
  33928. (i ? t.flip() : t).LE(n)
  33929. } catch (e) {
  33930. throw t.LE(n),
  33931. e
  33932. }
  33933. }
  33934. ,
  33935. c.encode = function(e, t, i) {
  33936. return new c(e).encode(t, i)
  33937. }
  33938. ,
  33939. o.calculate = function() {
  33940. return a.calculate(this)
  33941. }
  33942. ,
  33943. o.encodeDelimited = function(e, t) {
  33944. var i = !1;
  33945. e || (e = new I,
  33946. i = !0);
  33947. var n = (new I).LE();
  33948. return a.encode(this, n, t).flip(),
  33949. e.writeVarint32(n.remaining()),
  33950. e.append(n),
  33951. i ? e.flip() : e
  33952. }
  33953. ,
  33954. o.encodeAB = function() {
  33955. try {
  33956. return this.encode().toArrayBuffer()
  33957. } catch (e) {
  33958. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33959. e
  33960. }
  33961. }
  33962. ,
  33963. o.toArrayBuffer = o.encodeAB,
  33964. o.encodeNB = function() {
  33965. try {
  33966. return this.encode().toBuffer()
  33967. } catch (e) {
  33968. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33969. e
  33970. }
  33971. }
  33972. ,
  33973. o.toBuffer = o.encodeNB,
  33974. o.encode64 = function() {
  33975. try {
  33976. return this.encode().toBase64()
  33977. } catch (e) {
  33978. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33979. e
  33980. }
  33981. }
  33982. ,
  33983. o.toBase64 = o.encode64,
  33984. o.encodeHex = function() {
  33985. try {
  33986. return this.encode().toHex()
  33987. } catch (e) {
  33988. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33989. e
  33990. }
  33991. }
  33992. ,
  33993. o.toHex = o.encodeHex,
  33994. o.toRaw = function(e, t) {
  33995. return d(this, !!e, !!t, this.$type)
  33996. }
  33997. ,
  33998. o.encodeJSON = function() {
  33999. return JSON.stringify(d(this, !0, !0, this.$type))
  34000. }
  34001. ,
  34002. c.decode = function(t, e, i) {
  34003. "string" == typeof e && (i = e,
  34004. e = -1),
  34005. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  34006. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  34007. try {
  34008. var r = a.decode(t.LE());
  34009. return t.LE(n),
  34010. r
  34011. } catch (e) {
  34012. throw t.LE(n),
  34013. e
  34014. }
  34015. }
  34016. ,
  34017. c.decodeDelimited = function(t, e) {
  34018. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  34019. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  34020. return null;
  34021. var i = t.offset
  34022. , n = t.readVarint32();
  34023. if (t.remaining() < n)
  34024. return t.offset = i,
  34025. null;
  34026. try {
  34027. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  34028. return t.offset += n,
  34029. r
  34030. } catch (e) {
  34031. throw t.offset += n,
  34032. e
  34033. }
  34034. }
  34035. ,
  34036. c.decode64 = function(e) {
  34037. return c.decode(e, "base64")
  34038. }
  34039. ,
  34040. c.decodeHex = function(e) {
  34041. return c.decode(e, "hex")
  34042. }
  34043. ,
  34044. c.decodeJSON = function(e) {
  34045. return new c(JSON.parse(e))
  34046. }
  34047. ,
  34048. o.toString = function() {
  34049. return a.toString()
  34050. }
  34051. ,
  34052. Object.defineProperty && (Object.defineProperty(c, "$options", {
  34053. value: a.buildOpt()
  34054. }),
  34055. Object.defineProperty(o, "$options", {
  34056. value: c.$options
  34057. }),
  34058. Object.defineProperty(c, "$type", {
  34059. value: a
  34060. }),
  34061. Object.defineProperty(o, "$type", {
  34062. value: a
  34063. })),
  34064. c
  34065. }(g, this);
  34066. this._fields = [],
  34067. this._fieldsById = {},
  34068. this._fieldsByName = {};
  34069. for (var i, n = 0, r = this.children.length; n < r; n++)
  34070. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  34071. if (t.hasOwnProperty(i.name))
  34072. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  34073. t[i.name] = i.build()
  34074. } else if (i instanceof d.Field)
  34075. i.build(),
  34076. this._fields.push(i),
  34077. this._fieldsById[i.id] = i,
  34078. this._fieldsByName[i.name] = i;
  34079. else if (!(i instanceof d.OneOf || i instanceof v))
  34080. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  34081. return this.clazz = t
  34082. }
  34083. ,
  34084. n.encode = function(e, t, i) {
  34085. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  34086. r = e[(n = this._fields[a]).name],
  34087. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  34088. if (null === o)
  34089. return t;
  34090. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  34091. throw l.encoded = t,
  34092. l
  34093. }
  34094. ,
  34095. n.calculate = function(e) {
  34096. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  34097. if (i = e[(t = this._fields[r]).name],
  34098. t.required && null === i)
  34099. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  34100. n += t.calculate(i, e)
  34101. }
  34102. return n
  34103. }
  34104. ,
  34105. n.decode = function(e, t, i) {
  34106. t = "number" == typeof t ? t : -1;
  34107. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  34108. if (o = (n = e.readVarint32()) >>> 3,
  34109. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  34110. if (o !== i)
  34111. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  34112. break
  34113. }
  34114. if (a = this._fieldsById[o]) {
  34115. if (a.repeated && !a.options.packed)
  34116. l[a.name].push(a.decode(r, e));
  34117. else if (a.map) {
  34118. var c = a.decode(r, e);
  34119. l[a.name].set(c[0], c[1])
  34120. } else if (l[a.name] = a.decode(r, e),
  34121. a.oneof) {
  34122. var h = l[a.oneof.name];
  34123. null !== h && h !== a.name && (l[h] = null),
  34124. l[a.oneof.name] = a.name
  34125. }
  34126. } else
  34127. switch (r) {
  34128. case g.WIRE_TYPES.VARINT:
  34129. e.readVarint32();
  34130. break;
  34131. case g.WIRE_TYPES.BITS32:
  34132. e.offset += 4;
  34133. break;
  34134. case g.WIRE_TYPES.BITS64:
  34135. e.offset += 8;
  34136. break;
  34137. case g.WIRE_TYPES.LDELIM:
  34138. var u = e.readVarint32();
  34139. e.offset += u;
  34140. break;
  34141. case g.WIRE_TYPES.STARTGROUP:
  34142. for (; m(o, e); )
  34143. ;
  34144. break;
  34145. default:
  34146. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  34147. }
  34148. }
  34149. for (var d = 0, p = this._fields.length; d < p; ++d)
  34150. if (null === l[(a = this._fields[d]).name])
  34151. if ("proto3" === this.syntax)
  34152. l[a.name] = a.defaultValue;
  34153. else {
  34154. if (a.required) {
  34155. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  34156. throw f.decoded = l,
  34157. f
  34158. }
  34159. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  34160. }
  34161. return l
  34162. }
  34163. ,
  34164. s.Message = d;
  34165. function c(e, t, i, n, r, o, a, s, l, c) {
  34166. h.call(this, e, t, o),
  34167. this.className = "Message.Field",
  34168. this.required = "required" === i,
  34169. this.repeated = "repeated" === i,
  34170. this.map = "map" === i,
  34171. this.keyType = n || null,
  34172. this.type = r,
  34173. this.resolvedType = null,
  34174. this.id = a,
  34175. this.options = s || {},
  34176. this.defaultValue = null,
  34177. this.oneof = l || null,
  34178. this.syntax = c || "proto2",
  34179. this.originalName = this.name,
  34180. this.element = null,
  34181. this.keyElement = null,
  34182. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  34183. }
  34184. var r = c.prototype = Object.create(h.prototype);
  34185. r.build = function() {
  34186. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  34187. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  34188. "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)
  34189. }
  34190. ,
  34191. r.verifyValue = function(e, t) {
  34192. function i(e, t) {
  34193. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  34194. }
  34195. t = t || !1;
  34196. var n, r = this;
  34197. if (null === e)
  34198. return this.required && i(typeof e, "required"),
  34199. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  34200. null;
  34201. if (!this.repeated || t)
  34202. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  34203. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  34204. this.element.verifyValue(e));
  34205. Array.isArray(e) || (e = [e]);
  34206. var o = [];
  34207. for (n = 0; n < e.length; n++)
  34208. o.push(this.element.verifyValue(e[n]));
  34209. return o
  34210. }
  34211. ,
  34212. r.hasWirePresence = function(e, t) {
  34213. if ("proto3" !== this.syntax)
  34214. return null !== e;
  34215. if (this.oneof && t[this.oneof.name] === this.name)
  34216. return !0;
  34217. switch (this.type) {
  34218. case g.TYPES.int32:
  34219. case g.TYPES.sint32:
  34220. case g.TYPES.sfixed32:
  34221. case g.TYPES.uint32:
  34222. case g.TYPES.fixed32:
  34223. return 0 !== e;
  34224. case g.TYPES.int64:
  34225. case g.TYPES.sint64:
  34226. case g.TYPES.sfixed64:
  34227. case g.TYPES.uint64:
  34228. case g.TYPES.fixed64:
  34229. return 0 !== e.low || 0 !== e.high;
  34230. case g.TYPES.bool:
  34231. return e;
  34232. case g.TYPES.float:
  34233. case g.TYPES.double:
  34234. return 0 !== e;
  34235. case g.TYPES.string:
  34236. return 0 < e.length;
  34237. case g.TYPES.bytes:
  34238. return 0 < e.remaining();
  34239. case g.TYPES.enum:
  34240. return 0 !== e;
  34241. case g.TYPES.message:
  34242. return null !== e;
  34243. default:
  34244. return !0
  34245. }
  34246. }
  34247. ,
  34248. r.encode = function(t, r, e) {
  34249. if (null === this.type || "object" != typeof this.type)
  34250. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34251. if (null === t || this.repeated && 0 == t.length)
  34252. return r;
  34253. try {
  34254. var i;
  34255. if (this.repeated)
  34256. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34257. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34258. r.ensureCapacity(r.offset += 1);
  34259. var n = r.offset;
  34260. for (i = 0; i < t.length; i++)
  34261. this.element.encodeValue(this.id, t[i], r);
  34262. var o = r.offset - n
  34263. , a = I.calculateVarint32(o);
  34264. if (1 < a) {
  34265. var s = r.slice(n, r.offset);
  34266. n += a - 1,
  34267. r.offset = n,
  34268. r.append(s)
  34269. }
  34270. r.writeVarint32(o, n - a)
  34271. } else
  34272. for (i = 0; i < t.length; i++)
  34273. r.writeVarint32(this.id << 3 | this.type.wireType),
  34274. this.element.encodeValue(this.id, t[i], r);
  34275. else
  34276. this.map ? t.forEach(function(e, t, i) {
  34277. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34278. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34279. r.writeVarint32(n),
  34280. r.writeVarint32(8 | this.keyType.wireType),
  34281. this.keyElement.encodeValue(1, t, r),
  34282. r.writeVarint32(16 | this.type.wireType),
  34283. this.element.encodeValue(2, e, r)
  34284. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  34285. this.element.encodeValue(this.id, t, r))
  34286. } catch (e) {
  34287. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34288. }
  34289. return r
  34290. }
  34291. ,
  34292. r.calculate = function(t, e) {
  34293. if (t = this.verifyValue(t),
  34294. null === this.type || "object" != typeof this.type)
  34295. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34296. if (null === t || this.repeated && 0 == t.length)
  34297. return 0;
  34298. var r = 0;
  34299. try {
  34300. var i, n;
  34301. if (this.repeated)
  34302. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34303. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34304. i = n = 0; i < t.length; i++)
  34305. n += this.element.calculateLength(this.id, t[i]);
  34306. r += I.calculateVarint32(n),
  34307. r += n
  34308. } else
  34309. for (i = 0; i < t.length; i++)
  34310. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34311. r += this.element.calculateLength(this.id, t[i]);
  34312. else
  34313. this.map ? t.forEach(function(e, t, i) {
  34314. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34315. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34316. r += I.calculateVarint32(n),
  34317. r += n
  34318. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34319. r += this.element.calculateLength(this.id, t))
  34320. } catch (e) {
  34321. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34322. }
  34323. return r
  34324. }
  34325. ,
  34326. r.decode = function(e, t, i) {
  34327. var n, r;
  34328. 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))
  34329. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  34330. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  34331. r = t.readVarint32(),
  34332. r = t.offset + r;
  34333. for (var o = []; t.offset < r; )
  34334. o.push(this.decode(this.type.wireType, t, !0));
  34335. return o
  34336. }
  34337. if (this.map) {
  34338. var a = u.defaultFieldValue(this.keyType);
  34339. if (n = u.defaultFieldValue(this.type),
  34340. r = t.readVarint32(),
  34341. t.remaining() < r)
  34342. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  34343. var s = t.clone();
  34344. for (s.limit = s.offset + r,
  34345. t.offset += r; 0 < s.remaining(); ) {
  34346. var l = s.readVarint32();
  34347. e = 7 & l;
  34348. var c = l >>> 3;
  34349. if (1 == c)
  34350. a = this.keyElement.decode(s, e, c);
  34351. else {
  34352. if (2 != c)
  34353. throw Error("Unexpected tag in map field key/value submessage");
  34354. n = this.element.decode(s, e, c)
  34355. }
  34356. }
  34357. return [a, n]
  34358. }
  34359. return this.element.decode(t, e, this.id)
  34360. }
  34361. ,
  34362. s.Message.Field = c;
  34363. function o(e, t, i, n, r, o, a) {
  34364. c.call(this, e, t, i, null, n, r, o, a),
  34365. this.extension
  34366. }
  34367. o.prototype = Object.create(c.prototype),
  34368. s.Message.ExtensionField = o;
  34369. s.Message.OneOf = function(e, t, i) {
  34370. h.call(this, e, t, i),
  34371. this.fields = []
  34372. }
  34373. ;
  34374. var p = function(e, t, i, n, r) {
  34375. l.call(this, e, t, i, n, r),
  34376. this.className = "Enum",
  34377. this.object = null
  34378. };
  34379. p.getName = function(e, t) {
  34380. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  34381. if (e[i = n[r]] === t)
  34382. return i;
  34383. return null
  34384. }
  34385. ,
  34386. (p.prototype = Object.create(l.prototype)).build = function(e) {
  34387. if (this.object && !e)
  34388. return this.object;
  34389. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  34390. t[i[n].name] = i[n].id;
  34391. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34392. value: this.buildOpt(),
  34393. enumerable: !1
  34394. }),
  34395. this.object = t
  34396. }
  34397. ,
  34398. s.Enum = p;
  34399. function f(e, t, i, n) {
  34400. h.call(this, e, t, i),
  34401. this.className = "Enum.Value",
  34402. this.id = n
  34403. }
  34404. f.prototype = Object.create(h.prototype),
  34405. s.Enum.Value = f;
  34406. var v = function(e, t, i, n) {
  34407. h.call(this, e, t, i),
  34408. this.field = n
  34409. };
  34410. v.prototype = Object.create(h.prototype),
  34411. s.Extension = v;
  34412. var y = function(e, t, i, n) {
  34413. l.call(this, e, t, i, n),
  34414. this.className = "Service",
  34415. this.clazz = null
  34416. };
  34417. (y.prototype = Object.create(l.prototype)).build = function(e) {
  34418. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  34419. for (var o = function(e) {
  34420. t.Builder.Service.call(this),
  34421. this.rpcImpl = e || function(e, t, i) {
  34422. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  34423. }
  34424. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  34425. !function(n) {
  34426. e[n.name] = function(e, i) {
  34427. try {
  34428. try {
  34429. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  34430. } catch (e) {
  34431. if (!(e instanceof TypeError))
  34432. throw e
  34433. }
  34434. if (null === e || "object" != typeof e)
  34435. throw Error("Illegal arguments");
  34436. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  34437. this.rpcImpl(n.fqn(), e, function(e, t) {
  34438. if (!e) {
  34439. null === t && (t = "");
  34440. try {
  34441. t = n.resolvedResponseType.clazz.decode(t)
  34442. } catch (e) {}
  34443. 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))
  34444. }
  34445. i(e)
  34446. })
  34447. } catch (e) {
  34448. setTimeout(i.bind(this, e), 0)
  34449. }
  34450. }
  34451. ,
  34452. o[n.name] = function(e, t, i) {
  34453. new o(e)[n.name](t, i)
  34454. }
  34455. ,
  34456. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  34457. value: n.buildOpt()
  34458. }),
  34459. Object.defineProperty(e[n.name], "$options", {
  34460. value: o[n.name].$options
  34461. }))
  34462. }(i[n]);
  34463. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  34464. value: r.buildOpt()
  34465. }),
  34466. Object.defineProperty(e, "$options", {
  34467. value: o.$options
  34468. }),
  34469. Object.defineProperty(o, "$type", {
  34470. value: r
  34471. }),
  34472. Object.defineProperty(e, "$type", {
  34473. value: r
  34474. })),
  34475. o
  34476. }(g, this)
  34477. }
  34478. ,
  34479. s.Service = y;
  34480. function A(e, t, i, n) {
  34481. h.call(this, e, t, i),
  34482. this.className = "Service.Method",
  34483. this.options = n || {}
  34484. }
  34485. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  34486. s.Service.Method = A;
  34487. function C(e, t, i, n, r, o, a, s) {
  34488. A.call(this, e, t, i, s),
  34489. this.className = "Service.RPCMethod",
  34490. this.requestName = n,
  34491. this.responseName = r,
  34492. this.requestStream = o,
  34493. this.responseStream = a,
  34494. this.resolvedRequestType = null,
  34495. this.resolvedResponseType = null
  34496. }
  34497. return C.prototype = Object.create(A.prototype),
  34498. s.Service.RPCMethod = C,
  34499. s
  34500. }(o),
  34501. o.Builder = (i = (u = o).Lang,
  34502. s = o.Reflect,
  34503. n = h.prototype,
  34504. h.isMessage = function(e) {
  34505. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34506. }
  34507. ,
  34508. h.isMessageField = function(e) {
  34509. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34510. }
  34511. ,
  34512. h.isEnum = function(e) {
  34513. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34514. }
  34515. ,
  34516. h.isService = function(e) {
  34517. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34518. }
  34519. ,
  34520. h.isExtend = function(e) {
  34521. return "string" == typeof e.ref
  34522. }
  34523. ,
  34524. n.reset = function() {
  34525. return this.ptr = this.ns,
  34526. this
  34527. }
  34528. ,
  34529. n.define = function(e) {
  34530. if ("string" != typeof e || !i.TYPEREF.test(e))
  34531. throw Error("illegal namespace: " + e);
  34532. return e.split(".").forEach(function(e) {
  34533. var t = this.ptr.getChild(e);
  34534. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34535. this.ptr = t
  34536. }, this),
  34537. this
  34538. }
  34539. ,
  34540. n.create = function(e) {
  34541. if (!e)
  34542. return this;
  34543. if (Array.isArray(e)) {
  34544. if (0 === e.length)
  34545. return this;
  34546. e = e.slice()
  34547. } else
  34548. e = [e];
  34549. for (var t = [e]; 0 < t.length; ) {
  34550. if (e = t.pop(),
  34551. !Array.isArray(e))
  34552. throw Error("not a valid namespace: " + JSON.stringify(e));
  34553. for (; 0 < e.length; ) {
  34554. var i = e.shift();
  34555. if (h.isMessage(i)) {
  34556. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34557. , n = {};
  34558. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34559. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34560. }, this),
  34561. i.fields && i.fields.forEach(function(e) {
  34562. if (null !== o.getChild(0 | e.id))
  34563. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34564. if (e.options && "object" != typeof e.options)
  34565. throw Error("illegal field options in " + o.name + "#" + e.name);
  34566. var t = null;
  34567. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34568. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34569. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34570. t && t.fields.push(e),
  34571. o.addChild(e)
  34572. }, this);
  34573. var r = [];
  34574. if (i.enums && i.enums.forEach(function(e) {
  34575. r.push(e)
  34576. }),
  34577. i.messages && i.messages.forEach(function(e) {
  34578. r.push(e)
  34579. }),
  34580. i.services && i.services.forEach(function(e) {
  34581. r.push(e)
  34582. }),
  34583. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34584. this.ptr.addChild(o),
  34585. 0 < r.length) {
  34586. t.push(e),
  34587. e = r,
  34588. r = null,
  34589. this.ptr = o,
  34590. o = null;
  34591. continue
  34592. }
  34593. r = null
  34594. } else if (h.isEnum(i))
  34595. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34596. i.values.forEach(function(e) {
  34597. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34598. }, this),
  34599. this.ptr.addChild(o);
  34600. else if (h.isService(i))
  34601. o = new s.Service(this,this.ptr,i.name,i.options),
  34602. Object.keys(i.rpc).forEach(function(e) {
  34603. var t = i.rpc[e];
  34604. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34605. }, this),
  34606. this.ptr.addChild(o);
  34607. else {
  34608. if (!h.isExtend(i))
  34609. throw Error("not a valid definition: " + JSON.stringify(i));
  34610. if (o = this.ptr.resolve(i.ref, !0))
  34611. i.fields.forEach(function(t) {
  34612. if (null !== o.getChild(0 | t.id))
  34613. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34614. if (o.extensions) {
  34615. var i = !1;
  34616. if (o.extensions.forEach(function(e) {
  34617. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34618. }),
  34619. !i)
  34620. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34621. }
  34622. var e = t.name;
  34623. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34624. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34625. , r = new s.Extension(this,this.ptr,t.name,n);
  34626. n.extension = r,
  34627. this.ptr.addChild(r),
  34628. o.addChild(n)
  34629. }, this);
  34630. else if (!/\.?google\.protobuf\./.test(i.ref))
  34631. throw Error("extended message " + i.ref + " is not defined")
  34632. }
  34633. o = i = null
  34634. }
  34635. e = null,
  34636. this.ptr = this.ptr.parent
  34637. }
  34638. return this.resolved = !1,
  34639. this.result = null,
  34640. this
  34641. }
  34642. ,
  34643. n.import = function(t, e) {
  34644. var i = "/";
  34645. if ("string" == typeof e) {
  34646. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34647. !0 === this.files[e])
  34648. return this.reset();
  34649. this.files[e] = !0
  34650. } else if ("object" == typeof e) {
  34651. var n = e.root;
  34652. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34653. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34654. var r = n + i + e.file;
  34655. if (!0 === this.files[r])
  34656. return this.reset();
  34657. this.files[r] = !0
  34658. }
  34659. if (t.imports && 0 < t.imports.length) {
  34660. var o, a = !1;
  34661. "object" == typeof e ? (this.importRoot = e.root,
  34662. a = !0,
  34663. o = this.importRoot,
  34664. e = e.file,
  34665. (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(/\\[^\\]*$/, ""),
  34666. i = "\\") : o = "." : o = null;
  34667. for (var s = 0; s < t.imports.length; s++)
  34668. if ("string" == typeof t.imports[s]) {
  34669. if (!o)
  34670. throw Error("cannot determine import root");
  34671. var l = t.imports[s];
  34672. if ("google/protobuf/descriptor.proto" === l)
  34673. continue;
  34674. if (l = o + i + l,
  34675. !0 === this.files[l])
  34676. continue;
  34677. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34678. var c = u.Util.fetch(l);
  34679. if (null === c)
  34680. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34681. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34682. } else
  34683. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34684. return t + "_import" + s + "." + i
  34685. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34686. a && (this.importRoot = null)
  34687. }
  34688. t.package && this.define(t.package),
  34689. t.syntax && function t(i) {
  34690. i.messages && i.messages.forEach(function(e) {
  34691. e.syntax = i.syntax,
  34692. t(e)
  34693. }),
  34694. i.enums && i.enums.forEach(function(e) {
  34695. e.syntax = i.syntax
  34696. })
  34697. }(t);
  34698. var h = this.ptr;
  34699. return t.options && Object.keys(t.options).forEach(function(e) {
  34700. h.options[e] = t.options[e]
  34701. }),
  34702. t.messages && (this.create(t.messages),
  34703. this.ptr = h),
  34704. t.enums && (this.create(t.enums),
  34705. this.ptr = h),
  34706. t.services && (this.create(t.services),
  34707. this.ptr = h),
  34708. t.extends && this.create(t.extends),
  34709. this.reset()
  34710. }
  34711. ,
  34712. n.resolveAll = function() {
  34713. var e;
  34714. if (null == this.ptr || "object" == typeof this.ptr.type)
  34715. return this;
  34716. if (this.ptr instanceof s.Namespace)
  34717. this.ptr.children.forEach(function(e) {
  34718. this.ptr = e,
  34719. this.resolveAll()
  34720. }, this);
  34721. else if (this.ptr instanceof s.Message.Field) {
  34722. if (i.TYPE.test(this.ptr.type))
  34723. this.ptr.type = u.TYPES[this.ptr.type];
  34724. else {
  34725. if (!i.TYPEREF.test(this.ptr.type))
  34726. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34727. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34728. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34729. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34730. if (this.ptr.type = u.TYPES.enum,
  34731. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34732. throw Error("proto3 message cannot reference proto2 enum")
  34733. } else {
  34734. if (!(e instanceof s.Message))
  34735. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34736. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34737. }
  34738. }
  34739. if (this.ptr.map) {
  34740. if (!i.TYPE.test(this.ptr.keyType))
  34741. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34742. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34743. }
  34744. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34745. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34746. throw Error("illegal service type in " + this.ptr.toString(!0));
  34747. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34748. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34749. if (this.ptr.resolvedRequestType = e,
  34750. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34751. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34752. this.ptr.resolvedResponseType = e
  34753. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34754. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34755. return this.reset()
  34756. }
  34757. ,
  34758. n.build = function(e) {
  34759. if (this.reset(),
  34760. this.resolved || (this.resolveAll(),
  34761. this.resolved = !0,
  34762. this.result = null),
  34763. null === this.result && (this.result = this.ns.build()),
  34764. !e)
  34765. return this.result;
  34766. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34767. if (!i[t[n]]) {
  34768. i = null;
  34769. break
  34770. }
  34771. i = i[t[n]]
  34772. }
  34773. return i
  34774. }
  34775. ,
  34776. n.lookup = function(e, t) {
  34777. return e ? this.ns.resolve(e, t) : this.ns
  34778. }
  34779. ,
  34780. n.toString = function() {
  34781. return "Builder"
  34782. }
  34783. ,
  34784. h.Message = function() {}
  34785. ,
  34786. h.Enum = function() {}
  34787. ,
  34788. h.Service = function() {}
  34789. ,
  34790. h),
  34791. o.Map = (a = o.Reflect,
  34792. (t = c.prototype).clear = function() {
  34793. this.map = {}
  34794. }
  34795. ,
  34796. t.delete = function(e) {
  34797. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34798. , i = t in this.map;
  34799. return delete this.map[t],
  34800. i
  34801. }
  34802. ,
  34803. t.entries = function() {
  34804. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34805. t.push([(e = this.map[i[n]]).key, e.value]);
  34806. return l(t)
  34807. }
  34808. ,
  34809. t.keys = function() {
  34810. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34811. e.push(this.map[t[i]].key);
  34812. return l(e)
  34813. }
  34814. ,
  34815. t.values = function() {
  34816. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34817. e.push(this.map[t[i]].value);
  34818. return l(e)
  34819. }
  34820. ,
  34821. t.forEach = function(e, t) {
  34822. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34823. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34824. }
  34825. ,
  34826. t.set = function(e, t) {
  34827. var i = this.keyElem.verifyValue(e)
  34828. , n = this.valueElem.verifyValue(t);
  34829. return this.map[this.keyElem.valueToString(i)] = {
  34830. key: i,
  34831. value: n
  34832. },
  34833. this
  34834. }
  34835. ,
  34836. t.get = function(e) {
  34837. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34838. if (t in this.map)
  34839. return this.map[t].value
  34840. }
  34841. ,
  34842. t.has = function(e) {
  34843. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34844. }
  34845. ,
  34846. c),
  34847. o.loadProto = function(e, t, i) {
  34848. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34849. t = void 0),
  34850. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34851. }
  34852. ,
  34853. o.protoFromString = o.loadProto,
  34854. o.loadProtoFile = function(t, i, n) {
  34855. if (i && "object" == typeof i ? (n = i,
  34856. i = null) : i && "function" == typeof i || (i = null),
  34857. i)
  34858. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34859. if (null !== e)
  34860. try {
  34861. i(null, o.loadProto(e, n, t))
  34862. } catch (e) {
  34863. i(e)
  34864. }
  34865. else
  34866. i(Error("Failed to fetch file"))
  34867. });
  34868. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34869. return null === e ? null : o.loadProto(e, n, t)
  34870. }
  34871. ,
  34872. o.protoFromFile = o.loadProtoFile,
  34873. o.newBuilder = function(e) {
  34874. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34875. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34876. new o.Builder(e)
  34877. }
  34878. ,
  34879. o.loadJson = function(e, t, i) {
  34880. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34881. t = null),
  34882. t && "object" == typeof t || (t = o.newBuilder()),
  34883. "string" == typeof e && (e = JSON.parse(e)),
  34884. t.import(e, i),
  34885. t.resolveAll(),
  34886. t
  34887. }
  34888. ,
  34889. o.loadJsonFile = function(t, i, n) {
  34890. if (i && "object" == typeof i ? (n = i,
  34891. i = null) : i && "function" == typeof i || (i = null),
  34892. i)
  34893. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34894. if (null !== e)
  34895. try {
  34896. i(null, o.loadJson(JSON.parse(e), n, t))
  34897. } catch (e) {
  34898. i(e)
  34899. }
  34900. else
  34901. i(Error("Failed to fetch file"))
  34902. });
  34903. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34904. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34905. }
  34906. ,
  34907. o;
  34908. function l(e) {
  34909. var t = 0;
  34910. return {
  34911. next: function() {
  34912. return t < e.length ? {
  34913. done: !1,
  34914. value: e[t++]
  34915. } : {
  34916. done: !0
  34917. }
  34918. }
  34919. }
  34920. }
  34921. function c(e, t) {
  34922. if (!e.map)
  34923. throw Error("field is not a map");
  34924. if (this.field = e,
  34925. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34926. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34927. this.map = {},
  34928. Object.defineProperty(this, "size", {
  34929. get: function() {
  34930. return Object.keys(this.map).length
  34931. }
  34932. }),
  34933. t)
  34934. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34935. var r = this.keyElem.valueFromString(i[n])
  34936. , o = this.valueElem.verifyValue(t[i[n]]);
  34937. this.map[this.keyElem.valueToString(r)] = {
  34938. key: r,
  34939. value: o
  34940. }
  34941. }
  34942. }
  34943. function h(e) {
  34944. this.ns = new s.Namespace(this,null,""),
  34945. this.ptr = this.ns,
  34946. this.resolved = !1,
  34947. this.result = null,
  34948. this.files = {},
  34949. this.importRoot = null,
  34950. this.options = e || {}
  34951. }
  34952. }
  34953. ,
  34954. "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)
  34955. }
  34956. ).call(this, p("_process"))
  34957. }
  34958. , {
  34959. _process: 203,
  34960. bytebuffer: 215,
  34961. fs: 197,
  34962. path: 197
  34963. }],
  34964. 215: [function(t, e, i) {
  34965. var n, r;
  34966. n = this,
  34967. r = function(l) {
  34968. "use strict";
  34969. function s(e) {
  34970. var t = 0;
  34971. return function() {
  34972. return t < e.length ? e.charCodeAt(t++) : null
  34973. }
  34974. }
  34975. function c() {
  34976. var e = []
  34977. , t = [];
  34978. return function() {
  34979. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34980. e.length = 0),
  34981. void Array.prototype.push.apply(e, arguments))
  34982. }
  34983. }
  34984. function n(e, t, i, n, r) {
  34985. 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];
  34986. for (u += d,
  34987. o = p & (1 << -h) - 1,
  34988. p >>= -h,
  34989. h += s; 0 < h; o = 256 * o + e[t + u],
  34990. u += d,
  34991. h -= 8)
  34992. ;
  34993. for (a = o & (1 << -h) - 1,
  34994. o >>= -h,
  34995. h += n; 0 < h; a = 256 * a + e[t + u],
  34996. u += d,
  34997. h -= 8)
  34998. ;
  34999. if (0 === o)
  35000. o = 1 - c;
  35001. else {
  35002. if (o === l)
  35003. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  35004. a += Math.pow(2, n),
  35005. o -= c
  35006. }
  35007. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  35008. }
  35009. function r(e, t, i, n, r, o) {
  35010. 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;
  35011. for (t = Math.abs(t),
  35012. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  35013. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  35014. t * (l = Math.pow(2, -a)) < 1 && (a--,
  35015. l *= 2),
  35016. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  35017. l /= 2),
  35018. h <= a + u ? (s = 0,
  35019. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  35020. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  35021. a = 0)); 8 <= r; e[i + p] = 255 & s,
  35022. p += f,
  35023. s /= 256,
  35024. r -= 8)
  35025. ;
  35026. for (a = a << r | s,
  35027. c += r; 0 < c; e[i + p] = 255 & a,
  35028. p += f,
  35029. a /= 256,
  35030. c -= 8)
  35031. ;
  35032. e[i + p - f] |= 128 * g
  35033. }
  35034. var f = function(e, t, i) {
  35035. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  35036. void 0 === t && (t = f.DEFAULT_ENDIAN),
  35037. void 0 === i && (i = f.DEFAULT_NOASSERT),
  35038. !i) {
  35039. if ((e |= 0) < 0)
  35040. throw RangeError("Illegal capacity");
  35041. t = !!t,
  35042. i = !!i
  35043. }
  35044. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  35045. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  35046. this.offset = 0,
  35047. this.markedOffset = -1,
  35048. this.limit = e,
  35049. this.littleEndian = t,
  35050. this.noAssert = i
  35051. };
  35052. f.VERSION = "5.0.1",
  35053. f.LITTLE_ENDIAN = !0,
  35054. f.BIG_ENDIAN = !1,
  35055. f.DEFAULT_CAPACITY = 16,
  35056. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  35057. f.DEFAULT_NOASSERT = !1,
  35058. f.Long = l || null;
  35059. var a = f.prototype;
  35060. a.__isByteBuffer__,
  35061. Object.defineProperty(a, "__isByteBuffer__", {
  35062. value: !0,
  35063. enumerable: !1,
  35064. configurable: !1
  35065. });
  35066. var o = new ArrayBuffer(0)
  35067. , i = String.fromCharCode;
  35068. f.accessor = function() {
  35069. return Uint8Array
  35070. }
  35071. ,
  35072. f.allocate = function(e, t, i) {
  35073. return new f(e,t,i)
  35074. }
  35075. ,
  35076. f.concat = function(e, t, i, n) {
  35077. "boolean" != typeof t && "string" == typeof t || (n = i,
  35078. i = t,
  35079. t = void 0);
  35080. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  35081. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  35082. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  35083. if (0 === o)
  35084. return new f(0,i,n);
  35085. var l, c = new f(o,i,n);
  35086. for (a = 0; a < s; )
  35087. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  35088. c.offset += r);
  35089. return c.limit = c.offset,
  35090. c.offset = 0,
  35091. c
  35092. }
  35093. ,
  35094. f.isByteBuffer = function(e) {
  35095. return !0 === (e && e.__isByteBuffer__)
  35096. }
  35097. ,
  35098. f.type = function() {
  35099. return ArrayBuffer
  35100. }
  35101. ,
  35102. f.wrap = function(e, t, i, n) {
  35103. if ("string" != typeof t && (n = i,
  35104. i = t,
  35105. t = void 0),
  35106. "string" == typeof e)
  35107. switch (void 0 === t && (t = "utf8"),
  35108. t) {
  35109. case "base64":
  35110. return f.fromBase64(e, i);
  35111. case "hex":
  35112. return f.fromHex(e, i);
  35113. case "binary":
  35114. return f.fromBinary(e, i);
  35115. case "utf8":
  35116. return f.fromUTF8(e, i);
  35117. case "debug":
  35118. return f.fromDebug(e, i);
  35119. default:
  35120. throw Error("Unsupported encoding: " + t)
  35121. }
  35122. if (null === e || "object" != typeof e)
  35123. throw TypeError("Illegal buffer");
  35124. var r;
  35125. if (f.isByteBuffer(e))
  35126. return (r = a.clone.call(e)).markedOffset = -1,
  35127. r;
  35128. if (e instanceof Uint8Array)
  35129. r = new f(0,i,n),
  35130. 0 < e.length && (r.buffer = e.buffer,
  35131. r.offset = e.byteOffset,
  35132. r.limit = e.byteOffset + e.byteLength,
  35133. r.view = new Uint8Array(e.buffer));
  35134. else if (e instanceof ArrayBuffer)
  35135. r = new f(0,i,n),
  35136. 0 < e.byteLength && (r.buffer = e,
  35137. r.offset = 0,
  35138. r.limit = e.byteLength,
  35139. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  35140. else {
  35141. if ("[object Array]" !== Object.prototype.toString.call(e))
  35142. throw TypeError("Illegal buffer");
  35143. (r = new f(e.length,i,n)).limit = e.length;
  35144. for (var o = 0; o < e.length; ++o)
  35145. r.view[o] = e[o]
  35146. }
  35147. return r
  35148. }
  35149. ,
  35150. a.writeBitSet = function(e, t) {
  35151. var i = void 0 === t;
  35152. if (i && (t = this.offset),
  35153. !this.noAssert) {
  35154. if (!(e instanceof Array))
  35155. throw TypeError("Illegal BitSet: Not an array");
  35156. if ("number" != typeof t || t % 1 != 0)
  35157. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35158. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35159. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35160. }
  35161. var n, r = t, o = e.length, a = o >> 3, s = 0;
  35162. for (t += this.writeVarint32(o, t); a--; )
  35163. 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,
  35164. this.writeByte(n, t++);
  35165. if (s < o) {
  35166. var l = 0;
  35167. for (n = 0; s < o; )
  35168. n |= (1 & !!e[s++]) << l++;
  35169. this.writeByte(n, t++)
  35170. }
  35171. return i ? (this.offset = t,
  35172. this) : t - r
  35173. }
  35174. ,
  35175. a.readBitSet = function(e) {
  35176. var t = void 0 === e;
  35177. t && (e = this.offset);
  35178. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  35179. for (e += n.length; o--; )
  35180. i = this.readByte(e++),
  35181. s[a++] = !!(1 & i),
  35182. s[a++] = !!(2 & i),
  35183. s[a++] = !!(4 & i),
  35184. s[a++] = !!(8 & i),
  35185. s[a++] = !!(16 & i),
  35186. s[a++] = !!(32 & i),
  35187. s[a++] = !!(64 & i),
  35188. s[a++] = !!(128 & i);
  35189. if (a < r) {
  35190. var l = 0;
  35191. for (i = this.readByte(e++); a < r; )
  35192. s[a++] = !!(i >> l++ & 1)
  35193. }
  35194. return t && (this.offset = e),
  35195. s
  35196. }
  35197. ,
  35198. a.readBytes = function(e, t) {
  35199. var i = void 0 === t;
  35200. if (i && (t = this.offset),
  35201. !this.noAssert) {
  35202. if ("number" != typeof t || t % 1 != 0)
  35203. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35204. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  35205. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  35206. }
  35207. var n = this.slice(t, t + e);
  35208. return i && (this.offset += e),
  35209. n
  35210. }
  35211. ,
  35212. a.writeBytes = a.append,
  35213. a.writeInt8 = function(e, t) {
  35214. var i = void 0 === t;
  35215. if (i && (t = this.offset),
  35216. !this.noAssert) {
  35217. if ("number" != typeof e || e % 1 != 0)
  35218. throw TypeError("Illegal value: " + e + " (not an integer)");
  35219. if (e |= 0,
  35220. "number" != typeof t || t % 1 != 0)
  35221. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35222. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35223. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35224. }
  35225. t += 1;
  35226. var n = this.buffer.byteLength;
  35227. return n < t && this.resize((n *= 2) > t ? n : t),
  35228. t -= 1,
  35229. this.view[t] = e,
  35230. i && (this.offset += 1),
  35231. this
  35232. }
  35233. ,
  35234. a.writeByte = a.writeInt8,
  35235. a.readInt8 = function(e) {
  35236. var t = void 0 === e;
  35237. if (t && (e = this.offset),
  35238. !this.noAssert) {
  35239. if ("number" != typeof e || e % 1 != 0)
  35240. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35241. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35242. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35243. }
  35244. var i = this.view[e];
  35245. return 128 == (128 & i) && (i = -(255 - i + 1)),
  35246. t && (this.offset += 1),
  35247. i
  35248. }
  35249. ,
  35250. a.readByte = a.readInt8,
  35251. a.writeUint8 = function(e, t) {
  35252. var i = void 0 === t;
  35253. if (i && (t = this.offset),
  35254. !this.noAssert) {
  35255. if ("number" != typeof e || e % 1 != 0)
  35256. throw TypeError("Illegal value: " + e + " (not an integer)");
  35257. if (e >>>= 0,
  35258. "number" != typeof t || t % 1 != 0)
  35259. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35260. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35261. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35262. }
  35263. t += 1;
  35264. var n = this.buffer.byteLength;
  35265. return n < t && this.resize((n *= 2) > t ? n : t),
  35266. t -= 1,
  35267. this.view[t] = e,
  35268. i && (this.offset += 1),
  35269. this
  35270. }
  35271. ,
  35272. a.writeUInt8 = a.writeUint8,
  35273. a.readUint8 = function(e) {
  35274. var t = void 0 === e;
  35275. if (t && (e = this.offset),
  35276. !this.noAssert) {
  35277. if ("number" != typeof e || e % 1 != 0)
  35278. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35279. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35280. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35281. }
  35282. var i = this.view[e];
  35283. return t && (this.offset += 1),
  35284. i
  35285. }
  35286. ,
  35287. a.readUInt8 = a.readUint8,
  35288. a.writeInt16 = function(e, t) {
  35289. var i = void 0 === t;
  35290. if (i && (t = this.offset),
  35291. !this.noAssert) {
  35292. if ("number" != typeof e || e % 1 != 0)
  35293. throw TypeError("Illegal value: " + e + " (not an integer)");
  35294. if (e |= 0,
  35295. "number" != typeof t || t % 1 != 0)
  35296. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35297. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35298. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35299. }
  35300. t += 2;
  35301. var n = this.buffer.byteLength;
  35302. return n < t && this.resize((n *= 2) > t ? n : t),
  35303. t -= 2,
  35304. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35305. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35306. this.view[t + 1] = 255 & e),
  35307. i && (this.offset += 2),
  35308. this
  35309. }
  35310. ,
  35311. a.writeShort = a.writeInt16,
  35312. a.readInt16 = function(e) {
  35313. var t = void 0 === e;
  35314. if (t && (e = this.offset),
  35315. !this.noAssert) {
  35316. if ("number" != typeof e || e % 1 != 0)
  35317. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35318. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35319. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35320. }
  35321. var i = 0;
  35322. return this.littleEndian ? (i = this.view[e],
  35323. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35324. i |= this.view[e + 1]),
  35325. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  35326. t && (this.offset += 2),
  35327. i
  35328. }
  35329. ,
  35330. a.readShort = a.readInt16,
  35331. a.writeUint16 = function(e, t) {
  35332. var i = void 0 === t;
  35333. if (i && (t = this.offset),
  35334. !this.noAssert) {
  35335. if ("number" != typeof e || e % 1 != 0)
  35336. throw TypeError("Illegal value: " + e + " (not an integer)");
  35337. if (e >>>= 0,
  35338. "number" != typeof t || t % 1 != 0)
  35339. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35340. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35341. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35342. }
  35343. t += 2;
  35344. var n = this.buffer.byteLength;
  35345. return n < t && this.resize((n *= 2) > t ? n : t),
  35346. t -= 2,
  35347. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35348. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35349. this.view[t + 1] = 255 & e),
  35350. i && (this.offset += 2),
  35351. this
  35352. }
  35353. ,
  35354. a.writeUInt16 = a.writeUint16,
  35355. a.readUint16 = function(e) {
  35356. var t = void 0 === e;
  35357. if (t && (e = this.offset),
  35358. !this.noAssert) {
  35359. if ("number" != typeof e || e % 1 != 0)
  35360. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35361. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35362. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35363. }
  35364. var i = 0;
  35365. return this.littleEndian ? (i = this.view[e],
  35366. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35367. i |= this.view[e + 1]),
  35368. t && (this.offset += 2),
  35369. i
  35370. }
  35371. ,
  35372. a.readUInt16 = a.readUint16,
  35373. a.writeInt32 = function(e, t) {
  35374. var i = void 0 === t;
  35375. if (i && (t = this.offset),
  35376. !this.noAssert) {
  35377. if ("number" != typeof e || e % 1 != 0)
  35378. throw TypeError("Illegal value: " + e + " (not an integer)");
  35379. if (e |= 0,
  35380. "number" != typeof t || t % 1 != 0)
  35381. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35382. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35383. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35384. }
  35385. t += 4;
  35386. var n = this.buffer.byteLength;
  35387. return n < t && this.resize((n *= 2) > t ? n : t),
  35388. t -= 4,
  35389. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35390. this.view[t + 2] = e >>> 16 & 255,
  35391. this.view[t + 1] = e >>> 8 & 255,
  35392. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35393. this.view[t + 1] = e >>> 16 & 255,
  35394. this.view[t + 2] = e >>> 8 & 255,
  35395. this.view[t + 3] = 255 & e),
  35396. i && (this.offset += 4),
  35397. this
  35398. }
  35399. ,
  35400. a.writeInt = a.writeInt32,
  35401. a.readInt32 = function(e) {
  35402. var t = void 0 === e;
  35403. if (t && (e = this.offset),
  35404. !this.noAssert) {
  35405. if ("number" != typeof e || e % 1 != 0)
  35406. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35407. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35408. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35409. }
  35410. var i = 0;
  35411. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35412. i |= this.view[e + 1] << 8,
  35413. i |= this.view[e],
  35414. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35415. i |= this.view[e + 2] << 8,
  35416. i |= this.view[e + 3],
  35417. i += this.view[e] << 24 >>> 0),
  35418. i |= 0,
  35419. t && (this.offset += 4),
  35420. i
  35421. }
  35422. ,
  35423. a.readInt = a.readInt32,
  35424. a.writeUint32 = function(e, t) {
  35425. var i = void 0 === t;
  35426. if (i && (t = this.offset),
  35427. !this.noAssert) {
  35428. if ("number" != typeof e || e % 1 != 0)
  35429. throw TypeError("Illegal value: " + e + " (not an integer)");
  35430. if (e >>>= 0,
  35431. "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. t += 4;
  35437. var n = this.buffer.byteLength;
  35438. return n < t && this.resize((n *= 2) > t ? n : t),
  35439. t -= 4,
  35440. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35441. this.view[t + 2] = e >>> 16 & 255,
  35442. this.view[t + 1] = e >>> 8 & 255,
  35443. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35444. this.view[t + 1] = e >>> 16 & 255,
  35445. this.view[t + 2] = e >>> 8 & 255,
  35446. this.view[t + 3] = 255 & e),
  35447. i && (this.offset += 4),
  35448. this
  35449. }
  35450. ,
  35451. a.writeUInt32 = a.writeUint32,
  35452. a.readUint32 = function(e) {
  35453. var t = void 0 === e;
  35454. if (t && (e = this.offset),
  35455. !this.noAssert) {
  35456. if ("number" != typeof e || e % 1 != 0)
  35457. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35458. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35459. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35460. }
  35461. var i = 0;
  35462. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35463. i |= this.view[e + 1] << 8,
  35464. i |= this.view[e],
  35465. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35466. i |= this.view[e + 2] << 8,
  35467. i |= this.view[e + 3],
  35468. i += this.view[e] << 24 >>> 0),
  35469. t && (this.offset += 4),
  35470. i
  35471. }
  35472. ,
  35473. a.readUInt32 = a.readUint32,
  35474. l && (a.writeInt64 = function(e, t) {
  35475. var i = void 0 === t;
  35476. if (i && (t = this.offset),
  35477. !this.noAssert) {
  35478. if ("number" == typeof e)
  35479. e = l.fromNumber(e);
  35480. else if ("string" == typeof e)
  35481. e = l.fromString(e);
  35482. else if (!(e && e instanceof l))
  35483. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35484. if ("number" != typeof t || t % 1 != 0)
  35485. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35486. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35487. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35488. }
  35489. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35490. t += 8;
  35491. var n = this.buffer.byteLength;
  35492. n < t && this.resize((n *= 2) > t ? n : t),
  35493. t -= 8;
  35494. var r = e.low
  35495. , o = e.high;
  35496. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35497. this.view[t + 2] = r >>> 16 & 255,
  35498. this.view[t + 1] = r >>> 8 & 255,
  35499. this.view[t] = 255 & r,
  35500. t += 4,
  35501. this.view[t + 3] = o >>> 24 & 255,
  35502. this.view[t + 2] = o >>> 16 & 255,
  35503. this.view[t + 1] = o >>> 8 & 255,
  35504. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35505. this.view[t + 1] = o >>> 16 & 255,
  35506. this.view[t + 2] = o >>> 8 & 255,
  35507. this.view[t + 3] = 255 & o,
  35508. t += 4,
  35509. this.view[t] = r >>> 24 & 255,
  35510. this.view[t + 1] = r >>> 16 & 255,
  35511. this.view[t + 2] = r >>> 8 & 255,
  35512. this.view[t + 3] = 255 & r),
  35513. i && (this.offset += 8),
  35514. this
  35515. }
  35516. ,
  35517. a.writeLong = a.writeInt64,
  35518. a.readInt64 = function(e) {
  35519. var t = void 0 === e;
  35520. if (t && (e = this.offset),
  35521. !this.noAssert) {
  35522. if ("number" != typeof e || e % 1 != 0)
  35523. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35524. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35525. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35526. }
  35527. var i = 0
  35528. , n = 0;
  35529. this.littleEndian ? (i = this.view[e + 2] << 16,
  35530. i |= this.view[e + 1] << 8,
  35531. i |= this.view[e],
  35532. i += this.view[e + 3] << 24 >>> 0,
  35533. e += 4,
  35534. n = this.view[e + 2] << 16,
  35535. n |= this.view[e + 1] << 8,
  35536. n |= this.view[e],
  35537. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35538. n |= this.view[e + 2] << 8,
  35539. n |= this.view[e + 3],
  35540. n += this.view[e] << 24 >>> 0,
  35541. e += 4,
  35542. i = this.view[e + 1] << 16,
  35543. i |= this.view[e + 2] << 8,
  35544. i |= this.view[e + 3],
  35545. i += this.view[e] << 24 >>> 0);
  35546. var r = new l(i,n,!1);
  35547. return t && (this.offset += 8),
  35548. r
  35549. }
  35550. ,
  35551. a.readLong = a.readInt64,
  35552. a.writeUint64 = function(e, t) {
  35553. var i = void 0 === t;
  35554. if (i && (t = this.offset),
  35555. !this.noAssert) {
  35556. if ("number" == typeof e)
  35557. e = l.fromNumber(e);
  35558. else if ("string" == typeof e)
  35559. e = l.fromString(e);
  35560. else if (!(e && e instanceof l))
  35561. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35562. if ("number" != typeof t || t % 1 != 0)
  35563. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35564. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35565. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35566. }
  35567. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35568. t += 8;
  35569. var n = this.buffer.byteLength;
  35570. n < t && this.resize((n *= 2) > t ? n : t),
  35571. t -= 8;
  35572. var r = e.low
  35573. , o = e.high;
  35574. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35575. this.view[t + 2] = r >>> 16 & 255,
  35576. this.view[t + 1] = r >>> 8 & 255,
  35577. this.view[t] = 255 & r,
  35578. t += 4,
  35579. this.view[t + 3] = o >>> 24 & 255,
  35580. this.view[t + 2] = o >>> 16 & 255,
  35581. this.view[t + 1] = o >>> 8 & 255,
  35582. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35583. this.view[t + 1] = o >>> 16 & 255,
  35584. this.view[t + 2] = o >>> 8 & 255,
  35585. this.view[t + 3] = 255 & o,
  35586. t += 4,
  35587. this.view[t] = r >>> 24 & 255,
  35588. this.view[t + 1] = r >>> 16 & 255,
  35589. this.view[t + 2] = r >>> 8 & 255,
  35590. this.view[t + 3] = 255 & r),
  35591. i && (this.offset += 8),
  35592. this
  35593. }
  35594. ,
  35595. a.writeUInt64 = a.writeUint64,
  35596. a.readUint64 = function(e) {
  35597. var t = void 0 === e;
  35598. if (t && (e = this.offset),
  35599. !this.noAssert) {
  35600. if ("number" != typeof e || e % 1 != 0)
  35601. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35602. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35603. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35604. }
  35605. var i = 0
  35606. , n = 0;
  35607. this.littleEndian ? (i = this.view[e + 2] << 16,
  35608. i |= this.view[e + 1] << 8,
  35609. i |= this.view[e],
  35610. i += this.view[e + 3] << 24 >>> 0,
  35611. e += 4,
  35612. n = this.view[e + 2] << 16,
  35613. n |= this.view[e + 1] << 8,
  35614. n |= this.view[e],
  35615. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35616. n |= this.view[e + 2] << 8,
  35617. n |= this.view[e + 3],
  35618. n += this.view[e] << 24 >>> 0,
  35619. e += 4,
  35620. i = this.view[e + 1] << 16,
  35621. i |= this.view[e + 2] << 8,
  35622. i |= this.view[e + 3],
  35623. i += this.view[e] << 24 >>> 0);
  35624. var r = new l(i,n,!0);
  35625. return t && (this.offset += 8),
  35626. r
  35627. }
  35628. ,
  35629. a.readUInt64 = a.readUint64),
  35630. a.writeFloat32 = function(e, t) {
  35631. var i = void 0 === t;
  35632. if (i && (t = this.offset),
  35633. !this.noAssert) {
  35634. if ("number" != typeof e)
  35635. throw TypeError("Illegal value: " + e + " (not a number)");
  35636. if ("number" != typeof t || t % 1 != 0)
  35637. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35638. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35639. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35640. }
  35641. t += 4;
  35642. var n = this.buffer.byteLength;
  35643. return n < t && this.resize((n *= 2) > t ? n : t),
  35644. t -= 4,
  35645. r(this.view, e, t, this.littleEndian, 23, 4),
  35646. i && (this.offset += 4),
  35647. this
  35648. }
  35649. ,
  35650. a.writeFloat = a.writeFloat32,
  35651. a.readFloat32 = function(e) {
  35652. var t = void 0 === e;
  35653. if (t && (e = this.offset),
  35654. !this.noAssert) {
  35655. if ("number" != typeof e || e % 1 != 0)
  35656. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35657. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35658. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35659. }
  35660. var i = n(this.view, e, this.littleEndian, 23, 4);
  35661. return t && (this.offset += 4),
  35662. i
  35663. }
  35664. ,
  35665. a.readFloat = a.readFloat32,
  35666. a.writeFloat64 = function(e, t) {
  35667. var i = void 0 === t;
  35668. if (i && (t = this.offset),
  35669. !this.noAssert) {
  35670. if ("number" != typeof e)
  35671. throw TypeError("Illegal value: " + e + " (not a number)");
  35672. if ("number" != typeof t || t % 1 != 0)
  35673. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35674. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35675. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35676. }
  35677. t += 8;
  35678. var n = this.buffer.byteLength;
  35679. return n < t && this.resize((n *= 2) > t ? n : t),
  35680. t -= 8,
  35681. r(this.view, e, t, this.littleEndian, 52, 8),
  35682. i && (this.offset += 8),
  35683. this
  35684. }
  35685. ,
  35686. a.writeDouble = a.writeFloat64,
  35687. a.readFloat64 = function(e) {
  35688. var t = void 0 === e;
  35689. if (t && (e = this.offset),
  35690. !this.noAssert) {
  35691. if ("number" != typeof e || e % 1 != 0)
  35692. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35693. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35694. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35695. }
  35696. var i = n(this.view, e, this.littleEndian, 52, 8);
  35697. return t && (this.offset += 8),
  35698. i
  35699. }
  35700. ,
  35701. a.readDouble = a.readFloat64,
  35702. f.MAX_VARINT32_BYTES = 5,
  35703. f.calculateVarint32 = function(e) {
  35704. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35705. }
  35706. ,
  35707. f.zigZagEncode32 = function(e) {
  35708. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35709. }
  35710. ,
  35711. f.zigZagDecode32 = function(e) {
  35712. return e >>> 1 ^ -(1 & e) | 0
  35713. }
  35714. ,
  35715. a.writeVarint32 = function(e, t) {
  35716. var i = void 0 === t;
  35717. if (i && (t = this.offset),
  35718. !this.noAssert) {
  35719. if ("number" != typeof e || e % 1 != 0)
  35720. throw TypeError("Illegal value: " + e + " (not an integer)");
  35721. if (e |= 0,
  35722. "number" != typeof t || t % 1 != 0)
  35723. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35724. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35725. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35726. }
  35727. var n, r = f.calculateVarint32(e);
  35728. t += r;
  35729. var o = this.buffer.byteLength;
  35730. for (o < t && this.resize((o *= 2) > t ? o : t),
  35731. t -= r,
  35732. e >>>= 0; 128 <= e; )
  35733. n = 127 & e | 128,
  35734. this.view[t++] = n,
  35735. e >>>= 7;
  35736. return this.view[t++] = e,
  35737. i ? (this.offset = t,
  35738. this) : r
  35739. }
  35740. ,
  35741. a.writeVarint32ZigZag = function(e, t) {
  35742. return this.writeVarint32(f.zigZagEncode32(e), t)
  35743. }
  35744. ,
  35745. a.readVarint32 = function(e) {
  35746. var t = void 0 === e;
  35747. if (t && (e = this.offset),
  35748. !this.noAssert) {
  35749. if ("number" != typeof e || e % 1 != 0)
  35750. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35751. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35752. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35753. }
  35754. var i, n = 0, r = 0;
  35755. do {
  35756. if (!this.noAssert && e > this.limit) {
  35757. var o = Error("Truncated");
  35758. throw o.truncated = !0,
  35759. o
  35760. }
  35761. i = this.view[e++],
  35762. n < 5 && (r |= (127 & i) << 7 * n),
  35763. ++n
  35764. } while (0 != (128 & i));return r |= 0,
  35765. t ? (this.offset = e,
  35766. r) : {
  35767. value: r,
  35768. length: n
  35769. }
  35770. }
  35771. ,
  35772. a.readVarint32ZigZag = function(e) {
  35773. var t = this.readVarint32(e);
  35774. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35775. t
  35776. }
  35777. ,
  35778. l && (f.MAX_VARINT64_BYTES = 10,
  35779. f.calculateVarint64 = function(e) {
  35780. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35781. var t = e.toInt() >>> 0
  35782. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35783. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35784. 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
  35785. }
  35786. ,
  35787. f.zigZagEncode64 = function(e) {
  35788. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35789. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35790. }
  35791. ,
  35792. f.zigZagDecode64 = function(e) {
  35793. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35794. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35795. }
  35796. ,
  35797. a.writeVarint64 = function(e, t) {
  35798. var i = void 0 === t;
  35799. if (i && (t = this.offset),
  35800. !this.noAssert) {
  35801. if ("number" == typeof e)
  35802. e = l.fromNumber(e);
  35803. else if ("string" == typeof e)
  35804. e = l.fromString(e);
  35805. else if (!(e && e instanceof l))
  35806. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35807. if ("number" != typeof t || t % 1 != 0)
  35808. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35809. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35810. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35811. }
  35812. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35813. var n = f.calculateVarint64(e)
  35814. , r = e.toInt() >>> 0
  35815. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35816. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35817. t += n;
  35818. var s = this.buffer.byteLength;
  35819. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35820. t -= n,
  35821. n) {
  35822. case 10:
  35823. this.view[t + 9] = a >>> 7 & 1;
  35824. case 9:
  35825. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35826. case 8:
  35827. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35828. case 7:
  35829. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35830. case 6:
  35831. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35832. case 5:
  35833. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35834. case 4:
  35835. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35836. case 3:
  35837. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35838. case 2:
  35839. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35840. case 1:
  35841. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35842. }
  35843. return i ? (this.offset += n,
  35844. this) : n
  35845. }
  35846. ,
  35847. a.writeVarint64ZigZag = function(e, t) {
  35848. return this.writeVarint64(f.zigZagEncode64(e), t)
  35849. }
  35850. ,
  35851. a.readVarint64 = function(e) {
  35852. var t = void 0 === e;
  35853. if (t && (e = this.offset),
  35854. !this.noAssert) {
  35855. if ("number" != typeof e || e % 1 != 0)
  35856. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35857. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35858. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35859. }
  35860. var i = e
  35861. , n = 0
  35862. , r = 0
  35863. , o = 0
  35864. , a = 0;
  35865. if (n = 127 & (a = this.view[e++]),
  35866. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35867. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35868. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35869. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35870. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35871. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35872. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35873. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35874. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35875. 128 & a || this.noAssert && void 0 === a))))))))))
  35876. throw Error("Buffer overrun");
  35877. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35878. return t ? (this.offset = e,
  35879. s) : {
  35880. value: s,
  35881. length: e - i
  35882. }
  35883. }
  35884. ,
  35885. a.readVarint64ZigZag = function(e) {
  35886. var t = this.readVarint64(e);
  35887. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35888. t
  35889. }
  35890. ),
  35891. a.writeCString = function(e, t) {
  35892. var i = void 0 === t;
  35893. i && (t = this.offset);
  35894. var n, r = e.length;
  35895. if (!this.noAssert) {
  35896. if ("string" != typeof e)
  35897. throw TypeError("Illegal str: Not a string");
  35898. for (n = 0; n < r; ++n)
  35899. if (0 === e.charCodeAt(n))
  35900. throw RangeError("Illegal str: Contains NULL-characters");
  35901. if ("number" != typeof t || t % 1 != 0)
  35902. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35903. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35904. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35905. }
  35906. r = d.calculateUTF16asUTF8(s(e))[1],
  35907. t += r + 1;
  35908. var o = this.buffer.byteLength;
  35909. return o < t && this.resize((o *= 2) > t ? o : t),
  35910. t -= r + 1,
  35911. d.encodeUTF16toUTF8(s(e), function(e) {
  35912. this.view[t++] = e
  35913. }
  35914. .bind(this)),
  35915. this.view[t++] = 0,
  35916. i ? (this.offset = t,
  35917. this) : r
  35918. }
  35919. ,
  35920. a.readCString = function(e) {
  35921. var t = void 0 === e;
  35922. if (t && (e = this.offset),
  35923. !this.noAssert) {
  35924. if ("number" != typeof e || e % 1 != 0)
  35925. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35926. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35927. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35928. }
  35929. var i, n = e, r = -1;
  35930. return d.decodeUTF8toUTF16(function() {
  35931. if (0 === r)
  35932. return null;
  35933. if (e >= this.limit)
  35934. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35935. return 0 === (r = this.view[e++]) ? null : r
  35936. }
  35937. .bind(this), i = c(), !0),
  35938. t ? (this.offset = e,
  35939. i()) : {
  35940. string: i(),
  35941. length: e - n
  35942. }
  35943. }
  35944. ,
  35945. a.writeIString = function(e, t) {
  35946. var i = void 0 === t;
  35947. if (i && (t = this.offset),
  35948. !this.noAssert) {
  35949. if ("string" != typeof e)
  35950. throw TypeError("Illegal str: Not a string");
  35951. if ("number" != typeof t || t % 1 != 0)
  35952. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35953. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35954. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35955. }
  35956. var n, r = t;
  35957. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35958. t += 4 + n;
  35959. var o = this.buffer.byteLength;
  35960. if (o < t && this.resize((o *= 2) > t ? o : t),
  35961. t -= 4 + n,
  35962. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35963. this.view[t + 2] = n >>> 16 & 255,
  35964. this.view[t + 1] = n >>> 8 & 255,
  35965. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35966. this.view[t + 1] = n >>> 16 & 255,
  35967. this.view[t + 2] = n >>> 8 & 255,
  35968. this.view[t + 3] = 255 & n),
  35969. t += 4,
  35970. d.encodeUTF16toUTF8(s(e), function(e) {
  35971. this.view[t++] = e
  35972. }
  35973. .bind(this)),
  35974. t !== r + 4 + n)
  35975. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35976. return i ? (this.offset = t,
  35977. this) : t - r
  35978. }
  35979. ,
  35980. a.readIString = function(e) {
  35981. var t = void 0 === e;
  35982. if (t && (e = this.offset),
  35983. !this.noAssert) {
  35984. if ("number" != typeof e || e % 1 != 0)
  35985. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35986. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35987. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35988. }
  35989. var i = e
  35990. , n = this.readUint32(e)
  35991. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35992. return e += r.length,
  35993. t ? (this.offset = e,
  35994. r.string) : {
  35995. string: r.string,
  35996. length: e - i
  35997. }
  35998. }
  35999. ,
  36000. f.METRICS_CHARS = "c",
  36001. f.METRICS_BYTES = "b",
  36002. a.writeUTF8String = function(e, t) {
  36003. var i = void 0 === t;
  36004. if (i && (t = this.offset),
  36005. !this.noAssert) {
  36006. if ("number" != typeof t || t % 1 != 0)
  36007. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36008. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  36009. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36010. }
  36011. var n, r = t;
  36012. n = d.calculateUTF16asUTF8(s(e))[1],
  36013. t += n;
  36014. var o = this.buffer.byteLength;
  36015. return o < t && this.resize((o *= 2) > t ? o : t),
  36016. t -= n,
  36017. d.encodeUTF16toUTF8(s(e), function(e) {
  36018. this.view[t++] = e
  36019. }
  36020. .bind(this)),
  36021. i ? (this.offset = t,
  36022. this) : t - r
  36023. }
  36024. ,
  36025. a.writeString = a.writeUTF8String,
  36026. f.calculateUTF8Chars = function(e) {
  36027. return d.calculateUTF16asUTF8(s(e))[0]
  36028. }
  36029. ,
  36030. f.calculateUTF8Bytes = function(e) {
  36031. return d.calculateUTF16asUTF8(s(e))[1]
  36032. }
  36033. ,
  36034. f.calculateString = f.calculateUTF8Bytes,
  36035. a.readUTF8String = function(e, t, i) {
  36036. "number" == typeof t && (i = t,
  36037. t = void 0);
  36038. var n = void 0 === i;
  36039. if (n && (i = this.offset),
  36040. void 0 === t && (t = f.METRICS_CHARS),
  36041. !this.noAssert) {
  36042. if ("number" != typeof e || e % 1 != 0)
  36043. throw TypeError("Illegal length: " + e + " (not an integer)");
  36044. if (e |= 0,
  36045. "number" != typeof i || i % 1 != 0)
  36046. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36047. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36048. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36049. }
  36050. var r, o = 0, a = i;
  36051. if (t === f.METRICS_CHARS) {
  36052. if (r = c(),
  36053. d.decodeUTF8(function() {
  36054. return o < e && i < this.limit ? this.view[i++] : null
  36055. }
  36056. .bind(this), function(e) {
  36057. ++o,
  36058. d.UTF8toUTF16(e, r)
  36059. }),
  36060. o !== e)
  36061. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  36062. return n ? (this.offset = i,
  36063. r()) : {
  36064. string: r(),
  36065. length: i - a
  36066. }
  36067. }
  36068. if (t !== f.METRICS_BYTES)
  36069. throw TypeError("Unsupported metrics: " + t);
  36070. if (!this.noAssert) {
  36071. if ("number" != typeof i || i % 1 != 0)
  36072. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36073. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  36074. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  36075. }
  36076. var s = i + e;
  36077. if (d.decodeUTF8toUTF16(function() {
  36078. return i < s ? this.view[i++] : null
  36079. }
  36080. .bind(this), r = c(), this.noAssert),
  36081. i !== s)
  36082. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  36083. return n ? (this.offset = i,
  36084. r()) : {
  36085. string: r(),
  36086. length: i - a
  36087. }
  36088. }
  36089. ,
  36090. a.readString = a.readUTF8String,
  36091. a.writeVString = function(e, t) {
  36092. var i = void 0 === t;
  36093. if (i && (t = this.offset),
  36094. !this.noAssert) {
  36095. if ("string" != typeof e)
  36096. throw TypeError("Illegal str: Not a string");
  36097. if ("number" != typeof t || t % 1 != 0)
  36098. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36099. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  36100. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36101. }
  36102. var n, r, o = t;
  36103. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  36104. r = f.calculateVarint32(n),
  36105. t += r + n;
  36106. var a = this.buffer.byteLength;
  36107. if (a < t && this.resize((a *= 2) > t ? a : t),
  36108. t -= r + n,
  36109. t += this.writeVarint32(n, t),
  36110. d.encodeUTF16toUTF8(s(e), function(e) {
  36111. this.view[t++] = e
  36112. }
  36113. .bind(this)),
  36114. t !== o + n + r)
  36115. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  36116. return i ? (this.offset = t,
  36117. this) : t - o
  36118. }
  36119. ,
  36120. a.readVString = function(e) {
  36121. var t = void 0 === e;
  36122. if (t && (e = this.offset),
  36123. !this.noAssert) {
  36124. if ("number" != typeof e || e % 1 != 0)
  36125. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36126. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  36127. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36128. }
  36129. var i = e
  36130. , n = this.readVarint32(e)
  36131. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  36132. return e += r.length,
  36133. t ? (this.offset = e,
  36134. r.string) : {
  36135. string: r.string,
  36136. length: e - i
  36137. }
  36138. }
  36139. ,
  36140. a.append = function(e, t, i) {
  36141. "number" != typeof t && "string" == typeof t || (i = t,
  36142. t = void 0);
  36143. var n = void 0 === i;
  36144. if (n && (i = this.offset),
  36145. !this.noAssert) {
  36146. if ("number" != typeof i || i % 1 != 0)
  36147. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36148. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36149. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36150. }
  36151. e instanceof f || (e = f.wrap(e, t));
  36152. var r = e.limit - e.offset;
  36153. if (r <= 0)
  36154. return this;
  36155. i += r;
  36156. var o = this.buffer.byteLength;
  36157. return o < i && this.resize((o *= 2) > i ? o : i),
  36158. i -= r,
  36159. this.view.set(e.view.subarray(e.offset, e.limit), i),
  36160. e.offset += r,
  36161. n && (this.offset += r),
  36162. this
  36163. }
  36164. ,
  36165. a.appendTo = function(e, t) {
  36166. return e.append(this, t),
  36167. this
  36168. }
  36169. ,
  36170. a.assert = function(e) {
  36171. return this.noAssert = !e,
  36172. this
  36173. }
  36174. ,
  36175. a.capacity = function() {
  36176. return this.buffer.byteLength
  36177. }
  36178. ,
  36179. a.clear = function() {
  36180. return this.offset = 0,
  36181. this.limit = this.buffer.byteLength,
  36182. this.markedOffset = -1,
  36183. this
  36184. }
  36185. ,
  36186. a.clone = function(e) {
  36187. var t = new f(0,this.littleEndian,this.noAssert);
  36188. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  36189. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  36190. t.view = this.view),
  36191. t.offset = this.offset,
  36192. t.markedOffset = this.markedOffset,
  36193. t.limit = this.limit,
  36194. t
  36195. }
  36196. ,
  36197. a.compact = function(e, t) {
  36198. if (void 0 === e && (e = this.offset),
  36199. void 0 === t && (t = this.limit),
  36200. !this.noAssert) {
  36201. if ("number" != typeof e || e % 1 != 0)
  36202. throw TypeError("Illegal begin: Not an integer");
  36203. if (e >>>= 0,
  36204. "number" != typeof t || t % 1 != 0)
  36205. throw TypeError("Illegal end: Not an integer");
  36206. if (t >>>= 0,
  36207. e < 0 || t < e || t > this.buffer.byteLength)
  36208. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36209. }
  36210. if (0 === e && t === this.buffer.byteLength)
  36211. return this;
  36212. var i = t - e;
  36213. if (0 == i)
  36214. return this.buffer = o,
  36215. this.view = null,
  36216. 0 <= this.markedOffset && (this.markedOffset -= e),
  36217. this.offset = 0,
  36218. this.limit = 0,
  36219. this;
  36220. var n = new ArrayBuffer(i)
  36221. , r = new Uint8Array(n);
  36222. return r.set(this.view.subarray(e, t)),
  36223. this.buffer = n,
  36224. this.view = r,
  36225. 0 <= this.markedOffset && (this.markedOffset -= e),
  36226. this.offset = 0,
  36227. this.limit = i,
  36228. this
  36229. }
  36230. ,
  36231. a.copy = function(e, t) {
  36232. if (void 0 === e && (e = this.offset),
  36233. void 0 === t && (t = this.limit),
  36234. !this.noAssert) {
  36235. if ("number" != typeof e || e % 1 != 0)
  36236. throw TypeError("Illegal begin: Not an integer");
  36237. if (e >>>= 0,
  36238. "number" != typeof t || t % 1 != 0)
  36239. throw TypeError("Illegal end: Not an integer");
  36240. if (t >>>= 0,
  36241. e < 0 || t < e || t > this.buffer.byteLength)
  36242. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36243. }
  36244. if (e === t)
  36245. return new f(0,this.littleEndian,this.noAssert);
  36246. var i = t - e
  36247. , n = new f(i,this.littleEndian,this.noAssert);
  36248. return n.offset = 0,
  36249. n.limit = i,
  36250. 0 <= n.markedOffset && (n.markedOffset -= e),
  36251. this.copyTo(n, 0, e, t),
  36252. n
  36253. }
  36254. ,
  36255. a.copyTo = function(e, t, i, n) {
  36256. var r, o;
  36257. if (!this.noAssert && !f.isByteBuffer(e))
  36258. throw TypeError("Illegal target: Not a ByteBuffer");
  36259. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  36260. i = (r = void 0 === i) ? this.offset : 0 | i,
  36261. n = void 0 === n ? this.limit : 0 | n,
  36262. t < 0 || t > e.buffer.byteLength)
  36263. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  36264. if (i < 0 || n > this.buffer.byteLength)
  36265. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  36266. var a = n - i;
  36267. return 0 == a ? e : (e.ensureCapacity(t + a),
  36268. e.view.set(this.view.subarray(i, n), t),
  36269. r && (this.offset += a),
  36270. o && (e.offset += a),
  36271. this)
  36272. }
  36273. ,
  36274. a.ensureCapacity = function(e) {
  36275. var t = this.buffer.byteLength;
  36276. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  36277. }
  36278. ,
  36279. a.fill = function(e, t, i) {
  36280. var n = void 0 === t;
  36281. if (n && (t = this.offset),
  36282. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  36283. void 0 === t && (t = this.offset),
  36284. void 0 === i && (i = this.limit),
  36285. !this.noAssert) {
  36286. if ("number" != typeof e || e % 1 != 0)
  36287. throw TypeError("Illegal value: " + e + " (not an integer)");
  36288. if (e |= 0,
  36289. "number" != typeof t || t % 1 != 0)
  36290. throw TypeError("Illegal begin: Not an integer");
  36291. if (t >>>= 0,
  36292. "number" != typeof i || i % 1 != 0)
  36293. throw TypeError("Illegal end: Not an integer");
  36294. if (i >>>= 0,
  36295. t < 0 || i < t || i > this.buffer.byteLength)
  36296. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36297. }
  36298. if (i <= t)
  36299. return this;
  36300. for (; t < i; )
  36301. this.view[t++] = e;
  36302. return n && (this.offset = t),
  36303. this
  36304. }
  36305. ,
  36306. a.flip = function() {
  36307. return this.limit = this.offset,
  36308. this.offset = 0,
  36309. this
  36310. }
  36311. ,
  36312. a.mark = function(e) {
  36313. if (e = void 0 === e ? this.offset : e,
  36314. !this.noAssert) {
  36315. if ("number" != typeof e || e % 1 != 0)
  36316. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36317. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  36318. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  36319. }
  36320. return this.markedOffset = e,
  36321. this
  36322. }
  36323. ,
  36324. a.order = function(e) {
  36325. if (!this.noAssert && "boolean" != typeof e)
  36326. throw TypeError("Illegal littleEndian: Not a boolean");
  36327. return this.littleEndian = !!e,
  36328. this
  36329. }
  36330. ,
  36331. a.LE = function(e) {
  36332. return this.littleEndian = void 0 === e || !!e,
  36333. this
  36334. }
  36335. ,
  36336. a.BE = function(e) {
  36337. return this.littleEndian = void 0 !== e && !e,
  36338. this
  36339. }
  36340. ,
  36341. a.prepend = function(e, t, i) {
  36342. "number" != typeof t && "string" == typeof t || (i = t,
  36343. t = void 0);
  36344. var n = void 0 === i;
  36345. if (n && (i = this.offset),
  36346. !this.noAssert) {
  36347. if ("number" != typeof i || i % 1 != 0)
  36348. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36349. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36350. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36351. }
  36352. e instanceof f || (e = f.wrap(e, t));
  36353. var r = e.limit - e.offset;
  36354. if (r <= 0)
  36355. return this;
  36356. var o = r - i;
  36357. if (0 < o) {
  36358. var a = new ArrayBuffer(this.buffer.byteLength + o)
  36359. , s = new Uint8Array(a);
  36360. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  36361. this.buffer = a,
  36362. this.view = s,
  36363. this.offset += o,
  36364. 0 <= this.markedOffset && (this.markedOffset += o),
  36365. this.limit += o,
  36366. i += o
  36367. } else
  36368. new Uint8Array(this.buffer);
  36369. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  36370. e.offset = e.limit,
  36371. n && (this.offset -= r),
  36372. this
  36373. }
  36374. ,
  36375. a.prependTo = function(e, t) {
  36376. return e.prepend(this, t),
  36377. this
  36378. }
  36379. ,
  36380. a.printDebug = function(e) {
  36381. "function" != typeof e && (e = console.log.bind(console)),
  36382. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  36383. }
  36384. ,
  36385. a.remaining = function() {
  36386. return this.limit - this.offset
  36387. }
  36388. ,
  36389. a.reset = function() {
  36390. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  36391. this.markedOffset = -1) : this.offset = 0,
  36392. this
  36393. }
  36394. ,
  36395. a.resize = function(e) {
  36396. if (!this.noAssert) {
  36397. if ("number" != typeof e || e % 1 != 0)
  36398. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  36399. if ((e |= 0) < 0)
  36400. throw RangeError("Illegal capacity: 0 <= " + e)
  36401. }
  36402. if (this.buffer.byteLength < e) {
  36403. var t = new ArrayBuffer(e)
  36404. , i = new Uint8Array(t);
  36405. i.set(this.view),
  36406. this.buffer = t,
  36407. this.view = i
  36408. }
  36409. return this
  36410. }
  36411. ,
  36412. a.reverse = function(e, t) {
  36413. if (void 0 === e && (e = this.offset),
  36414. void 0 === t && (t = this.limit),
  36415. !this.noAssert) {
  36416. if ("number" != typeof e || e % 1 != 0)
  36417. throw TypeError("Illegal begin: Not an integer");
  36418. if (e >>>= 0,
  36419. "number" != typeof t || t % 1 != 0)
  36420. throw TypeError("Illegal end: Not an integer");
  36421. if (t >>>= 0,
  36422. e < 0 || t < e || t > this.buffer.byteLength)
  36423. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36424. }
  36425. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  36426. this
  36427. }
  36428. ,
  36429. a.skip = function(e) {
  36430. if (!this.noAssert) {
  36431. if ("number" != typeof e || e % 1 != 0)
  36432. throw TypeError("Illegal length: " + e + " (not an integer)");
  36433. e |= 0
  36434. }
  36435. var t = this.offset + e;
  36436. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36437. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36438. return this.offset = t,
  36439. this
  36440. }
  36441. ,
  36442. a.slice = function(e, t) {
  36443. if (void 0 === e && (e = this.offset),
  36444. void 0 === t && (t = this.limit),
  36445. !this.noAssert) {
  36446. if ("number" != typeof e || e % 1 != 0)
  36447. throw TypeError("Illegal begin: Not an integer");
  36448. if (e >>>= 0,
  36449. "number" != typeof t || t % 1 != 0)
  36450. throw TypeError("Illegal end: Not an integer");
  36451. if (t >>>= 0,
  36452. e < 0 || t < e || t > this.buffer.byteLength)
  36453. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36454. }
  36455. var i = this.clone();
  36456. return i.offset = e,
  36457. i.limit = t,
  36458. i
  36459. }
  36460. ,
  36461. a.toBuffer = function(e) {
  36462. var t = this.offset
  36463. , i = this.limit;
  36464. if (!this.noAssert) {
  36465. if ("number" != typeof t || t % 1 != 0)
  36466. throw TypeError("Illegal offset: Not an integer");
  36467. if (t >>>= 0,
  36468. "number" != typeof i || i % 1 != 0)
  36469. throw TypeError("Illegal limit: Not an integer");
  36470. if (i >>>= 0,
  36471. t < 0 || i < t || i > this.buffer.byteLength)
  36472. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36473. }
  36474. if (!e && 0 === t && i === this.buffer.byteLength)
  36475. return this.buffer;
  36476. if (t === i)
  36477. return o;
  36478. var n = new ArrayBuffer(i - t);
  36479. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36480. n
  36481. }
  36482. ,
  36483. a.toArrayBuffer = a.toBuffer,
  36484. a.toString = function(e, t, i) {
  36485. if (void 0 === e)
  36486. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36487. switch ("number" == typeof e && (i = t = e = "utf8"),
  36488. e) {
  36489. case "utf8":
  36490. return this.toUTF8(t, i);
  36491. case "base64":
  36492. return this.toBase64(t, i);
  36493. case "hex":
  36494. return this.toHex(t, i);
  36495. case "binary":
  36496. return this.toBinary(t, i);
  36497. case "debug":
  36498. return this.toDebug();
  36499. case "columns":
  36500. return this.toColumns();
  36501. default:
  36502. throw Error("Unsupported encoding: " + e)
  36503. }
  36504. }
  36505. ;
  36506. var h = function() {
  36507. 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)
  36508. a[r[t]] = t;
  36509. return e.encode = function(e, t) {
  36510. for (var i, n; null !== (i = e()); )
  36511. t(r[i >> 2 & 63]),
  36512. n = (3 & i) << 4,
  36513. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36514. n = (15 & i) << 2,
  36515. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36516. t(r[63 & i])) : (t(r[63 & n]),
  36517. t(61))) : (t(r[63 & n]),
  36518. t(61),
  36519. t(61))
  36520. }
  36521. ,
  36522. e.decode = function(e, t) {
  36523. function i(e) {
  36524. throw Error("Illegal character code: " + e)
  36525. }
  36526. for (var n, r, o; null !== (n = e()); )
  36527. if (void 0 === (r = a[n]) && i(n),
  36528. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36529. t(r << 2 >>> 0 | (48 & o) >> 4),
  36530. null !== (n = e()))) {
  36531. if (void 0 === (r = a[n])) {
  36532. if (61 === n)
  36533. break;
  36534. i(n)
  36535. }
  36536. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36537. null !== (n = e())) {
  36538. if (void 0 === (o = a[n])) {
  36539. if (61 === n)
  36540. break;
  36541. i(n)
  36542. }
  36543. t((3 & r) << 6 >>> 0 | o)
  36544. }
  36545. }
  36546. }
  36547. ,
  36548. e.test = function(e) {
  36549. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36550. }
  36551. ,
  36552. e
  36553. }();
  36554. a.toBase64 = function(e, t) {
  36555. if (void 0 === e && (e = this.offset),
  36556. void 0 === t && (t = this.limit),
  36557. t |= 0,
  36558. (e |= 0) < 0 || t > this.capacity || t < e)
  36559. throw RangeError("begin, end");
  36560. var i;
  36561. return h.encode(function() {
  36562. return e < t ? this.view[e++] : null
  36563. }
  36564. .bind(this), i = c()),
  36565. i()
  36566. }
  36567. ,
  36568. f.fromBase64 = function(e, t) {
  36569. if ("string" != typeof e)
  36570. throw TypeError("str");
  36571. var i = new f(e.length / 4 * 3,t)
  36572. , n = 0;
  36573. return h.decode(s(e), function(e) {
  36574. i.view[n++] = e
  36575. }),
  36576. i.limit = n,
  36577. i
  36578. }
  36579. ,
  36580. f.btoa = function(e) {
  36581. return f.fromBinary(e).toBase64()
  36582. }
  36583. ,
  36584. f.atob = function(e) {
  36585. return f.fromBase64(e).toBinary()
  36586. }
  36587. ,
  36588. a.toBinary = function(e, t) {
  36589. if (void 0 === e && (e = this.offset),
  36590. void 0 === t && (t = this.limit),
  36591. t |= 0,
  36592. (e |= 0) < 0 || t > this.capacity() || t < e)
  36593. throw RangeError("begin, end");
  36594. if (e === t)
  36595. return "";
  36596. for (var i = [], n = []; e < t; )
  36597. i.push(this.view[e++]),
  36598. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36599. i = []);
  36600. return n.join("") + String.fromCharCode.apply(String, i)
  36601. }
  36602. ,
  36603. f.fromBinary = function(e, t) {
  36604. if ("string" != typeof e)
  36605. throw TypeError("str");
  36606. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36607. if (255 < (i = e.charCodeAt(n)))
  36608. throw RangeError("illegal char code: " + i);
  36609. o.view[n++] = i
  36610. }
  36611. return o.limit = r,
  36612. o
  36613. }
  36614. ,
  36615. a.toDebug = function(e) {
  36616. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36617. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36618. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36619. ++i,
  36620. e && 0 < i && i % 16 == 0 && i !== n) {
  36621. for (; r.length < 51; )
  36622. r += " ";
  36623. a += r + o + "\n",
  36624. r = o = ""
  36625. }
  36626. 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 ? " " : ""
  36627. }
  36628. if (e && " " !== r) {
  36629. for (; r.length < 51; )
  36630. r += " ";
  36631. a += r + o + "\n"
  36632. }
  36633. return e ? a : r
  36634. }
  36635. ,
  36636. f.fromDebug = function(e, t, i) {
  36637. 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; ) {
  36638. switch (n = e.charAt(s++)) {
  36639. case "!":
  36640. if (!i) {
  36641. if (h || u || d) {
  36642. p = !0;
  36643. break
  36644. }
  36645. h = u = d = !0
  36646. }
  36647. a.offset = a.markedOffset = a.limit = l,
  36648. c = !1;
  36649. break;
  36650. case "|":
  36651. if (!i) {
  36652. if (h || d) {
  36653. p = !0;
  36654. break
  36655. }
  36656. h = d = !0
  36657. }
  36658. a.offset = a.limit = l,
  36659. c = !1;
  36660. break;
  36661. case "[":
  36662. if (!i) {
  36663. if (h || u) {
  36664. p = !0;
  36665. break
  36666. }
  36667. h = u = !0
  36668. }
  36669. a.offset = a.markedOffset = l,
  36670. c = !1;
  36671. break;
  36672. case "<":
  36673. if (!i) {
  36674. if (h) {
  36675. p = !0;
  36676. break
  36677. }
  36678. h = !0
  36679. }
  36680. a.offset = l,
  36681. c = !1;
  36682. break;
  36683. case "]":
  36684. if (!i) {
  36685. if (d || u) {
  36686. p = !0;
  36687. break
  36688. }
  36689. d = u = !0
  36690. }
  36691. a.limit = a.markedOffset = l,
  36692. c = !1;
  36693. break;
  36694. case ">":
  36695. if (!i) {
  36696. if (d) {
  36697. p = !0;
  36698. break
  36699. }
  36700. d = !0
  36701. }
  36702. a.limit = l,
  36703. c = !1;
  36704. break;
  36705. case "'":
  36706. if (!i) {
  36707. if (u) {
  36708. p = !0;
  36709. break
  36710. }
  36711. u = !0
  36712. }
  36713. a.markedOffset = l,
  36714. c = !1;
  36715. break;
  36716. case " ":
  36717. c = !1;
  36718. break;
  36719. default:
  36720. if (!i && c) {
  36721. p = !0;
  36722. break
  36723. }
  36724. if (r = parseInt(n + e.charAt(s++), 16),
  36725. !i && (isNaN(r) || r < 0 || 255 < r))
  36726. throw TypeError("Illegal str: Not a debug encoded string");
  36727. a.view[l++] = r,
  36728. c = !0
  36729. }
  36730. if (p)
  36731. throw TypeError("Illegal str: Invalid symbol at " + s)
  36732. }
  36733. if (!i) {
  36734. if (!h || !d)
  36735. throw TypeError("Illegal str: Missing offset or limit");
  36736. if (l < a.buffer.byteLength)
  36737. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36738. }
  36739. return a
  36740. }
  36741. ,
  36742. a.toHex = function(e, t) {
  36743. if (e = void 0 === e ? this.offset : e,
  36744. t = void 0 === t ? this.limit : t,
  36745. !this.noAssert) {
  36746. if ("number" != typeof e || e % 1 != 0)
  36747. throw TypeError("Illegal begin: Not an integer");
  36748. if (e >>>= 0,
  36749. "number" != typeof t || t % 1 != 0)
  36750. throw TypeError("Illegal end: Not an integer");
  36751. if (t >>>= 0,
  36752. e < 0 || t < e || t > this.buffer.byteLength)
  36753. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36754. }
  36755. for (var i, n = new Array(t - e); e < t; )
  36756. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36757. return n.join("")
  36758. }
  36759. ,
  36760. f.fromHex = function(e, t, i) {
  36761. if (!i) {
  36762. if ("string" != typeof e)
  36763. throw TypeError("Illegal str: Not a string");
  36764. if (e.length % 2 != 0)
  36765. throw TypeError("Illegal str: Length not a multiple of 2")
  36766. }
  36767. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36768. if (n = parseInt(e.substring(a, a + 2), 16),
  36769. !i && (!isFinite(n) || n < 0 || 255 < n))
  36770. throw TypeError("Illegal str: Contains non-hex characters");
  36771. o.view[s++] = n
  36772. }
  36773. return o.limit = s,
  36774. o
  36775. }
  36776. ;
  36777. var u, d = u = {
  36778. MAX_CODEPOINT: 1114111,
  36779. encodeUTF8: function(e, t) {
  36780. var i = null;
  36781. for ("number" == typeof e && (i = e,
  36782. e = function() {
  36783. return null
  36784. }
  36785. ); null !== i || null !== (i = e()); )
  36786. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36787. t(i >> 12 & 63 | 128)),
  36788. t(i >> 6 & 63 | 128)),
  36789. t(63 & i | 128)),
  36790. i = null
  36791. },
  36792. decodeUTF8: function(e, t) {
  36793. for (var i, n, r, o, a = function(e) {
  36794. e = e.slice(0, e.indexOf(null));
  36795. var t = Error(e.toString());
  36796. throw t.name = "TruncatedError",
  36797. t.bytes = e,
  36798. t
  36799. }; null !== (i = e()); )
  36800. if (0 == (128 & i))
  36801. t(i);
  36802. else if (192 == (224 & i))
  36803. null === (n = e()) && a([i, n]),
  36804. t((31 & i) << 6 | 63 & n);
  36805. else if (224 == (240 & i))
  36806. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36807. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36808. else {
  36809. if (240 != (248 & i))
  36810. throw RangeError("Illegal starting byte: " + i);
  36811. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36812. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36813. }
  36814. },
  36815. UTF16toUTF8: function(e, t) {
  36816. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36817. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36818. n = null) : t(i);
  36819. null !== n && t(n)
  36820. },
  36821. UTF8toUTF16: function(e, t) {
  36822. var i = null;
  36823. for ("number" == typeof e && (i = e,
  36824. e = function() {
  36825. return null
  36826. }
  36827. ); null !== i || null !== (i = e()); )
  36828. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36829. t(i % 1024 + 56320)),
  36830. i = null
  36831. },
  36832. encodeUTF16toUTF8: function(e, t) {
  36833. u.UTF16toUTF8(e, function(e) {
  36834. u.encodeUTF8(e, t)
  36835. })
  36836. },
  36837. decodeUTF8toUTF16: function(e, t) {
  36838. u.decodeUTF8(e, function(e) {
  36839. u.UTF8toUTF16(e, t)
  36840. })
  36841. },
  36842. calculateCodePoint: function(e) {
  36843. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36844. },
  36845. calculateUTF8: function(e) {
  36846. for (var t, i = 0; null !== (t = e()); )
  36847. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36848. return i
  36849. },
  36850. calculateUTF16asUTF8: function(e) {
  36851. var t = 0
  36852. , i = 0;
  36853. return u.UTF16toUTF8(e, function(e) {
  36854. ++t,
  36855. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36856. }),
  36857. [t, i]
  36858. }
  36859. };
  36860. return a.toUTF8 = function(t, i) {
  36861. if (void 0 === t && (t = this.offset),
  36862. void 0 === i && (i = this.limit),
  36863. !this.noAssert) {
  36864. if ("number" != typeof t || t % 1 != 0)
  36865. throw TypeError("Illegal begin: Not an integer");
  36866. if (t >>>= 0,
  36867. "number" != typeof i || i % 1 != 0)
  36868. throw TypeError("Illegal end: Not an integer");
  36869. if (i >>>= 0,
  36870. t < 0 || i < t || i > this.buffer.byteLength)
  36871. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36872. }
  36873. var e;
  36874. try {
  36875. d.decodeUTF8toUTF16(function() {
  36876. return t < i ? this.view[t++] : null
  36877. }
  36878. .bind(this), e = c())
  36879. } catch (e) {
  36880. if (t !== i)
  36881. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36882. }
  36883. return e()
  36884. }
  36885. ,
  36886. f.fromUTF8 = function(e, t, i) {
  36887. if (!i && "string" != typeof e)
  36888. throw TypeError("Illegal str: Not a string");
  36889. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36890. , r = 0;
  36891. return d.encodeUTF16toUTF8(s(e), function(e) {
  36892. n.view[r++] = e
  36893. }),
  36894. n.limit = r,
  36895. n
  36896. }
  36897. ,
  36898. f
  36899. }
  36900. ,
  36901. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36902. var e;
  36903. try {
  36904. e = t("long")
  36905. } catch (e) {}
  36906. return r(e)
  36907. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36908. }
  36909. , {
  36910. long: 216
  36911. }],
  36912. 216: [function(e, t, i) {
  36913. var n, r;
  36914. n = this,
  36915. r = function() {
  36916. "use strict";
  36917. function n(e, t, i) {
  36918. this.low = 0 | e,
  36919. this.high = 0 | t,
  36920. this.unsigned = !!i
  36921. }
  36922. function p(e) {
  36923. return !0 === (e && e.__isLong__)
  36924. }
  36925. function e(e, t) {
  36926. var i, n, r;
  36927. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36928. r && (a[e] = i),
  36929. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36930. r && (o[e] = i),
  36931. i)
  36932. }
  36933. function f(e, t) {
  36934. if (isNaN(e) || !isFinite(e))
  36935. return t ? l : y;
  36936. if (t) {
  36937. if (e < 0)
  36938. return l;
  36939. if (r <= e)
  36940. return I
  36941. } else {
  36942. if (e <= -s)
  36943. return E;
  36944. if (s <= e + 1)
  36945. return C
  36946. }
  36947. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36948. }
  36949. function g(e, t, i) {
  36950. return new n(e,t,i)
  36951. }
  36952. function h(e, t, i) {
  36953. if (0 === e.length)
  36954. throw Error("empty string");
  36955. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36956. return y;
  36957. if (t = "number" == typeof t ? (i = t,
  36958. !1) : !!t,
  36959. (i = i || 10) < 2 || 36 < i)
  36960. throw RangeError("radix");
  36961. var n;
  36962. if (0 < (n = e.indexOf("-")))
  36963. throw Error("interior hyphen");
  36964. if (0 === n)
  36965. return h(e.substring(1), t, i).neg();
  36966. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36967. var s = Math.min(8, e.length - a)
  36968. , l = parseInt(e.substring(a, a + s), i);
  36969. if (s < 8) {
  36970. var c = f(u(i, s));
  36971. o = o.mul(c).add(f(l))
  36972. } else
  36973. o = (o = o.mul(r)).add(f(l))
  36974. }
  36975. return o.unsigned = t,
  36976. o
  36977. }
  36978. function m(e) {
  36979. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36980. }
  36981. Object.defineProperty(n.prototype, "__isLong__", {
  36982. value: !0,
  36983. enumerable: !1,
  36984. configurable: !1
  36985. }),
  36986. n.isLong = p;
  36987. var o = {}
  36988. , a = {};
  36989. n.fromInt = e,
  36990. n.fromNumber = f,
  36991. n.fromBits = g;
  36992. var u = Math.pow;
  36993. n.fromString = h,
  36994. n.fromValue = m;
  36995. var i = 4294967296
  36996. , r = 0x10000000000000000
  36997. , s = r / 2
  36998. , v = e(1 << 24)
  36999. , y = e(0);
  37000. n.ZERO = y;
  37001. var l = e(0, !0);
  37002. n.UZERO = l;
  37003. var c = e(1);
  37004. n.ONE = c;
  37005. var d = e(1, !0);
  37006. n.UONE = d;
  37007. var A = e(-1);
  37008. n.NEG_ONE = A;
  37009. var C = g(-1, 2147483647, !1);
  37010. n.MAX_VALUE = C;
  37011. var I = g(-1, -1, !0);
  37012. n.MAX_UNSIGNED_VALUE = I;
  37013. var E = g(0, -2147483648, !1);
  37014. n.MIN_VALUE = E;
  37015. var t = n.prototype;
  37016. return t.toInt = function() {
  37017. return this.unsigned ? this.low >>> 0 : this.low
  37018. }
  37019. ,
  37020. t.toNumber = function() {
  37021. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  37022. }
  37023. ,
  37024. t.toString = function(e) {
  37025. if ((e = e || 10) < 2 || 36 < e)
  37026. throw RangeError("radix");
  37027. if (this.isZero())
  37028. return "0";
  37029. if (this.isNegative()) {
  37030. if (this.eq(E)) {
  37031. var t = f(e)
  37032. , i = this.div(t)
  37033. , n = i.mul(t).sub(this);
  37034. return i.toString(e) + n.toInt().toString(e)
  37035. }
  37036. return "-" + this.neg().toString(e)
  37037. }
  37038. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  37039. var s = o.div(r)
  37040. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  37041. if ((o = s).isZero())
  37042. return l + a;
  37043. for (; l.length < 6; )
  37044. l = "0" + l;
  37045. a = "" + l + a
  37046. }
  37047. }
  37048. ,
  37049. t.getHighBits = function() {
  37050. return this.high
  37051. }
  37052. ,
  37053. t.getHighBitsUnsigned = function() {
  37054. return this.high >>> 0
  37055. }
  37056. ,
  37057. t.getLowBits = function() {
  37058. return this.low
  37059. }
  37060. ,
  37061. t.getLowBitsUnsigned = function() {
  37062. return this.low >>> 0
  37063. }
  37064. ,
  37065. t.getNumBitsAbs = function() {
  37066. if (this.isNegative())
  37067. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  37068. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  37069. ;
  37070. return 0 != this.high ? t + 33 : t + 1
  37071. }
  37072. ,
  37073. t.isZero = function() {
  37074. return 0 === this.high && 0 === this.low
  37075. }
  37076. ,
  37077. t.isNegative = function() {
  37078. return !this.unsigned && this.high < 0
  37079. }
  37080. ,
  37081. t.isPositive = function() {
  37082. return this.unsigned || 0 <= this.high
  37083. }
  37084. ,
  37085. t.isOdd = function() {
  37086. return 1 == (1 & this.low)
  37087. }
  37088. ,
  37089. t.isEven = function() {
  37090. return 0 == (1 & this.low)
  37091. }
  37092. ,
  37093. t.equals = function(e) {
  37094. return p(e) || (e = m(e)),
  37095. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  37096. }
  37097. ,
  37098. t.eq = t.equals,
  37099. t.notEquals = function(e) {
  37100. return !this.eq(e)
  37101. }
  37102. ,
  37103. t.neq = t.notEquals,
  37104. t.lessThan = function(e) {
  37105. return this.comp(e) < 0
  37106. }
  37107. ,
  37108. t.lt = t.lessThan,
  37109. t.lessThanOrEqual = function(e) {
  37110. return this.comp(e) <= 0
  37111. }
  37112. ,
  37113. t.lte = t.lessThanOrEqual,
  37114. t.greaterThan = function(e) {
  37115. return 0 < this.comp(e)
  37116. }
  37117. ,
  37118. t.gt = t.greaterThan,
  37119. t.greaterThanOrEqual = function(e) {
  37120. return 0 <= this.comp(e)
  37121. }
  37122. ,
  37123. t.gte = t.greaterThanOrEqual,
  37124. t.compare = function(e) {
  37125. if (p(e) || (e = m(e)),
  37126. this.eq(e))
  37127. return 0;
  37128. var t = this.isNegative()
  37129. , i = e.isNegative();
  37130. 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
  37131. }
  37132. ,
  37133. t.comp = t.compare,
  37134. t.negate = function() {
  37135. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  37136. }
  37137. ,
  37138. t.neg = t.negate,
  37139. t.add = function(e) {
  37140. p(e) || (e = m(e));
  37141. var t = this.high >>> 16
  37142. , i = 65535 & this.high
  37143. , n = this.low >>> 16
  37144. , r = 65535 & this.low
  37145. , o = e.high >>> 16
  37146. , a = 65535 & e.high
  37147. , s = e.low >>> 16
  37148. , l = 0
  37149. , c = 0
  37150. , h = 0
  37151. , u = 0;
  37152. return h += (u += r + (65535 & e.low)) >>> 16,
  37153. c += (h += n + s) >>> 16,
  37154. l += (c += i + a) >>> 16,
  37155. l += t + o,
  37156. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  37157. }
  37158. ,
  37159. t.subtract = function(e) {
  37160. return p(e) || (e = m(e)),
  37161. this.add(e.neg())
  37162. }
  37163. ,
  37164. t.sub = t.subtract,
  37165. t.multiply = function(e) {
  37166. if (this.isZero())
  37167. return y;
  37168. if (p(e) || (e = m(e)),
  37169. e.isZero())
  37170. return y;
  37171. if (this.eq(E))
  37172. return e.isOdd() ? E : y;
  37173. if (e.eq(E))
  37174. return this.isOdd() ? E : y;
  37175. if (this.isNegative())
  37176. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  37177. if (e.isNegative())
  37178. return this.mul(e.neg()).neg();
  37179. if (this.lt(v) && e.lt(v))
  37180. return f(this.toNumber() * e.toNumber(), this.unsigned);
  37181. var t = this.high >>> 16
  37182. , i = 65535 & this.high
  37183. , n = this.low >>> 16
  37184. , r = 65535 & this.low
  37185. , o = e.high >>> 16
  37186. , a = 65535 & e.high
  37187. , s = e.low >>> 16
  37188. , l = 65535 & e.low
  37189. , c = 0
  37190. , h = 0
  37191. , u = 0
  37192. , d = 0;
  37193. return u += (d += r * l) >>> 16,
  37194. h += (u += n * l) >>> 16,
  37195. u &= 65535,
  37196. h += (u += r * s) >>> 16,
  37197. c += (h += i * l) >>> 16,
  37198. h &= 65535,
  37199. c += (h += n * s) >>> 16,
  37200. h &= 65535,
  37201. c += (h += r * a) >>> 16,
  37202. c += t * l + i * s + n * a + r * o,
  37203. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  37204. }
  37205. ,
  37206. t.mul = t.multiply,
  37207. t.divide = function(e) {
  37208. if (p(e) || (e = m(e)),
  37209. e.isZero())
  37210. throw Error("division by zero");
  37211. if (this.isZero())
  37212. return this.unsigned ? l : y;
  37213. var t, i, n;
  37214. if (this.unsigned) {
  37215. if (e.unsigned || (e = e.toUnsigned()),
  37216. e.gt(this))
  37217. return l;
  37218. if (e.gt(this.shru(1)))
  37219. return d;
  37220. n = l
  37221. } else {
  37222. if (this.eq(E))
  37223. 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)),
  37224. n = t.add(i.div(e)));
  37225. if (e.eq(E))
  37226. return this.unsigned ? l : y;
  37227. if (this.isNegative())
  37228. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  37229. if (e.isNegative())
  37230. return this.div(e.neg()).neg();
  37231. n = y
  37232. }
  37233. for (i = this; i.gte(e); ) {
  37234. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  37235. 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); )
  37236. s = (a = f(t -= o, this.unsigned)).mul(e);
  37237. a.isZero() && (a = c),
  37238. n = n.add(a),
  37239. i = i.sub(s)
  37240. }
  37241. return n
  37242. }
  37243. ,
  37244. t.div = t.divide,
  37245. t.modulo = function(e) {
  37246. return p(e) || (e = m(e)),
  37247. this.sub(this.div(e).mul(e))
  37248. }
  37249. ,
  37250. t.mod = t.modulo,
  37251. t.not = function() {
  37252. return g(~this.low, ~this.high, this.unsigned)
  37253. }
  37254. ,
  37255. t.and = function(e) {
  37256. return p(e) || (e = m(e)),
  37257. g(this.low & e.low, this.high & e.high, this.unsigned)
  37258. }
  37259. ,
  37260. t.or = function(e) {
  37261. return p(e) || (e = m(e)),
  37262. g(this.low | e.low, this.high | e.high, this.unsigned)
  37263. }
  37264. ,
  37265. t.xor = function(e) {
  37266. return p(e) || (e = m(e)),
  37267. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  37268. }
  37269. ,
  37270. t.shiftLeft = function(e) {
  37271. return p(e) && (e = e.toInt()),
  37272. 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)
  37273. }
  37274. ,
  37275. t.shl = t.shiftLeft,
  37276. t.shiftRight = function(e) {
  37277. return p(e) && (e = e.toInt()),
  37278. 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)
  37279. }
  37280. ,
  37281. t.shr = t.shiftRight,
  37282. t.shiftRightUnsigned = function(e) {
  37283. if (p(e) && (e = e.toInt()),
  37284. 0 === (e &= 63))
  37285. return this;
  37286. var t = this.high;
  37287. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  37288. }
  37289. ,
  37290. t.shru = t.shiftRightUnsigned,
  37291. t.toSigned = function() {
  37292. return this.unsigned ? g(this.low, this.high, !1) : this
  37293. }
  37294. ,
  37295. t.toUnsigned = function() {
  37296. return this.unsigned ? this : g(this.low, this.high, !0)
  37297. }
  37298. ,
  37299. t.toBytes = function(e) {
  37300. return e ? this.toBytesLE() : this.toBytesBE()
  37301. }
  37302. ,
  37303. t.toBytesLE = function() {
  37304. var e = this.high
  37305. , t = this.low;
  37306. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  37307. }
  37308. ,
  37309. t.toBytesBE = function() {
  37310. var e = this.high
  37311. , t = this.low;
  37312. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  37313. }
  37314. ,
  37315. n
  37316. }
  37317. ,
  37318. "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()
  37319. }
  37320. , {}],
  37321. 217: [function(e, t, i) {
  37322. 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 = {
  37323. REVISION: "75"
  37324. };
  37325. function Ii(e, t) {
  37326. return e.distance - t.distance
  37327. }
  37328. function Ei(e, t, i, n) {
  37329. if (!1 !== e.visible && (e.raycast(t, i),
  37330. !0 === n))
  37331. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  37332. Ei(r[o], t, i, !0)
  37333. }
  37334. function _i(e, t, i) {
  37335. return i < 0 && (i += 1),
  37336. 1 < i && (i -= 1),
  37337. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37338. }
  37339. function bi(e, t, i, n, r, o, a) {
  37340. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  37341. r.multiplyScalar(Vt.x),
  37342. o.multiplyScalar(Vt.y),
  37343. a.multiplyScalar(Vt.z),
  37344. r.add(o).add(a),
  37345. r.clone()
  37346. }
  37347. function wi(e, t, i, n, r, o, a) {
  37348. var s = e.material;
  37349. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  37350. return null;
  37351. Ut.copy(a),
  37352. Ut.applyMatrix4(e.matrixWorld);
  37353. var l = t.ray.origin.distanceTo(Ut);
  37354. return l < t.near || l > t.far ? null : {
  37355. distance: l,
  37356. point: Ut.clone(),
  37357. object: e
  37358. }
  37359. }
  37360. function Ti(e, t, i, n, r, o, a, s) {
  37361. Mt.fromArray(n, 3 * o),
  37362. Rt.fromArray(n, 3 * a),
  37363. Pt.fromArray(n, 3 * s);
  37364. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  37365. return l && (r && (Nt.fromArray(r, 2 * o),
  37366. Ft.fromArray(r, 2 * a),
  37367. Bt.fromArray(r, 2 * s),
  37368. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  37369. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  37370. l.faceIndex = o),
  37371. l
  37372. }
  37373. function xi() {}
  37374. function Si(e, t, i, n, r, o) {
  37375. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  37376. if (s = e[o[t]].x,
  37377. l = e[o[t]].y,
  37378. c = e[o[i]].x,
  37379. h = e[o[i]].y,
  37380. u = e[o[n]].x,
  37381. d = e[o[n]].y,
  37382. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  37383. return !1;
  37384. for (g = u - c,
  37385. m = d - h,
  37386. v = s - u,
  37387. y = l - d,
  37388. A = c - s,
  37389. C = h - l,
  37390. a = 0; a < r; a++)
  37391. if (p = e[o[a]].x,
  37392. f = e[o[a]].y,
  37393. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  37394. E = v * (f - d) - y * (p - u),
  37395. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  37396. return !1;
  37397. return !0
  37398. }
  37399. function Mi(e) {
  37400. switch (e) {
  37401. case Ci.LinearEncoding:
  37402. return ["Linear", "( value )"];
  37403. case Ci.sRGBEncoding:
  37404. return ["sRGB", "( value )"];
  37405. case Ci.RGBEEncoding:
  37406. return ["RGBE", "( value )"];
  37407. case Ci.RGBM7Encoding:
  37408. return ["RGBM", "( value, 7.0 )"];
  37409. case Ci.RGBM16Encoding:
  37410. return ["RGBM", "( value, 16.0 )"];
  37411. case Ci.RGBDEncoding:
  37412. return ["RGBD", "( value, 256.0 )"];
  37413. case Ci.GammaEncoding:
  37414. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  37415. default:
  37416. throw new Error("unsupported encoding: " + e)
  37417. }
  37418. }
  37419. function Ri(e, t) {
  37420. var i = Mi(t);
  37421. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  37422. }
  37423. function Pi(e) {
  37424. return "" !== e
  37425. }
  37426. function Oi(e, t) {
  37427. 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)
  37428. }
  37429. function Li(e) {
  37430. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  37431. var i = Ci.ShaderChunk[t];
  37432. if (void 0 === i)
  37433. throw new Error("Can not resolve #include <" + t + ">");
  37434. return Li(i)
  37435. })
  37436. }
  37437. function Di(e) {
  37438. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  37439. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  37440. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  37441. return r
  37442. })
  37443. }
  37444. function Ni(e, t, i, n) {
  37445. gi.set(t, i, n).unproject(mi);
  37446. var r = fi[e];
  37447. if (void 0 !== r)
  37448. for (var o = 0, a = r.length; o < a; o++)
  37449. pi.vertices[r[o]].copy(gi)
  37450. }
  37451. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  37452. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37453. void 0 === Math.sign && (Math.sign = function(e) {
  37454. return e < 0 ? -1 : 0 < e ? 1 : +e
  37455. }
  37456. ),
  37457. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37458. get: function() {
  37459. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37460. }
  37461. }),
  37462. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37463. writable: !0,
  37464. configurable: !0,
  37465. value: function(e) {
  37466. "use strict";
  37467. if (null == e)
  37468. throw new TypeError("Cannot convert first argument to object");
  37469. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37470. var r = arguments[i];
  37471. if (null != r) {
  37472. r = Object(r);
  37473. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37474. var l = o[a]
  37475. , c = Object.getOwnPropertyDescriptor(r, l);
  37476. void 0 !== c && c.enumerable && (t[l] = r[l])
  37477. }
  37478. }
  37479. }
  37480. return t
  37481. }
  37482. }),
  37483. Ci.MOUSE = {
  37484. LEFT: 0,
  37485. MIDDLE: 1,
  37486. RIGHT: 2
  37487. },
  37488. Ci.CullFaceNone = 0,
  37489. Ci.CullFaceBack = 1,
  37490. Ci.CullFaceFront = 2,
  37491. Ci.CullFaceFrontBack = 3,
  37492. Ci.FrontFaceDirectionCW = 0,
  37493. Ci.FrontFaceDirectionCCW = 1,
  37494. Ci.BasicShadowMap = 0,
  37495. Ci.PCFShadowMap = 1,
  37496. Ci.PCFSoftShadowMap = 2,
  37497. Ci.FrontSide = 0,
  37498. Ci.BackSide = 1,
  37499. Ci.DoubleSide = 2,
  37500. Ci.FlatShading = 1,
  37501. Ci.SmoothShading = 2,
  37502. Ci.NoColors = 0,
  37503. Ci.FaceColors = 1,
  37504. Ci.VertexColors = 2,
  37505. Ci.NoBlending = 0,
  37506. Ci.NormalBlending = 1,
  37507. Ci.AdditiveBlending = 2,
  37508. Ci.SubtractiveBlending = 3,
  37509. Ci.MultiplyBlending = 4,
  37510. Ci.CustomBlending = 5,
  37511. Ci.AddEquation = 100,
  37512. Ci.SubtractEquation = 101,
  37513. Ci.ReverseSubtractEquation = 102,
  37514. Ci.MinEquation = 103,
  37515. Ci.MaxEquation = 104,
  37516. Ci.ZeroFactor = 200,
  37517. Ci.OneFactor = 201,
  37518. Ci.SrcColorFactor = 202,
  37519. Ci.OneMinusSrcColorFactor = 203,
  37520. Ci.SrcAlphaFactor = 204,
  37521. Ci.OneMinusSrcAlphaFactor = 205,
  37522. Ci.DstAlphaFactor = 206,
  37523. Ci.OneMinusDstAlphaFactor = 207,
  37524. Ci.DstColorFactor = 208,
  37525. Ci.OneMinusDstColorFactor = 209,
  37526. Ci.SrcAlphaSaturateFactor = 210,
  37527. Ci.NeverDepth = 0,
  37528. Ci.AlwaysDepth = 1,
  37529. Ci.LessDepth = 2,
  37530. Ci.LessEqualDepth = 3,
  37531. Ci.EqualDepth = 4,
  37532. Ci.GreaterEqualDepth = 5,
  37533. Ci.GreaterDepth = 6,
  37534. Ci.NotEqualDepth = 7,
  37535. Ci.MultiplyOperation = 0,
  37536. Ci.MixOperation = 1,
  37537. Ci.AddOperation = 2,
  37538. Ci.NoToneMapping = 0,
  37539. Ci.LinearToneMapping = 1,
  37540. Ci.ReinhardToneMapping = 2,
  37541. Ci.Uncharted2ToneMapping = 3,
  37542. Ci.CineonToneMapping = 4,
  37543. Ci.UVMapping = 300,
  37544. Ci.CubeReflectionMapping = 301,
  37545. Ci.CubeRefractionMapping = 302,
  37546. Ci.EquirectangularReflectionMapping = 303,
  37547. Ci.EquirectangularRefractionMapping = 304,
  37548. Ci.SphericalReflectionMapping = 305,
  37549. Ci.CubeUVReflectionMapping = 306,
  37550. Ci.CubeUVRefractionMapping = 307,
  37551. Ci.RepeatWrapping = 1e3,
  37552. Ci.ClampToEdgeWrapping = 1001,
  37553. Ci.MirroredRepeatWrapping = 1002,
  37554. Ci.NearestFilter = 1003,
  37555. Ci.NearestMipMapNearestFilter = 1004,
  37556. Ci.NearestMipMapLinearFilter = 1005,
  37557. Ci.LinearFilter = 1006,
  37558. Ci.LinearMipMapNearestFilter = 1007,
  37559. Ci.LinearMipMapLinearFilter = 1008,
  37560. Ci.UnsignedByteType = 1009,
  37561. Ci.ByteType = 1010,
  37562. Ci.ShortType = 1011,
  37563. Ci.UnsignedShortType = 1012,
  37564. Ci.IntType = 1013,
  37565. Ci.UnsignedIntType = 1014,
  37566. Ci.FloatType = 1015,
  37567. Ci.HalfFloatType = 1025,
  37568. Ci.UnsignedShort4444Type = 1016,
  37569. Ci.UnsignedShort5551Type = 1017,
  37570. Ci.UnsignedShort565Type = 1018,
  37571. Ci.AlphaFormat = 1019,
  37572. Ci.RGBFormat = 1020,
  37573. Ci.RGBAFormat = 1021,
  37574. Ci.LuminanceFormat = 1022,
  37575. Ci.LuminanceAlphaFormat = 1023,
  37576. Ci.RGBEFormat = Ci.RGBAFormat,
  37577. Ci.RGB_S3TC_DXT1_Format = 2001,
  37578. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37579. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37580. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37581. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37582. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37583. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37584. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37585. Ci.RGB_ETC1_Format = 2151,
  37586. Ci.LoopOnce = 2200,
  37587. Ci.LoopRepeat = 2201,
  37588. Ci.LoopPingPong = 2202,
  37589. Ci.InterpolateDiscrete = 2300,
  37590. Ci.InterpolateLinear = 2301,
  37591. Ci.InterpolateSmooth = 2302,
  37592. Ci.ZeroCurvatureEnding = 2400,
  37593. Ci.ZeroSlopeEnding = 2401,
  37594. Ci.WrapAroundEnding = 2402,
  37595. Ci.TrianglesDrawMode = 0,
  37596. Ci.TriangleStripDrawMode = 1,
  37597. Ci.TriangleFanDrawMode = 2,
  37598. Ci.LinearEncoding = 3e3,
  37599. Ci.sRGBEncoding = 3001,
  37600. Ci.GammaEncoding = 3007,
  37601. Ci.RGBEEncoding = 3002,
  37602. Ci.LogLuvEncoding = 3003,
  37603. Ci.RGBM7Encoding = 3004,
  37604. Ci.RGBM16Encoding = 3005,
  37605. Ci.RGBDEncoding = 3006,
  37606. Ci.Color = function(e) {
  37607. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37608. }
  37609. ,
  37610. Ci.Color.prototype = {
  37611. constructor: Ci.Color,
  37612. r: 1,
  37613. g: 1,
  37614. b: 1,
  37615. set: function(e) {
  37616. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37617. this
  37618. },
  37619. setScalar: function(e) {
  37620. this.r = e,
  37621. this.g = e,
  37622. this.b = e
  37623. },
  37624. setHex: function(e) {
  37625. return e = Math.floor(e),
  37626. this.r = (e >> 16 & 255) / 255,
  37627. this.g = (e >> 8 & 255) / 255,
  37628. this.b = (255 & e) / 255,
  37629. this
  37630. },
  37631. setRGB: function(e, t, i) {
  37632. return this.r = e,
  37633. this.g = t,
  37634. this.b = i,
  37635. this
  37636. },
  37637. setHSL: function(e, t, i) {
  37638. if (e = Ci.Math.euclideanModulo(e, 1),
  37639. t = Ci.Math.clamp(t, 0, 1),
  37640. i = Ci.Math.clamp(i, 0, 1),
  37641. 0 === t)
  37642. this.r = this.g = this.b = i;
  37643. else {
  37644. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37645. , r = 2 * i - n;
  37646. this.r = _i(r, n, e + 1 / 3),
  37647. this.g = _i(r, n, e),
  37648. this.b = _i(r, n, e - 1 / 3)
  37649. }
  37650. return this
  37651. },
  37652. setStyle: function(t) {
  37653. function e(e) {
  37654. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37655. }
  37656. var i;
  37657. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37658. var n, r = i[1], o = i[2];
  37659. switch (r) {
  37660. case "rgb":
  37661. case "rgba":
  37662. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37663. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37664. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37665. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37666. e(n[5]),
  37667. this;
  37668. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37669. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37670. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37671. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37672. e(n[5]),
  37673. this;
  37674. break;
  37675. case "hsl":
  37676. case "hsla":
  37677. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37678. var a = parseFloat(n[1]) / 360
  37679. , s = parseInt(n[2], 10) / 100
  37680. , l = parseInt(n[3], 10) / 100;
  37681. return e(n[5]),
  37682. this.setHSL(a, s, l)
  37683. }
  37684. }
  37685. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37686. var c, h = (c = i[1]).length;
  37687. if (3 === h)
  37688. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37689. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37690. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37691. this;
  37692. if (6 === h)
  37693. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37694. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37695. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37696. this
  37697. }
  37698. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37699. return this
  37700. },
  37701. clone: function() {
  37702. return new this.constructor(this.r,this.g,this.b)
  37703. },
  37704. copy: function(e) {
  37705. return this.r = e.r,
  37706. this.g = e.g,
  37707. this.b = e.b,
  37708. this
  37709. },
  37710. copyGammaToLinear: function(e, t) {
  37711. return void 0 === t && (t = 2),
  37712. this.r = Math.pow(e.r, t),
  37713. this.g = Math.pow(e.g, t),
  37714. this.b = Math.pow(e.b, t),
  37715. this
  37716. },
  37717. copyLinearToGamma: function(e, t) {
  37718. void 0 === t && (t = 2);
  37719. var i = 0 < t ? 1 / t : 1;
  37720. return this.r = Math.pow(e.r, i),
  37721. this.g = Math.pow(e.g, i),
  37722. this.b = Math.pow(e.b, i),
  37723. this
  37724. },
  37725. convertGammaToLinear: function() {
  37726. var e = this.r
  37727. , t = this.g
  37728. , i = this.b;
  37729. return this.r = e * e,
  37730. this.g = t * t,
  37731. this.b = i * i,
  37732. this
  37733. },
  37734. convertLinearToGamma: function() {
  37735. return this.r = Math.sqrt(this.r),
  37736. this.g = Math.sqrt(this.g),
  37737. this.b = Math.sqrt(this.b),
  37738. this
  37739. },
  37740. getHex: function() {
  37741. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37742. },
  37743. getHexString: function() {
  37744. return ("000000" + this.getHex().toString(16)).slice(-6)
  37745. },
  37746. getHSL: function(e) {
  37747. var t, i, n = e || {
  37748. h: 0,
  37749. s: 0,
  37750. l: 0
  37751. }, 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;
  37752. if (l === s)
  37753. i = t = 0;
  37754. else {
  37755. var h = s - l;
  37756. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37757. s) {
  37758. case r:
  37759. t = (o - a) / h + (o < a ? 6 : 0);
  37760. break;
  37761. case o:
  37762. t = (a - r) / h + 2;
  37763. break;
  37764. case a:
  37765. t = (r - o) / h + 4
  37766. }
  37767. t /= 6
  37768. }
  37769. return n.h = t,
  37770. n.s = i,
  37771. n.l = c,
  37772. n
  37773. },
  37774. getStyle: function() {
  37775. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37776. },
  37777. offsetHSL: function(e, t, i) {
  37778. var n = this.getHSL();
  37779. return n.h += e,
  37780. n.s += t,
  37781. n.l += i,
  37782. this.setHSL(n.h, n.s, n.l),
  37783. this
  37784. },
  37785. add: function(e) {
  37786. return this.r += e.r,
  37787. this.g += e.g,
  37788. this.b += e.b,
  37789. this
  37790. },
  37791. addColors: function(e, t) {
  37792. return this.r = e.r + t.r,
  37793. this.g = e.g + t.g,
  37794. this.b = e.b + t.b,
  37795. this
  37796. },
  37797. addScalar: function(e) {
  37798. return this.r += e,
  37799. this.g += e,
  37800. this.b += e,
  37801. this
  37802. },
  37803. multiply: function(e) {
  37804. return this.r *= e.r,
  37805. this.g *= e.g,
  37806. this.b *= e.b,
  37807. this
  37808. },
  37809. multiplyScalar: function(e) {
  37810. return this.r *= e,
  37811. this.g *= e,
  37812. this.b *= e,
  37813. this
  37814. },
  37815. lerp: function(e, t) {
  37816. return this.r += (e.r - this.r) * t,
  37817. this.g += (e.g - this.g) * t,
  37818. this.b += (e.b - this.b) * t,
  37819. this
  37820. },
  37821. equals: function(e) {
  37822. return e.r === this.r && e.g === this.g && e.b === this.b
  37823. },
  37824. fromArray: function(e, t) {
  37825. return void 0 === t && (t = 0),
  37826. this.r = e[t],
  37827. this.g = e[t + 1],
  37828. this.b = e[t + 2],
  37829. this
  37830. },
  37831. toArray: function(e, t) {
  37832. return void 0 === e && (e = []),
  37833. void 0 === t && (t = 0),
  37834. e[t] = this.r,
  37835. e[t + 1] = this.g,
  37836. e[t + 2] = this.b,
  37837. e
  37838. }
  37839. },
  37840. Ci.ColorKeywords = {
  37841. aliceblue: 15792383,
  37842. antiquewhite: 16444375,
  37843. aqua: 65535,
  37844. aquamarine: 8388564,
  37845. azure: 15794175,
  37846. beige: 16119260,
  37847. bisque: 16770244,
  37848. black: 0,
  37849. blanchedalmond: 16772045,
  37850. blue: 255,
  37851. blueviolet: 9055202,
  37852. brown: 10824234,
  37853. burlywood: 14596231,
  37854. cadetblue: 6266528,
  37855. chartreuse: 8388352,
  37856. chocolate: 13789470,
  37857. coral: 16744272,
  37858. cornflowerblue: 6591981,
  37859. cornsilk: 16775388,
  37860. crimson: 14423100,
  37861. cyan: 65535,
  37862. darkblue: 139,
  37863. darkcyan: 35723,
  37864. darkgoldenrod: 12092939,
  37865. darkgray: 11119017,
  37866. darkgreen: 25600,
  37867. darkgrey: 11119017,
  37868. darkkhaki: 12433259,
  37869. darkmagenta: 9109643,
  37870. darkolivegreen: 5597999,
  37871. darkorange: 16747520,
  37872. darkorchid: 10040012,
  37873. darkred: 9109504,
  37874. darksalmon: 15308410,
  37875. darkseagreen: 9419919,
  37876. darkslateblue: 4734347,
  37877. darkslategray: 3100495,
  37878. darkslategrey: 3100495,
  37879. darkturquoise: 52945,
  37880. darkviolet: 9699539,
  37881. deeppink: 16716947,
  37882. deepskyblue: 49151,
  37883. dimgray: 6908265,
  37884. dimgrey: 6908265,
  37885. dodgerblue: 2003199,
  37886. firebrick: 11674146,
  37887. floralwhite: 16775920,
  37888. forestgreen: 2263842,
  37889. fuchsia: 16711935,
  37890. gainsboro: 14474460,
  37891. ghostwhite: 16316671,
  37892. gold: 16766720,
  37893. goldenrod: 14329120,
  37894. gray: 8421504,
  37895. green: 32768,
  37896. greenyellow: 11403055,
  37897. grey: 8421504,
  37898. honeydew: 15794160,
  37899. hotpink: 16738740,
  37900. indianred: 13458524,
  37901. indigo: 4915330,
  37902. ivory: 16777200,
  37903. khaki: 15787660,
  37904. lavender: 15132410,
  37905. lavenderblush: 16773365,
  37906. lawngreen: 8190976,
  37907. lemonchiffon: 16775885,
  37908. lightblue: 11393254,
  37909. lightcoral: 15761536,
  37910. lightcyan: 14745599,
  37911. lightgoldenrodyellow: 16448210,
  37912. lightgray: 13882323,
  37913. lightgreen: 9498256,
  37914. lightgrey: 13882323,
  37915. lightpink: 16758465,
  37916. lightsalmon: 16752762,
  37917. lightseagreen: 2142890,
  37918. lightskyblue: 8900346,
  37919. lightslategray: 7833753,
  37920. lightslategrey: 7833753,
  37921. lightsteelblue: 11584734,
  37922. lightyellow: 16777184,
  37923. lime: 65280,
  37924. limegreen: 3329330,
  37925. linen: 16445670,
  37926. magenta: 16711935,
  37927. maroon: 8388608,
  37928. mediumaquamarine: 6737322,
  37929. mediumblue: 205,
  37930. mediumorchid: 12211667,
  37931. mediumpurple: 9662683,
  37932. mediumseagreen: 3978097,
  37933. mediumslateblue: 8087790,
  37934. mediumspringgreen: 64154,
  37935. mediumturquoise: 4772300,
  37936. mediumvioletred: 13047173,
  37937. midnightblue: 1644912,
  37938. mintcream: 16121850,
  37939. mistyrose: 16770273,
  37940. moccasin: 16770229,
  37941. navajowhite: 16768685,
  37942. navy: 128,
  37943. oldlace: 16643558,
  37944. olive: 8421376,
  37945. olivedrab: 7048739,
  37946. orange: 16753920,
  37947. orangered: 16729344,
  37948. orchid: 14315734,
  37949. palegoldenrod: 15657130,
  37950. palegreen: 10025880,
  37951. paleturquoise: 11529966,
  37952. palevioletred: 14381203,
  37953. papayawhip: 16773077,
  37954. peachpuff: 16767673,
  37955. peru: 13468991,
  37956. pink: 16761035,
  37957. plum: 14524637,
  37958. powderblue: 11591910,
  37959. purple: 8388736,
  37960. red: 16711680,
  37961. rosybrown: 12357519,
  37962. royalblue: 4286945,
  37963. saddlebrown: 9127187,
  37964. salmon: 16416882,
  37965. sandybrown: 16032864,
  37966. seagreen: 3050327,
  37967. seashell: 16774638,
  37968. sienna: 10506797,
  37969. silver: 12632256,
  37970. skyblue: 8900331,
  37971. slateblue: 6970061,
  37972. slategray: 7372944,
  37973. slategrey: 7372944,
  37974. snow: 16775930,
  37975. springgreen: 65407,
  37976. steelblue: 4620980,
  37977. tan: 13808780,
  37978. teal: 32896,
  37979. thistle: 14204888,
  37980. tomato: 16737095,
  37981. turquoise: 4251856,
  37982. violet: 15631086,
  37983. wheat: 16113331,
  37984. white: 16777215,
  37985. whitesmoke: 16119285,
  37986. yellow: 16776960,
  37987. yellowgreen: 10145074
  37988. },
  37989. Ci.Quaternion = function(e, t, i, n) {
  37990. this._x = e || 0,
  37991. this._y = t || 0,
  37992. this._z = i || 0,
  37993. this._w = void 0 !== n ? n : 1
  37994. }
  37995. ,
  37996. Ci.Quaternion.prototype = {
  37997. constructor: Ci.Quaternion,
  37998. get x() {
  37999. return this._x
  38000. },
  38001. set x(e) {
  38002. this._x = e,
  38003. this.onChangeCallback()
  38004. },
  38005. get y() {
  38006. return this._y
  38007. },
  38008. set y(e) {
  38009. this._y = e,
  38010. this.onChangeCallback()
  38011. },
  38012. get z() {
  38013. return this._z
  38014. },
  38015. set z(e) {
  38016. this._z = e,
  38017. this.onChangeCallback()
  38018. },
  38019. get w() {
  38020. return this._w
  38021. },
  38022. set w(e) {
  38023. this._w = e,
  38024. this.onChangeCallback()
  38025. },
  38026. set: function(e, t, i, n) {
  38027. return this._x = e,
  38028. this._y = t,
  38029. this._z = i,
  38030. this._w = n,
  38031. this.onChangeCallback(),
  38032. this
  38033. },
  38034. clone: function() {
  38035. return new this.constructor(this._x,this._y,this._z,this._w)
  38036. },
  38037. toObject:function(){//add
  38038. return {x:this.x, y:this.y,z:this.z, w:this.w};
  38039. },
  38040. copy: function(e) {
  38041. return this._x = e.x,
  38042. this._y = e.y,
  38043. this._z = e.z,
  38044. this._w = e.w,
  38045. this.onChangeCallback(),
  38046. this
  38047. },
  38048. setFromEuler: function(e, t) {
  38049. if (e instanceof Ci.Euler == 0)
  38050. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  38051. var i = Math.cos(e._x / 2)
  38052. , n = Math.cos(e._y / 2)
  38053. , r = Math.cos(e._z / 2)
  38054. , o = Math.sin(e._x / 2)
  38055. , a = Math.sin(e._y / 2)
  38056. , s = Math.sin(e._z / 2)
  38057. , l = e.order;
  38058. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  38059. this._y = i * a * r - o * n * s,
  38060. this._z = i * n * s + o * a * r,
  38061. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  38062. this._y = i * a * r - o * n * s,
  38063. this._z = i * n * s - o * a * r,
  38064. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  38065. this._y = i * a * r + o * n * s,
  38066. this._z = i * n * s + o * a * r,
  38067. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  38068. this._y = i * a * r + o * n * s,
  38069. this._z = i * n * s - o * a * r,
  38070. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  38071. this._y = i * a * r + o * n * s,
  38072. this._z = i * n * s - o * a * r,
  38073. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  38074. this._y = i * a * r - o * n * s,
  38075. this._z = i * n * s + o * a * r,
  38076. this._w = i * n * r + o * a * s),
  38077. !1 !== t && this.onChangeCallback(),
  38078. this
  38079. },
  38080. setFromAxisAngle: function(e, t) {
  38081. var i = t / 2
  38082. , n = Math.sin(i);
  38083. return this._x = e.x * n,
  38084. this._y = e.y * n,
  38085. this._z = e.z * n,
  38086. this._w = Math.cos(i),
  38087. this.onChangeCallback(),
  38088. this
  38089. },
  38090. setFromRotationMatrix: function(e) {
  38091. 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;
  38092. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  38093. this._w = .25 / t,
  38094. this._x = (h - l) * t,
  38095. this._y = (o - c) * t,
  38096. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  38097. this._w = (h - l) / t,
  38098. this._x = .25 * t,
  38099. this._y = (r + a) / t,
  38100. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  38101. this._w = (o - c) / t,
  38102. this._x = (r + a) / t,
  38103. this._y = .25 * t,
  38104. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  38105. this._w = (a - r) / t,
  38106. this._x = (o + c) / t,
  38107. this._y = (l + h) / t,
  38108. this._z = .25 * t),
  38109. this.onChangeCallback(),
  38110. this
  38111. },
  38112. setFromUnitVectors: function(e, t) {
  38113. return void 0 === Be && (Be = new Ci.Vector3),
  38114. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  38115. 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),
  38116. this._x = Be.x,
  38117. this._y = Be.y,
  38118. this._z = Be.z,
  38119. this._w = Ve,
  38120. this.normalize(),
  38121. this
  38122. },
  38123. inverse: function() {
  38124. return this.conjugate().normalize(),
  38125. this
  38126. },
  38127. conjugate: function() {
  38128. return this._x *= -1,
  38129. this._y *= -1,
  38130. this._z *= -1,
  38131. this.onChangeCallback(),
  38132. this
  38133. },
  38134. dot: function(e) {
  38135. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  38136. },
  38137. lengthSq: function() {
  38138. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  38139. },
  38140. length: function() {
  38141. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  38142. },
  38143. normalize: function() {
  38144. var e = this.length();
  38145. return 0 === e ? (this._x = 0,
  38146. this._y = 0,
  38147. this._z = 0,
  38148. this._w = 1) : (e = 1 / e,
  38149. this._x = this._x * e,
  38150. this._y = this._y * e,
  38151. this._z = this._z * e,
  38152. this._w = this._w * e),
  38153. this.onChangeCallback(),
  38154. this
  38155. },
  38156. multiply: function(e, t) {
  38157. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  38158. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  38159. },
  38160. multiplyQuaternions: function(e, t) {
  38161. var i = e._x
  38162. , n = e._y
  38163. , r = e._z
  38164. , o = e._w
  38165. , a = t._x
  38166. , s = t._y
  38167. , l = t._z
  38168. , c = t._w;
  38169. return this._x = i * c + o * a + n * l - r * s,
  38170. this._y = n * c + o * s + r * a - i * l,
  38171. this._z = r * c + o * l + i * s - n * a,
  38172. this._w = o * c - i * a - n * s - r * l,
  38173. this.onChangeCallback(),
  38174. this
  38175. },
  38176. slerp: function(e, t) {
  38177. if (0 === t)
  38178. return this;
  38179. if (1 === t)
  38180. return this.copy(e);
  38181. var i = this._x
  38182. , n = this._y
  38183. , r = this._z
  38184. , o = this._w
  38185. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  38186. if (a < 0 ? (this._w = -e._w,
  38187. this._x = -e._x,
  38188. this._y = -e._y,
  38189. this._z = -e._z,
  38190. a = -a) : this.copy(e),
  38191. 1 <= a)
  38192. return this._w = o,
  38193. this._x = i,
  38194. this._y = n,
  38195. this._z = r,
  38196. this;
  38197. var s = Math.sqrt(1 - a * a);
  38198. if (Math.abs(s) < .001)
  38199. return this._w = .5 * (o + this._w),
  38200. this._x = .5 * (i + this._x),
  38201. this._y = .5 * (n + this._y),
  38202. this._z = .5 * (r + this._z),
  38203. this;
  38204. var l = Math.atan2(s, a)
  38205. , c = Math.sin((1 - t) * l) / s
  38206. , h = Math.sin(t * l) / s;
  38207. return this._w = o * c + this._w * h,
  38208. this._x = i * c + this._x * h,
  38209. this._y = n * c + this._y * h,
  38210. this._z = r * c + this._z * h,
  38211. this.onChangeCallback(),
  38212. this
  38213. },
  38214. equals: function(e) {
  38215. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  38216. },
  38217. fromArray: function(e, t) {
  38218. return void 0 === t && (t = 0),
  38219. this._x = e[t],
  38220. this._y = e[t + 1],
  38221. this._z = e[t + 2],
  38222. this._w = e[t + 3],
  38223. this.onChangeCallback(),
  38224. this
  38225. },
  38226. toArray: function(e, t) {
  38227. return void 0 === e && (e = []),
  38228. void 0 === t && (t = 0),
  38229. e[t] = this._x,
  38230. e[t + 1] = this._y,
  38231. e[t + 2] = this._z,
  38232. e[t + 3] = this._w,
  38233. e
  38234. },
  38235. onChange: function(e) {
  38236. return this.onChangeCallback = e,
  38237. this
  38238. },
  38239. onChangeCallback: function() {}
  38240. },
  38241. Object.assign(Ci.Quaternion, {
  38242. slerp: function(e, t, i, n) {
  38243. return i.copy(e).slerp(t, n)
  38244. },
  38245. slerpFlat: function(e, t, i, n, r, o, a) {
  38246. var s = i[n + 0]
  38247. , l = i[n + 1]
  38248. , c = i[n + 2]
  38249. , h = i[n + 3]
  38250. , u = r[o + 0]
  38251. , d = r[o + 1]
  38252. , p = r[o + 2]
  38253. , f = r[o + 3];
  38254. if (h !== f || s !== u || l !== d || c !== p) {
  38255. var g = 1 - a
  38256. , m = s * u + l * d + c * p + h * f
  38257. , v = 0 <= m ? 1 : -1
  38258. , y = 1 - m * m;
  38259. if (y > Number.EPSILON) {
  38260. var A = Math.sqrt(y)
  38261. , C = Math.atan2(A, m * v);
  38262. g = Math.sin(g * C) / A,
  38263. a = Math.sin(a * C) / A
  38264. }
  38265. var I = a * v;
  38266. if (s = s * g + u * I,
  38267. l = l * g + d * I,
  38268. c = c * g + p * I,
  38269. h = h * g + f * I,
  38270. g === 1 - a) {
  38271. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  38272. s *= E,
  38273. l *= E,
  38274. c *= E,
  38275. h *= E
  38276. }
  38277. }
  38278. e[t] = s,
  38279. e[t + 1] = l,
  38280. e[t + 2] = c,
  38281. e[t + 3] = h
  38282. }
  38283. }),
  38284. Ci.Vector2 = function(e, t) {
  38285. this.x = e || 0,
  38286. this.y = t || 0
  38287. }
  38288. ,
  38289. Ci.Vector2.prototype = {
  38290. constructor: Ci.Vector2,
  38291. get width() {
  38292. return this.x
  38293. },
  38294. set width(e) {
  38295. this.x = e
  38296. },
  38297. get height() {
  38298. return this.y
  38299. },
  38300. set height(e) {
  38301. this.y = e
  38302. },
  38303. set: function(e, t) {
  38304. return this.x = e,
  38305. this.y = t,
  38306. this
  38307. },
  38308. setScalar: function(e) {
  38309. return this.x = e,
  38310. this.y = e,
  38311. this
  38312. },
  38313. setX: function(e) {
  38314. return this.x = e,
  38315. this
  38316. },
  38317. setY: function(e) {
  38318. return this.y = e,
  38319. this
  38320. },
  38321. setComponent: function(e, t) {
  38322. switch (e) {
  38323. case 0:
  38324. this.x = t;
  38325. break;
  38326. case 1:
  38327. this.y = t;
  38328. break;
  38329. default:
  38330. throw new Error("index is out of range: " + e)
  38331. }
  38332. },
  38333. getComponent: function(e) {
  38334. switch (e) {
  38335. case 0:
  38336. return this.x;
  38337. case 1:
  38338. return this.y;
  38339. default:
  38340. throw new Error("index is out of range: " + e)
  38341. }
  38342. },
  38343. clone: function() {
  38344. return new this.constructor(this.x,this.y)
  38345. },
  38346. copy: function(e) {
  38347. return this.x = e.x,
  38348. this.y = e.y,
  38349. this
  38350. },
  38351. add: function(e, t) {
  38352. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38353. this.addVectors(e, t)) : (this.x += e.x,
  38354. this.y += e.y,
  38355. this)
  38356. },
  38357. addScalar: function(e) {
  38358. return this.x += e,
  38359. this.y += e,
  38360. this
  38361. },
  38362. addVectors: function(e, t) {
  38363. return this.x = e.x + t.x,
  38364. this.y = e.y + t.y,
  38365. this
  38366. },
  38367. addScaledVector: function(e, t) {
  38368. return this.x += e.x * t,
  38369. this.y += e.y * t,
  38370. this
  38371. },
  38372. sub: function(e, t) {
  38373. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38374. this.subVectors(e, t)) : (this.x -= e.x,
  38375. this.y -= e.y,
  38376. this)
  38377. },
  38378. subScalar: function(e) {
  38379. return this.x -= e,
  38380. this.y -= e,
  38381. this
  38382. },
  38383. subVectors: function(e, t) {
  38384. return this.x = e.x - t.x,
  38385. this.y = e.y - t.y,
  38386. this
  38387. },
  38388. multiply: function(e) {
  38389. return this.x *= e.x,
  38390. this.y *= e.y,
  38391. this
  38392. },
  38393. multiplyScalar: function(e) {
  38394. return isFinite(e) ? (this.x *= e,
  38395. this.y *= e) : (this.x = 0,
  38396. this.y = 0),
  38397. this
  38398. },
  38399. divide: function(e) {
  38400. return this.x /= e.x,
  38401. this.y /= e.y,
  38402. this
  38403. },
  38404. divideScalar: function(e) {
  38405. return this.multiplyScalar(1 / e)
  38406. },
  38407. min: function(e) {
  38408. return this.x = Math.min(this.x, e.x),
  38409. this.y = Math.min(this.y, e.y),
  38410. this
  38411. },
  38412. max: function(e) {
  38413. return this.x = Math.max(this.x, e.x),
  38414. this.y = Math.max(this.y, e.y),
  38415. this
  38416. },
  38417. clamp: function(e, t) {
  38418. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38419. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38420. this
  38421. },
  38422. clampScalar: function(e, t) {
  38423. return void 0 === Ne && (Ne = new Ci.Vector2,
  38424. Fe = new Ci.Vector2),
  38425. Ne.set(e, e),
  38426. Fe.set(t, t),
  38427. this.clamp(Ne, Fe)
  38428. },
  38429. clampLength: function(e, t) {
  38430. var i = this.length();
  38431. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38432. this
  38433. },
  38434. floor: function() {
  38435. return this.x = Math.floor(this.x),
  38436. this.y = Math.floor(this.y),
  38437. this
  38438. },
  38439. ceil: function() {
  38440. return this.x = Math.ceil(this.x),
  38441. this.y = Math.ceil(this.y),
  38442. this
  38443. },
  38444. round: function() {
  38445. return this.x = Math.round(this.x),
  38446. this.y = Math.round(this.y),
  38447. this
  38448. },
  38449. roundToZero: function() {
  38450. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38451. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38452. this
  38453. },
  38454. negate: function() {
  38455. return this.x = -this.x,
  38456. this.y = -this.y,
  38457. this
  38458. },
  38459. dot: function(e) {
  38460. return this.x * e.x + this.y * e.y
  38461. },
  38462. lengthSq: function() {
  38463. return this.x * this.x + this.y * this.y
  38464. },
  38465. length: function() {
  38466. return Math.sqrt(this.x * this.x + this.y * this.y)
  38467. },
  38468. lengthManhattan: function() {
  38469. return Math.abs(this.x) + Math.abs(this.y)
  38470. },
  38471. normalize: function() {
  38472. return this.divideScalar(this.length())
  38473. },
  38474. angle: function() {
  38475. var e = Math.atan2(this.y, this.x);
  38476. return e < 0 && (e += 2 * Math.PI),
  38477. e
  38478. },
  38479. distanceTo: function(e) {
  38480. return Math.sqrt(this.distanceToSquared(e))
  38481. },
  38482. distanceToSquared: function(e) {
  38483. var t = this.x - e.x
  38484. , i = this.y - e.y;
  38485. return t * t + i * i
  38486. },
  38487. setLength: function(e) {
  38488. return this.multiplyScalar(e / this.length())
  38489. },
  38490. lerp: function(e, t) {
  38491. return this.x += (e.x - this.x) * t,
  38492. this.y += (e.y - this.y) * t,
  38493. this
  38494. },
  38495. lerpVectors: function(e, t, i) {
  38496. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38497. this
  38498. },
  38499. equals: function(e) {
  38500. return e.x === this.x && e.y === this.y
  38501. },
  38502. fromArray: function(e, t) {
  38503. return void 0 === t && (t = 0),
  38504. this.x = e[t],
  38505. this.y = e[t + 1],
  38506. this
  38507. },
  38508. toArray: function(e, t) {
  38509. return void 0 === e && (e = []),
  38510. void 0 === t && (t = 0),
  38511. e[t] = this.x,
  38512. e[t + 1] = this.y,
  38513. e
  38514. },
  38515. fromAttribute: function(e, t, i) {
  38516. return void 0 === i && (i = 0),
  38517. t = t * e.itemSize + i,
  38518. this.x = e.array[t],
  38519. this.y = e.array[t + 1],
  38520. this
  38521. },
  38522. rotateAround: function(e, t) {
  38523. var i = Math.cos(t)
  38524. , n = Math.sin(t)
  38525. , r = this.x - e.x
  38526. , o = this.y - e.y;
  38527. return this.x = r * i - o * n + e.x,
  38528. this.y = r * n + o * i + e.y,
  38529. this
  38530. }
  38531. },
  38532. Ci.Vector3 = function(e, t, i) {
  38533. this.x = e || 0,
  38534. this.y = t || 0,
  38535. this.z = i || 0
  38536. }
  38537. ,
  38538. Ci.Vector3.prototype = {
  38539. constructor: Ci.Vector3,
  38540. set: function(e, t, i) {
  38541. return this.x = e,
  38542. this.y = t,
  38543. this.z = i,
  38544. this
  38545. },
  38546. setScalar: function(e) {
  38547. return this.x = e,
  38548. this.y = e,
  38549. this.z = e,
  38550. this
  38551. },
  38552. setX: function(e) {
  38553. return this.x = e,
  38554. this
  38555. },
  38556. setY: function(e) {
  38557. return this.y = e,
  38558. this
  38559. },
  38560. setZ: function(e) {
  38561. return this.z = e,
  38562. this
  38563. },
  38564. setComponent: function(e, t) {
  38565. switch (e) {
  38566. case 0:
  38567. this.x = t;
  38568. break;
  38569. case 1:
  38570. this.y = t;
  38571. break;
  38572. case 2:
  38573. this.z = t;
  38574. break;
  38575. default:
  38576. throw new Error("index is out of range: " + e)
  38577. }
  38578. },
  38579. getComponent: function(e) {
  38580. switch (e) {
  38581. case 0:
  38582. return this.x;
  38583. case 1:
  38584. return this.y;
  38585. case 2:
  38586. return this.z;
  38587. default:
  38588. throw new Error("index is out of range: " + e)
  38589. }
  38590. },
  38591. clone: function() {
  38592. return new this.constructor(this.x,this.y,this.z)
  38593. },
  38594. copy: function(e) {
  38595. return this.x = e.x,
  38596. this.y = e.y,
  38597. this.z = e.z,
  38598. this
  38599. },
  38600. add: function(e, t) {
  38601. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38602. this.addVectors(e, t)) : (this.x += e.x,
  38603. this.y += e.y,
  38604. this.z += e.z,
  38605. this)
  38606. },
  38607. addScalar: function(e) {
  38608. return this.x += e,
  38609. this.y += e,
  38610. this.z += e,
  38611. this
  38612. },
  38613. addVectors: function(e, t) {
  38614. return this.x = e.x + t.x,
  38615. this.y = e.y + t.y,
  38616. this.z = e.z + t.z,
  38617. this
  38618. },
  38619. addScaledVector: function(e, t) {
  38620. return this.x += e.x * t,
  38621. this.y += e.y * t,
  38622. this.z += e.z * t,
  38623. this
  38624. },
  38625. sub: function(e, t) {
  38626. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38627. this.subVectors(e, t)) : (this.x -= e.x,
  38628. this.y -= e.y,
  38629. this.z -= e.z,
  38630. this)
  38631. },
  38632. subScalar: function(e) {
  38633. return this.x -= e,
  38634. this.y -= e,
  38635. this.z -= e,
  38636. this
  38637. },
  38638. subVectors: function(e, t) {
  38639. return this.x = e.x - t.x,
  38640. this.y = e.y - t.y,
  38641. this.z = e.z - t.z,
  38642. this
  38643. },
  38644. multiply: function(e, t) {
  38645. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38646. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38647. this.y *= e.y,
  38648. this.z *= e.z,
  38649. this)
  38650. },
  38651. multiplyScalar: function(e) {
  38652. return isFinite(e) ? (this.x *= e,
  38653. this.y *= e,
  38654. this.z *= e) : (this.x = 0,
  38655. this.y = 0,
  38656. this.z = 0),
  38657. this
  38658. },
  38659. multiplyVectors: function(e, t) {
  38660. return this.x = e.x * t.x,
  38661. this.y = e.y * t.y,
  38662. this.z = e.z * t.z,
  38663. this
  38664. },
  38665. applyEuler: function(e) {
  38666. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38667. void 0 === De && (De = new Ci.Quaternion),
  38668. this.applyQuaternion(De.setFromEuler(e)),
  38669. this
  38670. },
  38671. applyAxisAngle: function(e, t) {
  38672. return void 0 === Le && (Le = new Ci.Quaternion),
  38673. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38674. this
  38675. },
  38676. applyMatrix3: function(e) {
  38677. var t = this.x
  38678. , i = this.y
  38679. , n = this.z
  38680. , r = e.elements;
  38681. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38682. this.y = r[1] * t + r[4] * i + r[7] * n,
  38683. this.z = r[2] * t + r[5] * i + r[8] * n,
  38684. this
  38685. },
  38686. applyMatrix4: function(e) {
  38687. var t = this.x
  38688. , i = this.y
  38689. , n = this.z
  38690. , r = e.elements;
  38691. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38692. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38693. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38694. this
  38695. },
  38696. applyProjection: function(e) {
  38697. var t = this.x
  38698. , i = this.y
  38699. , n = this.z
  38700. , r = e.elements
  38701. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38702. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38703. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38704. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38705. this
  38706. },
  38707. applyQuaternion: function(e) {
  38708. var t = this.x
  38709. , i = this.y
  38710. , n = this.z
  38711. , r = e.x
  38712. , o = e.y
  38713. , a = e.z
  38714. , s = e.w
  38715. , l = s * t + o * n - a * i
  38716. , c = s * i + a * t - r * n
  38717. , h = s * n + r * i - o * t
  38718. , u = -r * t - o * i - a * n;
  38719. return this.x = l * s + u * -r + c * -a - h * -o,
  38720. this.y = c * s + u * -o + h * -r - l * -a,
  38721. this.z = h * s + u * -a + l * -o - c * -r,
  38722. this
  38723. },
  38724. project: function(e) {
  38725. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38726. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38727. this.applyProjection(Oe)
  38728. },
  38729. unproject: function(e) {
  38730. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38731. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38732. this.applyProjection(Pe)
  38733. },
  38734. transformDirection: function(e) {
  38735. var t = this.x
  38736. , i = this.y
  38737. , n = this.z
  38738. , r = e.elements;
  38739. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38740. this.y = r[1] * t + r[5] * i + r[9] * n,
  38741. this.z = r[2] * t + r[6] * i + r[10] * n,
  38742. this.normalize(),
  38743. this
  38744. },
  38745. divide: function(e) {
  38746. return this.x /= e.x,
  38747. this.y /= e.y,
  38748. this.z /= e.z,
  38749. this
  38750. },
  38751. divideScalar: function(e) {
  38752. return this.multiplyScalar(1 / e)
  38753. },
  38754. min: function(e) {
  38755. return this.x = Math.min(this.x, e.x),
  38756. this.y = Math.min(this.y, e.y),
  38757. this.z = Math.min(this.z, e.z),
  38758. this
  38759. },
  38760. max: function(e) {
  38761. return this.x = Math.max(this.x, e.x),
  38762. this.y = Math.max(this.y, e.y),
  38763. this.z = Math.max(this.z, e.z),
  38764. this
  38765. },
  38766. clamp: function(e, t) {
  38767. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38768. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38769. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38770. this
  38771. },
  38772. clampScalar: function(e, t) {
  38773. return void 0 === Me && (Me = new Ci.Vector3,
  38774. Re = new Ci.Vector3),
  38775. Me.set(e, e, e),
  38776. Re.set(t, t, t),
  38777. this.clamp(Me, Re)
  38778. },
  38779. clampLength: function(e, t) {
  38780. var i = this.length();
  38781. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38782. this
  38783. },
  38784. floor: function() {
  38785. return this.x = Math.floor(this.x),
  38786. this.y = Math.floor(this.y),
  38787. this.z = Math.floor(this.z),
  38788. this
  38789. },
  38790. ceil: function() {
  38791. return this.x = Math.ceil(this.x),
  38792. this.y = Math.ceil(this.y),
  38793. this.z = Math.ceil(this.z),
  38794. this
  38795. },
  38796. round: function() {
  38797. return this.x = Math.round(this.x),
  38798. this.y = Math.round(this.y),
  38799. this.z = Math.round(this.z),
  38800. this
  38801. },
  38802. roundToZero: function() {
  38803. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38804. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38805. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38806. this
  38807. },
  38808. negate: function() {
  38809. return this.x = -this.x,
  38810. this.y = -this.y,
  38811. this.z = -this.z,
  38812. this
  38813. },
  38814. dot: function(e) {
  38815. return this.x * e.x + this.y * e.y + this.z * e.z
  38816. },
  38817. lengthSq: function() {
  38818. return this.x * this.x + this.y * this.y + this.z * this.z
  38819. },
  38820. length: function() {
  38821. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38822. },
  38823. lengthManhattan: function() {
  38824. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38825. },
  38826. normalize: function() {
  38827. return this.divideScalar(this.length())
  38828. },
  38829. setLength: function(e) {
  38830. return this.multiplyScalar(e / this.length())
  38831. },
  38832. lerp: function(e, t) {
  38833. return this.x += (e.x - this.x) * t,
  38834. this.y += (e.y - this.y) * t,
  38835. this.z += (e.z - this.z) * t,
  38836. this
  38837. },
  38838. lerpVectors: function(e, t, i) {
  38839. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38840. this
  38841. },
  38842. cross: function(e, t) {
  38843. if (void 0 !== t)
  38844. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38845. this.crossVectors(e, t);
  38846. var i = this.x
  38847. , n = this.y
  38848. , r = this.z;
  38849. return this.x = n * e.z - r * e.y,
  38850. this.y = r * e.x - i * e.z,
  38851. this.z = i * e.y - n * e.x,
  38852. this
  38853. },
  38854. crossVectors: function(e, t) {
  38855. var i = e.x
  38856. , n = e.y
  38857. , r = e.z
  38858. , o = t.x
  38859. , a = t.y
  38860. , s = t.z;
  38861. return this.x = n * s - r * a,
  38862. this.y = r * o - i * s,
  38863. this.z = i * a - n * o,
  38864. this
  38865. },
  38866. projectOnVector: function(e) {
  38867. return void 0 === xe && (xe = new Ci.Vector3),
  38868. xe.copy(e).normalize(),
  38869. Se = this.dot(xe),
  38870. this.copy(xe).multiplyScalar(Se)
  38871. },
  38872. projectOnPlane: function(e) {
  38873. return void 0 === Te && (Te = new Ci.Vector3),
  38874. Te.copy(this).projectOnVector(e),
  38875. this.sub(Te)
  38876. },
  38877. reflect: function(e) {
  38878. return void 0 === we && (we = new Ci.Vector3),
  38879. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38880. },
  38881. angleTo: function(e) {
  38882. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38883. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38884. },
  38885. distanceTo: function(e) {
  38886. return Math.sqrt(this.distanceToSquared(e))
  38887. },
  38888. distanceToSquared: function(e) {
  38889. var t = this.x - e.x
  38890. , i = this.y - e.y
  38891. , n = this.z - e.z;
  38892. return t * t + i * i + n * n
  38893. },
  38894. setFromSpherical: function(e) {
  38895. var t = Math.sin(e.phi) * e.radius;
  38896. return this.x = t * Math.sin(e.theta),
  38897. this.y = Math.cos(e.phi) * e.radius,
  38898. this.z = t * Math.cos(e.theta),
  38899. this
  38900. },
  38901. setFromMatrixPosition: function(e) {
  38902. return this.setFromMatrixColumn(e, 3)
  38903. },
  38904. setFromMatrixScale: function(e) {
  38905. var t = this.setFromMatrixColumn(e, 0).length()
  38906. , i = this.setFromMatrixColumn(e, 1).length()
  38907. , n = this.setFromMatrixColumn(e, 2).length();
  38908. return this.x = t,
  38909. this.y = i,
  38910. this.z = n,
  38911. this
  38912. },
  38913. setFromMatrixColumn: function(e, t) {
  38914. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38915. t = e = t),
  38916. this.fromArray(e.elements, 4 * t)
  38917. },
  38918. equals: function(e) {
  38919. return e.x === this.x && e.y === this.y && e.z === this.z
  38920. },
  38921. fromArray: function(e, t) {
  38922. return void 0 === t && (t = 0),
  38923. this.x = e[t],
  38924. this.y = e[t + 1],
  38925. this.z = e[t + 2],
  38926. this
  38927. },
  38928. toArray: function(e, t) {
  38929. return void 0 === e && (e = []),
  38930. void 0 === t && (t = 0),
  38931. e[t] = this.x,
  38932. e[t + 1] = this.y,
  38933. e[t + 2] = this.z,
  38934. e
  38935. },
  38936. fromAttribute: function(e, t, i) {
  38937. return void 0 === i && (i = 0),
  38938. t = t * e.itemSize + i,
  38939. this.x = e.array[t],
  38940. this.y = e.array[t + 1],
  38941. this.z = e.array[t + 2],
  38942. this
  38943. }
  38944. },
  38945. Ci.Vector4 = function(e, t, i, n) {
  38946. this.x = e || 0,
  38947. this.y = t || 0,
  38948. this.z = i || 0,
  38949. this.w = void 0 !== n ? n : 1
  38950. }
  38951. ,
  38952. Ci.Vector4.prototype = {
  38953. constructor: Ci.Vector4,
  38954. set: function(e, t, i, n) {
  38955. return this.x = e,
  38956. this.y = t,
  38957. this.z = i,
  38958. this.w = n,
  38959. this
  38960. },
  38961. setScalar: function(e) {
  38962. return this.x = e,
  38963. this.y = e,
  38964. this.z = e,
  38965. this.w = e,
  38966. this
  38967. },
  38968. setX: function(e) {
  38969. return this.x = e,
  38970. this
  38971. },
  38972. setY: function(e) {
  38973. return this.y = e,
  38974. this
  38975. },
  38976. setZ: function(e) {
  38977. return this.z = e,
  38978. this
  38979. },
  38980. setW: function(e) {
  38981. return this.w = e,
  38982. this
  38983. },
  38984. setComponent: function(e, t) {
  38985. switch (e) {
  38986. case 0:
  38987. this.x = t;
  38988. break;
  38989. case 1:
  38990. this.y = t;
  38991. break;
  38992. case 2:
  38993. this.z = t;
  38994. break;
  38995. case 3:
  38996. this.w = t;
  38997. break;
  38998. default:
  38999. throw new Error("index is out of range: " + e)
  39000. }
  39001. },
  39002. getComponent: function(e) {
  39003. switch (e) {
  39004. case 0:
  39005. return this.x;
  39006. case 1:
  39007. return this.y;
  39008. case 2:
  39009. return this.z;
  39010. case 3:
  39011. return this.w;
  39012. default:
  39013. throw new Error("index is out of range: " + e)
  39014. }
  39015. },
  39016. clone: function() {
  39017. return new this.constructor(this.x,this.y,this.z,this.w)
  39018. },
  39019. copy: function(e) {
  39020. return this.x = e.x,
  39021. this.y = e.y,
  39022. this.z = e.z,
  39023. this.w = void 0 !== e.w ? e.w : 1,
  39024. this
  39025. },
  39026. add: function(e, t) {
  39027. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39028. this.addVectors(e, t)) : (this.x += e.x,
  39029. this.y += e.y,
  39030. this.z += e.z,
  39031. this.w += e.w,
  39032. this)
  39033. },
  39034. addScalar: function(e) {
  39035. return this.x += e,
  39036. this.y += e,
  39037. this.z += e,
  39038. this.w += e,
  39039. this
  39040. },
  39041. addVectors: function(e, t) {
  39042. return this.x = e.x + t.x,
  39043. this.y = e.y + t.y,
  39044. this.z = e.z + t.z,
  39045. this.w = e.w + t.w,
  39046. this
  39047. },
  39048. addScaledVector: function(e, t) {
  39049. return this.x += e.x * t,
  39050. this.y += e.y * t,
  39051. this.z += e.z * t,
  39052. this.w += e.w * t,
  39053. this
  39054. },
  39055. sub: function(e, t) {
  39056. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39057. this.subVectors(e, t)) : (this.x -= e.x,
  39058. this.y -= e.y,
  39059. this.z -= e.z,
  39060. this.w -= e.w,
  39061. this)
  39062. },
  39063. subScalar: function(e) {
  39064. return this.x -= e,
  39065. this.y -= e,
  39066. this.z -= e,
  39067. this.w -= e,
  39068. this
  39069. },
  39070. subVectors: function(e, t) {
  39071. return this.x = e.x - t.x,
  39072. this.y = e.y - t.y,
  39073. this.z = e.z - t.z,
  39074. this.w = e.w - t.w,
  39075. this
  39076. },
  39077. multiplyScalar: function(e) {
  39078. return isFinite(e) ? (this.x *= e,
  39079. this.y *= e,
  39080. this.z *= e,
  39081. this.w *= e) : (this.x = 0,
  39082. this.y = 0,
  39083. this.z = 0,
  39084. this.w = 0),
  39085. this
  39086. },
  39087. applyMatrix4: function(e) {
  39088. var t = this.x
  39089. , i = this.y
  39090. , n = this.z
  39091. , r = this.w
  39092. , o = e.elements;
  39093. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  39094. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  39095. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  39096. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  39097. this
  39098. },
  39099. divideScalar: function(e) {
  39100. return this.multiplyScalar(1 / e)
  39101. },
  39102. setAxisAngleFromQuaternion: function(e) {
  39103. this.w = 2 * Math.acos(e.w);
  39104. var t = Math.sqrt(1 - e.w * e.w);
  39105. return t < 1e-4 ? (this.x = 1,
  39106. this.y = 0,
  39107. this.z = 0) : (this.x = e.x / t,
  39108. this.y = e.y / t,
  39109. this.z = e.z / t),
  39110. this
  39111. },
  39112. setAxisAngleFromRotationMatrix: function(e) {
  39113. 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];
  39114. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  39115. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  39116. return this.set(1, 0, 0, 0),
  39117. this;
  39118. t = Math.PI;
  39119. var g = (a + 1) / 2
  39120. , m = (h + 1) / 2
  39121. , v = (f + 1) / 2
  39122. , y = (s + c) / 4
  39123. , A = (l + d) / 4
  39124. , C = (u + p) / 4;
  39125. return m < g && v < g ? r = g < .01 ? (i = 0,
  39126. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  39127. A / i) : v < m ? r = m < .01 ? (n = 0,
  39128. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  39129. C / n) : v < .01 ? (n = i = .707106781,
  39130. r = 0) : (i = A / (r = Math.sqrt(v)),
  39131. n = C / r),
  39132. this.set(i, n, r, t),
  39133. this
  39134. }
  39135. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  39136. return Math.abs(I) < .001 && (I = 1),
  39137. this.x = (p - u) / I,
  39138. this.y = (l - d) / I,
  39139. this.z = (c - s) / I,
  39140. this.w = Math.acos((a + h + f - 1) / 2),
  39141. this
  39142. },
  39143. min: function(e) {
  39144. return this.x = Math.min(this.x, e.x),
  39145. this.y = Math.min(this.y, e.y),
  39146. this.z = Math.min(this.z, e.z),
  39147. this.w = Math.min(this.w, e.w),
  39148. this
  39149. },
  39150. max: function(e) {
  39151. return this.x = Math.max(this.x, e.x),
  39152. this.y = Math.max(this.y, e.y),
  39153. this.z = Math.max(this.z, e.z),
  39154. this.w = Math.max(this.w, e.w),
  39155. this
  39156. },
  39157. clamp: function(e, t) {
  39158. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39159. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39160. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  39161. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  39162. this
  39163. },
  39164. clampScalar: function(e, t) {
  39165. return void 0 === _e && (_e = new Ci.Vector4,
  39166. be = new Ci.Vector4),
  39167. _e.set(e, e, e, e),
  39168. be.set(t, t, t, t),
  39169. this.clamp(_e, be)
  39170. },
  39171. floor: function() {
  39172. return this.x = Math.floor(this.x),
  39173. this.y = Math.floor(this.y),
  39174. this.z = Math.floor(this.z),
  39175. this.w = Math.floor(this.w),
  39176. this
  39177. },
  39178. ceil: function() {
  39179. return this.x = Math.ceil(this.x),
  39180. this.y = Math.ceil(this.y),
  39181. this.z = Math.ceil(this.z),
  39182. this.w = Math.ceil(this.w),
  39183. this
  39184. },
  39185. round: function() {
  39186. return this.x = Math.round(this.x),
  39187. this.y = Math.round(this.y),
  39188. this.z = Math.round(this.z),
  39189. this.w = Math.round(this.w),
  39190. this
  39191. },
  39192. roundToZero: function() {
  39193. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39194. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39195. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  39196. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  39197. this
  39198. },
  39199. negate: function() {
  39200. return this.x = -this.x,
  39201. this.y = -this.y,
  39202. this.z = -this.z,
  39203. this.w = -this.w,
  39204. this
  39205. },
  39206. dot: function(e) {
  39207. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  39208. },
  39209. lengthSq: function() {
  39210. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  39211. },
  39212. length: function() {
  39213. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  39214. },
  39215. lengthManhattan: function() {
  39216. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  39217. },
  39218. normalize: function() {
  39219. return this.divideScalar(this.length())
  39220. },
  39221. setLength: function(e) {
  39222. return this.multiplyScalar(e / this.length())
  39223. },
  39224. lerp: function(e, t) {
  39225. return this.x += (e.x - this.x) * t,
  39226. this.y += (e.y - this.y) * t,
  39227. this.z += (e.z - this.z) * t,
  39228. this.w += (e.w - this.w) * t,
  39229. this
  39230. },
  39231. lerpVectors: function(e, t, i) {
  39232. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39233. this
  39234. },
  39235. equals: function(e) {
  39236. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  39237. },
  39238. fromArray: function(e, t) {
  39239. return void 0 === t && (t = 0),
  39240. this.x = e[t],
  39241. this.y = e[t + 1],
  39242. this.z = e[t + 2],
  39243. this.w = e[t + 3],
  39244. this
  39245. },
  39246. toArray: function(e, t) {
  39247. return void 0 === e && (e = []),
  39248. void 0 === t && (t = 0),
  39249. e[t] = this.x,
  39250. e[t + 1] = this.y,
  39251. e[t + 2] = this.z,
  39252. e[t + 3] = this.w,
  39253. e
  39254. },
  39255. fromAttribute: function(e, t, i) {
  39256. return void 0 === i && (i = 0),
  39257. t = t * e.itemSize + i,
  39258. this.x = e.array[t],
  39259. this.y = e.array[t + 1],
  39260. this.z = e.array[t + 2],
  39261. this.w = e.array[t + 3],
  39262. this
  39263. }
  39264. },
  39265. Ci.Euler = function(e, t, i, n) {
  39266. this._x = e || 0,
  39267. this._y = t || 0,
  39268. this._z = i || 0,
  39269. this._order = n || Ci.Euler.DefaultOrder
  39270. }
  39271. ,
  39272. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  39273. Ci.Euler.DefaultOrder = "XYZ",
  39274. Ci.Euler.prototype = {
  39275. constructor: Ci.Euler,
  39276. get x() {
  39277. return this._x
  39278. },
  39279. set x(e) {
  39280. this._x = e,
  39281. this.onChangeCallback()
  39282. },
  39283. get y() {
  39284. return this._y
  39285. },
  39286. set y(e) {
  39287. this._y = e,
  39288. this.onChangeCallback()
  39289. },
  39290. get z() {
  39291. return this._z
  39292. },
  39293. set z(e) {
  39294. this._z = e,
  39295. this.onChangeCallback()
  39296. },
  39297. get order() {
  39298. return this._order
  39299. },
  39300. set order(e) {
  39301. this._order = e,
  39302. this.onChangeCallback()
  39303. },
  39304. set: function(e, t, i, n) {
  39305. return this._x = e,
  39306. this._y = t,
  39307. this._z = i,
  39308. this._order = n || this._order,
  39309. this.onChangeCallback(),
  39310. this
  39311. },
  39312. clone: function() {
  39313. return new this.constructor(this._x,this._y,this._z,this._order)
  39314. },
  39315. copy: function(e) {
  39316. return this._x = e._x,
  39317. this._y = e._y,
  39318. this._z = e._z,
  39319. this._order = e._order,
  39320. this.onChangeCallback(),
  39321. this
  39322. },
  39323. toObject: function() {//xzw
  39324. return {x:this.x,y:this.y,z:this.z}
  39325. },
  39326. setFromRotationMatrix: function(e, t, i) {
  39327. var n = Ci.Math.clamp
  39328. , r = e.elements
  39329. , o = r[0]
  39330. , a = r[4]
  39331. , s = r[8]
  39332. , l = r[1]
  39333. , c = r[5]
  39334. , h = r[9]
  39335. , u = r[2]
  39336. , d = r[6]
  39337. , p = r[10];
  39338. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  39339. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  39340. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  39341. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  39342. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  39343. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  39344. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  39345. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  39346. this._z = Math.atan2(-a, c)) : (this._y = 0,
  39347. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  39348. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  39349. this._z = Math.atan2(l, o)) : (this._x = 0,
  39350. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  39351. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  39352. this._y = Math.atan2(-u, o)) : (this._x = 0,
  39353. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  39354. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  39355. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  39356. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  39357. this._order = t,
  39358. !1 !== i && this.onChangeCallback(),
  39359. this
  39360. },
  39361. setFromQuaternion: function(e, t, i) {
  39362. return void 0 === Ee && (Ee = new Ci.Matrix4),
  39363. Ee.makeRotationFromQuaternion(e),
  39364. this.setFromRotationMatrix(Ee, t, i),
  39365. this
  39366. },
  39367. setFromVector3: function(e, t) {
  39368. return this.set(e.x, e.y, e.z, t || this._order)
  39369. },
  39370. reorder: (Ie = new Ci.Quaternion,
  39371. function(e) {
  39372. Ie.setFromEuler(this),
  39373. this.setFromQuaternion(Ie, e)
  39374. }
  39375. ),
  39376. equals: function(e) {
  39377. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  39378. },
  39379. fromArray: function(e) {
  39380. return this._x = e[0],
  39381. this._y = e[1],
  39382. this._z = e[2],
  39383. void 0 !== e[3] && (this._order = e[3]),
  39384. this.onChangeCallback(),
  39385. this
  39386. },
  39387. toArray: function(e, t) {
  39388. return void 0 === e && (e = []),
  39389. void 0 === t && (t = 0),
  39390. e[t] = this._x,
  39391. e[t + 1] = this._y,
  39392. e[t + 2] = this._z,
  39393. e[t + 3] = this._order,
  39394. e
  39395. },
  39396. toVector3: function(e) {
  39397. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  39398. },
  39399. onChange: function(e) {
  39400. return this.onChangeCallback = e,
  39401. this
  39402. },
  39403. onChangeCallback: function() {}
  39404. },
  39405. Ci.Line3 = function(e, t) {
  39406. this.start = void 0 !== e ? e : new Ci.Vector3,
  39407. this.end = void 0 !== t ? t : new Ci.Vector3
  39408. }
  39409. ,
  39410. Ci.Line3.prototype = {
  39411. constructor: Ci.Line3,
  39412. set: function(e, t) {
  39413. return this.start.copy(e),
  39414. this.end.copy(t),
  39415. this
  39416. },
  39417. clone: function() {
  39418. return (new this.constructor).copy(this)
  39419. },
  39420. copy: function(e) {
  39421. return this.start.copy(e.start),
  39422. this.end.copy(e.end),
  39423. this
  39424. },
  39425. center: function(e) {
  39426. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  39427. },
  39428. delta: function(e) {
  39429. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  39430. },
  39431. distanceSq: function() {
  39432. return this.start.distanceToSquared(this.end)
  39433. },
  39434. distance: function() {
  39435. return this.start.distanceTo(this.end)
  39436. },
  39437. at: function(e, t) {
  39438. var i = t || new Ci.Vector3;
  39439. return this.delta(i).multiplyScalar(e).add(this.start)
  39440. },
  39441. closestPointToPointParameter: (Ae = new Ci.Vector3,
  39442. Ce = new Ci.Vector3,
  39443. function(e, t) {
  39444. Ae.subVectors(e, this.start),
  39445. Ce.subVectors(this.end, this.start);
  39446. var i = Ce.dot(Ce)
  39447. , n = Ce.dot(Ae) / i;
  39448. return t && (n = Ci.Math.clamp(n, 0, 1)),
  39449. n
  39450. }
  39451. ),
  39452. closestPointToPoint: function(e, t, i) {
  39453. var n = this.closestPointToPointParameter(e, t)
  39454. , r = i || new Ci.Vector3;
  39455. return this.delta(r).multiplyScalar(n).add(this.start)
  39456. },
  39457. applyMatrix4: function(e) {
  39458. return this.start.applyMatrix4(e),
  39459. this.end.applyMatrix4(e),
  39460. this
  39461. },
  39462. equals: function(e) {
  39463. return e.start.equals(this.start) && e.end.equals(this.end)
  39464. }
  39465. },
  39466. Ci.Box2 = function(e, t) {
  39467. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  39468. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  39469. }
  39470. ,
  39471. Ci.Box2.prototype = {
  39472. constructor: Ci.Box2,
  39473. set: function(e, t) {
  39474. return this.min.copy(e),
  39475. this.max.copy(t),
  39476. this
  39477. },
  39478. setFromPoints: function(e) {
  39479. this.makeEmpty();
  39480. for (var t = 0, i = e.length; t < i; t++)
  39481. this.expandByPoint(e[t]);
  39482. return this
  39483. },
  39484. setFromCenterAndSize: (ye = new Ci.Vector2,
  39485. function(e, t) {
  39486. var i = ye.copy(t).multiplyScalar(.5);
  39487. return this.min.copy(e).sub(i),
  39488. this.max.copy(e).add(i),
  39489. this
  39490. }
  39491. ),
  39492. clone: function() {
  39493. return (new this.constructor).copy(this)
  39494. },
  39495. copy: function(e) {
  39496. return this.min.copy(e.min),
  39497. this.max.copy(e.max),
  39498. this
  39499. },
  39500. makeEmpty: function() {
  39501. return this.min.x = this.min.y = 1 / 0,
  39502. this.max.x = this.max.y = -1 / 0,
  39503. this
  39504. },
  39505. isEmpty: function() {
  39506. return this.max.x < this.min.x || this.max.y < this.min.y
  39507. },
  39508. center: function(e) {
  39509. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39510. },
  39511. size: function(e) {
  39512. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39513. },
  39514. expandByPoint: function(e) {
  39515. return this.min.min(e),
  39516. this.max.max(e),
  39517. this
  39518. },
  39519. expandByVector: function(e) {
  39520. return this.min.sub(e),
  39521. this.max.add(e),
  39522. this
  39523. },
  39524. expandByScalar: function(e) {
  39525. return this.min.addScalar(-e),
  39526. this.max.addScalar(e),
  39527. this
  39528. },
  39529. containsPoint: function(e) {
  39530. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39531. },
  39532. containsBox: function(e) {
  39533. 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
  39534. },
  39535. getParameter: function(e, t) {
  39536. 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))
  39537. },
  39538. intersectsBox: function(e) {
  39539. 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)
  39540. },
  39541. clampPoint: function(e, t) {
  39542. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39543. },
  39544. distanceToPoint: (ve = new Ci.Vector2,
  39545. function(e) {
  39546. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39547. }
  39548. ),
  39549. intersect: function(e) {
  39550. return this.min.max(e.min),
  39551. this.max.min(e.max),
  39552. this
  39553. },
  39554. union: function(e) {
  39555. return this.min.min(e.min),
  39556. this.max.max(e.max),
  39557. this
  39558. },
  39559. translate: function(e) {
  39560. return this.min.add(e),
  39561. this.max.add(e),
  39562. this
  39563. },
  39564. equals: function(e) {
  39565. return e.min.equals(this.min) && e.max.equals(this.max)
  39566. }
  39567. },
  39568. Ci.Box3 = function(e, t) {
  39569. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39570. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39571. }
  39572. ,
  39573. Ci.Box3.prototype = {
  39574. constructor: Ci.Box3,
  39575. set: function(e, t) {
  39576. return this.min.copy(e),
  39577. this.max.copy(t),
  39578. this
  39579. },
  39580. setFromArray: function(e) {
  39581. this.makeEmpty();
  39582. 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) {
  39583. var c = e[s]
  39584. , h = e[s + 1]
  39585. , u = e[s + 2];
  39586. c < t && (t = c),
  39587. h < i && (i = h),
  39588. u < n && (n = u),
  39589. r < c && (r = c),
  39590. o < h && (o = h),
  39591. a < u && (a = u)
  39592. }
  39593. this.min.set(t, i, n),
  39594. this.max.set(r, o, a)
  39595. },
  39596. setFromPoints: function(e) {
  39597. this.makeEmpty();
  39598. for (var t = 0, i = e.length; t < i; t++)
  39599. this.expandByPoint(e[t]);
  39600. return this
  39601. },
  39602. setFromCenterAndSize: (me = new Ci.Vector3,
  39603. function(e, t) {
  39604. var i = me.copy(t).multiplyScalar(.5);
  39605. return this.min.copy(e).sub(i),
  39606. this.max.copy(e).add(i),
  39607. this
  39608. }
  39609. ),
  39610. setFromObject: function(e) {
  39611. void 0 === ge && (ge = new Ci.Box3);
  39612. var i = this;
  39613. return this.makeEmpty(),
  39614. e.updateMatrixWorld(!0),
  39615. e.traverse(function(e) {
  39616. var t = e.geometry;
  39617. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39618. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39619. ge.applyMatrix4(e.matrixWorld),
  39620. i.union(ge)))
  39621. }),
  39622. this
  39623. },
  39624. clone: function() {
  39625. return (new this.constructor).copy(this)
  39626. },
  39627. copy: function(e) {
  39628. return this.min.copy(e.min),
  39629. this.max.copy(e.max),
  39630. this
  39631. },
  39632. makeEmpty: function() {
  39633. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39634. this.max.x = this.max.y = this.max.z = -1 / 0,
  39635. this
  39636. },
  39637. isEmpty: function() {
  39638. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39639. },
  39640. center: function(e) {
  39641. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39642. },
  39643. size: function(e) {
  39644. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39645. },
  39646. expandByPoint: function(e) {
  39647. return this.min.min(e),
  39648. this.max.max(e),
  39649. this
  39650. },
  39651. expandByVector: function(e) {
  39652. return this.min.sub(e),
  39653. this.max.add(e),
  39654. this
  39655. },
  39656. expandByScalar: function(e) {
  39657. return this.min.addScalar(-e),
  39658. this.max.addScalar(e),
  39659. this
  39660. },
  39661. containsPoint: function(e) {
  39662. 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)
  39663. },
  39664. containsBox: function(e) {
  39665. 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
  39666. },
  39667. getParameter: function(e, t) {
  39668. 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))
  39669. },
  39670. intersectsBox: function(e) {
  39671. 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)
  39672. },
  39673. intersectsSphere: function(e) {
  39674. return void 0 === fe && (fe = new Ci.Vector3),
  39675. this.clampPoint(e.center, fe),
  39676. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39677. },
  39678. intersectsPlane: function(e) {
  39679. var t, i;
  39680. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39681. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39682. e.normal.x * this.min.x),
  39683. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39684. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39685. i += e.normal.y * this.min.y),
  39686. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39687. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39688. i += e.normal.z * this.min.z),
  39689. t <= e.constant && i >= e.constant
  39690. },
  39691. clampPoint: function(e, t) {
  39692. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39693. },
  39694. distanceToPoint: (pe = new Ci.Vector3,
  39695. function(e) {
  39696. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39697. }
  39698. ),
  39699. getBoundingSphere: (de = new Ci.Vector3,
  39700. function(e) {
  39701. var t = e || new Ci.Sphere;
  39702. return t.center = this.center(),
  39703. t.radius = .5 * this.size(de).length(),
  39704. t
  39705. }
  39706. ),
  39707. intersect: function(e) {
  39708. return this.min.max(e.min),
  39709. this.max.min(e.max),
  39710. this
  39711. },
  39712. union: function(e) {
  39713. return this.min.min(e.min),
  39714. this.max.max(e.max),
  39715. this
  39716. },
  39717. 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],
  39718. function(e) {
  39719. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39720. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39721. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39722. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39723. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39724. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39725. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39726. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39727. this.makeEmpty(),
  39728. this.setFromPoints(ue),
  39729. this
  39730. }
  39731. ),
  39732. translate: function(e) {
  39733. return this.min.add(e),
  39734. this.max.add(e),
  39735. this
  39736. },
  39737. equals: function(e) {
  39738. return e.min.equals(this.min) && e.max.equals(this.max)
  39739. }
  39740. },
  39741. Ci.Matrix3 = function() {
  39742. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39743. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39744. }
  39745. ,
  39746. Ci.Matrix3.prototype = {
  39747. constructor: Ci.Matrix3,
  39748. set: function(e, t, i, n, r, o, a, s, l) {
  39749. var c = this.elements;
  39750. return c[0] = e,
  39751. c[1] = n,
  39752. c[2] = a,
  39753. c[3] = t,
  39754. c[4] = r,
  39755. c[5] = s,
  39756. c[6] = i,
  39757. c[7] = o,
  39758. c[8] = l,
  39759. this
  39760. },
  39761. identity: function() {
  39762. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39763. this
  39764. },
  39765. clone: function() {
  39766. return (new this.constructor).fromArray(this.elements)
  39767. },
  39768. copy: function(e) {
  39769. var t = e.elements;
  39770. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39771. this
  39772. },
  39773. setFromMatrix4: function(e) {
  39774. var t = e.elements;
  39775. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39776. this
  39777. },
  39778. applyToVector3Array: function(e, t, i) {
  39779. void 0 === he && (he = new Ci.Vector3),
  39780. void 0 === t && (t = 0),
  39781. void 0 === i && (i = e.length);
  39782. for (var n = 0, r = t; n < i; n += 3,
  39783. r += 3)
  39784. he.fromArray(e, r),
  39785. he.applyMatrix3(this),
  39786. he.toArray(e, r);
  39787. return e
  39788. },
  39789. applyToBuffer: function(e, t, i) {
  39790. void 0 === ce && (ce = new Ci.Vector3),
  39791. void 0 === t && (t = 0),
  39792. void 0 === i && (i = e.length / e.itemSize);
  39793. for (var n = 0, r = t; n < i; n++,
  39794. r++)
  39795. ce.x = e.getX(r),
  39796. ce.y = e.getY(r),
  39797. ce.z = e.getZ(r),
  39798. ce.applyMatrix3(this),
  39799. e.setXYZ(ce.x, ce.y, ce.z);
  39800. return e
  39801. },
  39802. multiplyScalar: function(e) {
  39803. var t = this.elements;
  39804. return t[0] *= e,
  39805. t[3] *= e,
  39806. t[6] *= e,
  39807. t[1] *= e,
  39808. t[4] *= e,
  39809. t[7] *= e,
  39810. t[2] *= e,
  39811. t[5] *= e,
  39812. t[8] *= e,
  39813. this
  39814. },
  39815. determinant: function() {
  39816. var e = this.elements
  39817. , t = e[0]
  39818. , i = e[1]
  39819. , n = e[2]
  39820. , r = e[3]
  39821. , o = e[4]
  39822. , a = e[5]
  39823. , s = e[6]
  39824. , l = e[7]
  39825. , c = e[8];
  39826. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39827. },
  39828. getInverse: function(e, t) {
  39829. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39830. var i = e.elements
  39831. , n = this.elements
  39832. , r = i[0]
  39833. , o = i[1]
  39834. , a = i[2]
  39835. , s = i[3]
  39836. , l = i[4]
  39837. , c = i[5]
  39838. , h = i[6]
  39839. , u = i[7]
  39840. , d = i[8]
  39841. , p = d * l - c * u
  39842. , f = c * h - d * s
  39843. , g = u * s - l * h
  39844. , m = r * p + o * f + a * g;
  39845. if (0 != m)
  39846. return n[0] = p,
  39847. n[1] = a * u - d * o,
  39848. n[2] = c * o - a * l,
  39849. n[3] = f,
  39850. n[4] = d * r - a * h,
  39851. n[5] = a * s - c * r,
  39852. n[6] = g,
  39853. n[7] = o * h - u * r,
  39854. n[8] = l * r - o * s,
  39855. this.multiplyScalar(1 / m);
  39856. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39857. if (t)
  39858. throw new Error(v);
  39859. return this.identity()/* console.warn(v), *///许钟文删 boxHelper报的
  39860. },
  39861. transpose: function() {
  39862. var e, t = this.elements;
  39863. return e = t[1],
  39864. t[1] = t[3],
  39865. t[3] = e,
  39866. e = t[2],
  39867. t[2] = t[6],
  39868. t[6] = e,
  39869. e = t[5],
  39870. t[5] = t[7],
  39871. t[7] = e,
  39872. this
  39873. },
  39874. flattenToArrayOffset: function(e, t) {
  39875. var i = this.elements;
  39876. return e[t] = i[0],
  39877. e[t + 1] = i[1],
  39878. e[t + 2] = i[2],
  39879. e[t + 3] = i[3],
  39880. e[t + 4] = i[4],
  39881. e[t + 5] = i[5],
  39882. e[t + 6] = i[6],
  39883. e[t + 7] = i[7],
  39884. e[t + 8] = i[8],
  39885. e
  39886. },
  39887. getNormalMatrix: function(e) {
  39888. return this.setFromMatrix4(e).getInverse(this).transpose()
  39889. },
  39890. transposeIntoArray: function(e) {
  39891. var t = this.elements;
  39892. return e[0] = t[0],
  39893. e[1] = t[3],
  39894. e[2] = t[6],
  39895. e[3] = t[1],
  39896. e[4] = t[4],
  39897. e[5] = t[7],
  39898. e[6] = t[2],
  39899. e[7] = t[5],
  39900. e[8] = t[8],
  39901. this
  39902. },
  39903. fromArray: function(e) {
  39904. return this.elements.set(e),
  39905. this
  39906. },
  39907. toArray: function() {
  39908. var e = this.elements;
  39909. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39910. }
  39911. },
  39912. Ci.Matrix4 = function() {
  39913. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39914. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39915. }
  39916. ,
  39917. Ci.Matrix4.prototype = {
  39918. constructor: Ci.Matrix4,
  39919. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39920. var m = this.elements;
  39921. return m[0] = e,
  39922. m[4] = t,
  39923. m[8] = i,
  39924. m[12] = n,
  39925. m[1] = r,
  39926. m[5] = o,
  39927. m[9] = a,
  39928. m[13] = s,
  39929. m[2] = l,
  39930. m[6] = c,
  39931. m[10] = h,
  39932. m[14] = u,
  39933. m[3] = d,
  39934. m[7] = p,
  39935. m[11] = f,
  39936. m[15] = g,
  39937. this
  39938. },
  39939. identity: function() {
  39940. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39941. this
  39942. },
  39943. clone: function() {
  39944. return (new Ci.Matrix4).fromArray(this.elements)
  39945. },
  39946. copy: function(e) {
  39947. return this.elements.set(e.elements),
  39948. this
  39949. },
  39950. copyPosition: function(e) {
  39951. var t = this.elements
  39952. , i = e.elements;
  39953. return t[12] = i[12],
  39954. t[13] = i[13],
  39955. t[14] = i[14],
  39956. this
  39957. },
  39958. extractBasis: function(e, t, i) {
  39959. return e.setFromMatrixColumn(this, 0),
  39960. t.setFromMatrixColumn(this, 1),
  39961. i.setFromMatrixColumn(this, 2),
  39962. this
  39963. },
  39964. makeBasis: function(e, t, i) {
  39965. 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),
  39966. this
  39967. },
  39968. extractRotation: function(e) {
  39969. void 0 === le && (le = new Ci.Vector3);
  39970. var t = this.elements
  39971. , i = e.elements
  39972. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39973. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39974. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39975. return t[0] = i[0] * n,
  39976. t[1] = i[1] * n,
  39977. t[2] = i[2] * n,
  39978. t[4] = i[4] * r,
  39979. t[5] = i[5] * r,
  39980. t[6] = i[6] * r,
  39981. t[8] = i[8] * o,
  39982. t[9] = i[9] * o,
  39983. t[10] = i[10] * o,
  39984. this
  39985. },
  39986. makeRotationFromEuler: function(e) {
  39987. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39988. var t = this.elements
  39989. , i = e.x
  39990. , n = e.y
  39991. , r = e.z
  39992. , o = Math.cos(i)
  39993. , a = Math.sin(i)
  39994. , s = Math.cos(n)
  39995. , l = Math.sin(n)
  39996. , c = Math.cos(r)
  39997. , h = Math.sin(r);
  39998. if ("XYZ" === e.order) {
  39999. var u = o * c
  40000. , d = o * h
  40001. , p = a * c
  40002. , f = a * h;
  40003. t[0] = s * c,
  40004. t[4] = -s * h,
  40005. t[8] = l,
  40006. t[1] = d + p * l,
  40007. t[5] = u - f * l,
  40008. t[9] = -a * s,
  40009. t[2] = f - u * l,
  40010. t[6] = p + d * l,
  40011. t[10] = o * s
  40012. } else if ("YXZ" === e.order) {
  40013. var g = s * c
  40014. , m = s * h
  40015. , v = l * c
  40016. , y = l * h;
  40017. t[0] = g + y * a,
  40018. t[4] = v * a - m,
  40019. t[8] = o * l,
  40020. t[1] = o * h,
  40021. t[5] = o * c,
  40022. t[9] = -a,
  40023. t[2] = m * a - v,
  40024. t[6] = y + g * a,
  40025. t[10] = o * s
  40026. } else if ("ZXY" === e.order) {
  40027. g = s * c,
  40028. m = s * h,
  40029. v = l * c,
  40030. y = l * h;
  40031. t[0] = g - y * a,
  40032. t[4] = -o * h,
  40033. t[8] = v + m * a,
  40034. t[1] = m + v * a,
  40035. t[5] = o * c,
  40036. t[9] = y - g * a,
  40037. t[2] = -o * l,
  40038. t[6] = a,
  40039. t[10] = o * s
  40040. } else if ("ZYX" === e.order) {
  40041. u = o * c,
  40042. d = o * h,
  40043. p = a * c,
  40044. f = a * h;
  40045. t[0] = s * c,
  40046. t[4] = p * l - d,
  40047. t[8] = u * l + f,
  40048. t[1] = s * h,
  40049. t[5] = f * l + u,
  40050. t[9] = d * l - p,
  40051. t[2] = -l,
  40052. t[6] = a * s,
  40053. t[10] = o * s
  40054. } else if ("YZX" === e.order) {
  40055. var A = o * s
  40056. , C = o * l
  40057. , I = a * s
  40058. , E = a * l;
  40059. t[0] = s * c,
  40060. t[4] = E - A * h,
  40061. t[8] = I * h + C,
  40062. t[1] = h,
  40063. t[5] = o * c,
  40064. t[9] = -a * c,
  40065. t[2] = -l * c,
  40066. t[6] = C * h + I,
  40067. t[10] = A - E * h
  40068. } else if ("XZY" === e.order) {
  40069. A = o * s,
  40070. C = o * l,
  40071. I = a * s,
  40072. E = a * l;
  40073. t[0] = s * c,
  40074. t[4] = -h,
  40075. t[8] = l * c,
  40076. t[1] = A * h + E,
  40077. t[5] = o * c,
  40078. t[9] = C * h - I,
  40079. t[2] = I * h - C,
  40080. t[6] = a * c,
  40081. t[10] = E * h + A
  40082. }
  40083. return t[3] = 0,
  40084. t[7] = 0,
  40085. t[11] = 0,
  40086. t[12] = 0,
  40087. t[13] = 0,
  40088. t[14] = 0,
  40089. t[15] = 1,
  40090. this
  40091. },
  40092. makeRotationFromQuaternion: function(e) {
  40093. var t = this.elements
  40094. , i = e.x
  40095. , n = e.y
  40096. , r = e.z
  40097. , o = e.w
  40098. , a = i + i
  40099. , s = n + n
  40100. , l = r + r
  40101. , c = i * a
  40102. , h = i * s
  40103. , u = i * l
  40104. , d = n * s
  40105. , p = n * l
  40106. , f = r * l
  40107. , g = o * a
  40108. , m = o * s
  40109. , v = o * l;
  40110. return t[0] = 1 - (d + f),
  40111. t[4] = h - v,
  40112. t[8] = u + m,
  40113. t[1] = h + v,
  40114. t[5] = 1 - (c + f),
  40115. t[9] = p - g,
  40116. t[2] = u - m,
  40117. t[6] = p + g,
  40118. t[10] = 1 - (c + d),
  40119. t[3] = 0,
  40120. t[7] = 0,
  40121. t[11] = 0,
  40122. t[12] = 0,
  40123. t[13] = 0,
  40124. t[14] = 0,
  40125. t[15] = 1,
  40126. this
  40127. },
  40128. lookAt: function(e, t, i) {
  40129. void 0 === oe && (oe = new Ci.Vector3),
  40130. void 0 === ae && (ae = new Ci.Vector3),
  40131. void 0 === se && (se = new Ci.Vector3);
  40132. var n = this.elements;
  40133. return se.subVectors(e, t).normalize(),
  40134. 0 === se.lengthSq() && (se.z = 1),
  40135. oe.crossVectors(i, se).normalize(),
  40136. 0 === oe.lengthSq() && (se.x += 1e-4,
  40137. oe.crossVectors(i, se).normalize()),
  40138. ae.crossVectors(se, oe),
  40139. n[0] = oe.x,
  40140. n[4] = ae.x,
  40141. n[8] = se.x,
  40142. n[1] = oe.y,
  40143. n[5] = ae.y,
  40144. n[9] = se.y,
  40145. n[2] = oe.z,
  40146. n[6] = ae.z,
  40147. n[10] = se.z,
  40148. this
  40149. },
  40150. multiply: function(e, t) {
  40151. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  40152. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  40153. },
  40154. multiplyMatrices: function(e, t) {
  40155. var i = e.elements
  40156. , n = t.elements
  40157. , r = this.elements
  40158. , o = i[0]
  40159. , a = i[4]
  40160. , s = i[8]
  40161. , l = i[12]
  40162. , c = i[1]
  40163. , h = i[5]
  40164. , u = i[9]
  40165. , d = i[13]
  40166. , p = i[2]
  40167. , f = i[6]
  40168. , g = i[10]
  40169. , m = i[14]
  40170. , v = i[3]
  40171. , y = i[7]
  40172. , A = i[11]
  40173. , C = i[15]
  40174. , I = n[0]
  40175. , E = n[4]
  40176. , _ = n[8]
  40177. , b = n[12]
  40178. , w = n[1]
  40179. , T = n[5]
  40180. , x = n[9]
  40181. , S = n[13]
  40182. , M = n[2]
  40183. , R = n[6]
  40184. , P = n[10]
  40185. , O = n[14]
  40186. , L = n[3]
  40187. , D = n[7]
  40188. , N = n[11]
  40189. , F = n[15];
  40190. return r[0] = o * I + a * w + s * M + l * L,
  40191. r[4] = o * E + a * T + s * R + l * D,
  40192. r[8] = o * _ + a * x + s * P + l * N,
  40193. r[12] = o * b + a * S + s * O + l * F,
  40194. r[1] = c * I + h * w + u * M + d * L,
  40195. r[5] = c * E + h * T + u * R + d * D,
  40196. r[9] = c * _ + h * x + u * P + d * N,
  40197. r[13] = c * b + h * S + u * O + d * F,
  40198. r[2] = p * I + f * w + g * M + m * L,
  40199. r[6] = p * E + f * T + g * R + m * D,
  40200. r[10] = p * _ + f * x + g * P + m * N,
  40201. r[14] = p * b + f * S + g * O + m * F,
  40202. r[3] = v * I + y * w + A * M + C * L,
  40203. r[7] = v * E + y * T + A * R + C * D,
  40204. r[11] = v * _ + y * x + A * P + C * N,
  40205. r[15] = v * b + y * S + A * O + C * F,
  40206. this
  40207. },
  40208. multiplyToArray: function(e, t, i) {
  40209. var n = this.elements;
  40210. return this.multiplyMatrices(e, t),
  40211. i[0] = n[0],
  40212. i[1] = n[1],
  40213. i[2] = n[2],
  40214. i[3] = n[3],
  40215. i[4] = n[4],
  40216. i[5] = n[5],
  40217. i[6] = n[6],
  40218. i[7] = n[7],
  40219. i[8] = n[8],
  40220. i[9] = n[9],
  40221. i[10] = n[10],
  40222. i[11] = n[11],
  40223. i[12] = n[12],
  40224. i[13] = n[13],
  40225. i[14] = n[14],
  40226. i[15] = n[15],
  40227. this
  40228. },
  40229. multiplyScalar: function(e) {
  40230. var t = this.elements;
  40231. return t[0] *= e,
  40232. t[4] *= e,
  40233. t[8] *= e,
  40234. t[12] *= e,
  40235. t[1] *= e,
  40236. t[5] *= e,
  40237. t[9] *= e,
  40238. t[13] *= e,
  40239. t[2] *= e,
  40240. t[6] *= e,
  40241. t[10] *= e,
  40242. t[14] *= e,
  40243. t[3] *= e,
  40244. t[7] *= e,
  40245. t[11] *= e,
  40246. t[15] *= e,
  40247. this
  40248. },
  40249. applyToVector3Array: function(e, t, i) {
  40250. void 0 === re && (re = new Ci.Vector3),
  40251. void 0 === t && (t = 0),
  40252. void 0 === i && (i = e.length);
  40253. for (var n = 0, r = t; n < i; n += 3,
  40254. r += 3)
  40255. re.fromArray(e, r),
  40256. re.applyMatrix4(this),
  40257. re.toArray(e, r);
  40258. return e
  40259. },
  40260. applyToBuffer: function(e, t, i) {
  40261. void 0 === ne && (ne = new Ci.Vector3),
  40262. void 0 === t && (t = 0),
  40263. void 0 === i && (i = e.length / e.itemSize);
  40264. for (var n = 0, r = t; n < i; n++,
  40265. r++)
  40266. ne.x = e.getX(r),
  40267. ne.y = e.getY(r),
  40268. ne.z = e.getZ(r),
  40269. ne.applyMatrix4(this),
  40270. e.setXYZ(ne.x, ne.y, ne.z);
  40271. return e
  40272. },
  40273. determinant: function() {
  40274. var e = this.elements
  40275. , t = e[0]
  40276. , i = e[4]
  40277. , n = e[8]
  40278. , r = e[12]
  40279. , o = e[1]
  40280. , a = e[5]
  40281. , s = e[9]
  40282. , l = e[13]
  40283. , c = e[2]
  40284. , h = e[6]
  40285. , u = e[10]
  40286. , d = e[14];
  40287. 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)
  40288. },
  40289. transpose: function() {
  40290. var e, t = this.elements;
  40291. return e = t[1],
  40292. t[1] = t[4],
  40293. t[4] = e,
  40294. e = t[2],
  40295. t[2] = t[8],
  40296. t[8] = e,
  40297. e = t[6],
  40298. t[6] = t[9],
  40299. t[9] = e,
  40300. e = t[3],
  40301. t[3] = t[12],
  40302. t[12] = e,
  40303. e = t[7],
  40304. t[7] = t[13],
  40305. t[13] = e,
  40306. e = t[11],
  40307. t[11] = t[14],
  40308. t[14] = e,
  40309. this
  40310. },
  40311. flattenToArrayOffset: function(e, t) {
  40312. var i = this.elements;
  40313. return e[t] = i[0],
  40314. e[t + 1] = i[1],
  40315. e[t + 2] = i[2],
  40316. e[t + 3] = i[3],
  40317. e[t + 4] = i[4],
  40318. e[t + 5] = i[5],
  40319. e[t + 6] = i[6],
  40320. e[t + 7] = i[7],
  40321. e[t + 8] = i[8],
  40322. e[t + 9] = i[9],
  40323. e[t + 10] = i[10],
  40324. e[t + 11] = i[11],
  40325. e[t + 12] = i[12],
  40326. e[t + 13] = i[13],
  40327. e[t + 14] = i[14],
  40328. e[t + 15] = i[15],
  40329. e
  40330. },
  40331. getPosition: function() {
  40332. return void 0 === ie && (ie = new Ci.Vector3),
  40333. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  40334. ie.setFromMatrixColumn(this, 3)
  40335. },
  40336. setPosition: function(e) {
  40337. var t = this.elements;
  40338. return t[12] = e.x,
  40339. t[13] = e.y,
  40340. t[14] = e.z,
  40341. this
  40342. },
  40343. getInverse: function(e, t) {
  40344. var i = this.elements
  40345. , n = e.elements
  40346. , r = n[0]
  40347. , o = n[1]
  40348. , a = n[2]
  40349. , s = n[3]
  40350. , l = n[4]
  40351. , c = n[5]
  40352. , h = n[6]
  40353. , u = n[7]
  40354. , d = n[8]
  40355. , p = n[9]
  40356. , f = n[10]
  40357. , g = n[11]
  40358. , m = n[12]
  40359. , v = n[13]
  40360. , y = n[14]
  40361. , A = n[15]
  40362. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  40363. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  40364. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  40365. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  40366. , b = r * C + o * I + a * E + s * _;
  40367. if (0 != b)
  40368. return i[0] = C,
  40369. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  40370. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  40371. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  40372. i[4] = I,
  40373. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  40374. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  40375. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  40376. i[8] = E,
  40377. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  40378. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  40379. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  40380. i[12] = _,
  40381. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  40382. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  40383. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  40384. this.multiplyScalar(1 / b);
  40385. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  40386. if (t)
  40387. throw new Error(w);
  40388. return console.warn(w),
  40389. this.identity()
  40390. },
  40391. scale: function(e) {
  40392. var t = this.elements
  40393. , i = e.x
  40394. , n = e.y
  40395. , r = e.z;
  40396. return t[0] *= i,
  40397. t[4] *= n,
  40398. t[8] *= r,
  40399. t[1] *= i,
  40400. t[5] *= n,
  40401. t[9] *= r,
  40402. t[2] *= i,
  40403. t[6] *= n,
  40404. t[10] *= r,
  40405. t[3] *= i,
  40406. t[7] *= n,
  40407. t[11] *= r,
  40408. this
  40409. },
  40410. getMaxScaleOnAxis: function() {
  40411. var e = this.elements
  40412. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  40413. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  40414. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  40415. return Math.sqrt(Math.max(t, i, n))
  40416. },
  40417. makeTranslation: function(e, t, i) {
  40418. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  40419. this
  40420. },
  40421. makeRotationX: function(e) {
  40422. var t = Math.cos(e)
  40423. , i = Math.sin(e);
  40424. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  40425. this
  40426. },
  40427. makeRotationY: function(e) {
  40428. var t = Math.cos(e)
  40429. , i = Math.sin(e);
  40430. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40431. this
  40432. },
  40433. makeRotationZ: function(e) {
  40434. var t = Math.cos(e)
  40435. , i = Math.sin(e);
  40436. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40437. this
  40438. },
  40439. makeRotationAxis: function(e, t) {
  40440. var i = Math.cos(t)
  40441. , n = Math.sin(t)
  40442. , r = 1 - i
  40443. , o = e.x
  40444. , a = e.y
  40445. , s = e.z
  40446. , l = r * o
  40447. , c = r * a;
  40448. 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),
  40449. this
  40450. },
  40451. makeScale: function(e, t, i) {
  40452. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40453. this
  40454. },
  40455. compose: function(e, t, i) {
  40456. return this.makeRotationFromQuaternion(t),
  40457. this.scale(i),
  40458. this.setPosition(e),
  40459. this
  40460. },
  40461. decompose: function(e, t, i) {
  40462. void 0 === ee && (ee = new Ci.Vector3),
  40463. void 0 === te && (te = new Ci.Matrix4);
  40464. var n = this.elements
  40465. , r = ee.set(n[0], n[1], n[2]).length()
  40466. , o = ee.set(n[4], n[5], n[6]).length()
  40467. , a = ee.set(n[8], n[9], n[10]).length();
  40468. this.determinant() < 0 && (r = -r),
  40469. e.x = n[12],
  40470. e.y = n[13],
  40471. e.z = n[14],
  40472. te.elements.set(this.elements);
  40473. var s = 1 / r
  40474. , l = 1 / o
  40475. , c = 1 / a;
  40476. return te.elements[0] *= s,
  40477. te.elements[1] *= s,
  40478. te.elements[2] *= s,
  40479. te.elements[4] *= l,
  40480. te.elements[5] *= l,
  40481. te.elements[6] *= l,
  40482. te.elements[8] *= c,
  40483. te.elements[9] *= c,
  40484. te.elements[10] *= c,
  40485. t.setFromRotationMatrix(te),
  40486. i.x = r,
  40487. i.y = o,
  40488. i.z = a,
  40489. this
  40490. },
  40491. makeFrustum: function(e, t, i, n, r, o) {
  40492. var a = this.elements
  40493. , s = 2 * r / (t - e)
  40494. , l = 2 * r / (n - i)
  40495. , c = (t + e) / (t - e)
  40496. , h = (n + i) / (n - i)
  40497. , u = -(o + r) / (o - r)
  40498. , d = -2 * o * r / (o - r);
  40499. return a[0] = s,
  40500. a[4] = 0,
  40501. a[8] = c,
  40502. a[12] = 0,
  40503. a[1] = 0,
  40504. a[5] = l,
  40505. a[9] = h,
  40506. a[13] = 0,
  40507. a[2] = 0,
  40508. a[6] = 0,
  40509. a[10] = u,
  40510. a[14] = d,
  40511. a[3] = 0,
  40512. a[7] = 0,
  40513. a[11] = -1,
  40514. a[15] = 0,
  40515. this
  40516. },
  40517. makePerspective: function(e, t, i, n) {
  40518. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40519. , o = -r
  40520. , a = o * t
  40521. , s = r * t;
  40522. return this.makeFrustum(a, s, o, r, i, n)
  40523. },
  40524. makeOrthographic: function(e, t, i, n, r, o) {
  40525. var a = this.elements
  40526. , s = 1 / (t - e)
  40527. , l = 1 / (i - n)
  40528. , c = 1 / (o - r)
  40529. , h = (t + e) * s
  40530. , u = (i + n) * l
  40531. , d = (o + r) * c;
  40532. return a[0] = 2 * s,
  40533. a[4] = 0,
  40534. a[8] = 0,
  40535. a[12] = -h,
  40536. a[1] = 0,
  40537. a[5] = 2 * l,
  40538. a[9] = 0,
  40539. a[13] = -u,
  40540. a[2] = 0,
  40541. a[6] = 0,
  40542. a[10] = -2 * c,
  40543. a[14] = -d,
  40544. a[3] = 0,
  40545. a[7] = 0,
  40546. a[11] = 0,
  40547. a[15] = 1,
  40548. this
  40549. },
  40550. equals: function(e) {
  40551. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40552. if (t[n] !== i[n])
  40553. return !1;
  40554. return !0
  40555. },
  40556. fromArray: function(e) {
  40557. return this.elements.set(e),
  40558. this
  40559. },
  40560. toArray: function() {
  40561. var e = this.elements;
  40562. 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]]
  40563. }
  40564. },
  40565. Ci.Ray = function(e, t) {
  40566. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40567. this.direction = void 0 !== t ? t : new Ci.Vector3
  40568. }
  40569. ,
  40570. Ci.Ray.prototype = {
  40571. constructor: Ci.Ray,
  40572. set: function(e, t) {
  40573. return this.origin.copy(e),
  40574. this.direction.copy(t),
  40575. this
  40576. },
  40577. clone: function() {
  40578. return (new this.constructor).copy(this)
  40579. },
  40580. copy: function(e) {
  40581. return this.origin.copy(e.origin),
  40582. this.direction.copy(e.direction),
  40583. this
  40584. },
  40585. at: function(e, t) {
  40586. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40587. },
  40588. lookAt: function(e) {
  40589. this.direction.copy(e).sub(this.origin).normalize()
  40590. },
  40591. recast: ($ = new Ci.Vector3,
  40592. function(e) {
  40593. return this.origin.copy(this.at(e, $)),
  40594. this
  40595. }
  40596. ),
  40597. closestPointToPoint: function(e, t) {
  40598. var i = t || new Ci.Vector3;
  40599. i.subVectors(e, this.origin);
  40600. var n = i.dot(this.direction);
  40601. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40602. },
  40603. distanceToPoint: function(e) {
  40604. return Math.sqrt(this.distanceSqToPoint(e))
  40605. },
  40606. distanceSqToPoint: (J = new Ci.Vector3,
  40607. function(e) {
  40608. var t = J.subVectors(e, this.origin).dot(this.direction);
  40609. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40610. J.distanceToSquared(e))
  40611. }
  40612. ),
  40613. distanceSqToSegment: (Z = new Ci.Vector3,
  40614. K = new Ci.Vector3,
  40615. Q = new Ci.Vector3,
  40616. function(e, t, i, n) {
  40617. Z.copy(e).add(t).multiplyScalar(.5),
  40618. K.copy(t).sub(e).normalize(),
  40619. Q.copy(this.origin).sub(Z);
  40620. 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);
  40621. if (0 < p)
  40622. if (o = c * h - u,
  40623. s = l * p,
  40624. 0 <= (r = c * u - h))
  40625. if (-s <= o)
  40626. if (o <= s) {
  40627. var f = 1 / p;
  40628. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40629. } else
  40630. o = l,
  40631. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40632. else
  40633. o = -l,
  40634. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40635. else
  40636. 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,
  40637. (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;
  40638. else
  40639. o = 0 < c ? -l : l,
  40640. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40641. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40642. n && n.copy(K).multiplyScalar(o).add(Z),
  40643. a
  40644. }
  40645. ),
  40646. intersectSphere: (X = new Ci.Vector3,
  40647. function(e, t) {
  40648. X.subVectors(e.center, this.origin);
  40649. var i = X.dot(this.direction)
  40650. , n = X.dot(X) - i * i
  40651. , r = e.radius * e.radius;
  40652. if (r < n)
  40653. return null;
  40654. var o = Math.sqrt(r - n)
  40655. , a = i - o
  40656. , s = i + o;
  40657. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40658. }
  40659. ),
  40660. intersectsSphere: function(e) {
  40661. return this.distanceToPoint(e.center) <= e.radius
  40662. },
  40663. distanceToPlane: function(e) {
  40664. var t = e.normal.dot(this.direction);
  40665. if (0 === t)
  40666. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40667. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40668. return 0 <= i ? i : null
  40669. },
  40670. intersectPlane: function(e, t) {
  40671. var i = this.distanceToPlane(e);
  40672. return null === i ? null : this.at(i, t)
  40673. },
  40674. intersectsPlane: function(e) {
  40675. var t = e.distanceToPoint(this.origin);
  40676. return 0 === t || e.normal.dot(this.direction) * t < 0
  40677. },
  40678. intersectBox: function(e, t) {
  40679. 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;
  40680. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40681. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40682. (e.min.x - u.x) * l),
  40683. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40684. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40685. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40686. (o < n || n != n) && (n = o),
  40687. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40688. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40689. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40690. (s < n || n != n) && (n = s),
  40691. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40692. },
  40693. intersectsBox: (q = new Ci.Vector3,
  40694. function(e) {
  40695. return null !== this.intersectBox(e, q)
  40696. }
  40697. ),
  40698. intersectTriangle: (G = new Ci.Vector3,
  40699. W = new Ci.Vector3,
  40700. j = new Ci.Vector3,
  40701. Y = new Ci.Vector3,
  40702. function(e, t, i, n, r) {
  40703. W.subVectors(t, e),
  40704. j.subVectors(i, e),
  40705. Y.crossVectors(W, j);
  40706. var o, a = this.direction.dot(Y);
  40707. if (0 < a) {
  40708. if (n)
  40709. return null;
  40710. o = 1
  40711. } else {
  40712. if (!(a < 0))
  40713. return null;
  40714. o = -1,
  40715. a = -a
  40716. }
  40717. G.subVectors(this.origin, e);
  40718. var s = o * this.direction.dot(j.crossVectors(G, j));
  40719. if (s < 0)
  40720. return null;
  40721. var l = o * this.direction.dot(W.cross(G));
  40722. if (l < 0)
  40723. return null;
  40724. if (a < s + l)
  40725. return null;
  40726. var c = -o * G.dot(Y);
  40727. return c < 0 ? null : this.at(c / a, r)
  40728. }
  40729. ),
  40730. applyMatrix4: function(e) {
  40731. return this.direction.add(this.origin).applyMatrix4(e),
  40732. this.origin.applyMatrix4(e),
  40733. this.direction.sub(this.origin),
  40734. this.direction.normalize(),
  40735. this
  40736. },
  40737. equals: function(e) {
  40738. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40739. }
  40740. },
  40741. Ci.Sphere = function(e, t) {
  40742. this.center = void 0 !== e ? e : new Ci.Vector3,
  40743. this.radius = void 0 !== t ? t : 0
  40744. }
  40745. ,
  40746. Ci.Sphere.prototype = {
  40747. constructor: Ci.Sphere,
  40748. set: function(e, t) {
  40749. return this.center.copy(e),
  40750. this.radius = t,
  40751. this
  40752. },
  40753. setFromPoints: (z = new Ci.Box3,
  40754. function(e, t) {
  40755. var i = this.center;
  40756. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40757. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40758. n = Math.max(n, i.distanceToSquared(e[r]));
  40759. return this.radius = Math.sqrt(n),
  40760. this
  40761. }
  40762. ),
  40763. clone: function() {
  40764. return (new this.constructor).copy(this)
  40765. },
  40766. copy: function(e) {
  40767. return this.center.copy(e.center),
  40768. this.radius = e.radius,
  40769. this
  40770. },
  40771. empty: function() {
  40772. return this.radius <= 0
  40773. },
  40774. containsPoint: function(e) {
  40775. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40776. },
  40777. distanceToPoint: function(e) {
  40778. return e.distanceTo(this.center) - this.radius
  40779. },
  40780. intersectsSphere: function(e) {
  40781. var t = this.radius + e.radius;
  40782. return e.center.distanceToSquared(this.center) <= t * t
  40783. },
  40784. intersectsBox: function(e) {
  40785. return e.intersectsSphere(this)
  40786. },
  40787. intersectsPlane: function(e) {
  40788. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40789. },
  40790. clampPoint: function(e, t) {
  40791. var i = this.center.distanceToSquared(e)
  40792. , n = t || new Ci.Vector3;
  40793. return n.copy(e),
  40794. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40795. n.multiplyScalar(this.radius).add(this.center)),
  40796. n
  40797. },
  40798. getBoundingBox: function(e) {
  40799. var t = e || new Ci.Box3;
  40800. return t.set(this.center, this.center),
  40801. t.expandByScalar(this.radius),
  40802. t
  40803. },
  40804. applyMatrix4: function(e) {
  40805. return this.center.applyMatrix4(e),
  40806. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40807. this
  40808. },
  40809. translate: function(e) {
  40810. return this.center.add(e),
  40811. this
  40812. },
  40813. equals: function(e) {
  40814. return e.center.equals(this.center) && e.radius === this.radius
  40815. }
  40816. },
  40817. Ci.Frustum = function(e, t, i, n, r, o) {
  40818. 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]
  40819. }
  40820. ,
  40821. Ci.Frustum.prototype = {
  40822. constructor: Ci.Frustum,
  40823. set: function(e, t, i, n, r, o) {
  40824. var a = this.planes;
  40825. return a[0].copy(e),
  40826. a[1].copy(t),
  40827. a[2].copy(i),
  40828. a[3].copy(n),
  40829. a[4].copy(r),
  40830. a[5].copy(o),
  40831. this
  40832. },
  40833. clone: function() {
  40834. return (new this.constructor).copy(this)
  40835. },
  40836. copy: function(e) {
  40837. for (var t = this.planes, i = 0; i < 6; i++)
  40838. t[i].copy(e.planes[i]);
  40839. return this
  40840. },
  40841. setFromMatrix: function(e) {
  40842. var t = this.planes
  40843. , i = e.elements
  40844. , n = i[0]
  40845. , r = i[1]
  40846. , o = i[2]
  40847. , a = i[3]
  40848. , s = i[4]
  40849. , l = i[5]
  40850. , c = i[6]
  40851. , h = i[7]
  40852. , u = i[8]
  40853. , d = i[9]
  40854. , p = i[10]
  40855. , f = i[11]
  40856. , g = i[12]
  40857. , m = i[13]
  40858. , v = i[14]
  40859. , y = i[15];
  40860. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40861. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40862. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40863. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40864. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40865. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40866. this
  40867. },
  40868. intersectsObject: (H = new Ci.Sphere,
  40869. function(e) {
  40870. var t = e.geometry;
  40871. return null === t.boundingSphere && t.computeBoundingSphere(),
  40872. H.copy(t.boundingSphere),
  40873. H.applyMatrix4(e.matrixWorld),
  40874. this.intersectsSphere(H)
  40875. }
  40876. ),
  40877. intersectsSphere: function(e) {
  40878. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40879. if (t[r].distanceToPoint(i) < n)
  40880. return !1
  40881. }
  40882. return !0
  40883. },
  40884. intersectsBox: (k = new Ci.Vector3,
  40885. U = new Ci.Vector3,
  40886. function(e) {
  40887. for (var t = this.planes, i = 0; i < 6; i++) {
  40888. var n = t[i];
  40889. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40890. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40891. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40892. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40893. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40894. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40895. var r = n.distanceToPoint(k)
  40896. , o = n.distanceToPoint(U);
  40897. if (r < 0 && o < 0)
  40898. return !1
  40899. }
  40900. return !0
  40901. }
  40902. ),
  40903. containsPoint: function(e) {
  40904. for (var t = this.planes, i = 0; i < 6; i++)
  40905. if (t[i].distanceToPoint(e) < 0)
  40906. return !1;
  40907. return !0
  40908. }
  40909. },
  40910. Ci.Plane = function(e, t) {
  40911. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40912. this.constant = void 0 !== t ? t : 0
  40913. }
  40914. ,
  40915. Ci.Plane.prototype = {
  40916. constructor: Ci.Plane,
  40917. set: function(e, t) {
  40918. return this.normal.copy(e),
  40919. this.constant = t,
  40920. this
  40921. },
  40922. setComponents: function(e, t, i, n) {
  40923. return this.normal.set(e, t, i),
  40924. this.constant = n,
  40925. this
  40926. },
  40927. setFromNormalAndCoplanarPoint: function(e, t) {
  40928. return this.normal.copy(e),
  40929. this.constant = -t.dot(this.normal),
  40930. this
  40931. },
  40932. setFromCoplanarPoints: (B = new Ci.Vector3,
  40933. V = new Ci.Vector3,
  40934. function(e, t, i) {
  40935. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40936. return this.setFromNormalAndCoplanarPoint(n, e),
  40937. this
  40938. }
  40939. ),
  40940. clone: function() {
  40941. return (new this.constructor).copy(this)
  40942. },
  40943. copy: function(e) {
  40944. return this.normal.copy(e.normal),
  40945. this.constant = e.constant,
  40946. this
  40947. },
  40948. normalize: function() {
  40949. var e = 1 / this.normal.length();
  40950. return this.normal.multiplyScalar(e),
  40951. this.constant *= e,
  40952. this
  40953. },
  40954. negate: function() {
  40955. return this.constant *= -1,
  40956. this.normal.negate(),
  40957. this
  40958. },
  40959. distanceToPoint: function(e) {
  40960. return this.normal.dot(e) + this.constant
  40961. },
  40962. distanceToSphere: function(e) {
  40963. return this.distanceToPoint(e.center) - e.radius
  40964. },
  40965. projectPoint: function(e, t) {
  40966. return this.orthoPoint(e, t).sub(e).negate()
  40967. },
  40968. orthoPoint: function(e, t) {
  40969. var i = this.distanceToPoint(e);
  40970. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40971. },
  40972. intersectLine: (F = new Ci.Vector3,
  40973. function(e, t) {
  40974. var i = t || new Ci.Vector3
  40975. , n = e.delta(F)
  40976. , r = this.normal.dot(n);
  40977. if (0 !== r) {
  40978. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40979. if (!(o < 0 || 1 < o))
  40980. return i.copy(n).multiplyScalar(o).add(e.start)
  40981. } else if (0 === this.distanceToPoint(e.start))
  40982. return i.copy(e.start)
  40983. }
  40984. ),
  40985. intersectsLine: function(e) {
  40986. var t = this.distanceToPoint(e.start)
  40987. , i = this.distanceToPoint(e.end);
  40988. return t < 0 && 0 < i || i < 0 && 0 < t
  40989. },
  40990. intersectsBox: function(e) {
  40991. return e.intersectsPlane(this)
  40992. },
  40993. intersectsSphere: function(e) {
  40994. return e.intersectsPlane(this)
  40995. },
  40996. coplanarPoint: function(e) {
  40997. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40998. },
  40999. applyMatrix4: (L = new Ci.Vector3,
  41000. D = new Ci.Vector3,
  41001. N = new Ci.Matrix3,
  41002. function(e, t) {
  41003. var i = t || N.getNormalMatrix(e)
  41004. , n = L.copy(this.normal).applyMatrix3(i)
  41005. , r = this.coplanarPoint(D);
  41006. return r.applyMatrix4(e),
  41007. this.setFromNormalAndCoplanarPoint(n, r),
  41008. this
  41009. }
  41010. ),
  41011. translate: function(e) {
  41012. return this.constant = this.constant - e.dot(this.normal),
  41013. this
  41014. },
  41015. equals: function(e) {
  41016. return e.normal.equals(this.normal) && e.constant === this.constant
  41017. }
  41018. },
  41019. Ci.Spherical = function(e, t, i) {
  41020. return this.radius = void 0 !== e ? e : 1,
  41021. this.phi = void 0 !== t ? t : 0,
  41022. this.theta = void 0 !== i ? i : 0,
  41023. this
  41024. }
  41025. ,
  41026. Ci.Spherical.prototype = {
  41027. constructor: Ci.Spherical,
  41028. set: function(e, t, i) {
  41029. this.radius = e,
  41030. this.phi = t,
  41031. this.theta = i
  41032. },
  41033. clone: function() {
  41034. return (new this.constructor).copy(this)
  41035. },
  41036. copy: function(e) {
  41037. return this.radius.copy(e.radius),
  41038. this.phi.copy(e.phi),
  41039. this.theta.copy(e.theta),
  41040. this
  41041. },
  41042. makeSafe: function() {
  41043. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  41044. },
  41045. setFromVector3: function(e) {
  41046. return this.radius = e.length(),
  41047. 0 === this.radius ? (this.theta = 0,
  41048. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  41049. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  41050. this
  41051. }
  41052. },
  41053. Ci.Math = {
  41054. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  41055. P = new Array(36),
  41056. O = 0,
  41057. function() {
  41058. for (var e = 0; e < 36; e++)
  41059. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  41060. M = 15 & O,
  41061. O >>= 4,
  41062. P[e] = R[19 === e ? 3 & M | 8 : M]);
  41063. return P.join("")
  41064. }
  41065. ),
  41066. clamp: function(e, t, i) {
  41067. return Math.max(t, Math.min(i, e))
  41068. },
  41069. euclideanModulo: function(e, t) {
  41070. return (e % t + t) % t
  41071. },
  41072. mapLinear: function(e, t, i, n, r) {
  41073. return n + (e - t) * (r - n) / (i - t)
  41074. },
  41075. smoothstep: function(e, t, i) {
  41076. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  41077. },
  41078. smootherstep: function(e, t, i) {
  41079. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  41080. },
  41081. random16: function() {
  41082. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  41083. Math.random()
  41084. },
  41085. randInt: function(e, t) {
  41086. return e + Math.floor(Math.random() * (t - e + 1))
  41087. },
  41088. randFloat: function(e, t) {
  41089. return e + Math.random() * (t - e)
  41090. },
  41091. randFloatSpread: function(e) {
  41092. return e * (.5 - Math.random())
  41093. },
  41094. degToRad: (S = Math.PI / 180,
  41095. function(e) {
  41096. return e * S
  41097. }
  41098. ),
  41099. radToDeg: (x = 180 / Math.PI,
  41100. function(e) {
  41101. return e * x
  41102. }
  41103. ),
  41104. isPowerOfTwo: function(e) {
  41105. return 0 == (e & e - 1) && 0 !== e
  41106. },
  41107. nearestPowerOfTwo: function(e) {
  41108. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  41109. },
  41110. nextPowerOfTwo: function(e) {
  41111. return e--,
  41112. e |= e >> 1,
  41113. e |= e >> 2,
  41114. e |= e >> 4,
  41115. e |= e >> 8,
  41116. e |= e >> 16,
  41117. ++e
  41118. }
  41119. },
  41120. Ci.Spline = function(e) {
  41121. function t(e, t, i, n, r, o, a) {
  41122. var s = .5 * (i - e)
  41123. , l = .5 * (n - t);
  41124. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  41125. }
  41126. this.points = e;
  41127. var i, n, r, o, a, s, l, c, h, u = [], d = {
  41128. x: 0,
  41129. y: 0,
  41130. z: 0
  41131. };
  41132. this.initFromArray = function(e) {
  41133. this.points = [];
  41134. for (var t = 0; t < e.length; t++)
  41135. this.points[t] = {
  41136. x: e[t][0],
  41137. y: e[t][1],
  41138. z: e[t][2]
  41139. }
  41140. }
  41141. ,
  41142. this.getPoint = function(e) {
  41143. return i = (this.points.length - 1) * e,
  41144. n = Math.floor(i),
  41145. r = i - n,
  41146. u[0] = 0 === n ? n : n - 1,
  41147. u[1] = n,
  41148. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  41149. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  41150. s = this.points[u[0]],
  41151. l = this.points[u[1]],
  41152. c = this.points[u[2]],
  41153. h = this.points[u[3]],
  41154. a = r * (o = r * r),
  41155. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  41156. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  41157. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  41158. d
  41159. }
  41160. ,
  41161. this.getControlPointsArray = function() {
  41162. var e, t, i = this.points.length, n = [];
  41163. for (e = 0; e < i; e++)
  41164. t = this.points[e],
  41165. n[e] = [t.x, t.y, t.z];
  41166. return n
  41167. }
  41168. ,
  41169. this.getLength = function(e) {
  41170. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  41171. for (h[0] = 0,
  41172. e = e || 100,
  41173. n = this.points.length * e,
  41174. l.copy(this.points[0]),
  41175. t = 1; t < n; t++)
  41176. i = t / n,
  41177. r = this.getPoint(i),
  41178. c.copy(r),
  41179. u += c.distanceTo(l),
  41180. l.copy(r),
  41181. o = (this.points.length - 1) * i,
  41182. (a = Math.floor(o)) !== s && (h[a] = u,
  41183. s = a);
  41184. return h[h.length] = u,
  41185. {
  41186. chunks: h,
  41187. total: u
  41188. }
  41189. }
  41190. ,
  41191. this.reparametrizeByArcLength = function(e) {
  41192. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  41193. for (c.push(h.copy(this.points[0]).clone()),
  41194. t = 1; t < this.points.length; t++) {
  41195. for (a = u.chunks[t] - u.chunks[t - 1],
  41196. s = Math.ceil(e * a / u.total),
  41197. r = (t - 1) / (this.points.length - 1),
  41198. o = t / (this.points.length - 1),
  41199. i = 1; i < s - 1; i++)
  41200. n = r + i * (1 / s) * (o - r),
  41201. l = this.getPoint(n),
  41202. c.push(h.copy(l).clone());
  41203. c.push(h.copy(this.points[t]).clone())
  41204. }
  41205. this.points = c
  41206. }
  41207. }
  41208. ,
  41209. Ci.Triangle = function(e, t, i) {
  41210. this.a = void 0 !== e ? e : new Ci.Vector3,
  41211. this.b = void 0 !== t ? t : new Ci.Vector3,
  41212. this.c = void 0 !== i ? i : new Ci.Vector3
  41213. }
  41214. ,
  41215. Ci.Triangle.normal = (T = new Ci.Vector3,
  41216. function(e, t, i, n) {
  41217. var r = n || new Ci.Vector3;
  41218. r.subVectors(i, t),
  41219. T.subVectors(e, t),
  41220. r.cross(T);
  41221. var o = r.lengthSq();
  41222. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  41223. }
  41224. ),
  41225. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  41226. b = new Ci.Vector3,
  41227. w = new Ci.Vector3,
  41228. function(e, t, i, n, r) {
  41229. _.subVectors(n, t),
  41230. b.subVectors(i, t),
  41231. w.subVectors(e, t);
  41232. var o = _.dot(_)
  41233. , a = _.dot(b)
  41234. , s = _.dot(w)
  41235. , l = b.dot(b)
  41236. , c = b.dot(w)
  41237. , h = o * l - a * a
  41238. , u = r || new Ci.Vector3;
  41239. if (0 == h)
  41240. return u.set(-2, -1, -1);
  41241. var d = 1 / h
  41242. , p = (l * s - a * c) * d
  41243. , f = (o * c - a * s) * d;
  41244. return u.set(1 - p - f, f, p)
  41245. }
  41246. ),
  41247. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  41248. function(e, t, i, n) {
  41249. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  41250. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  41251. }
  41252. ),
  41253. Ci.Triangle.prototype = {
  41254. constructor: Ci.Triangle,
  41255. set: function(e, t, i) {
  41256. return this.a.copy(e),
  41257. this.b.copy(t),
  41258. this.c.copy(i),
  41259. this
  41260. },
  41261. setFromPointsAndIndices: function(e, t, i, n) {
  41262. return this.a.copy(e[t]),
  41263. this.b.copy(e[i]),
  41264. this.c.copy(e[n]),
  41265. this
  41266. },
  41267. clone: function() {
  41268. return (new this.constructor).copy(this)
  41269. },
  41270. copy: function(e) {
  41271. return this.a.copy(e.a),
  41272. this.b.copy(e.b),
  41273. this.c.copy(e.c),
  41274. this
  41275. },
  41276. area: (C = new Ci.Vector3,
  41277. I = new Ci.Vector3,
  41278. function() {
  41279. return C.subVectors(this.c, this.b),
  41280. I.subVectors(this.a, this.b),
  41281. .5 * C.cross(I).length()
  41282. }
  41283. ),
  41284. midpoint: function(e) {
  41285. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  41286. },
  41287. normal: function(e) {
  41288. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  41289. },
  41290. plane: function(e) {
  41291. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  41292. },
  41293. barycoordFromPoint: function(e, t) {
  41294. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  41295. },
  41296. containsPoint: function(e) {
  41297. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  41298. },
  41299. equals: function(e) {
  41300. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  41301. }
  41302. },
  41303. Ci.Interpolant = function(e, t, i, n) {
  41304. this.parameterPositions = e,
  41305. this._cachedIndex = 0,
  41306. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  41307. this.sampleValues = t,
  41308. this.valueSize = i
  41309. }
  41310. ,
  41311. Ci.Interpolant.prototype = {
  41312. constructor: Ci.Interpolant,
  41313. evaluate: function(e) {
  41314. var t = this.parameterPositions
  41315. , i = this._cachedIndex
  41316. , n = t[i]
  41317. , r = t[i - 1];
  41318. e: {
  41319. t: {
  41320. var o;
  41321. i: {
  41322. n: if (!(e < n)) {
  41323. for (var a = i + 2; ; ) {
  41324. if (void 0 === n) {
  41325. if (e < r)
  41326. break n;
  41327. return i = t.length,
  41328. this._cachedIndex = i,
  41329. this.afterEnd_(i - 1, e, r)
  41330. }
  41331. if (i === a)
  41332. break;
  41333. if (r = n,
  41334. e < (n = t[++i]))
  41335. break t
  41336. }
  41337. o = t.length;
  41338. break i
  41339. }
  41340. if (r <= e)
  41341. break e;
  41342. var s = t[1];
  41343. e < s && (i = 2,
  41344. r = s);
  41345. for (a = i - 2; ; ) {
  41346. if (void 0 === r)
  41347. return this._cachedIndex = 0,
  41348. this.beforeStart_(0, e, n);
  41349. if (i === a)
  41350. break;
  41351. if (n = r,
  41352. (r = t[--i - 1]) <= e)
  41353. break t
  41354. }
  41355. o = i,
  41356. i = 0
  41357. }
  41358. for (; i < o; ) {
  41359. var l = i + o >>> 1;
  41360. e < t[l] ? o = l : i = 1 + l
  41361. }
  41362. if (n = t[i],
  41363. void 0 === (r = t[i - 1]))
  41364. return this._cachedIndex = 0,
  41365. this.beforeStart_(0, e, n);
  41366. if (void 0 === n)
  41367. return i = t.length,
  41368. this._cachedIndex = i,
  41369. this.afterEnd_(i - 1, r, e)
  41370. }
  41371. this._cachedIndex = i,
  41372. this.intervalChanged_(i, r, n)
  41373. }
  41374. return this.interpolate_(i, r, e, n)
  41375. },
  41376. settings: null,
  41377. DefaultSettings_: {},
  41378. getSettings_: function() {
  41379. return this.settings || this.DefaultSettings_
  41380. },
  41381. copySampleValue_: function(e) {
  41382. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41383. t[o] = i[r + o];
  41384. return t
  41385. },
  41386. interpolate_: function(e, t, i, n) {
  41387. throw new Error("call to abstract method")
  41388. },
  41389. intervalChanged_: function(e, t, i) {}
  41390. },
  41391. Object.assign(Ci.Interpolant.prototype, {
  41392. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  41393. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  41394. }),
  41395. Ci.CubicInterpolant = function(e, t, i, n) {
  41396. Ci.Interpolant.call(this, e, t, i, n),
  41397. this._weightPrev = -0,
  41398. this._offsetPrev = -0,
  41399. this._weightNext = -0,
  41400. this._offsetNext = -0
  41401. }
  41402. ,
  41403. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41404. constructor: Ci.CubicInterpolant,
  41405. DefaultSettings_: {
  41406. endingStart: Ci.ZeroCurvatureEnding,
  41407. endingEnd: Ci.ZeroCurvatureEnding
  41408. },
  41409. intervalChanged_: function(e, t, i) {
  41410. var n = this.parameterPositions
  41411. , r = e - 2
  41412. , o = e + 1
  41413. , a = n[r]
  41414. , s = n[o];
  41415. if (void 0 === a)
  41416. switch (this.getSettings_().endingStart) {
  41417. case Ci.ZeroSlopeEnding:
  41418. r = e,
  41419. a = 2 * t - i;
  41420. break;
  41421. case Ci.WrapAroundEnding:
  41422. a = t + n[r = n.length - 2] - n[r + 1];
  41423. break;
  41424. default:
  41425. r = e,
  41426. a = i
  41427. }
  41428. if (void 0 === s)
  41429. switch (this.getSettings_().endingEnd) {
  41430. case Ci.ZeroSlopeEnding:
  41431. o = e,
  41432. s = 2 * i - t;
  41433. break;
  41434. case Ci.WrapAroundEnding:
  41435. s = i + n[o = 1] - n[0];
  41436. break;
  41437. default:
  41438. o = e - 1,
  41439. s = t
  41440. }
  41441. var l = .5 * (i - t)
  41442. , c = this.valueSize;
  41443. this._weightPrev = l / (t - a),
  41444. this._weightNext = l / (s - i),
  41445. this._offsetPrev = r * c,
  41446. this._offsetNext = o * c
  41447. },
  41448. interpolate_: function(e, t, i, n) {
  41449. 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)
  41450. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  41451. return r
  41452. }
  41453. }),
  41454. Ci.DiscreteInterpolant = function(e, t, i, n) {
  41455. Ci.Interpolant.call(this, e, t, i, n)
  41456. }
  41457. ,
  41458. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41459. constructor: Ci.DiscreteInterpolant,
  41460. interpolate_: function(e, t, i, n) {
  41461. return this.copySampleValue_(e - 1)
  41462. }
  41463. }),
  41464. Ci.LinearInterpolant = function(e, t, i, n) {
  41465. Ci.Interpolant.call(this, e, t, i, n)
  41466. }
  41467. ,
  41468. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41469. constructor: Ci.LinearInterpolant,
  41470. interpolate_: function(e, t, i, n) {
  41471. 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)
  41472. r[u] = o[l + u] * h + o[s + u] * c;
  41473. return r
  41474. }
  41475. }),
  41476. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  41477. Ci.Interpolant.call(this, e, t, i, n)
  41478. }
  41479. ,
  41480. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41481. constructor: Ci.QuaternionLinearInterpolant,
  41482. interpolate_: function(e, t, i, n) {
  41483. 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)
  41484. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  41485. return r
  41486. }
  41487. }),
  41488. Ci.Clock = function(e) {
  41489. this.autoStart = void 0 === e || e,
  41490. this.startTime = 0,
  41491. this.oldTime = 0,
  41492. this.elapsedTime = 0,
  41493. this.running = !1
  41494. }
  41495. ,
  41496. Ci.Clock.prototype = {
  41497. constructor: Ci.Clock,
  41498. start: function() {
  41499. this.startTime = performance.now(),
  41500. this.oldTime = this.startTime,
  41501. this.running = !0
  41502. },
  41503. stop: function() {
  41504. this.getElapsedTime(),
  41505. this.running = !1
  41506. },
  41507. getElapsedTime: function() {
  41508. return this.getDelta(),
  41509. this.elapsedTime
  41510. },
  41511. getDelta: function() {
  41512. var e = 0;
  41513. if (this.autoStart && !this.running && this.start(),
  41514. this.running) {
  41515. var t = performance.now();
  41516. e = .001 * (t - this.oldTime),
  41517. this.oldTime = t,
  41518. this.elapsedTime += e
  41519. }
  41520. return e
  41521. }
  41522. },
  41523. Ci.EventDispatcher = function() {}
  41524. ,
  41525. Ci.EventDispatcher.prototype = {
  41526. constructor: Ci.EventDispatcher,
  41527. apply: function(e) {
  41528. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41529. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41530. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41531. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41532. },
  41533. addEventListener: function(e, t) {
  41534. void 0 === this._listeners && (this._listeners = {});
  41535. var i = this._listeners;
  41536. void 0 === i[e] && (i[e] = []),
  41537. -1 === i[e].indexOf(t) && i[e].push(t)
  41538. },
  41539. hasEventListener: function(e, t) {
  41540. if (void 0 === this._listeners)
  41541. return !1;
  41542. var i = this._listeners;
  41543. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41544. },
  41545. removeEventListener: function(e, t) {
  41546. if (void 0 !== this._listeners) {
  41547. var i = this._listeners[e];
  41548. if (void 0 !== i) {
  41549. var n = i.indexOf(t);
  41550. -1 !== n && i.splice(n, 1)
  41551. }
  41552. }
  41553. },
  41554. dispatchEvent: function(e) {
  41555. if (void 0 !== this._listeners) {
  41556. var t = this._listeners[e.type];
  41557. if (void 0 !== t) {
  41558. e.target = this;
  41559. for (var i = [], n = t.length, r = 0; r < n; r++)
  41560. i[r] = t[r];
  41561. for (r = 0; r < n; r++)
  41562. i[r].call(this, e)
  41563. }
  41564. }
  41565. }
  41566. },
  41567. Ci.Layers = function() {
  41568. this.mask = 1
  41569. }
  41570. ,
  41571. Ci.Layers.prototype = {
  41572. constructor: Ci.Layers,
  41573. set: function(e) {
  41574. this.mask = 1 << e
  41575. },
  41576. enable: function(e) {
  41577. this.mask |= 1 << e
  41578. },
  41579. toggle: function(e) {
  41580. this.mask ^= 1 << e
  41581. },
  41582. disable: function(e) {
  41583. this.mask &= ~(1 << e)
  41584. },
  41585. test: function(e) {
  41586. return 0 != (this.mask & e.mask)
  41587. }
  41588. },
  41589. (A = Ci).Raycaster = function(e, t, i, n) {
  41590. this.ray = new A.Ray(e,t),
  41591. this.near = i || 0,
  41592. this.far = n || 1 / 0,
  41593. this.params = {
  41594. Mesh: {},
  41595. Line: {},
  41596. LOD: {},
  41597. Points: {
  41598. threshold: 1
  41599. },
  41600. Sprite: {}
  41601. },
  41602. Object.defineProperties(this.params, {
  41603. PointCloud: {
  41604. get: function() {
  41605. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41606. this.Points
  41607. }
  41608. }
  41609. })
  41610. }
  41611. ,
  41612. A.Raycaster.prototype = {
  41613. constructor: A.Raycaster,
  41614. linePrecision: 1,
  41615. set: function(e, t) {
  41616. this.ray.set(e, t)
  41617. },
  41618. setFromCamera: function(e, t) {
  41619. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41620. 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),
  41621. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41622. },
  41623. intersectObject: function(e, t) {
  41624. var i = [];
  41625. return Ei(e, this, i, t),
  41626. i.sort(Ii),
  41627. i
  41628. },
  41629. intersectObjects: function(e, t) {
  41630. var i = [];
  41631. if (!1 === Array.isArray(e))
  41632. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41633. i;
  41634. for (var n = 0, r = e.length; n < r; n++)
  41635. Ei(e[n], this, i, t);
  41636. return i.sort(Ii),
  41637. i
  41638. }
  41639. },
  41640. Ci.Object3D = function() {
  41641. Object.defineProperty(this, "id", {
  41642. value: Ci.Object3DIdCount++
  41643. }),
  41644. this.uuid = Ci.Math.generateUUID(),
  41645. this.name = "",
  41646. this.type = "Object3D",
  41647. this.parent = null,
  41648. this.children = [],
  41649. this.up = Ci.Object3D.DefaultUp.clone();
  41650. var e = new Ci.Vector3
  41651. , t = new Ci.Euler
  41652. , i = new Ci.Quaternion
  41653. , n = new Ci.Vector3(1,1,1);
  41654. t.onChange(function() {
  41655. i.setFromEuler(t, !1)
  41656. }),
  41657. i.onChange(function() {
  41658. t.setFromQuaternion(i, void 0, !1)
  41659. }),
  41660. Object.defineProperties(this, {
  41661. position: {
  41662. enumerable: !0,
  41663. value: e
  41664. },
  41665. rotation: {
  41666. enumerable: !0,
  41667. value: t
  41668. },
  41669. quaternion: {
  41670. enumerable: !0,
  41671. value: i
  41672. },
  41673. scale: {
  41674. enumerable: !0,
  41675. value: n
  41676. },
  41677. modelViewMatrix: {
  41678. value: new Ci.Matrix4
  41679. },
  41680. normalMatrix: {
  41681. value: new Ci.Matrix3
  41682. }
  41683. }),
  41684. this.rotationAutoUpdate = !0,
  41685. this.matrix = new Ci.Matrix4,
  41686. this.matrixWorld = new Ci.Matrix4,
  41687. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41688. this.matrixWorldNeedsUpdate = !1,
  41689. this.layers = new Ci.Layers,
  41690. this.visible = !0,
  41691. this.castShadow = !1,
  41692. this.receiveShadow = !1,
  41693. this.frustumCulled = !0,
  41694. this.renderOrder = 0,
  41695. this.userData = {}
  41696. }
  41697. ,
  41698. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41699. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41700. Ci.Object3D.prototype = {
  41701. constructor: Ci.Object3D,
  41702. applyMatrix: function(e) {
  41703. this.matrix.multiplyMatrices(e, this.matrix),
  41704. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41705. },
  41706. setRotationFromAxisAngle: function(e, t) {
  41707. this.quaternion.setFromAxisAngle(e, t)
  41708. },
  41709. setRotationFromEuler: function(e) {
  41710. this.quaternion.setFromEuler(e, !0)
  41711. },
  41712. setRotationFromMatrix: function(e) {
  41713. this.quaternion.setFromRotationMatrix(e)
  41714. },
  41715. setRotationFromQuaternion: function(e) {
  41716. this.quaternion.copy(e)
  41717. },
  41718. rotateOnAxis: (y = new Ci.Quaternion,
  41719. function(e, t) {
  41720. return y.setFromAxisAngle(e, t),
  41721. this.quaternion.multiply(y),
  41722. this
  41723. }
  41724. ),
  41725. rotateX: (v = new Ci.Vector3(1,0,0),
  41726. function(e) {
  41727. return this.rotateOnAxis(v, e)
  41728. }
  41729. ),
  41730. rotateY: (m = new Ci.Vector3(0,1,0),
  41731. function(e) {
  41732. return this.rotateOnAxis(m, e)
  41733. }
  41734. ),
  41735. rotateZ: (g = new Ci.Vector3(0,0,1),
  41736. function(e) {
  41737. return this.rotateOnAxis(g, e)
  41738. }
  41739. ),
  41740. translateOnAxis: (f = new Ci.Vector3,
  41741. function(e, t) {
  41742. return f.copy(e).applyQuaternion(this.quaternion),
  41743. this.position.add(f.multiplyScalar(t)),
  41744. this
  41745. }
  41746. ),
  41747. translateX: (p = new Ci.Vector3(1,0,0),
  41748. function(e) {
  41749. return this.translateOnAxis(p, e)
  41750. }
  41751. ),
  41752. translateY: (d = new Ci.Vector3(0,1,0),
  41753. function(e) {
  41754. return this.translateOnAxis(d, e)
  41755. }
  41756. ),
  41757. translateZ: (u = new Ci.Vector3(0,0,1),
  41758. function(e) {
  41759. return this.translateOnAxis(u, e)
  41760. }
  41761. ),
  41762. localToWorld: function(e) {
  41763. return e.applyMatrix4(this.matrixWorld)
  41764. },
  41765. worldToLocal: (h = new Ci.Matrix4,
  41766. function(e) {
  41767. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41768. }
  41769. ),
  41770. lookAt: (c = new Ci.Matrix4,
  41771. function(e) {
  41772. c.lookAt(e, this.position, this.up),
  41773. this.quaternion.setFromRotationMatrix(c)
  41774. }
  41775. ),
  41776. add: function(e) {
  41777. if (1 < arguments.length) {
  41778. for (var t = 0; t < arguments.length; t++)
  41779. this.add(arguments[t]);
  41780. return this
  41781. }
  41782. 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),
  41783. e.parent = this,
  41784. e.dispatchEvent({
  41785. type: "added"
  41786. }),
  41787. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41788. this
  41789. },
  41790. remove: function(e) {
  41791. if (1 < arguments.length)
  41792. for (var t = 0; t < arguments.length; t++)
  41793. this.remove(arguments[t]);
  41794. var i = this.children.indexOf(e);
  41795. -1 !== i && (e.parent = null,
  41796. e.dispatchEvent({
  41797. type: "removed"
  41798. }),
  41799. this.children.splice(i, 1))
  41800. },
  41801. getObjectById: function(e) {
  41802. return this.getObjectByProperty("id", e)
  41803. },
  41804. getObjectByName: function(e) {
  41805. return this.getObjectByProperty("name", e)
  41806. },
  41807. getObjectByProperty: function(e, t) {
  41808. if (this[e] === t)
  41809. return this;
  41810. for (var i = 0, n = this.children.length; i < n; i++) {
  41811. var r = this.children[i].getObjectByProperty(e, t);
  41812. if (void 0 !== r)
  41813. return r
  41814. }
  41815. },
  41816. getWorldPosition: function(e) {
  41817. var t = e || new Ci.Vector3;
  41818. return this.updateMatrixWorld(!0),
  41819. t.setFromMatrixPosition(this.matrixWorld)
  41820. },
  41821. getWorldQuaternion: (s = new Ci.Vector3,
  41822. l = new Ci.Vector3,
  41823. function(e) {
  41824. var t = e || new Ci.Quaternion;
  41825. return this.updateMatrixWorld(!0),
  41826. this.matrixWorld.decompose(s, t, l),
  41827. t
  41828. }
  41829. ),
  41830. getWorldRotation: (a = new Ci.Quaternion,
  41831. function(e) {
  41832. var t = e || new Ci.Euler;
  41833. return this.getWorldQuaternion(a),
  41834. t.setFromQuaternion(a, this.rotation.order, !1)
  41835. }
  41836. ),
  41837. getWorldScale: (r = new Ci.Vector3,
  41838. o = new Ci.Quaternion,
  41839. function(e) {
  41840. var t = e || new Ci.Vector3;
  41841. return this.updateMatrixWorld(!0),
  41842. this.matrixWorld.decompose(r, o, t),
  41843. t
  41844. }
  41845. ),
  41846. getWorldDirection: (n = new Ci.Quaternion,
  41847. function(e) {
  41848. var t = e || new Ci.Vector3;
  41849. return this.getWorldQuaternion(n),
  41850. t.set(0, 0, 1).applyQuaternion(n)
  41851. }
  41852. ),
  41853. raycast: function() {},
  41854. traverse: function(e) {
  41855. e(this);
  41856. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41857. t[i].traverse(e)
  41858. },
  41859. traverseVisible: function(e) {
  41860. if (!1 !== this.visible) {
  41861. e(this);
  41862. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41863. t[i].traverseVisible(e)
  41864. }
  41865. },
  41866. traverseAncestors: function(e) {
  41867. var t = this.parent;
  41868. null !== t && (e(t),
  41869. t.traverseAncestors(e))
  41870. },
  41871. updateMatrix: function() {
  41872. this.matrix.compose(this.position, this.quaternion, this.scale),
  41873. this.matrixWorldNeedsUpdate = !0
  41874. },
  41875. updateMatrixWorld: function(e) {
  41876. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41877. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41878. e = !(this.matrixWorldNeedsUpdate = !1));
  41879. for (var t = 0, i = this.children.length; t < i; t++)
  41880. this.children[t].updateMatrixWorld(e)
  41881. },
  41882. toJSON: function(e) {
  41883. function t(e) {
  41884. var t = [];
  41885. for (var i in e) {
  41886. var n = e[i];
  41887. delete n.metadata,
  41888. t.push(n)
  41889. }
  41890. return t
  41891. }
  41892. var i = void 0 === e
  41893. , n = {};
  41894. i && (e = {
  41895. geometries: {},
  41896. materials: {},
  41897. textures: {},
  41898. images: {}
  41899. },
  41900. n.metadata = {
  41901. version: 4.4,
  41902. type: "Object",
  41903. generator: "Object3D.toJSON"
  41904. });
  41905. var r = {};
  41906. if (r.uuid = this.uuid,
  41907. r.type = this.type,
  41908. "" !== this.name && (r.name = this.name),
  41909. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41910. !0 === this.castShadow && (r.castShadow = !0),
  41911. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41912. !1 === this.visible && (r.visible = !1),
  41913. r.matrix = this.matrix.toArray(),
  41914. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41915. r.geometry = this.geometry.uuid),
  41916. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41917. r.material = this.material.uuid),
  41918. 0 < this.children.length) {
  41919. r.children = [];
  41920. for (var o = 0; o < this.children.length; o++)
  41921. r.children.push(this.children[o].toJSON(e).object)
  41922. }
  41923. if (i) {
  41924. var a = t(e.geometries)
  41925. , s = t(e.materials)
  41926. , l = t(e.textures)
  41927. , c = t(e.images);
  41928. 0 < a.length && (n.geometries = a),
  41929. 0 < s.length && (n.materials = s),
  41930. 0 < l.length && (n.textures = l),
  41931. 0 < c.length && (n.images = c)
  41932. }
  41933. return n.object = r,
  41934. n
  41935. },
  41936. clone: function(e) {
  41937. return (new this.constructor).copy(this, e)
  41938. },
  41939. copy: function(e, t) {
  41940. if (void 0 === t && (t = !0),
  41941. this.name = e.name,
  41942. this.up.copy(e.up),
  41943. this.position.copy(e.position),
  41944. this.quaternion.copy(e.quaternion),
  41945. this.scale.copy(e.scale),
  41946. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41947. this.matrix.copy(e.matrix),
  41948. this.matrixWorld.copy(e.matrixWorld),
  41949. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41950. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41951. this.visible = e.visible,
  41952. this.castShadow = e.castShadow,
  41953. this.receiveShadow = e.receiveShadow,
  41954. this.frustumCulled = e.frustumCulled,
  41955. this.renderOrder = e.renderOrder,
  41956. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41957. !0 === t)
  41958. for (var i = 0; i < e.children.length; i++) {
  41959. var n = e.children[i];
  41960. this.add(n.clone())
  41961. }
  41962. return this
  41963. }
  41964. },
  41965. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41966. Ci.Object3DIdCount = 0,
  41967. Ci.Face3 = function(e, t, i, n, r, o) {
  41968. this.a = e,
  41969. this.b = t,
  41970. this.c = i,
  41971. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41972. this.vertexNormals = Array.isArray(n) ? n : [],
  41973. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41974. this.vertexColors = Array.isArray(r) ? r : [],
  41975. this.materialIndex = void 0 !== o ? o : 0
  41976. }
  41977. ,
  41978. Ci.Face3.prototype = {
  41979. constructor: Ci.Face3,
  41980. clone: function() {
  41981. return (new this.constructor).copy(this)
  41982. },
  41983. copy: function(e) {
  41984. this.a = e.a,
  41985. this.b = e.b,
  41986. this.c = e.c,
  41987. this.normal.copy(e.normal),
  41988. this.color.copy(e.color),
  41989. this.materialIndex = e.materialIndex;
  41990. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41991. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41992. for (t = 0,
  41993. i = e.vertexColors.length; t < i; t++)
  41994. this.vertexColors[t] = e.vertexColors[t].clone();
  41995. return this
  41996. }
  41997. },
  41998. Ci.BufferAttribute = function(e, t) {
  41999. this.uuid = Ci.Math.generateUUID(),
  42000. this.array = e,
  42001. this.itemSize = t,
  42002. this.dynamic = !1,
  42003. this.updateRange = {
  42004. offset: 0,
  42005. count: -1
  42006. },
  42007. this.version = 0
  42008. }
  42009. ,
  42010. Ci.BufferAttribute.prototype = {
  42011. constructor: Ci.BufferAttribute,
  42012. get count() {
  42013. return this.array.length / this.itemSize
  42014. },
  42015. set needsUpdate(e) {
  42016. !0 === e && this.version++
  42017. },
  42018. setDynamic: function(e) {
  42019. return this.dynamic = e,
  42020. this
  42021. },
  42022. copy: function(e) {
  42023. return this.array = new e.array.constructor(e.array),
  42024. this.itemSize = e.itemSize,
  42025. this.dynamic = e.dynamic,
  42026. this
  42027. },
  42028. copyAt: function(e, t, i) {
  42029. e *= this.itemSize,
  42030. i *= t.itemSize;
  42031. for (var n = 0, r = this.itemSize; n < r; n++)
  42032. this.array[e + n] = t.array[i + n];
  42033. return this
  42034. },
  42035. copyArray: function(e) {
  42036. return this.array.set(e),
  42037. this
  42038. },
  42039. copyColorsArray: function(e) {
  42040. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42041. var o = e[n];
  42042. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  42043. o = new Ci.Color),
  42044. t[i++] = o.r,
  42045. t[i++] = o.g,
  42046. t[i++] = o.b
  42047. }
  42048. return this
  42049. },
  42050. copyIndicesArray: function(e) {
  42051. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42052. var o = e[n];
  42053. t[i++] = o.a,
  42054. t[i++] = o.b,
  42055. t[i++] = o.c
  42056. }
  42057. return this
  42058. },
  42059. copyVector2sArray: function(e) {
  42060. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42061. var o = e[n];
  42062. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  42063. o = new Ci.Vector2),
  42064. t[i++] = o.x,
  42065. t[i++] = o.y
  42066. }
  42067. return this
  42068. },
  42069. copyVector3sArray: function(e) {
  42070. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42071. var o = e[n];
  42072. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  42073. o = new Ci.Vector3),
  42074. t[i++] = o.x,
  42075. t[i++] = o.y,
  42076. t[i++] = o.z
  42077. }
  42078. return this
  42079. },
  42080. copyVector4sArray: function(e) {
  42081. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42082. var o = e[n];
  42083. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  42084. o = new Ci.Vector4),
  42085. t[i++] = o.x,
  42086. t[i++] = o.y,
  42087. t[i++] = o.z,
  42088. t[i++] = o.w
  42089. }
  42090. return this
  42091. },
  42092. set: function(e, t) {
  42093. return void 0 === t && (t = 0),
  42094. this.array.set(e, t),
  42095. this
  42096. },
  42097. getX: function(e) {
  42098. return this.array[e * this.itemSize]
  42099. },
  42100. setX: function(e, t) {
  42101. return this.array[e * this.itemSize] = t,
  42102. this
  42103. },
  42104. getY: function(e) {
  42105. return this.array[e * this.itemSize + 1]
  42106. },
  42107. setY: function(e, t) {
  42108. return this.array[e * this.itemSize + 1] = t,
  42109. this
  42110. },
  42111. getZ: function(e) {
  42112. return this.array[e * this.itemSize + 2]
  42113. },
  42114. setZ: function(e, t) {
  42115. return this.array[e * this.itemSize + 2] = t,
  42116. this
  42117. },
  42118. getW: function(e) {
  42119. return this.array[e * this.itemSize + 3]
  42120. },
  42121. setW: function(e, t) {
  42122. return this.array[e * this.itemSize + 3] = t,
  42123. this
  42124. },
  42125. setXY: function(e, t, i) {
  42126. return e *= this.itemSize,
  42127. this.array[e + 0] = t,
  42128. this.array[e + 1] = i,
  42129. this
  42130. },
  42131. setXYZ: function(e, t, i, n) {
  42132. return e *= this.itemSize,
  42133. this.array[e + 0] = t,
  42134. this.array[e + 1] = i,
  42135. this.array[e + 2] = n,
  42136. this
  42137. },
  42138. setXYZW: function(e, t, i, n, r) {
  42139. return e *= this.itemSize,
  42140. this.array[e + 0] = t,
  42141. this.array[e + 1] = i,
  42142. this.array[e + 2] = n,
  42143. this.array[e + 3] = r,
  42144. this
  42145. },
  42146. clone: function() {
  42147. return (new this.constructor).copy(this)
  42148. }
  42149. },
  42150. Ci.Int8Attribute = function(e, t) {
  42151. return new Ci.BufferAttribute(new Int8Array(e),t)
  42152. }
  42153. ,
  42154. Ci.Uint8Attribute = function(e, t) {
  42155. return new Ci.BufferAttribute(new Uint8Array(e),t)
  42156. }
  42157. ,
  42158. Ci.Uint8ClampedAttribute = function(e, t) {
  42159. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  42160. }
  42161. ,
  42162. Ci.Int16Attribute = function(e, t) {
  42163. return new Ci.BufferAttribute(new Int16Array(e),t)
  42164. }
  42165. ,
  42166. Ci.Uint16Attribute = function(e, t) {
  42167. return new Ci.BufferAttribute(new Uint16Array(e),t)
  42168. }
  42169. ,
  42170. Ci.Int32Attribute = function(e, t) {
  42171. return new Ci.BufferAttribute(new Int32Array(e),t)
  42172. }
  42173. ,
  42174. Ci.Uint32Attribute = function(e, t) {
  42175. return new Ci.BufferAttribute(new Uint32Array(e),t)
  42176. }
  42177. ,
  42178. Ci.Float32Attribute = function(e, t) {
  42179. return new Ci.BufferAttribute(new Float32Array(e),t)
  42180. }
  42181. ,
  42182. Ci.Float64Attribute = function(e, t) {
  42183. return new Ci.BufferAttribute(new Float64Array(e),t)
  42184. }
  42185. ,
  42186. Ci.DynamicBufferAttribute = function(e, t) {
  42187. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  42188. new Ci.BufferAttribute(e,t).setDynamic(!0)
  42189. }
  42190. ,
  42191. Ci.InstancedBufferAttribute = function(e, t, i) {
  42192. Ci.BufferAttribute.call(this, e, t),
  42193. this.meshPerAttribute = i || 1
  42194. }
  42195. ,
  42196. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  42197. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  42198. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  42199. return Ci.BufferAttribute.prototype.copy.call(this, e),
  42200. this.meshPerAttribute = e.meshPerAttribute,
  42201. this
  42202. }
  42203. ,
  42204. Ci.InterleavedBuffer = function(e, t) {
  42205. this.uuid = Ci.Math.generateUUID(),
  42206. this.array = e,
  42207. this.stride = t,
  42208. this.dynamic = !1,
  42209. this.updateRange = {
  42210. offset: 0,
  42211. count: -1
  42212. },
  42213. this.version = 0
  42214. }
  42215. ,
  42216. Ci.InterleavedBuffer.prototype = {
  42217. constructor: Ci.InterleavedBuffer,
  42218. get length() {
  42219. return this.array.length
  42220. },
  42221. get count() {
  42222. return this.array.length / this.stride
  42223. },
  42224. set needsUpdate(e) {
  42225. !0 === e && this.version++
  42226. },
  42227. setDynamic: function(e) {
  42228. return this.dynamic = e,
  42229. this
  42230. },
  42231. copy: function(e) {
  42232. return this.array = new e.array.constructor(e.array),
  42233. this.stride = e.stride,
  42234. this.dynamic = e.dynamic,
  42235. this
  42236. },
  42237. copyAt: function(e, t, i) {
  42238. e *= this.stride,
  42239. i *= t.stride;
  42240. for (var n = 0, r = this.stride; n < r; n++)
  42241. this.array[e + n] = t.array[i + n];
  42242. return this
  42243. },
  42244. set: function(e, t) {
  42245. return void 0 === t && (t = 0),
  42246. this.array.set(e, t),
  42247. this
  42248. },
  42249. clone: function() {
  42250. return (new this.constructor).copy(this)
  42251. }
  42252. },
  42253. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  42254. Ci.InterleavedBuffer.call(this, e, t),
  42255. this.meshPerAttribute = i || 1
  42256. }
  42257. ,
  42258. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  42259. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  42260. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  42261. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  42262. this.meshPerAttribute = e.meshPerAttribute,
  42263. this
  42264. }
  42265. ,
  42266. Ci.InterleavedBufferAttribute = function(e, t, i) {
  42267. this.uuid = Ci.Math.generateUUID(),
  42268. this.data = e,
  42269. this.itemSize = t,
  42270. this.offset = i
  42271. }
  42272. ,
  42273. Ci.InterleavedBufferAttribute.prototype = {
  42274. constructor: Ci.InterleavedBufferAttribute,
  42275. get length() {
  42276. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  42277. this.array.length
  42278. },
  42279. get count() {
  42280. return this.data.count
  42281. },
  42282. setX: function(e, t) {
  42283. return this.data.array[e * this.data.stride + this.offset] = t,
  42284. this
  42285. },
  42286. setY: function(e, t) {
  42287. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  42288. this
  42289. },
  42290. setZ: function(e, t) {
  42291. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  42292. this
  42293. },
  42294. setW: function(e, t) {
  42295. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  42296. this
  42297. },
  42298. getX: function(e) {
  42299. return this.data.array[e * this.data.stride + this.offset]
  42300. },
  42301. getY: function(e) {
  42302. return this.data.array[e * this.data.stride + this.offset + 1]
  42303. },
  42304. getZ: function(e) {
  42305. return this.data.array[e * this.data.stride + this.offset + 2]
  42306. },
  42307. getW: function(e) {
  42308. return this.data.array[e * this.data.stride + this.offset + 3]
  42309. },
  42310. setXY: function(e, t, i) {
  42311. return e = e * this.data.stride + this.offset,
  42312. this.data.array[e + 0] = t,
  42313. this.data.array[e + 1] = i,
  42314. this
  42315. },
  42316. setXYZ: function(e, t, i, n) {
  42317. return e = e * this.data.stride + this.offset,
  42318. this.data.array[e + 0] = t,
  42319. this.data.array[e + 1] = i,
  42320. this.data.array[e + 2] = n,
  42321. this
  42322. },
  42323. setXYZW: function(e, t, i, n, r) {
  42324. return e = e * this.data.stride + this.offset,
  42325. this.data.array[e + 0] = t,
  42326. this.data.array[e + 1] = i,
  42327. this.data.array[e + 2] = n,
  42328. this.data.array[e + 3] = r,
  42329. this
  42330. }
  42331. },
  42332. Ci.Geometry = function() {
  42333. Object.defineProperty(this, "id", {
  42334. value: Ci.GeometryIdCount++
  42335. }),
  42336. this.uuid = Ci.Math.generateUUID(),
  42337. this.name = "",
  42338. this.type = "Geometry",
  42339. this.vertices = [],
  42340. this.colors = [],
  42341. this.faces = [],
  42342. this.faceVertexUvs = [[]],
  42343. this.morphTargets = [],
  42344. this.morphNormals = [],
  42345. this.skinWeights = [],
  42346. this.skinIndices = [],
  42347. this.lineDistances = [],
  42348. this.boundingBox = null,
  42349. this.boundingSphere = null,
  42350. this.verticesNeedUpdate = !1,
  42351. this.elementsNeedUpdate = !1,
  42352. this.uvsNeedUpdate = !1,
  42353. this.normalsNeedUpdate = !1,
  42354. this.colorsNeedUpdate = !1,
  42355. this.lineDistancesNeedUpdate = !1,
  42356. this.groupsNeedUpdate = !1
  42357. }
  42358. ,
  42359. Ci.Geometry.prototype = {
  42360. constructor: Ci.Geometry,
  42361. applyMatrix: function(e) {
  42362. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  42363. this.vertices[i].applyMatrix4(e)
  42364. }
  42365. for (i = 0,
  42366. n = this.faces.length; i < n; i++) {
  42367. var r = this.faces[i];
  42368. r.normal.applyMatrix3(t).normalize();
  42369. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  42370. r.vertexNormals[o].applyMatrix3(t).normalize()
  42371. }
  42372. return null !== this.boundingBox && this.computeBoundingBox(),
  42373. null !== this.boundingSphere && this.computeBoundingSphere(),
  42374. this.verticesNeedUpdate = !0,
  42375. this.normalsNeedUpdate = !0,
  42376. this
  42377. },
  42378. rotateX: function(e) {
  42379. return void 0 === mt && (mt = new Ci.Matrix4),
  42380. mt.makeRotationX(e),
  42381. this.applyMatrix(mt),
  42382. this
  42383. },
  42384. rotateY: function(e) {
  42385. return void 0 === gt && (gt = new Ci.Matrix4),
  42386. gt.makeRotationY(e),
  42387. this.applyMatrix(gt),
  42388. this
  42389. },
  42390. rotateZ: function(e) {
  42391. return void 0 === ft && (ft = new Ci.Matrix4),
  42392. ft.makeRotationZ(e),
  42393. this.applyMatrix(ft),
  42394. this
  42395. },
  42396. translate: function(e, t, i) {
  42397. return void 0 === pt && (pt = new Ci.Matrix4),
  42398. pt.makeTranslation(e, t, i),
  42399. this.applyMatrix(pt),
  42400. this
  42401. },
  42402. scale: function(e, t, i) {
  42403. return void 0 === dt && (dt = new Ci.Matrix4),
  42404. dt.makeScale(e, t, i),
  42405. this.applyMatrix(dt),
  42406. this
  42407. },
  42408. lookAt: function(e) {
  42409. void 0 === ut && (ut = new Ci.Object3D),
  42410. ut.lookAt(e),
  42411. ut.updateMatrix(),
  42412. this.applyMatrix(ut.matrix)
  42413. },
  42414. fromBufferGeometry: function(e) {
  42415. function t(e, t, i, n) {
  42416. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  42417. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  42418. , a = new Ci.Face3(e,t,i,r,o,n);
  42419. s.faces.push(a),
  42420. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  42421. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  42422. }
  42423. var s = this
  42424. , i = null !== e.index ? e.index.array : void 0
  42425. , n = e.attributes
  42426. , r = n.position.array
  42427. , l = void 0 !== n.normal ? n.normal.array : void 0
  42428. , c = void 0 !== n.color ? n.color.array : void 0
  42429. , h = void 0 !== n.uv ? n.uv.array : void 0
  42430. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  42431. void 0 !== u && (this.faceVertexUvs[1] = []);
  42432. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  42433. a += 2)
  42434. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  42435. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  42436. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  42437. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  42438. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  42439. if (void 0 !== i) {
  42440. var g = e.groups;
  42441. if (0 < g.length)
  42442. for (o = 0; o < g.length; o++)
  42443. for (var m = g[o], v = m.start, y = (a = v,
  42444. v + m.count); a < y; a += 3)
  42445. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  42446. else
  42447. for (o = 0; o < i.length; o += 3)
  42448. t(i[o], i[o + 1], i[o + 2])
  42449. } else
  42450. for (o = 0; o < r.length / 3; o += 3)
  42451. t(o, o + 1, o + 2);
  42452. return this.computeFaceNormals(),
  42453. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42454. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42455. this
  42456. },
  42457. center: function() {
  42458. this.computeBoundingBox();
  42459. var e = this.boundingBox.center().negate();
  42460. return this.translate(e.x, e.y, e.z),
  42461. e
  42462. },
  42463. normalize: function() {
  42464. this.computeBoundingSphere();
  42465. var e = this.boundingSphere.center
  42466. , t = this.boundingSphere.radius
  42467. , i = 0 === t ? 1 : 1 / t
  42468. , n = new Ci.Matrix4;
  42469. 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),
  42470. this.applyMatrix(n),
  42471. this
  42472. },
  42473. computeFaceNormals: function() {
  42474. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  42475. var r = this.faces[i]
  42476. , o = this.vertices[r.a]
  42477. , a = this.vertices[r.b]
  42478. , s = this.vertices[r.c];
  42479. e.subVectors(s, a),
  42480. t.subVectors(o, a),
  42481. e.cross(t),
  42482. e.normalize(),
  42483. r.normal.copy(e)
  42484. }
  42485. },
  42486. computeVertexNormals: function(e) {
  42487. var t, i, n, r, o, a;
  42488. for (void 0 === e && (e = !0),
  42489. a = new Array(this.vertices.length),
  42490. t = 0,
  42491. i = this.vertices.length; t < i; t++)
  42492. a[t] = new Ci.Vector3;
  42493. if (e) {
  42494. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42495. for (n = 0,
  42496. r = this.faces.length; n < r; n++)
  42497. o = this.faces[n],
  42498. s = this.vertices[o.a],
  42499. l = this.vertices[o.b],
  42500. c = this.vertices[o.c],
  42501. h.subVectors(c, l),
  42502. u.subVectors(s, l),
  42503. h.cross(u),
  42504. a[o.a].add(h),
  42505. a[o.b].add(h),
  42506. a[o.c].add(h)
  42507. } else
  42508. for (n = 0,
  42509. r = this.faces.length; n < r; n++)
  42510. a[(o = this.faces[n]).a].add(o.normal),
  42511. a[o.b].add(o.normal),
  42512. a[o.c].add(o.normal);
  42513. for (t = 0,
  42514. i = this.vertices.length; t < i; t++)
  42515. a[t].normalize();
  42516. for (n = 0,
  42517. r = this.faces.length; n < r; n++) {
  42518. var d = (o = this.faces[n]).vertexNormals;
  42519. 3 === d.length ? (d[0].copy(a[o.a]),
  42520. d[1].copy(a[o.b]),
  42521. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42522. d[1] = a[o.b].clone(),
  42523. d[2] = a[o.c].clone())
  42524. }
  42525. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42526. },
  42527. computeMorphNormals: function() {
  42528. var e, t, i, n, r;
  42529. for (i = 0,
  42530. n = this.faces.length; i < n; i++)
  42531. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42532. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42533. e = 0,
  42534. t = r.vertexNormals.length; e < t; e++)
  42535. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42536. var o = new Ci.Geometry;
  42537. for (o.faces = this.faces,
  42538. e = 0,
  42539. t = this.morphTargets.length; e < t; e++) {
  42540. if (!this.morphNormals[e]) {
  42541. this.morphNormals[e] = {},
  42542. this.morphNormals[e].faceNormals = [],
  42543. this.morphNormals[e].vertexNormals = [];
  42544. var a = this.morphNormals[e].faceNormals
  42545. , s = this.morphNormals[e].vertexNormals;
  42546. for (i = 0,
  42547. n = this.faces.length; i < n; i++)
  42548. l = new Ci.Vector3,
  42549. c = {
  42550. a: new Ci.Vector3,
  42551. b: new Ci.Vector3,
  42552. c: new Ci.Vector3
  42553. },
  42554. a.push(l),
  42555. s.push(c)
  42556. }
  42557. var l, c, h = this.morphNormals[e];
  42558. for (o.vertices = this.morphTargets[e].vertices,
  42559. o.computeFaceNormals(),
  42560. o.computeVertexNormals(),
  42561. i = 0,
  42562. n = this.faces.length; i < n; i++)
  42563. r = this.faces[i],
  42564. l = h.faceNormals[i],
  42565. c = h.vertexNormals[i],
  42566. l.copy(r.normal),
  42567. c.a.copy(r.vertexNormals[0]),
  42568. c.b.copy(r.vertexNormals[1]),
  42569. c.c.copy(r.vertexNormals[2])
  42570. }
  42571. for (i = 0,
  42572. n = this.faces.length; i < n; i++)
  42573. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42574. r.vertexNormals = r.__originalVertexNormals
  42575. },
  42576. computeTangents: function() {
  42577. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42578. },
  42579. computeLineDistances: function() {
  42580. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42581. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42582. this.lineDistances[i] = e
  42583. },
  42584. computeBoundingBox: function() {
  42585. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42586. this.boundingBox.setFromPoints(this.vertices)
  42587. },
  42588. computeBoundingSphere: function() {
  42589. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42590. this.boundingSphere.setFromPoints(this.vertices)
  42591. },
  42592. merge: function(e, t, i) {
  42593. if (e instanceof Ci.Geometry != 0) {
  42594. 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];
  42595. void 0 === i && (i = 0),
  42596. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42597. for (var u = 0, d = a.length; u < d; u++) {
  42598. var p = a[u].clone();
  42599. void 0 !== t && p.applyMatrix4(t),
  42600. o.push(p)
  42601. }
  42602. for (u = 0,
  42603. d = l.length; u < d; u++) {
  42604. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42605. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42606. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42607. for (var C = 0, I = y.length; C < I; C++)
  42608. g = y[C].clone(),
  42609. void 0 !== n && g.applyMatrix3(n).normalize(),
  42610. f.vertexNormals.push(g);
  42611. f.color.copy(v.color);
  42612. for (C = 0,
  42613. I = A.length; C < I; C++)
  42614. m = A[C],
  42615. f.vertexColors.push(m.clone());
  42616. f.materialIndex = v.materialIndex + i,
  42617. s.push(f)
  42618. }
  42619. for (u = 0,
  42620. d = h.length; u < d; u++) {
  42621. var E = h[u]
  42622. , _ = [];
  42623. if (void 0 !== E) {
  42624. for (C = 0,
  42625. I = E.length; C < I; C++)
  42626. _.push(E[C].clone());
  42627. c.push(_)
  42628. }
  42629. }
  42630. } else
  42631. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42632. },
  42633. mergeMesh: function(e) {
  42634. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42635. void this.merge(e.geometry, e.matrix))
  42636. },
  42637. mergeVertices: function() {
  42638. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42639. for (i = 0,
  42640. n = this.vertices.length; i < n; i++)
  42641. e = this.vertices[i],
  42642. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42643. c.push(this.vertices[i]),
  42644. h[i] = c.length - 1) : h[i] = h[l[t]];
  42645. var d = [];
  42646. for (i = 0,
  42647. n = this.faces.length; i < n; i++) {
  42648. (r = this.faces[i]).a = h[r.a],
  42649. r.b = h[r.b],
  42650. r.c = h[r.c],
  42651. o = [r.a, r.b, r.c];
  42652. for (var p = 0; p < 3; p++)
  42653. if (o[p] === o[(p + 1) % 3]) {
  42654. p,
  42655. d.push(i);
  42656. break
  42657. }
  42658. }
  42659. for (i = d.length - 1; 0 <= i; i--) {
  42660. var f = d[i];
  42661. for (this.faces.splice(f, 1),
  42662. a = 0,
  42663. s = this.faceVertexUvs.length; a < s; a++)
  42664. this.faceVertexUvs[a].splice(f, 1)
  42665. }
  42666. var g = this.vertices.length - c.length;
  42667. return this.vertices = c,
  42668. g
  42669. },
  42670. sortFacesByMaterialIndex: function() {
  42671. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42672. e[i]._id = i;
  42673. e.sort(function(e, t) {
  42674. return e.materialIndex - t.materialIndex
  42675. });
  42676. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42677. o && o.length === t && (n = []),
  42678. a && a.length === t && (r = []);
  42679. for (i = 0; i < t; i++) {
  42680. var s = e[i]._id;
  42681. n && n.push(o[s]),
  42682. r && r.push(a[s])
  42683. }
  42684. n && (this.faceVertexUvs[0] = n),
  42685. r && (this.faceVertexUvs[1] = r)
  42686. },
  42687. toJSON: function() {
  42688. function e(e, t, i) {
  42689. return i ? e | 1 << t : e & ~(1 << t)
  42690. }
  42691. function t(e) {
  42692. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42693. return void 0 !== d[t] || (d[t] = u.length / 3,
  42694. u.push(e.x, e.y, e.z)),
  42695. d[t]
  42696. }
  42697. function i(e) {
  42698. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42699. return void 0 !== f[t] || (f[t] = p.length,
  42700. p.push(e.getHex())),
  42701. f[t]
  42702. }
  42703. function n(e) {
  42704. var t = e.x.toString() + e.y.toString();
  42705. return void 0 !== m[t] || (m[t] = g.length / 2,
  42706. g.push(e.x, e.y)),
  42707. m[t]
  42708. }
  42709. var r = {
  42710. metadata: {
  42711. version: 4.4,
  42712. type: "Geometry",
  42713. generator: "Geometry.toJSON"
  42714. }
  42715. };
  42716. if (r.uuid = this.uuid,
  42717. r.type = this.type,
  42718. "" !== this.name && (r.name = this.name),
  42719. void 0 !== this.parameters) {
  42720. var o = this.parameters;
  42721. for (var a in o)
  42722. void 0 !== o[a] && (r[a] = o[a]);
  42723. return r
  42724. }
  42725. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42726. var c = this.vertices[l];
  42727. s.push(c.x, c.y, c.z)
  42728. }
  42729. var h = []
  42730. , u = []
  42731. , d = {}
  42732. , p = []
  42733. , f = {}
  42734. , g = []
  42735. , m = {};
  42736. for (l = 0; l < this.faces.length; l++) {
  42737. var v = this.faces[l]
  42738. , y = void 0 !== this.faceVertexUvs[0][l]
  42739. , A = 0 < v.normal.length()
  42740. , C = 0 < v.vertexNormals.length
  42741. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42742. , E = 0 < v.vertexColors.length
  42743. , _ = 0;
  42744. 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),
  42745. h.push(_),
  42746. h.push(v.a, v.b, v.c),
  42747. h.push(v.materialIndex),
  42748. y) {
  42749. var b = this.faceVertexUvs[0][l];
  42750. h.push(n(b[0]), n(b[1]), n(b[2]))
  42751. }
  42752. if (A && h.push(t(v.normal)),
  42753. C) {
  42754. var w = v.vertexNormals;
  42755. h.push(t(w[0]), t(w[1]), t(w[2]))
  42756. }
  42757. if (I && h.push(i(v.color)),
  42758. E) {
  42759. var T = v.vertexColors;
  42760. h.push(i(T[0]), i(T[1]), i(T[2]))
  42761. }
  42762. }
  42763. return r.data = {},
  42764. r.data.vertices = s,
  42765. r.data.normals = u,
  42766. 0 < p.length && (r.data.colors = p),
  42767. 0 < g.length && (r.data.uvs = [g]),
  42768. r.data.faces = h,
  42769. r
  42770. },
  42771. clone: function() {
  42772. return (new Ci.Geometry).copy(this)
  42773. },
  42774. copy: function(e) {
  42775. this.vertices = [],
  42776. this.faces = [],
  42777. this.faceVertexUvs = [[]];
  42778. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42779. this.vertices.push(t[i].clone());
  42780. var r = e.faces;
  42781. for (i = 0,
  42782. n = r.length; i < n; i++)
  42783. this.faces.push(r[i].clone());
  42784. for (i = 0,
  42785. n = e.faceVertexUvs.length; i < n; i++) {
  42786. var o = e.faceVertexUvs[i];
  42787. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42788. for (var a = 0, s = o.length; a < s; a++) {
  42789. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42790. var d = l[h];
  42791. c.push(d.clone())
  42792. }
  42793. this.faceVertexUvs[i].push(c)
  42794. }
  42795. }
  42796. return this
  42797. },
  42798. dispose: function() {
  42799. this.dispatchEvent({
  42800. type: "dispose"
  42801. })
  42802. }
  42803. },
  42804. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42805. Ci.GeometryIdCount = 0,
  42806. Ci.DirectGeometry = function() {
  42807. Object.defineProperty(this, "id", {
  42808. value: Ci.GeometryIdCount++
  42809. }),
  42810. this.uuid = Ci.Math.generateUUID(),
  42811. this.name = "",
  42812. this.type = "DirectGeometry",
  42813. this.indices = [],
  42814. this.vertices = [],
  42815. this.normals = [],
  42816. this.colors = [],
  42817. this.uvs = [],
  42818. this.uvs2 = [],
  42819. this.groups = [],
  42820. this.morphTargets = {},
  42821. this.skinWeights = [],
  42822. this.skinIndices = [],
  42823. this.boundingBox = null,
  42824. this.boundingSphere = null,
  42825. this.verticesNeedUpdate = !1,
  42826. this.normalsNeedUpdate = !1,
  42827. this.colorsNeedUpdate = !1,
  42828. this.uvsNeedUpdate = !1,
  42829. this.groupsNeedUpdate = !1
  42830. }
  42831. ,
  42832. Ci.DirectGeometry.prototype = {
  42833. constructor: Ci.DirectGeometry,
  42834. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42835. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42836. computeFaceNormals: function() {
  42837. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42838. },
  42839. computeVertexNormals: function() {
  42840. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42841. },
  42842. computeGroups: function(e) {
  42843. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42844. var a = r[o];
  42845. a.materialIndex !== i && (i = a.materialIndex,
  42846. void 0 !== t && (t.count = 3 * o - t.start,
  42847. n.push(t)),
  42848. t = {
  42849. start: 3 * o,
  42850. materialIndex: i
  42851. })
  42852. }
  42853. void 0 !== t && (t.count = 3 * o - t.start,
  42854. n.push(t)),
  42855. this.groups = n
  42856. },
  42857. fromGeometry: function(e) {
  42858. 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;
  42859. if (0 < l) {
  42860. t = [];
  42861. for (var c = 0; c < l; c++)
  42862. t[c] = [];
  42863. this.morphTargets.position = t
  42864. }
  42865. var h, u = e.morphNormals, d = u.length;
  42866. if (0 < d) {
  42867. h = [];
  42868. for (c = 0; c < d; c++)
  42869. h[c] = [];
  42870. this.morphTargets.normal = h
  42871. }
  42872. var p = e.skinIndices
  42873. , f = e.skinWeights
  42874. , g = p.length === n.length
  42875. , m = f.length === n.length;
  42876. for (c = 0; c < i.length; c++) {
  42877. var v = i[c];
  42878. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42879. var y = v.vertexNormals;
  42880. if (3 === y.length)
  42881. this.normals.push(y[0], y[1], y[2]);
  42882. else {
  42883. var A = v.normal;
  42884. this.normals.push(A, A, A)
  42885. }
  42886. var C, I = v.vertexColors;
  42887. if (3 === I.length)
  42888. this.colors.push(I[0], I[1], I[2]);
  42889. else {
  42890. var E = v.color;
  42891. this.colors.push(E, E, E)
  42892. }
  42893. if (!0 === o)
  42894. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42895. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42896. if (!0 === a)
  42897. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42898. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42899. for (var _ = 0; _ < l; _++) {
  42900. var b = s[_].vertices;
  42901. t[_].push(b[v.a], b[v.b], b[v.c])
  42902. }
  42903. for (_ = 0; _ < d; _++) {
  42904. var w = u[_].vertexNormals[c];
  42905. h[_].push(w.a, w.b, w.c)
  42906. }
  42907. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42908. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42909. }
  42910. return this.computeGroups(e),
  42911. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42912. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42913. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42914. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42915. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42916. this
  42917. },
  42918. dispose: function() {
  42919. this.dispatchEvent({
  42920. type: "dispose"
  42921. })
  42922. }
  42923. },
  42924. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42925. Ci.BufferGeometry = function() {
  42926. Object.defineProperty(this, "id", {
  42927. value: Ci.GeometryIdCount++
  42928. }),
  42929. this.uuid = Ci.Math.generateUUID(),
  42930. this.name = "",
  42931. this.type = "BufferGeometry",
  42932. this.index = null,
  42933. this.attributes = {},
  42934. this.morphAttributes = {},
  42935. this.groups = [],
  42936. this.boundingBox = null,
  42937. this.boundingSphere = null,
  42938. this.drawRange = {
  42939. start: 0,
  42940. count: 1 / 0
  42941. }
  42942. }
  42943. ,
  42944. Ci.BufferGeometry.prototype = {
  42945. constructor: Ci.BufferGeometry,
  42946. getIndex: function() {
  42947. return this.index
  42948. },
  42949. setIndex: function(e) {
  42950. this.index = e
  42951. },
  42952. addAttribute: function(e, t) {
  42953. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42954. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42955. void this.setIndex(t)) : (this.attributes[e] = t,
  42956. this)
  42957. },
  42958. getAttribute: function(e) {
  42959. return this.attributes[e]
  42960. },
  42961. removeAttribute: function(e) {
  42962. return delete this.attributes[e],
  42963. this
  42964. },
  42965. addGroup: function(e, t, i) {
  42966. this.groups.push({
  42967. start: e,
  42968. count: t,
  42969. materialIndex: void 0 !== i ? i : 0
  42970. })
  42971. },
  42972. clearGroups: function() {
  42973. this.groups = []
  42974. },
  42975. setDrawRange: function(e, t) {
  42976. this.drawRange.start = e,
  42977. this.drawRange.count = t
  42978. },
  42979. applyMatrix: function(e) {
  42980. var t = this.attributes.position;
  42981. void 0 !== t && (e.applyToVector3Array(t.array),
  42982. t.needsUpdate = !0);
  42983. var i = this.attributes.normal;
  42984. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42985. i.needsUpdate = !0);
  42986. return null !== this.boundingBox && this.computeBoundingBox(),
  42987. null !== this.boundingSphere && this.computeBoundingSphere(),
  42988. this
  42989. },
  42990. rotateX: function(e) {
  42991. return void 0 === ht && (ht = new Ci.Matrix4),
  42992. ht.makeRotationX(e),
  42993. this.applyMatrix(ht),
  42994. this
  42995. },
  42996. rotateY: function(e) {
  42997. return void 0 === ct && (ct = new Ci.Matrix4),
  42998. ct.makeRotationY(e),
  42999. this.applyMatrix(ct),
  43000. this
  43001. },
  43002. rotateZ: function(e) {
  43003. return void 0 === lt && (lt = new Ci.Matrix4),
  43004. lt.makeRotationZ(e),
  43005. this.applyMatrix(lt),
  43006. this
  43007. },
  43008. translate: function(e, t, i) {
  43009. return void 0 === st && (st = new Ci.Matrix4),
  43010. st.makeTranslation(e, t, i),
  43011. this.applyMatrix(st),
  43012. this
  43013. },
  43014. scale: function(e, t, i) {
  43015. return void 0 === at && (at = new Ci.Matrix4),
  43016. at.makeScale(e, t, i),
  43017. this.applyMatrix(at),
  43018. this
  43019. },
  43020. lookAt: function(e) {
  43021. void 0 === ot && (ot = new Ci.Object3D),
  43022. ot.lookAt(e),
  43023. ot.updateMatrix(),
  43024. this.applyMatrix(ot.matrix)
  43025. },
  43026. center: function() {
  43027. this.computeBoundingBox();
  43028. var e = this.boundingBox.center().negate();
  43029. return this.translate(e.x, e.y, e.z),
  43030. e
  43031. },
  43032. setFromObject: function(e) {
  43033. var t = e.geometry;
  43034. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  43035. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  43036. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  43037. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  43038. this.addAttribute("color", n.copyColorsArray(t.colors)),
  43039. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  43040. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  43041. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  43042. }
  43043. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  43044. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  43045. } else
  43046. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  43047. return this
  43048. },
  43049. updateFromObject: function(e) {
  43050. var t, i = e.geometry;
  43051. if (e instanceof Ci.Mesh) {
  43052. var n = i.__directGeometry;
  43053. if (void 0 === n)
  43054. return this.fromGeometry(i);
  43055. n.verticesNeedUpdate = i.verticesNeedUpdate,
  43056. n.normalsNeedUpdate = i.normalsNeedUpdate,
  43057. n.colorsNeedUpdate = i.colorsNeedUpdate,
  43058. n.uvsNeedUpdate = i.uvsNeedUpdate,
  43059. n.groupsNeedUpdate = i.groupsNeedUpdate,
  43060. i.verticesNeedUpdate = !1,
  43061. i.normalsNeedUpdate = !1,
  43062. i.colorsNeedUpdate = !1,
  43063. i.uvsNeedUpdate = !1,
  43064. i.groupsNeedUpdate = !1,
  43065. i = n
  43066. }
  43067. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  43068. t.needsUpdate = !0),
  43069. i.verticesNeedUpdate = !1);
  43070. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  43071. t.needsUpdate = !0),
  43072. i.normalsNeedUpdate = !1);
  43073. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  43074. t.needsUpdate = !0),
  43075. i.colorsNeedUpdate = !1);
  43076. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  43077. t.needsUpdate = !0),
  43078. i.uvsNeedUpdate = !1);
  43079. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  43080. t.needsUpdate = !0),
  43081. i.lineDistancesNeedUpdate = !1);
  43082. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  43083. this.groups = i.groups,
  43084. i.groupsNeedUpdate = !1),
  43085. this
  43086. },
  43087. fromGeometry: function(e) {
  43088. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  43089. this.fromDirectGeometry(e.__directGeometry)
  43090. },
  43091. fromDirectGeometry: function(e) {
  43092. var t = new Float32Array(3 * e.vertices.length);
  43093. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  43094. 0 < e.normals.length) {
  43095. var i = new Float32Array(3 * e.normals.length);
  43096. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  43097. }
  43098. if (0 < e.colors.length) {
  43099. var n = new Float32Array(3 * e.colors.length);
  43100. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  43101. }
  43102. if (0 < e.uvs.length) {
  43103. var r = new Float32Array(2 * e.uvs.length);
  43104. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  43105. }
  43106. if (0 < e.uvs2.length) {
  43107. var o = new Float32Array(2 * e.uvs2.length);
  43108. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  43109. }
  43110. if (0 < e.indices.length) {
  43111. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  43112. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  43113. }
  43114. for (var s in this.groups = e.groups,
  43115. e.morphTargets) {
  43116. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  43117. var d = c[h]
  43118. , p = new Ci.Float32Attribute(3 * d.length,3);
  43119. l.push(p.copyVector3sArray(d))
  43120. }
  43121. this.morphAttributes[s] = l
  43122. }
  43123. if (0 < e.skinIndices.length) {
  43124. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  43125. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  43126. }
  43127. if (0 < e.skinWeights.length) {
  43128. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  43129. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  43130. }
  43131. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  43132. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  43133. this
  43134. },
  43135. computeBoundingBox: (new Ci.Vector3,
  43136. function() {
  43137. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  43138. var e = this.attributes.position.array;
  43139. e && this.boundingBox.setFromArray(e),
  43140. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  43141. this.boundingBox.max.set(0, 0, 0)),
  43142. (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)
  43143. }
  43144. ),
  43145. computeBoundingSphere: (nt = new Ci.Box3,
  43146. rt = new Ci.Vector3,
  43147. function() {
  43148. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  43149. var e = this.attributes.position.array;
  43150. if (e) {
  43151. var t = this.boundingSphere.center;
  43152. nt.setFromArray(e),
  43153. nt.center(t);
  43154. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  43155. rt.fromArray(e, n),
  43156. i = Math.max(i, t.distanceToSquared(rt));
  43157. this.boundingSphere.radius = Math.sqrt(i),
  43158. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  43159. }
  43160. }
  43161. ),
  43162. computeFaceNormals: function() {},
  43163. computeVertexNormals: function() {
  43164. var e = this.index
  43165. , t = this.attributes
  43166. , i = this.groups;
  43167. if (t.position) {
  43168. var n = t.position.array;
  43169. if (void 0 === t.normal)
  43170. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  43171. else
  43172. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  43173. r[o] = 0;
  43174. 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;
  43175. if (e) {
  43176. var m = e.array;
  43177. 0 === i.length && this.addGroup(0, m.length);
  43178. for (var v = 0, y = i.length; v < y; ++v) {
  43179. var A = i[v]
  43180. , C = A.start;
  43181. for (o = C,
  43182. a = C + A.count; o < a; o += 3)
  43183. s = 3 * m[o + 0],
  43184. l = 3 * m[o + 1],
  43185. c = 3 * m[o + 2],
  43186. u.fromArray(n, s),
  43187. d.fromArray(n, l),
  43188. p.fromArray(n, c),
  43189. f.subVectors(p, d),
  43190. g.subVectors(u, d),
  43191. f.cross(g),
  43192. h[s] += f.x,
  43193. h[1 + s] += f.y,
  43194. h[2 + s] += f.z,
  43195. h[l] += f.x,
  43196. h[1 + l] += f.y,
  43197. h[2 + l] += f.z,
  43198. h[c] += f.x,
  43199. h[1 + c] += f.y,
  43200. h[2 + c] += f.z
  43201. }
  43202. } else
  43203. for (o = 0,
  43204. a = n.length; o < a; o += 9)
  43205. u.fromArray(n, o),
  43206. d.fromArray(n, o + 3),
  43207. p.fromArray(n, o + 6),
  43208. f.subVectors(p, d),
  43209. g.subVectors(u, d),
  43210. f.cross(g),
  43211. h[o] = f.x,
  43212. h[o + 1] = f.y,
  43213. h[o + 2] = f.z,
  43214. h[o + 3] = f.x,
  43215. h[o + 4] = f.y,
  43216. h[o + 5] = f.z,
  43217. h[o + 6] = f.x,
  43218. h[o + 7] = f.y,
  43219. h[o + 8] = f.z;
  43220. this.normalizeNormals(),
  43221. t.normal.needsUpdate = !0
  43222. }
  43223. },
  43224. merge: function(e, t) {
  43225. if (e instanceof Ci.BufferGeometry != 0) {
  43226. void 0 === t && (t = 0);
  43227. var i = this.attributes;
  43228. for (var n in i)
  43229. if (void 0 !== e.attributes[n])
  43230. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  43231. l++)
  43232. r[l] = a[s];
  43233. return this
  43234. }
  43235. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  43236. },
  43237. normalizeNormals: function() {
  43238. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  43239. e = r[o],
  43240. t = r[o + 1],
  43241. i = r[o + 2],
  43242. n = 1 / Math.sqrt(e * e + t * t + i * i),
  43243. r[o] *= n,
  43244. r[o + 1] *= n,
  43245. r[o + 2] *= n
  43246. },
  43247. toNonIndexed: function() {
  43248. if (null === this.index)
  43249. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  43250. this;
  43251. var e = new Ci.BufferGeometry
  43252. , t = this.index.array
  43253. , i = this.attributes;
  43254. for (var n in i) {
  43255. 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++) {
  43256. l = t[h] * a;
  43257. for (var d = 0; d < a; d++)
  43258. s[c++] = o[l++]
  43259. }
  43260. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  43261. }
  43262. return e
  43263. },
  43264. toJSON: function() {
  43265. var e = {
  43266. metadata: {
  43267. version: 4.4,
  43268. type: "BufferGeometry",
  43269. generator: "BufferGeometry.toJSON"
  43270. }
  43271. };
  43272. if (e.uuid = this.uuid,
  43273. e.type = this.type,
  43274. "" !== this.name && (e.name = this.name),
  43275. void 0 !== this.parameters) {
  43276. var t = this.parameters;
  43277. for (var i in t)
  43278. void 0 !== t[i] && (e[i] = t[i]);
  43279. return e
  43280. }
  43281. e.data = {
  43282. attributes: {}
  43283. };
  43284. var n = this.index;
  43285. if (null !== n) {
  43286. var r = Array.prototype.slice.call(n.array);
  43287. e.data.index = {
  43288. type: n.array.constructor.name,
  43289. array: r
  43290. }
  43291. }
  43292. var o = this.attributes;
  43293. for (var i in o) {
  43294. var a = o[i];
  43295. r = Array.prototype.slice.call(a.array);
  43296. e.data.attributes[i] = {
  43297. itemSize: a.itemSize,
  43298. type: a.array.constructor.name,
  43299. array: r
  43300. }
  43301. }
  43302. var s = this.groups;
  43303. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  43304. var l = this.boundingSphere;
  43305. return null !== l && (e.data.boundingSphere = {
  43306. center: l.center.toArray(),
  43307. radius: l.radius
  43308. }),
  43309. e
  43310. },
  43311. clone: function() {
  43312. return (new Ci.BufferGeometry).copy(this)
  43313. },
  43314. copy: function(e) {
  43315. var t = e.index;
  43316. null !== t && this.setIndex(t.clone());
  43317. var i = e.attributes;
  43318. for (var n in i) {
  43319. var r = i[n];
  43320. this.addAttribute(n, r.clone())
  43321. }
  43322. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43323. var l = o[a];
  43324. this.addGroup(l.start, l.count)
  43325. }
  43326. return this
  43327. },
  43328. dispose: function() {
  43329. this.dispatchEvent({
  43330. type: "dispose"
  43331. })
  43332. }
  43333. },
  43334. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  43335. Ci.BufferGeometry.MaxIndex = 65535,
  43336. Ci.InstancedBufferGeometry = function() {
  43337. Ci.BufferGeometry.call(this),
  43338. this.type = "InstancedBufferGeometry",
  43339. this.maxInstancedCount = void 0
  43340. }
  43341. ,
  43342. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  43343. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  43344. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43345. this.groups.push({
  43346. start: e,
  43347. count: t,
  43348. instances: i
  43349. })
  43350. }
  43351. ,
  43352. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  43353. var t = e.index;
  43354. null !== t && this.setIndex(t.clone());
  43355. var i = e.attributes;
  43356. for (var n in i) {
  43357. var r = i[n];
  43358. this.addAttribute(n, r.clone())
  43359. }
  43360. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43361. var l = o[a];
  43362. this.addGroup(l.start, l.count, l.instances)
  43363. }
  43364. return this
  43365. }
  43366. ,
  43367. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  43368. Ci.Uniform = function(e, t) {
  43369. this.type = e,
  43370. this.value = t,
  43371. this.dynamic = !1
  43372. }
  43373. ,
  43374. Ci.Uniform.prototype = {
  43375. constructor: Ci.Uniform,
  43376. onUpdate: function(e) {
  43377. return this.dynamic = !0,
  43378. this.onUpdateCallback = e,
  43379. this
  43380. }
  43381. },
  43382. Ci.AnimationClip = function(e, t, i) {
  43383. this.name = e || Ci.Math.generateUUID(),
  43384. this.tracks = i,
  43385. this.duration = void 0 !== t ? t : -1,
  43386. this.duration < 0 && this.resetDuration(),
  43387. this.trim(),
  43388. this.optimize()
  43389. }
  43390. ,
  43391. Ci.AnimationClip.prototype = {
  43392. constructor: Ci.AnimationClip,
  43393. resetDuration: function() {
  43394. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  43395. var n = this.tracks[t];
  43396. e = Math.max(e, n.times[n.times.length - 1])
  43397. }
  43398. this.duration = e
  43399. },
  43400. trim: function() {
  43401. for (var e = 0; e < this.tracks.length; e++)
  43402. this.tracks[e].trim(0, this.duration);
  43403. return this
  43404. },
  43405. optimize: function() {
  43406. for (var e = 0; e < this.tracks.length; e++)
  43407. this.tracks[e].optimize();
  43408. return this
  43409. }
  43410. },
  43411. Object.assign(Ci.AnimationClip, {
  43412. parse: function(e) {
  43413. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  43414. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  43415. return new Ci.AnimationClip(e.name,e.duration,t)
  43416. },
  43417. toJSON: function(e) {
  43418. for (var t = [], i = e.tracks, n = {
  43419. name: e.name,
  43420. duration: e.duration,
  43421. tracks: t
  43422. }, r = 0, o = i.length; r !== o; ++r)
  43423. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  43424. return n
  43425. },
  43426. CreateFromMorphTargetSequence: function(e, t, i) {
  43427. for (var n = t.length, r = [], o = 0; o < n; o++) {
  43428. var a = []
  43429. , s = [];
  43430. a.push((o + n - 1) % n, o, (o + 1) % n),
  43431. s.push(0, 1, 0);
  43432. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  43433. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  43434. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  43435. 0 === a[0] && (a.push(n),
  43436. s.push(s[0])),
  43437. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  43438. }
  43439. return new Ci.AnimationClip(e,-1,r)
  43440. },
  43441. findByName: function(e, t) {
  43442. for (var i = 0; i < e.length; i++)
  43443. if (e[i].name === t)
  43444. return e[i];
  43445. return null
  43446. },
  43447. CreateClipsFromMorphTargetSequences: function(e, t) {
  43448. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  43449. var a = e[r]
  43450. , s = a.name.match(n);
  43451. if (s && 1 < s.length) {
  43452. var l = i[h = s[1]];
  43453. l || (i[h] = l = []),
  43454. l.push(a)
  43455. }
  43456. }
  43457. var c = [];
  43458. for (var h in i)
  43459. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  43460. return c
  43461. },
  43462. parseAnimation: function(e, t, i) {
  43463. if (!e)
  43464. return console.error(" no animation in JSONLoader data"),
  43465. null;
  43466. function n(e, t, i, n, r) {
  43467. if (0 !== i.length) {
  43468. var o = []
  43469. , a = [];
  43470. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  43471. 0 !== o.length && r.push(new e(t,o,a))
  43472. }
  43473. }
  43474. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  43475. var h = l[c].keys;
  43476. if (h && 0 != h.length)
  43477. if (h[0].morphTargets) {
  43478. for (var u = {}, d = 0; d < h.length; d++)
  43479. if (h[d].morphTargets)
  43480. for (var p = 0; p < h[d].morphTargets.length; p++)
  43481. u[h[d].morphTargets[p]] = -1;
  43482. for (var f in u) {
  43483. var g = []
  43484. , m = [];
  43485. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  43486. var v = h[d];
  43487. g.push(v.time),
  43488. m.push(v.morphTarget === f ? 1 : 0)
  43489. }
  43490. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  43491. }
  43492. a = u.length * (s || 1)
  43493. } else {
  43494. var y = ".bones[" + t[c].name + "]";
  43495. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43496. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43497. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43498. }
  43499. }
  43500. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43501. }
  43502. }),
  43503. Ci.AnimationMixer = function(e) {
  43504. this._root = e,
  43505. this._initMemoryManager(),
  43506. this._accuIndex = 0,
  43507. this.time = 0,
  43508. this.timeScale = 1
  43509. }
  43510. ,
  43511. Ci.AnimationMixer.prototype = {
  43512. constructor: Ci.AnimationMixer,
  43513. clipAction: function(e, t) {
  43514. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43515. if (void 0 !== a) {
  43516. var s = a.actionByRoot[n];
  43517. if (void 0 !== s)
  43518. return s;
  43519. if (o = (i = a.knownActions[0])._clip,
  43520. e !== r && e !== o)
  43521. throw new Error("Different clips with the same name detected!")
  43522. }
  43523. if (null === o)
  43524. return null;
  43525. var l = new Ci.AnimationMixer._Action(this,o,t);
  43526. return this._bindAction(l, i),
  43527. this._addInactiveAction(l, r, n),
  43528. l
  43529. },
  43530. existingAction: function(e, t) {
  43531. var i = (t || this._root).uuid
  43532. , n = "string" == typeof e ? e : e.name
  43533. , r = this._actionsByClip[n];
  43534. return void 0 !== r && r.actionByRoot[i] || null
  43535. },
  43536. stopAllAction: function() {
  43537. var e = this._actions
  43538. , t = this._nActiveActions
  43539. , i = this._bindings
  43540. , n = this._nActiveBindings;
  43541. this._nActiveActions = 0;
  43542. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43543. e[r].reset();
  43544. for (r = 0; r !== n; ++r)
  43545. i[r].useCount = 0;
  43546. return this
  43547. },
  43548. update: function(e) {
  43549. e *= this.timeScale;
  43550. 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) {
  43551. var s = t[a];
  43552. s.enabled && s._update(n, e, r, o)
  43553. }
  43554. var l = this._bindings
  43555. , c = this._nActiveBindings;
  43556. for (a = 0; a !== c; ++a)
  43557. l[a].apply(o);
  43558. return this
  43559. },
  43560. getRoot: function() {
  43561. return this._root
  43562. },
  43563. uncacheClip: function(e) {
  43564. var t = this._actions
  43565. , i = e.name
  43566. , n = this._actionsByClip
  43567. , r = n[i];
  43568. if (void 0 !== r) {
  43569. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43570. var l = o[a];
  43571. this._deactivateAction(l);
  43572. var c = l._cacheIndex
  43573. , h = t[t.length - 1];
  43574. l._cacheIndex = null,
  43575. l._byClipCacheIndex = null,
  43576. t[h._cacheIndex = c] = h,
  43577. t.pop(),
  43578. this._removeInactiveBindingsForAction(l)
  43579. }
  43580. delete n[i]
  43581. }
  43582. },
  43583. uncacheRoot: function(e) {
  43584. var t = e.uuid
  43585. , i = this._actionsByClip;
  43586. for (var n in i) {
  43587. var r = i[n].actionByRoot[t];
  43588. void 0 !== r && (this._deactivateAction(r),
  43589. this._removeInactiveAction(r))
  43590. }
  43591. var o = this._bindingsByRootAndName[t];
  43592. if (void 0 !== o)
  43593. for (var a in o) {
  43594. var s = o[a];
  43595. s.restoreOriginalState(),
  43596. this._removeInactiveBinding(s)
  43597. }
  43598. },
  43599. uncacheAction: function(e, t) {
  43600. var i = this.existingAction(e, t);
  43601. null !== i && (this._deactivateAction(i),
  43602. this._removeInactiveAction(i))
  43603. }
  43604. },
  43605. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43606. Ci.AnimationMixer._Action = function(e, t, i) {
  43607. this._mixer = e,
  43608. this._clip = t,
  43609. this._localRoot = i || null;
  43610. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43611. endingStart: Ci.ZeroCurvatureEnding,
  43612. endingEnd: Ci.ZeroCurvatureEnding
  43613. }, s = 0; s !== r; ++s) {
  43614. var l = n[s].createInterpolant(null);
  43615. (o[s] = l).settings = a
  43616. }
  43617. this._interpolantSettings = a,
  43618. this._interpolants = o,
  43619. this._propertyBindings = new Array(r),
  43620. this._cacheIndex = null,
  43621. this._byClipCacheIndex = null,
  43622. this._timeScaleInterpolant = null,
  43623. this._weightInterpolant = null,
  43624. this.loop = Ci.LoopRepeat,
  43625. this._loopCount = -1,
  43626. this._startTime = null,
  43627. this.time = 0,
  43628. this.timeScale = 1,
  43629. this._effectiveTimeScale = 1,
  43630. this.weight = 1,
  43631. this._effectiveWeight = 1,
  43632. this.repetitions = 1 / 0,
  43633. this.paused = !1,
  43634. this.enabled = !0,
  43635. this.clampWhenFinished = !1,
  43636. this.zeroSlopeAtStart = !0,
  43637. this.zeroSlopeAtEnd = !0
  43638. }
  43639. ,
  43640. Ci.AnimationMixer._Action.prototype = {
  43641. constructor: Ci.AnimationMixer._Action,
  43642. play: function() {
  43643. return this._mixer._activateAction(this),
  43644. this
  43645. },
  43646. stop: function() {
  43647. return this._mixer._deactivateAction(this),
  43648. this.reset()
  43649. },
  43650. reset: function() {
  43651. return this.paused = !1,
  43652. this.enabled = !0,
  43653. this.time = 0,
  43654. this._loopCount = -1,
  43655. this._startTime = null,
  43656. this.stopFading().stopWarping()
  43657. },
  43658. isRunning: function() {
  43659. return this._startTime,
  43660. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43661. },
  43662. isScheduled: function() {
  43663. return this._mixer._isActiveAction(this)
  43664. },
  43665. startAt: function(e) {
  43666. return this._startTime = e,
  43667. this
  43668. },
  43669. setLoop: function(e, t) {
  43670. return this.loop = e,
  43671. this.repetitions = t,
  43672. this
  43673. },
  43674. setEffectiveWeight: function(e) {
  43675. return this.weight = e,
  43676. this._effectiveWeight = this.enabled ? e : 0,
  43677. this.stopFading()
  43678. },
  43679. getEffectiveWeight: function() {
  43680. return this._effectiveWeight
  43681. },
  43682. fadeIn: function(e) {
  43683. return this._scheduleFading(e, 0, 1)
  43684. },
  43685. fadeOut: function(e) {
  43686. return this._scheduleFading(e, 1, 0)
  43687. },
  43688. crossFadeFrom: function(e, t, i) {
  43689. if (this._mixer,
  43690. e.fadeOut(t),
  43691. this.fadeIn(t),
  43692. i) {
  43693. var n = this._clip.duration
  43694. , r = e._clip.duration
  43695. , o = r / n
  43696. , a = n / r;
  43697. e.warp(1, o, t),
  43698. this.warp(a, 1, t)
  43699. }
  43700. return this
  43701. },
  43702. crossFadeTo: function(e, t, i) {
  43703. return e.crossFadeFrom(this, t, i)
  43704. },
  43705. stopFading: function() {
  43706. var e = this._weightInterpolant;
  43707. return null !== e && (this._weightInterpolant = null,
  43708. this._mixer._takeBackControlInterpolant(e)),
  43709. this
  43710. },
  43711. setEffectiveTimeScale: function(e) {
  43712. return this.timeScale = e,
  43713. this._effectiveTimeScale = this.paused ? 0 : e,
  43714. this.stopWarping()
  43715. },
  43716. getEffectiveTimeScale: function() {
  43717. return this._effectiveTimeScale
  43718. },
  43719. setDuration: function(e) {
  43720. return this.timeScale = this._clip.duration / e,
  43721. this.stopWarping()
  43722. },
  43723. syncWith: function(e) {
  43724. return this.time = e.time,
  43725. this.timeScale = e.timeScale,
  43726. this.stopWarping()
  43727. },
  43728. halt: function(e) {
  43729. return this.warp(this._currentTimeScale, 0, e)
  43730. },
  43731. warp: function(e, t, i) {
  43732. var n = this._mixer
  43733. , r = n.time
  43734. , o = this._timeScaleInterpolant
  43735. , a = this.timeScale;
  43736. null === o && (o = n._lendControlInterpolant(),
  43737. this._timeScaleInterpolant = o);
  43738. var s = o.parameterPositions
  43739. , l = o.sampleValues;
  43740. return s[0] = r,
  43741. s[1] = r + i,
  43742. l[0] = e / a,
  43743. l[1] = t / a,
  43744. this
  43745. },
  43746. stopWarping: function() {
  43747. var e = this._timeScaleInterpolant;
  43748. return null !== e && (this._timeScaleInterpolant = null,
  43749. this._mixer._takeBackControlInterpolant(e)),
  43750. this
  43751. },
  43752. getMixer: function() {
  43753. return this._mixer
  43754. },
  43755. getClip: function() {
  43756. return this._clip
  43757. },
  43758. getRoot: function() {
  43759. return this._localRoot || this._mixer._root
  43760. },
  43761. _update: function(e, t, i, n) {
  43762. var r = this._startTime;
  43763. if (null !== r) {
  43764. var o = (e - r) * i;
  43765. if (o < 0 || 0 === i)
  43766. return;
  43767. this._startTime = null,
  43768. t = i * o
  43769. }
  43770. t *= this._updateTimeScale(e);
  43771. var a = this._updateTime(t)
  43772. , s = this._updateWeight(e);
  43773. if (0 < s)
  43774. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43775. l[h].evaluate(a),
  43776. c[h].accumulate(n, s)
  43777. },
  43778. _updateWeight: function(e) {
  43779. var t = 0;
  43780. if (this.enabled) {
  43781. t = this.weight;
  43782. var i = this._weightInterpolant;
  43783. if (null !== i) {
  43784. var n = i.evaluate(e)[0];
  43785. t *= n,
  43786. e > i.parameterPositions[1] && (this.stopFading(),
  43787. 0 === n && (this.enabled = !1))
  43788. }
  43789. }
  43790. return this._effectiveWeight = t
  43791. },
  43792. _updateTimeScale: function(e) {
  43793. var t = 0;
  43794. if (!this.paused) {
  43795. t = this.timeScale;
  43796. var i = this._timeScaleInterpolant;
  43797. if (null !== i)
  43798. t *= i.evaluate(e)[0],
  43799. e > i.parameterPositions[1] && (this.stopWarping(),
  43800. 0 === t ? this.pause = !0 : this.timeScale = t)
  43801. }
  43802. return this._effectiveTimeScale = t
  43803. },
  43804. _updateTime: function(e) {
  43805. var t = this.time + e;
  43806. if (0 === e)
  43807. return t;
  43808. var i = this._clip.duration
  43809. , n = this.loop
  43810. , r = this._loopCount
  43811. , o = !1;
  43812. switch (n) {
  43813. case Ci.LoopOnce:
  43814. if (-1 === r && (this.loopCount = 0,
  43815. this._setEndings(!0, !0, !1)),
  43816. i <= t)
  43817. t = i;
  43818. else {
  43819. if (!(t < 0))
  43820. break;
  43821. t = 0
  43822. }
  43823. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43824. this._mixer.dispatchEvent({
  43825. type: "finished",
  43826. action: this,
  43827. direction: e < 0 ? -1 : 1
  43828. });
  43829. break;
  43830. case Ci.LoopPingPong:
  43831. o = !0;
  43832. case Ci.LoopRepeat:
  43833. if (-1 === r && (0 < e ? (r = 0,
  43834. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43835. i <= t || t < 0) {
  43836. var a = Math.floor(t / i);
  43837. t -= i * a,
  43838. r += Math.abs(a);
  43839. var s = this.repetitions - r;
  43840. if (s < 0) {
  43841. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43842. t = 0 < e ? i : 0,
  43843. this._mixer.dispatchEvent({
  43844. type: "finished",
  43845. action: this,
  43846. direction: 0 < e ? 1 : -1
  43847. });
  43848. break
  43849. }
  43850. if (0 == s) {
  43851. var l = e < 0;
  43852. this._setEndings(l, !l, o)
  43853. } else
  43854. this._setEndings(!1, !1, o);
  43855. this._loopCount = r,
  43856. this._mixer.dispatchEvent({
  43857. type: "loop",
  43858. action: this,
  43859. loopDelta: a
  43860. })
  43861. }
  43862. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43863. return i - (this.time = t)
  43864. }
  43865. return this.time = t
  43866. },
  43867. _setEndings: function(e, t, i) {
  43868. var n = this._interpolantSettings;
  43869. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43870. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43871. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43872. },
  43873. _scheduleFading: function(e, t, i) {
  43874. var n = this._mixer
  43875. , r = n.time
  43876. , o = this._weightInterpolant;
  43877. null === o && (o = n._lendControlInterpolant(),
  43878. this._weightInterpolant = o);
  43879. var a = o.parameterPositions
  43880. , s = o.sampleValues;
  43881. return a[0] = r,
  43882. s[0] = t,
  43883. a[1] = r + e,
  43884. s[1] = i,
  43885. this
  43886. }
  43887. },
  43888. Object.assign(Ci.AnimationMixer.prototype, {
  43889. _bindAction: function(e, t) {
  43890. var i = e._localRoot || this._root
  43891. , n = e._clip.tracks
  43892. , r = n.length
  43893. , o = e._propertyBindings
  43894. , a = e._interpolants
  43895. , s = i.uuid
  43896. , l = this._bindingsByRootAndName
  43897. , c = l[s];
  43898. void 0 === c && (c = {},
  43899. l[s] = c);
  43900. for (var h = 0; h !== r; ++h) {
  43901. var u = n[h]
  43902. , d = u.name
  43903. , p = c[d];
  43904. if (void 0 !== p)
  43905. o[h] = p;
  43906. else {
  43907. if (void 0 !== (p = o[h])) {
  43908. null === p._cacheIndex && (++p.referenceCount,
  43909. this._addInactiveBinding(p, s, d));
  43910. continue
  43911. }
  43912. var f = t && t._propertyBindings[h].binding.parsedPath;
  43913. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43914. this._addInactiveBinding(p, s, d),
  43915. o[h] = p
  43916. }
  43917. a[h].resultBuffer = p.buffer
  43918. }
  43919. },
  43920. _activateAction: function(e) {
  43921. if (!this._isActiveAction(e)) {
  43922. if (null === e._cacheIndex) {
  43923. var t = (e._localRoot || this._root).uuid
  43924. , i = e._clip.name
  43925. , n = this._actionsByClip[i];
  43926. this._bindAction(e, n && n.knownActions[0]),
  43927. this._addInactiveAction(e, i, t)
  43928. }
  43929. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43930. var s = r[o];
  43931. 0 == s.useCount++ && (this._lendBinding(s),
  43932. s.saveOriginalState())
  43933. }
  43934. this._lendAction(e)
  43935. }
  43936. },
  43937. _deactivateAction: function(e) {
  43938. if (this._isActiveAction(e)) {
  43939. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43940. var r = t[i];
  43941. 0 == --r.useCount && (r.restoreOriginalState(),
  43942. this._takeBackBinding(r))
  43943. }
  43944. this._takeBackAction(e)
  43945. }
  43946. },
  43947. _initMemoryManager: function() {
  43948. this._actions = [],
  43949. this._nActiveActions = 0,
  43950. this._actionsByClip = {},
  43951. this._bindings = [],
  43952. this._nActiveBindings = 0,
  43953. this._bindingsByRootAndName = {},
  43954. this._controlInterpolants = [],
  43955. this._nActiveControlInterpolants = 0;
  43956. var e = this;
  43957. this.stats = {
  43958. actions: {
  43959. get total() {
  43960. return e._actions.length
  43961. },
  43962. get inUse() {
  43963. return e._nActiveActions
  43964. }
  43965. },
  43966. bindings: {
  43967. get total() {
  43968. return e._bindings.length
  43969. },
  43970. get inUse() {
  43971. return e._nActiveBindings
  43972. }
  43973. },
  43974. controlInterpolants: {
  43975. get total() {
  43976. return e._controlInterpolants.length
  43977. },
  43978. get inUse() {
  43979. return e._nActiveControlInterpolants
  43980. }
  43981. }
  43982. }
  43983. },
  43984. _isActiveAction: function(e) {
  43985. var t = e._cacheIndex;
  43986. return null !== t && t < this._nActiveActions
  43987. },
  43988. _addInactiveAction: function(e, t, i) {
  43989. var n = this._actions
  43990. , r = this._actionsByClip
  43991. , o = r[t];
  43992. if (void 0 === o)
  43993. o = {
  43994. knownActions: [e],
  43995. actionByRoot: {}
  43996. },
  43997. e._byClipCacheIndex = 0,
  43998. r[t] = o;
  43999. else {
  44000. var a = o.knownActions;
  44001. e._byClipCacheIndex = a.length,
  44002. a.push(e)
  44003. }
  44004. e._cacheIndex = n.length,
  44005. n.push(e),
  44006. o.actionByRoot[i] = e
  44007. },
  44008. _removeInactiveAction: function(e) {
  44009. var t = this._actions
  44010. , i = t[t.length - 1]
  44011. , n = e._cacheIndex;
  44012. t[i._cacheIndex = n] = i,
  44013. t.pop(),
  44014. e._cacheIndex = null;
  44015. var r = e._clip.name
  44016. , o = this._actionsByClip
  44017. , a = o[r]
  44018. , s = a.knownActions
  44019. , l = s[s.length - 1]
  44020. , c = e._byClipCacheIndex;
  44021. s[l._byClipCacheIndex = c] = l,
  44022. s.pop(),
  44023. e._byClipCacheIndex = null,
  44024. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  44025. 0 === s.length && delete o[r],
  44026. this._removeInactiveBindingsForAction(e)
  44027. },
  44028. _removeInactiveBindingsForAction: function(e) {
  44029. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  44030. var r = t[i];
  44031. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  44032. }
  44033. },
  44034. _lendAction: function(e) {
  44035. var t = this._actions
  44036. , i = e._cacheIndex
  44037. , n = this._nActiveActions++
  44038. , r = t[n];
  44039. t[e._cacheIndex = n] = e,
  44040. t[r._cacheIndex = i] = r
  44041. },
  44042. _takeBackAction: function(e) {
  44043. var t = this._actions
  44044. , i = e._cacheIndex
  44045. , n = --this._nActiveActions
  44046. , r = t[n];
  44047. t[e._cacheIndex = n] = e,
  44048. t[r._cacheIndex = i] = r
  44049. },
  44050. _addInactiveBinding: function(e, t, i) {
  44051. var n = this._bindingsByRootAndName
  44052. , r = n[t]
  44053. , o = this._bindings;
  44054. void 0 === r && (r = {},
  44055. n[t] = r),
  44056. (r[i] = e)._cacheIndex = o.length,
  44057. o.push(e)
  44058. },
  44059. _removeInactiveBinding: function(e) {
  44060. var t = this._bindings
  44061. , i = e.binding
  44062. , n = i.rootNode.uuid
  44063. , r = i.path
  44064. , o = this._bindingsByRootAndName
  44065. , a = o[n]
  44066. , s = t[t.length - 1]
  44067. , l = e._cacheIndex;
  44068. t[s._cacheIndex = l] = s,
  44069. t.pop(),
  44070. delete a[r];
  44071. e: {
  44072. for (var c in a)
  44073. break e;
  44074. delete o[n]
  44075. }
  44076. },
  44077. _lendBinding: function(e) {
  44078. var t = this._bindings
  44079. , i = e._cacheIndex
  44080. , n = this._nActiveBindings++
  44081. , r = t[n];
  44082. t[e._cacheIndex = n] = e,
  44083. t[r._cacheIndex = i] = r
  44084. },
  44085. _takeBackBinding: function(e) {
  44086. var t = this._bindings
  44087. , i = e._cacheIndex
  44088. , n = --this._nActiveBindings
  44089. , r = t[n];
  44090. t[e._cacheIndex = n] = e,
  44091. t[r._cacheIndex = i] = r
  44092. },
  44093. _lendControlInterpolant: function() {
  44094. var e = this._controlInterpolants
  44095. , t = this._nActiveControlInterpolants++
  44096. , i = e[t];
  44097. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  44098. i
  44099. },
  44100. _takeBackControlInterpolant: function(e) {
  44101. var t = this._controlInterpolants
  44102. , i = e.__cacheIndex
  44103. , n = --this._nActiveControlInterpolants
  44104. , r = t[n];
  44105. t[e.__cacheIndex = n] = e,
  44106. t[r.__cacheIndex = i] = r
  44107. },
  44108. _controlInterpolantsResultBuffer: new Float32Array(1)
  44109. }),
  44110. Ci.AnimationObjectGroup = function(e) {
  44111. this.uuid = Ci.Math.generateUUID(),
  44112. this._objects = Array.prototype.slice.call(arguments),
  44113. this.nCachedObjects_ = 0;
  44114. var t = {};
  44115. this._indicesByUUID = t;
  44116. for (var i = 0, n = arguments.length; i !== n; ++i)
  44117. t[arguments[i].uuid] = i;
  44118. this._paths = [],
  44119. this._parsedPaths = [],
  44120. this._bindings = [],
  44121. this._bindingsIndicesByPath = {};
  44122. var r = this;
  44123. this.stats = {
  44124. objects: {
  44125. get total() {
  44126. return r._objects.length
  44127. },
  44128. get inUse() {
  44129. return this.total - r.nCachedObjects_
  44130. }
  44131. },
  44132. get bindingsPerObject() {
  44133. return r._bindings.length
  44134. }
  44135. }
  44136. }
  44137. ,
  44138. Ci.AnimationObjectGroup.prototype = {
  44139. constructor: Ci.AnimationObjectGroup,
  44140. add: function(e) {
  44141. 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) {
  44142. var u = arguments[c]
  44143. , d = u.uuid
  44144. , p = r[d];
  44145. if (void 0 === p) {
  44146. p = i++,
  44147. r[d] = p,
  44148. t.push(u);
  44149. for (var f = 0, g = l; f !== g; ++f)
  44150. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  44151. } else if (p < n) {
  44152. var m = t[p]
  44153. , v = --n
  44154. , y = t[v];
  44155. t[r[y.uuid] = p] = y,
  44156. t[r[d] = v] = u;
  44157. for (f = 0,
  44158. g = l; f !== g; ++f) {
  44159. var A = s[f]
  44160. , C = A[v]
  44161. , I = A[p];
  44162. A[p] = C,
  44163. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  44164. A[v] = I
  44165. }
  44166. } else
  44167. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  44168. }
  44169. this.nCachedObjects_ = n
  44170. },
  44171. remove: function(e) {
  44172. for (var t = this._objects, i = (t.length,
  44173. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  44174. var l = arguments[a]
  44175. , c = l.uuid
  44176. , h = n[c];
  44177. if (void 0 !== h && i <= h) {
  44178. var u = i++
  44179. , d = t[u];
  44180. t[n[d.uuid] = h] = d,
  44181. t[n[c] = u] = l;
  44182. for (var p = 0, f = o; p !== f; ++p) {
  44183. var g = r[p]
  44184. , m = g[u]
  44185. , v = g[h];
  44186. g[h] = m,
  44187. g[u] = v
  44188. }
  44189. }
  44190. }
  44191. this.nCachedObjects_ = i
  44192. },
  44193. uncache: function(e) {
  44194. 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) {
  44195. var c = arguments[s].uuid
  44196. , h = r[c];
  44197. if (void 0 !== h)
  44198. if (delete r[c],
  44199. h < n) {
  44200. var u = --n
  44201. , d = t[u]
  44202. , p = t[y = --i];
  44203. t[r[d.uuid] = h] = d,
  44204. t[r[p.uuid] = u] = p,
  44205. t.pop();
  44206. for (var f = 0, g = a; f !== g; ++f) {
  44207. var m = (A = o[f])[u]
  44208. , v = A[y];
  44209. A[h] = m,
  44210. A[u] = v,
  44211. A.pop()
  44212. }
  44213. } else {
  44214. var y;
  44215. t[r[(p = t[y = --i]).uuid] = h] = p,
  44216. t.pop();
  44217. for (f = 0,
  44218. g = a; f !== g; ++f) {
  44219. var A;
  44220. (A = o[f])[h] = A[y],
  44221. A.pop()
  44222. }
  44223. }
  44224. }
  44225. this.nCachedObjects_ = n
  44226. },
  44227. subscribe_: function(e, t) {
  44228. var i = this._bindingsIndicesByPath
  44229. , n = i[e]
  44230. , r = this._bindings;
  44231. if (void 0 !== n)
  44232. return r[n];
  44233. var o = this._paths
  44234. , a = this._parsedPaths
  44235. , s = this._objects
  44236. , l = s.length
  44237. , c = this.nCachedObjects_
  44238. , h = new Array(l);
  44239. n = r.length,
  44240. i[e] = n,
  44241. o.push(e),
  44242. a.push(t),
  44243. r.push(h);
  44244. for (var u = c, d = s.length; u !== d; ++u) {
  44245. var p = s[u];
  44246. h[u] = new Ci.PropertyBinding(p,e,t)
  44247. }
  44248. return h
  44249. },
  44250. unsubscribe_: function(e) {
  44251. var t = this._bindingsIndicesByPath
  44252. , i = t[e];
  44253. if (void 0 !== i) {
  44254. var n = this._paths
  44255. , r = this._parsedPaths
  44256. , o = this._bindings
  44257. , a = o.length - 1
  44258. , s = o[a];
  44259. o[t[e[a]] = i] = s,
  44260. o.pop(),
  44261. r[i] = r[a],
  44262. r.pop(),
  44263. n[i] = n[a],
  44264. n.pop()
  44265. }
  44266. }
  44267. },
  44268. Ci.AnimationUtils = {
  44269. arraySlice: function(e, t, i) {
  44270. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  44271. },
  44272. convertArray: function(e, t, i) {
  44273. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  44274. },
  44275. isTypedArray: function(e) {
  44276. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  44277. },
  44278. getKeyframeOrder: function(i) {
  44279. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  44280. t[n] = n;
  44281. return t.sort(function(e, t) {
  44282. return i[e] - i[t]
  44283. }),
  44284. t
  44285. },
  44286. sortedArray: function(e, t, i) {
  44287. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  44288. for (var s = i[o] * t, l = 0; l !== t; ++l)
  44289. r[a++] = e[s + l];
  44290. return r
  44291. },
  44292. flattenJSON: function(e, t, i, n) {
  44293. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  44294. o = e[r++];
  44295. if (void 0 !== o) {
  44296. var a = o[n];
  44297. if (void 0 !== a)
  44298. if (Array.isArray(a))
  44299. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44300. i.push.apply(i, a)),
  44301. void 0 !== (o = e[r++]); )
  44302. ;
  44303. else if (void 0 !== a.toArray)
  44304. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44305. a.toArray(i, i.length)),
  44306. void 0 !== (o = e[r++]); )
  44307. ;
  44308. else
  44309. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44310. i.push(a)),
  44311. void 0 !== (o = e[r++]); )
  44312. ;
  44313. }
  44314. }
  44315. },
  44316. Ci.KeyframeTrack = function(e, t, i, n) {
  44317. if (void 0 === e)
  44318. throw new Error("track name is undefined");
  44319. if (void 0 === t || 0 === t.length)
  44320. throw new Error("no keyframes in track named " + e);
  44321. this.name = e,
  44322. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  44323. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  44324. this.setInterpolation(n || this.DefaultInterpolation),
  44325. this.validate(),
  44326. this.optimize()
  44327. }
  44328. ,
  44329. Ci.KeyframeTrack.prototype = {
  44330. constructor: Ci.KeyframeTrack,
  44331. TimeBufferType: Float32Array,
  44332. ValueBufferType: Float32Array,
  44333. DefaultInterpolation: Ci.InterpolateLinear,
  44334. InterpolantFactoryMethodDiscrete: function(e) {
  44335. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  44336. },
  44337. InterpolantFactoryMethodLinear: function(e) {
  44338. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44339. },
  44340. InterpolantFactoryMethodSmooth: function(e) {
  44341. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  44342. },
  44343. setInterpolation: function(e) {
  44344. var t = void 0;
  44345. switch (e) {
  44346. case Ci.InterpolateDiscrete:
  44347. t = this.InterpolantFactoryMethodDiscrete;
  44348. break;
  44349. case Ci.InterpolateLinear:
  44350. t = this.InterpolantFactoryMethodLinear;
  44351. break;
  44352. case Ci.InterpolateSmooth:
  44353. t = this.InterpolantFactoryMethodSmooth
  44354. }
  44355. if (void 0 !== t)
  44356. this.createInterpolant = t;
  44357. else {
  44358. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  44359. if (void 0 === this.createInterpolant) {
  44360. if (e === this.DefaultInterpolation)
  44361. throw new Error(i);
  44362. this.setInterpolation(this.DefaultInterpolation)
  44363. }
  44364. console.warn(i)
  44365. }
  44366. },
  44367. getInterpolation: function() {
  44368. switch (this.createInterpolant) {
  44369. case this.InterpolantFactoryMethodDiscrete:
  44370. return Ci.InterpolateDiscrete;
  44371. case this.InterpolantFactoryMethodLinear:
  44372. return Ci.InterpolateLinear;
  44373. case this.InterpolantFactoryMethodSmooth:
  44374. return Ci.InterpolateSmooth
  44375. }
  44376. },
  44377. getValueSize: function() {
  44378. return this.values.length / this.times.length
  44379. },
  44380. shift: function(e) {
  44381. if (0 !== e)
  44382. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44383. t[i] += e;
  44384. return this
  44385. },
  44386. scale: function(e) {
  44387. if (1 !== e)
  44388. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44389. t[i] *= e;
  44390. return this
  44391. },
  44392. trim: function(e, t) {
  44393. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  44394. ++r;
  44395. for (; -1 !== o && i[o] > t; )
  44396. --o;
  44397. if (++o,
  44398. 0 !== r || o !== n) {
  44399. o <= r && (r = (o = Math.max(o, 1)) - 1);
  44400. var a = this.getValueSize();
  44401. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  44402. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  44403. }
  44404. return this
  44405. },
  44406. validate: function() {
  44407. var e = !0
  44408. , t = this.getValueSize();
  44409. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  44410. e = !1);
  44411. var i = this.times
  44412. , n = this.values
  44413. , r = i.length;
  44414. 0 === r && (console.error("track is empty", this),
  44415. e = !1);
  44416. for (var o = null, a = 0; a !== r; a++) {
  44417. var s = i[a];
  44418. if ("number" == typeof s && isNaN(s)) {
  44419. console.error("time is not a valid number", this, a, s),
  44420. e = !1;
  44421. break
  44422. }
  44423. if (null !== o && s < o) {
  44424. console.error("out of order keys", this, a, s, o),
  44425. e = !1;
  44426. break
  44427. }
  44428. o = s
  44429. }
  44430. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  44431. a = 0;
  44432. for (var l = n.length; a !== l; ++a) {
  44433. var c = n[a];
  44434. if (isNaN(c)) {
  44435. console.error("value is not a valid number", this, a, c),
  44436. e = !1;
  44437. break
  44438. }
  44439. }
  44440. }
  44441. return e
  44442. },
  44443. optimize: function() {
  44444. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  44445. var a = !1
  44446. , s = e[r];
  44447. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  44448. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  44449. var d = t[l + u];
  44450. if (d !== t[c + u] || d !== t[h + u]) {
  44451. a = !0;
  44452. break
  44453. }
  44454. }
  44455. if (a) {
  44456. if (r !== n) {
  44457. e[n] = e[r];
  44458. var p = r * i
  44459. , f = n * i;
  44460. for (u = 0; u !== i; ++u)
  44461. t[f + u] = t[p + u]
  44462. }
  44463. ++n
  44464. }
  44465. }
  44466. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  44467. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  44468. this
  44469. }
  44470. },
  44471. Object.assign(Ci.KeyframeTrack, {
  44472. parse: function(e) {
  44473. if (void 0 === e.type)
  44474. throw new Error("track type undefined, can not parse");
  44475. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44476. if (void 0 === e.times) {
  44477. console.warn("legacy JSON format detected, converting");
  44478. var i = []
  44479. , n = [];
  44480. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  44481. e.times = i,
  44482. e.values = n
  44483. }
  44484. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44485. },
  44486. toJSON: function(e) {
  44487. var t, i = e.constructor;
  44488. if (void 0 !== i.toJSON)
  44489. t = i.toJSON(e);
  44490. else {
  44491. t = {
  44492. name: e.name,
  44493. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44494. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44495. };
  44496. var n = e.getInterpolation();
  44497. n !== e.DefaultInterpolation && (t.interpolation = n)
  44498. }
  44499. return t.type = e.ValueTypeName,
  44500. t
  44501. },
  44502. _getTrackTypeForValueTypeName: function(e) {
  44503. switch (e.toLowerCase()) {
  44504. case "scalar":
  44505. case "double":
  44506. case "float":
  44507. case "number":
  44508. case "integer":
  44509. return Ci.NumberKeyframeTrack;
  44510. case "vector":
  44511. case "vector2":
  44512. case "vector3":
  44513. case "vector4":
  44514. return Ci.VectorKeyframeTrack;
  44515. case "color":
  44516. return Ci.ColorKeyframeTrack;
  44517. case "quaternion":
  44518. return Ci.QuaternionKeyframeTrack;
  44519. case "bool":
  44520. case "boolean":
  44521. return Ci.BooleanKeyframeTrack;
  44522. case "string":
  44523. return Ci.StringKeyframeTrack
  44524. }
  44525. throw new Error("Unsupported typeName: " + e)
  44526. }
  44527. }),
  44528. Ci.PropertyBinding = function(e, t, i) {
  44529. this.path = t,
  44530. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44531. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44532. this.rootNode = e
  44533. }
  44534. ,
  44535. Ci.PropertyBinding.prototype = {
  44536. constructor: Ci.PropertyBinding,
  44537. getValue: function(e, t) {
  44538. this.bind(),
  44539. this.getValue(e, t)
  44540. },
  44541. setValue: function(e, t) {
  44542. this.bind(),
  44543. this.setValue(e, t)
  44544. },
  44545. bind: function() {
  44546. var e = this.node
  44547. , t = this.parsedPath
  44548. , i = t.objectName
  44549. , n = t.propertyName
  44550. , r = t.propertyIndex;
  44551. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44552. this.node = e),
  44553. this.getValue = this._getValue_unavailable,
  44554. this.setValue = this._setValue_unavailable,
  44555. e) {
  44556. if (i) {
  44557. var o = t.objectIndex;
  44558. switch (i) {
  44559. case "materials":
  44560. if (!e.material)
  44561. return void console.error(" can not bind to material as node does not have a material", this);
  44562. if (!e.material.materials)
  44563. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44564. e = e.material.materials;
  44565. break;
  44566. case "bones":
  44567. if (!e.skeleton)
  44568. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44569. e = e.skeleton.bones;
  44570. for (var a = 0; a < e.length; a++)
  44571. if (e[a].name === o) {
  44572. o = a;
  44573. break
  44574. }
  44575. break;
  44576. default:
  44577. if (void 0 === e[i])
  44578. return void console.error(" can not bind to objectName of node, undefined", this);
  44579. e = e[i]
  44580. }
  44581. if (void 0 !== o) {
  44582. if (void 0 === e[o])
  44583. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44584. e = e[o]
  44585. }
  44586. }
  44587. var s = e[n];
  44588. if (s) {
  44589. var l = this.Versioning.None;
  44590. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44591. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44592. this.targetObject = e);
  44593. var c = this.BindingType.Direct;
  44594. if (void 0 !== r) {
  44595. if ("morphTargetInfluences" === n) {
  44596. if (!e.geometry)
  44597. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44598. if (!e.geometry.morphTargets)
  44599. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44600. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44601. if (e.geometry.morphTargets[a].name === r) {
  44602. r = a;
  44603. break
  44604. }
  44605. }
  44606. c = this.BindingType.ArrayElement,
  44607. this.resolvedProperty = s,
  44608. this.propertyIndex = r
  44609. } else
  44610. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44611. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44612. this.resolvedProperty = s) : this.propertyName = n;
  44613. this.getValue = this.GetterByBindingType[c],
  44614. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44615. } else {
  44616. var h = t.nodeName;
  44617. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44618. }
  44619. } else
  44620. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44621. },
  44622. unbind: function() {
  44623. this.node = null,
  44624. this.getValue = this._getValue_unbound,
  44625. this.setValue = this._setValue_unbound
  44626. }
  44627. },
  44628. Object.assign(Ci.PropertyBinding.prototype, {
  44629. _getValue_unavailable: function() {},
  44630. _setValue_unavailable: function() {},
  44631. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44632. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44633. BindingType: {
  44634. Direct: 0,
  44635. EntireArray: 1,
  44636. ArrayElement: 2,
  44637. HasFromToArray: 3
  44638. },
  44639. Versioning: {
  44640. None: 0,
  44641. NeedsUpdate: 1,
  44642. MatrixWorldNeedsUpdate: 2
  44643. },
  44644. GetterByBindingType: [function(e, t) {
  44645. e[t] = this.node[this.propertyName]
  44646. }
  44647. , function(e, t) {
  44648. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44649. e[t++] = i[n]
  44650. }
  44651. , function(e, t) {
  44652. e[t] = this.resolvedProperty[this.propertyIndex]
  44653. }
  44654. , function(e, t) {
  44655. this.resolvedProperty.toArray(e, t)
  44656. }
  44657. ],
  44658. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44659. this.node[this.propertyName] = e[t]
  44660. }
  44661. , function(e, t) {
  44662. this.node[this.propertyName] = e[t],
  44663. this.targetObject.needsUpdate = !0
  44664. }
  44665. , function(e, t) {
  44666. this.node[this.propertyName] = e[t],
  44667. this.targetObject.matrixWorldNeedsUpdate = !0
  44668. }
  44669. ], [function(e, t) {
  44670. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44671. i[n] = e[t++]
  44672. }
  44673. , function(e, t) {
  44674. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44675. i[n] = e[t++];
  44676. this.targetObject.needsUpdate = !0
  44677. }
  44678. , function(e, t) {
  44679. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44680. i[n] = e[t++];
  44681. this.targetObject.matrixWorldNeedsUpdate = !0
  44682. }
  44683. ], [function(e, t) {
  44684. this.resolvedProperty[this.propertyIndex] = e[t]
  44685. }
  44686. , function(e, t) {
  44687. this.resolvedProperty[this.propertyIndex] = e[t],
  44688. this.targetObject.needsUpdate = !0
  44689. }
  44690. , function(e, t) {
  44691. this.resolvedProperty[this.propertyIndex] = e[t],
  44692. this.targetObject.matrixWorldNeedsUpdate = !0
  44693. }
  44694. ], [function(e, t) {
  44695. this.resolvedProperty.fromArray(e, t)
  44696. }
  44697. , function(e, t) {
  44698. this.resolvedProperty.fromArray(e, t),
  44699. this.targetObject.needsUpdate = !0
  44700. }
  44701. , function(e, t) {
  44702. this.resolvedProperty.fromArray(e, t),
  44703. this.targetObject.matrixWorldNeedsUpdate = !0
  44704. }
  44705. ]]
  44706. }),
  44707. Ci.PropertyBinding.Composite = function(e, t, i) {
  44708. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44709. this._targetGroup = e,
  44710. this._bindings = e.subscribe_(t, n)
  44711. }
  44712. ,
  44713. Ci.PropertyBinding.Composite.prototype = {
  44714. constructor: Ci.PropertyBinding.Composite,
  44715. getValue: function(e, t) {
  44716. this.bind();
  44717. var i = this._targetGroup.nCachedObjects_
  44718. , n = this._bindings[i];
  44719. void 0 !== n && n.getValue(e, t)
  44720. },
  44721. setValue: function(e, t) {
  44722. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44723. i[n].setValue(e, t)
  44724. },
  44725. bind: function() {
  44726. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44727. e[t].bind()
  44728. },
  44729. unbind: function() {
  44730. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44731. e[t].unbind()
  44732. }
  44733. },
  44734. Ci.PropertyBinding.create = function(e, t, i) {
  44735. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44736. }
  44737. ,
  44738. Ci.PropertyBinding.parseTrackName = function(e) {
  44739. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44740. , i = t.exec(e);
  44741. if (!i)
  44742. throw new Error("cannot parse trackName at all: " + e);
  44743. i.index === t.lastIndex && t.lastIndex++;
  44744. var n = {
  44745. nodeName: i[3],
  44746. objectName: i[5],
  44747. objectIndex: i[7],
  44748. propertyName: i[9],
  44749. propertyIndex: i[11]
  44750. };
  44751. if (null === n.propertyName || 0 === n.propertyName.length)
  44752. throw new Error("can not parse propertyName from trackName: " + e);
  44753. return n
  44754. }
  44755. ,
  44756. Ci.PropertyBinding.findNode = function(e, r) {
  44757. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44758. return e;
  44759. if (e.skeleton) {
  44760. var t = function(e) {
  44761. for (var t = 0; t < e.bones.length; t++) {
  44762. var i = e.bones[t];
  44763. if (i.name === r)
  44764. return i
  44765. }
  44766. return null
  44767. }(e.skeleton);
  44768. if (t)
  44769. return t
  44770. }
  44771. if (e.children) {
  44772. var o = function(e) {
  44773. for (var t = 0; t < e.length; t++) {
  44774. var i = e[t];
  44775. if (i.name === r || i.uuid === r)
  44776. return i;
  44777. var n = o(i.children);
  44778. if (n)
  44779. return n
  44780. }
  44781. return null
  44782. }
  44783. , i = o(e.children);
  44784. if (i)
  44785. return i
  44786. }
  44787. return null
  44788. }
  44789. ,
  44790. Ci.PropertyMixer = function(e, t, i) {
  44791. this.binding = e,
  44792. this.valueSize = i;
  44793. var n, r = Float64Array;
  44794. switch (t) {
  44795. case "quaternion":
  44796. n = this._slerp;
  44797. break;
  44798. case "string":
  44799. case "bool":
  44800. r = Array,
  44801. n = this._select;
  44802. break;
  44803. default:
  44804. n = this._lerp
  44805. }
  44806. this.buffer = new r(4 * i),
  44807. this._mixBufferRegion = n,
  44808. this.cumulativeWeight = 0,
  44809. this.useCount = 0,
  44810. this.referenceCount = 0
  44811. }
  44812. ,
  44813. Ci.PropertyMixer.prototype = {
  44814. constructor: Ci.PropertyMixer,
  44815. accumulate: function(e, t) {
  44816. var i = this.buffer
  44817. , n = this.valueSize
  44818. , r = e * n + n
  44819. , o = this.cumulativeWeight;
  44820. if (0 === o) {
  44821. for (var a = 0; a !== n; ++a)
  44822. i[r + a] = i[a];
  44823. o = t
  44824. } else {
  44825. var s = t / (o += t);
  44826. this._mixBufferRegion(i, r, 0, s, n)
  44827. }
  44828. this.cumulativeWeight = o
  44829. },
  44830. apply: function(e) {
  44831. var t = this.valueSize
  44832. , i = this.buffer
  44833. , n = e * t + t
  44834. , r = this.cumulativeWeight
  44835. , o = this.binding;
  44836. if (this.cumulativeWeight = 0,
  44837. r < 1) {
  44838. var a = 3 * t;
  44839. this._mixBufferRegion(i, n, a, 1 - r, t)
  44840. }
  44841. for (var s = t, l = t + t; s !== l; ++s)
  44842. if (i[s] !== i[s + t]) {
  44843. o.setValue(i, n);
  44844. break
  44845. }
  44846. },
  44847. saveOriginalState: function() {
  44848. var e = this.binding
  44849. , t = this.buffer
  44850. , i = this.valueSize
  44851. , n = 3 * i;
  44852. e.getValue(t, n);
  44853. for (var r = i, o = n; r !== o; ++r)
  44854. t[r] = t[n + r % i];
  44855. this.cumulativeWeight = 0
  44856. },
  44857. restoreOriginalState: function() {
  44858. var e = 3 * this.valueSize;
  44859. this.binding.setValue(this.buffer, e)
  44860. },
  44861. _select: function(e, t, i, n, r) {
  44862. if (.5 <= n)
  44863. for (var o = 0; o !== r; ++o)
  44864. e[t + o] = e[i + o]
  44865. },
  44866. _slerp: function(e, t, i, n, r) {
  44867. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44868. },
  44869. _lerp: function(e, t, i, n, r) {
  44870. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44871. var s = t + a;
  44872. e[s] = e[s] * o + e[i + a] * n
  44873. }
  44874. }
  44875. },
  44876. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44877. Ci.KeyframeTrack.call(this, e, t, i)
  44878. }
  44879. ,
  44880. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44881. constructor: Ci.BooleanKeyframeTrack,
  44882. ValueTypeName: "bool",
  44883. ValueBufferType: Array,
  44884. DefaultInterpolation: Ci.IntepolateDiscrete,
  44885. InterpolantFactoryMethodLinear: void 0,
  44886. InterpolantFactoryMethodSmooth: void 0
  44887. }),
  44888. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44889. Ci.KeyframeTrack.call(this, e, t, i, n)
  44890. }
  44891. ,
  44892. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44893. constructor: Ci.NumberKeyframeTrack,
  44894. ValueTypeName: "number"
  44895. }),
  44896. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44897. Ci.KeyframeTrack.call(this, e, t, i, n)
  44898. }
  44899. ,
  44900. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44901. constructor: Ci.QuaternionKeyframeTrack,
  44902. ValueTypeName: "quaternion",
  44903. DefaultInterpolation: Ci.InterpolateLinear,
  44904. InterpolantFactoryMethodLinear: function(e) {
  44905. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44906. },
  44907. InterpolantFactoryMethodSmooth: void 0
  44908. }),
  44909. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44910. Ci.KeyframeTrack.call(this, e, t, i, n)
  44911. }
  44912. ,
  44913. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44914. constructor: Ci.StringKeyframeTrack,
  44915. ValueTypeName: "string",
  44916. ValueBufferType: Array,
  44917. DefaultInterpolation: Ci.IntepolateDiscrete,
  44918. InterpolantFactoryMethodLinear: void 0,
  44919. InterpolantFactoryMethodSmooth: void 0
  44920. }),
  44921. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44922. Ci.KeyframeTrack.call(this, e, t, i, n)
  44923. }
  44924. ,
  44925. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44926. constructor: Ci.VectorKeyframeTrack,
  44927. ValueTypeName: "vector"
  44928. }),
  44929. Ci.Audio = function(e) {
  44930. Ci.Object3D.call(this),
  44931. this.type = "Audio",
  44932. this.context = e.context,
  44933. this.source = this.context.createBufferSource(),
  44934. this.source.onended = this.onEnded.bind(this),
  44935. this.gain = this.context.createGain(),
  44936. this.gain.connect(e.getInput()),
  44937. this.autoplay = !1,
  44938. this.startTime = 0,
  44939. this.playbackRate = 1,
  44940. this.isPlaying = !1,
  44941. this.hasPlaybackControl = !0,
  44942. this.sourceType = "empty",
  44943. this.filter = null
  44944. }
  44945. ,
  44946. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44947. Ci.Audio.prototype.constructor = Ci.Audio,
  44948. Ci.Audio.prototype.getOutput = function() {
  44949. return this.gain
  44950. }
  44951. ,
  44952. Ci.Audio.prototype.load = function(e) {
  44953. var t = new Ci.AudioBuffer(this.context);
  44954. return t.load(e),
  44955. this.setBuffer(t),
  44956. this
  44957. }
  44958. ,
  44959. Ci.Audio.prototype.setNodeSource = function(e) {
  44960. return this.hasPlaybackControl = !1,
  44961. this.sourceType = "audioNode",
  44962. this.source = e,
  44963. this.connect(),
  44964. this
  44965. }
  44966. ,
  44967. Ci.Audio.prototype.setBuffer = function(e) {
  44968. var t = this;
  44969. return e.onReady(function(e) {
  44970. t.source.buffer = e,
  44971. t.sourceType = "buffer",
  44972. t.autoplay && t.play()
  44973. }),
  44974. this
  44975. }
  44976. ,
  44977. Ci.Audio.prototype.play = function() {
  44978. if (!0 !== this.isPlaying)
  44979. if (!1 !== this.hasPlaybackControl) {
  44980. var e = this.context.createBufferSource();
  44981. e.buffer = this.source.buffer,
  44982. e.loop = this.source.loop,
  44983. e.onended = this.source.onended,
  44984. e.start(0, this.startTime),
  44985. e.playbackRate.value = this.playbackRate,
  44986. this.isPlaying = !0,
  44987. this.source = e,
  44988. this.connect()
  44989. } else
  44990. console.warn("THREE.Audio: this Audio has no playback control.");
  44991. else
  44992. console.warn("THREE.Audio: Audio is already playing.")
  44993. }
  44994. ,
  44995. Ci.Audio.prototype.pause = function() {
  44996. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44997. void (this.startTime = this.context.currentTime))
  44998. }
  44999. ,
  45000. Ci.Audio.prototype.stop = function() {
  45001. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  45002. void (this.startTime = 0))
  45003. }
  45004. ,
  45005. Ci.Audio.prototype.connect = function() {
  45006. null !== this.filter ? (this.source.connect(this.filter),
  45007. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  45008. }
  45009. ,
  45010. Ci.Audio.prototype.disconnect = function() {
  45011. null !== this.filter ? (this.source.disconnect(this.filter),
  45012. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  45013. }
  45014. ,
  45015. Ci.Audio.prototype.getFilter = function() {
  45016. return this.filter
  45017. }
  45018. ,
  45019. Ci.Audio.prototype.setFilter = function(e) {
  45020. void 0 === e && (e = null),
  45021. !0 === this.isPlaying ? (this.disconnect(),
  45022. this.filter = e,
  45023. this.connect()) : this.filter = e
  45024. }
  45025. ,
  45026. Ci.Audio.prototype.setPlaybackRate = function(e) {
  45027. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  45028. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  45029. }
  45030. ,
  45031. Ci.Audio.prototype.getPlaybackRate = function() {
  45032. return this.playbackRate
  45033. }
  45034. ,
  45035. Ci.Audio.prototype.onEnded = function() {
  45036. this.isPlaying = !1
  45037. }
  45038. ,
  45039. Ci.Audio.prototype.setLoop = function(e) {
  45040. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  45041. }
  45042. ,
  45043. Ci.Audio.prototype.getLoop = function() {
  45044. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  45045. !1) : this.source.loop
  45046. }
  45047. ,
  45048. Ci.Audio.prototype.setVolume = function(e) {
  45049. this.gain.gain.value = e
  45050. }
  45051. ,
  45052. Ci.Audio.prototype.getVolume = function() {
  45053. return this.gain.gain.value
  45054. }
  45055. ,
  45056. Ci.AudioAnalyser = function(e, t) {
  45057. this.analyser = e.context.createAnalyser(),
  45058. this.analyser.fftSize = void 0 !== t ? t : 2048,
  45059. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  45060. e.getOutput().connect(this.analyser)
  45061. }
  45062. ,
  45063. Ci.AudioAnalyser.prototype = {
  45064. constructor: Ci.AudioAnalyser,
  45065. getData: function() {
  45066. return this.analyser.getByteFrequencyData(this.data),
  45067. this.data
  45068. }
  45069. },
  45070. Ci.AudioBuffer = function(e) {
  45071. this.context = e,
  45072. this.ready = !1,
  45073. this.readyCallbacks = []
  45074. }
  45075. ,
  45076. Ci.AudioBuffer.prototype.load = function(e) {
  45077. var i = this
  45078. , t = new XMLHttpRequest;
  45079. return t.open("GET", e, !0),
  45080. t.responseType = "arraybuffer",
  45081. t.onload = function(e) {
  45082. i.context.decodeAudioData(this.response, function(e) {
  45083. i.buffer = e,
  45084. i.ready = !0;
  45085. for (var t = 0; t < i.readyCallbacks.length; t++)
  45086. i.readyCallbacks[t](i.buffer);
  45087. i.readyCallbacks = []
  45088. })
  45089. }
  45090. ,
  45091. t.send(),
  45092. this
  45093. }
  45094. ,
  45095. Ci.AudioBuffer.prototype.onReady = function(e) {
  45096. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  45097. }
  45098. ,
  45099. Ci.PositionalAudio = function(e) {
  45100. Ci.Audio.call(this, e),
  45101. this.panner = this.context.createPanner(),
  45102. this.panner.connect(this.gain)
  45103. }
  45104. ,
  45105. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  45106. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  45107. Ci.PositionalAudio.prototype.getOutput = function() {
  45108. return this.panner
  45109. }
  45110. ,
  45111. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  45112. this.panner.refDistance = e
  45113. }
  45114. ,
  45115. Ci.PositionalAudio.prototype.getRefDistance = function() {
  45116. return this.panner.refDistance
  45117. }
  45118. ,
  45119. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  45120. this.panner.rolloffFactor = e
  45121. }
  45122. ,
  45123. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  45124. return this.panner.rolloffFactor
  45125. }
  45126. ,
  45127. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  45128. this.panner.distanceModel = e
  45129. }
  45130. ,
  45131. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  45132. return this.panner.distanceModel
  45133. }
  45134. ,
  45135. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  45136. this.panner.maxDistance = e
  45137. }
  45138. ,
  45139. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  45140. return this.panner.maxDistance
  45141. }
  45142. ,
  45143. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  45144. function(e) {
  45145. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  45146. it.setFromMatrixPosition(this.matrixWorld),
  45147. this.panner.setPosition(it.x, it.y, it.z)
  45148. }
  45149. ),
  45150. Ci.AudioListener = function() {
  45151. Ci.Object3D.call(this),
  45152. this.type = "AudioListener",
  45153. this.context = new (window.AudioContext || window.webkitAudioContext),
  45154. this.gain = this.context.createGain(),
  45155. this.gain.connect(this.context.destination),
  45156. this.filter = null
  45157. }
  45158. ,
  45159. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  45160. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  45161. Ci.AudioListener.prototype.getInput = function() {
  45162. return this.gain
  45163. }
  45164. ,
  45165. Ci.AudioListener.prototype.removeFilter = function() {
  45166. null !== this.filter && (this.gain.disconnect(this.filter),
  45167. this.filter.disconnect(this.context.destination),
  45168. this.gain.connect(this.context.destination),
  45169. this.filter = null)
  45170. }
  45171. ,
  45172. Ci.AudioListener.prototype.setFilter = function(e) {
  45173. null !== this.filter ? (this.gain.disconnect(this.filter),
  45174. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  45175. this.filter = e,
  45176. this.gain.connect(this.filter),
  45177. this.filter.connect(this.context.destination)
  45178. }
  45179. ,
  45180. Ci.AudioListener.prototype.getFilter = function() {
  45181. return this.filter
  45182. }
  45183. ,
  45184. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  45185. this.gain.gain.value = e
  45186. }
  45187. ,
  45188. Ci.AudioListener.prototype.getMasterVolume = function() {
  45189. return this.gain.gain.value
  45190. }
  45191. ,
  45192. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  45193. $e = new Ci.Quaternion,
  45194. et = new Ci.Vector3,
  45195. tt = new Ci.Vector3,
  45196. function(e) {
  45197. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  45198. var t = this.context.listener
  45199. , i = this.up;
  45200. this.matrixWorld.decompose(Je, $e, et),
  45201. tt.set(0, 0, -1).applyQuaternion($e),
  45202. t.setPosition(Je.x, Je.y, Je.z),
  45203. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  45204. }
  45205. ),
  45206. Ci.Camera = function() {
  45207. Ci.Object3D.call(this),
  45208. this.type = "Camera",
  45209. this.matrixWorldInverse = new Ci.Matrix4,
  45210. this.projectionMatrix = new Ci.Matrix4
  45211. }
  45212. ,
  45213. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  45214. Ci.Camera.prototype.constructor = Ci.Camera,
  45215. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  45216. function(e) {
  45217. var t = e || new Ci.Vector3;
  45218. return this.getWorldQuaternion(Qe),
  45219. t.set(0, 0, -1).applyQuaternion(Qe)
  45220. }
  45221. ),
  45222. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  45223. function(e) {
  45224. Ke.lookAt(this.position, e, this.up),
  45225. this.quaternion.setFromRotationMatrix(Ke)
  45226. }
  45227. ),
  45228. Ci.Camera.prototype.clone = function() {
  45229. return (new this.constructor).copy(this)
  45230. }
  45231. ,
  45232. Ci.Camera.prototype.copy = function(e) {
  45233. return Ci.Object3D.prototype.copy.call(this, e),
  45234. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  45235. this.projectionMatrix.copy(e.projectionMatrix),
  45236. this
  45237. }
  45238. ,
  45239. Ci.CubeCamera = function(e, t, i) {
  45240. Ci.Object3D.call(this),
  45241. this.type = "CubeCamera";
  45242. var r = new Ci.PerspectiveCamera(90,1,e,t);
  45243. r.up.set(0, -1, 0),
  45244. r.lookAt(new Ci.Vector3(1,0,0)),
  45245. this.add(r);
  45246. var o = new Ci.PerspectiveCamera(90,1,e,t);
  45247. o.up.set(0, -1, 0),
  45248. o.lookAt(new Ci.Vector3(-1,0,0)),
  45249. this.add(o);
  45250. var a = new Ci.PerspectiveCamera(90,1,e,t);
  45251. a.up.set(0, 0, 1),
  45252. a.lookAt(new Ci.Vector3(0,1,0)),
  45253. this.add(a);
  45254. var s = new Ci.PerspectiveCamera(90,1,e,t);
  45255. s.up.set(0, 0, -1),
  45256. s.lookAt(new Ci.Vector3(0,-1,0)),
  45257. this.add(s);
  45258. var l = new Ci.PerspectiveCamera(90,1,e,t);
  45259. l.up.set(0, -1, 0),
  45260. l.lookAt(new Ci.Vector3(0,0,1)),
  45261. this.add(l);
  45262. var c = new Ci.PerspectiveCamera(90,1,e,t);
  45263. c.up.set(0, -1, 0),
  45264. c.lookAt(new Ci.Vector3(0,0,-1)),
  45265. this.add(c);
  45266. var n = {
  45267. format: Ci.RGBFormat,
  45268. magFilter: Ci.LinearFilter,
  45269. minFilter: Ci.LinearFilter
  45270. };
  45271. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  45272. this.updateCubeMap = function(e, t) {
  45273. null === this.parent && this.updateMatrixWorld();
  45274. var i = this.renderTarget
  45275. , n = i.texture.generateMipmaps;
  45276. i.texture.generateMipmaps = !1,
  45277. i.activeCubeFace = 0,
  45278. e.render(t, r, i),
  45279. i.activeCubeFace = 1,
  45280. e.render(t, o, i),
  45281. i.activeCubeFace = 2,
  45282. e.render(t, a, i),
  45283. i.activeCubeFace = 3,
  45284. e.render(t, s, i),
  45285. i.activeCubeFace = 4,
  45286. e.render(t, l, i),
  45287. i.texture.generateMipmaps = n,
  45288. i.activeCubeFace = 5,
  45289. e.render(t, c, i),
  45290. e.setRenderTarget(null)
  45291. }
  45292. }
  45293. ,
  45294. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  45295. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  45296. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  45297. Ci.Camera.call(this),
  45298. this.type = "OrthographicCamera",
  45299. this.zoom = 1,
  45300. this.left = e,
  45301. this.right = t,
  45302. this.top = i,
  45303. this.bottom = n,
  45304. this.near = void 0 !== r ? r : .1,
  45305. this.far = void 0 !== o ? o : 2e3,
  45306. this.updateProjectionMatrix()
  45307. }
  45308. ,
  45309. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  45310. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  45311. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  45312. var e = (this.right - this.left) / (2 * this.zoom)
  45313. , t = (this.top - this.bottom) / (2 * this.zoom)
  45314. , i = (this.right + this.left) / 2
  45315. , n = (this.top + this.bottom) / 2;
  45316. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  45317. }
  45318. ,
  45319. Ci.OrthographicCamera.prototype.copy = function(e) {
  45320. return Ci.Camera.prototype.copy.call(this, e),
  45321. this.left = e.left,
  45322. this.right = e.right,
  45323. this.top = e.top,
  45324. this.bottom = e.bottom,
  45325. this.near = e.near,
  45326. this.far = e.far,
  45327. this.zoom = e.zoom,
  45328. this
  45329. }
  45330. ,
  45331. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  45332. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45333. return t.object.zoom = this.zoom,
  45334. t.object.left = this.left,
  45335. t.object.right = this.right,
  45336. t.object.top = this.top,
  45337. t.object.bottom = this.bottom,
  45338. t.object.near = this.near,
  45339. t.object.far = this.far,
  45340. t
  45341. }
  45342. ,
  45343. Ci.PerspectiveCamera = function(e, t, i, n) {
  45344. Ci.Camera.call(this),
  45345. this.type = "PerspectiveCamera",
  45346. this.focalLength = 10,
  45347. this.zoom = 1,
  45348. this.fov = void 0 !== e ? e : 50,
  45349. this.aspect = void 0 !== t ? t : 1,
  45350. this.near = void 0 !== i ? i : .1,
  45351. this.far = void 0 !== n ? n : 2e3,
  45352. this.updateProjectionMatrix()
  45353. }
  45354. ,
  45355. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  45356. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  45357. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  45358. void 0 === t && (t = 24),
  45359. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  45360. this.updateProjectionMatrix()
  45361. }
  45362. ,
  45363. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  45364. this.fullWidth = e,
  45365. this.fullHeight = t,
  45366. this.x = i,
  45367. this.y = n,
  45368. this.width = r,
  45369. this.height = o,
  45370. this.updateProjectionMatrix()
  45371. }
  45372. ,
  45373. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45374. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  45375. if (this.fullWidth) {
  45376. var t = this.fullWidth / this.fullHeight
  45377. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  45378. , n = -i
  45379. , r = t * n
  45380. , o = t * i
  45381. , a = Math.abs(o - r)
  45382. , s = Math.abs(i - n);
  45383. 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)
  45384. } else
  45385. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45386. }
  45387. ,
  45388. Ci.PerspectiveCamera.prototype.copy = function(e) {
  45389. return Ci.Camera.prototype.copy.call(this, e),
  45390. this.focalLength = e.focalLength,
  45391. this.zoom = e.zoom,
  45392. this.fov = e.fov,
  45393. this.aspect = e.aspect,
  45394. this.near = e.near,
  45395. this.far = e.far,
  45396. this
  45397. }
  45398. ,
  45399. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  45400. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45401. return t.object.focalLength = this.focalLength,
  45402. t.object.zoom = this.zoom,
  45403. t.object.fov = this.fov,
  45404. t.object.aspect = this.aspect,
  45405. t.object.near = this.near,
  45406. t.object.far = this.far,
  45407. t
  45408. }
  45409. ,
  45410. Ci.StereoCamera = function() {
  45411. this.type = "StereoCamera",
  45412. this.aspect = 1,
  45413. this.cameraL = new Ci.PerspectiveCamera,
  45414. this.cameraL.layers.enable(1),
  45415. this.cameraL.matrixAutoUpdate = !1,
  45416. this.cameraR = new Ci.PerspectiveCamera,
  45417. this.cameraR.layers.enable(2),
  45418. this.cameraR.matrixAutoUpdate = !1
  45419. }
  45420. ,
  45421. Ci.StereoCamera.prototype = {
  45422. constructor: Ci.StereoCamera,
  45423. update: (Xe = new Ci.Matrix4,
  45424. Ze = new Ci.Matrix4,
  45425. function(e) {
  45426. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  45427. Ge = e.focalLength,
  45428. We = e.fov,
  45429. je = e.aspect * this.aspect,
  45430. Ye = e.near,
  45431. qe = e.far;
  45432. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  45433. Ze.elements[12] = -.032,
  45434. Xe.elements[12] = .032,
  45435. t = -o * je + r,
  45436. i = o * je + r,
  45437. n.elements[0] = 2 * Ye / (i - t),
  45438. n.elements[8] = (i + t) / (i - t),
  45439. this.cameraL.projectionMatrix.copy(n),
  45440. t = -o * je - r,
  45441. i = o * je - r,
  45442. n.elements[0] = 2 * Ye / (i - t),
  45443. n.elements[8] = (i + t) / (i - t),
  45444. this.cameraR.projectionMatrix.copy(n)
  45445. }
  45446. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  45447. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  45448. }
  45449. )
  45450. },
  45451. Ci.Light = function(e, t) {
  45452. Ci.Object3D.call(this),
  45453. this.type = "Light",
  45454. this.color = new Ci.Color(e),
  45455. this.intensity = void 0 !== t ? t : 1,
  45456. this.receiveShadow = void 0
  45457. }
  45458. ,
  45459. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  45460. Ci.Light.prototype.constructor = Ci.Light,
  45461. Ci.Light.prototype.copy = function(e) {
  45462. return Ci.Object3D.prototype.copy.call(this, e),
  45463. this.color.copy(e.color),
  45464. this.intensity = e.intensity,
  45465. this
  45466. }
  45467. ,
  45468. Ci.Light.prototype.toJSON = function(e) {
  45469. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45470. return t.object.color = this.color.getHex(),
  45471. t.object.intensity = this.intensity,
  45472. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45473. void 0 !== this.distance && (t.object.distance = this.distance),
  45474. void 0 !== this.angle && (t.object.angle = this.angle),
  45475. void 0 !== this.decay && (t.object.decay = this.decay),
  45476. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45477. t
  45478. }
  45479. ,
  45480. Ci.LightShadow = function(e) {
  45481. this.camera = e,
  45482. this.bias = 0,
  45483. this.radius = 1,
  45484. this.mapSize = new Ci.Vector2(512,512),
  45485. this.map = null,
  45486. this.matrix = new Ci.Matrix4
  45487. }
  45488. ,
  45489. Ci.LightShadow.prototype = {
  45490. constructor: Ci.LightShadow,
  45491. copy: function(e) {
  45492. return this.camera = e.camera.clone(),
  45493. this.bias = e.bias,
  45494. this.radius = e.radius,
  45495. this.mapSize.copy(e.mapSize),
  45496. this
  45497. },
  45498. clone: function() {
  45499. return (new this.constructor).copy(this)
  45500. }
  45501. },
  45502. Ci.AmbientLight = function(e, t) {
  45503. Ci.Light.call(this, e, t),
  45504. this.type = "AmbientLight",
  45505. this.castShadow = void 0
  45506. }
  45507. ,
  45508. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45509. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45510. Ci.DirectionalLight = function(e, t) {
  45511. Ci.Light.call(this, e, t),
  45512. this.type = "DirectionalLight",
  45513. this.position.set(0, 1, 0),
  45514. this.updateMatrix(),
  45515. this.target = new Ci.Object3D,
  45516. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45517. }
  45518. ,
  45519. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45520. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45521. Ci.DirectionalLight.prototype.copy = function(e) {
  45522. return Ci.Light.prototype.copy.call(this, e),
  45523. this.target = e.target.clone(),
  45524. this.shadow = e.shadow.clone(),
  45525. this
  45526. }
  45527. ,
  45528. Ci.HemisphereLight = function(e, t, i) {
  45529. Ci.Light.call(this, e, i),
  45530. this.type = "HemisphereLight",
  45531. this.castShadow = void 0,
  45532. this.position.set(0, 1, 0),
  45533. this.updateMatrix(),
  45534. this.groundColor = new Ci.Color(t)
  45535. }
  45536. ,
  45537. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45538. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45539. Ci.HemisphereLight.prototype.copy = function(e) {
  45540. return Ci.Light.prototype.copy.call(this, e),
  45541. this.groundColor.copy(e.groundColor),
  45542. this
  45543. }
  45544. ,
  45545. Ci.PointLight = function(e, t, i, n) {
  45546. Ci.Light.call(this, e, t),
  45547. this.type = "PointLight",
  45548. this.distance = void 0 !== i ? i : 0,
  45549. this.decay = void 0 !== n ? n : 1,
  45550. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45551. }
  45552. ,
  45553. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45554. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45555. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45556. get: function() {
  45557. return 4 * this.intensity * Math.PI
  45558. },
  45559. set: function(e) {
  45560. this.intensity = e / (4 * Math.PI)
  45561. }
  45562. }),
  45563. Ci.PointLight.prototype.copy = function(e) {
  45564. return Ci.Light.prototype.copy.call(this, e),
  45565. this.distance = e.distance,
  45566. this.decay = e.decay,
  45567. this.shadow = e.shadow.clone(),
  45568. this
  45569. }
  45570. ,
  45571. Ci.SpotLight = function(e, t, i, n, r, o) {
  45572. Ci.Light.call(this, e, t),
  45573. this.type = "SpotLight",
  45574. this.position.set(0, 1, 0),
  45575. this.updateMatrix(),
  45576. this.target = new Ci.Object3D,
  45577. this.distance = void 0 !== i ? i : 0,
  45578. this.angle = void 0 !== n ? n : Math.PI / 3,
  45579. this.penumbra = void 0 !== r ? r : 0,
  45580. this.decay = void 0 !== o ? o : 1,
  45581. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45582. }
  45583. ,
  45584. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45585. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45586. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45587. get: function() {
  45588. return this.intensity * Math.PI
  45589. },
  45590. set: function(e) {
  45591. this.intensity = e / Math.PI
  45592. }
  45593. }),
  45594. Ci.SpotLight.prototype.copy = function(e) {
  45595. return Ci.Light.prototype.copy.call(this, e),
  45596. this.distance = e.distance,
  45597. this.angle = e.angle,
  45598. this.penumbra = e.penumbra,
  45599. this.decay = e.decay,
  45600. this.target = e.target.clone(),
  45601. this.shadow = e.shadow.clone(),
  45602. this
  45603. }
  45604. ,
  45605. Ci.Cache = {
  45606. enabled: !1,
  45607. files: {},
  45608. add: function(e, t) {
  45609. !1 !== this.enabled && (this.files[e] = t)
  45610. },
  45611. get: function(e) {
  45612. if (!1 !== this.enabled)
  45613. return this.files[e]
  45614. },
  45615. remove: function(e) {
  45616. delete this.files[e]
  45617. },
  45618. clear: function() {
  45619. this.files = {}
  45620. }
  45621. },
  45622. Ci.Loader = function() {
  45623. this.onLoadStart = function() {}
  45624. ,
  45625. this.onLoadProgress = function() {}
  45626. ,
  45627. this.onLoadComplete = function() {}
  45628. }
  45629. ,
  45630. Ci.Loader.prototype = {
  45631. constructor: Ci.Loader,
  45632. crossOrigin: void 0,
  45633. extractUrlBase: function(e) {
  45634. var t = e.split("/");
  45635. return 1 === t.length ? "./" : (t.pop(),
  45636. t.join("/") + "/")
  45637. },
  45638. initMaterials: function(e, t, i) {
  45639. for (var n = [], r = 0; r < e.length; ++r)
  45640. n[r] = this.createMaterial(e[r], t, i);
  45641. return n
  45642. },
  45643. createMaterial: function(e, c, h) {
  45644. function t(e, t, i, n, r) {
  45645. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45646. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45647. He.load(a)),
  45648. void 0 !== t && (o.repeat.fromArray(t),
  45649. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45650. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45651. void 0 !== i && o.offset.fromArray(i),
  45652. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45653. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45654. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45655. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45656. void 0 !== r && (o.anisotropy = r);
  45657. var l = Ci.Math.generateUUID();
  45658. return u[l] = o,
  45659. l
  45660. }
  45661. void 0 === Ue && (Ue = new Ci.Color),
  45662. void 0 === He && (He = new Ci.TextureLoader),
  45663. void 0 === ze && (ze = new Ci.MaterialLoader);
  45664. var u = {}
  45665. , i = {
  45666. uuid: Ci.Math.generateUUID(),
  45667. type: "MeshLambertMaterial"
  45668. };
  45669. for (var n in e) {
  45670. var r = e[n];
  45671. switch (n) {
  45672. case "DbgColor":
  45673. case "DbgIndex":
  45674. case "opticalDensity":
  45675. case "illumination":
  45676. break;
  45677. case "DbgName":
  45678. i.name = r;
  45679. break;
  45680. case "blending":
  45681. i.blending = Ci[r];
  45682. break;
  45683. case "colorAmbient":
  45684. case "mapAmbient":
  45685. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45686. break;
  45687. case "colorDiffuse":
  45688. i.color = Ue.fromArray(r).getHex();
  45689. break;
  45690. case "colorSpecular":
  45691. i.specular = Ue.fromArray(r).getHex();
  45692. break;
  45693. case "colorEmissive":
  45694. i.emissive = Ue.fromArray(r).getHex();
  45695. break;
  45696. case "specularCoef":
  45697. i.shininess = r;
  45698. break;
  45699. case "shading":
  45700. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45701. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45702. break;
  45703. case "mapDiffuse":
  45704. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45705. break;
  45706. case "mapDiffuseRepeat":
  45707. case "mapDiffuseOffset":
  45708. case "mapDiffuseWrap":
  45709. case "mapDiffuseAnisotropy":
  45710. break;
  45711. case "mapLight":
  45712. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45713. break;
  45714. case "mapLightRepeat":
  45715. case "mapLightOffset":
  45716. case "mapLightWrap":
  45717. case "mapLightAnisotropy":
  45718. break;
  45719. case "mapAO":
  45720. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45721. break;
  45722. case "mapAORepeat":
  45723. case "mapAOOffset":
  45724. case "mapAOWrap":
  45725. case "mapAOAnisotropy":
  45726. break;
  45727. case "mapBump":
  45728. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45729. break;
  45730. case "mapBumpScale":
  45731. i.bumpScale = r;
  45732. break;
  45733. case "mapBumpRepeat":
  45734. case "mapBumpOffset":
  45735. case "mapBumpWrap":
  45736. case "mapBumpAnisotropy":
  45737. break;
  45738. case "mapNormal":
  45739. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45740. break;
  45741. case "mapNormalFactor":
  45742. i.normalScale = [r, r];
  45743. break;
  45744. case "mapNormalRepeat":
  45745. case "mapNormalOffset":
  45746. case "mapNormalWrap":
  45747. case "mapNormalAnisotropy":
  45748. break;
  45749. case "mapSpecular":
  45750. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45751. break;
  45752. case "mapSpecularRepeat":
  45753. case "mapSpecularOffset":
  45754. case "mapSpecularWrap":
  45755. case "mapSpecularAnisotropy":
  45756. break;
  45757. case "mapAlpha":
  45758. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45759. break;
  45760. case "mapAlphaRepeat":
  45761. case "mapAlphaOffset":
  45762. case "mapAlphaWrap":
  45763. case "mapAlphaAnisotropy":
  45764. break;
  45765. case "flipSided":
  45766. i.side = Ci.BackSide;
  45767. break;
  45768. case "doubleSided":
  45769. i.side = Ci.DoubleSide;
  45770. break;
  45771. case "transparency":
  45772. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45773. i.opacity = r;
  45774. break;
  45775. case "depthTest":
  45776. case "depthWrite":
  45777. case "colorWrite":
  45778. case "opacity":
  45779. case "reflectivity":
  45780. case "transparent":
  45781. case "visible":
  45782. case "wireframe":
  45783. i[n] = r;
  45784. break;
  45785. case "vertexColors":
  45786. !0 === r && (i.vertexColors = Ci.VertexColors),
  45787. "face" === r && (i.vertexColors = Ci.FaceColors);
  45788. break;
  45789. default:
  45790. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45791. }
  45792. }
  45793. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45794. "MeshPhongMaterial" !== i.type && delete i.specular,
  45795. i.opacity < 1 && (i.transparent = !0),
  45796. ze.setTextures(u),
  45797. ze.parse(i)
  45798. }
  45799. },
  45800. Ci.Loader.Handlers = {
  45801. handlers: [],
  45802. add: function(e, t) {
  45803. this.handlers.push(e, t)
  45804. },
  45805. get: function(e) {
  45806. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45807. var r = t[i]
  45808. , o = t[i + 1];
  45809. if (r.test(e))
  45810. return o
  45811. }
  45812. return null
  45813. }
  45814. },
  45815. Ci.XHRLoader = function(e) {
  45816. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45817. }
  45818. ,
  45819. Ci.XHRLoader.prototype = {
  45820. constructor: Ci.XHRLoader,
  45821. load: function(i, n, t, r) {
  45822. void 0 !== this.path && (i = this.path + i);
  45823. var o = this
  45824. , e = Ci.Cache.get(i);
  45825. if (void 0 !== e)
  45826. return n && setTimeout(function() {
  45827. n(e)
  45828. }, 0),
  45829. e;
  45830. var a = new XMLHttpRequest;
  45831. return a.overrideMimeType("text/plain"),
  45832. a.open("GET", i, !0),
  45833. a.addEventListener("load", function(e) {
  45834. var t = e.target.response;
  45835. Ci.Cache.add(i, t),
  45836. 200 === this.status ? (n && n(t),
  45837. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45838. n && n(t),
  45839. o.manager.itemEnd(i)) : (r && r(e),
  45840. o.manager.itemError(i))
  45841. }, !1),
  45842. void 0 !== t && a.addEventListener("progress", function(e) {
  45843. t(e)
  45844. }, !1),
  45845. a.addEventListener("error", function(e) {
  45846. r && r(e),
  45847. o.manager.itemError(i)
  45848. }, !1),
  45849. void 0 !== this.responseType && (a.responseType = this.responseType),
  45850. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45851. a.send(null),
  45852. o.manager.itemStart(i),
  45853. a
  45854. },
  45855. setPath: function(e) {
  45856. this.path = e
  45857. },
  45858. setResponseType: function(e) {
  45859. this.responseType = e
  45860. },
  45861. setWithCredentials: function(e) {
  45862. this.withCredentials = e
  45863. }
  45864. },
  45865. Ci.FontLoader = function(e) {
  45866. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45867. }
  45868. ,
  45869. Ci.FontLoader.prototype = {
  45870. constructor: Ci.FontLoader,
  45871. load: function(e, t, i, n) {
  45872. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45873. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45874. }, i, n)
  45875. }
  45876. },
  45877. Ci.ImageLoader = function(e) {
  45878. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45879. }
  45880. ,
  45881. Ci.ImageLoader.prototype = {
  45882. constructor: Ci.ImageLoader,
  45883. load: function(t, i, n, r) {
  45884. void 0 !== this.path && (t = this.path + t);
  45885. var o = this
  45886. , e = Ci.Cache.get(t);
  45887. if (void 0 !== e)
  45888. return o.manager.itemStart(t),
  45889. i ? setTimeout(function() {
  45890. i(e),
  45891. o.manager.itemEnd(t)
  45892. }, 0) : o.manager.itemEnd(t),
  45893. e;
  45894. var a = document.createElement("img");
  45895. return a.addEventListener("load", function(e) {
  45896. Ci.Cache.add(t, this),
  45897. i && i(this),
  45898. o.manager.itemEnd(t)
  45899. }, !1),
  45900. void 0 !== n && a.addEventListener("progress", function(e) {
  45901. n(e)
  45902. }, !1),
  45903. a.addEventListener("error", function(e) {
  45904. r && r(e),
  45905. o.manager.itemError(t)
  45906. }, !1),
  45907. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45908. o.manager.itemStart(t),
  45909. a.src = t,
  45910. a
  45911. },
  45912. setCrossOrigin: function(e) {
  45913. this.crossOrigin = e
  45914. },
  45915. setPath: function(e) {
  45916. this.path = e
  45917. }
  45918. },
  45919. Ci.JSONLoader = function(e) {
  45920. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45921. e = void 0),
  45922. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45923. this.withCredentials = !1
  45924. }
  45925. ,
  45926. Ci.JSONLoader.prototype = {
  45927. constructor: Ci.JSONLoader,
  45928. get statusDomElement() {
  45929. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45930. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45931. this._statusDomElement
  45932. },
  45933. load: function(o, a, e, t) {
  45934. var s = this
  45935. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45936. , i = new Ci.XHRLoader(this.manager);
  45937. i.setWithCredentials(this.withCredentials),
  45938. i.load(o, function(e) {
  45939. var t = JSON.parse(e)
  45940. , i = t.metadata;
  45941. if (void 0 !== i) {
  45942. var n = i.type;
  45943. if (void 0 !== n) {
  45944. if ("object" === n.toLowerCase())
  45945. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45946. if ("scene" === n.toLowerCase())
  45947. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45948. }
  45949. }
  45950. var r = s.parse(t, l);
  45951. a(r.geometry, r.materials)
  45952. }, e, t)
  45953. },
  45954. setTexturePath: function(e) {
  45955. this.texturePath = e
  45956. },
  45957. parse: function(D, e) {
  45958. var N = new Ci.Geometry
  45959. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45960. if (function(e) {
  45961. function t(e, t) {
  45962. return e & 1 << t
  45963. }
  45964. 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;
  45965. if (void 0 !== D.uvs) {
  45966. for (i = 0; i < D.uvs.length; i++)
  45967. D.uvs[i].length && L++;
  45968. for (i = 0; i < L; i++)
  45969. N.faceVertexUvs[i] = []
  45970. }
  45971. for (o = 0,
  45972. a = R.length; o < a; )
  45973. (A = new Ci.Vector3).x = R[o++] * e,
  45974. A.y = R[o++] * e,
  45975. A.z = R[o++] * e,
  45976. N.vertices.push(A);
  45977. for (o = 0,
  45978. a = M.length; o < a; )
  45979. if (d = t(u = M[o++], 0),
  45980. p = t(u, 1),
  45981. f = t(u, 3),
  45982. g = t(u, 4),
  45983. m = t(u, 5),
  45984. v = t(u, 6),
  45985. y = t(u, 7),
  45986. d) {
  45987. if ((I = new Ci.Face3).a = M[o],
  45988. I.b = M[o + 1],
  45989. I.c = M[o + 3],
  45990. (E = new Ci.Face3).a = M[o + 1],
  45991. E.b = M[o + 2],
  45992. E.c = M[o + 3],
  45993. o += 4,
  45994. p && (h = M[o++],
  45995. I.materialIndex = h,
  45996. E.materialIndex = h),
  45997. r = N.faces.length,
  45998. f)
  45999. for (i = 0; i < L; i++)
  46000. for (w = D.uvs[i],
  46001. N.faceVertexUvs[i][r] = [],
  46002. N.faceVertexUvs[i][r + 1] = [],
  46003. n = 0; n < 4; n++)
  46004. x = w[2 * (c = M[o++])],
  46005. S = w[2 * c + 1],
  46006. T = new Ci.Vector2(x,S),
  46007. 2 !== n && N.faceVertexUvs[i][r].push(T),
  46008. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  46009. if (g && (l = 3 * M[o++],
  46010. I.normal.set(P[l++], P[l++], P[l]),
  46011. E.normal.copy(I.normal)),
  46012. m)
  46013. for (i = 0; i < 4; i++)
  46014. l = 3 * M[o++],
  46015. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  46016. 2 !== i && I.vertexNormals.push(b),
  46017. 0 !== i && E.vertexNormals.push(b);
  46018. if (v && (_ = O[s = M[o++]],
  46019. I.color.setHex(_),
  46020. E.color.setHex(_)),
  46021. y)
  46022. for (i = 0; i < 4; i++)
  46023. _ = O[s = M[o++]],
  46024. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  46025. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  46026. N.faces.push(I),
  46027. N.faces.push(E)
  46028. } else {
  46029. if ((C = new Ci.Face3).a = M[o++],
  46030. C.b = M[o++],
  46031. C.c = M[o++],
  46032. p && (h = M[o++],
  46033. C.materialIndex = h),
  46034. r = N.faces.length,
  46035. f)
  46036. for (i = 0; i < L; i++)
  46037. for (w = D.uvs[i],
  46038. N.faceVertexUvs[i][r] = [],
  46039. n = 0; n < 3; n++)
  46040. x = w[2 * (c = M[o++])],
  46041. S = w[2 * c + 1],
  46042. T = new Ci.Vector2(x,S),
  46043. N.faceVertexUvs[i][r].push(T);
  46044. if (g && (l = 3 * M[o++],
  46045. C.normal.set(P[l++], P[l++], P[l])),
  46046. m)
  46047. for (i = 0; i < 3; i++)
  46048. l = 3 * M[o++],
  46049. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  46050. C.vertexNormals.push(b);
  46051. if (v && (s = M[o++],
  46052. C.color.setHex(O[s])),
  46053. y)
  46054. for (i = 0; i < 3; i++)
  46055. s = M[o++],
  46056. C.vertexColors.push(new Ci.Color(O[s]));
  46057. N.faces.push(C)
  46058. }
  46059. }(t),
  46060. function() {
  46061. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  46062. if (D.skinWeights)
  46063. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  46064. var n = D.skinWeights[t]
  46065. , r = 1 < e ? D.skinWeights[t + 1] : 0
  46066. , o = 2 < e ? D.skinWeights[t + 2] : 0
  46067. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  46068. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  46069. }
  46070. if (D.skinIndices)
  46071. for (t = 0,
  46072. i = D.skinIndices.length; t < i; t += e) {
  46073. var s = D.skinIndices[t]
  46074. , l = 1 < e ? D.skinIndices[t + 1] : 0
  46075. , c = 2 < e ? D.skinIndices[t + 2] : 0
  46076. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  46077. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  46078. }
  46079. N.bones = D.bones,
  46080. 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.")
  46081. }(),
  46082. function(e) {
  46083. if (void 0 !== D.morphTargets)
  46084. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  46085. N.morphTargets[t] = {},
  46086. N.morphTargets[t].name = D.morphTargets[t].name,
  46087. N.morphTargets[t].vertices = [];
  46088. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  46089. var s = new Ci.Vector3;
  46090. s.x = r[o] * e,
  46091. s.y = r[o + 1] * e,
  46092. s.z = r[o + 2] * e,
  46093. n.push(s)
  46094. }
  46095. }
  46096. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  46097. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  46098. var l = N.faces
  46099. , c = D.morphColors[0].colors;
  46100. for (t = 0,
  46101. i = l.length; t < i; t++)
  46102. l[t].color.fromArray(c, 3 * t)
  46103. }
  46104. }(t),
  46105. function() {
  46106. var e = []
  46107. , t = [];
  46108. void 0 !== D.animation && t.push(D.animation),
  46109. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  46110. for (var i = 0; i < t.length; i++) {
  46111. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  46112. n && e.push(n)
  46113. }
  46114. if (N.morphTargets) {
  46115. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  46116. e = e.concat(r)
  46117. }
  46118. 0 < e.length && (N.animations = e)
  46119. }(),
  46120. N.computeFaceNormals(),
  46121. N.computeBoundingSphere(),
  46122. void 0 === D.materials || 0 === D.materials.length)
  46123. return {
  46124. geometry: N
  46125. };
  46126. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  46127. return {
  46128. geometry: N,
  46129. materials: i
  46130. }
  46131. }
  46132. },
  46133. Ci.LoadingManager = function(e, t, i) {
  46134. var n = this
  46135. , r = !1
  46136. , o = 0
  46137. , a = 0;
  46138. this.onStart = void 0,
  46139. this.onLoad = e,
  46140. this.onProgress = t,
  46141. this.onError = i,
  46142. this.itemStart = function(e) {
  46143. a++,
  46144. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  46145. r = !0
  46146. }
  46147. ,
  46148. this.itemEnd = function(e) {
  46149. o++,
  46150. void 0 !== n.onProgress && n.onProgress(e, o, a),
  46151. o === a && (r = !1,
  46152. void 0 !== n.onLoad && n.onLoad())
  46153. }
  46154. ,
  46155. this.itemError = function(e) {
  46156. void 0 !== n.onError && n.onError(e)
  46157. }
  46158. }
  46159. ,
  46160. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  46161. Ci.BufferGeometryLoader = function(e) {
  46162. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46163. }
  46164. ,
  46165. Ci.BufferGeometryLoader.prototype = {
  46166. constructor: Ci.BufferGeometryLoader,
  46167. load: function(e, t, i, n) {
  46168. var r = this;
  46169. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46170. t(r.parse(JSON.parse(e)))
  46171. }, i, n)
  46172. },
  46173. parse: function(e) {
  46174. var t = new Ci.BufferGeometry
  46175. , i = e.data.index
  46176. , n = {
  46177. Int8Array: Int8Array,
  46178. Uint8Array: Uint8Array,
  46179. Uint8ClampedArray: Uint8ClampedArray,
  46180. Int16Array: Int16Array,
  46181. Uint16Array: Uint16Array,
  46182. Int32Array: Int32Array,
  46183. Uint32Array: Uint32Array,
  46184. Float32Array: Float32Array,
  46185. Float64Array: Float64Array
  46186. };
  46187. if (void 0 !== i) {
  46188. var r = new n[i.type](i.array);
  46189. t.setIndex(new Ci.BufferAttribute(r,1))
  46190. }
  46191. var o = e.data.attributes;
  46192. for (var a in o) {
  46193. var s = o[a];
  46194. r = new n[s.type](s.array);
  46195. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  46196. }
  46197. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  46198. if (void 0 !== l)
  46199. for (var c = 0, h = l.length; c !== h; ++c) {
  46200. var u = l[c];
  46201. t.addGroup(u.start, u.count, u.materialIndex)
  46202. }
  46203. var d = e.data.boundingSphere;
  46204. if (void 0 !== d) {
  46205. var p = new Ci.Vector3;
  46206. void 0 !== d.center && p.fromArray(d.center),
  46207. t.boundingSphere = new Ci.Sphere(p,d.radius)
  46208. }
  46209. return t
  46210. }
  46211. },
  46212. Ci.MaterialLoader = function(e) {
  46213. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46214. this.textures = {}
  46215. }
  46216. ,
  46217. Ci.MaterialLoader.prototype = {
  46218. constructor: Ci.MaterialLoader,
  46219. load: function(e, t, i, n) {
  46220. var r = this;
  46221. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46222. t(r.parse(JSON.parse(e)))
  46223. }, i, n)
  46224. },
  46225. setTextures: function(e) {
  46226. this.textures = e
  46227. },
  46228. getTexture: function(e) {
  46229. var t = this.textures;
  46230. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  46231. t[e]
  46232. },
  46233. parse: function(e) {
  46234. var t = new Ci[e.type];
  46235. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  46236. void 0 !== e.name && (t.name = e.name),
  46237. void 0 !== e.color && t.color.setHex(e.color),
  46238. void 0 !== e.roughness && (t.roughness = e.roughness),
  46239. void 0 !== e.metalness && (t.metalness = e.metalness),
  46240. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  46241. void 0 !== e.specular && t.specular.setHex(e.specular),
  46242. void 0 !== e.shininess && (t.shininess = e.shininess),
  46243. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  46244. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  46245. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  46246. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  46247. void 0 !== e.shading && (t.shading = e.shading),
  46248. void 0 !== e.blending && (t.blending = e.blending),
  46249. void 0 !== e.side && (t.side = e.side),
  46250. void 0 !== e.opacity && (t.opacity = e.opacity),
  46251. void 0 !== e.transparent && (t.transparent = e.transparent),
  46252. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  46253. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  46254. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  46255. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  46256. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  46257. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  46258. void 0 !== e.size && (t.size = e.size),
  46259. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  46260. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  46261. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  46262. t.transparent = !0),
  46263. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  46264. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  46265. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  46266. void 0 !== e.normalScale) {
  46267. var i = e.normalScale;
  46268. !1 === Array.isArray(i) && (i = [i, i]),
  46269. t.normalScale = (new Ci.Vector2).fromArray(i)
  46270. }
  46271. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  46272. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  46273. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  46274. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  46275. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  46276. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  46277. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  46278. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  46279. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  46280. t.combine = Ci.MultiplyOperation),
  46281. e.reflectivity && (t.reflectivity = e.reflectivity),
  46282. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  46283. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  46284. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  46285. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  46286. void 0 !== e.materials)
  46287. for (var n = 0, r = e.materials.length; n < r; n++)
  46288. t.materials.push(this.parse(e.materials[n]));
  46289. return t
  46290. }
  46291. },
  46292. Ci.ObjectLoader = function(e) {
  46293. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46294. this.texturePath = ""
  46295. }
  46296. ,
  46297. Ci.ObjectLoader.prototype = {
  46298. constructor: Ci.ObjectLoader,
  46299. load: function(e, t, i, n) {
  46300. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  46301. var r = this;
  46302. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46303. r.parse(JSON.parse(e), t)
  46304. }, i, n)
  46305. },
  46306. setTexturePath: function(e) {
  46307. this.texturePath = e
  46308. },
  46309. setCrossOrigin: function(e) {
  46310. this.crossOrigin = e
  46311. },
  46312. parse: function(e, t) {
  46313. var i = this.parseGeometries(e.geometries)
  46314. , n = this.parseImages(e.images, function() {
  46315. void 0 !== t && t(a)
  46316. })
  46317. , r = this.parseTextures(e.textures, n)
  46318. , o = this.parseMaterials(e.materials, r)
  46319. , a = this.parseObject(e.object, i, o);
  46320. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  46321. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  46322. a
  46323. },
  46324. parseGeometries: function(e) {
  46325. var t = {};
  46326. if (void 0 !== e)
  46327. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  46328. var a, s = e[r];
  46329. switch (s.type) {
  46330. case "PlaneGeometry":
  46331. case "PlaneBufferGeometry":
  46332. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  46333. break;
  46334. case "BoxGeometry":
  46335. case "BoxBufferGeometry":
  46336. case "CubeGeometry":
  46337. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  46338. break;
  46339. case "CircleGeometry":
  46340. case "CircleBufferGeometry":
  46341. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  46342. break;
  46343. case "CylinderGeometry":
  46344. case "CylinderBufferGeometry":
  46345. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  46346. break;
  46347. case "SphereGeometry":
  46348. case "SphereBufferGeometry":
  46349. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  46350. break;
  46351. case "DodecahedronGeometry":
  46352. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  46353. break;
  46354. case "IcosahedronGeometry":
  46355. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  46356. break;
  46357. case "OctahedronGeometry":
  46358. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  46359. break;
  46360. case "TetrahedronGeometry":
  46361. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  46362. break;
  46363. case "RingGeometry":
  46364. case "RingBufferGeometry":
  46365. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  46366. break;
  46367. case "TorusGeometry":
  46368. case "TorusBufferGeometry":
  46369. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  46370. break;
  46371. case "TorusKnotGeometry":
  46372. case "TorusKnotBufferGeometry":
  46373. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  46374. break;
  46375. case "LatheGeometry":
  46376. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  46377. break;
  46378. case "BufferGeometry":
  46379. a = n.parse(s);
  46380. break;
  46381. case "Geometry":
  46382. a = i.parse(s.data, this.texturePath).geometry;
  46383. break;
  46384. default:
  46385. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  46386. continue
  46387. }
  46388. a.uuid = s.uuid,
  46389. void 0 !== s.name && (a.name = s.name),
  46390. t[s.uuid] = a
  46391. }
  46392. return t
  46393. },
  46394. parseMaterials: function(e, t) {
  46395. var i = {};
  46396. if (void 0 !== e) {
  46397. var n = new Ci.MaterialLoader;
  46398. n.setTextures(t);
  46399. for (var r = 0, o = e.length; r < o; r++) {
  46400. var a = n.parse(e[r]);
  46401. i[a.uuid] = a
  46402. }
  46403. }
  46404. return i
  46405. },
  46406. parseAnimations: function(e) {
  46407. for (var t = [], i = 0; i < e.length; i++) {
  46408. var n = Ci.AnimationClip.parse(e[i]);
  46409. t.push(n)
  46410. }
  46411. return t
  46412. },
  46413. parseImages: function(e, t) {
  46414. function i(e) {
  46415. return n.manager.itemStart(e),
  46416. a.load(e, function() {
  46417. n.manager.itemEnd(e)
  46418. })
  46419. }
  46420. var n = this
  46421. , r = {};
  46422. if (void 0 !== e && 0 < e.length) {
  46423. var o = new Ci.LoadingManager(t)
  46424. , a = new Ci.ImageLoader(o);
  46425. a.setCrossOrigin(this.crossOrigin);
  46426. for (var s = 0, l = e.length; s < l; s++) {
  46427. var c = e[s]
  46428. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  46429. r[c.uuid] = i(h)
  46430. }
  46431. }
  46432. return r
  46433. },
  46434. parseTextures: function(e, t) {
  46435. function i(e) {
  46436. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46437. Ci[e])
  46438. }
  46439. var n = {};
  46440. if (void 0 !== e)
  46441. for (var r = 0, o = e.length; r < o; r++) {
  46442. var a = e[r];
  46443. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  46444. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  46445. var s = new Ci.Texture(t[a.image]);
  46446. s.needsUpdate = !0,
  46447. s.uuid = a.uuid,
  46448. void 0 !== a.name && (s.name = a.name),
  46449. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  46450. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  46451. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  46452. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  46453. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  46454. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  46455. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  46456. s.wrapT = i(a.wrap[1])),
  46457. n[a.uuid] = s
  46458. }
  46459. return n
  46460. },
  46461. parseObject: (ke = new Ci.Matrix4,
  46462. function(e, t, i) {
  46463. function n(e) {
  46464. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46465. t[e]
  46466. }
  46467. function r(e) {
  46468. if (void 0 !== e)
  46469. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46470. i[e]
  46471. }
  46472. var o;
  46473. switch (e.type) {
  46474. case "Scene":
  46475. o = new Ci.Scene;
  46476. break;
  46477. case "PerspectiveCamera":
  46478. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  46479. break;
  46480. case "OrthographicCamera":
  46481. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  46482. break;
  46483. case "AmbientLight":
  46484. o = new Ci.AmbientLight(e.color,e.intensity);
  46485. break;
  46486. case "DirectionalLight":
  46487. o = new Ci.DirectionalLight(e.color,e.intensity);
  46488. break;
  46489. case "PointLight":
  46490. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  46491. break;
  46492. case "SpotLight":
  46493. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46494. break;
  46495. case "HemisphereLight":
  46496. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46497. break;
  46498. case "Mesh":
  46499. var a = n(e.geometry)
  46500. , s = r(e.material);
  46501. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46502. break;
  46503. case "LOD":
  46504. o = new Ci.LOD;
  46505. break;
  46506. case "Line":
  46507. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46508. break;
  46509. case "PointCloud":
  46510. case "Points":
  46511. o = new Ci.Points(n(e.geometry),r(e.material));
  46512. break;
  46513. case "Sprite":
  46514. o = new Ci.Sprite(r(e.material));
  46515. break;
  46516. case "Group":
  46517. o = new Ci.Group;
  46518. break;
  46519. default:
  46520. o = new Ci.Object3D
  46521. }
  46522. if (o.uuid = e.uuid,
  46523. void 0 !== e.name && (o.name = e.name),
  46524. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46525. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46526. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46527. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46528. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46529. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46530. void 0 !== e.visible && (o.visible = e.visible),
  46531. void 0 !== e.userData && (o.userData = e.userData),
  46532. void 0 !== e.children)
  46533. for (var l in e.children)
  46534. o.add(this.parseObject(e.children[l], t, i));
  46535. if ("LOD" === e.type)
  46536. for (var c = e.levels, h = 0; h < c.length; h++) {
  46537. var u = c[h];
  46538. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46539. }
  46540. return o
  46541. }
  46542. )
  46543. },
  46544. Ci.TextureLoader = function(e) {
  46545. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46546. }
  46547. ,
  46548. Ci.TextureLoader.prototype = {
  46549. constructor: Ci.TextureLoader,
  46550. load: function(e, t, i, n) {
  46551. var r = new Ci.Texture
  46552. , o = new Ci.ImageLoader(this.manager);
  46553. return o.setCrossOrigin(this.crossOrigin),
  46554. o.setPath(this.path),
  46555. o.load(e, function(e) {
  46556. r.image = e,
  46557. r.needsUpdate = !0,
  46558. void 0 !== t && t(r)
  46559. }, i, n),
  46560. r
  46561. },
  46562. setCrossOrigin: function(e) {
  46563. this.crossOrigin = e
  46564. },
  46565. setPath: function(e) {
  46566. this.path = e
  46567. }
  46568. },
  46569. Ci.CubeTextureLoader = function(e) {
  46570. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46571. }
  46572. ,
  46573. Ci.CubeTextureLoader.prototype = {
  46574. constructor: Ci.CubeTextureLoader,
  46575. load: function(e, i, t, n) {
  46576. function r(t) {
  46577. a.load(e[t], function(e) {
  46578. o.images[t] = e,
  46579. 6 === ++s && (o.needsUpdate = !0,
  46580. i && i(o))
  46581. }, void 0, n)
  46582. }
  46583. var o = new Ci.CubeTexture
  46584. , a = new Ci.ImageLoader(this.manager);
  46585. a.setCrossOrigin(this.crossOrigin),
  46586. a.setPath(this.path);
  46587. for (var s = 0, l = 0; l < e.length; ++l)
  46588. r(l);
  46589. return o
  46590. },
  46591. setCrossOrigin: function(e) {
  46592. this.crossOrigin = e
  46593. },
  46594. setPath: function(e) {
  46595. this.path = e
  46596. }
  46597. },
  46598. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46599. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46600. this._parser = null
  46601. }
  46602. ,
  46603. Ci.BinaryTextureLoader.prototype = {
  46604. constructor: Ci.BinaryTextureLoader,
  46605. load: function(e, i, t, n) {
  46606. var r = this
  46607. , o = new Ci.DataTexture
  46608. , a = new Ci.XHRLoader(this.manager);
  46609. return a.setResponseType("arraybuffer"),
  46610. a.load(e, function(e) {
  46611. var t = r._parser(e);
  46612. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46613. o.image.height = t.height,
  46614. o.image.data = t.data),
  46615. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46616. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46617. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46618. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46619. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46620. void 0 !== t.format && (o.format = t.format),
  46621. void 0 !== t.type && (o.type = t.type),
  46622. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46623. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46624. o.needsUpdate = !0,
  46625. i && i(o, t))
  46626. }, t, n),
  46627. o
  46628. }
  46629. },
  46630. Ci.CompressedTextureLoader = function(e) {
  46631. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46632. this._parser = null
  46633. }
  46634. ,
  46635. Ci.CompressedTextureLoader.prototype = {
  46636. constructor: Ci.CompressedTextureLoader,
  46637. load: function(e, o, t, n) {
  46638. function i(i) {
  46639. r.load(e[i], function(e) {
  46640. var t = a._parser(e, !0);
  46641. s[i] = {
  46642. width: t.width,
  46643. height: t.height,
  46644. format: t.format,
  46645. mipmaps: t.mipmaps
  46646. },
  46647. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46648. l.format = t.format,
  46649. l.needsUpdate = !0,
  46650. o && o(l))
  46651. }, t, n)
  46652. }
  46653. var a = this
  46654. , s = []
  46655. , l = new Ci.CompressedTexture;
  46656. l.image = s;
  46657. var r = new Ci.XHRLoader(this.manager);
  46658. if (r.setPath(this.path),
  46659. r.setResponseType("arraybuffer"),
  46660. Array.isArray(e))
  46661. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46662. i(h);
  46663. else
  46664. r.load(e, function(e) {
  46665. var t = a._parser(e, !0);
  46666. if (t.isCubemap)
  46667. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46668. s[n] = {
  46669. mipmaps: []
  46670. };
  46671. for (var r = 0; r < t.mipmapCount; r++)
  46672. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46673. s[n].format = t.format,
  46674. s[n].width = t.width,
  46675. s[n].height = t.height
  46676. }
  46677. else
  46678. l.image.width = t.width,
  46679. l.image.height = t.height,
  46680. l.mipmaps = t.mipmaps;
  46681. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46682. l.format = t.format,
  46683. l.needsUpdate = !0,
  46684. o && o(l)
  46685. }, t, n);
  46686. return l
  46687. },
  46688. setPath: function(e) {
  46689. this.path = e
  46690. }
  46691. },
  46692. Ci.Material = function() {
  46693. Object.defineProperty(this, "id", {
  46694. value: Ci.MaterialIdCount++
  46695. }),
  46696. this.uuid = Ci.Math.generateUUID(),
  46697. this.name = "",
  46698. this.type = "Material",
  46699. this.side = Ci.FrontSide,
  46700. this.opacity = 1,
  46701. this.transparent = !1,
  46702. this.blending = Ci.NormalBlending,
  46703. this.blendSrc = Ci.SrcAlphaFactor,
  46704. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46705. this.blendEquation = Ci.AddEquation,
  46706. this.blendSrcAlpha = null,
  46707. this.blendDstAlpha = null,
  46708. this.blendEquationAlpha = null,
  46709. this.depthFunc = Ci.LessEqualDepth,
  46710. this.depthTest = !0,
  46711. this.depthWrite = !0,
  46712. this.colorWrite = !0,
  46713. this.precision = null,
  46714. this.polygonOffset = !1,
  46715. this.polygonOffsetFactor = 0,
  46716. this.polygonOffsetUnits = 0,
  46717. this.alphaTest = 0,
  46718. this.premultipliedAlpha = !1,
  46719. this.overdraw = 0,
  46720. this.visible = !0,
  46721. this._needsUpdate = !0
  46722. }
  46723. ,
  46724. Ci.Material.prototype = {
  46725. constructor: Ci.Material,
  46726. get needsUpdate() {
  46727. return this._needsUpdate
  46728. },
  46729. set needsUpdate(e) {
  46730. !0 === e && this.update(),
  46731. this._needsUpdate = e
  46732. },
  46733. setValues: function(e) {
  46734. if (void 0 !== e)
  46735. for (var t in e) {
  46736. var i = e[t];
  46737. if (void 0 !== i) {
  46738. var n = this[t];
  46739. 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.")
  46740. } else
  46741. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46742. }
  46743. },
  46744. toJSON: function(e) {
  46745. function t(e) {
  46746. var t = [];
  46747. for (var i in e) {
  46748. var n = e[i];
  46749. delete n.metadata,
  46750. t.push(n)
  46751. }
  46752. return t
  46753. }
  46754. var i = void 0 === e;
  46755. i && (e = {
  46756. textures: {},
  46757. images: {}
  46758. });
  46759. var n = {
  46760. metadata: {
  46761. version: 4.4,
  46762. type: "Material",
  46763. generator: "Material.toJSON"
  46764. }
  46765. };
  46766. if (n.uuid = this.uuid,
  46767. n.type = this.type,
  46768. "" !== this.name && (n.name = this.name),
  46769. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46770. .5 !== this.roughness && (n.roughness = this.roughness),
  46771. .5 !== this.metalness && (n.metalness = this.metalness),
  46772. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46773. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46774. void 0 !== this.shininess && (n.shininess = this.shininess),
  46775. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46776. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46777. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46778. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46779. n.bumpScale = this.bumpScale),
  46780. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46781. n.normalScale = this.normalScale.toArray()),
  46782. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46783. n.displacementScale = this.displacementScale,
  46784. n.displacementBias = this.displacementBias),
  46785. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46786. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46787. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46788. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46789. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46790. n.reflectivity = this.reflectivity),
  46791. void 0 !== this.size && (n.size = this.size),
  46792. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46793. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46794. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46795. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46796. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46797. this.opacity < 1 && (n.opacity = this.opacity),
  46798. !0 === this.transparent && (n.transparent = this.transparent),
  46799. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46800. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46801. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46802. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46803. i) {
  46804. var r = t(e.textures)
  46805. , o = t(e.images);
  46806. 0 < r.length && (n.textures = r),
  46807. 0 < o.length && (n.images = o)
  46808. }
  46809. return n
  46810. },
  46811. clone: function() {
  46812. return (new this.constructor).copy(this)
  46813. },
  46814. copy: function(e) {
  46815. return this.name = e.name,
  46816. this.side = e.side,
  46817. this.opacity = e.opacity,
  46818. this.transparent = e.transparent,
  46819. this.blending = e.blending,
  46820. this.blendSrc = e.blendSrc,
  46821. this.blendDst = e.blendDst,
  46822. this.blendEquation = e.blendEquation,
  46823. this.blendSrcAlpha = e.blendSrcAlpha,
  46824. this.blendDstAlpha = e.blendDstAlpha,
  46825. this.blendEquationAlpha = e.blendEquationAlpha,
  46826. this.depthFunc = e.depthFunc,
  46827. this.depthTest = e.depthTest,
  46828. this.depthWrite = e.depthWrite,
  46829. this.colorWrite = e.colorWrite,
  46830. this.precision = e.precision,
  46831. this.polygonOffset = e.polygonOffset,
  46832. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46833. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46834. this.alphaTest = e.alphaTest,
  46835. this.premultipliedAlpha = e.premultipliedAlpha,
  46836. this.overdraw = e.overdraw,
  46837. this.visible = e.visible,
  46838. this
  46839. },
  46840. update: function() {
  46841. this.dispatchEvent({
  46842. type: "update"
  46843. })
  46844. },
  46845. dispose: function() {
  46846. this.dispatchEvent({
  46847. type: "dispose"
  46848. })
  46849. }
  46850. },
  46851. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46852. Ci.MaterialIdCount = 0,
  46853. Ci.LineBasicMaterial = function(e) {
  46854. Ci.Material.call(this),
  46855. this.type = "LineBasicMaterial",
  46856. this.color = new Ci.Color(16777215),
  46857. this.linewidth = 1,
  46858. this.linecap = "round",
  46859. this.linejoin = "round",
  46860. this.blending = Ci.NormalBlending,
  46861. this.vertexColors = Ci.NoColors,
  46862. this.fog = !0,
  46863. this.setValues(e)
  46864. }
  46865. ,
  46866. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46867. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46868. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46869. return Ci.Material.prototype.copy.call(this, e),
  46870. this.color.copy(e.color),
  46871. this.linewidth = e.linewidth,
  46872. this.linecap = e.linecap,
  46873. this.linejoin = e.linejoin,
  46874. this.vertexColors = e.vertexColors,
  46875. this.fog = e.fog,
  46876. this
  46877. }
  46878. ,
  46879. Ci.LineDashedMaterial = function(e) {
  46880. Ci.Material.call(this),
  46881. this.type = "LineDashedMaterial",
  46882. this.color = new Ci.Color(16777215),
  46883. this.linewidth = 1,
  46884. this.scale = 1,
  46885. this.dashSize = 3,
  46886. this.gapSize = 1,
  46887. this.blending = Ci.NormalBlending,
  46888. this.vertexColors = Ci.NoColors,
  46889. this.fog = !0,
  46890. this.setValues(e)
  46891. }
  46892. ,
  46893. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46894. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46895. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46896. return Ci.Material.prototype.copy.call(this, e),
  46897. this.color.copy(e.color),
  46898. this.linewidth = e.linewidth,
  46899. this.scale = e.scale,
  46900. this.dashSize = e.dashSize,
  46901. this.gapSize = e.gapSize,
  46902. this.vertexColors = e.vertexColors,
  46903. this.fog = e.fog,
  46904. this
  46905. }
  46906. ,
  46907. Ci.MeshBasicMaterial = function(e) {
  46908. Ci.Material.call(this),
  46909. this.type = "MeshBasicMaterial",
  46910. this.color = new Ci.Color(16777215),
  46911. this.map = null,
  46912. this.aoMap = null,
  46913. this.aoMapIntensity = 1,
  46914. this.specularMap = null,
  46915. this.alphaMap = null,
  46916. this.envMap = null,
  46917. this.combine = Ci.MultiplyOperation,
  46918. this.reflectivity = 1,
  46919. this.refractionRatio = .98,
  46920. this.fog = !0,
  46921. this.shading = Ci.SmoothShading,
  46922. this.blending = Ci.NormalBlending,
  46923. this.wireframe = !1,
  46924. this.wireframeLinewidth = 1,
  46925. this.wireframeLinecap = "round",
  46926. this.wireframeLinejoin = "round",
  46927. this.vertexColors = Ci.NoColors,
  46928. this.skinning = !1,
  46929. this.morphTargets = !1,
  46930. this.setValues(e)
  46931. }
  46932. ,
  46933. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46934. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46935. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46936. return Ci.Material.prototype.copy.call(this, e),
  46937. this.color.copy(e.color),
  46938. this.map = e.map,
  46939. this.aoMap = e.aoMap,
  46940. this.aoMapIntensity = e.aoMapIntensity,
  46941. this.specularMap = e.specularMap,
  46942. this.alphaMap = e.alphaMap,
  46943. this.envMap = e.envMap,
  46944. this.combine = e.combine,
  46945. this.reflectivity = e.reflectivity,
  46946. this.refractionRatio = e.refractionRatio,
  46947. this.fog = e.fog,
  46948. this.shading = e.shading,
  46949. this.wireframe = e.wireframe,
  46950. this.wireframeLinewidth = e.wireframeLinewidth,
  46951. this.wireframeLinecap = e.wireframeLinecap,
  46952. this.wireframeLinejoin = e.wireframeLinejoin,
  46953. this.vertexColors = e.vertexColors,
  46954. this.skinning = e.skinning,
  46955. this.morphTargets = e.morphTargets,
  46956. this
  46957. }
  46958. ,
  46959. Ci.MeshLambertMaterial = function(e) {
  46960. Ci.Material.call(this),
  46961. this.type = "MeshLambertMaterial",
  46962. this.color = new Ci.Color(16777215),
  46963. this.map = null,
  46964. this.lightMap = null,
  46965. this.lightMapIntensity = 1,
  46966. this.aoMap = null,
  46967. this.aoMapIntensity = 1,
  46968. this.emissive = new Ci.Color(0),
  46969. this.emissiveIntensity = 1,
  46970. this.emissiveMap = null,
  46971. this.specularMap = null,
  46972. this.alphaMap = null,
  46973. this.envMap = null,
  46974. this.combine = Ci.MultiplyOperation,
  46975. this.reflectivity = 1,
  46976. this.refractionRatio = .98,
  46977. this.fog = !0,
  46978. this.blending = Ci.NormalBlending,
  46979. this.wireframe = !1,
  46980. this.wireframeLinewidth = 1,
  46981. this.wireframeLinecap = "round",
  46982. this.wireframeLinejoin = "round",
  46983. this.vertexColors = Ci.NoColors,
  46984. this.skinning = !1,
  46985. this.morphTargets = !1,
  46986. this.morphNormals = !1,
  46987. this.setValues(e)
  46988. }
  46989. ,
  46990. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46991. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46992. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46993. return Ci.Material.prototype.copy.call(this, e),
  46994. this.color.copy(e.color),
  46995. this.map = e.map,
  46996. this.lightMap = e.lightMap,
  46997. this.lightMapIntensity = e.lightMapIntensity,
  46998. this.aoMap = e.aoMap,
  46999. this.aoMapIntensity = e.aoMapIntensity,
  47000. this.emissive.copy(e.emissive),
  47001. this.emissiveMap = e.emissiveMap,
  47002. this.emissiveIntensity = e.emissiveIntensity,
  47003. this.specularMap = e.specularMap,
  47004. this.alphaMap = e.alphaMap,
  47005. this.envMap = e.envMap,
  47006. this.combine = e.combine,
  47007. this.reflectivity = e.reflectivity,
  47008. this.refractionRatio = e.refractionRatio,
  47009. this.fog = e.fog,
  47010. this.wireframe = e.wireframe,
  47011. this.wireframeLinewidth = e.wireframeLinewidth,
  47012. this.wireframeLinecap = e.wireframeLinecap,
  47013. this.wireframeLinejoin = e.wireframeLinejoin,
  47014. this.vertexColors = e.vertexColors,
  47015. this.skinning = e.skinning,
  47016. this.morphTargets = e.morphTargets,
  47017. this.morphNormals = e.morphNormals,
  47018. this
  47019. }
  47020. ,
  47021. Ci.MeshPhongMaterial = function(e) {
  47022. Ci.Material.call(this),
  47023. this.type = "MeshPhongMaterial",
  47024. this.color = new Ci.Color(16777215),
  47025. this.specular = new Ci.Color(1118481),
  47026. this.shininess = 30,
  47027. this.map = null,
  47028. this.lightMap = null,
  47029. this.lightMapIntensity = 1,
  47030. this.aoMap = null,
  47031. this.aoMapIntensity = 1,
  47032. this.emissive = new Ci.Color(0),
  47033. this.emissiveIntensity = 1,
  47034. this.emissiveMap = null,
  47035. this.bumpMap = null,
  47036. this.bumpScale = 1,
  47037. this.normalMap = null,
  47038. this.normalScale = new Ci.Vector2(1,1),
  47039. this.displacementMap = null,
  47040. this.displacementScale = 1,
  47041. this.displacementBias = 0,
  47042. this.specularMap = null,
  47043. this.alphaMap = null,
  47044. this.envMap = null,
  47045. this.combine = Ci.MultiplyOperation,
  47046. this.reflectivity = 1,
  47047. this.refractionRatio = .98,
  47048. this.fog = !0,
  47049. this.shading = Ci.SmoothShading,
  47050. this.blending = Ci.NormalBlending,
  47051. this.wireframe = !1,
  47052. this.wireframeLinewidth = 1,
  47053. this.wireframeLinecap = "round",
  47054. this.wireframeLinejoin = "round",
  47055. this.vertexColors = Ci.NoColors,
  47056. this.skinning = !1,
  47057. this.morphTargets = !1,
  47058. this.morphNormals = !1,
  47059. this.setValues(e)
  47060. }
  47061. ,
  47062. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  47063. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  47064. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  47065. return Ci.Material.prototype.copy.call(this, e),
  47066. this.color.copy(e.color),
  47067. this.specular.copy(e.specular),
  47068. this.shininess = e.shininess,
  47069. this.map = e.map,
  47070. this.lightMap = e.lightMap,
  47071. this.lightMapIntensity = e.lightMapIntensity,
  47072. this.aoMap = e.aoMap,
  47073. this.aoMapIntensity = e.aoMapIntensity,
  47074. this.emissive.copy(e.emissive),
  47075. this.emissiveMap = e.emissiveMap,
  47076. this.emissiveIntensity = e.emissiveIntensity,
  47077. this.bumpMap = e.bumpMap,
  47078. this.bumpScale = e.bumpScale,
  47079. this.normalMap = e.normalMap,
  47080. this.normalScale.copy(e.normalScale),
  47081. this.displacementMap = e.displacementMap,
  47082. this.displacementScale = e.displacementScale,
  47083. this.displacementBias = e.displacementBias,
  47084. this.specularMap = e.specularMap,
  47085. this.alphaMap = e.alphaMap,
  47086. this.envMap = e.envMap,
  47087. this.combine = e.combine,
  47088. this.reflectivity = e.reflectivity,
  47089. this.refractionRatio = e.refractionRatio,
  47090. this.fog = e.fog,
  47091. this.shading = e.shading,
  47092. this.wireframe = e.wireframe,
  47093. this.wireframeLinewidth = e.wireframeLinewidth,
  47094. this.wireframeLinecap = e.wireframeLinecap,
  47095. this.wireframeLinejoin = e.wireframeLinejoin,
  47096. this.vertexColors = e.vertexColors,
  47097. this.skinning = e.skinning,
  47098. this.morphTargets = e.morphTargets,
  47099. this.morphNormals = e.morphNormals,
  47100. this
  47101. }
  47102. ,
  47103. Ci.MeshStandardMaterial = function(e) {
  47104. Ci.Material.call(this),
  47105. this.type = "MeshStandardMaterial",
  47106. this.color = new Ci.Color(16777215),
  47107. this.roughness = .5,
  47108. this.metalness = .5,
  47109. this.map = null,
  47110. this.lightMap = null,
  47111. this.lightMapIntensity = 1,
  47112. this.aoMap = null,
  47113. this.aoMapIntensity = 1,
  47114. this.emissive = new Ci.Color(0),
  47115. this.emissiveIntensity = 1,
  47116. this.emissiveMap = null,
  47117. this.bumpMap = null,
  47118. this.bumpScale = 1,
  47119. this.normalMap = null,
  47120. this.normalScale = new Ci.Vector2(1,1),
  47121. this.displacementMap = null,
  47122. this.displacementScale = 1,
  47123. this.displacementBias = 0,
  47124. this.roughnessMap = null,
  47125. this.metalnessMap = null,
  47126. this.alphaMap = null,
  47127. this.envMap = null,
  47128. this.envMapIntensity = 1,
  47129. this.refractionRatio = .98,
  47130. this.fog = !0,
  47131. this.shading = Ci.SmoothShading,
  47132. this.blending = Ci.NormalBlending,
  47133. this.wireframe = !1,
  47134. this.wireframeLinewidth = 1,
  47135. this.wireframeLinecap = "round",
  47136. this.wireframeLinejoin = "round",
  47137. this.vertexColors = Ci.NoColors,
  47138. this.skinning = !1,
  47139. this.morphTargets = !1,
  47140. this.morphNormals = !1,
  47141. this.setValues(e)
  47142. }
  47143. ,
  47144. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  47145. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  47146. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  47147. return Ci.Material.prototype.copy.call(this, e),
  47148. this.color.copy(e.color),
  47149. this.roughness = e.roughness,
  47150. this.metalness = e.metalness,
  47151. this.map = e.map,
  47152. this.lightMap = e.lightMap,
  47153. this.lightMapIntensity = e.lightMapIntensity,
  47154. this.aoMap = e.aoMap,
  47155. this.aoMapIntensity = e.aoMapIntensity,
  47156. this.emissive.copy(e.emissive),
  47157. this.emissiveMap = e.emissiveMap,
  47158. this.emissiveIntensity = e.emissiveIntensity,
  47159. this.bumpMap = e.bumpMap,
  47160. this.bumpScale = e.bumpScale,
  47161. this.normalMap = e.normalMap,
  47162. this.normalScale.copy(e.normalScale),
  47163. this.displacementMap = e.displacementMap,
  47164. this.displacementScale = e.displacementScale,
  47165. this.displacementBias = e.displacementBias,
  47166. this.roughnessMap = e.roughnessMap,
  47167. this.metalnessMap = e.metalnessMap,
  47168. this.alphaMap = e.alphaMap,
  47169. this.envMap = e.envMap,
  47170. this.envMapIntensity = e.envMapIntensity,
  47171. this.refractionRatio = e.refractionRatio,
  47172. this.fog = e.fog,
  47173. this.shading = e.shading,
  47174. this.wireframe = e.wireframe,
  47175. this.wireframeLinewidth = e.wireframeLinewidth,
  47176. this.wireframeLinecap = e.wireframeLinecap,
  47177. this.wireframeLinejoin = e.wireframeLinejoin,
  47178. this.vertexColors = e.vertexColors,
  47179. this.skinning = e.skinning,
  47180. this.morphTargets = e.morphTargets,
  47181. this.morphNormals = e.morphNormals,
  47182. this
  47183. }
  47184. ,
  47185. Ci.MeshDepthMaterial = function(e) {
  47186. Ci.Material.call(this),
  47187. this.type = "MeshDepthMaterial",
  47188. this.morphTargets = !1,
  47189. this.wireframe = !1,
  47190. this.wireframeLinewidth = 1,
  47191. this.setValues(e)
  47192. }
  47193. ,
  47194. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  47195. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  47196. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  47197. return Ci.Material.prototype.copy.call(this, e),
  47198. this.wireframe = e.wireframe,
  47199. this.wireframeLinewidth = e.wireframeLinewidth,
  47200. this
  47201. }
  47202. ,
  47203. Ci.MeshNormalMaterial = function(e) {
  47204. Ci.Material.call(this, e),
  47205. this.type = "MeshNormalMaterial",
  47206. this.wireframe = !1,
  47207. this.wireframeLinewidth = 1,
  47208. this.morphTargets = !1,
  47209. this.setValues(e)
  47210. }
  47211. ,
  47212. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  47213. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  47214. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  47215. return Ci.Material.prototype.copy.call(this, e),
  47216. this.wireframe = e.wireframe,
  47217. this.wireframeLinewidth = e.wireframeLinewidth,
  47218. this
  47219. }
  47220. ,
  47221. Ci.MultiMaterial = function(e) {
  47222. this.uuid = Ci.Math.generateUUID(),
  47223. this.type = "MultiMaterial",
  47224. this.materials = e instanceof Array ? e : [],
  47225. this.visible = !0
  47226. }
  47227. ,
  47228. Ci.MultiMaterial.prototype = {
  47229. constructor: Ci.MultiMaterial,
  47230. toJSON: function(e) {
  47231. for (var t = {
  47232. metadata: {
  47233. version: 4.2,
  47234. type: "material",
  47235. generator: "MaterialExporter"
  47236. },
  47237. uuid: this.uuid,
  47238. type: this.type,
  47239. materials: []
  47240. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  47241. var o = i[n].toJSON(e);
  47242. delete o.metadata,
  47243. t.materials.push(o)
  47244. }
  47245. return t.visible = this.visible,
  47246. t
  47247. },
  47248. clone: function() {
  47249. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  47250. e.materials.push(this.materials[t].clone());
  47251. return e.visible = this.visible,
  47252. e
  47253. }
  47254. },
  47255. Ci.PointsMaterial = function(e) {
  47256. Ci.Material.call(this),
  47257. this.type = "PointsMaterial",
  47258. this.color = new Ci.Color(16777215),
  47259. this.map = null,
  47260. this.size = 1,
  47261. this.sizeAttenuation = !0,
  47262. this.blending = Ci.NormalBlending,
  47263. this.vertexColors = Ci.NoColors,
  47264. this.fog = !0,
  47265. this.setValues(e)
  47266. }
  47267. ,
  47268. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  47269. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  47270. Ci.PointsMaterial.prototype.copy = function(e) {
  47271. return Ci.Material.prototype.copy.call(this, e),
  47272. this.color.copy(e.color),
  47273. this.map = e.map,
  47274. this.size = e.size,
  47275. this.sizeAttenuation = e.sizeAttenuation,
  47276. this.vertexColors = e.vertexColors,
  47277. this.fog = e.fog,
  47278. this
  47279. }
  47280. ,
  47281. Ci.ShaderMaterial = function(e) {
  47282. Ci.Material.call(this),
  47283. this.type = "ShaderMaterial",
  47284. this.defines = {},
  47285. this.uniforms = {},
  47286. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  47287. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  47288. this.shading = Ci.SmoothShading,
  47289. this.linewidth = 1,
  47290. this.wireframe = !1,
  47291. this.wireframeLinewidth = 1,
  47292. this.fog = !1,
  47293. this.lights = !1,
  47294. this.vertexColors = Ci.NoColors,
  47295. this.skinning = !1,
  47296. this.morphTargets = !1,
  47297. this.morphNormals = !1,
  47298. this.extensions = {
  47299. derivatives: !1,
  47300. fragDepth: !1,
  47301. drawBuffers: !1,
  47302. shaderTextureLOD: !1
  47303. },
  47304. this.defaultAttributeValues = {
  47305. color: [1, 1, 1],
  47306. uv: [0, 0],
  47307. uv2: [0, 0]
  47308. },
  47309. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  47310. this.setValues(e))
  47311. }
  47312. ,
  47313. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  47314. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  47315. Ci.ShaderMaterial.prototype.copy = function(e) {
  47316. return Ci.Material.prototype.copy.call(this, e),
  47317. this.fragmentShader = e.fragmentShader,
  47318. this.vertexShader = e.vertexShader,
  47319. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  47320. this.defines = e.defines,
  47321. this.shading = e.shading,
  47322. this.wireframe = e.wireframe,
  47323. this.wireframeLinewidth = e.wireframeLinewidth,
  47324. this.fog = e.fog,
  47325. this.lights = e.lights,
  47326. this.vertexColors = e.vertexColors,
  47327. this.skinning = e.skinning,
  47328. this.morphTargets = e.morphTargets,
  47329. this.morphNormals = e.morphNormals,
  47330. this.extensions = e.extensions,
  47331. this
  47332. }
  47333. ,
  47334. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  47335. var t = Ci.Material.prototype.toJSON.call(this, e);
  47336. return t.uniforms = this.uniforms,
  47337. t.vertexShader = this.vertexShader,
  47338. t.fragmentShader = this.fragmentShader,
  47339. t
  47340. }
  47341. ,
  47342. Ci.RawShaderMaterial = function(e) {
  47343. Ci.ShaderMaterial.call(this, e),
  47344. this.type = "RawShaderMaterial"
  47345. }
  47346. ,
  47347. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  47348. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  47349. Ci.SpriteMaterial = function(e) {
  47350. Ci.Material.call(this),
  47351. this.type = "SpriteMaterial",
  47352. this.color = new Ci.Color(16777215),
  47353. this.map = null,
  47354. this.rotation = 0,
  47355. this.fog = !1,
  47356. this.setValues(e)
  47357. }
  47358. ,
  47359. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  47360. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  47361. Ci.SpriteMaterial.prototype.copy = function(e) {
  47362. return Ci.Material.prototype.copy.call(this, e),
  47363. this.color.copy(e.color),
  47364. this.map = e.map,
  47365. this.rotation = e.rotation,
  47366. this.fog = e.fog,
  47367. this
  47368. }
  47369. ,
  47370. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  47371. Object.defineProperty(this, "id", {
  47372. value: Ci.TextureIdCount++
  47373. }),
  47374. this.uuid = Ci.Math.generateUUID(),
  47375. this.name = "",
  47376. this.sourceFile = "",
  47377. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  47378. this.mipmaps = [],
  47379. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  47380. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  47381. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  47382. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  47383. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  47384. this.anisotropy = void 0 !== l ? l : 1,
  47385. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  47386. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  47387. this.offset = new Ci.Vector2(0,0),
  47388. this.repeat = new Ci.Vector2(1,1),
  47389. this.generateMipmaps = !0,
  47390. this.premultiplyAlpha = !1,
  47391. this.flipY = !0,
  47392. this.unpackAlignment = 4,
  47393. this.encoding = Ci.LinearEncoding,
  47394. this.version = 0,
  47395. this.onUpdate = null
  47396. }
  47397. ,
  47398. Ci.Texture.DEFAULT_IMAGE = void 0,
  47399. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  47400. Ci.Texture.prototype = {
  47401. constructor: Ci.Texture,
  47402. set needsUpdate(e) {
  47403. !0 === e && this.version++
  47404. },
  47405. clone: function() {
  47406. return (new this.constructor).copy(this)
  47407. },
  47408. copy: function(e) {
  47409. return this.image = e.image,
  47410. this.mipmaps = e.mipmaps.slice(0),
  47411. this.mapping = e.mapping,
  47412. this.wrapS = e.wrapS,
  47413. this.wrapT = e.wrapT,
  47414. this.magFilter = e.magFilter,
  47415. this.minFilter = e.minFilter,
  47416. this.anisotropy = e.anisotropy,
  47417. this.format = e.format,
  47418. this.type = e.type,
  47419. this.offset.copy(e.offset),
  47420. this.repeat.copy(e.repeat),
  47421. this.generateMipmaps = e.generateMipmaps,
  47422. this.premultiplyAlpha = e.premultiplyAlpha,
  47423. this.flipY = e.flipY,
  47424. this.unpackAlignment = e.unpackAlignment,
  47425. this.encoding = e.encoding,
  47426. this
  47427. },
  47428. toJSON: function(e) {
  47429. if (void 0 !== e.textures[this.uuid])
  47430. return e.textures[this.uuid];
  47431. var t, i, n = {
  47432. metadata: {
  47433. version: 4.4,
  47434. type: "Texture",
  47435. generator: "Texture.toJSON"
  47436. },
  47437. uuid: this.uuid,
  47438. name: this.name,
  47439. mapping: this.mapping,
  47440. repeat: [this.repeat.x, this.repeat.y],
  47441. offset: [this.offset.x, this.offset.y],
  47442. wrap: [this.wrapS, this.wrapT],
  47443. minFilter: this.minFilter,
  47444. magFilter: this.magFilter,
  47445. anisotropy: this.anisotropy
  47446. };
  47447. if (void 0 !== this.image) {
  47448. var r = this.image;
  47449. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  47450. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47451. uuid: r.uuid,
  47452. url: (t = r,
  47453. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  47454. i.height = t.height,
  47455. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  47456. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  47457. }),
  47458. n.image = r.uuid
  47459. }
  47460. return e.textures[this.uuid] = n
  47461. },
  47462. dispose: function() {
  47463. this.dispatchEvent({
  47464. type: "dispose"
  47465. })
  47466. },
  47467. transformUv: function(e) {
  47468. if (this.mapping === Ci.UVMapping) {
  47469. if (e.multiply(this.repeat),
  47470. e.add(this.offset),
  47471. e.x < 0 || 1 < e.x)
  47472. switch (this.wrapS) {
  47473. case Ci.RepeatWrapping:
  47474. e.x = e.x - Math.floor(e.x);
  47475. break;
  47476. case Ci.ClampToEdgeWrapping:
  47477. e.x = e.x < 0 ? 0 : 1;
  47478. break;
  47479. case Ci.MirroredRepeatWrapping:
  47480. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47481. }
  47482. if (e.y < 0 || 1 < e.y)
  47483. switch (this.wrapT) {
  47484. case Ci.RepeatWrapping:
  47485. e.y = e.y - Math.floor(e.y);
  47486. break;
  47487. case Ci.ClampToEdgeWrapping:
  47488. e.y = e.y < 0 ? 0 : 1;
  47489. break;
  47490. case Ci.MirroredRepeatWrapping:
  47491. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47492. }
  47493. this.flipY && (e.y = 1 - e.y)
  47494. }
  47495. }
  47496. },
  47497. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47498. Ci.TextureIdCount = 0,
  47499. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47500. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47501. this.needsUpdate = !0
  47502. }
  47503. ,
  47504. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47505. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47506. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47507. e = void 0 !== e ? e : [],
  47508. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47509. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47510. this.flipY = !1
  47511. }
  47512. ,
  47513. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47514. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47515. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47516. get: function() {
  47517. return this.image
  47518. },
  47519. set: function(e) {
  47520. this.image = e
  47521. }
  47522. }),
  47523. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47524. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47525. this.image = {
  47526. width: t,
  47527. height: i
  47528. },
  47529. this.mipmaps = e,
  47530. this.flipY = !1,
  47531. this.generateMipmaps = !1
  47532. }
  47533. ,
  47534. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47535. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47536. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47537. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47538. this.image = {
  47539. data: e,
  47540. width: t,
  47541. height: i
  47542. },
  47543. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47544. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47545. this.flipY = !1,
  47546. this.generateMipmaps = !1
  47547. }
  47548. ,
  47549. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47550. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47551. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47552. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47553. this.generateMipmaps = !1;
  47554. var c = this;
  47555. !function e() {
  47556. requestAnimationFrame(e),
  47557. !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47558. }()
  47559. }
  47560. ,
  47561. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47562. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47563. Ci.Group = function() {
  47564. Ci.Object3D.call(this),
  47565. this.type = "Group"
  47566. }
  47567. ,
  47568. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47569. Ci.Group.prototype.constructor = Ci.Group,
  47570. Ci.Points = function(e, t) {
  47571. Ci.Object3D.call(this),
  47572. this.type = "Points",
  47573. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47574. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47575. color: 16777215 * Math.random()
  47576. })
  47577. }
  47578. ,
  47579. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47580. Ci.Points.prototype.constructor = Ci.Points,
  47581. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47582. jt = new Ci.Ray,
  47583. Yt = new Ci.Sphere,
  47584. function(o, a) {
  47585. function e(e, t) {
  47586. var i = jt.distanceSqToPoint(e);
  47587. if (i < c) {
  47588. var n = jt.closestPointToPoint(e);
  47589. n.applyMatrix4(l);
  47590. var r = o.ray.origin.distanceTo(n);
  47591. if (r < o.near || r > o.far)
  47592. return;
  47593. a.push({
  47594. distance: r,
  47595. distanceToRay: Math.sqrt(i),
  47596. point: n.clone(),
  47597. index: t,
  47598. face: null,
  47599. object: s
  47600. })
  47601. }
  47602. }
  47603. var s = this
  47604. , t = this.geometry
  47605. , l = this.matrixWorld
  47606. , i = o.params.Points.threshold;
  47607. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47608. Yt.copy(t.boundingSphere),
  47609. Yt.applyMatrix4(l),
  47610. !1 !== o.ray.intersectsSphere(Yt)) {
  47611. Wt.getInverse(l),
  47612. jt.copy(o.ray).applyMatrix4(Wt);
  47613. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47614. , c = n * n
  47615. , r = new Ci.Vector3;
  47616. if (t instanceof Ci.BufferGeometry) {
  47617. var h = t.index
  47618. , u = t.attributes.position.array;
  47619. if (null !== h)
  47620. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47621. var g = d[p];
  47622. r.fromArray(u, 3 * g),
  47623. e(r, g)
  47624. }
  47625. else {
  47626. p = 0;
  47627. for (var m = u.length / 3; p < m; p++)
  47628. r.fromArray(u, 3 * p),
  47629. e(r, p)
  47630. }
  47631. } else {
  47632. var v = t.vertices;
  47633. for (p = 0,
  47634. m = v.length; p < m; p++)
  47635. e(v[p], p)
  47636. }
  47637. }
  47638. }
  47639. ),
  47640. Ci.Points.prototype.clone = function() {
  47641. return new this.constructor(this.geometry,this.material).copy(this)
  47642. }
  47643. ,
  47644. Ci.Line = function(e, t, i) {
  47645. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47646. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47647. this.type = "Line",
  47648. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47649. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47650. color: 16777215 * Math.random()
  47651. })))
  47652. }
  47653. ,
  47654. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47655. Ci.Line.prototype.constructor = Ci.Line,
  47656. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47657. zt = new Ci.Ray,
  47658. Gt = new Ci.Sphere,
  47659. function(e, t) {
  47660. var i = e.linePrecision
  47661. , n = i * i
  47662. , r = this.geometry
  47663. , o = this.matrixWorld;
  47664. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47665. Gt.copy(r.boundingSphere),
  47666. Gt.applyMatrix4(o),
  47667. !1 !== e.ray.intersectsSphere(Gt)) {
  47668. Ht.getInverse(o),
  47669. zt.copy(e.ray).applyMatrix4(Ht);
  47670. var a = new Ci.Vector3
  47671. , s = new Ci.Vector3
  47672. , l = new Ci.Vector3
  47673. , c = new Ci.Vector3
  47674. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47675. if (r instanceof Ci.BufferGeometry) {
  47676. var u = r.index
  47677. , d = r.attributes.position.array;
  47678. if (null !== u)
  47679. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47680. var m = p[f]
  47681. , v = p[f + 1];
  47682. a.fromArray(d, 3 * m),
  47683. s.fromArray(d, 3 * v),
  47684. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47685. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47686. distance: C,
  47687. point: l.clone().applyMatrix4(this.matrixWorld),
  47688. index: f,
  47689. face: null,
  47690. faceIndex: null,
  47691. object: this
  47692. }))
  47693. }
  47694. else
  47695. for (f = 0,
  47696. g = d.length / 3 - 1; f < g; f += h)
  47697. a.fromArray(d, 3 * f),
  47698. s.fromArray(d, 3 * f + 3),
  47699. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47700. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47701. distance: C,
  47702. point: l.clone().applyMatrix4(this.matrixWorld),
  47703. index: f,
  47704. face: null,
  47705. faceIndex: null,
  47706. object: this
  47707. }))
  47708. } else if (r instanceof Ci.Geometry) {
  47709. var y = r.vertices
  47710. , A = y.length;
  47711. for (f = 0; f < A - 1; f += h) {
  47712. var C;
  47713. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47714. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47715. distance: C,
  47716. point: l.clone().applyMatrix4(this.matrixWorld),
  47717. index: f,
  47718. face: null,
  47719. faceIndex: null,
  47720. object: this
  47721. }))
  47722. }
  47723. }
  47724. }
  47725. }
  47726. ),
  47727. Ci.Line.prototype.clone = function() {
  47728. return new this.constructor(this.geometry,this.material).copy(this)
  47729. }
  47730. ,
  47731. Ci.LineStrip = 0,
  47732. Ci.LinePieces = 1,
  47733. Ci.LineSegments = function(e, t) {
  47734. Ci.Line.call(this, e, t),
  47735. this.type = "LineSegments"
  47736. }
  47737. ,
  47738. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47739. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47740. Ci.Mesh = function(e, t) {
  47741. Ci.Object3D.call(this),
  47742. this.type = "Mesh",
  47743. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47744. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47745. color: 16777215 * Math.random()
  47746. }),
  47747. this.drawMode = Ci.TrianglesDrawMode,
  47748. this.updateMorphTargets()
  47749. }
  47750. ,
  47751. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47752. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47753. Ci.Mesh.prototype.setDrawMode = function(e) {
  47754. this.drawMode = e
  47755. }
  47756. ,
  47757. Ci.Mesh.prototype.updateMorphTargets = function() {
  47758. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47759. this.morphTargetBase = -1,
  47760. this.morphTargetInfluences = [],
  47761. this.morphTargetDictionary = {};
  47762. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47763. this.morphTargetInfluences.push(0),
  47764. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47765. }
  47766. }
  47767. ,
  47768. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47769. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47770. 0)
  47771. }
  47772. ,
  47773. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47774. xt = new Ci.Ray,
  47775. St = new Ci.Sphere,
  47776. Mt = new Ci.Vector3,
  47777. Rt = new Ci.Vector3,
  47778. Pt = new Ci.Vector3,
  47779. Ot = new Ci.Vector3,
  47780. Lt = new Ci.Vector3,
  47781. Dt = new Ci.Vector3,
  47782. Nt = new Ci.Vector2,
  47783. Ft = new Ci.Vector2,
  47784. Bt = new Ci.Vector2,
  47785. Vt = new Ci.Vector3,
  47786. kt = new Ci.Vector3,
  47787. Ut = new Ci.Vector3,
  47788. function(e, t) {
  47789. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47790. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47791. St.copy(r.boundingSphere),
  47792. St.applyMatrix4(a),
  47793. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47794. xt.copy(e.ray).applyMatrix4(Tt),
  47795. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47796. if (r instanceof Ci.BufferGeometry) {
  47797. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47798. if (void 0 !== u.uv && (i = u.uv.array),
  47799. null !== h)
  47800. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47801. s = p[f],
  47802. l = p[f + 1],
  47803. c = p[f + 2],
  47804. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47805. t.push(n));
  47806. else
  47807. for (f = 0,
  47808. g = d.length; f < g; f += 9)
  47809. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47810. t.push(n))
  47811. } else if (r instanceof Ci.Geometry) {
  47812. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47813. 0 < _.length && (i = _);
  47814. for (var b = 0, w = E.length; b < w; b++) {
  47815. var T = E[b]
  47816. , x = 1 == A ? C[T.materialIndex] : o;
  47817. if (void 0 !== x) {
  47818. if (m = I[T.a],
  47819. v = I[T.b],
  47820. y = I[T.c],
  47821. !0 === x.morphTargets) {
  47822. var S = r.morphTargets
  47823. , M = this.morphTargetInfluences;
  47824. Mt.set(0, 0, 0),
  47825. Rt.set(0, 0, 0),
  47826. Pt.set(0, 0, 0);
  47827. for (var R = 0, P = S.length; R < P; R++) {
  47828. var O = M[R];
  47829. if (0 !== O) {
  47830. var L = S[R].vertices;
  47831. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47832. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47833. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47834. }
  47835. }
  47836. Mt.add(m),
  47837. Rt.add(v),
  47838. Pt.add(y),
  47839. m = Mt,
  47840. v = Rt,
  47841. y = Pt
  47842. }
  47843. if (n = wi(this, e, xt, m, v, y, kt)) {
  47844. if (i) {
  47845. var D = i[b];
  47846. Nt.copy(D[0]),
  47847. Ft.copy(D[1]),
  47848. Bt.copy(D[2]),
  47849. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47850. }
  47851. n.face = T,
  47852. n.faceIndex = b,
  47853. t.push(n)
  47854. }
  47855. }
  47856. }
  47857. }
  47858. }
  47859. ),
  47860. Ci.Mesh.prototype.clone = function() {
  47861. return new this.constructor(this.geometry,this.material).copy(this)
  47862. }
  47863. ,
  47864. Ci.Bone = function(e) {
  47865. Ci.Object3D.call(this),
  47866. this.type = "Bone",
  47867. this.skin = e
  47868. }
  47869. ,
  47870. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47871. Ci.Bone.prototype.constructor = Ci.Bone,
  47872. Ci.Bone.prototype.copy = function(e) {
  47873. return Ci.Object3D.prototype.copy.call(this, e),
  47874. this.skin = e.skin,
  47875. this
  47876. }
  47877. ,
  47878. Ci.Skeleton = function(e, t, i) {
  47879. if (this.useVertexTexture = void 0 === i || i,
  47880. this.identityMatrix = new Ci.Matrix4,
  47881. e = e || [],
  47882. this.bones = e.slice(0),
  47883. this.useVertexTexture) {
  47884. var n = Math.sqrt(4 * this.bones.length);
  47885. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47886. n = Math.max(n, 4),
  47887. this.boneTextureWidth = n,
  47888. this.boneTextureHeight = n,
  47889. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47890. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47891. } else
  47892. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47893. if (void 0 === t)
  47894. this.calculateInverses();
  47895. else if (this.bones.length === t.length)
  47896. this.boneInverses = t.slice(0);
  47897. else {
  47898. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47899. this.boneInverses = [];
  47900. for (var r = 0, o = this.bones.length; r < o; r++)
  47901. this.boneInverses.push(new Ci.Matrix4)
  47902. }
  47903. }
  47904. ,
  47905. Ci.Skeleton.prototype.calculateInverses = function() {
  47906. this.boneInverses = [];
  47907. for (var e = 0, t = this.bones.length; e < t; e++) {
  47908. var i = new Ci.Matrix4;
  47909. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47910. this.boneInverses.push(i)
  47911. }
  47912. }
  47913. ,
  47914. Ci.Skeleton.prototype.pose = function() {
  47915. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47916. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47917. for (t = 0,
  47918. i = this.bones.length; t < i; t++)
  47919. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47920. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47921. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47922. }
  47923. ,
  47924. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47925. function() {
  47926. for (var e = 0, t = this.bones.length; e < t; e++) {
  47927. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47928. wt.multiplyMatrices(i, this.boneInverses[e]),
  47929. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47930. }
  47931. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47932. }
  47933. ),
  47934. Ci.Skeleton.prototype.clone = function() {
  47935. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47936. }
  47937. ,
  47938. Ci.SkinnedMesh = function(e, t, i) {
  47939. Ci.Mesh.call(this, e, t),
  47940. this.type = "SkinnedMesh",
  47941. this.bindMode = "attached",
  47942. this.bindMatrix = new Ci.Matrix4,
  47943. this.bindMatrixInverse = new Ci.Matrix4;
  47944. var n = [];
  47945. if (this.geometry && void 0 !== this.geometry.bones) {
  47946. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47947. o = this.geometry.bones[a],
  47948. r = new Ci.Bone(this),
  47949. n.push(r),
  47950. r.name = o.name,
  47951. r.position.fromArray(o.pos),
  47952. r.quaternion.fromArray(o.rotq),
  47953. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47954. for (a = 0,
  47955. s = this.geometry.bones.length; a < s; ++a)
  47956. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47957. }
  47958. this.normalizeSkinWeights(),
  47959. this.updateMatrixWorld(!0),
  47960. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47961. }
  47962. ,
  47963. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47964. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47965. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47966. this.skeleton = e,
  47967. void 0 === t && (this.updateMatrixWorld(!0),
  47968. this.skeleton.calculateInverses(),
  47969. t = this.matrixWorld),
  47970. this.bindMatrix.copy(t),
  47971. this.bindMatrixInverse.getInverse(t)
  47972. }
  47973. ,
  47974. Ci.SkinnedMesh.prototype.pose = function() {
  47975. this.skeleton.pose()
  47976. }
  47977. ,
  47978. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47979. if (this.geometry instanceof Ci.Geometry)
  47980. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47981. var t = this.geometry.skinWeights[e];
  47982. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47983. }
  47984. else if (this.geometry instanceof Ci.BufferGeometry) {
  47985. var i = new Ci.Vector4
  47986. , n = this.geometry.attributes.skinWeight;
  47987. for (e = 0; e < n.count; e++) {
  47988. var r;
  47989. i.x = n.getX(e),
  47990. i.y = n.getY(e),
  47991. i.z = n.getZ(e),
  47992. i.w = n.getW(e),
  47993. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47994. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47995. }
  47996. }
  47997. }
  47998. ,
  47999. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  48000. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  48001. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  48002. }
  48003. ,
  48004. Ci.SkinnedMesh.prototype.clone = function() {
  48005. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  48006. }
  48007. ,
  48008. Ci.LOD = function() {
  48009. Ci.Object3D.call(this),
  48010. this.type = "LOD",
  48011. Object.defineProperties(this, {
  48012. levels: {
  48013. enumerable: !0,
  48014. value: []
  48015. },
  48016. objects: {
  48017. get: function() {
  48018. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  48019. this.levels
  48020. }
  48021. }
  48022. })
  48023. }
  48024. ,
  48025. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  48026. Ci.LOD.prototype.constructor = Ci.LOD,
  48027. Ci.LOD.prototype.addLevel = function(e, t) {
  48028. void 0 === t && (t = 0),
  48029. t = Math.abs(t);
  48030. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  48031. ;
  48032. i.splice(n, 0, {
  48033. distance: t,
  48034. object: e
  48035. }),
  48036. this.add(e)
  48037. }
  48038. ,
  48039. Ci.LOD.prototype.getObjectForDistance = function(e) {
  48040. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  48041. ;
  48042. return t[i - 1].object
  48043. }
  48044. ,
  48045. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  48046. function(e, t) {
  48047. bt.setFromMatrixPosition(this.matrixWorld);
  48048. var i = e.ray.origin.distanceTo(bt);
  48049. this.getObjectForDistance(i).raycast(e, t)
  48050. }
  48051. ),
  48052. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  48053. _t = new Ci.Vector3,
  48054. function(e) {
  48055. var t = this.levels;
  48056. if (1 < t.length) {
  48057. Et.setFromMatrixPosition(e.matrixWorld),
  48058. _t.setFromMatrixPosition(this.matrixWorld);
  48059. var i = Et.distanceTo(_t);
  48060. t[0].object.visible = !0;
  48061. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  48062. t[n - 1].object.visible = !1,
  48063. t[n].object.visible = !0;
  48064. for (; n < r; n++)
  48065. t[n].object.visible = !1
  48066. }
  48067. }
  48068. ),
  48069. Ci.LOD.prototype.copy = function(e) {
  48070. Ci.Object3D.prototype.copy.call(this, e, !1);
  48071. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  48072. var r = t[i];
  48073. this.addLevel(r.object.clone(), r.distance)
  48074. }
  48075. return this
  48076. }
  48077. ,
  48078. Ci.LOD.prototype.toJSON = function(e) {
  48079. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  48080. t.object.levels = [];
  48081. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  48082. var o = i[n];
  48083. t.object.levels.push({
  48084. object: o.object.uuid,
  48085. distance: o.distance
  48086. })
  48087. }
  48088. return t
  48089. }
  48090. ,
  48091. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  48092. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  48093. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  48094. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  48095. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  48096. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  48097. function(e) {
  48098. Ci.Object3D.call(this),
  48099. this.type = "Sprite",
  48100. this.geometry = It,
  48101. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  48102. }
  48103. ),
  48104. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  48105. Ci.Sprite.prototype.constructor = Ci.Sprite,
  48106. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  48107. function(e, t) {
  48108. vt.setFromMatrixPosition(this.matrixWorld);
  48109. var i = e.ray.distanceSqToPoint(vt);
  48110. this.scale.x * this.scale.y < i || t.push({
  48111. distance: Math.sqrt(i),
  48112. point: this.position,
  48113. face: null,
  48114. object: this
  48115. })
  48116. }
  48117. ),
  48118. Ci.Sprite.prototype.clone = function() {
  48119. return new this.constructor(this.material).copy(this)
  48120. }
  48121. ,
  48122. Ci.Particle = Ci.Sprite,
  48123. Ci.LensFlare = function(e, t, i, n, r) {
  48124. Ci.Object3D.call(this),
  48125. this.lensFlares = [],
  48126. this.positionScreen = new Ci.Vector3,
  48127. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  48128. }
  48129. ,
  48130. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  48131. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  48132. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  48133. void 0 === t && (t = -1),
  48134. void 0 === i && (i = 0),
  48135. void 0 === o && (o = 1),
  48136. void 0 === r && (r = new Ci.Color(16777215)),
  48137. void 0 === n && (n = Ci.NormalBlending),
  48138. i = Math.min(i, Math.max(0, i)),
  48139. this.lensFlares.push({
  48140. texture: e,
  48141. size: t,
  48142. distance: i,
  48143. x: 0,
  48144. y: 0,
  48145. z: 0,
  48146. scale: 1,
  48147. rotation: 0,
  48148. opacity: o,
  48149. color: r,
  48150. blending: n
  48151. })
  48152. }
  48153. ,
  48154. Ci.LensFlare.prototype.updateLensFlares = function() {
  48155. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  48156. for (e = 0; e < i; e++)
  48157. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  48158. t.y = this.positionScreen.y + r * t.distance,
  48159. t.wantedRotation = t.x * Math.PI * .25,
  48160. t.rotation += .25 * (t.wantedRotation - t.rotation)
  48161. }
  48162. ,
  48163. Ci.LensFlare.prototype.copy = function(e) {
  48164. Ci.Object3D.prototype.copy.call(this, e),
  48165. this.positionScreen.copy(e.positionScreen),
  48166. this.customUpdateCallback = e.customUpdateCallback;
  48167. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  48168. this.lensFlares.push(e.lensFlares[t]);
  48169. return this
  48170. }
  48171. ,
  48172. Ci.Scene = function() {
  48173. Ci.Object3D.call(this),
  48174. this.type = "Scene",
  48175. this.fog = null,
  48176. this.overrideMaterial = null,
  48177. this.autoUpdate = !0
  48178. }
  48179. ,
  48180. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  48181. Ci.Scene.prototype.constructor = Ci.Scene,
  48182. Ci.Scene.prototype.copy = function(e, t) {
  48183. return Ci.Object3D.prototype.copy.call(this, e, t),
  48184. null !== e.fog && (this.fog = e.fog.clone()),
  48185. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  48186. this.autoUpdate = e.autoUpdate,
  48187. this.matrixAutoUpdate = e.matrixAutoUpdate,
  48188. this
  48189. }
  48190. ,
  48191. Ci.Fog = function(e, t, i) {
  48192. this.name = "",
  48193. this.color = new Ci.Color(e),
  48194. this.near = void 0 !== t ? t : 1,
  48195. this.far = void 0 !== i ? i : 1e3
  48196. }
  48197. ,
  48198. Ci.Fog.prototype.clone = function() {
  48199. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  48200. }
  48201. ,
  48202. Ci.FogExp2 = function(e, t) {
  48203. this.name = "",
  48204. this.color = new Ci.Color(e),
  48205. this.density = void 0 !== t ? t : 25e-5
  48206. }
  48207. ,
  48208. Ci.FogExp2.prototype.clone = function() {
  48209. return new Ci.FogExp2(this.color.getHex(),this.density)
  48210. }
  48211. ,
  48212. Ci.ShaderChunk = {},
  48213. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  48214. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  48215. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  48216. 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",
  48217. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  48218. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  48219. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  48220. 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",
  48221. 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",
  48222. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  48223. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  48224. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  48225. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  48226. 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",
  48227. 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",
  48228. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  48229. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  48230. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  48231. 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",
  48232. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  48233. 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",
  48234. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  48235. 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",
  48236. 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",
  48237. 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",
  48238. 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",
  48239. 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",
  48240. 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",
  48241. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  48242. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  48243. 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",
  48244. 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",
  48245. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  48246. 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",
  48247. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  48248. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  48249. 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",
  48250. 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",
  48251. 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",
  48252. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  48253. 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",
  48254. 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",
  48255. 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",
  48256. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  48257. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  48258. 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",
  48259. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  48260. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  48261. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  48262. 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",
  48263. 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",
  48264. 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",
  48265. 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",
  48266. 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",
  48267. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  48268. 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",
  48269. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  48270. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  48271. 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",
  48272. 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",
  48273. 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",
  48274. 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",
  48275. 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",
  48276. 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",
  48277. 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",
  48278. 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",
  48279. 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",
  48280. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  48281. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  48282. 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",
  48283. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  48284. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  48285. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  48286. 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",
  48287. 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",
  48288. 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",
  48289. 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",
  48290. Ci.UniformsUtils = {
  48291. merge: function(e) {
  48292. for (var t = {}, i = 0; i < e.length; i++) {
  48293. var n = this.clone(e[i]);
  48294. for (var r in n)
  48295. t[r] = n[r]
  48296. }
  48297. return t
  48298. },
  48299. clone: function(e) {
  48300. var t = {};
  48301. for (var i in e)
  48302. for (var n in t[i] = {},
  48303. e[i]) {
  48304. var r = e[i][n];
  48305. 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
  48306. }
  48307. return t
  48308. }
  48309. },
  48310. Ci.UniformsLib = {
  48311. common: {
  48312. diffuse: {
  48313. type: "c",
  48314. value: new Ci.Color(15658734)
  48315. },
  48316. opacity: {
  48317. type: "f",
  48318. value: 1
  48319. },
  48320. map: {
  48321. type: "t",
  48322. value: null
  48323. },
  48324. offsetRepeat: {
  48325. type: "v4",
  48326. value: new Ci.Vector4(0,0,1,1)
  48327. },
  48328. specularMap: {
  48329. type: "t",
  48330. value: null
  48331. },
  48332. alphaMap: {
  48333. type: "t",
  48334. value: null
  48335. },
  48336. envMap: {
  48337. type: "t",
  48338. value: null
  48339. },
  48340. flipEnvMap: {
  48341. type: "f",
  48342. value: -1
  48343. },
  48344. reflectivity: {
  48345. type: "f",
  48346. value: 1
  48347. },
  48348. refractionRatio: {
  48349. type: "f",
  48350. value: .98
  48351. }
  48352. },
  48353. aomap: {
  48354. aoMap: {
  48355. type: "t",
  48356. value: null
  48357. },
  48358. aoMapIntensity: {
  48359. type: "f",
  48360. value: 1
  48361. }
  48362. },
  48363. lightmap: {
  48364. lightMap: {
  48365. type: "t",
  48366. value: null
  48367. },
  48368. lightMapIntensity: {
  48369. type: "f",
  48370. value: 1
  48371. }
  48372. },
  48373. emissivemap: {
  48374. emissiveMap: {
  48375. type: "t",
  48376. value: null
  48377. }
  48378. },
  48379. bumpmap: {
  48380. bumpMap: {
  48381. type: "t",
  48382. value: null
  48383. },
  48384. bumpScale: {
  48385. type: "f",
  48386. value: 1
  48387. }
  48388. },
  48389. normalmap: {
  48390. normalMap: {
  48391. type: "t",
  48392. value: null
  48393. },
  48394. normalScale: {
  48395. type: "v2",
  48396. value: new Ci.Vector2(1,1)
  48397. }
  48398. },
  48399. displacementmap: {
  48400. displacementMap: {
  48401. type: "t",
  48402. value: null
  48403. },
  48404. displacementScale: {
  48405. type: "f",
  48406. value: 1
  48407. },
  48408. displacementBias: {
  48409. type: "f",
  48410. value: 0
  48411. }
  48412. },
  48413. roughnessmap: {
  48414. roughnessMap: {
  48415. type: "t",
  48416. value: null
  48417. }
  48418. },
  48419. metalnessmap: {
  48420. metalnessMap: {
  48421. type: "t",
  48422. value: null
  48423. }
  48424. },
  48425. fog: {
  48426. fogDensity: {
  48427. type: "f",
  48428. value: 25e-5
  48429. },
  48430. fogNear: {
  48431. type: "f",
  48432. value: 1
  48433. },
  48434. fogFar: {
  48435. type: "f",
  48436. value: 2e3
  48437. },
  48438. fogColor: {
  48439. type: "c",
  48440. value: new Ci.Color(16777215)
  48441. }
  48442. },
  48443. lights: {
  48444. ambientLightColor: {
  48445. type: "fv",
  48446. value: []
  48447. },
  48448. directionalLights: {
  48449. type: "sa",
  48450. value: [],
  48451. properties: {
  48452. direction: {
  48453. type: "v3"
  48454. },
  48455. color: {
  48456. type: "c"
  48457. },
  48458. shadow: {
  48459. type: "i"
  48460. },
  48461. shadowBias: {
  48462. type: "f"
  48463. },
  48464. shadowRadius: {
  48465. type: "f"
  48466. },
  48467. shadowMapSize: {
  48468. type: "v2"
  48469. }
  48470. }
  48471. },
  48472. directionalShadowMap: {
  48473. type: "tv",
  48474. value: []
  48475. },
  48476. directionalShadowMatrix: {
  48477. type: "m4v",
  48478. value: []
  48479. },
  48480. spotLights: {
  48481. type: "sa",
  48482. value: [],
  48483. properties: {
  48484. color: {
  48485. type: "c"
  48486. },
  48487. position: {
  48488. type: "v3"
  48489. },
  48490. direction: {
  48491. type: "v3"
  48492. },
  48493. distance: {
  48494. type: "f"
  48495. },
  48496. coneCos: {
  48497. type: "f"
  48498. },
  48499. penumbraCos: {
  48500. type: "f"
  48501. },
  48502. decay: {
  48503. type: "f"
  48504. },
  48505. shadow: {
  48506. type: "i"
  48507. },
  48508. shadowBias: {
  48509. type: "f"
  48510. },
  48511. shadowRadius: {
  48512. type: "f"
  48513. },
  48514. shadowMapSize: {
  48515. type: "v2"
  48516. }
  48517. }
  48518. },
  48519. spotShadowMap: {
  48520. type: "tv",
  48521. value: []
  48522. },
  48523. spotShadowMatrix: {
  48524. type: "m4v",
  48525. value: []
  48526. },
  48527. pointLights: {
  48528. type: "sa",
  48529. value: [],
  48530. properties: {
  48531. color: {
  48532. type: "c"
  48533. },
  48534. position: {
  48535. type: "v3"
  48536. },
  48537. decay: {
  48538. type: "f"
  48539. },
  48540. distance: {
  48541. type: "f"
  48542. },
  48543. shadow: {
  48544. type: "i"
  48545. },
  48546. shadowBias: {
  48547. type: "f"
  48548. },
  48549. shadowRadius: {
  48550. type: "f"
  48551. },
  48552. shadowMapSize: {
  48553. type: "v2"
  48554. }
  48555. }
  48556. },
  48557. pointShadowMap: {
  48558. type: "tv",
  48559. value: []
  48560. },
  48561. pointShadowMatrix: {
  48562. type: "m4v",
  48563. value: []
  48564. },
  48565. hemisphereLights: {
  48566. type: "sa",
  48567. value: [],
  48568. properties: {
  48569. direction: {
  48570. type: "v3"
  48571. },
  48572. skyColor: {
  48573. type: "c"
  48574. },
  48575. groundColor: {
  48576. type: "c"
  48577. }
  48578. }
  48579. }
  48580. },
  48581. points: {
  48582. diffuse: {
  48583. type: "c",
  48584. value: new Ci.Color(15658734)
  48585. },
  48586. opacity: {
  48587. type: "f",
  48588. value: 1
  48589. },
  48590. size: {
  48591. type: "f",
  48592. value: 1
  48593. },
  48594. scale: {
  48595. type: "f",
  48596. value: 1
  48597. },
  48598. map: {
  48599. type: "t",
  48600. value: null
  48601. },
  48602. offsetRepeat: {
  48603. type: "v4",
  48604. value: new Ci.Vector4(0,0,1,1)
  48605. }
  48606. }
  48607. },
  48608. 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",
  48609. 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",
  48610. 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",
  48611. 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",
  48612. 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",
  48613. 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",
  48614. 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",
  48615. 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",
  48616. 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",
  48617. 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",
  48618. 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",
  48619. 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",
  48620. 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",
  48621. 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",
  48622. 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",
  48623. 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",
  48624. 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",
  48625. 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",
  48626. 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",
  48627. 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",
  48628. 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",
  48629. 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",
  48630. 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",
  48631. 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",
  48632. Ci.ShaderLib = {
  48633. basic: {
  48634. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48635. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48636. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48637. },
  48638. lambert: {
  48639. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48640. emissive: {
  48641. type: "c",
  48642. value: new Ci.Color(0)
  48643. }
  48644. }]),
  48645. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48646. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48647. },
  48648. phong: {
  48649. 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, {
  48650. emissive: {
  48651. type: "c",
  48652. value: new Ci.Color(0)
  48653. },
  48654. specular: {
  48655. type: "c",
  48656. value: new Ci.Color(1118481)
  48657. },
  48658. shininess: {
  48659. type: "f",
  48660. value: 30
  48661. }
  48662. }]),
  48663. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48664. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48665. },
  48666. standard: {
  48667. 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, {
  48668. emissive: {
  48669. type: "c",
  48670. value: new Ci.Color(0)
  48671. },
  48672. roughness: {
  48673. type: "f",
  48674. value: .5
  48675. },
  48676. metalness: {
  48677. type: "f",
  48678. value: 0
  48679. },
  48680. envMapIntensity: {
  48681. type: "f",
  48682. value: 1
  48683. }
  48684. }]),
  48685. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48686. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48687. },
  48688. points: {
  48689. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48690. vertexShader: Ci.ShaderChunk.points_vert,
  48691. fragmentShader: Ci.ShaderChunk.points_frag
  48692. },
  48693. dashed: {
  48694. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48695. scale: {
  48696. type: "f",
  48697. value: 1
  48698. },
  48699. dashSize: {
  48700. type: "f",
  48701. value: 1
  48702. },
  48703. totalSize: {
  48704. type: "f",
  48705. value: 2
  48706. }
  48707. }]),
  48708. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48709. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48710. },
  48711. depth: {
  48712. uniforms: {
  48713. mNear: {
  48714. type: "f",
  48715. value: 1
  48716. },
  48717. mFar: {
  48718. type: "f",
  48719. value: 2e3
  48720. },
  48721. opacity: {
  48722. type: "f",
  48723. value: 1
  48724. }
  48725. },
  48726. vertexShader: Ci.ShaderChunk.depth_vert,
  48727. fragmentShader: Ci.ShaderChunk.depth_frag
  48728. },
  48729. normal: {
  48730. uniforms: {
  48731. opacity: {
  48732. type: "f",
  48733. value: 1
  48734. }
  48735. },
  48736. vertexShader: Ci.ShaderChunk.normal_vert,
  48737. fragmentShader: Ci.ShaderChunk.normal_frag
  48738. },
  48739. cube: {
  48740. uniforms: {
  48741. tCube: {
  48742. type: "t",
  48743. value: null
  48744. },
  48745. tFlip: {
  48746. type: "f",
  48747. value: -1
  48748. }
  48749. },
  48750. vertexShader: Ci.ShaderChunk.cube_vert,
  48751. fragmentShader: Ci.ShaderChunk.cube_frag
  48752. },
  48753. equirect: {
  48754. uniforms: {
  48755. tEquirect: {
  48756. type: "t",
  48757. value: null
  48758. },
  48759. tFlip: {
  48760. type: "f",
  48761. value: -1
  48762. }
  48763. },
  48764. vertexShader: Ci.ShaderChunk.equirect_vert,
  48765. fragmentShader: Ci.ShaderChunk.equirect_frag
  48766. },
  48767. depthRGBA: {
  48768. uniforms: {},
  48769. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48770. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48771. },
  48772. distanceRGBA: {
  48773. uniforms: {
  48774. lightPos: {
  48775. type: "v3",
  48776. value: new Ci.Vector3(0,0,0)
  48777. }
  48778. },
  48779. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48780. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48781. }
  48782. },
  48783. Ci.WebGLRenderer = function(e) {
  48784. function S() {
  48785. return null === Q ? he : 1
  48786. }
  48787. function i(e, t, i, n) {
  48788. !0 === V && (e *= n,
  48789. t *= n,
  48790. i *= n),
  48791. _e.clearColor(e, t, i, n)
  48792. }
  48793. function t() {
  48794. _e.init(),
  48795. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48796. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48797. i(ae.r, ae.g, ae.b, se)
  48798. }
  48799. function n() {
  48800. te = K = null,
  48801. ee = "",
  48802. $ = -1,
  48803. _e.reset()
  48804. }
  48805. function r(e) {
  48806. e.preventDefault(),
  48807. n(),
  48808. t(),
  48809. be.clear()
  48810. }
  48811. function f(e) {
  48812. var t = e.target;
  48813. t.removeEventListener("dispose", f),
  48814. function(e) {
  48815. var t = be.get(e);
  48816. if (e.image && t.__image__webglTextureCube)
  48817. X.deleteTexture(t.__image__webglTextureCube);
  48818. else {
  48819. if (void 0 === t.__webglInit)
  48820. return;
  48821. X.deleteTexture(t.__webglTexture)
  48822. }
  48823. be.delete(e)
  48824. }(t),
  48825. ye.textures--
  48826. }
  48827. function a(e) {
  48828. var t = e.target;
  48829. t.removeEventListener("dispose", a),
  48830. function(e) {
  48831. var t = be.get(e)
  48832. , i = be.get(e.texture);
  48833. if (e && void 0 !== i.__webglTexture) {
  48834. if (X.deleteTexture(i.__webglTexture),
  48835. e instanceof Ci.WebGLRenderTargetCube)
  48836. for (var n = 0; n < 6; n++)
  48837. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48838. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48839. else
  48840. X.deleteFramebuffer(t.__webglFramebuffer),
  48841. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48842. be.delete(e.texture),
  48843. be.delete(e)
  48844. }
  48845. }(t),
  48846. ye.textures--
  48847. }
  48848. function v(e) {
  48849. var t = e.target;
  48850. t.removeEventListener("dispose", v),
  48851. function(e) {
  48852. y(e),
  48853. be.delete(e)
  48854. }(t)
  48855. }
  48856. function y(e) {
  48857. var t = be.get(e).program;
  48858. (e.program = void 0) !== t && Te.releaseProgram(t)
  48859. }
  48860. function M(e, t) {
  48861. return Math.abs(t[0]) - Math.abs(e[0])
  48862. }
  48863. function s(e, t) {
  48864. 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
  48865. }
  48866. function l(e, t) {
  48867. 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
  48868. }
  48869. function d(e, t, i, n, r) {
  48870. var o, a;
  48871. a = i.transparent ? (o = G,
  48872. ++W) : (o = H,
  48873. ++z);
  48874. var s = o[a];
  48875. void 0 !== s ? (s.id = e.id,
  48876. s.object = e,
  48877. s.geometry = t,
  48878. s.material = i,
  48879. s.z = me.z,
  48880. s.group = r) : (s = {
  48881. id: e.id,
  48882. object: e,
  48883. geometry: t,
  48884. material: i,
  48885. z: me.z,
  48886. group: r
  48887. },
  48888. o.push(s))
  48889. }
  48890. function c(e, t, i, n) {
  48891. for (var r = 0, o = e.length; r < o; r++) {
  48892. var a = e[r]
  48893. , s = a.object
  48894. , l = a.geometry
  48895. , c = void 0 === n ? a.material : n
  48896. , h = a.group;
  48897. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48898. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48899. s instanceof Ci.ImmediateRenderObject) {
  48900. R(c);
  48901. var u = P(t, i, c, s);
  48902. ee = "",
  48903. s.render(function(e) {
  48904. Z.renderBufferImmediate(e, u, c)
  48905. })
  48906. } else
  48907. Z.renderBufferDirect(t, i, l, c, s, h)
  48908. }
  48909. }
  48910. function R(e) {
  48911. (function(e) {
  48912. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48913. _e.setFlipSided(e.side === Ci.BackSide)
  48914. }
  48915. )(e),
  48916. !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),
  48917. _e.setDepthFunc(e.depthFunc),
  48918. _e.setDepthTest(e.depthTest),
  48919. _e.setDepthWrite(e.depthWrite),
  48920. _e.setColorWrite(e.colorWrite),
  48921. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48922. }
  48923. function P(e, t, i, n) {
  48924. oe = 0;
  48925. var r = be.get(i);
  48926. void 0 === r.program && (i.needsUpdate = !0),
  48927. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48928. i.needsUpdate && (function(e, t, i) {
  48929. var n = be.get(e)
  48930. , r = Te.getParameters(e, ve, t, i)
  48931. , o = Te.getProgramCode(e, r)
  48932. , a = n.program
  48933. , s = !0;
  48934. if (void 0 === a)
  48935. e.addEventListener("dispose", v);
  48936. else if (a.code !== o)
  48937. y(e);
  48938. else {
  48939. if (void 0 !== r.shaderID)
  48940. return;
  48941. s = !1
  48942. }
  48943. if (s) {
  48944. if (r.shaderID) {
  48945. var l = Ci.ShaderLib[r.shaderID];
  48946. n.__webglShader = {
  48947. name: e.type,
  48948. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48949. vertexShader: l.vertexShader,
  48950. fragmentShader: l.fragmentShader
  48951. }
  48952. } else
  48953. n.__webglShader = {
  48954. name: e.type,
  48955. uniforms: e.uniforms,
  48956. vertexShader: e.vertexShader,
  48957. fragmentShader: e.fragmentShader
  48958. };
  48959. e.__webglShader = n.__webglShader,
  48960. a = Te.acquireProgram(e, r, o),
  48961. n.program = a,
  48962. e.program = a
  48963. }
  48964. var c = a.getAttributes();
  48965. if (e.morphTargets)
  48966. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48967. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48968. if (e.morphNormals)
  48969. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48970. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48971. n.uniformsList = [];
  48972. var u = n.__webglShader.uniforms
  48973. , d = n.program.getUniforms();
  48974. for (var p in u) {
  48975. var f = d[p];
  48976. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48977. }
  48978. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48979. u.ambientLightColor.value = ve.ambient,
  48980. u.directionalLights.value = ve.directional,
  48981. u.spotLights.value = ve.spot,
  48982. u.pointLights.value = ve.point,
  48983. u.hemisphereLights.value = ve.hemi,
  48984. u.directionalShadowMap.value = ve.directionalShadowMap,
  48985. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48986. u.spotShadowMap.value = ve.spotShadowMap,
  48987. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48988. u.pointShadowMap.value = ve.pointShadowMap,
  48989. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48990. n.hasDynamicUniforms = !1;
  48991. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48992. if (!0 === n.uniformsList[g][0].dynamic) {
  48993. n.hasDynamicUniforms = !0;
  48994. break
  48995. }
  48996. }
  48997. }(i, t, n),
  48998. i.needsUpdate = !1);
  48999. var o = !1
  49000. , a = !1
  49001. , s = !1
  49002. , l = r.program
  49003. , c = l.getUniforms()
  49004. , h = r.__webglShader.uniforms;
  49005. if (l.id !== K && (X.useProgram(l.program),
  49006. K = l.id,
  49007. s = a = o = !0),
  49008. i.id !== $ && ($ = i.id,
  49009. a = !0),
  49010. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  49011. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  49012. e !== te && (te = e,
  49013. s = a = !0),
  49014. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  49015. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  49016. (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),
  49017. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  49018. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  49019. i.skinning)
  49020. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  49021. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  49022. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  49023. if (void 0 !== c.boneTexture) {
  49024. var u = A();
  49025. X.uniform1i(c.boneTexture, u),
  49026. Z.setTexture(n.skeleton.boneTexture, u)
  49027. }
  49028. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  49029. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  49030. } else
  49031. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  49032. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  49033. e.ambientLightColor.needsUpdate = t,
  49034. e.directionalLights.needsUpdate = t,
  49035. e.pointLights.needsUpdate = t,
  49036. e.spotLights.needsUpdate = t,
  49037. e.hemisphereLights.needsUpdate = t
  49038. }(h, s),
  49039. t && i.fog && function(e, t) {
  49040. e.fogColor.value = t.color,
  49041. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  49042. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  49043. }(h, t),
  49044. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  49045. var i;
  49046. if (e.opacity.value = t.opacity,
  49047. e.diffuse.value = t.color,
  49048. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  49049. e.map.value = t.map,
  49050. e.specularMap.value = t.specularMap,
  49051. e.alphaMap.value = t.alphaMap,
  49052. t.aoMap && (e.aoMap.value = t.aoMap,
  49053. e.aoMapIntensity.value = t.aoMapIntensity),
  49054. 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),
  49055. void 0 !== i) {
  49056. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  49057. var n = i.offset
  49058. , r = i.repeat;
  49059. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  49060. }
  49061. e.envMap.value = t.envMap,
  49062. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  49063. e.reflectivity.value = t.reflectivity,
  49064. e.refractionRatio.value = t.refractionRatio
  49065. }(h, i),
  49066. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  49067. function(e, t) {
  49068. e.dashSize.value = t.dashSize,
  49069. e.totalSize.value = t.dashSize + t.gapSize,
  49070. e.scale.value = t.scale
  49071. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  49072. if (e.diffuse.value = t.color,
  49073. e.opacity.value = t.opacity,
  49074. e.size.value = t.size * he,
  49075. e.scale.value = O.clientHeight / 2,
  49076. e.map.value = t.map,
  49077. null !== t.map) {
  49078. var i = t.map.offset
  49079. , n = t.map.repeat;
  49080. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  49081. }
  49082. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  49083. t.lightMap && (e.lightMap.value = t.lightMap,
  49084. e.lightMapIntensity.value = t.lightMapIntensity),
  49085. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  49086. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  49087. e.specular.value = t.specular,
  49088. e.shininess.value = Math.max(t.shininess, 1e-4),
  49089. t.lightMap && (e.lightMap.value = t.lightMap,
  49090. e.lightMapIntensity.value = t.lightMapIntensity),
  49091. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49092. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49093. e.bumpScale.value = t.bumpScale),
  49094. t.normalMap && (e.normalMap.value = t.normalMap,
  49095. e.normalScale.value.copy(t.normalScale)),
  49096. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49097. e.displacementScale.value = t.displacementScale,
  49098. e.displacementBias.value = t.displacementBias)
  49099. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  49100. e.roughness.value = t.roughness,
  49101. e.metalness.value = t.metalness,
  49102. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  49103. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  49104. t.lightMap && (e.lightMap.value = t.lightMap,
  49105. e.lightMapIntensity.value = t.lightMapIntensity),
  49106. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49107. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49108. e.bumpScale.value = t.bumpScale),
  49109. t.normalMap && (e.normalMap.value = t.normalMap,
  49110. e.normalScale.value.copy(t.normalScale)),
  49111. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49112. e.displacementScale.value = t.displacementScale,
  49113. e.displacementBias.value = t.displacementBias),
  49114. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  49115. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  49116. h.mFar.value = e.far,
  49117. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  49118. g(r.uniformsList)),
  49119. function(e, t) {
  49120. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  49121. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  49122. }(c, n),
  49123. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  49124. !0 === r.hasDynamicUniforms && function(e, t, i) {
  49125. for (var n = [], r = 0, o = e.length; r < o; r++) {
  49126. var a = e[r][0]
  49127. , s = a.onUpdateCallback;
  49128. void 0 !== s && (s.bind(a)(t, i),
  49129. n.push(e[r]))
  49130. }
  49131. g(n)
  49132. }(r.uniformsList, n, e),
  49133. l
  49134. }
  49135. function p(e, t) {
  49136. e.diffuse.value = t.color,
  49137. e.opacity.value = t.opacity
  49138. }
  49139. function A() {
  49140. var e = oe;
  49141. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  49142. oe += 1,
  49143. e
  49144. }
  49145. function C(e, t, i, n) {
  49146. var r, o;
  49147. if ("1i" === t)
  49148. X.uniform1i(i, n);
  49149. else if ("1f" === t)
  49150. X.uniform1f(i, n);
  49151. else if ("2f" === t)
  49152. X.uniform2f(i, n[0], n[1]);
  49153. else if ("3f" === t)
  49154. X.uniform3f(i, n[0], n[1], n[2]);
  49155. else if ("4f" === t)
  49156. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  49157. else if ("1iv" === t)
  49158. X.uniform1iv(i, n);
  49159. else if ("3iv" === t)
  49160. X.uniform3iv(i, n);
  49161. else if ("1fv" === t)
  49162. X.uniform1fv(i, n);
  49163. else if ("2fv" === t)
  49164. X.uniform2fv(i, n);
  49165. else if ("3fv" === t)
  49166. X.uniform3fv(i, n);
  49167. else if ("4fv" === t)
  49168. X.uniform4fv(i, n);
  49169. else if ("Matrix2fv" === t)
  49170. X.uniformMatrix2fv(i, !1, n);
  49171. else if ("Matrix3fv" === t)
  49172. X.uniformMatrix3fv(i, !1, n);
  49173. else if ("Matrix4fv" === t)
  49174. X.uniformMatrix4fv(i, !1, n);
  49175. else if ("i" === t)
  49176. X.uniform1i(i, n);
  49177. else if ("f" === t)
  49178. X.uniform1f(i, n);
  49179. else if ("v2" === t)
  49180. X.uniform2f(i, n.x, n.y);
  49181. else if ("v3" === t)
  49182. X.uniform3f(i, n.x, n.y, n.z);
  49183. else if ("v4" === t)
  49184. X.uniform4f(i, n.x, n.y, n.z, n.w);
  49185. else if ("c" === t)
  49186. X.uniform3f(i, n.r, n.g, n.b);
  49187. else if ("s" === t) {
  49188. var a = e.properties;
  49189. for (var s in a) {
  49190. var l = a[s]
  49191. , c = i[s]
  49192. , h = n[s];
  49193. C(l, l.type, c, h)
  49194. }
  49195. } else if ("sa" === t) {
  49196. a = e.properties;
  49197. for (var u = 0, d = n.length; u < d; u++)
  49198. for (var s in a) {
  49199. l = a[s],
  49200. c = i[u][s],
  49201. h = n[u][s];
  49202. C(l, l.type, c, h)
  49203. }
  49204. } else if ("iv1" === t)
  49205. X.uniform1iv(i, n);
  49206. else if ("iv" === t)
  49207. X.uniform3iv(i, n);
  49208. else if ("fv1" === t)
  49209. X.uniform1fv(i, n);
  49210. else if ("fv" === t)
  49211. X.uniform3fv(i, n);
  49212. else if ("v2v" === t) {
  49213. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  49214. u = 0;
  49215. for (var p = 0, f = n.length; u < f; u++,
  49216. p += 2)
  49217. e._array[p + 0] = n[u].x,
  49218. e._array[p + 1] = n[u].y;
  49219. X.uniform2fv(i, e._array)
  49220. } else if ("v3v" === t) {
  49221. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  49222. u = 0;
  49223. var g = 0;
  49224. for (f = n.length; u < f; u++,
  49225. g += 3)
  49226. e._array[g + 0] = n[u].x,
  49227. e._array[g + 1] = n[u].y,
  49228. e._array[g + 2] = n[u].z;
  49229. X.uniform3fv(i, e._array)
  49230. } else if ("v4v" === t) {
  49231. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  49232. u = 0;
  49233. var m = 0;
  49234. for (f = n.length; u < f; u++,
  49235. m += 4)
  49236. e._array[m + 0] = n[u].x,
  49237. e._array[m + 1] = n[u].y,
  49238. e._array[m + 2] = n[u].z,
  49239. e._array[m + 3] = n[u].w;
  49240. X.uniform4fv(i, e._array)
  49241. } else if ("m2" === t)
  49242. X.uniformMatrix2fv(i, !1, n.elements);
  49243. else if ("m3" === t)
  49244. X.uniformMatrix3fv(i, !1, n.elements);
  49245. else if ("m3v" === t) {
  49246. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  49247. for (u = 0,
  49248. f = n.length; u < f; u++)
  49249. n[u].flattenToArrayOffset(e._array, 9 * u);
  49250. X.uniformMatrix3fv(i, !1, e._array)
  49251. } else if ("m4" === t)
  49252. X.uniformMatrix4fv(i, !1, n.elements);
  49253. else if ("m4v" === t) {
  49254. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  49255. for (u = 0,
  49256. f = n.length; u < f; u++)
  49257. n[u].flattenToArrayOffset(e._array, 16 * u);
  49258. X.uniformMatrix4fv(i, !1, e._array)
  49259. } else if ("t" === t) {
  49260. if (r = n,
  49261. o = A(),
  49262. X.uniform1i(i, o),
  49263. !r)
  49264. return;
  49265. 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)
  49266. } else if ("tv" === t) {
  49267. void 0 === e._array && (e._array = []);
  49268. for (u = 0,
  49269. f = e.value.length; u < f; u++)
  49270. e._array[u] = A();
  49271. X.uniform1iv(i, e._array);
  49272. for (u = 0,
  49273. f = e.value.length; u < f; u++)
  49274. r = e.value[u],
  49275. o = e._array[u],
  49276. 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))
  49277. } else
  49278. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  49279. }
  49280. function g(e) {
  49281. for (var t = 0, i = e.length; t < i; t++) {
  49282. var n = e[t][0];
  49283. if (!1 !== n.needsUpdate)
  49284. C(n, n.type, e[t][1], n.value)
  49285. }
  49286. }
  49287. function m(e, t, i) {
  49288. var n;
  49289. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  49290. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  49291. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  49292. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  49293. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  49294. 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),
  49295. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  49296. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  49297. 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)),
  49298. n = Ie.get("EXT_texture_filter_anisotropic")) {
  49299. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  49300. return;
  49301. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  49302. return;
  49303. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  49304. be.get(t).__currentAnisotropy = t.anisotropy)
  49305. }
  49306. }
  49307. function o(e, t, i) {
  49308. void 0 === e.__webglInit && (e.__webglInit = !0,
  49309. t.addEventListener("dispose", f),
  49310. e.__webglTexture = X.createTexture(),
  49311. ye.textures++),
  49312. _e.activeTexture(X.TEXTURE0 + i),
  49313. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  49314. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49315. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49316. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  49317. var n = I(t.image, Ee.maxTextureSize);
  49318. !function(e) {
  49319. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  49320. }(t) || !1 !== E(n) || (n = function(e) {
  49321. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49322. var t = document.createElement("canvas");
  49323. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  49324. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  49325. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  49326. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49327. t
  49328. }
  49329. return e
  49330. }(n));
  49331. var r = E(n)
  49332. , o = x(t.format)
  49333. , a = x(t.type);
  49334. m(X.TEXTURE_2D, t, r);
  49335. var s, l = t.mipmaps;
  49336. if (t instanceof Ci.DataTexture)
  49337. if (0 < l.length && r) {
  49338. for (var c = 0, h = l.length; c < h; c++)
  49339. s = l[c],
  49340. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  49341. t.generateMipmaps = !1
  49342. } else
  49343. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  49344. else if (t instanceof Ci.CompressedTexture)
  49345. for (c = 0,
  49346. h = l.length; c < h; c++)
  49347. s = l[c],
  49348. 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);
  49349. else if (0 < l.length && r) {
  49350. for (c = 0,
  49351. h = l.length; c < h; c++)
  49352. s = l[c],
  49353. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  49354. t.generateMipmaps = !1
  49355. } else
  49356. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  49357. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49358. e.__version = t.version,
  49359. t.onUpdate && t.onUpdate(t)
  49360. }
  49361. function I(e, t) {
  49362. if (e.width > t || e.height > t) {
  49363. var i = t / Math.max(e.width, e.height)
  49364. , n = document.createElement("canvas");
  49365. return n.width = Math.floor(e.width * i),
  49366. n.height = Math.floor(e.height * i),
  49367. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49368. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49369. n
  49370. }
  49371. return e
  49372. }
  49373. function E(e) {
  49374. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  49375. }
  49376. function _(e, t) {
  49377. var i = be.get(e);
  49378. if (6 === e.image.length)
  49379. if (0 < e.version && i.__version !== e.version) {
  49380. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  49381. i.__image__webglTextureCube = X.createTexture(),
  49382. ye.textures++),
  49383. _e.activeTexture(X.TEXTURE0 + t),
  49384. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49385. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49386. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  49387. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  49388. var s = E(o[0])
  49389. , l = x(e.format)
  49390. , c = x(e.type);
  49391. m(X.TEXTURE_CUBE_MAP, e, s);
  49392. for (a = 0; a < 6; a++)
  49393. if (n)
  49394. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  49395. h = u[d],
  49396. 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);
  49397. else
  49398. 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]);
  49399. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49400. i.__version = e.version,
  49401. e.onUpdate && e.onUpdate(e)
  49402. } else
  49403. _e.activeTexture(X.TEXTURE0 + t),
  49404. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49405. }
  49406. function b(e, t) {
  49407. _e.activeTexture(X.TEXTURE0 + t),
  49408. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  49409. }
  49410. function h(e, t, i, n) {
  49411. var r = x(t.texture.format)
  49412. , o = x(t.texture.type);
  49413. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49414. X.bindFramebuffer(X.FRAMEBUFFER, e),
  49415. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  49416. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49417. }
  49418. function u(e, t) {
  49419. X.bindRenderbuffer(X.RENDERBUFFER, e),
  49420. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  49421. 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),
  49422. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  49423. X.bindRenderbuffer(X.RENDERBUFFER, null)
  49424. }
  49425. function w(e) {
  49426. var t = be.get(e)
  49427. , i = be.get(e.texture);
  49428. e.addEventListener("dispose", a),
  49429. i.__webglTexture = X.createTexture(),
  49430. ye.textures++;
  49431. var n = e instanceof Ci.WebGLRenderTargetCube
  49432. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  49433. if (n) {
  49434. t.__webglFramebuffer = [];
  49435. for (var o = 0; o < 6; o++)
  49436. t.__webglFramebuffer[o] = X.createFramebuffer()
  49437. } else
  49438. t.__webglFramebuffer = X.createFramebuffer();
  49439. if (n) {
  49440. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  49441. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  49442. for (o = 0; o < 6; o++)
  49443. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  49444. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49445. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  49446. } else
  49447. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  49448. m(X.TEXTURE_2D, e.texture, r),
  49449. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  49450. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49451. _e.bindTexture(X.TEXTURE_2D, null);
  49452. e.depthBuffer && function(e) {
  49453. var t = be.get(e);
  49454. if (e instanceof Ci.WebGLRenderTargetCube) {
  49455. t.__webglDepthbuffer = [];
  49456. for (var i = 0; i < 6; i++)
  49457. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  49458. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  49459. u(t.__webglDepthbuffer[i], e)
  49460. } else
  49461. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  49462. t.__webglDepthbuffer = X.createRenderbuffer(),
  49463. u(t.__webglDepthbuffer, e);
  49464. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49465. }(e)
  49466. }
  49467. function T(e) {
  49468. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  49469. }
  49470. function x(e) {
  49471. var t;
  49472. if (e === Ci.RepeatWrapping)
  49473. return X.REPEAT;
  49474. if (e === Ci.ClampToEdgeWrapping)
  49475. return X.CLAMP_TO_EDGE;
  49476. if (e === Ci.MirroredRepeatWrapping)
  49477. return X.MIRRORED_REPEAT;
  49478. if (e === Ci.NearestFilter)
  49479. return X.NEAREST;
  49480. if (e === Ci.NearestMipMapNearestFilter)
  49481. return X.NEAREST_MIPMAP_NEAREST;
  49482. if (e === Ci.NearestMipMapLinearFilter)
  49483. return X.NEAREST_MIPMAP_LINEAR;
  49484. if (e === Ci.LinearFilter)
  49485. return X.LINEAR;
  49486. if (e === Ci.LinearMipMapNearestFilter)
  49487. return X.LINEAR_MIPMAP_NEAREST;
  49488. if (e === Ci.LinearMipMapLinearFilter)
  49489. return X.LINEAR_MIPMAP_LINEAR;
  49490. if (e === Ci.UnsignedByteType)
  49491. return X.UNSIGNED_BYTE;
  49492. if (e === Ci.UnsignedShort4444Type)
  49493. return X.UNSIGNED_SHORT_4_4_4_4;
  49494. if (e === Ci.UnsignedShort5551Type)
  49495. return X.UNSIGNED_SHORT_5_5_5_1;
  49496. if (e === Ci.UnsignedShort565Type)
  49497. return X.UNSIGNED_SHORT_5_6_5;
  49498. if (e === Ci.ByteType)
  49499. return X.BYTE;
  49500. if (e === Ci.ShortType)
  49501. return X.SHORT;
  49502. if (e === Ci.UnsignedShortType)
  49503. return X.UNSIGNED_SHORT;
  49504. if (e === Ci.IntType)
  49505. return X.INT;
  49506. if (e === Ci.UnsignedIntType)
  49507. return X.UNSIGNED_INT;
  49508. if (e === Ci.FloatType)
  49509. return X.FLOAT;
  49510. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49511. return t.HALF_FLOAT_OES;
  49512. if (e === Ci.AlphaFormat)
  49513. return X.ALPHA;
  49514. if (e === Ci.RGBFormat)
  49515. return X.RGB;
  49516. if (e === Ci.RGBAFormat)
  49517. return X.RGBA;
  49518. if (e === Ci.LuminanceFormat)
  49519. return X.LUMINANCE;
  49520. if (e === Ci.LuminanceAlphaFormat)
  49521. return X.LUMINANCE_ALPHA;
  49522. if (e === Ci.AddEquation)
  49523. return X.FUNC_ADD;
  49524. if (e === Ci.SubtractEquation)
  49525. return X.FUNC_SUBTRACT;
  49526. if (e === Ci.ReverseSubtractEquation)
  49527. return X.FUNC_REVERSE_SUBTRACT;
  49528. if (e === Ci.ZeroFactor)
  49529. return X.ZERO;
  49530. if (e === Ci.OneFactor)
  49531. return X.ONE;
  49532. if (e === Ci.SrcColorFactor)
  49533. return X.SRC_COLOR;
  49534. if (e === Ci.OneMinusSrcColorFactor)
  49535. return X.ONE_MINUS_SRC_COLOR;
  49536. if (e === Ci.SrcAlphaFactor)
  49537. return X.SRC_ALPHA;
  49538. if (e === Ci.OneMinusSrcAlphaFactor)
  49539. return X.ONE_MINUS_SRC_ALPHA;
  49540. if (e === Ci.DstAlphaFactor)
  49541. return X.DST_ALPHA;
  49542. if (e === Ci.OneMinusDstAlphaFactor)
  49543. return X.ONE_MINUS_DST_ALPHA;
  49544. if (e === Ci.DstColorFactor)
  49545. return X.DST_COLOR;
  49546. if (e === Ci.OneMinusDstColorFactor)
  49547. return X.ONE_MINUS_DST_COLOR;
  49548. if (e === Ci.SrcAlphaSaturateFactor)
  49549. return X.SRC_ALPHA_SATURATE;
  49550. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49551. if (e === Ci.RGB_S3TC_DXT1_Format)
  49552. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49553. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49554. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49555. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49556. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49557. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49558. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49559. }
  49560. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49561. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49562. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49563. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49564. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49565. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49566. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49567. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49568. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49569. }
  49570. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49571. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49572. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49573. if (e === Ci.MinEquation)
  49574. return t.MIN_EXT;
  49575. if (e === Ci.MaxEquation)
  49576. return t.MAX_EXT
  49577. }
  49578. return 0
  49579. }
  49580. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49581. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49582. , L = void 0 !== e.context ? e.context : null
  49583. , D = void 0 !== e.alpha && e.alpha
  49584. , N = void 0 === e.depth || e.depth
  49585. , F = void 0 === e.stencil || e.stencil
  49586. , B = void 0 !== e.antialias && e.antialias
  49587. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49588. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49589. , U = []
  49590. , H = []
  49591. , z = -1
  49592. , G = []
  49593. , W = -1
  49594. , j = new Float32Array(8)
  49595. , Y = []
  49596. , q = [];
  49597. this.domElement = O,
  49598. this.context = null,
  49599. this.autoClear = !0,
  49600. this.autoClearColor = !0,
  49601. this.autoClearDepth = !0,
  49602. this.autoClearStencil = !0,
  49603. this.sortObjects = !0,
  49604. this.gammaFactor = 2,
  49605. this.gammaInput = !1,
  49606. this.gammaOutput = !1,
  49607. this.physicallyCorrectLights = !1,
  49608. this.toneMapping = Ci.LinearToneMapping,
  49609. this.toneMappingExposure = 1,
  49610. this.toneMappingWhitePoint = 1,
  49611. this.maxMorphTargets = 8,
  49612. this.maxMorphNormals = 4,
  49613. this.autoScaleCubemaps = !0;
  49614. 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 = {
  49615. hash: "",
  49616. ambient: [0, 0, 0],
  49617. directional: [],
  49618. directionalShadowMap: [],
  49619. directionalShadowMatrix: [],
  49620. spot: [],
  49621. spotShadowMap: [],
  49622. spotShadowMatrix: [],
  49623. point: [],
  49624. pointShadowMap: [],
  49625. pointShadowMatrix: [],
  49626. hemi: [],
  49627. shadows: [],
  49628. shadowsPointLight: 0
  49629. }, ye = {
  49630. geometries: 0,
  49631. textures: 0
  49632. }, Ae = {
  49633. calls: 0,
  49634. vertices: 0,
  49635. faces: 0,
  49636. points: 0
  49637. };
  49638. this.info = {
  49639. render: Ae,
  49640. memory: ye,
  49641. programs: null
  49642. };
  49643. try {
  49644. var Ce = {
  49645. alpha: D,
  49646. depth: N,
  49647. stencil: F,
  49648. antialias: B,
  49649. premultipliedAlpha: V,
  49650. preserveDrawingBuffer: k
  49651. };
  49652. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49653. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49654. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49655. return {
  49656. rangeMin: 1,
  49657. rangeMax: 1,
  49658. precision: 1
  49659. }
  49660. }
  49661. ),
  49662. O.addEventListener("webglcontextlost", r, !1)
  49663. } catch (e) {
  49664. console.error("THREE.WebGLRenderer: " + e)
  49665. }
  49666. var Ie = new Ci.WebGLExtensions(X);
  49667. Ie.get("OES_texture_float"),
  49668. Ie.get("OES_texture_float_linear"),
  49669. Ie.get("OES_texture_half_float"),
  49670. Ie.get("OES_texture_half_float_linear"),
  49671. Ie.get("OES_standard_derivatives"),
  49672. Ie.get("ANGLE_instanced_arrays"),
  49673. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49674. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49675. , _e = new Ci.WebGLState(X,Ie,x)
  49676. , be = new Ci.WebGLProperties
  49677. , we = new Ci.WebGLObjects(X,be,this.info)
  49678. , Te = new Ci.WebGLPrograms(this,Ee)
  49679. , xe = new Ci.WebGLLights;
  49680. this.info.programs = Te.programs;
  49681. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49682. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49683. t(),
  49684. this.context = X,
  49685. this.capabilities = Ee,
  49686. this.extensions = Ie,
  49687. this.properties = be,
  49688. this.state = _e;
  49689. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49690. this.shadowMap = Re;
  49691. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49692. this.getContext = function() {
  49693. return X
  49694. }
  49695. ,
  49696. this.getContextAttributes = function() {
  49697. return X.getContextAttributes()
  49698. }
  49699. ,
  49700. this.forceContextLoss = function() {
  49701. Ie.get("WEBGL_lose_context").loseContext()
  49702. }
  49703. ,
  49704. this.getMaxAnisotropy = function() {
  49705. if (void 0 !== Pe)
  49706. return Pe;
  49707. var e = Ie.get("EXT_texture_filter_anisotropic");
  49708. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49709. }
  49710. ,
  49711. this.getPrecision = function() {
  49712. return Ee.precision
  49713. }
  49714. ,
  49715. this.getPixelRatio = function() {
  49716. return he
  49717. }
  49718. ,
  49719. this.setPixelRatio = function(e) {
  49720. void 0 !== e && (he = e,
  49721. this.setSize(pe.z, pe.w, !1))
  49722. }
  49723. ,
  49724. this.getSize = function() {
  49725. return {
  49726. width: le,
  49727. height: ce
  49728. }
  49729. }
  49730. ,
  49731. this.setSize = function(e, t, i, n) {
  49732. null != n && (he = n),
  49733. le = e,
  49734. ce = t,
  49735. O.width = e * he,
  49736. O.height = t * he,
  49737. !1 !== i && (O.style.width = e + "px",
  49738. O.style.height = t + "px"),
  49739. this.setViewport(0, 0, e, t)
  49740. }
  49741. ,
  49742. this.setViewport = function(e, t, i, n) {
  49743. _e.viewport(pe.set(e, t, i, n))
  49744. }
  49745. ,
  49746. this.setScissor = function(e, t, i, n) {
  49747. _e.scissor(ue.set(e, t, i, n))
  49748. }
  49749. ,
  49750. this.setScissorTest = function(e) {
  49751. _e.setScissorTest(de = e)
  49752. }
  49753. ,
  49754. this.getClearColor = function() {
  49755. return ae
  49756. }
  49757. ,
  49758. this.setClearColor = function(e, t) {
  49759. ae.set(e),
  49760. se = void 0 !== t ? t : 1,
  49761. i(ae.r, ae.g, ae.b, se)
  49762. }
  49763. ,
  49764. this.getClearAlpha = function() {
  49765. return se
  49766. }
  49767. ,
  49768. this.setClearAlpha = function(e) {
  49769. se = e,
  49770. i(ae.r, ae.g, ae.b, se)
  49771. }
  49772. ,
  49773. this.clear = function(e, t, i) {
  49774. var n = 0;
  49775. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49776. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49777. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49778. X.clear(n)
  49779. }
  49780. ,
  49781. this.clearColor = function() {
  49782. this.clear(!0, !1, !1)
  49783. }
  49784. ,
  49785. this.clearDepth = function() {
  49786. this.clear(!1, !0, !1)
  49787. }
  49788. ,
  49789. this.clearStencil = function() {
  49790. this.clear(!1, !1, !0)
  49791. }
  49792. ,
  49793. this.clearTarget = function(e, t, i, n) {
  49794. this.setRenderTarget(e),
  49795. this.clear(t, i, n)
  49796. }
  49797. ,
  49798. this.resetGLState = n,
  49799. this.dispose = function() {
  49800. O.removeEventListener("webglcontextlost", r, !1)
  49801. }
  49802. ,
  49803. this.renderBufferImmediate = function(e, t, i) {
  49804. _e.initAttributes();
  49805. var n = be.get(e);
  49806. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49807. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49808. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49809. e.hasColors && !n.color && (n.color = X.createBuffer());
  49810. var r = t.getAttributes();
  49811. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49812. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49813. _e.enableAttribute(r.position),
  49814. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49815. e.hasNormals) {
  49816. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49817. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49818. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49819. var s = e.normalArray
  49820. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49821. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49822. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49823. s[o + 0] = l,
  49824. s[o + 1] = c,
  49825. s[o + 2] = h,
  49826. s[o + 3] = l,
  49827. s[o + 4] = c,
  49828. s[o + 5] = h,
  49829. s[o + 6] = l,
  49830. s[o + 7] = c,
  49831. s[o + 8] = h
  49832. }
  49833. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49834. _e.enableAttribute(r.normal),
  49835. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49836. }
  49837. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49838. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49839. _e.enableAttribute(r.uv),
  49840. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49841. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49842. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49843. _e.enableAttribute(r.color),
  49844. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49845. _e.disableUnusedAttributes(),
  49846. X.drawArrays(X.TRIANGLES, 0, e.count),
  49847. e.count = 0
  49848. }
  49849. ,
  49850. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49851. R(n);
  49852. var a = P(e, t, n, r)
  49853. , s = !1
  49854. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49855. l !== ee && (ee = l,
  49856. s = !0);
  49857. var c = r.morphTargetInfluences;
  49858. if (void 0 !== c) {
  49859. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49860. var p = c[u];
  49861. h.push([p, u])
  49862. }
  49863. h.sort(M),
  49864. 8 < h.length && (h.length = 8);
  49865. var f = i.morphAttributes;
  49866. for (u = 0,
  49867. d = h.length; u < d; u++) {
  49868. p = h[u];
  49869. if (j[u] = p[0],
  49870. 0 !== p[0]) {
  49871. var g = p[1];
  49872. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49873. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49874. } else
  49875. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49876. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49877. }
  49878. var m = a.getUniforms();
  49879. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49880. s = !0
  49881. }
  49882. g = i.index;
  49883. var v, y = i.attributes.position;
  49884. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49885. null !== g ? (v = Me).setIndex(g) : v = Se,
  49886. s && (function(e, t, i, n) {
  49887. var r;
  49888. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49889. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49890. else {
  49891. void 0 === n && (n = 0),
  49892. _e.initAttributes();
  49893. var o = i.attributes
  49894. , a = t.getAttributes()
  49895. , s = e.defaultAttributeValues;
  49896. for (var l in a) {
  49897. var c = a[l];
  49898. if (0 <= c) {
  49899. var h = o[l];
  49900. if (void 0 !== h) {
  49901. var u = h.itemSize
  49902. , d = we.getAttributeBuffer(h);
  49903. if (h instanceof Ci.InterleavedBufferAttribute) {
  49904. var p = h.data
  49905. , f = p.stride
  49906. , g = h.offset;
  49907. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49908. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49909. X.bindBuffer(X.ARRAY_BUFFER, d),
  49910. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49911. } else
  49912. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49913. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49914. X.bindBuffer(X.ARRAY_BUFFER, d),
  49915. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49916. } else if (void 0 !== s) {
  49917. var m = s[l];
  49918. if (void 0 !== m)
  49919. switch (m.length) {
  49920. case 2:
  49921. X.vertexAttrib2fv(c, m);
  49922. break;
  49923. case 3:
  49924. X.vertexAttrib3fv(c, m);
  49925. break;
  49926. case 4:
  49927. X.vertexAttrib4fv(c, m);
  49928. break;
  49929. default:
  49930. X.vertexAttrib1fv(c, m)
  49931. }
  49932. }
  49933. }
  49934. }
  49935. _e.disableUnusedAttributes()
  49936. }
  49937. }(n, a, i),
  49938. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49939. var A = 1 / 0;
  49940. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49941. var C = i.drawRange.start
  49942. , I = i.drawRange.count
  49943. , E = null !== o ? o.start : 0
  49944. , _ = null !== o ? o.count : 1 / 0
  49945. , b = Math.max(0, C, E)
  49946. , w = Math.min(0 + A, C + I, E + _) - 1
  49947. , T = Math.max(0, w - b + 1);
  49948. if (r instanceof Ci.Mesh)
  49949. if (!0 === n.wireframe)
  49950. _e.setLineWidth(n.wireframeLinewidth * S()),
  49951. v.setMode(X.LINES);
  49952. else
  49953. switch (r.drawMode) {
  49954. case Ci.TrianglesDrawMode:
  49955. v.setMode(X.TRIANGLES);
  49956. break;
  49957. case Ci.TriangleStripDrawMode:
  49958. v.setMode(X.TRIANGLE_STRIP);
  49959. break;
  49960. case Ci.TriangleFanDrawMode:
  49961. v.setMode(X.TRIANGLE_FAN)
  49962. }
  49963. else if (r instanceof Ci.Line) {
  49964. var x = n.linewidth;
  49965. void 0 === x && (x = 1),
  49966. _e.setLineWidth(x * S()),
  49967. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49968. } else
  49969. r instanceof Ci.Points && v.setMode(X.POINTS);
  49970. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49971. }
  49972. ,
  49973. this.render = function(e, t, i, n) {
  49974. if (t instanceof Ci.Camera != 0) {
  49975. var r = e.fog;
  49976. if (ee = "",
  49977. $ = -1,
  49978. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49979. null === t.parent && t.updateMatrixWorld(),
  49980. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49981. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49982. fe.setFromMatrix(ge),
  49983. U.length = 0,
  49984. W = z = -1,
  49985. Y.length = 0,
  49986. q.length = 0,
  49987. function e(t, i) {
  49988. if (!1 !== t.visible) {
  49989. if (t.layers.test(i.layers))
  49990. if (t instanceof Ci.Light)
  49991. U.push(t);
  49992. else if (t instanceof Ci.Sprite)
  49993. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49994. else if (t instanceof Ci.LensFlare)
  49995. q.push(t);
  49996. else if (t instanceof Ci.ImmediateRenderObject)
  49997. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49998. me.applyProjection(ge)),
  49999. d(t, null, t.material, me.z, null);
  50000. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  50001. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  50002. var n = t.material;
  50003. if (!0 === n.visible) {
  50004. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  50005. me.applyProjection(ge));
  50006. var r = we.update(t);
  50007. if (n instanceof Ci.MultiMaterial)
  50008. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  50009. var c = o[s]
  50010. , h = a[c.materialIndex];
  50011. !0 === h.visible && d(t, r, h, me.z, c)
  50012. }
  50013. else
  50014. d(t, r, n, me.z, null)
  50015. }
  50016. }
  50017. var u = t.children;
  50018. for (s = 0,
  50019. l = u.length; s < l; s++)
  50020. e(u[s], i)
  50021. }
  50022. }(e, t),
  50023. H.length = z + 1,
  50024. G.length = W + 1,
  50025. !0 === Z.sortObjects && (H.sort(s),
  50026. G.sort(l)),
  50027. function(e, t) {
  50028. 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;
  50029. for (i = ve.shadowsPointLight = 0,
  50030. n = e.length; i < n; i++)
  50031. if (o = (r = e[i]).color,
  50032. a = r.intensity,
  50033. s = r.distance,
  50034. r instanceof Ci.AmbientLight)
  50035. l += o.r * a,
  50036. c += o.g * a,
  50037. h += o.b * a;
  50038. else if (r instanceof Ci.DirectionalLight) {
  50039. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  50040. v.direction.setFromMatrixPosition(r.matrixWorld),
  50041. me.setFromMatrixPosition(r.target.matrixWorld),
  50042. v.direction.sub(me),
  50043. v.direction.transformDirection(u),
  50044. v.shadow = r.castShadow,
  50045. r.castShadow && (v.shadowBias = r.shadow.bias,
  50046. v.shadowRadius = r.shadow.radius,
  50047. v.shadowMapSize = r.shadow.mapSize,
  50048. ve.shadows[m++] = r),
  50049. ve.directionalShadowMap[d] = r.shadow.map,
  50050. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  50051. ve.directional[d++] = v
  50052. } else if (r instanceof Ci.SpotLight) {
  50053. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  50054. v.position.applyMatrix4(u),
  50055. v.color.copy(o).multiplyScalar(a),
  50056. v.distance = s,
  50057. v.direction.setFromMatrixPosition(r.matrixWorld),
  50058. me.setFromMatrixPosition(r.target.matrixWorld),
  50059. v.direction.sub(me),
  50060. v.direction.transformDirection(u),
  50061. v.coneCos = Math.cos(r.angle),
  50062. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  50063. v.decay = 0 === r.distance ? 0 : r.decay,
  50064. v.shadow = r.castShadow,
  50065. r.castShadow && (v.shadowBias = r.shadow.bias,
  50066. v.shadowRadius = r.shadow.radius,
  50067. v.shadowMapSize = r.shadow.mapSize,
  50068. ve.shadows[m++] = r),
  50069. ve.spotShadowMap[f] = r.shadow.map,
  50070. ve.spotShadowMatrix[f] = r.shadow.matrix,
  50071. ve.spot[f++] = v
  50072. } else if (r instanceof Ci.PointLight) {
  50073. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  50074. v.position.applyMatrix4(u),
  50075. v.color.copy(r.color).multiplyScalar(r.intensity),
  50076. v.distance = r.distance,
  50077. v.decay = 0 === r.distance ? 0 : r.decay,
  50078. v.shadow = r.castShadow,
  50079. r.castShadow && (v.shadowBias = r.shadow.bias,
  50080. v.shadowRadius = r.shadow.radius,
  50081. v.shadowMapSize = r.shadow.mapSize,
  50082. ve.shadows[m++] = r),
  50083. ve.pointShadowMap[p] = r.shadow.map,
  50084. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  50085. me.setFromMatrixPosition(r.matrixWorld).negate(),
  50086. ve.pointShadowMatrix[p].identity().setPosition(me),
  50087. ve.point[p++] = v
  50088. } else if (r instanceof Ci.HemisphereLight) {
  50089. var v;
  50090. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  50091. v.direction.transformDirection(u),
  50092. v.direction.normalize(),
  50093. v.skyColor.copy(r.color).multiplyScalar(a),
  50094. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  50095. ve.hemi[g++] = v
  50096. }
  50097. ve.ambient[0] = l,
  50098. ve.ambient[1] = c,
  50099. ve.ambient[2] = h,
  50100. ve.directional.length = d,
  50101. ve.spot.length = f,
  50102. ve.point.length = p,
  50103. ve.hemi.length = g,
  50104. ve.shadows.length = m,
  50105. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  50106. }(U, t),
  50107. Re.render(e, t),
  50108. Ae.calls = 0,
  50109. Ae.vertices = 0,
  50110. Ae.faces = 0,
  50111. void (Ae.points = 0) === i && (i = null),
  50112. this.setRenderTarget(i),
  50113. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  50114. e.overrideMaterial) {
  50115. var o = e.overrideMaterial;
  50116. c(H, t, r, o),
  50117. c(G, t, r, o)
  50118. } else
  50119. _e.setBlending(Ci.NoBlending),
  50120. c(H, t, r),
  50121. c(G, t, r);
  50122. if (Oe.render(e, t),
  50123. Le.render(e, t, re),
  50124. i) {
  50125. var a = i.texture;
  50126. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  50127. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  50128. , i = be.get(e.texture).__webglTexture;
  50129. _e.bindTexture(t, i),
  50130. X.generateMipmap(t),
  50131. _e.bindTexture(t, null)
  50132. }(i)
  50133. }
  50134. _e.setDepthTest(!0),
  50135. _e.setDepthWrite(!0),
  50136. _e.setColorWrite(!0)
  50137. } else
  50138. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  50139. }
  50140. ,
  50141. this.setFaceCulling = function(e, t) {
  50142. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  50143. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  50144. _e.enable(X.CULL_FACE))
  50145. }
  50146. ,
  50147. this.setTexture = function(e, t) {
  50148. var i = be.get(e);
  50149. if (0 < e.version && i.__version !== e.version) {
  50150. var n = e.image;
  50151. 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)
  50152. }
  50153. _e.activeTexture(X.TEXTURE0 + t),
  50154. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  50155. }
  50156. ,
  50157. this.getCurrentRenderTarget = function() {
  50158. return Q
  50159. }
  50160. ,
  50161. this.setRenderTarget = function(e) {
  50162. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  50163. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  50164. if (e) {
  50165. var n = be.get(e);
  50166. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  50167. ie.copy(e.scissor),
  50168. ne = e.scissorTest,
  50169. re.copy(e.viewport)
  50170. } else
  50171. t = null,
  50172. ie.copy(ue).multiplyScalar(he),
  50173. ne = de,
  50174. re.copy(pe).multiplyScalar(he);
  50175. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  50176. J = t),
  50177. _e.scissor(ie),
  50178. _e.setScissorTest(ne),
  50179. _e.viewport(re),
  50180. i) {
  50181. var r = be.get(e.texture);
  50182. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  50183. }
  50184. }
  50185. ,
  50186. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  50187. if (e instanceof Ci.WebGLRenderTarget != 0) {
  50188. var a = be.get(e).__webglFramebuffer;
  50189. if (a) {
  50190. var s = !1;
  50191. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  50192. s = !0);
  50193. try {
  50194. var l = e.texture;
  50195. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  50196. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  50197. 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")))
  50198. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  50199. 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.")
  50200. } finally {
  50201. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  50202. }
  50203. }
  50204. } else
  50205. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  50206. }
  50207. }
  50208. ,
  50209. Ci.WebGLRenderTarget = function(e, t, i) {
  50210. this.uuid = Ci.Math.generateUUID(),
  50211. this.width = e,
  50212. this.height = t,
  50213. this.scissor = new Ci.Vector4(0,0,e,t),
  50214. this.scissorTest = !1,
  50215. this.viewport = new Ci.Vector4(0,0,e,t),
  50216. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  50217. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  50218. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  50219. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  50220. }
  50221. ,
  50222. Ci.WebGLRenderTarget.prototype = {
  50223. constructor: Ci.WebGLRenderTarget,
  50224. setSize: function(e, t) {
  50225. this.width === e && this.height === t || (this.width = e,
  50226. this.height = t,
  50227. this.dispose()),
  50228. this.viewport.set(0, 0, e, t),
  50229. this.scissor.set(0, 0, e, t)
  50230. },
  50231. clone: function() {
  50232. return (new this.constructor).copy(this)
  50233. },
  50234. copy: function(e) {
  50235. return this.width = e.width,
  50236. this.height = e.height,
  50237. this.viewport.copy(e.viewport),
  50238. this.texture = e.texture.clone(),
  50239. this.depthBuffer = e.depthBuffer,
  50240. this.stencilBuffer = e.stencilBuffer,
  50241. this
  50242. },
  50243. dispose: function() {
  50244. this.dispatchEvent({
  50245. type: "dispose"
  50246. })
  50247. }
  50248. },
  50249. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  50250. Ci.WebGLRenderTargetCube = function(e, t, i) {
  50251. Ci.WebGLRenderTarget.call(this, e, t, i),
  50252. this.activeCubeFace = 0,
  50253. this.activeMipMapLevel = 0
  50254. }
  50255. ,
  50256. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  50257. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  50258. Ci.WebGLBufferRenderer = function(r, o, a) {
  50259. var s;
  50260. this.setMode = function(e) {
  50261. s = e
  50262. }
  50263. ,
  50264. this.render = function(e, t) {
  50265. r.drawArrays(s, e, t),
  50266. a.calls++,
  50267. a.vertices += t,
  50268. s === r.TRIANGLES && (a.faces += t / 3)
  50269. }
  50270. ,
  50271. this.renderInstances = function(e) {
  50272. var t = o.get("ANGLE_instanced_arrays");
  50273. if (null !== t) {
  50274. var i = e.attributes.position
  50275. , n = 0;
  50276. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  50277. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  50278. a.calls++,
  50279. a.vertices += n * e.maxInstancedCount,
  50280. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  50281. } else
  50282. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  50283. }
  50284. }
  50285. ,
  50286. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  50287. var s, l, c;
  50288. this.setMode = function(e) {
  50289. s = e
  50290. }
  50291. ,
  50292. this.setIndex = function(e) {
  50293. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  50294. 4) : (l = r.UNSIGNED_SHORT,
  50295. 2)
  50296. }
  50297. ,
  50298. this.render = function(e, t) {
  50299. r.drawElements(s, t, l, e * c),
  50300. a.calls++,
  50301. a.vertices += t,
  50302. s === r.TRIANGLES && (a.faces += t / 3)
  50303. }
  50304. ,
  50305. this.renderInstances = function(e, t, i) {
  50306. var n = o.get("ANGLE_instanced_arrays");
  50307. 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),
  50308. a.calls++,
  50309. a.vertices += i * e.maxInstancedCount,
  50310. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  50311. }
  50312. }
  50313. ,
  50314. Ci.WebGLExtensions = function(i) {
  50315. var n = {};
  50316. this.get = function(e) {
  50317. if (void 0 !== n[e])
  50318. return n[e];
  50319. var t;
  50320. switch (e) {
  50321. case "EXT_texture_filter_anisotropic":
  50322. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  50323. break;
  50324. case "WEBGL_compressed_texture_s3tc":
  50325. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  50326. break;
  50327. case "WEBGL_compressed_texture_pvrtc":
  50328. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  50329. break;
  50330. case "WEBGL_compressed_texture_etc1":
  50331. t = i.getExtension("WEBGL_compressed_texture_etc1");
  50332. break;
  50333. default:
  50334. t = i.getExtension(e)
  50335. }
  50336. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  50337. n[e] = t
  50338. }
  50339. }
  50340. ,
  50341. Ci.WebGLCapabilities = function(t, e, i) {
  50342. function n(e) {
  50343. if ("highp" === e) {
  50344. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  50345. return "highp";
  50346. e = "mediump"
  50347. }
  50348. 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"
  50349. }
  50350. this.getMaxPrecision = n,
  50351. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50352. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50353. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  50354. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50355. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  50356. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  50357. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  50358. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  50359. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  50360. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  50361. this.vertexTextures = 0 < this.maxVertexTextures,
  50362. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  50363. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50364. var r = n(this.precision);
  50365. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50366. this.precision = r),
  50367. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  50368. }
  50369. ,
  50370. Ci.WebGLGeometries = function(i, o, a) {
  50371. function s(e) {
  50372. var t = e.target
  50373. , i = c[t.id];
  50374. null !== i.index && l(i.index),
  50375. function(e) {
  50376. for (var t in e)
  50377. l(e[t])
  50378. }(i.attributes),
  50379. t.removeEventListener("dispose", s),
  50380. delete c[t.id];
  50381. var n = o.get(t);
  50382. n.wireframe && l(n.wireframe),
  50383. o.delete(t);
  50384. var r = o.get(i);
  50385. r.wireframe && l(r.wireframe),
  50386. o.delete(i),
  50387. a.memory.geometries--
  50388. }
  50389. function l(e) {
  50390. var t = function(e) {
  50391. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  50392. }(e);
  50393. void 0 !== t && (i.deleteBuffer(t),
  50394. function(e) {
  50395. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  50396. }(e))
  50397. }
  50398. var c = {};
  50399. this.get = function(e) {
  50400. var t, i = e.geometry;
  50401. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  50402. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  50403. t = i._bufferGeometry),
  50404. c[i.id] = t,
  50405. a.memory.geometries++,
  50406. t)
  50407. }
  50408. }
  50409. ,
  50410. Ci.WebGLLights = function() {
  50411. var i = {};
  50412. this.get = function(e) {
  50413. if (void 0 !== i[e.id])
  50414. return i[e.id];
  50415. var t;
  50416. switch (e.type) {
  50417. case "DirectionalLight":
  50418. t = {
  50419. direction: new Ci.Vector3,
  50420. color: new Ci.Color,
  50421. shadow: !1,
  50422. shadowBias: 0,
  50423. shadowRadius: 1,
  50424. shadowMapSize: new Ci.Vector2
  50425. };
  50426. break;
  50427. case "SpotLight":
  50428. t = {
  50429. position: new Ci.Vector3,
  50430. direction: new Ci.Vector3,
  50431. color: new Ci.Color,
  50432. distance: 0,
  50433. coneCos: 0,
  50434. penumbraCos: 0,
  50435. decay: 0,
  50436. shadow: !1,
  50437. shadowBias: 0,
  50438. shadowRadius: 1,
  50439. shadowMapSize: new Ci.Vector2
  50440. };
  50441. break;
  50442. case "PointLight":
  50443. t = {
  50444. position: new Ci.Vector3,
  50445. color: new Ci.Color,
  50446. distance: 0,
  50447. decay: 0,
  50448. shadow: !1,
  50449. shadowBias: 0,
  50450. shadowRadius: 1,
  50451. shadowMapSize: new Ci.Vector2
  50452. };
  50453. break;
  50454. case "HemisphereLight":
  50455. t = {
  50456. direction: new Ci.Vector3,
  50457. skyColor: new Ci.Color,
  50458. groundColor: new Ci.Color
  50459. }
  50460. }
  50461. return i[e.id] = t
  50462. }
  50463. }
  50464. ,
  50465. Ci.WebGLObjects = function(g, m, e) {
  50466. function v(e, t) {
  50467. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  50468. , n = m.get(i);
  50469. void 0 === n.__webglBuffer ? function(e, t, i) {
  50470. e.__webglBuffer = g.createBuffer(),
  50471. g.bindBuffer(i, e.__webglBuffer);
  50472. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  50473. g.bufferData(i, t.array, n),
  50474. e.version = t.version
  50475. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  50476. g.bindBuffer(i, e.__webglBuffer),
  50477. !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)),
  50478. t.updateRange.count = 0),
  50479. e.version = t.version
  50480. }(n, i, t)
  50481. }
  50482. function y(e, t, i) {
  50483. if (i < t) {
  50484. var n = t;
  50485. t = i,
  50486. i = n
  50487. }
  50488. var r = e[t];
  50489. return void 0 === r ? (e[t] = [i],
  50490. !0) : -1 === r.indexOf(i) && (r.push(i),
  50491. !0)
  50492. }
  50493. var c = new Ci.WebGLGeometries(g,m,e);
  50494. this.getAttributeBuffer = function(e) {
  50495. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50496. }
  50497. ,
  50498. this.getWireframeAttribute = function(e) {
  50499. var t = m.get(e);
  50500. if (void 0 !== t.wireframe)
  50501. return t.wireframe;
  50502. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50503. if (null !== r)
  50504. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50505. var h = i[l + 0]
  50506. , u = i[l + 1]
  50507. , d = i[l + 2];
  50508. y(s, h, u) && n.push(h, u),
  50509. y(s, u, d) && n.push(u, d),
  50510. y(s, d, h) && n.push(d, h)
  50511. }
  50512. else
  50513. for (l = 0,
  50514. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50515. h = l + 0,
  50516. u = l + 1,
  50517. d = l + 2;
  50518. n.push(h, u, u, d, d, h)
  50519. }
  50520. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50521. , f = new Ci.BufferAttribute(new p(n),1);
  50522. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50523. t.wireframe = f
  50524. }
  50525. ,
  50526. this.update = function(e) {
  50527. var t = c.get(e);
  50528. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50529. var i = t.index
  50530. , n = t.attributes;
  50531. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50532. n)
  50533. v(n[r], g.ARRAY_BUFFER);
  50534. var o = t.morphAttributes;
  50535. for (var r in o)
  50536. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50537. v(a[s], g.ARRAY_BUFFER);
  50538. return t
  50539. }
  50540. }
  50541. ,
  50542. Ci.WebGLProgram = (Qt = 0,
  50543. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50544. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50545. ei = /^([\w\d_]+)\[0\]$/,
  50546. function(e, t, i, n) {
  50547. var r = e.context
  50548. , o = i.extensions
  50549. , a = i.defines
  50550. , s = i.__webglShader.vertexShader
  50551. , l = i.__webglShader.fragmentShader
  50552. , c = "SHADOWMAP_TYPE_BASIC";
  50553. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50554. var h = "ENVMAP_TYPE_CUBE"
  50555. , u = "ENVMAP_MODE_REFLECTION"
  50556. , d = "ENVMAP_BLENDING_MULTIPLY";
  50557. if (n.envMap) {
  50558. switch (i.envMap.mapping) {
  50559. case Ci.CubeReflectionMapping:
  50560. case Ci.CubeRefractionMapping:
  50561. h = "ENVMAP_TYPE_CUBE";
  50562. break;
  50563. case Ci.CubeUVReflectionMapping:
  50564. case Ci.CubeUVRefractionMapping:
  50565. h = "ENVMAP_TYPE_CUBE_UV";
  50566. break;
  50567. case Ci.EquirectangularReflectionMapping:
  50568. case Ci.EquirectangularRefractionMapping:
  50569. h = "ENVMAP_TYPE_EQUIREC";
  50570. break;
  50571. case Ci.SphericalReflectionMapping:
  50572. h = "ENVMAP_TYPE_SPHERE"
  50573. }
  50574. switch (i.envMap.mapping) {
  50575. case Ci.CubeRefractionMapping:
  50576. case Ci.EquirectangularRefractionMapping:
  50577. u = "ENVMAP_MODE_REFRACTION"
  50578. }
  50579. switch (i.combine) {
  50580. case Ci.MultiplyOperation:
  50581. d = "ENVMAP_BLENDING_MULTIPLY";
  50582. break;
  50583. case Ci.MixOperation:
  50584. d = "ENVMAP_BLENDING_MIX";
  50585. break;
  50586. case Ci.AddOperation:
  50587. d = "ENVMAP_BLENDING_ADD"
  50588. }
  50589. }
  50590. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50591. 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")
  50592. }(o, n, e.extensions), v = function(e) {
  50593. var t = [];
  50594. for (var i in e) {
  50595. var n = e[i];
  50596. !1 !== n && t.push("#define " + i + " " + n)
  50597. }
  50598. return t.join("\n")
  50599. }(a), y = r.createProgram();
  50600. 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"),
  50601. [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) {
  50602. var i;
  50603. switch (t) {
  50604. case Ci.LinearToneMapping:
  50605. i = "Linear";
  50606. break;
  50607. case Ci.ReinhardToneMapping:
  50608. i = "Reinhard";
  50609. break;
  50610. case Ci.Uncharted2ToneMapping:
  50611. i = "Uncharted2";
  50612. break;
  50613. case Ci.CineonToneMapping:
  50614. i = "OptimizedCineon";
  50615. break;
  50616. default:
  50617. throw new Error("unsupported toneMapping: " + t)
  50618. }
  50619. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50620. }("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) {
  50621. var i = Mi(t);
  50622. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50623. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50624. s = Oi(s = Li(s), n),
  50625. l = Oi(l = Li(l), n),
  50626. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50627. l = Di(l));
  50628. var A = p + s
  50629. , C = f + l
  50630. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50631. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50632. r.attachShader(y, I),
  50633. r.attachShader(y, E),
  50634. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50635. r.linkProgram(y);
  50636. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50637. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50638. 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),
  50639. M && (this.diagnostics = {
  50640. runnable: S,
  50641. material: i,
  50642. programLog: w,
  50643. vertexShader: {
  50644. log: T,
  50645. prefix: p
  50646. },
  50647. fragmentShader: {
  50648. log: x,
  50649. prefix: f
  50650. }
  50651. }),
  50652. r.deleteShader(I),
  50653. r.deleteShader(E),
  50654. this.getUniforms = function() {
  50655. return void 0 === _ && (_ = function(e, t) {
  50656. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50657. var o = e.getActiveUniform(t, r).name
  50658. , a = e.getUniformLocation(t, o)
  50659. , s = Jt.exec(o);
  50660. if (s) {
  50661. var l = s[1]
  50662. , c = s[2]
  50663. , h = i[l];
  50664. (h = h || (i[l] = {}))[c] = a
  50665. } else if (s = $t.exec(o)) {
  50666. var u = s[1]
  50667. , d = s[2]
  50668. , p = s[3]
  50669. , f = i[u]
  50670. , g = (f = f || (i[u] = []))[d];
  50671. (g = g || (f[d] = {}))[p] = a
  50672. } else
  50673. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50674. }
  50675. return i
  50676. }(r, y)),
  50677. _
  50678. }
  50679. ,
  50680. this.getAttributes = function() {
  50681. return void 0 === b && (b = function(e, t) {
  50682. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50683. var o = e.getActiveAttrib(t, r).name;
  50684. i[o] = e.getAttribLocation(t, o)
  50685. }
  50686. return i
  50687. }(r, y)),
  50688. b
  50689. }
  50690. ,
  50691. this.destroy = function() {
  50692. r.deleteProgram(y),
  50693. this.program = void 0
  50694. }
  50695. ,
  50696. Object.defineProperties(this, {
  50697. uniforms: {
  50698. get: function() {
  50699. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50700. this.getUniforms()
  50701. }
  50702. },
  50703. attributes: {
  50704. get: function() {
  50705. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50706. this.getAttributes()
  50707. }
  50708. }
  50709. }),
  50710. this.id = Qt++,
  50711. this.code = t,
  50712. this.usedTimes = 1,
  50713. this.program = y,
  50714. this.vertexShader = I,
  50715. this.fragmentShader = E,
  50716. this
  50717. }
  50718. ),
  50719. Ci.WebGLPrograms = function(s, l) {
  50720. function c(e, t) {
  50721. var i;
  50722. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50723. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50724. i
  50725. }
  50726. var h = []
  50727. , u = {
  50728. MeshDepthMaterial: "depth",
  50729. MeshNormalMaterial: "normal",
  50730. MeshBasicMaterial: "basic",
  50731. MeshLambertMaterial: "lambert",
  50732. MeshPhongMaterial: "phong",
  50733. MeshStandardMaterial: "standard",
  50734. LineBasicMaterial: "basic",
  50735. LineDashedMaterial: "dashed",
  50736. PointsMaterial: "points"
  50737. }
  50738. , 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"];
  50739. this.getParameters = function(e, t, i, n) {
  50740. var r = u[e.type]
  50741. , o = function(e) {
  50742. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50743. return 1024;
  50744. var t = l.maxVertexUniforms
  50745. , i = Math.floor((t - 20) / 4);
  50746. 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)")),
  50747. i
  50748. }(n)
  50749. , a = s.getPrecision();
  50750. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50751. {
  50752. shaderID: r,
  50753. precision: a,
  50754. supportsVertexTextures: l.vertexTextures,
  50755. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50756. map: !!e.map,
  50757. mapEncoding: c(e.map, s.gammaInput),
  50758. envMap: !!e.envMap,
  50759. envMapMode: e.envMap && e.envMap.mapping,
  50760. envMapEncoding: c(e.envMap, s.gammaInput),
  50761. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50762. lightMap: !!e.lightMap,
  50763. aoMap: !!e.aoMap,
  50764. emissiveMap: !!e.emissiveMap,
  50765. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50766. bumpMap: !!e.bumpMap,
  50767. normalMap: !!e.normalMap,
  50768. displacementMap: !!e.displacementMap,
  50769. roughnessMap: !!e.roughnessMap,
  50770. metalnessMap: !!e.metalnessMap,
  50771. specularMap: !!e.specularMap,
  50772. alphaMap: !!e.alphaMap,
  50773. combine: e.combine,
  50774. vertexColors: e.vertexColors,
  50775. fog: i,
  50776. useFog: e.fog,
  50777. fogExp: i instanceof Ci.FogExp2,
  50778. flatShading: e.shading === Ci.FlatShading,
  50779. sizeAttenuation: e.sizeAttenuation,
  50780. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50781. skinning: e.skinning,
  50782. maxBones: o,
  50783. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50784. morphTargets: e.morphTargets,
  50785. morphNormals: e.morphNormals,
  50786. maxMorphTargets: s.maxMorphTargets,
  50787. maxMorphNormals: s.maxMorphNormals,
  50788. numDirLights: t.directional.length,
  50789. numPointLights: t.point.length,
  50790. numSpotLights: t.spot.length,
  50791. numHemiLights: t.hemi.length,
  50792. pointLightShadows: t.shadowsPointLight,
  50793. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50794. shadowMapType: s.shadowMap.type,
  50795. toneMapping: s.toneMapping,
  50796. physicallyCorrectLights: s.physicallyCorrectLights,
  50797. premultipliedAlpha: e.premultipliedAlpha,
  50798. alphaTest: e.alphaTest,
  50799. doubleSided: e.side === Ci.DoubleSide,
  50800. flipSided: e.side === Ci.BackSide
  50801. }
  50802. }
  50803. ,
  50804. this.getProgramCode = function(e, t) {
  50805. var i = [];
  50806. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50807. i.push(e.vertexShader)),
  50808. void 0 !== e.defines)
  50809. for (var n in e.defines)
  50810. i.push(n),
  50811. i.push(e.defines[n]);
  50812. for (var r = 0; r < a.length; r++) {
  50813. var o = a[r];
  50814. i.push(o),
  50815. i.push(t[o])
  50816. }
  50817. return i.join()
  50818. }
  50819. ,
  50820. this.acquireProgram = function(e, t, i) {
  50821. for (var n, r = 0, o = h.length; r < o; r++) {
  50822. var a = h[r];
  50823. if (a.code === i) {
  50824. ++(n = a).usedTimes;
  50825. break
  50826. }
  50827. }
  50828. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50829. h.push(n)),
  50830. n
  50831. }
  50832. ,
  50833. this.releaseProgram = function(e) {
  50834. if (0 == --e.usedTimes) {
  50835. var t = h.indexOf(e);
  50836. h[t] = h[h.length - 1],
  50837. h.pop(),
  50838. e.destroy()
  50839. }
  50840. }
  50841. ,
  50842. this.programs = h
  50843. }
  50844. ,
  50845. Ci.WebGLProperties = function() {
  50846. var n = {};
  50847. this.get = function(e) {
  50848. var t = e.uuid
  50849. , i = n[t];
  50850. return void 0 === i && (i = {},
  50851. n[t] = i),
  50852. i
  50853. }
  50854. ,
  50855. this.delete = function(e) {
  50856. delete n[e.uuid]
  50857. }
  50858. ,
  50859. this.clear = function() {
  50860. n = {}
  50861. }
  50862. }
  50863. ,
  50864. Ci.WebGLShader = function(e, t, i) {
  50865. var n = e.createShader(t);
  50866. return e.shaderSource(n, i),
  50867. e.compileShader(n),
  50868. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50869. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50870. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50871. t[i] = i + 1 + ": " + t[i];
  50872. return t.join("\n")
  50873. }(i)),
  50874. n
  50875. }
  50876. ,
  50877. Ci.WebGLShadowMap = function(P, O, L) {
  50878. function D(e, t, i, n) {
  50879. var r = e.geometry
  50880. , o = null
  50881. , a = p
  50882. , s = e.customDepthMaterial;
  50883. if (i && (a = f,
  50884. s = e.customDistanceMaterial),
  50885. s)
  50886. o = s;
  50887. else {
  50888. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50889. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50890. , h = 0;
  50891. l && (h |= u),
  50892. c && (h |= d),
  50893. o = a[h]
  50894. }
  50895. return o.visible = t.visible,
  50896. o.wireframe = t.wireframe,
  50897. o.wireframeLinewidth = t.wireframeLinewidth,
  50898. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50899. o
  50900. }
  50901. function N(e, t, i) {
  50902. if (!1 !== e.visible) {
  50903. 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)))
  50904. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50905. G.push(e));
  50906. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50907. N(n[r], t, i)
  50908. }
  50909. }
  50910. 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) {
  50911. var a = 0 != (o & u)
  50912. , s = 0 != (o & d)
  50913. , l = new Ci.ShaderMaterial({
  50914. uniforms: i,
  50915. vertexShader: t.vertexShader,
  50916. fragmentShader: t.fragmentShader,
  50917. morphTargets: a,
  50918. skinning: s
  50919. });
  50920. p[o] = l;
  50921. var c = new Ci.ShaderMaterial({
  50922. defines: {
  50923. USE_SHADOWMAP: ""
  50924. },
  50925. uniforms: r,
  50926. vertexShader: n.vertexShader,
  50927. fragmentShader: n.fragmentShader,
  50928. morphTargets: a,
  50929. skinning: s
  50930. });
  50931. f[o] = c
  50932. }
  50933. var q = this;
  50934. this.enabled = !1,
  50935. this.autoUpdate = !0,
  50936. this.needsUpdate = !1,
  50937. this.type = Ci.PCFShadowMap,
  50938. this.cullFace = Ci.CullFaceFront,
  50939. this.render = function(e, t) {
  50940. var i, n, r = O.shadows;
  50941. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50942. B.clearColor(1, 1, 1, 1),
  50943. B.disable(F.BLEND),
  50944. B.enable(F.CULL_FACE),
  50945. F.frontFace(F.CCW),
  50946. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50947. B.setDepthTest(!0),
  50948. B.setScissorTest(!1);
  50949. for (var o = 0, a = r.length; o < a; o++) {
  50950. var s = r[o]
  50951. , l = s.shadow
  50952. , c = l.camera;
  50953. if (U.copy(l.mapSize),
  50954. s instanceof Ci.PointLight) {
  50955. i = 6,
  50956. n = !0;
  50957. var h = U.x
  50958. , u = U.y;
  50959. Y[0].set(2 * h, u, h, u),
  50960. Y[1].set(0, u, h, u),
  50961. Y[2].set(3 * h, u, h, u),
  50962. Y[3].set(h, u, h, u),
  50963. Y[4].set(3 * h, 0, h, u),
  50964. Y[5].set(h, 0, h, u),
  50965. U.x *= 4,
  50966. U.y *= 2
  50967. } else
  50968. n = !(i = 1);
  50969. if (null === l.map) {
  50970. var d = {
  50971. minFilter: Ci.NearestFilter,
  50972. magFilter: Ci.NearestFilter,
  50973. format: Ci.RGBAFormat
  50974. };
  50975. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50976. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50977. c.updateProjectionMatrix()
  50978. }
  50979. var p = l.map
  50980. , f = l.matrix;
  50981. z.setFromMatrixPosition(s.matrixWorld),
  50982. c.position.copy(z),
  50983. P.setRenderTarget(p),
  50984. P.clear();
  50985. for (var g = 0; g < i; g++) {
  50986. if (n) {
  50987. H.copy(c.position),
  50988. H.add(W[g]),
  50989. c.up.copy(j[g]),
  50990. c.lookAt(H);
  50991. var m = Y[g];
  50992. B.viewport(m)
  50993. } else
  50994. H.setFromMatrixPosition(s.target.matrixWorld),
  50995. c.lookAt(H);
  50996. c.updateMatrixWorld(),
  50997. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50998. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50999. f.multiply(c.projectionMatrix),
  51000. f.multiply(c.matrixWorldInverse),
  51001. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  51002. V.setFromMatrix(k),
  51003. G.length = 0,
  51004. N(e, t, c);
  51005. for (var v = 0, y = G.length; v < y; v++) {
  51006. var A = G[v]
  51007. , C = L.update(A)
  51008. , I = A.material;
  51009. if (I instanceof Ci.MultiMaterial)
  51010. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  51011. var T = E[b]
  51012. , x = _[T.materialIndex];
  51013. if (!0 === x.visible) {
  51014. var S = D(A, x, n, z);
  51015. P.renderBufferDirect(c, null, C, S, A, T)
  51016. }
  51017. }
  51018. else {
  51019. S = D(A, I, n, z);
  51020. P.renderBufferDirect(c, null, C, S, A, null)
  51021. }
  51022. }
  51023. }
  51024. }
  51025. var M = P.getClearColor()
  51026. , R = P.getClearAlpha();
  51027. P.setClearColor(M, R),
  51028. B.enable(F.BLEND),
  51029. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  51030. q.needsUpdate = !1
  51031. }
  51032. }
  51033. }
  51034. ,
  51035. Ci.WebGLState = function(l, i, c) {
  51036. var n = this
  51037. , r = new Ci.Vector4
  51038. , o = new Uint8Array(16)
  51039. , a = new Uint8Array(16)
  51040. , s = new Uint8Array(16)
  51041. , t = {}
  51042. , h = null
  51043. , u = null
  51044. , d = null
  51045. , p = null
  51046. , f = null
  51047. , g = null
  51048. , m = null
  51049. , v = null
  51050. , y = !1
  51051. , A = null
  51052. , C = null
  51053. , I = null
  51054. , E = null
  51055. , _ = null
  51056. , b = null
  51057. , w = null
  51058. , T = null
  51059. , x = null
  51060. , S = null
  51061. , M = null
  51062. , R = null
  51063. , P = null
  51064. , O = null
  51065. , L = null
  51066. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  51067. , N = void 0
  51068. , F = {}
  51069. , B = new Ci.Vector4
  51070. , V = null
  51071. , k = null
  51072. , U = new Ci.Vector4
  51073. , H = new Ci.Vector4
  51074. , z = l.createTexture();
  51075. l.bindTexture(l.TEXTURE_2D, z),
  51076. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  51077. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  51078. this.init = function() {
  51079. this.clearColor(0, 0, 0, 1),
  51080. this.clearDepth(1),
  51081. this.clearStencil(0),
  51082. this.enable(l.DEPTH_TEST),
  51083. l.depthFunc(l.LEQUAL),
  51084. l.frontFace(l.CCW),
  51085. l.cullFace(l.BACK),
  51086. this.enable(l.CULL_FACE),
  51087. this.enable(l.BLEND),
  51088. l.blendEquation(l.FUNC_ADD),
  51089. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  51090. }
  51091. ,
  51092. this.initAttributes = function() {
  51093. for (var e = 0, t = o.length; e < t; e++)
  51094. o[e] = 0
  51095. }
  51096. ,
  51097. this.enableAttribute = function(e) {
  51098. o[e] = 1,
  51099. 0 === a[e] && (l.enableVertexAttribArray(e),
  51100. a[e] = 1),
  51101. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  51102. s[e] = 0)
  51103. }
  51104. ,
  51105. this.enableAttributeAndDivisor = function(e, t, i) {
  51106. o[e] = 1,
  51107. 0 === a[e] && (l.enableVertexAttribArray(e),
  51108. a[e] = 1),
  51109. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  51110. s[e] = t)
  51111. }
  51112. ,
  51113. this.disableUnusedAttributes = function() {
  51114. for (var e = 0, t = a.length; e < t; e++)
  51115. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  51116. a[e] = 0)
  51117. }
  51118. ,
  51119. this.enable = function(e) {
  51120. !0 !== t[e] && (l.enable(e),
  51121. t[e] = !0)
  51122. }
  51123. ,
  51124. this.disable = function(e) {
  51125. !1 !== t[e] && (l.disable(e),
  51126. t[e] = !1)
  51127. }
  51128. ,
  51129. this.getCompressedTextureFormats = function() {
  51130. if (null === h && (h = [],
  51131. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  51132. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  51133. h.push(e[t]);
  51134. return h
  51135. }
  51136. ,
  51137. this.setBlending = function(e, t, i, n, r, o, a, s) {
  51138. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  51139. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51140. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  51141. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51142. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  51143. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51144. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  51145. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51146. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51147. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  51148. u = e,
  51149. y = s),
  51150. e === Ci.CustomBlending ? (r = r || t,
  51151. o = o || i,
  51152. a = a || n,
  51153. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  51154. d = t,
  51155. g = r),
  51156. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  51157. p = i,
  51158. f = n,
  51159. m = o,
  51160. v = a)) : v = m = g = f = p = d = null
  51161. }
  51162. ,
  51163. this.setDepthFunc = function(e) {
  51164. if (A !== e) {
  51165. if (e)
  51166. switch (e) {
  51167. case Ci.NeverDepth:
  51168. l.depthFunc(l.NEVER);
  51169. break;
  51170. case Ci.AlwaysDepth:
  51171. l.depthFunc(l.ALWAYS);
  51172. break;
  51173. case Ci.LessDepth:
  51174. l.depthFunc(l.LESS);
  51175. break;
  51176. case Ci.LessEqualDepth:
  51177. l.depthFunc(l.LEQUAL);
  51178. break;
  51179. case Ci.EqualDepth:
  51180. l.depthFunc(l.EQUAL);
  51181. break;
  51182. case Ci.GreaterEqualDepth:
  51183. l.depthFunc(l.GEQUAL);
  51184. break;
  51185. case Ci.GreaterDepth:
  51186. l.depthFunc(l.GREATER);
  51187. break;
  51188. case Ci.NotEqualDepth:
  51189. l.depthFunc(l.NOTEQUAL);
  51190. break;
  51191. default:
  51192. l.depthFunc(l.LEQUAL)
  51193. }
  51194. else
  51195. l.depthFunc(l.LEQUAL);
  51196. A = e
  51197. }
  51198. }
  51199. ,
  51200. this.setDepthTest = function(e) {
  51201. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  51202. }
  51203. ,
  51204. this.setDepthWrite = function(e) {
  51205. C !== e && (l.depthMask(e),
  51206. C = e)
  51207. }
  51208. ,
  51209. this.setColorWrite = function(e) {
  51210. I !== e && (l.colorMask(e, e, e, e),
  51211. I = e)
  51212. }
  51213. ,
  51214. this.setStencilFunc = function(e, t, i) {
  51215. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  51216. _ = e,
  51217. b = t,
  51218. w = i)
  51219. }
  51220. ,
  51221. this.setStencilOp = function(e, t, i) {
  51222. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  51223. T = e,
  51224. x = t,
  51225. S = i)
  51226. }
  51227. ,
  51228. this.setStencilTest = function(e) {
  51229. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  51230. }
  51231. ,
  51232. this.setStencilWrite = function(e) {
  51233. E !== e && (l.stencilMask(e),
  51234. E = e)
  51235. }
  51236. ,
  51237. this.setFlipSided = function(e) {
  51238. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  51239. M = e)
  51240. }
  51241. ,
  51242. this.setLineWidth = function(e) {
  51243. e !== R && (l.lineWidth(e),
  51244. R = e)
  51245. }
  51246. ,
  51247. this.setPolygonOffset = function(e, t, i) {
  51248. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  51249. !e || P === t && O === i || (l.polygonOffset(t, i),
  51250. P = t,
  51251. O = i)
  51252. }
  51253. ,
  51254. this.getScissorTest = function() {
  51255. return L
  51256. }
  51257. ,
  51258. this.setScissorTest = function(e) {
  51259. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  51260. }
  51261. ,
  51262. this.activeTexture = function(e) {
  51263. void 0 === e && (e = l.TEXTURE0 + D - 1),
  51264. N !== e && (l.activeTexture(e),
  51265. N = e)
  51266. }
  51267. ,
  51268. this.bindTexture = function(e, t) {
  51269. void 0 === N && n.activeTexture();
  51270. var i = F[N];
  51271. void 0 === i && (i = {
  51272. type: void 0,
  51273. texture: void 0
  51274. },
  51275. F[N] = i),
  51276. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  51277. i.type = e,
  51278. i.texture = t)
  51279. }
  51280. ,
  51281. this.compressedTexImage2D = function() {
  51282. try {
  51283. l.compressedTexImage2D.apply(l, arguments)
  51284. } catch (e) {
  51285. console.error(e)
  51286. }
  51287. }
  51288. ,
  51289. this.texImage2D = function() {
  51290. try {
  51291. l.texImage2D.apply(l, arguments)
  51292. } catch (e) {
  51293. console.error(e)
  51294. }
  51295. }
  51296. ,
  51297. this.clearColor = function(e, t, i, n) {
  51298. r.set(e, t, i, n),
  51299. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  51300. B.copy(r))
  51301. }
  51302. ,
  51303. this.clearDepth = function(e) {
  51304. V !== e && (l.clearDepth(e),
  51305. V = e)
  51306. }
  51307. ,
  51308. this.clearStencil = function(e) {
  51309. k !== e && (l.clearStencil(e),
  51310. k = e)
  51311. }
  51312. ,
  51313. this.scissor = function(e) {
  51314. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  51315. U.copy(e))
  51316. }
  51317. ,
  51318. this.viewport = function(e) {
  51319. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  51320. H.copy(e))
  51321. }
  51322. ,
  51323. this.reset = function() {
  51324. for (var e = 0; e < a.length; e++)
  51325. 1 === a[e] && (l.disableVertexAttribArray(e),
  51326. a[e] = 0);
  51327. t = {},
  51328. N = void 0,
  51329. F = {},
  51330. M = E = C = I = u = h = null
  51331. }
  51332. }
  51333. ,
  51334. Ci.LensFlarePlugin = function(v, y) {
  51335. function A() {
  51336. 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]);
  51337. C = S.createBuffer(),
  51338. I = S.createBuffer(),
  51339. S.bindBuffer(S.ARRAY_BUFFER, C),
  51340. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  51341. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51342. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  51343. T = S.createTexture(),
  51344. x = S.createTexture(),
  51345. M.bindTexture(S.TEXTURE_2D, T),
  51346. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  51347. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51348. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51349. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51350. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51351. M.bindTexture(S.TEXTURE_2D, x),
  51352. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  51353. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51354. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51355. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51356. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51357. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  51358. 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"),
  51359. 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")
  51360. } : {
  51361. 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"),
  51362. 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")
  51363. },
  51364. E = function(e) {
  51365. var t = S.createProgram()
  51366. , i = S.createShader(S.FRAGMENT_SHADER)
  51367. , n = S.createShader(S.VERTEX_SHADER)
  51368. , r = "precision " + v.getPrecision() + " float;\n";
  51369. return S.shaderSource(i, r + e.fragmentShader),
  51370. S.shaderSource(n, r + e.vertexShader),
  51371. S.compileShader(i),
  51372. S.compileShader(n),
  51373. S.attachShader(t, i),
  51374. S.attachShader(t, n),
  51375. S.linkProgram(t),
  51376. t
  51377. }(e),
  51378. _ = {
  51379. vertex: S.getAttribLocation(E, "position"),
  51380. uv: S.getAttribLocation(E, "uv")
  51381. },
  51382. b = {
  51383. renderType: S.getUniformLocation(E, "renderType"),
  51384. map: S.getUniformLocation(E, "map"),
  51385. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  51386. opacity: S.getUniformLocation(E, "opacity"),
  51387. color: S.getUniformLocation(E, "color"),
  51388. scale: S.getUniformLocation(E, "scale"),
  51389. rotation: S.getUniformLocation(E, "rotation"),
  51390. screenPosition: S.getUniformLocation(E, "screenPosition")
  51391. }
  51392. }
  51393. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  51394. this.render = function(e, t, i) {
  51395. if (0 !== y.length) {
  51396. var n = new Ci.Vector3
  51397. , r = i.w / i.z
  51398. , o = .5 * i.z
  51399. , a = .5 * i.w
  51400. , s = 16 / i.w
  51401. , l = new Ci.Vector2(s * r,s)
  51402. , c = new Ci.Vector3(1,1,0)
  51403. , h = new Ci.Vector2(1,1);
  51404. void 0 === E && A(),
  51405. S.useProgram(E),
  51406. M.initAttributes(),
  51407. M.enableAttribute(_.vertex),
  51408. M.enableAttribute(_.uv),
  51409. M.disableUnusedAttributes(),
  51410. S.uniform1i(b.occlusionMap, 0),
  51411. S.uniform1i(b.map, 1),
  51412. S.bindBuffer(S.ARRAY_BUFFER, C),
  51413. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  51414. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  51415. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51416. M.disable(S.CULL_FACE),
  51417. M.setDepthWrite(!1);
  51418. for (var u = 0, d = y.length; u < d; u++) {
  51419. s = 16 / i.w,
  51420. l.set(s * r, s);
  51421. var p = y[u];
  51422. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  51423. n.applyMatrix4(t.matrixWorldInverse),
  51424. n.applyProjection(t.projectionMatrix),
  51425. c.copy(n),
  51426. h.x = c.x * o + o,
  51427. h.y = c.y * a + a,
  51428. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  51429. M.activeTexture(S.TEXTURE0),
  51430. M.bindTexture(S.TEXTURE_2D, null),
  51431. M.activeTexture(S.TEXTURE1),
  51432. M.bindTexture(S.TEXTURE_2D, T),
  51433. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51434. S.uniform1i(b.renderType, 0),
  51435. S.uniform2f(b.scale, l.x, l.y),
  51436. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51437. M.disable(S.BLEND),
  51438. M.enable(S.DEPTH_TEST),
  51439. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51440. M.activeTexture(S.TEXTURE0),
  51441. M.bindTexture(S.TEXTURE_2D, x),
  51442. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51443. S.uniform1i(b.renderType, 1),
  51444. M.disable(S.DEPTH_TEST),
  51445. M.activeTexture(S.TEXTURE1),
  51446. M.bindTexture(S.TEXTURE_2D, T),
  51447. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51448. p.positionScreen.copy(c),
  51449. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  51450. S.uniform1i(b.renderType, 2),
  51451. M.enable(S.BLEND);
  51452. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  51453. var m = p.lensFlares[f];
  51454. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  51455. c.y = m.y,
  51456. c.z = m.z,
  51457. s = m.size * m.scale / i.w,
  51458. l.x = s * r,
  51459. l.y = s,
  51460. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51461. S.uniform2f(b.scale, l.x, l.y),
  51462. S.uniform1f(b.rotation, m.rotation),
  51463. S.uniform1f(b.opacity, m.opacity),
  51464. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  51465. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  51466. v.setTexture(m.texture, 1),
  51467. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  51468. }
  51469. }
  51470. }
  51471. M.enable(S.CULL_FACE),
  51472. M.enable(S.DEPTH_TEST),
  51473. M.setDepthWrite(!0),
  51474. v.resetGLState()
  51475. }
  51476. }
  51477. }
  51478. ,
  51479. Ci.SpritePlugin = function(u, d) {
  51480. function p() {
  51481. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51482. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51483. g = I.createBuffer(),
  51484. m = I.createBuffer(),
  51485. I.bindBuffer(I.ARRAY_BUFFER, g),
  51486. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  51487. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51488. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  51489. v = function() {
  51490. var e = I.createProgram()
  51491. , t = I.createShader(I.VERTEX_SHADER)
  51492. , i = I.createShader(I.FRAGMENT_SHADER);
  51493. 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")),
  51494. 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")),
  51495. I.compileShader(t),
  51496. I.compileShader(i),
  51497. I.attachShader(e, t),
  51498. I.attachShader(e, i),
  51499. I.linkProgram(e),
  51500. e
  51501. }(),
  51502. y = {
  51503. position: I.getAttribLocation(v, "position"),
  51504. uv: I.getAttribLocation(v, "uv")
  51505. },
  51506. A = {
  51507. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51508. uvScale: I.getUniformLocation(v, "uvScale"),
  51509. rotation: I.getUniformLocation(v, "rotation"),
  51510. scale: I.getUniformLocation(v, "scale"),
  51511. color: I.getUniformLocation(v, "color"),
  51512. map: I.getUniformLocation(v, "map"),
  51513. opacity: I.getUniformLocation(v, "opacity"),
  51514. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51515. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51516. fogType: I.getUniformLocation(v, "fogType"),
  51517. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51518. fogNear: I.getUniformLocation(v, "fogNear"),
  51519. fogFar: I.getUniformLocation(v, "fogFar"),
  51520. fogColor: I.getUniformLocation(v, "fogColor"),
  51521. alphaTest: I.getUniformLocation(v, "alphaTest")
  51522. };
  51523. var i = document.createElement("canvas");
  51524. i.width = 8,
  51525. i.height = 8;
  51526. var n = i.getContext("2d");
  51527. n.fillStyle = "white",
  51528. n.fillRect(0, 0, 8, 8),
  51529. (C = new Ci.Texture(i)).needsUpdate = !0
  51530. }
  51531. function f(e, t) {
  51532. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51533. }
  51534. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51535. this.render = function(e, t) {
  51536. if (0 !== d.length) {
  51537. void 0 === v && p(),
  51538. I.useProgram(v),
  51539. E.initAttributes(),
  51540. E.enableAttribute(y.position),
  51541. E.enableAttribute(y.uv),
  51542. E.disableUnusedAttributes(),
  51543. E.disable(I.CULL_FACE),
  51544. E.enable(I.BLEND),
  51545. I.bindBuffer(I.ARRAY_BUFFER, g),
  51546. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51547. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51548. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51549. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51550. E.activeTexture(I.TEXTURE0),
  51551. I.uniform1i(A.map, 0);
  51552. var i = 0
  51553. , n = 0
  51554. , r = e.fog;
  51555. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51556. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51557. I.uniform1f(A.fogFar, r.far),
  51558. I.uniform1i(A.fogType, 1),
  51559. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51560. I.uniform1i(A.fogType, 2),
  51561. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51562. n = i = 0);
  51563. for (var o = 0, a = d.length; o < a; o++) {
  51564. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51565. l.z = -l.modelViewMatrix.elements[14]
  51566. }
  51567. d.sort(f);
  51568. var s = [];
  51569. for (o = 0,
  51570. a = d.length; o < a; o++) {
  51571. var l, c = (l = d[o]).material;
  51572. I.uniform1f(A.alphaTest, c.alphaTest),
  51573. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51574. l.matrixWorld.decompose(_, b, w),
  51575. s[0] = w.x,
  51576. s[1] = w.y;
  51577. var h = 0;
  51578. e.fog && c.fog && (h = n),
  51579. i !== h && (I.uniform1i(A.fogType, h),
  51580. i = h),
  51581. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51582. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51583. I.uniform2f(A.uvScale, 1, 1)),
  51584. I.uniform1f(A.opacity, c.opacity),
  51585. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51586. I.uniform1f(A.rotation, c.rotation),
  51587. I.uniform2fv(A.scale, s),
  51588. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51589. E.setDepthTest(c.depthTest),
  51590. E.setDepthWrite(c.depthWrite),
  51591. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51592. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51593. }
  51594. E.enable(I.CULL_FACE),
  51595. u.resetGLState()
  51596. }
  51597. }
  51598. }
  51599. ,
  51600. Object.defineProperties(Ci.Box2.prototype, {
  51601. empty: {
  51602. value: function() {
  51603. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51604. this.isEmpty()
  51605. }
  51606. },
  51607. isIntersectionBox: {
  51608. value: function(e) {
  51609. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51610. this.intersectsBox(e)
  51611. }
  51612. }
  51613. }),
  51614. Object.defineProperties(Ci.Box3.prototype, {
  51615. empty: {
  51616. value: function() {
  51617. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51618. this.isEmpty()
  51619. }
  51620. },
  51621. isIntersectionBox: {
  51622. value: function(e) {
  51623. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51624. this.intersectsBox(e)
  51625. }
  51626. },
  51627. isIntersectionSphere: {
  51628. value: function(e) {
  51629. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51630. this.intersectsSphere(e)
  51631. }
  51632. }
  51633. }),
  51634. Object.defineProperties(Ci.Matrix3.prototype, {
  51635. multiplyVector3: {
  51636. value: function(e) {
  51637. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51638. e.applyMatrix3(this)
  51639. }
  51640. },
  51641. multiplyVector3Array: {
  51642. value: function(e) {
  51643. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51644. this.applyToVector3Array(e)
  51645. }
  51646. }
  51647. }),
  51648. Object.defineProperties(Ci.Matrix4.prototype, {
  51649. extractPosition: {
  51650. value: function(e) {
  51651. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51652. this.copyPosition(e)
  51653. }
  51654. },
  51655. setRotationFromQuaternion: {
  51656. value: function(e) {
  51657. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51658. this.makeRotationFromQuaternion(e)
  51659. }
  51660. },
  51661. multiplyVector3: {
  51662. value: function(e) {
  51663. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51664. e.applyProjection(this)
  51665. }
  51666. },
  51667. multiplyVector4: {
  51668. value: function(e) {
  51669. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51670. e.applyMatrix4(this)
  51671. }
  51672. },
  51673. multiplyVector3Array: {
  51674. value: function(e) {
  51675. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51676. this.applyToVector3Array(e)
  51677. }
  51678. },
  51679. rotateAxis: {
  51680. value: function(e) {
  51681. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51682. e.transformDirection(this)
  51683. }
  51684. },
  51685. crossVector: {
  51686. value: function(e) {
  51687. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51688. e.applyMatrix4(this)
  51689. }
  51690. },
  51691. translate: {
  51692. value: function(e) {
  51693. console.error("THREE.Matrix4: .translate() has been removed.")
  51694. }
  51695. },
  51696. rotateX: {
  51697. value: function(e) {
  51698. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51699. }
  51700. },
  51701. rotateY: {
  51702. value: function(e) {
  51703. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51704. }
  51705. },
  51706. rotateZ: {
  51707. value: function(e) {
  51708. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51709. }
  51710. },
  51711. rotateByAxis: {
  51712. value: function(e, t) {
  51713. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51714. }
  51715. }
  51716. }),
  51717. Object.defineProperties(Ci.Plane.prototype, {
  51718. isIntersectionLine: {
  51719. value: function(e) {
  51720. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51721. this.intersectsLine(e)
  51722. }
  51723. }
  51724. }),
  51725. Object.defineProperties(Ci.Quaternion.prototype, {
  51726. multiplyVector3: {
  51727. value: function(e) {
  51728. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51729. e.applyQuaternion(this)
  51730. }
  51731. }
  51732. }),
  51733. Object.defineProperties(Ci.Ray.prototype, {
  51734. isIntersectionBox: {
  51735. value: function(e) {
  51736. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51737. this.intersectsBox(e)
  51738. }
  51739. },
  51740. isIntersectionPlane: {
  51741. value: function(e) {
  51742. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51743. this.intersectsPlane(e)
  51744. }
  51745. },
  51746. isIntersectionSphere: {
  51747. value: function(e) {
  51748. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51749. this.intersectsSphere(e)
  51750. }
  51751. }
  51752. }),
  51753. Object.defineProperties(Ci.Vector3.prototype, {
  51754. setEulerFromRotationMatrix: {
  51755. value: function() {
  51756. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51757. }
  51758. },
  51759. setEulerFromQuaternion: {
  51760. value: function() {
  51761. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51762. }
  51763. },
  51764. getPositionFromMatrix: {
  51765. value: function(e) {
  51766. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51767. this.setFromMatrixPosition(e)
  51768. }
  51769. },
  51770. getScaleFromMatrix: {
  51771. value: function(e) {
  51772. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51773. this.setFromMatrixScale(e)
  51774. }
  51775. },
  51776. getColumnFromMatrix: {
  51777. value: function(e, t) {
  51778. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51779. this.setFromMatrixColumn(e, t)
  51780. }
  51781. }
  51782. }),
  51783. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51784. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51785. new Ci.Face3(e,t,i,r,o,a)
  51786. }
  51787. ,
  51788. Ci.Vertex = function(e, t, i) {
  51789. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51790. new Ci.Vector3(e,t,i)
  51791. }
  51792. ,
  51793. Object.defineProperties(Ci.Object3D.prototype, {
  51794. eulerOrder: {
  51795. get: function() {
  51796. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51797. this.rotation.order
  51798. },
  51799. set: function(e) {
  51800. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51801. this.rotation.order = e
  51802. }
  51803. },
  51804. getChildByName: {
  51805. value: function(e) {
  51806. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51807. this.getObjectByName(e)
  51808. }
  51809. },
  51810. renderDepth: {
  51811. set: function(e) {
  51812. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51813. }
  51814. },
  51815. translate: {
  51816. value: function(e, t) {
  51817. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51818. this.translateOnAxis(t, e)
  51819. }
  51820. },
  51821. useQuaternion: {
  51822. get: function() {
  51823. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51824. },
  51825. set: function(e) {
  51826. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51827. }
  51828. }
  51829. }),
  51830. Object.defineProperties(Ci, {
  51831. PointCloud: {
  51832. value: function(e, t) {
  51833. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51834. new Ci.Points(e,t)
  51835. }
  51836. },
  51837. ParticleSystem: {
  51838. value: function(e, t) {
  51839. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51840. new Ci.Points(e,t)
  51841. }
  51842. }
  51843. }),
  51844. Object.defineProperties(Ci.Light.prototype, {
  51845. onlyShadow: {
  51846. set: function(e) {
  51847. console.warn("THREE.Light: .onlyShadow has been removed.")
  51848. }
  51849. },
  51850. shadowCameraFov: {
  51851. set: function(e) {
  51852. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51853. this.shadow.camera.fov = e
  51854. }
  51855. },
  51856. shadowCameraLeft: {
  51857. set: function(e) {
  51858. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51859. this.shadow.camera.left = e
  51860. }
  51861. },
  51862. shadowCameraRight: {
  51863. set: function(e) {
  51864. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51865. this.shadow.camera.right = e
  51866. }
  51867. },
  51868. shadowCameraTop: {
  51869. set: function(e) {
  51870. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51871. this.shadow.camera.top = e
  51872. }
  51873. },
  51874. shadowCameraBottom: {
  51875. set: function(e) {
  51876. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51877. this.shadow.camera.bottom = e
  51878. }
  51879. },
  51880. shadowCameraNear: {
  51881. set: function(e) {
  51882. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51883. this.shadow.camera.near = e
  51884. }
  51885. },
  51886. shadowCameraFar: {
  51887. set: function(e) {
  51888. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51889. this.shadow.camera.far = e
  51890. }
  51891. },
  51892. shadowCameraVisible: {
  51893. set: function(e) {
  51894. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51895. }
  51896. },
  51897. shadowBias: {
  51898. set: function(e) {
  51899. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51900. this.shadow.bias = e
  51901. }
  51902. },
  51903. shadowDarkness: {
  51904. set: function(e) {
  51905. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51906. }
  51907. },
  51908. shadowMapWidth: {
  51909. set: function(e) {
  51910. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51911. this.shadow.mapSize.width = e
  51912. }
  51913. },
  51914. shadowMapHeight: {
  51915. set: function(e) {
  51916. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51917. this.shadow.mapSize.height = e
  51918. }
  51919. }
  51920. }),
  51921. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51922. length: {
  51923. get: function() {
  51924. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51925. this.array.length
  51926. }
  51927. }
  51928. }),
  51929. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51930. drawcalls: {
  51931. get: function() {
  51932. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51933. this.groups
  51934. }
  51935. },
  51936. offsets: {
  51937. get: function() {
  51938. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51939. this.groups
  51940. }
  51941. },
  51942. addIndex: {
  51943. value: function(e) {
  51944. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51945. this.setIndex(e)
  51946. }
  51947. },
  51948. addDrawCall: {
  51949. value: function(e, t, i) {
  51950. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51951. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51952. this.addGroup(e, t)
  51953. }
  51954. },
  51955. clearDrawCalls: {
  51956. value: function() {
  51957. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51958. this.clearGroups()
  51959. }
  51960. },
  51961. computeTangents: {
  51962. value: function() {
  51963. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51964. }
  51965. },
  51966. computeOffsets: {
  51967. value: function() {
  51968. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51969. }
  51970. }
  51971. }),
  51972. Object.defineProperties(Ci.Material.prototype, {
  51973. wrapAround: {
  51974. get: function() {
  51975. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51976. },
  51977. set: function(e) {
  51978. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51979. }
  51980. },
  51981. wrapRGB: {
  51982. get: function() {
  51983. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51984. new Ci.Color
  51985. }
  51986. }
  51987. }),
  51988. Object.defineProperties(Ci, {
  51989. PointCloudMaterial: {
  51990. value: function(e) {
  51991. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51992. new Ci.PointsMaterial(e)
  51993. }
  51994. },
  51995. ParticleBasicMaterial: {
  51996. value: function(e) {
  51997. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51998. new Ci.PointsMaterial(e)
  51999. }
  52000. },
  52001. ParticleSystemMaterial: {
  52002. value: function(e) {
  52003. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  52004. new Ci.PointsMaterial(e)
  52005. }
  52006. }
  52007. }),
  52008. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  52009. metal: {
  52010. get: function() {
  52011. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  52012. !1
  52013. },
  52014. set: function(e) {
  52015. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  52016. }
  52017. }
  52018. }),
  52019. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  52020. derivatives: {
  52021. get: function() {
  52022. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52023. this.extensions.derivatives
  52024. },
  52025. set: function(e) {
  52026. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52027. this.extensions.derivatives = e
  52028. }
  52029. }
  52030. }),
  52031. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  52032. supportsFloatTextures: {
  52033. value: function() {
  52034. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  52035. this.extensions.get("OES_texture_float")
  52036. }
  52037. },
  52038. supportsHalfFloatTextures: {
  52039. value: function() {
  52040. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  52041. this.extensions.get("OES_texture_half_float")
  52042. }
  52043. },
  52044. supportsStandardDerivatives: {
  52045. value: function() {
  52046. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  52047. this.extensions.get("OES_standard_derivatives")
  52048. }
  52049. },
  52050. supportsCompressedTextureS3TC: {
  52051. value: function() {
  52052. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  52053. this.extensions.get("WEBGL_compressed_texture_s3tc")
  52054. }
  52055. },
  52056. supportsCompressedTexturePVRTC: {
  52057. value: function() {
  52058. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  52059. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  52060. }
  52061. },
  52062. supportsBlendMinMax: {
  52063. value: function() {
  52064. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  52065. this.extensions.get("EXT_blend_minmax")
  52066. }
  52067. },
  52068. supportsVertexTextures: {
  52069. value: function() {
  52070. return this.capabilities.vertexTextures
  52071. }
  52072. },
  52073. supportsInstancedArrays: {
  52074. value: function() {
  52075. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  52076. this.extensions.get("ANGLE_instanced_arrays")
  52077. }
  52078. },
  52079. enableScissorTest: {
  52080. value: function(e) {
  52081. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  52082. this.setScissorTest(e)
  52083. }
  52084. },
  52085. initMaterial: {
  52086. value: function() {
  52087. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  52088. }
  52089. },
  52090. addPrePlugin: {
  52091. value: function() {
  52092. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  52093. }
  52094. },
  52095. addPostPlugin: {
  52096. value: function() {
  52097. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  52098. }
  52099. },
  52100. updateShadowMap: {
  52101. value: function() {
  52102. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  52103. }
  52104. },
  52105. shadowMapEnabled: {
  52106. get: function() {
  52107. return this.shadowMap.enabled
  52108. },
  52109. set: function(e) {
  52110. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  52111. this.shadowMap.enabled = e
  52112. }
  52113. },
  52114. shadowMapType: {
  52115. get: function() {
  52116. return this.shadowMap.type
  52117. },
  52118. set: function(e) {
  52119. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  52120. this.shadowMap.type = e
  52121. }
  52122. },
  52123. shadowMapCullFace: {
  52124. get: function() {
  52125. return this.shadowMap.cullFace
  52126. },
  52127. set: function(e) {
  52128. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  52129. this.shadowMap.cullFace = e
  52130. }
  52131. }
  52132. }),
  52133. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  52134. wrapS: {
  52135. get: function() {
  52136. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52137. this.texture.wrapS
  52138. },
  52139. set: function(e) {
  52140. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52141. this.texture.wrapS = e
  52142. }
  52143. },
  52144. wrapT: {
  52145. get: function() {
  52146. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52147. this.texture.wrapT
  52148. },
  52149. set: function(e) {
  52150. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52151. this.texture.wrapT = e
  52152. }
  52153. },
  52154. magFilter: {
  52155. get: function() {
  52156. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52157. this.texture.magFilter
  52158. },
  52159. set: function(e) {
  52160. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52161. this.texture.magFilter = e
  52162. }
  52163. },
  52164. minFilter: {
  52165. get: function() {
  52166. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52167. this.texture.minFilter
  52168. },
  52169. set: function(e) {
  52170. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52171. this.texture.minFilter = e
  52172. }
  52173. },
  52174. anisotropy: {
  52175. get: function() {
  52176. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52177. this.texture.anisotropy
  52178. },
  52179. set: function(e) {
  52180. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52181. this.texture.anisotropy = e
  52182. }
  52183. },
  52184. offset: {
  52185. get: function() {
  52186. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52187. this.texture.offset
  52188. },
  52189. set: function(e) {
  52190. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52191. this.texture.offset = e
  52192. }
  52193. },
  52194. repeat: {
  52195. get: function() {
  52196. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52197. this.texture.repeat
  52198. },
  52199. set: function(e) {
  52200. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52201. this.texture.repeat = e
  52202. }
  52203. },
  52204. format: {
  52205. get: function() {
  52206. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52207. this.texture.format
  52208. },
  52209. set: function(e) {
  52210. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52211. this.texture.format = e
  52212. }
  52213. },
  52214. type: {
  52215. get: function() {
  52216. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52217. this.texture.type
  52218. },
  52219. set: function(e) {
  52220. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52221. this.texture.type = e
  52222. }
  52223. },
  52224. generateMipmaps: {
  52225. get: function() {
  52226. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52227. this.texture.generateMipmaps
  52228. },
  52229. set: function(e) {
  52230. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52231. this.texture.generateMipmaps = e
  52232. }
  52233. }
  52234. }),
  52235. Ci.GeometryUtils = {
  52236. merge: function(e, t, i) {
  52237. var n;
  52238. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  52239. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  52240. n = t.matrix,
  52241. t = t.geometry),
  52242. e.merge(t, n, i)
  52243. },
  52244. center: function(e) {
  52245. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52246. e.center()
  52247. }
  52248. },
  52249. Ci.ImageUtils = {
  52250. crossOrigin: void 0,
  52251. loadTexture: function(e, t, i, n) {
  52252. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52253. var r = new Ci.TextureLoader;
  52254. r.setCrossOrigin(this.crossOrigin);
  52255. var o = r.load(e, i, void 0, n);
  52256. return t && (o.mapping = t),
  52257. o
  52258. },
  52259. loadTextureCube: function(e, t, i, n) {
  52260. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52261. var r = new Ci.CubeTextureLoader;
  52262. r.setCrossOrigin(this.crossOrigin);
  52263. var o = r.load(e, i, void 0, n);
  52264. return t && (o.mapping = t),
  52265. o
  52266. },
  52267. loadCompressedTexture: function() {
  52268. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52269. },
  52270. loadCompressedTextureCube: function() {
  52271. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52272. }
  52273. },
  52274. Ci.Projector = function() {
  52275. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52276. this.projectVector = function(e, t) {
  52277. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52278. e.project(t)
  52279. }
  52280. ,
  52281. this.unprojectVector = function(e, t) {
  52282. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52283. e.unproject(t)
  52284. }
  52285. ,
  52286. this.pickingRay = function(e, t) {
  52287. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52288. }
  52289. }
  52290. ,
  52291. Ci.CanvasRenderer = function() {
  52292. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52293. this.domElement = document.createElement("canvas"),
  52294. this.clear = function() {}
  52295. ,
  52296. this.render = function() {}
  52297. ,
  52298. this.setClearColor = function() {}
  52299. ,
  52300. this.setSize = function() {}
  52301. }
  52302. ,
  52303. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  52304. Ci.CurveUtils = {
  52305. tangentQuadraticBezier: function(e, t, i, n) {
  52306. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52307. },
  52308. tangentCubicBezier: function(e, t, i, n, r) {
  52309. 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
  52310. },
  52311. tangentSpline: function(e, t, i, n, r) {
  52312. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  52313. },
  52314. interpolate: function(e, t, i, n, r) {
  52315. var o = .5 * (i - e)
  52316. , a = .5 * (n - t)
  52317. , s = r * r;
  52318. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52319. }
  52320. },
  52321. Ci.SceneUtils = {
  52322. createMultiMaterialObject: function(e, t) {
  52323. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  52324. i.add(new Ci.Mesh(e,t[n]));
  52325. return i
  52326. },
  52327. detach: function(e, t, i) {
  52328. e.applyMatrix(t.matrixWorld),
  52329. t.remove(e),
  52330. i.add(e)
  52331. },
  52332. attach: function(e, t, i) {
  52333. var n = new Ci.Matrix4;
  52334. n.getInverse(i.matrixWorld),
  52335. e.applyMatrix(n),
  52336. t.remove(e),
  52337. i.add(e)
  52338. }
  52339. },
  52340. Ci.ShapeUtils = {
  52341. area: function(e) {
  52342. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52343. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52344. return .5 * i
  52345. },
  52346. triangulate: function(e, t) {
  52347. var i = e.length;
  52348. if (i < 3)
  52349. return null;
  52350. var n, r, o, a = [], s = [], l = [];
  52351. if (0 < Ci.ShapeUtils.area(e))
  52352. for (r = 0; r < i; r++)
  52353. s[r] = r;
  52354. else
  52355. for (r = 0; r < i; r++)
  52356. s[r] = i - 1 - r;
  52357. var c = i
  52358. , h = 2 * c;
  52359. for (r = c - 1; 2 < c; ) {
  52360. if (h-- <= 0)
  52361. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52362. t ? l : a;
  52363. if (c <= (n = r) && (n = 0),
  52364. c <= (r = n + 1) && (r = 0),
  52365. c <= (o = r + 1) && (o = 0),
  52366. Si(e, n, r, o, c, s)) {
  52367. var u, d, p, f, g;
  52368. for (u = s[n],
  52369. d = s[r],
  52370. p = s[o],
  52371. a.push([e[u], e[d], e[p]]),
  52372. l.push([s[n], s[r], s[o]]),
  52373. g = (f = r) + 1; g < c; f++,
  52374. g++)
  52375. s[f] = s[g];
  52376. h = 2 * --c
  52377. }
  52378. }
  52379. return t ? l : a
  52380. },
  52381. triangulateShape: function(e, t) {
  52382. function w(e, t, i) {
  52383. 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
  52384. }
  52385. function b(e, t, i, n, r) {
  52386. var o = t.x - e.x
  52387. , a = t.y - e.y
  52388. , s = n.x - i.x
  52389. , l = n.y - i.y
  52390. , c = e.x - i.x
  52391. , h = e.y - i.y
  52392. , u = a * s - o * l
  52393. , d = a * c - o * h;
  52394. if (Math.abs(u) > Number.EPSILON) {
  52395. var p;
  52396. if (0 < u) {
  52397. if (d < 0 || u < d)
  52398. return [];
  52399. if ((p = l * c - s * h) < 0 || u < p)
  52400. return []
  52401. } else {
  52402. if (0 < d || d < u)
  52403. return [];
  52404. if (0 < (p = l * c - s * h) || p < u)
  52405. return []
  52406. }
  52407. if (0 === p)
  52408. return !r || 0 != d && d != u ? [e] : [];
  52409. if (p === u)
  52410. return !r || 0 != d && d != u ? [t] : [];
  52411. if (0 == d)
  52412. return [i];
  52413. if (d == u)
  52414. return [n];
  52415. var f = p / u;
  52416. return [{
  52417. x: e.x + f * o,
  52418. y: e.y + f * a
  52419. }]
  52420. }
  52421. if (0 != d || l * c != s * h)
  52422. return [];
  52423. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  52424. 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,
  52425. (m = t).x) : (v = (g = t).x,
  52426. (m = e).x),
  52427. i.x < n.x ? (I = (A = i).x,
  52428. (C = n).x) : (I = (A = n).x,
  52429. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  52430. (m = t).y) : (v = (g = t).y,
  52431. (m = e).y),
  52432. i.y < n.y ? (I = (A = i).y,
  52433. (C = n).y) : (I = (A = n).y,
  52434. (C = i).y)),
  52435. 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])
  52436. }
  52437. function T(e, t, i, n) {
  52438. var r = t.x - e.x
  52439. , o = t.y - e.y
  52440. , a = i.x - e.x
  52441. , s = i.y - e.y
  52442. , l = n.x - e.x
  52443. , c = n.y - e.y
  52444. , h = r * s - o * a
  52445. , u = r * c - o * l;
  52446. if (Math.abs(h) > Number.EPSILON) {
  52447. var d = l * s - c * a;
  52448. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  52449. }
  52450. return 0 < u
  52451. }
  52452. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  52453. Array.prototype.push.apply(c, t[h]);
  52454. for (i = 0,
  52455. n = c.length; i < n; i++)
  52456. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  52457. l[a] = i;
  52458. var d = function(e, a) {
  52459. function t(e, t) {
  52460. var i = m.length - 1
  52461. , n = e - 1;
  52462. n < 0 && (n = i);
  52463. var r = e + 1;
  52464. i < r && (r = 0);
  52465. var o = T(m[e], m[n], m[r], c[t]);
  52466. if (!o)
  52467. return !1;
  52468. var a = c.length - 1
  52469. , s = t - 1;
  52470. s < 0 && (s = a);
  52471. var l = t + 1;
  52472. return a < l && (l = 0),
  52473. !!(o = T(c[t], c[s], c[l], m[e]))
  52474. }
  52475. function i(e, t) {
  52476. var i, n;
  52477. for (i = 0; i < m.length; i++)
  52478. if (n = i + 1,
  52479. n %= m.length,
  52480. 0 < b(e, t, m[i], m[n], !0).length)
  52481. return !0;
  52482. return !1
  52483. }
  52484. function n(e, t) {
  52485. var i, n, r, o;
  52486. for (i = 0; i < v.length; i++)
  52487. for (n = a[v[i]],
  52488. r = 0; r < n.length; r++)
  52489. if (o = r + 1,
  52490. o %= n.length,
  52491. 0 < b(e, t, n[r], n[o], !0).length)
  52492. return !0;
  52493. return !1
  52494. }
  52495. 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++)
  52496. v.push(A);
  52497. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52498. if (--E < 0) {
  52499. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52500. break
  52501. }
  52502. for (o = I; o < m.length; o++) {
  52503. s = m[o],
  52504. r = -1;
  52505. for (A = 0; A < v.length; A++)
  52506. if (h = v[A],
  52507. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52508. c = a[h];
  52509. for (var _ = 0; _ < c.length; _++)
  52510. if (l = c[_],
  52511. t(o, _) && !i(s, l) && !n(s, l)) {
  52512. r = _,
  52513. v.splice(A, 1),
  52514. d = m.slice(0, o + 1),
  52515. p = m.slice(o),
  52516. f = c.slice(r),
  52517. g = c.slice(0, r + 1),
  52518. m = d.concat(f).concat(g).concat(p),
  52519. I = o;
  52520. break
  52521. }
  52522. if (0 <= r)
  52523. break;
  52524. y[u] = !0
  52525. }
  52526. if (0 <= r)
  52527. break
  52528. }
  52529. }
  52530. return m
  52531. }(e, t)
  52532. , p = Ci.ShapeUtils.triangulate(d, !1);
  52533. for (i = 0,
  52534. n = p.length; i < n; i++)
  52535. for (o = p[i],
  52536. r = 0; r < 3; r++)
  52537. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52538. return p.concat()
  52539. },
  52540. isClockWise: function(e) {
  52541. return Ci.ShapeUtils.area(e) < 0
  52542. },
  52543. b2: function(e, t, i, n) {
  52544. return function(e, t) {
  52545. var i = 1 - e;
  52546. return i * i * t
  52547. }(e, t) + function(e, t) {
  52548. return 2 * (1 - e) * e * t
  52549. }(e, i) + function(e, t) {
  52550. return e * e * t
  52551. }(e, n)
  52552. },
  52553. b3: function(e, t, i, n, r) {
  52554. return function(e, t) {
  52555. var i = 1 - e;
  52556. return i * i * i * t
  52557. }(e, t) + function(e, t) {
  52558. var i = 1 - e;
  52559. return 3 * i * i * e * t
  52560. }(e, i) + function(e, t) {
  52561. return 3 * (1 - e) * e * e * t
  52562. }(e, n) + function(e, t) {
  52563. return e * e * e * t
  52564. }(e, r)
  52565. }
  52566. },
  52567. Ci.Curve = function() {}
  52568. ,
  52569. Ci.Curve.prototype = {
  52570. constructor: Ci.Curve,
  52571. getPoint: function(e) {
  52572. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52573. null
  52574. },
  52575. getPointAt: function(e) {
  52576. var t = this.getUtoTmapping(e);
  52577. return this.getPoint(t)
  52578. },
  52579. getPoints: function(e) {
  52580. e = e || 5;
  52581. var t, i = [];
  52582. for (t = 0; t <= e; t++)
  52583. i.push(this.getPoint(t / e));
  52584. return i
  52585. },
  52586. getSpacedPoints: function(e) {
  52587. e = e || 5;
  52588. var t, i = [];
  52589. for (t = 0; t <= e; t++)
  52590. i.push(this.getPointAt(t / e));
  52591. return i
  52592. },
  52593. getLength: function() {
  52594. var e = this.getLengths();
  52595. return e[e.length - 1]
  52596. },
  52597. getLengths: function(e) {
  52598. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52599. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52600. return this.cacheArcLengths;
  52601. this.needsUpdate = !1;
  52602. var t, i, n = [], r = this.getPoint(0), o = 0;
  52603. for (n.push(0),
  52604. i = 1; i <= e; i++)
  52605. o += (t = this.getPoint(i / e)).distanceTo(r),
  52606. n.push(o),
  52607. r = t;
  52608. return this.cacheArcLengths = n
  52609. },
  52610. updateArcLengths: function() {
  52611. this.needsUpdate = !0,
  52612. this.getLengths()
  52613. },
  52614. getUtoTmapping: function(e, t) {
  52615. var i, n = this.getLengths(), r = 0, o = n.length;
  52616. i = t || e * n[o - 1];
  52617. for (var a, s = 0, l = o - 1; s <= l; )
  52618. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52619. s = r + 1;
  52620. else {
  52621. if (!(0 < a)) {
  52622. l = r;
  52623. break
  52624. }
  52625. l = r - 1
  52626. }
  52627. if (n[r = l] === i)
  52628. return r / (o - 1);
  52629. var c = n[r];
  52630. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52631. },
  52632. getTangent: function(e) {
  52633. var t = e - 1e-4
  52634. , i = e + 1e-4;
  52635. t < 0 && (t = 0),
  52636. 1 < i && (i = 1);
  52637. var n = this.getPoint(t);
  52638. return this.getPoint(i).clone().sub(n).normalize()
  52639. },
  52640. getTangentAt: function(e) {
  52641. var t = this.getUtoTmapping(e);
  52642. return this.getTangent(t)
  52643. }
  52644. },
  52645. Ci.Curve.create = function(e, t) {
  52646. return e.prototype = Object.create(Ci.Curve.prototype),
  52647. (e.prototype.constructor = e).prototype.getPoint = t,
  52648. e
  52649. }
  52650. ,
  52651. Ci.CurvePath = function() {
  52652. this.curves = [],
  52653. this.autoClose = !1
  52654. }
  52655. ,
  52656. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52657. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52658. Ci.CurvePath.prototype.add = function(e) {
  52659. this.curves.push(e)
  52660. }
  52661. ,
  52662. Ci.CurvePath.prototype.closePath = function() {
  52663. var e = this.curves[0].getPoint(0)
  52664. , t = this.curves[this.curves.length - 1].getPoint(1);
  52665. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52666. }
  52667. ,
  52668. Ci.CurvePath.prototype.getPoint = function(e) {
  52669. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52670. if (i[n] >= t) {
  52671. var r = i[n] - t
  52672. , o = this.curves[n]
  52673. , a = 1 - r / o.getLength();
  52674. return o.getPointAt(a)
  52675. }
  52676. n++
  52677. }
  52678. return null
  52679. }
  52680. ,
  52681. Ci.CurvePath.prototype.getLength = function() {
  52682. var e = this.getCurveLengths();
  52683. return e[e.length - 1]
  52684. }
  52685. ,
  52686. Ci.CurvePath.prototype.getCurveLengths = function() {
  52687. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52688. return this.cacheLengths;
  52689. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52690. t += this.curves[i].getLength(),
  52691. e.push(t);
  52692. return this.cacheLengths = e
  52693. }
  52694. ,
  52695. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52696. var t = this.getPoints(e);
  52697. return this.createGeometry(t)
  52698. }
  52699. ,
  52700. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52701. var t = this.getSpacedPoints(e);
  52702. return this.createGeometry(t)
  52703. }
  52704. ,
  52705. Ci.CurvePath.prototype.createGeometry = function(e) {
  52706. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52707. var r = e[i];
  52708. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52709. }
  52710. return t
  52711. }
  52712. ,
  52713. Ci.Font = function(e) {
  52714. this.data = e
  52715. }
  52716. ,
  52717. Ci.Font.prototype = {
  52718. constructor: Ci.Font,
  52719. generateShapes: function(e, s, b) {
  52720. function l(e, t, i) {
  52721. var n = w.glyphs[e] || w.glyphs["?"];
  52722. if (n) {
  52723. 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;
  52724. if (n.o)
  52725. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52726. switch (A[C++]) {
  52727. case "m":
  52728. r = A[C++] * t + i,
  52729. o = A[C++] * t,
  52730. g.moveTo(r, o);
  52731. break;
  52732. case "l":
  52733. r = A[C++] * t + i,
  52734. o = A[C++] * t,
  52735. g.lineTo(r, o);
  52736. break;
  52737. case "q":
  52738. if (a = A[C++] * t + i,
  52739. s = A[C++] * t,
  52740. h = A[C++] * t + i,
  52741. u = A[C++] * t,
  52742. g.quadraticCurveTo(h, u, a, s),
  52743. f = m[m.length - 1]) {
  52744. l = f.x,
  52745. c = f.y;
  52746. for (var E = 1; E <= b; E++) {
  52747. v(_ = E / b, l, h, a),
  52748. v(_, c, u, s)
  52749. }
  52750. }
  52751. break;
  52752. case "b":
  52753. if (a = A[C++] * t + i,
  52754. s = A[C++] * t,
  52755. h = A[C++] * t + i,
  52756. u = A[C++] * t,
  52757. d = A[C++] * t + i,
  52758. p = A[C++] * t,
  52759. g.bezierCurveTo(h, u, d, p, a, s),
  52760. f = m[m.length - 1]) {
  52761. l = f.x,
  52762. c = f.y;
  52763. for (E = 1; E <= b; E++) {
  52764. var _;
  52765. y(_ = E / b, l, h, d, a),
  52766. y(_, c, u, p, s)
  52767. }
  52768. }
  52769. }
  52770. }
  52771. return {
  52772. offset: n.ha * t,
  52773. path: g
  52774. }
  52775. }
  52776. }
  52777. void 0 === s && (s = 100),
  52778. void 0 === b && (b = 4);
  52779. for (var w = this.data, t = function(e) {
  52780. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52781. var a = l(t[o], i, n);
  52782. n += a.offset,
  52783. r.push(a.path)
  52784. }
  52785. return r
  52786. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52787. Array.prototype.push.apply(i, t[n].toShapes());
  52788. return i
  52789. }
  52790. },
  52791. Ci.Path = function(e) {
  52792. Ci.CurvePath.call(this),
  52793. this.actions = [],
  52794. e && this.fromPoints(e)
  52795. }
  52796. ,
  52797. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52798. Ci.Path.prototype.constructor = Ci.Path,
  52799. Ci.Path.prototype.fromPoints = function(e) {
  52800. this.moveTo(e[0].x, e[0].y);
  52801. for (var t = 1, i = e.length; t < i; t++)
  52802. this.lineTo(e[t].x, e[t].y)
  52803. }
  52804. ,
  52805. Ci.Path.prototype.moveTo = function(e, t) {
  52806. this.actions.push({
  52807. action: "moveTo",
  52808. args: [e, t]
  52809. })
  52810. }
  52811. ,
  52812. Ci.Path.prototype.lineTo = function(e, t) {
  52813. var i = this.actions[this.actions.length - 1].args
  52814. , n = i[i.length - 2]
  52815. , r = i[i.length - 1]
  52816. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52817. this.curves.push(o),
  52818. this.actions.push({
  52819. action: "lineTo",
  52820. args: [e, t]
  52821. })
  52822. }
  52823. ,
  52824. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52825. var r = this.actions[this.actions.length - 1].args
  52826. , o = r[r.length - 2]
  52827. , a = r[r.length - 1]
  52828. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52829. this.curves.push(s),
  52830. this.actions.push({
  52831. action: "quadraticCurveTo",
  52832. args: [e, t, i, n]
  52833. })
  52834. }
  52835. ,
  52836. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52837. var a = this.actions[this.actions.length - 1].args
  52838. , s = a[a.length - 2]
  52839. , l = a[a.length - 1]
  52840. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52841. this.curves.push(c),
  52842. this.actions.push({
  52843. action: "bezierCurveTo",
  52844. args: [e, t, i, n, r, o]
  52845. })
  52846. }
  52847. ,
  52848. Ci.Path.prototype.splineThru = function(e) {
  52849. var t = Array.prototype.slice.call(arguments)
  52850. , i = this.actions[this.actions.length - 1].args
  52851. , n = i[i.length - 2]
  52852. , r = i[i.length - 1]
  52853. , o = [new Ci.Vector2(n,r)];
  52854. Array.prototype.push.apply(o, e);
  52855. var a = new Ci.SplineCurve(o);
  52856. this.curves.push(a),
  52857. this.actions.push({
  52858. action: "splineThru",
  52859. args: t
  52860. })
  52861. }
  52862. ,
  52863. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52864. var a = this.actions[this.actions.length - 1].args
  52865. , s = a[a.length - 2]
  52866. , l = a[a.length - 1];
  52867. this.absarc(e + s, t + l, i, n, r, o)
  52868. }
  52869. ,
  52870. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52871. this.absellipse(e, t, i, i, n, r, o)
  52872. }
  52873. ,
  52874. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52875. var l = this.actions[this.actions.length - 1].args
  52876. , c = l[l.length - 2]
  52877. , h = l[l.length - 1];
  52878. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52879. }
  52880. ,
  52881. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52882. var l = [e, t, i, n, r, o, a, s || 0]
  52883. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52884. this.curves.push(c);
  52885. var h = c.getPoint(1);
  52886. l.push(h.x),
  52887. l.push(h.y),
  52888. this.actions.push({
  52889. action: "ellipse",
  52890. args: l
  52891. })
  52892. }
  52893. ,
  52894. Ci.Path.prototype.getSpacedPoints = function(e) {
  52895. e = e || 40;
  52896. for (var t = [], i = 0; i < e; i++)
  52897. t.push(this.getPoint(i / e));
  52898. return this.autoClose && t.push(t[0]),
  52899. t
  52900. }
  52901. ,
  52902. Ci.Path.prototype.getPoints = function(e) {
  52903. e = e || 12;
  52904. 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++) {
  52905. var v = this.actions[g]
  52906. , y = v.action
  52907. , A = v.args;
  52908. switch (y) {
  52909. case "moveTo":
  52910. case "lineTo":
  52911. f.push(new Ci.Vector2(A[0],A[1]));
  52912. break;
  52913. case "quadraticCurveTo":
  52914. t = A[2],
  52915. i = A[3],
  52916. o = A[0],
  52917. a = A[1],
  52918. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52919. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52920. c[c.length - 1]);
  52921. for (var C = 1; C <= e; C++) {
  52922. h = d(O = C / e, s, o, t),
  52923. u = d(O, l, a, i),
  52924. f.push(new Ci.Vector2(h,u))
  52925. }
  52926. break;
  52927. case "bezierCurveTo":
  52928. t = A[4],
  52929. i = A[5],
  52930. o = A[0],
  52931. a = A[1],
  52932. n = A[2],
  52933. r = A[3],
  52934. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52935. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52936. c[c.length - 1]);
  52937. for (C = 1; C <= e; C++) {
  52938. h = p(O = C / e, s, o, n, t),
  52939. u = p(O, l, a, r, i),
  52940. f.push(new Ci.Vector2(h,u))
  52941. }
  52942. break;
  52943. case "splineThru":
  52944. c = this.actions[g - 1].args;
  52945. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52946. , E = e * A[0].length;
  52947. I = I.concat(A[0]);
  52948. var _ = new Ci.SplineCurve(I);
  52949. for (C = 1; C <= E; C++)
  52950. f.push(_.getPointAt(C / E));
  52951. break;
  52952. case "arc":
  52953. var b = A[0]
  52954. , w = A[1]
  52955. , T = A[2]
  52956. , x = A[3]
  52957. , S = A[4]
  52958. , M = !!A[5]
  52959. , R = S - x
  52960. , P = 2 * e;
  52961. for (C = 1; C <= P; C++) {
  52962. var O = C / P;
  52963. M || (O = 1 - O),
  52964. L = x + O * R,
  52965. h = b + T * Math.cos(L),
  52966. u = w + T * Math.sin(L),
  52967. f.push(new Ci.Vector2(h,u))
  52968. }
  52969. break;
  52970. case "ellipse":
  52971. b = A[0],
  52972. w = A[1];
  52973. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52974. S = A[5],
  52975. M = !!A[6],
  52976. A[7]);
  52977. R = S - x,
  52978. P = 2 * e;
  52979. 0 !== V && (D = Math.cos(V),
  52980. N = Math.sin(V));
  52981. for (C = 1; C <= P; C++) {
  52982. O = C / P;
  52983. if (M || (O = 1 - O),
  52984. L = x + O * R,
  52985. h = b + F * Math.cos(L),
  52986. u = w + B * Math.sin(L),
  52987. 0 !== V) {
  52988. var k = h;
  52989. h = (k - b) * D - (u - w) * N + b,
  52990. u = (k - b) * N + (u - w) * D + w
  52991. }
  52992. f.push(new Ci.Vector2(h,u))
  52993. }
  52994. }
  52995. }
  52996. var U = f[f.length - 1];
  52997. 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),
  52998. this.autoClose && f.push(f[0]),
  52999. f
  53000. }
  53001. ,
  53002. Ci.Path.prototype.toShapes = function(e, t) {
  53003. function i(e) {
  53004. for (var t = [], i = 0, n = e.length; i < n; i++) {
  53005. var r = e[i]
  53006. , o = new Ci.Shape;
  53007. o.actions = r.actions,
  53008. o.curves = r.curves,
  53009. t.push(o)
  53010. }
  53011. return t
  53012. }
  53013. function n(e, t) {
  53014. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  53015. var a = t[r]
  53016. , s = t[o]
  53017. , l = s.x - a.x
  53018. , c = s.y - a.y;
  53019. if (Math.abs(c) > Number.EPSILON) {
  53020. if (c < 0 && (a = t[o],
  53021. l = -l,
  53022. s = t[r],
  53023. c = -c),
  53024. e.y < a.y || e.y > s.y)
  53025. continue;
  53026. if (e.y === a.y) {
  53027. if (e.x === a.x)
  53028. return !0
  53029. } else {
  53030. var h = c * (e.x - a.x) - l * (e.y - a.y);
  53031. if (0 == h)
  53032. return !0;
  53033. if (h < 0)
  53034. continue;
  53035. n = !n
  53036. }
  53037. } else {
  53038. if (e.y !== a.y)
  53039. continue;
  53040. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  53041. return !0
  53042. }
  53043. }
  53044. return n
  53045. }
  53046. var r = Ci.ShapeUtils.isClockWise
  53047. , o = function(e) {
  53048. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  53049. var o = e[n]
  53050. , a = o.args
  53051. , s = o.action;
  53052. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  53053. i = new Ci.Path),
  53054. i[s].apply(i, a)
  53055. }
  53056. return 0 !== i.actions.length && t.push(i),
  53057. t
  53058. }(this.actions);
  53059. if (0 === o.length)
  53060. return [];
  53061. if (!0 === t)
  53062. return i(o);
  53063. var a, s, l, c = [];
  53064. if (1 === o.length)
  53065. return s = o[0],
  53066. (l = new Ci.Shape).actions = s.actions,
  53067. l.curves = s.curves,
  53068. c.push(l),
  53069. c;
  53070. var h = !r(o[0].getPoints());
  53071. h = e ? !h : h;
  53072. var u, d = [], p = [], f = [], g = 0;
  53073. p[g] = void 0,
  53074. f[g] = [];
  53075. for (var m = 0, v = o.length; m < v; m++)
  53076. a = r(u = (s = o[m]).getPoints()),
  53077. (a = e ? !a : a) ? (!h && p[g] && g++,
  53078. p[g] = {
  53079. s: new Ci.Shape,
  53080. p: u
  53081. },
  53082. p[g].s.actions = s.actions,
  53083. p[g].s.curves = s.curves,
  53084. h && g++,
  53085. f[g] = []) : f[g].push({
  53086. h: s,
  53087. p: u[0]
  53088. });
  53089. if (!p[0])
  53090. return i(o);
  53091. if (1 < p.length) {
  53092. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  53093. d[C] = [];
  53094. for (C = 0,
  53095. I = p.length; C < I; C++)
  53096. for (var E = f[C], _ = 0; _ < E.length; _++) {
  53097. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  53098. n(b.p, p[T].p) && (C !== T && A.push({
  53099. froms: C,
  53100. tos: T,
  53101. hole: _
  53102. }),
  53103. w ? (w = !1,
  53104. d[T].push(b)) : y = !0);
  53105. w && d[C].push(b)
  53106. }
  53107. 0 < A.length && (y || (f = d))
  53108. }
  53109. m = 0;
  53110. for (var x, S = p.length; m < S; m++) {
  53111. l = p[m].s,
  53112. c.push(l);
  53113. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  53114. l.holes.push(x[M].h)
  53115. }
  53116. return c
  53117. }
  53118. ,
  53119. Ci.Shape = function() {
  53120. Ci.Path.apply(this, arguments),
  53121. this.holes = []
  53122. }
  53123. ,
  53124. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  53125. Ci.Shape.prototype.constructor = Ci.Shape,
  53126. Ci.Shape.prototype.extrude = function(e) {
  53127. return new Ci.ExtrudeGeometry(this,e)
  53128. }
  53129. ,
  53130. Ci.Shape.prototype.makeGeometry = function(e) {
  53131. return new Ci.ShapeGeometry(this,e)
  53132. }
  53133. ,
  53134. Ci.Shape.prototype.getPointsHoles = function(e) {
  53135. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  53136. t[i] = this.holes[i].getPoints(e);
  53137. return t
  53138. }
  53139. ,
  53140. Ci.Shape.prototype.extractAllPoints = function(e) {
  53141. return {
  53142. shape: this.getPoints(e),
  53143. holes: this.getPointsHoles(e)
  53144. }
  53145. }
  53146. ,
  53147. Ci.Shape.prototype.extractPoints = function(e) {
  53148. return this.extractAllPoints(e)
  53149. }
  53150. ,
  53151. Ci.LineCurve = function(e, t) {
  53152. this.v1 = e,
  53153. this.v2 = t
  53154. }
  53155. ,
  53156. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  53157. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  53158. Ci.LineCurve.prototype.getPoint = function(e) {
  53159. var t = this.v2.clone().sub(this.v1);
  53160. return t.multiplyScalar(e).add(this.v1),
  53161. t
  53162. }
  53163. ,
  53164. Ci.LineCurve.prototype.getPointAt = function(e) {
  53165. return this.getPoint(e)
  53166. }
  53167. ,
  53168. Ci.LineCurve.prototype.getTangent = function(e) {
  53169. return this.v2.clone().sub(this.v1).normalize()
  53170. }
  53171. ,
  53172. Ci.QuadraticBezierCurve = function(e, t, i) {
  53173. this.v0 = e,
  53174. this.v1 = t,
  53175. this.v2 = i
  53176. }
  53177. ,
  53178. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  53179. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  53180. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  53181. var t = Ci.ShapeUtils.b2;
  53182. 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))
  53183. }
  53184. ,
  53185. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  53186. var t = Ci.CurveUtils.tangentQuadraticBezier;
  53187. 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()
  53188. }
  53189. ,
  53190. Ci.CubicBezierCurve = function(e, t, i, n) {
  53191. this.v0 = e,
  53192. this.v1 = t,
  53193. this.v2 = i,
  53194. this.v3 = n
  53195. }
  53196. ,
  53197. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  53198. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  53199. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  53200. var t = Ci.ShapeUtils.b3;
  53201. 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))
  53202. }
  53203. ,
  53204. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  53205. var t = Ci.CurveUtils.tangentCubicBezier;
  53206. 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()
  53207. }
  53208. ,
  53209. Ci.SplineCurve = function(e) {
  53210. this.points = null == e ? [] : e
  53211. }
  53212. ,
  53213. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  53214. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  53215. Ci.SplineCurve.prototype.getPoint = function(e) {
  53216. var t = this.points
  53217. , i = (t.length - 1) * e
  53218. , n = Math.floor(i)
  53219. , r = i - n
  53220. , o = t[0 === n ? n : n - 1]
  53221. , a = t[n]
  53222. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53223. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53224. , c = Ci.CurveUtils.interpolate;
  53225. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  53226. }
  53227. ,
  53228. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  53229. this.aX = e,
  53230. this.aY = t,
  53231. this.xRadius = i,
  53232. this.yRadius = n,
  53233. this.aStartAngle = r,
  53234. this.aEndAngle = o,
  53235. this.aClockwise = a,
  53236. this.aRotation = s || 0
  53237. }
  53238. ,
  53239. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  53240. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  53241. Ci.EllipseCurve.prototype.getPoint = function(e) {
  53242. var t, i = this.aEndAngle - this.aStartAngle;
  53243. i < 0 && (i += 2 * Math.PI),
  53244. i > 2 * Math.PI && (i -= 2 * Math.PI),
  53245. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  53246. var n = this.aX + this.xRadius * Math.cos(t)
  53247. , r = this.aY + this.yRadius * Math.sin(t);
  53248. if (0 !== this.aRotation) {
  53249. var o = Math.cos(this.aRotation)
  53250. , a = Math.sin(this.aRotation)
  53251. , s = n
  53252. , l = r;
  53253. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  53254. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  53255. }
  53256. return new Ci.Vector2(n,r)
  53257. }
  53258. ,
  53259. Ci.ArcCurve = function(e, t, i, n, r, o) {
  53260. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  53261. }
  53262. ,
  53263. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  53264. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  53265. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  53266. this.v1 = e,
  53267. this.v2 = t
  53268. }, function(e) {
  53269. var t = new Ci.Vector3;
  53270. return t.subVectors(this.v2, this.v1),
  53271. t.multiplyScalar(e),
  53272. t.add(this.v1),
  53273. t
  53274. }),
  53275. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  53276. this.v0 = e,
  53277. this.v1 = t,
  53278. this.v2 = i
  53279. }, function(e) {
  53280. var t = Ci.ShapeUtils.b2;
  53281. 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))
  53282. }),
  53283. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  53284. this.v0 = e,
  53285. this.v1 = t,
  53286. this.v2 = i,
  53287. this.v3 = n
  53288. }, function(e) {
  53289. var t = Ci.ShapeUtils.b3;
  53290. 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))
  53291. }),
  53292. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  53293. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53294. this.points = null == e ? [] : e
  53295. }, function(e) {
  53296. var t = this.points
  53297. , i = (t.length - 1) * e
  53298. , n = Math.floor(i)
  53299. , r = i - n
  53300. , o = t[0 == n ? n : n - 1]
  53301. , a = t[n]
  53302. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53303. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53304. , c = Ci.CurveUtils.interpolate;
  53305. 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))
  53306. }),
  53307. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  53308. Xt = new xi,
  53309. Zt = new xi,
  53310. Kt = new xi,
  53311. xi.prototype.init = function(e, t, i, n) {
  53312. this.c0 = e,
  53313. this.c1 = i,
  53314. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53315. this.c3 = 2 * e - 2 * t + i + n
  53316. }
  53317. ,
  53318. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53319. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53320. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53321. s *= o,
  53322. l *= o,
  53323. this.init(t, i, s, l)
  53324. }
  53325. ,
  53326. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  53327. this.init(t, i, r * (i - e), r * (n - t))
  53328. }
  53329. ,
  53330. xi.prototype.calc = function(e) {
  53331. var t = e * e
  53332. , i = t * e;
  53333. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53334. }
  53335. ,
  53336. Ci.Curve.create(function(e) {
  53337. this.points = e || [],
  53338. this.closed = !1
  53339. }, function(e) {
  53340. var t, i, n, r, o, a, s, l, c = this.points;
  53341. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  53342. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  53343. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  53344. n = 1),
  53345. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  53346. qt),
  53347. a = c[i % r],
  53348. s = c[(i + 1) % r],
  53349. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  53350. qt),
  53351. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53352. var h = "chordal" === this.type ? .5 : .25
  53353. , u = Math.pow(o.distanceToSquared(a), h)
  53354. , d = Math.pow(a.distanceToSquared(s), h)
  53355. , p = Math.pow(s.distanceToSquared(l), h);
  53356. d < 1e-4 && (d = 1),
  53357. u < 1e-4 && (u = d),
  53358. p < 1e-4 && (p = d),
  53359. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  53360. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  53361. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  53362. } else if ("catmullrom" === this.type) {
  53363. var f = void 0 !== this.tension ? this.tension : .5;
  53364. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  53365. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  53366. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  53367. }
  53368. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  53369. })),
  53370. Ci.ClosedSplineCurve3 = function(e) {
  53371. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53372. Ci.CatmullRomCurve3.call(this, e),
  53373. this.type = "catmullrom",
  53374. this.closed = !0
  53375. }
  53376. ,
  53377. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  53378. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  53379. Ci.Geometry.call(this),
  53380. this.type = "BoxGeometry",
  53381. this.parameters = {
  53382. width: e,
  53383. height: t,
  53384. depth: i,
  53385. widthSegments: n,
  53386. heightSegments: r,
  53387. depthSegments: o
  53388. },
  53389. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  53390. this.mergeVertices()
  53391. }
  53392. ,
  53393. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53394. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  53395. Ci.CubeGeometry = Ci.BoxGeometry,
  53396. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  53397. function a(e, t, i, n, r, o, a, s, l, c, h) {
  53398. 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++)
  53399. for (var E = I * d - f, _ = 0; _ < m; _++) {
  53400. var b = _ * u - p;
  53401. C[e] = b * n,
  53402. C[t] = E * r,
  53403. C[i] = g,
  53404. P[D] = C.x,
  53405. P[D + 1] = C.y,
  53406. P[D + 2] = C.z,
  53407. C[e] = 0,
  53408. C[t] = 0,
  53409. C[i] = 0 < s ? 1 : -1,
  53410. O[D] = C.x,
  53411. O[D + 1] = C.y,
  53412. O[D + 2] = C.z,
  53413. L[N] = _ / l,
  53414. L[N + 1] = 1 - I / c,
  53415. D += 3,
  53416. N += 2,
  53417. y += 1
  53418. }
  53419. for (I = 0; I < c; I++)
  53420. for (_ = 0; _ < l; _++) {
  53421. var w = B + _ + m * I
  53422. , T = B + _ + m * (I + 1)
  53423. , x = B + (_ + 1) + m * (I + 1)
  53424. , S = B + (_ + 1) + m * I;
  53425. R[F] = w,
  53426. R[F + 1] = T,
  53427. R[F + 2] = S,
  53428. R[F + 3] = T,
  53429. R[F + 4] = x,
  53430. R[F + 5] = S,
  53431. F += 6,
  53432. A += 6
  53433. }
  53434. M.addGroup(V, A, h),
  53435. V += A,
  53436. B += y
  53437. }
  53438. Ci.BufferGeometry.call(this),
  53439. this.type = "BoxBufferGeometry",
  53440. this.parameters = {
  53441. width: e,
  53442. height: t,
  53443. depth: i,
  53444. widthSegments: n,
  53445. heightSegments: r,
  53446. depthSegments: o
  53447. };
  53448. var M = this;
  53449. n = Math.floor(n) || 1,
  53450. r = Math.floor(r) || 1,
  53451. o = Math.floor(o) || 1;
  53452. var s, l, c, h, u = (h = 0,
  53453. h += (s = n) * (l = r) * 2,
  53454. h += s * (c = o) * 2,
  53455. 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;
  53456. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  53457. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  53458. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  53459. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  53460. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  53461. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  53462. this.setIndex(new Ci.BufferAttribute(R,1)),
  53463. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  53464. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  53465. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  53466. }
  53467. ,
  53468. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53469. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  53470. Ci.CircleGeometry = function(e, t, i, n) {
  53471. Ci.Geometry.call(this),
  53472. this.type = "CircleGeometry",
  53473. this.parameters = {
  53474. radius: e,
  53475. segments: t,
  53476. thetaStart: i,
  53477. thetaLength: n
  53478. },
  53479. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  53480. }
  53481. ,
  53482. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53483. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  53484. Ci.CircleBufferGeometry = function(e, t, i, n) {
  53485. Ci.BufferGeometry.call(this),
  53486. this.type = "CircleBufferGeometry",
  53487. this.parameters = {
  53488. radius: e,
  53489. segments: t,
  53490. thetaStart: i,
  53491. thetaLength: n
  53492. },
  53493. e = e || 50,
  53494. t = void 0 !== t ? Math.max(3, t) : 8,
  53495. i = void 0 !== i ? i : 0,
  53496. n = void 0 !== n ? n : 2 * Math.PI;
  53497. var r = t + 2
  53498. , o = new Float32Array(3 * r)
  53499. , a = new Float32Array(3 * r)
  53500. , s = new Float32Array(2 * r);
  53501. a[2] = 1,
  53502. s[0] = .5,
  53503. s[1] = .5;
  53504. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53505. c += 3,
  53506. h += 2) {
  53507. var u = i + l / t * n;
  53508. o[c] = e * Math.cos(u),
  53509. o[c + 1] = e * Math.sin(u),
  53510. a[c + 2] = 1,
  53511. s[h] = (o[c] / e + 1) / 2,
  53512. s[h + 1] = (o[c + 1] / e + 1) / 2
  53513. }
  53514. var d = [];
  53515. for (c = 1; c <= t; c++)
  53516. d.push(c, c + 1, 0);
  53517. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53518. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53519. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53520. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53521. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53522. }
  53523. ,
  53524. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53525. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53526. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53527. function t(e) {
  53528. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53529. for (i = b,
  53530. t = 1; t <= m; t++)
  53531. I.setXYZ(b, 0, x * s, 0),
  53532. E.setXYZ(b, 0, s, 0),
  53533. !0 === e ? (r.x = t / m,
  53534. r.y = 0) : (r.x = (t - 1) / m,
  53535. r.y = 1),
  53536. _.setXY(b, r.x, r.y),
  53537. b++;
  53538. for (n = b,
  53539. t = 0; t <= m; t++) {
  53540. var l = t / m;
  53541. o.x = a * Math.sin(l * A + y),
  53542. o.y = x * s,
  53543. o.z = a * Math.cos(l * A + y),
  53544. I.setXYZ(b, o.x, o.y, o.z),
  53545. E.setXYZ(b, 0, s, 0),
  53546. _.setXY(b, l, !0 === e ? 1 : 0),
  53547. b++
  53548. }
  53549. for (t = 0; t < m; t++) {
  53550. var c = i + t
  53551. , h = n + t;
  53552. !0 === e ? (C.setX(w, h),
  53553. w++,
  53554. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53555. w++,
  53556. C.setX(w, h)),
  53557. w++,
  53558. C.setX(w, c),
  53559. w++
  53560. }
  53561. }
  53562. Ci.BufferGeometry.call(this),
  53563. this.type = "CylinderBufferGeometry",
  53564. this.parameters = {
  53565. radiusTop: p,
  53566. radiusBottom: f,
  53567. height: g,
  53568. radialSegments: m,
  53569. heightSegments: v,
  53570. openEnded: e,
  53571. thetaStart: y,
  53572. thetaLength: A
  53573. },
  53574. p = void 0 !== p ? p : 20,
  53575. f = void 0 !== f ? f : 20,
  53576. g = void 0 !== g ? g : 100,
  53577. m = Math.floor(m) || 8,
  53578. v = Math.floor(v) || 1,
  53579. e = void 0 !== e && e,
  53580. y = void 0 !== y ? y : 0,
  53581. A = void 0 !== A ? A : 2 * Math.PI;
  53582. var i, n, r = (n = (m + 1) * (v + 1),
  53583. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53584. n), o = (i = m * v * 2 * 3,
  53585. !1 === e && (i += 2 * m * 3),
  53586. 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;
  53587. (function() {
  53588. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53589. for (t = 0; t <= v; t++) {
  53590. var o = []
  53591. , a = t / v
  53592. , s = a * (f - p) + p;
  53593. for (e = 0; e <= m; e++) {
  53594. var l = e / m;
  53595. n.x = s * Math.sin(l * A + y),
  53596. n.y = -a * g + x,
  53597. n.z = s * Math.cos(l * A + y),
  53598. I.setXYZ(b, n.x, n.y, n.z),
  53599. i.copy(n),
  53600. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53601. i.z = Math.cos(l * A + y)),
  53602. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53603. E.setXYZ(b, i.x, i.y, i.z),
  53604. _.setXY(b, l, 1 - a),
  53605. o.push(b),
  53606. b++
  53607. }
  53608. T.push(o)
  53609. }
  53610. for (e = 0; e < m; e++)
  53611. for (t = 0; t < v; t++) {
  53612. var c = T[t][e]
  53613. , h = T[t + 1][e]
  53614. , u = T[t + 1][e + 1]
  53615. , d = T[t][e + 1];
  53616. C.setX(w, c),
  53617. w++,
  53618. C.setX(w, h),
  53619. w++,
  53620. C.setX(w, d),
  53621. w++,
  53622. C.setX(w, h),
  53623. w++,
  53624. C.setX(w, u),
  53625. w++,
  53626. C.setX(w, d),
  53627. w++
  53628. }
  53629. }
  53630. )(),
  53631. !1 === e && (0 < p && t(!0),
  53632. 0 < f && t(!1)),
  53633. this.setIndex(C),
  53634. this.addAttribute("position", I),
  53635. this.addAttribute("normal", E),
  53636. this.addAttribute("uv", _)
  53637. }
  53638. ,
  53639. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53640. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53641. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53642. Ci.Geometry.call(this),
  53643. this.type = "CylinderGeometry",
  53644. this.parameters = {
  53645. radiusTop: e,
  53646. radiusBottom: t,
  53647. height: i,
  53648. radialSegments: n,
  53649. heightSegments: r,
  53650. openEnded: o,
  53651. thetaStart: a,
  53652. thetaLength: s
  53653. },
  53654. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53655. this.mergeVertices()
  53656. }
  53657. ,
  53658. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53659. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53660. Ci.EdgesGeometry = function(e, t) {
  53661. function i(e, t) {
  53662. return e - t
  53663. }
  53664. Ci.BufferGeometry.call(this),
  53665. t = void 0 !== t ? t : 1;
  53666. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53667. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53668. n.mergeVertices(),
  53669. n.computeFaceNormals();
  53670. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53671. for (var d = c[h], p = 0; p < 3; p++) {
  53672. o[0] = d[s[p]],
  53673. o[1] = d[s[(p + 1) % 3]],
  53674. o.sort(i),
  53675. void 0 === a[g = o.toString()] ? a[g] = {
  53676. vert1: o[0],
  53677. vert2: o[1],
  53678. face1: h,
  53679. face2: void 0
  53680. } : a[g].face2 = h
  53681. }
  53682. var f = [];
  53683. for (var g in a) {
  53684. var m = a[g];
  53685. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53686. var v = l[m.vert1];
  53687. f.push(v.x),
  53688. f.push(v.y),
  53689. f.push(v.z),
  53690. v = l[m.vert2],
  53691. f.push(v.x),
  53692. f.push(v.y),
  53693. f.push(v.z)
  53694. }
  53695. }
  53696. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53697. }
  53698. ,
  53699. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53700. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53701. Ci.ExtrudeGeometry = function(e, t) {
  53702. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53703. this.type = "ExtrudeGeometry",
  53704. e = Array.isArray(e) ? e : [e],
  53705. this.addShapeList(e, t),
  53706. void this.computeFaceNormals())
  53707. }
  53708. ;
  53709. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53710. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53711. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53712. for (var i = e.length, n = 0; n < i; n++) {
  53713. var r = e[n];
  53714. this.addShape(r, t)
  53715. }
  53716. }
  53717. ,
  53718. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53719. function i(e, t, i) {
  53720. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53721. t.clone().multiplyScalar(i).add(e)
  53722. }
  53723. function n(e, t, i) {
  53724. 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;
  53725. if (Math.abs(u) > Number.EPSILON) {
  53726. var d = Math.sqrt(h)
  53727. , p = Math.sqrt(l * l + c * c)
  53728. , f = t.x - s / d
  53729. , g = t.y + a / d
  53730. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53731. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53732. if (v <= 2)
  53733. return new Ci.Vector2(n,r);
  53734. o = Math.sqrt(v / 2)
  53735. } else {
  53736. var y = !1;
  53737. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53738. o = y ? (n = -s,
  53739. r = a,
  53740. Math.sqrt(h)) : (n = a,
  53741. r = s,
  53742. Math.sqrt(h / 2))
  53743. }
  53744. return new Ci.Vector2(n / o,r / o)
  53745. }
  53746. function r(e, t) {
  53747. var i, n;
  53748. for (G = e.length; 0 <= --G; ) {
  53749. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53750. var r = 0
  53751. , o = A + 2 * m;
  53752. for (r = 0; r < o; r++) {
  53753. var a = U * r
  53754. , s = U * (r + 1);
  53755. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53756. }
  53757. }
  53758. }
  53759. function o(e, t, i) {
  53760. T.vertices.push(new Ci.Vector3(e,t,i))
  53761. }
  53762. function a(e, t, i) {
  53763. e += x,
  53764. t += x,
  53765. i += x,
  53766. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53767. var n = E.generateTopUV(T, e, t, i);
  53768. T.faceVertexUvs[0].push(n)
  53769. }
  53770. function l(e, t, i, n) {
  53771. e += x,
  53772. t += x,
  53773. i += x,
  53774. n += x,
  53775. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53776. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53777. var r = E.generateSideWallUV(T, e, t, i, n);
  53778. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53779. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53780. }
  53781. 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;
  53782. C && (s = C.getSpacedPoints(A),
  53783. v = !(I = !0),
  53784. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53785. h = new Ci.Vector3,
  53786. u = new Ci.Vector3,
  53787. d = new Ci.Vector3),
  53788. v || (g = f = m = 0);
  53789. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53790. if (P) {
  53791. for (M = M.reverse(),
  53792. b = 0,
  53793. w = R.length; b < w; b++)
  53794. _ = R[b],
  53795. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53796. P = !1
  53797. }
  53798. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53799. , L = M;
  53800. for (b = 0,
  53801. w = R.length; b < w; b++)
  53802. _ = R[b],
  53803. M = M.concat(_);
  53804. 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++,
  53805. j++,
  53806. Y++)
  53807. j === W && (j = 0),
  53808. Y === W && (Y = 0),
  53809. z[G] = n(L[G], L[j], L[Y]);
  53810. var q, X, Z = [], K = z.concat();
  53811. for (b = 0,
  53812. w = R.length; b < w; b++) {
  53813. for (_ = R[b],
  53814. q = [],
  53815. G = 0,
  53816. j = (W = _.length) - 1,
  53817. Y = G + 1; G < W; G++,
  53818. j++,
  53819. Y++)
  53820. j === W && (j = 0),
  53821. Y === W && (Y = 0),
  53822. q[G] = n(_[G], _[j], _[Y]);
  53823. Z.push(q),
  53824. K = K.concat(q)
  53825. }
  53826. for (D = 0; D < m; D++) {
  53827. for (B = f * (1 - (F = D / m)),
  53828. N = g * Math.sin(F * Math.PI / 2),
  53829. G = 0,
  53830. W = L.length; G < W; G++)
  53831. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53832. for (b = 0,
  53833. w = R.length; b < w; b++)
  53834. for (_ = R[b],
  53835. q = Z[b],
  53836. G = 0,
  53837. W = _.length; G < W; G++)
  53838. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53839. }
  53840. for (N = g,
  53841. G = 0; G < U; G++)
  53842. V = v ? i(M[G], K[G], N) : M[G],
  53843. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53844. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53845. d.copy(s[0]).add(u).add(h),
  53846. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53847. for (X = 1; X <= A; X++)
  53848. for (G = 0; G < U; G++)
  53849. V = v ? i(M[G], K[G], N) : M[G],
  53850. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53851. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53852. d.copy(s[X]).add(u).add(h),
  53853. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53854. for (D = m - 1; 0 <= D; D--) {
  53855. for (B = f * (1 - (F = D / m)),
  53856. N = g * Math.sin(F * Math.PI / 2),
  53857. G = 0,
  53858. W = L.length; G < W; G++)
  53859. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53860. for (b = 0,
  53861. w = R.length; b < w; b++)
  53862. for (_ = R[b],
  53863. q = Z[b],
  53864. G = 0,
  53865. W = _.length; G < W; G++)
  53866. V = i(_[G], q[G], N),
  53867. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53868. }
  53869. (function() {
  53870. if (v) {
  53871. var e = 0
  53872. , t = U * e;
  53873. for (G = 0; G < H; G++)
  53874. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53875. for (t = U * (e = A + 2 * m),
  53876. G = 0; G < H; G++)
  53877. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53878. } else {
  53879. for (G = 0; G < H; G++)
  53880. a((k = O[G])[2], k[1], k[0]);
  53881. for (G = 0; G < H; G++)
  53882. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53883. }
  53884. }
  53885. )(),
  53886. function() {
  53887. var e = 0;
  53888. for (r(L, e),
  53889. e += L.length,
  53890. b = 0,
  53891. w = R.length; b < w; b++)
  53892. r(_ = R[b], e),
  53893. e += _.length
  53894. }()
  53895. }
  53896. ,
  53897. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53898. generateTopUV: function(e, t, i, n) {
  53899. var r = e.vertices
  53900. , o = r[t]
  53901. , a = r[i]
  53902. , s = r[n];
  53903. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53904. },
  53905. generateSideWallUV: function(e, t, i, n, r) {
  53906. var o = e.vertices
  53907. , a = o[t]
  53908. , s = o[i]
  53909. , l = o[n]
  53910. , c = o[r];
  53911. 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)]
  53912. }
  53913. },
  53914. Ci.ShapeGeometry = function(e, t) {
  53915. Ci.Geometry.call(this),
  53916. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53917. this.addShapeList(e, t),
  53918. this.computeFaceNormals()
  53919. }
  53920. ,
  53921. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53922. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53923. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53924. for (var i = 0, n = e.length; i < n; i++)
  53925. this.addShape(e[i], t);
  53926. return this
  53927. }
  53928. ,
  53929. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53930. void 0 === t && (t = {});
  53931. 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);
  53932. if (d) {
  53933. for (h = h.reverse(),
  53934. i = 0,
  53935. n = u.length; i < n; i++)
  53936. r = u[i],
  53937. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53938. d = !1
  53939. }
  53940. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53941. for (i = 0,
  53942. n = u.length; i < n; i++)
  53943. r = u[i],
  53944. h = h.concat(r);
  53945. var f, g, m = h.length, v = p.length;
  53946. for (i = 0; i < m; i++)
  53947. f = h[i],
  53948. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53949. for (i = 0; i < v; i++) {
  53950. var y = (g = p[i])[0] + l
  53951. , A = g[1] + l
  53952. , C = g[2] + l;
  53953. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53954. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53955. }
  53956. }
  53957. ,
  53958. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53959. Ci.BufferGeometry.call(this),
  53960. this.type = "LatheBufferGeometry",
  53961. this.parameters = {
  53962. points: e,
  53963. segments: t,
  53964. phiStart: i,
  53965. phiLength: n
  53966. },
  53967. t = Math.floor(t) || 12,
  53968. i = i || 0,
  53969. n = n || 2 * Math.PI,
  53970. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53971. 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,
  53972. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53973. for (o = 0; o <= t; o++) {
  53974. var v = i + o * f * n
  53975. , y = Math.sin(v)
  53976. , A = Math.cos(v);
  53977. for (a = 0; a <= e.length - 1; a++)
  53978. g.x = e[a].x * y,
  53979. g.y = e[a].y,
  53980. g.z = e[a].x * A,
  53981. h.setXYZ(d, g.x, g.y, g.z),
  53982. m.x = o / t,
  53983. m.y = a / (e.length - 1),
  53984. u.setXY(d, m.x, m.y),
  53985. d++
  53986. }
  53987. for (o = 0; o < t; o++)
  53988. for (a = 0; a < e.length - 1; a++) {
  53989. var C = r = a + o * e.length
  53990. , I = r + e.length
  53991. , E = r + e.length + 1
  53992. , _ = r + 1;
  53993. c.setX(p, C),
  53994. p++,
  53995. c.setX(p, I),
  53996. p++,
  53997. c.setX(p, _),
  53998. p++,
  53999. c.setX(p, I),
  54000. p++,
  54001. c.setX(p, E),
  54002. p++,
  54003. c.setX(p, _),
  54004. p++
  54005. }
  54006. if (this.setIndex(c),
  54007. this.addAttribute("position", h),
  54008. this.addAttribute("uv", u),
  54009. this.computeVertexNormals(),
  54010. n === 2 * Math.PI) {
  54011. var b = this.attributes.normal.array
  54012. , w = new Ci.Vector3
  54013. , T = new Ci.Vector3
  54014. , x = new Ci.Vector3;
  54015. for (r = t * e.length * 3,
  54016. a = o = 0; o < e.length; o++,
  54017. a += 3)
  54018. w.x = b[a + 0],
  54019. w.y = b[a + 1],
  54020. w.z = b[a + 2],
  54021. T.x = b[r + a + 0],
  54022. T.y = b[r + a + 1],
  54023. T.z = b[r + a + 2],
  54024. x.addVectors(w, T).normalize(),
  54025. b[a + 0] = b[r + a + 0] = x.x,
  54026. b[a + 1] = b[r + a + 1] = x.y,
  54027. b[a + 2] = b[r + a + 2] = x.z
  54028. }
  54029. }
  54030. ,
  54031. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54032. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  54033. Ci.LatheGeometry = function(e, t, i, n) {
  54034. Ci.Geometry.call(this),
  54035. this.type = "LatheGeometry",
  54036. this.parameters = {
  54037. points: e,
  54038. segments: t,
  54039. phiStart: i,
  54040. phiLength: n
  54041. },
  54042. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  54043. this.mergeVertices()
  54044. }
  54045. ,
  54046. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54047. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  54048. Ci.PlaneGeometry = function(e, t, i, n) {
  54049. Ci.Geometry.call(this),
  54050. this.type = "PlaneGeometry",
  54051. this.parameters = {
  54052. width: e,
  54053. height: t,
  54054. widthSegments: i,
  54055. heightSegments: n
  54056. },
  54057. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  54058. }
  54059. ,
  54060. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54061. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  54062. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  54063. Ci.BufferGeometry.call(this),
  54064. this.type = "PlaneBufferGeometry",
  54065. this.parameters = {
  54066. width: e,
  54067. height: t,
  54068. widthSegments: i,
  54069. heightSegments: n
  54070. };
  54071. 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++)
  54072. for (var y = v * u - o, A = 0; A < l; A++) {
  54073. var C = A * h - r;
  54074. d[g] = C,
  54075. d[g + 1] = -y,
  54076. p[g + 2] = 1,
  54077. f[m] = A / a,
  54078. f[m + 1] = 1 - v / s,
  54079. g += 3,
  54080. m += 2
  54081. }
  54082. g = 0;
  54083. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  54084. for (v = 0; v < s; v++)
  54085. for (A = 0; A < a; A++) {
  54086. var E = A + l * v
  54087. , _ = A + l * (v + 1)
  54088. , b = A + 1 + l * (v + 1)
  54089. , w = A + 1 + l * v;
  54090. I[g] = E,
  54091. I[g + 1] = _,
  54092. I[g + 2] = w,
  54093. I[g + 3] = _,
  54094. I[g + 4] = b,
  54095. I[g + 5] = w,
  54096. g += 6
  54097. }
  54098. this.setIndex(new Ci.BufferAttribute(I,1)),
  54099. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  54100. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  54101. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  54102. }
  54103. ,
  54104. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54105. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  54106. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  54107. Ci.BufferGeometry.call(this),
  54108. this.type = "RingBufferGeometry",
  54109. this.parameters = {
  54110. innerRadius: e,
  54111. outerRadius: t,
  54112. thetaSegments: i,
  54113. phiSegments: n,
  54114. thetaStart: r,
  54115. thetaLength: o
  54116. },
  54117. e = e || 20,
  54118. t = t || 50,
  54119. r = void 0 !== r ? r : 0,
  54120. o = void 0 !== o ? o : 2 * Math.PI;
  54121. 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;
  54122. for (s = 0; s <= n; s++) {
  54123. for (l = 0; l <= i; l++)
  54124. a = r + l / i * o,
  54125. A.x = v * Math.cos(a),
  54126. A.y = v * Math.sin(a),
  54127. d.setXYZ(g, A.x, A.y, A.z),
  54128. p.setXYZ(g, 0, 0, 1),
  54129. C.x = (A.x / t + 1) / 2,
  54130. C.y = (A.y / t + 1) / 2,
  54131. f.setXY(g, C.x, C.y),
  54132. g++;
  54133. v += y
  54134. }
  54135. for (s = 0; s < n; s++) {
  54136. var I = s * (i + 1);
  54137. for (l = 0; l < i; l++) {
  54138. var E = a = l + I
  54139. , _ = a + i + 1
  54140. , b = a + i + 2
  54141. , w = a + 1;
  54142. u.setX(m, E),
  54143. m++,
  54144. u.setX(m, _),
  54145. m++,
  54146. u.setX(m, b),
  54147. m++,
  54148. u.setX(m, E),
  54149. m++,
  54150. u.setX(m, b),
  54151. m++,
  54152. u.setX(m, w),
  54153. m++
  54154. }
  54155. }
  54156. this.setIndex(u),
  54157. this.addAttribute("position", d),
  54158. this.addAttribute("normal", p),
  54159. this.addAttribute("uv", f)
  54160. }
  54161. ,
  54162. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54163. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  54164. Ci.RingGeometry = function(e, t, i, n, r, o) {
  54165. Ci.Geometry.call(this),
  54166. this.type = "RingGeometry",
  54167. this.parameters = {
  54168. innerRadius: e,
  54169. outerRadius: t,
  54170. thetaSegments: i,
  54171. phiSegments: n,
  54172. thetaStart: r,
  54173. thetaLength: o
  54174. },
  54175. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  54176. }
  54177. ,
  54178. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54179. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  54180. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  54181. Ci.Geometry.call(this),
  54182. this.type = "SphereGeometry",
  54183. this.parameters = {
  54184. radius: e,
  54185. widthSegments: t,
  54186. heightSegments: i,
  54187. phiStart: n,
  54188. phiLength: r,
  54189. thetaStart: o,
  54190. thetaLength: a
  54191. },
  54192. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  54193. }
  54194. ,
  54195. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54196. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  54197. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  54198. Ci.BufferGeometry.call(this),
  54199. this.type = "SphereBufferGeometry",
  54200. this.parameters = {
  54201. radius: e,
  54202. widthSegments: t,
  54203. heightSegments: i,
  54204. phiStart: n,
  54205. phiLength: r,
  54206. thetaStart: o,
  54207. thetaLength: a
  54208. },
  54209. e = e || 50,
  54210. t = Math.max(3, Math.floor(t) || 8),
  54211. i = Math.max(2, Math.floor(i) || 6),
  54212. n = void 0 !== n ? n : 0,
  54213. r = void 0 !== r ? r : 2 * Math.PI;
  54214. 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++) {
  54215. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  54216. var A = y / t
  54217. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  54218. , I = e * Math.cos(o + v * a)
  54219. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  54220. f.set(C, I, E).normalize(),
  54221. c.setXYZ(d, C, I, E),
  54222. h.setXYZ(d, f.x, f.y, f.z),
  54223. u.setXY(d, A, 1 - v),
  54224. m.push(d),
  54225. d++
  54226. }
  54227. p.push(m)
  54228. }
  54229. var _ = [];
  54230. for (g = 0; g < i; g++)
  54231. for (y = 0; y < t; y++) {
  54232. var b = p[g][y + 1]
  54233. , w = p[g][y]
  54234. , T = p[g + 1][y]
  54235. , x = p[g + 1][y + 1];
  54236. (0 !== g || 0 < o) && _.push(b, w, x),
  54237. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  54238. }
  54239. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  54240. this.addAttribute("position", c),
  54241. this.addAttribute("normal", h),
  54242. this.addAttribute("uv", u),
  54243. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  54244. }
  54245. ,
  54246. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54247. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  54248. Ci.TextGeometry = function(e, t) {
  54249. var i = (t = t || {}).font;
  54250. if (i instanceof Ci.Font == 0)
  54251. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54252. new Ci.Geometry;
  54253. var n = i.generateShapes(e, t.size, t.curveSegments);
  54254. t.amount = void 0 !== t.height ? t.height : 50,
  54255. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54256. void 0 === t.bevelSize && (t.bevelSize = 8),
  54257. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54258. Ci.ExtrudeGeometry.call(this, n, t),
  54259. this.type = "TextGeometry"
  54260. }
  54261. ,
  54262. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  54263. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  54264. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  54265. Ci.BufferGeometry.call(this),
  54266. this.type = "TorusBufferGeometry",
  54267. this.parameters = {
  54268. radius: e,
  54269. tube: t,
  54270. radialSegments: i,
  54271. tubularSegments: n,
  54272. arc: r
  54273. },
  54274. e = e || 100,
  54275. t = t || 40,
  54276. i = Math.floor(i) || 8,
  54277. n = Math.floor(n) || 6,
  54278. r = r || 2 * Math.PI;
  54279. 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;
  54280. for (o = 0; o <= i; o++)
  54281. for (a = 0; a <= n; a++) {
  54282. var A = a / n * r
  54283. , C = o / i * Math.PI * 2;
  54284. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  54285. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  54286. v.z = t * Math.sin(C),
  54287. h[p] = v.x,
  54288. h[p + 1] = v.y,
  54289. h[p + 2] = v.z,
  54290. m.x = e * Math.cos(A),
  54291. m.y = e * Math.sin(A),
  54292. y.subVectors(v, m).normalize(),
  54293. u[p] = y.x,
  54294. u[p + 1] = y.y,
  54295. u[p + 2] = y.z,
  54296. d[f] = a / n,
  54297. d[f + 1] = o / i,
  54298. p += 3,
  54299. f += 2
  54300. }
  54301. for (o = 1; o <= i; o++)
  54302. for (a = 1; a <= n; a++) {
  54303. var I = (n + 1) * o + a - 1
  54304. , E = (n + 1) * (o - 1) + a - 1
  54305. , _ = (n + 1) * (o - 1) + a
  54306. , b = (n + 1) * o + a;
  54307. c[g] = I,
  54308. c[g + 1] = E,
  54309. c[g + 2] = b,
  54310. c[g + 3] = E,
  54311. c[g + 4] = _,
  54312. c[g + 5] = b,
  54313. g += 6
  54314. }
  54315. this.setIndex(new Ci.BufferAttribute(c,1)),
  54316. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  54317. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  54318. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  54319. }
  54320. ,
  54321. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54322. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  54323. Ci.TorusGeometry = function(e, t, i, n, r) {
  54324. Ci.Geometry.call(this),
  54325. this.type = "TorusGeometry",
  54326. this.parameters = {
  54327. radius: e,
  54328. tube: t,
  54329. radialSegments: i,
  54330. tubularSegments: n,
  54331. arc: r
  54332. },
  54333. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  54334. }
  54335. ,
  54336. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54337. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  54338. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  54339. function a(e, t, i, n, r) {
  54340. var o = Math.cos(e)
  54341. , a = Math.sin(e)
  54342. , s = i / t * e
  54343. , l = Math.cos(s);
  54344. r.x = n * (2 + l) * .5 * o,
  54345. r.y = n * (2 + l) * a * .5,
  54346. r.z = n * Math.sin(s) * .5
  54347. }
  54348. Ci.BufferGeometry.call(this),
  54349. this.type = "TorusKnotBufferGeometry",
  54350. this.parameters = {
  54351. radius: e,
  54352. tube: t,
  54353. tubularSegments: i,
  54354. radialSegments: n,
  54355. p: r,
  54356. q: o
  54357. },
  54358. e = e || 100,
  54359. t = t || 40,
  54360. i = Math.floor(i) || 64,
  54361. r = r || 2,
  54362. o = o || 3;
  54363. 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;
  54364. for (s = 0; s <= i; ++s) {
  54365. var w = s / i * r * Math.PI * 2;
  54366. for (a(w, r, o, e, C),
  54367. a(.01 + w, r, o, e, I),
  54368. _.subVectors(I, C),
  54369. b.addVectors(I, C),
  54370. E.crossVectors(_, b),
  54371. b.crossVectors(E, _),
  54372. E.normalize(),
  54373. b.normalize(),
  54374. l = 0; l <= n; ++l) {
  54375. var T = l / n * Math.PI * 2
  54376. , x = -t * Math.cos(T)
  54377. , S = t * Math.sin(T);
  54378. v.x = C.x + (x * b.x + S * E.x),
  54379. v.y = C.y + (x * b.y + S * E.y),
  54380. v.z = C.z + (x * b.z + S * E.z),
  54381. d.setXYZ(g, v.x, v.y, v.z),
  54382. y.subVectors(v, C).normalize(),
  54383. p.setXYZ(g, y.x, y.y, y.z),
  54384. A.x = s / i,
  54385. A.y = l / n,
  54386. f.setXY(g, A.x, A.y),
  54387. g++
  54388. }
  54389. }
  54390. for (l = 1; l <= i; l++)
  54391. for (s = 1; s <= n; s++) {
  54392. var M = (n + 1) * (l - 1) + (s - 1)
  54393. , R = (n + 1) * l + (s - 1)
  54394. , P = (n + 1) * l + s
  54395. , O = (n + 1) * (l - 1) + s;
  54396. u.setX(m, M),
  54397. m++,
  54398. u.setX(m, R),
  54399. m++,
  54400. u.setX(m, O),
  54401. m++,
  54402. u.setX(m, R),
  54403. m++,
  54404. u.setX(m, P),
  54405. m++,
  54406. u.setX(m, O),
  54407. m++
  54408. }
  54409. this.setIndex(u),
  54410. this.addAttribute("position", d),
  54411. this.addAttribute("normal", p),
  54412. this.addAttribute("uv", f)
  54413. }
  54414. ,
  54415. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54416. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  54417. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  54418. Ci.Geometry.call(this),
  54419. this.type = "TorusKnotGeometry",
  54420. this.parameters = {
  54421. radius: e,
  54422. tube: t,
  54423. tubularSegments: i,
  54424. radialSegments: n,
  54425. p: r,
  54426. q: o
  54427. },
  54428. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54429. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  54430. this.mergeVertices()
  54431. }
  54432. ,
  54433. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54434. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  54435. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  54436. Ci.Geometry.call(this),
  54437. this.type = "TubeGeometry",
  54438. this.parameters = {
  54439. path: e,
  54440. segments: t,
  54441. radius: i,
  54442. radialSegments: n,
  54443. closed: r,
  54444. taper: o
  54445. },
  54446. t = t || 64,
  54447. i = i || 1,
  54448. n = n || 8,
  54449. r = r || !1,
  54450. o = o || Ci.TubeGeometry.NoTaper;
  54451. 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;
  54452. for (this.tangents = D,
  54453. this.normals = N,
  54454. this.binormals = F,
  54455. f = 0; f < P; f++)
  54456. for (M[f] = [],
  54457. l = f / (P - 1),
  54458. p = e.getPointAt(l),
  54459. D[f],
  54460. a = N[f],
  54461. s = F[f],
  54462. h = i * o(l),
  54463. g = 0; g < n; g++)
  54464. c = g / n * 2 * Math.PI,
  54465. u = -h * Math.cos(c),
  54466. d = h * Math.sin(c),
  54467. O.copy(p),
  54468. O.x += u * a.x + d * s.x,
  54469. O.y += u * a.y + d * s.y,
  54470. O.z += u * a.z + d * s.z,
  54471. M[f][g] = (T = O.x,
  54472. x = O.y,
  54473. S = O.z,
  54474. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  54475. for (f = 0; f < t; f++)
  54476. for (g = 0; g < n; g++)
  54477. m = r ? (f + 1) % t : f + 1,
  54478. v = (g + 1) % n,
  54479. y = M[f][g],
  54480. A = M[m][g],
  54481. C = M[m][v],
  54482. I = M[f][v],
  54483. E = new Ci.Vector2(f / t,g / n),
  54484. _ = new Ci.Vector2((f + 1) / t,g / n),
  54485. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  54486. w = new Ci.Vector2(f / t,(g + 1) / n),
  54487. this.faces.push(new Ci.Face3(y,A,I)),
  54488. this.faceVertexUvs[0].push([E, _, w]),
  54489. this.faces.push(new Ci.Face3(A,C,I)),
  54490. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  54491. this.computeFaceNormals(),
  54492. this.computeVertexNormals()
  54493. }
  54494. ,
  54495. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54496. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54497. Ci.TubeGeometry.NoTaper = function(e) {
  54498. return 1
  54499. }
  54500. ,
  54501. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54502. return Math.sin(Math.PI * e)
  54503. }
  54504. ,
  54505. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54506. 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;
  54507. for (this.tangents = u,
  54508. this.normals = d,
  54509. this.binormals = p,
  54510. l = 0; l < m; l++)
  54511. c = l / (m - 1),
  54512. u[l] = e.getTangentAt(c),
  54513. u[l].normalize();
  54514. for (d[0] = new Ci.Vector3,
  54515. p[0] = new Ci.Vector3,
  54516. r = Number.MAX_VALUE,
  54517. o = Math.abs(u[0].x),
  54518. a = Math.abs(u[0].y),
  54519. s = Math.abs(u[0].z),
  54520. o <= r && (r = o,
  54521. h.set(1, 0, 0)),
  54522. a <= r && (r = a,
  54523. h.set(0, 1, 0)),
  54524. s <= r && h.set(0, 0, 1),
  54525. f.crossVectors(u[0], h).normalize(),
  54526. d[0].crossVectors(u[0], f),
  54527. p[0].crossVectors(u[0], d[0]),
  54528. l = 1; l < m; l++)
  54529. d[l] = d[l - 1].clone(),
  54530. p[l] = p[l - 1].clone(),
  54531. f.crossVectors(u[l - 1], u[l]),
  54532. f.length() > Number.EPSILON && (f.normalize(),
  54533. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54534. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54535. p[l].crossVectors(u[l], d[l]);
  54536. if (i)
  54537. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54538. n /= m - 1,
  54539. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54540. l = 1; l < m; l++)
  54541. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54542. p[l].crossVectors(u[l], d[l])
  54543. }
  54544. ,
  54545. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54546. function f(e) {
  54547. var t = e.normalize().clone();
  54548. t.index = m.vertices.push(t) - 1;
  54549. var i = a(e) / 2 / Math.PI + .5
  54550. , n = function(e) {
  54551. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54552. }(e) / Math.PI + .5;
  54553. return t.uv = new Ci.Vector2(i,1 - n),
  54554. t
  54555. }
  54556. function g(e, t, i, n) {
  54557. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54558. m.faces.push(r),
  54559. y.copy(e).add(t).add(i).divideScalar(3);
  54560. var o = a(y);
  54561. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54562. }
  54563. function r(e, t) {
  54564. 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++) {
  54565. a[l] = [];
  54566. 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++)
  54567. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54568. }
  54569. for (l = 0; l < i; l++)
  54570. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54571. var p = Math.floor(d / 2);
  54572. 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)
  54573. }
  54574. }
  54575. function a(e) {
  54576. return Math.atan2(e.z, -e.x)
  54577. }
  54578. function s(e, t, i) {
  54579. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54580. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54581. e.clone()
  54582. }
  54583. Ci.Geometry.call(this),
  54584. this.type = "PolyhedronGeometry",
  54585. this.parameters = {
  54586. vertices: e,
  54587. indices: t,
  54588. radius: i,
  54589. detail: n
  54590. },
  54591. i = i || 1,
  54592. n = n || 0;
  54593. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54594. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54595. var c = this.vertices
  54596. , h = []
  54597. , u = (o = 0,
  54598. 0);
  54599. for (l = t.length; o < l; o += 3,
  54600. u++) {
  54601. var d = c[t[o]]
  54602. , p = c[t[o + 1]]
  54603. , v = c[t[o + 2]];
  54604. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54605. }
  54606. var y = new Ci.Vector3;
  54607. for (o = 0,
  54608. l = h.length; o < l; o++)
  54609. r(h[o], n);
  54610. for (o = 0,
  54611. l = this.faceVertexUvs[0].length; o < l; o++) {
  54612. var A = this.faceVertexUvs[0][o]
  54613. , C = A[0].x
  54614. , I = A[1].x
  54615. , E = A[2].x
  54616. , _ = Math.max(C, I, E)
  54617. , b = Math.min(C, I, E);
  54618. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54619. I < .2 && (A[1].x += 1),
  54620. E < .2 && (A[2].x += 1))
  54621. }
  54622. for (o = 0,
  54623. l = this.vertices.length; o < l; o++)
  54624. this.vertices[o].multiplyScalar(i);
  54625. this.mergeVertices(),
  54626. this.computeFaceNormals(),
  54627. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54628. }
  54629. ,
  54630. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54631. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54632. Ci.DodecahedronGeometry = function(e, t) {
  54633. var i = (1 + Math.sqrt(5)) / 2
  54634. , n = 1 / i
  54635. , 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];
  54636. 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),
  54637. this.type = "DodecahedronGeometry",
  54638. this.parameters = {
  54639. radius: e,
  54640. detail: t
  54641. }
  54642. }
  54643. ,
  54644. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54645. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54646. Ci.IcosahedronGeometry = function(e, t) {
  54647. var i = (1 + Math.sqrt(5)) / 2
  54648. , 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];
  54649. 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),
  54650. this.type = "IcosahedronGeometry",
  54651. this.parameters = {
  54652. radius: e,
  54653. detail: t
  54654. }
  54655. }
  54656. ,
  54657. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54658. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54659. Ci.OctahedronGeometry = function(e, t) {
  54660. 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),
  54661. this.type = "OctahedronGeometry",
  54662. this.parameters = {
  54663. radius: e,
  54664. detail: t
  54665. }
  54666. }
  54667. ,
  54668. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54669. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54670. Ci.TetrahedronGeometry = function(e, t) {
  54671. 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),
  54672. this.type = "TetrahedronGeometry",
  54673. this.parameters = {
  54674. radius: e,
  54675. detail: t
  54676. }
  54677. }
  54678. ,
  54679. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54680. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54681. Ci.ParametricGeometry = function(e, t, i) {
  54682. Ci.Geometry.call(this),
  54683. this.type = "ParametricGeometry",
  54684. this.parameters = {
  54685. func: e,
  54686. slices: t,
  54687. stacks: i
  54688. };
  54689. 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;
  54690. for (n = 0; n <= i; n++)
  54691. for (a = n / i,
  54692. r = 0; r <= t; r++)
  54693. o = e(r / t, a),
  54694. g.push(o);
  54695. for (n = 0; n < i; n++)
  54696. for (r = 0; r < t; r++)
  54697. l = (s = n * y + r) + 1,
  54698. c = (n + 1) * y + r + 1,
  54699. h = (n + 1) * y + r,
  54700. u = new Ci.Vector2(r / t,n / i),
  54701. d = new Ci.Vector2((r + 1) / t,n / i),
  54702. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54703. f = new Ci.Vector2(r / t,(n + 1) / i),
  54704. m.push(new Ci.Face3(s,l,h)),
  54705. v.push([u, d, f]),
  54706. m.push(new Ci.Face3(l,c,h)),
  54707. v.push([d.clone(), p, f.clone()]);
  54708. this.computeFaceNormals(),
  54709. this.computeVertexNormals()
  54710. }
  54711. ,
  54712. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54713. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54714. Ci.WireframeGeometry = function(e) {
  54715. function t(e, t) {
  54716. return e - t
  54717. }
  54718. Ci.BufferGeometry.call(this);
  54719. var i = [0, 0]
  54720. , n = {}
  54721. , r = ["a", "b", "c"];
  54722. if (e instanceof Ci.Geometry) {
  54723. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54724. for (var u = a[c], d = 0; d < 3; d++) {
  54725. i[0] = u[r[d]],
  54726. i[1] = u[r[(d + 1) % 3]],
  54727. i.sort(t),
  54728. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54729. l[2 * s + 1] = i[1],
  54730. n[E] = !0,
  54731. s++)
  54732. }
  54733. var p = new Float32Array(2 * s * 3);
  54734. for (c = 0,
  54735. h = s; c < h; c++)
  54736. for (d = 0; d < 2; d++) {
  54737. var f = o[l[2 * c + d]];
  54738. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54739. p[_ + 1] = f.y,
  54740. p[_ + 2] = f.z
  54741. }
  54742. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54743. } else if (e instanceof Ci.BufferGeometry)
  54744. if (null !== e.index) {
  54745. var g = e.index.array
  54746. , m = (o = e.attributes.position,
  54747. e.groups);
  54748. s = 0;
  54749. 0 === m.length && e.addGroup(0, g.length);
  54750. l = new Uint32Array(2 * g.length);
  54751. for (var v = 0, y = m.length; v < y; ++v)
  54752. for (var A = m[v], C = A.start, I = (c = C,
  54753. C + A.count); c < I; c += 3)
  54754. for (d = 0; d < 3; d++) {
  54755. var E;
  54756. i[0] = g[c + d],
  54757. i[1] = g[c + (d + 1) % 3],
  54758. i.sort(t),
  54759. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54760. l[2 * s + 1] = i[1],
  54761. n[E] = !0,
  54762. s++)
  54763. }
  54764. for (p = new Float32Array(2 * s * 3),
  54765. c = 0,
  54766. h = s; c < h; c++)
  54767. for (d = 0; d < 2; d++) {
  54768. var _ = 6 * c + 3 * d
  54769. , b = l[2 * c + d];
  54770. p[_ + 0] = o.getX(b),
  54771. p[_ + 1] = o.getY(b),
  54772. p[_ + 2] = o.getZ(b)
  54773. }
  54774. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54775. } else {
  54776. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54777. for (p = new Float32Array(2 * s * 3),
  54778. c = 0,
  54779. h = w; c < h; c++)
  54780. for (d = 0; d < 3; d++) {
  54781. var T = 9 * c + 3 * d;
  54782. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54783. p[_ + 1] = o[1 + T],
  54784. p[_ + 2] = o[2 + T];
  54785. b = 9 * c + (d + 1) % 3 * 3;
  54786. p[_ + 3] = o[b],
  54787. p[_ + 4] = o[b + 1],
  54788. p[_ + 5] = o[b + 2]
  54789. }
  54790. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54791. }
  54792. }
  54793. ,
  54794. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54795. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54796. Ci.AxisHelper = function(e) {
  54797. e = e || 1;
  54798. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54799. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54800. , n = new Ci.BufferGeometry;
  54801. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54802. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54803. var r = new Ci.LineBasicMaterial({
  54804. vertexColors: Ci.VertexColors
  54805. });
  54806. Ci.LineSegments.call(this, n, r)
  54807. }
  54808. ,
  54809. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54810. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54811. Ci.ArrowHelper = function() {
  54812. var a = new Ci.Geometry;
  54813. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54814. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54815. return s.translate(0, -.5, 0),
  54816. function(e, t, i, n, r, o) {
  54817. Ci.Object3D.call(this),
  54818. void 0 === n && (n = 16776960),
  54819. void 0 === i && (i = 1),
  54820. void 0 === r && (r = .2 * i),
  54821. void 0 === o && (o = .2 * r),
  54822. this.position.copy(t),
  54823. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54824. color: n
  54825. })),
  54826. this.line.matrixAutoUpdate = !1,
  54827. this.add(this.line),
  54828. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54829. color: n
  54830. })),
  54831. this.cone.matrixAutoUpdate = !1,
  54832. this.add(this.cone),
  54833. this.setDirection(e),
  54834. this.setLength(i, r, o)
  54835. }
  54836. }(),
  54837. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54838. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54839. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54840. function(e) {
  54841. .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(),
  54842. yi = Math.acos(e.y),
  54843. this.quaternion.setFromAxisAngle(Ai, yi))
  54844. }
  54845. ),
  54846. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54847. void 0 === t && (t = .2 * e),
  54848. void 0 === i && (i = .2 * t),
  54849. this.line.scale.set(1, Math.max(0, e - t), 1),
  54850. this.line.updateMatrix(),
  54851. this.cone.scale.set(i, t, i),
  54852. this.cone.position.y = e,
  54853. this.cone.updateMatrix()
  54854. }
  54855. ,
  54856. Ci.ArrowHelper.prototype.setColor = function(e) {
  54857. this.line.material.color.set(e),
  54858. this.cone.material.color.set(e)
  54859. }
  54860. ,
  54861. Ci.BoxHelper = function(e) {
  54862. 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])
  54863. , i = new Float32Array(24)
  54864. , n = new Ci.BufferGeometry;
  54865. n.setIndex(new Ci.BufferAttribute(t,1)),
  54866. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54867. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54868. color: 16776960
  54869. })),
  54870. void 0 !== e && this.update(e)
  54871. }
  54872. ,
  54873. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54874. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54875. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54876. function(e) {
  54877. if (vi.setFromObject(e),
  54878. !vi.isEmpty()) {
  54879. var t = vi.min
  54880. , i = vi.max
  54881. , n = this.geometry.attributes.position
  54882. , r = n.array;
  54883. r[0] = i.x,
  54884. r[1] = i.y,
  54885. r[2] = i.z,
  54886. r[3] = t.x,
  54887. r[4] = i.y,
  54888. r[5] = i.z,
  54889. r[6] = t.x,
  54890. r[7] = t.y,
  54891. r[8] = i.z,
  54892. r[9] = i.x,
  54893. r[10] = t.y,
  54894. r[11] = i.z,
  54895. r[12] = i.x,
  54896. r[13] = i.y,
  54897. r[14] = t.z,
  54898. r[15] = t.x,
  54899. r[16] = i.y,
  54900. r[17] = t.z,
  54901. r[18] = t.x,
  54902. r[19] = t.y,
  54903. r[20] = t.z,
  54904. r[21] = i.x,
  54905. r[22] = t.y,
  54906. r[23] = t.z,
  54907. n.needsUpdate = !0,
  54908. this.geometry.computeBoundingSphere()
  54909. }
  54910. }
  54911. ),
  54912. Ci.BoundingBoxHelper = function(e, t) {
  54913. var i = void 0 !== t ? t : 8947848;
  54914. this.object = e,
  54915. this.box = new Ci.Box3,
  54916. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54917. color: i,
  54918. wireframe: !0
  54919. }))
  54920. }
  54921. ,
  54922. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54923. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54924. Ci.BoundingBoxHelper.prototype.update = function() {
  54925. this.box.setFromObject(this.object),
  54926. this.box.size(this.scale),
  54927. this.box.center(this.position)
  54928. }
  54929. ,
  54930. Ci.CameraHelper = function(e) {
  54931. function t(e, t, i) {
  54932. n(e, i),
  54933. n(t, i)
  54934. }
  54935. function n(e, t) {
  54936. i.vertices.push(new Ci.Vector3),
  54937. i.colors.push(new Ci.Color(t)),
  54938. void 0 === o[e] && (o[e] = []),
  54939. o[e].push(i.vertices.length - 1)
  54940. }
  54941. var i = new Ci.Geometry
  54942. , r = new Ci.LineBasicMaterial({
  54943. color: 16777215,
  54944. vertexColors: Ci.FaceColors
  54945. })
  54946. , o = {}
  54947. , a = 16755200
  54948. , s = 16711680
  54949. , l = 3355443;
  54950. t("n1", "n2", a),
  54951. t("n2", "n4", a),
  54952. t("n4", "n3", a),
  54953. t("n3", "n1", a),
  54954. t("f1", "f2", a),
  54955. t("f2", "f4", a),
  54956. t("f4", "f3", a),
  54957. t("f3", "f1", a),
  54958. t("n1", "f1", a),
  54959. t("n2", "f2", a),
  54960. t("n3", "f3", a),
  54961. t("n4", "f4", a),
  54962. t("p", "n1", s),
  54963. t("p", "n2", s),
  54964. t("p", "n3", s),
  54965. t("p", "n4", s),
  54966. t("u1", "u2", 43775),
  54967. t("u2", "u3", 43775),
  54968. t("u3", "u1", 43775),
  54969. t("c", "t", 16777215),
  54970. t("p", "c", l),
  54971. t("cn1", "cn2", l),
  54972. t("cn3", "cn4", l),
  54973. t("cf1", "cf2", l),
  54974. t("cf3", "cf4", l),
  54975. Ci.LineSegments.call(this, i, r),
  54976. this.camera = e,
  54977. this.camera.updateProjectionMatrix(),
  54978. this.matrix = e.matrixWorld,
  54979. this.matrixAutoUpdate = !1,
  54980. this.pointMap = o,
  54981. this.update()
  54982. }
  54983. ,
  54984. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54985. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54986. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54987. mi = new Ci.Camera,
  54988. function() {
  54989. pi = this.geometry,
  54990. fi = this.pointMap,
  54991. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54992. Ni("c", 0, 0, -1),
  54993. Ni("t", 0, 0, 1),
  54994. Ni("n1", -1, -1, -1),
  54995. Ni("n2", 1, -1, -1),
  54996. Ni("n3", -1, 1, -1),
  54997. Ni("n4", 1, 1, -1),
  54998. Ni("f1", -1, -1, 1),
  54999. Ni("f2", 1, -1, 1),
  55000. Ni("f3", -1, 1, 1),
  55001. Ni("f4", 1, 1, 1),
  55002. Ni("u1", .7, 1.1, -1),
  55003. Ni("u2", -.7, 1.1, -1),
  55004. Ni("u3", 0, 2, -1),
  55005. Ni("cf1", -1, 0, 1),
  55006. Ni("cf2", 1, 0, 1),
  55007. Ni("cf3", 0, -1, 1),
  55008. Ni("cf4", 0, 1, 1),
  55009. Ni("cn1", -1, 0, -1),
  55010. Ni("cn2", 1, 0, -1),
  55011. Ni("cn3", 0, -1, -1),
  55012. Ni("cn4", 0, 1, -1),
  55013. pi.verticesNeedUpdate = !0
  55014. }
  55015. ),
  55016. Ci.DirectionalLightHelper = function(e, t) {
  55017. Ci.Object3D.call(this),
  55018. this.light = e,
  55019. this.light.updateMatrixWorld(),
  55020. this.matrix = e.matrixWorld,
  55021. this.matrixAutoUpdate = !1,
  55022. t = t || 1;
  55023. var i = new Ci.Geometry;
  55024. 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));
  55025. var n = new Ci.LineBasicMaterial({
  55026. fog: !1
  55027. });
  55028. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55029. this.lightPlane = new Ci.Line(i,n),
  55030. this.add(this.lightPlane),
  55031. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  55032. (n = new Ci.LineBasicMaterial({
  55033. fog: !1
  55034. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55035. this.targetLine = new Ci.Line(i,n),
  55036. this.add(this.targetLine),
  55037. this.update()
  55038. }
  55039. ,
  55040. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55041. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  55042. Ci.DirectionalLightHelper.prototype.dispose = function() {
  55043. this.lightPlane.geometry.dispose(),
  55044. this.lightPlane.material.dispose(),
  55045. this.targetLine.geometry.dispose(),
  55046. this.targetLine.material.dispose()
  55047. }
  55048. ,
  55049. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  55050. ui = new Ci.Vector3,
  55051. di = new Ci.Vector3,
  55052. function() {
  55053. hi.setFromMatrixPosition(this.light.matrixWorld),
  55054. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  55055. di.subVectors(ui, hi),
  55056. this.lightPlane.lookAt(di),
  55057. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55058. this.targetLine.geometry.vertices[1].copy(di),
  55059. this.targetLine.geometry.verticesNeedUpdate = !0,
  55060. this.targetLine.material.color.copy(this.lightPlane.material.color)
  55061. }
  55062. ),
  55063. Ci.EdgesHelper = function(e, t, i) {
  55064. var n = void 0 !== t ? t : 16777215;
  55065. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  55066. color: n
  55067. })),
  55068. this.matrix = e.matrixWorld,
  55069. this.matrixAutoUpdate = !1
  55070. }
  55071. ,
  55072. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55073. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  55074. Ci.FaceNormalsHelper = function(e, t, i, n) {
  55075. this.object = e,
  55076. this.size = void 0 !== t ? t : 1;
  55077. var r = void 0 !== i ? i : 16776960
  55078. , o = void 0 !== n ? n : 1
  55079. , a = 0
  55080. , s = this.object.geometry;
  55081. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  55082. var l = new Ci.BufferGeometry
  55083. , c = new Ci.Float32Attribute(2 * a * 3,3);
  55084. l.addAttribute("position", c),
  55085. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  55086. color: r,
  55087. linewidth: o
  55088. })),
  55089. this.matrixAutoUpdate = !1,
  55090. this.update()
  55091. }
  55092. ,
  55093. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55094. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  55095. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  55096. li = new Ci.Vector3,
  55097. ci = new Ci.Matrix3,
  55098. function() {
  55099. this.object.updateMatrixWorld(!0),
  55100. ci.getNormalMatrix(this.object.matrixWorld);
  55101. 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++) {
  55102. var l = r[a]
  55103. , c = l.normal;
  55104. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  55105. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  55106. t.setXYZ(o, si.x, si.y, si.z),
  55107. o += 1,
  55108. t.setXYZ(o, li.x, li.y, li.z),
  55109. o += 1
  55110. }
  55111. return t.needsUpdate = !0,
  55112. this
  55113. }
  55114. ),
  55115. Ci.GridHelper = function(e, t) {
  55116. var i = new Ci.Geometry
  55117. , n = new Ci.LineBasicMaterial({
  55118. vertexColors: Ci.VertexColors
  55119. });
  55120. this.color1 = new Ci.Color(4473924),
  55121. this.color2 = new Ci.Color(8947848);
  55122. for (var r = -e; r <= e; r += t) {
  55123. 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));
  55124. var o = 0 === r ? this.color1 : this.color2;
  55125. i.colors.push(o, o, o, o)
  55126. }
  55127. Ci.LineSegments.call(this, i, n)
  55128. }
  55129. ,
  55130. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55131. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  55132. Ci.GridHelper.prototype.setColors = function(e, t) {
  55133. this.color1.set(e),
  55134. this.color2.set(t),
  55135. this.geometry.colorsNeedUpdate = !0
  55136. }
  55137. ,
  55138. Ci.HemisphereLightHelper = function(e, t) {
  55139. Ci.Object3D.call(this),
  55140. this.light = e,
  55141. this.light.updateMatrixWorld(),
  55142. this.matrix = e.matrixWorld,
  55143. this.matrixAutoUpdate = !1,
  55144. this.colors = [new Ci.Color, new Ci.Color];
  55145. var i = new Ci.SphereGeometry(t,4,2);
  55146. i.rotateX(-Math.PI / 2);
  55147. for (var n = 0; n < 8; n++)
  55148. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  55149. var r = new Ci.MeshBasicMaterial({
  55150. vertexColors: Ci.FaceColors,
  55151. wireframe: !0
  55152. });
  55153. this.lightSphere = new Ci.Mesh(i,r),
  55154. this.add(this.lightSphere),
  55155. this.update()
  55156. }
  55157. ,
  55158. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55159. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  55160. Ci.HemisphereLightHelper.prototype.dispose = function() {
  55161. this.lightSphere.geometry.dispose(),
  55162. this.lightSphere.material.dispose()
  55163. }
  55164. ,
  55165. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  55166. function() {
  55167. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  55168. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  55169. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  55170. this.lightSphere.geometry.colorsNeedUpdate = !0
  55171. }
  55172. ),
  55173. Ci.PointLightHelper = function(e, t) {
  55174. this.light = e,
  55175. this.light.updateMatrixWorld();
  55176. var i = new Ci.SphereGeometry(t,4,2)
  55177. , n = new Ci.MeshBasicMaterial({
  55178. wireframe: !0,
  55179. fog: !1
  55180. });
  55181. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55182. Ci.Mesh.call(this, i, n),
  55183. this.matrix = this.light.matrixWorld,
  55184. this.matrixAutoUpdate = !1
  55185. }
  55186. ,
  55187. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  55188. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  55189. Ci.PointLightHelper.prototype.dispose = function() {
  55190. this.geometry.dispose(),
  55191. this.material.dispose()
  55192. }
  55193. ,
  55194. Ci.PointLightHelper.prototype.update = function() {
  55195. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55196. }
  55197. ,
  55198. Ci.SkeletonHelper = function(e) {
  55199. this.bones = this.getBoneList(e);
  55200. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  55201. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  55202. t.vertices.push(new Ci.Vector3),
  55203. t.colors.push(new Ci.Color(0,0,1)),
  55204. t.colors.push(new Ci.Color(0,1,0)))
  55205. }
  55206. t.dynamic = !0;
  55207. var n = new Ci.LineBasicMaterial({
  55208. vertexColors: Ci.VertexColors,
  55209. depthTest: !1,
  55210. depthWrite: !1,
  55211. transparent: !0
  55212. });
  55213. Ci.LineSegments.call(this, t, n),
  55214. this.root = e,
  55215. this.matrix = e.matrixWorld,
  55216. this.matrixAutoUpdate = !1,
  55217. this.update()
  55218. }
  55219. ,
  55220. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55221. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  55222. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  55223. var t = [];
  55224. e instanceof Ci.Bone && t.push(e);
  55225. for (var i = 0; i < e.children.length; i++)
  55226. t.push.apply(t, this.getBoneList(e.children[i]));
  55227. return t
  55228. }
  55229. ,
  55230. Ci.SkeletonHelper.prototype.update = function() {
  55231. 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++) {
  55232. var o = this.bones[r];
  55233. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  55234. e.vertices[n].setFromMatrixPosition(i),
  55235. i.multiplyMatrices(t, o.parent.matrixWorld),
  55236. e.vertices[n + 1].setFromMatrixPosition(i),
  55237. n += 2)
  55238. }
  55239. e.verticesNeedUpdate = !0,
  55240. e.computeBoundingSphere()
  55241. }
  55242. ,
  55243. Ci.SpotLightHelper = function(e) {
  55244. Ci.Object3D.call(this),
  55245. this.light = e,
  55246. this.light.updateMatrixWorld(),
  55247. this.matrix = e.matrixWorld,
  55248. this.matrixAutoUpdate = !1;
  55249. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  55250. t.translate(0, -.5, 0),
  55251. t.rotateX(-Math.PI / 2);
  55252. var i = new Ci.MeshBasicMaterial({
  55253. wireframe: !0,
  55254. fog: !1
  55255. });
  55256. this.cone = new Ci.Mesh(t,i),
  55257. this.add(this.cone),
  55258. this.update()
  55259. }
  55260. ,
  55261. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55262. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  55263. Ci.SpotLightHelper.prototype.dispose = function() {
  55264. this.cone.geometry.dispose(),
  55265. this.cone.material.dispose()
  55266. }
  55267. ,
  55268. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  55269. oi = new Ci.Vector3,
  55270. function() {
  55271. var e = this.light.distance ? this.light.distance : 1e4
  55272. , t = e * Math.tan(this.light.angle);
  55273. this.cone.scale.set(t, t, e),
  55274. ri.setFromMatrixPosition(this.light.matrixWorld),
  55275. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  55276. this.cone.lookAt(oi.sub(ri)),
  55277. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55278. }
  55279. ),
  55280. Ci.VertexNormalsHelper = function(e, t, i, n) {
  55281. this.object = e,
  55282. this.size = void 0 !== t ? t : 1;
  55283. var r = void 0 !== i ? i : 16711680
  55284. , o = void 0 !== n ? n : 1
  55285. , a = 0
  55286. , s = this.object.geometry;
  55287. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  55288. var l = new Ci.BufferGeometry
  55289. , c = new Ci.Float32Attribute(2 * a * 3,3);
  55290. l.addAttribute("position", c),
  55291. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  55292. color: r,
  55293. linewidth: o
  55294. })),
  55295. this.matrixAutoUpdate = !1,
  55296. this.update()
  55297. }
  55298. ,
  55299. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55300. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  55301. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  55302. ii = new Ci.Vector3,
  55303. ni = new Ci.Matrix3,
  55304. function() {
  55305. var e = ["a", "b", "c"];
  55306. this.object.updateMatrixWorld(!0),
  55307. ni.getNormalMatrix(this.object.matrixWorld);
  55308. var t = this.object.matrixWorld
  55309. , i = this.geometry.attributes.position
  55310. , n = this.object.geometry;
  55311. if (n instanceof Ci.Geometry)
  55312. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  55313. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  55314. var d = r[c[e[h]]]
  55315. , p = c.vertexNormals[h];
  55316. ti.copy(d).applyMatrix4(t),
  55317. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55318. i.setXYZ(a, ti.x, ti.y, ti.z),
  55319. a += 1,
  55320. i.setXYZ(a, ii.x, ii.y, ii.z),
  55321. a += 1
  55322. }
  55323. else if (n instanceof Ci.BufferGeometry) {
  55324. var f = n.attributes.position
  55325. , g = n.attributes.normal;
  55326. for (h = a = 0,
  55327. u = f.count; h < u; h++)
  55328. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  55329. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  55330. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55331. i.setXYZ(a, ti.x, ti.y, ti.z),
  55332. a += 1,
  55333. i.setXYZ(a, ii.x, ii.y, ii.z),
  55334. a += 1
  55335. }
  55336. return i.needsUpdate = !0,
  55337. this
  55338. }
  55339. ),
  55340. Ci.WireframeHelper = function(e, t) {
  55341. var i = void 0 !== t ? t : 16777215;
  55342. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  55343. color: i
  55344. })),
  55345. this.matrix = e.matrixWorld,
  55346. this.matrixAutoUpdate = !1
  55347. }
  55348. ,
  55349. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55350. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  55351. Ci.ImmediateRenderObject = function(e) {
  55352. Ci.Object3D.call(this),
  55353. this.material = e,
  55354. this.render = function(e) {}
  55355. }
  55356. ,
  55357. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  55358. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  55359. Ci.MorphBlendMesh = function(e, t) {
  55360. Ci.Mesh.call(this, e, t),
  55361. this.animationsMap = {},
  55362. this.animationsList = [];
  55363. var i = this.geometry.morphTargets.length
  55364. , n = i - 1
  55365. , r = i / 1;
  55366. this.createAnimation("__default", 0, n, r),
  55367. this.setAnimationWeight("__default", 1)
  55368. }
  55369. ,
  55370. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  55371. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  55372. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55373. var r = {
  55374. start: t,
  55375. end: i,
  55376. length: i - t + 1,
  55377. fps: n,
  55378. duration: (i - t) / n,
  55379. lastFrame: 0,
  55380. currentFrame: 0,
  55381. active: !1,
  55382. time: 0,
  55383. direction: 1,
  55384. weight: 1,
  55385. directionBackwards: !1,
  55386. mirroredLoop: !1
  55387. };
  55388. this.animationsMap[e] = r,
  55389. this.animationsList.push(r)
  55390. }
  55391. ,
  55392. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55393. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55394. var s = r.morphTargets[o].name.match(i);
  55395. if (s && 1 < s.length)
  55396. n[l = s[1]] || (n[l] = {
  55397. start: 1 / 0,
  55398. end: -1 / 0
  55399. }),
  55400. o < (c = n[l]).start && (c.start = o),
  55401. o > c.end && (c.end = o),
  55402. t = t || l
  55403. }
  55404. for (var l in n) {
  55405. var c = n[l];
  55406. this.createAnimation(l, c.start, c.end, e)
  55407. }
  55408. this.firstAnimation = t
  55409. }
  55410. ,
  55411. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55412. var t = this.animationsMap[e];
  55413. t && (t.direction = 1,
  55414. t.directionBackwards = !1)
  55415. }
  55416. ,
  55417. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55418. var t = this.animationsMap[e];
  55419. t && (t.direction = -1,
  55420. t.directionBackwards = !0)
  55421. }
  55422. ,
  55423. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55424. var i = this.animationsMap[e];
  55425. i && (i.fps = t,
  55426. i.duration = (i.end - i.start) / i.fps)
  55427. }
  55428. ,
  55429. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55430. var i = this.animationsMap[e];
  55431. i && (i.duration = t,
  55432. i.fps = (i.end - i.start) / i.duration)
  55433. }
  55434. ,
  55435. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55436. var i = this.animationsMap[e];
  55437. i && (i.weight = t)
  55438. }
  55439. ,
  55440. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55441. var i = this.animationsMap[e];
  55442. i && (i.time = t)
  55443. }
  55444. ,
  55445. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55446. var t = 0
  55447. , i = this.animationsMap[e];
  55448. return i && (t = i.time),
  55449. t
  55450. }
  55451. ,
  55452. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55453. var t = -1
  55454. , i = this.animationsMap[e];
  55455. return i && (t = i.duration),
  55456. t
  55457. }
  55458. ,
  55459. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  55460. var t = this.animationsMap[e];
  55461. t ? (t.time = 0,
  55462. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55463. }
  55464. ,
  55465. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55466. var t = this.animationsMap[e];
  55467. t && (t.active = !1)
  55468. }
  55469. ,
  55470. Ci.MorphBlendMesh.prototype.update = function(e) {
  55471. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55472. var n = this.animationsList[t];
  55473. if (n.active) {
  55474. var r = n.duration / n.length;
  55475. n.time += n.direction * e,
  55476. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  55477. n.time > n.duration && (n.time = n.duration,
  55478. n.directionBackwards = !0),
  55479. n.time < 0 && (n.time = 0,
  55480. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  55481. n.time < 0 && (n.time += n.duration));
  55482. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  55483. , a = n.weight;
  55484. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  55485. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  55486. this.morphTargetInfluences[o] = 0,
  55487. n.lastFrame = n.currentFrame,
  55488. n.currentFrame = o);
  55489. var s = n.time % r / r;
  55490. n.directionBackwards && (s = 1 - s),
  55491. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55492. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55493. }
  55494. }
  55495. }
  55496. ,
  55497. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55498. i.THREE = Ci) : this.THREE = Ci
  55499. window.THREE = Ci
  55500. getObjLoader()
  55501. }
  55502. , {}]
  55503. }, {}, [116]);